From de1e89f065034bc7470dfbc5e1f674fc84357ea2 Mon Sep 17 00:00:00 2001
From: huanghongfa <huanghongfa123456>
Date: 星期五, 30 七月 2021 14:19:54 +0800
Subject: [PATCH] 修改bug
---
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java | 23 ++++++++++++++++++++++-
1 files changed, 22 insertions(+), 1 deletions(-)
diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
index a5aa7e2..a2ea07c 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
@@ -363,6 +363,7 @@
@Override
@Transactional(rollbackFor = Exception.class)
public R listSavePopulation(List<ComMngPopulationServeExcelVO> list, Long communityId) throws Exception {
+ List<ComMngPopulationMistakeExcelVO> mistakes = new ArrayList<>();
List<ComMngPopulationImportErrorVO> populationImportErrorVOList = new ArrayList<>();
//查询该社区
ComActDO comActDO = comActDAO.selectById(communityId);
@@ -400,6 +401,11 @@
importErrorVO.setErrorPosition("街路巷:" + vo.getRoad() + ",小区号:" + vo.getDoorNo());
populationImportErrorVOList.add(importErrorVO);
// index++;
+ ComMngPopulationMistakeExcelVO mistake = new ComMngPopulationMistakeExcelVO();
+ BeanUtils.copyProperties(vo,mistake);
+ setMistake(mistake, vo);
+ mistake.setMistake("街路巷或小区号不存在,请先在“小区管理”中添加该小区:街路巷:"+ vo.getRoad() +",小区号:" + vo.getDoorNo());
+ mistakes.add(mistake);
continue;
}
@@ -467,7 +473,7 @@
this.saveBatch(populationDOList);*/
if (!populationImportErrorVOList.isEmpty()) {
- return R.fail(JSON.toJSONString(populationImportErrorVOList));
+ return R.fail(mistakes,JSON.toJSONString(populationImportErrorVOList));
}
return R.ok();
}
@@ -1908,4 +1914,19 @@
return R.ok(this.baseMapper.getVillagePopulationAdmin(new Page(villagePopulationDTO.getPageNum(),villagePopulationDTO.getPageSize()),villagePopulationDTO));
}
+ private void setMistake(ComMngPopulationMistakeExcelVO mvo, ComMngPopulationServeExcelVO vo){
+ mvo.setPoliticalOutlook(PopulPoliticalOutlookEnum.getCnDescByName(vo.getPoliticalOutlook()));
+ mvo.setIsRent(PopulHouseUseEnum.getCnDescByName(vo.getIsRent()));
+ mvo.setRelation(PopulRelationEnum.getCnDescByName(vo.getRelation()));
+ mvo.setHouseStatus(PopulHouseStatusEnum.getCnDescByName(vo.getHouseStatus()));
+ mvo.setHousePurpose(PopulHousePurposeEnum.getCnDescByName(vo.getHousePurpose()));
+ mvo.setControlStatus(PopulHouseControlStatusEnum.getCnDescByName(vo.getControlStatus()));
+ mvo.setCultureLevel(PopulCultureLevelEnum.getCnDescByName(vo.getCultureLevel()));
+ mvo.setMarriage(PopulMarriageEnum.getCnDescByName(vo.getMarriage()));
+ mvo.setOutOrLocal(PopulOutOrLocalEnum.getCnDescByName(vo.getOutOrLocal()));
+ mvo.setResidence(PopulRelationEnum.getCnDescByName(vo.getResidence()));
+ mvo.setPersonType(PopulPersonTypeEnum.getCnDescByName(vo.getPersonType()));
+ mvo.setDeath(PopulOutOrLocalEnum.getCnDescByName(vo.getDeath()));
+ }
+
}
\ No newline at end of file
--
Gitblit v1.7.1