Browse Source

累积投资金额 放到项目详情

tags/24080901
PoffyZhang 1 year ago
parent
commit
b4ee2ba136
12 changed files with 80 additions and 218 deletions
  1. +0
    -12
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/helper/ProjectHelper.java
  2. +30
    -11
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java
  3. +0
    -16
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectAnnualAccumulateAmountMapper.java
  4. +0
    -5
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectAnnualAccumulateAmountMapper.xml
  5. +0
    -34
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectAnnualAccumulateAmountSaveDTO.java
  6. +17
    -17
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java
  7. +0
    -48
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectAnnualAccumulateAmount.java
  8. +32
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/AnnualAmountVO.java
  9. +0
    -36
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectAnnualAccumulateAmountVO.java
  10. +1
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java
  11. +0
    -16
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectAnnualAccumulateAmountService.java
  12. +0
    -22
      pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectAnnualAccumulateAmountServiceImpl.java

+ 0
- 12
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/helper/ProjectHelper.java View File

@@ -3,7 +3,6 @@ package com.ningdatech.pmapi.projectlib.helper;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectAnnualAccumulateAmount;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication; import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication;
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectApplicationVO; import com.ningdatech.pmapi.projectlib.model.vo.ProjectApplicationVO;
@@ -53,17 +52,6 @@ public class ProjectHelper {
} }


/** /**
* 转换年度投资详情
* @param amount
* @return
*/
public static String convertAnnualAmountDetail(ProjectAnnualAccumulateAmount amount) {
StringBuffer sb = new StringBuffer();
sb.append(amount.getProjectYear() + "年投资" + amount.getConvertTenThousand() + "万元。\n");
return sb.toString();
}

