|
@@ -715,6 +715,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
Map<String, Object> currentMap = new HashMap<>(tec.constantMap);
|
|
|
List<String> relyList = fd.getFormula().getRelyList();
|
|
|
if(CollectionUtil.isNotEmpty(relyList)){
|
|
|
+ /*存在依赖*/
|
|
|
List<FormData> ele = new ArrayList<>();
|
|
|
relyList.forEach(rely->{
|
|
|
FormData formData= this.tec.getFormDataMap().get(rely);
|
|
@@ -768,13 +769,19 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
}else{
|
|
|
@SuppressWarnings("unchecked")
|
|
|
Map<String,Object> em = (Map<String, Object>) currentMap.computeIfAbsent(E,(k)-> new HashMap<>());
|
|
|
- ele.forEach(e->{
|
|
|
- em.put(e.getCode(),e.getValues().stream().map(ElementData::getValue).collect(Collectors.toList()));
|
|
|
- });
|
|
|
+ if(ele.stream().map(e->e.getCoordsList().size()).max(Comparator.comparingInt(e->e)).orElse(1)==1&&fd.getCoordsList().size()==1){
|
|
|
+ ele.forEach(e->{
|
|
|
+ em.put(e.getCode(),e.getValues().get(0).getValue());
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ ele.forEach(e->{
|
|
|
+ em.put(e.getCode(),e.getValues().stream().map(ElementData::getValue).collect(Collectors.toList()));
|
|
|
+ });
|
|
|
+ }
|
|
|
Object data =Expression.parse(formula.getFormula()).calculate(currentMap);
|
|
|
write(fd,data);
|
|
|
}
|
|
|
- /*重置*/
|
|
|
+ /*错位计算偏移量重置*/
|
|
|
ele.stream().filter(s->s.getOffset()>0).forEach(FormData::restore);
|
|
|
}else{
|
|
|
Object data =Expression.parse(formula.getFormula()).calculate(currentMap);
|