From 6aa669a8bb6c8133810ad4d708d57e69d6ae5db7 Mon Sep 17 00:00:00 2001
From: tangxiaobao <303826152@qq.com>
Date: 星期一, 02 八月 2021 13:34:44 +0800
Subject: [PATCH] 代码合并

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 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 a2ea07c..4699ff0 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
@@ -364,7 +364,7 @@
     @Transactional(rollbackFor = Exception.class)
     public R listSavePopulation(List<ComMngPopulationServeExcelVO> list, Long communityId) throws Exception {
         List<ComMngPopulationMistakeExcelVO> mistakes = new ArrayList<>();
-        List<ComMngPopulationImportErrorVO> populationImportErrorVOList = new ArrayList<>();
+//        List<ComMngPopulationImportErrorVO> populationImportErrorVOList = new ArrayList<>();
         //查询该社区
         ComActDO comActDO = comActDAO.selectById(communityId);
         //查询该社区的省市区地址
@@ -396,10 +396,10 @@
             //查询小区街路巷是否存在
             ComMngVillageDO comMngVillageDO = comActVillageDAO.selectOne(new QueryWrapper<ComMngVillageDO>().eq("alley", vo.getRoad()).eq("house_num", vo.getDoorNo()).eq("community_id", communityId));
             if (comMngVillageDO == null) {
-                ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO();
-                importErrorVO.setErrorMsg("街路巷或小区号不存在,请先在“小区管理”中添加该小区");
-                importErrorVO.setErrorPosition("街路巷:" + vo.getRoad() + ",小区号:" + vo.getDoorNo());
-                populationImportErrorVOList.add(importErrorVO);
+//                ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO();
+//                importErrorVO.setErrorMsg("街路巷或小区号不存在,请先在“小区管理”中添加该小区");
+//                importErrorVO.setErrorPosition("街路巷:" + vo.getRoad() + ",小区号:" + vo.getDoorNo());
+//                populationImportErrorVOList.add(importErrorVO);
 //                index++;
                 ComMngPopulationMistakeExcelVO mistake = new ComMngPopulationMistakeExcelVO();
                 BeanUtils.copyProperties(vo,mistake);
@@ -434,9 +434,11 @@
             }
             String cardNoAES = AESUtil.encrypt128(vo.getCardNo(), aesKey);
             //判断实有人口是否已存在
-            ComMngPopulationDO populationDO = this.baseMapper.selectOne(new QueryWrapper<ComMngPopulationDO>().lambda()
+            ComMngPopulationDO populationDO = null;
+            List<ComMngPopulationDO> populationDOList = this.baseMapper.selectList(new QueryWrapper<ComMngPopulationDO>().lambda()
                     .eq(ComMngPopulationDO::getCardNo, cardNoAES));
-            if (populationDO == null) {
+
+            if (populationDOList.isEmpty()) {
                 //不存在实有人口,则新增
                 populationDO = savePopulationDO(vo, comActDO, comMngVillageDO);
 //                ComMngPopulationHouseUserDO comMngPopulationHouseUserDO = savePopulationHouseUser(vo, populationDO, populationHouseDO);
@@ -445,7 +447,7 @@
 //                if (vo.getIsRent() != null && vo.getIsRent().equals(PopulHouseUseEnum.SELF.getCode())) {
 //                    populationDO = updatePopulationDO(vo, populationDO);
 //                }
-                populationDO = updatePopulationDO(vo, comActDO, populationDO);
+                populationDO = updatePopulationDO(vo, comActDO, populationDOList.get(0));
             }
 
             //处理实有人口房屋居住信息
@@ -472,8 +474,8 @@
         }
         this.saveBatch(populationDOList);*/
 
-        if (!populationImportErrorVOList.isEmpty()) {
-            return R.fail(mistakes,JSON.toJSONString(populationImportErrorVOList));
+        if (!mistakes.isEmpty()) {
+            return R.fail(mistakes);
         }
         return R.ok();
     }

--
Gitblit v1.7.1