|
@@ -745,12 +745,6 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
List<InterimPaymentCertificate> payItemZj=new ArrayList<>();
|
|
List<InterimPaymentCertificate> payItemZj=new ArrayList<>();
|
|
if(MeterInfo.MB_ZJ.equals(tec.meterInfo.getTemplate())){
|
|
if(MeterInfo.MB_ZJ.equals(tec.meterInfo.getTemplate())){
|
|
/*假如章节*/
|
|
/*假如章节*/
|
|
- /* dataList.forEach(ipc->{
|
|
|
|
- InterimPayCertificateItem ic= new InterimPayCertificateItem();
|
|
|
|
- ic.setCertificateId(tec.getReportId());
|
|
|
|
- BeanUtils.copyProperties(ipc,ic);
|
|
|
|
- itemList.add(ic);
|
|
|
|
- });*/
|
|
|
|
InterimPaymentCertificate xj=new InterimPaymentCertificate("小计",true);
|
|
InterimPaymentCertificate xj=new InterimPaymentCertificate("小计",true);
|
|
addGetSetConfig(xj,summaryConfigMap,InterimPaymentCertificate::getContractAmount,xj::setContractAmount);
|
|
addGetSetConfig(xj,summaryConfigMap,InterimPaymentCertificate::getContractAmount,xj::setContractAmount);
|
|
addGetSetConfig(xj,summaryConfigMap,InterimPaymentCertificate::getRevisedTotal,xj::setRevisedTotal);
|
|
addGetSetConfig(xj,summaryConfigMap,InterimPaymentCertificate::getRevisedTotal,xj::setRevisedTotal);
|
|
@@ -780,7 +774,18 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
payItemZj.add(new InterimPaymentCertificate("索赔金额",MINUS_ONE));
|
|
payItemZj.add(new InterimPaymentCertificate("索赔金额",MINUS_ONE));
|
|
payItemZj.add(new InterimPaymentCertificate("违约罚金",MINUS_ONE));
|
|
payItemZj.add(new InterimPaymentCertificate("违约罚金",MINUS_ONE));
|
|
payItemZj.add(new InterimPaymentCertificate("迟付款利息"));
|
|
payItemZj.add(new InterimPaymentCertificate("迟付款利息"));
|
|
- payItemZj.add(new InterimPaymentCertificate("动员预付款"));
|
|
|
|
|
|
+ InterimPaymentCertificate startPay =new InterimPaymentCertificate("动员预付款");
|
|
|
|
+ if(tec.meterInfo.getStartPayFormAll()!=null){
|
|
|
|
+ List<StartPayForm> startPayForm = tec.getMeterInfo().getStartPayFormAll();
|
|
|
|
+ if(startPayForm.size()>0){
|
|
|
|
+ String current= startPayForm.stream().filter(s->s.getPeriodSort()<=tec.periodInfo.getSort()).map(s->BaseUtils.str2BigDecimal(s.getMeterMoney())).reduce(BigDecimal.ZERO,BigDecimal::add).toPlainString();
|
|
|
|
+ String end= startPayForm.stream().filter(s-> s.getPeriodSort().equals(tec.periodInfo.getSort())).map(s->BaseUtils.str2BigDecimal(s.getMeterMoney())).reduce(BigDecimal.ZERO,BigDecimal::add).toPlainString();
|
|
|
|
+ startPay.setCurrentPeriodPay(current);
|
|
|
|
+ startPay.setCurrentPeriodEndPay(end);
|
|
|
|
+ startPay.setPreviousPeriodEndPay(subtractFc.apply(end,current));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ 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("扣回材料设备垫付款"));
|
|
@@ -817,8 +822,32 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
dataList.addAll(payItemZj);
|
|
dataList.addAll(payItemZj);
|
|
/*生成中期支付证书可编辑列表*/
|
|
/*生成中期支付证书可编辑列表*/
|
|
/*合并手写内容*/
|
|
/*合并手写内容*/
|
|
|
|
+ RebateIncentiveAdvPay rebateIncentiveAdvPay = new RebateIncentiveAdvPay();
|
|
for (InterimPaymentCertificate certificate : dataList) {
|
|
for (InterimPaymentCertificate certificate : dataList) {
|
|
- InterimPayCertificateItem ic= currentMap.getOrDefault(certificate.getChapterSeq(),new InterimPayCertificateItem());
|
|
|
|
|
|
+ InterimPayCertificateItem ic= currentMap.getOrDefault(payItemZj.contains(certificate)?certificate.getChapterSeq():certificate.getFormName(),new InterimPayCertificateItem());
|
|
|
|
+ if("小计".equals(certificate.getChapterSeq())){
|
|
|
|
+ /*本期扣回动员预付款*/
|
|
|
|
+ BaseInfo baseInfo = tec.meterInfo.getBaseInfo();
|
|
|
|
+ BigDecimal subtotal= dataList.stream().limit(dataList.indexOf(certificate)).map(e->BaseUtils.str2BigDecimal(e.getCurrentPeriodEndPay())).reduce(BigDecimal.ZERO,BigDecimal::add);
|
|
|
|
+ rebateIncentiveAdvPay.setSubtotal(subtotal.toPlainString());
|
|
|
|
+ String dyTotalAmount=baseInfo.getDyTotalAmount().toPlainString();
|
|
|
|
+ rebateIncentiveAdvPay.calc(baseInfo.getContractAmount().toPlainString(),dyTotalAmount);
|
|
|
|
+ InterimPayCertificateItem preSubTotal = previousMap.get("小计");
|
|
|
|
+ if(preSubTotal!=null){
|
|
|
|
+ rebateIncentiveAdvPay.setEndPay(addFc.apply(rebateIncentiveAdvPay.getCurrentPay(),preSubTotal.getCurrentPeriodEndPay()));
|
|
|
|
+ }else{
|
|
|
|
+ rebateIncentiveAdvPay.setEndPay(rebateIncentiveAdvPay.getCurrentPay());
|
|
|
|
+ }
|
|
|
|
+ /*当扣完动员预付款的时候,小计总额*/
|
|
|
|
+ interimPayCertificateItemGroup.values().stream().flatMap(v->v.values().stream()).filter(e->"小计".equals(e.getChapterSeq())).sorted(Comparator.comparing(InterimPayCertificateItem::getCurrentPeriodEndPay)).filter(e->BaseUtils.str2BigDecimal(e.getCurrentPeriodEndPay()).compareTo(BaseUtils.str2BigDecimal(dyTotalAmount))>0).findFirst().ifPresent(t->{
|
|
|
|
+ rebateIncentiveAdvPay.setMeterAmount(t.getCurrentPeriodEndPay());
|
|
|
|
+ rebateIncentiveAdvPay.setRatio(ratioFc.apply(t.getCurrentPeriodEndPay(),baseInfo.getContractAmount().toPlainString()));
|
|
|
|
+ });
|
|
|
|
+ }else if("扣回动员预付款".equals(certificate.getChapterSeq())){
|
|
|
|
+ certificate.setCurrentPeriodEndPay(rebateIncentiveAdvPay.getEndPay());
|
|
|
|
+ certificate.setCurrentPeriodPay(rebateIncentiveAdvPay.getCurrentPay());
|
|
|
|
+ certificate.setPreviousPeriodEndPay(rebateIncentiveAdvPay.getPreviousPay());
|
|
|
|
+ }
|
|
BeanUtils.copyProperties(certificate,ic);
|
|
BeanUtils.copyProperties(certificate,ic);
|
|
/*同时兼容几个表后,支付章名称和章节号有点混乱,需要注意纠正*/
|
|
/*同时兼容几个表后,支付章名称和章节号有点混乱,需要注意纠正*/
|
|
if(!payItemZj.contains(certificate)){
|
|
if(!payItemZj.contains(certificate)){
|
|
@@ -830,14 +859,8 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
}
|
|
}
|
|
itemList.add(ic);
|
|
itemList.add(ic);
|
|
}
|
|
}
|
|
- RebateIncentiveAdvPay rebateIncentiveAdvPay = new RebateIncentiveAdvPay();
|
|
|
|
/*分行合计列,合计的时候需要计入手填部分*/
|
|
/*分行合计列,合计的时候需要计入手填部分*/
|
|
fieldGetSet(summaryConfigMap,x->!x.getIsSummary(),InterimPaymentCertificate::getInvertState);
|
|
fieldGetSet(summaryConfigMap,x->!x.getIsSummary(),InterimPaymentCertificate::getInvertState);
|
|
- payItemZj.stream().filter(t->t.getChapterSeq()!=null&&t.getChapterSeq().contains("小计")).findFirst().ifPresent(t->{
|
|
|
|
- rebateIncentiveAdvPay.setSubtotal(t.getCurrentPeriodEndPay());
|
|
|
|
- BaseInfo baseInfo = tec.meterInfo.getBaseInfo();
|
|
|
|
- rebateIncentiveAdvPay.calc(baseInfo.getContractAmount().toPlainString(),baseInfo.getDyTotalAmount().toPlainString());
|
|
|
|
- });
|
|
|
|
if(peerMap.size()>0) {
|
|
if(peerMap.size()>0) {
|
|
/*等合计项目计算完毕,再赋值*/
|
|
/*等合计项目计算完毕,再赋值*/
|
|
peerMap.forEach((sc, item) -> {
|
|
peerMap.forEach((sc, item) -> {
|
|
@@ -1245,19 +1268,20 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
cs.setCurrentPayPercent(ratioFc.apply(cs.getCurrentPeriodPay(),cs.getChangeMoney()));
|
|
cs.setCurrentPayPercent(ratioFc.apply(cs.getCurrentPeriodPay(),cs.getChangeMoney()));
|
|
/* 本期末累计支付金额占合同比*/
|
|
/* 本期末累计支付金额占合同比*/
|
|
cs.setPayPercent(ratioFc.apply(cs.getCurrentPeriodEndPay(),cs.getChangeMoney()));
|
|
cs.setPayPercent(ratioFc.apply(cs.getCurrentPeriodEndPay(),cs.getChangeMoney()));
|
|
- /**上期末占合合同金额*/
|
|
|
|
- cs.setPrePayPercent(ratioFc.apply(subtractFc.apply(cs.getCurrentPeriodEndPay(),cs.getCurrentPeriodPay()),cs.getContractMoney()));
|
|
|
|
|
|
+ /**本期末占合合同金额 */
|
|
|
|
+ cs.setPrePayPercent(ratioFc.apply(cs.getCurrentPeriodEndPay(),cs.getContractMoney()));
|
|
/*变更金额*/
|
|
/*变更金额*/
|
|
cs.setChangeMoneyAll(subtractFc.apply(cs.getChangeMoney(),cs.getContractMoney()));
|
|
cs.setChangeMoneyAll(subtractFc.apply(cs.getChangeMoney(),cs.getContractMoney()));
|
|
dataList.add(cs);
|
|
dataList.add(cs);
|
|
});
|
|
});
|
|
/*每月合计进度*/
|
|
/*每月合计进度*/
|
|
try {
|
|
try {
|
|
|
|
+ String totalAmount=dataList.stream().map(ConstructionSchedule::getContractMoney).map(BaseUtils::str2BigDecimal).reduce(BigDecimal.ZERO,BigDecimal::add).toPlainString();
|
|
int max = monthMoney.keySet().stream().max(Comparator.comparingInt(i->i)).orElse(12);
|
|
int max = monthMoney.keySet().stream().max(Comparator.comparingInt(i->i)).orElse(12);
|
|
/*没月累计*/
|
|
/*没月累计*/
|
|
List<String> monthlySum= IntStream.rangeClosed(1,max).boxed().map(month->{
|
|
List<String> monthlySum= IntStream.rangeClosed(1,max).boxed().map(month->{
|
|
BigDecimal tmp= monthMoney.entrySet().stream().filter(e->e.getKey()<=month).map(Map.Entry::getValue).reduce(BigDecimal.ZERO,BigDecimal::add);
|
|
BigDecimal tmp= monthMoney.entrySet().stream().filter(e->e.getKey()<=month).map(Map.Entry::getValue).reduce(BigDecimal.ZERO,BigDecimal::add);
|
|
- return multiFc.apply(ratioFc.apply(tmp.toPlainString(),baseInfo.getTotalAmount().toString()),"100");
|
|
|
|
|
|
+ return multiFc.apply(ratioFc.apply(tmp.toPlainString(),totalAmount),"100");
|
|
}).collect(Collectors.toList());
|
|
}).collect(Collectors.toList());
|
|
FormulaUtils.elementFindByCode(fdm,ConstructionSchedule.TBN+":key_22").ifPresent(t->{
|
|
FormulaUtils.elementFindByCode(fdm,ConstructionSchedule.TBN+":key_22").ifPresent(t->{
|
|
elementWriter.write(t,monthlySum);
|
|
elementWriter.write(t,monthlySum);
|
|
@@ -1265,24 +1289,26 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
/*本月*/
|
|
/*本月*/
|
|
List<String> monthlyCount= IntStream.rangeClosed(1,max).boxed().map(month->{
|
|
List<String> monthlyCount= IntStream.rangeClosed(1,max).boxed().map(month->{
|
|
BigDecimal tmp= monthMoney.entrySet().stream().filter(e-> e.getKey().equals(month)).map(Map.Entry::getValue).reduce(BigDecimal.ZERO,BigDecimal::add);
|
|
BigDecimal tmp= monthMoney.entrySet().stream().filter(e-> e.getKey().equals(month)).map(Map.Entry::getValue).reduce(BigDecimal.ZERO,BigDecimal::add);
|
|
- return ratioFc.apply(tmp.toPlainString(),baseInfo.getTotalAmount().toString());
|
|
|
|
|
|
+ return ratioFc.apply(tmp.toPlainString(),totalAmount);
|
|
}).collect(Collectors.toList());
|
|
}).collect(Collectors.toList());
|
|
FormulaUtils.elementFindByCode(fdm,ConstructionSchedule.TBN+":key_23").ifPresent(t->{
|
|
FormulaUtils.elementFindByCode(fdm,ConstructionSchedule.TBN+":key_23").ifPresent(t->{
|
|
elementWriter.write(t,monthlyCount);
|
|
elementWriter.write(t,monthlyCount);
|
|
});
|
|
});
|
|
List<String> planMonthSum=new ArrayList<>();
|
|
List<String> planMonthSum=new ArrayList<>();
|
|
if(chapterSchedules!=null&&chapterSchedules.size()>0) {
|
|
if(chapterSchedules!=null&&chapterSchedules.size()>0) {
|
|
|
|
+ String totalAmountPlan=totalAmount;
|
|
|
|
+ /*chapterSchedules.stream().map(ChapterSchedule::getEight).map(BaseUtils::str2BigDecimal).reduce(BigDecimal.ZERO,BigDecimal::add).toPlainString();*/
|
|
chapterSchedules.forEach(ChapterSchedule::updateArray);
|
|
chapterSchedules.forEach(ChapterSchedule::updateArray);
|
|
List<BigDecimal> planMonth = IntStream.range(0,12).boxed().map(i->chapterSchedules.stream().map(e->e.getArr()[i]).reduce(BigDecimal.ZERO,BigDecimal::add)).collect(Collectors.toList());
|
|
List<BigDecimal> planMonth = IntStream.range(0,12).boxed().map(i->chapterSchedules.stream().map(e->e.getArr()[i]).reduce(BigDecimal.ZERO,BigDecimal::add)).collect(Collectors.toList());
|
|
/*计划本月*/
|
|
/*计划本月*/
|
|
FormulaUtils.elementFindByCode(fdm, ConstructionSchedule.TBN + ":key_28").ifPresent(t -> {
|
|
FormulaUtils.elementFindByCode(fdm, ConstructionSchedule.TBN + ":key_28").ifPresent(t -> {
|
|
- List<String> value=planMonth.stream().map(BigDecimal::toPlainString).map(s-> multiFc.apply(ratioFc.apply(s,baseInfo.getTotalAmount().toString()),"100")).collect(Collectors.toList());
|
|
|
|
|
|
+ List<String> value=planMonth.stream().map(BigDecimal::toPlainString).map(s-> multiFc.apply(ratioFc.apply(s,totalAmountPlan),"100")).collect(Collectors.toList());
|
|
elementWriter.write(t, value);
|
|
elementWriter.write(t, value);
|
|
});
|
|
});
|
|
/*计划累计*/
|
|
/*计划累计*/
|
|
planMonthSum = IntStream.range(0,12).boxed().map(i-> {
|
|
planMonthSum = IntStream.range(0,12).boxed().map(i-> {
|
|
String tmp= planMonth.stream().filter(e -> planMonth.indexOf(e) <= i).reduce(BigDecimal.ZERO, BigDecimal::add).toPlainString();
|
|
String tmp= planMonth.stream().filter(e -> planMonth.indexOf(e) <= i).reduce(BigDecimal.ZERO, BigDecimal::add).toPlainString();
|
|
- return multiFc.apply(ratioFc.apply(tmp,baseInfo.getTotalAmount().toString()),"100");
|
|
|
|
|
|
+ return multiFc.apply(ratioFc.apply(tmp,totalAmountPlan),"100");
|
|
}
|
|
}
|
|
).collect(Collectors.toList());
|
|
).collect(Collectors.toList());
|
|
List<String> finalPlanMonthSum = planMonthSum;
|
|
List<String> finalPlanMonthSum = planMonthSum;
|