Browse Source

合同备案 接口

tags/24080901
PoffyZhang 1 year ago
parent
commit
560601a6c8
2 changed files with 11 additions and 1 deletions
  1. +8
    -1
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/manage/ConstructionManage.java
  2. +3
    -0
      pmapi/src/main/java/com/ningdatech/pmapi/projectdeclared/model/vo/PaymentPlanVO.java

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

@@ -45,6 +45,7 @@ import org.springframework.stereotype.Component;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@@ -209,7 +210,13 @@ public class ConstructionManage {
if(CollUtil.isEmpty(payments)){
return Collections.emptyList();
}
return payments.stream().map(p -> BeanUtil.copyProperties(p,PaymentPlanVO.class))
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%"
: p.getPaymentAmount().multiply(BigDecimal.valueOf(100))
.divide(p.getPlanAmount(),BigDecimal.ROUND_CEILING,BigDecimal.ROUND_CEILING) + "%");
return vo;
})
.collect(Collectors.toList());
}



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

@@ -47,6 +47,9 @@ public class PaymentPlanVO {
@ApiModelProperty("支付金额")
private BigDecimal paymentAmount;

@ApiModelProperty("支付比例")
private String ratio;

@ApiModelProperty("支付时间")
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDateTime paymentTime;


Loading…
Cancel
Save