|
|
@@ -24,7 +24,6 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.bind.annotation.ResponseStatus;
|
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
-import com.uas.platform.b2b.core.util.SearchKeyUtils;
|
|
|
import com.uas.platform.b2b.model.Attach;
|
|
|
import com.uas.platform.b2b.model.Enterprise;
|
|
|
import com.uas.platform.b2b.model.FileUpload;
|
|
|
@@ -58,7 +57,7 @@ public class PublicQueryController {
|
|
|
|
|
|
@Autowired
|
|
|
private MonthProdioService monthProdIoService;
|
|
|
-
|
|
|
+
|
|
|
@Autowired
|
|
|
private AttachService attachService;
|
|
|
|
|
|
@@ -71,21 +70,17 @@ public class PublicQueryController {
|
|
|
@RequestMapping(value = "/members", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
@ResponseStatus(value = HttpStatus.OK)
|
|
|
- public ModelMap queryEnterprise(String name, String shortName, Long uu)
|
|
|
- throws UnsupportedEncodingException {
|
|
|
+ public ModelMap queryEnterprise(String name, String shortName, Long uu) throws UnsupportedEncodingException {
|
|
|
ModelMap returnMap = new ModelMap();
|
|
|
if (!StringUtils.isEmpty(name)) {
|
|
|
- List<Enterprise> enterprises = enterpriseService
|
|
|
- .findByName(SearchKeyUtils.decodeURL(name));
|
|
|
+ List<Enterprise> enterprises = enterpriseService.findByName(name);
|
|
|
if (!CollectionUtils.isEmpty(enterprises))
|
|
|
returnMap.put("name", QueriableMember.getMembers(enterprises));
|
|
|
}
|
|
|
if (!StringUtils.isEmpty(shortName)) {
|
|
|
- Set<Enterprise> enterprises = enterpriseService
|
|
|
- .findByShortName(SearchKeyUtils.decodeURL(shortName));
|
|
|
+ Set<Enterprise> enterprises = enterpriseService.findByShortName(shortName);
|
|
|
if (!CollectionUtils.isEmpty(enterprises))
|
|
|
- returnMap.put("shortName",
|
|
|
- QueriableMember.getMembers(enterprises));
|
|
|
+ returnMap.put("shortName", QueriableMember.getMembers(enterprises));
|
|
|
}
|
|
|
if (uu != null) {
|
|
|
Enterprise enterprise = enterpriseService.findById(uu);
|
|
|
@@ -103,12 +98,9 @@ public class PublicQueryController {
|
|
|
*/
|
|
|
@RequestMapping(value = "/batch/members", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public Map<String, Object> queryEnterprises(
|
|
|
- @RequestParam("data") String data)
|
|
|
- throws UnsupportedEncodingException {
|
|
|
+ public Map<String, Object> queryEnterprises(@RequestParam("data") String data) throws UnsupportedEncodingException {
|
|
|
if (!StringUtils.isEmpty(data)) {
|
|
|
List<String> accounts = null;
|
|
|
- data = SearchKeyUtils.decodeURL(data);
|
|
|
// 多个
|
|
|
if (data.startsWith("[")) {
|
|
|
accounts = FlexJsonUtils.fromJsonArray(data, String.class);
|
|
|
@@ -116,8 +108,7 @@ public class PublicQueryController {
|
|
|
accounts = new ArrayList<String>();
|
|
|
accounts.add(FlexJsonUtils.fromJson(data, String.class));
|
|
|
}
|
|
|
- List<Object[]> backInfo = enterpriseService
|
|
|
- .findByEnNames(accounts);
|
|
|
+ List<Object[]> backInfo = enterpriseService.findByEnNames(accounts);
|
|
|
System.out.println(FlexJsonUtils.toJson(backInfo));
|
|
|
Map<String, Object> infos = new HashMap<String, Object>();
|
|
|
for (Object[] objs : backInfo) {
|
|
|
@@ -151,8 +142,7 @@ public class PublicQueryController {
|
|
|
@RequestMapping(value = "/members/{enUU}/users/{userUU}", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
@ResponseStatus(value = HttpStatus.OK)
|
|
|
- public QueriableUser getUser(@PathVariable("enUU") Long enUU,
|
|
|
- @PathVariable("userUU") Long userUU) {
|
|
|
+ public QueriableUser getUser(@PathVariable("enUU") Long enUU, @PathVariable("userUU") Long userUU) {
|
|
|
User user = userService.findUserByEnUUAndUserUU(enUU, userUU);
|
|
|
if (user != null)
|
|
|
return new QueriableUser(user);
|
|
|
@@ -173,12 +163,11 @@ public class PublicQueryController {
|
|
|
|
|
|
@RequestMapping(value = "/search", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public JSONObject getMonthProdio(Long month, String brand, String vendor,
|
|
|
- String date) {
|
|
|
- JSONObject json = monthProdIoService.getMonthProdio(month, brand,
|
|
|
- vendor, date);
|
|
|
+ public JSONObject getMonthProdio(Long month, String brand, String vendor, String date) {
|
|
|
+ JSONObject json = monthProdIoService.getMonthProdio(month, brand, vendor, date);
|
|
|
return json;
|
|
|
}
|
|
|
+
|
|
|
/**
|
|
|
* 验证ERP注册信息
|
|
|
*/
|
|
|
@@ -192,11 +181,11 @@ public class PublicQueryController {
|
|
|
map.put("bussinessCode", enterpriseService.bussinessCodeEnable(enter.getEnBussinessCode()));
|
|
|
return map;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
/**
|
|
|
* 注册新企业用户
|
|
|
*/
|
|
|
- @RequestMapping(value="/erpRegister", method = RequestMethod.POST)
|
|
|
+ @RequestMapping(value = "/erpRegister", method = RequestMethod.POST)
|
|
|
public @ResponseBody ResponseEntity<ModelMap> register(String enterprise, FileUpload uploadItem, Boolean isSaas) {
|
|
|
HttpHeaders headers = new HttpHeaders();
|
|
|
headers.add("Content-Type", "application/json; charset=utf-8");
|