huanghongfa
2021-07-27 973caebefdd691d45108d56fc96b9aa2e5fc6fe8
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/ComMngPopulationServiceImpl.java
@@ -55,6 +55,7 @@
import com.panzhihua.service_community.service.ComMngPopulationService;
import com.panzhihua.service_community.service.ComMngVillageService;
import com.panzhihua.service_community.service.EventResourceService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@@ -71,6 +72,7 @@
/**
 * 实有人口Service实现类
 */
@Slf4j
@Service
public class ComMngPopulationServiceImpl extends ServiceImpl<ComMngPopulationDAO, ComMngPopulationDO> implements ComMngPopulationService {
    @Resource
@@ -394,7 +396,7 @@
            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.setErrorMsg("街路巷或小区号不存在,请先在“小区管理”中添加该小区");
                importErrorVO.setErrorPosition("街路巷:" + vo.getRoad() + ",小区号:" + vo.getDoorNo());
                populationImportErrorVOList.add(importErrorVO);
//                index++;
@@ -452,6 +454,7 @@
                    populationHouseUserDO.setPopulId(populationDO.getId());
                    populationHouseUserDO.setRelation(vo.getRelation());
                    populationHouseUserDO.setRelationId(vo.getIsRent());
                    populationHouseUserDO.setResidence(vo.getResidence());
                    comMngPopulationHouseUserDAO.insert(populationHouseUserDO);
                }
            }
@@ -812,6 +815,9 @@
                populationHouseUserDO.setRelation(houseEditDto.getRelation());
                if (houseEditDto.getIsResidence().equals(ComMngPopulationHouseEditDTO.isResidence.yes)) {
                    houseId = houseEditDto.getId();//居住地
                    populationHouseUserDO.setResidence(ComMngPopulationHouseEditDTO.isResidence.yes);
                }else {
                    populationHouseUserDO.setResidence(ComMngPopulationHouseEditDTO.isResidence.no);
                }
                populationHouseUserDOList.add(populationHouseUserDO);
@@ -1266,7 +1272,11 @@
            villageStatisticsList.forEach(village -> {
                CivilVillageStatisticsVO villageStatisticsVO = this.baseMapper.getCivilScreenVillageStatistics(village.getVillageId());
                if(villageStatisticsVO != null){
                    BeanUtils.copyProperties(villageStatisticsVO,village);
                    village.setPeopleNum(villageStatisticsVO.getPeopleNum());
                    village.setHouseNum(villageStatisticsVO.getHouseNum());
                    village.setRegisterNum(villageStatisticsVO.getRegisterNum());
                    village.setFlowNum(villageStatisticsVO.getFlowNum());
//                    BeanUtils.copyProperties(villageStatisticsVO,village);
                }
            });
        }
@@ -1727,6 +1737,14 @@
     */
    @Override
    public R getGridPopulationAdminList(ComMngPopulationListDTO populationListDTO){
        if(StringUtils.isNotEmpty(populationListDTO.getKeyWord())){
            try {
                populationListDTO.setCardNo(AESUtil.encrypt128(populationListDTO.getKeyWord(),aesKey));
            }catch (Exception e){
                log.error("转换身份证号码失败");
            }
        }
        IPage<ComMngPopulationListVO> populationListIPage = this.baseMapper.getGridPopulationAdminList(new Page(populationListDTO.getPageNum(),populationListDTO.getPageSize()),populationListDTO);
        if(!populationListIPage.getRecords().isEmpty()){
            populationListIPage.getRecords().forEach(population -> {