From 483a07154eed1c3af9ef3d4f48071646f3714d2c Mon Sep 17 00:00:00 2001 From: 罗元桥 <2376770955@qq.com> Date: 星期日, 01 八月 2021 15:50:15 +0800 Subject: [PATCH] Merge branch 'test' into 'master' --- springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java | 15 +++++++++++++-- 1 files changed, 13 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 26e8bfe..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,15 +580,21 @@ // 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(); @@ -592,8 +602,9 @@ // importErrorVO.setErrorMsg("数据格式有误,请检查文档内数据"); // populationImportErrorVOList.add(importErrorVO); log.error("数据格式有误,第" + index + "行"); - throw new ServiceException("500", "导入失败"); + throw new ServiceException("500", "导入失败111"); } catch (ParseException e1) { + log.info("处理数据时失败2"); e1.printStackTrace(); // List<ComMngPopulationImportErrorVO> populationImportErrorVOList = new ArrayList<>(); // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); @@ -601,7 +612,7 @@ // importErrorVO.setErrorMsg("数据格式有误,请检查文档内数据"); // populationImportErrorVOList.add(importErrorVO); log.error("数据格式有误,第" + index + "行"); - throw new ServiceException("500", "导入失败"); + throw new ServiceException("500", "导入失败222"); } } -- Gitblit v1.7.1