Sfoglia il codice sorgente

续建资金项目权限

master
PoffyZhang 1 anno fa
parent
commit
521adb7292
6 ha cambiato i file con 95 aggiunte e 5 eliminazioni
  1. +7
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectRenewalFundDeclarationController.java
  2. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java
  3. +58
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java
  4. +17
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectRenewalFundDeclarationMapper.xml
  5. +11
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectRenewalListReq.java
  6. +1
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CockpitStatsStatisticsTask.java

+ 7
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectRenewalFundDeclarationController.java Vedi File

@@ -3,12 +3,15 @@ package com.ningdatech.pmapi.projectlib.controller;

import com.ningdatech.basic.model.PageVo;
import com.ningdatech.log.annotation.WebLog;
import com.ningdatech.pmapi.common.helper.UserInfoHelper;
import com.ningdatech.pmapi.common.util.ExcelDownUtil;
import com.ningdatech.pmapi.projectlib.manage.ProjectRenewalFundManage;
import com.ningdatech.pmapi.projectlib.model.dto.ProjectRenewalFundDeclarationDTO;
import com.ningdatech.pmapi.projectlib.model.req.ProjectRenewalAuditReq;
import com.ningdatech.pmapi.projectlib.model.req.ProjectRenewalListReq;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectRenewalFundDeclarationVO;
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
@@ -32,11 +35,14 @@ import javax.servlet.http.HttpServletResponse;
public class ProjectRenewalFundDeclarationController {
private final ProjectRenewalFundManage projectRenewalFundManage;

private final UserInfoHelper userInfoHelper;

@GetMapping("/list")
@ApiOperation("项目续建资金库")
@WebLog("项目续建资金库")
public PageVo<ProjectRenewalFundDeclarationVO> list(ProjectRenewalListReq req) {
return projectRenewalFundManage.list(req);
UserFullInfoDTO user = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId());
return projectRenewalFundManage.list(req,user);
}

@GetMapping("/{id}")


+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java Vedi File

@@ -1209,7 +1209,7 @@ public class ProjectLibManage {
return user;
}

