|
@@ -10,6 +10,7 @@ import org.springblade.core.tool.utils.StringPool;
|
|
|
import org.springblade.manager.dto.ElementData;
|
|
|
import org.springblade.manager.dto.FormData;
|
|
|
import org.springblade.manager.dto.TreeNode;
|
|
|
+import org.springblade.manager.formula.ElementWriter;
|
|
|
import org.springblade.manager.vo.*;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
|
|
@@ -35,6 +36,7 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
private Function<Long, List<Payment>> paymentListFc;
|
|
|
private Function<Long, List<InventoryForm>> inventoryFormFc;
|
|
|
private Function<Long, List<MeterApply>> meterApplyFc;
|
|
|
+ private ElementWriter elementWriter;
|
|
|
/*执行链*/
|
|
|
private List<Special> specialList = new ArrayList<>();
|
|
|
/**支付章节*/
|
|
@@ -89,6 +91,7 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
|
|
|
@Override
|
|
|
public void handle() {
|
|
|
+ this.elementWriter=new MeterElementWriter();
|
|
|
if(MeterType.MATERIAL.equals(tec.getMeterType())){
|
|
|
this.specialList.add(new MaterialCalc());
|
|
|
}else if(MeterType.INTERIM.equals(tec.getMeterType())){
|
|
@@ -221,7 +224,7 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
for(int i=0;i<this.fds.size();i++){
|
|
|
List<Object> dl= groupData.get(i);
|
|
|
FormData fd= fds.get(i);
|
|
|
- FormulaUtils.write(fd,dl);
|
|
|
+ elementWriter.write(fd,dl);
|
|
|
}
|
|
|
/*追加合计*/
|
|
|
append(this.sum,this.total);
|
|
@@ -249,7 +252,7 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
@Data
|
|
|
@EqualsAndHashCode(callSuper = true)
|
|
|
public class InterimPayCert extends BaseSpecial<InterimPaymentCertificate> implements Special{
|
|
|
-
|
|
|
+ /*中期支付证书*/
|
|
|
@Override
|
|
|
public boolean ready() {
|
|
|
return true;
|
|
@@ -326,6 +329,15 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
}
|
|
|
/*数据获取end*/
|
|
|
/*本期实际支付合计计算*/
|
|
|
+ double total=dataList.stream().map(InterimPaymentCertificate::getCurrentPeriodPay).mapToDouble(Double::parseDouble).sum();
|
|
|
+ if(total>0){
|
|
|
+ FormData ft =tec.formDataMap.get(InterimPaymentCertificate.TBN+ StringPool.COLON+"key_9");
|
|
|
+ put2FormData(ft,total);
|
|
|
+ FormData laborerFd =tec.formDataMap.get(InterimPaymentCertificate.TBN+ StringPool.COLON+"key_10");
|
|
|
+ put2FormData(laborerFd,StringUtils.number2String(total*0.25,2));
|
|
|
+ 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(Double::parseDouble).sum()));
|
|
|
/*内容输出*/
|
|
|
putOut();
|
|
@@ -338,6 +350,7 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
@Data
|
|
|
@EqualsAndHashCode(callSuper = true)
|
|
|
public class InterimSum extends BaseSpecial<InterimPaymentSummary> implements Special{
|
|
|
+ /*中期支付汇总表*/
|
|
|
@Override
|
|
|
public boolean ready() {
|
|
|
return interimPaymentCertificates.size()>0;
|
|
@@ -614,7 +627,7 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
/*分项数据*/
|
|
|
FormData subPjFd = fdm.get(SubInterimMeterPaySummary.getSubPjFdCode());
|
|
|
if(subPjFd!=null) {
|
|
|
- FormulaUtils.write(subPjFd, this.subProjectName);
|
|
|
+ put2FormData(subPjFd, this.subProjectName);
|
|
|
}
|
|
|
/*内容输出*/
|
|
|
putOut(SubInterimMeterPaySummary.class);
|
|
@@ -827,4 +840,18 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
|
public ExecutorMeter(TableElementConverter tec) {
|
|
|
super(tec);
|
|
|
}
|
|
|
+
|
|
|
+ /*无页码无坐标元素写人*/
|
|
|
+ public static void put2FormData(FormData fd,Object data){
|
|
|
+ if(fd!=null&&data!=null){
|
|
|
+ if(data instanceof List) {
|
|
|
+ List<Object> list = (List<Object>)data;
|
|
|
+ fd.setValues(list.stream().map(ElementData::new).collect(Collectors.toList()));
|
|
|
+ }else{
|
|
|
+ fd.getValues().add(new ElementData(data));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|