huanghongfa
2021-04-28 2f0a186a0408cc508cef85af46abeb4f96a2ae4f
暂时修改实有人口导入逻辑
2个文件已修改
33 ■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java
@@ -186,13 +186,27 @@
                voList.add(vo);
                index++;
            }
            if(populationImportErrorVOList.isEmpty()){
                R r = communityService.listSavePopulationServeExcelVO(voList, communityId);
                if (!R.isOk(r)) {
                    throw new ServiceException(r.getMsg());
            //客户需要暂时注释,等客户处理完成需要恢复
//            if(populationImportErrorVOList.isEmpty()){
//                R r = communityService.listSavePopulationServeExcelVO(voList, communityId);
//                if (!R.isOk(r)) {
//                    throw new ServiceException(r.getMsg());
//                }
//            }else{
//                throw new ServiceException("500", JSON.toJSONString(populationImportErrorVOList));
//            }
            R r = communityService.listSavePopulationServeExcelVO(voList, communityId);
            if (!R.isOk(r)) {
                String errMsg = r.getMsg();
                List<ComMngPopulationImportErrorVO> errorList = JSON.parseArray(errMsg,ComMngPopulationImportErrorVO.class);
                if(!errorList.isEmpty()){
                    populationImportErrorVOList.addAll(errorList);
                }
            }else{
                throw new ServiceException("500", JSON.toJSONString(populationImportErrorVOList));
            }else{
                if(!populationImportErrorVOList.isEmpty()){
                    throw new ServiceException("500", JSON.toJSONString(populationImportErrorVOList));
                }
            }
        } catch (NumberFormatException e) {
            List<ComMngPopulationImportErrorVO> populationImportErrorVOList = new ArrayList<>();
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
@@ -255,11 +255,16 @@
            index++;
        }
        //如果有错误,返回错误
        //暂时注释,等客户完成任务需要恢复
        /*if(!populationImportErrorVOList.isEmpty()){
            return R.fail(JSON.toJSONString(populationImportErrorVOList));
        }
        this.saveBatch(populationDOList);*/
        this.saveBatch(populationDOList);
        if(!populationImportErrorVOList.isEmpty()){
            return R.fail(JSON.toJSONString(populationImportErrorVOList));
        }
        this.saveBatch(populationDOList);
        return R.ok("共计导入实有人口数量:" + populationDOList.size());
    }