From b902a510a9802f5a711f07f73d9c2fb3faf25dcb Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 27 Jun 2023 15:10:09 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=BA=94=E7=94=A8=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/ProjectApplicationController.java | 4 +-- .../pmapi/projectlib/manage/ApplicationManage.java | 35 +++++++++++++++++----- .../pmapi/projectlib/manage/ProjectLibManage.java | 2 +- 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectApplicationController.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectApplicationController.java index edba6bf..4378fcf 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectApplicationController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/controller/ProjectApplicationController.java @@ -24,10 +24,10 @@ public class ProjectApplicationController { private final ApplicationManage applicationManage; - @GetMapping("/get-report") + @GetMapping("/get-report/{appCode}") @ApiOperation("获取应用 试运行报告") @WebLog("获取应用 试运行报告") - public String getReport(@RequestParam(required = false) String appCode) { + public String getReport(@PathVariable String appCode) { return applicationManage.getReport(appCode); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ApplicationManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ApplicationManage.java index 1497136..b80a1e0 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ApplicationManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ApplicationManage.java @@ -1,7 +1,12 @@ package com.ningdatech.pmapi.projectlib.manage; +import cn.hutool.core.collection.CollUtil; import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.ningdatech.basic.exception.BizException; import com.ningdatech.basic.function.VUtils; +import com.ningdatech.basic.model.ApiResponse; import com.ningdatech.pmapi.common.util.HmacAuthUtil; import com.ningdatech.pmapi.projectlib.model.dto.ApplicationAppCodeSaveDTO; import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication; @@ -9,11 +14,9 @@ import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService; import com.ningdatech.pmapi.user.util.LoginUserUtil; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Value; -import org.springframework.http.HttpEntity; -import org.springframework.http.HttpHeaders; -import org.springframework.http.HttpMethod; -import org.springframework.http.ResponseEntity; +import org.springframework.http.*; import org.springframework.stereotype.Component; import org.springframework.util.MultiValueMap; import org.springframework.web.client.RestTemplate; @@ -85,11 +88,29 @@ public class ApplicationManage { HttpEntity> formEntity = new HttpEntity>(headers); RestTemplate restTemplate = new RestTemplate(); - ResponseEntity forEntity = restTemplate.exchange(url, HttpMethod.GET,formEntity, String.class); + ResponseEntity forEntity = restTemplate.exchange(appUrl, HttpMethod.GET,formEntity, ApiResponse.class); log.info("body:",forEntity.getBody()); - String body = forEntity.getBody(); + ApiResponse body = forEntity.getBody(); - return null; + if(!body.getCode().equals(HttpStatus.OK.value())){ + throw new BizException(body.getMessage()); + } + + Object data = body.getData(); + if(Objects.nonNull(data)){ + JSONObject dataJson = JSON.parseObject(JSON.toJSONString(data)); + JSONArray resourceList = dataJson.getJSONArray("resourceList"); + if(CollUtil.isNotEmpty(resourceList)){ + JSONObject resource = JSON.parseObject(JSON.toJSONString(resourceList.get(0))); + if(StringUtils.isBlank(resource.getString("reportOss"))){ + //暂时没有 appCode 所以先返回测试数据 + return "https://irs-yyyw.oss-cn-hangzhou-zwynet-d01-a.internet.cloud.zj.gov.cn/tmp/%E6%B8%A9%E5%B7%9E%E5%B8%82%E4%B9%90%E6%B8%85%E5%B8%82%E5%8C%BA%E5%9F%9F%E4%BD%93%E6%A3%80%E4%BF%A1%E6%81%AF%E7%B3%BB%E7%BB%9F_9cf0b901f2ca4fbf8ff274da359ad219.html?Expires=1687833685&OSSAccessKeyId=wMhEw2BhpIDc1xwO&Signature=UPAbMdDy23FI1sNemszg5WH%2BG40%3D"; + }else{ + return resource.getString("reportOss"); + } + } + } + throw new BizException("获取报告失败!"); } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java index 05999dc..a0c13a9 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java @@ -731,7 +731,7 @@ public class ProjectLibManage { if(StringUtils.isNotBlank(req.getApplicationName())){ wrapper.and(q1 -> q1.like(ProjectApplication::getApplicationName,req.getApplicationName()) - .or(q2 -> q2.like(ProjectApplication::getAccountAppName,req.getApplicationName()))); + .or(q2 -> q2.like(ProjectApplication::getRelatedExistsApplication,req.getApplicationName()))); } wrapper.orderByDesc(ProjectApplication::getUpdateOn); projectApplicationService.page(page,wrapper); From c4662828585a3bb13ac8ac8d4aa2e19217f387cf Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 27 Jun 2023 17:37:35 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=BB=A9=E6=95=88?= =?UTF-8?q?=E6=8C=87=E6=A0=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/common/constant/RegionConst.java | 2 + .../PerformanceIndicatorTemplateController.java | 8 ++ .../enumration/PerformanceTemplateTypeEnum.java | 44 ++++++++ .../manage/IndicatorTemplateManage.java | 123 ++++++++++++++++++++- ...rmanceIndicatorProjectTemplateDetailMapper.java | 16 +++ ...ormanceIndicatorProjectTemplateDetailMapper.xml | 5 + ...PerformanceIndicatorProjectTemplateSaveDTO.java | 6 +- .../model/dto/ProjectTemplateDetailDTO.java | 3 +- .../PerformanceIndicatorProjectTemplate.java | 3 + .../vo/PerformanceIndicatorProjectTemplateVO.java | 9 +- .../model/vo/ProjectTemplateDetailVO.java | 42 +++++++ ...manceIndicatorProjectTemplateDetailService.java | 16 +++ ...eIndicatorProjectTemplateDetailServiceImpl.java | 21 ++++ .../projectdeclared/manage/PurchaseManage.java | 32 ++++-- .../projectdeclared/model/dto/PurchaseSaveDTO.java | 2 + 15 files changed, 316 insertions(+), 16 deletions(-) create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/performance/enumration/PerformanceTemplateTypeEnum.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceIndicatorProjectTemplateDetailMapper.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceIndicatorProjectTemplateDetailMapper.xml create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectTemplateDetailVO.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceIndicatorProjectTemplateDetailService.java create mode 100644 pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceIndicatorProjectTemplateDetailServiceImpl.java diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/RegionConst.java b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/RegionConst.java index 014a1d9..84f1c9b 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/RegionConst.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/common/constant/RegionConst.java @@ -24,6 +24,8 @@ public interface RegionConst { * 丽水行政区划编码 */ String RC_LS = "331100"; + //遂昌县 + String RC_SC = "331123"; /** * 中国行政区划编码 diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/PerformanceIndicatorTemplateController.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/PerformanceIndicatorTemplateController.java index 95161dc..d5951ed 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/PerformanceIndicatorTemplateController.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/controller/PerformanceIndicatorTemplateController.java @@ -1,6 +1,7 @@ package com.ningdatech.pmapi.performance.controller; import com.ningdatech.basic.model.PageVo; +import com.ningdatech.log.annotation.WebLog; import com.ningdatech.pmapi.performance.manage.IndicatorTemplateManage; import com.ningdatech.pmapi.performance.model.dto.PerformanceIndicatorProjectTemplateSaveDTO; import com.ningdatech.pmapi.performance.model.req.PerformanceAppraisalListReq; @@ -32,8 +33,15 @@ public class PerformanceIndicatorTemplateController { return indicatorTemplateManage.projectList(req); } + @GetMapping("/project/detail/{id}") + @ApiOperation("项目指标配置模板详情") + public PerformanceIndicatorProjectTemplateVO projectDetail(@PathVariable Long id) { + return indicatorTemplateManage.projectDetail(id); + } + @PostMapping("/project/save") @ApiOperation("项目指标配置模板保存") + @WebLog("项目指标配置模板保存") public String projectTemplateSave(@Valid @RequestBody PerformanceIndicatorProjectTemplateSaveDTO dto) { return indicatorTemplateManage.projectTemplateSave(dto); } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/enumration/PerformanceTemplateTypeEnum.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/enumration/PerformanceTemplateTypeEnum.java new file mode 100644 index 0000000..51f7bfc --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/enumration/PerformanceTemplateTypeEnum.java @@ -0,0 +1,44 @@ +package com.ningdatech.pmapi.performance.enumration; + +import lombok.AllArgsConstructor; +import lombok.Getter; +import lombok.NoArgsConstructor; +import org.apache.commons.lang3.StringUtils; + +import java.util.Objects; + +/** + *

+ * PerformanceTemplateTypeEnum + *

+ * + * @author Poffy + * @since 16:56 2023/6/27 + */ +@Getter +@AllArgsConstructor +@NoArgsConstructor +public enum PerformanceTemplateTypeEnum { + /** + * 模板类型 + */ + STAGE(0, "阶段"), + FIRST_INDEX(1, "第一指标"), + SECOND_INDEX(2, "第二指标"), + THIRD_INDEX(3, "第三指标"); + + private Integer code; + private String desc; + + public static String getDesc(Integer code) { + if (Objects.isNull(code)) { + return StringUtils.EMPTY; + } + for (PerformanceTemplateTypeEnum t : PerformanceTemplateTypeEnum.values()) { + if (code.equals(t.getCode())) { + return t.desc; + } + } + return StringUtils.EMPTY; + } +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorTemplateManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorTemplateManage.java index a0465f6..8865874 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorTemplateManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/manage/IndicatorTemplateManage.java @@ -1,16 +1,23 @@ package com.ningdatech.pmapi.performance.manage; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.collection.CollUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.google.common.collect.Lists; import com.ningdatech.basic.exception.BizException; import com.ningdatech.basic.function.VUtils; import com.ningdatech.basic.model.PageVo; +import com.ningdatech.pmapi.performance.enumration.PerformanceTemplateTypeEnum; import com.ningdatech.pmapi.performance.model.dto.PerformanceIndicatorProjectTemplateSaveDTO; +import com.ningdatech.pmapi.performance.model.dto.ProjectTemplateDetailDTO; 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.PerformanceIndicatorProjectTemplateVO; +import com.ningdatech.pmapi.performance.model.vo.ProjectTemplateDetailVO; +import com.ningdatech.pmapi.performance.service.IPerformanceIndicatorProjectTemplateDetailService; import com.ningdatech.pmapi.performance.service.IPerformanceIndicatorProjectTemplateService; import com.ningdatech.pmapi.user.security.auth.model.UserInfoDetails; import com.ningdatech.pmapi.user.util.LoginUserUtil; @@ -20,6 +27,7 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Component; import java.time.LocalDateTime; +import java.util.Collections; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; @@ -36,6 +44,8 @@ import java.util.stream.Collectors; public class IndicatorTemplateManage { private final IPerformanceIndicatorProjectTemplateService indicatorTemplateService; + private final IPerformanceIndicatorProjectTemplateDetailService indicatorProjectTemplateDetailService; + /** * 模板列表 * @param req @@ -60,6 +70,26 @@ public class IndicatorTemplateManage { } /** + * 查询项目模板详情 + * @param id + * @return + */ + public PerformanceIndicatorProjectTemplateVO projectDetail(Long id) { + PerformanceIndicatorProjectTemplate template = indicatorTemplateService.getById(id); + if(Objects.isNull(template)){ + return null; + } + PerformanceIndicatorProjectTemplateVO vo = BeanUtil.copyProperties(template, + PerformanceIndicatorProjectTemplateVO.class); + List templateDetails = indicatorProjectTemplateDetailService.list(Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplateDetail.class) + .eq(PerformanceIndicatorProjectTemplateDetail::getTemplateId, id)); + if(CollUtil.isNotEmpty(templateDetails)){ + vo.setTemplateDetails(buildTemplateDetail(templateDetails)); + } + return vo; + } + + /** * 项目指标 模板保存 * @param dto * @return @@ -67,7 +97,6 @@ public class IndicatorTemplateManage { public String projectTemplateSave(PerformanceIndicatorProjectTemplateSaveDTO dto) { UserInfoDetails user = LoginUserUtil.loginUserDetail(); PerformanceIndicatorProjectTemplate template = BeanUtil.copyProperties(dto, PerformanceIndicatorProjectTemplate.class); - if(Objects.nonNull(dto.getId())){ PerformanceIndicatorProjectTemplate old = indicatorTemplateService.getById(dto.getId()); VUtils.isTrue(Objects.isNull(old)).throwMessage("该模板不存在!"); @@ -77,14 +106,100 @@ public class IndicatorTemplateManage { template.setCreateOn(LocalDateTime.now()); template.setCreateBy(user.getUsername()); } - template.setUpdateOn(LocalDateTime.now()); template.setUpdateBy(user.getUsername()); if(indicatorTemplateService.saveOrUpdate(template)){ //保存 模板的详情 - return "保存成功"; + if(CollUtil.isNotEmpty(dto.getTemplateDetails())){ + //先删除 + indicatorProjectTemplateDetailService.remove(Wrappers.lambdaQuery(PerformanceIndicatorProjectTemplateDetail.class) + .eq(PerformanceIndicatorProjectTemplateDetail::getTemplateId,dto.getId())); + analysisTemplateDetails(dto.getTemplateDetails(),template.getId()); + } + return "保存成功"; } - throw new BizException("保存失败!"); } + + /** + * 解析 项目考核指标 + * @param templateDetails + * @return + */ + private void analysisTemplateDetails( + List templateDetails,Long templateId) { + List details = Lists.newArrayList(); + if(CollUtil.isEmpty(templateDetails)){ + return; + } + + analysisTemplateDetailsInner(templateDetails,templateId,null); + } + + private void analysisTemplateDetailsInner(List templateDetails, + Long templateId,Long parentId) { + if(CollUtil.isEmpty(templateDetails)){ + return; + } + UserInfoDetails user = LoginUserUtil.loginUserDetail(); + for(ProjectTemplateDetailDTO detail : templateDetails){ + PerformanceIndicatorProjectTemplateDetail templateDetail = BeanUtil.copyProperties(detail, PerformanceIndicatorProjectTemplateDetail.class); + templateDetail.setCreateBy(user.getUsername()); + templateDetail.setCreateOn(LocalDateTime.now()); + templateDetail.setUpdateBy(user.getUsername()); + templateDetail.setUpdateOn(LocalDateTime.now()); + templateDetail.setTemplateId(templateId); + templateDetail.setParentId(parentId); + indicatorProjectTemplateDetailService.save(templateDetail); + + if(CollUtil.isNotEmpty(detail.getChildren())){ + analysisTemplateDetailsInner(detail.getChildren(),templateId,templateDetail.getId()); + } + } + } + + /** + * 装配 模板详情 + * @param templateDetails + * @return + */ + private List buildTemplateDetail(List templateDetails) { + List res = Lists.newArrayList(); + //第一层是 一级的 + for(PerformanceIndicatorProjectTemplateDetail templateDetail : templateDetails){ + if(PerformanceTemplateTypeEnum.STAGE.getCode().equals(templateDetail.getType())){ + ProjectTemplateDetailVO detailVo = BeanUtil.copyProperties(templateDetail, ProjectTemplateDetailVO.class); + List secondList = Lists.newArrayList(); + for(PerformanceIndicatorProjectTemplateDetail templateDetailSecond : templateDetails) { + if (Objects.nonNull(templateDetailSecond.getParentId()) && + templateDetailSecond.getParentId().equals(templateDetail.getId())) { + ProjectTemplateDetailVO detailSecondVo = BeanUtil.copyProperties(templateDetailSecond, ProjectTemplateDetailVO.class); + List thirdList = Lists.newArrayList(); + for(PerformanceIndicatorProjectTemplateDetail templateDetailThird : templateDetails) { + if (Objects.nonNull(templateDetailThird.getParentId()) && + templateDetailThird.getParentId().equals(templateDetailSecond.getId())) { + ProjectTemplateDetailVO detailThirdVo = BeanUtil.copyProperties(templateDetailThird, ProjectTemplateDetailVO.class); + List fourList = Lists.newArrayList(); + for(PerformanceIndicatorProjectTemplateDetail templateDetailFour : templateDetails) { + if (Objects.nonNull(templateDetailFour.getParentId()) && + templateDetailFour.getParentId().equals(templateDetailThird.getId())) { + ProjectTemplateDetailVO detailFourVo = BeanUtil.copyProperties(templateDetailFour, ProjectTemplateDetailVO.class); + fourList.add(detailFourVo); + } + } + detailThirdVo.setChildren(fourList); + thirdList.add(detailThirdVo); + } + } + detailSecondVo.setChildren(thirdList); + secondList.add(detailSecondVo); + } + } + detailVo.setChildren(secondList); + res.add(detailVo); + } + } + + return res; + } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceIndicatorProjectTemplateDetailMapper.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceIndicatorProjectTemplateDetailMapper.java new file mode 100644 index 0000000..d0e9a73 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceIndicatorProjectTemplateDetailMapper.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.performance.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ningdatech.pmapi.performance.model.entity.PerformanceIndicatorProjectTemplateDetail; + +/** + *

+ * Mapper 接口 + *

+ * + * @author Zpf + * @since 2023-06-03 + */ +public interface PerformanceIndicatorProjectTemplateDetailMapper extends BaseMapper { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceIndicatorProjectTemplateDetailMapper.xml b/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceIndicatorProjectTemplateDetailMapper.xml new file mode 100644 index 0000000..16a746b --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/mapper/PerformanceIndicatorProjectTemplateDetailMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceIndicatorProjectTemplateSaveDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceIndicatorProjectTemplateSaveDTO.java index 36dcba5..56503b4 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceIndicatorProjectTemplateSaveDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/dto/PerformanceIndicatorProjectTemplateSaveDTO.java @@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty; import lombok.Data; import java.io.Serializable; +import java.util.List; /** * @Classname PerformanceIndicatorProjectTemplateSaveDTO @@ -30,9 +31,12 @@ public class PerformanceIndicatorProjectTemplateSaveDTO implements Serializable @ApiModelProperty("项目年度") private Integer projectYear; + @ApiModelProperty("项目类型 ") + private Integer projectType; + @ApiModelProperty("项目资金范围 1.500万元以下、2.500-2000万元,3.2000万元及以上") private Integer amountRange; @ApiModelProperty("绩效指标详情") - private ProjectTemplateDetailDTO templateDetail; + private List templateDetails; } 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 843220a..2f0afab 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 @@ -9,6 +9,7 @@ import lombok.Data; import java.io.Serializable; import java.time.LocalDateTime; +import java.util.List; /** * @Classname PerformanceIndicatorProjectTemplateDetail @@ -41,5 +42,5 @@ public class ProjectTemplateDetailDTO implements Serializable { private String scoreRubric; @ApiModelProperty("子指标") - private ProjectTemplateDetailDTO children; + private List children; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceIndicatorProjectTemplate.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceIndicatorProjectTemplate.java index dda9e60..338195e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceIndicatorProjectTemplate.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/entity/PerformanceIndicatorProjectTemplate.java @@ -41,6 +41,9 @@ public class PerformanceIndicatorProjectTemplate implements Serializable { @ApiModelProperty("项目年度") private Integer projectYear; + @ApiModelProperty("项目类型") + private Integer projectType; + @ApiModelProperty("项目资金范围 1.500万元以下、2.500-2000万元,3.2000万元及以上") private Integer amountRange; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceIndicatorProjectTemplateVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceIndicatorProjectTemplateVO.java index d8c61f1..81b7416 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceIndicatorProjectTemplateVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/PerformanceIndicatorProjectTemplateVO.java @@ -6,9 +6,10 @@ import lombok.Data; import java.io.Serializable; import java.time.LocalDateTime; +import java.util.List; /** - * @Classname PerformanceIndicatorTemplateVO + * @Classname PerformanceIndicatorProjectTemplateVO * @Description 绩效评价考核项目指标模板 * @Date 2023/6/19 14:02 * @Author PoffyZhang @@ -36,6 +37,12 @@ public class PerformanceIndicatorProjectTemplateVO implements Serializable { @ApiModelProperty("项目年度") private Integer projectYear; + @ApiModelProperty("项目类型") + private Integer projectType; + @ApiModelProperty("项目资金范围 1.500万元以下、2.500-2000万元,3.2000万元及以上") private Integer amountRange; + + @ApiModelProperty("绩效指标详情") + private List templateDetails; } 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 new file mode 100644 index 0000000..7ee7ad6 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/model/vo/ProjectTemplateDetailVO.java @@ -0,0 +1,42 @@ +package com.ningdatech.pmapi.performance.model.vo; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * @Classname PerformanceIndicatorProjectTemplateDetail + * @Description 绩效评价考核项目指标模板 + * @Date 2023/6/19 14:02 + * @Author PoffyZhang + */ +@Data +@ApiModel(value = "绩效评价考核项目指标模板详情保存树", description = "绩效评价考核项目指标模板详情保存树") +public class ProjectTemplateDetailVO implements Serializable { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty("关联模板ID") + private Long templateId; + + @ApiModelProperty("指标名称") + private String name; + + @ApiModelProperty("指标类型 0阶段 1一级指标 2二级指标 3三级指标") + private Integer type; + + @ApiModelProperty("父级指标id") + private Long parentId; + + @ApiModelProperty("分数 3级指标才有") + private Integer score; + + @ApiModelProperty("分数细则 3级指标才有") + private String scoreRubric; + + @ApiModelProperty("子指标") + private List children; +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceIndicatorProjectTemplateDetailService.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceIndicatorProjectTemplateDetailService.java new file mode 100644 index 0000000..ff9d7a1 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/IPerformanceIndicatorProjectTemplateDetailService.java @@ -0,0 +1,16 @@ +package com.ningdatech.pmapi.performance.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.ningdatech.pmapi.performance.model.entity.PerformanceIndicatorProjectTemplateDetail; + +/** + *

+ * 服务类 + *

+ * + * @author PoffyZhang + * @since 2023-06-03 + */ +public interface IPerformanceIndicatorProjectTemplateDetailService extends IService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceIndicatorProjectTemplateDetailServiceImpl.java b/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceIndicatorProjectTemplateDetailServiceImpl.java new file mode 100644 index 0000000..660c459 --- /dev/null +++ b/pmapi/src/main/java/com/ningdatech/pmapi/performance/service/impl/PerformanceIndicatorProjectTemplateDetailServiceImpl.java @@ -0,0 +1,21 @@ +package com.ningdatech.pmapi.performance.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.ningdatech.pmapi.performance.mapper.PerformanceIndicatorProjectTemplateDetailMapper; +import com.ningdatech.pmapi.performance.model.entity.PerformanceIndicatorProjectTemplateDetail; +import com.ningdatech.pmapi.performance.service.IPerformanceIndicatorProjectTemplateDetailService; +import org.springframework.stereotype.Service; + +/** + *

+ * 绩效评价详情 服务实现类 + *

+ * + * @author ZPF + * @since 2023-06-15 + */ +@Service +public class PerformanceIndicatorProjectTemplateDetailServiceImpl extends ServiceImpl + implements IPerformanceIndicatorProjectTemplateDetailService { + +} diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PurchaseManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PurchaseManage.java index e7b9583..21d3e78 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PurchaseManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/PurchaseManage.java @@ -12,6 +12,7 @@ import com.ningdatech.basic.model.PageVo; import com.ningdatech.basic.util.CollUtils; import com.ningdatech.basic.util.NdDateUtils; import com.ningdatech.pmapi.common.constant.BizConst; +import com.ningdatech.pmapi.common.constant.RegionConst; import com.ningdatech.pmapi.common.helper.UserInfoHelper; import com.ningdatech.pmapi.common.statemachine.util.StateMachineUtils; import com.ningdatech.pmapi.common.util.ExcelDownUtil; @@ -191,15 +192,28 @@ public class PurchaseManage { purchaseEntity.setId(purchase.getId()); } purchaseEntity.setProjectId(projectId); - purchaseService.saveOrUpdate(purchaseEntity); - - //进入到下一状态 - stateMachineUtils.pass(project); - project.setUpdateOn(LocalDateTime.now()); - project.setTransactionAmount(dto.getTransactionAmount()); - project.setTransactionTime(dto.getTransactionTime()); - projectService.updateById(project); + if(purchaseService.saveOrUpdate(purchaseEntity)){ + //如果 需要推送项目和应用管理的话 只有遂昌县才有 +// String areaCode = project.getAreaCode(); +// String appCode = dto.getAppCode(); +// if(RegionConst.RC_SC.equals(areaCode) && StringUtils.isNotBlank(appCode)){ +// try{ +// +// }catch (Exception e){ +// log.info("绑定以及推送项目和应用关系 失败! {}" + e.getMessage()); +// } +// } + + //进入到下一状态 + stateMachineUtils.pass(project); + project.setUpdateOn(LocalDateTime.now()); + project.setTransactionAmount(dto.getTransactionAmount()); + project.setTransactionTime(dto.getTransactionTime()); + projectService.updateById(project); + + return "填写成功"; + } - return "填写成功"; + return "保存失败"; } } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/PurchaseSaveDTO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/PurchaseSaveDTO.java index 784c639..9ea6aa3 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/PurchaseSaveDTO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/PurchaseSaveDTO.java @@ -56,4 +56,6 @@ public class PurchaseSaveDTO { @ApiModelProperty("中标通知书") private String acceptanceLetter; + @ApiModelProperty("应用编码") + private String appCode; }