|
@@ -376,25 +376,38 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
List<Payment> pre=tec.meterInfo.getPaymentListMap().get(MeterInfo.PRE);
|
|
List<Payment> pre=tec.meterInfo.getPaymentListMap().get(MeterInfo.PRE);
|
|
List<Payment> cur=tec.meterInfo.getPaymentListMap().get(MeterInfo.CUR);
|
|
List<Payment> cur=tec.meterInfo.getPaymentListMap().get(MeterInfo.CUR);
|
|
List<Payment> end=tec.meterInfo.getPaymentListMap().get(MeterInfo.END);
|
|
List<Payment> end=tec.meterInfo.getPaymentListMap().get(MeterInfo.END);
|
|
|
|
+ Map<SupervisionCertificate,Map<Function<SupervisionCertificate,String>,Consumer<String>>> summaryConfigMap = new HashMap<>();
|
|
itemNamesMap.forEach((k,v)->{
|
|
itemNamesMap.forEach((k,v)->{
|
|
SupervisionCertificate sc = new SupervisionCertificate();
|
|
SupervisionCertificate sc = new SupervisionCertificate();
|
|
sc.setItemName(k);
|
|
sc.setItemName(k);
|
|
- List<Payment> p = pre.stream().filter(e->getPrefix(e.getNumber()).equals("100")).collect(Collectors.toList());
|
|
|
|
- List<Payment> c = cur.stream().filter(e->getPrefix(e.getNumber()).equals("100")).collect(Collectors.toList());
|
|
|
|
- List<Payment> t = end.stream().filter(e->getPrefix(e.getNumber()).equals("100")).collect(Collectors.toList());
|
|
|
|
- Payment sample=p.get(0);
|
|
|
|
- sc.setPrice(sample.getPrice());
|
|
|
|
- sc.setContractAmount(sample.getContractMoney());
|
|
|
|
- /*本期*/
|
|
|
|
- sc.setCurrentAmount(c.stream().map(e->BaseUtils.str2BigDecimal(e.getMoney())).reduce(BigDecimal.ZERO,BigDecimal::add).toString());
|
|
|
|
- sc.setCurrentRatio(ratioFc.apply(sc.getCurrentAmount(),sc.getContractAmount()));
|
|
|
|
- /*上期末*/
|
|
|
|
- sc.setPreviousEndAmount(p.stream().map(e->BaseUtils.str2BigDecimal(e.getMoney())).reduce(BigDecimal.ZERO,BigDecimal::add).toString());
|
|
|
|
- sc.setPreviousEndRatio(ratioFc.apply(sc.getPreviousEndAmount(),sc.getContractAmount()));
|
|
|
|
- /*本期末*/
|
|
|
|
- sc.setPeriodEndAmount(t.stream().map(e->BaseUtils.str2BigDecimal(e.getMoney())).reduce(BigDecimal.ZERO,BigDecimal::add).toString());
|
|
|
|
- sc.setPeriodEndRatio(ratioFc.apply(sc.getPeriodEndAmount(),sc.getContractAmount()));
|
|
|
|
|
|
+ sc.setMonth(tec.periodInfo.getMonth());
|
|
|
|
+ if(!v.isEmpty()&&!v.equals("-1")){
|
|
|
|
+ List<Payment> p = pre.stream().filter(e->getPrefix(e.getNumber()).equals(v)).collect(Collectors.toList());
|
|
|
|
+ List<Payment> c = cur.stream().filter(e->getPrefix(e.getNumber()).equals(v)).collect(Collectors.toList());
|
|
|
|
+ List<Payment> t = end.stream().filter(e->getPrefix(e.getNumber()).equals(v)).collect(Collectors.toList());
|
|
|
|
+ t.stream().findFirst().ifPresent(sample->{
|
|
|
|
+ sc.setPrice(sample.getPrice());
|
|
|
|
+ sc.setContractAmount(sample.getContractMoney());
|
|
|
|
+ /*本期*/
|
|
|
|
+ sc.setCurrentAmount(c.stream().map(e->BaseUtils.str2BigDecimal(e.getMoney())).reduce(BigDecimal.ZERO,BigDecimal::add).toString());
|
|
|
|
+ sc.setCurrentRatio(ratioFc.apply(sc.getCurrentAmount(),sc.getContractAmount()));
|
|
|
|
+ /*上期末*/
|
|
|
|
+ sc.setPreviousEndAmount(p.stream().map(e->BaseUtils.str2BigDecimal(e.getMoney())).reduce(BigDecimal.ZERO,BigDecimal::add).toString());
|
|
|
|
+ sc.setPreviousEndRatio(ratioFc.apply(sc.getPreviousEndAmount(),sc.getContractAmount()));
|
|
|
|
+ /*本期末*/
|
|
|
|
+ sc.setPeriodEndAmount(t.stream().map(e->BaseUtils.str2BigDecimal(e.getMoney())).reduce(BigDecimal.ZERO,BigDecimal::add).toString());
|
|
|
|
+ sc.setPeriodEndRatio(ratioFc.apply(sc.getPeriodEndAmount(),sc.getContractAmount()));
|
|
|
|
+ });
|
|
|
|
+ }else if(v.equals("-1")){
|
|
|
|
+ sc.setIsSummary(true);
|
|
|
|
+ addGetSetConfig(sc,summaryConfigMap,SupervisionCertificate::getContractAmount,sc::setContractAmount);
|
|
|
|
+ addGetSetConfig(sc,summaryConfigMap,SupervisionCertificate::getPeriodEndAmount,sc::setPeriodEndAmount);
|
|
|
|
+ addGetSetConfig(sc,summaryConfigMap,SupervisionCertificate::getPreviousEndAmount,sc::setPreviousEndAmount);
|
|
|
|
+ addGetSetConfig(sc,summaryConfigMap,SupervisionCertificate::getCurrentAmount,sc::setCurrentAmount);
|
|
|
|
+ }
|
|
});
|
|
});
|
|
|
|
+ /*分行合计列*/
|
|
|
|
+ fieldGetSet(summaryConfigMap,x->!x.getIsSummary());
|
|
putOut();
|
|
putOut();
|
|
}
|
|
}
|
|
}
|
|
}
|