Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
B
BasicAPI
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杜科
BasicAPI
Commits
4c888858
Commit
4c888858
authored
Mar 21, 2023
by
shyWang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PDM前端改造
添加查询用户全部待办接口
parent
75fb0e4f
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
88 additions
and
1 deletion
+88
-1
WorkflowUtil.java
src/com/yonde/common/WorkflowUtil.java
+48
-1
WfcProcessController.java
src/com/yonde/wfc/controller/WfcProcessController.java
+12
-0
WfcProcessService.java
src/com/yonde/wfc/service/WfcProcessService.java
+28
-0
No files found.
src/com/yonde/common/WorkflowUtil.java
View file @
4c888858
...
...
@@ -2131,7 +2131,7 @@ public class WorkflowUtil implements RemoteAccess {
public
static
List
<
WorkItem
>
getUserWorks
(
WTUser
wtUser
)
throws
WTException
{
List
<
WorkItem
>
list
=
new
ArrayList
<
WorkItem
>();
Enumeration
enumx
=
getUser
UnDo
Task
(
wtUser
);
Enumeration
enumx
=
getUserTask
(
wtUser
);
if
(
enumx
!=
null
)
{
while
(
enumx
.
hasMoreElements
())
{
WorkItem
workItem
=
(
WorkItem
)
enumx
.
nextElement
();
...
...
@@ -2157,6 +2157,35 @@ public class WorkflowUtil implements RemoteAccess {
* @return
* @throws WTException
*/
public
static
List
<
WorkItem
>
getUserUndoWorks
(
WTUser
wtUser
)
throws
WTException
{
List
<
WorkItem
>
list
=
new
ArrayList
<
WorkItem
>();
Enumeration
enumx
=
getUserUnDoTask
(
wtUser
);
if
(
enumx
!=
null
)
{
while
(
enumx
.
hasMoreElements
())
{
WorkItem
workItem
=
(
WorkItem
)
enumx
.
nextElement
();
list
.
add
(
workItem
);
}
}
// 对workItem根据创建时间进行排序,最新时间的排列在前。
Collections
.
sort
(
list
,
new
Comparator
<
WorkItem
>()
{
@Override
public
int
compare
(
WorkItem
wt1
,
WorkItem
wt2
)
{
Timestamp
ts1
=
wt1
.
getCreateTimestamp
();
Timestamp
ts2
=
wt2
.
getCreateTimestamp
();
return
ts2
.
compareTo
(
ts1
);
}
});
return
list
;
}
/**
* 获取未完成工作流任务
*
* @param wtUser
* @return
* @throws WTException
*/
public
static
Enumeration
getUserUnDoTask
(
WTUser
wtUser
)
throws
WTException
{
Enumeration
enumx
=
null
;
...
...
@@ -2168,6 +2197,24 @@ public class WorkflowUtil implements RemoteAccess {
return
enumx
;
}
/**
* 获取工作流任务
*
* @param wtUser
* @return
* @throws WTException
*/
public
static
Enumeration
getUserTask
(
WTUser
wtUser
)
throws
WTException
{
Enumeration
enumx
=
null
;
if
(
ObjectsUtil
.
nonNull
(
wtUser
))
{
enumx
=
WorkflowHelper
.
service
.
getWorkItems
(
wtUser
);
}
else
{
enumx
=
WorkflowHelper
.
service
.
getWorkItems
();
}
return
enumx
;
}
/**
* 判断流程活动是否已存在参与者
*
...
...
src/com/yonde/wfc/controller/WfcProcessController.java
View file @
4c888858
...
...
@@ -51,6 +51,18 @@ public class WfcProcessController {
return
todoTaskList
;
}
@GetMapping
({
"/task/all"
})
//@ApiOperation("查询待办任务列表")
public
List
<
DxWfProcessTaskVO
>
getAllTaskList
(
@RequestParam
(
"userName"
)
String
userName
)
{
List
<
DxWfProcessTaskVO
>
todoTaskList
=
new
ArrayList
<
DxWfProcessTaskVO
>();
try
{
todoTaskList
=
WfcProcessService
.
getAllTaskList
(
userName
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
return
todoTaskList
;
}
@GetMapping
({
"/task/countOfType"
})
public
Map
<
String
,
Integer
>
getTaskTypeAndCount
(
@RequestParam
(
"userName"
)
String
userName
)
{
Map
<
String
,
Integer
>
resultMap
=
new
HashMap
<
String
,
Integer
>();
...
...
src/com/yonde/wfc/service/WfcProcessService.java
View file @
4c888858
...
...
@@ -177,6 +177,34 @@ public class WfcProcessService implements RemoteAccess {
}
List
<
DxWfProcessTaskVO
>
taskVOList
=
new
ArrayList
<
DxWfProcessTaskVO
>();
SessionContext
previous
=
SessionContext
.
newContext
();
try
{
SessionHelper
.
manager
.
setAdministrator
();
WTUser
user
=
WTUserUtil
.
getUser
(
userName
);
List
<
WorkItem
>
userWorks
=
WorkflowUtil
.
getUserUndoWorks
(
user
);
for
(
WorkItem
userWork
:
userWorks
)
{
DxWfProcessTaskVO
dxWfProcessTaskVO
=
new
DxWfProcessTaskVO
(
userWork
);
taskVOList
.
add
(
dxWfProcessTaskVO
);
}
}
finally
{
SessionContext
.
setContext
(
previous
);
}
return
taskVOList
;
}
/**
* 获取用户待办
* @param userName
* @return
* @throws Exception
*/
public
static
List
<
DxWfProcessTaskVO
>
getAllTaskList
(
String
userName
)
throws
Exception
{
if
(!
RemoteMethodServer
.
ServerFlag
)
{
return
(
List
<
DxWfProcessTaskVO
>)
RemoteMethodServer
.
getDefault
().
invoke
(
"getAllTaskList"
,
WfcProcessService
.
class
.
getName
(),
null
,
new
Class
[]
{
String
.
class
},
new
Object
[]
{
userName
});
}
List
<
DxWfProcessTaskVO
>
taskVOList
=
new
ArrayList
<
DxWfProcessTaskVO
>();
SessionContext
previous
=
SessionContext
.
newContext
();
try
{
SessionHelper
.
manager
.
setAdministrator
();
WTUser
user
=
WTUserUtil
.
getUser
(
userName
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment