|
@@ -36,6 +36,7 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
private Function<Long, List<Payment>> paymentListFc;
|
|
private Function<Long, List<Payment>> paymentListFc;
|
|
private Function<Long, List<InventoryForm>> inventoryFormFc;
|
|
private Function<Long, List<InventoryForm>> inventoryFormFc;
|
|
private Function<Long, List<MeterApply>> meterApplyFc;
|
|
private Function<Long, List<MeterApply>> meterApplyFc;
|
|
|
|
+ private Function<Long, List<StartPayForm>> stayPayFormFc;
|
|
private ElementWriter elementWriter;
|
|
private ElementWriter elementWriter;
|
|
/*执行链*/
|
|
/*执行链*/
|
|
private List<Special> specialList = new ArrayList<>();
|
|
private List<Special> specialList = new ArrayList<>();
|
|
@@ -93,6 +94,7 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
public void handle() {
|
|
public void handle() {
|
|
this.elementWriter=new MeterElementWriter();
|
|
this.elementWriter=new MeterElementWriter();
|
|
if(MeterType.MATERIAL.equals(tec.getMeterType())){
|
|
if(MeterType.MATERIAL.equals(tec.getMeterType())){
|
|
|
|
+ /*材料预付款支付申请表处理*/
|
|
this.specialList.add(new MaterialCalc());
|
|
this.specialList.add(new MaterialCalc());
|
|
}else if(MeterType.INTERIM.equals(tec.getMeterType())){
|
|
}else if(MeterType.INTERIM.equals(tec.getMeterType())){
|
|
this.specialList.add(new InterimPayCert());
|
|
this.specialList.add(new InterimPayCert());
|
|
@@ -101,11 +103,46 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
this.specialList.add(new SubIMeterPay());
|
|
this.specialList.add(new SubIMeterPay());
|
|
this.specialList.add(new IMeterPaySummary());
|
|
this.specialList.add(new IMeterPaySummary());
|
|
this.specialList.add(new IMeter());
|
|
this.specialList.add(new IMeter());
|
|
|
|
+ }else if(MeterType.START.equals(tec.getMeterType())){
|
|
|
|
+ /*开工预付款支付证书处理*/
|
|
|
|
+ this.specialList.add(new StayPayCalc());
|
|
}
|
|
}
|
|
this.specialList.stream().filter(Special::ready).forEach(Special::parse);
|
|
this.specialList.stream().filter(Special::ready).forEach(Special::parse);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Data
|
|
|
|
+ public class StayPayCalc implements Special{
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public boolean ready() {
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
|
|
|
|
+ public void parse(){
|
|
|
|
+ LinkedHashMap<String,FormData> fdm = FormulaUtils.toFormDataMap(AdvancePaymentCertificate.class);
|
|
|
|
+ List<StartPayForm> startPayForms= stayPayFormFc.apply(tec.getContractId());
|
|
|
|
+ if(Func.isNotEmpty(startPayForms)){
|
|
|
|
+ startPayForms.sort(Comparator.comparingInt(StartPayForm::getPeriodSort));
|
|
|
|
+ double sum,previousD,currentD;
|
|
|
|
+ List<StartPayForm> current = startPayForms.stream().filter(s->s.getMeterPeriodId().equals(tec.getPeriodId())).collect(Collectors.toList());
|
|
|
|
+ if(current.size()>0){
|
|
|
|
+ StartPayForm one = current.get(0);
|
|
|
|
+ sum= startPayForms.stream().filter(s->s.getPeriodSort()<=one.getPeriodSort()).mapToDouble(s->Double.parseDouble(s.getMeterMoney())).sum();
|
|
|
|
+ /*累计*/
|
|
|
|
+ elementWriter.write(fdm.get("key_3"),StringUtils.number2String(sum,2));
|
|
|
|
+ currentD=startPayForms.stream().mapToDouble(s->Double.parseDouble(s.getMeterMoney())).sum();
|
|
|
|
+ elementWriter.write(fdm.get("key_2"),StringUtils.number2String(currentD,2));
|
|
|
|
+ /*上一期*/
|
|
|
|
+ Optional<Integer> op=startPayForms.stream().map(StartPayForm::getPeriodSort).filter(s->s<one.getPeriodSort()).max(Comparator.comparingInt(s->s));
|
|
|
|
+ if(op.isPresent()){
|
|
|
|
+ previousD= startPayForms.stream().filter(s->s.getPeriodSort().equals(one.getPeriodSort())).mapToDouble(s->Double.parseDouble(s.getMeterMoney())).sum();
|
|
|
|
+ elementWriter.write(fdm.get("key_1"),StringUtils.number2String(previousD,2));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
|
|
@Data
|
|
@Data
|
|
public class MaterialCalc implements Special{
|
|
public class MaterialCalc implements Special{
|