From 486fa904456eefeb096885d3caf63c85f821152d Mon Sep 17 00:00:00 2001 From: DESKTOP-71BH0QO\L、ming <172680469@qq.com> Date: 星期三, 31 三月 2021 11:18:51 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java | 49 ++++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 48 insertions(+), 1 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java index 411e239..b640208 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java @@ -27,6 +27,7 @@ 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; @@ -249,6 +250,38 @@ if (comMngVillageDO == null) { throw new ServiceException("街道巷:" + vo.getRoad() + "不存在!"); } + //性别判断 + 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.setActId(comMngVillageDO.getVillageId()); comMngPopulationDO.setActId(comActDO.getCommunityId()); comMngPopulationDO.setStreetId(comActDO.getStreetId()); @@ -256,7 +289,7 @@ comMngPopulationDO.setVillageName(comMngVillageDO.getGroupAt()); populationDOList.add(comMngPopulationDO); }); - //this.saveBatch(populationDOList); + this.saveBatch(populationDOList); return R.ok("共计导入实有人口数量:" + populationDOList.size()); } @@ -289,4 +322,18 @@ } 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(); + } } -- Gitblit v1.7.1