/**
* 转换VO * 转换VO
* @param app * @param app
* @return * @return


+ 30
- 11
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/manage/ProjectLibManage.java View File

@@ -3,22 +3,26 @@ package com.ningdatech.pmapi.projectlib.manage;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.google.common.collect.Lists;
import com.ningdatech.basic.model.PageVo; import com.ningdatech.basic.model.PageVo;
import com.ningdatech.basic.util.CollUtils; import com.ningdatech.basic.util.CollUtils;
import com.ningdatech.pmapi.projectlib.enumeration.ProjectStatusEnum;
import com.ningdatech.pmapi.projectlib.helper.ProjectHelper; import com.ningdatech.pmapi.projectlib.helper.ProjectHelper;
import com.ningdatech.pmapi.projectlib.model.entity.Project; import com.ningdatech.pmapi.projectlib.model.entity.Project;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectAnnualAccumulateAmount;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication; import com.ningdatech.pmapi.projectlib.model.entity.ProjectApplication;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectRenewalFundDeclaration;
import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq; import com.ningdatech.pmapi.projectlib.model.req.ProjectListReq;
import com.ningdatech.pmapi.projectlib.model.vo.AnnualAmountVO;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO; import com.ningdatech.pmapi.projectlib.model.vo.ProjectDetailVO;
import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO; import com.ningdatech.pmapi.projectlib.model.vo.ProjectLibListItemVO;
import com.ningdatech.pmapi.projectlib.service.IProjectAnnualAccumulateAmountService;
import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService; import com.ningdatech.pmapi.projectlib.service.IProjectApplicationService;
import com.ningdatech.pmapi.projectlib.service.IProjectRenewalFundDeclarationService;
import com.ningdatech.pmapi.projectlib.service.IProjectService; import com.ningdatech.pmapi.projectlib.service.IProjectService;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;


import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.Objects; import java.util.Objects;
import java.util.Optional; import java.util.Optional;
@@ -39,7 +43,7 @@ public class ProjectLibManage {


private final IProjectApplicationService applicationService; private final IProjectApplicationService applicationService;


private final IProjectAnnualAccumulateAmountService announcementAccumulateAmountService;
private final IProjectRenewalFundDeclarationService renewalFundDeclarationService;


public PageVo<ProjectLibListItemVO> projectLibList(ProjectListReq req) { public PageVo<ProjectLibListItemVO> projectLibList(ProjectListReq req) {
LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req); LambdaQueryWrapper<Project> query = ProjectHelper.projectQuery(req);
@@ -88,14 +92,29 @@ public class ProjectLibManage {
vo.setProjectApplications(CollUtils.convert(apps, vo.setProjectApplications(CollUtils.convert(apps,
ProjectHelper::convertVO) ProjectHelper::convertVO)
)); ));
//查询年度投资金额
List<ProjectAnnualAccumulateAmount> annualAmount = announcementAccumulateAmountService.list(Wrappers.lambdaQuery(ProjectAnnualAccumulateAmount.class)
.eq(ProjectAnnualAccumulateAmount::getProjectId, vo.getId())
.orderByAsc(ProjectAnnualAccumulateAmount::getProjectYear));
Optional.ofNullable(annualAmount).ifPresent(amounts ->
vo.setAnnualAccumulateAmountDetail(CollUtils.joinByComma(
amounts,ProjectHelper::convertAnnualAmountDetail)
));

//查询年度投资金额 要是已验收的项目
if(ProjectStatusEnum.ACCEPTED.getCode().equals(projectInfo.getStatus())){
List<AnnualAmountVO> annualAmounts = Lists.newArrayList();
annualAmounts.add(AnnualAmountVO.builder()
.projectId(projectInfo.getId())
.projectYear(projectInfo.getProjectYear())
.annualAmount(projectInfo.getAnnualPlanAmount())
.build());
List<ProjectRenewalFundDeclaration> renewalDeclarations = renewalFundDeclarationService.list(Wrappers.lambdaQuery(ProjectRenewalFundDeclaration.class)
.eq(ProjectRenewalFundDeclaration::getProjectId, vo.getId())
.orderByAsc(ProjectRenewalFundDeclaration::getProjectYear));
Optional.ofNullable(renewalDeclarations).ifPresent(declarations ->
declarations.forEach(declaration -> {
annualAmounts.add(AnnualAmountVO.builder()
.projectId(projectInfo.getId())
.projectYear(declaration.getProjectYear())
.annualAmount(declaration.getAnnualPaymentAmount())
.build());
})
);
vo.setAnnualAccumulateAmountList(annualAmounts);
}
return vo; return vo;
} }




+ 0
- 16
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectAnnualAccumulateAmountMapper.java View File

@@ -1,16 +0,0 @@
package com.ningdatech.pmapi.projectlib.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectAnnualAccumulateAmount;

/**
* <p>
* Mapper 接口
* </p>
*
* @author zpf
* @since 2023-02-17
*/
public interface ProjectAnnualAccumulateAmountMapper extends BaseMapper<ProjectAnnualAccumulateAmount> {

}

+ 0
- 5
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/mapper/ProjectAnnualAccumulateAmountMapper.xml View File

@@ -1,5 +0,0 @@
<?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.projectlib.mapper.ProjectAnnualAccumulateAmountMapper">

</mapper>

+ 0
- 34
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/dto/ProjectAnnualAccumulateAmountSaveDTO.java View File

@@ -1,34 +0,0 @@
package com.ningdatech.pmapi.projectlib.model.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;

/**
* @Classname ProjectAnnualAccumulateAmountSaveDTO
* @Description
* @Date 2023/2/17 10:49
* @Author PoffyZhang
*/
@Data
@ApiModel(value = "ProjectAnnualAccumulateAmountSaveDTO", description = "项目年度累积投资资金保存")
public class ProjectAnnualAccumulateAmountSaveDTO implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("项目ID")
@NotNull
private Long projectId;

@NotNull
@ApiModelProperty("年份")
private Integer projectYear;

@NotNull
@ApiModelProperty("年度投资金额")
private BigDecimal annualAccumulateAmount;
}

+ 17
- 17
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/Project.java View File

