|
@@ -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);
|
|
|
}
|
|
|
|