| | |
| | | import org.apache.logging.log4j.util.Strings; |
| | | import org.springblade.common.cache.SysCache; |
| | | import org.springblade.common.node.TreeStringNode; |
| | | import org.springblade.common.param.CommonParamSet; |
| | | import org.springblade.common.utils.IdUtils; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.mp.support.Condition; |
| | |
| | | import org.springblade.modules.place.service.IPlaceExtService; |
| | | import org.springblade.modules.place.service.IPlacePoiLabelService; |
| | | import org.springblade.modules.place.service.IPlaceRelService; |
| | | import org.springblade.modules.place.vo.PlaceCheckVO; |
| | | import org.springblade.modules.place.vo.PlacePoiLabelVO; |
| | | import org.springblade.modules.place.vo.PlaceVO; |
| | | import org.springblade.modules.place.mapper.PlaceMapper; |
| | |
| | | */ |
| | | @Override |
| | | public IPage<PlaceVO> selectPlacePage(IPage<PlaceVO> page, PlaceVO place) { |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2; |
| | | List<String> list = new ArrayList<>(); |
| | | if (null != place.getRoleName() && !place.getRoleName().equals("")) { |
| | | if (place.getRoleName().equals("网格员")) { |
| | | // 查询对应的房屋地址code |
| | | list = gridService.getAddressCodeListByUserId(AuthUtil.getUserId()); |
| | | } |
| | | } |
| | | List<PlaceVO> placeVOS = baseMapper.selectPlacePage(page, place, list, regionChildCodesList, isAdministrator); |
| | | // 公共参数设置 |
| | | CommonParamSet commonParamSet = new CommonParamSet().invoke(PlaceVO.class,place); |
| | | List<PlaceVO> placeVOS = baseMapper.selectPlacePage(page, |
| | | place, |
| | | commonParamSet.getGridCodeList(), |
| | | commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getIsAdministrator()); |
| | | // 返回 |
| | | return page.setRecords(placeVOS); |
| | | } |
| | |
| | | placeVO.setUpdateTime(new Date()); |
| | | // 查看是否包含houseCode,如果有,则更新 |
| | | if (!Strings.isBlank(placeVO.getHouseCode())) { |
| | | setSource(placeVO); |
| | | // 比对是否1km 范围内(现场)采集 |
| | | setIsScene(placeVO); |
| | | // 更新,先查询场所信息 |
| | |
| | | // houseCodeBind(placeVO); |
| | | // 返回结果 |
| | | return flag; |
| | | } |
| | | |
| | | /** |
| | | * 设置场所的source 来源 |
| | | * @param placeVO |
| | | */ |
| | | public void setSource(PlaceVO placeVO) { |
| | | if (null!=placeVO.getSource()){ |
| | | placeVO.setSource(placeVO.getSource()); |
| | | }else { |
| | | // 查询该houseCode 是否存在地址总表,如果是,赋值 1,否则2 |
| | | QueryWrapper<DoorplateAddressEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("address_code",placeVO.getHouseCode()); |
| | | DoorplateAddressEntity one = doorplateAddressService.getOne(wrapper); |
| | | if (null!=one){ |
| | | placeVO.setSource(1); |
| | | }else { |
| | | placeVO.setSource(2); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | |
| | | && !Strings.isBlank(placeVO.getLocation()) |
| | | && !Strings.isBlank(placeVO.getPlaceName()) |
| | | && !Strings.isBlank(placeVO.getImageUrls()) |
| | | && !Strings.isBlank(placeVO.getPrincipalIdCard()) |
| | | ) { |
| | | // 已完善 |
| | | placeVO.setStatus(2); |
| | |
| | | if (null != addressEntity) { |
| | | placeVO = new PlaceVO(); |
| | | placeVO.setDoorplateAddressEntity(addressEntity); |
| | | placeVO.setLng(addressEntity.getX()); |
| | | placeVO.setLat(addressEntity.getY()); |
| | | placeVO.setLocation(addressEntity.getAddressName()); |
| | | } |
| | | } |
| | | } |