Commit a1a828dd authored by zhangsen's avatar zhangsen

中心级优化项

parent 38ea4de3
......@@ -30,6 +30,8 @@ public interface DataDictionaryMapper extends BaseMapper<DataDictionary> {
*/
public DataDictionary getByCode(String code,String type);
public DataDictionary getByType(@Param("type") String type);
public List<DataDictionary> getFireTeamTypeTree(String bizOrgCode);
public List<DataDictionary> getwaterResourceTypeTree(String bizOrgCode);
......
......@@ -117,5 +117,12 @@ WHERE
</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>
......@@ -625,33 +625,31 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
// 2021-09-16
if (null != t.get("amosOrgId") && StringUtils.isNotEmpty(t.get("amosOrgId").toString())) {
amosIds.add(t.get("amosOrgId").toString());
String chargePersonId = iOrgUsrService.getIdNumberByAmosId(t.get("amosOrgId").toString());
t.put("chargePersonId", chargePersonId);
} else {
t.put("chargePersonId", null);
if (!ObjectUtils.isEmpty(t.get("certificateTypeValue")) && "120".equals(t.get("certificateTypeValue").toString())) {
t.put("chargePersonId", t.get("certificatesNumber"));
}
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"));
}
t.put("chargePersonId", null);
}
});
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)) {
String join = String.join(",", amosIds);
List<AgencyUserModel> amosUser = Privilege.agencyUserClient.queryByIds(join, false).getResult();
Map<String, AgencyUserModel> 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());
collect = amosUser.stream().collect(Collectors.toMap(AgencyUserModel::getUserId, t -> t));
}
});
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("")) {
String positionTypeFine = positionType;
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
List<Map<String, Object>> list = this.baseMapper.selectPersonList(map);
//处理循环中的远程调用(原有逻辑不变)
List<String> amosIds = new ArrayList<>();
list.stream().forEach(t -> {
list.forEach(t -> {
// BUG2886 因为前期沟通 人员code 可能会发生改变 所以 现在接口code 不再保存,查询数据时通过接口重新赋值 by kongfm
// 2021-09-16
if (null != t.get("amosOrgId") && StringUtils.isNotEmpty(t.get("amosOrgId").toString())) {
amosIds.add(t.get("amosOrgId").toString());
String chargePersonId = iOrgUsrService.getIdNumberByAmosId(t.get("amosOrgId").toString());
t.put("chargePersonId", chargePersonId);
} else {
t.put("chargePersonId", null);
if (!ObjectUtils.isEmpty(t.get("certificateTypeValue")) && "120".equals(t.get("certificateTypeValue").toString())) {
t.put("chargePersonId", t.get("certificatesNumber"));
}
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"));
}
t.put("chargePersonId", null);
}
});
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)) {
String join = String.join(",", amosIds);
List<AgencyUserModel> amosUser = Privilege.agencyUserClient.queryByIds(join, false).getResult();
Map<String, AgencyUserModel> 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());
collect = amosUser.stream().collect(Collectors.toMap(AgencyUserModel::getUserId, t -> t));
}
});
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()));
}
});
/* Bug2652 根据名字和工号模糊查询失效 已添加模糊匹配 2021-09-01 陈召 结束 */
pageBean.setRecords(list);
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