|
|
@@ -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 "填写成功"; |
|
|
|
} |
|
|
|