Browse Source

Merge remote-tracking branch 'origin/master' into feature/syp_houseInfoAndActivity

feature/syp_points
songyunpeng 5 years ago
parent
commit
2f856c54f9
  1. 6
      esua-epdc/epdc-commons/epdc-commons-tools/src/main/java/com/elink/esua/epdc/commons/tools/constant/FieldConstant.java
  2. 31
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/events/service/impl/EpdcEventsServiceImpl.java
  3. 10
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/IssueService.java
  4. 30
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/issue/service/impl/IssueServiceImpl.java
  5. 20
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/ItemService.java
  6. 17
      esua-epdc/epdc-module/epdc-events/epdc-events-server/src/main/java/com/elink/esua/epdc/modules/item/service/impl/ItemServiceImpl.java
  7. 5
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/form/PartyGroupTopicTopFormDTO.java
  8. 5
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-client/src/main/java/com/elink/esua/epdc/dto/result/PartyGroupOfficialsResultDTO.java
  9. 2
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/AppPartyTopicController.java
  10. 17
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/controller/PartyTopicController.java
  11. 10
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/java/com/elink/esua/epdc/service/impl/PartyTopicServiceImpl.java
  12. 8
      esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyTopicDao.xml
  13. 3
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/excel/BasePopulationInformationExcel.java
  14. 345
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/HousingInformationServiceImpl.java
  15. 19
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/java/com/elink/esua/epdc/service/impl/PopulationInformationServiceImpl.java
  16. BIN
      esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/excel/居民信息录入模板.xls

6
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";
}

31
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<EpdcEventsDao, EpdcEv
|| "".equals(dto.getCategoryId()))) {
return new Result().error("分类信息不能为空");
}
// 事件审核校验
checkEventReview(dto.getId(), dto.getEventState());
EpdcEventsEntity entity = new EpdcEventsEntity();
entity.setId(dto.getId());
entity.setEventState(dto.getEventState());
@ -739,4 +743,31 @@ public class EpdcEventsServiceImpl extends BaseServiceImpl<EpdcEventsDao, EpdcEv
return eventTagService.listOfEventTags();
}
/**
* 事件审核校验
*
* @param eventId 事件ID
* @param eventState 事件状态
* @return void
* @author Liuchuang
* @since 2020/9/16 10:18
*/
private void checkEventReview(String eventId, int eventState) {
boolean checkResult;
if (EventIssueItemState.EVENT_REVIEW_PASS == eventState) {
int issueCount = issueService.selectIssueCountByEventId(eventId);
checkResult = issueCount > 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("该事件已审核,请勿重复操作");
}
}
}

10
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<IssueEntity> {
* @since 2020/3/7 12:50
*/
void modifyPartyGroupName(List<GroupFormDTO> groups);
/**
* 根据事件ID获取议题数量
*
* @param eventId 事件ID
* @return int
* @author Liuchuang
* @since 2020/9/16 10:31
*/
int selectIssueCountByEventId(String eventId);
}

30
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<IssueDao, IssueEntity> 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<IssueDao, IssueEntity> imp
return new Result();
}
@Override
public int selectIssueCountByEventId(String eventId) {
QueryWrapper<IssueEntity> 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("该议题已转为项目,请勿重复操作");
}
}
}
}

20
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<ItemEntity> {
* @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);
}

17
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<ItemDao, ItemEntity> implem
baseDao.rejectItemSatisfactionInfo(dto.getRelationId());
return new Result();
}
@Override
public int selectItemCountByEventId(String eventId) {
QueryWrapper<ItemEntity> wrapper = new QueryWrapper<>();
wrapper.eq(FieldConstant.EVENT_ID, eventId);
return baseDao.selectCount(wrapper);
}
@Override
public int selectItemCountByIssueId(String issueId) {
QueryWrapper<ItemEntity> wrapper = new QueryWrapper<>();
wrapper.eq(FieldConstant.ISSUE_ID, issueId);
return baseDao.selectCount(wrapper);
}
}

5
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;
}

5
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;
}

2
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);
}

17
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);
}
}

