Browse Source

修改 付款计划

tags/24080901
PoffyZhang 1 year ago
parent
commit
bed2dadf85
4 changed files with 15 additions and 14 deletions
  1. +9
    -8
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionManage.java
  2. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/PaymentPlanSaveDTO.java
  3. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/PaymentPlan.java
  4. +2
    -2
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/PaymentPlanVO.java

+ 9
- 8
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionManage.java View File

@@ -197,24 +197,25 @@ public class ConstructionManage {
ContractVO vo = BeanUtil.copyProperties(contract, ContractVO.class);

List<PaymentPlan> payments = paymentPlanService.list(Wrappers.lambdaQuery(PaymentPlan.class)
.eq(PaymentPlan::getProjectId, projectId));
.eq(PaymentPlan::getProjectId, projectId)
.orderByAsc(PaymentPlan::getPaymentTime));

if(CollUtil.isNotEmpty(payments)){
vo.setPayments(convertPayments(payments));
vo.setPayments(convertPayments(payments,contract.getTotalAmount()));
}

return vo;
}

private List<PaymentPlanVO> convertPayments(List<PaymentPlan> payments) {
private List<PaymentPlanVO> convertPayments(List<PaymentPlan> payments,BigDecimal totalAmount) {
if(CollUtil.isEmpty(payments)){
return Collections.emptyList();
}
return payments.stream().map(p -> {
PaymentPlanVO vo = BeanUtil.copyProperties(p, PaymentPlanVO.class);
vo.setRatio((Objects.isNull(p.getPlanAmount())||p.getPlanAmount().compareTo(BigDecimal.ZERO) == 0) ? "0%"
vo.setRatio((Objects.isNull(totalAmount)||totalAmount.compareTo(BigDecimal.ZERO) == 0) ? "0%"
: p.getPaymentAmount().multiply(BigDecimal.valueOf(100))
.divide(p.getPlanAmount(),BigDecimal.ROUND_CEILING,BigDecimal.ROUND_CEILING) + "%");
.divide(totalAmount,BigDecimal.ROUND_CEILING,BigDecimal.ROUND_CEILING) + "%");
return vo;
})
.collect(Collectors.toList());
@@ -279,10 +280,10 @@ public class ConstructionManage {
if(StringUtils.isNotBlank(project.getPreliminaryInspectionMaterials())){
//进入到下一状态
stateMachineUtils.pass(project);
project.setUpdateOn(LocalDateTime.now());
project.setDeliveryTime(dto.getDeliveryTime());
projectService.updateById(project);
}
project.setUpdateOn(LocalDateTime.now());
project.setDeliveryTime(dto.getDeliveryTime());
projectService.updateById(project);

return "填写成功";
}


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/dto/PaymentPlanSaveDTO.java View File

@@ -23,8 +23,8 @@ public class PaymentPlanSaveDTO {
@ApiModelProperty("项目ID")
private Long projectId;

@ApiModelProperty("计划金额")
private BigDecimal planAmount;
@ApiModelProperty("付款计划")
private String planAmount;

@ApiModelProperty("支付金额")
private BigDecimal paymentAmount;


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/entity/PaymentPlan.java View File

@@ -41,8 +41,8 @@ public class PaymentPlan {
@ApiModelProperty("项目ID")
private Long projectId;

@ApiModelProperty("计划金额")
private BigDecimal planAmount;
@ApiModelProperty("付款计划")
private String planAmount;

@ApiModelProperty("支付金额")
private BigDecimal paymentAmount;


+ 2
- 2
pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/PaymentPlanVO.java View File

@@ -41,8 +41,8 @@ public class PaymentPlanVO {
@ApiModelProperty("项目ID")
private Long projectId;

@ApiModelProperty("计划金额")
private BigDecimal planAmount;
@ApiModelProperty("付款计划")
private String planAmount;

@ApiModelProperty("支付金额")
private BigDecimal paymentAmount;


Loading…
Cancel
Save