tangxiaobao
2021-08-19 14317726aca669284ddf4e6b65a03091d3826cd2
实有人口和社区关系以及对应标签修改
5个文件已添加
18个文件已修改
930 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationCorrectExcelListen.java 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationCultExcelListen.java 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationDisabilityExcelListen.java 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationDrugExcelListen.java 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationKeyExcelListen.java 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationLowSecurityExcelListen.java 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationMajorExcelListen.java 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationRehabilitationExcelListen.java 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationSentenceExcelListen.java 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java 68 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationVeteransExcelListen.java 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/PopulationApi.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommonDataApi.java 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationCommunityTagsDAO.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComMngPopulationCommunityTagsDO.java 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComMngPopulationDO.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngPopulationCommunityTagsService.java 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngPopulationService.java 22 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationCommunityTagsServiceImpl.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java 170 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComMngPopulationCommunityTagsMapper.xml 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationCorrectExcelListen.java
@@ -48,31 +48,18 @@
    private Long communityId;
    private Long userId;
    private static int headSize = 0;
    private Map<Integer, String> headData;
    private String userName;
    // FTP 登录密码
    private String password;
    // FTP 服务器地址IP地址
    private String host;
    // FTP 端口
    private int port;
    private String excelUrl;
    private StringRedisTemplate stringRedisTemplate;
    public static String loadUrl;
    public ComMngPopulationCorrectExcelListen(CommunityService communityService, Long communityId, String userName, String password, String host, int port, String excelUrl, StringRedisTemplate stringRedisTemplate) {
    public ComMngPopulationCorrectExcelListen(CommunityService communityService, Long communityId, Long userId, StringRedisTemplate stringRedisTemplate) {
            this.communityService = communityService;
            this.communityId = communityId;
            this.userName = userName;
            this.password = password;
            this.host = host;
            this.port = port;
            this.excelUrl = excelUrl;
            this.userId = userId;
            this.stringRedisTemplate = stringRedisTemplate;
        }
@@ -502,7 +489,7 @@
                //根据list中的IdCard城市来去重
                List<ComMngPopulationCorrectExcelVO> newVoList = voList.stream().filter(ListUtils.distinctByKey(ComMngPopulationCorrectExcelVO::getDistinctPass)).collect(Collectors.toList());
                log.info("开始进入业务层处理逻辑");
                R r = communityService.listSavePopulationCorrectExcelVO(newVoList, communityId);
                R r = communityService.listSavePopulationCorrectExcelVO(newVoList, communityId, userId);
                log.info("业务层处理逻辑完成");
                if (!R.isOk(r)) {
                    log.info("业务层处理成功");
@@ -588,51 +575,6 @@
        vo.setPubishmentChange(map.get(45));
        vo.setRemark(map.get(46));
    }
        private R mistakeExportPopulation(List<ComMngPopulationMistakeExcelVO> vo) {
            //生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址
            String ftpUrl = "/mnt/data/web/excel/";
            String name = "实有人口错误数据.xlsx";
            try {
                SFTPUtil sftp = new SFTPUtil(userName, password, host, port);
                sftp.login();
                boolean existDir = sftp.isExistDir(ftpUrl + name);
                if (!existDir) {
                    String property = System.getProperty("user.dir");
                    String fileName = property + File.separator + name;
                    // 这里 需要指定写用哪个class去写
                    ExcelWriter excelWriter = null;
                    InputStream inputStream = null;
                    try {
                        excelWriter = EasyExcel.write(fileName, ComMngPopulationMistakeExcelVO.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).registerWriteHandler(new CustomSheetWriteHandler()).build();
                        WriteSheet writeSheet = EasyExcel.writerSheet("实有人口错误数据").build();
                        excelWriter.write(vo, writeSheet);
                        excelWriter.finish();
                        File file = new File(fileName);
                        inputStream = new FileInputStream(file);
                        sftp.uploadMore(ftpUrl, name, inputStream);
                        sftp.logout();
                        inputStream.close();
                        String absolutePath = file.getAbsolutePath();
                        boolean delete = file.delete();
                        log.info("删除excel【{}】结果【{}】", absolutePath, delete);
                    } finally {
                        // 千万别忘记finish 会帮忙关闭流
                        if (inputStream != null) {
                            inputStream.close();
                        }
                        if (excelWriter != null) {
                            excelWriter.finish();
                        }
                    }
                }
                return R.ok(excelUrl + name);
            } catch (Exception e) {
                e.printStackTrace();
                log.error("文件传输失败【{}】", e.getMessage());
                return R.fail();
            }
        }
        private String convertMarriage(String ma) {
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationCultExcelListen.java
@@ -38,31 +38,18 @@
    private Long communityId;
    private Long userId;
    private static int headSize = 0;
    private Map<Integer, String> headData;
    private String userName;
    // FTP 登录密码
    private String password;
    // FTP 服务器地址IP地址
    private String host;
    // FTP 端口
    private int port;
    private String excelUrl;
    private StringRedisTemplate stringRedisTemplate;
    public static String loadUrl;
    public ComMngPopulationCultExcelListen(CommunityService communityService, Long communityId, String userName, String password, String host, int port, String excelUrl, StringRedisTemplate stringRedisTemplate) {
    public ComMngPopulationCultExcelListen(CommunityService communityService, Long communityId, Long userId, StringRedisTemplate stringRedisTemplate) {
            this.communityService = communityService;
            this.communityId = communityId;
            this.userName = userName;
            this.password = password;
            this.host = host;
            this.port = port;
            this.excelUrl = excelUrl;
            this.userId = userId;
            this.stringRedisTemplate = stringRedisTemplate;
        }
@@ -396,7 +383,7 @@
                //根据list中的IdCard城市来去重
                List<ComMngPopulationCultExcelVO> newVoList = voList.stream().filter(ListUtils.distinctByKey(ComMngPopulationCultExcelVO::getDistinctPass)).collect(Collectors.toList());
                log.info("开始进入业务层处理逻辑");
                R r = communityService.listSavePopulationCultExcelVO(newVoList, communityId);
                R r = communityService.listSavePopulationCultExcelVO(newVoList, communityId, userId);
                log.info("业务层处理逻辑完成");
                if (!R.isOk(r)) {
                    log.info("业务层处理成功");
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationDisabilityExcelListen.java
@@ -39,31 +39,18 @@
    private Long communityId;
    private Long userId;
    private static int headSize = 0;
    private Map<Integer, String> headData;
    private String userName;
    // FTP 登录密码
    private String password;
    // FTP 服务器地址IP地址
    private String host;
    // FTP 端口
    private int port;
    private String excelUrl;
    private StringRedisTemplate stringRedisTemplate;
    public static String loadUrl;
    public ComMngPopulationDisabilityExcelListen(CommunityService communityService, Long communityId, String userName, String password, String host, int port, String excelUrl, StringRedisTemplate stringRedisTemplate) {
    public ComMngPopulationDisabilityExcelListen(CommunityService communityService, Long communityId, Long userId, StringRedisTemplate stringRedisTemplate) {
            this.communityService = communityService;
            this.communityId = communityId;
            this.userName = userName;
            this.password = password;
            this.host = host;
            this.port = port;
            this.excelUrl = excelUrl;
            this.userId = userId;
            this.stringRedisTemplate = stringRedisTemplate;
        }
@@ -358,7 +345,7 @@
                //根据list中的IdCard城市来去重
                List<ComMngPopulationDisabilityExcelVO> newVoList = voList.stream().filter(ListUtils.distinctByKey(ComMngPopulationDisabilityExcelVO::getDistinctPass)).collect(Collectors.toList());
                log.info("开始进入业务层处理逻辑");
                R r = communityService.listSavePopulationDisabilityExcelVO(newVoList, communityId);
                R r = communityService.listSavePopulationDisabilityExcelVO(newVoList, communityId, userId);
                log.info("业务层处理逻辑完成");
                if (!R.isOk(r)) {
                    log.info("业务层处理成功");
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationDrugExcelListen.java
@@ -51,31 +51,18 @@
    private Long communityId;
    private Long userId;
    private static int headSize = 0;
    private Map<Integer, String> headData;
    private String userName;
    // FTP 登录密码
    private String password;
    // FTP 服务器地址IP地址
    private String host;
    // FTP 端口
    private int port;
    private String excelUrl;
    private StringRedisTemplate stringRedisTemplate;
    public static String loadUrl;
    public ComMngPopulationDrugExcelListen(CommunityService communityService, Long communityId, String userName, String password, String host, int port, String excelUrl, StringRedisTemplate stringRedisTemplate) {
    public ComMngPopulationDrugExcelListen(CommunityService communityService, Long communityId, Long userId , StringRedisTemplate stringRedisTemplate) {
            this.communityService = communityService;
            this.communityId = communityId;
            this.userName = userName;
            this.password = password;
            this.host = host;
            this.port = port;
            this.excelUrl = excelUrl;
            this.userId = userId;
            this.stringRedisTemplate = stringRedisTemplate;
        }
@@ -383,7 +370,7 @@
                //根据list中的IdCard城市来去重
                List<ComMngPopulationDrugExcelVO> newVoList = voList.stream().filter(ListUtils.distinctByKey(ComMngPopulationDrugExcelVO::getDistinctPass)).collect(Collectors.toList());
                log.info("开始进入业务层处理逻辑");
                R r = communityService.listSavePopulationDrugExcelVO(newVoList, communityId);
                R r = communityService.listSavePopulationDrugExcelVO(newVoList, communityId, userId);
                log.info("业务层处理逻辑完成");
                if (!R.isOk(r)) {
                    log.info("业务层处理成功");
@@ -450,51 +437,6 @@
        vo.setCrimeSutiation(map.get(26));
        vo.setRemark(map.get(27));
    }
        private R mistakeExportPopulation(List<ComMngPopulationMistakeExcelVO> vo) {
            //生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址
            String ftpUrl = "/mnt/data/web/excel/";
            String name = "实有人口错误数据.xlsx";
            try {
                SFTPUtil sftp = new SFTPUtil(userName, password, host, port);
                sftp.login();
                boolean existDir = sftp.isExistDir(ftpUrl + name);
                if (!existDir) {
                    String property = System.getProperty("user.dir");
                    String fileName = property + File.separator + name;
                    // 这里 需要指定写用哪个class去写
                    ExcelWriter excelWriter = null;
                    InputStream inputStream = null;
                    try {
                        excelWriter = EasyExcel.write(fileName, ComMngPopulationMistakeExcelVO.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).registerWriteHandler(new CustomSheetWriteHandler()).build();
                        WriteSheet writeSheet = EasyExcel.writerSheet("实有人口错误数据").build();
                        excelWriter.write(vo, writeSheet);
                        excelWriter.finish();
                        File file = new File(fileName);
                        inputStream = new FileInputStream(file);
                        sftp.uploadMore(ftpUrl, name, inputStream);
                        sftp.logout();
                        inputStream.close();
                        String absolutePath = file.getAbsolutePath();
                        boolean delete = file.delete();
                        log.info("删除excel【{}】结果【{}】", absolutePath, delete);
                    } finally {
                        // 千万别忘记finish 会帮忙关闭流
                        if (inputStream != null) {
                            inputStream.close();
                        }
                        if (excelWriter != null) {
                            excelWriter.finish();
                        }
                    }
                }
                return R.ok(excelUrl + name);
            } catch (Exception e) {
                e.printStackTrace();
                log.error("文件传输失败【{}】", e.getMessage());
                return R.fail();
            }
        }
        private String convertMarriage(String ma) {
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationKeyExcelListen.java
@@ -47,31 +47,18 @@
    private Long communityId;
    private Long userId;
    private static int headSize = 0;
    private Map<Integer, String> headData;
    private String userName;
    // FTP 登录密码
    private String password;
    // FTP 服务器地址IP地址
    private String host;
    // FTP 端口
    private int port;
    private String excelUrl;
    private StringRedisTemplate stringRedisTemplate;
    public static String loadUrl;
    public ComMngPopulationKeyExcelListen(CommunityService communityService, Long communityId, String userName, String password, String host, int port, String excelUrl, StringRedisTemplate stringRedisTemplate) {
    public ComMngPopulationKeyExcelListen(CommunityService communityService, Long communityId, Long userId, StringRedisTemplate stringRedisTemplate) {
            this.communityService = communityService;
            this.communityId = communityId;
            this.userName = userName;
            this.password = password;
            this.host = host;
            this.port = port;
            this.excelUrl = excelUrl;
            this.userId = userId;
            this.stringRedisTemplate = stringRedisTemplate;
        }
@@ -348,7 +335,7 @@
                //根据list中的IdCard城市来去重
                List<ComMngPopulationKeyExcelVO> newVoList = voList.stream().filter(ListUtils.distinctByKey(ComMngPopulationKeyExcelVO::getDistinctPass)).collect(Collectors.toList());
                log.info("开始进入业务层处理逻辑");
                R r = communityService.listSavePopulationKeyExcelVO(newVoList, communityId);
                R r = communityService.listSavePopulationKeyExcelVO(newVoList, communityId, userId);
                log.info("业务层处理逻辑完成");
                if (!R.isOk(r)) {
                    log.info("业务层处理成功");
@@ -405,51 +392,6 @@
        vo.setCensusRegister(map.get(16));
        vo.setRemark(map.get(17));
    }
        private R mistakeExportPopulation(List<ComMngPopulationMistakeExcelVO> vo) {
            //生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址
            String ftpUrl = "/mnt/data/web/excel/";
            String name = "实有人口错误数据.xlsx";
            try {
                SFTPUtil sftp = new SFTPUtil(userName, password, host, port);
                sftp.login();
                boolean existDir = sftp.isExistDir(ftpUrl + name);
                if (!existDir) {
                    String property = System.getProperty("user.dir");
                    String fileName = property + File.separator + name;
                    // 这里 需要指定写用哪个class去写
                    ExcelWriter excelWriter = null;
                    InputStream inputStream = null;
                    try {
                        excelWriter = EasyExcel.write(fileName, ComMngPopulationMistakeExcelVO.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).registerWriteHandler(new CustomSheetWriteHandler()).build();
                        WriteSheet writeSheet = EasyExcel.writerSheet("实有人口错误数据").build();
                        excelWriter.write(vo, writeSheet);
                        excelWriter.finish();
                        File file = new File(fileName);
                        inputStream = new FileInputStream(file);
                        sftp.uploadMore(ftpUrl, name, inputStream);
                        sftp.logout();
                        inputStream.close();
                        String absolutePath = file.getAbsolutePath();
                        boolean delete = file.delete();
                        log.info("删除excel【{}】结果【{}】", absolutePath, delete);
                    } finally {
                        // 千万别忘记finish 会帮忙关闭流
                        if (inputStream != null) {
                            inputStream.close();
                        }
                        if (excelWriter != null) {
                            excelWriter.finish();
                        }
                    }
                }
                return R.ok(excelUrl + name);
            } catch (Exception e) {
                e.printStackTrace();
                log.error("文件传输失败【{}】", e.getMessage());
                return R.fail();
            }
        }
        private String convertMarriage(String ma) {
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationLowSecurityExcelListen.java
@@ -40,31 +40,18 @@
    private Long communityId;
    private Long userId;
    private static int headSize = 0;
    private Map<Integer, String> headData;
    private String userName;
    // FTP 登录密码
    private String password;
    // FTP 服务器地址IP地址
    private String host;
    // FTP 端口
    private int port;
    private String excelUrl;
    private StringRedisTemplate stringRedisTemplate;
    public static String loadUrl;
    public ComMngPopulationLowSecurityExcelListen(CommunityService communityService, Long communityId, String userName, String password, String host, int port, String excelUrl, StringRedisTemplate stringRedisTemplate) {
    public ComMngPopulationLowSecurityExcelListen(CommunityService communityService, Long communityId, Long userId, StringRedisTemplate stringRedisTemplate) {
            this.communityService = communityService;
            this.communityId = communityId;
            this.userName = userName;
            this.password = password;
            this.host = host;
            this.port = port;
            this.excelUrl = excelUrl;
            this.userId = userId;
            this.stringRedisTemplate = stringRedisTemplate;
        }
@@ -426,7 +413,7 @@
                //根据list中的IdCard城市来去重
                List<ComMngPopulationLowSecurityExcelVO> newVoList = voList.stream().filter(ListUtils.distinctByKey(ComMngPopulationLowSecurityExcelVO::getDistinctPass)).collect(Collectors.toList());
                log.info("开始进入业务层处理逻辑");
                R r = communityService.listSavePopulationLowSecurityExcelVO(newVoList, communityId);
                R r = communityService.listSavePopulationLowSecurityExcelVO(newVoList, communityId, userId);
                log.info("业务层处理逻辑完成");
                if (!R.isOk(r)) {
                    log.info("业务层处理成功");
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationMajorExcelListen.java
@@ -47,31 +47,18 @@
    private Long communityId;
    private Long userId;
    private static int headSize = 0;
    private Map<Integer, String> headData;
    private String userName;
    // FTP 登录密码
    private String password;
    // FTP 服务器地址IP地址
    private String host;
    // FTP 端口
    private int port;
    private String excelUrl;
    private StringRedisTemplate stringRedisTemplate;
    public static String loadUrl;
    public ComMngPopulationMajorExcelListen(CommunityService communityService, Long communityId, String userName, String password, String host, int port, String excelUrl, StringRedisTemplate stringRedisTemplate) {
    public ComMngPopulationMajorExcelListen(CommunityService communityService, Long communityId, Long userId, StringRedisTemplate stringRedisTemplate) {
            this.communityService = communityService;
            this.communityId = communityId;
            this.userName = userName;
            this.password = password;
            this.host = host;
            this.port = port;
            this.excelUrl = excelUrl;
            this.userId = userId;
            this.stringRedisTemplate = stringRedisTemplate;
        }
@@ -410,7 +397,7 @@
                //根据list中的IdCard城市来去重
                List<ComMngPopulationMajorExcelVO> newVoList = voList.stream().filter(ListUtils.distinctByKey(ComMngPopulationMajorExcelVO::getDistinctPass)).collect(Collectors.toList());
                log.info("开始进入业务层处理逻辑");
                R r = communityService.listSavePopulationMajorExcelVO(newVoList, communityId);
                R r = communityService.listSavePopulationMajorExcelVO(newVoList, communityId,userId);
                log.info("业务层处理逻辑完成");
                if (!R.isOk(r)) {
                    log.info("业务层处理成功");
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationRehabilitationExcelListen.java
@@ -50,31 +50,18 @@
    private Long communityId;
    private Long userId;
    private static int headSize = 0;
    private Map<Integer, String> headData;
    private String userName;
    // FTP 登录密码
    private String password;
    // FTP 服务器地址IP地址
    private String host;
    // FTP 端口
    private int port;
    private String excelUrl;
    private StringRedisTemplate stringRedisTemplate;
    public static String loadUrl;
    public ComMngPopulationRehabilitationExcelListen(CommunityService communityService, Long communityId, String userName, String password, String host, int port, String excelUrl, StringRedisTemplate stringRedisTemplate) {
    public ComMngPopulationRehabilitationExcelListen(CommunityService communityService, Long communityId, Long userId, StringRedisTemplate stringRedisTemplate) {
            this.communityService = communityService;
            this.communityId = communityId;
            this.userName = userName;
            this.password = password;
            this.host = host;
            this.port = port;
            this.excelUrl = excelUrl;
            this.userId = userId;
            this.stringRedisTemplate = stringRedisTemplate;
        }
@@ -479,7 +466,7 @@
                //根据list中的IdCard城市来去重
                List<ComMngPopulationRehabilitationExcelVO> newVoList = voList.stream().filter(ListUtils.distinctByKey(ComMngPopulationRehabilitationExcelVO::getDistinctPass)).collect(Collectors.toList());
                log.info("开始进入业务层处理逻辑");
                R r = communityService.listSavePopulationRehabilitationExcelVO(newVoList, communityId);
                R r = communityService.listSavePopulationRehabilitationExcelVO(newVoList, communityId, userId);
                log.info("业务层处理逻辑完成");
                if (!R.isOk(r)) {
                    log.info("业务层处理成功");
@@ -557,51 +544,6 @@
        vo.setHelpSituation(map.get(37));
        vo.setRemark(map.get(38));
    }
        private R mistakeExportPopulation(List<ComMngPopulationMistakeExcelVO> vo) {
            //生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址
            String ftpUrl = "/mnt/data/web/excel/";
            String name = "实有人口错误数据.xlsx";
            try {
                SFTPUtil sftp = new SFTPUtil(userName, password, host, port);
                sftp.login();
                boolean existDir = sftp.isExistDir(ftpUrl + name);
                if (!existDir) {
                    String property = System.getProperty("user.dir");
                    String fileName = property + File.separator + name;
                    // 这里 需要指定写用哪个class去写
                    ExcelWriter excelWriter = null;
                    InputStream inputStream = null;
                    try {
                        excelWriter = EasyExcel.write(fileName, ComMngPopulationMistakeExcelVO.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).registerWriteHandler(new CustomSheetWriteHandler()).build();
                        WriteSheet writeSheet = EasyExcel.writerSheet("实有人口错误数据").build();
                        excelWriter.write(vo, writeSheet);
                        excelWriter.finish();
                        File file = new File(fileName);
                        inputStream = new FileInputStream(file);
                        sftp.uploadMore(ftpUrl, name, inputStream);
                        sftp.logout();
                        inputStream.close();
                        String absolutePath = file.getAbsolutePath();
                        boolean delete = file.delete();
                        log.info("删除excel【{}】结果【{}】", absolutePath, delete);
                    } finally {
                        // 千万别忘记finish 会帮忙关闭流
                        if (inputStream != null) {
                            inputStream.close();
                        }
                        if (excelWriter != null) {
                            excelWriter.finish();
                        }
                    }
                }
                return R.ok(excelUrl + name);
            } catch (Exception e) {
                e.printStackTrace();
                log.error("文件传输失败【{}】", e.getMessage());
                return R.fail();
            }
        }
        private String convertMarriage(String ma) {
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationSentenceExcelListen.java
@@ -49,31 +49,18 @@
    private Long communityId;
    private Long userId;
    private static int headSize = 0;
    private Map<Integer, String> headData;
    private String userName;
    // FTP 登录密码
    private String password;
    // FTP 服务器地址IP地址
    private String host;
    // FTP 端口
    private int port;
    private String excelUrl;
    private StringRedisTemplate stringRedisTemplate;
    public static String loadUrl;
    public ComMngPopulationSentenceExcelListen(CommunityService communityService, Long communityId, String userName, String password, String host, int port, String excelUrl, StringRedisTemplate stringRedisTemplate) {
    public ComMngPopulationSentenceExcelListen(CommunityService communityService, Long communityId, Long userId, StringRedisTemplate stringRedisTemplate) {
            this.communityService = communityService;
            this.communityId = communityId;
            this.userName = userName;
            this.password = password;
            this.host = host;
            this.port = port;
            this.excelUrl = excelUrl;
            this.userId = userId;
            this.stringRedisTemplate = stringRedisTemplate;
        }
@@ -365,7 +352,7 @@
                //根据list中的IdCard城市来去重
                List<ComMngPopulationSentenceExcelVO> newVoList = voList.stream().filter(ListUtils.distinctByKey(ComMngPopulationSentenceExcelVO::getDistinctPass)).collect(Collectors.toList());
                log.info("开始进入业务层处理逻辑");
                R r = communityService.listSavePopulationSentenceExcelVO(newVoList, communityId);
                R r = communityService.listSavePopulationSentenceExcelVO(newVoList, communityId, userId);
                log.info("业务层处理逻辑完成");
                if (!R.isOk(r)) {
                    log.info("业务层处理成功");
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationServeExcelListen.java
@@ -48,31 +48,18 @@
    private Long communityId;
    private Long userId;
    private static int headSize = 0;
    private Map<Integer, String> headData;
    private String userName;
    // FTP 登录密码
    private String password;
    // FTP 服务器地址IP地址
    private String host;
    // FTP 端口
    private int port;
    private String excelUrl;
    private StringRedisTemplate stringRedisTemplate;
    public static String loadUrl;
    public ComMngPopulationServeExcelListen(CommunityService communityService, Long communityId, String userName, String password, String host, int port, String excelUrl,StringRedisTemplate stringRedisTemplate) {
    public ComMngPopulationServeExcelListen(CommunityService communityService, Long communityId, Long userId, StringRedisTemplate stringRedisTemplate) {
            this.communityService = communityService;
            this.communityId = communityId;
            this.userName = userName;
            this.password = password;
            this.host = host;
            this.port = port;
            this.excelUrl = excelUrl;
            this.userId = userId;
            this.stringRedisTemplate = stringRedisTemplate;
        }
@@ -578,7 +565,7 @@
                //根据list中的IdCard城市来去重
                List<ComMngPopulationServeExcelVO> newVoList = voList.stream().filter(ListUtils.distinctByKey(ComMngPopulationServeExcelVO::getDistinctPass)).collect(Collectors.toList());
                log.info("开始进入业务层处理逻辑");
                R r = communityService.listSavePopulationServeExcelVO(newVoList, communityId);
                R r = communityService.listSavePopulationServeExcelVO(newVoList, communityId, userId);
                log.info("业务层处理逻辑完成");
                if (!R.isOk(r)) {
                    log.info("业务层处理成功");
@@ -668,51 +655,6 @@
            vo.setIdCardBack(map.get(38));
            vo.setHouseHold(map.get(39));
            vo.setDeath(map.get(40));
        }
        private R mistakeExportPopulation(List<ComMngPopulationMistakeExcelVO> vo) {
            //生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址
            String ftpUrl = "/mnt/data/web/excel/";
            String name = "实有人口错误数据.xlsx";
            try {
                SFTPUtil sftp = new SFTPUtil(userName, password, host, port);
                sftp.login();
                boolean existDir = sftp.isExistDir(ftpUrl + name);
                if (!existDir) {
                    String property = System.getProperty("user.dir");
                    String fileName = property + File.separator + name;
                    // 这里 需要指定写用哪个class去写
                    ExcelWriter excelWriter = null;
                    InputStream inputStream = null;
                    try {
                        excelWriter = EasyExcel.write(fileName, ComMngPopulationMistakeExcelVO.class).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).registerWriteHandler(new CustomSheetWriteHandler()).build();
                        WriteSheet writeSheet = EasyExcel.writerSheet("实有人口错误数据").build();
                        excelWriter.write(vo, writeSheet);
                        excelWriter.finish();
                        File file = new File(fileName);
                        inputStream = new FileInputStream(file);
                        sftp.uploadMore(ftpUrl, name, inputStream);
                        sftp.logout();
                        inputStream.close();
                        String absolutePath = file.getAbsolutePath();
                        boolean delete = file.delete();
                        log.info("删除excel【{}】结果【{}】", absolutePath, delete);
                    } finally {
                        // 千万别忘记finish 会帮忙关闭流
                        if (inputStream != null) {
                            inputStream.close();
                        }
                        if (excelWriter != null) {
                            excelWriter.finish();
                        }
                    }
                }
                return R.ok(excelUrl + name);
            } catch (Exception e) {
                e.printStackTrace();
                log.error("文件传输失败【{}】", e.getMessage());
                return R.fail();
            }
        }
        private String convertMarriage(String ma) {
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationVeteransExcelListen.java
@@ -38,31 +38,18 @@
    private Long communityId;
    private Long userId;
    private static int headSize = 0;
    private Map<Integer, String> headData;
    private String userName;
    // FTP 登录密码
    private String password;
    // FTP 服务器地址IP地址
    private String host;
    // FTP 端口
    private int port;
    private String excelUrl;
    private StringRedisTemplate stringRedisTemplate;
    public static String loadUrl;
    public ComMngPopulationVeteransExcelListen(CommunityService communityService, Long communityId, String userName, String password, String host, int port, String excelUrl, StringRedisTemplate stringRedisTemplate) {
    public ComMngPopulationVeteransExcelListen(CommunityService communityService, Long communityId, Long userId , StringRedisTemplate stringRedisTemplate) {
            this.communityService = communityService;
            this.communityId = communityId;
            this.userName = userName;
            this.password = password;
            this.host = host;
            this.port = port;
            this.excelUrl = excelUrl;
            this.userId = userId;
            this.stringRedisTemplate = stringRedisTemplate;
        }
@@ -521,7 +508,7 @@
                //根据list中的IdCard城市来去重
                List<ComMngPopulationVeteransExcelVO> newVoList = voList.stream().filter(ListUtils.distinctByKey(ComMngPopulationVeteransExcelVO::getDistinctPass)).collect(Collectors.toList());
                log.info("开始进入业务层处理逻辑");
                R r = communityService.listSavePopulationVeteransExcelVO(newVoList, communityId);
                R r = communityService.listSavePopulationVeteransExcelVO(newVoList, communityId, userId);
                log.info("业务层处理逻辑完成");
                if (!R.isOk(r)) {
                    log.info("业务层处理成功");
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/service/community/CommunityService.java
@@ -1702,7 +1702,7 @@
     * @return 导入结果
     */
    @PostMapping("/common/data/population/import")
    R listSavePopulationServeExcelVO(@RequestBody List<ComMngPopulationServeExcelVO> list, @RequestParam(value = "communityId") Long communityId);
    R listSavePopulationServeExcelVO(@RequestBody List<ComMngPopulationServeExcelVO> list, @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId);
    /**
     * 批量导入吸毒人员
@@ -1712,7 +1712,7 @@
     * @return 导入结果
     */
    @PostMapping("/common/data/population/importDrug")
    R listSavePopulationDrugExcelVO(@RequestBody List<ComMngPopulationDrugExcelVO> list, @RequestParam(value = "communityId") Long communityId);
    R listSavePopulationDrugExcelVO(@RequestBody List<ComMngPopulationDrugExcelVO> list, @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId);
    /**
     * 批量导入社区矫正人员
@@ -1722,7 +1722,7 @@
     * @return 导入结果
     */
    @PostMapping("/common/data/population/importCorrect")
    R listSavePopulationCorrectExcelVO(@RequestBody List<ComMngPopulationCorrectExcelVO> list, @RequestParam(value = "communityId") Long communityId);
    R listSavePopulationCorrectExcelVO(@RequestBody List<ComMngPopulationCorrectExcelVO> list, @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId);
    /**
     * 批量导入重精人员
@@ -1732,7 +1732,7 @@
     * @return 导入结果
     */
    @PostMapping("/common/data/population/importMajor")
    R listSavePopulationMajorExcelVO(@RequestBody List<ComMngPopulationMajorExcelVO> list, @RequestParam(value = "communityId") Long communityId);
    R listSavePopulationMajorExcelVO(@RequestBody List<ComMngPopulationMajorExcelVO> list, @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId);
    /**
     * 批量导入邪教人员
@@ -1742,7 +1742,7 @@
     * @return 导入结果
     */
    @PostMapping("/common/data/population/importCult")
    R listSavePopulationCultExcelVO(@RequestBody List<ComMngPopulationCultExcelVO> list, @RequestParam(value = "communityId") Long communityId);
    R listSavePopulationCultExcelVO(@RequestBody List<ComMngPopulationCultExcelVO> list, @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId);
    /**
     * 批量导入刑释人员
@@ -1752,7 +1752,7 @@
     * @return 导入结果
     */
    @PostMapping("/common/data/population/importRehabilitation")
    R listSavePopulationRehabilitationExcelVO(@RequestBody List<ComMngPopulationRehabilitationExcelVO> list, @RequestParam(value = "communityId") Long communityId);
    R listSavePopulationRehabilitationExcelVO(@RequestBody List<ComMngPopulationRehabilitationExcelVO> list, @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId);
    /**
     * 批量导入重点上访人员
@@ -1762,7 +1762,7 @@
     * @return 导入结果
     */
    @PostMapping("/common/data/population/importKey")
    R listSavePopulationKeyExcelVO(@RequestBody List<ComMngPopulationKeyExcelVO> list, @RequestParam(value = "communityId") Long communityId);
    R listSavePopulationKeyExcelVO(@RequestBody List<ComMngPopulationKeyExcelVO> list, @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId);
    /**
     * 批量导入服刑人员
@@ -1772,7 +1772,7 @@
     * @return 导入结果
     */
    @PostMapping("/common/data/population/importSentence")
    R listSavePopulationSentenceExcelVO(@RequestBody List<ComMngPopulationSentenceExcelVO> list, @RequestParam(value = "communityId") Long communityId);
    R listSavePopulationSentenceExcelVO(@RequestBody List<ComMngPopulationSentenceExcelVO> list, @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId);
    /**
     * 批量导入退役军人
@@ -1782,7 +1782,7 @@
     * @return 导入结果
     */
    @PostMapping("/common/data/population/importVeterans")
    R listSavePopulationVeteransExcelVO(@RequestBody List<ComMngPopulationVeteransExcelVO> list, @RequestParam(value = "communityId") Long communityId);
    R listSavePopulationVeteransExcelVO(@RequestBody List<ComMngPopulationVeteransExcelVO> list, @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId);
    /**
     * 批量导入残疾人
@@ -1792,7 +1792,7 @@
     * @return 导入结果
     */
    @PostMapping("/common/data/population/importDisability")
    R listSavePopulationDisabilityExcelVO(@RequestBody List<ComMngPopulationDisabilityExcelVO> list, @RequestParam(value = "communityId") Long communityId);
    R listSavePopulationDisabilityExcelVO(@RequestBody List<ComMngPopulationDisabilityExcelVO> list, @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId);
    /**
     * 批量导入低保户
@@ -1802,7 +1802,7 @@
     * @return 导入结果
     */
    @PostMapping("/common/data/population/importLowSecurity")
    R listSavePopulationLowSecurityExcelVO(@RequestBody List<ComMngPopulationLowSecurityExcelVO> list, @RequestParam(value = "communityId") Long communityId);
    R listSavePopulationLowSecurityExcelVO(@RequestBody List<ComMngPopulationLowSecurityExcelVO> list, @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId);
    /**
     * 确认导入实有人口(有则更新,无则新建)
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/PopulationApi.java
@@ -95,7 +95,7 @@
        InputStream inputStream = null;
        try {
            inputStream = file.getInputStream();
            ComMngPopulationServeExcelListen comMngPopulationServeExcelListen = new ComMngPopulationServeExcelListen(communityService, this.getCommunityId(),userName,password,host,port,excelUrl,stringRedisTemplate);
            ComMngPopulationServeExcelListen comMngPopulationServeExcelListen = new ComMngPopulationServeExcelListen(communityService, this.getCommunityId(),this.getLoginUserInfo().getUserId(),stringRedisTemplate);
            EasyExcel.read(inputStream, null, comMngPopulationServeExcelListen).sheet().doRead();
        } catch (IOException e) {
            log.error("导入模板失败【{}】", e.getMessage());
@@ -113,7 +113,7 @@
        InputStream inputStream = null;
        try {
            inputStream = file.getInputStream();
            ComMngPopulationDrugExcelListen comMngPopulationDrugExcelListen = new ComMngPopulationDrugExcelListen(communityService, this.getCommunityId(),userName,password,host,port,excelUrl,stringRedisTemplate);
            ComMngPopulationDrugExcelListen comMngPopulationDrugExcelListen = new ComMngPopulationDrugExcelListen(communityService, this.getCommunityId(),this.getLoginUserInfo().getUserId(),stringRedisTemplate);
            EasyExcel.read(inputStream, null, comMngPopulationDrugExcelListen).sheet().doRead();
        } catch (IOException e) {
            log.error("导入模板失败【{}】", e.getMessage());
@@ -131,7 +131,7 @@
        InputStream inputStream = null;
        try {
            inputStream = file.getInputStream();
            ComMngPopulationCorrectExcelListen comMngPopulationCorrectExcelListen = new ComMngPopulationCorrectExcelListen(communityService, this.getCommunityId(),userName,password,host,port,excelUrl,stringRedisTemplate);
            ComMngPopulationCorrectExcelListen comMngPopulationCorrectExcelListen = new ComMngPopulationCorrectExcelListen(communityService, this.getCommunityId(),this.getLoginUserInfo().getUserId(),stringRedisTemplate);
            EasyExcel.read(inputStream, null, comMngPopulationCorrectExcelListen).sheet().doRead();
        } catch (IOException e) {
            log.error("导入模板失败【{}】", e.getMessage());
@@ -149,7 +149,7 @@
        InputStream inputStream = null;
        try {
            inputStream = file.getInputStream();
            ComMngPopulationMajorExcelListen comMngPopulationMajorExcelListen = new ComMngPopulationMajorExcelListen(communityService, this.getCommunityId(),userName,password,host,port,excelUrl,stringRedisTemplate);
            ComMngPopulationMajorExcelListen comMngPopulationMajorExcelListen = new ComMngPopulationMajorExcelListen(communityService, this.getCommunityId(),this.getLoginUserInfo().getUserId(),stringRedisTemplate);
            EasyExcel.read(inputStream, null, comMngPopulationMajorExcelListen).sheet().doRead();
        } catch (IOException e) {
            log.error("导入模板失败【{}】", e.getMessage());
@@ -167,7 +167,7 @@
        InputStream inputStream = null;
        try {
            inputStream = file.getInputStream();
            ComMngPopulationCultExcelListen comMngPopulationCultExcelListen = new ComMngPopulationCultExcelListen(communityService, this.getCommunityId(),userName,password,host,port,excelUrl,stringRedisTemplate);
            ComMngPopulationCultExcelListen comMngPopulationCultExcelListen = new ComMngPopulationCultExcelListen(communityService, this.getCommunityId(),this.getLoginUserInfo().getUserId(),stringRedisTemplate);
            EasyExcel.read(inputStream, null, comMngPopulationCultExcelListen).sheet().doRead();
        } catch (IOException e) {
            log.error("导入模板失败【{}】", e.getMessage());
@@ -185,7 +185,7 @@
        InputStream inputStream = null;
        try {
            inputStream = file.getInputStream();
            ComMngPopulationRehabilitationExcelListen comMngPopulationRehabilitationExcelListen = new ComMngPopulationRehabilitationExcelListen(communityService, this.getCommunityId(),userName,password,host,port,excelUrl,stringRedisTemplate);
            ComMngPopulationRehabilitationExcelListen comMngPopulationRehabilitationExcelListen = new ComMngPopulationRehabilitationExcelListen(communityService, this.getCommunityId(),this.getLoginUserInfo().getUserId(),stringRedisTemplate);
            EasyExcel.read(inputStream, null, comMngPopulationRehabilitationExcelListen).sheet().doRead();
        } catch (IOException e) {
            log.error("导入模板失败【{}】", e.getMessage());
@@ -203,7 +203,7 @@
        InputStream inputStream = null;
        try {
            inputStream = file.getInputStream();
            ComMngPopulationKeyExcelListen mngPopulationKeyExcelListen = new ComMngPopulationKeyExcelListen(communityService, this.getCommunityId(),userName,password,host,port,excelUrl,stringRedisTemplate);
            ComMngPopulationKeyExcelListen mngPopulationKeyExcelListen = new ComMngPopulationKeyExcelListen(communityService, this.getCommunityId(),this.getLoginUserInfo().getUserId(),stringRedisTemplate);
            EasyExcel.read(inputStream, null, mngPopulationKeyExcelListen).sheet().doRead();
        } catch (IOException e) {
            log.error("导入模板失败【{}】", e.getMessage());
@@ -221,7 +221,7 @@
        InputStream inputStream = null;
        try {
            inputStream = file.getInputStream();
            ComMngPopulationSentenceExcelListen comMngPopulationSentenceExcelListen = new ComMngPopulationSentenceExcelListen(communityService, this.getCommunityId(),userName,password,host,port,excelUrl,stringRedisTemplate);
            ComMngPopulationSentenceExcelListen comMngPopulationSentenceExcelListen = new ComMngPopulationSentenceExcelListen(communityService, this.getCommunityId(),this.getLoginUserInfo().getUserId(),stringRedisTemplate);
            EasyExcel.read(inputStream, null, comMngPopulationSentenceExcelListen).sheet().doRead();
        } catch (IOException e) {
            log.error("导入模板失败【{}】", e.getMessage());
@@ -239,7 +239,7 @@
        InputStream inputStream = null;
        try {
            inputStream = file.getInputStream();
            ComMngPopulationVeteransExcelListen comMngPopulationVeteransExcelListen = new ComMngPopulationVeteransExcelListen(communityService, this.getCommunityId(),userName,password,host,port,excelUrl,stringRedisTemplate);
            ComMngPopulationVeteransExcelListen comMngPopulationVeteransExcelListen = new ComMngPopulationVeteransExcelListen(communityService, this.getCommunityId(),this.getLoginUserInfo().getUserId(),stringRedisTemplate);
            EasyExcel.read(inputStream, null, comMngPopulationVeteransExcelListen).sheet().doRead();
        } catch (IOException e) {
            log.error("导入模板失败【{}】", e.getMessage());
@@ -257,7 +257,7 @@
        InputStream inputStream = null;
        try {
            inputStream = file.getInputStream();
            ComMngPopulationDisabilityExcelListen mngPopulationDisabilityExcelListen = new ComMngPopulationDisabilityExcelListen(communityService, this.getCommunityId(),userName,password,host,port,excelUrl,stringRedisTemplate);
            ComMngPopulationDisabilityExcelListen mngPopulationDisabilityExcelListen = new ComMngPopulationDisabilityExcelListen(communityService, this.getCommunityId(),this.getLoginUserInfo().getUserId(),stringRedisTemplate);
            EasyExcel.read(inputStream, null, mngPopulationDisabilityExcelListen).sheet().doRead();
        } catch (IOException e) {
            log.error("导入模板失败【{}】", e.getMessage());
@@ -275,7 +275,7 @@
        InputStream inputStream = null;
        try {
            inputStream = file.getInputStream();
            ComMngPopulationLowSecurityExcelListen mngPopulationDisabilityExcelListen = new ComMngPopulationLowSecurityExcelListen(communityService, this.getCommunityId(),userName,password,host,port,excelUrl,stringRedisTemplate);
            ComMngPopulationLowSecurityExcelListen mngPopulationDisabilityExcelListen = new ComMngPopulationLowSecurityExcelListen(communityService, this.getCommunityId(),this.getLoginUserInfo().getUserId(),stringRedisTemplate);
            EasyExcel.read(inputStream, null, mngPopulationDisabilityExcelListen).sheet().doRead();
        } catch (IOException e) {
            log.error("导入模板失败【{}】", e.getMessage());
@@ -319,7 +319,7 @@
        try {
            Long communityId = Long.valueOf(request.getParameter("communityId"));
            inputStream = file.getInputStream();
            ComMngPopulationServeExcelListen comMngPopulationServeExcelListen = new ComMngPopulationServeExcelListen(communityService, communityId,userName,password,host,port,excelUrl,stringRedisTemplate);
            ComMngPopulationServeExcelListen comMngPopulationServeExcelListen = new ComMngPopulationServeExcelListen(communityService, communityId,this.getLoginUserInfo().getUserId(),stringRedisTemplate);
            EasyExcel.read(inputStream, null, comMngPopulationServeExcelListen).sheet().doRead();
        } catch (IOException e) {
            log.error("导入模板失败【{}】", e.getMessage());
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommonDataApi.java
@@ -325,8 +325,8 @@
     */
    @PostMapping("/population/import")
    @Transactional(rollbackFor = Exception.class)
    public R listSavePopulationExcelVO(@RequestBody List<ComMngPopulationServeExcelVO> list, @RequestParam(value = "communityId") Long communityId){
        return comMngPopulationService.listSavePopulation(list, communityId);
    public R listSavePopulationExcelVO(@RequestBody List<ComMngPopulationServeExcelVO> list, @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId){
        return comMngPopulationService.listSavePopulation(list, communityId, userId);
    }
    /**
@@ -338,8 +338,8 @@
     */
    @PostMapping("population/importDrug")
    @Transactional(rollbackFor = Exception.class)
    public R listSavePopulationDrugExcelVO(@RequestBody List<ComMngPopulationDrugExcelVO> list, @RequestParam(value = "communityId") Long communityId){
        return comMngPopulationService.listSaveDrugPopulation(list, communityId);
    public R listSavePopulationDrugExcelVO(@RequestBody List<ComMngPopulationDrugExcelVO> list, @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId){
        return comMngPopulationService.listSaveDrugPopulation(list, communityId, userId);
    }
    /**
@@ -351,8 +351,8 @@
     */
    @PostMapping("population/importCorrect")
    @Transactional(rollbackFor = Exception.class)
    public R listSavePopulationCorrectExcelVO(@RequestBody List<ComMngPopulationCorrectExcelVO> list, @RequestParam(value = "communityId") Long communityId){
        return comMngPopulationService.listSaveCorrectPopulation(list, communityId);
    public R listSavePopulationCorrectExcelVO(@RequestBody List<ComMngPopulationCorrectExcelVO> list, @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId){
        return comMngPopulationService.listSaveCorrectPopulation(list, communityId, userId);
    }
    /**
@@ -364,8 +364,8 @@
     */
    @Transactional(rollbackFor = Exception.class)
    @PostMapping("population/importMajor")
    public R listSavePopulationMajorExcelVO(@RequestBody List<ComMngPopulationMajorExcelVO> list, @RequestParam(value = "communityId") Long communityId){
        return comMngPopulationService.listSaveMajorPopulation(list, communityId);
    public R listSavePopulationMajorExcelVO(@RequestBody List<ComMngPopulationMajorExcelVO> list, @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId){
        return comMngPopulationService.listSaveMajorPopulation(list, communityId, userId);
    }
    /**
@@ -377,8 +377,8 @@
     */
    @PostMapping("population/importCult")
    @Transactional(rollbackFor = Exception.class)
    public R listSavePopulationCultExcelVO(@RequestBody List<ComMngPopulationCultExcelVO> list, @RequestParam(value = "communityId") Long communityId){
        return comMngPopulationService.listSaveCultPopulation(list, communityId);
    public R listSavePopulationCultExcelVO(@RequestBody List<ComMngPopulationCultExcelVO> list, @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId){
        return comMngPopulationService.listSaveCultPopulation(list, communityId, userId);
    }
    /**
@@ -390,8 +390,8 @@
     */
    @PostMapping("population/importRehabilitation")
    @Transactional(rollbackFor = Exception.class)
    public R listSavePopulationRehabilitationExcelVO(@RequestBody List<ComMngPopulationRehabilitationExcelVO> list, @RequestParam(value = "communityId") Long communityId){
        return comMngPopulationService.listSaveRehabilitationPopulation(list, communityId);
    public R listSavePopulationRehabilitationExcelVO(@RequestBody List<ComMngPopulationRehabilitationExcelVO> list, @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId){
        return comMngPopulationService.listSaveRehabilitationPopulation(list, communityId, userId);
    }
    /**
@@ -403,8 +403,8 @@
     */
    @Transactional(rollbackFor = Exception.class)
    @PostMapping("population/importKey")
    public R listSavePopulationKeyExcelVO(@RequestBody List<ComMngPopulationKeyExcelVO> list, @RequestParam(value = "communityId") Long communityId){
        return comMngPopulationService.listSaveKeyPopulation(list, communityId);
    public R listSavePopulationKeyExcelVO(@RequestBody List<ComMngPopulationKeyExcelVO> list, @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId){
        return comMngPopulationService.listSaveKeyPopulation(list, communityId, userId);
    }
    /**
@@ -416,8 +416,8 @@
     */
    @Transactional(rollbackFor = Exception.class)
    @PostMapping("population/importSentence")
    public R listSavePopulationSentenceExcelVO(@RequestBody List<ComMngPopulationSentenceExcelVO> list, @RequestParam(value = "communityId") Long communityId){
        return comMngPopulationService.listSaveSentencePopulation(list, communityId);
    public R listSavePopulationSentenceExcelVO(@RequestBody List<ComMngPopulationSentenceExcelVO> list, @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId){
        return comMngPopulationService.listSaveSentencePopulation(list, communityId, userId);
    }
    /**
@@ -429,8 +429,8 @@
     */
    @Transactional(rollbackFor = Exception.class)
    @PostMapping("population/importVeterans")
    public R listSavePopulationVeteransExcelVO(@RequestBody List<ComMngPopulationVeteransExcelVO> list, @RequestParam(value = "communityId") Long communityId){
        return comMngPopulationService.listSaveVeteransPopulation(list, communityId);
    public R listSavePopulationVeteransExcelVO(@RequestBody List<ComMngPopulationVeteransExcelVO> list, @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId){
        return comMngPopulationService.listSaveVeteransPopulation(list, communityId, userId);
    }
    /**
@@ -442,8 +442,8 @@
     */
    @Transactional(rollbackFor = Exception.class)
    @PostMapping("population/importDisability")
    public R listSavePopulationDisabilityExcelVO(@RequestBody List<ComMngPopulationDisabilityExcelVO> list, @RequestParam(value = "communityId") Long communityId){
        return comMngPopulationService.listSaveDisabilityPopulation(list, communityId);
    public R listSavePopulationDisabilityExcelVO(@RequestBody List<ComMngPopulationDisabilityExcelVO> list, @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId){
        return comMngPopulationService.listSaveDisabilityPopulation(list, communityId, userId);
    }
    /**
@@ -455,8 +455,8 @@
     */
    @Transactional(rollbackFor = Exception.class)
    @PostMapping("/population/importLowSecurity")
    public R listSavePopulationLowSecurityExcelVO(@RequestBody List<ComMngPopulationLowSecurityExcelVO> list, @RequestParam(value = "communityId") Long communityId) {
        return comMngPopulationService.listSaveLowSecurityPopulation(list, communityId);
    public R listSavePopulationLowSecurityExcelVO(@RequestBody List<ComMngPopulationLowSecurityExcelVO> list, @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId) {
        return comMngPopulationService.listSaveLowSecurityPopulation(list, communityId, userId);
    }
    /**
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationCommunityTagsDAO.java
New file
@@ -0,0 +1,21 @@
package com.panzhihua.service_community.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.panzhihua.service_community.model.dos.ComMngPopulationCommunityTagsDO;
import com.panzhihua.service_community.model.dos.ComMngPopulationDO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
 * @auther txb
 * @create 2021-08-19 14:55:29
 * @describe 基础数据》人口社区特殊群体关系表mapper类
 */
@Mapper
public interface ComMngPopulationCommunityTagsDAO extends BaseMapper<ComMngPopulationCommunityTagsDO> {
    void updateAll(@Param("populationCommunityTagsList") List<ComMngPopulationCommunityTagsDO> populationCommunityTagsList);
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java
@@ -150,7 +150,7 @@
            "cmp.remark, " +
            "cmp.native_place, " +
            "cmp.nation,  " +
            "cmp.label,  " +
            "cmpct.label,  " +
            "cmp.marriage,  " +
            "cmp.culture_level,  " +
            "cmp.profession,  " +
@@ -163,12 +163,13 @@
            "cmp.is_rent  " +
            "FROM  " +
            "com_mng_population AS cmp " +
            " LEFT JOIN com_mng_population_community_tags AS cmpct ON cmp.id = cmpct.population_id  " +
            "<where>" +
            "<if test='comMngPopulationVO.name != null and comMngPopulationVO.name != &quot;&quot;'>" +
            "AND cmp.`name` LIKE concat(#{comMngPopulationVO.name},'%') " +
            " </if> " +
            "<if test='comMngPopulationVO.label != null and comMngPopulationVO.label != &quot;&quot;'>" +
            "AND cmp.label LIKE concat('%',#{comMngPopulationVO.label},'%') " +
            "AND cmpct.label LIKE concat('%',#{comMngPopulationVO.label},'%') " +
            " </if> " +
            "<if test='comMngPopulationVO.actId != null'>" +
            " and cmp.act_id = #{comMngPopulationVO.actId} " +
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComMngPopulationCommunityTagsDO.java
New file
@@ -0,0 +1,80 @@
package com.panzhihua.service_community.model.dos;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
 * @auther txb
 * @create 2021-08-19 14:55:29
 * @describe 基础数据》人口社区特殊群体关系表实体类
 */
@Data
@TableName("com_mng_population_community_tags")
public class ComMngPopulationCommunityTagsDO implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
    * 主键id
    */
    @TableId(type = IdType.INPUT)
    private Long id;
    /**
    * 人口id
    */
    private Long populationId;
    /**
    * 社区id
    */
    private Long communityId;
    /**
    * 标签集合(多个标签以,隔开)
    */
    private String label;
    /**
    * 创建时间
    */
    @TableField(fill = FieldFill.INSERT)
    private Date createAt;
    /**
    * 创建用户
    */
    private Long createBy;
    /**
    * 修改时间
    */
    @TableField(fill = FieldFill.UPDATE)
    private Date updateAt;
    /**
    * 修改用户
    */
    private Long updateBy;
@Override
public String toString() {
        return "ComMngPopulationCommunityTagsDO{" +
                "id=" + id +
                ", populationId=" + populationId +
                ", communityId=" + communityId +
                ", label=" + label +
                ", createAt=" + createAt +
                ", createBy=" + createBy +
                ", updateAt=" + updateAt +
                ", updateBy=" + updateBy +
        "}";
        }
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComMngPopulationDO.java
@@ -251,6 +251,11 @@
     */
    @TableField(fill = FieldFill.INSERT)
    private Date createAt;
    /**
     * 创建用戶
     */
    private Long createBy;
    /**
     * 修改时间
     */
@@ -258,6 +263,11 @@
    private Date updateAt;
    /**
     * 修改用戶
     */
    private Long updateBy;
    /**
     * 小区名字
     */
    @TableField(exist = false)
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngPopulationCommunityTagsService.java
New file
@@ -0,0 +1,13 @@
package com.panzhihua.service_community.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.panzhihua.service_community.model.dos.ComMngPopulationCommunityTagsDO;
/**
 * @auther txb
 * @create 2021-08-19 14:55:29
 * @describe 基础数据》人口社区特殊群体关系表服务类
 */
public interface ComMngPopulationCommunityTagsService extends IService<ComMngPopulationCommunityTagsDO> {
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngPopulationService.java
@@ -79,7 +79,7 @@
     * @param communityId
     * @return
     */
    R listSavePopulation(List<ComMngPopulationServeExcelVO> list, Long communityId);
    R listSavePopulation(List<ComMngPopulationServeExcelVO> list, Long communityId, Long userId);
    /**
     * 导入吸毒人员
@@ -87,7 +87,7 @@
     * @param communityId
     * @return
     */
    R listSaveDrugPopulation(List<ComMngPopulationDrugExcelVO> list, Long communityId);
    R listSaveDrugPopulation(List<ComMngPopulationDrugExcelVO> list, Long communityId, Long userId);
    /**
     * 批量导入社区矫正人员
@@ -96,7 +96,7 @@
     * @param communityId 社区id
     * @return 导入结果
     */
    R listSaveCorrectPopulation(List<ComMngPopulationCorrectExcelVO> list, Long communityId);
    R listSaveCorrectPopulation(List<ComMngPopulationCorrectExcelVO> list, Long communityId, Long userId);
    /**
     * 批量导入重精人员
@@ -105,7 +105,7 @@
     * @param communityId 社区id
     * @return 导入结果
     */
    R listSaveMajorPopulation(List<ComMngPopulationMajorExcelVO> list, Long communityId);
    R listSaveMajorPopulation(List<ComMngPopulationMajorExcelVO> list, Long communityId, Long userId);
    /**
     * 批量导入邪教人员
@@ -114,7 +114,7 @@
     * @param communityId 社区id
     * @return 导入结果
     */
    R listSaveCultPopulation(List<ComMngPopulationCultExcelVO> list, Long communityId);
    R listSaveCultPopulation(List<ComMngPopulationCultExcelVO> list, Long communityId, Long userId);
    /**
     * 批量导入刑释人员
@@ -123,7 +123,7 @@
     * @param communityId 社区id
     * @return 导入结果
     */
    R listSaveRehabilitationPopulation(List<ComMngPopulationRehabilitationExcelVO> list, Long communityId);
    R listSaveRehabilitationPopulation(List<ComMngPopulationRehabilitationExcelVO> list, Long communityId, Long userId);
    /**
     * 批量导入重点上访人员
@@ -132,7 +132,7 @@
     * @param communityId 社区id
     * @return 导入结果
     */
    R listSaveKeyPopulation(List<ComMngPopulationKeyExcelVO> list, Long communityId);
    R listSaveKeyPopulation(List<ComMngPopulationKeyExcelVO> list, Long communityId, Long userId);
    /**
     * 批量导入服刑人员
@@ -141,7 +141,7 @@
     * @param communityId 社区id
     * @return 导入结果
     */
    R listSaveSentencePopulation(List<ComMngPopulationSentenceExcelVO> list, Long communityId);
    R listSaveSentencePopulation(List<ComMngPopulationSentenceExcelVO> list, Long communityId, Long userId);
    /**
     * 批量导入退役军人
@@ -150,7 +150,7 @@
     * @param communityId 社区id
     * @return 导入结果
     */
    R listSaveVeteransPopulation(List<ComMngPopulationVeteransExcelVO> list, Long communityId);
    R listSaveVeteransPopulation(List<ComMngPopulationVeteransExcelVO> list, Long communityId, Long userId);
    /**
     * 批量导入残疾人
@@ -159,7 +159,7 @@
     * @param communityId 社区id
     * @return 导入结果
     */
    R listSaveDisabilityPopulation(List<ComMngPopulationDisabilityExcelVO> list, Long communityId);
    R listSaveDisabilityPopulation(List<ComMngPopulationDisabilityExcelVO> list, Long communityId, Long userId);
    /**
     * 批量导入低保户
@@ -168,7 +168,7 @@
     * @param communityId 社区id
     * @return 导入结果
     */
    R listSaveLowSecurityPopulation(List<ComMngPopulationLowSecurityExcelVO> list, Long communityId);
    R listSaveLowSecurityPopulation(List<ComMngPopulationLowSecurityExcelVO> list, Long communityId, Long userId);
    /**
     * 确认导入实有人口(有则更新,无则新建)
     *
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationCommunityTagsServiceImpl.java
New file
@@ -0,0 +1,19 @@
package com.panzhihua.service_community.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.service_community.dao.ComMngPopulationCommunityTagsDAO;
import com.panzhihua.service_community.model.dos.ComMngPopulationCommunityTagsDO;
import com.panzhihua.service_community.service.ComMngPopulationCommunityTagsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
/**
 * @auther txb
 * @create 2021-08-19 14:55:29
 * @describe 基础数据》人口社区特殊群体关系表服务实现类
 */
@Slf4j
@Service
public class ComMngPopulationCommunityTagsServiceImpl extends ServiceImpl<ComMngPopulationCommunityTagsDAO, ComMngPopulationCommunityTagsDO> implements ComMngPopulationCommunityTagsService {
}
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
@@ -81,6 +81,10 @@
    @Resource
    private ComMngPopulationHouseUserDAO comMngPopulationHouseUserDAO;
    @Resource
    private ComMngPopulationCommunityTagsDAO comMngPopulationCommunityTagsDAO;
    @Resource
    private ComMngPopulationCommunityTagsService comMngPopulationCommunityTagsService;
    @Resource
    private ComMngPopulationDAO comMngPopulationDAO;
    @Resource
    private ComMngPopulationHouseUserService comMngPopulationHouseUserService;
@@ -213,6 +217,12 @@
        //设置年龄
        if (StringUtils.isNotEmpty(comMngPopulationVO.getBirthday())) {
            comMngPopulationVO.setAge(AgeUtils.getAgeFromBirthTimes(comMngPopulationVO.getBirthday()));
        }
        //设置特殊群体标签
        ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = comMngPopulationCommunityTagsDAO.selectOne(new QueryWrapper<ComMngPopulationCommunityTagsDO>().
                lambda().eq(ComMngPopulationCommunityTagsDO::getPopulationId, populationId));
        if (null != comMngPopulationCommunityTagsDO) {
            comMngPopulationVO.setLabel(comMngPopulationCommunityTagsDO.getLabel());
        }
        //查询当前用户电子档信息
@@ -496,7 +506,7 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R listSavePopulation(List<ComMngPopulationServeExcelVO> list, Long communityId){
    public R listSavePopulation(List<ComMngPopulationServeExcelVO> list, Long communityId, Long userId){
        //需要新增的房屋集合
        List<ComMngPopulationHouseDO> houseList = new ArrayList<>();
        //需要新增的人口集合
@@ -505,6 +515,10 @@
        List<ComMngPopulationDO> updateList = new ArrayList<>();
        //需要新增的人口与房屋关系集合
        List<ComMngPopulationHouseUserDO> houseUserList = new ArrayList<>();
        //需要新增的人口与社区关系集合
        List<ComMngPopulationCommunityTagsDO> savePopulationCommunityList = new ArrayList<>();
        //需要新增的人口与社区关系集合
        List<ComMngPopulationCommunityTagsDO> updatePopulationCommunityList = new ArrayList<>();
        log.info("开始处理导入数据");
        List<ComMngPopulationMistakeExcelVO> mistakes = new ArrayList<>();
@@ -516,7 +530,7 @@
                log.error("未查询到社区信息");
                return R.fail("未查询到社区信息");
            }
            log.info("开始查询社区信息数据完成");
            log.info("查询社区信息数据完成");
            //查询当前社区标签列表
            List<String> labelList = new ArrayList<>();
@@ -559,6 +573,12 @@
                houseUserMap.put(key,houseUser);
            });
            List<ComMngPopulationCommunityTagsDO> populationCommunityLists = comMngPopulationCommunityTagsDAO.selectList(null);
            HashMap<String,Object> populationCommunityMap = new HashMap<>();
            populationCommunityLists.forEach(populationCommunity -> {
                String key = populationCommunity.getPopulationId() + populationCommunity.getCommunityId() + "";
                populationCommunityMap.put(key,populationCommunity);
            });
            for (ComMngPopulationServeExcelVO vo : list) {
                if (vo.getDoorNo().contains("号")) {
@@ -607,7 +627,7 @@
                    address.append(vo.getHouseNo()).append("号");
                }
                vo.setAddress(address.toString());
                log.info("开始查询小区街路巷是否存在完成");
                log.info("查询小区街路巷是否存在完成");
                log.info("开始查询房屋是否存在");
                //先判断房屋是否存在
@@ -633,7 +653,7 @@
                    populationHouseDO = (ComMngPopulationHouseDO)houseMap.get(houseKey);
                }
                vo.setHouseId(populationHouseDO.getId());
                log.info("开始查询房屋是否存在完成");
                log.info("查询房屋是否存在完成");
                if (StringUtils.isEmpty(vo.getName()) && StringUtils.isEmpty(vo.getCardNo())) {
                    //空户处理完房屋信息,直接返回
@@ -647,20 +667,14 @@
                if(!isOnly(populationKey,populationMap)){
                    //存在实有人口信息,则更新
                    populationDO = (ComMngPopulationDO)populationMap.get(populationKey);
                    ComMngPopulationDO updatePopulationDO = updatePopulationDO(vo,populationDO,labelList);
                    ComMngPopulationDO updatePopulationDO = updatePopulationDO(vo,populationDO,userId);
                    updateList.add(updatePopulationDO);
                    ComMngPopulationMistakeExcelVO mistake = new ComMngPopulationMistakeExcelVO();
                    BeanUtils.copyProperties(vo,mistake);
                    setMistake(mistake, vo);
                    mistake.setMistake("该实有人口已存在,执行更新,社区id::"+ populationDO.getActId());
                    mistakes.add(mistake);
                }else{
                    //不存在实有人口,则新增
                    populationDO = savePopulationDO(vo, populationActVO, comMngVillageDO,labelList);
                    populationDO = savePopulationDO(vo, populationActVO, comMngVillageDO, userId);
                    saveList.add(populationDO);
                }
                log.info("开始查询实有人口是否已存在完成");
                log.info("查询实有人口是否已存在完成");
                log.info("开始查询实有人口房屋居住信息");
                //处理实有人口房屋居住信息
@@ -678,7 +692,53 @@
                        houseUserList.add(populationHouseUserDO);
                    }
                }
                log.info("开始查询实有人口房屋居住信息完成");
                log.info("查询实有人口房屋居住信息完成");
                log.info("开始查询实有人口存在社区信息");
                //处理实有人口与社区关系以及对应特殊群体标签
                String populationCommunityKey = populationDO.getId() + populationActVO.getCommunityId() + "";
                if (populationDO != null) {
                    ComMngPopulationCommunityTagsDO cpopulationCommunityTagsDO = null;
                    if(isOnly(populationCommunityKey,populationCommunityMap)){
                        //实有人口不存在于当前社区
                        cpopulationCommunityTagsDO = new ComMngPopulationCommunityTagsDO();
                        cpopulationCommunityTagsDO.setId(Snowflake.getId());
                        cpopulationCommunityTagsDO.setPopulationId(populationDO.getId());
                        cpopulationCommunityTagsDO.setCommunityId(communityId);
                        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
                        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
                        Iterator<String> iterator = userTag.iterator();
                        while (iterator.hasNext()) {
                            String s = iterator.next();
                            if (!labelList.contains(s))
                                iterator.remove();
                        }
                        populationDO.setLabel(Joiner.on(",").join(userTag));
                        populationDO.setCreateBy(userId);
                        savePopulationCommunityList.add(cpopulationCommunityTagsDO);
                    }
                }else {
                    //实有人口存在于当前社区,则更新
                    ComMngPopulationCommunityTagsDO comMngPopulationCommunityTagsDO = (ComMngPopulationCommunityTagsDO)populationCommunityMap.get(populationCommunityKey);
                    List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
                    //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
                    Iterator<String> iterator = userTag.iterator();
                    while (iterator.hasNext()) {
                        String s = iterator.next();
                        if (!labelList.contains(s))
                            iterator.remove();
                    }
                    comMngPopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag));
                    comMngPopulationCommunityTagsDO.setUpdateBy(userId);
                    updatePopulationCommunityList.add(comMngPopulationCommunityTagsDO);
                    ComMngPopulationMistakeExcelVO mistake = new ComMngPopulationMistakeExcelVO();
                    BeanUtils.copyProperties(vo,mistake);
                    setMistake(mistake, vo);
                    mistake.setMistake("该实有人口已存在于该社区,执行更新");
                    mistakes.add(mistake);
                }
                log.info("查询实有人口存在社区信息完成");
            }
        }catch (Exception e){
            log.info("出现错误,错误原因:" + e.getMessage());
@@ -689,23 +749,33 @@
        if(!houseList.isEmpty()){
            log.info("执行数据库导入房屋");
            comMngPopulationHouseDAO.insertAll(houseList);
            log.info("执行数据库导入房屋完成");
            log.info("数据库导入房屋完成");
        }
        if(!saveList.isEmpty()){
            log.info("执行数据库导入人口");
            this.baseMapper.insertAll(saveList);
            log.info("执行数据库导入人口完成");
            log.info("数据库导入人口完成");
        }
        if(!updateList.isEmpty()){
            log.info("执行数据库更新人口");
            this.baseMapper.updateAll(updateList);
//            this.updateBatchById(updateList);
            log.info("执行数据库更新人口完成");
            log.info("数据库更新人口完成");
        }
        if(!houseUserList.isEmpty()){
            log.info("执行数据库导入人口房屋关系");
            comMngPopulationHouseUserService.saveBatch(houseUserList);
            log.info("执行数据库导入人口房屋关系完成");
            log.info("数据库导入人口房屋关系完成");
        }
        if(!savePopulationCommunityList.isEmpty()){
            log.info("执行数据库导入人口社区关系");
            comMngPopulationCommunityTagsService.saveBatch(savePopulationCommunityList);
            log.info("数据库导入人口社区关系完成");
        }
        if(!updatePopulationCommunityList.isEmpty()){
            log.info("执行数据库更新人口社区关系");
            comMngPopulationCommunityTagsService.updateBatchById(updatePopulationCommunityList);
            log.info("数据库更新人口社区关系完成");
        }
        log.info("执行数据库导入完成");
@@ -718,7 +788,7 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R listSaveDrugPopulation(List<ComMngPopulationDrugExcelVO> list, Long communityId) {
    public R listSaveDrugPopulation(List<ComMngPopulationDrugExcelVO> list, Long communityId, Long userId) {
        //需要新增的房屋集合
        List<ComMngPopulationHouseDO> houseList = new ArrayList<>();
        //需要新增的人口集合
@@ -934,7 +1004,7 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R listSaveCorrectPopulation(List<ComMngPopulationCorrectExcelVO> list, Long communityId) {
    public R listSaveCorrectPopulation(List<ComMngPopulationCorrectExcelVO> list, Long communityId, Long userId) {
        //需要新增的房屋集合
        List<ComMngPopulationHouseDO> houseList = new ArrayList<>();
        //需要新增的人口集合
@@ -1150,7 +1220,7 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R listSaveMajorPopulation(List<ComMngPopulationMajorExcelVO> list, Long communityId) {
    public R listSaveMajorPopulation(List<ComMngPopulationMajorExcelVO> list, Long communityId, Long userId) {
        //需要新增的房屋集合
        List<ComMngPopulationHouseDO> houseList = new ArrayList<>();
        //需要新增的人口集合
@@ -1366,7 +1436,7 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R listSaveCultPopulation(List<ComMngPopulationCultExcelVO> list, Long communityId) {
    public R listSaveCultPopulation(List<ComMngPopulationCultExcelVO> list, Long communityId, Long userId) {
        //需要新增的房屋集合
        List<ComMngPopulationHouseDO> houseList = new ArrayList<>();
        //需要新增的人口集合
@@ -1582,7 +1652,7 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R listSaveRehabilitationPopulation(List<ComMngPopulationRehabilitationExcelVO> list, Long communityId) {
    public R listSaveRehabilitationPopulation(List<ComMngPopulationRehabilitationExcelVO> list, Long communityId, Long userId) {
        //需要新增的房屋集合
        List<ComMngPopulationHouseDO> houseList = new ArrayList<>();
        //需要新增的人口集合
@@ -1798,7 +1868,7 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R listSaveKeyPopulation(List<ComMngPopulationKeyExcelVO> list, Long communityId) {
    public R listSaveKeyPopulation(List<ComMngPopulationKeyExcelVO> list, Long communityId, Long userId) {
        //需要新增的房屋集合
        List<ComMngPopulationHouseDO> houseList = new ArrayList<>();
        //需要新增的人口集合
@@ -2014,7 +2084,7 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R listSaveSentencePopulation(List<ComMngPopulationSentenceExcelVO> list, Long communityId) {
    public R listSaveSentencePopulation(List<ComMngPopulationSentenceExcelVO> list, Long communityId, Long userId) {
        //需要新增的房屋集合
        List<ComMngPopulationHouseDO> houseList = new ArrayList<>();
        //需要新增的人口集合
@@ -2230,7 +2300,7 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R listSaveVeteransPopulation(List<ComMngPopulationVeteransExcelVO> list, Long communityId) {
    public R listSaveVeteransPopulation(List<ComMngPopulationVeteransExcelVO> list, Long communityId, Long userId) {
        //需要新增的房屋集合
        List<ComMngPopulationHouseDO> houseList = new ArrayList<>();
        //需要新增的人口集合
@@ -2446,7 +2516,7 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R listSaveDisabilityPopulation(List<ComMngPopulationDisabilityExcelVO> list, Long communityId) {
    public R listSaveDisabilityPopulation(List<ComMngPopulationDisabilityExcelVO> list, Long communityId, Long userId) {
        //需要新增的房屋集合
        List<ComMngPopulationHouseDO> houseList = new ArrayList<>();
        //需要新增的人口集合
@@ -2662,7 +2732,7 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public R listSaveLowSecurityPopulation(List<ComMngPopulationLowSecurityExcelVO> list, Long communityId) {
    public R listSaveLowSecurityPopulation(List<ComMngPopulationLowSecurityExcelVO> list, Long communityId, Long userId) {
        //需要新增的房屋集合
        List<ComMngPopulationHouseDO> houseList = new ArrayList<>();
        //需要新增的人口集合
@@ -2881,24 +2951,25 @@
    }
    private ComMngPopulationDO updatePopulationDO(ComMngPopulationServeExcelVO vo, ComMngPopulationDO populationDO,List<String> labelList){
    private ComMngPopulationDO updatePopulationDO(ComMngPopulationServeExcelVO vo, ComMngPopulationDO populationDO, Long userId){
        BeanUtils.copyProperties(vo, populationDO);
        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
        Iterator<String> iterator = userTag.iterator();
        while (iterator.hasNext()) {
            String s = iterator.next();
            if (!labelList.contains(s))
                iterator.remove();
        }
//        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
//        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
//        Iterator<String> iterator = userTag.iterator();
//        while (iterator.hasNext()) {
//            String s = iterator.next();
//            if (!labelList.contains(s))
//                iterator.remove();
//        }
        String cardNoAES = populationDO.getCardNo();
        try {
            cardNoAES = AESUtil.encrypt128(vo.getCardNo(), aesKey);
        }catch (Exception e){
            log.error("身份证加密失败");
        }
        populationDO.setLabel(Joiner.on(",").join(userTag));
//        populationDO.setLabel(Joiner.on(",").join(userTag));
        populationDO.setCardNo(cardNoAES);
        populationDO.setUpdateBy(userId);
        return populationDO;
    }
@@ -3263,23 +3334,23 @@
        return populationDO;
    }
    private ComMngPopulationDO savePopulationDO(ComMngPopulationServeExcelVO vo, ComPopulationActVO comActDO, ComMngVillageDO comMngVillageDO,List<String> labelList) {
    private ComMngPopulationDO savePopulationDO(ComMngPopulationServeExcelVO vo, ComPopulationActVO comActDO, ComMngVillageDO comMngVillageDO, Long userId) {
        ComMngPopulationDO populationDO = new ComMngPopulationDO();
        BeanUtils.copyProperties(vo, populationDO);
        populationDO.setId(Snowflake.getId());
        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
        Iterator<String> iterator = userTag.iterator();
        while (iterator.hasNext()) {
            String s = iterator.next();
            if (!labelList.contains(s))
                iterator.remove();
        }
//        List<String> userTag = vo.getUserTagStr().stream().map(userTagStr -> userTagStr.split("\\(")[0]).collect(Collectors.toList());
//
//        //如果导入数据标签中有当前社区标签列表中不包含的标签,则删除
//        Iterator<String> iterator = userTag.iterator();
//        while (iterator.hasNext()) {
//            String s = iterator.next();
//            if (!labelList.contains(s))
//                iterator.remove();
//        }
        populationDO.setVillageId(comMngVillageDO.getVillageId());
        populationDO.setActId(comActDO.getCommunityId());
        populationDO.setStreetId(comActDO.getStreetId());
        populationDO.setLabel(Joiner.on(",").join(userTag));
//        populationDO.setLabel(Joiner.on(",").join(userTag));
        populationDO.setVillageName(comMngVillageDO.getGroupAt());
        populationDO.setCardNoStr(vo.getCardNo());
        populationDO.setUpdateAt(new Date());
@@ -3291,6 +3362,7 @@
            log.error("身份证加密失败");
        }
        populationDO.setCardNo(cardNoAES);
        populationDO.setCreateBy(userId);
        //新增的时候默认绑定房屋id
//        if ((vo.getIsRent() != null && vo.getIsRent().equals(PopulHouseUseEnum.SELF.getCode())) ||
//                (vo.getIsResidence() != null && vo.getIsResidence().intValue() == 1)) {
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComMngPopulationCommunityTagsMapper.xml
New file
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.panzhihua.service_community.dao.ComMngPopulationCommunityTagsDAO">
        <!-- 通用查询映射结果 -->
        <resultMap id="BaseResultMap" type="com.panzhihua.service_community.model.dos.ComMngPopulationCommunityTagsDO">
                    <id column="id" property="id" />
                    <result column="population_id" property="populationId" />
                    <result column="community_id" property="communityId" />
                    <result column="label" property="label" />
                    <result column="create_at" property="createAt" />
                    <result column="create_by" property="createBy" />
                    <result column="update_at" property="updateAt" />
                    <result column="update_by" property="updateBy" />
        </resultMap>
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, population_id, community_id, label, create_at, create_by, update_at, update_by
    </sql>
</mapper>