|
@@ -338,14 +338,19 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
Map<String,BigDecimal> currentMoney= this.moneySum.apply(current);
|
|
|
/*合同金额*/
|
|
|
Map<String,BigDecimal[]> contractMoney = this.contractMoneySum.apply(inventoryForms);
|
|
|
+ Map<String,InventoryForm> dictMap= chapters.stream().collect(Collectors.toMap(InventoryForm::getFormNumber, e->e));
|
|
|
for(Map.Entry<String,BigDecimal[]> cm:contractMoney.entrySet()){
|
|
|
if(Func.isEmpty(cm.getKey()))continue;
|
|
|
- InterimPaymentCertificate ipc = new InterimPaymentCertificate();
|
|
|
+ InventoryForm inventoryForm=dictMap.get(cm.getKey());
|
|
|
+ InterimPaymentCertificate ipc = new InterimPaymentCertificate(inventoryForm.getFormName());
|
|
|
+ /*中期支付汇总的章次*/
|
|
|
+ String ch=inventoryForm.getFormNumber();
|
|
|
+ ipc.setChapterSeq(ch+(BaseUtils.isNumber(ch)?"章":""));
|
|
|
BigDecimal[] bmMoney =cm.getValue();
|
|
|
ipc.setContractAmount(bmMoney[0].toString());
|
|
|
ipc.setRevisedAmount(bmMoney[1].toString());
|
|
|
- ipc.setPreviousPeriodEndPay(previousMoney.getOrDefault(cm.getKey(),BigDecimal.ZERO).toString());
|
|
|
- ipc.setCurrentPeriodPay(currentMoney.getOrDefault(cm.getKey(),BigDecimal.ZERO).toString());
|
|
|
+ ipc.setPreviousPeriodEndPay(StringUtils.handleNull(previousMoney.get(cm.getKey())));
|
|
|
+ ipc.setCurrentPeriodPay(StringUtils.handleNull(currentMoney.get(cm.getKey())));
|
|
|
/*由已知求未知*/
|
|
|
ipc.calculate();
|
|
|
dataList.add(ipc);
|
|
@@ -353,7 +358,8 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
}
|
|
|
/*数据获取end*/
|
|
|
/*本期实际支付合计计算*/
|
|
|
- double total=dataList.stream().map(InterimPaymentCertificate::getCurrentPeriodPay).mapToDouble(Double::parseDouble).sum();
|
|
|
+ interimPaymentCertificates=dataList;
|
|
|
+ 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");
|
|
|
put2FormData(ft,total);
|
|
@@ -362,7 +368,7 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
FormData constructFd =tec.formDataMap.get(InterimPaymentCertificate.TBN+ StringPool.COLON+"key_11");
|
|
|
put2FormData(constructFd,StringUtils.number2String(total*0.75,2));
|
|
|
}
|
|
|
- fieldDataFcMap.put(InterimPaymentCertificate.TBN+ StringPool.COLON+"key_9",(List<InterimPaymentCertificate> list)-> Collections.singletonList(list.stream().map(InterimPaymentCertificate::getCurrentPeriodPay).mapToDouble(Double::parseDouble).sum()));
|
|
|
+ fieldDataFcMap.put(InterimPaymentCertificate.TBN+ StringPool.COLON+"key_9",(List<InterimPaymentCertificate> list)-> Collections.singletonList(list.stream().map(InterimPaymentCertificate::getCurrentPeriodPay).mapToDouble(BaseUtils::obj2DoubleZero).sum()));
|
|
|
/*内容输出*/
|
|
|
putOut();
|
|
|
}
|
|
@@ -381,7 +387,7 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
}
|
|
|
|
|
|
/*合计字段*/
|
|
|
- BiFunction<List<InterimPaymentSummary>,Function<InterimPaymentSummary,String>,String> bfc= (list,fc) -> StringUtils.number2String(list.stream().map(fc).mapToDouble(Double::parseDouble).sum(),1);
|
|
|
+ BiFunction<List<InterimPaymentSummary>,Function<InterimPaymentSummary,String>,String> bfc= (list,fc) -> StringUtils.number2String(list.stream().map(fc).mapToDouble(BaseUtils::obj2DoubleZero).sum(),1);
|
|
|
|
|
|
|
|
|
@Override
|