springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/java/com/panzhihua/applets_backstage/api/CommonDataApi.java
@@ -2,6 +2,9 @@ import javax.annotation.Resource; import com.panzhihua.common.model.dtos.user.PageInputUserDTO; import com.panzhihua.common.model.vos.user.ComMngTagVO; import com.panzhihua.common.service.user.UserService; import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; @@ -31,6 +34,8 @@ @Resource private CommunityService communityService; @Resource private UserService userService; @Value("${excel.convenientUrl}") private String excelConvenientUrl = "http://panzhihua.nhys.cdnhxx.com/web/bianminfuwudaoru.xlsx"; @@ -76,4 +81,38 @@ required = true) @RequestParam(value = "provinceAdcode") Integer provinceAdcode) { return communityService.getCityTreeByProvinceCode(provinceAdcode); } @ApiOperation(value = "特殊群体/分页查询标签列表", response = ComMngTagVO.class) @PostMapping("/special/tags/page") public R specialInputUserTags(@RequestBody PageInputUserDTO comMngUserTagDTO) { // Long communityId = this.getCommunityId(); // comMngUserTagDTO.setCommunityId(communityId); return userService.specialInputUserTags(comMngUserTagDTO); } /** * 新增或修改特殊群体标签 * * @param comMngTagVO * @return */ @ApiOperation(value = "特殊群体/新增或修改标签") @PostMapping("/special/tags/save") R saveSpecialInputUserTags(@RequestBody ComMngTagVO comMngTagVO) { // Long communityId = this.getLoginUserInfo().getCommunityId(); // comMngTagVO.setCommunityId(communityId); return userService.saveSpecialInputUserTags(comMngTagVO); } /** * 删除特殊群体标签 * * @param id * @return */ @ApiOperation(value = "特殊群体/删除标签") @DeleteMapping("/special/tags/delete") R deleteSpecialInputUserTags(@RequestParam(value = "id") Long id) { return userService.deleteSpecialInputUserTags(id); } } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComElderAuthRecordImportExcelListen.java
New file @@ -0,0 +1,242 @@ package com.panzhihua.common.listen; import cn.hutool.core.date.DateUtil; import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.event.AnalysisEventListener; import com.alibaba.fastjson.JSONArray; import com.google.common.collect.Lists; import com.panzhihua.common.constants.BcDictionaryConstants; import com.panzhihua.common.constants.Constants; import com.panzhihua.common.enums.*; import com.panzhihua.common.exceptions.ServiceException; import com.panzhihua.common.model.vos.BcDictionaryVO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.ComElderAuthRecordImportExcelVO; import com.panzhihua.common.model.vos.community.ComElderAuthRecordImportMistakeExcelVO; import com.panzhihua.common.model.vos.community.ComMngPopulationDrugExcelVO; import com.panzhihua.common.model.vos.community.ComMngPopulationDrugMistakeExcelVO; import com.panzhihua.common.service.community.CommunityService; import com.panzhihua.common.utlis.ListUtils; import com.panzhihua.common.utlis.PayUtil; import com.panzhihua.common.utlis.StringUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.ValueOperations; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; /** * @description: 高龄认证线下认证居民导入监听 * @author: txb */ @Slf4j public class ComElderAuthRecordImportExcelListen extends AnalysisEventListener<Map<Integer, String>> { /** * 每隔5条存储数据库,实际使用中可以3000条,然后清理list ,方便内存回收 */ private static final int BATCH_COUNT = 5000; private static int headSize = 0; List<Map<Integer, String>> list = new ArrayList<Map<Integer, String>>(); private CommunityService communityService; private Long communityId; private Long userId; private Map<Integer, String> headData; private StringRedisTemplate stringRedisTemplate; public ComElderAuthRecordImportExcelListen(CommunityService communityService, Long communityId, Long userId, StringRedisTemplate stringRedisTemplate) { this.communityService = communityService; this.communityId = communityId; this.userId = userId; this.stringRedisTemplate = stringRedisTemplate; } @Override public void invoke(Map<Integer, String> data, AnalysisContext context) { list.add(data); if (list.size() >= BATCH_COUNT) { saveData(); list.clear(); } } /** * 这里会一行行的返回头 * * @param headMap * @param context */ @Override public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) { headSize = headMap.size(); headData = headMap; } @Override public void doAfterAllAnalysed(AnalysisContext context) { saveData(); log.info("所有数据解析完成!"); } /** * 不是固定的列只能手动处理 */ private void saveData() { R<List<BcDictionaryVO>> dictionaryR = communityService.listDictionaryByKey(BcDictionaryConstants.FAMILY); log.info("开始导入线下认证居民数据"); log.info("表格总数据:" + list.size()); if (list.size() == 0) { throw new ServiceException("100", "导入数据为空!"); } ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue(); String key = Constants.ELDER_RECORD_ERROR_LIST; Map<String, String> dictMap = dictionaryR.getData().stream() .collect(Collectors.toMap(BcDictionaryVO::getDictName, BcDictionaryVO::getDictValue)); // Map<String,Integer> dictMap = new HashMap<>(); // for(BcDictionaryVO vo : dictionaryR.getData()){ // dictMap.put(vo.getDictName(),Integer.valueOf(vo.getDictValue())); // } int index = 2; try { String[] parsePatterns = new String[] {"yyyy-MM-dd", "yyyy-M-dd", "yyyy-MM-d", "yyyy-M-d", "yyyy/MM/dd", "yyyy/M/dd", "yyyy/MM/d", "yyyy/M/d"}; ArrayList<ComElderAuthRecordImportExcelVO> voList = Lists.newArrayList(); // List<ComMngPopulationImportErrorVO> populationImportErrorVOList = new ArrayList<>(); ArrayList<ComElderAuthRecordImportMistakeExcelVO> mistakes = Lists.newArrayList(); for (Map<Integer, String> oneData : list) { ComElderAuthRecordImportExcelVO vo = new ComElderAuthRecordImportExcelVO(); if (StringUtils.isEmpty(oneData.get(0))) { ComElderAuthRecordImportMistakeExcelVO mistake = new ComElderAuthRecordImportMistakeExcelVO(); index++; setElderAuthMistake(oneData, mistake); mistake.setMistake("名字不可为空,请填写姓名"); mistakes.add(mistake); continue; } vo.setName(oneData.get(0)); if (StringUtils.isEmpty(oneData.get(1))) { ComElderAuthRecordImportMistakeExcelVO mistake = new ComElderAuthRecordImportMistakeExcelVO(); index++; setElderAuthMistake(oneData, mistake); mistake.setMistake("身份证号不可为空,请填写身份证"); mistakes.add(mistake); continue; } // 判断身份证号码位数 if (oneData.get(1).length() != 18) { ComElderAuthRecordImportMistakeExcelVO mistake = new ComElderAuthRecordImportMistakeExcelVO(); index++; setElderAuthMistake(oneData, mistake); mistake.setMistake("身份证号位数有误,请检查身份证号码是否正确"); mistakes.add(mistake); continue; } vo.setIdCard(oneData.get(1).toUpperCase()); // 根据身份证号码解析年龄以及性别 // 获取用户生日 String birthday = vo.getIdCard().substring(6, 14); if (StringUtils.isNotEmpty(birthday)) { String year = birthday.substring(0, 4); String month = birthday.substring(4, 6); String day = birthday.substring(6, 8); vo.setBirthday(year + "-" + month + "-" + day); } // //设置用户年龄 // vo.setAge(AgeUtils.getAgeFromBirthTime(birthday)); // 获取用户性别 int sex = Integer.parseInt(vo.getIdCard().substring(16, 17)); if (sex % 2 == 1) { vo.setSex(PopulSexEnum.nan.getCode()); } else { vo.setSex(PopulSexEnum.nv.getCode()); } if (StringUtils.isNotEmpty(oneData.get(2))) { vo.setPhone(oneData.get(2)); } if (StringUtils.isNotEmpty(oneData.get(3))) { vo.setNowAddress(oneData.get(3)); } if (StringUtils.isEmpty(oneData.get(4))) { index++; ComElderAuthRecordImportMistakeExcelVO mistake = new ComElderAuthRecordImportMistakeExcelVO(); setElderAuthMistake(oneData, mistake); mistake.setMistake("认证时间不可为空"); mistakes.add(mistake); continue; } vo.setAuthDate(DateUtil.parse(oneData.get(4).trim(), parsePatterns)); if (StringUtils.isNotEmpty(oneData.get(5))) { Integer isOk = PopulHouseUseEnum.getCodeByName(oneData.get(5)); if (isOk.equals(-1)) { index++; ComElderAuthRecordImportMistakeExcelVO mistake = new ComElderAuthRecordImportMistakeExcelVO(); setElderAuthMistake(oneData, mistake); mistake.setMistake("您填写的健在(是/否)有误"); mistakes.add(mistake); continue; } vo.setIsAlive(isOk); } else { vo.setIsAlive(PopulHouseUseEnum.getCodeByName("否")); } voList.add(vo); index++; } log.info("开始进入业务层处理逻辑"); R r = communityService.listSaveElderAuthRecordExcelVO(voList, communityId, userId); log.info("业务层处理逻辑完成"); if (!R.isOk(r)) { log.info("业务层处理成功"); List<ComElderAuthRecordImportMistakeExcelVO> list = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComElderAuthRecordImportMistakeExcelVO.class); // String errMsg = r.getMsg(); // List<ComMngPopulationImportErrorVO> errorList = // JSON.parseArray(errMsg,ComMngPopulationImportErrorVO.class); // if(!errorList.isEmpty()){ // populationImportErrorVOList.addAll(errorList); // } mistakes.addAll(list); log.info("将错误数据存入redis中"); valueOperations.set(key, JSONArray.toJSONString(mistakes), 1, TimeUnit.HOURS); log.info("将错误数据存入redis中成功"); throw new ServiceException("500", key); } else { log.info("业务层处理逻辑失败"); if (!mistakes.isEmpty()) { log.info("业务层处理逻辑失败,将错误数据缓存到redis中"); valueOperations.set(key, JSONArray.toJSONString(mistakes), 1, TimeUnit.HOURS); log.info("业务层处理逻辑失败,将错误数据缓存到redis中成功"); throw new ServiceException("500", key); } } } catch (NumberFormatException e) { log.info("处理数据时失败"); e.printStackTrace(); // List<ComMngPopulationImportErrorVO> populationImportErrorVOList = new ArrayList<>(); // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); // importErrorVO.setErrorPosition("第" + index + "行"); // importErrorVO.setErrorMsg("数据格式有误,请检查文档内数据"); // populationImportErrorVOList.add(importErrorVO); log.error("数据格式有误,第" + index + "行"); throw new ServiceException("500", "导入失败111"); } } private void setElderAuthMistake(Map<Integer, String> map, ComElderAuthRecordImportMistakeExcelVO vo) { vo.setName(map.get(0)); vo.setIdCard(map.get(1)); vo.setPhone(map.get(3)); vo.setNowAddress(map.get(2)); vo.setAuthDate(map.get(4)); vo.setIsAlive(map.get(5)); } } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationElderExcelListen.java
New file @@ -0,0 +1,470 @@ package com.panzhihua.common.listen; import cn.hutool.core.date.DateUtil; import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.event.AnalysisEventListener; import com.alibaba.fastjson.JSONArray; import com.google.common.collect.Lists; import com.panzhihua.common.constants.BcDictionaryConstants; import com.panzhihua.common.constants.Constants; import com.panzhihua.common.enums.*; import com.panzhihua.common.exceptions.ServiceException; import com.panzhihua.common.model.vos.BcDictionaryVO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.ComMngPopulationElderExcelVO; import com.panzhihua.common.model.vos.community.ComMngPopulationElderMistakeExcelVO; import com.panzhihua.common.model.vos.community.ComMngPopulationMistakeExcelVO; import com.panzhihua.common.service.community.CommunityService; import com.panzhihua.common.utlis.ListUtils; import com.panzhihua.common.utlis.PayUtil; import com.panzhihua.common.utlis.StringUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.ValueOperations; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; /** * title: ComMngPopulationElderExcelListen 高龄老人导入监听 * projectName 成都呐喊信息技术有限公司-智慧社区项目 * description: 高龄老人导入监听 * * @author txb * @date 2021/9/01 15:12 */ @Slf4j public class ComMngPopulationElderExcelListen extends AnalysisEventListener<Map<Integer, String>> { /** * 每隔5条存储数据库,实际使用中可以3000条,然后清理list ,方便内存回收 */ private static final int BATCH_COUNT = 5000; private static int headSize = 0; List<Map<Integer, String>> list = new ArrayList<Map<Integer, String>>(); private CommunityService communityService; private Long communityId; private Long userId; private Map<Integer, String> headData; private StringRedisTemplate stringRedisTemplate; public ComMngPopulationElderExcelListen(CommunityService communityService, Long communityId, Long userId, StringRedisTemplate stringRedisTemplate) { this.communityService = communityService; this.communityId = communityId; this.userId = userId; this.stringRedisTemplate = stringRedisTemplate; } @Override public void invoke(Map<Integer, String> data, AnalysisContext context) { list.add(data); if (list.size() >= BATCH_COUNT) { saveData(); list.clear(); } } /** * 这里会一行行的返回头 * * @param headMap * @param context */ @Override public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) { headSize = headMap.size(); headData = headMap; } @Override public void doAfterAllAnalysed(AnalysisContext context) { saveData(); log.info("所有数据解析完成!"); } /** * 不是固定的列只能手动处理 */ private void saveData() { R<List<BcDictionaryVO>> dictionaryR = communityService.listDictionaryByKey(BcDictionaryConstants.FAMILY); log.info("开始导入高龄老人数据"); log.info("表格总数据:" + list.size()); if (list.size() == 0) { throw new ServiceException("100", "导入数据为空!"); } ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue(); String key = Constants.ELDER_POPULATION_ERROR_LIST; Map<String, String> dictMap = dictionaryR.getData().stream() .collect(Collectors.toMap(BcDictionaryVO::getDictName, BcDictionaryVO::getDictValue)); // Map<String,Integer> dictMap = new HashMap<>(); // for(BcDictionaryVO vo : dictionaryR.getData()){ // dictMap.put(vo.getDictName(),Integer.valueOf(vo.getDictValue())); // } int index = 2; try { String[] parsePatterns = new String[] {"yyyy-MM-dd", "yyyy-M-dd", "yyyy-MM-d", "yyyy-M-d", "yyyy/MM/dd", "yyyy/M/dd", "yyyy/MM/d", "yyyy/M/d"}; ArrayList<ComMngPopulationElderExcelVO> voList = Lists.newArrayList(); // List<ComMngPopulationImportErrorVO> populationImportErrorVOList = new ArrayList<>(); ArrayList<ComMngPopulationElderMistakeExcelVO> mistakes = Lists.newArrayList(); for (Map<Integer, String> oneData : list) { ComMngPopulationElderExcelVO vo = new ComMngPopulationElderExcelVO(); if (StringUtils.isEmpty(oneData.get(0))) { ComMngPopulationElderMistakeExcelVO mistake = new ComMngPopulationElderMistakeExcelVO(); index++; setElderMistake(oneData, mistake); mistake.setMistake("名字不可为空,请填写姓名"); mistakes.add(mistake); continue; } vo.setName(oneData.get(0)); if (StringUtils.isEmpty(oneData.get(1))) { ComMngPopulationElderMistakeExcelVO mistake = new ComMngPopulationElderMistakeExcelVO(); index++; setElderMistake(oneData, mistake); mistake.setMistake("身份证号不可为空,请填写身份证"); mistakes.add(mistake); continue; } // 判断身份证号码位数 if (oneData.get(1).length() != 18) { ComMngPopulationElderMistakeExcelVO mistake = new ComMngPopulationElderMistakeExcelVO(); index++; setElderMistake(oneData, mistake); mistake.setMistake("身份证号位数有误,请检查身份证号码是否正确"); mistakes.add(mistake); continue; } vo.setCardNo(oneData.get(1).toUpperCase()); // 根据身份证号码解析年龄以及性别 // 获取用户生日 String birthday = vo.getCardNo().substring(6, 14); if (StringUtils.isNotEmpty(birthday)) { String year = birthday.substring(0, 4); String month = birthday.substring(4, 6); String day = birthday.substring(6, 8); vo.setBirthday(year + "-" + month + "-" + day); } // //设置用户年龄 // vo.setAge(AgeUtils.getAgeFromBirthTime(birthday)); // 获取用户性别 int sex = Integer.parseInt(vo.getCardNo().substring(16, 17)); if (sex % 2 == 1) { vo.setSex(PopulSexEnum.nan.getCode()); } else { vo.setSex(PopulSexEnum.nv.getCode()); } if (StringUtils.isNotEmpty(oneData.get(2))) { vo.setNation(oneData.get(2)); } if (StringUtils.isNotEmpty(oneData.get(3))) { Integer isOk = PopulPoliticalOutlookEnum.getCodeByName(oneData.get(3)); if (isOk.equals(-1)) { index++; ComMngPopulationElderMistakeExcelVO mistake = new ComMngPopulationElderMistakeExcelVO(); setElderMistake(oneData, mistake); mistake.setMistake("您填写的政治面貌有误"); mistakes.add(mistake); continue; } vo.setPoliticalOutlook(isOk); } if (StringUtils.isNotEmpty(oneData.get(4))) { Integer isOk = PopulHouseUseEnum.getCodeByName(oneData.get(4)); if (isOk.equals(-1)) { ComMngPopulationElderMistakeExcelVO mistake = new ComMngPopulationElderMistakeExcelVO(); index++; setElderMistake(oneData, mistake); mistake.setMistake("您填写的是否租住有误"); mistakes.add(mistake); continue; } vo.setIsRent(isOk); } else { vo.setIsRent(PopulHouseUseEnum.getCodeByName("否")); } if (StringUtils.isEmpty(oneData.get(5))) { index++; ComMngPopulationElderMistakeExcelVO mistake = new ComMngPopulationElderMistakeExcelVO(); setElderMistake(oneData, mistake); mistake.setMistake("街路巷不可为空"); mistakes.add(mistake); continue; } vo.setRoad(oneData.get(5)); if (StringUtils.isEmpty(oneData.get(6))) { index++; ComMngPopulationElderMistakeExcelVO mistake = new ComMngPopulationElderMistakeExcelVO(); setElderMistake(oneData, mistake); mistake.setMistake("小区号不可为空"); mistakes.add(mistake); continue; } vo.setDoorNo(oneData.get(6).trim()); // if(StringUtils.isEmpty(oneData.get(7))){ // index++; // ComMngPopulationElderMistakeExcelVO mistake = new ComMngPopulationElderMistakeExcelVO(); // setElderMistake(oneData, mistake); // mistake.setMistake("楼排号不可为空"); // mistakes.add(mistake); // continue; // } if (StringUtils.isNotEmpty(oneData.get(7))) { vo.setFloor(oneData.get(7).trim()); } // if(StringUtils.isEmpty(oneData.get(8))){ // index++; // ComMngPopulationElderMistakeExcelVO mistake = new ComMngPopulationElderMistakeExcelVO(); // setElderMistake(oneData, mistake); // mistake.setMistake("单元号不可为空"); // mistakes.add(mistake); // continue; // } if (StringUtils.isNotEmpty(oneData.get(8))) { vo.setUnitNo(oneData.get(8).trim()); } // if(StringUtils.isEmpty(oneData.get(9))){ // index++; // ComMngPopulationElderMistakeExcelVO mistake = new ComMngPopulationElderMistakeExcelVO(); // setElderMistake(oneData, mistake); // mistake.setMistake("户室不可为空"); // mistakes.add(mistake); // continue; // } if (StringUtils.isNotEmpty(oneData.get(9))) { vo.setHouseNo(oneData.get(9).trim()); } if (StringUtils.isNotEmpty(oneData.get(10))) { Integer isOk = PopulHouseStatusEnum.getCodeByName(oneData.get(10).trim()); if (isOk.equals(-1)) { index++; ComMngPopulationElderMistakeExcelVO mistake = new ComMngPopulationElderMistakeExcelVO(); setElderMistake(oneData, mistake); mistake.setMistake("您填写的房屋状态有误"); mistakes.add(mistake); continue; } vo.setHouseStatus(isOk); } if (StringUtils.isNotEmpty(oneData.get(11))) { Integer isOk = PopulHousePurposeEnum.getCodeByName(oneData.get(11).trim()); if (isOk.equals(-1)) { index++; ComMngPopulationElderMistakeExcelVO mistake = new ComMngPopulationElderMistakeExcelVO(); setElderMistake(oneData, mistake); mistake.setMistake("您填写的房屋用途有误"); mistakes.add(mistake); continue; } vo.setHousePurpose(isOk); } if (StringUtils.isNotEmpty(oneData.get(12))) { Integer isOk = PopulHouseControlStatusEnum.getCodeByName(oneData.get(12)); if (isOk.equals(-1)) { index++; ComMngPopulationElderMistakeExcelVO mistake = new ComMngPopulationElderMistakeExcelVO(); setElderMistake(oneData, mistake); mistake.setMistake("您填写的管控状态有误"); mistakes.add(mistake); continue; } vo.setControlStatus(isOk); } if (StringUtils.isNotEmpty(oneData.get(13))) { vo.setPhone(oneData.get(13).trim()); } if (StringUtils.isNotEmpty(oneData.get(14))) { vo.setNativePlace(oneData.get(14).trim()); } if (StringUtils.isNotEmpty(oneData.get(15))) { Integer isOk = PopulCultureLevelEnum.getCodeByName(oneData.get(15)); if (isOk.equals(-1)) { index++; ComMngPopulationElderMistakeExcelVO mistake = new ComMngPopulationElderMistakeExcelVO(); setElderMistake(oneData, mistake); mistake.setMistake("您填写的文化程度有误"); mistakes.add(mistake); continue; } vo.setCultureLevel(isOk); } if (StringUtils.isNotEmpty(oneData.get(16))) { Integer isOk = PopulMarriageEnum.getCodeByName(oneData.get(16)); if (isOk.equals(-1)) { index++; ComMngPopulationElderMistakeExcelVO mistake = new ComMngPopulationElderMistakeExcelVO(); setElderMistake(oneData, mistake); mistake.setMistake("您填写的婚姻状况有误"); mistakes.add(mistake); continue; } else { vo.setMarriage(isOk); } } if (StringUtils.isNotEmpty(oneData.get(17))) { vo.setHealthy(oneData.get(17).trim()); } if (StringUtils.isNotEmpty(oneData.get(18))) { Integer isOk = PopulOutOrLocalEnum.getCodeByName(oneData.get(18)); if (isOk.equals(-1)) { index++; ComMngPopulationElderMistakeExcelVO mistake = new ComMngPopulationElderMistakeExcelVO(); setElderMistake(oneData, mistake); mistake.setMistake("您填写的本地/外地有误"); mistakes.add(mistake); continue; } vo.setOutOrLocal(isOk); } else { vo.setOutOrLocal(PopulOutOrLocalEnum.getCodeByName("本地")); } if (StringUtils.isNotEmpty(oneData.get(19))) { vo.setCensusRegister(oneData.get(19).trim()); } if (StringUtils.isNotEmpty(oneData.get(20))) { Integer isOk = PopulHouseUseEnum.getCodeByName(oneData.get(20)); if (isOk.equals(-1)) { ComMngPopulationElderMistakeExcelVO mistake = new ComMngPopulationElderMistakeExcelVO(); index++; setElderMistake(oneData, mistake); mistake.setMistake("您填写的高龄老人登记(是/否)有误"); mistakes.add(mistake); continue; } vo.setIsRegister(isOk); } else { vo.setIsRegister(PopulHouseUseEnum.getCodeByName("否")); } if (StringUtils.isNotEmpty(oneData.get(21))) { Integer isOk = PopulHouseUseEnum.getCodeByName(oneData.get(21)); if (isOk.equals(-1)) { ComMngPopulationElderMistakeExcelVO mistake = new ComMngPopulationElderMistakeExcelVO(); index++; setElderMistake(oneData, mistake); mistake.setMistake("您填写的健在(是/否)有误"); mistakes.add(mistake); continue; } vo.setIsAlive(isOk); } else { vo.setIsAlive(PopulHouseUseEnum.getCodeByName("否")); } if (StringUtils.isNotEmpty(oneData.get(22))) { vo.setReceiveAllowanceBegin(DateUtil.parse(oneData.get(22).trim(), parsePatterns)); } if (StringUtils.isNotEmpty(oneData.get(23))) { vo.setNowAddress(oneData.get(23).trim()); } if (StringUtils.isNotEmpty(oneData.get(24))) { vo.setRemark(oneData.get(24).trim()); } vo.getUserTagStr().add("高龄老人"); for (int i = 25; i < headSize; i++) { if (oneData.get(i) != null && oneData.get(i).equals("是")) { vo.getUserTagStr().add(headData.get(i).substring(0, headData.get(i).indexOf("("))); } } // 将重复的数据进行MD5加密实现去重 String distinct = vo.getName() + vo.getCardNo() + vo.getRoad() + vo.getDoorNo() + vo.getFloor() + vo.getUnitNo() + vo.getHouseNo(); try { String distinctPass = PayUtil.MD5(distinct); if (StringUtils.isNotEmpty(distinctPass)) { vo.setDistinctPass(distinctPass); } } catch (Exception e) { log.error("组装MD5加密字段失败,数据表格行数:" + index); continue; } voList.add(vo); index++; } // 客户需要暂时注释,等客户处理完成需要恢复 // 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)); // } // 根据list中的IdCard城市来去重 List<ComMngPopulationElderExcelVO> newVoList = voList.stream().filter(ListUtils.distinctByKey(ComMngPopulationElderExcelVO::getDistinctPass)) .collect(Collectors.toList()); log.info("开始进入业务层处理逻辑"); R r = communityService.listSavePopulationElderExcelVO(newVoList, communityId, userId); log.info("业务层处理逻辑完成"); if (!R.isOk(r)) { log.info("业务层处理成功"); List<ComMngPopulationElderMistakeExcelVO> list = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComMngPopulationElderMistakeExcelVO.class); // String errMsg = r.getMsg(); // List<ComMngPopulationImportErrorVO> errorList = // JSON.parseArray(errMsg,ComMngPopulationImportErrorVO.class); // if(!errorList.isEmpty()){ // populationImportErrorVOList.addAll(errorList); // } mistakes.addAll(list); log.info("将错误数据存入redis中"); valueOperations.set(key, JSONArray.toJSONString(mistakes), 1, TimeUnit.HOURS); log.info("将错误数据存入redis中成功"); throw new ServiceException("500", key); } else { log.info("业务层处理逻辑失败"); if (!mistakes.isEmpty()) { log.info("业务层处理逻辑失败,将错误数据缓存到redis中"); valueOperations.set(key, JSONArray.toJSONString(mistakes), 1, TimeUnit.HOURS); log.info("业务层处理逻辑失败,将错误数据缓存到redis中成功"); throw new ServiceException("500", key); } } } catch (NumberFormatException e) { log.info("处理数据时失败"); e.printStackTrace(); // List<ComMngPopulationImportErrorVO> populationImportErrorVOList = new ArrayList<>(); // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); // importErrorVO.setErrorPosition("第" + index + "行"); // importErrorVO.setErrorMsg("数据格式有误,请检查文档内数据"); // populationImportErrorVOList.add(importErrorVO); log.error("数据格式有误,第" + index + "行"); throw new ServiceException("500", "导入失败111"); } } private void setElderMistake(Map<Integer, String> map, ComMngPopulationElderMistakeExcelVO vo) { vo.setName(map.get(0)); vo.setCardNo(map.get(1)); vo.setNation(map.get(2)); vo.setPoliticalOutlook(map.get(3)); vo.setIsRent(map.get(4)); vo.setRoad(map.get(5)); vo.setDoorNo(map.get(6)); vo.setFloor(map.get(7)); vo.setUnitNo(map.get(8)); vo.setHouseNo(map.get(9)); vo.setHouseStatus(map.get(10)); vo.setHousePurpose(map.get(11)); vo.setControlStatus(map.get(12)); vo.setPhone(map.get(13)); vo.setNativePlace(map.get(14)); vo.setCultureLevel(map.get(15)); vo.setMarriage(map.get(16)); vo.setHealthy(map.get(17)); vo.setOutOrLocal(map.get(18)); vo.setCensusRegister(map.get(19)); vo.setIsRegister(map.get(20)); vo.setIsAlive(map.get(21)); vo.setReceiveAllowanceBegin(map.get(22)); vo.setNowAddress(map.get(23)); vo.setRemark(map.get(24)); } } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationPensionExcelListen.java
New file @@ -0,0 +1,468 @@ package com.panzhihua.common.listen; import cn.hutool.core.date.DateUtil; import com.alibaba.excel.context.AnalysisContext; import com.alibaba.excel.event.AnalysisEventListener; import com.alibaba.fastjson.JSONArray; import com.google.common.collect.Lists; import com.panzhihua.common.constants.BcDictionaryConstants; import com.panzhihua.common.constants.Constants; import com.panzhihua.common.enums.*; import com.panzhihua.common.exceptions.ServiceException; import com.panzhihua.common.model.vos.BcDictionaryVO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.ComMngPopulationPensionExcelVO; import com.panzhihua.common.model.vos.community.ComMngPopulationPensionMistakeExcelVO; import com.panzhihua.common.service.community.CommunityService; import com.panzhihua.common.utlis.ListUtils; import com.panzhihua.common.utlis.PayUtil; import com.panzhihua.common.utlis.StringUtils; import lombok.extern.slf4j.Slf4j; import org.springframework.data.redis.core.StringRedisTemplate; import org.springframework.data.redis.core.ValueOperations; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; /** * title: ComMngPopulationPensionExcelListen 养老金人员导入监听 * projectName 成都呐喊信息技术有限公司-智慧社区项目 * description: 养老金人员导入监听 * * @author txb * @date 2021/9/01 15:12 */ @Slf4j public class ComMngPopulationPensionExcelListen extends AnalysisEventListener<Map<Integer, String>> { /** * 每隔5条存储数据库,实际使用中可以3000条,然后清理list ,方便内存回收 */ private static final int BATCH_COUNT = 5000; private static int headSize = 0; List<Map<Integer, String>> list = new ArrayList<Map<Integer, String>>(); private CommunityService communityService; private Long communityId; private Long userId; private Map<Integer, String> headData; private StringRedisTemplate stringRedisTemplate; public ComMngPopulationPensionExcelListen(CommunityService communityService, Long communityId, Long userId, StringRedisTemplate stringRedisTemplate) { this.communityService = communityService; this.communityId = communityId; this.userId = userId; this.stringRedisTemplate = stringRedisTemplate; } @Override public void invoke(Map<Integer, String> data, AnalysisContext context) { list.add(data); if (list.size() >= BATCH_COUNT) { saveData(); list.clear(); } } /** * 这里会一行行的返回头 * * @param headMap * @param context */ @Override public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) { headSize = headMap.size(); headData = headMap; } @Override public void doAfterAllAnalysed(AnalysisContext context) { saveData(); log.info("所有数据解析完成!"); } /** * 不是固定的列只能手动处理 */ private void saveData() { R<List<BcDictionaryVO>> dictionaryR = communityService.listDictionaryByKey(BcDictionaryConstants.FAMILY); log.info("开始导入养老金人员数据"); log.info("表格总数据:" + list.size()); if (list.size() == 0) { throw new ServiceException("100", "导入数据为空!"); } ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue(); String key = Constants.PENSION_POPULATION_ERROR_LIST; Map<String, String> dictMap = dictionaryR.getData().stream() .collect(Collectors.toMap(BcDictionaryVO::getDictName, BcDictionaryVO::getDictValue)); // Map<String,Integer> dictMap = new HashMap<>(); // for(BcDictionaryVO vo : dictionaryR.getData()){ // dictMap.put(vo.getDictName(),Integer.valueOf(vo.getDictValue())); // } int index = 2; try { String[] parsePatterns = new String[] {"yyyy-MM-dd", "yyyy-M-dd", "yyyy-MM-d", "yyyy-M-d", "yyyy/MM/dd", "yyyy/M/dd", "yyyy/MM/d", "yyyy/M/d"}; ArrayList<ComMngPopulationPensionExcelVO> voList = Lists.newArrayList(); // List<ComMngPopulationImportErrorVO> populationImportErrorVOList = new ArrayList<>(); ArrayList<ComMngPopulationPensionMistakeExcelVO> mistakes = Lists.newArrayList(); for (Map<Integer, String> oneData : list) { ComMngPopulationPensionExcelVO vo = new ComMngPopulationPensionExcelVO(); if (StringUtils.isEmpty(oneData.get(0))) { ComMngPopulationPensionMistakeExcelVO mistake = new ComMngPopulationPensionMistakeExcelVO(); index++; setPensionMistake(oneData, mistake); mistake.setMistake("名字不可为空,请填写姓名"); mistakes.add(mistake); continue; } vo.setName(oneData.get(0)); if (StringUtils.isEmpty(oneData.get(1))) { ComMngPopulationPensionMistakeExcelVO mistake = new ComMngPopulationPensionMistakeExcelVO(); index++; setPensionMistake(oneData, mistake); mistake.setMistake("身份证号不可为空,请填写身份证"); mistakes.add(mistake); continue; } // 判断身份证号码位数 if (oneData.get(1).length() != 18) { ComMngPopulationPensionMistakeExcelVO mistake = new ComMngPopulationPensionMistakeExcelVO(); index++; setPensionMistake(oneData, mistake); mistake.setMistake("身份证号位数有误,请检查身份证号码是否正确"); mistakes.add(mistake); continue; } vo.setCardNo(oneData.get(1).toUpperCase()); // 根据身份证号码解析年龄以及性别 // 获取用户生日 String birthday = vo.getCardNo().substring(6, 14); if (StringUtils.isNotEmpty(birthday)) { String year = birthday.substring(0, 4); String month = birthday.substring(4, 6); String day = birthday.substring(6, 8); vo.setBirthday(year + "-" + month + "-" + day); } // //设置用户年龄 // vo.setAge(AgeUtils.getAgeFromBirthTime(birthday)); // 获取用户性别 int sex = Integer.parseInt(vo.getCardNo().substring(16, 17)); if (sex % 2 == 1) { vo.setSex(PopulSexEnum.nan.getCode()); } else { vo.setSex(PopulSexEnum.nv.getCode()); } if (StringUtils.isNotEmpty(oneData.get(2))) { vo.setNation(oneData.get(2)); } if (StringUtils.isNotEmpty(oneData.get(3))) { Integer isOk = PopulPoliticalOutlookEnum.getCodeByName(oneData.get(3)); if (isOk.equals(-1)) { index++; ComMngPopulationPensionMistakeExcelVO mistake = new ComMngPopulationPensionMistakeExcelVO(); setPensionMistake(oneData, mistake); mistake.setMistake("您填写的政治面貌有误"); mistakes.add(mistake); continue; } vo.setPoliticalOutlook(isOk); } if (StringUtils.isNotEmpty(oneData.get(4))) { Integer isOk = PopulHouseUseEnum.getCodeByName(oneData.get(4)); if (isOk.equals(-1)) { ComMngPopulationPensionMistakeExcelVO mistake = new ComMngPopulationPensionMistakeExcelVO(); index++; setPensionMistake(oneData, mistake); mistake.setMistake("您填写的是否租住有误"); mistakes.add(mistake); continue; } vo.setIsRent(isOk); } else { vo.setIsRent(PopulHouseUseEnum.getCodeByName("否")); } if (StringUtils.isEmpty(oneData.get(5))) { index++; ComMngPopulationPensionMistakeExcelVO mistake = new ComMngPopulationPensionMistakeExcelVO(); setPensionMistake(oneData, mistake); mistake.setMistake("街路巷不可为空"); mistakes.add(mistake); continue; } vo.setRoad(oneData.get(5)); if (StringUtils.isEmpty(oneData.get(6))) { index++; ComMngPopulationPensionMistakeExcelVO mistake = new ComMngPopulationPensionMistakeExcelVO(); setPensionMistake(oneData, mistake); mistake.setMistake("小区号不可为空"); mistakes.add(mistake); continue; } vo.setDoorNo(oneData.get(6).trim()); // if(StringUtils.isEmpty(oneData.get(7))){ // index++; // ComMngPopulationPensionMistakeExcelVO mistake = new ComMngPopulationPensionMistakeExcelVO(); // setPensionMistake(oneData, mistake); // mistake.setMistake("楼排号不可为空"); // mistakes.add(mistake); // continue; // } if (StringUtils.isNotEmpty(oneData.get(7))) { vo.setFloor(oneData.get(7).trim()); } // if(StringUtils.isEmpty(oneData.get(8))){ // index++; // ComMngPopulationPensionMistakeExcelVO mistake = new ComMngPopulationPensionMistakeExcelVO(); // setPensionMistake(oneData, mistake); // mistake.setMistake("单元号不可为空"); // mistakes.add(mistake); // continue; // } if (StringUtils.isNotEmpty(oneData.get(8))) { vo.setUnitNo(oneData.get(8).trim()); } // if(StringUtils.isEmpty(oneData.get(9))){ // index++; // ComMngPopulationPensionMistakeExcelVO mistake = new ComMngPopulationPensionMistakeExcelVO(); // setPensionMistake(oneData, mistake); // mistake.setMistake("户室不可为空"); // mistakes.add(mistake); // continue; // } if (StringUtils.isNotEmpty(oneData.get(9))) { vo.setHouseNo(oneData.get(9).trim()); } if (StringUtils.isNotEmpty(oneData.get(10))) { Integer isOk = PopulHouseStatusEnum.getCodeByName(oneData.get(10).trim()); if (isOk.equals(-1)) { index++; ComMngPopulationPensionMistakeExcelVO mistake = new ComMngPopulationPensionMistakeExcelVO(); setPensionMistake(oneData, mistake); mistake.setMistake("您填写的房屋状态有误"); mistakes.add(mistake); continue; } vo.setHouseStatus(isOk); } if (StringUtils.isNotEmpty(oneData.get(11))) { Integer isOk = PopulHousePurposeEnum.getCodeByName(oneData.get(11).trim()); if (isOk.equals(-1)) { index++; ComMngPopulationPensionMistakeExcelVO mistake = new ComMngPopulationPensionMistakeExcelVO(); setPensionMistake(oneData, mistake); mistake.setMistake("您填写的房屋用途有误"); mistakes.add(mistake); continue; } vo.setHousePurpose(isOk); } if (StringUtils.isNotEmpty(oneData.get(12))) { Integer isOk = PopulHouseControlStatusEnum.getCodeByName(oneData.get(12)); if (isOk.equals(-1)) { index++; ComMngPopulationPensionMistakeExcelVO mistake = new ComMngPopulationPensionMistakeExcelVO(); setPensionMistake(oneData, mistake); mistake.setMistake("您填写的管控状态有误"); mistakes.add(mistake); continue; } vo.setControlStatus(isOk); } if (StringUtils.isNotEmpty(oneData.get(13))) { vo.setPhone(oneData.get(13).trim()); } if (StringUtils.isNotEmpty(oneData.get(14))) { vo.setNativePlace(oneData.get(14).trim()); } if (StringUtils.isNotEmpty(oneData.get(15))) { Integer isOk = PopulCultureLevelEnum.getCodeByName(oneData.get(15)); if (isOk.equals(-1)) { index++; ComMngPopulationPensionMistakeExcelVO mistake = new ComMngPopulationPensionMistakeExcelVO(); setPensionMistake(oneData, mistake); mistake.setMistake("您填写的文化程度有误"); mistakes.add(mistake); continue; } vo.setCultureLevel(isOk); } if (StringUtils.isNotEmpty(oneData.get(16))) { Integer isOk = PopulMarriageEnum.getCodeByName(oneData.get(16)); if (isOk.equals(-1)) { index++; ComMngPopulationPensionMistakeExcelVO mistake = new ComMngPopulationPensionMistakeExcelVO(); setPensionMistake(oneData, mistake); mistake.setMistake("您填写的婚姻状况有误"); mistakes.add(mistake); continue; } else { vo.setMarriage(isOk); } } if (StringUtils.isNotEmpty(oneData.get(17))) { vo.setHealthy(oneData.get(17).trim()); } if (StringUtils.isNotEmpty(oneData.get(18))) { Integer isOk = PopulOutOrLocalEnum.getCodeByName(oneData.get(18)); if (isOk.equals(-1)) { index++; ComMngPopulationPensionMistakeExcelVO mistake = new ComMngPopulationPensionMistakeExcelVO(); setPensionMistake(oneData, mistake); mistake.setMistake("您填写的本地/外地有误"); mistakes.add(mistake); continue; } vo.setOutOrLocal(isOk); } else { vo.setOutOrLocal(PopulOutOrLocalEnum.getCodeByName("本地")); } if (StringUtils.isNotEmpty(oneData.get(19))) { vo.setCensusRegister(oneData.get(19).trim()); } if (StringUtils.isNotEmpty(oneData.get(20))) { Integer isOk = PopulHouseUseEnum.getCodeByName(oneData.get(20)); if (isOk.equals(-1)) { ComMngPopulationPensionMistakeExcelVO mistake = new ComMngPopulationPensionMistakeExcelVO(); index++; setPensionMistake(oneData, mistake); mistake.setMistake("您填写的养老登记(是/否)有误"); mistakes.add(mistake); continue; } vo.setIsRegister(isOk); } else { vo.setIsRegister(PopulHouseUseEnum.getCodeByName("否")); } if (StringUtils.isNotEmpty(oneData.get(21))) { Integer isOk = PopulHouseUseEnum.getCodeByName(oneData.get(21)); if (isOk.equals(-1)) { ComMngPopulationPensionMistakeExcelVO mistake = new ComMngPopulationPensionMistakeExcelVO(); index++; setPensionMistake(oneData, mistake); mistake.setMistake("您填写的健在(是/否)有误"); mistakes.add(mistake); continue; } vo.setIsAlive(isOk); } else { vo.setIsAlive(PopulHouseUseEnum.getCodeByName("否")); } if (StringUtils.isNotEmpty(oneData.get(22))) { vo.setReceiveAllowanceBegin(DateUtil.parse(oneData.get(22).trim(), parsePatterns)); } if (StringUtils.isNotEmpty(oneData.get(23))) { vo.setNowAddress(oneData.get(23).trim()); } if (StringUtils.isNotEmpty(oneData.get(24))) { vo.setRemark(oneData.get(24).trim()); } vo.getUserTagStr().add("养老金人员"); for (int i = 25; i < headSize; i++) { if (oneData.get(i) != null && oneData.get(i).equals("是")) { vo.getUserTagStr().add(headData.get(i).substring(0, headData.get(i).indexOf("("))); } } // 将重复的数据进行MD5加密实现去重 String distinct = vo.getName() + vo.getCardNo() + vo.getRoad() + vo.getDoorNo() + vo.getFloor() + vo.getUnitNo() + vo.getHouseNo(); try { String distinctPass = PayUtil.MD5(distinct); if (StringUtils.isNotEmpty(distinctPass)) { vo.setDistinctPass(distinctPass); } } catch (Exception e) { log.error("组装MD5加密字段失败,数据表格行数:" + index); continue; } voList.add(vo); index++; } // 客户需要暂时注释,等客户处理完成需要恢复 // 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)); // } // 根据list中的IdCard城市来去重 List<ComMngPopulationPensionExcelVO> newVoList = voList.stream().filter(ListUtils.distinctByKey(ComMngPopulationPensionExcelVO::getDistinctPass)) .collect(Collectors.toList()); log.info("开始进入业务层处理逻辑"); R r = communityService.listSavePopulationPensionExcelVO(newVoList, communityId, userId); log.info("业务层处理逻辑完成"); if (!R.isOk(r)) { log.info("业务层处理成功"); List<ComMngPopulationPensionMistakeExcelVO> list = JSONArray.parseArray(JSONArray.toJSONString(r.getData()), ComMngPopulationPensionMistakeExcelVO.class); // String errMsg = r.getMsg(); // List<ComMngPopulationImportErrorVO> errorList = // JSON.parseArray(errMsg,ComMngPopulationImportErrorVO.class); // if(!errorList.isEmpty()){ // populationImportErrorVOList.addAll(errorList); // } mistakes.addAll(list); log.info("将错误数据存入redis中"); valueOperations.set(key, JSONArray.toJSONString(mistakes), 1, TimeUnit.HOURS); log.info("将错误数据存入redis中成功"); throw new ServiceException("500", key); } else { log.info("业务层处理逻辑失败"); if (!mistakes.isEmpty()) { log.info("业务层处理逻辑失败,将错误数据缓存到redis中"); valueOperations.set(key, JSONArray.toJSONString(mistakes), 1, TimeUnit.HOURS); log.info("业务层处理逻辑失败,将错误数据缓存到redis中成功"); throw new ServiceException("500", key); } } } catch (NumberFormatException e) { log.info("处理数据时失败"); e.printStackTrace(); // List<ComMngPopulationImportErrorVO> populationImportErrorVOList = new ArrayList<>(); // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); // importErrorVO.setErrorPosition("第" + index + "行"); // importErrorVO.setErrorMsg("数据格式有误,请检查文档内数据"); // populationImportErrorVOList.add(importErrorVO); log.error("数据格式有误,第" + index + "行"); throw new ServiceException("500", "导入失败111"); } } private void setPensionMistake(Map<Integer, String> map, ComMngPopulationPensionMistakeExcelVO vo) { vo.setName(map.get(0)); vo.setCardNo(map.get(1)); vo.setNation(map.get(2)); vo.setPoliticalOutlook(map.get(3)); vo.setIsRent(map.get(4)); vo.setRoad(map.get(5)); vo.setDoorNo(map.get(6)); vo.setFloor(map.get(7)); vo.setUnitNo(map.get(8)); vo.setHouseNo(map.get(9)); vo.setHouseStatus(map.get(10)); vo.setHousePurpose(map.get(11)); vo.setControlStatus(map.get(12)); vo.setPhone(map.get(13)); vo.setNativePlace(map.get(14)); vo.setCultureLevel(map.get(15)); vo.setMarriage(map.get(16)); vo.setHealthy(map.get(17)); vo.setOutOrLocal(map.get(18)); vo.setCensusRegister(map.get(19)); vo.setIsRegister(map.get(20)); vo.setIsAlive(map.get(21)); vo.setReceiveAllowanceBegin(map.get(22)); vo.setNowAddress(map.get(23)); vo.setRemark(map.get(24)); } } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/listen/ComMngPopulationRehabilitationExcelListen.java
@@ -357,13 +357,13 @@ vo.setOriginalTerm(oneData.get(22).trim()); } if (StringUtils.isNotEmpty(oneData.get(23))) { vo.setSentenceBegin(DateUtil.parse(oneData.get(23).trim())); vo.setSentenceBegin(DateUtil.parse(oneData.get(23).trim(), parsePatterns)); } if (StringUtils.isNotEmpty(oneData.get(24))) { vo.setOriginalCharge(oneData.get(24).trim()); } if (StringUtils.isNotEmpty(oneData.get(25))) { vo.setSentenceEnd(DateUtil.parse(oneData.get(25).trim())); vo.setSentenceEnd(DateUtil.parse(oneData.get(25).trim(), parsePatterns)); } if (StringUtils.isNotEmpty(oneData.get(26))) { vo.setSentencePlace(oneData.get(26).trim()); @@ -372,7 +372,7 @@ vo.setRiskAssessment(oneData.get(27).trim()); } if (StringUtils.isNotEmpty(oneData.get(28))) { vo.setJoinDate(DateUtil.parse(oneData.get(28).trim())); vo.setJoinDate(DateUtil.parse(oneData.get(28).trim(), parsePatterns)); } if (StringUtils.isNotEmpty(oneData.get(29))) { vo.setJoinSituation(oneData.get(29).trim()); @@ -399,14 +399,14 @@ vo.setPlaceSituation(oneData.get(32).trim()); } if (StringUtils.isNotEmpty(oneData.get(33))) { vo.setPlaceDate(DateUtil.parse(oneData.get(33).trim())); vo.setPlaceDate(DateUtil.parse(oneData.get(33).trim(), parsePatterns)); } if (StringUtils.isNotEmpty(oneData.get(34))) { vo.setNotPlaceReason(oneData.get(34).trim()); } if (StringUtils.isNotEmpty(oneData.get(35))) { try { vo.setHelpBegin(DateUtil.parse(oneData.get(35).trim())); vo.setHelpBegin(DateUtil.parse(oneData.get(35).trim(), parsePatterns)); } catch (DateException e) { log.info("处理数据时失败"); e.printStackTrace(); @@ -421,7 +421,7 @@ } if (StringUtils.isNotEmpty(oneData.get(36))) { try { vo.setHelpEnd(DateUtil.parse(oneData.get(36).trim())); vo.setHelpEnd(DateUtil.parse(oneData.get(36).trim(), parsePatterns)); } catch (DateException e) { log.info("处理数据时失败"); e.printStackTrace(); springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/dtos/community/PageElderAuthRecordsDTO.java
New file @@ -0,0 +1,52 @@ package com.panzhihua.common.model.dtos.community; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** * title: PageElderAuthRecordsDTO 高龄老人认证记录分页查询参数 * projectName 成都呐喊信息技术有限公司-智慧社区项目 * description: 高龄老人认证记录分页查询参数 * * @author txb * @date 2021/9/02 11:12 */ @Data @ApiModel("高龄老人认证记录分页查询参数") public class PageElderAuthRecordsDTO { @ApiModelProperty(value = "分页-当前页数,默认1", example = "1") private Long pageNum; @ApiModelProperty(value = "分页-每页记录数,默认10", example = "10") private Long pageSize; @ApiModelProperty(value = "查询关键词") private String searchKey; @ApiModelProperty(value = "认证期数") private String authPeriod; @ApiModelProperty(value = "认证开始时间") private String authDateBegin; @ApiModelProperty(value = "认证结束时间") private String authDateEnd; @ApiModelProperty(value = "认证状态(1.已认证 0.未认证)") private String authStatus; @ApiModelProperty(value = "审核状态(1.待审核 2.驳回 3.通过)") private Integer approvalStatus; @ApiModelProperty(value = "人员类别(1.80-89周岁 2.90-99周岁 3.100周岁(含)以上)") private Integer personnelCategory; @ApiModelProperty(value = "是否健在(1.是 0.否)") private Integer isAlive; @ApiModelProperty(value = "社区ID", hidden = true) private Long communityId; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComElderAuthElderliesVO.java
New file @@ -0,0 +1,82 @@ package com.panzhihua.common.model.vos.community; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; import java.util.Date; /** * title: ComElderAuthElderliesVO 社区政务》高龄老人认证》高龄老人表实体类 * projectName 成都呐喊信息技术有限公司-智慧社区项目 * description: 社区政务》高龄老人认证》高龄老人表实体类 * * @author txb * @date 2021/9/01 14:12 */ @Data @ApiModel("高龄认证记录") public class ComElderAuthElderliesVO { @ApiModelProperty(value = "主键id") private Long id; @ApiModelProperty(value = "人口id") private Long populationId; @ApiModelProperty(value = "街道id") private Long streetId; @ApiModelProperty(value = "社区id") private Long communityId; @ApiModelProperty(value = "联系电话") private String phone; @ApiModelProperty(value = "姓名") private String name; @ApiModelProperty(value = "身份证号") private String idCard; @ApiModelProperty(value = "性别") private Integer sex; @ApiModelProperty(value = "年龄") private Integer age; @ApiModelProperty(value = "出生日期") private String birthday; @ApiModelProperty(value = "人员类别(1.80-89周岁 2.90-99周岁 3.100周岁(含)以上)") private Integer personnelCategory; @ApiModelProperty(value = "是否高龄老人登记(1.是 0.否)") private Integer isRegister; @ApiModelProperty(value = "是否健在(1.是 0.否)") private Integer isAlive; @ApiModelProperty(value = "居住地址") private String address; @ApiModelProperty(value = "备注") private String remark; @ApiModelProperty(value = "高龄津贴开始领取日期") private Date receiveAllowanceBegin; @ApiModelProperty(value = "创建时间") private Date createAt; @ApiModelProperty(value = "创建用户") private Long createBy; @ApiModelProperty(value = "更新时间") private Date updateAt; @ApiModelProperty(value = "修改用户") private Long updateBy; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComElderAuthRecordExcleVO.java
New file @@ -0,0 +1,68 @@ package com.panzhihua.common.model.vos.community; import com.alibaba.excel.annotation.ExcelProperty; import com.fasterxml.jackson.databind.annotation.JsonSerialize; import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.util.Date; /** * @title: ComElderAuthRecordVO * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 * @description: 高龄认证记录 * @author: hans * @date: 2021/09/01 16:16 */ @Data @ApiModel("高龄认证记录") @EncryptDecryptClass public class ComElderAuthRecordExcleVO { @ExcelProperty(value = "提交用户", index = 0) private String submitUserName; @ExcelProperty(value = "联系电话", index = 1) private String phone; @ExcelProperty(value = "认证姓名", index = 2) private String name; @ExcelProperty(value = "身份证号", index = 3) @EncryptDecryptField private String idCard; @ExcelProperty(value = "性别", index = 4) private String sex; @ExcelProperty(value = "年龄", index = 5) private String age; @ExcelProperty(value = "出生日期", index = 6) private String birthday; @ExcelProperty(value = "人员类别", index = 7) private String personnelCategory; @ExcelProperty(value = "现居住地址", index = 8) private String address; @ExcelProperty(value = "健在", index = 9) private String isAlive; @ExcelProperty(value = "认证期数", index = 10) private String authPeriod; @ExcelProperty(value = "认证时间", index = 11) private String authDate; @ExcelProperty(value = "标记", index = 12) private String mark; @ExcelProperty(value = "审核状态", index = 13) private String approvalStatus; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComElderAuthRecordImportExcelVO.java
New file @@ -0,0 +1,59 @@ package com.panzhihua.common.model.vos.community; import com.alibaba.excel.annotation.ExcelProperty; import com.google.common.collect.Lists; import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; import lombok.Data; import java.io.Serializable; import java.util.Date; import java.util.List; /** * @description: 批量导入吸毒人员 * @author: txb */ @Data @EncryptDecryptClass public class ComElderAuthRecordImportExcelVO implements Serializable { @ExcelProperty(value = "认证姓名", index = 0) private String name; @ExcelProperty(value = "认证身份证号码", index = 1) @EncryptDecryptField private String IdCard; @ExcelProperty(value = "联系电话", index = 2) private String phone; @ExcelProperty(value = "现居住地址", index = 3) private String nowAddress; @ExcelProperty(value = "认证时间", index = 4) private Date authDate; @ExcelProperty(value = "健在(是/否)", index = 5) private Integer isAlive; /** * 年龄 */ private Integer age; /** * 性别(1.男 2.女) */ private Integer sex; /** * 出生年月日 */ private String birthday; /** * 地址 */ private String address; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComElderAuthRecordImportMistakeExcelVO.java
New file @@ -0,0 +1,40 @@ package com.panzhihua.common.model.vos.community; import com.alibaba.excel.annotation.ExcelProperty; import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; import lombok.Data; import java.io.Serializable; import java.util.Date; /** * @description: 批量导入吸毒人员 * @author: txb */ @Data @EncryptDecryptClass public class ComElderAuthRecordImportMistakeExcelVO implements Serializable { @ExcelProperty(value = "认证姓名", index = 0) private String name; @ExcelProperty(value = "认证身份证号码", index = 1) @EncryptDecryptField private String IdCard; @ExcelProperty(value = "联系电话", index = 2) private String phone; @ExcelProperty(value = "现居住地址", index = 3) private String nowAddress; @ExcelProperty(value = "认证时间", index = 4) private String authDate; @ExcelProperty(value = "健在(是/否)", index = 5) private String isAlive; @ExcelProperty(value = "错误信息", index = 6) private String mistake; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComElderAuthRecordVO.java
@@ -4,6 +4,7 @@ import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -29,14 +30,51 @@ @ApiModelProperty(value = "认证期数") private String authPeriod; @ApiModelProperty(value = "提交用户") @ApiModelProperty(value = "提交用户id") private Long submitUserId; @ApiModelProperty(value = "提交用户姓名") private String submitUserName; @ApiModelProperty(value = "联系电话") private String phone; @ApiModelProperty(value = "姓名") private String name; @ApiModelProperty(value = "身份证号") @EncryptDecryptField private String idCard; @ApiModelProperty(value = "性别(1.男 2.女 3.其他)") private String sex; @ApiModelProperty(value = "年龄") private Integer age; @ApiModelProperty(value = "出生日期") private String birthday; @ApiModelProperty(value = "人员类别(1.80-89周岁 2.90-99周岁 3.100周岁(含)以上)") private Integer personnelCategory; @ApiModelProperty(value = "是否高龄老人登记(1.是 0.否)") private Integer isRegister; @ApiModelProperty(value = "是否健在(1.是 0.否)") private Integer isAlive; @ApiModelProperty(value = "居住地址") private String address; @ApiModelProperty(value = "认证视频url") private String authVideo; @ApiModelProperty(value = "审核人员") private String approver; @ApiModelProperty(value = "审核人员id") private Long approver; @ApiModelProperty(value = "审核人员姓名") private String approverName; @ApiModelProperty(value = "审核状态(1.待审核 2.驳回 3.通过)") private Integer approvalStatus; @@ -51,7 +89,7 @@ private String rejectReason; @ApiModelProperty(value = "认证状态") private Boolean authStatus; private Integer authStatus; @ApiModelProperty(value = "认证时间") private Date authDate; springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComMngPopulationElderExcelVO.java
New file @@ -0,0 +1,132 @@ package com.panzhihua.common.model.vos.community; import com.alibaba.excel.annotation.ExcelProperty; import com.google.common.collect.Lists; import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; import lombok.Data; import java.io.Serializable; import java.util.Date; import java.util.List; /** * title: ComMngPopulationElderExcelVO 批量导入高龄老人 * projectName 成都呐喊信息技术有限公司-智慧社区项目 * description: 批量导入高龄老人 * * @author txb * @date 2021/9/01 13:12 */ @Data @EncryptDecryptClass public class ComMngPopulationElderExcelVO { @ExcelProperty(value = "姓名", index = 0) private String name; @ExcelProperty(value = "身份证号码", index = 1) @EncryptDecryptField private String cardNo; @ExcelProperty(value = "民族", index = 2) private String nation; @ExcelProperty(value = "政治面貌", index = 3) private Integer politicalOutlook; @ExcelProperty(value = "是否租住", index = 4) private Integer isRent; @ExcelProperty(value = "街/路/巷", index = 5) private String road; @ExcelProperty(value = "小区号", index = 6) private String doorNo; @ExcelProperty(value = "楼排号", index = 7) private String floor; @ExcelProperty(value = "单元号", index = 8) private String unitNo; @ExcelProperty(value = "户室(房间号)", index = 9) private String houseNo; @ExcelProperty(value = "房屋状态(1.自住 2.租住 3.其他)", index = 10) private Integer houseStatus; @ExcelProperty(value = "房屋用途(1.住宅 2.公寓 3.宿舍 4.仓库 5.其他)", index = 11) private Integer housePurpose; @ExcelProperty(value = "管控状态(1.常规 2.关注 3.管控)", index = 12) private Integer controlStatus; @ExcelProperty(value = "联系方式", index = 13) private String phone; @ExcelProperty(value = "籍贯", index = 14) private String nativePlace; @ExcelProperty(value = "文化程度(1.小学 2.初中 3.高中 4.中专 5.大专 6.本科 7.硕士 8.博士 9.其他)", index = 15) private Integer cultureLevel; @ExcelProperty(value = "婚姻状况(1.未婚 2.已婚 3.离异 4.丧偶 5.分居 6.其他)", index = 16) private Integer marriage; @ExcelProperty(value = "健康状况", index = 17) private String healthy; @ExcelProperty(value = "外地/本地(1.本地 2.外地)", index = 18) private Integer outOrLocal; @ExcelProperty(value = "户口所在地", index = 19) private String censusRegister; @ExcelProperty(value = "高龄老人登记(是/否)", index = 20) private Integer isRegister; @ExcelProperty(value = "健在(是/否)", index = 21) private Integer isAlive; @ExcelProperty(value = "*高龄津贴开始领取时间(年-月-日)", index = 22) private Date receiveAllowanceBegin; @ExcelProperty(value = "*现居住地址", index = 23) private String nowAddress; @ExcelProperty(value = "备注", index = 24) private String remark; /** * 去重字段,使用(姓名+身份证号+街路巷+小区号+楼牌号+单元号+户室)组合字段进行MD5加密实现去重 */ private String distinctPass; /** * 年龄 */ private Integer age; /** * 性别(1.男 2.女) */ private Integer sex; /** * 出生年月日 */ private String birthday; /** * 扩展字段用逗号隔开 */ private List<String> userTagStr = Lists.newArrayList(); private Long houseId; /** * 地址 */ private String address; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComMngPopulationElderMistakeExcelVO.java
New file @@ -0,0 +1,101 @@ package com.panzhihua.common.model.vos.community; import com.alibaba.excel.annotation.ExcelProperty; import com.google.common.collect.Lists; import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; import lombok.Data; import java.io.Serializable; import java.util.List; /** * title: ComMngPopulationElderExcelVO 批量导入高龄老人 * projectName 成都呐喊信息技术有限公司-智慧社区项目 * description: 批量导入高龄老人 * * @author txb * @String 2021/9/01 13:12 */ @Data public class ComMngPopulationElderMistakeExcelVO implements Serializable { @ExcelProperty(value = "姓名", index = 0) private String name; @ExcelProperty(value = "身份证号码", index = 1) @EncryptDecryptField private String cardNo; @ExcelProperty(value = "民族", index = 2) private String nation; @ExcelProperty(value = "政治面貌", index = 3) private String politicalOutlook; @ExcelProperty(value = "是否租住", index = 4) private String isRent; @ExcelProperty(value = "街/路/巷", index = 5) private String road; @ExcelProperty(value = "小区号", index = 6) private String doorNo; @ExcelProperty(value = "楼排号", index = 7) private String floor; @ExcelProperty(value = "单元号", index = 8) private String unitNo; @ExcelProperty(value = "户室(房间号)", index = 9) private String houseNo; @ExcelProperty(value = "房屋状态(1.自住 2.租住 3.其他)", index = 10) private String houseStatus; @ExcelProperty(value = "房屋用途(1.住宅 2.公寓 3.宿舍 4.仓库 5.其他)", index = 11) private String housePurpose; @ExcelProperty(value = "管控状态(1.常规 2.关注 3.管控)", index = 12) private String controlStatus; @ExcelProperty(value = "联系方式", index = 13) private String phone; @ExcelProperty(value = "籍贯", index = 14) private String nativePlace; @ExcelProperty(value = "文化程度(1.小学 2.初中 3.高中 4.中专 5.大专 6.本科 7.硕士 8.博士 9.其他)", index = 15) private String cultureLevel; @ExcelProperty(value = "婚姻状况(1.未婚 2.已婚 3.离异 4.丧偶 5.分居 6.其他)", index = 16) private String marriage; @ExcelProperty(value = "健康状况", index = 17) private String healthy; @ExcelProperty(value = "外地/本地(1.本地 2.外地)", index = 18) private String outOrLocal; @ExcelProperty(value = "户口所在地", index = 19) private String censusRegister; @ExcelProperty(value = "高龄老人登记(是/否)", index = 20) private String isRegister; @ExcelProperty(value = "健在(是/否)", index = 21) private String isAlive; @ExcelProperty(value = "*高龄津贴开始领取时间(年-月-日)", index = 22) private String receiveAllowanceBegin; @ExcelProperty(value = "*现居住地址", index = 23) private String nowAddress; @ExcelProperty(value = "备注", index = 24) private String remark; @ExcelProperty(value = "错误信息", index = 25) private String mistake; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComMngPopulationPensionExcelVO.java
New file @@ -0,0 +1,132 @@ package com.panzhihua.common.model.vos.community; import com.alibaba.excel.annotation.ExcelProperty; import com.google.common.collect.Lists; import com.panzhihua.common.model.helper.encrypt.EncryptDecryptClass; import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; import lombok.Data; import java.io.Serializable; import java.util.Date; import java.util.List; /** * title: ComMngPopulationPensionExcelVO 批量导入养老金人员 * projectName 成都呐喊信息技术有限公司-智慧社区项目 * description: 批量导入养老金人员 * * @author txb * @date 2021/9/01 13:12 */ @Data @EncryptDecryptClass public class ComMngPopulationPensionExcelVO implements Serializable { @ExcelProperty(value = "姓名", index = 0) private String name; @ExcelProperty(value = "身份证号码", index = 1) @EncryptDecryptField private String cardNo; @ExcelProperty(value = "民族", index = 2) private String nation; @ExcelProperty(value = "政治面貌", index = 3) private Integer politicalOutlook; @ExcelProperty(value = "是否租住", index = 4) private Integer isRent; @ExcelProperty(value = "街/路/巷", index = 5) private String road; @ExcelProperty(value = "小区号", index = 6) private String doorNo; @ExcelProperty(value = "楼排号", index = 7) private String floor; @ExcelProperty(value = "单元号", index = 8) private String unitNo; @ExcelProperty(value = "户室(房间号)", index = 9) private String houseNo; @ExcelProperty(value = "房屋状态(1.自住 2.租住 3.其他)", index = 10) private Integer houseStatus; @ExcelProperty(value = "房屋用途(1.住宅 2.公寓 3.宿舍 4.仓库 5.其他)", index = 11) private Integer housePurpose; @ExcelProperty(value = "管控状态(1.常规 2.关注 3.管控)", index = 12) private Integer controlStatus; @ExcelProperty(value = "联系方式", index = 13) private String phone; @ExcelProperty(value = "籍贯", index = 14) private String nativePlace; @ExcelProperty(value = "文化程度(1.小学 2.初中 3.高中 4.中专 5.大专 6.本科 7.硕士 8.博士 9.其他)", index = 15) private Integer cultureLevel; @ExcelProperty(value = "婚姻状况(1.未婚 2.已婚 3.离异 4.丧偶 5.分居 6.其他)", index = 16) private Integer marriage; @ExcelProperty(value = "健康状况", index = 17) private String healthy; @ExcelProperty(value = "外地/本地(1.本地 2.外地)", index = 18) private Integer outOrLocal; @ExcelProperty(value = "户口所在地", index = 19) private String censusRegister; @ExcelProperty(value = "养老登记(是/否)", index = 20) private Integer isRegister; @ExcelProperty(value = "健在(是/否)", index = 21) private Integer isAlive; @ExcelProperty(value = "*养老金开始领取时间(年-月-日)", index = 22) private Date receiveAllowanceBegin; @ExcelProperty(value = "*现居住地址", index = 23) private String nowAddress; @ExcelProperty(value = "备注", index = 24) private String remark; /** * 去重字段,使用(姓名+身份证号+街路巷+小区号+楼牌号+单元号+户室)组合字段进行MD5加密实现去重 */ private String distinctPass; /** * 年龄 */ private Integer age; /** * 性别(1.男 2.女) */ private Integer sex; /** * 出生年月日 */ private String birthday; /** * 扩展字段用逗号隔开 */ private List<String> userTagStr = Lists.newArrayList(); private Long houseId; /** * 地址 */ private String address; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComMngPopulationPensionMistakeExcelVO.java
New file @@ -0,0 +1,99 @@ package com.panzhihua.common.model.vos.community; import com.alibaba.excel.annotation.ExcelProperty; import com.panzhihua.common.model.helper.encrypt.EncryptDecryptField; import lombok.Data; import java.io.Serializable; /** * title: ComMngPopulationPensionMistakeExcelVO 批量导入养老金人员 * projectName 成都呐喊信息技术有限公司-智慧社区项目 * description: 批量导入养老金人员 * * @author txb * @String 2021/9/01 13:12 */ @Data public class ComMngPopulationPensionMistakeExcelVO implements Serializable { @ExcelProperty(value = "姓名", index = 0) private String name; @ExcelProperty(value = "身份证号码", index = 1) @EncryptDecryptField private String cardNo; @ExcelProperty(value = "民族", index = 2) private String nation; @ExcelProperty(value = "政治面貌", index = 3) private String politicalOutlook; @ExcelProperty(value = "是否租住", index = 4) private String isRent; @ExcelProperty(value = "街/路/巷", index = 5) private String road; @ExcelProperty(value = "小区号", index = 6) private String doorNo; @ExcelProperty(value = "楼排号", index = 7) private String floor; @ExcelProperty(value = "单元号", index = 8) private String unitNo; @ExcelProperty(value = "户室(房间号)", index = 9) private String houseNo; @ExcelProperty(value = "房屋状态(1.自住 2.租住 3.其他)", index = 10) private String houseStatus; @ExcelProperty(value = "房屋用途(1.住宅 2.公寓 3.宿舍 4.仓库 5.其他)", index = 11) private String housePurpose; @ExcelProperty(value = "管控状态(1.常规 2.关注 3.管控)", index = 12) private String controlStatus; @ExcelProperty(value = "联系方式", index = 13) private String phone; @ExcelProperty(value = "籍贯", index = 14) private String nativePlace; @ExcelProperty(value = "文化程度(1.小学 2.初中 3.高中 4.中专 5.大专 6.本科 7.硕士 8.博士 9.其他)", index = 15) private String cultureLevel; @ExcelProperty(value = "婚姻状况(1.未婚 2.已婚 3.离异 4.丧偶 5.分居 6.其他)", index = 16) private String marriage; @ExcelProperty(value = "健康状况", index = 17) private String healthy; @ExcelProperty(value = "外地/本地(1.本地 2.外地)", index = 18) private String outOrLocal; @ExcelProperty(value = "户口所在地", index = 19) private String censusRegister; @ExcelProperty(value = "高龄老人登记(是/否)", index = 20) private String isRegister; @ExcelProperty(value = "健在(是/否)", index = 21) private String isAlive; @ExcelProperty(value = "*高龄津贴开始领取时间(年-月-日)", index = 22) private String receiveAllowanceBegin; @ExcelProperty(value = "*现居住地址", index = 23) private String nowAddress; @ExcelProperty(value = "备注", index = 24) private String remark; @ExcelProperty(value = "错误信息", index = 25) private String mistake; } springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComMngPopulationVO.java
@@ -222,6 +222,12 @@ @ApiModelProperty("低保户信息") private List<ComLowSecurityPopulationVO> comLowSecurityPopulationVOs; @ApiModelProperty("高龄老人信息") private List<ComElderAuthElderliesVO> comElderAuthElderliesVOList; @ApiModelProperty("养老人员信息") private List<ComPensionAuthPensionerVO> comPensionAuthPensionerVOList; public interface sex { int nan = 1; int nv = 2; springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/community/ComPensionAuthPensionerVO.java
New file @@ -0,0 +1,80 @@ package com.panzhihua.common.model.vos.community; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; import java.util.Date; /** * @title: ComPensionAuthPensionerVO 养老金人员表实体类 * @projectName: 成都呐喊信息技术有限公司-智慧社区项目 * @description: 养老金人员表实体类 * @author: hans * @date: 2021/09/01 16:30 */ @Data @ApiModel("养老认证记录") public class ComPensionAuthPensionerVO { @ApiModelProperty(value = "主键id") private Long id; @ApiModelProperty(value = "人口id") private Long populationId; @ApiModelProperty(value = "街道id") private Long streetId; @ApiModelProperty(value = "社区id") private Long communityId; @ApiModelProperty(value = "联系电话") private String phone; @ApiModelProperty(value = "姓名") private String name; @ApiModelProperty(value = "身份证号") private String idCard; @ApiModelProperty(value = "性别") private Integer sex; @ApiModelProperty(value = "年龄") private Integer age; @ApiModelProperty(value = "出生日期") private String birthday; @ApiModelProperty(value = "人员类别(1.80-89周岁 2.90-99周岁 3.100周岁(含)以上)") private Integer personnelCategory; @ApiModelProperty(value = "是否养老登记(1.是 0.否)") private Integer isRegister; @ApiModelProperty(value = "是否健在(1.是 0.否)") private Integer isAlive; @ApiModelProperty(value = "居住地址") private String address; @ApiModelProperty(value = "备注") private String remark; @ApiModelProperty(value = "养老金开始领取日期") private Date receiveAllowanceBegin; @ApiModelProperty(value = "创建时间") private Date createAt; @ApiModelProperty(value = "创建用户") private Long createBy; @ApiModelProperty(value = "更新时间") private Date updateAt; @ApiModelProperty(value = "修改用户") private Long updateBy; } springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommonDataApi.java
@@ -626,39 +626,6 @@ } } @ApiOperation(value = "特殊群体/分页查询标签列表", response = ComMngTagVO.class) @PostMapping("/special/tags/page") public R specialInputUserTags(@RequestBody PageInputUserDTO comMngUserTagDTO) { Long communityId = this.getCommunityId(); comMngUserTagDTO.setCommunityId(communityId); return userService.specialInputUserTags(comMngUserTagDTO); } /** * 新增或修改特殊群体标签 * * @param comMngTagVO * @return */ @ApiOperation(value = "特殊群体/新增或修改标签") @PostMapping("/special/tags/save") R saveSpecialInputUserTags(@RequestBody ComMngTagVO comMngTagVO) { Long communityId = this.getLoginUserInfo().getCommunityId(); comMngTagVO.setCommunityId(communityId); return userService.saveSpecialInputUserTags(comMngTagVO); } /** * 删除特殊群体标签 * * @param id * @return */ @ApiOperation(value = "特殊群体/删除标签") @DeleteMapping("/special/tags/delete") R deleteSpecialInputUserTags(@RequestParam(value = "id") Long id) { return userService.deleteSpecialInputUserTags(id); } @ApiOperation(value = "分页查询单位管理列表", response = ComMngRealCompanyVO.class) @PostMapping("/company/page") springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/PopulationApi.java
@@ -308,6 +308,48 @@ return R.ok(); } @ApiOperation(value = "excel导入高龄老人") @PostMapping(value = "/serve/importElder", consumes = "multipart/*", headers = "content-type=multipart/form-date") public R importElder(@RequestParam MultipartFile file, HttpServletRequest request) { // 获取文件名 String fileName = file.getOriginalFilename(); log.info("传入文件名字【{}】", fileName); InputStream inputStream = null; try { inputStream = file.getInputStream(); ComMngPopulationElderExcelListen comMngPopulationElderExcelListen = new ComMngPopulationElderExcelListen(communityService, this.getCommunityId(), this.getLoginUserInfo().getUserId(), stringRedisTemplate); EasyExcel.read(inputStream, null, comMngPopulationElderExcelListen).sheet().doRead(); } catch (IOException e) { log.error("导入模板失败【{}】", e.getMessage()); e.printStackTrace(); } return R.ok(); } @ApiOperation(value = "excel导入养老金人员") @PostMapping(value = "/serve/importPension", consumes = "multipart/*", headers = "content-type=multipart/form-date") public R importPension(@RequestParam MultipartFile file, HttpServletRequest request) { // 获取文件名 String fileName = file.getOriginalFilename(); log.info("传入文件名字【{}】", fileName); InputStream inputStream = null; try { inputStream = file.getInputStream(); ComMngPopulationPensionExcelListen comMngPopulationPensionExcelListen = new ComMngPopulationPensionExcelListen(communityService, this.getCommunityId(), this.getLoginUserInfo().getUserId(), stringRedisTemplate); EasyExcel.read(inputStream, null, comMngPopulationPensionExcelListen).sheet().doRead(); } catch (IOException e) { log.error("导入模板失败【{}】", e.getMessage()); e.printStackTrace(); } return R.ok(); } /** * 确认导入实有人口(有则更新,无则新建) * @@ -406,7 +448,7 @@ data = formDataFilling(); // 查询当前社区标签列表 R tagsResult = userService.listTags(communityId); R tagsResult = userService.listTags(); if (Constants.SUCCESS.equals(tagsResult.getCode())) { List<String> TagsList = (List<String>)tagsResult.getData(); // 动态加载标签列表到表头 @@ -466,7 +508,7 @@ list = headDrugDataFilling(); // 查询当前社区标签列表 R tagsResult = userService.listTags(communityId); R tagsResult = userService.listTags(); if (Constants.SUCCESS.equals(tagsResult.getCode())) { List<String> TagsList = (List<String>)tagsResult.getData(); // 动态加载标签列表到表头 @@ -526,7 +568,7 @@ list = headCorrectDataFilling(); // 查询当前社区标签列表 R tagsResult = userService.listTags(communityId); R tagsResult = userService.listTags(); if (Constants.SUCCESS.equals(tagsResult.getCode())) { List<String> TagsList = (List<String>)tagsResult.getData(); // 动态加载标签列表到表头 @@ -586,7 +628,7 @@ list = headMajorDataFilling(); // 查询当前社区标签列表 R tagsResult = userService.listTags(communityId); R tagsResult = userService.listTags(); if (Constants.SUCCESS.equals(tagsResult.getCode())) { List<String> TagsList = (List<String>)tagsResult.getData(); // 动态加载标签列表到表头 @@ -646,7 +688,7 @@ list = headCultDataFilling(); // 查询当前社区标签列表 R tagsResult = userService.listTags(communityId); R tagsResult = userService.listTags(); if (Constants.SUCCESS.equals(tagsResult.getCode())) { List<String> TagsList = (List<String>)tagsResult.getData(); // 动态加载标签列表到表头 @@ -706,7 +748,7 @@ list = headRehabilitationDataFilling(); // 查询当前社区标签列表 R tagsResult = userService.listTags(communityId); R tagsResult = userService.listTags(); if (Constants.SUCCESS.equals(tagsResult.getCode())) { List<String> TagsList = (List<String>)tagsResult.getData(); // 动态加载标签列表到表头 @@ -766,7 +808,7 @@ list = headKeyDataFilling(); // 查询当前社区标签列表 R tagsResult = userService.listTags(communityId); R tagsResult = userService.listTags(); if (Constants.SUCCESS.equals(tagsResult.getCode())) { List<String> TagsList = (List<String>)tagsResult.getData(); // 动态加载标签列表到表头 @@ -826,7 +868,7 @@ list = headSentenceDataFilling(); // 查询当前社区标签列表 R tagsResult = userService.listTags(communityId); R tagsResult = userService.listTags(); if (Constants.SUCCESS.equals(tagsResult.getCode())) { List<String> TagsList = (List<String>)tagsResult.getData(); // 动态加载标签列表到表头 @@ -886,7 +928,7 @@ list = headVeteransDataFilling(); // 查询当前社区标签列表 R tagsResult = userService.listTags(communityId); R tagsResult = userService.listTags(); if (Constants.SUCCESS.equals(tagsResult.getCode())) { List<String> TagsList = (List<String>)tagsResult.getData(); // 动态加载标签列表到表头 @@ -946,7 +988,7 @@ list = headDisabilityDataFilling(); // 查询当前社区标签列表 R tagsResult = userService.listTags(communityId); R tagsResult = userService.listTags(); if (Constants.SUCCESS.equals(tagsResult.getCode())) { List<String> TagsList = (List<String>)tagsResult.getData(); // 动态加载标签列表到表头 @@ -1006,7 +1048,7 @@ list = headLowSecurityDataFilling(); // 查询当前社区标签列表 R tagsResult = userService.listTags(communityId); R tagsResult = userService.listTags(); if (Constants.SUCCESS.equals(tagsResult.getCode())) { List<String> TagsList = (List<String>)tagsResult.getData(); // 动态加载标签列表到表头 @@ -1035,6 +1077,126 @@ } } return R.ok(excelUrl + "低保户导入模板.xlsx"); } catch (Exception e) { e.printStackTrace(); log.error("文件传输失败【{}】", e.getMessage()); return R.fail(); } } @ApiOperation(value = "高龄老人-下载模板") @GetMapping("/export/elder") public R exportElder() { // 获取登陆用户绑定社区id Long communityId = 2L;// this.getCommunityId(); // 生成动态模板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 { List<List<String>> list = new ArrayList<>(); List<List<Object>> dataList = new ArrayList<>(); list = headElderDataFilling(); // 查询当前社区标签列表 R tagsResult = userService.listTags(); if (Constants.SUCCESS.equals(tagsResult.getCode())) { List<String> TagsList = (List<String>)tagsResult.getData(); // 动态加载标签列表到表头 for (int i = 0; i < TagsList.size(); i++) { if (!"高龄老人".equals(TagsList.get(i))) { List<String> head = new ArrayList<>(); head.add(TagsList.get(i) + "(是/否)"); list.add(head); } } } EasyExcel.write(fileName).head(list).sheet("高龄老人导入模板").doWrite(dataList); 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(); } } } return R.ok(excelUrl + name); } catch (Exception e) { e.printStackTrace(); log.error("文件传输失败【{}】", e.getMessage()); return R.fail(); } } @ApiOperation(value = "养老金居民-下载模板") @GetMapping("/export/pension") public R exportPension() { // 获取登陆用户绑定社区id Long communityId = 2L;// this.getCommunityId(); // 生成动态模板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 { List<List<String>> list = new ArrayList<>(); List<List<Object>> dataList = new ArrayList<>(); list = headPensionDataFilling(); // 查询当前社区标签列表 R tagsResult = userService.listTags(); if (Constants.SUCCESS.equals(tagsResult.getCode())) { List<String> TagsList = (List<String>)tagsResult.getData(); // 动态加载标签列表到表头 for (int i = 0; i < TagsList.size(); i++) { if (!"养老金居民".equals(TagsList.get(i))) { List<String> head = new ArrayList<>(); head.add(TagsList.get(i) + "(是/否)"); list.add(head); } } } EasyExcel.write(fileName).head(list).sheet("养老金居民导入模板").doWrite(dataList); 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(); } } } return R.ok(excelUrl + name); } catch (Exception e) { e.printStackTrace(); log.error("文件传输失败【{}】", e.getMessage()); @@ -2255,6 +2417,170 @@ return list; } // 高龄老人 private List<List<String>> headElderDataFilling() { List<List<String>> list = new ArrayList<List<String>>(); List<String> head0 = new ArrayList<String>(); head0.add("姓名"); List<String> head1 = new ArrayList<String>(); head1.add("身份证(性别和年龄自动根据身份证号识别)"); List<String> head2 = new ArrayList<String>(); head2.add("民族"); List<String> head3 = new ArrayList<String>(); head3.add("政治面貌(群众/中共党员/共青团员)"); List<String> head4 = new ArrayList<String>(); head4.add("是否租住"); List<String> head5 = new ArrayList<String>(); head5.add("*街/路/巷"); List<String> head6 = new ArrayList<String>(); head6.add("*小区号(政府对于每个小区都有特定编号)"); List<String> head7 = new ArrayList<String>(); head7.add("楼排号"); List<String> head8 = new ArrayList<String>(); head8.add("单元号"); List<String> head9 = new ArrayList<String>(); head9.add("户室(四位数表示。前两位楼层,后两位户号)"); List<String> head10 = new ArrayList<String>(); head10.add("房屋状态(自住/租住/其他)"); List<String> head11 = new ArrayList<String>(); head11.add("房屋用途(住宅/公寓/宿舍/仓库/其他)"); List<String> head12 = new ArrayList<String>(); head12.add("控状态(常规/关注/管控)"); List<String> head13 = new ArrayList<String>(); head13.add("联系方式"); List<String> head14 = new ArrayList<String>(); head14.add("籍贯"); List<String> head15 = new ArrayList<String>(); head15.add("文化程度"); List<String> head16 = new ArrayList<String>(); head16.add("婚姻状况"); List<String> head17 = new ArrayList<String>(); head17.add("健康状况"); List<String> head18 = new ArrayList<String>(); head18.add("本地/外地"); List<String> head19 = new ArrayList<String>(); head19.add("户口所在地"); List<String> head20 = new ArrayList<String>(); head20.add("*高龄老人登记(是/否)"); List<String> head21 = new ArrayList<String>(); head21.add("*健在(是/否)"); List<String> head22 = new ArrayList<String>(); head22.add("*高龄津贴开始领取时间(年-月-日)"); List<String> head23 = new ArrayList<String>(); head23.add("*现居住地址"); List<String> head24 = new ArrayList<String>(); head24.add("备注"); list.add(head0); list.add(head1); list.add(head2); list.add(head3); list.add(head4); list.add(head5); list.add(head6); list.add(head7); list.add(head8); list.add(head9); list.add(head10); list.add(head11); list.add(head12); list.add(head13); list.add(head14); list.add(head15); list.add(head16); list.add(head17); list.add(head18); list.add(head19); list.add(head20); list.add(head21); list.add(head22); list.add(head23); list.add(head24); return list; } // 养老金居民 private List<List<String>> headPensionDataFilling() { List<List<String>> list = new ArrayList<List<String>>(); List<String> head0 = new ArrayList<String>(); head0.add("姓名"); List<String> head1 = new ArrayList<String>(); head1.add("身份证(性别和年龄自动根据身份证号识别)"); List<String> head2 = new ArrayList<String>(); head2.add("民族"); List<String> head3 = new ArrayList<String>(); head3.add("政治面貌(群众/中共党员/共青团员)"); List<String> head4 = new ArrayList<String>(); head4.add("是否租住"); List<String> head5 = new ArrayList<String>(); head5.add("*街/路/巷"); List<String> head6 = new ArrayList<String>(); head6.add("*小区号(政府对于每个小区都有特定编号)"); List<String> head7 = new ArrayList<String>(); head7.add("楼排号"); List<String> head8 = new ArrayList<String>(); head8.add("单元号"); List<String> head9 = new ArrayList<String>(); head9.add("户室(四位数表示。前两位楼层,后两位户号)"); List<String> head10 = new ArrayList<String>(); head10.add("房屋状态(自住/租住/其他)"); List<String> head11 = new ArrayList<String>(); head11.add("房屋用途(住宅/公寓/宿舍/仓库/其他)"); List<String> head12 = new ArrayList<String>(); head12.add("控状态(常规/关注/管控)"); List<String> head13 = new ArrayList<String>(); head13.add("联系方式"); List<String> head14 = new ArrayList<String>(); head14.add("籍贯"); List<String> head15 = new ArrayList<String>(); head15.add("文化程度"); List<String> head16 = new ArrayList<String>(); head16.add("婚姻状况"); List<String> head17 = new ArrayList<String>(); head17.add("健康状况"); List<String> head18 = new ArrayList<String>(); head18.add("本地/外地"); List<String> head19 = new ArrayList<String>(); head19.add("户口所在地"); List<String> head20 = new ArrayList<String>(); head20.add("*养老登记(是/否)"); List<String> head21 = new ArrayList<String>(); head21.add("*健在(是/否)"); List<String> head22 = new ArrayList<String>(); head22.add("*养老金开始领取时间(年-月-日)"); List<String> head23 = new ArrayList<String>(); head23.add("*现居住地址"); List<String> head24 = new ArrayList<String>(); head24.add("备注"); list.add(head0); list.add(head1); list.add(head2); list.add(head3); list.add(head4); list.add(head5); list.add(head6); list.add(head7); list.add(head8); list.add(head9); list.add(head10); list.add(head11); list.add(head12); list.add(head13); list.add(head14); list.add(head15); list.add(head16); list.add(head17); list.add(head18); list.add(head19); list.add(head20); list.add(head21); list.add(head22); list.add(head23); list.add(head24); return list; } private List<Object> formDataFilling() { List<Object> data = new ArrayList<>(); data.add("张三"); @@ -3108,4 +3434,120 @@ return R.fail(); } } @ApiOperation(value = "下载导入失败高龄老人数据") @PostMapping("/download/error/populationElder") public R downloadErrorElderPopulation(@RequestParam(value = "key") String key) { List<ComMngPopulationElderMistakeExcelVO> list = new ArrayList<>(); Boolean isExits = stringRedisTemplate.hasKey(key); ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue(); if (isExits) { String json = valueOperations.get(key); list = JSONArray.parseArray(json, ComMngPopulationElderMistakeExcelVO.class); } // List<ComMngPopulationMistakeExcelVO> list = JSON.parseArray(mistakes,ComMngPopulationMistakeExcelVO.class); // 生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址 String ftpUrl = "/mnt/data/web/excel/"; String nowDate = DateUtils.getCurrentDateString(); String name = "高龄老人错误数据" + nowDate + ".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, ComMngPopulationElderMistakeExcelVO.class) .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) .registerWriteHandler(new CustomSheetWriteHandler()).build(); WriteSheet writeSheet = EasyExcel.writerSheet("高龄老人错误数据").build(); excelWriter.write(list, 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(); } } @ApiOperation(value = "下载导入失败养老金人员数据") @PostMapping("/download/error/populationPension") public R downloadErrorPensionPopulation(@RequestParam(value = "key") String key) { List<ComMngPopulationPensionMistakeExcelVO> list = new ArrayList<>(); Boolean isExits = stringRedisTemplate.hasKey(key); ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue(); if (isExits) { String json = valueOperations.get(key); list = JSONArray.parseArray(json, ComMngPopulationPensionMistakeExcelVO.class); } // List<ComMngPopulationMistakeExcelVO> list = JSON.parseArray(mistakes,ComMngPopulationMistakeExcelVO.class); // 生成动态模板excel通过ftp工具上传到主节点,然后返回模板下载地址 String ftpUrl = "/mnt/data/web/excel/"; String nowDate = DateUtils.getCurrentDateString(); String name = "养老金人员错误数据" + nowDate + ".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, ComMngPopulationPensionMistakeExcelVO.class) .registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()) .registerWriteHandler(new CustomSheetWriteHandler()).build(); WriteSheet writeSheet = EasyExcel.writerSheet("养老金人员错误数据").build(); excelWriter.write(list, 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(); } } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/CommonDataApi.java
@@ -500,13 +500,43 @@ * @return 导入结果 */ @Transactional(rollbackFor = Exception.class) @PostMapping("/population/importLowSecurity") @PostMapping("population/importLowSecurity") public R listSavePopulationLowSecurityExcelVO(@RequestBody List<ComMngPopulationLowSecurityExcelVO> list, @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId) { return comMngPopulationService.listSaveLowSecurityPopulation(list, communityId, userId); } /** * 批量导入高龄老人 listSavePopulationElderExcelVO 批量导入高龄老人 * @param list 高龄老人数据 * @param communityId 社区id * @return R 导入结果 * @author txb * @date 2021/9/01 15:03 */ @Transactional(rollbackFor = Exception.class) @PostMapping("population/importElder") public R listSavePopulationElderExcelVO(@RequestBody List<ComMngPopulationElderExcelVO> list, @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId){ return comMngPopulationService.listSaveEdlerPopulation(list, communityId, userId); } /** * 批量导入养老金人员 listSavePopulationPensionExcelVO 批量导入养老金人员 * @param list 养老金人员数据 * @param communityId 社区id * @return R 导入结果 * @author txb * @date 2021/9/01 15:03 */ @Transactional(rollbackFor = Exception.class) @PostMapping("population/importPension") R listSavePopulationPensionExcelVO(@RequestBody List<ComMngPopulationPensionExcelVO> list, @RequestParam(value = "communityId") Long communityId, @RequestParam(value = "userId") Long userId){ return comMngPopulationService.listSavePensionPopulation(list, communityId, userId); } /** * 确认导入实有人口(有则更新,无则新建) * * @param list springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComElderAuthRecordsDAO.java
@@ -1,8 +1,18 @@ package com.panzhihua.service_community.dao; import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.panzhihua.common.model.dtos.community.ComMngPopulationDTO; import com.panzhihua.common.model.dtos.community.PageElderAuthRecordsDTO; import com.panzhihua.common.model.vos.community.ComElderAuthRecordExcleVO; import com.panzhihua.common.model.vos.community.ComElderAuthRecordVO; import com.panzhihua.common.model.vos.community.ComMngPopulationVO; import com.panzhihua.service_community.model.dos.ComElderAuthRecordsDO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; import java.util.List; /** * title: ComElderAuthRecordsDAO 社区政务》高龄老人认证》认证记录表mapper类 @@ -15,4 +25,11 @@ @Mapper public interface ComElderAuthRecordsDAO extends BaseMapper<ComElderAuthRecordsDO> { IPage<ComElderAuthRecordVO> pageElderAuthRecords(Page page, @Param("pageElderAuthRecordsDTO") PageElderAuthRecordsDTO pageElderAuthRecordsDTO); ComElderAuthRecordVO detailElderAuthRecords(@Param("authRecordId") Long authRecordId); List<ComElderAuthRecordExcleVO> getElderAuthRecordsByIds(@Param("ids") List<Long> ids); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/ComMngPopulationDAO.java
@@ -156,9 +156,9 @@ IPage<InputUserInfoVO> specialInputUser(Page page, @Param("pageInputUserDTO") PageInputUserDTO pageInputUserDTO); @Select("<script> " + "select id,tag_name,community_id,create_at,sys_flag from com_mng_user_tag where community_id = #{comMngUserTagDTO.communityId}" + "select id,tag_name,community_id,create_at,sys_flag from com_mng_user_tag <where> " + "<if test='comMngUserTagDTO.tagName != null and comMngUserTagDTO.tagName != ""'>" + " AND tag_name LIKE concat(#{comMngUserTagDTO.tagName},'%') " + " </if> " + " order by create_at desc " + " AND tag_name LIKE concat(#{comMngUserTagDTO.tagName},'%') " + " </if> " + "</where>" + " order by create_at desc " + "</script>") IPage<ComMngTagVO> specialInputUserTags(Page page, @Param("comMngUserTagDTO") PageInputUserDTO comMngUserTagDTO); springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/model/dos/ComElderAuthElderliesDO.java
@@ -123,29 +123,14 @@ */ private Long updateBy; @Override public String toString() { return "ComElderAuthElderliesDO{" + "id=" + id + ", populationId=" + populationId + ", streetId=" + streetId + ", communityId=" + communityId + ", phone=" + phone + ", name=" + name + ", idCard=" + idCard + ", sex=" + sex + ", age=" + age + ", birthday=" + birthday + ", personnelCategory=" + personnelCategory + ", isRegister=" + isRegister + ", isAlive=" + isAlive + ", address=" + address + ", remark=" + remark + ", receiveAllowanceBegin=" + receiveAllowanceBegin + ", createAt=" + createAt + ", createBy=" + createBy + ", updateAt=" + updateAt + ", updateBy=" + updateBy + "}"; } /** * 人员类别(1.80-89周岁 2.90-99周岁 3.100周岁(含)以上) */ public interface personnelCategory { int under90 = 1; int under100 = 2; int above100 = 3; } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComElderAuthRecordsService.java
@@ -1,7 +1,16 @@ package com.panzhihua.service_community.service; import com.baomidou.mybatisplus.extension.service.IService; import com.panzhihua.common.model.dtos.community.PageElderAuthRecordsDTO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.ComElderAuthRecordVO; import com.panzhihua.service_community.model.dos.ComElderAuthRecordsDO; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; import java.util.List; /** * title: ComElderAuthRecordsService 社区政务》高龄老人认证》认证记录表服务类 @@ -13,4 +22,50 @@ */ public interface ComElderAuthRecordsService extends IService<ComElderAuthRecordsDO> { /** * 分页查询高龄老人认证记录 pageElderAuthRecords 分页查询高龄老人认证记录 * @param pageElderAuthRecordsDTO 查询参数 * @return R 查询结果 * @author txb * @date 2021/9/02 11:03 */ R pageElderAuthRecords(PageElderAuthRecordsDTO pageElderAuthRecordsDTO); /** * 根据高龄认证记录id查询详情 detailElderAuthRecords 根据高龄认证记录id查询详情 * @param authRecordId 高龄认证记录id * @return R 查询结果 * @author txb * @date 2021/9/02 11:03 */ R detailElderAuthRecords(Long authRecordId); /** * 高龄认证审核 examineElderAuthRecords 高龄认证审核 * @param comElderAuthRecordVO 高龄认证审核参数 * @return R 查询结果 * @author txb * @date 2021/9/02 11:03 */ R examineElderAuthRecords(ComElderAuthRecordVO comElderAuthRecordVO); /** * 高龄认证标记 examineElderAuthRecords 高龄认证标记 * @param comElderAuthRecordVO 高龄认证标记参数 * @return R 查询结果 * @author txb * @date 2021/9/02 11:03 */ R signElderAuthRecords(ComElderAuthRecordVO comElderAuthRecordVO); /** * 根据高龄认证记录id批量查询 getElderAuthRecordsByIds 根据高龄认证记录id批量查询 * @param ids 高龄认证记录id集合 * @return R 查询结果 * @author txb * @date 2021/9/02 11:03 */ R getElderAuthRecordsByIds(@RequestBody List<Long> ids); } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/ComMngPopulationService.java
@@ -19,6 +19,10 @@ import com.panzhihua.common.model.vos.user.ComMngTagVO; import com.panzhihua.common.model.vos.user.UserElectronicFileVO; import com.panzhihua.service_community.model.dos.ComMngPopulationDO; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestParam; /** * 实有人口Service @@ -203,6 +207,26 @@ R listSaveLowSecurityPopulation(List<ComMngPopulationLowSecurityExcelVO> list, Long communityId, Long userId); /** * 批量导入高龄老人 listSavePopulationElderExcelVO 批量导入高龄老人 * @param list 高龄老人数据 * @param communityId 社区id * @return R 导入结果 * @author txb * @date 2021/9/01 15:03 */ R listSaveEdlerPopulation(List<ComMngPopulationElderExcelVO> list, Long communityId, Long userId); /** * 批量导入养老金人员 listSavePopulationPensionExcelVO 批量导入养老金人员 * @param list 养老金人员数据 * @param communityId 社区id * @return R 导入结果 * @author txb * @date 2021/9/01 15:03 */ R listSavePensionPopulation(List<ComMngPopulationPensionExcelVO> list, Long communityId, Long userId); /** * 确认导入实有人口(有则更新,无则新建) * * @param list springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComElderAuthRecordsServiceImpl.java
@@ -1,11 +1,30 @@ package com.panzhihua.service_community.service.impl; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.panzhihua.common.enums.PopulCultureLevelEnum; import com.panzhihua.common.enums.PopulMarriageEnum; import com.panzhihua.common.enums.PopulPoliticalOutlookEnum; import com.panzhihua.common.enums.PopulRelationEnum; import com.panzhihua.common.model.dtos.community.PageElderAuthRecordsDTO; import com.panzhihua.common.model.vos.R; import com.panzhihua.common.model.vos.community.ComElderAuthRecordExcleVO; import com.panzhihua.common.model.vos.community.ComElderAuthRecordVO; import com.panzhihua.common.model.vos.community.ComMngPopulationVO; import com.panzhihua.common.utlis.AgeUtils; import com.panzhihua.common.utlis.StringUtils; import com.panzhihua.service_community.dao.ComElderAuthRecordsDAO; import com.panzhihua.service_community.model.dos.ComElderAuthRecordsDO; import com.panzhihua.service_community.model.dos.ComMngPopulationDO; import com.panzhihua.service_community.service.ComElderAuthRecordsService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.Date; import java.util.List; /** * title: ComElderAuthRecordsServiceImpl 社区政务》高龄老人认证》认证记录表服务实现类 @@ -19,4 +38,71 @@ @Service public class ComElderAuthRecordsServiceImpl extends ServiceImpl<ComElderAuthRecordsDAO, ComElderAuthRecordsDO> implements ComElderAuthRecordsService { @Resource private ComElderAuthRecordsDAO comElderAuthRecordsDAO; @Override public R pageElderAuthRecords(PageElderAuthRecordsDTO pageElderAuthRecordsDTO) { Page page = new Page<>(); Long pageNum = pageElderAuthRecordsDTO.getPageNum(); Long pageSize = pageElderAuthRecordsDTO.getPageSize(); if (null == pageNum || 0 == pageNum) { pageNum = 1L; } if (null == pageSize || 0 == pageSize) { pageSize = 10L; } page.setSize(pageSize); page.setCurrent(pageNum); IPage<ComElderAuthRecordVO> iPage = comElderAuthRecordsDAO.pageElderAuthRecords(page, pageElderAuthRecordsDTO); if (!iPage.getRecords().isEmpty()) { iPage.getRecords().forEach(comElderAuthRecordVO -> { if (StringUtils.isNotEmpty(comElderAuthRecordVO.getBirthday())) { comElderAuthRecordVO.setAge(AgeUtils.getAgeFromBirthTimes(comElderAuthRecordVO.getBirthday())); } }); } return R.ok(iPage); } @Override public R detailElderAuthRecords(Long authRecordId) { ComElderAuthRecordVO comElderAuthRecordVO = comElderAuthRecordsDAO.detailElderAuthRecords(authRecordId); return R.ok(comElderAuthRecordVO); } @Override public R examineElderAuthRecords(ComElderAuthRecordVO comElderAuthRecordVO) { ComElderAuthRecordsDO comElderAuthRecordsDO = comElderAuthRecordsDAO.selectById(comElderAuthRecordVO.getId()); if (comElderAuthRecordsDO == null) { return R.fail("未查询到高龄老人认证记录"); } BeanUtils.copyProperties(comElderAuthRecordVO, comElderAuthRecordsDO); comElderAuthRecordsDO.setApprovalDate(new Date()); int nub = comElderAuthRecordsDAO.updateById(comElderAuthRecordsDO); if (nub < 1) { return R.fail("审核失败"); } return R.ok(); } @Override public R signElderAuthRecords(ComElderAuthRecordVO comElderAuthRecordVO) { ComElderAuthRecordsDO comElderAuthRecordsDO = comElderAuthRecordsDAO.selectById(comElderAuthRecordVO.getId()); if (comElderAuthRecordsDO == null) { return R.fail("未查询到高龄老人认证记录"); } BeanUtils.copyProperties(comElderAuthRecordVO, comElderAuthRecordsDO); int nub = comElderAuthRecordsDAO.updateById(comElderAuthRecordsDO); if (nub < 1) { return R.fail("标记失败"); } return R.ok(); } @Override public R getElderAuthRecordsByIds(List<Long> ids) { List<ComElderAuthRecordExcleVO> comElderAuthRecordExcleVOS = comElderAuthRecordsDAO.getElderAuthRecordsByIds(ids); return R.ok(comElderAuthRecordExcleVOS); } } springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
@@ -118,6 +118,10 @@ private ComDisabilityPopulationDAO comDisabilityPopulationDAO; @Resource private ComLowSecurityPopulationDAO comLowSecurityPopulationDAO; @Resource private ComElderAuthElderliesDAO comElderAuthElderliesDAO; @Resource private ComPensionAuthPensionerDAO comPensionAuthPensionerDAO; @Value("${domain.aesKey:}") private String aesKey; @@ -385,6 +389,34 @@ comMngPopulationVO.setComLowSecurityPopulationVOs(comLowSecurityPopulationVOS); }); } // 高龄老人信息 List<ComElderAuthElderliesVO> comElderAuthElderliesVOList = new ArrayList<>(); List<ComElderAuthElderliesDO> comElderAuthElderliesDOS = comElderAuthElderliesDAO.selectList(new QueryWrapper<ComElderAuthElderliesDO>().lambda() .eq(ComElderAuthElderliesDO::getPopulationId, populationId)); if (!comElderAuthElderliesDOS.isEmpty()) { comElderAuthElderliesDOS.forEach(comElderAuthElderliesDO -> { ComElderAuthElderliesVO comElderAuthElderliesVO = new ComElderAuthElderliesVO(); BeanUtils.copyProperties(comElderAuthElderliesDO, comElderAuthElderliesVO); comElderAuthElderliesVOList.add(comElderAuthElderliesVO); comMngPopulationVO.setComElderAuthElderliesVOList(comElderAuthElderliesVOList); }); } // 养老人员信息 List<ComPensionAuthPensionerVO> comPensionAuthPensionerVOList = new ArrayList<>(); List<ComPensionAuthPensionerDO> comPensionAuthPensionerDOS = comPensionAuthPensionerDAO.selectList(new QueryWrapper<ComPensionAuthPensionerDO>().lambda() .eq(ComPensionAuthPensionerDO::getPopulationId, populationId)); if (!comPensionAuthPensionerDOS.isEmpty()) { comPensionAuthPensionerDOS.forEach(comPensionAuthPensionerDO -> { ComPensionAuthPensionerVO comPensionAuthPensionerVO = new ComPensionAuthPensionerVO(); BeanUtils.copyProperties(comPensionAuthPensionerDO, comPensionAuthPensionerVO); comPensionAuthPensionerVOList.add(comPensionAuthPensionerVO); comMngPopulationVO.setComPensionAuthPensionerVOList(comPensionAuthPensionerVOList); }); } return R.ok(comMngPopulationVO); } @@ -560,7 +592,7 @@ // 查询当前社区标签列表 List<String> labelList = new ArrayList<>(); List<ComMngUserTagDO> comMngUserTagDOS = comMngUserTagDAO .selectList(new QueryWrapper<ComMngUserTagDO>().eq("sys_flag", 1).or().eq("community_id", communityId)); .selectList(null); if (!ObjectUtils.isEmpty(comMngUserTagDOS)) { labelList = comMngUserTagDOS.stream().map(comMngUserTagDO -> comMngUserTagDO.getTagName()) .collect(Collectors.toList()); @@ -748,8 +780,8 @@ if (!labelList.contains(s)) iterator.remove(); } populationDO.setLabel(Joiner.on(",").join(userTag)); populationDO.setCreateBy(userId); cpopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); cpopulationCommunityTagsDO.setCreateBy(userId); savePopulationCommunityList.add(cpopulationCommunityTagsDO); }else { // 实有人口存在于当前社区,则更新 @@ -854,7 +886,7 @@ // 查询当前社区标签列表 List<String> labelList = new ArrayList<>(); List<ComMngUserTagDO> comMngUserTagDOS = comMngUserTagDAO .selectList(new QueryWrapper<ComMngUserTagDO>().eq("sys_flag", 1).or().eq("community_id", communityId)); .selectList(null); if (!ObjectUtils.isEmpty(comMngUserTagDOS)) { labelList = comMngUserTagDOS.stream().map(comMngUserTagDO -> comMngUserTagDO.getTagName()) .collect(Collectors.toList()); @@ -1043,8 +1075,8 @@ if (!labelList.contains(s)) iterator.remove(); } populationDO.setLabel(Joiner.on(",").join(userTag)); populationDO.setCreateBy(userId); cpopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); cpopulationCommunityTagsDO.setCreateBy(userId); savePopulationCommunityList.add(cpopulationCommunityTagsDO); }else { // 实有人口存在于当前社区,则更新 @@ -1149,7 +1181,7 @@ // 查询当前社区标签列表 List<String> labelList = new ArrayList<>(); List<ComMngUserTagDO> comMngUserTagDOS = comMngUserTagDAO .selectList(new QueryWrapper<ComMngUserTagDO>().eq("sys_flag", 1).or().eq("community_id", communityId)); .selectList(null); if (!ObjectUtils.isEmpty(comMngUserTagDOS)) { labelList = comMngUserTagDOS.stream().map(comMngUserTagDO -> comMngUserTagDO.getTagName()) .collect(Collectors.toList()); @@ -1338,8 +1370,8 @@ if (!labelList.contains(s)) iterator.remove(); } populationDO.setLabel(Joiner.on(",").join(userTag)); populationDO.setCreateBy(userId); cpopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); cpopulationCommunityTagsDO.setCreateBy(userId); savePopulationCommunityList.add(cpopulationCommunityTagsDO); }else { // 实有人口存在于当前社区,则更新 @@ -1444,7 +1476,7 @@ // 查询当前社区标签列表 List<String> labelList = new ArrayList<>(); List<ComMngUserTagDO> comMngUserTagDOS = comMngUserTagDAO .selectList(new QueryWrapper<ComMngUserTagDO>().eq("sys_flag", 1).or().eq("community_id", communityId)); .selectList(null); if (!ObjectUtils.isEmpty(comMngUserTagDOS)) { labelList = comMngUserTagDOS.stream().map(comMngUserTagDO -> comMngUserTagDO.getTagName()) .collect(Collectors.toList()); @@ -1633,8 +1665,8 @@ if (!labelList.contains(s)) iterator.remove(); } populationDO.setLabel(Joiner.on(",").join(userTag)); populationDO.setCreateBy(userId); cpopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); cpopulationCommunityTagsDO.setCreateBy(userId); savePopulationCommunityList.add(cpopulationCommunityTagsDO); }else { // 实有人口存在于当前社区,则更新 @@ -1739,7 +1771,7 @@ // 查询当前社区标签列表 List<String> labelList = new ArrayList<>(); List<ComMngUserTagDO> comMngUserTagDOS = comMngUserTagDAO .selectList(new QueryWrapper<ComMngUserTagDO>().eq("sys_flag", 1).or().eq("community_id", communityId)); .selectList(null); if (!ObjectUtils.isEmpty(comMngUserTagDOS)) { labelList = comMngUserTagDOS.stream().map(comMngUserTagDO -> comMngUserTagDO.getTagName()) .collect(Collectors.toList()); @@ -1928,8 +1960,8 @@ if (!labelList.contains(s)) iterator.remove(); } populationDO.setLabel(Joiner.on(",").join(userTag)); populationDO.setCreateBy(userId); cpopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); cpopulationCommunityTagsDO.setCreateBy(userId); savePopulationCommunityList.add(cpopulationCommunityTagsDO); } else { // 实有人口存在于当前社区,则更新 @@ -2035,7 +2067,7 @@ // 查询当前社区标签列表 List<String> labelList = new ArrayList<>(); List<ComMngUserTagDO> comMngUserTagDOS = comMngUserTagDAO .selectList(new QueryWrapper<ComMngUserTagDO>().eq("sys_flag", 1).or().eq("community_id", communityId)); .selectList(null); if (!ObjectUtils.isEmpty(comMngUserTagDOS)) { labelList = comMngUserTagDOS.stream().map(comMngUserTagDO -> comMngUserTagDO.getTagName()) .collect(Collectors.toList()); @@ -2225,8 +2257,8 @@ if (!labelList.contains(s)) iterator.remove(); } populationDO.setLabel(Joiner.on(",").join(userTag)); populationDO.setCreateBy(userId); cpopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); cpopulationCommunityTagsDO.setCreateBy(userId); savePopulationCommunityList.add(cpopulationCommunityTagsDO); }else { // 实有人口存在于当前社区,则更新 @@ -2332,7 +2364,7 @@ // 查询当前社区标签列表 List<String> labelList = new ArrayList<>(); List<ComMngUserTagDO> comMngUserTagDOS = comMngUserTagDAO .selectList(new QueryWrapper<ComMngUserTagDO>().eq("sys_flag", 1).or().eq("community_id", communityId)); .selectList(null); if (!ObjectUtils.isEmpty(comMngUserTagDOS)) { labelList = comMngUserTagDOS.stream().map(comMngUserTagDO -> comMngUserTagDO.getTagName()) .collect(Collectors.toList()); @@ -2521,8 +2553,8 @@ if (!labelList.contains(s)) iterator.remove(); } populationDO.setLabel(Joiner.on(",").join(userTag)); populationDO.setCreateBy(userId); cpopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); cpopulationCommunityTagsDO.setCreateBy(userId); savePopulationCommunityList.add(cpopulationCommunityTagsDO); }else { // 实有人口存在于当前社区,则更新 @@ -2627,7 +2659,7 @@ // 查询当前社区标签列表 List<String> labelList = new ArrayList<>(); List<ComMngUserTagDO> comMngUserTagDOS = comMngUserTagDAO .selectList(new QueryWrapper<ComMngUserTagDO>().eq("sys_flag", 1).or().eq("community_id", communityId)); .selectList(null); if (!ObjectUtils.isEmpty(comMngUserTagDOS)) { labelList = comMngUserTagDOS.stream().map(comMngUserTagDO -> comMngUserTagDO.getTagName()) .collect(Collectors.toList()); @@ -2816,8 +2848,8 @@ if (!labelList.contains(s)) iterator.remove(); } populationDO.setLabel(Joiner.on(",").join(userTag)); populationDO.setCreateBy(userId); cpopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); cpopulationCommunityTagsDO.setCreateBy(userId); savePopulationCommunityList.add(cpopulationCommunityTagsDO); } else { // 实有人口存在于当前社区,则更新 @@ -2922,7 +2954,7 @@ // 查询当前社区标签列表 List<String> labelList = new ArrayList<>(); List<ComMngUserTagDO> comMngUserTagDOS = comMngUserTagDAO .selectList(new QueryWrapper<ComMngUserTagDO>().eq("sys_flag", 1).or().eq("community_id", communityId)); .selectList(null); if (!ObjectUtils.isEmpty(comMngUserTagDOS)) { labelList = comMngUserTagDOS.stream().map(comMngUserTagDO -> comMngUserTagDO.getTagName()) .collect(Collectors.toList()); @@ -3111,8 +3143,8 @@ if (!labelList.contains(s)) iterator.remove(); } populationDO.setLabel(Joiner.on(",").join(userTag)); populationDO.setCreateBy(userId); cpopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); cpopulationCommunityTagsDO.setCreateBy(userId); savePopulationCommunityList.add(cpopulationCommunityTagsDO); }else { // 实有人口存在于当前社区,则更新 @@ -3217,7 +3249,7 @@ // 查询当前社区标签列表 List<String> labelList = new ArrayList<>(); List<ComMngUserTagDO> comMngUserTagDOS = comMngUserTagDAO .selectList(new QueryWrapper<ComMngUserTagDO>().eq("sys_flag", 1).or().eq("community_id", communityId)); .selectList(null); if (!ObjectUtils.isEmpty(comMngUserTagDOS)) { labelList = comMngUserTagDOS.stream().map(comMngUserTagDO -> comMngUserTagDO.getTagName()) .collect(Collectors.toList()); @@ -3406,8 +3438,8 @@ if (!labelList.contains(s)) iterator.remove(); } populationDO.setLabel(Joiner.on(",").join(userTag)); populationDO.setCreateBy(userId); cpopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); cpopulationCommunityTagsDO.setCreateBy(userId); savePopulationCommunityList.add(cpopulationCommunityTagsDO); } else { // 实有人口存在于当前社区,则更新 @@ -3517,7 +3549,7 @@ // 查询当前社区标签列表 List<String> labelList = new ArrayList<>(); List<ComMngUserTagDO> comMngUserTagDOS = comMngUserTagDAO .selectList(new QueryWrapper<ComMngUserTagDO>().eq("sys_flag", 1).or().eq("community_id", communityId)); .selectList(null); if (!ObjectUtils.isEmpty(comMngUserTagDOS)) { labelList = comMngUserTagDOS.stream().map(comMngUserTagDO -> comMngUserTagDO.getTagName()) .collect(Collectors.toList()); @@ -3706,8 +3738,8 @@ if (!labelList.contains(s)) iterator.remove(); } populationDO.setLabel(Joiner.on(",").join(userTag)); populationDO.setCreateBy(userId); cpopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); cpopulationCommunityTagsDO.setCreateBy(userId); savePopulationCommunityList.add(cpopulationCommunityTagsDO); } else { // 实有人口存在于当前社区,则更新 @@ -3729,6 +3761,604 @@ ComMngPopulationLowSecurityMistakeExcelVO mistake = new ComMngPopulationLowSecurityMistakeExcelVO(); BeanUtils.copyProperties(vo, mistake); setLowSecurityMistake(mistake, vo); mistake.setMistake("该实有人口已存在于该社区,执行更新"); mistakes.add(mistake); } } log.info("查询实有人口存在社区信息完成"); } } catch (Exception e) { log.info("出现错误,错误原因:" + e.getMessage()); } log.info("处理完成导入数据"); log.info("开始执行数据库导入"); if (!houseList.isEmpty()) { log.info("执行数据库导入房屋"); comMngPopulationHouseDAO.insertAll(houseList); log.info("执行数据库导入房屋完成"); } if (!saveList.isEmpty()) { log.info("执行数据库导入人口"); this.baseMapper.insertAll(saveList); log.info("执行数据库导入人口完成"); } if (!updateList.isEmpty()) { log.info("执行数据库更新人口"); this.baseMapper.updateAll(updateList); // this.updateBatchById(updateList); log.info("执行数据库更新人口完成"); } if (!houseUserList.isEmpty()) { log.info("执行数据库导入人口房屋关系"); comMngPopulationHouseUserService.saveBatch(houseUserList); log.info("执行数据库导入人口房屋关系完成"); } if (!savePopulationCommunityList.isEmpty()) { log.info("执行数据库导入人口社区关系"); comMngPopulationCommunityTagsService.saveBatch(savePopulationCommunityList); log.info("数据库导入人口社区关系完成"); } if (!updatePopulationCommunityList.isEmpty()) { log.info("执行数据库更新人口社区关系"); comMngPopulationCommunityTagsDAO.updateAll(updatePopulationCommunityList); log.info("数据库更新人口社区关系完成"); } log.info("执行数据库导入完成"); if (!mistakes.isEmpty()) { log.info("返回错误数据"); return R.fail(mistakes); } return R.ok(mistakes); } @Override @Transactional(rollbackFor = Exception.class) public R listSaveEdlerPopulation(List<ComMngPopulationElderExcelVO> list, Long communityId, Long userId) { // 需要新增的房屋集合 List<ComMngPopulationHouseDO> houseList = new ArrayList<>(); // 需要新增的人口集合 List<ComMngPopulationDO> saveList = new ArrayList<>(); // 需要修改的人口集合 List<ComMngPopulationDO> updateList = new ArrayList<>(); // 需要新增的吸毒人员集合 List<ComDrugPopulationDO> saveDrugList = new ArrayList<>(); // 需要修改的吸毒人员集合 List<ComDrugPopulationDO> updateDrugList = new ArrayList<>(); // 需要新增的人口与房屋关系集合 List<ComMngPopulationHouseUserDO> houseUserList = new ArrayList<>(); // 需要新增的人口与社区关系集合 List<ComMngPopulationCommunityTagsDO> savePopulationCommunityList = new ArrayList<>(); // 需要新增的人口与社区关系集合 List<ComMngPopulationCommunityTagsDO> updatePopulationCommunityList = new ArrayList<>(); log.info("开始处理导入数据"); List<ComMngPopulationElderMistakeExcelVO> mistakes = new ArrayList<>(); try { // 查询社区信息 log.info("开始查询社区信息数据"); ComPopulationActVO populationActVO = comActDAO.getPopulationActById(communityId); if (populationActVO == null) { log.error("未查询到社区信息"); return R.fail("未查询到社区信息"); } log.info("开始查询社区信息数据完成"); // 查询当前社区标签列表 List<String> labelList = new ArrayList<>(); List<ComMngUserTagDO> comMngUserTagDOS = comMngUserTagDAO .selectList(null); if (!ObjectUtils.isEmpty(comMngUserTagDOS)) { labelList = comMngUserTagDOS.stream().map(comMngUserTagDO -> comMngUserTagDO.getTagName()) .collect(Collectors.toList()); } StringBuilder areaPath = new StringBuilder(); areaPath.append(populationActVO.getProvinceName()).append(">").append(populationActVO.getCityName()) .append(">").append(populationActVO.getDistrictName()).append(">"); // 处理实有人口信息 Integer nub = 1; // 查询所有人口数据放入HashMap中 List<ComMngPopulationDO> populationList = this.baseMapper.selectList(null); HashMap<String, Object> populationMap = new HashMap<>(); populationList.forEach(population -> { String key = population.getCardNo(); populationMap.put(key, population); }); // 查询所有房屋信息放入到HashMap中 List<ComMngPopulationHouseDO> houseLists = comMngPopulationHouseDAO.selectList(null); HashMap<String, Object> houseMap = new HashMap<>(); houseLists.forEach(house -> { String key = house.getCommunityId() + house.getVillageId() + house.getFloor() + house.getUnitNo() + house.getHouseNo(); houseMap.put(key, house); }); List<ComMngVillageDO> villageList = comActVillageDAO.selectList(null); HashMap<String, Object> villageMap = new HashMap<>(); villageList.forEach(village -> { String key = village.getCommunityId() + village.getAlley() + village.getHouseNum(); villageMap.put(key, village); }); List<ComMngPopulationHouseUserDO> houseUserLists = comMngPopulationHouseUserDAO.selectList(null); HashMap<String, Object> houseUserMap = new HashMap<>(); houseUserLists.forEach(houseUser -> { String key = houseUser.getPopulId() + houseUser.getHouseId() + ""; 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 (ComMngPopulationElderExcelVO vo : list) { if (vo.getDoorNo().contains("号")) { vo.setDoorNo(vo.getDoorNo().replace("号", "")); } if (StringUtils.isNotEmpty(vo.getFloor())) { if (vo.getFloor().contains("栋")) { vo.setFloor(vo.getFloor().replace("栋", "")); } } if (StringUtils.isNotEmpty(vo.getUnitNo())) { if (vo.getUnitNo().contains("单元")) { vo.setUnitNo(vo.getUnitNo().replace("单元", "")); } } if (StringUtils.isNotEmpty(vo.getHouseNo())) { if (vo.getHouseNo().contains("号")) { vo.setHouseNo(vo.getHouseNo().replace("号", "")); } } log.info("开始查询小区街路巷是否存在"); // 查询小区街路巷是否存在 ComMngVillageDO comMngVillageDO = null; String villageKey = communityId + vo.getRoad() + vo.getDoorNo(); if (!isOnly(villageKey, villageMap)) { comMngVillageDO = (ComMngVillageDO)villageMap.get(villageKey); } else { ComMngPopulationElderMistakeExcelVO mistake = new ComMngPopulationElderMistakeExcelVO(); BeanUtils.copyProperties(vo, mistake); setElderMistake(mistake, vo); mistake.setMistake("街路巷或小区号不存在,请先在“小区管理”中添加该小区:街路巷:" + vo.getRoad() + ",小区号:" + vo.getDoorNo()); mistakes.add(mistake); log.info("未查询到街路巷:" + vo.getRoad() + ",小区号:" + vo.getDoorNo()); continue; } StringBuilder address = new StringBuilder(); address.append(populationActVO.getProvinceName()).append(populationActVO.getCityName()) .append(populationActVO.getDistrictName()).append(populationActVO.getStreetName()) .append(comMngVillageDO.getAlley()).append(vo.getDoorNo()).append("号"); if (StringUtils.isNotEmpty(vo.getFloor())) { address.append(vo.getFloor()).append("栋"); } if (StringUtils.isNotEmpty(vo.getUnitNo())) { address.append(vo.getUnitNo()).append("单元"); } if (StringUtils.isNotEmpty(vo.getHouseNo())) { address.append(vo.getHouseNo()).append("号"); } vo.setAddress(address.toString()); log.info("开始查询小区街路巷是否存在完成"); log.info("开始查询房屋是否存在"); // 先判断房屋是否存在 ComMngPopulationHouseDO populationHouseDO = null; String houseKey = communityId + comMngVillageDO.getVillageId() + vo.getFloor() + vo.getUnitNo() + vo.getHouseNo(); if (isOnly(houseKey, houseMap)) { if (!houseList.isEmpty()) { for (ComMngPopulationHouseDO house : houseList) { if (house.getVillageId().equals(comMngVillageDO.getVillageId()) && house.getCommunityId().equals(communityId) && house.getFloor().equals(vo.getFloor()) && house.getUnitNo().equals(vo.getUnitNo()) && house.getHouseNo().equals(vo.getHouseNo())) { populationHouseDO = house; break; } } } if (populationHouseDO == null) { // 房屋信息不存在建立房屋信息 populationHouseDO = saveElderPopulationHouse(vo, comMngVillageDO, communityId, areaPath, populationActVO.getName()); houseList.add(populationHouseDO); } } else { populationHouseDO = (ComMngPopulationHouseDO)houseMap.get(houseKey); } vo.setHouseId(populationHouseDO.getId()); log.info("开始查询房屋是否存在完成"); if (StringUtils.isEmpty(vo.getName()) && StringUtils.isEmpty(vo.getCardNo())) { // 空户处理完房屋信息,直接返回 continue; } String cardNoAES = AESUtil.encrypt128(vo.getCardNo(), aesKey); // 判断实有人口是否已存在 log.info("开始查询实有人口是否已存在"); ComMngPopulationDO populationDO = null; String populationKey = vo.getCardNo(); if (!isOnly(populationKey, populationMap)) { // 存在实有人口信息,则更新 populationDO = (ComMngPopulationDO)populationMap.get(populationKey); ComMngPopulationDO updatePopulationDO = updateElderPopulationDO(vo, populationDO, communityId, userId); updateList.add(updatePopulationDO); } else { // 不存在实有人口,则新增 populationDO = saveElderPopulationDO(vo, populationActVO, comMngVillageDO, userId); saveList.add(populationDO); } log.info("开始查询实有人口是否已存在完成"); log.info("开始查询实有人口房屋居住信息"); // 处理实有人口房屋居住信息 if (populationDO != null) { ComMngPopulationHouseUserDO populationHouseUserDO = null; String houseUserKey = populationDO.getId() + populationHouseDO.getId() + ""; if (isOnly(houseUserKey, houseUserMap)) { populationHouseUserDO = new ComMngPopulationHouseUserDO(); populationHouseUserDO.setId(Snowflake.getId()); populationHouseUserDO.setHouseId(populationHouseDO.getId()); populationHouseUserDO.setPopulId(populationDO.getId()); // populationHouseUserDO.setRelation(vo.getRelation()); populationHouseUserDO.setRelationId(vo.getIsRent()); // populationHouseUserDO.setResidence(vo.getResidence()); houseUserList.add(populationHouseUserDO); } } 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(); } cpopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); cpopulationCommunityTagsDO.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); ComMngPopulationElderMistakeExcelVO mistake = new ComMngPopulationElderMistakeExcelVO(); BeanUtils.copyProperties(vo, mistake); setElderMistake(mistake, vo); mistake.setMistake("该实有人口已存在于该社区,执行更新"); mistakes.add(mistake); } } log.info("查询实有人口存在社区信息完成"); } } catch (Exception e) { log.info("出现错误,错误原因:" + e.getMessage()); } log.info("处理完成导入数据"); log.info("开始执行数据库导入"); if (!houseList.isEmpty()) { log.info("执行数据库导入房屋"); comMngPopulationHouseDAO.insertAll(houseList); log.info("执行数据库导入房屋完成"); } if (!saveList.isEmpty()) { log.info("执行数据库导入人口"); this.baseMapper.insertAll(saveList); log.info("执行数据库导入人口完成"); } if (!updateList.isEmpty()) { log.info("执行数据库更新人口"); this.baseMapper.updateAll(updateList); // this.updateBatchById(updateList); log.info("执行数据库更新人口完成"); } if (!houseUserList.isEmpty()) { log.info("执行数据库导入人口房屋关系"); comMngPopulationHouseUserService.saveBatch(houseUserList); log.info("执行数据库导入人口房屋关系完成"); } if (!savePopulationCommunityList.isEmpty()) { log.info("执行数据库导入人口社区关系"); comMngPopulationCommunityTagsService.saveBatch(savePopulationCommunityList); log.info("数据库导入人口社区关系完成"); } if (!updatePopulationCommunityList.isEmpty()) { log.info("执行数据库更新人口社区关系"); comMngPopulationCommunityTagsDAO.updateAll(updatePopulationCommunityList); log.info("数据库更新人口社区关系完成"); } log.info("执行数据库导入完成"); if (!mistakes.isEmpty()) { log.info("返回错误数据"); return R.fail(mistakes); } return R.ok(mistakes); } @Override @Transactional(rollbackFor = Exception.class) public R listSavePensionPopulation(List<ComMngPopulationPensionExcelVO> list, Long communityId, Long userId) { // 需要新增的房屋集合 List<ComMngPopulationHouseDO> houseList = new ArrayList<>(); // 需要新增的人口集合 List<ComMngPopulationDO> saveList = new ArrayList<>(); // 需要修改的人口集合 List<ComMngPopulationDO> updateList = new ArrayList<>(); // 需要新增的吸毒人员集合 List<ComDrugPopulationDO> saveDrugList = new ArrayList<>(); // 需要修改的吸毒人员集合 List<ComDrugPopulationDO> updateDrugList = new ArrayList<>(); // 需要新增的人口与房屋关系集合 List<ComMngPopulationHouseUserDO> houseUserList = new ArrayList<>(); // 需要新增的人口与社区关系集合 List<ComMngPopulationCommunityTagsDO> savePopulationCommunityList = new ArrayList<>(); // 需要新增的人口与社区关系集合 List<ComMngPopulationCommunityTagsDO> updatePopulationCommunityList = new ArrayList<>(); log.info("开始处理导入数据"); List<ComMngPopulationPensionMistakeExcelVO> mistakes = new ArrayList<>(); try { // 查询社区信息 log.info("开始查询社区信息数据"); ComPopulationActVO populationActVO = comActDAO.getPopulationActById(communityId); if (populationActVO == null) { log.error("未查询到社区信息"); return R.fail("未查询到社区信息"); } log.info("开始查询社区信息数据完成"); // 查询当前社区标签列表 List<String> labelList = new ArrayList<>(); List<ComMngUserTagDO> comMngUserTagDOS = comMngUserTagDAO .selectList(null); if (!ObjectUtils.isEmpty(comMngUserTagDOS)) { labelList = comMngUserTagDOS.stream().map(comMngUserTagDO -> comMngUserTagDO.getTagName()) .collect(Collectors.toList()); } StringBuilder areaPath = new StringBuilder(); areaPath.append(populationActVO.getProvinceName()).append(">").append(populationActVO.getCityName()) .append(">").append(populationActVO.getDistrictName()).append(">"); // 处理实有人口信息 Integer nub = 1; // 查询所有人口数据放入HashMap中 List<ComMngPopulationDO> populationList = this.baseMapper.selectList(null); HashMap<String, Object> populationMap = new HashMap<>(); populationList.forEach(population -> { String key = population.getCardNo(); populationMap.put(key, population); }); // 查询所有房屋信息放入到HashMap中 List<ComMngPopulationHouseDO> houseLists = comMngPopulationHouseDAO.selectList(null); HashMap<String, Object> houseMap = new HashMap<>(); houseLists.forEach(house -> { String key = house.getCommunityId() + house.getVillageId() + house.getFloor() + house.getUnitNo() + house.getHouseNo(); houseMap.put(key, house); }); List<ComMngVillageDO> villageList = comActVillageDAO.selectList(null); HashMap<String, Object> villageMap = new HashMap<>(); villageList.forEach(village -> { String key = village.getCommunityId() + village.getAlley() + village.getHouseNum(); villageMap.put(key, village); }); List<ComMngPopulationHouseUserDO> houseUserLists = comMngPopulationHouseUserDAO.selectList(null); HashMap<String, Object> houseUserMap = new HashMap<>(); houseUserLists.forEach(houseUser -> { String key = houseUser.getPopulId() + houseUser.getHouseId() + ""; 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 (ComMngPopulationPensionExcelVO vo : list) { if (vo.getDoorNo().contains("号")) { vo.setDoorNo(vo.getDoorNo().replace("号", "")); } if (StringUtils.isNotEmpty(vo.getFloor())) { if (vo.getFloor().contains("栋")) { vo.setFloor(vo.getFloor().replace("栋", "")); } } if (StringUtils.isNotEmpty(vo.getUnitNo())) { if (vo.getUnitNo().contains("单元")) { vo.setUnitNo(vo.getUnitNo().replace("单元", "")); } } if (StringUtils.isNotEmpty(vo.getHouseNo())) { if (vo.getHouseNo().contains("号")) { vo.setHouseNo(vo.getHouseNo().replace("号", "")); } } log.info("开始查询小区街路巷是否存在"); // 查询小区街路巷是否存在 ComMngVillageDO comMngVillageDO = null; String villageKey = communityId + vo.getRoad() + vo.getDoorNo(); if (!isOnly(villageKey, villageMap)) { comMngVillageDO = (ComMngVillageDO)villageMap.get(villageKey); } else { ComMngPopulationPensionMistakeExcelVO mistake = new ComMngPopulationPensionMistakeExcelVO(); BeanUtils.copyProperties(vo, mistake); setPensionMistake(mistake, vo); mistake.setMistake("街路巷或小区号不存在,请先在“小区管理”中添加该小区:街路巷:" + vo.getRoad() + ",小区号:" + vo.getDoorNo()); mistakes.add(mistake); log.info("未查询到街路巷:" + vo.getRoad() + ",小区号:" + vo.getDoorNo()); continue; } StringBuilder address = new StringBuilder(); address.append(populationActVO.getProvinceName()).append(populationActVO.getCityName()) .append(populationActVO.getDistrictName()).append(populationActVO.getStreetName()) .append(comMngVillageDO.getAlley()).append(vo.getDoorNo()).append("号"); if (StringUtils.isNotEmpty(vo.getFloor())) { address.append(vo.getFloor()).append("栋"); } if (StringUtils.isNotEmpty(vo.getUnitNo())) { address.append(vo.getUnitNo()).append("单元"); } if (StringUtils.isNotEmpty(vo.getHouseNo())) { address.append(vo.getHouseNo()).append("号"); } vo.setAddress(address.toString()); log.info("开始查询小区街路巷是否存在完成"); log.info("开始查询房屋是否存在"); // 先判断房屋是否存在 ComMngPopulationHouseDO populationHouseDO = null; String houseKey = communityId + comMngVillageDO.getVillageId() + vo.getFloor() + vo.getUnitNo() + vo.getHouseNo(); if (isOnly(houseKey, houseMap)) { if (!houseList.isEmpty()) { for (ComMngPopulationHouseDO house : houseList) { if (house.getVillageId().equals(comMngVillageDO.getVillageId()) && house.getCommunityId().equals(communityId) && house.getFloor().equals(vo.getFloor()) && house.getUnitNo().equals(vo.getUnitNo()) && house.getHouseNo().equals(vo.getHouseNo())) { populationHouseDO = house; break; } } } if (populationHouseDO == null) { // 房屋信息不存在建立房屋信息 populationHouseDO = savePensionPopulationHouse(vo, comMngVillageDO, communityId, areaPath, populationActVO.getName()); houseList.add(populationHouseDO); } } else { populationHouseDO = (ComMngPopulationHouseDO)houseMap.get(houseKey); } vo.setHouseId(populationHouseDO.getId()); log.info("开始查询房屋是否存在完成"); if (StringUtils.isEmpty(vo.getName()) && StringUtils.isEmpty(vo.getCardNo())) { // 空户处理完房屋信息,直接返回 continue; } String cardNoAES = AESUtil.encrypt128(vo.getCardNo(), aesKey); // 判断实有人口是否已存在 log.info("开始查询实有人口是否已存在"); ComMngPopulationDO populationDO = null; String populationKey = vo.getCardNo(); if (!isOnly(populationKey, populationMap)) { // 存在实有人口信息,则更新 populationDO = (ComMngPopulationDO)populationMap.get(populationKey); ComMngPopulationDO updatePopulationDO = updatePensionPopulationDO(vo, populationDO, communityId, userId); updateList.add(updatePopulationDO); } else { // 不存在实有人口,则新增 populationDO = savePensionPopulationDO(vo, populationActVO, comMngVillageDO, userId); saveList.add(populationDO); } log.info("开始查询实有人口是否已存在完成"); log.info("开始查询实有人口房屋居住信息"); // 处理实有人口房屋居住信息 if (populationDO != null) { ComMngPopulationHouseUserDO populationHouseUserDO = null; String houseUserKey = populationDO.getId() + populationHouseDO.getId() + ""; if (isOnly(houseUserKey, houseUserMap)) { populationHouseUserDO = new ComMngPopulationHouseUserDO(); populationHouseUserDO.setId(Snowflake.getId()); populationHouseUserDO.setHouseId(populationHouseDO.getId()); populationHouseUserDO.setPopulId(populationDO.getId()); // populationHouseUserDO.setRelation(vo.getRelation()); populationHouseUserDO.setRelationId(vo.getIsRent()); // populationHouseUserDO.setResidence(vo.getResidence()); houseUserList.add(populationHouseUserDO); } } 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(); } cpopulationCommunityTagsDO.setLabel(Joiner.on(",").join(userTag)); cpopulationCommunityTagsDO.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); ComMngPopulationPensionMistakeExcelVO mistake = new ComMngPopulationPensionMistakeExcelVO(); BeanUtils.copyProperties(vo, mistake); setPensionMistake(mistake, vo); mistake.setMistake("该实有人口已存在于该社区,执行更新"); mistakes.add(mistake); } @@ -4211,6 +4841,114 @@ comLowSecurityPopulationDO.setCommunityId(populationDO.getActId()); comLowSecurityPopulationDO.setStreetId(populationDO.getStreetId()); comLowSecurityPopulationDAO.insert(comLowSecurityPopulationDO); } return populationDO; } private ComMngPopulationDO updateElderPopulationDO(ComMngPopulationElderExcelVO vo, ComMngPopulationDO populationDO, Long communityId, Long userId) { BeanUtils.copyProperties(vo, populationDO); ComElderAuthElderliesDO comElderAuthElderliesDO = comElderAuthElderliesDAO.selectOne(new QueryWrapper<ComElderAuthElderliesDO>().lambda() .eq(ComElderAuthElderliesDO::getPopulationId, populationDO.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(); // } String cardNoAES = populationDO.getCardNo(); try { cardNoAES = AESUtil.encrypt128(vo.getCardNo(), aesKey); } catch (Exception e) { log.error("身份证加密失败"); } // populationDO.setLabel(Joiner.on(",").join(userTag)); populationDO.setActId(communityId); populationDO.setCardNo(cardNoAES); populationDO.setUpdateBy(userId); if (comElderAuthElderliesDO != null) { BeanUtils.copyProperties(vo, comElderAuthElderliesDO); comElderAuthElderliesDO.setIdCard(cardNoAES); comElderAuthElderliesDO.setAddress(vo.getNowAddress()); if (StringUtils.isNotEmpty(vo.getBirthday())) { int age = AgeUtils.getAgeFromBirthTimes(vo.getBirthday()); if (age >= 80 && age < 90) { comElderAuthElderliesDO.setPersonnelCategory(ComElderAuthElderliesDO.personnelCategory.under90); }else if (age >= 90 && age < 100){ comElderAuthElderliesDO.setPersonnelCategory(ComElderAuthElderliesDO.personnelCategory.under100); }else if (age >= 100){ comElderAuthElderliesDO.setPersonnelCategory(ComElderAuthElderliesDO.personnelCategory.above100); } } comElderAuthElderliesDAO.updateById(comElderAuthElderliesDO); } else { comElderAuthElderliesDO = new ComElderAuthElderliesDO(); BeanUtils.copyProperties(vo, comElderAuthElderliesDO); comElderAuthElderliesDO.setId(Snowflake.getId()); comElderAuthElderliesDO.setPopulationId(populationDO.getId()); comElderAuthElderliesDO.setCommunityId(populationDO.getActId()); comElderAuthElderliesDO.setStreetId(populationDO.getStreetId()); comElderAuthElderliesDO.setIdCard(cardNoAES); comElderAuthElderliesDO.setAddress(vo.getNowAddress()); if (StringUtils.isNotEmpty(vo.getBirthday())) { int age = AgeUtils.getAgeFromBirthTimes(vo.getBirthday()); if (age >= 80 && age < 90) { comElderAuthElderliesDO.setPersonnelCategory(ComElderAuthElderliesDO.personnelCategory.under90); }else if (age >= 90 && age < 100){ comElderAuthElderliesDO.setPersonnelCategory(ComElderAuthElderliesDO.personnelCategory.under100); }else if (age >= 100){ comElderAuthElderliesDO.setPersonnelCategory(ComElderAuthElderliesDO.personnelCategory.above100); } } comElderAuthElderliesDAO.insert(comElderAuthElderliesDO); } return populationDO; } private ComMngPopulationDO updatePensionPopulationDO(ComMngPopulationPensionExcelVO vo, ComMngPopulationDO populationDO, Long communityId, Long userId) { BeanUtils.copyProperties(vo, populationDO); ComPensionAuthPensionerDO comPensionAuthPensionerDO = comPensionAuthPensionerDAO.selectOne(new QueryWrapper<ComPensionAuthPensionerDO>().lambda() .eq(ComPensionAuthPensionerDO::getPopulationId, populationDO.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(); // } String cardNoAES = populationDO.getCardNo(); try { cardNoAES = AESUtil.encrypt128(vo.getCardNo(), aesKey); } catch (Exception e) { log.error("身份证加密失败"); } // populationDO.setLabel(Joiner.on(",").join(userTag)); populationDO.setActId(communityId); populationDO.setCardNo(cardNoAES); populationDO.setUpdateBy(userId); if (comPensionAuthPensionerDO != null) { BeanUtils.copyProperties(vo, comPensionAuthPensionerDO); comPensionAuthPensionerDO.setIdCard(cardNoAES); comPensionAuthPensionerDO.setAddress(vo.getNowAddress()); comPensionAuthPensionerDAO.updateById(comPensionAuthPensionerDO); } else { comPensionAuthPensionerDO = new ComPensionAuthPensionerDO(); BeanUtils.copyProperties(vo, comPensionAuthPensionerDO); comPensionAuthPensionerDO.setId(Snowflake.getId()); comPensionAuthPensionerDO.setPopulationId(populationDO.getId()); comPensionAuthPensionerDO.setCommunityId(populationDO.getActId()); comPensionAuthPensionerDO.setStreetId(populationDO.getStreetId()); comPensionAuthPensionerDO.setIdCard(cardNoAES); comPensionAuthPensionerDO.setAddress(vo.getNowAddress()); comPensionAuthPensionerDAO.insert(comPensionAuthPensionerDO); } return populationDO; } @@ -4768,6 +5506,122 @@ return populationDO; } private ComMngPopulationDO saveElderPopulationDO(ComMngPopulationElderExcelVO vo, ComPopulationActVO comActDO, ComMngVillageDO comMngVillageDO, Long userId) { ComMngPopulationDO populationDO = new ComMngPopulationDO(); ComElderAuthElderliesDO comElderAuthElderliesDO = new ComElderAuthElderliesDO(); BeanUtils.copyProperties(vo, populationDO); BeanUtils.copyProperties(vo, comElderAuthElderliesDO); Long populationId = Snowflake.getId(); populationDO.setId(populationId); comElderAuthElderliesDO.setPopulationId(populationId); // 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.setVillageName(comMngVillageDO.getGroupAt()); populationDO.setCardNoStr(vo.getCardNo()); populationDO.setUpdateAt(new Date()); String cardNoAES = populationDO.getCardNo(); try { cardNoAES = AESUtil.encrypt128(vo.getCardNo(), aesKey); } catch (Exception e) { 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)) { // populationDO.setHouseId(vo.getHouseId()); // }else{ // populationDO.setHouseId(null); // } // this.baseMapper.insert(populationDO); comElderAuthElderliesDO.setId(Snowflake.getId()); comElderAuthElderliesDO.setCommunityId(comActDO.getCommunityId()); comElderAuthElderliesDO.setStreetId(comActDO.getStreetId()); comElderAuthElderliesDO.setIdCard(cardNoAES); comElderAuthElderliesDO.setAddress(vo.getNowAddress()); if (StringUtils.isNotEmpty(vo.getBirthday())) { int age = AgeUtils.getAgeFromBirthTimes(vo.getBirthday()); if (age >= 80 && age < 90) { comElderAuthElderliesDO.setPersonnelCategory(ComElderAuthElderliesDO.personnelCategory.under90); }else if (age >= 90 && age < 100){ comElderAuthElderliesDO.setPersonnelCategory(ComElderAuthElderliesDO.personnelCategory.under100); }else if (age >= 100){ comElderAuthElderliesDO.setPersonnelCategory(ComElderAuthElderliesDO.personnelCategory.above100); } } comElderAuthElderliesDAO.insert(comElderAuthElderliesDO); return populationDO; } private ComMngPopulationDO savePensionPopulationDO(ComMngPopulationPensionExcelVO vo, ComPopulationActVO comActDO, ComMngVillageDO comMngVillageDO, Long userId) { ComMngPopulationDO populationDO = new ComMngPopulationDO(); ComPensionAuthPensionerDO comPensionAuthPensionerDO = new ComPensionAuthPensionerDO(); BeanUtils.copyProperties(vo, populationDO); BeanUtils.copyProperties(vo, comPensionAuthPensionerDO); Long populationId = Snowflake.getId(); populationDO.setId(populationId); comPensionAuthPensionerDO.setPopulationId(populationId); // 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.setVillageName(comMngVillageDO.getGroupAt()); populationDO.setCardNoStr(vo.getCardNo()); populationDO.setUpdateAt(new Date()); String cardNoAES = populationDO.getCardNo(); try { cardNoAES = AESUtil.encrypt128(vo.getCardNo(), aesKey); } catch (Exception e) { 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)) { // populationDO.setHouseId(vo.getHouseId()); // }else{ // populationDO.setHouseId(null); // } // this.baseMapper.insert(populationDO); comPensionAuthPensionerDO.setId(Snowflake.getId()); comPensionAuthPensionerDO.setCommunityId(comActDO.getCommunityId()); comPensionAuthPensionerDO.setStreetId(comActDO.getStreetId()); comPensionAuthPensionerDO.setIdCard(cardNoAES); comPensionAuthPensionerDO.setAddress(vo.getNowAddress()); comPensionAuthPensionerDAO.insert(comPensionAuthPensionerDO); return populationDO; } private ComMngPopulationHouseDO savePopulationHouse(ComMngPopulationServeExcelVO vo, ComMngVillageDO comMngVillageDO, Long communityId, StringBuilder areaPath, String actName) { // 查询该房屋未建立,执行建立房屋信息 @@ -5241,6 +6095,92 @@ return populationHouseDO; } private ComMngPopulationHouseDO saveElderPopulationHouse(ComMngPopulationElderExcelVO vo, ComMngVillageDO comMngVillageDO, Long communityId, StringBuilder areaPath, String actName) { // 查询该房屋未建立,执行建立房屋信息 ComMngPopulationHouseDO populationHouseDO = new ComMngPopulationHouseDO(); populationHouseDO.setId(Snowflake.getId()); populationHouseDO.setStreetId(comMngVillageDO.getStreetId()); populationHouseDO.setVillageId(comMngVillageDO.getVillageId()); populationHouseDO.setAlley(vo.getRoad()); populationHouseDO.setHouseNum(vo.getDoorNo()); populationHouseDO.setStatus(vo.getIsRent()); populationHouseDO.setCommunityId(communityId); populationHouseDO.setFloor(vo.getFloor()); populationHouseDO.setUnitNo(vo.getUnitNo()); populationHouseDO.setHouseNo(vo.getHouseNo()); populationHouseDO.setCode(vo.getHouseNo()); populationHouseDO.setAddress(vo.getAddress()); populationHouseDO.setUpdateAt(new Date()); // populationHouseDO.setConstructPurpose(vo.getHousePurpose()); StringBuilder housePath = new StringBuilder(); housePath.append(populationHouseDO.getAlley()).append(">").append(actName).append(">") .append(comMngVillageDO.getName()).append(">").append(vo.getAddress()); populationHouseDO.setPath(areaPath.toString() + housePath.toString()); // try { // populationHouseDO.setConstructArea(new BigDecimal(vo.getBuildArea())); // } catch (Exception e) { // } if (StringUtils.isEmpty(vo.getName()) && StringUtils.isEmpty(vo.getCardNo())) { populationHouseDO.setIsEmpty(PopulIsOksEnum.YES.getCode()); } if (vo.getHouseStatus() != null) { populationHouseDO.setStatus(vo.getHouseStatus()); } if (vo.getHousePurpose() != null) { populationHouseDO.setPurpose(vo.getHousePurpose()); } if (vo.getControlStatus() != null) { populationHouseDO.setControlStatus(vo.getControlStatus()); } // comMngPopulationHouseDAO.insert(populationHouseDO); return populationHouseDO; } private ComMngPopulationHouseDO savePensionPopulationHouse(ComMngPopulationPensionExcelVO vo, ComMngVillageDO comMngVillageDO, Long communityId, StringBuilder areaPath, String actName) { // 查询该房屋未建立,执行建立房屋信息 ComMngPopulationHouseDO populationHouseDO = new ComMngPopulationHouseDO(); populationHouseDO.setId(Snowflake.getId()); populationHouseDO.setStreetId(comMngVillageDO.getStreetId()); populationHouseDO.setVillageId(comMngVillageDO.getVillageId()); populationHouseDO.setAlley(vo.getRoad()); populationHouseDO.setHouseNum(vo.getDoorNo()); populationHouseDO.setStatus(vo.getIsRent()); populationHouseDO.setCommunityId(communityId); populationHouseDO.setFloor(vo.getFloor()); populationHouseDO.setUnitNo(vo.getUnitNo()); populationHouseDO.setHouseNo(vo.getHouseNo()); populationHouseDO.setCode(vo.getHouseNo()); populationHouseDO.setAddress(vo.getAddress()); populationHouseDO.setUpdateAt(new Date()); // populationHouseDO.setConstructPurpose(vo.getHousePurpose()); StringBuilder housePath = new StringBuilder(); housePath.append(populationHouseDO.getAlley()).append(">").append(actName).append(">") .append(comMngVillageDO.getName()).append(">").append(vo.getAddress()); populationHouseDO.setPath(areaPath.toString() + housePath.toString()); // try { // populationHouseDO.setConstructArea(new BigDecimal(vo.getBuildArea())); // } catch (Exception e) { // } if (StringUtils.isEmpty(vo.getName()) && StringUtils.isEmpty(vo.getCardNo())) { populationHouseDO.setIsEmpty(PopulIsOksEnum.YES.getCode()); } if (vo.getHouseStatus() != null) { populationHouseDO.setStatus(vo.getHouseStatus()); } if (vo.getHousePurpose() != null) { populationHouseDO.setPurpose(vo.getHousePurpose()); } if (vo.getControlStatus() != null) { populationHouseDO.setControlStatus(vo.getControlStatus()); } // comMngPopulationHouseDAO.insert(populationHouseDO); return populationHouseDO; } private ComMngPopulationHouseUserDO savePopulationHouseUser(ComMngPopulationServeExcelVO vo, ComMngPopulationDO comMngPopulationDO, ComMngPopulationHouseDO comMngPopulationHouseDO) { // 查询该房屋未建立,执行建立房屋信息 @@ -5585,7 +6525,7 @@ } ComMngUserTagDO checkCreditCode = comMngUserTagDAO.selectOne( new QueryWrapper<ComMngUserTagDO>().lambda().eq(ComMngUserTagDO::getTagName, comMngTagVO.getTagName())); if (null != checkCreditCode && comMngUserTagDO.getId() != checkCreditCode.getId()) { if (null != checkCreditCode && !comMngUserTagDO.getId().equals(checkCreditCode.getId())) { return R.fail("该标签已存在,标签名称重复"); } @@ -5597,8 +6537,7 @@ } else { // 新增 Integer count = comMngUserTagDAO.selectCount( new QueryWrapper<ComMngUserTagDO>().lambda().eq(ComMngUserTagDO::getTagName, comMngTagVO.getTagName()) .eq(ComMngUserTagDO::getCommunityId, comMngTagVO.getCommunityId())); new QueryWrapper<ComMngUserTagDO>().lambda().eq(ComMngUserTagDO::getTagName, comMngTagVO.getTagName())); if (count > 0) { return R.fail("该标签已存在,标签名称重复"); } @@ -6817,6 +7756,40 @@ // mvo.setDeath(PopulOutOrLocalEnum.getCnDescByName(vo.getDeath())); } private void setElderMistake(ComMngPopulationElderMistakeExcelVO mvo, ComMngPopulationElderExcelVO vo) { mvo.setPoliticalOutlook(PopulPoliticalOutlookEnum.getCnDescByName(vo.getPoliticalOutlook())); mvo.setIsRent(PopulHouseUseEnum.getCnDescByName(vo.getIsRent())); mvo.setHouseStatus(PopulHouseStatusEnum.getCnDescByName(vo.getHouseStatus())); mvo.setHousePurpose(PopulHousePurposeEnum.getCnDescByName(vo.getHousePurpose())); mvo.setControlStatus(PopulHouseControlStatusEnum.getCnDescByName(vo.getControlStatus())); mvo.setCultureLevel(PopulCultureLevelEnum.getCnDescByName(vo.getCultureLevel())); mvo.setMarriage(PopulMarriageEnum.getCnDescByName(vo.getMarriage())); mvo.setOutOrLocal(PopulOutOrLocalEnum.getCnDescByName(vo.getOutOrLocal())); mvo.setIsRegister(PopulHouseUseEnum.getCnDescByName(vo.getIsRegister())); mvo.setIsAlive(PopulHouseUseEnum.getCnDescByName(vo.getIsAlive())); // mvo.setResidence(PopulRelationEnum.getCnDescByName(vo.getResidence())); // mvo.setPersonType(PopulPersonTypeEnum.getCnDescByName(vo.getPersonType())); // mvo.setDeath(PopulOutOrLocalEnum.getCnDescByName(vo.getDeath())); } private void setPensionMistake(ComMngPopulationPensionMistakeExcelVO mvo, ComMngPopulationPensionExcelVO vo) { mvo.setPoliticalOutlook(PopulPoliticalOutlookEnum.getCnDescByName(vo.getPoliticalOutlook())); mvo.setIsRent(PopulHouseUseEnum.getCnDescByName(vo.getIsRent())); mvo.setHouseStatus(PopulHouseStatusEnum.getCnDescByName(vo.getHouseStatus())); mvo.setHousePurpose(PopulHousePurposeEnum.getCnDescByName(vo.getHousePurpose())); mvo.setControlStatus(PopulHouseControlStatusEnum.getCnDescByName(vo.getControlStatus())); mvo.setCultureLevel(PopulCultureLevelEnum.getCnDescByName(vo.getCultureLevel())); mvo.setMarriage(PopulMarriageEnum.getCnDescByName(vo.getMarriage())); mvo.setOutOrLocal(PopulOutOrLocalEnum.getCnDescByName(vo.getOutOrLocal())); mvo.setIsRegister(PopulHouseUseEnum.getCnDescByName(vo.getIsRegister())); mvo.setIsAlive(PopulHouseUseEnum.getCnDescByName(vo.getIsAlive())); // mvo.setResidence(PopulRelationEnum.getCnDescByName(vo.getResidence())); // mvo.setPersonType(PopulPersonTypeEnum.getCnDescByName(vo.getPersonType())); // mvo.setDeath(PopulOutOrLocalEnum.getCnDescByName(vo.getDeath())); } /** * 判重方法 * springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/resources/mapper/ComElderAuthRecordsMapper.xml
@@ -25,4 +25,137 @@ id, elderlies_id, auth_period, submit_user_id, auth_video, approver, approval_status, approval_date, mark, reject_reason, auth_status, auth_date, create_at, update_at </sql> <select id="pageElderAuthRecords" resultType="com.panzhihua.common.model.vos.community.ComElderAuthRecordVO"> SELECT su.`name` submitUserName, ceae.phone, ceae.`name`, ceae.id_card, ceae.sex, ceae.birthday, ceae.personnel_category, ceae.address, ceae.is_alive, cear.auth_period, cear.auth_date, cear.mark, cear.approval_status, cear.auth_status FROM com_elder_auth_records cear LEFT JOIN com_elder_auth_elderlies ceae ON cear.elderlies_id = ceae.id LEFT JOIN sys_user su ON cear.submit_user_id = su.user_id WHERE ceae.community_id = #{pageElderAuthRecordsDTO.communityId} <if test="pageElderAuthRecordsDTO.authPeriod != null and pageElderAuthRecordsDTO.authPeriod !=''"> and cear.auth_period = #{pageElderAuthRecordsDTO.authPeriod} </if> <if test="pageElderAuthRecordsDTO.authDateBegin != null and pageElderAuthRecordsDTO.authDateBegin != ''"> and cear.auth_date after #{pageElderAuthRecordsDTO.authDateBegin} </if> <if test="pageElderAuthRecordsDTO.authDateEnd != null and pageElderAuthRecordsDTO.authDateEnd != ''"> and cear.auth_date before #{pageElderAuthRecordsDTO.authDateEnd} </if> <if test="pageElderAuthRecordsDTO.approvalStatus != null"> and cear.approval_status = #{pageElderAuthRecordsDTO.approvalStatus} </if> <if test="pageElderAuthRecordsDTO.authStatus != null"> and cear.auth_status = #{pageElderAuthRecordsDTO.authStatus} </if> <if test="pageElderAuthRecordsDTO.personnelCategory != null"> and ceae.personnel_category = #{pageElderAuthRecordsDTO.personnelCategory} </if> <if test="pageElderAuthRecordsDTO.isAlive != null"> and ceae.is_alive = #{pageElderAuthRecordsDTO.isAlive} </if> <if test="pageElderAuthRecordsDTO.searchKey != null and pageElderAuthRecordsDTO.searchKey != ''"> and (ceae.`name` like concat ('%', #{pageElderAuthRecordsDTO.searchKey}, '%') or cear.mark like concat ('%', #{pageElderAuthRecordsDTO.searchKey}, '%')) </if> order by cear.create_at desc </select> <select id="detailElderAuthRecords" resultType="com.panzhihua.common.model.vos.community.ComElderAuthRecordVO"> SELECT su.`name` submitUserName, ceae.phone, ceae.`name`, ceae.id_card, ceae.sex, ceae.birthday, ceae.personnel_category, ceae.address, ceae.is_alive, cear.auth_period, cear.auth_date, cear.mark, cear.auth_video, cear.approval_status, su1.`name` as approverName, cear.approval_date FROM com_elder_auth_records cear LEFT JOIN com_elder_auth_elderlies ceae ON cear.elderlies_id = ceae.id LEFT JOIN sys_user su ON cear.submit_user_id = su.user_id LEFT JOIN sys_user su1 ON cear.approver_id = su1.user_id WHERE cear.id = #{authRecordId} </select> <select id="getElderAuthRecordsByIds" resultType="com.panzhihua.common.model.vos.community.ComElderAuthRecordExcleVO"> SELECT su.`name` submitUserName, ceae.phone, ceae.`name`, ceae.id_card, CASE ceae.sex WHEN 1 THEN '男' WHEN 2 THEN '女' WHEN 3 THEN '其他' END sex, ceae.birthday, CASE ceae.personnel_category WHEN 1 THEN '80-89周岁' WHEN 2 THEN '90-99周岁' WHEN 3 THEN '100周岁(含)以上' END personnelCategory, ceae.address, CASE ceae.isAlive WHEN 1 THEN '是' WHEN 0 THEN '否' END is_alive, cear.auth_period, cear.auth_date, cear.mark, CASE cear.approval_status WHEN 1 THEN '待审核' WHEN 2 THEN '驳回' WHEN 3 THEN '通过' END approvalStatus FROM com_elder_auth_records cear LEFT JOIN com_elder_auth_elderlies ceae ON cear.elderlies_id = ceae.id LEFT JOIN sys_user su ON cear.submit_user_id = su.user_id WHERE cear.id in <foreach collection="ids" item="id" open="(" separator="," close=")" > #{id} </foreach> order by cear.create_at desc </select> </mapper>