| | |
| | | R<List<BcDictionaryVO>> dictionaryR = communityService.listDictionaryByKey(BcDictionaryConstants.FAMILY); |
| | | log.info("开始导入人口数据"); |
| | | log.info("表格总数据:" + list.size()); |
| | | if (list.size() == 0) { |
| | | throw new ServiceException("000", "导入数据为空!"); |
| | | } |
| | | ValueOperations<String, String> valueOperations = stringRedisTemplate.opsForValue(); |
| | | String key = Constants.POPULATION_ERROR_LIST + communityId; |
| | | String key = Constants.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 { |
| | |
| | | continue; |
| | | } |
| | | vo.setDoorNo(oneData.get(7).trim()); |
| | | if(StringUtils.isEmpty(oneData.get(8))){ |
| | | // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | // importErrorVO.setErrorPosition("第" + index + "行,第9列"); |
| | | // importErrorVO.setErrorMsg("楼排号不可为空"); |
| | | // populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | ComMngPopulationMistakeExcelVO mistake = new ComMngPopulationMistakeExcelVO(); |
| | | setMistake(oneData, mistake); |
| | | mistake.setMistake("楼排号不可为空"); |
| | | mistakes.add(mistake); |
| | | continue; |
| | | // if(StringUtils.isEmpty(oneData.get(8))){ |
| | | //// ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | //// importErrorVO.setErrorPosition("第" + index + "行,第9列"); |
| | | //// importErrorVO.setErrorMsg("楼排号不可为空"); |
| | | //// populationImportErrorVOList.add(importErrorVO); |
| | | // index++; |
| | | // ComMngPopulationMistakeExcelVO mistake = new ComMngPopulationMistakeExcelVO(); |
| | | // setMistake(oneData, mistake); |
| | | // mistake.setMistake("楼排号不可为空"); |
| | | // mistakes.add(mistake); |
| | | // continue; |
| | | // } |
| | | if(StringUtils.isNotEmpty(oneData.get(8))) { |
| | | vo.setFloor(oneData.get(8).trim()); |
| | | } |
| | | vo.setFloor(oneData.get(8).trim()); |
| | | if(StringUtils.isEmpty(oneData.get(9))){ |
| | | // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | // importErrorVO.setErrorPosition("第" + index + "行,第10列"); |
| | | // importErrorVO.setErrorMsg("单元号不可为空"); |
| | | // populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | ComMngPopulationMistakeExcelVO mistake = new ComMngPopulationMistakeExcelVO(); |
| | | setMistake(oneData, mistake); |
| | | mistake.setMistake("单元号不可为空"); |
| | | mistakes.add(mistake); |
| | | continue; |
| | | // if(StringUtils.isEmpty(oneData.get(9))){ |
| | | //// ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | //// importErrorVO.setErrorPosition("第" + index + "行,第10列"); |
| | | //// importErrorVO.setErrorMsg("单元号不可为空"); |
| | | //// populationImportErrorVOList.add(importErrorVO); |
| | | // index++; |
| | | // ComMngPopulationMistakeExcelVO mistake = new ComMngPopulationMistakeExcelVO(); |
| | | // setMistake(oneData, mistake); |
| | | // mistake.setMistake("单元号不可为空"); |
| | | // mistakes.add(mistake); |
| | | // continue; |
| | | // } |
| | | if(StringUtils.isNotEmpty(oneData.get(9))) { |
| | | vo.setUnitNo(oneData.get(9).trim()); |
| | | } |
| | | vo.setUnitNo(oneData.get(9).trim()); |
| | | if(StringUtils.isEmpty(oneData.get(10))){ |
| | | // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | // importErrorVO.setErrorPosition("第" + index + "行,第11列"); |
| | | // importErrorVO.setErrorMsg("户室不可为空"); |
| | | // populationImportErrorVOList.add(importErrorVO); |
| | | index++; |
| | | ComMngPopulationMistakeExcelVO mistake = new ComMngPopulationMistakeExcelVO(); |
| | | setMistake(oneData, mistake); |
| | | mistake.setMistake("户室不可为空"); |
| | | mistakes.add(mistake); |
| | | continue; |
| | | // if(StringUtils.isEmpty(oneData.get(10))){ |
| | | //// ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | //// importErrorVO.setErrorPosition("第" + index + "行,第11列"); |
| | | //// importErrorVO.setErrorMsg("户室不可为空"); |
| | | //// populationImportErrorVOList.add(importErrorVO); |
| | | // index++; |
| | | // ComMngPopulationMistakeExcelVO mistake = new ComMngPopulationMistakeExcelVO(); |
| | | // setMistake(oneData, mistake); |
| | | // mistake.setMistake("户室不可为空"); |
| | | // mistakes.add(mistake); |
| | | // continue; |
| | | // } |
| | | if(StringUtils.isNotEmpty(oneData.get(10))) { |
| | | vo.setHouseNo(oneData.get(10).trim()); |
| | | } |
| | | vo.setHouseNo(oneData.get(10).trim()); |
| | | if(StringUtils.isNotEmpty(oneData.get(11))){ |
| | | vo.setBuildPurpose(oneData.get(11).trim()); |
| | | } |