|
@@ -1,6 +1,5 @@
|
|
package org.springblade.manager.formula.impl;
|
|
package org.springblade.manager.formula.impl;
|
|
|
|
|
|
-import com.mixsmart.utils.CustomFunction;
|
|
|
|
import com.mixsmart.utils.FormulaUtils;
|
|
import com.mixsmart.utils.FormulaUtils;
|
|
import com.mixsmart.utils.StringUtils;
|
|
import com.mixsmart.utils.StringUtils;
|
|
import lombok.Data;
|
|
import lombok.Data;
|
|
@@ -325,7 +324,7 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
}
|
|
}
|
|
/*数据获取end*/
|
|
/*数据获取end*/
|
|
/*本期实际支付合计计算*/
|
|
/*本期实际支付合计计算*/
|
|
- functionMap.put(InterimPaymentCertificate.TBN+ StringPool.COLON+"key_9",(List<InterimPaymentCertificate> list)-> Collections.singletonList(list.stream().map(InterimPaymentCertificate::getCurrentPeriodPay).mapToDouble(Double::parseDouble).sum()));
|
|
|
|
|
|
+ fieldDataFcMap.put(InterimPaymentCertificate.TBN+ StringPool.COLON+"key_9",(List<InterimPaymentCertificate> list)-> Collections.singletonList(list.stream().map(InterimPaymentCertificate::getCurrentPeriodPay).mapToDouble(Double::parseDouble).sum()));
|
|
/*内容输出*/
|
|
/*内容输出*/
|
|
putOut();
|
|
putOut();
|
|
}
|
|
}
|
|
@@ -481,8 +480,12 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
sis.setPayRatio(ratioFc.apply(sis.getCurrentPeriodEndPay(),sis.getChangeMoney()));
|
|
sis.setPayRatio(ratioFc.apply(sis.getCurrentPeriodEndPay(),sis.getChangeMoney()));
|
|
totalList.add(sis);
|
|
totalList.add(sis);
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+
|
|
LinkedHashMap<String,List<SubprojectInterimPaymentSummary>> chapterGroup= totalList.stream().collect(Collectors.groupingBy(e->getPrefix(e.getFormNumber()),LinkedHashMap::new,Collectors.toList()));
|
|
LinkedHashMap<String,List<SubprojectInterimPaymentSummary>> chapterGroup= totalList.stream().collect(Collectors.groupingBy(e->getPrefix(e.getFormNumber()),LinkedHashMap::new,Collectors.toList()));
|
|
AtomicInteger loop = new AtomicInteger(chapterGroup.size());
|
|
AtomicInteger loop = new AtomicInteger(chapterGroup.size());
|
|
|
|
+ AtomicInteger pn = new AtomicInteger();
|
|
|
|
+ List<String> pageList= new ArrayList<>();
|
|
chapterGroup.forEach((k,v)->{
|
|
chapterGroup.forEach((k,v)->{
|
|
int extra=loop.getAndDecrement()>0?1:2;
|
|
int extra=loop.getAndDecrement()>0?1:2;
|
|
/*每章小结或总结等价一行数据*/
|
|
/*每章小结或总结等价一行数据*/
|
|
@@ -517,12 +520,17 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
}
|
|
}
|
|
dataList.addAll(tmp);
|
|
dataList.addAll(tmp);
|
|
tmp.clear();
|
|
tmp.clear();
|
|
|
|
+ pn.incrementAndGet();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
|
|
+ FormData pageFd = fdm.get(FormulaUtils.getPageCode(SubprojectInterimPaymentSummary.class));
|
|
|
|
+ String pageTmp="第$1页 共"+pn.get()+"页";
|
|
|
|
+ pageFd.setValues(IntStream.range(0,pn.get()).boxed().map(i->new ElementData(pageTmp.replace("$1",i.toString()))).collect(Collectors.toList()));
|
|
/*内容输出*/
|
|
/*内容输出*/
|
|
putOut();
|
|
putOut();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
public void subtotal(SubprojectInterimPaymentSummary b, List<SubprojectInterimPaymentSummary> result ,List<SubprojectInterimPaymentSummary> data){
|
|
public void subtotal(SubprojectInterimPaymentSummary b, List<SubprojectInterimPaymentSummary> result ,List<SubprojectInterimPaymentSummary> data){
|
|
b.calculate(data);
|
|
b.calculate(data);
|
|
result.add(b);
|
|
result.add(b);
|
|
@@ -744,7 +752,7 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
/*数据模型包含的元素*/
|
|
/*数据模型包含的元素*/
|
|
public LinkedHashMap<String,FormData> fdm;
|
|
public LinkedHashMap<String,FormData> fdm;
|
|
/*元素内容输出对应的映射函数*/
|
|
/*元素内容输出对应的映射函数*/
|
|
- public Map<String,Function<List<T>,List<Object>>> functionMap;
|
|
|
|
|
|
+ public Map<String,Function<List<T>,List<Object>>> fieldDataFcMap;
|
|
/*获取实际输出行数*/
|
|
/*获取实际输出行数*/
|
|
public Integer capacity;
|
|
public Integer capacity;
|
|
/*输出值*/
|
|
/*输出值*/
|
|
@@ -752,7 +760,7 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
/*用实例去构建带有初始化数据的元素*/
|
|
/*用实例去构建带有初始化数据的元素*/
|
|
public void builderFormDatas(T bean){
|
|
public void builderFormDatas(T bean){
|
|
fdm = FormulaUtils.toFormDataMap(bean);
|
|
fdm = FormulaUtils.toFormDataMap(bean);
|
|
- functionMap =FormulaUtils.fieldDataFcMap(bean.getClass());
|
|
|
|
|
|
+ fieldDataFcMap =FormulaUtils.fieldDataFcMap(bean.getClass());
|
|
capacity=getLineSize(new ArrayList<>(fdm.keySet()));
|
|
capacity=getLineSize(new ArrayList<>(fdm.keySet()));
|
|
tec.getFormDataMap().putAll(fdm);
|
|
tec.getFormDataMap().putAll(fdm);
|
|
dataList=new ArrayList<>();
|
|
dataList=new ArrayList<>();
|
|
@@ -760,14 +768,14 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
/*用元类class 创建空元素*/
|
|
/*用元类class 创建空元素*/
|
|
public void builderFormDatas(Class<T> clazz){
|
|
public void builderFormDatas(Class<T> clazz){
|
|
fdm = FormulaUtils.toFormDataMap(clazz);
|
|
fdm = FormulaUtils.toFormDataMap(clazz);
|
|
- functionMap =FormulaUtils.fieldDataFcMap(clazz);
|
|
|
|
|
|
+ fieldDataFcMap =FormulaUtils.fieldDataFcMap(clazz);
|
|
capacity=getLineSize(new ArrayList<>(fdm.keySet()));
|
|
capacity=getLineSize(new ArrayList<>(fdm.keySet()));
|
|
tec.getFormDataMap().putAll(fdm);
|
|
tec.getFormDataMap().putAll(fdm);
|
|
dataList=new ArrayList<>();
|
|
dataList=new ArrayList<>();
|
|
}
|
|
}
|
|
/*写入对应的元素*/
|
|
/*写入对应的元素*/
|
|
public void putOut(){
|
|
public void putOut(){
|
|
- FormulaUtils.put2FormData(fdm,functionMap,dataList);
|
|
|
|
|
|
+ FormulaUtils.put2FormData(fdm, fieldDataFcMap,dataList);
|
|
};
|
|
};
|
|
}
|
|
}
|
|
interface Special{
|
|
interface Special{
|
|
@@ -775,6 +783,7 @@ public class ExecutorMeter extends FormulaExecutor {
|
|
boolean ready();
|
|
boolean ready();
|
|
/**解析数据*/
|
|
/**解析数据*/
|
|
void parse();
|
|
void parse();
|
|
|
|
+
|
|
}
|
|
}
|
|
public ExecutorMeter(TableElementConverter tec) {
|
|
public ExecutorMeter(TableElementConverter tec) {
|
|
super(tec);
|
|
super(tec);
|