Commit a1a828dd authored by zhangsen's avatar zhangsen

中心级优化项

parent 38ea4de3
...@@ -29,6 +29,8 @@ public interface DataDictionaryMapper extends BaseMapper<DataDictionary> { ...@@ -29,6 +29,8 @@ public interface DataDictionaryMapper extends BaseMapper<DataDictionary> {
* @return * @return
*/ */
public DataDictionary getByCode(String code,String type); public DataDictionary getByCode(String code,String type);
public DataDictionary getByType(@Param("type") String type);
public List<DataDictionary> getFireTeamTypeTree(String bizOrgCode); public List<DataDictionary> getFireTeamTypeTree(String bizOrgCode);
......
...@@ -116,6 +116,13 @@ WHERE ...@@ -116,6 +116,13 @@ WHERE
cdd.type = 'XFSYLX' cdd.type = 'XFSYLX'
</select> </select>
<select id="getByType" resultType="com.yeejoin.amos.boot.biz.common.entity.DataDictionary">
SELECT
*
FROM
cb_data_dictionary cbb
WHERE
cbb.is_delete = 0 and cbb.type = #{type}
</select>
</mapper> </mapper>
...@@ -625,33 +625,31 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -625,33 +625,31 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
// 2021-09-16 // 2021-09-16
if (null != t.get("amosOrgId") && StringUtils.isNotEmpty(t.get("amosOrgId").toString())) { if (null != t.get("amosOrgId") && StringUtils.isNotEmpty(t.get("amosOrgId").toString())) {
amosIds.add(t.get("amosOrgId").toString()); amosIds.add(t.get("amosOrgId").toString());
String chargePersonId = iOrgUsrService.getIdNumberByAmosId(t.get("amosOrgId").toString()); if (!ObjectUtils.isEmpty(t.get("certificateTypeValue")) && "120".equals(t.get("certificateTypeValue").toString())) {
t.put("chargePersonId", chargePersonId); t.put("chargePersonId", t.get("certificatesNumber"));
}
} else { } else {
t.put("chargePersonId", null); t.put("chargePersonId", null);
} }
if (!ObjectUtils.isEmpty(t.get("state"))) {
DataDictionary gwmc = dataDictionaryService.getByCode(t.get("state").toString(), "RYZT");
if (!ObjectUtils.isEmpty(gwmc)) {
t.put("stateName", gwmc.getName());
} else {
t.put("stateName", t.get("state"));
}
}
}); });
List<DataDictionary> dictList = dataDictionaryService.getByType("RYZT");
Map<String, String> dictMap = dictList.stream().collect(Collectors.toMap(DataDictionary::getCode, DataDictionary::getName));
Map<String, AgencyUserModel> collect = new HashMap<>();
if (CollectionUtils.isNotEmpty(amosIds)) { if (CollectionUtils.isNotEmpty(amosIds)) {
String join = String.join(",", amosIds); String join = String.join(",", amosIds);
List<AgencyUserModel> amosUser = Privilege.agencyUserClient.queryByIds(join, false).getResult(); List<AgencyUserModel> amosUser = Privilege.agencyUserClient.queryByIds(join, false).getResult();
Map<String, AgencyUserModel> collect = amosUser.stream().collect(Collectors.toMap(AgencyUserModel::getUserId, t -> t)); collect = amosUser.stream().collect(Collectors.toMap(AgencyUserModel::getUserId, t -> t));
list.stream().forEach(t -> {
if (null != t.get("amosOrgId") && StringUtils.isNotEmpty(t.get("amosOrgId").toString()) && collect.containsKey(t.get("amosOrgId").toString())) {
t.put("amosOrgCode", collect.get(t.get("amosOrgId").toString()).getRealName());
}
});
} }
Map<String, AgencyUserModel> finalCollect = collect;
list.forEach(t -> {
if (!ObjectUtils.isEmpty(finalCollect) && null != t.get("amosOrgId") && StringUtils.isNotEmpty(t.get("amosOrgId").toString()) && finalCollect.containsKey(t.get("amosOrgId").toString())) {
t.put("amosOrgCode", finalCollect.get(t.get("amosOrgId").toString()).getRealName());
}
if (!ObjectUtils.isEmpty(t.get("state"))) {
t.put("stateName", dictMap.getOrDefault(t.get("state").toString(), t.get("state").toString()));
}
});
if(!positionType.equals("")) { if(!positionType.equals("")) {
String positionTypeFine = positionType; String positionTypeFine = positionType;
list = list.stream().filter(e-> !ObjectUtils.isEmpty(e.get("positionType")) && String.valueOf(e.get("positionType")).contains(positionTypeFine)).collect(Collectors.toList()); list = list.stream().filter(e-> !ObjectUtils.isEmpty(e.get("positionType")) && String.valueOf(e.get("positionType")).contains(positionTypeFine)).collect(Collectors.toList());
...@@ -721,41 +719,38 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -721,41 +719,38 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
List<Map<String, Object>> list = this.baseMapper.selectPersonList(map); List<Map<String, Object>> list = this.baseMapper.selectPersonList(map);
//处理循环中的远程调用(原有逻辑不变) //处理循环中的远程调用(原有逻辑不变)
List<String> amosIds = new ArrayList<>(); List<String> amosIds = new ArrayList<>();
list.stream().forEach(t -> { list.forEach(t -> {
// BUG2886 因为前期沟通 人员code 可能会发生改变 所以 现在接口code 不再保存,查询数据时通过接口重新赋值 by kongfm // BUG2886 因为前期沟通 人员code 可能会发生改变 所以 现在接口code 不再保存,查询数据时通过接口重新赋值 by kongfm
// 2021-09-16 // 2021-09-16
if (null != t.get("amosOrgId") && StringUtils.isNotEmpty(t.get("amosOrgId").toString())) { if (null != t.get("amosOrgId") && StringUtils.isNotEmpty(t.get("amosOrgId").toString())) {
amosIds.add(t.get("amosOrgId").toString()); amosIds.add(t.get("amosOrgId").toString());
if (!ObjectUtils.isEmpty(t.get("certificateTypeValue")) && "120".equals(t.get("certificateTypeValue").toString())) {
String chargePersonId = iOrgUsrService.getIdNumberByAmosId(t.get("amosOrgId").toString()); t.put("chargePersonId", t.get("certificatesNumber"));
t.put("chargePersonId", chargePersonId); }
} else { } else {
t.put("chargePersonId", null); t.put("chargePersonId", null);
} }
if (!ObjectUtils.isEmpty(t.get("state"))) {
DataDictionary gwmc = dataDictionaryService.getByCode(t.get("state").toString(), "RYZT");
if (!ObjectUtils.isEmpty(gwmc)) {
t.put("stateName", gwmc.getName());
} else {
t.put("stateName", t.get("state"));
}
}
}); });
List<DataDictionary> dictList = dataDictionaryService.getByType("RYZT");
Map<String, String> dictMap = dictList.stream().collect(Collectors.toMap(DataDictionary::getCode, DataDictionary::getName));
Map<String, AgencyUserModel> collect = new HashMap<>();
if (CollectionUtils.isNotEmpty(amosIds)) { if (CollectionUtils.isNotEmpty(amosIds)) {
String join = String.join(",", amosIds); String join = String.join(",", amosIds);
List<AgencyUserModel> amosUser = Privilege.agencyUserClient.queryByIds(join, false).getResult(); List<AgencyUserModel> amosUser = Privilege.agencyUserClient.queryByIds(join, false).getResult();
Map<String, AgencyUserModel> collect = amosUser.stream().collect(Collectors.toMap(AgencyUserModel::getUserId, t -> t)); collect = amosUser.stream().collect(Collectors.toMap(AgencyUserModel::getUserId, t -> t));
list.stream().forEach(t -> { }
if (null != t.get("amosOrgId") && StringUtils.isNotEmpty(t.get("amosOrgId").toString()) && collect.containsKey(t.get("amosOrgId").toString())) { Map<String, AgencyUserModel> finalCollect = collect;
t.put("amosOrgCode", collect.get(t.get("amosOrgId").toString()).getRealName()); list.forEach(t -> {
if (!ObjectUtils.isEmpty(finalCollect) && null != t.get("amosOrgId") && StringUtils.isNotEmpty(t.get("amosOrgId").toString()) && finalCollect.containsKey(t.get("amosOrgId").toString())) {
t.put("amosOrgCode", finalCollect.get(t.get("amosOrgId").toString()).getRealName());
}
if (!ObjectUtils.isEmpty(t.get("state"))) {
t.put("stateName", dictMap.getOrDefault(t.get("state").toString(), t.get("state").toString()));
} }
}); });
}
/* Bug2652 根据名字和工号模糊查询失效 已添加模糊匹配 2021-09-01 陈召 结束 */ /* Bug2652 根据名字和工号模糊查询失效 已添加模糊匹配 2021-09-01 陈召 结束 */
pageBean.setRecords(list); pageBean.setRecords(list);
return pageBean; return pageBean;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment