From 55aa6212eed862f5095cd942ba193edecd367af4 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Mon, 14 Aug 2023 17:48:00 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E7=BB=AD=E5=BB=BA=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E9=87=91=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../manage/ProjectRenewalFundManage.java | 27 ++++++++++++++++++++++ .../model/vo/ProjectRenewalFundDeclarationVO.java | 4 ++++ wps-convert/HELP.md | 10 ++++++++ 3 files changed, 41 insertions(+) create mode 100644 wps-convert/HELP.md diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java index 8fae0d3..aff05ce 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java @@ -2,7 +2,9 @@ package com.ningdatech.pmapi.projectlib.manage; import cn.hutool.core.util.StrUtil; import com.alibaba.excel.EasyExcel; +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; @@ -22,6 +24,7 @@ import com.ningdatech.pmapi.projectlib.model.entity.ProjectRenewalFundDeclaratio import com.ningdatech.pmapi.projectlib.model.po.ProjectRenewalFundDeclarationPO; import com.ningdatech.pmapi.projectlib.model.req.ProjectRenewalAuditReq; import com.ningdatech.pmapi.projectlib.model.req.ProjectRenewalListReq; +import com.ningdatech.pmapi.projectlib.model.vo.AnnualAmountVO; import com.ningdatech.pmapi.projectlib.model.vo.ProjectRenewalFundDeclarationVO; import com.ningdatech.pmapi.projectlib.service.IProjectRenewalFundDeclarationService; import com.ningdatech.pmapi.projectlib.service.IProjectService; @@ -37,6 +40,7 @@ import java.io.IOException; import java.time.LocalDateTime; import java.util.List; import java.util.Objects; +import java.util.Optional; import java.util.stream.Collectors; /** @@ -100,6 +104,29 @@ public class ProjectRenewalFundManage { vo.setStatus(project.getStatus()); vo.setBuildOrgName(project.getBuildOrgName()); vo.setAnnualPaymentAmount(project.getAnnualPlanAmount()); + if (ProjectStatusEnum.ACCEPTED.getCode().equals(project.getStatus())) { + List annualAmounts = Lists.newArrayList(); + annualAmounts.add(AnnualAmountVO.builder() + .projectId(project.getId()) + .projectYear(project.getProjectYear()) + .annualAmount(project.getAnnualPlanAmount()) + .build()); + List renewalDeclarations = projectRenewalFundDeclarationService.list(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class) + .eq(ProjectRenewalFundDeclaration::getProjectId, vo.getId()) + .eq(ProjectRenewalFundDeclaration::getApprovalStatus, ProjectRenewalApprovalStatusEnum.PASS.name()) + .eq(ProjectRenewalFundDeclaration::getDeleted,Boolean.FALSE) + .orderByAsc(ProjectRenewalFundDeclaration::getProjectYear)); + Optional.ofNullable(renewalDeclarations).ifPresent(declarations -> + declarations.forEach(declaration -> { + annualAmounts.add(AnnualAmountVO.builder() + .projectId(project.getId()) + .projectYear(declaration.getProjectYear()) + .annualAmount(declaration.getAnnualPaymentAmount()) + .build()); + }) + ); + vo.setAnnualAccumulateAmountList(annualAmounts); + } return vo; } diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectRenewalFundDeclarationVO.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectRenewalFundDeclarationVO.java index cf9229d..c530fe0 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectRenewalFundDeclarationVO.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectRenewalFundDeclarationVO.java @@ -7,6 +7,7 @@ import lombok.Data; import java.io.Serializable; import java.math.BigDecimal; import java.time.LocalDateTime; +import java.util.List; /** *

@@ -87,4 +88,7 @@ public class ProjectRenewalFundDeclarationVO implements Serializable { @ApiModelProperty("审核意见") private String auditOpinion; + + @ApiModelProperty("年度投资金额详情") + private List annualAccumulateAmountList; } diff --git a/wps-convert/HELP.md b/wps-convert/HELP.md new file mode 100644 index 0000000..e61384b --- /dev/null +++ b/wps-convert/HELP.md @@ -0,0 +1,10 @@ +# Getting Started + +### Reference Documentation + +For further reference, please consider the following sections: + +* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) +* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.7.14/maven-plugin/reference/html/) +* [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.7.14/maven-plugin/reference/html/#build-image) + From 53bbe193c078128ccc5237b67b7f82fc8748df1d Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Mon, 14 Aug 2023 17:48:28 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E7=BB=AD=E5=BB=BA=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E9=87=91=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wps-convert/HELP.md | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 wps-convert/HELP.md diff --git a/wps-convert/HELP.md b/wps-convert/HELP.md deleted file mode 100644 index e61384b..0000000 --- a/wps-convert/HELP.md +++ /dev/null @@ -1,10 +0,0 @@ -# Getting Started - -### Reference Documentation - -For further reference, please consider the following sections: - -* [Official Apache Maven documentation](https://maven.apache.org/guides/index.html) -* [Spring Boot Maven Plugin Reference Guide](https://docs.spring.io/spring-boot/docs/2.7.14/maven-plugin/reference/html/) -* [Create an OCI image](https://docs.spring.io/spring-boot/docs/2.7.14/maven-plugin/reference/html/#build-image) - From 0b303a4ca6ce1f02c83472b41af79d7449fa0c59 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 15 Aug 2023 09:30:19 +0800 Subject: [PATCH 3/4] =?UTF-8?q?debug=20=E7=BB=AD=E5=BB=BA=E8=B5=84?= =?UTF-8?q?=E9=87=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pmapi/projectlib/manage/ProjectRenewalFundManage.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java index aff05ce..35dc25d 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java @@ -103,7 +103,7 @@ public class ProjectRenewalFundManage { vo.setStage(project.getStage()); vo.setStatus(project.getStatus()); vo.setBuildOrgName(project.getBuildOrgName()); - vo.setAnnualPaymentAmount(project.getAnnualPlanAmount()); + vo.setAnnualPaymentAmount(renewal.getAnnualPaymentAmount()); if (ProjectStatusEnum.ACCEPTED.getCode().equals(project.getStatus())) { List annualAmounts = Lists.newArrayList(); annualAmounts.add(AnnualAmountVO.builder() @@ -149,10 +149,11 @@ public class ProjectRenewalFundManage { ProjectRenewalFundDeclaration oldDeclaration = projectRenewalFundDeclarationService.getById(dto.getId()); VUtils.isTrue(Objects.isNull(oldDeclaration)).throwMessage(String.format("重新申报失败 【%s】 该申报不存在!",dto.getId())); BeanUtils.copyProperties(oldDeclaration,declaration); + }else{ + declaration.setCreateOn(LocalDateTime.now()); + declaration.setUpdateOn(LocalDateTime.now()); } BeanUtils.copyProperties(dto,declaration); - declaration.setCreateOn(LocalDateTime.now()); - declaration.setUpdateOn(LocalDateTime.now()); declaration.setApprovalStatus(ProjectRenewalApprovalStatusEnum.PENDING.name()); declaration.setRegionCode(project.getAreaCode()); declaration.setOrgCode(project.getBuildOrgCode()); From ea8543708dca24dfbeff557d8090ae82c23a83f1 Mon Sep 17 00:00:00 2001 From: PoffyZhang <99775271@qq.com> Date: Tue, 15 Aug 2023 09:40:42 +0800 Subject: [PATCH 4/4] =?UTF-8?q?debug=20=E7=BB=AD=E5=BB=BA=E8=B5=84?= =?UTF-8?q?=E9=87=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java | 2 +- .../pmapi/projectlib/manage/ProjectRenewalFundManage.java | 2 +- .../pmapi/scheduler/task/EarlyWarningInstanceNotStartTask.java | 7 ++----- 3 files changed, 4 insertions(+), 7 deletions(-) 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 127ba0f..5e92531 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 @@ -411,7 +411,7 @@ public class ProjectLibManage { .annualAmount(projectInfo.getAnnualPlanAmount()) .build()); List renewalDeclarations = renewalFundDeclarationService.list(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class) - .eq(ProjectRenewalFundDeclaration::getProjectId, vo.getId()) + .eq(ProjectRenewalFundDeclaration::getProjectId, projectInfo.getId()) .eq(ProjectRenewalFundDeclaration::getApprovalStatus, ProjectRenewalApprovalStatusEnum.PASS.name()) .eq(ProjectRenewalFundDeclaration::getDeleted,Boolean.FALSE) .orderByAsc(ProjectRenewalFundDeclaration::getProjectYear)); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java index 35dc25d..10baa5e 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java @@ -112,7 +112,7 @@ public class ProjectRenewalFundManage { .annualAmount(project.getAnnualPlanAmount()) .build()); List renewalDeclarations = projectRenewalFundDeclarationService.list(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class) - .eq(ProjectRenewalFundDeclaration::getProjectId, vo.getId()) + .eq(ProjectRenewalFundDeclaration::getProjectId, vo.getProjectId()) .eq(ProjectRenewalFundDeclaration::getApprovalStatus, ProjectRenewalApprovalStatusEnum.PASS.name()) .eq(ProjectRenewalFundDeclaration::getDeleted,Boolean.FALSE) .orderByAsc(ProjectRenewalFundDeclaration::getProjectYear)); diff --git a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/EarlyWarningInstanceNotStartTask.java b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/EarlyWarningInstanceNotStartTask.java index 33e06bd..292cee1 100644 --- a/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/EarlyWarningInstanceNotStartTask.java +++ b/pmapi/src/main/java/com/ningdatech/pmapi/scheduler/task/EarlyWarningInstanceNotStartTask.java @@ -114,7 +114,7 @@ public class EarlyWarningInstanceNotStartTask { .eq(Project::getAreaCode, areaCode) .eq(Project::getNewest, Boolean.TRUE) .eq(Project::getStatus,projectStutas)); - log.info("needNextProjects :{}",needNextProjects.size()); + //需要发通知的项目 List needToWaringProjects = needNextProjects.stream() .filter(p -> { @@ -130,9 +130,6 @@ public class EarlyWarningInstanceNotStartTask { } } - log.info("projectId :{}",p.getId()); - log.info("秒数差 :{}",Duration.between(p.getUpdateOn(),LocalDateTime.now()).getSeconds()); - if(Duration.between(p.getUpdateOn(),LocalDateTime.now()).toMinutes() >= time * 60 && //time * 60 Duration.between(p.getUpdateOn(),LocalDateTime.now()).toMinutes() <= time * 60 + 1){ //time * 60 return Boolean.TRUE; @@ -221,7 +218,7 @@ public class EarlyWarningInstanceNotStartTask { .eq(Project::getAreaCode, areaCode) .eq(Project::getNewest, Boolean.TRUE) .eq(Project::getStatus,projectStutas)); - log.info("needNextProjects :{}",needNextProjects.size()); + List projectCodes = needNextProjects.stream().map(Project::getProjectCode).collect(Collectors.toList()); List operations = operationService.list(Wrappers.lambdaQuery(Operation.class)