|
@@ -1046,6 +1046,7 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
InterimPaymentCertificate startPay =new InterimPaymentCertificate("动员预付款");
|
|
|
startPay.setContractAmount(StringUtils.handleNull(tec.meterInfo.getBaseInfo().getDyTotalAmount()));
|
|
|
if(tec.meterInfo.getStartPayFormAll()!=null){
|
|
|
+ /*中期计量第一期之前的*/
|
|
|
List<StartPayForm> startPayForm = tec.getMeterInfo().getStartPayFormAll();
|
|
|
if(startPayForm.size()>0){
|
|
|
if(StringUtils.isNotEmpty(tec.getPeriodInfo().getStartIds())) {
|
|
@@ -1062,7 +1063,7 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
}).collect(Collectors.toList());
|
|
|
if (Func.isNotEmpty(list)) {
|
|
|
StartPayForm relate = list.get(list.size() - 1);
|
|
|
- BigDecimal pre = startPayForm.stream().filter(s -> s.getPeriodSort() <= relate.getPeriodSort()).map(s -> BaseUtils.str2BigDecimal(s.getMeterMoney())).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
+ BigDecimal pre = startPayForm.stream().filter(s -> s.getPeriodSort() <relate.getPeriodSort()).map(s -> BaseUtils.str2BigDecimal(s.getMeterMoney())).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
BigDecimal cur = list.stream().map(s -> BaseUtils.str2BigDecimal(s.getMeterMoney())).reduce(BigDecimal.ZERO, BigDecimal::add);
|
|
|
startPay.setCurrentPeriodPay(cur.toPlainString());
|
|
|
startPay.setPreviousPeriodEndPay(pre.toPlainString());
|
|
@@ -1389,7 +1390,7 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
/**变更数量*/
|
|
|
private Integer changeTotal =0;
|
|
|
/**完成数量*/
|
|
|
- private Double completed=0D;
|
|
|
+ private BigDecimal completed=BigDecimal.ZERO;
|
|
|
/**单价*/
|
|
|
private String price;
|
|
|
/* 本次完成数量
|
|
@@ -1414,7 +1415,7 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
this.unit = p.getUnit();
|
|
|
this.contractTotal=p.getContractTotal();
|
|
|
this.changeTotal = p.getChangeTotal();
|
|
|
- this.completed =p.getCompleted();
|
|
|
+ this.completed =BaseUtils.str2BigDecimal(p.getCompleted());
|
|
|
this.contractMoney =new BigDecimal(p.getContractMoney());
|
|
|
this.changeMoney =new BigDecimal(p.getChangeMoney());
|
|
|
this.money=p.getMoneyAsBigDecimal();
|
|
@@ -1427,7 +1428,7 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
this.itemName=next.itemName;
|
|
|
}
|
|
|
/*本期完成*/
|
|
|
- this.completed =next.completed+this.completed;;
|
|
|
+ this.completed =next.completed.add(this.completed);;
|
|
|
this.money=this.money.add(next.money);
|
|
|
return this;
|
|
|
}
|
|
@@ -1436,7 +1437,7 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
public Summary merge(Summary previous){
|
|
|
if(previous!=null){
|
|
|
this.currentPeriodEndPay=this.money.add(previous.money);
|
|
|
- this.completed=this.completed+previous.completed;
|
|
|
+ this.completed=this.completed.add(previous.completed);
|
|
|
}
|
|
|
return this;
|
|
|
}
|
|
@@ -1482,12 +1483,12 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
sis.setPrice(itf.getBidPrice());
|
|
|
if(cur!=null&&cur.getContractMoney()!=null) {
|
|
|
FormulaUtils.getScale(cur.getUnit()).ifPresent(scale->{
|
|
|
- cur.setCompleted(BaseUtils.str2BigDecimal(cur.getCompleted()).setScale(scale,RoundingMode.HALF_UP).doubleValue());
|
|
|
+ cur.setCompleted(BaseUtils.str2BigDecimal(cur.getCompleted()).setScale(scale,RoundingMode.HALF_UP));
|
|
|
cur.setMoney(BaseUtils.str2BigDecimal(multiFc.apply(cur.getPrice(),cur.getCompleted().toString())).setScale(0,RoundingMode.HALF_UP));
|
|
|
if (pre != null) {
|
|
|
- pre.setCompleted(BaseUtils.str2BigDecimal(pre.getCompleted()).setScale(scale,RoundingMode.HALF_UP).doubleValue());
|
|
|
+ pre.setCompleted(BaseUtils.str2BigDecimal(pre.getCompleted()).setScale(scale,RoundingMode.HALF_UP));
|
|
|
pre.setMoney(BaseUtils.str2BigDecimal(multiFc.apply(pre.getPrice(),pre.getCompleted().toString())).setScale(0,RoundingMode.HALF_UP));
|
|
|
- end.setCompleted(BaseUtils.str2BigDecimal(addFc.apply(cur.getCompleted().toString(),pre.getCompleted().toString())).setScale(scale,RoundingMode.HALF_UP).doubleValue());
|
|
|
+ end.setCompleted(BaseUtils.str2BigDecimal(addFc.apply(cur.getCompleted().toString(),pre.getCompleted().toString())).setScale(scale,RoundingMode.HALF_UP));
|
|
|
end.setMoney(BaseUtils.str2BigDecimal(multiFc.apply(end.getPrice(),end.getCompleted().toString())).setScale(0,RoundingMode.HALF_UP));
|
|
|
}else {
|
|
|
end.setCompleted(cur.getCompleted());
|
|
@@ -1495,13 +1496,13 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
}
|
|
|
});
|
|
|
sis.setCurrentPeriodPay(cur.getMoney().toPlainString());
|
|
|
- sis.setCurrentPeriodCompleted(cur.getCompleted().toString());
|
|
|
+ sis.setCurrentPeriodCompleted(cur.getCompleted().toPlainString());
|
|
|
if (pre != null) {
|
|
|
- sis.setPreviousPeriodPay(pre.getMoney().toString());
|
|
|
- sis.setPreviousPeriodCompleted(pre.getCompleted().toString());
|
|
|
+ sis.setPreviousPeriodPay(pre.getMoney().toPlainString());
|
|
|
+ sis.setPreviousPeriodCompleted(pre.getCompleted().toPlainString());
|
|
|
}
|
|
|
- sis.setCompleted(end.getCompleted().toString());
|
|
|
- sis.setCurrentPeriodEndPay(end.getMoney().toString());
|
|
|
+ sis.setCompleted(end.getCompleted().toPlainString());
|
|
|
+ sis.setCurrentPeriodEndPay(end.getMoney().toPlainString());
|
|
|
sis.setPayRatio(ratioFc.apply(sis.getCurrentPeriodEndPay(), sis.getChangeMoney()));
|
|
|
}
|
|
|
totalList.add(sis);
|