|
@@ -18,6 +18,7 @@ import org.apache.commons.collections.MapUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Component;
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
@@ -37,7 +38,7 @@ public class RuleAggregate {
|
|
|
public Map<String, RuleDTO> getAllRules(
|
|
|
@DataConsumer("getRuleInit") Map<String, List<RuleInitDTO>> ruleInits,
|
|
|
@DataConsumer("getRuleConditionInit") Map<Integer, Map<String, List<RuleConditionInitDTO>>> ruleConditionInits,
|
|
|
- @DataConsumer("getRuleBaseInit") Map<Integer, RuleBaseInitDTO> ruleBaseInits) {
|
|
|
+ @DataConsumer("getRuleBaseInit") Map<Integer, List<RuleBaseInitDTO>> ruleBaseInits) {
|
|
|
Map<String, RuleDTO> res = new HashMap();
|
|
|
//结果判空第一层规则类型
|
|
|
if (MapUtils.isNotEmpty(ruleInits)) {
|
|
@@ -52,15 +53,17 @@ public class RuleAggregate {
|
|
|
Map<String, List<RuleConditionInitDTO>> map = ruleConditionInits.get(ruleInitDTO.getRuleId());
|
|
|
//结果判空第二层条件组别
|
|
|
if (MapUtils.isNotEmpty(map)) {
|
|
|
- for (String key : map.keySet()) {
|
|
|
+ for (String ruleGroup : map.keySet()) {
|
|
|
RuleConditionDTO ruleConditionDTO = new RuleConditionDTO();
|
|
|
ruleConditionDTO.setHasSubCond(ruleInitDTO.getHasSubCond());
|
|
|
- ruleConditionDTO.setRuleGroup(key);
|
|
|
+ ruleConditionDTO.setRuleGroup(ruleGroup);
|
|
|
//结果判空第三层条件明细
|
|
|
- if (ListUtil.isNotEmpty(map.get(key))) {
|
|
|
- for (RuleConditionInitDTO ruleConditionInitDTO : map.get(key)) {
|
|
|
+ if (ListUtil.isNotEmpty(map.get(ruleGroup))) {
|
|
|
+ for (RuleConditionInitDTO ruleConditionInitDTO : map.get(ruleGroup)) {
|
|
|
ruleConditionDTO.setMsg(ruleConditionInitDTO.getMsg());
|
|
|
+ //todo
|
|
|
RuleBaseDTO ruleBaseDTO = new RuleBaseDTO();
|
|
|
+ List<RuleBaseInitDTO> ruleBaseInitDTOList = ruleBaseInits.get(ruleConditionInitDTO.getRuleBaseId());
|
|
|
BeanUtil.copyProperties(ruleBaseInits.get(ruleConditionInitDTO.getRuleBaseId()), ruleBaseDTO);
|
|
|
ruleConditionDTO.getRuleBaseDTOList().add(ruleBaseDTO);
|
|
|
}
|
|
@@ -85,8 +88,16 @@ public class RuleAggregate {
|
|
|
}
|
|
|
|
|
|
@DataProvider("getRuleInit")
|
|
|
- public Map<String, List<RuleInitDTO>> getRuleInit() {
|
|
|
- List<RuleInitDTO> list = klRuleFacade.getRuleInitDTO();
|
|
|
+ public Map<String, List<RuleInitDTO>> getRuleInit(
|
|
|
+ @DataConsumer("getRuleInitNotHaveClass") List<RuleInitDTO> ruleNotHaveClass,
|
|
|
+ @DataConsumer("getRuleInitHaveClass") List<RuleInitDTO> ruleHaveClass) {
|
|
|
+ List<RuleInitDTO> list = new ArrayList<>();
|
|
|
+ if (ListUtil.isNotEmpty(ruleNotHaveClass)){
|
|
|
+ list.addAll(ruleNotHaveClass);
|
|
|
+ }
|
|
|
+ if (ListUtil.isNotEmpty(ruleHaveClass)){
|
|
|
+ list.addAll(ruleHaveClass);
|
|
|
+ }
|
|
|
return EntityUtil.makeEntityListMap(list, "conceptGroup");
|
|
|
}
|
|
|
|
|
@@ -95,16 +106,45 @@ public class RuleAggregate {
|
|
|
List<RuleConditionInitDTO> list = klRuleFacade.getRuleConditionInitDTO();
|
|
|
Map<Integer, List<RuleConditionInitDTO>> map = EntityUtil.makeEntityListMap(list, "ruleId");
|
|
|
Map<Integer, Map<String, List<RuleConditionInitDTO>>> res = new HashMap<>();
|
|
|
- for (Integer key : map.keySet()) {
|
|
|
- res.put(key, EntityUtil.makeEntityListMap(map.get(key), "ruleGroup"));
|
|
|
+ for (Integer ruleId : map.keySet()) {
|
|
|
+ res.put(ruleId, EntityUtil.makeEntityListMap(map.get(ruleId), "ruleGroup"));
|
|
|
}
|
|
|
return res;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@DataProvider("getRuleBaseInit")
|
|
|
- public Map<Integer, RuleBaseInitDTO> getRuleBaseInit() {
|
|
|
- List<RuleBaseInitDTO> list = klRuleFacade.getRuleBaseInitDTO();
|
|
|
- return EntityUtil.makeEntityMap(list, "ruleBaseId");
|
|
|
+ public Map<Integer, List<RuleBaseInitDTO>> getRuleBaseInit(
|
|
|
+ @DataConsumer("getRuleBaseInitNotHaveClass") List<RuleBaseInitDTO> ruleBaseNotHaveClass,
|
|
|
+ @DataConsumer("getRuleBaseInitHaveClass") List<RuleBaseInitDTO> ruleBaseHaveClass) {
|
|
|
+ List<RuleBaseInitDTO> list = new ArrayList<>();
|
|
|
+ if (ListUtil.isNotEmpty(ruleBaseNotHaveClass)){
|
|
|
+ list.addAll(ruleBaseNotHaveClass);
|
|
|
+ }
|
|
|
+ if (ListUtil.isNotEmpty(ruleBaseHaveClass)){
|
|
|
+ list.addAll(ruleBaseHaveClass);
|
|
|
+ }
|
|
|
+ return EntityUtil.makeEntityListMap(list, "ruleBaseId");
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @DataProvider("getRuleInitNotHaveClass")
|
|
|
+ public List<RuleInitDTO> getRuleInitNotHaveClass() {
|
|
|
+ return klRuleFacade.getRuleInitDTONotHaveClass();
|
|
|
}
|
|
|
+
|
|
|
+ @DataProvider("getRuleInitHaveClass")
|
|
|
+ public List<RuleInitDTO> getRuleInitHaveClass() {
|
|
|
+ return klRuleFacade.getRuleInitDTOHaveClass();
|
|
|
+ }
|
|
|
+
|
|
|
+ @DataProvider("getRuleBaseInitNotHaveClass")
|
|
|
+ public List<RuleBaseInitDTO> getRuleBaseInitNotHaveClass() {
|
|
|
+ return klRuleFacade.getRuleBaseInitDTONotHaveClass();
|
|
|
+ }
|
|
|
+
|
|
|
+ @DataProvider("getRuleBaseInitHaveClass")
|
|
|
+ public List<RuleBaseInitDTO> getRuleBaseInitHaveClass() {
|
|
|
+ return klRuleFacade.getRuleBaseInitDTOHaveClass();
|
|
|
+ }
|
|
|
+
|
|
|
}
|