提交 e9aba5d6 authored 作者: zhoushaopan's avatar zhoushaopan

[工作流模块] InvokeRequestVo 缺少了一个字段补充上去

上级 69fd07c1
......@@ -16,11 +16,11 @@ public class ApiException extends RuntimeException {
}
public ApiException(String message) {
this.responseEntity = ResponseEntity.status(400).body(new ResultObj(message));
this.responseEntity = ResponseEntity.status(500).body(new ResultObj(message));
}
public ApiException(String message, Object data) {
this.responseEntity = ResponseEntity.status(400).body(new ResultObj(data, message));
public ApiException( Object data,String message) {
this.responseEntity = ResponseEntity.status(500).body(new ResultObj(data, message));
}
......
......@@ -23,36 +23,6 @@ import org.springframework.web.bind.annotation.ResponseStatus;
@Slf4j
public class GlobalExceptionHandler {
/**
* 报错信息都会通过这个方法处理并通过统一的返回方式进行返回
*
* @param e 报错信息
*/
@ResponseBody
@ExceptionHandler(Exception.class)
public ResponseEntity errorMessage(Exception e) {
log.error("[其他异常] {}", e.toString());
e.printStackTrace();
return ResultUtil.failed(e.getMessage());
}
/**
* 参数校验错误
* @param e 报错信息
*/
@ResponseBody
@ExceptionHandler(MethodArgumentNotValidException.class)
@ResponseStatus(HttpStatus.BAD_REQUEST)
public ResponseEntity errorMessage(MethodArgumentNotValidException e) {
BindingResult bindingResult = e.getBindingResult();
String errorMesssage = "参数校验失败:";
for (FieldError fieldError : bindingResult.getFieldErrors()) {
errorMesssage += fieldError.getDefaultMessage() + ", ";
}
log.error("[参数校验异常] {}", errorMesssage);
e.printStackTrace();
return ResultUtil.failed(errorMesssage);
}
/**
* 业务错误
......@@ -69,26 +39,7 @@ public class GlobalExceptionHandler {
return ResultUtil.failed(e.getMessage());
}
/**
* 数据合法性验证报错会通过这个方法处理并通过统一的返回方式进行返回
*
* @param e 报错信息
*/
@ResponseBody
@ExceptionHandler(BindException.class)
public ResponseEntity errorMessage(BindException e) {
log.error("[参数异常] 检测到用户访问接口没有提供正确的参数 {}", e.toString());
e.printStackTrace();
BindingResult bindingResult = e.getBindingResult();
String message = null;
if (bindingResult.hasErrors()) {
FieldError fieldError = bindingResult.getFieldError();
if (fieldError != null) {
message = fieldError.getField() + fieldError.getDefaultMessage();
}
}
return ResultUtil.failed(message);
}
}
......
......@@ -7,6 +7,7 @@ import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.flowable.engine.runtime.ProcessInstance;
import java.util.List;
......@@ -24,6 +25,9 @@ import java.util.List;
@Api(tags = "调用服务接口vo")
public class InvokeRequestVo {
@ApiModelProperty("流程实例")
private ProcessInstance processInstance;
@ApiModelProperty("流程实例id")
private String processInstanceId;
......@@ -34,5 +38,5 @@ public class InvokeRequestVo {
private String name;
@ApiModelProperty("参数列表")
private List<Parameter> parameterList;
private List<Parameter> params;
}
......@@ -9,7 +9,6 @@ import com.tykj.workflowcore.workflow_editer.entity.VariableStorage;
import com.tykj.workflowcore.workflow_editer.entity.vo.InvokeRequestVo;
import com.tykj.workflowcore.workflow_editer.entity.vo.SearchVariableStorageVo;
import com.tykj.workflowcore.workflow_editer.service.VariableStorageService;
import liquibase.pro.packaged.A;
import org.flowable.common.engine.api.delegate.Expression;
import org.flowable.common.engine.api.delegate.event.FlowableEngineEntityEvent;
import org.flowable.common.engine.api.delegate.event.FlowableEvent;
......@@ -64,6 +63,7 @@ public class ProcessEndListener extends AbstractFlowableEngineEventListener {
InvokeRequestVo variableInfo = variableStorage.getInvokeRequest();
variableInfo.setProcessInstance(processInstance);
//调用服务接口
//1. 获取调用的具体数值
apiController.invoke(getApiInvokeParam(variableInfo));
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论