|
|
@ -53,8 +53,6 @@ import java.util.Map; |
|
|
|
@Service |
|
|
|
public class ReportPartyServiceImpl extends BaseServiceImpl<ReportPartyDao, ReportPartyEntity> implements ReportPartyService { |
|
|
|
|
|
|
|
private static final Long screenDeptId = 1175270520603930625L; |
|
|
|
|
|
|
|
@Resource |
|
|
|
private AdminFeignClient adminFeignClient; |
|
|
|
|
|
|
@ -109,11 +107,34 @@ public class ReportPartyServiceImpl extends BaseServiceImpl<ReportPartyDao, Repo |
|
|
|
if (StringUtils.isNotEmpty(entity.getCouplingCommunity())) { |
|
|
|
reportPartyDTOS.forEach(dto -> { |
|
|
|
if (dto.getId().equals(entity.getId())) { |
|
|
|
//包联社区
|
|
|
|
dto.setCouplingCommunity(entity.getCouplingCommunity().split(",")); |
|
|
|
ParentAndAllDeptDTO deptDTO = adminFeignClient.getParentAndAllDept(dto.getCouplingCommunity()[dto.getCouplingCommunity().length - 1]).getData(); |
|
|
|
dto.setCouplingCommunityName(deptDTO.getParentDeptNames()); |
|
|
|
//居住社区
|
|
|
|
if (dto.getShiBei() == 0) { |
|
|
|
if (StringUtils.isNotEmpty(entity.getVillageName())) { |
|
|
|
String[] names = entity.getVillageName().split("-"); |
|
|
|
if (names.length == 2) { |
|
|
|
dto.setParentDeptNames(names[0]); |
|
|
|
dto.setHomeName(names[1]); |
|
|
|
} |
|
|
|
} |
|
|
|
dto.setAllDeptNames(entity.getVillageName()); |
|
|
|
} else { |
|
|
|
if (StringUtils.isNotEmpty(entity.getAllDeptIds())) { |
|
|
|
dto.setAllDeptIds(entity.getAllDeptIds().split(",")); |
|
|
|
if (dto.getAllDeptIds().length == 4) { |
|
|
|
deptDTO = adminFeignClient.getParentAndAllDept(dto.getAllDeptIds()[dto.getAllDeptIds().length - 2]).getData(); |
|
|
|
dto.setParentDeptNames(deptDTO.getAllDeptNames()); |
|
|
|
} else { |
|
|
|
deptDTO = adminFeignClient.getParentAndAllDept(dto.getAllDeptIds()[dto.getAllDeptIds().length - 1]).getData(); |
|
|
|
dto.setParentDeptNames(deptDTO.getAllDeptNames()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
dto.setAllDeptNames(entity.getParentDeptNames()); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
@ -131,17 +152,31 @@ public class ReportPartyServiceImpl extends BaseServiceImpl<ReportPartyDao, Repo |
|
|
|
String workUnit = (String) params.get("workUnit"); |
|
|
|
Long deptId = SecurityUser.getUser().getDeptId(); |
|
|
|
String deptIds = (String) params.get("deptId"); |
|
|
|
ParentAndAllDeptDTO deptDTO; |
|
|
|
if (StringUtils.isNotEmpty(deptIds)) { |
|
|
|
deptIds = screenDeptId + "," + deptIds; |
|
|
|
if (StringUtils.isNotEmpty(sel) && sel.equals("1")) { |
|
|
|
wrapper.likeRight("COUPLING_COMMUNITY", deptIds); |
|
|
|
if (deptIds.split(",").length > 1) { |
|
|
|
String[] ids = deptIds.split(","); |
|
|
|
if (ids.length == 3) { |
|
|
|
deptDTO = adminFeignClient.getParentAndAllDept(ids[ids.length - 2]).getData(); |
|
|
|
} else { |
|
|
|
deptDTO = adminFeignClient.getParentAndAllDept(ids[ids.length - 1]).getData(); |
|
|
|
} |
|
|
|
} else { |
|
|
|
wrapper.likeRight("ALL_DEPT_IDS", deptIds); |
|
|
|
if (!String.valueOf(deptId).equals(deptIds)) { |
|
|
|
deptDTO = adminFeignClient.getParentAndAllDept(String.valueOf(deptId)).getData(); |
|
|
|
} else { |
|
|
|
deptDTO = adminFeignClient.getParentAndAllDept(deptIds).getData(); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (null != deptId && !deptId.equals(screenDeptId)) { |
|
|
|
wrapper.eq("DEPT_ID", deptId); |
|
|
|
} |
|
|
|
deptDTO = adminFeignClient.getParentAndAllDept(String.valueOf(deptId)).getData(); |
|
|
|
} |
|
|
|
//居住社区
|
|
|
|
String deptIdsStr = deptDTO.getAllDeptIds(); |
|
|
|
if (StringUtils.isNotEmpty(sel) && sel.equals("0")) { |
|
|
|
wrapper.likeRight("ALL_DEPT_IDS", deptIdsStr); |
|
|
|
} else {//包联社区
|
|
|
|
wrapper.likeRight("COUPLING_COMMUNITY", deptIdsStr); |
|
|
|
} |
|
|
|
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|
|
|
wrapper.like(StringUtils.isNotBlank(name), FieldConstant.NAME_HUMP, name); |
|
|
@ -164,11 +199,27 @@ public class ReportPartyServiceImpl extends BaseServiceImpl<ReportPartyDao, Repo |
|
|
|
ParentAndAllDeptDTO deptDTO = adminFeignClient.getParentAndAllDept(result.getCouplingCommunity()[result.getCouplingCommunity().length - 1]).getData(); |
|
|
|
result.setCouplingCommunityName(deptDTO.getParentDeptNames()); |
|
|
|
} |
|
|
|
// if (StringUtils.isNotEmpty(entity.getIdCard())) {
|
|
|
|
// String idCard = entity.getIdCard();
|
|
|
|
// String temp = idCard.substring(0, 4) + tempKey + idCard.substring(idCard.length() - 3);
|
|
|
|
// result.setIdCard(temp);
|
|
|
|
// }
|
|
|
|
if (entity.getShiBei() == 0) { |
|
|
|
if (StringUtils.isNotEmpty(entity.getVillageName())) { |
|
|
|
String[] names = entity.getVillageName().split("-"); |
|
|
|
if (names.length == 2) { |
|
|
|
result.setParentDeptNames(names[0]); |
|
|
|
result.setHomeName(names[1]); |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (StringUtils.isNotEmpty(entity.getAllDeptIds())) { |
|
|
|
ParentAndAllDeptDTO deptDTO; |
|
|
|
result.setAllDeptIds(entity.getAllDeptIds().split(",")); |
|
|
|
if (result.getAllDeptIds().length == 4) { |
|
|
|
deptDTO = adminFeignClient.getParentAndAllDept(result.getAllDeptIds()[result.getAllDeptIds().length - 2]).getData(); |
|
|
|
result.setParentDeptNames(deptDTO.getAllDeptNames()); |
|
|
|
} else { |
|
|
|
deptDTO = adminFeignClient.getParentAndAllDept(result.getAllDeptIds()[result.getAllDeptIds().length - 1]).getData(); |
|
|
|
result.setParentDeptNames(deptDTO.getAllDeptNames()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
@ -229,7 +280,6 @@ public class ReportPartyServiceImpl extends BaseServiceImpl<ReportPartyDao, Repo |
|
|
|
} |
|
|
|
if (null == entity.getAllDeptIds()) { |
|
|
|
entity.setAllDeptIds(""); |
|
|
|
entity.setDeptId("-1"); |
|
|
|
} |
|
|
|
entity.setStatus(0); |
|
|
|
entity.setExamineMsg(null); |
|
|
@ -268,7 +318,11 @@ public class ReportPartyServiceImpl extends BaseServiceImpl<ReportPartyDao, Repo |
|
|
|
ReportPartyEntity entity = ConvertUtils.sourceToTarget(dto, ReportPartyEntity.class); |
|
|
|
//市北居住处理居住社区信息
|
|
|
|
if (null != dto.getAllDeptIds() && dto.getShiBei() == 1) { |
|
|
|
entity.setDeptId(dto.getCouplingCommunity()[dto.getCouplingCommunity().length - 2]); |
|
|
|
if (entity.getCouplingCommunity().length() == 4) { |
|
|
|
entity.setDeptId(dto.getCouplingCommunity()[dto.getCouplingCommunity().length - 2]); |
|
|
|
} else { |
|
|
|
entity.setDeptId(dto.getCouplingCommunity()[dto.getCouplingCommunity().length - 1]); |
|
|
|
} |
|
|
|
entity.setAllDeptIds(StringUtils.join(dto.getAllDeptIds(), ",")); |
|
|
|
Result<ParentAndAllDeptDTO> parentResult = adminFeignClient.getParentAndAllDept(String.valueOf(entity.getDeptId())); |
|
|
|
if (!parentResult.success() || parentResult.getData() == null) { |
|
|
@ -281,6 +335,11 @@ public class ReportPartyServiceImpl extends BaseServiceImpl<ReportPartyDao, Repo |
|
|
|
} |
|
|
|
} else {//不在市北,处理居住信息
|
|
|
|
if (StringUtils.isNotEmpty(dto.getVillageName())) { |
|
|
|
if (entity.getCouplingCommunity().length() == 4) { |
|
|
|
entity.setDeptId(dto.getCouplingCommunity()[dto.getCouplingCommunity().length - 2]); |
|
|
|
} else { |
|
|
|
entity.setDeptId(dto.getCouplingCommunity()[dto.getCouplingCommunity().length - 1]); |
|
|
|
} |
|
|
|
String[] names = dto.getVillageName().split("-"); |
|
|
|
if (names.length == 2) { |
|
|
|
entity.setHomeName(names[1]); |
|
|
|