diff --git a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java index cdec54b8..81cb72b6 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java +++ b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java @@ -19,6 +19,7 @@ import io.renren.modules.resourceBrowse.service.ResourceBrowseService; import io.renren.modules.security.user.SecurityUser; import io.renren.modules.security.user.UserDetail; import io.renren.modules.sys.dto.SysDeptDTO; +import io.renren.modules.sys.enums.SuperAdminEnum; import io.renren.modules.sys.service.SysDeptService; import io.renren.modules.sys.service.SysUserService; import io.swagger.annotations.Api; @@ -75,6 +76,8 @@ public class CensusController { @Value("${census.applyType}") private String[] censusApplyTypes; // 需要进行申请统计的资源类型 + @Value("${big_date.name}") + private String bigDataDeptName; /** * 获取各类资源数目 @@ -479,19 +482,18 @@ public class CensusController { }) public Result selectCensusResourceTable(@RequestParam Map params) { UserDetail user = SecurityUser.getUser(); - if (user.getDeptId() != null) { - SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId()); + SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId()); + //2022-11-21 修改为只有大数据局部门和admin账号能查看所有 + if (SuperAdminEnum.YES.value() != user.getSuperAdmin() && !bigDataDeptName.equals(sysDeptDTO.getName())) { + params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域 } -// else if (SuperAdminEnum.YES.value() == user.getSuperAdmin()) { // 超级管理员 -// -// } return new Result().ok(resourceService.selectCensusResourceTable(params)); } @GetMapping("/exportSelectCensusResourceTable") - @ApiOperation("查询部门上架资源及审批结果详细信息") - @LogOperation("查询部门上架资源及审批结果详细信息") + @ApiOperation("导出部门上架资源及审批结果详细信息") + @LogOperation("导出部门上架资源及审批结果详细信息") @ApiImplicitParams({ @ApiImplicitParam(name = "startDate", value = "开始时间", paramType = "query", dataType = "String"), @ApiImplicitParam(name = "endDate", value = "结束时间", paramType = "query", dataType = "String"), @@ -501,8 +503,10 @@ public class CensusController { }) public void exportSelectCensusResourceTable(@RequestParam Map params, HttpServletResponse response) throws IOException { UserDetail user = SecurityUser.getUser(); - if (user.getDeptId() != null) { - SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId()); + SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId()); + //2022-11-21 修改为只有大数据局部门和admin账号能查看所有 + if (SuperAdminEnum.YES.value() != user.getSuperAdmin() && !bigDataDeptName.equals(sysDeptDTO.getName())) { + params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域 } ArrayList resultList = (ArrayList) resourceDao.selectCensusResourceTable(params); @@ -560,13 +564,12 @@ public class CensusController { }) public Result selectCensusApplyTable(@RequestParam Map params) { UserDetail user = SecurityUser.getUser(); - if (user.getDeptId() != null) { - SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId()); + SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId()); + //2022-11-21 修改为只有大数据局部门和admin账号能查看所有 + if (SuperAdminEnum.YES.value() != user.getSuperAdmin() && !bigDataDeptName.equals(sysDeptDTO.getName())) { + params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域 } -// else if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { // 超级管理员 -// -// } return new Result().ok(resourceService.selectCensusApplyTable(params)); } @@ -582,13 +585,12 @@ public class CensusController { }) public void exportSelectCensusApplyTable(@RequestParam Map params, HttpServletResponse response) throws IOException { UserDetail user = SecurityUser.getUser(); - if (user.getDeptId() != null) { - SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId()); + SysDeptDTO sysDeptDTO = sysDeptService.get(user.getDeptId()); + //2022-11-21 修改为只有大数据局部门和admin账号能查看所有 + if (SuperAdminEnum.YES.value() != user.getSuperAdmin() && !bigDataDeptName.equals(sysDeptDTO.getName())) { params.put("region", sysDeptDTO.getDistrict()); // 管理员只出本部门区域 } -// else if (user.getSuperAdmin() == SuperAdminEnum.YES.value()) { // 超级管理员 -// -// } + ArrayList resultList = (ArrayList) resourceDao.selectCensusApplyTable(params); List> date = resultList.stream().map(index -> { List data = new ArrayList<>(); diff --git a/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java index cc017413..4a96feda 100644 --- a/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/notice/service/impl/SysNoticeServiceImpl.java @@ -271,12 +271,17 @@ public class SysNoticeServiceImpl extends CrudServiceImpl ids) { diff --git a/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/TAbilityApplicationServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/TAbilityApplicationServiceImpl.java index 39083f5c..693d1f98 100644 --- a/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/TAbilityApplicationServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/processForm/service/impl/TAbilityApplicationServiceImpl.java @@ -13,8 +13,10 @@ import io.renren.modules.security.user.UserDetail; import org.apache.commons.lang3.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; @@ -29,6 +31,8 @@ import java.util.stream.Collectors; @Service public class TAbilityApplicationServiceImpl extends CrudServiceImpl implements TAbilityApplicationService { private static final Logger logger = LoggerFactory.getLogger(TAbilityApplicationServiceImpl.class); + + @Autowired private TAbilityApplicationDao abilityApplicationDao; @Override @@ -145,7 +149,8 @@ public class TAbilityApplicationServiceImpl extends CrudServiceImpl cameraList = abilityApplicationDao.getApplyCameraList(userDetail.getId(), currentTime); + return cameraList.isEmpty() ? new ArrayList<>() : cameraList; } @Override diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java index 3ca7a805..f1631dc0 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/impl/ResourceServiceImpl.java @@ -159,6 +159,9 @@ public class ResourceServiceImpl extends CrudServiceImpl