lyhzzz 1 nedēļu atpakaļ
vecāks
revīzija
cd372137c4

+ 2 - 2
src/main/java/com/fdkankan/fusion/config/FusionConfig.java

@@ -13,12 +13,12 @@ public class FusionConfig {
     @Value("${fusion.ai-url:http://192.168.9.61:30000/v1/}")
     private String aiUrl;
 
-    @Value("${fusion.push-jm.url: }")
+    @Value("${fusion.push-jm.url}")
     private String pushJmUrl;
 
     /**
      * 推送绘图平面图地址  http://1.119.159.10:58080/ecs/api/panoramicImageService/submitDrawing
      */
-    @Value("${fusion.push-draw.url: }")
+    @Value("${fusion.push-draw.url}")
     private String pushDrawUrl;
 }

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

@@ -64,9 +64,11 @@ public class CaseOverviewController {
     @PushJm(event_content = "添加绘图")
     public ResultData addOrUpdate (@RequestBody CaseOverview 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);
     }
 

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

@@ -4,14 +4,23 @@ package com.fdkankan.fusion.controller;
 import com.fdkankan.fusion.aop.PushJm;
 import com.fdkankan.fusion.common.ResultCode;
 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.CaseFiles;
 import com.fdkankan.fusion.entity.CaseOverview;
 import com.fdkankan.fusion.entity.CaseTabulation;
 import com.fdkankan.fusion.exception.BusinessException;
+import com.fdkankan.fusion.httpClient.client.OtherClient;
+import com.fdkankan.fusion.service.ICaseService;
 import com.fdkankan.fusion.service.ICaseTabulationService;
+import lombok.extern.slf4j.Slf4j;
+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,12 +31,18 @@ import org.springframework.web.bind.annotation.*;
  */
 @RestController
 @RequestMapping("/caseTabulation")
+@Slf4j
 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){
@@ -54,6 +69,25 @@ public class CaseTabulationController {
     @PushJm(event_content = "添加制表")
     public ResultData addOrUpdate (@RequestBody CaseTabulation caseTabulation){
         caseTabulationService.addOrUpdate(caseTabulation);
+        try {
+            if( StringUtils.isNotBlank(caseTabulation.getListCover()) && caseTabulation.getOverviewId() != null){
+                CaseEntity caseEntity = caseService.getById(caseTabulation.getCaseId());
+                if(caseEntity!=null && StringUtils.isNotBlank(fusionConfig.getPushJmUrl())){
+                    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);
+                }
+            }
+        }catch (Exception e){
+            log.info("调用haixin失败:{}",e);
+        }
+
         return ResultData.ok(caseTabulation);
     }
 

+ 3 - 0
src/main/java/com/fdkankan/fusion/entity/CaseEntity.java

@@ -130,6 +130,9 @@ public class CaseEntity implements Serializable {
     @TableField(exist = false)
     public MapConfig mapConfig;
 
+    @TableField("k_number")
+    private String kNumber;
+
     @TableField("sys_user_id")
     private Long sysUserId;