|
@@ -345,10 +345,10 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
if(Func.isEmpty(cm.getKey()))continue;
|
|
if(Func.isEmpty(cm.getKey()))continue;
|
|
InventoryForm inventoryForm=dictMap.get(cm.getKey());
|
|
InventoryForm inventoryForm=dictMap.get(cm.getKey());
|
|
if(inventoryForm!=null) {
|
|
if(inventoryForm!=null) {
|
|
- InterimPaymentCertificate ipc = new InterimPaymentCertificate(inventoryForm.getFormName());
|
|
|
|
/*中期支付汇总的章次*/
|
|
/*中期支付汇总的章次*/
|
|
String ch = inventoryForm.getFormNumber();
|
|
String ch = inventoryForm.getFormNumber();
|
|
- ipc.setChapterSeq(ch + (BaseUtils.isNumber(ch) ? "章" : ""));
|
|
|
|
|
|
+ InterimPaymentCertificate ipc = new InterimPaymentCertificate(ch + (BaseUtils.isNumber(ch) ? "章" : ""));
|
|
|
|
+ ipc.setChapterSeq(ipc.getItemName());
|
|
BigDecimal[] bmMoney = cm.getValue();
|
|
BigDecimal[] bmMoney = cm.getValue();
|
|
ipc.setContractAmount(bmMoney[0].toString());
|
|
ipc.setContractAmount(bmMoney[0].toString());
|
|
ipc.setRevisedAmount(bmMoney[1].toString());
|
|
ipc.setRevisedAmount(bmMoney[1].toString());
|
|
@@ -425,7 +425,7 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
summary.setCurrentPeriodPay(StringUtils.number2StringZero(bfc.apply(dataList,InterimPaymentSummary::getCurrentPeriodPay),tec.getScale()));
|
|
summary.setCurrentPeriodPay(StringUtils.number2StringZero(bfc.apply(dataList,InterimPaymentSummary::getCurrentPeriodPay),tec.getScale()));
|
|
summary.setCurrentPeriodEndPay(StringUtils.number2StringZero(bfc.apply(dataList,InterimPaymentSummary::getCurrentPeriodEndPay),tec.getScale()));
|
|
summary.setCurrentPeriodEndPay(StringUtils.number2StringZero(bfc.apply(dataList,InterimPaymentSummary::getCurrentPeriodEndPay),tec.getScale()));
|
|
summary.setPayRatioA(ratioFc.apply(summary.getCurrentPeriodEndPay(),summary.getContractAmount()));
|
|
summary.setPayRatioA(ratioFc.apply(summary.getCurrentPeriodEndPay(),summary.getContractAmount()));
|
|
- summary.setPayRatioA(ratioFc.apply(summary.getCurrentPeriodEndPay(),summary.getRevisedAmount()));
|
|
|
|
|
|
+ summary.setPayRatioB(ratioFc.apply(summary.getCurrentPeriodEndPay(),summary.getRevisedAmount()));
|
|
dataList.add(summary);
|
|
dataList.add(summary);
|
|
/*内容输出*/
|
|
/*内容输出*/
|
|
putOut();
|
|
putOut();
|
|
@@ -470,7 +470,7 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
/**支付金额*/
|
|
/**支付金额*/
|
|
private BigDecimal money=BigDecimal.ZERO;
|
|
private BigDecimal money=BigDecimal.ZERO;
|
|
/**本次支付金额*/
|
|
/**本次支付金额*/
|
|
- private BigDecimal currentPeriodPay=BigDecimal.ZERO;
|
|
|
|
|
|
+ /* private BigDecimal currentPeriodPay=BigDecimal.ZERO;*/
|
|
/**累计支付B金额*/
|
|
/**累计支付B金额*/
|
|
private BigDecimal currentPeriodEndPay=BigDecimal.ZERO;
|
|
private BigDecimal currentPeriodEndPay=BigDecimal.ZERO;
|
|
|
|
|
|
@@ -503,8 +503,7 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
/*当前期合并往期计算累计值*/
|
|
/*当前期合并往期计算累计值*/
|
|
public Summary merge(Summary previous){
|
|
public Summary merge(Summary previous){
|
|
if(previous!=null){
|
|
if(previous!=null){
|
|
- this.currentPeriodPay=this.money;
|
|
|
|
- this.currentPeriodEndPay=this.currentPeriodPay.add(previous.money);
|
|
|
|
|
|
+ this.currentPeriodEndPay=this.money.add(previous.money);
|
|
this.completed=this.completed+previous.completed;
|
|
this.completed=this.completed+previous.completed;
|
|
}
|
|
}
|
|
return this;
|
|
return this;
|
|
@@ -539,7 +538,9 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
List<SubprojectInterimPaymentSummary> totalList = new ArrayList<>();
|
|
List<SubprojectInterimPaymentSummary> totalList = new ArrayList<>();
|
|
List<String> numbers= paymentsPeriodEnd.stream().map(Payment::getNumber).distinct().collect(Collectors.toList());
|
|
List<String> numbers= paymentsPeriodEnd.stream().map(Payment::getNumber).distinct().collect(Collectors.toList());
|
|
numbers.forEach(number->{
|
|
numbers.forEach(number->{
|
|
|
|
+ /*往期汇总*/
|
|
Summary pre =preSummary.get(number);
|
|
Summary pre =preSummary.get(number);
|
|
|
|
+ /*本期汇总*/
|
|
Summary cur = currentSummary.get(number);
|
|
Summary cur = currentSummary.get(number);
|
|
SubprojectInterimPaymentSummary sis = new SubprojectInterimPaymentSummary();
|
|
SubprojectInterimPaymentSummary sis = new SubprojectInterimPaymentSummary();
|
|
Summary main =cur;
|
|
Summary main =cur;
|
|
@@ -553,7 +554,6 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
sis.setChangeMoney(main.getChangeMoney().toString());
|
|
sis.setChangeMoney(main.getChangeMoney().toString());
|
|
if(cur!=null){
|
|
if(cur!=null){
|
|
sis.setCurrentPeriodCompleted(cur.getCompleted().toString());
|
|
sis.setCurrentPeriodCompleted(cur.getCompleted().toString());
|
|
- sis.setCurrentPeriodPay(cur.getCurrentPeriodPay().toString());
|
|
|
|
}
|
|
}
|
|
if(pre!=null){
|
|
if(pre!=null){
|
|
sis.setPreviousPeriodPay(pre.getMoney().toString());
|
|
sis.setPreviousPeriodPay(pre.getMoney().toString());
|
|
@@ -561,9 +561,12 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
}
|
|
}
|
|
if(cur!=null&&pre!=null){
|
|
if(cur!=null&&pre!=null){
|
|
main.merge(pre);
|
|
main.merge(pre);
|
|
|
|
+ }else{
|
|
|
|
+ /*如果只有其中一项,则不需要合并金额*/
|
|
|
|
+ main.setCurrentPeriodEndPay(main.getMoney());
|
|
}
|
|
}
|
|
sis.setCompleted(main.getCompleted().toString());
|
|
sis.setCompleted(main.getCompleted().toString());
|
|
- sis.setCurrentPeriodPay(main.getCurrentPeriodPay().toString());
|
|
|
|
|
|
+ sis.setCurrentPeriodPay(main.getMoney().toString());
|
|
sis.setCurrentPeriodEndPay(main.getCurrentPeriodEndPay().toString());
|
|
sis.setCurrentPeriodEndPay(main.getCurrentPeriodEndPay().toString());
|
|
sis.setPayRatio(ratioFc.apply(sis.getCurrentPeriodEndPay(),sis.getChangeMoney()));
|
|
sis.setPayRatio(ratioFc.apply(sis.getCurrentPeriodEndPay(),sis.getChangeMoney()));
|
|
totalList.add(sis);
|
|
totalList.add(sis);
|
|
@@ -663,6 +666,7 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
smps.setItemName(payment.getName());
|
|
smps.setItemName(payment.getName());
|
|
smps.setFormNumber(payment.getNumber());
|
|
smps.setFormNumber(payment.getNumber());
|
|
smps.setUnit(payment.getUnit());
|
|
smps.setUnit(payment.getUnit());
|
|
|
|
+ smps.setPrice(payment.getPrice());
|
|
smps.setRevisedTotal(StringUtils.handleNull(payment.getChangeTotal()));
|
|
smps.setRevisedTotal(StringUtils.handleNull(payment.getChangeTotal()));
|
|
/*本期完成数量*/
|
|
/*本期完成数量*/
|
|
smps.setCurrentPeriodCompleted(StringUtils.handleNull(payment.getCompleted()));
|
|
smps.setCurrentPeriodCompleted(StringUtils.handleNull(payment.getCompleted()));
|
|
@@ -698,17 +702,6 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
/*根据计量单元Id和清单Id分组清单*/
|
|
/*根据计量单元Id和清单Id分组清单*/
|
|
Map<String,Payment> preMeterPaymentGroup = previous.stream().collect(Collectors.toMap(Payment::meterFormKey,p->p,(p1,p2)->p2));
|
|
Map<String,Payment> preMeterPaymentGroup = previous.stream().collect(Collectors.toMap(Payment::meterFormKey,p->p,(p1,p2)->p2));
|
|
FormulaUtils.treeNodeSort(0,top);
|
|
FormulaUtils.treeNodeSort(0,top);
|
|
- /* current.forEach(e -> {
|
|
|
|
- TreeNode<MeterTree> meterTreeNode=treeNodeMap.get(e.getMeterId());
|
|
|
|
- if(meterTreeNode!=null){
|
|
|
|
- MeterTree meterUnit = meterTreeNode.getValue();
|
|
|
|
- List<Payment> paymentList = paymentGroup.get(meterUnit.getId());
|
|
|
|
- for(Payment payment:paymentList){
|
|
|
|
- Payment prePayment = preMeterPaymentGroup.get(meterUnit.getId().toString()+payment.getFormId());
|
|
|
|
- this.treeNodeCheckedCount(meterTreeNode,payment,prePayment);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });*/
|
|
|
|
/*路径选中,设置节点采集数据*/
|
|
/*路径选中,设置节点采集数据*/
|
|
paymentGroup.forEach((k,v)->{
|
|
paymentGroup.forEach((k,v)->{
|
|
TreeNode<MeterTree> meterTreeNode=treeNodeMap.get(k);
|
|
TreeNode<MeterTree> meterTreeNode=treeNodeMap.get(k);
|
|
@@ -723,6 +716,7 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
int size = (int)Math.ceil(tmp.size()/(double)this.capacity);
|
|
int size = (int)Math.ceil(tmp.size()/(double)this.capacity);
|
|
/*每一章需要留一行做小计,其他要填充空白行*/
|
|
/*每一章需要留一行做小计,其他要填充空白行*/
|
|
SubInterimMeterPaySummary summary= new SubInterimMeterPaySummary("小计");
|
|
SubInterimMeterPaySummary summary= new SubInterimMeterPaySummary("小计");
|
|
|
|
+ summary.setCurrentPeriodPay(tmp.stream().filter(e->e.getCompleted()!=null).map(SubInterimMeterPaySummary::getCurrentPeriodPay).filter(BaseUtils::isNumber).map(BigDecimal::new).reduce(BigDecimal.ZERO,BigDecimal::add).toString());
|
|
summary.setCurrentPeriodEndPay(tmp.stream().map(SubInterimMeterPaySummary::getCurrentPeriodEndPay).filter(BaseUtils::isNumber).map(BigDecimal::new).reduce(BigDecimal.ZERO,BigDecimal::add).toString());
|
|
summary.setCurrentPeriodEndPay(tmp.stream().map(SubInterimMeterPaySummary::getCurrentPeriodEndPay).filter(BaseUtils::isNumber).map(BigDecimal::new).reduce(BigDecimal.ZERO,BigDecimal::add).toString());
|
|
summary.setCurrentPeriodEndPay(StringUtils.number2StringZero(summary.getCurrentPeriodEndPay(),tec.getScale()));
|
|
summary.setCurrentPeriodEndPay(StringUtils.number2StringZero(summary.getCurrentPeriodEndPay(),tec.getScale()));
|
|
|
|
|