private ProjectListReq buildProjectLibPermission(ProjectListReq req,UserFullInfoDTO user) {
public ProjectListReq buildProjectLibPermission(ProjectListReq req,UserFullInfoDTO user) {
Optional<DataScopeDTO> currentUserDataScope = DataScopeUtil.getCurrentUserDataScope(user);
if (!currentUserDataScope.isPresent()) {
log.warn("没有取到权限信息 当前查询 没有权限条件");


+ 58
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java Vedi File

@@ -12,8 +12,12 @@ import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.basic.util.NdDateUtils;
import com.ningdatech.pmapi.common.constant.BizConst;
import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.common.constant.RegionConst;
import com.ningdatech.pmapi.common.helper.RegionCacheHelper;
import com.ningdatech.pmapi.common.util.ExcelDownUtil;
import com.ningdatech.pmapi.common.util.ExcelExportStyle;
import com.ningdatech.pmapi.datascope.model.DataScopeDTO;
import com.ningdatech.pmapi.datascope.utils.DataScopeUtil;
import com.ningdatech.pmapi.gov.model.entity.GovBizProjectApply;
import com.ningdatech.pmapi.gov.model.entity.GovBizProjectApprove;
import com.ningdatech.pmapi.gov.model.entity.GovBizProjectBaseinfo;
@@ -32,16 +36,19 @@ import com.ningdatech.pmapi.projectlib.model.dto.ProjectRenewalFundDeclarationDT
import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectRenewalFundDeclaration;
import com.ningdatech.pmapi.projectlib.model.po.ProjectRenewalFundDeclarationPO;
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq;
import com.ningdatech.pmapi.projectlib.model.req.ProjectRenewalAuditReq;
import com.ningdatech.pmapi.projectlib.model.req.ProjectRenewalListReq;
import com.ningdatech.pmapi.projectlib.model.vo.AnnualAmountVO;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectRenewalFundDeclarationVO;
import com.ningdatech.pmapi.projectlib.service.IProjectRenewalFundDeclarationService;
import com.ningdatech.pmapi.projectlib.service.IProjectService;
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO;
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import com.wflow.exception.BusinessException;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;
@@ -49,6 +56,7 @@ import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.time.LocalDateTime;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.Optional;
@@ -64,6 +72,7 @@ import java.util.stream.Collectors;
*/
@Component
@RequiredArgsConstructor
@Slf4j
public class ProjectRenewalFundManage {

private final IProjectRenewalFundDeclarationService projectRenewalFundDeclarationService;
@@ -78,13 +87,16 @@ public class ProjectRenewalFundManage {

private final IGovBizProjectApproveService approveService;

private final RegionCacheHelper regionCacheHelper;

/**
* 项目续建资金库列表 分页
* @param req
* @return
*/
public PageVo<ProjectRenewalFundDeclarationVO> list(ProjectRenewalListReq req) {
public PageVo<ProjectRenewalFundDeclarationVO> list(ProjectRenewalListReq req, UserFullInfoDTO user) {
Page<ProjectRenewalFundDeclarationPO> page = req.page();
req = buildProjectLibPermission(req,user);
projectRenewalFundDeclarationService.pageSql(page, req);
long total;
if ((total = page.getTotal()) == 0) {
@@ -446,4 +458,49 @@ public class ProjectRenewalFundManage {
throw new RuntimeException(e);
}
}

public ProjectRenewalListReq buildProjectLibPermission(ProjectRenewalListReq req, UserFullInfoDTO user) {
Optional<DataScopeDTO> currentUserDataScope = DataScopeUtil.getCurrentUserDataScope(user);
if (!currentUserDataScope.isPresent()) {
log.warn("没有取到权限信息 当前查询 没有权限条件");
return req;
}

switch (currentUserDataScope.get().getRole()) {
case NORMAL_MEMBER:
//普通用户 只能看到自己单位去申报的
req.setUserType("normal");
req.setUserValue(user.getEmpPosUnitCode());
break;
case COMPANY_MANAGER:
//单位管理员 看到自己单位去申报的 + 待预审的主管单位是自己单位的项目
req.setUserType("org");
req.setUserValue(user.getEmpPosUnitCode());
break;
case SUPER_ADMIN:
//超级管理员 看到丽水全市的 并且也要判断他 同时是不是单位管理员
break;
case REGION_MANAGER:
//区域管理员 看到自己区域的项目 如果是市本级 就看全市的
if (RegionConst.RC_LS.equals(user.getRegionCode())) {
Collection<String> regionCodes = regionCacheHelper.listChildRegionCodeList(user.getRegionCode(),
RegionConst.RL_CITY);
req.setRegionCodes(regionCodes);
} else {
req.setUserRegionCode(user.getRegionCode());
}
req.setUserType("region");
break;
case VISITOR:
//访客可以看全市的
break;
case DASHBOARD:
break;
default:
//没有权限的话 就让它查不到
req.setId(0L);
break;
}
return req;
}
}

+ 17
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectRenewalFundDeclarationMapper.xml Vedi File

@@ -61,6 +61,23 @@
<if test="param.approvalStatus != null">
and prfd.approval_status = #{param.approvalStatus}
</if>
<if test="param.userType != null and param.userType == 'normal'">
and prfd.org_code = #{param.userValue}
</if>
<if test="param.userType != null and param.userType == 'org'">
and prfd.org_code = #{param.userValue}
</if>
<if test="param.userType != null and param.userType == 'region'">
<if test="param.regionCodes != null">
and prfd.region_code in
<foreach close=")" collection="param.regionCodes" item="code" open="(" separator=",">
#{code}
</foreach>
</if>
<if test="param.userRegionCode != null">
and prfd.region_code = param.userRegionCode}
</if>
</if>
order by prfd.update_on desc
</select>
</mapper>

+ 11
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/req/ProjectRenewalListReq.java Vedi File

@@ -7,6 +7,7 @@ import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import java.util.Collection;
import java.util.List;

/**
@@ -22,6 +23,8 @@ import java.util.List;
@EqualsAndHashCode(callSuper = true)
public class ProjectRenewalListReq extends PagePo {

private Long id;

@ApiModelProperty("区域编码")
private String regionCode;

@@ -62,4 +65,12 @@ public class ProjectRenewalListReq extends PagePo {

@ApiModelProperty("审核状态")
private String approvalStatus;

private String userType;
private String userValue;

private Collection<String> regionCodes;

@ApiModelProperty("区域编码")
private String userRegionCode;
}

+ 1
- 2
pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/CockpitStatsStatisticsTask.java Vedi File

@@ -81,8 +81,7 @@ public class CockpitStatsStatisticsTask {


/**
* 前置机每天晚上10点自动清空,第二天早上6点获取数据
* 定时同步前置机数据 每天1点开始执行一次
* 定义统计 驾驶舱数据 每天3点开始执行一次
*
*/
@Scheduled(cron = "0 0 3 * * ?")


Loading…
Annulla
Salva