Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
I
ibzwf
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
ibiz4jteam
ibzwf
提交
bb6519a2
提交
bb6519a2
编写于
11月 16, 2022
作者:
ibizdev
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
zhouweidong 发布系统代码 [ibz-wf,统一工作流]
上级
c21fe4dd
变更
5
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
648 行增加
和
13 行删除
+648
-13
wfprocess-instances.ts
...rc/mock/entity/wfprocess-instances/wfprocess-instances.ts
+292
-11
wfprocess-instance-active-instance-option-view-base.vue
...w/wfprocess-instance-active-instance-option-view-base.vue
+1
-1
wfprocess-instance-service-base.ts
...ice/wfprocess-instance/wfprocess-instance-service-base.ts
+179
-0
wfprocess-instance-ui-service-base.ts
.../wfprocess-instance/wfprocess-instance-ui-service-base.ts
+20
-1
WFProcessInstanceResource.java
...n/java/cn/ibizlab/api/rest/WFProcessInstanceResource.java
+156
-0
未找到文件。
app_web/src/mock/entity/wfprocess-instances/wfprocess-instances.ts
浏览文件 @
bb6519a2
...
...
@@ -86,16 +86,241 @@ mock.onDelete(new RegExp(/^\/wfprocessinstances\/batch$/)).reply((config: any) =
return
[
status
,
{}];
});
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// URI参数传递情况未实现
// CheckKey
mock
.
onPost
(
new
RegExp
(
/^
\/
wfprocessinstances
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
checkkey$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:wfprocessinstance 方法: CheckKey"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
wfprocessinstances
\/([
a-zA-Z0-9
\-\;]{1,35})\/
checkkey$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'id'
]
==
tempValue
[
'id'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// Create
mock
.
onPost
(
new
RegExp
(
/^
\/
wfprocessinstances
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:wfprocessinstance 方法: Create"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
wfprocessinstances
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
mockDatas
[
0
]);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
mockDatas
[
0
]];
});
// GetDraft
mock
.
onGet
(
new
RegExp
(
/^
\/
wfprocessinstances
\/
getdraft$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:wfprocessinstance 方法: GetDraft"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
// GetDraft
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
({});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
{}];
});
// Jump
mock
.
onPost
(
new
RegExp
(
/^
\/
wfprocessinstances
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
jump$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:wfprocessinstance 方法: Jump"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
wfprocessinstances
\/([
a-zA-Z0-9
\-\;]{1,35})\/
jump$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'id'
]
==
tempValue
[
'id'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// Restart
mock
.
onPost
(
new
RegExp
(
/^
\/
wfprocessinstances
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
restart$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:wfprocessinstance 方法: Restart"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
wfprocessinstances
\/([
a-zA-Z0-9
\-\;]{1,35})\/
restart$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'id'
]
==
tempValue
[
'id'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// Save
mock
.
onPost
(
new
RegExp
(
/^
\/
wfprocessinstances
\/?([
a-zA-Z0-9
\-\;]{0,35})\/
save$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:wfprocessinstance 方法: Save"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
wfprocessinstances
\/([
a-zA-Z0-9
\-\;]{1,35})\/
save$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'id'
]
==
tempValue
[
'id'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// Update
mock
.
onPut
(
new
RegExp
(
/^
\/
wfprocessinstances
\/?([
a-zA-Z0-9
\-\;]{0,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:wfprocessinstance 方法: Update"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
wfprocessinstances
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
//let items = mockDatas ? mockDatas : [];
//let _items = items.find((item: any) => Object.is(item.id, tempValue.id));
let
data
=
JSON
.
parse
(
config
.
data
);
mockDatas
.
forEach
((
item
)
=>
{
if
(
item
[
'id'
]
==
tempValue
[
'id'
]
){
for
(
let
value
in
data
){
if
(
item
.
hasOwnProperty
(
value
)){
item
[
value
]
=
data
[
value
];
}
}
}
})
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
data
);
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
data
];
});
// FetchActiveProcessInstance
mock
.
onGet
(
new
RegExp
(
/^
\/
wfprocessinstances$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onGet
(
new
RegExp
(
/^
\/
wfprocessinstances
\/
fetchactiveprocessinstance
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:wfprocessinstance 方法: FetchActiveProcessInstance"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
...
...
@@ -110,7 +335,7 @@ mock.onGet(new RegExp(/^\/wfprocessinstances$/)).reply((config: any) => {
});
// FetchActiveProcessInstance
mock
.
onGet
(
new
RegExp
(
/^
\/
wfprocessinstances
(\?[\w
-.
/
?%&=,
]
*
)
*$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onGet
(
new
RegExp
(
/^
\/
wfprocessinstances
\/
fetchactiveprocessinstance
(\?[\w
-.
/
?%&=,
]
*
)
*$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:wfprocessinstance 方法: FetchActiveProcessInstance"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
if
(
config
.
url
.
includes
(
'page'
)){
...
...
@@ -139,7 +364,7 @@ mock.onGet(new RegExp(/^\/wfprocessinstances(\?[\w-./?%&=,]*)*$/)).reply((config
});
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
wfprocessinstances$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onGet
(
new
RegExp
(
/^
\/
wfprocessinstances
\/
fetchdefault
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:wfprocessinstance 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
...
...
@@ -154,7 +379,7 @@ mock.onGet(new RegExp(/^\/wfprocessinstances$/)).reply((config: any) => {
});
// FetchDefault
mock
.
onGet
(
new
RegExp
(
/^
\/
wfprocessinstances
(\?[\w
-.
/
?%&=,
]
*
)
*$/
)).
reply
((
config
:
any
)
=>
{
mock
.
onGet
(
new
RegExp
(
/^
\/
wfprocessinstances
\/
fetchdefault
(\?[\w
-.
/
?%&=,
]
*
)
*$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:wfprocessinstance 方法: FetchDefault"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
if
(
config
.
url
.
includes
(
'page'
)){
...
...
@@ -217,3 +442,59 @@ mock.onGet(new RegExp(/^\/wfprocessinstances\/([a-zA-Z0-9\-\;]{1,35})\/select$/)
return
[
status
,
_items
];
});
// Get
mock
.
onGet
(
new
RegExp
(
/^
\/
wfprocessinstances
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:wfprocessinstance 方法: Get"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
wfprocessinstances
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
id
,
tempValue
.
id
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
// Remove
mock
.
onDelete
(
new
RegExp
(
/^
\/
wfprocessinstances
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
)).
reply
((
config
:
any
)
=>
{
console
.
groupCollapsed
(
"实体:wfprocessinstance 方法: Remove"
);
console
.
table
({
url
:
config
.
url
,
method
:
config
.
method
,
data
:
config
.
data
});
let
status
=
MockAdapter
.
mockStatus
(
config
);
if
(
status
!==
200
)
{
return
[
status
,
null
];
}
const
paramArray
:
Array
<
any
>
=
[
'id'
];
const
matchArray
:
any
=
new
RegExp
(
/^
\/
wfprocessinstances
\/([
a-zA-Z0-9
\-\;]{1,35})
$/
).
exec
(
config
.
url
);
let
tempValue
:
any
=
{};
if
(
matchArray
&&
matchArray
.
length
>
1
&&
paramArray
&&
paramArray
.
length
>
0
){
paramArray
.
forEach
((
item
:
any
,
index
:
number
)
=>
{
Object
.
defineProperty
(
tempValue
,
item
,
{
enumerable
:
true
,
value
:
matchArray
[
index
+
1
]
});
});
}
let
items
=
mockDatas
?
mockDatas
:
[];
let
_items
=
items
.
find
((
item
:
any
)
=>
Object
.
is
(
item
.
id
,
tempValue
.
id
));
console
.
groupCollapsed
(
"response数据 status: "
+
status
+
" data: "
);
console
.
table
(
_items
?
_items
:{});
console
.
groupEnd
();
console
.
groupEnd
();
return
[
status
,
_items
?
_items
:{}];
});
app_web/src/pages/workflow/wfprocess-instance-active-instance-option-view/wfprocess-instance-active-instance-option-view-base.vue
浏览文件 @
bb6519a2
...
...
@@ -13,7 +13,7 @@
:autosave=
"false"
:viewtag=
"viewtag"
:showBusyIndicator=
"true"
updateAction=
""
updateAction=
"
Jump
"
removeAction=
"Remove"
loaddraftAction=
"GetDraft"
loadAction=
"Get"
...
...
app_web/src/service/wfprocess-instance/wfprocess-instance-service-base.ts
浏览文件 @
bb6519a2
...
...
@@ -38,6 +38,179 @@ export default class WFProcessInstanceServiceBase extends EntityService {
// 实体接口
/**
* CheckKey接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public
async
CheckKey
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
Http
.
getInstance
().
post
(
`/wfprocessinstances/
${
context
.
wfprocessinstance
}
/checkkey`
,
data
,
isloading
);
return
res
;
}
/**
* Create接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public
async
Create
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
if
(
!
data
.
srffrontuf
||
data
.
srffrontuf
!==
"1"
){
data
[
this
.
APPDEKEY
]
=
null
;
}
if
(
data
.
srffrontuf
){
delete
data
.
srffrontuf
;
}
let
tempContext
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
context
));
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/wfprocessinstances`
,
data
,
isloading
);
return
res
;
}
/**
* Get接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public
async
Get
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/wfprocessinstances/
${
context
.
wfprocessinstance
}
`
,
isloading
);
return
res
;
}
/**
* GetDraft接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public
async
GetDraft
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
await
Http
.
getInstance
().
get
(
`/wfprocessinstances/getdraft`
,
isloading
);
res
.
data
.
wfprocessinstance
=
data
.
wfprocessinstance
;
return
res
;
}
/**
* Jump接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public
async
Jump
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
Http
.
getInstance
().
post
(
`/wfprocessinstances/
${
context
.
wfprocessinstance
}
/jump`
,
data
,
isloading
);
return
res
;
}
/**
* JumpBatch接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public
async
JumpBatch
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
await
Http
.
getInstance
().
post
(
`/wfprocessinstances/jumpbatch`
,
tempData
,
isloading
);
}
/**
* Remove接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public
async
Remove
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
Http
.
getInstance
().
delete
(
`/wfprocessinstances/
${
context
.
wfprocessinstance
}
`
,
isloading
);
return
res
;
}
/**
* Restart接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public
async
Restart
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
res
:
any
=
Http
.
getInstance
().
post
(
`/wfprocessinstances/
${
context
.
wfprocessinstance
}
/restart`
,
data
,
isloading
);
return
res
;
}
/**
* RestartBatch接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public
async
RestartBatch
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
return
await
Http
.
getInstance
().
post
(
`/wfprocessinstances/restartbatch`
,
tempData
,
isloading
);
}
/**
* Save接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public
async
Save
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
post
(
`/wfprocessinstances/
${
context
.
wfprocessinstance
}
/save`
,
data
,
isloading
);
return
res
;
}
/**
* Update接口方法
*
* @param {*} [context={}]
* @param {*} [data={}]
* @param {boolean} [isloading]
* @returns {Promise<any>}
* @memberof WFProcessInstanceServiceBase
*/
public
async
Update
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
masterData
:
any
=
{};
Object
.
assign
(
data
,
masterData
);
let
res
:
any
=
await
Http
.
getInstance
().
put
(
`/wfprocessinstances/
${
context
.
wfprocessinstance
}
`
,
data
,
isloading
);
return
res
;
}
/**
* FetchActiveProcessInstance接口方法
*
...
...
@@ -48,6 +221,9 @@ export default class WFProcessInstanceServiceBase extends EntityService {
* @memberof WFProcessInstanceServiceBase
*/
public
async
FetchActiveProcessInstance
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
let
res
:
any
=
Http
.
getInstance
().
get
(
`/wfprocessinstances/fetchactiveprocessinstance`
,
tempData
,
isloading
);
return
res
;
}
/**
...
...
@@ -74,6 +250,9 @@ export default class WFProcessInstanceServiceBase extends EntityService {
* @memberof WFProcessInstanceServiceBase
*/
public
async
FetchDefault
(
context
:
any
=
{},
data
:
any
=
{},
isloading
?:
boolean
):
Promise
<
any
>
{
let
tempData
:
any
=
JSON
.
parse
(
JSON
.
stringify
(
data
));
let
res
:
any
=
Http
.
getInstance
().
get
(
`/wfprocessinstances/fetchdefault`
,
tempData
,
isloading
);
return
res
;
}
/**
...
...
app_web/src/uiservice/wfprocess-instance/wfprocess-instance-ui-service-base.ts
浏览文件 @
bb6519a2
...
...
@@ -233,7 +233,26 @@ export default class WFProcessInstanceUIServiceBase extends UIService {
delete
context
.
srfsessionid
;
}
const
backend
=
()
=>
{
actionContext
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
'模型异常,应用实体方法不存在'
});
const
curService
:
WFProcessInstanceService
=
new
WFProcessInstanceService
();
curService
.
Restart
(
context
,
data
,
true
).
then
((
response
:
any
)
=>
{
if
(
!
response
||
response
.
status
!==
200
)
{
actionContext
.
$Notice
.
error
({
title
:
'错误'
,
desc
:
response
.
message
});
return
;
}
actionContext
.
$Notice
.
success
({
title
:
'成功'
,
desc
:
'操作成功'
});
const
_this
:
any
=
actionContext
;
return
response
;
}).
catch
((
response
:
any
)
=>
{
if
(
response
&&
response
.
status
&&
response
.
data
)
{
actionContext
.
$Notice
.
error
({
title
:
(
actionContext
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
response
.
data
.
message
});
return
;
}
if
(
!
response
||
!
response
.
status
||
!
response
.
data
)
{
actionContext
.
$Notice
.
error
({
title
:
(
actionContext
.
$t
(
'app.commonWords.wrong'
)
as
string
),
desc
:
(
actionContext
.
$t
(
'app.commonWords.sysException'
)
as
string
)
});
return
;
}
return
response
;
});
};
backend
();
}
...
...
ibzwf-provider/ibzwf-provider-api/src/main/java/cn/ibizlab/api/rest/WFProcessInstanceResource.java
浏览文件 @
bb6519a2
...
...
@@ -47,6 +47,162 @@ public class WFProcessInstanceResource {
@Lazy
public
WFProcessInstanceMapping
wfprocessinstanceMapping
;
@ApiOperation
(
value
=
"新建流程实例"
,
tags
=
{
"流程实例"
},
notes
=
"新建流程实例"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/wfprocessinstances"
)
public
ResponseEntity
<
WFProcessInstanceDTO
>
create
(
@Validated
@RequestBody
WFProcessInstanceDTO
wfprocessinstancedto
)
{
WFProcessInstance
domain
=
wfprocessinstanceMapping
.
toDomain
(
wfprocessinstancedto
);
wfprocessinstanceService
.
create
(
domain
);
WFProcessInstanceDTO
dto
=
wfprocessinstanceMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"批量新建流程实例"
,
tags
=
{
"流程实例"
},
notes
=
"批量新建流程实例"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/wfprocessinstances/batch"
)
public
ResponseEntity
<
Boolean
>
createBatch
(
@RequestBody
List
<
WFProcessInstanceDTO
>
wfprocessinstancedtos
)
{
wfprocessinstanceService
.
createBatch
(
wfprocessinstanceMapping
.
toDomain
(
wfprocessinstancedtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"获取流程实例"
,
tags
=
{
"流程实例"
},
notes
=
"获取流程实例"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/wfprocessinstances/{wfprocessinstance_id}"
)
public
ResponseEntity
<
WFProcessInstanceDTO
>
get
(
@PathVariable
(
"wfprocessinstance_id"
)
String
wfprocessinstance_id
)
{
WFProcessInstance
domain
=
wfprocessinstanceService
.
get
(
wfprocessinstance_id
);
WFProcessInstanceDTO
dto
=
wfprocessinstanceMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"删除流程实例"
,
tags
=
{
"流程实例"
},
notes
=
"删除流程实例"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/wfprocessinstances/{wfprocessinstance_id}"
)
public
ResponseEntity
<
Boolean
>
remove
(
@PathVariable
(
"wfprocessinstance_id"
)
String
wfprocessinstance_id
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
wfprocessinstanceService
.
remove
(
wfprocessinstance_id
));
}
@ApiOperation
(
value
=
"批量删除流程实例"
,
tags
=
{
"流程实例"
},
notes
=
"批量删除流程实例"
)
@RequestMapping
(
method
=
RequestMethod
.
DELETE
,
value
=
"/wfprocessinstances/batch"
)
public
ResponseEntity
<
Boolean
>
removeBatch
(
@RequestBody
List
<
String
>
ids
)
{
wfprocessinstanceService
.
removeBatch
(
ids
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"更新流程实例"
,
tags
=
{
"流程实例"
},
notes
=
"更新流程实例"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/wfprocessinstances/{wfprocessinstance_id}"
)
public
ResponseEntity
<
WFProcessInstanceDTO
>
update
(
@PathVariable
(
"wfprocessinstance_id"
)
String
wfprocessinstance_id
,
@RequestBody
WFProcessInstanceDTO
wfprocessinstancedto
)
{
WFProcessInstance
domain
=
wfprocessinstanceMapping
.
toDomain
(
wfprocessinstancedto
);
domain
.
setId
(
wfprocessinstance_id
);
wfprocessinstanceService
.
update
(
domain
);
WFProcessInstanceDTO
dto
=
wfprocessinstanceMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
dto
);
}
@ApiOperation
(
value
=
"批量更新流程实例"
,
tags
=
{
"流程实例"
},
notes
=
"批量更新流程实例"
)
@RequestMapping
(
method
=
RequestMethod
.
PUT
,
value
=
"/wfprocessinstances/batch"
)
public
ResponseEntity
<
Boolean
>
updateBatch
(
@RequestBody
List
<
WFProcessInstanceDTO
>
wfprocessinstancedtos
)
{
wfprocessinstanceService
.
updateBatch
(
wfprocessinstanceMapping
.
toDomain
(
wfprocessinstancedtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"检查流程实例"
,
tags
=
{
"流程实例"
},
notes
=
"检查流程实例"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/wfprocessinstances/checkkey"
)
public
ResponseEntity
<
Boolean
>
checkKey
(
@RequestBody
WFProcessInstanceDTO
wfprocessinstancedto
)
{
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
wfprocessinstanceService
.
checkKey
(
wfprocessinstanceMapping
.
toDomain
(
wfprocessinstancedto
)));
}
@ApiOperation
(
value
=
"获取流程实例草稿"
,
tags
=
{
"流程实例"
},
notes
=
"获取流程实例草稿"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/wfprocessinstances/getdraft"
)
public
ResponseEntity
<
WFProcessInstanceDTO
>
getDraft
(
WFProcessInstanceDTO
dto
)
{
WFProcessInstance
domain
=
wfprocessinstanceMapping
.
toDomain
(
dto
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
wfprocessinstanceMapping
.
toDto
(
wfprocessinstanceService
.
getDraft
(
domain
)));
}
@ApiOperation
(
value
=
"流程跳转"
,
tags
=
{
"流程实例"
},
notes
=
"流程跳转"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/wfprocessinstances/{wfprocessinstance_id}/jump"
)
public
ResponseEntity
<
WFProcessInstanceDTO
>
jump
(
@PathVariable
(
"wfprocessinstance_id"
)
String
wfprocessinstance_id
,
@RequestBody
WFProcessInstanceDTO
wfprocessinstancedto
)
{
WFProcessInstance
domain
=
wfprocessinstanceMapping
.
toDomain
(
wfprocessinstancedto
);
domain
.
setId
(
wfprocessinstance_id
);
domain
=
wfprocessinstanceService
.
jump
(
domain
);
wfprocessinstancedto
=
wfprocessinstanceMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
wfprocessinstancedto
);
}
@ApiOperation
(
value
=
"批量处理[流程跳转]"
,
tags
=
{
"流程实例"
},
notes
=
"批量处理[流程跳转]"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/wfprocessinstances/jumpbatch"
)
public
ResponseEntity
<
Boolean
>
jumpBatch
(
@RequestBody
List
<
WFProcessInstanceDTO
>
wfprocessinstancedtos
)
{
List
<
WFProcessInstance
>
domains
=
wfprocessinstanceMapping
.
toDomain
(
wfprocessinstancedtos
);
boolean
result
=
wfprocessinstanceService
.
jumpBatch
(
domains
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
result
);
}
@ApiOperation
(
value
=
"重启流程"
,
tags
=
{
"流程实例"
},
notes
=
"重启流程"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/wfprocessinstances/{wfprocessinstance_id}/restart"
)
public
ResponseEntity
<
WFProcessInstanceDTO
>
restart
(
@PathVariable
(
"wfprocessinstance_id"
)
String
wfprocessinstance_id
,
@RequestBody
WFProcessInstanceDTO
wfprocessinstancedto
)
{
WFProcessInstance
domain
=
wfprocessinstanceMapping
.
toDomain
(
wfprocessinstancedto
);
domain
.
setId
(
wfprocessinstance_id
);
domain
=
wfprocessinstanceService
.
restart
(
domain
);
wfprocessinstancedto
=
wfprocessinstanceMapping
.
toDto
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
wfprocessinstancedto
);
}
@ApiOperation
(
value
=
"批量处理[重启流程]"
,
tags
=
{
"流程实例"
},
notes
=
"批量处理[重启流程]"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/wfprocessinstances/restartbatch"
)
public
ResponseEntity
<
Boolean
>
restartBatch
(
@RequestBody
List
<
WFProcessInstanceDTO
>
wfprocessinstancedtos
)
{
List
<
WFProcessInstance
>
domains
=
wfprocessinstanceMapping
.
toDomain
(
wfprocessinstancedtos
);
boolean
result
=
wfprocessinstanceService
.
restartBatch
(
domains
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
result
);
}
@ApiOperation
(
value
=
"保存流程实例"
,
tags
=
{
"流程实例"
},
notes
=
"保存流程实例"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/wfprocessinstances/save"
)
public
ResponseEntity
<
WFProcessInstanceDTO
>
save
(
@RequestBody
WFProcessInstanceDTO
wfprocessinstancedto
)
{
WFProcessInstance
domain
=
wfprocessinstanceMapping
.
toDomain
(
wfprocessinstancedto
);
wfprocessinstanceService
.
save
(
domain
);
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
wfprocessinstanceMapping
.
toDto
(
domain
));
}
@ApiOperation
(
value
=
"批量保存流程实例"
,
tags
=
{
"流程实例"
},
notes
=
"批量保存流程实例"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/wfprocessinstances/savebatch"
)
public
ResponseEntity
<
Boolean
>
saveBatch
(
@RequestBody
List
<
WFProcessInstanceDTO
>
wfprocessinstancedtos
)
{
wfprocessinstanceService
.
saveBatch
(
wfprocessinstanceMapping
.
toDomain
(
wfprocessinstancedtos
));
return
ResponseEntity
.
status
(
HttpStatus
.
OK
).
body
(
true
);
}
@ApiOperation
(
value
=
"获取流程中实例"
,
tags
=
{
"流程实例"
}
,
notes
=
"获取流程中实例"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/wfprocessinstances/fetchactiveprocessinstance"
)
public
ResponseEntity
<
List
<
WFProcessInstanceDTO
>>
fetchActiveProcessInstance
(
WFProcessInstanceSearchContext
context
)
{
Page
<
WFProcessInstance
>
domains
=
wfprocessinstanceService
.
searchActiveProcessInstance
(
context
)
;
List
<
WFProcessInstanceDTO
>
list
=
wfprocessinstanceMapping
.
toDto
(
domains
.
getContent
());
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
header
(
"x-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageNumber
()))
.
header
(
"x-per-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageSize
()))
.
header
(
"x-total"
,
String
.
valueOf
(
domains
.
getTotalElements
()))
.
body
(
list
);
}
@ApiOperation
(
value
=
"查询流程中实例"
,
tags
=
{
"流程实例"
}
,
notes
=
"查询流程中实例"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/wfprocessinstances/searchactiveprocessinstance"
)
public
ResponseEntity
<
Page
<
WFProcessInstanceDTO
>>
searchActiveProcessInstance
(
@RequestBody
WFProcessInstanceSearchContext
context
)
{
Page
<
WFProcessInstance
>
domains
=
wfprocessinstanceService
.
searchActiveProcessInstance
(
context
)
;
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
body
(
new
PageImpl
(
wfprocessinstanceMapping
.
toDto
(
domains
.
getContent
()),
context
.
getPageable
(),
domains
.
getTotalElements
()));
}
@ApiOperation
(
value
=
"获取DEFAULT"
,
tags
=
{
"流程实例"
}
,
notes
=
"获取DEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
GET
,
value
=
"/wfprocessinstances/fetchdefault"
)
public
ResponseEntity
<
List
<
WFProcessInstanceDTO
>>
fetchDefault
(
WFProcessInstanceSearchContext
context
)
{
Page
<
WFProcessInstance
>
domains
=
wfprocessinstanceService
.
searchDefault
(
context
)
;
List
<
WFProcessInstanceDTO
>
list
=
wfprocessinstanceMapping
.
toDto
(
domains
.
getContent
());
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
header
(
"x-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageNumber
()))
.
header
(
"x-per-page"
,
String
.
valueOf
(
context
.
getPageable
().
getPageSize
()))
.
header
(
"x-total"
,
String
.
valueOf
(
domains
.
getTotalElements
()))
.
body
(
list
);
}
@ApiOperation
(
value
=
"查询DEFAULT"
,
tags
=
{
"流程实例"
}
,
notes
=
"查询DEFAULT"
)
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/wfprocessinstances/searchdefault"
)
public
ResponseEntity
<
Page
<
WFProcessInstanceDTO
>>
searchDefault
(
@RequestBody
WFProcessInstanceSearchContext
context
)
{
Page
<
WFProcessInstance
>
domains
=
wfprocessinstanceService
.
searchDefault
(
context
)
;
return
ResponseEntity
.
status
(
HttpStatus
.
OK
)
.
body
(
new
PageImpl
(
wfprocessinstanceMapping
.
toDto
(
domains
.
getContent
()),
context
.
getPageable
(),
domains
.
getTotalElements
()));
}
}
...
...
编辑
预览
Markdown
格式
0%
请重试
or
添加新附件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录