|
@@ -912,6 +912,7 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
LinkedHashMap<Integer,MeterPeriodInfo> monthMeterMap=meterPeriodInfoMap.values().stream().collect(Collectors.toMap(e->e.getFormPrintDate().getMonthValue(),t->t,(v1,v2)->v2,LinkedHashMap::new));
|
|
|
/* 根据清单编号、计量期分组*/
|
|
|
Map<String,Map<Long,List<Payment>>> paymentGroup=paymentsPeriodEnd.stream().collect(Collectors.groupingBy(Payment::getNumber,Collectors.groupingBy(Payment::getPeriodId,Collectors.toList())));
|
|
|
+ /*获取最大月份,暂时不考虑跨年*/
|
|
|
int max=monthMeterMap.keySet().stream().max(Comparator.comparingInt(t->t)).orElse(12);
|
|
|
BaseInfo baseInfo =tec.meterInfo.getBaseInfo();
|
|
|
totalList.sort(Comparator.comparing(e -> getPrefix(e.getFormNumber())));
|
|
@@ -939,9 +940,11 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
pl.addAll(pays);
|
|
|
}
|
|
|
}
|
|
|
+ List<Payment> add =new ArrayList<>();
|
|
|
if(pl.size()>0) {
|
|
|
- sis.getMonthlyCompletion().add(new ArrayList<>(pl));
|
|
|
+ add.addAll(pl);
|
|
|
}
|
|
|
+ sis.getMonthlyCompletion().add(add);
|
|
|
}
|
|
|
});
|
|
|
/* 输出设置
|
|
@@ -953,14 +956,18 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
return StringPool.EMPTY;
|
|
|
}else{
|
|
|
List<Payment> cur=l.get(month);
|
|
|
- String money=cur.stream().map(Payment::getMoneyAsBigDecimal).reduce(BigDecimal.ZERO,BigDecimal::add).toString();
|
|
|
- String change =cur.get(0).getChangeMoney();
|
|
|
- return ratioFc.apply(money,change);
|
|
|
+ if(cur.size()>0) {
|
|
|
+ String money = cur.stream().map(Payment::getMoneyAsBigDecimal).reduce(BigDecimal.ZERO, BigDecimal::add).toString();
|
|
|
+ String change = cur.get(0).getChangeMoney();
|
|
|
+ return ratioFc.apply(money, change);
|
|
|
+ }else{
|
|
|
+ return "0";
|
|
|
+ }
|
|
|
}
|
|
|
});
|
|
|
}).collect(Collectors.toList()));
|
|
|
/*分页*/
|
|
|
- List<List<ConstructionSchedule>> pageList = BaseUtils.splitList(totalList,capacity);
|
|
|
+ List<List<ConstructionSchedule>> pageList = BaseUtils.splitList(totalList,capacity-1);
|
|
|
BiFunction<List<ConstructionSchedule>,Function<ConstructionSchedule,String>,String> sumFc= (page,fc)->page.stream().map(fc).map(BaseUtils::str2BigDecimal).reduce(BigDecimal.ZERO,BigDecimal::add).toString();
|
|
|
pageList.forEach(page->{
|
|
|
dataList.addAll(page);
|