Browse Source

新增 高级用户角色

master
PoffyZhang 11 months ago
parent
commit
0926076efa
6 changed files with 154 additions and 7 deletions
  1. +9
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/controller/StatisticsController.java
  2. +28
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/EarlyWarningStatisticsManage.java
  3. +37
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/vo/EarlyWarningStatisticsVO.java
  4. +77
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/HigherUserDataScopeProviderImpl.java
  5. +0
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java
  6. +3
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/user/entity/enumeration/RoleEnum.java

+ 9
- 4
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/controller/StatisticsController.java View File

@@ -1,9 +1,6 @@
package com.ningdatech.pmapi.dashboard.controller;

import com.ningdatech.pmapi.dashboard.manage.ExpertStatisticsManage;
import com.ningdatech.pmapi.dashboard.manage.FundStatisticsManage;
import com.ningdatech.pmapi.dashboard.manage.MeetingStatisticsManage;
import com.ningdatech.pmapi.dashboard.manage.ProjectCostStatisticsManage;
import com.ningdatech.pmapi.dashboard.manage.*;
import com.ningdatech.pmapi.dashboard.model.vo.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -30,6 +27,8 @@ public class StatisticsController {

private final ProjectCostStatisticsManage costStatisticsManage;

private final EarlyWarningStatisticsManage earlyWarningStatisticsManage;

@GetMapping("/fund")
@ApiOperation("项目资金统计")
public FundStatisticsVO fund(@RequestParam(required = false) Integer year) {
@@ -53,4 +52,10 @@ public class StatisticsController {
public CostStatisticsVO projectCost() {
return costStatisticsManage.statistics();
}

@GetMapping("/early-warning")
@ApiOperation("预警统计")
public EarlyWarningStatisticsVO earlyWarning(@RequestParam(required = false) Integer year) {
return earlyWarningStatisticsManage.statistics(year);
}
}

+ 28
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/manage/EarlyWarningStatisticsManage.java View File

@@ -0,0 +1,28 @@
package com.ningdatech.pmapi.dashboard.manage;

import com.ningdatech.pmapi.dashboard.model.vo.EarlyWarningStatisticsVO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
* @Classname EarlyWarningStatisticsManage
* @Description
* @Date 2023/12/05 17:44
* @Author PoffyZhang
*/
@Component
@RequiredArgsConstructor
@Slf4j
public class EarlyWarningStatisticsManage {



public EarlyWarningStatisticsVO statistics(Integer year) {
EarlyWarningStatisticsVO res = new EarlyWarningStatisticsVO();



return res;
}
}

+ 37
- 0
pmapi/src/main/java/com/ningdatech/pmapi/dashboard/model/vo/EarlyWarningStatisticsVO.java View File

@@ -0,0 +1,37 @@
package com.ningdatech.pmapi.dashboard.model.vo;

import com.ningdatech.pmapi.common.model.entity.DataDTO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

@Data
@ApiModel(value = "预警统计", description = "")
public class EarlyWarningStatisticsVO implements Serializable {
private static final long serialVersionUID = 1L;

@ApiModelProperty("评审召开总数")
private Integer meetingTotal = 0;

@ApiModelProperty("评审通过数")
private Integer passReview = 0;

@ApiModelProperty("评审不通过率")
private BigDecimal notPassRate = BigDecimal.ZERO;

@ApiModelProperty("各区县召开总数")
private List<DataDTO> regionMeetings;

@ApiModelProperty("预审/验收 会议情况")
private List<DataDTO> meetingTypes;

@ApiModelProperty("各区县不通过率")
private List<DataDTO> notPassRegionMeetings;

@ApiModelProperty("各部门不通过top10")
private List<DataDTO> notPassTop10;
}

+ 77
- 0
pmapi/src/main/java/com/ningdatech/pmapi/datascope/provider/impl/HigherUserDataScopeProviderImpl.java View File

@@ -0,0 +1,77 @@
package com.ningdatech.pmapi.datascope.provider.impl;

import cn.hutool.core.collection.CollUtil;
import com.google.common.collect.Lists;
import com.ningdatech.pmapi.common.constant.RegionConst;
import com.ningdatech.pmapi.common.helper.RegionCacheHelper;
import com.ningdatech.pmapi.common.helper.UserInfoHelper;
import com.ningdatech.pmapi.datascope.model.DataScopeDTO;
import com.ningdatech.pmapi.datascope.provider.DataScopeProvider;
import com.ningdatech.pmapi.user.entity.enumeration.RoleEnum;
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO;
import com.ningdatech.pmapi.user.util.LoginUserUtil;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Optional;

/**
* <p>
* 数据权限
* </p>
*
* @author ZPF
* @since 2023/3/27 23:29
*/
@Slf4j
@RequiredArgsConstructor
@Component("HIGH_MEMBER")
public class HigherUserDataScopeProviderImpl implements DataScopeProvider {

private final RegionCacheHelper regionCacheHelper;
private final UserInfoHelper userInfoHelper;

//和区域管理员一样
@Override
public Optional<DataScopeDTO> findDataFieldProperty() {
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(LoginUserUtil.getUserId());
//借由 丽水市的code 来映射市本级的regionCode
Collection<String> regionCodes = regionCacheHelper.listChildRegionCodeList(userFullInfo.getRegionCode(),
RegionConst.RL_CITY);
//如果不是市本级的话 就直接放入本区域的县就好了
if(CollUtil.isEmpty(regionCodes)){
regionCodes = Lists.newArrayList();
regionCodes.add(userFullInfo.getRegionCode());
}

DataScopeDTO ds = new DataScopeDTO();
ds.setRegionCodes(new ArrayList<>(regionCodes));
ds.setUserId(userFullInfo.getUserId());
ds.setEmployeeCode(userFullInfo.getEmployeeCode());
ds.setRole(RoleEnum.REGION_MANAGER);
return Optional.of(ds);
}

@Override
public Optional<DataScopeDTO> findDataFieldProperty(Long userId) {
UserFullInfoDTO userFullInfo = userInfoHelper.getUserFullInfo(userId);
//借由 丽水市的code 来映射市本级的regionCode
Collection<String> regionCodes = regionCacheHelper.listChildRegionCodeList(userFullInfo.getRegionCode(),
RegionConst.RL_CITY);
//如果不是市本级的话 就直接放入本区域的县就好了
if(CollUtil.isEmpty(regionCodes)){
regionCodes = Lists.newArrayList();
regionCodes.add(userFullInfo.getRegionCode());
}

DataScopeDTO ds = new DataScopeDTO();
ds.setRegionCodes(new ArrayList<>(regionCodes));
ds.setUserId(userFullInfo.getUserId());
ds.setEmployeeCode(userFullInfo.getEmployeeCode());
ds.setRole(RoleEnum.REGION_MANAGER);
return Optional.of(ds);
}
}

+ 0
- 1
pmapi/src/main/java/com/ningdatech/pmapi/sys/manage/NoticeManage.java View File

@@ -37,7 +37,6 @@ import com.ningdatech.pmapi.sys.service.INotifyService;
import com.ningdatech.pmapi.todocenter.bean.entity.WorkNoticeInfo;
import com.ningdatech.pmapi.todocenter.model.dto.ProjectAuditMsgExtraDTO;
import com.ningdatech.pmapi.user.entity.UserInfo;
import com.ningdatech.pmapi.user.entity.enumeration.RoleEnum;
import com.ningdatech.pmapi.user.security.auth.model.UserFullInfoDTO;
import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails;
import com.ningdatech.pmapi.user.service.IUserInfoService;


+ 3
- 2
pmapi/src/main/java/com/ningdatech/pmapi/user/entity/enumeration/RoleEnum.java View File

@@ -20,7 +20,8 @@ public enum RoleEnum {
/**
* 系统角色枚举
*/
NORMAL_MEMBER("普通用户", 7),
NORMAL_MEMBER("普通用户", 8),
HIGH_MEMBER("高级用户", 7),

EXPERT("专家", 6),

@@ -34,7 +35,7 @@ public enum RoleEnum {

VISITOR("访客", 2),

DASHBOARD("工作台", 8);
DASHBOARD("工作台", 9);

private final String desc;



Loading…
Cancel
Save