|
@@ -182,6 +182,7 @@ public class KlRuleFacade extends KlRuleServiceImpl {
|
|
|
//先保存数据到kl_rule_base表里
|
|
|
List<KlRuleBase> klRuleBaseList = new ArrayList<>();
|
|
|
for (KlRuleInfoSaveSubVO list : klRuleInfoSaveSub) {
|
|
|
+ KlRuleCondition klRuleCondition = new KlRuleCondition();
|
|
|
KlRuleBase klRuleBase = new KlRuleBase();
|
|
|
klRuleBase.setGmtModified(now);
|
|
|
klRuleBase.setConceptId(list.getSubConceptId());
|
|
@@ -197,23 +198,17 @@ public class KlRuleFacade extends KlRuleServiceImpl {
|
|
|
klRuleBase.setEqValue(list.getSubEqValue());
|
|
|
klRuleBase.setEqOperator(list.getSubEqOperator());
|
|
|
klRuleBase.setEqUnit(list.getSubEqUnit());
|
|
|
- klRuleBaseList.add(klRuleBase);
|
|
|
- }
|
|
|
- res = klRuleBaseFacade.saveBatchAll(klRuleBaseList);
|
|
|
- List<KlRuleCondition> klRuleConditionList = new ArrayList<>();
|
|
|
- for (KlRuleBase data1 : klRuleBaseList) {
|
|
|
- for (KlRuleInfoSaveSubVO data2 : klRuleInfoSaveSub) {
|
|
|
- KlRuleCondition klRuleCondition = new KlRuleCondition();
|
|
|
- if (data1.getDescription().equals(data2.getSubDescription())) {
|
|
|
- klRuleCondition.setGmtCreate(now);
|
|
|
- klRuleCondition.setGroupType(data2.getGroupType());
|
|
|
- klRuleCondition.setRuleBaseId(data1.getId());
|
|
|
- klRuleCondition.setRuleId(klRuleInfoSaveVO.getParId());
|
|
|
- klRuleConditionList.add(klRuleCondition);
|
|
|
- }
|
|
|
+ res = klRuleBaseFacade.save(klRuleBase);
|
|
|
+ //再把数据保存在kl_rule_condition
|
|
|
+ if (res) {
|
|
|
+ klRuleCondition.setGmtCreate(now);
|
|
|
+ klRuleCondition.setGroupType(list.getGroupType());
|
|
|
+ klRuleCondition.setRuleBaseId(klRuleBase.getId());
|
|
|
+ klRuleCondition.setRuleId(klRuleInfoSaveVO.getParId());
|
|
|
+ res = klRuleConditionFacade.save(klRuleCondition);
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
- res = klRuleConditionFacade.saveBatchAll(klRuleConditionList);
|
|
|
}
|
|
|
|
|
|
return res;
|