diff --git a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java index 508436911..1cdc80b61 100644 --- a/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-api/epdc-api-server/src/main/java/com/elink/esua/epdc/service/impl/AppUserServiceImpl.java @@ -1694,20 +1694,23 @@ public class AppUserServiceImpl implements AppUserService { public Result updateReportparty(ReportPartyDTO dto) { EpdcPartyMemberRegistDTO partyMemberRegistDTO = new EpdcPartyMemberRegistDTO(); CityCenterFromDTO formDTO = new CityCenterFromDTO(); - if (dto.getDeptId() != null) { - formDTO.setDeptId(Long.parseLong(dto.getAllDeptIds()[dto.getAllDeptIds().length - 2])); - SysDeptDTO liveDept = adminFeignClient.getDeptInfo(formDTO).getData(); - partyMemberRegistDTO.setLiveAddress(liveDept.getAddress()); - partyMemberRegistDTO.setLiveCommunity(liveDept.getName()); - partyMemberRegistDTO.setLiveMobile(liveDept.getMobile()); - partyMemberRegistDTO.setLiveSecretaryName(liveDept.getSecretaryName()); - partyMemberRegistDTO.setLiveTelephone(liveDept.getTelephone()); - partyMemberRegistDTO.setLiveStreetName(liveDept.getStreetName()); - partyMemberRegistDTO.setLiveLongitude(liveDept.getLongitude()); - partyMemberRegistDTO.setLiveLatitude(liveDept.getLatitude()); + if(dto.getShiBei() == 1){ + if (null != dto.getAllDeptIds() && dto.getAllDeptIds().length > 3) { + formDTO.setDeptId(Long.parseLong(dto.getAllDeptIds()[dto.getAllDeptIds().length - 2])); + SysDeptDTO liveDept = adminFeignClient.getDeptInfo(formDTO).getData(); + partyMemberRegistDTO.setLiveAddress(liveDept.getAddress()); + partyMemberRegistDTO.setLiveCommunity(liveDept.getName()); + partyMemberRegistDTO.setLiveMobile(liveDept.getMobile()); + partyMemberRegistDTO.setLiveSecretaryName(liveDept.getSecretaryName()); + partyMemberRegistDTO.setLiveTelephone(liveDept.getTelephone()); + partyMemberRegistDTO.setLiveStreetName(liveDept.getStreetName()); + partyMemberRegistDTO.setLiveLongitude(liveDept.getLongitude()); + partyMemberRegistDTO.setLiveLatitude(liveDept.getLatitude()); + } } - if (null != dto.getCouplingCommunity()) { + if (null != dto.getCouplingCommunity() && dto.getCouplingCommunity().length > 3) { formDTO.setDeptId(Long.parseLong(dto.getCouplingCommunity()[dto.getCouplingCommunity().length - 2])); + dto.setDeptId(formDTO.getDeptId()); SysDeptDTO couplingDept = adminFeignClient.getDeptInfo(formDTO).getData(); partyMemberRegistDTO.setCouplingAddress(couplingDept.getAddress()); partyMemberRegistDTO.setCouplingCommunity(couplingDept.getName()); @@ -1803,16 +1806,15 @@ public class AppUserServiceImpl implements AppUserService { //如果在市北,获取网格机构详情 if (formDto.getShibei() == 1) { if (null != formDto.getAllDeptIds()) { - if (formDto.getAllDeptIds().length > 1) { + if (formDto.getAllDeptIds().length > 3) { //默认获取社区第一网格 - deptId = Long.parseLong(formDto.getAllDeptIds()[formDto.getAllDeptIds().length - 1]); + registDTO.setGridId(Long.parseLong(formDto.getAllDeptIds()[formDto.getAllDeptIds().length - 2])); + } + completeDept = adminFeignClient.getCompleteDept(Long.parseLong(formDto.getAllDeptIds()[formDto.getAllDeptIds().length - 1])).getData(); + if (null == completeDept) { + throw new RenException("查询网格信息失败"); } } - completeDept = adminFeignClient.getCompleteDept(deptId).getData(); - if (null == completeDept) { - throw new RenException("查询网格信息失败"); - } - registDTO.setGridId(deptId); //暂时关闭,此时还没有登陆 // else { // UserDetail user = SecurityUser.getUser(); diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/party/service/impl/ReportPartyServiceImpl.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/party/service/impl/ReportPartyServiceImpl.java index 4da47717b..c504d8988 100755 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/party/service/impl/ReportPartyServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/party/service/impl/ReportPartyServiceImpl.java @@ -24,7 +24,6 @@ import com.elink.esua.epdc.commons.tools.constant.FieldConstant; import com.elink.esua.epdc.commons.tools.exception.RenException; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.security.user.SecurityUser; -import com.elink.esua.epdc.commons.tools.security.user.UserDetail; import com.elink.esua.epdc.commons.tools.utils.ConvertUtils; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.dto.ParentAndAllDeptDTO; @@ -41,7 +40,6 @@ import javax.annotation.Resource; import java.util.Arrays; import java.util.List; import java.util.Map; -import java.util.Objects; /** * 党员报道 @@ -70,16 +68,23 @@ public class ReportPartyServiceImpl extends BaseServiceImpl { result.getList().forEach(dto -> { if (entity.getId().equals(dto.getId())) { - String[] ids; if (StringUtils.isNotEmpty(entity.getAllDeptIds())) { dto.setAllDeptIds(entity.getAllDeptIds().split(",")); } - if (StringUtils.isNotEmpty(entity.getCouplingCommunity())) { - ids = entity.getCouplingCommunity().split(","); + ParentAndAllDeptDTO deptDTO; + if (entity.getShiBei() == 1) { + String[] ids = entity.getAllDeptIds().split(","); String deptId = ids[ids.length - 1]; - ParentAndAllDeptDTO deptDTO = adminFeignClient.getParentAndAllDept(deptId).getData(); - dto.setCouplingCommunityName(deptDTO.getAllDeptNames()); + deptDTO = adminFeignClient.getParentAndAllDept(deptId).getData(); + dto.setParentDeptNames(deptDTO.getParentDeptNames()); + }else { + String[] villageNames = entity.getVillageName().split("-"); + dto.setParentDeptNames(villageNames[0]); + dto.setHomeName(villageNames[1]); } + //包联社区 + deptDTO = adminFeignClient.getParentAndAllDept(entity.getDeptId()).getData(); + dto.setCouplingCommunityName(deptDTO.getAllDeptNames()); if (StringUtils.isNotEmpty(entity.getIdCard())) { String idCard = entity.getIdCard(); String temp = idCard.substring(0, 4) + tempKey + idCard.substring(idCard.length() - 3); @@ -104,11 +109,9 @@ public class ReportPartyServiceImpl extends BaseServiceImpl parentResult = null; - if (dto.getAllDeptIds() != null && dto.getAllDeptIds().length > 1) { - entity.setDeptId(dto.getAllDeptIds()[dto.getAllDeptIds().length - 1]); - parentResult = adminFeignClient.getParentAndAllDept(dto.getAllDeptIds()[dto.getAllDeptIds().length - 1]); + if (null != dto.getCouplingCommunity() && dto.getCouplingCommunity().length > 3) { + entity.setDeptId(dto.getCouplingCommunity()[dto.getCouplingCommunity().length - 2]); + entity.setCouplingCommunity(String.join(",", dto.getCouplingCommunity())); + } + if (dto.getAllDeptIds() != null && dto.getAllDeptIds().length > 3) { + entity.setDeptId(dto.getAllDeptIds()[dto.getAllDeptIds().length - 2]); + parentResult = adminFeignClient.getParentAndAllDept(dto.getAllDeptIds()[dto.getAllDeptIds().length - 2]); } else { parentResult = adminFeignClient.getParentAndAllDept(String.valueOf(dto.getDeptId())); } @@ -160,7 +164,6 @@ public class ReportPartyServiceImpl extends BaseServiceImpl parentResult = null; - if (dto.getAllDeptIds() != null && dto.getAllDeptIds().length > 1) { - entity.setDeptId(dto.getAllDeptIds()[dto.getAllDeptIds().length - 1]); - parentResult = adminFeignClient.getParentAndAllDept(dto.getAllDeptIds()[dto.getAllDeptIds().length - 1]); - } else { - parentResult = adminFeignClient.getParentAndAllDept(String.valueOf(dto.getDeptId())); - } - if (!parentResult.success() || parentResult.getData() == null) { - throw new RenException("获取部门信息失败"); + Result parentResult; + if (dto.getShiBei() == 1) {//设置居住社区 + if (null != dto.getAllDeptIds() && dto.getAllDeptIds().length > 3) { + entity.setAllDeptIds(dto.getAllDeptIds().toString()); + parentResult = adminFeignClient.getParentAndAllDept(dto.getAllDeptIds()[dto.getAllDeptIds().length - 1]); + if (!parentResult.success() || parentResult.getData() == null) { + throw new RenException("获取部门信息失败"); + } + ParentAndAllDeptDTO deptDTO = parentResult.getData(); + entity.setAllDeptIds(deptDTO.getAllDeptIds()); + entity.setAllDeptNames(deptDTO.getAllDeptNames()); + entity.setParentDeptIds(deptDTO.getParentDeptIds()); + entity.setParentDeptNames(deptDTO.getParentDeptNames()); + } } else { - ParentAndAllDeptDTO deptDTO = parentResult.getData(); - entity.setAllDeptIds(deptDTO.getAllDeptIds()); - entity.setAllDeptNames(deptDTO.getAllDeptNames()); - entity.setParentDeptIds(deptDTO.getParentDeptIds()); - entity.setParentDeptNames(deptDTO.getParentDeptNames()); - } - if (Objects.equals(0, entity.getStatus())) { - entity.setExamineMsg(null); + if (StringUtils.isNotEmpty(dto.getVillageName())) { + dto.setParentDeptNames(dto.getVillageName()); + } } - if (null != dto.getCouplingCommunity()) { + if (null != dto.getCouplingCommunity() && dto.getCouplingCommunity().length > 3) { + entity.setDeptId(dto.getCouplingCommunity()[dto.getCouplingCommunity().length - 2]); entity.setCouplingCommunity(String.join(",", dto.getCouplingCommunity())); } + entity.setStatus(0); + entity.setExamineMsg(null); updateById(entity); } @@ -230,15 +233,22 @@ public class ReportPartyServiceImpl extends BaseServiceImpl 3) { + result.setDeptId(dto.getCouplingCommunity()[dto.getCouplingCommunity().length - 2]); + } else { + result.setDeptId(dto.getCouplingCommunity()[dto.getCouplingCommunity().length - 1]); + } + result.setStatus(0); baseDao.updateById(result); } else { - if (dto.getAllDeptIds().length == 0) { - setDeptId(dto); - } Result parentResult; - if (dto.getAllDeptIds() != null && dto.getAllDeptIds().length > 1) { + if (null != dto.getCouplingCommunity() && dto.getCouplingCommunity().length > 3) { + entity.setDeptId(dto.getCouplingCommunity()[dto.getCouplingCommunity().length - 2]); + entity.setCouplingCommunity(String.join(",", dto.getCouplingCommunity())); + parentResult = adminFeignClient.getParentAndAllDept(String.valueOf(entity.getDeptId())); + } else if (null != dto.getAllDeptIds() && dto.getAllDeptIds().length > 2) { entity.setDeptId(dto.getAllDeptIds()[dto.getAllDeptIds().length - 1]); - parentResult = adminFeignClient.getParentAndAllDept(dto.getAllDeptIds()[dto.getAllDeptIds().length - 1]); + parentResult = adminFeignClient.getParentAndAllDept(entity.getDeptId()); } else { parentResult = adminFeignClient.getParentAndAllDept(String.valueOf(dto.getDeptId())); } @@ -251,16 +261,8 @@ public class ReportPartyServiceImpl extends BaseServiceImpl