|
@@ -2,11 +2,21 @@ package com.fdkankan.fusion.controller;
|
|
|
|
|
|
|
|
|
import com.fdkankan.fusion.common.ResultData;
|
|
|
+import com.fdkankan.fusion.common.util.FileMd5Util;
|
|
|
+import com.fdkankan.fusion.common.util.MD5Checksum;
|
|
|
+import com.fdkankan.fusion.config.FusionConfig;
|
|
|
+import com.fdkankan.fusion.entity.CaseEntity;
|
|
|
import com.fdkankan.fusion.entity.CaseOverview;
|
|
|
+import com.fdkankan.fusion.httpClient.client.OtherClient;
|
|
|
import com.fdkankan.fusion.service.ICaseOverviewService;
|
|
|
+import com.fdkankan.fusion.service.ICaseService;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
+import java.io.File;
|
|
|
+import java.util.HashMap;
|
|
|
+
|
|
|
/**
|
|
|
* <p>
|
|
|
* 前端控制器
|
|
@@ -21,6 +31,12 @@ public class CaseOverviewController {
|
|
|
|
|
|
@Autowired
|
|
|
ICaseOverviewService caseOverviewService;
|
|
|
+ @Autowired
|
|
|
+ FusionConfig fusionConfig;
|
|
|
+ @Autowired
|
|
|
+ ICaseService caseService;
|
|
|
+ @Autowired
|
|
|
+ OtherClient otherClient;
|
|
|
|
|
|
|
|
|
@GetMapping("/getByCaseId")
|
|
@@ -38,6 +54,17 @@ 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());
|
|
|
+ otherClient.postJson(fusionConfig.getPushDrawUrl(),map);
|
|
|
+ }
|
|
|
+ }
|
|
|
return ResultData.ok(caseOverview);
|
|
|
}
|
|
|
|