|
@@ -35,6 +35,7 @@ import java.util.stream.Stream;
|
|
|
public class ExecutorMeter extends FormulaExecutor {
|
|
|
private Function<Long, List<Material>> materialFormFc;
|
|
|
private Function<Long, List<Payment>> paymentListFc;
|
|
|
+ private Function<Long, List<MidPayItem>> midPayItemListFc;
|
|
|
private Function<Long, List<InventoryForm>> inventoryFormFc;
|
|
|
private Function<Long, List<MeterApply>> meterApplyFc;
|
|
|
private Function<Long, List<StartPayForm>> stayPayFormFc;
|
|
@@ -309,7 +310,6 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
/*数据获取start*/
|
|
|
/*支付数据*/
|
|
|
List<Payment> paymentList=paymentListFc.apply(tec.getContractId());
|
|
|
-
|
|
|
/*合同计量清单*/
|
|
|
List<InventoryForm> inventoryForms = inventoryFormFc.apply(tec.getContractId());
|
|
|
InventoryForm root = null;
|
|
@@ -326,6 +326,7 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ Map<String,InterimPaymentCertificate> paymentCertificateMap = new LinkedHashMap<>();
|
|
|
if(Func.isNotEmpty(paymentList)){
|
|
|
/*之前的计量期数据*/
|
|
|
previous = paymentList.stream().filter(e->e.getSort()<tec.periodInfo.getSort()).collect(Collectors.toList());
|
|
@@ -355,13 +356,25 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
ipc.setCurrentPeriodPay(StringUtils.handleNull(currentMoney.get(cm.getKey())));
|
|
|
/*由已知求未知*/
|
|
|
ipc.calculate();
|
|
|
- dataList.add(ipc);
|
|
|
+ //dataList.add(ipc);
|
|
|
+ paymentCertificateMap.put(ch,ipc);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- /*数据获取end*/
|
|
|
/*本期实际支付合计计算*/
|
|
|
- interimPaymentCertificates=dataList;
|
|
|
+ interimPaymentCertificates= new ArrayList<>(paymentCertificateMap.values());
|
|
|
+ /*合同段支付项*/
|
|
|
+ List<MidPayItem> midPayItemList=midPayItemListFc.apply(tec.getContractId());
|
|
|
+ if(Func.isNotEmpty(midPayItemList)){
|
|
|
+ midPayItemList.forEach(e->{
|
|
|
+ InterimPaymentCertificate ipc = paymentCertificateMap.get(e.getPayNumber());
|
|
|
+ if(ipc==null){
|
|
|
+ ipc= new InterimPaymentCertificate(e.getPayName());
|
|
|
+ }
|
|
|
+ dataList.add(ipc);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ /*数据获取end*/
|
|
|
double total=dataList.stream().map(InterimPaymentCertificate::getCurrentPeriodPay).mapToDouble(BaseUtils::obj2DoubleZero).sum();
|
|
|
if(total>0){
|
|
|
FormData ft =tec.formDataMap.get(InterimPaymentCertificate.TBN+ StringPool.COLON+"key_9");
|