Parcourir la source

绩效评价-项目指标库

master
CMM il y a 1 an
Parent
révision
4568d15462
6 fichiers modifiés avec 169 ajouts et 30 suppressions
  1. +23
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/IndicatorConfigController.java
  2. +57
    -4
      pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorConfigManage.java
  3. +56
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceIndicatorProjectIndexSaveDTO.java
  4. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProjectIndicator.java
  5. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/req/PerformanceAppraisalListReq.java
  6. +28
    -23
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexVO.java

+ 23
- 1
pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/IndicatorConfigController.java Voir le fichier

@@ -3,9 +3,11 @@ package com.ningdatech.pmapi.performance.controller;
import com.ningdatech.basic.model.PageVo;
import com.ningdatech.log.annotation.WebLog;
import com.ningdatech.pmapi.performance.manage.IndicatorConfigManage;
import com.ningdatech.pmapi.performance.model.dto.PerformanceIndicatorProjectIndexSaveDTO;
import com.ningdatech.pmapi.performance.model.dto.PerformanceIndicatorProjectTemplateSaveDTO;
import com.ningdatech.pmapi.performance.model.req.PerformanceAppraisalListReq;
import com.ningdatech.pmapi.performance.model.vo.ProjectIndexTemplateVO;
import com.ningdatech.pmapi.performance.model.vo.ProjectIndexVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
@@ -70,7 +72,27 @@ public class IndicatorConfigController {

@GetMapping("/project/index/list")
@ApiOperation("项目指标库列表")
public PageVo<ProjectIndexTemplateVO> projectIndexList(PerformanceAppraisalListReq req) {
public PageVo<ProjectIndexVO> projectIndexList(PerformanceAppraisalListReq req) {
return indicatorConfigManage.projectIndexList(req);
}

@PostMapping("/project/index/save")
@ApiOperation("项目指标库新增指标保存")
@WebLog("项目指标库新增指标保存")
public String projectIndexSave(@Valid @RequestBody PerformanceIndicatorProjectIndexSaveDTO dto) {
return indicatorConfigManage.projectIndexSave(dto);
}

@PostMapping("/project/index/delete/{id}")
@ApiOperation("项目指标库指标删除")
@WebLog("项目指标库指标删除")
public String projectIndexDelete(@PathVariable Long id) {
return indicatorConfigManage.projectIndexDelete(id);
}

@PostMapping("/project/index/detail/{id}")
@ApiOperation("项目指标库项目指标详情")
public ProjectIndexVO projectIndexDetail(@PathVariable Long id) {
return indicatorConfigManage.projectIndexDetail(id);
}
}

+ 57
- 4
pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorConfigManage.java Voir le fichier

@@ -13,12 +13,15 @@ import com.ningdatech.pmapi.common.constant.CommonConst;
import com.ningdatech.pmapi.common.enumeration.CommonEnum;
import com.ningdatech.pmapi.common.helper.UserInfoHelper;
import com.ningdatech.pmapi.performance.enumration.PerformanceTemplateTypeEnum;
import com.ningdatech.pmapi.performance.model.dto.PerformanceIndicatorProjectIndexSaveDTO;
import com.ningdatech.pmapi.performance.model.dto.PerformanceIndicatorProjectTemplateSaveDTO;
import com.ningdatech.pmapi.performance.model.dto.ProjectTemplateDetailDTO;
import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalProjectIndicator;
import com.ningdatech.pmapi.performance.model.entity.PerformanceIndicatorProjectTemplate;
import com.ningdatech.pmapi.performance.model.entity.PerformanceIndicatorProjectTemplateDetail;
import com.ningdatech.pmapi.performance.model.req.PerformanceAppraisalListReq;
import com.ningdatech.pmapi.performance.model.vo.ProjectIndexTemplateVO;
import com.ningdatech.pmapi.performance.model.vo.ProjectIndexVO;
import com.ningdatech.pmapi.performance.model.vo.ProjectTemplateDetailVO;
import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalProjectIndicatorService;
import com.ningdatech.pmapi.performance.service.IPerformanceIndicatorProjectTemplateDetailService;
@@ -62,7 +65,8 @@ public class IndicatorConfigManage {
Page<PerformanceIndicatorProjectTemplate> page = req.page();
LambdaQueryWrapper<PerformanceIndicatorProjectTemplate> wrapper = Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplate.class)
.like(StringUtils.isNotBlank(req.getTemplateName()), PerformanceIndicatorProjectTemplate::getName, req.getTemplateName())
.eq(StringUtils.isNotBlank(req.getRegionCode()), PerformanceIndicatorProjectTemplate::getRegionCode,req.getRegionCode());
.eq(StringUtils.isNotBlank(req.getRegionCode()), PerformanceIndicatorProjectTemplate::getRegionCode,req.getRegionCode())
.orderByDesc(PerformanceIndicatorProjectTemplate::getCreateOn);
indicatorProjectTemplateService.page(page,wrapper);

if(0L == page.getTotal()){
@@ -351,9 +355,58 @@ public class IndicatorConfigManage {
return "模版复制失败";
}

public PageVo<ProjectIndexTemplateVO> projectIndexList(PerformanceAppraisalListReq req) {
public PageVo<ProjectIndexVO> projectIndexList(PerformanceAppraisalListReq req) {
Page<PerformanceAppraisalProjectIndicator> page = req.page();
LambdaQueryWrapper<PerformanceAppraisalProjectIndicator> wrapper = Wrappers.lambdaQuery(PerformanceAppraisalProjectIndicator.class)
.like(StringUtils.isNotBlank(req.getIndexName()), PerformanceAppraisalProjectIndicator::getIndexName, req.getIndexName())
.eq(Objects.nonNull(req.getIndexLevel()), PerformanceAppraisalProjectIndicator::getIndexLevel, req.getIndexLevel())
.eq(StringUtils.isNotBlank(req.getRegionCode()), PerformanceAppraisalProjectIndicator::getRegionCode, req.getRegionCode())
.orderByDesc(PerformanceAppraisalProjectIndicator::getCreateOn);
projectIndicatorService.page(page,wrapper);

if (CollUtil.isEmpty(page.getRecords())){
return PageVo.empty();
}
List<ProjectIndexVO> result = page.getRecords().stream()
.map(i -> BeanUtil.copyProperties(i, ProjectIndexVO.class))
.collect(Collectors.toList());
return PageVo.of(result,page.getTotal());
}

public String projectIndexSave(PerformanceIndicatorProjectIndexSaveDTO dto) {
UserInfoDetails user = LoginUserUtil.loginUserDetail();
Page<Object> page = req.page();
return null;
PerformanceAppraisalProjectIndicator projectIndicator = BeanUtil.copyProperties(dto, PerformanceAppraisalProjectIndicator.class);
if(Objects.nonNull(dto.getId())){
PerformanceAppraisalProjectIndicator old = projectIndicatorService.getById(dto.getId());
VUtils.isTrue(Objects.isNull(old)).throwMessage("该项目指标不存在!");
projectIndicator.setId(old.getId());
}else{
projectIndicator.setId(null);
projectIndicator.setCreateOn(LocalDateTime.now());
projectIndicator.setCreateBy(user.getUsername());
}
projectIndicator.setUpdateOn(LocalDateTime.now());
projectIndicator.setUpdateBy(user.getUsername());
if(projectIndicatorService.saveOrUpdate(projectIndicator)){
return "指标新增成功";
}
return "指标新增失败";
}

public String projectIndexDelete(Long id) {
PerformanceAppraisalProjectIndicator projectIndicator = projectIndicatorService.getById(id);
VUtils.isTrue(Objects.isNull(projectIndicator)).throwMessage("该项目指标不存在!");
if (projectIndicatorService.removeById(id)) {
return "删除成功";
}
return "操作失败";
}

public ProjectIndexVO projectIndexDetail(Long id) {
PerformanceAppraisalProjectIndicator projectIndex = projectIndicatorService.getById(id);
if(Objects.isNull(projectIndex)){
return null;
}
return BeanUtil.copyProperties(projectIndex, ProjectIndexVO.class);
}
}

+ 56
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceIndicatorProjectIndexSaveDTO.java Voir le fichier

@@ -0,0 +1,56 @@
package com.ningdatech.pmapi.performance.model.dto;

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

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Size;

/**
* 绩效评级-项目指标库 新增指标保存
* @return
* @author CMM
* @since 2023/07/28 15:44
*/
@Data
@ApiModel(value = "绩效评价考核项目指标库", description = "绩效评价考核项目指标库")
public class PerformanceIndicatorProjectIndexSaveDTO implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("主键ID")
private Long id;

@ApiModelProperty("指标名称")
@Size(max = 50)
private String indexName;

@ApiModelProperty("指标级别(1 一级、2 二级、3 三级)")
private Integer indexLevel;

@ApiModelProperty("指标分值")
@Range(min = 0, max = 100, message = "数值范围不正确,数值应大于0小于100")
private BigDecimal indexScore;

@ApiModelProperty("指标细则")
@Size(max = 200)
private String indexDetail;

@ApiModelProperty("评分细则")
@Size(max = 200)
private String gradeDetail;

@ApiModelProperty("佐证材料")
@Size(max = 200)
private String supportMaterial;

@ApiModelProperty("丽水 区域code")
private String regionCode;
}

+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProjectIndicator.java Voir le fichier

@@ -47,6 +47,9 @@ public class PerformanceAppraisalProjectIndicator implements Serializable {
@ApiModelProperty("佐证材料")
private String supportMaterial;

@ApiModelProperty("丽水 区域code")
private String regionCode;

@ApiModelProperty("创建时间")
private LocalDateTime createOn;



+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/req/PerformanceAppraisalListReq.java Voir le fichier

@@ -37,6 +37,6 @@ public class PerformanceAppraisalListReq extends PagePo {
@ApiModelProperty("指标名称")
private String indexName;

@ApiModelProperty("指标类型 1一级指标 2二级指标 3三级指标")
private Integer type;
@ApiModelProperty("指标级别 1一级指标 2二级指标 3三级指标")
private Integer indexLevel;
}

+ 28
- 23
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexVO.java Voir le fichier

@@ -1,9 +1,12 @@
package com.ningdatech.pmapi.performance.model.vo;

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

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -20,38 +23,40 @@ public class ProjectIndexVO implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("主键")
@ApiModelProperty("主键ID")
@TableId(type = IdType.AUTO)
private Long id;

private LocalDateTime createOn;
private LocalDateTime updateOn;
private String createBy;
private String updateBy;
@ApiModelProperty("指标名称")
private String indexName;

@ApiModelProperty("模板名称")
private String name;
@ApiModelProperty("指标级别(1 一级、2 二级、3 三级)")
private Integer indexLevel;

@ApiModelProperty("丽水 区域code")
private String regionCode;
@ApiModelProperty("指标分值")
private BigDecimal indexScore;

@ApiModelProperty("项目类型")
private Integer projectType;
@ApiModelProperty("指标细则")
private String indexDetail;

@ApiModelProperty("项目年度")
private Integer projectYear;
@ApiModelProperty("评分细则")
private String gradeDetail;

@ApiModelProperty("建设类型 1 软件、2 硬件、3 软硬件")
private Integer constructType;
@ApiModelProperty("佐证材料")
private String supportMaterial;

@ApiModelProperty("项目资金范围 1.500万元以下、2.500-2000万元,3.2000万元及以上")
private Integer amountRange;
@ApiModelProperty("丽水 区域code")
private String regionCode;

@ApiModelProperty("创建时间")
private LocalDateTime createOn;

@ApiModelProperty("状态 0关闭 1开启")
private Integer status;
@ApiModelProperty("创建人")
private String createBy;

@ApiModelProperty("绩效指标详情")
private List<ProjectTemplateDetailVO> templateDetails;
@ApiModelProperty("更新时间")
private LocalDateTime updateOn;

@ApiModelProperty("附加绩效指标详情")
private List<ProjectTemplateDetailVO> additionalIndexDetails;
@ApiModelProperty("更新人")
private String updateBy;
}

Chargement…
Annuler
Enregistrer