|
@@ -973,6 +973,9 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
}
|
|
}
|
|
payItemZj.add(jgtz);
|
|
payItemZj.add(jgtz);
|
|
InterimPaymentCertificate hj = new InterimPaymentCertificate("合计",true);
|
|
InterimPaymentCertificate hj = new InterimPaymentCertificate("合计",true);
|
|
|
|
+ /* fieldSetImmediately(hj,InterimPaymentCertificate::getCurrentPeriodEndPay,hj::setCurrentPeriodEndPay,x->!x.getIsSummary(),InterimPaymentCertificate::getInvertState);
|
|
|
|
+ fieldSetImmediately(hj,InterimPaymentCertificate::getPreviousPeriodEndPay,hj::setPreviousPeriodEndPay,x->!x.getIsSummary(),InterimPaymentCertificate::getInvertState);
|
|
|
|
+ fieldSetImmediately(hj,InterimPaymentCertificate::getCurrentPeriodPay,hj::setCurrentPeriodPay,x->!x.getIsSummary(),InterimPaymentCertificate::getInvertState);*/
|
|
addGetSetConfig(hj,InterimPaymentCertificate::getCurrentPeriodEndPay,hj::setCurrentPeriodEndPay);
|
|
addGetSetConfig(hj,InterimPaymentCertificate::getCurrentPeriodEndPay,hj::setCurrentPeriodEndPay);
|
|
addGetSetConfig(hj,InterimPaymentCertificate::getPreviousPeriodEndPay,hj::setPreviousPeriodEndPay);
|
|
addGetSetConfig(hj,InterimPaymentCertificate::getPreviousPeriodEndPay,hj::setPreviousPeriodEndPay);
|
|
addGetSetConfig(hj,InterimPaymentCertificate::getCurrentPeriodPay,hj::setCurrentPeriodPay);
|
|
addGetSetConfig(hj,InterimPaymentCertificate::getCurrentPeriodPay,hj::setCurrentPeriodPay);
|
|
@@ -1000,22 +1003,13 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
startPay.setCurrentPeriodEndPay(addFc.apply(startPay.getCurrentPeriodPay(),startPay.getPreviousPeriodEndPay()));
|
|
startPay.setCurrentPeriodEndPay(addFc.apply(startPay.getCurrentPeriodPay(),startPay.getPreviousPeriodEndPay()));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- /* BigDecimal end = startPayForm.stream().filter(s->s.getPeriodSort()<=tec.periodInfo.getSort()).map(s->BaseUtils.str2BigDecimal(s.getMeterMoney())).reduce(BigDecimal.ZERO,BigDecimal::add);
|
|
|
|
- BigDecimal current= startPayForm.stream().filter(s-> s.getPeriodSort().equals(tec.periodInfo.getSort())).map(s->BaseUtils.str2BigDecimal(s.getMeterMoney())).reduce(BigDecimal.ZERO,BigDecimal::add);
|
|
|
|
- *//*startPay.setCurrentPeriodPay(current.toPlainString());*//*
|
|
|
|
- startPay.setCurrentPeriodEndPay(end.toPlainString());
|
|
|
|
- String pre=subtractFc.apply(end.toPlainString(),current.toPlainString());
|
|
|
|
- if(!pre.contains("-")) {
|
|
|
|
- *//*非负数*//*
|
|
|
|
- startPay.setPreviousPeriodEndPay(pre);
|
|
|
|
- }*/
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
payItemZj.add(startPay);
|
|
payItemZj.add(startPay);
|
|
payItemZj.add(new InterimPaymentCertificate("扣回动员预付款"));
|
|
payItemZj.add(new InterimPaymentCertificate("扣回动员预付款"));
|
|
payItemZj.add(new InterimPaymentCertificate("材料设备垫付款"));
|
|
payItemZj.add(new InterimPaymentCertificate("材料设备垫付款"));
|
|
payItemZj.add(new InterimPaymentCertificate("扣回材料设备垫付款"));
|
|
payItemZj.add(new InterimPaymentCertificate("扣回材料设备垫付款"));
|
|
- blj=new InterimPaymentCertificate("保留金");
|
|
|
|
|
|
+ blj=new InterimPaymentCertificate("保留金",MINUS_ONE);
|
|
payItemZj.add(blj);
|
|
payItemZj.add(blj);
|
|
InterimPaymentCertificate thblj=new InterimPaymentCertificate("退还保留金",true);
|
|
InterimPaymentCertificate thblj=new InterimPaymentCertificate("退还保留金",true);
|
|
thblj.setNoApply(1);
|
|
thblj.setNoApply(1);
|
|
@@ -1109,6 +1103,16 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
}
|
|
}
|
|
/*分行合计列,合计的时候需要计入手填部分*/
|
|
/*分行合计列,合计的时候需要计入手填部分*/
|
|
fieldGetSet(x->!x.getIsSummary(),InterimPaymentCertificate::getInvertState);
|
|
fieldGetSet(x->!x.getIsSummary(),InterimPaymentCertificate::getInvertState);
|
|
|
|
+ InterimPaymentCertificate finalBlj = blj;
|
|
|
|
+ dataList.stream().filter(e->e.getChapterSeq().equals("合计")).findFirst().ifPresent(t->{
|
|
|
|
+ finalBlj.setCurrentPeriodPay(multiFc.apply(t.getCurrentPeriodPay(),"0.1"));
|
|
|
|
+ /* itemList.stream().filter(e->e.getChapterSeq().equals("保留金")).findFirst().ifPresent(k->{
|
|
|
|
+ k.setCurrentPeriodPay(finalBlj.getCurrentPeriodPay());
|
|
|
|
+ });*/
|
|
|
|
+ dataList.stream().filter(e->e.getChapterSeq().equals("实际支付")).findFirst().ifPresent(w->{
|
|
|
|
+ w.setCurrentPeriodPay(subtractFc.apply(w.getCurrentPeriodPay(),finalBlj.getCurrentPeriodPay()));
|
|
|
|
+ });
|
|
|
|
+ });
|
|
if(peerMap.size()>0) {
|
|
if(peerMap.size()>0) {
|
|
/*等合计项目计算完毕,再赋值*/
|
|
/*等合计项目计算完毕,再赋值*/
|
|
peerMap.forEach((sc, item) -> {
|
|
peerMap.forEach((sc, item) -> {
|
|
@@ -1117,13 +1121,6 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
item.setCurrentPeriodEndPay(sc.getCurrentPeriodEndPay());
|
|
item.setCurrentPeriodEndPay(sc.getCurrentPeriodEndPay());
|
|
});
|
|
});
|
|
}
|
|
}
|
|
- InterimPaymentCertificate finalBlj = blj;
|
|
|
|
- dataList.stream().filter(e->e.getChapterSeq().equals("合计")).findFirst().ifPresent(t->{
|
|
|
|
- finalBlj.setCurrentPeriodPay(multiFc.apply(t.getCurrentPeriodPay(),"0.1"));
|
|
|
|
- itemList.stream().filter(e->e.getChapterSeq().equals("保留金")).findFirst().ifPresent(k->{
|
|
|
|
- k.setCurrentPeriodPay(finalBlj.getCurrentPeriodPay());
|
|
|
|
- });
|
|
|
|
- });
|
|
|
|
/*排序*/
|
|
/*排序*/
|
|
List<String> indexSort =dataList.stream().map(InterimPaymentCertificate::getChapterSeq).collect(Collectors.toList());
|
|
List<String> indexSort =dataList.stream().map(InterimPaymentCertificate::getChapterSeq).collect(Collectors.toList());
|
|
itemList.forEach(e->{
|
|
itemList.forEach(e->{
|
|
@@ -2250,12 +2247,12 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
fieldGetSet(p,bean->BigDecimal.ONE);
|
|
fieldGetSet(p,bean->BigDecimal.ONE);
|
|
}
|
|
}
|
|
/*Map<T,Map<Function<T,String>,Consumer<String>>> gsMap, Predicate<T> p,Function<T,BigDecimal> sign*/
|
|
/*Map<T,Map<Function<T,String>,Consumer<String>>> gsMap, Predicate<T> p,Function<T,BigDecimal> sign*/
|
|
|
|
+ /*字段赋值,延迟计算*/
|
|
public void fieldGetSet( Predicate<T> p,Function<T,BigDecimal> sign){
|
|
public void fieldGetSet( Predicate<T> p,Function<T,BigDecimal> sign){
|
|
if(dataList.size()>0) {
|
|
if(dataList.size()>0) {
|
|
summaryConfigMap.forEach((b, m) -> {
|
|
summaryConfigMap.forEach((b, m) -> {
|
|
List<T> dl = dataList.stream().limit(dataList.indexOf(b)).collect(Collectors.toList());
|
|
List<T> dl = dataList.stream().limit(dataList.indexOf(b)).collect(Collectors.toList());
|
|
m.forEach((f, c) -> {
|
|
m.forEach((f, c) -> {
|
|
- /* c.accept(dl.stream().filter(p).map(f).map(BaseUtils::str2BigDecimal).reduce(BigDecimal.ZERO, BigDecimal::add).toString());*/
|
|
|
|
/*扣款项需要根据符号状态sign转成负数,依靠invert实现*/
|
|
/*扣款项需要根据符号状态sign转成负数,依靠invert实现*/
|
|
String value =dl.stream().filter(p).map(e-> invert.apply(sign.apply(e),BaseUtils.str2BigDecimal(f.apply(e)))).reduce(BigDecimal.ZERO, BigDecimal::add).toString();
|
|
String value =dl.stream().filter(p).map(e-> invert.apply(sign.apply(e),BaseUtils.str2BigDecimal(f.apply(e)))).reduce(BigDecimal.ZERO, BigDecimal::add).toString();
|
|
c.accept(value);
|
|
c.accept(value);
|
|
@@ -2264,6 +2261,16 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /*字段赋值,立即计算*/
|
|
|
|
+ public void fieldSetImmediately(T b,Function<T,String>f,Consumer<String> c,Predicate<T> p,Function<T,BigDecimal> sign){
|
|
|
|
+ if(dataList.size()>0) {
|
|
|
|
+ List<T> dl = dataList.stream().limit(dataList.indexOf(b)).collect(Collectors.toList());
|
|
|
|
+ /*扣款项需要根据符号状态sign转成负数,依靠invert实现*/
|
|
|
|
+ String value =dl.stream().filter(p).map(e-> invert.apply(sign.apply(e),BaseUtils.str2BigDecimal(f.apply(e)))).reduce(BigDecimal.ZERO, BigDecimal::add).toString();
|
|
|
|
+ c.accept(value);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
/*T b,Map<T,Map<Function<T,String>,Consumer<String>>> gsMap,Function<T,String>f,Consumer<String> c*/
|
|
/*T b,Map<T,Map<Function<T,String>,Consumer<String>>> gsMap,Function<T,String>f,Consumer<String> c*/
|
|
public void addGetSetConfig(T b,Function<T,String>f,Consumer<String> c){
|
|
public void addGetSetConfig(T b,Function<T,String>f,Consumer<String> c){
|
|
Map<Function<T,String>,Consumer<String>> configMap = summaryConfigMap.computeIfAbsent(b,k->new HashMap<>());
|
|
Map<Function<T,String>,Consumer<String>> configMap = summaryConfigMap.computeIfAbsent(b,k->new HashMap<>());
|