| | |
| | | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.ObjectUtils; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | |
| | | if (comMngVillageDO == null) { |
| | | throw new ServiceException("街道巷:" + vo.getRoad() + "不存在!"); |
| | | } |
| | | comMngPopulationDO.setActId(comMngVillageDO.getVillageId()); |
| | | //性别判断 |
| | | if(!StringUtils.isEmpty(vo.getSex())){ |
| | | if(vo.getSex().equals(ComMngPopulationServeExcelVO.sex.nan)){ |
| | | comMngPopulationDO.setSex(ComMngPopulationDO.sex.nan); |
| | | }else if(vo.getSex().equals(ComMngPopulationServeExcelVO.sex.nv)){ |
| | | comMngPopulationDO.setSex(ComMngPopulationDO.sex.nv); |
| | | }else{ |
| | | comMngPopulationDO.setSex(ComMngPopulationDO.sex.no); |
| | | } |
| | | } |
| | | //是否租住判断 |
| | | if(!StringUtils.isEmpty(vo.getIsRent())){ |
| | | if(vo.getIsRent().equals(ComMngPopulationServeExcelVO.isOk.no)){ |
| | | comMngPopulationDO.setIsRent(ComMngPopulationDO.isOk.no); |
| | | }else{ |
| | | comMngPopulationDO.setIsRent(ComMngPopulationDO.isOk.yes); |
| | | } |
| | | } |
| | | //政治面貌判断 |
| | | if(!StringUtils.isEmpty(vo.getPoliticalOutlook())){ |
| | | if(vo.getPoliticalOutlook().equals(ComMngPopulationServeExcelVO.politicalOutlook.qun)){ |
| | | comMngPopulationDO.setPoliticalOutlook(ComMngPopulationDO.politicalOutlook.qun); |
| | | }else if(vo.getPoliticalOutlook().equals(ComMngPopulationServeExcelVO.politicalOutlook.tuan)){ |
| | | comMngPopulationDO.setPoliticalOutlook(ComMngPopulationDO.politicalOutlook.tuan); |
| | | }else if(vo.getPoliticalOutlook().equals(ComMngPopulationServeExcelVO.politicalOutlook.dang)){ |
| | | comMngPopulationDO.setPoliticalOutlook(ComMngPopulationDO.politicalOutlook.dang); |
| | | }else if(vo.getPoliticalOutlook().equals(ComMngPopulationServeExcelVO.politicalOutlook.wu)){ |
| | | comMngPopulationDO.setPoliticalOutlook(ComMngPopulationDO.politicalOutlook.wu); |
| | | }else{ |
| | | comMngPopulationDO.setPoliticalOutlook(ComMngPopulationDO.politicalOutlook.no); |
| | | } |
| | | } |
| | | comMngPopulationDO.setVillageId(comMngVillageDO.getVillageId()); |
| | | comMngPopulationDO.setActId(comActDO.getCommunityId()); |
| | | comMngPopulationDO.setStreetId(comActDO.getStreetId()); |
| | | comMngPopulationDO.setLabel(Joiner.on(",").join(vo.getUserTagStr())); |
| | | comMngPopulationDO.setVillageName(comMngVillageDO.getGroupAt()); |
| | | populationDOList.add(comMngPopulationDO); |
| | | }); |
| | | //this.saveBatch(populationDOList); |
| | | this.saveBatch(populationDOList); |
| | | return R.ok("共计导入实有人口数量:" + populationDOList.size()); |
| | | } |
| | | |
| | |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 批量删除实有人口 |
| | | * @param Ids |
| | | * @return |
| | | */ |
| | | @Override |
| | | public R deletePopulations(List<Long> Ids) { |
| | | int delete = populationDAO.deleteBatchIds(Ids); |
| | | if (delete > 0) { |
| | | return R.ok(); |
| | | } |
| | | return R.fail(); |
| | | } |
| | | } |