소스 검색

Merge remote-tracking branch 'origin/master'

tags/24080901
WendyYang 1 년 전
부모
커밋
85ebd1c41e
25개의 변경된 파일783개의 추가작업 그리고 19개의 파일을 삭제
  1. +1
    -1
      ningda-generator/src/main/java/com/ningdatech/generator/config/GeneratorCodeKingbaseConfig.java
  2. +99
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java
  3. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java
  4. +60
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/IndicatorConfigController.java
  5. +136
    -7
      pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorConfigManage.java
  6. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalAppIndicatorMapper.java
  7. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalAppIndicatorMapper.xml
  8. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalProjectIndicatorMapper.java
  9. +5
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalProjectIndicatorMapper.xml
  10. +49
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceIndicatorAppIndexSaveDTO.java
  11. +56
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceIndicatorProjectIndexSaveDTO.java
  12. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/ProjectTemplateDetailDTO.java
  13. +64
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalAppIndicator.java
  14. +65
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProjectIndicator.java
  15. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceIndicatorProjectTemplateDetail.java
  16. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/req/PerformanceAppraisalListReq.java
  17. +61
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/AppIndexVO.java
  18. +61
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexVO.java
  19. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectTemplateDetailVO.java
  20. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceAppraisalAppIndicatorService.java
  21. +16
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceAppraisalProjectIndicatorService.java
  22. +20
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceAppraisalAppIndicatorServiceImpl.java
  23. +20
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceAppraisalProjectIndicatorServiceImpl.java
  24. +1
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ApplicationManage.java
  25. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java

+ 1
- 1
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_app_indicator");
}

}

+ 99
- 5
pmapi/src/main/java/com/ningdatech/pmapi/ding/controller/DingInfoPullController.java 파일 보기

@@ -4,6 +4,8 @@ import cn.hutool.core.util.StrUtil;
import cn.hutool.crypto.SecureUtil;
import cn.hutool.crypto.digest.HMac;
import cn.hutool.crypto.digest.MD5;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.google.common.collect.Maps;
import com.ningdatech.irs.service.IRefreshTokenService;
import com.ningdatech.pmapi.common.util.CryptUtils;
@@ -20,16 +22,24 @@ import com.sun.crypto.provider.HmacMD5KeyGenerator;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.ResponseEntity;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.client.RestTemplate;
import javax.annotation.Resource;
import java.io.UnsupportedEncodingException;
import java.io.*;
import java.nio.charset.StandardCharsets;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.time.LocalDateTime;
import java.util.Objects;

