@@ -57,7 +57,7 @@ public class GeneratorCodeKingbaseConfig { | |||||
public static void main(String[] args) { | public static void main(String[] args) { | ||||
//generate("Liuxinxin", "expert", PATH_LXX, "expert_gov_business_strip"); | //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"); | |||||
} | } | ||||
} | } |
@@ -3,9 +3,11 @@ package com.ningdatech.pmapi.performance.controller; | |||||
import com.ningdatech.basic.model.PageVo; | import com.ningdatech.basic.model.PageVo; | ||||
import com.ningdatech.log.annotation.WebLog; | import com.ningdatech.log.annotation.WebLog; | ||||
import com.ningdatech.pmapi.performance.manage.IndicatorConfigManage; | 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.PerformanceIndicatorProjectIndexSaveDTO; | ||||
import com.ningdatech.pmapi.performance.model.dto.PerformanceIndicatorProjectTemplateSaveDTO; | import com.ningdatech.pmapi.performance.model.dto.PerformanceIndicatorProjectTemplateSaveDTO; | ||||
import com.ningdatech.pmapi.performance.model.req.PerformanceAppraisalListReq; | 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.ProjectIndexTemplateVO; | ||||
import com.ningdatech.pmapi.performance.model.vo.ProjectIndexVO; | import com.ningdatech.pmapi.performance.model.vo.ProjectIndexVO; | ||||
import io.swagger.annotations.Api; | import io.swagger.annotations.Api; | ||||
@@ -46,7 +48,7 @@ public class IndicatorConfigController { | |||||
public String enOrDisProjectIndexTemplate(@PathVariable Long templateId, | public String enOrDisProjectIndexTemplate(@PathVariable Long templateId, | ||||
@PathVariable Boolean state) { | @PathVariable Boolean state) { | ||||
Boolean result = indicatorConfigManage.enOrDisProjectIndexTemplate(templateId, state); | Boolean result = indicatorConfigManage.enOrDisProjectIndexTemplate(templateId, state); | ||||
return Boolean.TRUE.equals(result) ? "启用项目指标模版成功":"禁用项目指标模版成功"; | |||||
return Boolean.TRUE.equals(result) ? "操作成功":"操作失败"; | |||||
} | } | ||||
@PostMapping("/project/index/template/save") | @PostMapping("/project/index/template/save") | ||||
@@ -95,4 +97,38 @@ public class IndicatorConfigController { | |||||
public ProjectIndexVO projectIndexDetail(@PathVariable Long id) { | public ProjectIndexVO projectIndexDetail(@PathVariable Long id) { | ||||
return indicatorConfigManage.projectIndexDetail(id); | return indicatorConfigManage.projectIndexDetail(id); | ||||
} | } | ||||
@GetMapping("/app/index/list") | |||||
@ApiOperation("应用指标库列表") | |||||
public PageVo<AppIndexVO> 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) ? "操作成功":"操作失败"; | |||||
} | |||||
} | } |
@@ -13,16 +13,20 @@ import com.ningdatech.pmapi.common.constant.CommonConst; | |||||
import com.ningdatech.pmapi.common.enumeration.CommonEnum; | import com.ningdatech.pmapi.common.enumeration.CommonEnum; | ||||
import com.ningdatech.pmapi.common.helper.UserInfoHelper; | import com.ningdatech.pmapi.common.helper.UserInfoHelper; | ||||
import com.ningdatech.pmapi.performance.enumration.PerformanceTemplateTypeEnum; | 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.PerformanceIndicatorProjectIndexSaveDTO; | ||||
import com.ningdatech.pmapi.performance.model.dto.PerformanceIndicatorProjectTemplateSaveDTO; | import com.ningdatech.pmapi.performance.model.dto.PerformanceIndicatorProjectTemplateSaveDTO; | ||||
import com.ningdatech.pmapi.performance.model.dto.ProjectTemplateDetailDTO; | 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.PerformanceAppraisalProjectIndicator; | ||||
import com.ningdatech.pmapi.performance.model.entity.PerformanceIndicatorProjectTemplate; | import com.ningdatech.pmapi.performance.model.entity.PerformanceIndicatorProjectTemplate; | ||||
import com.ningdatech.pmapi.performance.model.entity.PerformanceIndicatorProjectTemplateDetail; | import com.ningdatech.pmapi.performance.model.entity.PerformanceIndicatorProjectTemplateDetail; | ||||
import com.ningdatech.pmapi.performance.model.req.PerformanceAppraisalListReq; | 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.ProjectIndexTemplateVO; | ||||
import com.ningdatech.pmapi.performance.model.vo.ProjectIndexVO; | import com.ningdatech.pmapi.performance.model.vo.ProjectIndexVO; | ||||
import com.ningdatech.pmapi.performance.model.vo.ProjectTemplateDetailVO; | 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.IPerformanceAppraisalProjectIndicatorService; | ||||
import com.ningdatech.pmapi.performance.service.IPerformanceIndicatorProjectTemplateDetailService; | import com.ningdatech.pmapi.performance.service.IPerformanceIndicatorProjectTemplateDetailService; | ||||
import com.ningdatech.pmapi.performance.service.IPerformanceIndicatorProjectTemplateService; | import com.ningdatech.pmapi.performance.service.IPerformanceIndicatorProjectTemplateService; | ||||
@@ -55,6 +59,7 @@ public class IndicatorConfigManage { | |||||
private final IPerformanceIndicatorProjectTemplateService indicatorProjectTemplateService; | private final IPerformanceIndicatorProjectTemplateService indicatorProjectTemplateService; | ||||
private final IPerformanceIndicatorProjectTemplateDetailService indicatorProjectTemplateDetailService; | private final IPerformanceIndicatorProjectTemplateDetailService indicatorProjectTemplateDetailService; | ||||
private final IPerformanceAppraisalProjectIndicatorService projectIndicatorService; | private final IPerformanceAppraisalProjectIndicatorService projectIndicatorService; | ||||
private final IPerformanceAppraisalAppIndicatorService appIndicatorService; | |||||
/** | /** | ||||
* 模板列表 | * 模板列表 | ||||
@@ -409,4 +414,67 @@ public class IndicatorConfigManage { | |||||
} | } | ||||
return BeanUtil.copyProperties(projectIndex, ProjectIndexVO.class); | return BeanUtil.copyProperties(projectIndex, ProjectIndexVO.class); | ||||
} | } | ||||
public PageVo<AppIndexVO> appIndexList(PerformanceAppraisalListReq req) { | |||||
Page<PerformanceAppraisalAppIndicator> page = req.page(); | |||||
LambdaQueryWrapper<PerformanceAppraisalAppIndicator> 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<AppIndexVO> 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); | |||||
} | |||||
} | } |
@@ -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; | |||||
/** | |||||
* <p> | |||||
* Mapper 接口 | |||||
* </p> | |||||
* | |||||
* @author CMM | |||||
* @since 2023-07-29 | |||||
*/ | |||||
public interface PerformanceAppraisalAppIndicatorMapper extends BaseMapper<PerformanceAppraisalAppIndicator> { | |||||
} |
@@ -0,0 +1,5 @@ | |||||
<?xml version="1.0" encoding="UTF-8"?> | |||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||||
<mapper namespace="com.ningdatech.pmapi.performance.mapper.PerformanceAppraisalAppIndicatorMapper"> | |||||
</mapper> |
@@ -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; | |||||
} |
@@ -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; | |||||
/** | |||||
* <p> | |||||
* | |||||
* </p> | |||||
* | |||||
* @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; | |||||
} |
@@ -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; | |||||
} |
@@ -24,7 +24,6 @@ public class ProjectIndexVO implements Serializable { | |||||
private static final long serialVersionUID = 1L; | private static final long serialVersionUID = 1L; | ||||
@ApiModelProperty("主键ID") | @ApiModelProperty("主键ID") | ||||
@TableId(type = IdType.AUTO) | |||||
private Long id; | private Long id; | ||||
@ApiModelProperty("指标名称") | @ApiModelProperty("指标名称") | ||||
@@ -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; | |||||
/** | |||||
* <p> | |||||
* 服务类 | |||||
* </p> | |||||
* | |||||
* @author CMM | |||||
* @since 2023-07-29 | |||||
*/ | |||||
public interface IPerformanceAppraisalAppIndicatorService extends IService<PerformanceAppraisalAppIndicator> { | |||||
} |
@@ -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; | |||||
/** | |||||
* <p> | |||||
* 服务实现类 | |||||
* </p> | |||||
* | |||||
* @author CMM | |||||
* @since 2023-07-29 | |||||
*/ | |||||
@Service | |||||
public class PerformanceAppraisalAppIndicatorServiceImpl extends ServiceImpl<PerformanceAppraisalAppIndicatorMapper, PerformanceAppraisalAppIndicator> implements IPerformanceAppraisalAppIndicatorService { | |||||
} |