|
@@ -1,5 +1,6 @@
|
|
|
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;
|
|
@@ -9,10 +10,12 @@ 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.formula.FormulaStrategy;
|
|
|
+import org.springblade.manager.formula.KeyMapper;
|
|
|
import org.springblade.manager.formula.Mileage;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
@@ -65,10 +68,15 @@ public class FormulaMileage implements FormulaStrategy {
|
|
|
FormData line0=data.get(0);
|
|
|
if(line0!=null&&Func.isNotEmpty(line0.getValues())){
|
|
|
List<ElementData> eds=line0.getValues();
|
|
|
+ List<Long> tableInfoIds= tec.getKeyMappers().stream().filter(k->k.getTableName().equals(cur.getTableName())).map(KeyMapper::getPkId).distinct().collect(Collectors.toList());
|
|
|
for (ElementData ed : eds) {
|
|
|
LinkedHashMap<String, ElementData> row = new LinkedHashMap<>();
|
|
|
Mileage mileage = new Mileage(row);
|
|
|
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++) {
|
|
|
FormData rely = data.get(j);
|
|
@@ -88,6 +96,8 @@ public class FormulaMileage implements FormulaStrategy {
|
|
|
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());
|