Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
W
workflow
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
2
议题
2
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
黄夏豪
workflow
Commits
e9aba5d6
提交
e9aba5d6
authored
3月 26, 2021
作者:
zhoushaopan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[工作流模块] InvokeRequestVo 缺少了一个字段补充上去
上级
69fd07c1
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
10 行增加
和
55 行删除
+10
-55
ApiException.java
.../java/com/tykj/workflowcore/base/result/ApiException.java
+3
-3
GlobalExceptionHandler.java
...tykj/workflowcore/base/result/GlobalExceptionHandler.java
+1
-50
InvokeRequestVo.java
...rkflowcore/workflow_editer/entity/vo/InvokeRequestVo.java
+5
-1
ProcessEndListener.java
...flowcore/workflow_editer/listener/ProcessEndListener.java
+1
-1
没有找到文件。
src/main/java/com/tykj/workflowcore/base/result/ApiException.java
浏览文件 @
e9aba5d6
...
...
@@ -16,11 +16,11 @@ public class ApiException extends RuntimeException {
}
public
ApiException
(
String
message
)
{
this
.
responseEntity
=
ResponseEntity
.
status
(
4
00
).
body
(
new
ResultObj
(
message
));
this
.
responseEntity
=
ResponseEntity
.
status
(
5
00
).
body
(
new
ResultObj
(
message
));
}
public
ApiException
(
String
message
,
Object
data
)
{
this
.
responseEntity
=
ResponseEntity
.
status
(
4
00
).
body
(
new
ResultObj
(
data
,
message
));
public
ApiException
(
Object
data
,
String
message
)
{
this
.
responseEntity
=
ResponseEntity
.
status
(
5
00
).
body
(
new
ResultObj
(
data
,
message
));
}
...
...
src/main/java/com/tykj/workflowcore/base/result/GlobalExceptionHandler.java
浏览文件 @
e9aba5d6
...
...
@@ -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
);
}
}
...
...
src/main/java/com/tykj/workflowcore/workflow_editer/entity/vo/InvokeRequestVo.java
浏览文件 @
e9aba5d6
...
...
@@ -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
>
param
eterList
;
private
List
<
Parameter
>
param
s
;
}
src/main/java/com/tykj/workflowcore/workflow_editer/listener/ProcessEndListener.java
浏览文件 @
e9aba5d6
...
...
@@ -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
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论