/**
@@ -119,9 +129,93 @@ public class DingInfoPullController {
return procDefManage.initByArea(areaCode);
}

@ApiOperation(value = "测试项目详情推送", notes = "测试项目详情推送")
@GetMapping("/test-push-project")
public String testPushProject(@ModelAttribute ProjectDTO projectDto) throws Exception {
return appIrsManage.pushProjectDetail(projectDto);
@ApiOperation(value = "项目详情推送", notes = "项目详情推送")
@GetMapping("/push-project")
public String pushProject() throws Exception {
File f = new File("/temp/遂昌归集项目信息(需补).xlsx");
// File f = new File("C:\\Users\\PoffyZhang\\Desktop\\遂昌归集项目信息(需补).xlsx");
Workbook wb = readExcel(new FileInputStream(f),f.getName());
Assert.notNull(wb,"文件流为空");
Row row;
Integer sucessNum = 0;
if(wb != null){
//获取第一个sheet
Sheet sheet = wb.getSheetAt(0);
//获取最大行数
int rownum = sheet.getPhysicalNumberOfRows();
//获取第一行
row = sheet.getRow(0);
//获取最大列数
for (int i = 1; i<rownum; i++) {
row = sheet.getRow(i);
if(Objects.isNull(row) || Objects.isNull(row.getCell(0))){
//取不到数据了 停止
log.info("数据取完");
break;
}
ProjectDTO projectDto = new ProjectDTO();

projectDto.setProjectCode(row.getCell(0).toString());
projectDto.setProjectName(row.getCell(1).toString());
projectDto.setArea(row.getCell(2).toString());
projectDto.setAreaCode(row.getCell(3).toString());
String baseProjType = String.valueOf(row.getCell(4));
if(StringUtils.isNotBlank(baseProjType) && baseProjType.contains(".")){
baseProjType = baseProjType.substring(0,
baseProjType.indexOf("."));
}
projectDto.setBaseProjType(baseProjType);
projectDto.setBaseConstructionType(String.valueOf(row.getCell(5)));
projectDto.setBaseProjConsClass(String.valueOf(row.getCell(6)));
projectDto.setBaseLowestLevel(String.valueOf(row.getCell(7)));
projectDto.setProjectYear(Integer.valueOf(String.valueOf(row.getCell(8))));
projectDto.setBaseProjBasis(String.valueOf(row.getCell(9)));
projectDto.setBuildBasis(String.valueOf(row.getCell(10)));
String baseProjSerProg = String.valueOf(row.getCell(12));
if(StringUtils.isNotBlank(baseProjSerProg) && baseProjSerProg.contains(".")){
baseProjSerProg = baseProjSerProg.substring(0,
baseProjSerProg.indexOf("."));
}
projectDto.setBaseProjSetProg(baseProjSerProg);
projectDto.setResponsibleMan(String.valueOf(row.getCell(13)));
projectDto.setResponsibleManMobile(String.valueOf(row.getCell(14)));
projectDto.setContactName(String.valueOf(row.getCell(15)));
projectDto.setContactPhone(String.valueOf(row.getCell(16)));
projectDto.setBuildOrgName(String.valueOf(row.getCell(18)));
projectDto.setBuildOrgCode(String.valueOf(row.getCell(19)));
projectDto.setSuperOrg(String.valueOf(row.getCell(21)));
projectDto.setSuperOrgCode(String.valueOf(row.getCell(22)));
projectDto.setHigherSuperOrg(String.valueOf(row.getCell(24)));
projectDto.setHigherSuperOrgCode(String.valueOf(row.getCell(25)));

log.info("projectDto :{}",JSON.toJSONString(projectDto));

if(StringUtils.isNotBlank(appIrsManage.pushProjectDetail(projectDto))){
sucessNum ++;
}
}
}

return "推送IRS项目详情成功数量:" + sucessNum;
}

public static Workbook readExcel(InputStream is, String extString){
Workbook wb = null;

extString = extString.substring(extString.lastIndexOf("."));
try {
if(".xls".equals(extString)){
return wb = new HSSFWorkbook(is);
}else if(".xlsx".equals(extString)){
return wb = new XSSFWorkbook(is);
}else {
return wb = null;
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return wb;
}
}

+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/irs/manage/AppIrsManage.java 파일 보기

@@ -304,7 +304,7 @@ public class AppIrsManage {
String ProjPrincipalCall = projectDto.getResponsibleManMobile();//"13884366607"
//内容类别
String baseConstructionType = projectDto.getBaseConstructionType();//"01"
String baseProjType = String.valueOf(projectDto.getProjectType());//"1"
String baseProjType = projectDto.getBaseProjType();//"1"
String baseProjContacts = projectDto.getContactName();//"毛以林"
String isEffective = "1";
String baseConsDeprtDing = projectDto.getBuildOrgCode();//"GO_9a7dce7fbaf54787998fa004f1b7c0e1";
@@ -324,7 +324,7 @@ public class AppIrsManage {
log.error(e.getMessage());
}

String url = "https://interface.zjzwfw.gov.cn/gateway/api/proxy/001003001029/dataSharing/3XN9R93Pva6db7sf.htm?" +
String url = pushProjectUrl+ "?" +
"requestTime=" + timestamp + "&sign=" + sign +
"&appKey=" + appKey + "&baseProjPrincipal=" + baseProjPrincipal + "" +
"&baseProjSetYear=" + baseProjSetYear + "&baseProjId=" + baseProjId +


+ 60
- 2
pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/IndicatorConfigController.java 파일 보기

@@ -3,9 +3,13 @@ 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;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
@@ -44,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")
@@ -70,7 +74,61 @@ 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);
}

@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) ? "操作成功":"操作失败";
}
}

+ 136
- 7
pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorConfigManage.java 파일 보기

@@ -11,16 +11,26 @@ 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.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;
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 +57,9 @@ import java.util.stream.Collectors;
@AllArgsConstructor
public class IndicatorConfigManage {
private final IPerformanceIndicatorProjectTemplateService indicatorProjectTemplateService;

private final IPerformanceIndicatorProjectTemplateDetailService indicatorProjectTemplateDetailService;
private final IPerformanceAppraisalProjectIndicatorService projectIndicatorService;
private final IPerformanceAppraisalAppIndicatorService appIndicatorService;

/**
* 模板列表
@@ -59,7 +70,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()){
@@ -128,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<PerformanceIndicatorProjectTemplateDetail> indexList = indicatorProjectTemplateDetailService.list(Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplateDetail.class)
.eq(PerformanceIndicatorProjectTemplateDetail::getTemplateId, template.getId())
@@ -139,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())){
@@ -324,6 +336,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<PerformanceIndicatorProjectTemplateDetail> projectTemplateDetails = indicatorProjectTemplateDetailService.list(Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplateDetail.class)
@@ -337,6 +351,8 @@ public class IndicatorConfigManage {
newProjectTemplateDetail.setCreateBy(user.getUsername());
newProjectTemplateDetail.setUpdateOn(LocalDateTime.now());
newProjectTemplateDetail.setUpdateBy(user.getUsername());
// 新的指标ID要置空
newProjectTemplateDetail.setId(null);
indicatorProjectTemplateDetailService.save(newProjectTemplateDetail);
}
return "模版复制成功";
@@ -344,8 +360,121 @@ 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();
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);
}

return null;
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);
}
}

+ 16
- 0
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;

/**
* <p>
* Mapper 接口
* </p>
*
* @author CMM
* @since 2023-07-29
*/
public interface PerformanceAppraisalAppIndicatorMapper extends BaseMapper<PerformanceAppraisalAppIndicator> {

}

+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalAppIndicatorMapper.xml 파일 보기

@@ -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>

+ 16
- 0
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;

/**
* <p>
* Mapper 接口
* </p>
*
* @author CMM
* @since 2023-07-28
*/
public interface PerformanceAppraisalProjectIndicatorMapper extends BaseMapper<PerformanceAppraisalProjectIndicator> {

}

+ 5
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceAppraisalProjectIndicatorMapper.xml 파일 보기

@@ -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.PerformanceAppraisalProjectIndicatorMapper">

</mapper>

+ 49
- 0
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;
}

+ 56
- 0
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;
}

+ 3
- 0
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;



+ 64
- 0
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;

/**
* <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;
}

+ 65
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceAppraisalProjectIndicator.java 파일 보기

@@ -0,0 +1,65 @@
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-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("丽水 区域code")
private String regionCode;

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

@ApiModelProperty("创建人")
private String createBy;

@ApiModelProperty("更新时间")
private LocalDateTime updateOn;

@ApiModelProperty("更新人")
private String updateBy;

}

+ 3
- 0
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;



+ 2
- 2
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;
}

+ 61
- 0
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;
}

+ 61
- 0
pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectIndexVO.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 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;

/**
* 绩效评价-项目指标库
* @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("主键ID")
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("丽水 区域code")
private String regionCode;

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

@ApiModelProperty("创建人")
private String createBy;

@ApiModelProperty("更新时间")
private LocalDateTime updateOn;

@ApiModelProperty("更新人")
private String updateBy;
}

+ 3
- 0
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;



+ 16
- 0
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;

/**
* <p>
* 服务类
* </p>
*
* @author CMM
* @since 2023-07-29
*/
public interface IPerformanceAppraisalAppIndicatorService extends IService<PerformanceAppraisalAppIndicator> {

}

+ 16
- 0
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;

/**
* <p>
* 服务类
* </p>
*
* @author CMM
* @since 2023-07-28
*/
public interface IPerformanceAppraisalProjectIndicatorService extends IService<PerformanceAppraisalProjectIndicator> {

}

+ 20
- 0
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;

/**
* <p>
* 服务实现类
* </p>
*
* @author CMM
* @since 2023-07-29
*/
@Service
public class PerformanceAppraisalAppIndicatorServiceImpl extends ServiceImpl<PerformanceAppraisalAppIndicatorMapper, PerformanceAppraisalAppIndicator> implements IPerformanceAppraisalAppIndicatorService {

}

+ 20
- 0
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;

/**
* <p>
* 服务实现类
* </p>
*
* @author CMM
* @since 2023-07-28
*/
@Service
public class PerformanceAppraisalProjectIndicatorServiceImpl extends ServiceImpl<PerformanceAppraisalProjectIndicatorMapper, PerformanceAppraisalProjectIndicator> implements IPerformanceAppraisalProjectIndicatorService {

}

+ 1
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ApplicationManage.java 파일 보기

@@ -106,6 +106,7 @@ public class ApplicationManage {
RestTemplate restTemplate = new RestTemplate();
ResponseEntity<ApiResponse> forEntity = restTemplate.exchange(appUrl, HttpMethod.GET,formEntity, ApiResponse.class);

log.info("forEntity:",JSON.toJSONString(forEntity));
log.info("body:",forEntity.getBody());
ApiResponse body = forEntity.getBody();



+ 3
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectDTO.java 파일 보기

@@ -314,4 +314,7 @@ public class ProjectDTO implements Serializable {

//01政策、法规,02规划或决策部署,03上级下达任务,04领导批示,05单位核心业务或单位职能,00其他,多个时用中文;分割
private String baseProjBasis;

@ApiModelProperty("项目类型 01首次建设;02迭代升级;03结转建设;04新运维;05续运维")
private String baseProjType;
}

불러오는 중...
취소
저장