10
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<PartyTopicDao, PartyT
@Override
public Result modifyTopicTopFlag(PartyGroupTopicTopFormDTO formDto) {
// 校验用户是否是群主或者副群主
int num = baseDao.selectGroupUserByUserIdAndTopicId(formDto);
if (num <= NumConstant.ZERO) {
return new Result().error("您不是群主或副群主,不能进行置顶操作");
if (NumConstant.ZERO_STR.equals(formDto.getSystemFlag())) {
// 校验用户是否是群主或者副群主
int num = baseDao.selectGroupUserByUserIdAndTopicId(formDto);
if (num <= NumConstant.ZERO) {
return new Result().error("您不是群主或副群主,不能进行置顶操作");
}
}
// 更新话题置顶状态

8
esua-epdc/epdc-module/epdc-party-group/epdc-party-group-server/src/main/resources/mapper/PartyTopicDao.xml

@ -32,6 +32,8 @@
<result property="createdTime" column="CREATED_TIME"/>
<result property="updatedBy" column="UPDATED_BY"/>
<result property="updatedTime" column="UPDATED_TIME"/>
<result property="topFlag" column="TOP_FLAG"/>
<result property="topTime" column="TOP_TIME"/>
</resultMap>
@ -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'
<if test="groupId!=null and groupId!=''">
@ -79,7 +83,7 @@
<if test="endTime != null and endTime != '' ">
<![CDATA[ and t.CREATED_TIME <= ]]> #{endTime}
</if>
order by CREATED_TIME desc
order by t.TOP_TIME DESC, t.CREATED_TIME desc
</select>
<resultMap id="topicDetail" type="com.elink.esua.epdc.dto.PartyTopicDTO">

3
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;

345
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<HousingInform
residentParams.put("RESIDENT_ID", houseResidentEntity.getResidentId());
List<HouseResidentEntity> 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<String, Object> residentParams = new HashMap<>();
residentParams.put("HOUSE_HEAD_ID", populationIds.get(0));
houseResidentDao.deleteByMap(residentParams);
List<HouseResidentEntity> houseResidentEntityList = houseResidentDao.selectByMap(residentParams);
if(houseResidentEntityList!=null && houseResidentEntityList.size()>0){
List<String> 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<HousingInform
}
return populationIdNoAndIdMap;
}
/**
* @return void
* @Description 校验完成后新增人口信息 - 因为不填写产权证而废弃
* @Author songyunpeng
* @Date 2020/8/31
* @Param [basePopulationInformationExcels]
**/
@Deprecated
private Map<String,String> savePopulationList(List<BasePopulationInformationExcel> basePopulationInformationExcels, ParentAndAllDeptDTO parentAndAllDeptDTO) {
//插入房屋信息
List<HousingInformationEntity> 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<HouseRentInfoEntity> houseRentInfoEntities = new ArrayList<>();
List<HouseBusinessInfoEntity> houseBusinessInfoEntities = new ArrayList<>();
//更新户主信息
List<PopulationInformationEntity> updatePopulationInfo = new ArrayList<>();
//插入户主信息
List<PopulationInformationEntity> insertPopulationInfo = new ArrayList<>();
//房屋户主信息 -- 户主更新
List<HouseResidentEntity> houseResidentEntityList = new ArrayList<>();
//身份证校验
List<String> identifyNoValidation = new ArrayList<>();
//存储 key:身份证 value 房子ID 身份证是可重复的
List<Map<String, String>> 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<String, String> 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<String, String> houseResidentInfo : HouseResidentInfos) {
Set<Map.Entry<String, String>> set = houseResidentInfo.entrySet();
for (Map.Entry<String, String> 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<String,String> populationIdNoAndIdMap = new HashMap<>();
insertPopulationInfo.forEach(i -> {
populationIdNoAndIdMap.put(i.getResidentsIdentityNo(),i.getId());
});
return populationIdNoAndIdMap;
}
/**
@ -635,11 +506,15 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
private void validateHouseHeadInfo(PopulationInformationEntity populationInformationEntity, BasePopulationInformationExcel basePopulationInformationExcel) {
//赋值失业登记时间
if (StringUtils.isNotBlank(basePopulationInformationExcel.getUnemploymentRegisterTime())) {
populationInformationEntity.setUnemploymentRegisterTime(DateUtil.parse(basePopulationInformationExcel.getUnemploymentRegisterTime()));
if(IdentityNoUtils.isStrDate(basePopulationInformationExcel.getUnemploymentRegisterTime())){
populationInformationEntity.setUnemploymentRegisterTime(DateUtil.parse(basePopulationInformationExcel.getUnemploymentRegisterTime()));
}
}
//赋值入党时间
if (StringUtils.isNotBlank(basePopulationInformationExcel.getJoinTime())) {
populationInformationEntity.setJoinTime(DateUtil.parse(basePopulationInformationExcel.getJoinTime()));
if(IdentityNoUtils.isStrDate(basePopulationInformationExcel.getJoinTime())){
populationInformationEntity.setJoinTime(DateUtil.parse(basePopulationInformationExcel.getJoinTime()));
}
}
//如果状态为群众。清空excel中多余的入党时间和组织关系所在地
if ("0".equals(basePopulationInformationExcel.getPoliticsStatus())) {
@ -651,35 +526,56 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
populationInformationEntity.setOrganizationalRelationshipLocation("");
}
if ("0".equals(basePopulationInformationExcel.getEmploymentStatus())) {
//如果选在岗,则清空失业原因,再就业优惠政,失业登记和失业登记时间
populationInformationEntity.setUnemploymentReason("");
populationInformationEntity.setReemploymentPermit("");
populationInformationEntity.setUnemploymentRegister("");
clearEmployedInfo(populationInformationEntity);
} else if ("1".equals(basePopulationInformationExcel.getEmploymentStatus())) {
clearUnEmployedInfo(populationInformationEntity);
} else {
clearEmployedInfo(populationInformationEntity);
clearUnEmployedInfo(populationInformationEntity);
}
if(basePopulationInformationExcel.getMotorVehicleNum()!=null && basePopulationInformationExcel.getMotorVehicleNum()==0){
//如果机动车数量为0 清空机动车类型
populationInformationEntity.setMotorVehicleCategory("");
}
}
/**
* @Description 清空在岗信息
* @Author songyunpeng
* @Date 2020/9/16
* @Param [populationInformationEntity]
* @return void
**/
private void clearUnEmployedInfo(PopulationInformationEntity populationInformationEntity){
//如果选择失业,也清空 工作单位 和工作单位地址
populationInformationEntity.setCurrentEmployer("");
populationInformationEntity.setCurrentEmployerAddress("");
//如果失业且失业登记为否,清空失业登记时间
if ("0".equals(populationInformationEntity.getUnemploymentRegister())) {
if(StringUtils.isNotBlank(populationInformationEntity.getId())){
//ID不为空为更新,此时手动置空失业登记时间时间
populationInformationService.setUnemploymentRegisterTimeToNull(populationInformationEntity.getId());
}
populationInformationEntity.setUnemploymentRegisterTime(null);
} else if ("1".equals(basePopulationInformationExcel.getEmploymentStatus())) {
//如果选择失业,也清空 工作单位 和工作单位地址
populationInformationEntity.setCurrentEmployer("");
populationInformationEntity.setCurrentEmployerAddress("");
//如果失业且失业登记为否,清空失业登记时间
if ("0".equals(populationInformationEntity.getUnemploymentRegister())) {
if(StringUtils.isNotBlank(populationInformationEntity.getId())){
//ID不为空为更新,此时手动置空失业登记时间时间
populationInformationService.setUnemploymentRegisterTimeToNull(populationInformationEntity.getId());
}
populationInformationEntity.setUnemploymentRegisterTime(null);
}
}
if(basePopulationInformationExcel.getMotorVehicleNum()!=null && basePopulationInformationExcel.getMotorVehicleNum()==0){
//如果机动车数量为0 清空机动车类型
populationInformationEntity.setMotorVehicleCategory("");
}
/**
* @Description 清空失业
* @Author songyunpeng
* @Date 2020/9/16
* @Param [populationInformationEntity]
* @return void
**/
private void clearEmployedInfo(PopulationInformationEntity populationInformationEntity){
//如果选在岗,则清空失业原因,再就业优惠政,失业登记和失业登记时间
populationInformationEntity.setUnemploymentReason("");
populationInformationEntity.setReemploymentPermit("");
populationInformationEntity.setUnemploymentRegister("");
if(StringUtils.isNotBlank(populationInformationEntity.getId())){
//ID不为空为更新,此时手动置空失业登记时间时间
populationInformationService.setUnemploymentRegisterTimeToNull(populationInformationEntity.getId());
}
populationInformationEntity.setUnemploymentRegisterTime(null);
}
/**
* @return java.util.List<com.elink.esua.epdc.dto.epdc.result.EpdcPopulationErrorResultDTO>
* @Description 校验居住人数据
@ -852,6 +748,13 @@ public class HousingInformationServiceImpl extends BaseServiceImpl<HousingInform
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}else if(StringUtils.isNotBlank((houseAddress))){
if(houseAddress.length()>32){
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 BaseServiceImpl<HousingInform
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}else if(StringUtils.isNotBlank((propertyOwner))){
if(propertyOwner.length()>32){
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 BaseServiceImpl<HousingInform
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}else if(StringUtils.isNotBlank((propertyOwnerIdentityNo))){
if(propertyOwnerIdentityNo.length()>32){
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 BaseServiceImpl<HousingInform
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}else if(StringUtils.isNotBlank((propertyOwnerMobile))){
if(propertyOwnerMobile.length()>32){
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 BaseServiceImpl<HousingInform
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}else if(StringUtils.isNotBlank((tenantName))){
if(tenantName.length()>32){
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 BaseServiceImpl<HousingInform
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}else if(StringUtils.isNotBlank((tenantPhone))){
if(tenantPhone.length()>32){
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 BaseServiceImpl<HousingInform
}
} else if (HouseUseConstant.BUSINESS.equals(houseUse)) {
if(StringUtils.isNotBlank((enterpriseName))){
if(enterpriseName.length()>128){
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 BaseServiceImpl<HousingInform
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}else if(StringUtils.isNotBlank((enterprisePhone))){
if(enterprisePhone.length()>32){
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 BaseServiceImpl<HousingInform
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}else if(StringUtils.isNotBlank((residentsName))){
if(residentsName.length()>32){
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 BaseServiceImpl<HousingInform
basePopulationInformationExcel.setJoinTime(joinTime);
}
if(StringUtils.isNotBlank((organizationalRelationshipLocation))){
if(organizationalRelationshipLocation.length()>32){
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 BaseServiceImpl<HousingInform
errorLineInfoDto.setSheetName("房屋信息和户主信息");
errorLineInfoList.add(errorLineInfoDto);
}else if(StringUtils.isNotBlank((residentsPhone))){
if(residentsPhone.length()>32){
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 BaseServiceImpl<HousingInform
errorLineInfoList.add(errorLineInfoDto);
}
if(StringUtils.isNotBlank((householdRegistrationPlace))){
if(householdRegistrationPlace.length()>32){
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 BaseServiceImpl<HousingInform
}
if ("在岗".equals(employmentStatus)) {
if(StringUtils.isNotBlank((currentEmployer))){
if(currentEmployer.length()>128){
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)) {

19
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<Population
entity.setUnemploymentRegister("");
this.setUnemploymentRegisterTimeToNull(entity.getId());
entity.setUnemploymentRegisterTime(null);
}
if("1".equals(dto.getEmploymentStatus())){
} else if("1".equals(dto.getEmploymentStatus())){
//如果选择为失业,则置空工作单位和工作地址
entity.setCurrentEmployer("");
entity.setCurrentEmployerAddress("");
if("0".equals(dto.getUnemploymentRegister())){
//如果表单选择的是失业 且就业登记为否 则也置空失业登记时间
this.setUnemploymentRegisterTimeToNull(entity.getId());
entity.setUnemploymentRegisterTime(null);
}
} else {
//如果表单选择的是在岗,则清空失业原因,再就业优惠政,失业登记和失业登记时间
entity.setUnemploymentReason("");
entity.setReemploymentPermit("");
entity.setUnemploymentRegister("");
this.setUnemploymentRegisterTimeToNull(entity.getId());
entity.setUnemploymentRegisterTime(null);
//如果选择为失业,则置空工作单位和工作地址
entity.setCurrentEmployer("");
entity.setCurrentEmployerAddress("");
@ -180,7 +194,6 @@ public class PopulationInformationServiceImpl extends BaseServiceImpl<Population
//如果表单选择的是失业 且就业登记为否 则也置空失业登记时间
this.setUnemploymentRegisterTimeToNull(entity.getId());
entity.setUnemploymentRegisterTime(null);
}
}

BIN
esua-epdc/epdc-module/epdc-user/epdc-user-server/src/main/resources/excel/居民信息录入模板.xls

Binary file not shown.
Loading…
Cancel
Save