From 2ced4e05bc384e010836df6f3f0f13dd6a7f2d0f Mon Sep 17 00:00:00 2001 From: DESKTOP-71BH0QO\L、ming <172680469@qq.com> Date: 星期五, 02 四月 2021 09:41:36 +0800 Subject: [PATCH] fix:修改bug --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java | 51 +++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 49 insertions(+), 2 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..326f178 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,14 +250,46 @@ 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()); } @@ -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