From f5c10abcaf6c613e8bea66df45f78a41beac8fbb Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Fri, 28 Jul 2023 14:55:55 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=8C=87=E6=A0=87?= =?UTF-8?q?=E6=A8=A1=E7=89=88=E5=A4=8D=E5=88=B6=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/GeneratorCodeKingbaseConfig.java | 2 +- .../performance/manage/IndicatorConfigManage.java | 12 ++++- ...PerformanceAppraisalProjectIndicatorMapper.java | 16 ++++++ .../PerformanceAppraisalProjectIndicatorMapper.xml | 5 ++ .../PerformanceAppraisalProjectIndicator.java | 62 ++++++++++++++++++++++ .../pmapi/performance/model/vo/ProjectIndexVO.java | 57 ++++++++++++++++++++ ...erformanceAppraisalProjectIndicatorService.java | 16 ++++++ ...rmanceAppraisalProjectIndicatorServiceImpl.java | 20 +++++++ 8 files changed, 187 insertions(+), 3 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalProjectIndicatorMapper.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalProjectIndicatorMapper.xml create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProjectIndicator.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexVO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceAppraisalProjectIndicatorService.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceAppraisalProjectIndicatorServiceImpl.java diff --git a/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java b/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java index 8a455b6..d205dd7 100644 --- a/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java +++ b/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java @@ -57,7 +57,7 @@ public class GeneratorCodeKingbaseConfig { public static void main(String[] args) { //generate("Liuxinxin", "expert", PATH_LXX, "expert_gov_business_strip"); - generate("CMM", "test", PATH_CMM, "nd_project_core_business_indicators"); + generate("CMM", "test", PATH_CMM, "nd_performance_appraisal_project_indicator"); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorConfigManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorConfigManage.java index 691ecf6..b99268a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorConfigManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorConfigManage.java @@ -11,6 +11,7 @@ import com.ningdatech.basic.function.VUtils; import com.ningdatech.basic.model.PageVo; 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.PerformanceIndicatorProjectTemplateSaveDTO; import com.ningdatech.pmapi.performance.model.dto.ProjectTemplateDetailDTO; @@ -19,8 +20,10 @@ import com.ningdatech.pmapi.performance.model.entity.PerformanceIndicatorProject import com.ningdatech.pmapi.performance.model.req.PerformanceAppraisalListReq; import com.ningdatech.pmapi.performance.model.vo.ProjectIndexTemplateVO; import com.ningdatech.pmapi.performance.model.vo.ProjectTemplateDetailVO; +import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalProjectIndicatorService; import com.ningdatech.pmapi.performance.service.IPerformanceIndicatorProjectTemplateDetailService; import com.ningdatech.pmapi.performance.service.IPerformanceIndicatorProjectTemplateService; +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 lombok.AllArgsConstructor; @@ -47,8 +50,8 @@ import java.util.stream.Collectors; @AllArgsConstructor public class IndicatorConfigManage { private final IPerformanceIndicatorProjectTemplateService indicatorProjectTemplateService; - private final IPerformanceIndicatorProjectTemplateDetailService indicatorProjectTemplateDetailService; + private final IPerformanceAppraisalProjectIndicatorService projectIndicatorService; /** * 模板列表 @@ -324,6 +327,8 @@ public class IndicatorConfigManage { newTemplate.setCreateBy(user.getUsername()); newTemplate.setUpdateOn(LocalDateTime.now()); newTemplate.setUpdateBy(user.getUsername()); + // 副本ID要置空 + newTemplate.setId(null); if (indicatorProjectTemplateService.save(newTemplate)) { // 新增指标详情 List projectTemplateDetails = indicatorProjectTemplateDetailService.list(Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplateDetail.class) @@ -337,6 +342,8 @@ public class IndicatorConfigManage { newProjectTemplateDetail.setCreateBy(user.getUsername()); newProjectTemplateDetail.setUpdateOn(LocalDateTime.now()); newProjectTemplateDetail.setUpdateBy(user.getUsername()); + // 新的指标ID要置空 + newProjectTemplateDetail.setId(null); indicatorProjectTemplateDetailService.save(newProjectTemplateDetail); } return "模版复制成功"; @@ -345,7 +352,8 @@ public class IndicatorConfigManage { } public PageVo projectIndexList(PerformanceAppraisalListReq req) { - + UserInfoDetails user = LoginUserUtil.loginUserDetail(); + Page page = req.page(); return null; } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalProjectIndicatorMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalProjectIndicatorMapper.java new file mode 100644 index 0000000..03a900f --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalProjectIndicatorMapper.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.performance.mapper; + +import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalProjectIndicator; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * Mapper 接口 + *

+ * + * @author CMM + * @since 2023-07-28 + */ +public interface PerformanceAppraisalProjectIndicatorMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalProjectIndicatorMapper.xml b/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalProjectIndicatorMapper.xml new file mode 100644 index 0000000..19e19bd --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalProjectIndicatorMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProjectIndicator.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProjectIndicator.java new file mode 100644 index 0000000..7f1e0ce --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProjectIndicator.java @@ -0,0 +1,62 @@ +package com.ningdatech.pmapi.performance.model.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + *

+ * + *

+ * + * @author CMM + * @since 2023-07-28 + */ +@TableName("nd_performance_appraisal_project_indicator") +@ApiModel(value = "NdPerformanceAppraisalProjectIndicator对象", description = "") +@Data +public class PerformanceAppraisalProjectIndicator implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键ID") + @TableId(type = IdType.AUTO) + private Long id; + + @ApiModelProperty("指标名称") + private String indexName; + + @ApiModelProperty("指标级别(1 一级、2 二级、3 三级)") + private Integer indexLevel; + + @ApiModelProperty("指标分值") + private BigDecimal indexScore; + + @ApiModelProperty("指标细则") + private String indexDetail; + + @ApiModelProperty("评分细则") + private String gradeDetail; + + @ApiModelProperty("佐证材料") + private String supportMaterial; + + @ApiModelProperty("创建时间") + private LocalDateTime createOn; + + @ApiModelProperty("创建人") + private String createBy; + + @ApiModelProperty("更新时间") + private LocalDateTime updateOn; + + @ApiModelProperty("更新人") + private String updateBy; + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexVO.java new file mode 100644 index 0000000..427feb7 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexVO.java @@ -0,0 +1,57 @@ +package com.ningdatech.pmapi.performance.model.vo; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.List; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 绩效评价-项目指标库 + * @return + * @author CMM + * @since 2023/07/28 14:45 + */ +@Data +@ApiModel(value = "绩效评价项目指标库", description = "绩效评价项目指标库") +public class ProjectIndexVO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键") + private Long id; + + private LocalDateTime createOn; + private LocalDateTime updateOn; + private String createBy; + private String updateBy; + + @ApiModelProperty("模板名称") + private String name; + + @ApiModelProperty("丽水 区域code") + private String regionCode; + + @ApiModelProperty("项目类型") + private Integer projectType; + + @ApiModelProperty("项目年度") + private Integer projectYear; + + @ApiModelProperty("建设类型 1 软件、2 硬件、3 软硬件") + private Integer constructType; + + @ApiModelProperty("项目资金范围 1.500万元以下、2.500-2000万元,3.2000万元及以上") + private Integer amountRange; + + @ApiModelProperty("状态 0关闭 1开启") + private Integer status; + + @ApiModelProperty("绩效指标详情") + private List templateDetails; + + @ApiModelProperty("附加绩效指标详情") + private List additionalIndexDetails; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceAppraisalProjectIndicatorService.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceAppraisalProjectIndicatorService.java new file mode 100644 index 0000000..7e5f08f --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceAppraisalProjectIndicatorService.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.performance.service; + +import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalProjectIndicator; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author CMM + * @since 2023-07-28 + */ +public interface IPerformanceAppraisalProjectIndicatorService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceAppraisalProjectIndicatorServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceAppraisalProjectIndicatorServiceImpl.java new file mode 100644 index 0000000..cdaece7 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceAppraisalProjectIndicatorServiceImpl.java @@ -0,0 +1,20 @@ +package com.ningdatech.pmapi.performance.service.impl; + +import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalProjectIndicator; +import com.ningdatech.pmapi.performance.mapper.PerformanceAppraisalProjectIndicatorMapper; +import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalProjectIndicatorService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author CMM + * @since 2023-07-28 + */ +@Service +public class PerformanceAppraisalProjectIndicatorServiceImpl extends ServiceImpl implements IPerformanceAppraisalProjectIndicatorService { + +} From 4568d1546238d4abe1d1531a93707ac0d517ab4e Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Fri, 28 Jul 2023 17:19:43 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E7=BB=A9=E6=95=88=E8=AF=84=E4=BB=B7-?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=8C=87=E6=A0=87=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/IndicatorConfigController.java | 24 ++++++++- .../performance/manage/IndicatorConfigManage.java | 61 ++++++++++++++++++++-- .../PerformanceIndicatorProjectIndexSaveDTO.java | 56 ++++++++++++++++++++ .../PerformanceAppraisalProjectIndicator.java | 3 ++ .../model/req/PerformanceAppraisalListReq.java | 4 +- .../pmapi/performance/model/vo/ProjectIndexVO.java | 51 ++++++++++-------- 6 files changed, 169 insertions(+), 30 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceIndicatorProjectIndexSaveDTO.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/IndicatorConfigController.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/IndicatorConfigController.java index 22a77da..7a535cb 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/IndicatorConfigController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/IndicatorConfigController.java @@ -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 projectIndexList(PerformanceAppraisalListReq req) { + public PageVo 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); + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorConfigManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorConfigManage.java index b99268a..64219c8 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorConfigManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorConfigManage.java @@ -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 page = req.page(); LambdaQueryWrapper 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 projectIndexList(PerformanceAppraisalListReq req) { + public PageVo projectIndexList(PerformanceAppraisalListReq req) { + Page page = req.page(); + LambdaQueryWrapper 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 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 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); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceIndicatorProjectIndexSaveDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceIndicatorProjectIndexSaveDTO.java new file mode 100644 index 0000000..f0dd3cb --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceIndicatorProjectIndexSaveDTO.java @@ -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; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProjectIndicator.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProjectIndicator.java index 7f1e0ce..8f58fe0 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProjectIndicator.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProjectIndicator.java @@ -47,6 +47,9 @@ public class PerformanceAppraisalProjectIndicator implements Serializable { @ApiModelProperty("佐证材料") private String supportMaterial; + @ApiModelProperty("丽水 区域code") + private String regionCode; + @ApiModelProperty("创建时间") private LocalDateTime createOn; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/req/PerformanceAppraisalListReq.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/req/PerformanceAppraisalListReq.java index 08ff060..cbe4d42 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/req/PerformanceAppraisalListReq.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/req/PerformanceAppraisalListReq.java @@ -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; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexVO.java index 427feb7..67b7cdb 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexVO.java @@ -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 templateDetails; + @ApiModelProperty("更新时间") + private LocalDateTime updateOn; - @ApiModelProperty("附加绩效指标详情") - private List additionalIndexDetails; + @ApiModelProperty("更新人") + private String updateBy; } From d55806b17be512607a6bf6b13a9e3b66353df03b Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Sat, 29 Jul 2023 11:26:05 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E7=BB=A9=E6=95=88=E8=AF=84=E4=BB=B7-?= =?UTF-8?q?=E5=BA=94=E7=94=A8=E6=8C=87=E6=A0=87=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/GeneratorCodeKingbaseConfig.java | 2 +- .../controller/IndicatorConfigController.java | 38 +++++++++++- .../performance/manage/IndicatorConfigManage.java | 68 ++++++++++++++++++++++ .../PerformanceAppraisalAppIndicatorMapper.java | 16 +++++ .../PerformanceAppraisalAppIndicatorMapper.xml | 5 ++ .../dto/PerformanceIndicatorAppIndexSaveDTO.java | 49 ++++++++++++++++ .../entity/PerformanceAppraisalAppIndicator.java | 64 ++++++++++++++++++++ .../pmapi/performance/model/vo/AppIndexVO.java | 61 +++++++++++++++++++ .../pmapi/performance/model/vo/ProjectIndexVO.java | 1 - .../IPerformanceAppraisalAppIndicatorService.java | 16 +++++ ...erformanceAppraisalAppIndicatorServiceImpl.java | 20 +++++++ 11 files changed, 337 insertions(+), 3 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalAppIndicatorMapper.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalAppIndicatorMapper.xml create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceIndicatorAppIndexSaveDTO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalAppIndicator.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/AppIndexVO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceAppraisalAppIndicatorService.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceAppraisalAppIndicatorServiceImpl.java diff --git a/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java b/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java index d205dd7..2b0d82b 100644 --- a/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java +++ b/ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java @@ -57,7 +57,7 @@ public class GeneratorCodeKingbaseConfig { public static void main(String[] args) { //generate("Liuxinxin", "expert", PATH_LXX, "expert_gov_business_strip"); - generate("CMM", "test", PATH_CMM, "nd_performance_appraisal_project_indicator"); + generate("CMM", "test", PATH_CMM, "nd_performance_appraisal_app_indicator"); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/IndicatorConfigController.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/IndicatorConfigController.java index 7a535cb..b303a83 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/IndicatorConfigController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/IndicatorConfigController.java @@ -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.PerformanceIndicatorAppIndexSaveDTO; 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.AppIndexVO; import com.ningdatech.pmapi.performance.model.vo.ProjectIndexTemplateVO; import com.ningdatech.pmapi.performance.model.vo.ProjectIndexVO; import io.swagger.annotations.Api; @@ -46,7 +48,7 @@ public class IndicatorConfigController { public String enOrDisProjectIndexTemplate(@PathVariable Long templateId, @PathVariable Boolean state) { Boolean result = indicatorConfigManage.enOrDisProjectIndexTemplate(templateId, state); - return Boolean.TRUE.equals(result) ? "启用项目指标模版成功":"禁用项目指标模版成功"; + return Boolean.TRUE.equals(result) ? "操作成功":"操作失败"; } @PostMapping("/project/index/template/save") @@ -95,4 +97,38 @@ public class IndicatorConfigController { public ProjectIndexVO projectIndexDetail(@PathVariable Long id) { return indicatorConfigManage.projectIndexDetail(id); } + + @GetMapping("/app/index/list") + @ApiOperation("应用指标库列表") + public PageVo appIndexList(PerformanceAppraisalListReq req) { + return indicatorConfigManage.appIndexList(req); + } + + @PostMapping("/app/index/save") + @ApiOperation("应用指标库新增指标保存") + @WebLog("应用指标库新增指标保存") + public String appIndexSave(@Valid @RequestBody PerformanceIndicatorAppIndexSaveDTO dto) { + return indicatorConfigManage.appIndexSave(dto); + } + + @PostMapping("/app/index/delete/{id}") + @ApiOperation("应用指标库指标删除") + @WebLog("应用指标库指标删除") + public String appIndexDelete(@PathVariable Long id) { + return indicatorConfigManage.appIndexDelete(id); + } + + @PostMapping("/app/index/detail/{id}") + @ApiOperation("应用指标库应用指标详情") + public AppIndexVO appIndexDetail(@PathVariable Long id) { + return indicatorConfigManage.appIndexDetail(id); + } + + @ApiOperation(value = "应用指标启用(禁用)", notes = "应用指标启用(禁用)") + @PutMapping("/app/index/{appId}/active/{state}") + public String enOrDisAppIndex(@PathVariable Long appId, + @PathVariable Boolean state) { + Boolean result = indicatorConfigManage.enOrDisAppIndex(appId, state); + return Boolean.TRUE.equals(result) ? "操作成功":"操作失败"; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorConfigManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorConfigManage.java index 64219c8..70d052a 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorConfigManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorConfigManage.java @@ -13,16 +13,20 @@ 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.PerformanceIndicatorAppIndexSaveDTO; 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.PerformanceAppraisalAppIndicator; 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.AppIndexVO; 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.IPerformanceAppraisalAppIndicatorService; import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalProjectIndicatorService; import com.ningdatech.pmapi.performance.service.IPerformanceIndicatorProjectTemplateDetailService; import com.ningdatech.pmapi.performance.service.IPerformanceIndicatorProjectTemplateService; @@ -55,6 +59,7 @@ public class IndicatorConfigManage { private final IPerformanceIndicatorProjectTemplateService indicatorProjectTemplateService; private final IPerformanceIndicatorProjectTemplateDetailService indicatorProjectTemplateDetailService; private final IPerformanceAppraisalProjectIndicatorService projectIndicatorService; + private final IPerformanceAppraisalAppIndicatorService appIndicatorService; /** * 模板列表 @@ -409,4 +414,67 @@ public class IndicatorConfigManage { } return BeanUtil.copyProperties(projectIndex, ProjectIndexVO.class); } + + public PageVo appIndexList(PerformanceAppraisalListReq req) { + Page page = req.page(); + LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(PerformanceAppraisalAppIndicator.class) + .like(StringUtils.isNotBlank(req.getIndexName()), PerformanceAppraisalAppIndicator::getIndexName, req.getIndexName()) + .orderBy(Boolean.FALSE,Boolean.TRUE, PerformanceAppraisalAppIndicator::getSort); + appIndicatorService.page(page,wrapper); + + if (CollUtil.isEmpty(page.getRecords())){ + return PageVo.empty(); + } + List result = page.getRecords().stream() + .map(i -> BeanUtil.copyProperties(i, AppIndexVO.class)) + .collect(Collectors.toList()); + return PageVo.of(result,page.getTotal()); + } + + public String appIndexSave(PerformanceIndicatorAppIndexSaveDTO dto) { + UserInfoDetails user = LoginUserUtil.loginUserDetail(); + PerformanceAppraisalAppIndicator appIndicator = BeanUtil.copyProperties(dto, PerformanceAppraisalAppIndicator.class); + if(Objects.nonNull(dto.getId())){ + PerformanceAppraisalAppIndicator old = appIndicatorService.getById(dto.getId()); + VUtils.isTrue(Objects.isNull(old)).throwMessage("该项目指标不存在!"); + appIndicator.setId(old.getId()); + }else{ + appIndicator.setId(null); + appIndicator.setCreateOn(LocalDateTime.now()); + appIndicator.setCreateBy(user.getUsername()); + } + appIndicator.setUpdateOn(LocalDateTime.now()); + appIndicator.setUpdateBy(user.getUsername()); + if(appIndicatorService.saveOrUpdate(appIndicator)){ + return "指标新增成功"; + } + return "指标新增失败"; + } + + public String appIndexDelete(Long id) { + PerformanceAppraisalAppIndicator appIndicator = appIndicatorService.getById(id); + VUtils.isTrue(Objects.isNull(appIndicator)).throwMessage("该应用指标不存在!"); + if (appIndicatorService.removeById(id)) { + return "删除成功"; + } + return "操作失败"; + } + + public AppIndexVO appIndexDetail(Long id) { + PerformanceAppraisalAppIndicator appIndex = appIndicatorService.getById(id); + if(Objects.isNull(appIndex)){ + return null; + } + return BeanUtil.copyProperties(appIndex, AppIndexVO.class); + } + + public Boolean enOrDisAppIndex(Long appId, Boolean state) { + PerformanceAppraisalAppIndicator appIndicator = appIndicatorService.getById(appId); + if (Boolean.TRUE.equals(state)){ + appIndicator.setIsDisplay(Boolean.TRUE); + }else { + appIndicator.setIsDisplay(Boolean.FALSE); + } + return appIndicatorService.updateById(appIndicator); + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalAppIndicatorMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalAppIndicatorMapper.java new file mode 100644 index 0000000..3e60b91 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalAppIndicatorMapper.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.performance.mapper; + +import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalAppIndicator; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + *

+ * Mapper 接口 + *

+ * + * @author CMM + * @since 2023-07-29 + */ +public interface PerformanceAppraisalAppIndicatorMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalAppIndicatorMapper.xml b/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalAppIndicatorMapper.xml new file mode 100644 index 0000000..cb8a4d1 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalAppIndicatorMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceIndicatorAppIndexSaveDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceIndicatorAppIndexSaveDTO.java new file mode 100644 index 0000000..4665378 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceIndicatorAppIndexSaveDTO.java @@ -0,0 +1,49 @@ +package com.ningdatech.pmapi.performance.model.dto; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +import javax.validation.constraints.Size; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import org.hibernate.validator.constraints.Range; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + * 绩效评级-应用指标库 新增指标保存 + * @return + * @author CMM + * @since 2023/07/29 10:04 + */ +@Data +@ApiModel(value = "绩效评价考核应用指标库", description = "绩效评价考核应用指标库") +public class PerformanceIndicatorAppIndexSaveDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键ID") + private Long id; + + @ApiModelProperty("指标名称") + private String indexName; + + @ApiModelProperty("指标所属模块") + private String indexOwningModule; + + @ApiModelProperty("指标展示顺序") + private Integer sort; + + @ApiModelProperty("展示形式(1 图标、2 文字、3 评分)") + private Integer displayForm; + + @ApiModelProperty("指标类型(1 通用指标、2 辅助指标)") + private Integer indexType; + + @ApiModelProperty("指标分值") + private BigDecimal indexScore; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalAppIndicator.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalAppIndicator.java new file mode 100644 index 0000000..466807b --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalAppIndicator.java @@ -0,0 +1,64 @@ +package com.ningdatech.pmapi.performance.model.entity; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +/** + *

+ * + *

+ * + * @author CMM + * @since 2023-07-29 + */ +@TableName("nd_performance_appraisal_app_indicator") +@ApiModel(value = "NdPerformanceAppraisalAppIndicator对象", description = "") +@Data +public class PerformanceAppraisalAppIndicator implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键ID") + @TableId(type = IdType.AUTO) + private Long id; + + @ApiModelProperty("指标名称") + private String indexName; + + @ApiModelProperty("指标所属模块") + private String indexOwningModule; + + @ApiModelProperty("指标展示顺序") + private Integer sort; + + @ApiModelProperty("展示形式(1 图标、2 文字、3 评分)") + private Integer displayForm; + + @ApiModelProperty("指标类型(1 通用指标、2 辅助指标)") + private Integer indexType; + + @ApiModelProperty("指标分值") + private BigDecimal indexScore; + + @ApiModelProperty("是否展示") + private Boolean isDisplay; + + @ApiModelProperty("创建时间") + private LocalDateTime createOn; + + @ApiModelProperty("创建人") + private String createBy; + + @ApiModelProperty("更新时间") + private LocalDateTime updateOn; + + @ApiModelProperty("创建人") + private String updateBy; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/AppIndexVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/AppIndexVO.java new file mode 100644 index 0000000..ad8ab6d --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/AppIndexVO.java @@ -0,0 +1,61 @@ +package com.ningdatech.pmapi.performance.model.vo; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.time.LocalDateTime; + +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; + +/** + * 绩效评价-项目指标库 + * @return + * @author CMM + * @since 2023/07/28 14:45 + */ +@Data +@ApiModel(value = "绩效评价项目指标库", description = "绩效评价项目指标库") +public class AppIndexVO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("主键ID") + private Long id; + + @ApiModelProperty("指标名称") + private String indexName; + + @ApiModelProperty("指标所属模块") + private String indexOwningModule; + + @ApiModelProperty("指标展示顺序") + private Integer sort; + + @ApiModelProperty("展示形式(1 图标、2 文字、3 评分)") + private Integer displayForm; + + @ApiModelProperty("指标类型(1 通用指标、2 辅助指标)") + private Integer indexType; + + @ApiModelProperty("指标分值") + private BigDecimal indexScore; + + @ApiModelProperty("是否展示") + private Boolean isDisplay; + + @ApiModelProperty("创建时间") + private LocalDateTime createOn; + + @ApiModelProperty("创建人") + private String createBy; + + @ApiModelProperty("更新时间") + private LocalDateTime updateOn; + + @ApiModelProperty("创建人") + private String updateBy; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexVO.java index 67b7cdb..c1e0b2e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexVO.java @@ -24,7 +24,6 @@ public class ProjectIndexVO implements Serializable { private static final long serialVersionUID = 1L; @ApiModelProperty("主键ID") - @TableId(type = IdType.AUTO) private Long id; @ApiModelProperty("指标名称") diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceAppraisalAppIndicatorService.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceAppraisalAppIndicatorService.java new file mode 100644 index 0000000..940c0f6 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceAppraisalAppIndicatorService.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.performance.service; + +import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalAppIndicator; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + *

+ * 服务类 + *

+ * + * @author CMM + * @since 2023-07-29 + */ +public interface IPerformanceAppraisalAppIndicatorService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceAppraisalAppIndicatorServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceAppraisalAppIndicatorServiceImpl.java new file mode 100644 index 0000000..429d15a --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceAppraisalAppIndicatorServiceImpl.java @@ -0,0 +1,20 @@ +package com.ningdatech.pmapi.performance.service.impl; + +import com.ningdatech.pmapi.performance.model.entity.PerformanceAppraisalAppIndicator; +import com.ningdatech.pmapi.performance.mapper.PerformanceAppraisalAppIndicatorMapper; +import com.ningdatech.pmapi.performance.service.IPerformanceAppraisalAppIndicatorService; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.springframework.stereotype.Service; + +/** + *

+ * 服务实现类 + *

+ * + * @author CMM + * @since 2023-07-29 + */ +@Service +public class PerformanceAppraisalAppIndicatorServiceImpl extends ServiceImpl implements IPerformanceAppraisalAppIndicatorService { + +} From 3aa800debeaf932ce78de9bc3d255285b80c90b7 Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Sat, 29 Jul 2023 17:04:32 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E7=BB=A9=E6=95=88=E8=AF=84=E4=BB=B7-?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=8C=87=E6=A0=87=E6=A8=A1=E7=89=88=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/performance/model/dto/ProjectTemplateDetailDTO.java | 3 +++ .../model/entity/PerformanceIndicatorProjectTemplateDetail.java | 3 +++ .../ningdatech/pmapi/performance/model/vo/ProjectTemplateDetailVO.java | 3 +++ 3 files changed, 9 insertions(+) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/ProjectTemplateDetailDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/ProjectTemplateDetailDTO.java index 91caf9c..516321f 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/ProjectTemplateDetailDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/ProjectTemplateDetailDTO.java @@ -24,6 +24,9 @@ public class ProjectTemplateDetailDTO implements Serializable { @ApiModelProperty("关联模板ID") private Long templateId; + @ApiModelProperty("指标ID") + private Long indexId; + @ApiModelProperty("指标名称") private String name; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceIndicatorProjectTemplateDetail.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceIndicatorProjectTemplateDetail.java index 3e6abcf..4eb23f3 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceIndicatorProjectTemplateDetail.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceIndicatorProjectTemplateDetail.java @@ -37,6 +37,9 @@ public class PerformanceIndicatorProjectTemplateDetail implements Serializable { @ApiModelProperty("关联模板ID") private Long templateId; + @ApiModelProperty("指标ID") + private Long indexId; + @ApiModelProperty("指标名称") private String name; diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectTemplateDetailVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectTemplateDetailVO.java index a006b1d..c4d4b1d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectTemplateDetailVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectTemplateDetailVO.java @@ -23,6 +23,9 @@ public class ProjectTemplateDetailVO implements Serializable { @ApiModelProperty("关联模板ID") private Long templateId; + @ApiModelProperty("指标ID") + private Long indexId; + @ApiModelProperty("指标名称") private String name; From 551453792a42e05d33157be4b1b13b877deb90b0 Mon Sep 17 00:00:00 2001 From: CMM <2198256324@qq.com> Date: Sat, 29 Jul 2023 18:06:59 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E7=BB=A9=E6=95=88=E8=AF=84=E4=BB=B7-?= =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=8C=87=E6=A0=87=E6=A8=A1=E7=89=88=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ningdatech/pmapi/performance/manage/IndicatorConfigManage.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorConfigManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorConfigManage.java index 70d052a..bec49ae 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorConfigManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorConfigManage.java @@ -140,8 +140,6 @@ public class IndicatorConfigManage { //先删除 indicatorProjectTemplateDetailService.remove(Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplateDetail.class) .eq(PerformanceIndicatorProjectTemplateDetail::getTemplateId,dto.getId())); - analysisTemplateDetails(dto.getTemplateDetails(),template.getId()); - //校检 所有3级指标(不包括附加指标) 总分是不是100 List indexList = indicatorProjectTemplateDetailService.list(Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplateDetail.class) .eq(PerformanceIndicatorProjectTemplateDetail::getTemplateId, template.getId()) @@ -151,8 +149,10 @@ public class IndicatorConfigManage { .map(PerformanceIndicatorProjectTemplateDetail::getIndexScore) .filter(Objects::nonNull) .reduce(BigDecimal.ZERO, BigDecimal::add); - VUtils.isTrue((BigDecimal.valueOf(100)).equals(sum)).throwMessage("总分不是100 操作失败!"); + boolean score = (BigDecimal.valueOf(100)).equals(sum); + VUtils.isTrue(Boolean.FALSE.equals(score)).throwMessage("总分不是100 操作失败!"); } + analysisTemplateDetails(dto.getTemplateDetails(),template.getId()); } // 保存 模版附加指标详情 if (CollUtil.isNotEmpty(dto.getAdditionalIndexDetails())){