|
|
@@ -3,9 +3,12 @@ package org.jeecg.modules.medical.ruleengine;
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
+import org.apache.poi.ss.formula.functions.Even;
|
|
|
import org.jeecg.modules.medical.ColumnTypeEnum;
|
|
|
import org.jeecg.modules.medical.entity.EventAttr;
|
|
|
import org.jeecg.modules.medical.entity.FactorCondRela;
|
|
|
+import org.jeecg.modules.medical.service.IEventAttrService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.expression.Expression;
|
|
|
import org.springframework.expression.ExpressionParser;
|
|
|
import org.springframework.expression.spel.standard.SpelExpressionParser;
|
|
|
@@ -26,12 +29,14 @@ import java.util.Map;
|
|
|
@Component
|
|
|
public class SPELUtil {
|
|
|
ExpressionParser parser = new SpelExpressionParser();
|
|
|
+ @Autowired
|
|
|
+ IEventAttrService eventAttrService;
|
|
|
|
|
|
public String getSPELString(FactorCondRela factorCondRela, Map<Integer, EventAttr> enchanceAttrMap) {
|
|
|
Integer operater = factorCondRela.getOperator();
|
|
|
OperaterEnum operaterEnum = OperaterEnum.getType(operater);
|
|
|
- EventAttr eventAttr = enchanceAttrMap.get(factorCondRela.getEventAttrId());
|
|
|
- EventAttr refEventAttr = enchanceAttrMap.get(factorCondRela.getRefEventAttrId());
|
|
|
+ EventAttr eventAttr = eventAttrService.getById(factorCondRela.getEventAttrId());
|
|
|
+ EventAttr refEventAttr = eventAttrService.getById(factorCondRela.getRefEventAttrId());
|
|
|
|
|
|
if (2 == factorCondRela.getRefAttrType() && null == refEventAttr) {
|
|
|
throw new NullPointerException("表达式Id:" + factorCondRela.getId() + " 表达式:" + factorCondRela.getCondStr() + " 要素提取id:" + factorCondRela.getFactorEnhanceId() + " 要素id:" + factorCondRela.getRefEventAttrId() + " 配置的被比较要素不存在,要素管理未配置");
|