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
85ae98a0
Commit
85ae98a0
authored
Apr 02, 2020
by
chenweisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
e5d34b2c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
44 deletions
+36
-44
ExcelController.java
...n/java/com/keymobile/rest/controller/ExcelController.java
+2
-2
TaskController.java
...in/java/com/keymobile/rest/controller/TaskController.java
+30
-38
ActivityService.java
...main/java/com/keymobile/rest/service/ActivityService.java
+2
-2
application-test.yml
src/main/resources/application-test.yml
+2
-2
No files found.
src/main/java/com/keymobile/rest/controller/ExcelController.java
View file @
85ae98a0
...
...
@@ -85,8 +85,8 @@ public class ExcelController {
@ApiImplicitParams
(
@ApiImplicitParam
(
name
=
"excelId"
,
required
=
true
,
value
=
"当前模板id"
,
dataType
=
"long"
,
paramType
=
"query"
)
)
@
PostMapping
(
value
=
"/excel/getData
"
)
public
Object
getRecordData
(
long
excelId
)
{
@
GetMapping
(
value
=
"/excel/getData/{excelId}
"
)
public
Object
getRecordData
(
@PathVariable
long
excelId
)
{
return
"成功"
;
}
...
...
src/main/java/com/keymobile/rest/controller/TaskController.java
View file @
85ae98a0
...
...
@@ -68,7 +68,7 @@ public class TaskController {
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"当前页条数"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
,
defaultValue
=
"10"
),
@ApiImplicitParam
(
name
=
"name"
,
value
=
"活动名称"
,
paramType
=
"query"
,
dataType
=
"string"
)
})
@
PostMapping
(
value
=
"/task/list
"
)
@
GetMapping
(
value
=
"/tasks
"
)
public
SimplePage
getTaskList
(
int
pageNo
,
int
pageSize
,
String
name
)
{
Page
<
Activity
>
taskList
;
String
orderBy
=
"descending"
;
//
...
...
@@ -81,23 +81,23 @@ public class TaskController {
return
SimplePage
.
of
(
taskList
);
}
@ApiOperation
(
value
=
"单个活动详情"
)
@ApiOperation
(
value
=
"
获取
单个活动详情"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"taskId"
,
value
=
"活动id"
,
paramType
=
"
query
"
,
required
=
true
,
dataType
=
"long"
)
@ApiImplicitParam
(
name
=
"taskId"
,
value
=
"活动id"
,
paramType
=
"
path
"
,
required
=
true
,
dataType
=
"long"
)
})
@
PostMapping
(
value
=
"/task/get
"
)
public
SimpleTask
get
(
long
taskId
)
{
Activity
activity
=
activityService
.
get
(
taskId
);
@
GetMapping
(
value
=
"/task/get/{taskId}
"
)
public
SimpleTask
get
(
@PathVariable
long
taskId
)
{
Activity
activity
=
activityService
.
findById
(
taskId
);
CommonValidator
.
notNull
(
activity
,
"活动不存在"
);
return
SimpleTask
.
convert
(
activity
);
}
@ApiOperation
(
value
=
"我的任务"
,
notes
=
"任务列表"
)
@ApiOperation
(
value
=
"
获取
我的任务"
,
notes
=
"任务列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户id"
,
paramType
=
"
query
"
,
required
=
true
,
dataType
=
"long"
,
defaultValue
=
"3"
)
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户id"
,
paramType
=
"
path
"
,
required
=
true
,
dataType
=
"long"
,
defaultValue
=
"3"
)
})
@
PostMapping
(
value
=
"/task/getMyTasks
"
)
public
List
<
Mission
>
getMyMissions
(
long
userId
)
{
@
GetMapping
(
value
=
"/task/getMyTasks/{userId}
"
)
public
List
<
Mission
>
getMyMissions
(
@PathVariable
long
userId
)
{
Map
user
=
feignAuthService
.
getUserById
(
userId
);
CommonValidator
.
notNull
(
user
,
"用户不存在"
);
String
username
=
user
.
get
(
"name"
).
toString
();
...
...
@@ -187,18 +187,21 @@ public class TaskController {
}
@ApiOperation
(
value
=
"修改活动"
)
@PostMapping
(
value
=
"/task/update"
)
public
Object
updateTask
(
@RequestBody
TaskForm
form
)
{
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"taskId"
,
value
=
"活动id"
,
paramType
=
"path"
,
required
=
true
,
dataType
=
"long"
)
})
@PostMapping
(
value
=
"/task/edit/{taskId}"
)
public
Object
editTask
(
@RequestBody
TaskForm
form
,
@PathVariable
long
taskId
)
{
return
"修改成功"
;
}
@ApiOperation
(
value
=
"发起活动"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"taskId"
,
value
=
"活动id"
,
paramType
=
"
query
"
,
required
=
true
,
dataType
=
"long"
)
@ApiImplicitParam
(
name
=
"taskId"
,
value
=
"活动id"
,
paramType
=
"
path
"
,
required
=
true
,
dataType
=
"long"
)
})
@PostMapping
(
value
=
"/task/
start
"
)
public
Object
runTask
(
long
taskId
)
{
Activity
activity
=
activityService
.
get
(
taskId
);
@PostMapping
(
value
=
"/task/
run/{taskId}
"
)
public
Object
runTask
(
@PathVariable
long
taskId
)
{
Activity
activity
=
activityService
.
findById
(
taskId
);
CommonValidator
.
notNull
(
activity
,
"活动不存在"
);
CommonValidator
.
isTrue
(
activity
.
getStatus
()
==
Activity
.
STATUS_WAIT
,
"活动正在运行,不能重复启动"
);
...
...
@@ -245,35 +248,24 @@ public class TaskController {
@ApiOperation
(
value
=
"审核通过活动"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"taskId"
,
value
=
"活动id"
,
paramType
=
"
query
"
,
required
=
true
,
dataType
=
"long"
)
@ApiImplicitParam
(
name
=
"taskId"
,
value
=
"活动id"
,
paramType
=
"
path
"
,
required
=
true
,
dataType
=
"long"
)
})
@PostMapping
(
value
=
"/task/pass"
)
public
Object
passTask
(
long
taskId
)
{
Activity
activity
=
activityService
.
get
(
taskId
);
@PostMapping
(
value
=
"/task/pass
/{taskId}
"
)
public
Object
passTask
(
@PathVariable
long
taskId
)
{
Activity
activity
=
activityService
.
findById
(
taskId
);
// 完结活动, 流程跑完
// User judge = userService.getAudit();
// List<Task> taskList = taskService.createTaskQuery().processInstanceId(assignment.getProcessId())
// .taskAssignee(judge.getUsername()).list();
// TwinkleValidator.notLessThan(taskList.size(), 1, "启动失败");
// Task task = taskList.get(0);
// taskService.complete(task.getId(), ImmutableMap.of("pass", "true"));
// assignment.setStatus(Assignment.STATUS_COMPLETED);
// activityService.update(activity);
return
"审核通过成功"
;
}
@ApiOperation
(
value
=
"审核驳回活动"
)
@PostMapping
(
value
=
"/task/reject"
)
public
Object
rejectTask
(
@RequestParam
Long
taskId
)
{
Activity
activity
=
activityService
.
get
(
taskId
);
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"taskId"
,
value
=
"活动id"
,
paramType
=
"path"
,
required
=
true
,
dataType
=
"long"
)
})
@PostMapping
(
value
=
"/task/reject/{taskId}"
)
public
Object
rejectTask
(
@PathVariable
long
taskId
)
{
Activity
activity
=
activityService
.
findById
(
taskId
);
// 完结活动, 流程跑完
// User judge = userService.getAudit();
// List<Task> taskList = taskService.createTaskQuery().processInstanceId(assignment.getProcessId())
// .taskAssignee(judge.getUsername()).list();
// TwinkleValidator.notLessThan(taskList.size(), 1, "启动失败");
// Task task = taskList.get(0);
// taskService.complete(task.getId(), ImmutableMap.of("pass", "false"));
return
"审核驳回成功"
;
}
...
...
@@ -286,7 +278,7 @@ public class TaskController {
@ApiOperation
(
value
=
"查看当前活动进度"
,
hidden
=
true
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"taskId"
,
value
=
"活动id"
,
paramType
=
"
query
"
,
required
=
true
,
dataType
=
"long"
)
@ApiImplicitParam
(
name
=
"taskId"
,
value
=
"活动id"
,
paramType
=
"
path
"
,
required
=
true
,
dataType
=
"long"
)
})
@PostMapping
(
value
=
"/task/progress/{taskId}"
)
public
Object
viewTaskProgress
(
@PathVariable
long
taskId
)
{
...
...
src/main/java/com/keymobile/rest/service/ActivityService.java
View file @
85ae98a0
...
...
@@ -16,8 +16,8 @@ public class ActivityService {
@Autowired
private
ActivityDao
activityDao
;
public
Activity
get
(
long
id
)
{
return
activityDao
.
getOne
(
id
);
public
Activity
findById
(
long
id
)
{
return
activityDao
.
findById
(
id
).
get
(
);
}
public
Activity
update
(
Activity
activity
)
{
...
...
src/main/resources/application-test.yml
View file @
85ae98a0
...
...
@@ -57,8 +57,8 @@ app:
active-process
:
MoreSubProcessStandard.bpmn
swagger2
:
host
:
192.168.0.240:8762/api/datacollector
#
host: localhost:8110
#
host: 192.168.0.240:8762/api/datacollector
host
:
localhost:8110
security
:
authUser
:
root
authPwd
:
pwd
...
...
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