|
@@ -36,46 +36,31 @@ public class KlRuleFacade extends KlRuleServiceImpl {
|
|
|
|
|
|
public KlRuleByIdParDTO getByIdRuleInfos(KlRuleByIdVO klRuleByIdVO) {
|
|
|
RespDTO<KlRuleByIdParDTO> byIdRuleInfoAll = cdssCoreClient.getByIdRuleInfoAll(klRuleByIdVO);
|
|
|
- if (byIdRuleInfoAll == null || !CommonErrorCode.OK.getCode().equals(byIdRuleInfoAll.code)) {
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
- "获取规则详情数据失败");
|
|
|
- }
|
|
|
+ RespDTOUtil.respNGDeal(byIdRuleInfoAll, "获取规则详情数据失败");
|
|
|
return byIdRuleInfoAll.data;
|
|
|
}
|
|
|
|
|
|
public Boolean saveRuleInfos(KlRuleInfoSaveVO klRuleInfoSaveVO) {
|
|
|
RespDTO<Boolean> booleanRespDTO = cdssCoreClient.saveRuleInfoAll(klRuleInfoSaveVO);
|
|
|
- if (booleanRespDTO == null || !CommonErrorCode.OK.getCode().equals(booleanRespDTO.code)) {
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
- "保存规则详情数据失败");
|
|
|
- }
|
|
|
+ RespDTOUtil.respNGDeal(booleanRespDTO, "保存规则详情数据失败");
|
|
|
return booleanRespDTO.data;
|
|
|
}
|
|
|
|
|
|
public Boolean clearRuleInfos(KlRuleInfoClearVO klRuleInfoClearVO) {
|
|
|
RespDTO<Boolean> booleanRespDTO = cdssCoreClient.clearRuleInfoAll(klRuleInfoClearVO);
|
|
|
- if (booleanRespDTO == null || !CommonErrorCode.OK.getCode().equals(booleanRespDTO.code)) {
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
- "刪除规则详情数据失败");
|
|
|
- }
|
|
|
+ RespDTOUtil.respNGDeal(booleanRespDTO, "刪除规则详情数据失败");
|
|
|
return booleanRespDTO.data;
|
|
|
}
|
|
|
|
|
|
public Boolean startOrDisableRule(KlRuleSatartOrdisaVO klRuleSatartOrdisaVO) {
|
|
|
RespDTO<Boolean> booleanRespDTO = cdssCoreClient.disableRuleInfos(klRuleSatartOrdisaVO);
|
|
|
- if (booleanRespDTO == null || !CommonErrorCode.OK.getCode().equals(booleanRespDTO.code)) {
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
- "停用规则失败");
|
|
|
- }
|
|
|
+ RespDTOUtil.respNGDeal(booleanRespDTO, "停用规则失败");
|
|
|
return booleanRespDTO.data;
|
|
|
}
|
|
|
|
|
|
public Boolean startRuleInfos(KlRuleSatartOrdisaVO klRuleSatartOrdisaVO) {
|
|
|
RespDTO<Boolean> booleanRespDTO = cdssCoreClient.startRuleInfos(klRuleSatartOrdisaVO);
|
|
|
- if (booleanRespDTO == null || !CommonErrorCode.OK.getCode().equals(booleanRespDTO.code)) {
|
|
|
- throw new CommonException(CommonErrorCode.SERVER_IS_ERROR,
|
|
|
- "启用规则失败");
|
|
|
- }
|
|
|
+ RespDTOUtil.respNGDeal(booleanRespDTO, "启用规则失败");
|
|
|
return booleanRespDTO.data;
|
|
|
}
|
|
|
}
|