| | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R listSavePopulation(List<ComMngPopulationServeExcelVO> list, Long communityId) throws Exception { |
| | | List<ComMngPopulationMistakeExcelVO> mistakes = new ArrayList<>(); |
| | | List<ComMngPopulationImportErrorVO> populationImportErrorVOList = new ArrayList<>(); |
| | | //查询该社区 |
| | | ComActDO comActDO = comActDAO.selectById(communityId); |
| | |
| | | importErrorVO.setErrorPosition("街路巷:" + vo.getRoad() + ",小区号:" + vo.getDoorNo()); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | // index++; |
| | | ComMngPopulationMistakeExcelVO mistake = new ComMngPopulationMistakeExcelVO(); |
| | | BeanUtils.copyProperties(vo,mistake); |
| | | setMistake(mistake, vo); |
| | | mistake.setMistake("街路巷或小区号不存在,请先在“小区管理”中添加该小区:街路巷:"+ vo.getRoad() +",小区号:" + vo.getDoorNo()); |
| | | mistakes.add(mistake); |
| | | continue; |
| | | } |
| | | |
| | |
| | | this.saveBatch(populationDOList);*/ |
| | | |
| | | if (!populationImportErrorVOList.isEmpty()) { |
| | | return R.fail(JSON.toJSONString(populationImportErrorVOList)); |
| | | return R.fail(mistakes,JSON.toJSONString(populationImportErrorVOList)); |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | return R.ok(this.baseMapper.getVillagePopulationAdmin(new Page(villagePopulationDTO.getPageNum(),villagePopulationDTO.getPageSize()),villagePopulationDTO)); |
| | | } |
| | | |
| | | private void setMistake(ComMngPopulationMistakeExcelVO mvo, ComMngPopulationServeExcelVO vo){ |
| | | mvo.setPoliticalOutlook(PopulPoliticalOutlookEnum.getCnDescByName(vo.getPoliticalOutlook())); |
| | | mvo.setIsRent(PopulHouseUseEnum.getCnDescByName(vo.getIsRent())); |
| | | mvo.setRelation(PopulRelationEnum.getCnDescByName(vo.getRelation())); |
| | | 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.setResidence(PopulRelationEnum.getCnDescByName(vo.getResidence())); |
| | | mvo.setPersonType(PopulPersonTypeEnum.getCnDescByName(vo.getPersonType())); |
| | | mvo.setDeath(PopulOutOrLocalEnum.getCnDescByName(vo.getDeath())); |
| | | } |
| | | |
| | | } |