|
@@ -8,10 +8,6 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.jfireel.expression.Expression;
|
|
import com.jfireel.expression.Expression;
|
|
import com.mixsmart.utils.*;
|
|
import com.mixsmart.utils.*;
|
|
import lombok.RequiredArgsConstructor;
|
|
import lombok.RequiredArgsConstructor;
|
|
-import org.jsoup.Jsoup;
|
|
|
|
-import org.jsoup.nodes.Document;
|
|
|
|
-import org.jsoup.nodes.Element;
|
|
|
|
-import org.jsoup.select.Elements;
|
|
|
|
import org.springblade.common.utils.SnowFlakeUtil;
|
|
import org.springblade.common.utils.SnowFlakeUtil;
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
import org.springblade.core.mp.base.BaseServiceImpl;
|
|
import org.springblade.core.tool.utils.*;
|
|
import org.springblade.core.tool.utils.*;
|
|
@@ -28,10 +24,6 @@ import org.springblade.manager.vo.AppWbsTreeContractVO;
|
|
import org.springblade.manager.vo.CurrentNode;
|
|
import org.springblade.manager.vo.CurrentNode;
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.jdbc.core.JdbcTemplate;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
-
|
|
|
|
-import java.io.File;
|
|
|
|
-import java.io.FileInputStream;
|
|
|
|
-import java.io.FileNotFoundException;
|
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
import java.util.regex.Matcher;
|
|
import java.util.regex.Matcher;
|
|
@@ -77,9 +69,12 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
public static final String ELE_CODE_REG= "(?<=E\\[)[^]]+(?=])";
|
|
public static final String ELE_CODE_REG= "(?<=E\\[)[^]]+(?=])";
|
|
public static final Pattern P = Pattern.compile(ELE_CODE_REG);
|
|
public static final Pattern P = Pattern.compile(ELE_CODE_REG);
|
|
public static final Pattern P2= Pattern.compile("(?<=E\\[)[^];]+:[^];]+:[^];]+(?=])");
|
|
public static final Pattern P2= Pattern.compile("(?<=E\\[)[^];]+:[^];]+:[^];]+(?=])");
|
|
- public static final String POLY_REG= "(quantity)\\(([^)]+)\\)";
|
|
|
|
public final static String CTI="ContractInfo";
|
|
public final static String CTI="ContractInfo";
|
|
public final static String PJI="ProjectInfo";
|
|
public final static String PJI="ProjectInfo";
|
|
|
|
+ /*元素标识*/
|
|
|
|
+ public final static String E="E";
|
|
|
|
+ /*公式参数*/
|
|
|
|
+ public final static String FMOT="FORMULA_OPTION";
|
|
/**表单信息*/
|
|
/**表单信息*/
|
|
public final static String TEXT_INFO_MAP="textInfoMap";
|
|
public final static String TEXT_INFO_MAP="textInfoMap";
|
|
|
|
|
|
@@ -217,7 +212,8 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
/*公式参数*/
|
|
/*公式参数*/
|
|
FormulaOption formulaOption = this.formulaOptionService.getOne(Wrappers.<FormulaOption>lambdaQuery().eq(FormulaOption::getParentId,one.getId()).eq(FormulaOption::getContractId,contractId));
|
|
FormulaOption formulaOption = this.formulaOptionService.getOne(Wrappers.<FormulaOption>lambdaQuery().eq(FormulaOption::getParentId,one.getId()).eq(FormulaOption::getContractId,contractId));
|
|
if(formulaOption!=null){
|
|
if(formulaOption!=null){
|
|
- LinkedHashMap linkedHashMap = JSON.parseObject(formulaOption.getVal(),LinkedHashMap.class);
|
|
|
|
|
|
+ /*数据格式 {tablename:{keyxxx:{option:[1|0]}}}*/
|
|
|
|
+ this.constantMap.put(FMOT,JSON.parseObject(formulaOption.getVal(),LinkedHashMap.class));
|
|
}
|
|
}
|
|
return this;
|
|
return this;
|
|
}
|
|
}
|
|
@@ -417,7 +413,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
public IFormulaService pre() {
|
|
public IFormulaService pre() {
|
|
if(CollectionUtil.isNotEmpty(this.formDataList)){
|
|
if(CollectionUtil.isNotEmpty(this.formDataList)){
|
|
for(FormData fd:this.formDataList){
|
|
for(FormData fd:this.formDataList){
|
|
- /*预处理公式脚本*/
|
|
|
|
|
|
+ /*预处理公式脚本,只做文本转换不做计算*/
|
|
if(!fd.executable()){
|
|
if(!fd.executable()){
|
|
/*不存公式,则认为执行完成,不会再主动执行*/
|
|
/*不存公式,则认为执行完成,不会再主动执行*/
|
|
fd.setFinished(Boolean.TRUE);
|
|
fd.setFinished(Boolean.TRUE);
|
|
@@ -429,18 +425,17 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
}
|
|
}
|
|
String tmp =fd.getFormula().getFormula();
|
|
String tmp =fd.getFormula().getFormula();
|
|
tmp = tmp.replace(FC, CustomFunction.CLASS_CALL);
|
|
tmp = tmp.replace(FC, CustomFunction.CLASS_CALL);
|
|
- if(tmp.contains(CustomFunction.CLASS_CALL+"ifelse")){
|
|
|
|
- Matcher im =IF.matcher(tmp);
|
|
|
|
- while (im.find()){
|
|
|
|
- String rep =im.group();
|
|
|
|
- Matcher fm=P.matcher(rep);
|
|
|
|
- while (fm.find()){
|
|
|
|
- rep=rep.replace(fm.group(),"'"+fm.group()+"'");
|
|
|
|
- }
|
|
|
|
- tmp=tmp.replace(im.group(),rep);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
|
|
+// if(tmp.contains(CustomFunction.CLASS_CALL+"ifelse")){
|
|
|
|
+// Matcher im =IF.matcher(tmp);
|
|
|
|
+// while (im.find()){
|
|
|
|
+// String rep =im.group();
|
|
|
|
+// Matcher fm=P.matcher(rep);
|
|
|
|
+// while (fm.find()){
|
|
|
|
+// rep=rep.replace(fm.group(),"'"+fm.group()+"'");
|
|
|
|
+// }
|
|
|
|
+// tmp=tmp.replace(im.group(),rep);
|
|
|
|
+// }
|
|
|
|
+// }
|
|
if(tmp.contains("E[")||tmp.contains("WP[")){
|
|
if(tmp.contains("E[")||tmp.contains("WP[")){
|
|
Matcher am = AP.matcher(tmp);
|
|
Matcher am = AP.matcher(tmp);
|
|
while (am.find()){
|
|
while (am.find()){
|
|
@@ -474,9 +469,6 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
|
|
|
|
@Override
|
|
@Override
|
|
public IFormulaService calculate() {
|
|
public IFormulaService calculate() {
|
|
- /*公式执行*/
|
|
|
|
- /*先处理聚合类的方法*/
|
|
|
|
- /*每次执行都会构造一个只有依赖的的集合*/
|
|
|
|
for(FormData fd:this.formDataList){
|
|
for(FormData fd:this.formDataList){
|
|
if(fd.verify()){
|
|
if(fd.verify()){
|
|
Formula formula =fd.getFormula();
|
|
Formula formula =fd.getFormula();
|
|
@@ -493,7 +485,6 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
relyList.forEach(rely->{
|
|
relyList.forEach(rely->{
|
|
FormData formData= this.tec.getFormDataMap().get(rely);
|
|
FormData formData= this.tec.getFormDataMap().get(rely);
|
|
if(formData!=null&&formData.getValues().size()>0){
|
|
if(formData!=null&&formData.getValues().size()>0){
|
|
- /*formData.getValues().stream().anyMatch(Func::isNotEmpty)*/
|
|
|
|
ele.add(formData);
|
|
ele.add(formData);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -520,14 +511,14 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
while (cda.hasNext()){
|
|
while (cda.hasNext()){
|
|
LinkedHashMap<String,ElementData> tip= cda.next();
|
|
LinkedHashMap<String,ElementData> tip= cda.next();
|
|
Map<String, Object> variable = new HashMap<>(this.constantMap);
|
|
Map<String, Object> variable = new HashMap<>(this.constantMap);
|
|
- Map<String,Object> E=getMap(variable,"E");
|
|
|
|
|
|
+ Map<String,Object> em= (Map<String, Object>) variable.computeIfAbsent(E, k->new HashMap<>());
|
|
int index= new ArrayList<>(tip.values()).get(0).getIndex();
|
|
int index= new ArrayList<>(tip.values()).get(0).getIndex();
|
|
for(Map.Entry<String,ElementData> se:tip.entrySet()){
|
|
for(Map.Entry<String,ElementData> se:tip.entrySet()){
|
|
Object value=se.getValue().getValue();
|
|
Object value=se.getValue().getValue();
|
|
if(CustomFunction.isNumber(value)){
|
|
if(CustomFunction.isNumber(value)){
|
|
- E.put(se.getKey(),StringUtils.obj2Double(value));
|
|
|
|
|
|
+ em.put(se.getKey(),StringUtils.obj2Double(value));
|
|
}else{
|
|
}else{
|
|
- E.put(se.getKey(),value);
|
|
|
|
|
|
+ em.put(se.getKey(),value);
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
@@ -536,19 +527,11 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
if(local.size()>0){
|
|
if(local.size()>0){
|
|
List<Object> values = slice(local,this.constantMap,f);
|
|
List<Object> values = slice(local,this.constantMap,f);
|
|
write(fd,values);
|
|
write(fd,values);
|
|
-// if(values.size()>fd.getValues().size()){
|
|
|
|
-// /*当生成的数据超过实际容量的时候,会自动合并到第一个单元格*/
|
|
|
|
-// fd.getValues().get(0).setValue(values.stream().filter(Func::isNotEmpty).map(StringUtils::handleNull).collect(Collectors.joining("、")));
|
|
|
|
-// }else{
|
|
|
|
-// for(int n=0;n<values.size();n++){
|
|
|
|
-// fd.getValues().get(n).setValue(values.get(n));
|
|
|
|
-// }
|
|
|
|
-// }
|
|
|
|
}
|
|
}
|
|
}else{
|
|
}else{
|
|
- Map<String,Object> E = (Map<String, Object>) currentMap.computeIfAbsent("E",(k)-> new HashMap<>());
|
|
|
|
|
|
+ Map<String,Object> em = (Map<String, Object>) currentMap.computeIfAbsent(E,(k)-> new HashMap<>());
|
|
ele.forEach(e->{
|
|
ele.forEach(e->{
|
|
- E.put(e.getCode(),e.getValues().stream().map(ElementData::getValue).collect(Collectors.toList()));
|
|
|
|
|
|
+ em.put(e.getCode(),e.getValues().stream().map(ElementData::getValue).collect(Collectors.toList()));
|
|
});
|
|
});
|
|
Object data =Expression.parse(formula.getFormula()).calculate(currentMap);
|
|
Object data =Expression.parse(formula.getFormula()).calculate(currentMap);
|
|
write(fd,data);
|
|
write(fd,data);
|
|
@@ -593,9 +576,9 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
/*超页就尽管写进去,格式化阶段再加表*/
|
|
/*超页就尽管写进去,格式化阶段再加表*/
|
|
Coords coords = coordsList.get(j);
|
|
Coords coords = coordsList.get(j);
|
|
Object v=null;
|
|
Object v=null;
|
|
- int st=i*coordsList.size()*j;
|
|
|
|
|
|
+ int st=i*coordsList.size()+j;
|
|
if(st<overList.size()){
|
|
if(st<overList.size()){
|
|
- v= values.get(st);
|
|
|
|
|
|
+ v= overList.get(st);
|
|
}
|
|
}
|
|
addList.add(new ElementData(indexBase+i,last.getGroupId(),v,coords.getX(),coords.getY()));
|
|
addList.add(new ElementData(indexBase+i,last.getGroupId(),v,coords.getX(),coords.getY()));
|
|
}
|
|
}
|
|
@@ -627,53 +610,49 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
KeyMapper last = kms.get(kms.size()-1);
|
|
KeyMapper last = kms.get(kms.size()-1);
|
|
WbsTreeContract origin = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId,last.getPkId()));
|
|
WbsTreeContract origin = this.wbsTreeContractService.getOne(Wrappers.<WbsTreeContract>lambdaQuery().eq(WbsTreeContract::getPKeyId,last.getPkId()));
|
|
if(origin!=null){
|
|
if(origin!=null){
|
|
- Long mark =origin.getPKeyId();
|
|
|
|
for(int i=0;i<pageAdd;i++){
|
|
for(int i=0;i<pageAdd;i++){
|
|
/*复制表*/
|
|
/*复制表*/
|
|
WbsTreeContract target = new WbsTreeContract();
|
|
WbsTreeContract target = new WbsTreeContract();
|
|
BeanUtil.copy(origin,target);
|
|
BeanUtil.copy(origin,target);
|
|
target.setPKeyId(SnowFlakeUtil.getId());
|
|
target.setPKeyId(SnowFlakeUtil.getId());
|
|
- this.wbsTreeContractService.saveOrUpdate(target);
|
|
|
|
- List<KeyMapper> allInTable=tec.getKeyMappers().stream().filter(e->e.getTableName().equals(fd.getTableName())).collect(Collectors.toList());
|
|
|
|
|
|
+ target.setCreateTime(new Date());
|
|
|
|
+ String nodeName = origin.getNodeName();
|
|
|
|
+ if (nodeName.contains("__")) {
|
|
|
|
+ String[] oldName = nodeName.split("__");
|
|
|
|
+ nodeName = oldName[0] + "__" + (Integer.parseInt(oldName[1]) + 1);
|
|
|
|
+ } else {
|
|
|
|
+ nodeName = nodeName + "__" + 1;
|
|
|
|
+ }
|
|
|
|
+ target.setNodeName(nodeName);
|
|
|
|
+ target.setIsCopeTab(2);
|
|
|
|
+ target.setIsTabPdf(1); // pdf 不能预览
|
|
|
|
+ target.setIsBussShow(1); // 是否隐藏表
|
|
|
|
+ target.setTabFileType(1);//没有上传附件
|
|
|
|
+ target.setPdfUrl("");
|
|
|
|
+ this.wbsTreeContractService.save(target);
|
|
|
|
+ Long pkeyId=origin.getPKeyId();
|
|
|
|
+ List<KeyMapper> allInTable=tec.getKeyMappers().stream().filter(e->e.getPkId().equals(pkeyId)).collect(Collectors.toList());
|
|
allInTable.forEach(e->{
|
|
allInTable.forEach(e->{
|
|
KeyMapper km = new KeyMapper();
|
|
KeyMapper km = new KeyMapper();
|
|
BeanUtil.copy(e,km);
|
|
BeanUtil.copy(e,km);
|
|
km.setPkId(target.getPKeyId());
|
|
km.setPkId(target.getPKeyId());
|
|
tec.getKeyMappers().add(km);
|
|
tec.getKeyMappers().add(km);
|
|
});
|
|
});
|
|
- tec.getTableInfoList().stream().filter(o->StringUtils.isEquals(o.getPkeyId(),mark)).findFirst().ifPresent(tb->{
|
|
|
|
|
|
+ tec.getTableInfoList().stream().filter(o->StringUtils.isEquals(o.getPkeyId(),pkeyId)).findFirst().ifPresent(tb->{
|
|
/*表单数据复制*/
|
|
/*表单数据复制*/
|
|
TableInfo tableInfo = new TableInfo();
|
|
TableInfo tableInfo = new TableInfo();
|
|
BeanUtil.copy(tb,tableInfo);
|
|
BeanUtil.copy(tb,tableInfo);
|
|
- tableInfo.setDataMap(new LinkedHashMap<>());
|
|
|
|
|
|
+ tableInfo.setPkeyId(target.getPKeyId().toString());
|
|
|
|
+ tableInfo.setDataMap(new LinkedHashMap<>(tb.getDataMap()));
|
|
|
|
+ tableInfo.getDataMap().put("p_key_id",tableInfo.getPkeyId());
|
|
tec.getTableInfoList().add(tec.getTableInfoList().indexOf(tb)+1,tableInfo);
|
|
tec.getTableInfoList().add(tec.getTableInfoList().indexOf(tb)+1,tableInfo);
|
|
});
|
|
});
|
|
|
|
+ origin=target;
|
|
}
|
|
}
|
|
//enlarge(fd,pageAdd);
|
|
//enlarge(fd,pageAdd);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public void enlarge(FormData fd,int pageAdd){
|
|
|
|
- List<FormData> targetList = tec.getFormDataMap().values().stream().filter(e->StringUtils.isEquals(fd.getTableName(),e.getTableName())).collect(Collectors.toList());
|
|
|
|
- targetList.forEach(tmp->{
|
|
|
|
- if(tmp!=null){
|
|
|
|
- List<Coords> list = tmp.getCoordsList();
|
|
|
|
- ElementData last = tmp.getValues().get(tmp.getValues().size()-1);
|
|
|
|
- int index =last.getIndex();
|
|
|
|
- int groupId=last.getGroupId();
|
|
|
|
- Object data=null;
|
|
|
|
- if(Formula.FULL.equals(tmp.getFormula().getOutm())){
|
|
|
|
- data=tmp.getValues().get(tmp.getValues().size()-1);
|
|
|
|
- }
|
|
|
|
- for(int i=0;i<pageAdd;i++){
|
|
|
|
- int finalIndex = index;
|
|
|
|
- Object finalData = data;
|
|
|
|
- tmp.getValues().addAll(list.stream().map(c-> new ElementData(finalIndex,groupId, finalData,c.getX(),c.getY())).collect(Collectors.toList()));
|
|
|
|
- index++;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -695,12 +674,9 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
}
|
|
}
|
|
}
|
|
}
|
|
/*检查超页情况*/
|
|
/*检查超页情况*/
|
|
- LinkedHashMap<String,List<FormData>> tableElementMaps= this.formDataMap.values().stream().filter(e->e.getUpdate()==1&&e.getAddPages()>0).sorted(Comparator.comparing(FormData::getAddPages).reversed()).collect(Collectors.groupingBy(FormData::getTableName,LinkedHashMap::new,Collectors.toList()));
|
|
|
|
- for(Map.Entry<String,List<FormData>> entry:tableElementMaps.entrySet()){
|
|
|
|
- String tableName=entry.getKey();
|
|
|
|
- FormData max= entry.getValue().get(0);
|
|
|
|
- copy(max);
|
|
|
|
- }
|
|
|
|
|
|
+ this.formDataMap.values().stream().filter(e->e.getUpdate()==1&&e.getAddPages()>0).sorted(Comparator.comparing(FormData::getAddPages).reversed())
|
|
|
|
+ .collect(Collectors.groupingBy(FormData::getTableName,LinkedHashMap::new,Collectors.toList())).values()
|
|
|
|
+ .forEach(l->copy(l.get(0)));;
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
@@ -752,14 +728,6 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- public Map<String,Object> getMap(Map<String,Object> main,String key){
|
|
|
|
- Map<String,Object> CNDMap = (Map<String, Object>) main.get(key);
|
|
|
|
- if(CNDMap==null){
|
|
|
|
- CNDMap = new HashMap<>();
|
|
|
|
- main.put(key,CNDMap);
|
|
|
|
- }
|
|
|
|
- return CNDMap;
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
|
|
public List<Object> slice(List<LocalVariable> local,Map<String,Object> constantMap,String formula){
|
|
public List<Object> slice(List<LocalVariable> local,Map<String,Object> constantMap,String formula){
|
|
@@ -865,17 +833,19 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if(f.contains(".option")){
|
|
if(f.contains(".option")){
|
|
|
|
+ /*FC.optionC?是无法嵌套的函数*/
|
|
Matcher m = RegexUtils.matcher(FC_REG+"(optionC?)\\(([^)]+)\\)",f);
|
|
Matcher m = RegexUtils.matcher(FC_REG+"(optionC?)\\(([^)]+)\\)",f);
|
|
while (m.find()){
|
|
while (m.find()){
|
|
String[] args= m.group(2).split(",");
|
|
String[] args= m.group(2).split(",");
|
|
String flag=args[0];
|
|
String flag=args[0];
|
|
- if(flag.equals("OPTION")){
|
|
|
|
|
|
+ /*radio控件,结果只有两个0,1 ,结果作为标识位,且为1才会执第二个参数的回调方法*/
|
|
|
|
+ if("OPTION".equals(flag)){
|
|
Optional<KeyMapper> kOp=tec.getKeyMappers().stream().filter(e->StringUtils.isEquals(e.getCode(),fd.getCode())).findFirst();
|
|
Optional<KeyMapper> kOp=tec.getKeyMappers().stream().filter(e->StringUtils.isEquals(e.getCode(),fd.getCode())).findFirst();
|
|
if(kOp.isPresent()){
|
|
if(kOp.isPresent()){
|
|
/*表名+合同段+父节点*/
|
|
/*表名+合同段+父节点*/
|
|
- String findStr = "OP"+DigestUtil.md5Hex(fd.getCode()+ tec.getTableAll().stream().filter(t->StringUtils.isEquals(t.getPKeyId(),kOp.get().getPkId())).map(t->fd.getTableName()+t.getContractId()+t.getParentId()).collect(Collectors.joining()));
|
|
|
|
- Map<String,Object> dictMap = (Map<String, Object>) this.constantMap.computeIfAbsent("OPTION",k->new HashMap<>());
|
|
|
|
- flag=StringUtils.handleNull(dictMap.get(findStr));
|
|
|
|
|
|
+ Map<String,Object> optionMap = (Map<String, Object>) this.constantMap.computeIfAbsent(FMOT,k->new HashMap<>());
|
|
|
|
+ String findStr=fd.getTableName()+"['"+fd.getKey()+"']['TF']";
|
|
|
|
+ flag=StringUtils.handleNull(Expression.parse(findStr).calculate(optionMap));
|
|
}
|
|
}
|
|
}else if(flag.contains("E[")){
|
|
}else if(flag.contains("E[")){
|
|
List<FormData> target = getFormDataByCode(flag);
|
|
List<FormData> target = getFormDataByCode(flag);
|
|
@@ -888,7 +858,7 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
flag="0";
|
|
flag="0";
|
|
}
|
|
}
|
|
if(StringUtils.isEquals(flag,1)){
|
|
if(StringUtils.isEquals(flag,1)){
|
|
- f=f.replace(m.group(),m.group(2).replaceAll("^[0-1],",""));
|
|
|
|
|
|
+ f=f.replace(m.group(),args[1]);
|
|
}else{
|
|
}else{
|
|
f=f.replace(m.group(),"''");
|
|
f=f.replace(m.group(),"''");
|
|
}
|
|
}
|
|
@@ -954,9 +924,9 @@ public class FormulaServiceImpl extends BaseServiceImpl<FormulaMapper, Formula>
|
|
Map<String,Object> currentMap= new HashMap<String,Object>(this.constantMap);
|
|
Map<String,Object> currentMap= new HashMap<String,Object>(this.constantMap);
|
|
List<FormData> fds= getFormDataByCode(String.join(",", getCodeByEl(el)));
|
|
List<FormData> fds= getFormDataByCode(String.join(",", getCodeByEl(el)));
|
|
if(Func.isNotEmpty(fds)){
|
|
if(Func.isNotEmpty(fds)){
|
|
- Map<String,Object> E= (Map<String, Object>) currentMap.computeIfAbsent("E", k->new HashMap<String,Object>());
|
|
|
|
|
|
+ Map<String,Object> Em= (Map<String, Object>) currentMap.computeIfAbsent(E, k->new HashMap<String,Object>());
|
|
fds.forEach(e->{
|
|
fds.forEach(e->{
|
|
- E.put(e.getCode(),e.getValues().stream().map(ElementData::getValue).collect(Collectors.toList()));
|
|
|
|
|
|
+ Em.put(e.getCode(),e.getValues().stream().map(ElementData::getValue).collect(Collectors.toList()));
|
|
});
|
|
});
|
|
}
|
|
}
|
|
return currentMap;
|
|
return currentMap;
|