PoffyZhang 1 year ago
parent
commit
1abc8787dc
2 changed files with 31 additions and 0 deletions
  1. +27
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java
  2. +4
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectRenewalFundDeclarationVO.java

+ 27
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectRenewalFundManage.java View File

@@ -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<AnnualAmountVO> annualAmounts = Lists.newArrayList();
annualAmounts.add(AnnualAmountVO.builder()
.projectId(project.getId())
.projectYear(project.getProjectYear())
.annualAmount(project.getAnnualPlanAmount())
.build());
List<ProjectRenewalFundDeclaration> 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;
}



+ 4
- 0
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectRenewalFundDeclarationVO.java View File

@@ -7,6 +7,7 @@ import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
* <p>
@@ -87,4 +88,7 @@ public class ProjectRenewalFundDeclarationVO implements Serializable {

@ApiModelProperty("审核意见")
private String auditOpinion;

@ApiModelProperty("年度投资金额详情")
private List<AnnualAmountVO> annualAccumulateAmountList;
}

Loading…
Cancel
Save