|
|
@@ -72,7 +72,8 @@ public class PublicQueryController {
|
|
|
@ResponseStatus(value = HttpStatus.OK)
|
|
|
public ModelMap queryEnterprise(String name, String shortName, Long uu) throws UnsupportedEncodingException {
|
|
|
ModelMap returnMap = new ModelMap();
|
|
|
- if (!StringUtils.isEmpty(name)) { List<Enterprise> enterprises = enterpriseService.findByName(name);
|
|
|
+ if (!StringUtils.isEmpty(name)) {
|
|
|
+ List<Enterprise> enterprises = enterpriseService.findByName(name);
|
|
|
if (!CollectionUtils.isEmpty(enterprises)) {
|
|
|
returnMap.put("name", QueriableMember.getMembers(enterprises));
|
|
|
}
|
|
|
@@ -107,21 +108,21 @@ public class PublicQueryController {
|
|
|
if (data.startsWith("[")) {
|
|
|
accounts = FlexJsonUtils.fromJsonArray(data, String.class);
|
|
|
} else {// 单个
|
|
|
- accounts = new ArrayList<String>();
|
|
|
+ accounts = new ArrayList<>();
|
|
|
// 存在纯数字的情况,这个地方不用FlexJsonUtils转换
|
|
|
accounts.add(data);
|
|
|
}
|
|
|
List<Object[]> backInfo = enterpriseService.findByEnNames(accounts);
|
|
|
- Map<String, Object> infos = new HashMap<String, Object>();
|
|
|
- Map<String, Map<String, Object>> map = new HashMap<>();
|
|
|
- for (Object[] objs : backInfo) {
|
|
|
- infos.put("uu", objs[0]);
|
|
|
- infos.put("businessCode", objs[2]);
|
|
|
- infos.put("address", objs[3]);
|
|
|
- infos.put("corporation", objs[4]);
|
|
|
- map.put(objs[1].toString(), infos);
|
|
|
- }
|
|
|
- return map;
|
|
|
+ Map<String, Map<String, Object>> resultMap = new HashMap<>(1);
|
|
|
+ backInfo.forEach(info -> {
|
|
|
+ Map<String, Object> infoMap = new HashMap<>(4);
|
|
|
+ infoMap.put("uu", info[0]);
|
|
|
+ infoMap.put("businessCode", info[2]);
|
|
|
+ infoMap.put("address", info[3]);
|
|
|
+ infoMap.put("corporation", info[4]);
|
|
|
+ resultMap.put(info[1].toString(), infoMap);
|
|
|
+ });
|
|
|
+ return resultMap;
|
|
|
}
|
|
|
return null;
|
|
|
}
|