Browse Source

修改代码

wangfeng 4 years ago
parent
commit
3a23466e16

+ 5 - 20
cdssman-service/src/main/java/com/diagbot/facade/KlRuleFacade.java

@@ -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;
     }
 }

+ 10 - 2
cdssman-service/src/main/java/com/diagbot/vo/KlRuleInfoSaveVO.java

@@ -1,8 +1,11 @@
 package com.diagbot.vo;
 
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Setter;
 
+import javax.validation.constraints.NotBlank;
+import javax.validation.constraints.NotNull;
 import java.util.List;
 
 /**
@@ -13,13 +16,18 @@ import java.util.List;
 @Setter
 @Getter
 public class KlRuleInfoSaveVO {
-    private Long id;
+    private Long parId;
+    @NotBlank(message = "请输入规则名称")
     private String parDescription;//规则名称
+    @NotNull(message = "请输入规则类型")
     private Integer parRuleType;//规则类型(1:开单合理性;2:高危;3:危急值;4:其他值提醒;5:其他值提醒输血;6:正常项目重复开立)
+    @NotNull(message = "请输入概念id")
     private Long parConceptId;//提示概念id
+    @NotNull(message = "请输入概念id")
     private Integer parHasSub;//是否有子条件(0:无,1:有)
     private String parMsg;//附加信息
-    private Integer parStatus;//启用状态(0:禁用,1:启用)
+    @ApiModelProperty(hidden = true)
+    private Integer parStatus = 1;//启用状态(0:禁用,1:启用)
     /*    private String parlibName;
         private String parLenName;
         private String parLenCode;*/