lyhzzz 1 개월 전
부모
커밋
3e3d1a3713
1개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 5 3
      src/main/java/com/fdkankan/fusion/controller/CaseOverviewController.java

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

@@ -55,9 +55,11 @@ public class CaseOverviewController {
     @PostMapping("/addOrUpdate")
     @PostMapping("/addOrUpdate")
     public ResultData addOrUpdate (@RequestBody CaseOverview caseOverview){
     public ResultData addOrUpdate (@RequestBody CaseOverview caseOverview){
         caseOverviewService.saveOrUpdate(caseOverview);
         caseOverviewService.saveOrUpdate(caseOverview);
-        caseOverview.getCaseTabulation().setOverviewId(caseOverview.getId());
-        caseOverview.getCaseTabulation().setCaseId(caseOverview.getCaseId());
-        caseTabulationService.addOrUpdate(caseOverview.getCaseTabulation());
+        if(caseOverview.getCaseTabulation() != null){
+            caseOverview.getCaseTabulation().setOverviewId(caseOverview.getId());
+            caseOverview.getCaseTabulation().setCaseId(caseOverview.getCaseId());
+            caseTabulationService.addOrUpdate(caseOverview.getCaseTabulation());
+        }
         return ResultData.ok(caseOverview);
         return ResultData.ok(caseOverview);
     }
     }