@@ -118,52 +118,52 @@ public class Project implements Serializable {
@ApiModelProperty("项目简介") @ApiModelProperty("项目简介")
private String projectIntroduction; private String projectIntroduction;


@ApiModelProperty("资金申报情况-申报金额(元)")
@ApiModelProperty("资金申报情况-申报金额(元)")
private BigDecimal declareAmount; private BigDecimal declareAmount;


@ApiModelProperty("资金申报情况-自有金额(元)")
@ApiModelProperty("资金申报情况-自有金额(元)")
private BigDecimal declareHaveAmount; private BigDecimal declareHaveAmount;


@ApiModelProperty("资金申报情况-政府投资-本级财政资金(元)")
@ApiModelProperty("资金申报情况-政府投资-本级财政资金(元)")
private BigDecimal declareGovOwnFinanceAmount; private BigDecimal declareGovOwnFinanceAmount;


@ApiModelProperty("资金申报情况-政府投资-上级补助资金(元)")
@ApiModelProperty("资金申报情况-政府投资-上级补助资金(元)")
private BigDecimal declareGovSuperiorFinanceAmount; private BigDecimal declareGovSuperiorFinanceAmount;


@ApiModelProperty("银行贷款(元)")
@ApiModelProperty("银行贷款(元)")
private BigDecimal declareBankLendingAmount; private BigDecimal declareBankLendingAmount;


@ApiModelProperty("其它资金(元)")
@ApiModelProperty("其它资金(元)")
private BigDecimal declareOtherAmount; private BigDecimal declareOtherAmount;


@ApiModelProperty("资金分配情况-软件开发(元)")
@ApiModelProperty("资金分配情况-软件开发(元)")
private BigDecimal softwareDevelopmentAmount; private BigDecimal softwareDevelopmentAmount;


@ApiModelProperty("资金分配情况-云资源、硬件购置(元)")
@ApiModelProperty("资金分配情况-云资源、硬件购置(元)")
private BigDecimal cloudHardwarePurchaseAmount; private BigDecimal cloudHardwarePurchaseAmount;


@ApiModelProperty("资金分配情况-第三方服务(元)")
@ApiModelProperty("资金分配情况-第三方服务(元)")
private BigDecimal thirdPartyAmount; private BigDecimal thirdPartyAmount;


@ApiModelProperty("年度支付计划-年度支付计划(元)")
@ApiModelProperty("年度支付计划-年度支付计划(元)")
private BigDecimal annualPlanAmount; private BigDecimal annualPlanAmount;


@ApiModelProperty("年度支付计划-自有金额(元)")
@ApiModelProperty("年度支付计划-自有金额(元)")
private BigDecimal annualPlanHaveAmount; private BigDecimal annualPlanHaveAmount;


@ApiModelProperty("年度支付计划-政府投资-本级财政资金(元)")
@ApiModelProperty("年度支付计划-政府投资-本级财政资金(元)")
private BigDecimal annualPlanGovOwnFinanceAmount; private BigDecimal annualPlanGovOwnFinanceAmount;


@ApiModelProperty("年度支付计划-政府投资-上级补助资金(元)")
@ApiModelProperty("年度支付计划-政府投资-上级补助资金(元)")
private BigDecimal annualPlanGovSuperiorFinanceAmount; private BigDecimal annualPlanGovSuperiorFinanceAmount;


@ApiModelProperty("年度支付计划-银行贷款(元)")
@ApiModelProperty("年度支付计划-银行贷款(元)")
private BigDecimal annualPlanBankLendingAmount; private BigDecimal annualPlanBankLendingAmount;


@ApiModelProperty("年度支付计划-其它资金(元)")
@ApiModelProperty("年度支付计划-其它资金(元)")
private BigDecimal annualPlanOtherAmount; private BigDecimal annualPlanOtherAmount;


@ApiModelProperty("立项批复资金(元)")
@ApiModelProperty("立项批复资金(元)")
private BigDecimal approvalAmount; private BigDecimal approvalAmount;


private LocalDateTime annualPlanAddTime; private LocalDateTime annualPlanAddTime;
@@ -177,7 +177,7 @@ public class Project implements Serializable {
@ApiModelProperty("安全投入-内容描述") @ApiModelProperty("安全投入-内容描述")
private String safetyInputDescribe; private String safetyInputDescribe;


@ApiModelProperty("安全投入-金额(元)")
@ApiModelProperty("安全投入-金额(元)")
private BigDecimal safetyInputAmount; private BigDecimal safetyInputAmount;


@ApiModelProperty("附件-初步方案") @ApiModelProperty("附件-初步方案")


+ 0
- 48
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/entity/ProjectAnnualAccumulateAmount.java View File

@@ -1,48 +0,0 @@
package com.ningdatech.pmapi.projectlib.model.entity;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.time.LocalDateTime;
import java.util.Objects;

/**
* @Classname NdProjectAnnualAccumulateAmount
* @Description
* @Date 2023/2/17 10:49
* @Author PoffyZhang
*/
@Data
@TableName("nd_project_annual_accumulate_amount")
@ApiModel(value = "NdProjectAnnualAccumulateAmount", description = "项目年度累积投资资金表")
public class ProjectAnnualAccumulateAmount implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("主键")
@TableId(type = IdType.AUTO)
private Long id;

@ApiModelProperty("项目ID")
private Long projectId;

@ApiModelProperty("年份")
private Integer projectYear;

@ApiModelProperty("年度投资金额")
private BigDecimal annualAccumulateAmount;

private LocalDateTime createOn;
private LocalDateTime updateOn;

public BigDecimal getConvertTenThousand() {
if(Objects.nonNull(this.annualAccumulateAmount)){
return this.annualAccumulateAmount.divide(BigDecimal.valueOf(10000),2, RoundingMode.HALF_UP);
}
return BigDecimal.ZERO;
}
}

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

@@ -0,0 +1,32 @@
package com.ningdatech.pmapi.projectlib.model.vo;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

/**
* @Classname AnnualAmountVO
* @Description
* @Date 2023/2/17 13:37
* @Author PoffyZhang
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class AnnualAmountVO {

@ApiModelProperty("项目ID")
private Long projectId;

@ApiModelProperty("年份")
private Integer projectYear;

@ApiModelProperty("年度投资资金")
private BigDecimal annualAmount;

}

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

@@ -1,36 +0,0 @@
package com.ningdatech.pmapi.projectlib.model.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
* @Classname ProjectAnnualAccumulateAmountVO
* @Description
* @Date 2023/2/17 10:49
* @Author PoffyZhang
*/
@Data
@ApiModel(value = "ProjectAnnualAccumulateAmountVO", description = "项目年度累积投资资金VO")
public class ProjectAnnualAccumulateAmountVO implements Serializable {

private static final long serialVersionUID = 1L;

@ApiModelProperty("主键")
private Long id;

@ApiModelProperty("项目ID")
private Long projectId;

@ApiModelProperty("年份")
private Integer projectYear;

@ApiModelProperty("年度投资金额")
private BigDecimal annualAccumulateAmount;

private Long createBy;
private Long updateBy;
}

+ 1
- 1
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/model/vo/ProjectDetailVO.java View File

@@ -275,7 +275,7 @@ public class ProjectDetailVO {
private Map<String, Object> dynamicForm; private Map<String, Object> dynamicForm;


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


private String projectTypeName; private String projectTypeName;




+ 0
- 16
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/IProjectAnnualAccumulateAmountService.java View File

@@ -1,16 +0,0 @@
package com.ningdatech.pmapi.projectlib.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectAnnualAccumulateAmount;

/**
* <p>
* 服务类
* </p>
*
* @author zpf
* @since 2023-02-17
*/
public interface IProjectAnnualAccumulateAmountService extends IService<ProjectAnnualAccumulateAmount> {

}

+ 0
- 22
pmapi/src/main/java/com/ningdatech/pmapi/projectlib/service/impl/ProjectAnnualAccumulateAmountServiceImpl.java View File

@@ -1,22 +0,0 @@
package com.ningdatech.pmapi.projectlib.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ningdatech.pmapi.projectlib.mapper.ProjectAnnualAccumulateAmountMapper;
import com.ningdatech.pmapi.projectlib.model.entity.ProjectAnnualAccumulateAmount;
import com.ningdatech.pmapi.projectlib.service.IProjectAnnualAccumulateAmountService;
import org.springframework.stereotype.Service;

/**
* <p>
* 服务实现类
* </p>
*
* @author WendyYang
* @since 2023-02-05
*/
@Service
public class ProjectAnnualAccumulateAmountServiceImpl
extends ServiceImpl<ProjectAnnualAccumulateAmountMapper, ProjectAnnualAccumulateAmount>
implements IProjectAnnualAccumulateAmountService {

}

Loading…
Cancel
Save