Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
datacollector
Overview
Overview
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
chenweisong
datacollector
Commits
ae779dae
Commit
ae779dae
authored
Mar 11, 2020
by
chenweisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
跟新
parent
5e63394f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
8 deletions
+36
-8
IndexCtrl.java
src/main/java/com/keymobile/rest/ctrl/IndexCtrl.java
+23
-3
User.java
src/main/java/com/keymobile/rest/model/User.java
+1
-1
application-test.yml
src/main/resources/application-test.yml
+2
-2
ProcessTest.java
src/test/java/com/keymobile/ProcessTest.java
+10
-2
No files found.
src/main/java/com/keymobile/rest/ctrl/IndexCtrl.java
View file @
ae779dae
...
...
@@ -95,6 +95,26 @@ public class IndexCtrl {
return
ApiResponse
.
ok
(
excelList
);
}
@ApiOperation
(
value
=
"审核人员查看自己任务"
)
@PostMapping
(
value
=
"/task/getMyAudits"
)
public
ApiResponse
getMyJudges
()
{
List
<
User
>
userList
=
userService
.
findAllByRole
(
User
.
ROLE_AUDIT
);
User
curUser
=
userList
.
get
(
0
);
List
<
Excel
>
excelList
=
new
ArrayList
<>();
// 发起人把流程发送到下一个人
List
<
Task
>
taskList
=
taskService
.
createTaskQuery
()
.
taskAssignee
(
curUser
.
getUsername
()).
list
();
if
(
taskList
.
size
()
>
0
)
{
Task
task
=
taskList
.
get
(
0
);
String
processId
=
task
.
getProcessInstanceId
();
Job
job
=
jobService
.
findByProcessId
(
processId
);
if
(
job
.
getStatus
()
!=
Job
.
STATUS_COMPLETED
)
{
excelList
=
excelService
.
findAllByJobId
(
job
.
getId
());
}
}
return
ApiResponse
.
ok
(
excelList
);
}
@ApiOperation
(
value
=
"新建收数"
)
@PostMapping
(
value
=
"/task/create"
)
public
ApiResponse
createTask
(
@RequestBody
JobForm
form
)
{
...
...
@@ -194,7 +214,7 @@ public class IndexCtrl {
public
ApiResponse
passTask
(
@RequestParam
Long
taskId
)
{
Job
job
=
jobService
.
get
(
taskId
);
// 完结收数, 流程跑完
List
<
User
>
judgeList
=
userService
.
findAllByRole
(
User
.
ROLE_
JUDGE
);
List
<
User
>
judgeList
=
userService
.
findAllByRole
(
User
.
ROLE_
AUDIT
);
User
judge
=
judgeList
.
get
(
0
);
List
<
Task
>
taskList
=
taskService
.
createTaskQuery
().
processInstanceId
(
job
.
getProcessId
())
.
taskAssignee
(
judge
.
getUsername
()).
list
();
...
...
@@ -211,7 +231,7 @@ public class IndexCtrl {
public
ApiResponse
rejectTask
(
@RequestParam
Long
taskId
)
{
Job
job
=
jobService
.
get
(
taskId
);
// 完结收数, 流程跑完
List
<
User
>
judgeList
=
userService
.
findAllByRole
(
User
.
ROLE_
JUDGE
);
List
<
User
>
judgeList
=
userService
.
findAllByRole
(
User
.
ROLE_
AUDIT
);
User
judge
=
judgeList
.
get
(
0
);
List
<
Task
>
taskList
=
taskService
.
createTaskQuery
().
processInstanceId
(
job
.
getProcessId
())
.
taskAssignee
(
judge
.
getUsername
()).
list
();
...
...
@@ -252,7 +272,7 @@ public class IndexCtrl {
.
taskAssignee
(
curUser
.
getUsername
()).
list
();
Task
task
=
taskList
.
get
(
0
);
List
<
User
>
judgeList
=
userService
.
findAllByRole
(
User
.
ROLE_
JUDGE
);
List
<
User
>
judgeList
=
userService
.
findAllByRole
(
User
.
ROLE_
AUDIT
);
User
judge
=
judgeList
.
get
(
0
);
taskService
.
complete
(
task
.
getId
(),
ImmutableMap
.
of
(
"judgeId"
,
judge
.
getUsername
()));
return
ApiResponse
.
ok
(
recordData
.
getId
());
...
...
src/main/java/com/keymobile/rest/model/User.java
View file @
ae779dae
...
...
@@ -16,7 +16,7 @@ import java.io.Serializable;
public
class
User
implements
Serializable
{
public
static
int
ROLE_NORMAL
=
1
;
public
static
int
ROLE_
JUDGE
=
2
;
public
static
int
ROLE_
AUDIT
=
2
;
public
static
int
ROLE_MANAGER
=
3
;
@Id
...
...
src/main/resources/application-test.yml
View file @
ae779dae
...
...
@@ -52,8 +52,8 @@ app:
active-process
:
RecordStandardProcess.bpmn
swagger2
:
#
host: localhost:8110
host
:
47.105.236.43/activiti
host
:
localhost:8110
#
host: 47.105.236.43/activiti
...
...
src/test/java/com/keymobile/ProcessTest.java
View file @
ae779dae
package
com
.
keymobile
;
import
com.keymobile.rest.common.exception.TwinkleException
;
import
com.keymobile.rest.common.validator.TwinkleValidator
;
import
com.keymobile.rest.model.Job
;
import
com.keymobile.rest.service.JobService
;
import
javafx.application.Application
;
import
org.activiti.engine.*
;
import
org.activiti.engine.history.HistoricProcessInstance
;
...
...
@@ -22,6 +26,8 @@ import java.util.List;
public
class
ProcessTest
{
@Resource
private
JobService
jobService
;
@Resource
private
RepositoryService
repositoryService
;
@Resource
private
RuntimeService
runtimeService
;
...
...
@@ -46,12 +52,14 @@ public class ProcessTest {
@Test
public
void
start
()
{
// ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
// Job job = jobService.findByProcessId("115005");
// TwinkleValidator.notNull(job, "22");
// ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
// processEngine.getTaskService()
// .complete("32502");
}
// @Test
// @Test
public
void
zhuguan
()
{
// try {
...
...
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