From f7d7e5b1eeed518b896bd1822c612a13856bcf60 Mon Sep 17 00:00:00 2001
From: tangxiaobao <303826152@qq.com>
Date: 星期一, 02 八月 2021 13:35:02 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/test' into txb

---
 springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java
index e035edb..5373d17 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java
@@ -114,6 +114,7 @@
          */
         private void saveData() {
             R<List<BcDictionaryVO>> dictionaryR = communityService.listDictionaryByKey(BcDictionaryConstants.FAMILY);
+            log.info("开始导入人口数据");
             ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue();
             String key = Constants.POPULATION_ERROR_LIST + communityId;
 
@@ -567,8 +568,11 @@
 //            }
                 //根据list中的IdCard城市来去重
                 List<ComMngPopulationServeExcelVO> newVoList = voList.stream().filter(ListUtils.distinctByKey(ComMngPopulationServeExcelVO::getDistinctPass)).collect(Collectors.toList());
+                log.info("开始进入业务层处理逻辑");
                 R r = communityService.listSavePopulationServeExcelVO(newVoList, communityId);
+                log.info("业务层处理逻辑完成");
                 if (!R.isOk(r)) {
+                    log.info("业务层处理成功");
                     List<ComMngPopulationMistakeExcelVO> list = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComMngPopulationMistakeExcelVO.class);
 //                    String errMsg = r.getMsg();
 //                    List<ComMngPopulationImportErrorVO> errorList = JSON.parseArray(errMsg,ComMngPopulationImportErrorVO.class);
@@ -576,30 +580,39 @@
 //                        populationImportErrorVOList.addAll(errorList);
 //                    }
                     mistakes.addAll(list);
+                    log.info("将错误数据存入redis中");
                     valueOperations.set(key,JSONArray.toJSONString(mistakes),1, TimeUnit.HOURS);
+                    log.info("将错误数据存入redis中成功");
                     throw new ServiceException("500", key);
                 }else{
+                    log.info("业务层处理逻辑失败");
                     if(!mistakes.isEmpty()){
+                        log.info("业务层处理逻辑失败,将错误数据缓存到redis中");
                         valueOperations.set(key,JSONArray.toJSONString(mistakes),1, TimeUnit.HOURS);
+                        log.info("业务层处理逻辑失败,将错误数据缓存到redis中成功");
                         throw new ServiceException("500", key);
                     }
                 }
             } catch (NumberFormatException e) {
+                log.info("处理数据时失败");
                 e.printStackTrace();
 //                List<ComMngPopulationImportErrorVO> populationImportErrorVOList = new ArrayList<>();
 //                ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO();
 //                importErrorVO.setErrorPosition("第" + index + "行");
 //                importErrorVO.setErrorMsg("数据格式有误,请检查文档内数据");
 //                populationImportErrorVOList.add(importErrorVO);
-                throw new ServiceException("500", "导入失败");
+                log.error("数据格式有误,第" + index + "行");
+                throw new ServiceException("500", "导入失败111");
             } catch (ParseException e1) {
+                log.info("处理数据时失败2");
                 e1.printStackTrace();
 //                List<ComMngPopulationImportErrorVO> populationImportErrorVOList = new ArrayList<>();
 //                ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO();
 //                importErrorVO.setErrorPosition("第" + index + "行");
 //                importErrorVO.setErrorMsg("数据格式有误,请检查文档内数据");
 //                populationImportErrorVOList.add(importErrorVO);
-                throw new ServiceException("500", "导入失败");
+                log.error("数据格式有误,第" + index + "行");
+                throw new ServiceException("500", "导入失败222");
             }
         }
 

--
Gitblit v1.7.1