| | |
| | | import liquibase.repackaged.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.AuthUtils; |
| | | import org.springblade.common.utils.SpringUtils; |
| | | import org.springblade.core.secure.utils.AuthUtil; |
| | |
| | | */ |
| | | @Override |
| | | public IPage<TaskPlaceRectificationVO> selectTaskPlaceRectificationList(IPage<TaskPlaceRectificationVO> page, TaskPlaceRectificationDTO taskPlaceRectificationDTO) { |
| | | // 数据过滤 todo |
| | | String roleName = SpringUtils.getRequestParam("roleName"); |
| | | String communityCode = SpringUtils.getRequestParam("communityCode"); |
| | | if (!Strings.isBlank(communityCode)){ |
| | | // 校验社区编号是否合规 |
| | | if(null!=SpringUtils.getBean(IRegionService.class).getById(communityCode)) { |
| | | taskPlaceRectificationDTO.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)){ |
| | | taskPlaceRectificationDTO.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(TaskPlaceRectificationDTO.class, taskPlaceRectificationDTO); |
| | | List<String> strings = new ArrayList<>(); |
| | | if (null!=taskPlaceRectificationDTO.getNineType()){ |
| | | if (null != taskPlaceRectificationDTO.getNineType()) { |
| | | QueryWrapper<DictBiz> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("is_deleted",0).eq("dict_key",taskPlaceRectificationDTO.getNineType()).eq("code","nineType"); |
| | | queryWrapper.eq("is_deleted", 0).eq("dict_key", taskPlaceRectificationDTO.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(taskPlaceRectificationDTO.getNineType()); |
| | | }else { |
| | | } else { |
| | | strings = list.stream().map(DictBiz::getDictKey).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | List<TaskPlaceRectificationVO> taskPlaceRectificationVOS = baseMapper.selectTaskPlaceRectificationList(page, |
| | | taskPlaceRectificationDTO, |
| | | regionChildCodesList, |
| | | isAdministrator, |
| | | gridCodeList, |
| | | commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getIsAdministrator(), |
| | | commonParamSet.getGridCodeList(), |
| | | strings); |
| | | for (TaskPlaceRectificationVO taskPlaceRectificationVO : taskPlaceRectificationVOS) { |
| | | StringBuilder builder = new StringBuilder(""); |
| | |
| | | |
| | | @Override |
| | | public List<TaskPlaceRectificationExcel> export(TaskPlaceRectificationsVO taskPlaceRectificationVO) { |
| | | // 数据过滤 todo |
| | | String roleName = SpringUtils.getRequestParam("roleName"); |
| | | String communityCode = SpringUtils.getRequestParam("communityCode"); |
| | | if (!Strings.isBlank(communityCode)){ |
| | | // 校验社区编号是否合规 |
| | | if(null!=SpringUtils.getBean(IRegionService.class).getById(communityCode)) { |
| | | taskPlaceRectificationVO.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)){ |
| | | taskPlaceRectificationVO.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(TaskPlaceRectificationsVO.class, taskPlaceRectificationVO); |
| | | List<String> strings = new ArrayList<>(); |
| | | if (null!=taskPlaceRectificationVO.getNineType()){ |
| | | if (null != taskPlaceRectificationVO.getNineType()) { |
| | | QueryWrapper<DictBiz> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("is_deleted",0).eq("dict_key",taskPlaceRectificationVO.getNineType()).eq("code","nineType"); |
| | | queryWrapper.eq("is_deleted", 0).eq("dict_key", taskPlaceRectificationVO.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(taskPlaceRectificationVO.getNineType()); |
| | | }else { |
| | | } else { |
| | | strings = list.stream().map(DictBiz::getDictKey).collect(Collectors.toList()); |
| | | } |
| | | } |
| | | List<TaskPlaceRectificationExcel> export = baseMapper.export( |
| | | taskPlaceRectificationVO, |
| | | regionChildCodesList, |
| | | isAdministrator, |
| | | gridCodeList, |
| | | commonParamSet.getRegionChildCodesList(), |
| | | commonParamSet.getIsAdministrator(), |
| | | commonParamSet.getGridCodeList(), |
| | | strings); |
| | | IDictBizService bean = SpringUtils.getBean(IDictBizService.class); |
| | | List<DictBiz> nineType = bean.list(Wrappers.<DictBiz>lambdaQuery().eq(DictBiz::getCode, "nineType").eq(DictBiz::getIsDeleted, 0)); |
| | |
| | | // 获取请求头中的角色别名 |
| | | String roleName = SpringUtils.getRequestParam("roleName"); |
| | | if (AuthUtils.isMj(roleName)) { |
| | | return baseMapper.getCount(neiCode, i, AuthUtil.getUserId()); |
| | | // 民警角色 |
| | | List<String> regionChildCodesList = SpringUtil.getBean(IPoliceAffairsGridService.class) |
| | | .getCommunityCodeListByUserId(AuthUtil.getUserId()); |
| | | TaskPlaceRectificationDTO taskPlaceRectificationDTO = new TaskPlaceRectificationDTO(); |
| | | taskPlaceRectificationDTO.setCommunityCode(neiCode); |
| | | taskPlaceRectificationDTO.setStatus(i); |
| | | taskPlaceRectificationDTO.setRoleName(roleName); |
| | | return baseMapper.getCount(taskPlaceRectificationDTO, regionChildCodesList, 2); |
| | | } |
| | | return 0; |
| | | } |