| | |
| | | @Override |
| | | public List<NinePlaceExcel> export(PlaceVO place) { |
| | | place.setIsNine(1); |
| | | // todo |
| | | List<String> regionChildCodesList = new ArrayList<>();//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()); |
| | | 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<NinePlaceExcel> aa = baseMapper.export(place, list, regionChildCodesList, isAdministrator); |
| | | 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()); |
| | | } |
| | | } |
| | | List<String> strings = new ArrayList<>(); |
| | | if (null!=place.getNineType()){ |
| | | QueryWrapper<DictBiz> queryWrapper = new QueryWrapper<>(); |
| | | 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){ |
| | | strings.add(place.getNineType().toString()); |
| | | }else { |
| | | strings = list.stream().map(DictBiz::getDictKey).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | 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) { |