ソースを参照

开单合理项维护

zhaops 4 年 前
コミット
724b08caeb

+ 2 - 2
src/main/java/com/diagbot/facade/BillManFacade.java

@@ -301,12 +301,12 @@ public class BillManFacade {
         //新增已存在
         if (billSaveVO.getRelationId() == null
                 && existRelation != null) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "规则已存在,不允许重复添加");
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "规则已存在");
         }
         //修改成已存在规则
         if (billSaveVO.getRelationId() != null
                 && !billSaveVO.getRelationId().equals(existRelation.getRelationId())) {
-            throw new CommonException(CommonErrorCode.IS_EXISTS, "规则已存在,不允许修改");
+            throw new CommonException(CommonErrorCode.IS_EXISTS, "规则已存在");
         }
 
         //数值类型特殊处理

+ 3 - 2
src/main/java/com/diagbot/web/BillManController.java

@@ -20,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestBody;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import javax.validation.Valid;
 import java.util.List;
 
 /**
@@ -71,7 +72,7 @@ public class BillManController {
     @ApiOperation(value = "查询单条规则[zhaops]",
             notes = "relationId:关系id<br>")
     @PostMapping("/getRecordByRelationId")
-    public RespDTO<BillSaveVO> getRecordByRelationId(@RequestBody RelationIdVO relationIdVO) {
+    public RespDTO<BillSaveVO> getRecordByRelationId(@RequestBody @Valid RelationIdVO relationIdVO) {
         BillSaveVO data = billManFacade.getRecordByRelationId(relationIdVO);
         return RespDTO.onSuc(data);
     }
@@ -88,7 +89,7 @@ public class BillManController {
             notes = "relationId:关系id<br>" +
                     "status:状态(0-禁用、1-启用)")
     @PostMapping("/updateStatus")
-    public RespDTO<Boolean> updateStatus(@RequestBody RelationStatusVO relationStatusVO) {
+    public RespDTO<Boolean> updateStatus(@RequestBody @Valid RelationStatusVO relationStatusVO) {
         Boolean data = billManFacade.updateStatus(relationStatusVO);
         return RespDTO.onSuc(data);
     }