| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public R listSavePopulation(List<ComMngPopulationServeExcelVO> list, Long communityId) throws Exception { |
| | | List<ComMngPopulationMistakeExcelVO> mistakes = new ArrayList<>(); |
| | | List<ComMngPopulationImportErrorVO> populationImportErrorVOList = new ArrayList<>(); |
| | | // List<ComMngPopulationImportErrorVO> populationImportErrorVOList = new ArrayList<>(); |
| | | //查询该社区 |
| | | ComActDO comActDO = comActDAO.selectById(communityId); |
| | | //查询该社区的省市区地址 |
| | |
| | | //查询小区街路巷是否存在 |
| | | ComMngVillageDO comMngVillageDO = comActVillageDAO.selectOne(new QueryWrapper<ComMngVillageDO>().eq("alley", vo.getRoad()).eq("house_num", vo.getDoorNo()).eq("community_id", communityId)); |
| | | if (comMngVillageDO == null) { |
| | | ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | importErrorVO.setErrorMsg("街路巷或小区号不存在,请先在“小区管理”中添加该小区"); |
| | | importErrorVO.setErrorPosition("街路巷:" + vo.getRoad() + ",小区号:" + vo.getDoorNo()); |
| | | populationImportErrorVOList.add(importErrorVO); |
| | | // ComMngPopulationImportErrorVO importErrorVO = new ComMngPopulationImportErrorVO(); |
| | | // importErrorVO.setErrorMsg("街路巷或小区号不存在,请先在“小区管理”中添加该小区"); |
| | | // importErrorVO.setErrorPosition("街路巷:" + vo.getRoad() + ",小区号:" + vo.getDoorNo()); |
| | | // populationImportErrorVOList.add(importErrorVO); |
| | | // index++; |
| | | ComMngPopulationMistakeExcelVO mistake = new ComMngPopulationMistakeExcelVO(); |
| | | BeanUtils.copyProperties(vo,mistake); |
| | |
| | | ComMngPopulationDO populationDO = null; |
| | | List<ComMngPopulationDO> populationDOList = this.baseMapper.selectList(new QueryWrapper<ComMngPopulationDO>().lambda() |
| | | .eq(ComMngPopulationDO::getCardNo, cardNoAES)); |
| | | |
| | | if (populationDOList.isEmpty()) { |
| | | //不存在实有人口,则新增 |
| | | populationDO = savePopulationDO(vo, comActDO, comMngVillageDO); |
| | |
| | | } |
| | | this.saveBatch(populationDOList);*/ |
| | | |
| | | if (!populationImportErrorVOList.isEmpty()) { |
| | | return R.fail(mistakes,JSON.toJSONString(populationImportErrorVOList)); |
| | | if (!mistakes.isEmpty()) { |
| | | return R.fail(mistakes); |
| | | } |
| | | return R.ok(); |
| | | } |