lyhzzz 2 miesięcy temu
rodzic
commit
5925386d27

+ 1 - 14
src/main/java/com/fdkankan/fusion/controller/CaseOverviewController.java

@@ -35,8 +35,7 @@ public class CaseOverviewController {
     FusionConfig fusionConfig;
     @Autowired
     ICaseService caseService;
-    @Autowired
-    OtherClient otherClient;
+
 
 
     @GetMapping("/getByCaseId")
@@ -54,18 +53,6 @@ public class CaseOverviewController {
     @PostMapping("/addOrUpdate")
     public ResultData addOrUpdate (@RequestBody CaseOverview caseOverview){
         caseOverviewService.saveOrUpdate(caseOverview);
-        if(StringUtils.isNotBlank(caseOverview.getListCover()) && StringUtils.isNotBlank(fusionConfig.getPushDrawUrl())){
-            CaseEntity caseEntity = caseService.getById(caseOverview.getCaseId());
-            if(caseEntity != null){
-                HashMap<String, Object> map = new HashMap<>();
-                map.put("id",caseOverview.getId());
-                map.put("kno",caseEntity.getKNumber());
-                map.put("md5", MD5Checksum.getMD5(caseOverview.getListCover().replace("/oss/", "/oss/4dkankan/")));
-                map.put("fileUrl",caseOverview.getListCover());
-                map.put("vendor","A0BF");// 供应商类型
-                otherClient.postJson(fusionConfig.getPushDrawUrl(),map);
-            }
-        }
         return ResultData.ok(caseOverview);
     }
 

+ 29 - 1
src/main/java/com/fdkankan/fusion/controller/CaseTabulationController.java

@@ -2,11 +2,19 @@ package com.fdkankan.fusion.controller;
 
 
 import com.fdkankan.fusion.common.ResultData;
+import com.fdkankan.fusion.common.util.MD5Checksum;
+import com.fdkankan.fusion.config.FusionConfig;
+import com.fdkankan.fusion.entity.CaseEntity;
 import com.fdkankan.fusion.entity.CaseTabulation;
+import com.fdkankan.fusion.httpClient.client.OtherClient;
+import com.fdkankan.fusion.service.ICaseService;
 import com.fdkankan.fusion.service.ICaseTabulationService;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import java.util.HashMap;
+
 /**
  * <p>
  *  前端控制器
@@ -22,7 +30,12 @@ public class CaseTabulationController {
 
     @Autowired
     ICaseTabulationService caseTabulationService;
-
+    @Autowired
+    OtherClient otherClient;
+    @Autowired
+    ICaseService caseService;
+    @Autowired
+    FusionConfig fusionConfig;
 
     @GetMapping("/getByCaseId")
     public ResultData getByCaseId (@RequestParam(required = false) String caseId){
@@ -45,6 +58,21 @@ public class CaseTabulationController {
     @PostMapping("/addOrUpdate")
     public ResultData addOrUpdate (@RequestBody CaseTabulation caseTabulation){
         caseTabulationService.addOrUpdate(caseTabulation);
+        if( StringUtils.isNotBlank(caseTabulation.getListCover()) && caseTabulation.getOverviewId() != null){
+            CaseEntity caseEntity = caseService.getById(caseTabulation.getCaseId());
+            if(caseEntity!=null){
+                HashMap<String, Object> map = new HashMap<>();
+                map.put("caseId",caseTabulation.getCaseId());
+                map.put("overviewId",caseTabulation.getOverviewId());
+                map.put("tabulationId",caseTabulation.getId());
+                map.put("kno",caseEntity.getKNumber());
+                map.put("md5", MD5Checksum.getMD5(caseTabulation.getListCover().replace("/oss/", "/oss/4dkankan/")));
+                map.put("fileUrl",caseTabulation.getListCover());
+                map.put("vendor","A0BF");// 供应商类型
+                otherClient.postJson(fusionConfig.getPushDrawUrl(),map);
+            }
+        }
+
         return ResultData.ok(caseTabulation);
     }