| | |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.springblade.common.cache.SysCache; |
| | | import org.springblade.common.param.CommonParamSet; |
| | | import org.springblade.common.utils.IdUtils; |
| | | import org.springblade.common.utils.NodeTreeUtil; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | | import org.springblade.core.tool.utils.BeanUtil; |
| | | import org.springblade.modules.grid.entity.GridEntity; |
| | | import org.springblade.modules.grid.entity.GridRangeEntity; |
| | | import org.springblade.modules.grid.service.IGridRangeService; |
| | | import org.springblade.modules.grid.service.IGridService; |
| | |
| | | import org.springblade.modules.house.vo.HouseVO; |
| | | import org.springblade.modules.label.entity.LabelEntity; |
| | | import org.springblade.modules.label.service.ILabelService; |
| | | import org.springblade.modules.label.vo.LabelVO; |
| | | import org.springblade.modules.police.entity.PoliceAffairsGridEntity; |
| | | import org.springblade.modules.police.service.IPoliceAffairsGridService; |
| | | import org.springblade.modules.system.entity.Region; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.service.IRegionService; |
| | |
| | | |
| | | @Override |
| | | public IPage<HouseVO> selectHousePage(IPage<HouseVO> page, HouseVO house) { |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2; |
| | | List<HouseVO> houseVOS = baseMapper.selectHousePage(page, house, regionChildCodesList, isAdministrator); |
| | | // List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | // Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2; |
| | | CommonParamSet commonParamSet = new CommonParamSet().invoke(HouseVO.class,house); |
| | | |
| | | List<HouseVO> houseVOS = baseMapper.selectHousePage(page, house, |
| | | commonParamSet.getRegionChildCodesList(),commonParamSet.getGridCodeList(), commonParamSet.getIsAdministrator() |
| | | ); |
| | | return page.setRecords(houseVOS); |
| | | } |
| | | |
| | |
| | | if (!Strings.isBlank(houseAndHoldExcel.getPartyEmber())) { |
| | | householdEntity.setPartyEmber(Integer.parseInt(houseAndHoldExcel.getPartyEmber())); |
| | | } |
| | | householdEntity.setHkmtPass(houseAndHoldExcel.getHkmtPass()); |
| | | householdEntity.setPassport(houseAndHoldExcel.getPassport()); |
| | | // householdEntity.setHkmtPass(houseAndHoldExcel.getHkmtPass()); |
| | | // householdEntity.setPassport(houseAndHoldExcel.getPassport()); |
| | | // 民族 |
| | | if (!Strings.isBlank(houseAndHoldExcel.getEthnicity())) { |
| | | householdEntity.setEthnicity(Integer.parseInt(houseAndHoldExcel.getEthnicity())); |
| | |
| | | if (!Strings.isBlank(houseAndHoldExcel.getPartyEmber())) { |
| | | one.setPartyEmber(Integer.parseInt(houseAndHoldExcel.getPartyEmber())); |
| | | } |
| | | one.setHkmtPass(houseAndHoldExcel.getHkmtPass()); |
| | | one.setPassport(houseAndHoldExcel.getPassport()); |
| | | // one.setHkmtPass(houseAndHoldExcel.getHkmtPass()); |
| | | // one.setPassport(houseAndHoldExcel.getPassport()); |
| | | // 民族 |
| | | if (!Strings.isBlank(houseAndHoldExcel.getEthnicity())) { |
| | | one.setEthnicity(Integer.parseInt(houseAndHoldExcel.getEthnicity())); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> labelStatistics(HouseVO house) { |
| | | public List<Map<String, Object>> labelStatistics(HouseVO house) { |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2; |
| | | return baseMapper.labelStatistics(house,regionChildCodesList,isAdministrator); |
| | | return baseMapper.labelStatistics(house, regionChildCodesList, isAdministrator); |
| | | } |
| | | |
| | | @Override |
| | | public List<Map<String, Object>> labelCommunityStatistics(HouseVO house) { |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2; |
| | | return baseMapper.labelCommunityStatistics(house,regionChildCodesList,isAdministrator); |
| | | List<Map<String, Object>> list = baseMapper.labelCommunityStatistics(house, regionChildCodesList); |
| | | for (Map<String, Object> map : list) { |
| | | List<LabelVO> code = baseMapper.getlabelCount(house, regionChildCodesList, isAdministrator, map.get("code").toString()); |
| | | map.put("child",code); |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | /** |
| | | * 房屋网格处理 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Object houseGridHandle() { |
| | | // 查询未处理的数据 |
| | | List<HouseEntity> houseEntityList = baseMapper.getNotBindGridOrJwGridList(1); |
| | | // 遍历 |
| | | for (HouseEntity houseEntity : houseEntityList) { |
| | | String point = "'POINT(" + houseEntity.getLng() + " " + houseEntity.getLat() + ")'"; |
| | | List<GridEntity> gridEntityList = SpringUtils.getBean(IGridService.class).spatialAnalysis(point); |
| | | if (gridEntityList.size()>0){ |
| | | houseEntity.setGridCode(gridEntityList.get(0).getGridCode()); |
| | | houseEntity.setGridId(gridEntityList.get(0).getId()); |
| | | // 更新 |
| | | updateById(houseEntity); |
| | | } |
| | | } |
| | | |
| | | return null; |
| | | } |
| | | |
| | | /** |
| | | * 房屋警格处理 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public Object houseJwGridHandle() { |
| | | // 查询未处理的数据 |
| | | List<HouseEntity> houseEntityList = baseMapper.getNotBindGridOrJwGridList(2); |
| | | // 遍历 |
| | | for (HouseEntity houseEntity : houseEntityList) { |
| | | String point = "'POINT(" + houseEntity.getLng() + " " + houseEntity.getLat() + ")'"; |
| | | List<PoliceAffairsGridEntity> policeAffairsGridEntityList = SpringUtils.getBean(IPoliceAffairsGridService.class).spatialAnalysis(point); |
| | | if (policeAffairsGridEntityList.size()>0){ |
| | | houseEntity.setJwGridCode(policeAffairsGridEntityList.get(0).getJwGridCode()); |
| | | // 更新 |
| | | updateById(houseEntity); |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | } |