|
@@ -85,20 +85,20 @@ public class KlRuleFacade extends KlRuleServiceImpl {
|
|
int count = this.count(new QueryWrapper<KlRule>()
|
|
int count = this.count(new QueryWrapper<KlRule>()
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
.eq("description", klRuleInfoSaveVO.getParDescription())
|
|
.eq("description", klRuleInfoSaveVO.getParDescription())
|
|
- .ne("id", klRuleInfoSaveVO.getId() == null ? -1 : klRuleInfoSaveVO.getId()));
|
|
|
|
|
|
+ .ne("id", klRuleInfoSaveVO.getParId() == null ? -1 : klRuleInfoSaveVO.getParId()));
|
|
if (count > 0) {
|
|
if (count > 0) {
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该规则名称已存在");
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该规则名称已存在");
|
|
}
|
|
}
|
|
//校验数据是否还在
|
|
//校验数据是否还在
|
|
- if (null != klRuleInfoSaveVO.getId()) {
|
|
|
|
|
|
+ if (null != klRuleInfoSaveVO.getParId()) {
|
|
int sum = this.count(new QueryWrapper<KlRule>().eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
int sum = this.count(new QueryWrapper<KlRule>().eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
- .eq("id", klRuleInfoSaveVO.getId()));
|
|
|
|
|
|
+ .eq("id", klRuleInfoSaveVO.getParId()));
|
|
if (sum == 0) {
|
|
if (sum == 0) {
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该数据已不存在!");
|
|
throw new CommonException(CommonErrorCode.SERVER_IS_ERROR, "该数据已不存在!");
|
|
}
|
|
}
|
|
UpdateWrapper<KlRule> klRuleUpdate = new UpdateWrapper<>();
|
|
UpdateWrapper<KlRule> klRuleUpdate = new UpdateWrapper<>();
|
|
klRuleUpdate.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
klRuleUpdate.eq("is_deleted", IsDeleteEnum.N.getKey())
|
|
- .eq("id", klRuleInfoSaveVO.getId())
|
|
|
|
|
|
+ .eq("id", klRuleInfoSaveVO.getParId())
|
|
.set(StringUtil.isNotBlank(klRuleInfoSaveVO.getParDescription()), "description", klRuleInfoSaveVO.getParDescription())
|
|
.set(StringUtil.isNotBlank(klRuleInfoSaveVO.getParDescription()), "description", klRuleInfoSaveVO.getParDescription())
|
|
.set(StringUtil.isNotBlank(klRuleInfoSaveVO.getParConceptId().toString()), "concept_id", klRuleInfoSaveVO.getParConceptId())
|
|
.set(StringUtil.isNotBlank(klRuleInfoSaveVO.getParConceptId().toString()), "concept_id", klRuleInfoSaveVO.getParConceptId())
|
|
.set(StringUtil.isNotBlank(klRuleInfoSaveVO.getParRuleType().toString()), "rule_type", klRuleInfoSaveVO.getParRuleType())
|
|
.set(StringUtil.isNotBlank(klRuleInfoSaveVO.getParRuleType().toString()), "rule_type", klRuleInfoSaveVO.getParRuleType())
|
|
@@ -109,7 +109,7 @@ public class KlRuleFacade extends KlRuleServiceImpl {
|
|
res = this.update(klRuleUpdate);
|
|
res = this.update(klRuleUpdate);
|
|
|
|
|
|
//先删除原有的详情;
|
|
//先删除原有的详情;
|
|
- res = clearSub(klRuleInfoSaveVO.getId());
|
|
|
|
|
|
+ res = clearSub(klRuleInfoSaveVO.getParId());
|
|
if (ListUtil.isNotEmpty(klRuleInfoSaveVO.getKlRuleInfoSaveSub())) {
|
|
if (ListUtil.isNotEmpty(klRuleInfoSaveVO.getKlRuleInfoSaveSub())) {
|
|
//再重新传入的详情保存
|
|
//再重新传入的详情保存
|
|
res = saveCommon(klRuleInfoSaveVO);
|
|
res = saveCommon(klRuleInfoSaveVO);
|
|
@@ -128,7 +128,7 @@ public class KlRuleFacade extends KlRuleServiceImpl {
|
|
res = this.save(klRule);
|
|
res = this.save(klRule);
|
|
if (res) {
|
|
if (res) {
|
|
//再保存附表
|
|
//再保存附表
|
|
- klRuleInfoSaveVO.setId(klRule.getId());
|
|
|
|
|
|
+ klRuleInfoSaveVO.setParId(klRule.getId());
|
|
res = saveCommon(klRuleInfoSaveVO);
|
|
res = saveCommon(klRuleInfoSaveVO);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -208,7 +208,7 @@ public class KlRuleFacade extends KlRuleServiceImpl {
|
|
klRuleCondition.setGmtCreate(now);
|
|
klRuleCondition.setGmtCreate(now);
|
|
klRuleCondition.setGroupType(data2.getGroupType());
|
|
klRuleCondition.setGroupType(data2.getGroupType());
|
|
klRuleCondition.setRuleBaseId(data1.getId());
|
|
klRuleCondition.setRuleBaseId(data1.getId());
|
|
- klRuleCondition.setRuleId(klRuleInfoSaveVO.getId());
|
|
|
|
|
|
+ klRuleCondition.setRuleId(klRuleInfoSaveVO.getParId());
|
|
klRuleConditionList.add(klRuleCondition);
|
|
klRuleConditionList.add(klRuleCondition);
|
|
}
|
|
}
|
|
}
|
|
}
|