|
@@ -429,27 +429,54 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
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(payment->{
|
|
|
+ Optional<Payment> op= t.stream().findFirst();
|
|
|
+ if(op.isPresent()){
|
|
|
+ Payment payment = op.get();
|
|
|
+ sc.setPrice(payment.getPrice());
|
|
|
+ sc.setContractAmount(payment.getContractMoney());
|
|
|
+ /*本期*/
|
|
|
+ sc.setCurrentAmount(paymentSumFc.apply(c));
|
|
|
+ sc.setCurrentRatio(ratioFc.apply(sc.getCurrentAmount(),sc.getContractAmount()));
|
|
|
+ /*上期末*/
|
|
|
+ sc.setPreviousEndAmount(paymentSumFc.apply(p));
|
|
|
+ sc.setPreviousEndRatio(ratioFc.apply(sc.getPreviousEndAmount(),sc.getContractAmount()));
|
|
|
+ /*本期末*/
|
|
|
+ sc.setPeriodEndAmount(paymentSumFc.apply(t));
|
|
|
+ sc.setPeriodEndRatio(ratioFc.apply(sc.getPeriodEndAmount(),sc.getContractAmount()));
|
|
|
+
|
|
|
+ current.setFormName(v);
|
|
|
+ current.setChapterSeq(k);
|
|
|
+ current.setContractAmount(payment.getContractMoney());
|
|
|
+ current.setPreviousPeriodEndPay(sc.getPreviousEndAmount());
|
|
|
+ current.setCurrentPeriodPay(sc.getCurrentAmount());
|
|
|
+ current.setCurrentPeriodEndPay(sc.getPeriodEndAmount());
|
|
|
+ }else{
|
|
|
+ current.setFormName(v);
|
|
|
+ current.setChapterSeq(k);
|
|
|
+ }
|
|
|
+ itemList.add(current);
|
|
|
+
|
|
|
+ /* t.stream().findFirst().ifPresent(payment->{
|
|
|
sc.setPrice(payment.getPrice());
|
|
|
sc.setContractAmount(payment.getContractMoney());
|
|
|
- /*本期*/
|
|
|
+ *//*本期*//*
|
|
|
sc.setCurrentAmount(paymentSumFc.apply(c));
|
|
|
sc.setCurrentRatio(ratioFc.apply(sc.getCurrentAmount(),sc.getContractAmount()));
|
|
|
- /*上期末*/
|
|
|
+ *//*上期末*//*
|
|
|
sc.setPreviousEndAmount(paymentSumFc.apply(p));
|
|
|
sc.setPreviousEndRatio(ratioFc.apply(sc.getPreviousEndAmount(),sc.getContractAmount()));
|
|
|
- /*本期末*/
|
|
|
+ *//*本期末*//*
|
|
|
sc.setPeriodEndAmount(paymentSumFc.apply(t));
|
|
|
sc.setPeriodEndRatio(ratioFc.apply(sc.getPeriodEndAmount(),sc.getContractAmount()));
|
|
|
|
|
|
current.setFormName(v);
|
|
|
current.setChapterSeq(k);
|
|
|
current.setContractAmount(payment.getContractMoney());
|
|
|
- current.setPreviousPeriodEndPay(sc.getPeriodEndAmount());
|
|
|
+ current.setPreviousPeriodEndPay(sc.getPreviousEndAmount());
|
|
|
current.setCurrentPeriodPay(sc.getCurrentAmount());
|
|
|
current.setCurrentPeriodEndPay(sc.getPeriodEndAmount());
|
|
|
itemList.add(current);
|
|
|
- });
|
|
|
+ });*/
|
|
|
|
|
|
}
|
|
|
dataList.add(sc);
|
|
@@ -459,7 +486,7 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
if(peerMap.size()>0) {
|
|
|
/*等合计项目计算完毕,再赋值*/
|
|
|
peerMap.forEach((sc, item) -> {
|
|
|
- item.setPreviousPeriodEndPay(sc.getPeriodEndAmount());
|
|
|
+ item.setPreviousPeriodEndPay(sc.getPreviousEndAmount());
|
|
|
item.setCurrentPeriodPay(sc.getCurrentAmount());
|
|
|
item.setCurrentPeriodEndPay(sc.getPeriodEndAmount());
|
|
|
});
|
|
@@ -615,12 +642,21 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
/*合同段支付项*/
|
|
|
List<MidPayItem> midPayItemList=tec.meterInfo.getMidPayItemList();
|
|
|
Map<InterimPaymentCertificate,Map<Function<InterimPaymentCertificate,String>,Consumer<String>>> summaryConfigMap = new HashMap<>();
|
|
|
- Map<Function<InterimPaymentCertificate,String>,Consumer<String>> getSetMap = new HashMap<>();
|
|
|
+ /* Map<Function<InterimPaymentCertificate,String>,Consumer<String>> getSetMap = new HashMap<>();*/
|
|
|
+ Map<Long,LinkedHashMap<String,InterimPayCertificateItem>>interimPayCertificateItemGroup=tec.meterInfo.getInterimPayCertificateItemGroup();
|
|
|
+ LinkedHashMap<String,InterimPayCertificateItem> previousMap = new LinkedHashMap<>();
|
|
|
+ if(tec.meterInfo.getPreviousPeriodInfo()!=null){
|
|
|
+ previousMap= interimPayCertificateItemGroup.getOrDefault(tec.meterInfo.getPreviousPeriodInfo().getReportId(),new LinkedHashMap<>());
|
|
|
+ }
|
|
|
+ LinkedHashMap<String,InterimPayCertificateItem> currentMap = interimPayCertificateItemGroup.getOrDefault(tec.periodInfo.getReportId(),new LinkedHashMap<>());
|
|
|
+ List<InterimPayCertificateItem> itemList = tec.meterInfo.getInterimPayCertificateItems();
|
|
|
+ itemList.clear();
|
|
|
if(Func.isNotEmpty(midPayItemList)){
|
|
|
+ /*合计后回显*/
|
|
|
+ Map<InterimPaymentCertificate,InterimPayCertificateItem> peerMap = new HashMap<>();
|
|
|
List<InterimPaymentCertificate> payItemZj=new ArrayList<>();
|
|
|
if(MeterInfo.MB_ZJ.equals(tec.meterInfo.getConfig())){
|
|
|
- InterimPaymentCertificate xj=new InterimPaymentCertificate("小计");
|
|
|
- xj.setIsSummary(true);
|
|
|
+ InterimPaymentCertificate xj=new InterimPaymentCertificate("小计",true);
|
|
|
addGetSetConfig(xj,summaryConfigMap,InterimPaymentCertificate::getContractAmount,xj::setContractAmount);
|
|
|
addGetSetConfig(xj,summaryConfigMap,InterimPaymentCertificate::getRevisedTotal,xj::setRevisedTotal);
|
|
|
addGetSetConfig(xj,summaryConfigMap,InterimPaymentCertificate::getRevisedAmount,xj::setRevisedAmount);
|
|
@@ -641,14 +677,13 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
jgtz.setCurrentPeriodEndPay(countFc.apply(MeterInfo.END));
|
|
|
}
|
|
|
payItemZj.add(jgtz);
|
|
|
- InterimPaymentCertificate hj = new InterimPaymentCertificate("合计");
|
|
|
- hj.setIsSummary(true);
|
|
|
+ InterimPaymentCertificate hj = new InterimPaymentCertificate("合计",true);
|
|
|
addGetSetConfig(hj,summaryConfigMap,InterimPaymentCertificate::getCurrentPeriodEndPay,hj::setCurrentPeriodEndPay);
|
|
|
addGetSetConfig(hj,summaryConfigMap,InterimPaymentCertificate::getPreviousPeriodEndPay,hj::setPreviousPeriodEndPay);
|
|
|
addGetSetConfig(hj,summaryConfigMap,InterimPaymentCertificate::getCurrentPeriodPay,hj::setCurrentPeriodPay);
|
|
|
payItemZj.add(hj);
|
|
|
- payItemZj.add(new InterimPaymentCertificate("索赔金额"));
|
|
|
- payItemZj.add(new InterimPaymentCertificate("违约罚金"));
|
|
|
+ payItemZj.add(new InterimPaymentCertificate("索赔金额",MINUS_ONE));
|
|
|
+ payItemZj.add(new InterimPaymentCertificate("违约罚金",MINUS_ONE));
|
|
|
payItemZj.add(new InterimPaymentCertificate("迟付款利息"));
|
|
|
payItemZj.add(new InterimPaymentCertificate("动员预付款"));
|
|
|
payItemZj.add(new InterimPaymentCertificate("扣回动员预付款"));
|
|
@@ -660,6 +695,26 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
addGetSetConfig(sjzf,summaryConfigMap,InterimPaymentCertificate::getPreviousPeriodEndPay,sjzf::setPreviousPeriodEndPay);
|
|
|
addGetSetConfig(sjzf,summaryConfigMap,InterimPaymentCertificate::getCurrentPeriodPay,sjzf::setCurrentPeriodPay);
|
|
|
payItemZj.add(sjzf);
|
|
|
+ /*合并手写内容*/
|
|
|
+ for (InterimPaymentCertificate certificate : payItemZj) {
|
|
|
+ InterimPayCertificateItem ic= currentMap.getOrDefault(certificate.getChapterSeq(),new InterimPayCertificateItem());
|
|
|
+ ic.setChapterSeq(certificate.getChapterSeq());
|
|
|
+ if(certificate.getIsSummary()){
|
|
|
+ peerMap.put(certificate,ic);
|
|
|
+ }else if(certificate.getNoApply()!=1){
|
|
|
+ InterimPayCertificateItem pre =previousMap.get(certificate.getChapterSeq());
|
|
|
+ if(pre!=null){
|
|
|
+ ic.setPreviousPeriodEndPay(pre.getCurrentPeriodEndPay());
|
|
|
+ }
|
|
|
+ certificate.setCurrentPeriodPay(ic.getCurrentPeriodPay());
|
|
|
+ certificate.setPreviousPeriodEndPay(ic.getPreviousPeriodEndPay());
|
|
|
+ certificate.setCurrentPeriodEndPay(ic.getCurrentPeriodEndPay());
|
|
|
+ }else{
|
|
|
+ ic.setCurrentPeriodPay(certificate.getCurrentPeriodPay());
|
|
|
+ ic.setPreviousPeriodEndPay(certificate.getPreviousPeriodEndPay());
|
|
|
+ ic.setCurrentPeriodEndPay(certificate.getCurrentPeriodEndPay());
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
midPayItemList.forEach(e->{
|
|
|
InterimPaymentCertificate ipc = paymentCertificateMap.get(e.getPayNumber());
|
|
@@ -683,9 +738,16 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
t.setCurrentPeriodEndChangeMoney("");
|
|
|
});
|
|
|
dataList.addAll(payItemZj);
|
|
|
- /*分行合计列*/
|
|
|
- fieldGetSet(summaryConfigMap,x->!x.getIsSummary());
|
|
|
- /*计算合计值*/
|
|
|
+ /*分行合计列,合计的时候需要计入手填部分*/
|
|
|
+ fieldGetSet(summaryConfigMap,x->!x.getIsSummary(),InterimPaymentCertificate::getInvertState);
|
|
|
+ if(peerMap.size()>0) {
|
|
|
+ /*等合计项目计算完毕,再赋值*/
|
|
|
+ peerMap.forEach((sc, item) -> {
|
|
|
+ item.setPreviousPeriodEndPay(sc.getPreviousPeriodEndPay());
|
|
|
+ item.setCurrentPeriodPay(sc.getCurrentPeriodPay());
|
|
|
+ item.setCurrentPeriodEndPay(sc.getCurrentPeriodEndPay());
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
/*数据获取end*/
|
|
@@ -700,6 +762,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(BaseUtils::obj2DoubleZero).sum()));
|
|
|
/*内容输出*/
|
|
|
putOut();
|
|
@@ -709,24 +772,6 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
tec.periodInfo.setPreTotal(last.getPreviousPeriodEndPay());
|
|
|
tec.periodInfo.setCurTotal(last.getCurrentPeriodPay());
|
|
|
tec.periodInfo.setTotal(last.getCurrentPeriodEndPay());
|
|
|
- /* if(paymentsPeriodEnd.size()>0){
|
|
|
- FormData fd=tec.formDataMap.get(MeterPeriodInfo.TBN+":key_7");
|
|
|
- if(fd!=null) {
|
|
|
- elementWriter.write(fd, paymentsPeriodEnd.stream().mapToDouble(p -> Double.parseDouble(p.getMoney())).sum());
|
|
|
- }
|
|
|
- }
|
|
|
- if(current.size()>0){
|
|
|
- FormData fd=tec.formDataMap.get(MeterPeriodInfo.TBN+":key_6");
|
|
|
- if(fd!=null) {
|
|
|
- elementWriter.write(fd, current.stream().mapToDouble(p -> Double.parseDouble(p.getMoney())).sum());
|
|
|
- }
|
|
|
- }
|
|
|
- if(previous.size()>0){
|
|
|
- FormData fd=tec.formDataMap.get(MeterPeriodInfo.TBN+":key_4");
|
|
|
- if(fd!=null) {
|
|
|
- elementWriter.write(fd, previous.stream().mapToDouble(p -> Double.parseDouble(p.getMoney())).sum());
|
|
|
- }
|
|
|
- }*/
|
|
|
}
|
|
|
|
|
|
/**
|