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