|
|
@@ -25,6 +25,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.ResponseBody;
|
|
|
import org.springframework.web.bind.annotation.ResponseStatus;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.uas.platform.b2b.dao.EnterpriseDao;
|
|
|
import com.uas.platform.b2b.dao.UserDao;
|
|
|
@@ -127,6 +128,7 @@ public class PublicQueryController {
|
|
|
accounts.add(FlexJsonUtils.fromJson(data, String.class));
|
|
|
}
|
|
|
List<Object[]> backInfo = enterpriseService.findByEnNames(accounts);
|
|
|
+ System.out.println(JSON.toJSON(backInfo));
|
|
|
Map<String, Object> infos = new HashMap<String, Object>();
|
|
|
for (Object[] objs : backInfo) {
|
|
|
infos.put(objs[1].toString(), objs[0]);
|
|
|
@@ -447,4 +449,36 @@ public class PublicQueryController {
|
|
|
infos.put("error", error);
|
|
|
return infos;
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 按企业名称查企业UU号,全名匹配
|
|
|
+ *
|
|
|
+ * @return
|
|
|
+ * @throws UnsupportedEncodingException
|
|
|
+ */
|
|
|
+ @RequestMapping(value = "/batch/getEnByName", method = RequestMethod.GET)
|
|
|
+ @ResponseBody
|
|
|
+ public List<ModelMap> getEnterprises(@RequestParam("data") String data) throws UnsupportedEncodingException {
|
|
|
+ if (!StringUtils.isEmpty(data)) {
|
|
|
+ List<String> accounts = null;
|
|
|
+ // data = URLDecoder.decode(data, "UTF-8");
|
|
|
+ // 多个
|
|
|
+ if (data.startsWith("[")) {
|
|
|
+ accounts = FlexJsonUtils.fromJsonArray(data, String.class);
|
|
|
+ } else {// 单个
|
|
|
+ accounts = new ArrayList<String>();
|
|
|
+ accounts.add(FlexJsonUtils.fromJson(data, String.class));
|
|
|
+ }
|
|
|
+ List<Enterprise> ens = enterpriseService.findByNames(accounts);
|
|
|
+ List<ModelMap> maps = new ArrayList<ModelMap>();
|
|
|
+ for (Enterprise en : ens) {
|
|
|
+ ModelMap map = new ModelMap();
|
|
|
+ map.put("FName", en.getEnName());
|
|
|
+ map.put("FUU", en.getUu());
|
|
|
+ maps.add(map);
|
|
|
+ }
|
|
|
+ return maps;
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
}
|