diff --git a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/FieldConstant.java b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/FieldConstant.java index 8818dd2a..f2d39525 100644 --- a/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/FieldConstant.java +++ b/esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/FieldConstant.java @@ -64,4 +64,10 @@ public interface FieldConstant { String TAG_ID = "TAG_ID"; String TAG_ID_HUMP = "tagId"; + String EVENT_ID = "EVENT_ID"; + String EVENT_ID_HUMP = "eventId"; + + String ISSUE_ID = "ISSUE_ID"; + String ISSUE_ID_HUMP = "issueId"; + } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java index 28c0969f..721523c9 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java @@ -23,6 +23,7 @@ import com.elink.esua.epdc.commons.mybatis.service.impl.BaseServiceImpl; import com.elink.esua.epdc.commons.tools.constant.FieldConstant; import com.elink.esua.epdc.commons.tools.constant.NumConstant; import com.elink.esua.epdc.commons.tools.constant.OrganizationTypeConstant; +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.content.CheckDataUtils; import com.elink.esua.epdc.commons.tools.security.content.ModuleName; @@ -258,6 +259,9 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl NumConstant.ZERO; + } else if (EventIssueItemState.EVENT_REVIEW_TO_ITEM == eventState) { + int itemCount = itemService.selectItemCountByEventId(eventId); + checkResult = itemCount > NumConstant.ZERO; + } else { + EpdcEventsEntity entity = baseDao.selectById(eventId); + checkResult = eventState == entity.getEventState(); + } + + if (!checkResult) { + throw new RenException("该事件已审核,请勿重复操作"); + } + } + } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/IssueService.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/IssueService.java index c16ba47f..63ff5996 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/IssueService.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/IssueService.java @@ -284,4 +284,14 @@ public interface IssueService extends BaseService { * @since 2020/3/7 12:50 */ void modifyPartyGroupName(List groups); + + /** + * 根据事件ID获取议题数量 + * + * @param eventId 事件ID + * @return int + * @author Liuchuang + * @since 2020/9/16 10:31 + */ + int selectIssueCountByEventId(String eventId); } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/impl/IssueServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/impl/IssueServiceImpl.java index 5b2101c6..10ba9446 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/impl/IssueServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/impl/IssueServiceImpl.java @@ -189,6 +189,9 @@ public class IssueServiceImpl extends BaseServiceImpl imp @Override @Transactional(rollbackFor = Exception.class) public Result saveIssueHandleResult(IssueWaitHandleSubmitFormDTO dto) { + // 转项目校验 + checkChangeToItem(dto.getId(), dto.getState()); + IssueHandleEntity handleEntity = new IssueHandleEntity(); handleEntity.setAdvice(dto.getAdvice()); handleEntity.setState(dto.getState()); @@ -696,4 +699,31 @@ public class IssueServiceImpl extends BaseServiceImpl imp return new Result(); } + + @Override + public int selectIssueCountByEventId(String eventId) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(FieldConstant.EVENT_ID, eventId); + + return baseDao.selectCount(wrapper); + } + + /** + * 议题转项目校验 + * + * @param issueId 议题ID + * @param state 状态 + * @return void + * @author Liuchuang + * @since 2020/9/16 11:11 + */ + private void checkChangeToItem(String issueId, int state) { + if(EventIssueItemState.ISSUE_CHANGE_TO_ITEM_AND_CIRCULATION_ASSISTANCE == state + || EventIssueItemState.ISSUE_CHANGE_TO_ITEM == state) { + int itemCount = itemService.selectItemCountByIssueId(issueId); + if (itemCount > NumConstant.ZERO) { + throw new RenException("该议题已转为项目,请勿重复操作"); + } + } + } } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemService.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemService.java index 8daf6737..c25af812 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemService.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemService.java @@ -387,4 +387,24 @@ public interface ItemService extends BaseService { * @return com.elink.esua.epdc.commons.tools.utils.Result */ Result rejectItemSatisfactionInfo(RejectRecordDTO dto); + + /** + * 根据事件ID获取项目数量 + * + * @param eventId 事件ID + * @return int + * @author Liuchuang + * @since 2020/9/16 10:37 + */ + int selectItemCountByEventId(String eventId); + + /** + * 根据议题ID获取项目数量 + * + * @param issueId 议题ID + * @return int + * @author Liuchuang + * @since 2020/9/16 10:37 + */ + int selectItemCountByIssueId(String issueId); } diff --git a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java index ffb20f0a..9dd2752e 100644 --- a/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java @@ -74,6 +74,7 @@ import com.elink.esua.epdc.modules.feign.ContentSecurityFeignClient; import com.elink.esua.epdc.modules.feign.UserFeignClient; import com.elink.esua.epdc.modules.interfacelog.entity.InterfaceLogEntity; import com.elink.esua.epdc.modules.interfacelog.service.InterfaceLogService; +import com.elink.esua.epdc.modules.issue.entity.IssueEntity; import com.elink.esua.epdc.modules.issue.service.IssueService; import com.elink.esua.epdc.modules.item.dao.GridPlatformHandleLogDao; import com.elink.esua.epdc.modules.item.dao.ItemDao; @@ -1546,4 +1547,20 @@ public class ItemServiceImpl extends BaseServiceImpl implem baseDao.rejectItemSatisfactionInfo(dto.getRelationId()); return new Result(); } + + @Override + public int selectItemCountByEventId(String eventId) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(FieldConstant.EVENT_ID, eventId); + + return baseDao.selectCount(wrapper); + } + + @Override + public int selectItemCountByIssueId(String issueId) { + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(FieldConstant.ISSUE_ID, issueId); + + return baseDao.selectCount(wrapper); + } } diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/form/PartyGroupTopicTopFormDTO.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/form/PartyGroupTopicTopFormDTO.java index 3cf2f696..bfe73068 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/form/PartyGroupTopicTopFormDTO.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/form/PartyGroupTopicTopFormDTO.java @@ -31,4 +31,9 @@ public class PartyGroupTopicTopFormDTO implements Serializable { * 用户ID */ private String userId; + + /** + * 系统标识:0-居民端,1-pc端 + */ + private String systemFlag; } diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/PartyGroupOfficialsResultDTO.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/PartyGroupOfficialsResultDTO.java index 31056758..29771c60 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/PartyGroupOfficialsResultDTO.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/PartyGroupOfficialsResultDTO.java @@ -64,6 +64,9 @@ public class PartyGroupOfficialsResultDTO implements Serializable { */ private String areaResponsibility; - + /** + * 职责 + */ + private String duty; } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/AppPartyTopicController.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/AppPartyTopicController.java index ca161bf1..83988fb6 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/AppPartyTopicController.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/AppPartyTopicController.java @@ -18,6 +18,7 @@ package com.elink.esua.epdc.controller; import com.elink.esua.epdc.common.token.dto.TokenDto; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; import com.elink.esua.epdc.commons.tools.utils.Result; import com.elink.esua.epdc.commons.tools.validator.ValidatorUtils; import com.elink.esua.epdc.dto.form.*; @@ -126,6 +127,7 @@ public class AppPartyTopicController { */ @PostMapping("top") public Result topicTop(@RequestBody PartyGroupTopicTopFormDTO formDto) { + formDto.setSystemFlag(NumConstant.ZERO_STR); return partyTopicService.modifyTopicTopFlag(formDto); } diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyTopicController.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyTopicController.java index 1b492736..99fdb232 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyTopicController.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyTopicController.java @@ -17,6 +17,7 @@ package com.elink.esua.epdc.controller; +import com.elink.esua.epdc.commons.tools.constant.NumConstant; import com.elink.esua.epdc.commons.tools.page.PageData; import com.elink.esua.epdc.commons.tools.utils.ExcelUtils; import com.elink.esua.epdc.commons.tools.utils.Result; @@ -27,6 +28,7 @@ import com.elink.esua.epdc.commons.tools.validator.group.UpdateGroup; import com.elink.esua.epdc.commons.tools.validator.group.DefaultGroup; import com.elink.esua.epdc.dto.GroupTopicCloseFormDTO; import com.elink.esua.epdc.dto.PartyTopicDTO; +import com.elink.esua.epdc.dto.form.PartyGroupTopicTopFormDTO; import com.elink.esua.epdc.excel.PartyTopicExcel; import com.elink.esua.epdc.service.PartyTopicService; import org.springframework.beans.factory.annotation.Autowired; @@ -98,4 +100,19 @@ public class PartyTopicController { return partyTopicService.modifyTopicState(formDto); } + /** + * 话题置顶或取消置顶 + * + * @param formDto 参数 + * @return com.elink.esua.epdc.commons.tools.utils.Result + * @author Liuchuang + * @since 2020/9/8 9:33 + */ + @PostMapping("top") + public Result topicTop(@RequestBody PartyGroupTopicTopFormDTO formDto) { + ValidatorUtils.validateEntity(formDto); + formDto.setSystemFlag(NumConstant.ONE_STR); + return partyTopicService.modifyTopicTopFlag(formDto); + } + } \ No newline at end of file diff --git a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyTopicServiceImpl.java b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyTopicServiceImpl.java index ea840cc0..4fc4469c 100644 --- a/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyTopicServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyTopicServiceImpl.java @@ -325,10 +325,12 @@ public class PartyTopicServiceImpl extends BaseServiceImpl + + @@ -64,7 +66,9 @@ t.CREATED_BY, t.CREATED_TIME, t.UPDATED_BY, - t.UPDATED_TIME + t.UPDATED_TIME, + t.TOP_FLAG, + t.TOP_TIME from epdc_party_topic t where t.DEL_FLAG ='0' @@ -79,7 +83,7 @@ #{endTime} - order by CREATED_TIME desc + order by t.TOP_TIME DESC, t.CREATED_TIME desc diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/BasePopulationInformationExcel.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/BasePopulationInformationExcel.java index 223d061d..1f88c463 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/BasePopulationInformationExcel.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/BasePopulationInformationExcel.java @@ -50,9 +50,6 @@ public class BasePopulationInformationExcel { @Excel(name = "产权人联系电话",width = 20) private String propertyOwnerMobile; - @Excel(name = "产权证") - private String propertyOwnerCard; - @Excel(name = "房屋用途",replace = {"自住_0","租赁_1","经营_2"}) private String houseUse; diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/HousingInformationServiceImpl.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/HousingInformationServiceImpl.java index 812e13c6..26af1333 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/HousingInformationServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/HousingInformationServiceImpl.java @@ -54,6 +54,7 @@ import org.springframework.web.multipart.MultipartFile; import java.io.File; import java.math.BigDecimal; import java.util.*; +import java.util.stream.Collectors; /** * 房屋信息表 @@ -279,20 +280,26 @@ public class HousingInformationServiceImpl extends BaseServiceImpl allHouseResidentEntities = houseResidentDao.selectByMap(residentParams); if (allHouseResidentEntities != null && allHouseResidentEntities.size() == 1) { - //此人只与此房屋关联 + //此户主只与此房屋关联 populationIds.add(houseResidentEntity.getResidentId()); } } - //删除人口信息 -- 只删与且仅与此房屋有关系的人口 + //删除人口信息 -- 删户主信息,居住人信息,户主房屋关联信息,居住人户主关联信息 if (populationIds.size() > 0) { + //(1)删户主信息 - 根据人口ID删 populationInformationService.deleteBatchIds(populationIds); - //且删除此户主对应的居民信息 - //根据此户主ID删除 + //(3)删居住人信息 - 根据人口ID删 Map residentParams = new HashMap<>(); residentParams.put("HOUSE_HEAD_ID", populationIds.get(0)); - houseResidentDao.deleteByMap(residentParams); + List houseResidentEntityList = houseResidentDao.selectByMap(residentParams); + if(houseResidentEntityList!=null && houseResidentEntityList.size()>0){ + List residentIds = houseResidentEntityList.stream().map(HouseResidentEntity::getResidentId).collect(Collectors.toList()); + populationInformationService.deleteBatchIds(residentIds); + //(4)删居住人关联信息 - 根据户主ID删 + houseResidentDao.deleteByMap(residentParams); + } } - //删除关联关系 -- 全删 + //删除户主关联信息 - 根据房屋ID删 houseResidentDao.deleteByMap(params); } //删除房屋信息 @@ -487,142 +494,6 @@ public class HousingInformationServiceImpl extends BaseServiceImpl savePopulationList(List basePopulationInformationExcels, ParentAndAllDeptDTO parentAndAllDeptDTO) { - //插入房屋信息 - List housingInformationEntityList = new ArrayList<>(); - - for (BasePopulationInformationExcel basePopulationInformationExcel : basePopulationInformationExcels) { - HousingInformationEntity housingInformationEntity = ConvertUtils.sourceToTarget(basePopulationInformationExcel, HousingInformationEntity.class); - housingInformationEntity.setGridId(parentAndAllDeptDTO.getGridId()); - housingInformationEntity.setParentDeptIds(parentAndAllDeptDTO.getParentDeptIds()); - housingInformationEntity.setParentDeptNames(parentAndAllDeptDTO.getParentDeptNames()); - housingInformationEntity.setAllDeptIds(parentAndAllDeptDTO.getAllDeptIds()); - housingInformationEntity.setAllDeptNames(parentAndAllDeptDTO.getAllDeptNames()); - housingInformationEntity.setBuyingTime(DateUtil.parse(basePopulationInformationExcel.getBuyingTime())); - housingInformationEntityList.add(housingInformationEntity); - } - insertBatch(housingInformationEntityList); - //组装租赁,经营,户主,房屋人员关系表信息 - List houseRentInfoEntities = new ArrayList<>(); - List houseBusinessInfoEntities = new ArrayList<>(); - //更新户主信息 - List updatePopulationInfo = new ArrayList<>(); - //插入户主信息 - List insertPopulationInfo = new ArrayList<>(); - //房屋户主信息 -- 户主更新 - List houseResidentEntityList = new ArrayList<>(); - //身份证校验 - List identifyNoValidation = new ArrayList<>(); - //存储 key:身份证 value 房子ID 身份证是可重复的 - List> HouseResidentInfos = new ArrayList<>(); - a: - for (HousingInformationEntity housingInformationEntity : housingInformationEntityList) { - for (BasePopulationInformationExcel basePopulationInformationExcel : basePopulationInformationExcels) { - //以产权证为唯一标识 - if (housingInformationEntity.getPropertyOwnerCard().equals(basePopulationInformationExcel.getPropertyOwnerCard())) { - if (HouseUseConstant.RENT.equals(housingInformationEntity.getHouseUse())) { - //房屋租赁信息 - HouseRentInfoEntity houseRentInfoEntity = ConvertUtils.sourceToTarget(basePopulationInformationExcel, HouseRentInfoEntity.class); - houseRentInfoEntity.setHouseId(housingInformationEntity.getId()); - houseRentInfoEntities.add(houseRentInfoEntity); - } else if (HouseUseConstant.BUSINESS.equals(housingInformationEntity.getHouseUse())) { - //房屋经营信息 - HouseBusinessInfoEntity houseBusinessInfoEntity = ConvertUtils.sourceToTarget(basePopulationInformationExcel, HouseBusinessInfoEntity.class); - houseBusinessInfoEntity.setHouseId(housingInformationEntity.getId()); - houseBusinessInfoEntities.add(houseBusinessInfoEntity); - } - //插入户主信息 - PopulationInformationEntity populationInformationEntity = ConvertUtils.sourceToTarget(basePopulationInformationExcel, PopulationInformationEntity.class); - PopulationInformationEntity oldPopulationInformationEntity = populationInformationService.getInfoByIdentityNo(populationInformationEntity.getResidentsIdentityNo()); - if (oldPopulationInformationEntity != null) { - //身份证在列表已存在,则更新户主信息 - populationInformationEntity.setId(oldPopulationInformationEntity.getId()); - //先检验下户主的一些信息 - validateHouseHeadInfo(populationInformationEntity, basePopulationInformationExcel); - updatePopulationInfo.add(populationInformationEntity); - //插入房屋人员关联关系表 - HouseResidentEntity houseResidentEntity = new HouseResidentEntity(); - houseResidentEntity.setHouseId(housingInformationEntity.getId()); - houseResidentEntity.setResidentId(oldPopulationInformationEntity.getId()); - houseResidentEntity.setIsHouseHead("1"); - houseResidentEntityList.add(houseResidentEntity); - } else { - //先检验下户主的一些信息 - validateHouseHeadInfo(populationInformationEntity, basePopulationInformationExcel); - - - //将新增的人员的身份证存到List,防止excel中重复的身份证增加不同的户主信息 - if (!identifyNoValidation.contains(populationInformationEntity.getResidentsIdentityNo())) { - //如果不包含,才新增进去。也就是说如果重复的身份证,只取第一条信息作为户主信息 - insertPopulationInfo.add(populationInformationEntity); - } - identifyNoValidation.add(populationInformationEntity.getResidentsIdentityNo()); - //方便下面新增房屋人员关系表,此时存储所有的户主身份证+房子ID - Map houseResidentInfo = new HashMap<>(); - houseResidentInfo.put(populationInformationEntity.getResidentsIdentityNo(), housingInformationEntity.getId()); - HouseResidentInfos.add(houseResidentInfo); - } - continue a; - } - } - } - //插入租赁信息 - if (houseRentInfoEntities.size() > 0) { - houseRentInfoService.insertBatch(houseRentInfoEntities); - } - //插入经营信息 - if (houseBusinessInfoEntities.size() > 0) { - houseBusinessInfoService.insertBatch(houseBusinessInfoEntities); - } - //如果人口信息身份证已有,则更新人口信息 - if (updatePopulationInfo.size() > 0) { - populationInformationService.updateBatchById(updatePopulationInfo); - } - //插入人口信息 - if (insertPopulationInfo.size() > 0) { - populationInformationService.insertBatch(insertPopulationInfo); - //遍历存储的身份证+房子ID对应信息,组装房屋人员关系 - for (Map houseResidentInfo : HouseResidentInfos) { - Set> set = houseResidentInfo.entrySet(); - for (Map.Entry entry : set) { - String identifyNo = entry.getKey(); - String houseId = entry.getValue(); - //根据身份证取户主ID - for (PopulationInformationEntity populationInformationEntity : insertPopulationInfo) { - if (populationInformationEntity.getResidentsIdentityNo().equals(identifyNo)) { - HouseResidentEntity houseResidentEntity = new HouseResidentEntity(); - houseResidentEntity.setHouseId(houseId); - houseResidentEntity.setResidentId(populationInformationEntity.getId()); - houseResidentEntity.setIsHouseHead("1"); - houseResidentEntityList.add(houseResidentEntity); - break; - } - } - } - - } - } - //插入房屋人员关系 - if (houseResidentEntityList.size() > 0) { - houseResidentService.insertBatch(houseResidentEntityList); - } - //组装人口身份证和ID信息 辅助添加居民信息 - insertPopulationInfo.addAll(updatePopulationInfo); - Map populationIdNoAndIdMap = new HashMap<>(); - insertPopulationInfo.forEach(i -> { - populationIdNoAndIdMap.put(i.getResidentsIdentityNo(),i.getId()); - }); - return populationIdNoAndIdMap; - } - /** @@ -635,11 +506,15 @@ public class HousingInformationServiceImpl extends BaseServiceImpl * @Description 校验居住人数据 @@ -852,6 +748,13 @@ public class HousingInformationServiceImpl extends BaseServiceImpl32){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("房屋地址字数不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setHouseAddress(houseAddress); } if (StringUtils.isNotBlank(buyingTime)) { @@ -879,6 +782,13 @@ public class HousingInformationServiceImpl extends BaseServiceImpl32){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("产权人字数不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setPropertyOwner(propertyOwner); } if (StringUtils.isBlank(propertyOwnerIdentityNo)) { @@ -888,6 +798,13 @@ public class HousingInformationServiceImpl extends BaseServiceImpl32){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("产权人身份证号不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setPropertyOwnerIdentityNo(propertyOwnerIdentityNo); } if (StringUtils.isBlank(propertyOwnerMobile)) { @@ -897,6 +814,13 @@ public class HousingInformationServiceImpl extends BaseServiceImpl32){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("产权人电话不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setPropertyOwnerMobile(propertyOwnerMobile); } if (StringUtils.isBlank(houseUse)) { @@ -923,6 +847,13 @@ public class HousingInformationServiceImpl extends BaseServiceImpl32){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("承租人不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setTenantName(tenantName); } if (StringUtils.isBlank(tenantPhone)) { @@ -932,6 +863,13 @@ public class HousingInformationServiceImpl extends BaseServiceImpl32){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("承租人电话不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setTenantPhone(tenantPhone); } if (StringUtils.isBlank(tenantIdentityNo)) { @@ -955,9 +893,23 @@ public class HousingInformationServiceImpl extends BaseServiceImpl128){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("企业名称不能大于128个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setEnterpriseName(enterpriseName); } if(StringUtils.isNotBlank((legalRepresentative))){ + if(legalRepresentative.length()>32){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("法人代表不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setLegalRepresentative(legalRepresentative); } if (StringUtils.isBlank(enterprisePhone)) { @@ -967,9 +919,23 @@ public class HousingInformationServiceImpl extends BaseServiceImpl32){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("企业联系电话大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setEnterprisePhone(enterprisePhone); } if(StringUtils.isNotBlank((socialUniformCode))){ + if(socialUniformCode.length()>128){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("社会统一代码不能大于128个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setSocialUniformCode(socialUniformCode); } } @@ -980,9 +946,23 @@ public class HousingInformationServiceImpl extends BaseServiceImpl32){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("户主姓名不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setResidentsName(residentsName); } if(StringUtils.isNotBlank((residentsNation))){ + if(residentsNation.length()>32){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("民族不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setResidentsNation(residentsNation); } if (StringUtils.isNotBlank(educationLevel)) { @@ -1047,6 +1027,13 @@ public class HousingInformationServiceImpl extends BaseServiceImpl32){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("组织关系所在地不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setOrganizationalRelationshipLocation(organizationalRelationshipLocation); } } @@ -1078,6 +1065,13 @@ public class HousingInformationServiceImpl extends BaseServiceImpl32){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("户主联系电话不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setResidentsPhone(residentsPhone); } if (StringUtils.isNotBlank(bodyStatus)) { @@ -1156,6 +1150,13 @@ public class HousingInformationServiceImpl extends BaseServiceImpl32){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("户籍地不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setHouseholdRegistrationPlace(householdRegistrationPlace); } if (StringUtils.isNotBlank(employmentStatus)) { @@ -1181,9 +1182,23 @@ public class HousingInformationServiceImpl extends BaseServiceImpl128){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("现工作单位不能大于128个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setCurrentEmployer(currentEmployer); } if(StringUtils.isNotBlank((currentEmployerAddress))){ + if(currentEmployerAddress.length()>128){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("现单位地址不能大于128个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setCurrentEmployerAddress(currentEmployerAddress); } } else if ("失业".equals(employmentStatus)) { diff --git a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PopulationInformationServiceImpl.java b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PopulationInformationServiceImpl.java index fc15b936..aae3f9d2 100644 --- a/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PopulationInformationServiceImpl.java +++ b/esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PopulationInformationServiceImpl.java @@ -171,8 +171,22 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl