From 197911b2c27da523983c5957a756ce11703aa045 Mon Sep 17 00:00:00 2001 From: songyunpeng Date: Tue, 15 Sep 2020 14:32:21 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=88=A0=E9=99=A4=E6=88=BF=E5=B1=8B?= =?UTF-8?q?=E4=BF=A1=E6=81=AFbug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/HousingInformationServiceImpl.java | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) 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 6d8725e6..c4c5a96b 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); } //删除房屋信息 From 76ade3c355579939f150c9c0e1cd0cac76d38a59 Mon Sep 17 00:00:00 2001 From: liuchuang <123456> Date: Wed, 16 Sep 2020 13:24:19 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=AE=A1=E6=A0=B8=E8=AE=AE=E9=A2=98?= =?UTF-8?q?=E5=92=8C=E8=BD=AC=E9=A1=B9=E7=9B=AE=E5=A2=9E=E5=8A=A0=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/constant/FieldConstant.java | 6 ++++ .../service/impl/EpdcEventsServiceImpl.java | 31 +++++++++++++++++++ .../modules/issue/service/IssueService.java | 10 ++++++ .../issue/service/impl/IssueServiceImpl.java | 30 ++++++++++++++++++ .../modules/item/service/ItemService.java | 20 ++++++++++++ .../item/service/impl/ItemServiceImpl.java | 17 ++++++++++ 6 files changed, 114 insertions(+) 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); + } } From f04dadb0d220cc5465970b011577fd343867c7d7 Mon Sep 17 00:00:00 2001 From: liuchuang <123456> Date: Wed, 16 Sep 2020 17:05:12 +0800 Subject: [PATCH 3/5] =?UTF-8?q?PC=E7=AB=AF=E5=85=9A=E7=BE=A41+1=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E7=BD=AE=E9=A1=B6=E5=92=8C=E5=8F=96=E6=B6=88=E7=BD=AE?= =?UTF-8?q?=E9=A1=B6=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/form/PartyGroupTopicTopFormDTO.java | 5 +++++ .../controller/AppPartyTopicController.java | 2 ++ .../epdc/controller/PartyTopicController.java | 17 +++++++++++++++++ .../service/impl/PartyTopicServiceImpl.java | 10 ++++++---- .../src/main/resources/mapper/PartyTopicDao.xml | 8 ++++++-- 5 files changed, 36 insertions(+), 6 deletions(-) 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-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 From 6436b28ac17aafeccfcb39745d968a28497f593f Mon Sep 17 00:00:00 2001 From: liuchuang <123456> Date: Wed, 16 Sep 2020 17:28:05 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E7=AE=A1=E5=B0=8F=E5=B8=A6=E4=B8=AA?= =?UTF-8?q?=E9=95=BF=E6=8E=A5=E5=8F=A3=E5=A2=9E=E5=8A=A0=E8=81=8C=E8=B4=A3?= =?UTF-8?q?=E5=AD=97=E6=AE=B5=E8=BF=94=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../esua/epdc/dto/result/PartyGroupOfficialsResultDTO.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 From 6f390e030e7c7ba0e9949452bc75e9be175b1246 Mon Sep 17 00:00:00 2001 From: songyunpeng Date: Wed, 16 Sep 2020 17:35:44 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E5=B1=85=E6=B0=91=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E8=A1=A8=E6=A0=BC=E9=AA=8C=E8=AF=81=E4=BF=AE=E6=94=B9=EF=BC=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../excel/BasePopulationInformationExcel.java | 3 - .../impl/HousingInformationServiceImpl.java | 326 +++++++++--------- .../PopulationInformationServiceImpl.java | 19 +- .../excel/居民信息录入模板.xls | Bin 36352 -> 36352 bytes 4 files changed, 183 insertions(+), 165 deletions(-) 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 c4c5a96b..57fe575e 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 @@ -489,142 +489,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; - } - /** @@ -637,11 +501,15 @@ public class HousingInformationServiceImpl extends BaseServiceImpl * @Description 校验居住人数据 @@ -854,6 +743,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)) { @@ -881,6 +777,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)) { @@ -890,6 +793,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)) { @@ -899,6 +809,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)) { @@ -925,6 +842,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)) { @@ -934,6 +858,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)) { @@ -957,9 +888,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)) { @@ -969,9 +914,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); } } @@ -982,9 +941,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)) { @@ -1049,6 +1022,13 @@ public class HousingInformationServiceImpl extends BaseServiceImpl32){ + errorLineInfoDto = new EpdcPopulationErrorResultDTO(); + errorLineInfoDto.setErrorLine((i + 2) + ""); + errorLineInfoDto.setErrorInfo("组织关系所在地不能大于32个字符"); + errorLineInfoDto.setSheetName("房屋信息和户主信息"); + errorLineInfoList.add(errorLineInfoDto); + } basePopulationInformationExcel.setOrganizationalRelationshipLocation(organizationalRelationshipLocation); } } @@ -1080,6 +1060,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)) { @@ -1158,6 +1145,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)) { @@ -1183,9 +1177,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 1fc95351..962f4c3b 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 @@ -157,8 +157,22 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl%tv_nW zAjf?uN}`7#dMM0GgoP1^PZ}sx5LBcuy(BCNX%wyVEd;6G<;U;b-#O>r!{sI>gv5j} z*-Le8(~6`?vVJ;3=2?cGD@+HYXuKmE32lENtoP)sy>7LZuW4m##YzJpwvfh%uWMQE z3nx1cMh^MaXc&rNmWAzomdBvvt5ts?KoLOtR&Jw9UqmH#fI?IQ`(Y2UJV!APIC?b} zg9uQ7_8_WS_8N5o^?(h)N&r%*7{?0m7Ur&+~Z0nIz%fzV*CRXQfV^SO69qsM{gJQK$hM*g-*d zLj)8)GvF35(eiJCmBgLsd;jx8aU~VLz*ggvj0~CCT-=-rpK^81^7cD7ny1I^&9|Bp zMWQ;W`cls-lt-VG)}fh?3vaiZ$I3SR7bk~nGs`V?JUI33d~CwQmxdlt@`evyzD+%1 zl_-kUQjK(2k~Y(1(7W53>P=Fu)Fe42H)@XPdz$M_4$)ENupx6xa|<~)Wp4v;Dc zU}E5BVEE7h=CFOp0Md*)3=BL#ntSpOllaZ)ra8=-fAt|knFb6D6+o%IK>7@jmN#Tz z&|_p^Xav#|fb`4Fe=N9o*ti@R7>Zmrzx9`5+^pvIkA;^Ts8$$=LB@(qHuR2VWSHFV z?an960Fq$@$^lv2o1b`JW}LjhM^;)Re0mH6gJGnUA4nDi|Noa}kY?D&=s$U(kLc#J zzU_>Yr~3!6-uGf)=-vFrUxa1y0v4G~A& zgdv5&638}SNZh=)+=U4!VTLX-S)|GWC~l4+9$%F