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 { + +}