Commit 7408439b authored by zhangsen's avatar zhangsen

获取工作流流程图API

parent 5aa27964
......@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.workflow.feign.WorkflowFeignService;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FailureDetailsServiceImpl;
import com.yeejoin.amos.boot.module.ugp.api.dto.ProblemCodeLibDto;
import com.yeejoin.amos.boot.module.ugp.api.entity.ProblemCodeLib;
import com.yeejoin.amos.boot.module.ugp.api.service.IProblemCodeLibService;
......@@ -16,18 +18,26 @@ import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.privilege.model.ApplicationModel;
import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.DictionarieValueModel;
import feign.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.exception.BaseException;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.*;
import java.util.stream.Collectors;
......@@ -48,6 +58,13 @@ public class ProblemCodeLibController extends BaseController {
@Resource
private IProblemCodeLibService problemCodeLibService;
@Autowired
FailureDetailsServiceImpl failureDetailsServiceImpl;
@Autowired
WorkflowFeignService workflowFeignService;
/**
* 新增质量监检信息表
*/
......@@ -172,4 +189,23 @@ public class ProblemCodeLibController extends BaseController {
List<DictionarieValueModel> result = adminCommonlyUsed.getResult();
return ResponseHelper.buildResponse(result);
}
/**
* 参考JCS服务流程图信息
* @param instanceId 流程实例ID
* @return 流程图
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/getInstanceImage")
@ApiOperation(httpMethod = "GET", value = "流程图高亮图片", notes = "流程图高亮图片")
public ResponseEntity<String> downloadFile(@RequestParam String instanceId, HttpServletRequest request, HttpServletResponse response) {
Response feignResponse = workflowFeignService.thighLineImg(instanceId);
try {
Response.Body body = feignResponse.body();
return new ResponseEntity<>(IOUtils.toString(body.asInputStream()), HttpStatus.OK);
} catch (Exception e) {
throw new BaseException("Error exporting diagram", "500", instanceId);
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment