|
@@ -1,26 +1,22 @@
|
|
|
package org.springblade.manager.formula.impl;
|
|
|
|
|
|
import com.jfireel.expression.Expression;
|
|
|
-import com.mixsmart.utils.CustomFunction;
|
|
|
import com.mixsmart.utils.FormulaUtils;
|
|
|
import com.mixsmart.utils.ListUtils;
|
|
|
import com.mixsmart.utils.StringUtils;
|
|
|
import lombok.Data;
|
|
|
import org.springblade.business.feign.MileageClient;
|
|
|
-import org.springblade.common.utils.BaseUtils;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
-import org.springblade.core.tool.utils.StringPool;
|
|
|
-import org.springblade.manager.bean.TableInfo;
|
|
|
import org.springblade.manager.dto.ElementData;
|
|
|
import org.springblade.manager.dto.FormData;
|
|
|
import org.springblade.manager.entity.Formula;
|
|
|
+import org.springblade.manager.entity.WbsTreeContract;
|
|
|
import org.springblade.manager.formula.FormulaStrategy;
|
|
|
import org.springblade.manager.formula.KeyMapper;
|
|
|
import org.springblade.manager.formula.Mileage;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
import java.util.*;
|
|
|
-import java.util.regex.Matcher;
|
|
|
import java.util.regex.Pattern;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -75,7 +71,6 @@ public class FormulaMileage implements FormulaStrategy {
|
|
|
mileage.setValue(0, ed.stringValue());
|
|
|
Long pkeyId=tableInfoIds.get(ed.getIndex());
|
|
|
String findStr="OP['"+cur.getTableName()+"']['"+pkeyId+"@"+cur.getKey()+"__"+ed.getY()+"_"+ed.getX()+"']['TF']";
|
|
|
- String flag=StringUtils.handleNull(Expression.parse(findStr).calculate(tec.getConstantMap()));
|
|
|
mileage.setVertical(StringUtils.isEquals(1,StringUtils.handleNull(Expression.parse(findStr).calculate(tec.getConstantMap()))));
|
|
|
row.put(line0.getCode(), ed);
|
|
|
for (int j = 1; j < relyList.size(); j++) {
|
|
@@ -90,14 +85,13 @@ public class FormulaMileage implements FormulaStrategy {
|
|
|
|
|
|
}
|
|
|
mileageList.add(mileage);
|
|
|
-
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
if(Func.isNotEmpty(mileageList)){
|
|
|
List<String> zhpw =mileageList.stream().filter(Mileage::isChecked).map(Mileage::getZhPw).collect(Collectors.toList());
|
|
|
Map<String,String[]> coordinateMap = mileageClient.mileage2Coordinate(zhpw,Func.toLong(tec.getConstantMap().get("contractId")));
|
|
|
/*G10缓存对象*/
|
|
|
- tec.getConstantMap().put("G10",new Object());
|
|
|
if(coordinateMap.size()>0){
|
|
|
mileageList.forEach(m->{
|
|
|
String[] coordinate = coordinateMap.get(m.getZhPw());
|
|
@@ -118,7 +112,7 @@ public class FormulaMileage implements FormulaStrategy {
|
|
|
}
|
|
|
});
|
|
|
data.forEach(e->{e.setUpdate(1);e.setFinished(Boolean.TRUE);});
|
|
|
-
|
|
|
+ forG10(mileageList,tec);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -126,7 +120,14 @@ public class FormulaMileage implements FormulaStrategy {
|
|
|
}
|
|
|
public static final Pattern MILE_P = Pattern.compile("(?<=T\\(com.mixsmart.utils.CustomFunction\\).MILE\\()([^,]+),([^,]+)(?=,)");
|
|
|
|
|
|
-
|
|
|
+ public void forG10(List<Mileage> data,TableElementConverter tec){
|
|
|
+ if(Func.isNotEmpty(data)){
|
|
|
+ Map<String,Object> g10 = (Map<String, Object>) tec.getConstantMap().computeIfAbsent("G10", k->new HashMap<>());
|
|
|
+ g10.put("dx",data.stream().map(Mileage::getDx).collect(Collectors.toList()));
|
|
|
+ g10.put("dxnv",data.stream().filter(e->!e.getVertical()).map(Mileage::getDx).collect(Collectors.toList()));
|
|
|
+ g10.put("dxv",data.stream().filter(Mileage::getVertical).map(Mileage::getDx).collect(Collectors.toList()));
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
public void write( LinkedHashMap<String,ElementData> row,List<Object>data,List<String> keys,List<String> scale3){
|
|
|
if(ListUtils.isNotEmpty(data)){
|