From ffa2e6d93e7e203c020d0d63ba2939526dffd254 Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Mon, 21 Nov 2022 17:58:19 +0800 Subject: [PATCH] =?UTF-8?q?1.=E8=A5=BF=E6=B5=B7=E5=B2=B8-=E5=B7=B2?= =?UTF-8?q?=E7=94=B3=E8=AF=B7=E5=88=97=E8=A1=A8=E6=9F=A5=E8=AF=A2=202.toke?= =?UTF-8?q?n=E8=BF=87=E6=9C=9F=E6=97=B6=E9=97=B4=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E5=8F=AF=E9=85=8D=E7=BD=AE=203.=E4=BA=9A=E4=BC=9F=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E6=B6=88=E6=81=AFbug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/controller/CensusController.java | 40 ++++++++++--------- .../service/impl/SysNoticeServiceImpl.java | 9 ++++- .../TAbilityApplicationController.java | 2 +- .../impl/TAbilityApplicationServiceImpl.java | 7 +++- .../service/impl/ResourceServiceImpl.java | 11 +++-- .../service/impl/SysUserTokenServiceImpl.java | 5 ++- .../src/main/resources/application.yml | 2 + .../processForm/TAbilityApplicationDao.xml | 2 +- 8 files changed, 48 insertions(+), 30 deletions(-) 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