| | |
| | | import org.springblade.modules.system.service.IDictBizService; |
| | | import org.springblade.modules.system.service.IRegionService; |
| | | import org.springblade.modules.system.service.IUserService; |
| | | import org.springblade.modules.task.vo.TaskLabelReportingEventVO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | @Override |
| | | public IPage<PlaceVO> selectPlacePage(IPage<PlaceVO> page, PlaceVO place) { |
| | | // 公共参数设置 |
| | | CommonParamSet commonParamSet = new CommonParamSet().invoke(PlaceVO.class,place); |
| | | CommonParamSet commonParamSet = new CommonParamSet().invoke(PlaceVO.class, place); |
| | | List<PlaceVO> placeVOS = baseMapper.selectPlacePage(page, |
| | | place, |
| | | commonParamSet.getGridCodeList(), |
| | |
| | | |
| | | /** |
| | | * 设置场所的source 来源 |
| | | * |
| | | * @param placeVO |
| | | */ |
| | | public void setSource(PlaceVO placeVO) { |
| | | if (null!=placeVO.getSource()){ |
| | | if (null != placeVO.getSource()) { |
| | | placeVO.setSource(placeVO.getSource()); |
| | | }else { |
| | | } else { |
| | | // 查询该houseCode 是否存在地址总表,如果是,赋值 1,否则2 |
| | | QueryWrapper<DoorplateAddressEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("address_code",placeVO.getHouseCode()); |
| | | wrapper.eq("address_code", placeVO.getHouseCode()); |
| | | DoorplateAddressEntity one = doorplateAddressService.getOne(wrapper); |
| | | if (null!=one){ |
| | | if (null != one) { |
| | | placeVO.setSource(1); |
| | | }else { |
| | | } else { |
| | | placeVO.setSource(2); |
| | | } |
| | | } |
| | |
| | | |
| | | /** |
| | | * 处理对应的绑定房屋数据 |
| | | * |
| | | * @param list |
| | | */ |
| | | public void handlePlaceOne(List<String> list,PlaceVO place) { |
| | | public void handlePlaceOne(List<String> list, PlaceVO place) { |
| | | // 处理对应的绑定房屋数据 |
| | | List<Long> longs = new ArrayList<>(); |
| | | // 把其他单个的场所数据删除 |
| | |
| | | */ |
| | | @Override |
| | | public IPage<PlaceVO> selectNinePlacePage(IPage<PlaceVO> page, PlaceVO place) { |
| | | String roleName = SpringUtils.getRequestParam("roleName"); |
| | | String communityCode = SpringUtils.getRequestParam("communityCode"); |
| | | if (!Strings.isBlank(communityCode)){ |
| | | // 校验社区编号是否合规 |
| | | if(null!=SpringUtils.getBean(IRegionService.class).getById(communityCode)) { |
| | | place.setCommunityCode(communityCode); |
| | | } |
| | | } |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator()==true?1:2; |
| | | // 网格编号集合 |
| | | List<String> gridCodeList = new ArrayList<>(); |
| | | // 民警角色 |
| | | if (!Strings.isBlank(roleName)){ |
| | | place.setRoleName(roleName); |
| | | if(roleName.equals("mj")) { |
| | | regionChildCodesList = SpringUtil.getBean(IPoliceAffairsGridService.class).getCommunityCodeListByUserId(AuthUtil.getUserId()); |
| | | } |
| | | if (roleName.equals("wgy")) { |
| | | gridCodeList = SpringUtil.getBean(IGridService.class).getGridListByUserId(AuthUtil.getUserId()); |
| | | } |
| | | } |
| | | // String roleName = SpringUtils.getRequestParam("roleName"); |
| | | // String communityCode = SpringUtils.getRequestParam("communityCode"); |
| | | // if (!Strings.isBlank(communityCode)){ |
| | | // // 校验社区编号是否合规 |
| | | // if(null!=SpringUtils.getBean(IRegionService.class).getById(communityCode)) { |
| | | // place.setCommunityCode(communityCode); |
| | | // } |
| | | // } |
| | | // List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | // Integer isAdministrator = AuthUtil.isAdministrator()==true?1:2; |
| | | // // 网格编号集合 |
| | | // List<String> gridCodeList = new ArrayList<>(); |
| | | // // 民警角色 |
| | | // if (!Strings.isBlank(roleName)){ |
| | | // place.setRoleName(roleName); |
| | | // if(roleName.equals("mj")) { |
| | | // regionChildCodesList = SpringUtil.getBean(IPoliceAffairsGridService.class).getCommunityCodeListByUserId(AuthUtil.getUserId()); |
| | | // } |
| | | // if (roleName.equals("wgy")) { |
| | | // gridCodeList = SpringUtil.getBean(IGridService.class).getGridListByUserId(AuthUtil.getUserId()); |
| | | // } |
| | | // } |
| | | CommonParamSet commonParamSet = new CommonParamSet().invoke(PlaceVO.class, place); |
| | | |
| | | List<String> strings = new ArrayList<>(); |
| | | if (null!=place.getNineType()){ |
| | | if (null != place.getNineType()) { |
| | | QueryWrapper<DictBiz> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("is_deleted",0).eq("dict_key",place.getNineType()).eq("code","nineType"); |
| | | queryWrapper.eq("is_deleted", 0).eq("dict_key", place.getNineType()).eq("code", "nineType"); |
| | | // 先查询当前 |
| | | DictBiz one = dictBizService.getOne(queryWrapper); |
| | | // 查询本身和子集的key |
| | | List<DictBiz> list = dictBizService.getList("nineType", one.getId()); |
| | | if (list.size()==0){ |
| | | if (list.size() == 0) { |
| | | strings.add(place.getNineType().toString()); |
| | | }else { |
| | | } else { |
| | | strings = list.stream().map(DictBiz::getDictKey).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | List<PlaceVO> placeVOS = baseMapper.selectNinePlacePage(page, place, gridCodeList, regionChildCodesList, isAdministrator,strings); |
| | | List<PlaceVO> placeVOS = baseMapper.selectNinePlacePage(page, place, commonParamSet.getGridCodeList(), |
| | | commonParamSet.getRegionChildCodesList(), commonParamSet.getIsAdministrator(), strings); |
| | | // 返回 |
| | | return page.setRecords(placeVOS); |
| | | } |
| | |
| | | public List<NinePlaceExcel> export(PlaceVO place) { |
| | | String roleName = SpringUtils.getRequestParam("roleName"); |
| | | String communityCode = SpringUtils.getRequestParam("communityCode"); |
| | | if (!Strings.isBlank(communityCode)){ |
| | | if (!Strings.isBlank(communityCode)) { |
| | | // 校验社区编号是否合规 |
| | | if(null!=SpringUtils.getBean(IRegionService.class).getById(communityCode)) { |
| | | if (null != SpringUtils.getBean(IRegionService.class).getById(communityCode)) { |
| | | place.setCommunityCode(communityCode); |
| | | } |
| | | } |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator()==true?1:2; |
| | | Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2; |
| | | // 网格编号集合 |
| | | List<String> gridCodeList = new ArrayList<>(); |
| | | // 民警角色 |
| | | if (!Strings.isBlank(roleName)){ |
| | | if (!Strings.isBlank(roleName)) { |
| | | place.setRoleName(roleName); |
| | | if(roleName.equals("mj")) { |
| | | if (roleName.equals("mj")) { |
| | | regionChildCodesList = SpringUtil.getBean(IPoliceAffairsGridService.class).getCommunityCodeListByUserId(AuthUtil.getUserId()); |
| | | } |
| | | if (roleName.equals("wgy")) { |
| | |
| | | } |
| | | } |
| | | List<String> strings = new ArrayList<>(); |
| | | if (null!=place.getNineType()){ |
| | | if (null != place.getNineType()) { |
| | | QueryWrapper<DictBiz> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("is_deleted",0).eq("dict_key",place.getNineType()).eq("code","nineType"); |
| | | queryWrapper.eq("is_deleted", 0).eq("dict_key", place.getNineType()).eq("code", "nineType"); |
| | | // 先查询当前 |
| | | DictBiz one = dictBizService.getOne(queryWrapper); |
| | | // 查询本身和子集的key |
| | | List<DictBiz> list = dictBizService.getList("nineType", one.getId()); |
| | | if (list.size()==0){ |
| | | if (list.size() == 0) { |
| | | strings.add(place.getNineType().toString()); |
| | | }else { |
| | | } else { |
| | | strings = list.stream().map(DictBiz::getDictKey).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | List<NinePlaceExcel> aa = baseMapper.export(place, gridCodeList, regionChildCodesList, isAdministrator,strings); |
| | | List<NinePlaceExcel> aa = baseMapper.export(place, gridCodeList, regionChildCodesList, isAdministrator, strings); |
| | | IDictBizService bean = SpringUtils.getBean(IDictBizService.class); |
| | | List<DictBiz> nineType = bean.list(Wrappers.<DictBiz>lambdaQuery().eq(DictBiz::getCode, "nineType").eq(DictBiz::getIsDeleted, 0)); |
| | | for (NinePlaceExcel ninePlaceExcel : aa) { |
| | |
| | | updateById(placeEntity); |
| | | // 查询绑定关系是否已存在 |
| | | QueryWrapper<PlaceDoorEntity> wrapper = new QueryWrapper<>(); |
| | | wrapper.eq("house_code",placeEntity.getHouseCode()).eq("place_id",placeEntity.getId()); |
| | | wrapper.eq("house_code", placeEntity.getHouseCode()).eq("place_id", placeEntity.getId()); |
| | | // 查询 |
| | | PlaceDoorEntity one = placeDoorService.getOne(wrapper); |
| | | if (null==one){ |
| | | if (null == one) { |
| | | // 新增 |
| | | PlaceDoorEntity placeDoorEntity = new PlaceDoorEntity(); |
| | | placeDoorEntity.setPlaceId(placeEntity.getId()); |