lyhzzz 4 هفته پیش
والد
کامیت
a5573ee6fe

+ 5 - 2
src/main/java/com/fdkankan/fusion/controller/CaseOverviewController.java

@@ -38,8 +38,11 @@ public class CaseOverviewController {
 
     @GetMapping("/info")
     public ResultData info (@RequestParam (required = false) String overviewId){
-
-        return ResultData.ok(caseOverviewService.getById(overviewId));
+        CaseOverview caseOverview = caseOverviewService.getById(overviewId);
+        if(caseOverview == null){
+            throw new BusinessException(ResultCode.RECORD_NOT_EXITS);
+        }
+        return ResultData.ok(caseOverview);
     }
 
     @PostMapping("/addOrUpdate")

+ 7 - 2
src/main/java/com/fdkankan/fusion/controller/CaseTabulationController.java

@@ -1,8 +1,10 @@
 package com.fdkankan.fusion.controller;
 
 
+import com.fdkankan.fusion.common.ResultCode;
 import com.fdkankan.fusion.common.ResultData;
 import com.fdkankan.fusion.entity.CaseTabulation;
+import com.fdkankan.fusion.exception.BusinessException;
 import com.fdkankan.fusion.service.ICaseTabulationService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -34,8 +36,11 @@ public class CaseTabulationController {
 
     @GetMapping("/info")
     public ResultData info (@RequestParam (required = false) String tabulationId){
-
-        return ResultData.ok(caseTabulationService.getById(tabulationId));
+        CaseTabulation caseTabulation = caseTabulationService.getById(tabulationId);
+        if(caseTabulation == null){
+            throw new BusinessException(ResultCode.RECORD_NOT_EXITS);
+        }
+        return ResultData.ok(caseTabulation);
     }
 
     @GetMapping("/getByOverviewId")