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
e5d34b2c
Commit
e5d34b2c
authored
Apr 02, 2020
by
chenweisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
b757bc91
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
130 additions
and
82 deletions
+130
-82
SimplePage.java
src/main/java/com/keymobile/rest/common/bean/SimplePage.java
+29
-0
ExcelController.java
...n/java/com/keymobile/rest/controller/ExcelController.java
+4
-5
TaskController.java
...in/java/com/keymobile/rest/controller/TaskController.java
+53
-49
UserController.java
...in/java/com/keymobile/rest/controller/UserController.java
+10
-11
Mission.java
src/main/java/com/keymobile/rest/vo/Mission.java
+19
-0
SimpleTask.java
src/main/java/com/keymobile/rest/vo/SimpleTask.java
+0
-2
application-test.yml
src/main/resources/application-test.yml
+15
-15
No files found.
src/main/java/com/keymobile/rest/common/bean/SimplePage.java
0 → 100644
View file @
e5d34b2c
package
com
.
keymobile
.
rest
.
common
.
bean
;
import
lombok.Builder
;
import
lombok.Data
;
import
org.springframework.data.domain.Page
;
import
java.util.List
;
@Data
@Builder
public
class
SimplePage
<
T
>
{
private
long
totalElements
;
private
long
totalPages
;
private
long
pageSize
;
private
long
pageNumber
;
private
List
<
T
>
content
;
public
static
<
T
>
SimplePage
of
(
Page
<
T
>
page
)
{
return
SimplePage
.
builder
()
.
content
((
List
<
Object
>)
page
.
getContent
())
.
pageNumber
(
page
.
getPageable
().
getPageNumber
())
.
pageSize
(
page
.
getPageable
().
getPageSize
())
.
totalElements
(
page
.
getTotalElements
())
.
totalPages
(
page
.
getTotalPages
())
.
build
();
}
}
src/main/java/com/keymobile/rest/controller/ExcelController.java
View file @
e5d34b2c
package
com
.
keymobile
.
rest
.
controller
;
package
com
.
keymobile
.
rest
.
controller
;
import
com.keymobile.rest.common.bean.ApiResponse
;
import
com.keymobile.rest.common.utils.DateUtil
;
import
com.keymobile.rest.common.utils.DateUtil
;
import
com.keymobile.rest.common.validator.CommonValidator
;
import
com.keymobile.rest.common.validator.CommonValidator
;
import
com.keymobile.rest.model.DataInfo
;
import
com.keymobile.rest.model.DataInfo
;
...
@@ -39,7 +38,7 @@ public class ExcelController {
...
@@ -39,7 +38,7 @@ public class ExcelController {
@ApiImplicitParam
(
name
=
"dataStr"
,
required
=
true
,
value
=
"当前数据字符"
,
dataType
=
"string"
,
paramType
=
"query"
)
@ApiImplicitParam
(
name
=
"dataStr"
,
required
=
true
,
value
=
"当前数据字符"
,
dataType
=
"string"
,
paramType
=
"query"
)
})
})
@PostMapping
(
value
=
"/excel/saveData"
)
@PostMapping
(
value
=
"/excel/saveData"
)
public
ApiResponse
saveTemplateData
(
String
taskId
,
long
excelId
,
String
dataStr
)
{
public
Object
saveTemplateData
(
String
taskId
,
long
excelId
,
String
dataStr
)
{
Task
task
=
taskService
.
createTaskQuery
().
taskId
(
taskId
).
singleResult
();
Task
task
=
taskService
.
createTaskQuery
().
taskId
(
taskId
).
singleResult
();
CommonValidator
.
notNull
(
task
,
"任务不存在"
);
CommonValidator
.
notNull
(
task
,
"任务不存在"
);
...
@@ -79,7 +78,7 @@ public class ExcelController {
...
@@ -79,7 +78,7 @@ public class ExcelController {
taskService
.
complete
(
task
.
getId
(),
vars
);
taskService
.
complete
(
task
.
getId
(),
vars
);
return
ApiResponse
.
ok
()
;
return
"成功"
;
}
}
@ApiOperation
(
value
=
"传excelId过来,获取用户填写的数据"
)
@ApiOperation
(
value
=
"传excelId过来,获取用户填写的数据"
)
...
@@ -87,8 +86,8 @@ public class ExcelController {
...
@@ -87,8 +86,8 @@ public class ExcelController {
@ApiImplicitParam
(
name
=
"excelId"
,
required
=
true
,
value
=
"当前模板id"
,
dataType
=
"long"
,
paramType
=
"query"
)
@ApiImplicitParam
(
name
=
"excelId"
,
required
=
true
,
value
=
"当前模板id"
,
dataType
=
"long"
,
paramType
=
"query"
)
)
)
@PostMapping
(
value
=
"/excel/getData"
)
@PostMapping
(
value
=
"/excel/getData"
)
public
ApiResponse
getRecordData
(
long
excelId
)
{
public
Object
getRecordData
(
long
excelId
)
{
return
ApiResponse
.
ok
()
;
return
"成功"
;
}
}
}
}
src/main/java/com/keymobile/rest/controller/TaskController.java
View file @
e5d34b2c
package
com
.
keymobile
.
rest
.
controller
;
package
com
.
keymobile
.
rest
.
controller
;
import
com.google.common.collect.ImmutableMap
;
import
com.google.common.collect.ImmutableMap
;
import
com.keymobile.rest.common.bean.
ApiRespons
e
;
import
com.keymobile.rest.common.bean.
SimplePag
e
;
import
com.keymobile.rest.common.utils.BeanUtils
;
import
com.keymobile.rest.common.utils.BeanUtils
;
import
com.keymobile.rest.common.utils.DateUtil
;
import
com.keymobile.rest.common.utils.DateUtil
;
import
com.keymobile.rest.common.validator.CommonValidator
;
import
com.keymobile.rest.common.validator.CommonValidator
;
import
com.keymobile.rest.controller.constant.TaskConstant
;
import
com.keymobile.rest.model.*
;
import
com.keymobile.rest.model.*
;
import
com.keymobile.rest.model.Process
;
import
com.keymobile.rest.model.Process
;
import
com.keymobile.rest.service.*
;
import
com.keymobile.rest.service.*
;
import
com.keymobile.rest.dto.ExcelForm
;
import
com.keymobile.rest.dto.ExcelForm
;
import
com.keymobile.rest.dto.TaskForm
;
import
com.keymobile.rest.dto.TaskForm
;
import
com.keymobile.rest.vo.Mission
;
import
com.keymobile.rest.vo.SimpleTask
;
import
com.keymobile.rest.vo.SimpleTask
;
import
io.swagger.annotations.*
;
import
io.swagger.annotations.*
;
import
org.activiti.engine.*
;
import
org.activiti.engine.*
;
...
@@ -26,7 +28,6 @@ import org.springframework.web.bind.annotation.*;
...
@@ -26,7 +28,6 @@ import org.springframework.web.bind.annotation.*;
import
java.util.*
;
import
java.util.*
;
import
static
com
.
keymobile
.
rest
.
controller
.
constant
.
TaskConstant
.*;
@Api
(
tags
=
"活动 控制器"
,
description
=
"Task Info"
)
@Api
(
tags
=
"活动 控制器"
,
description
=
"Task Info"
)
@RestController
@RestController
...
@@ -68,7 +69,7 @@ public class TaskController {
...
@@ -68,7 +69,7 @@ public class TaskController {
@ApiImplicitParam
(
name
=
"name"
,
value
=
"活动名称"
,
paramType
=
"query"
,
dataType
=
"string"
)
@ApiImplicitParam
(
name
=
"name"
,
value
=
"活动名称"
,
paramType
=
"query"
,
dataType
=
"string"
)
})
})
@PostMapping
(
value
=
"/task/list"
)
@PostMapping
(
value
=
"/task/list"
)
public
ApiRespons
e
getTaskList
(
int
pageNo
,
int
pageSize
,
String
name
)
{
public
SimplePag
e
getTaskList
(
int
pageNo
,
int
pageSize
,
String
name
)
{
Page
<
Activity
>
taskList
;
Page
<
Activity
>
taskList
;
String
orderBy
=
"descending"
;
//
String
orderBy
=
"descending"
;
//
String
propBy
=
"id"
;
// groupBy
String
propBy
=
"id"
;
// groupBy
...
@@ -77,7 +78,7 @@ public class TaskController {
...
@@ -77,7 +78,7 @@ public class TaskController {
}
else
{
}
else
{
taskList
=
activityService
.
findAll
(
pageNo
,
pageSize
,
orderBy
,
propBy
);
taskList
=
activityService
.
findAll
(
pageNo
,
pageSize
,
orderBy
,
propBy
);
}
}
return
ApiResponse
.
ok
(
ImmutableMap
.
of
(
"list"
,
SimpleTask
.
convert
(
taskList
.
getContent
()),
"total"
,
taskList
.
getTotalElements
())
);
return
SimplePage
.
of
(
taskList
);
}
}
@ApiOperation
(
value
=
"单个活动详情"
)
@ApiOperation
(
value
=
"单个活动详情"
)
...
@@ -85,10 +86,10 @@ public class TaskController {
...
@@ -85,10 +86,10 @@ public class TaskController {
@ApiImplicitParam
(
name
=
"taskId"
,
value
=
"活动id"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"long"
)
@ApiImplicitParam
(
name
=
"taskId"
,
value
=
"活动id"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"long"
)
})
})
@PostMapping
(
value
=
"/task/get"
)
@PostMapping
(
value
=
"/task/get"
)
public
ApiResponse
get
(
long
taskId
)
{
public
SimpleTask
get
(
long
taskId
)
{
Activity
activity
=
activityService
.
get
(
taskId
);
Activity
activity
=
activityService
.
get
(
taskId
);
CommonValidator
.
notNull
(
activity
,
"活动不存在"
);
CommonValidator
.
notNull
(
activity
,
"活动不存在"
);
return
ApiResponse
.
ok
(
SimpleTask
.
convert
(
activity
)
);
return
SimpleTask
.
convert
(
activity
);
}
}
@ApiOperation
(
value
=
"我的任务"
,
notes
=
"任务列表"
)
@ApiOperation
(
value
=
"我的任务"
,
notes
=
"任务列表"
)
...
@@ -96,16 +97,16 @@ public class TaskController {
...
@@ -96,16 +97,16 @@ public class TaskController {
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户id"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"long"
,
defaultValue
=
"3"
)
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户id"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"long"
,
defaultValue
=
"3"
)
})
})
@PostMapping
(
value
=
"/task/getMyTasks"
)
@PostMapping
(
value
=
"/task/getMyTasks"
)
public
ApiResponse
getMyMissions
(
long
userId
)
{
public
List
<
Mission
>
getMyMissions
(
long
userId
)
{
Map
user
=
feignAuthService
.
getUserById
(
userId
);
Map
user
=
feignAuthService
.
getUserById
(
userId
);
CommonValidator
.
notNull
(
user
,
"用户不存在"
);
CommonValidator
.
notNull
(
user
,
"用户不存在"
);
String
username
=
user
.
get
(
"name"
).
toString
();
String
username
=
user
.
get
(
"name"
).
toString
();
List
<
M
ap
>
missions
=
new
ArrayList
<>();
List
<
M
ission
>
missions
=
new
ArrayList
<>();
// 获取个人任务
// 获取个人任务
List
<
Task
>
tasks
=
taskService
.
createTaskQuery
().
taskAssigneeLike
(
"%"
+
username
+
"%"
).
active
().
list
();
List
<
Task
>
tasks
=
taskService
.
createTaskQuery
().
taskAssigneeLike
(
"%"
+
username
+
"%"
).
active
().
list
();
tasks
.
forEach
(
task
->
{
tasks
.
forEach
(
task
->
{
missions
.
add
(
convert
(
task
,
ImmutableMap
.
of
(
"username"
,
username
,
"type"
,
TASK_TYPE_PERSONAL
)));
missions
.
add
(
convert
(
task
,
ImmutableMap
.
of
(
"username"
,
username
,
"type"
,
T
askConstant
.
T
ASK_TYPE_PERSONAL
)));
});
});
// 获取组任务
// 获取组任务
...
@@ -122,20 +123,20 @@ public class TaskController {
...
@@ -122,20 +123,20 @@ public class TaskController {
// 组id
// 组id
String
groupId
=
"id:"
+
templateId
;
String
groupId
=
"id:"
+
templateId
;
if
(
groupId
.
equals
(
identityLink
.
getGroupId
()))
{
if
(
groupId
.
equals
(
identityLink
.
getGroupId
()))
{
missions
.
add
(
convert
(
groupTask
,
ImmutableMap
.
of
(
"username"
,
username
,
"type"
,
TASK_TYPE_GROUP
,
"templateId"
,
templateId
)));
missions
.
add
(
convert
(
groupTask
,
ImmutableMap
.
of
(
"username"
,
username
,
"type"
,
T
askConstant
.
T
ASK_TYPE_GROUP
,
"templateId"
,
templateId
)));
}
}
});
});
}
}
});
});
}
}
});
});
return
ApiResponse
.
ok
(
missions
)
;
return
missions
;
}
}
@ApiOperation
(
value
=
"新建活动"
)
@ApiOperation
(
value
=
"新建活动"
)
@PostMapping
(
value
=
"/task/create"
)
@PostMapping
(
value
=
"/task/create"
)
public
ApiResponse
createTask
(
@RequestBody
TaskForm
form
)
{
public
Object
createTask
(
@RequestBody
TaskForm
form
)
{
CommonValidator
.
notEmpty
(
form
.
getName
(),
"名称不能为空"
);
CommonValidator
.
notEmpty
(
form
.
getName
(),
"名称不能为空"
);
CommonValidator
.
notNull
(
form
.
getType
(),
"类型不能为空"
);
CommonValidator
.
notNull
(
form
.
getType
(),
"类型不能为空"
);
CommonValidator
.
isTrue
(
form
.
getExcels
()
!=
null
&&
form
.
getExcels
().
size
()
!=
0
,
"补录模板不能为空"
);
CommonValidator
.
isTrue
(
form
.
getExcels
()
!=
null
&&
form
.
getExcels
().
size
()
!=
0
,
"补录模板不能为空"
);
...
@@ -182,13 +183,13 @@ public class TaskController {
...
@@ -182,13 +183,13 @@ public class TaskController {
userTemplateMapperService
.
save
(
mapper
);
userTemplateMapperService
.
save
(
mapper
);
});
});
});
});
return
ApiResponse
.
ok
(
finalActivity
.
getId
()
);
return
finalActivity
.
getId
(
);
}
}
@ApiOperation
(
value
=
"修改活动"
)
@ApiOperation
(
value
=
"修改活动"
)
@PostMapping
(
value
=
"/task/update"
)
@PostMapping
(
value
=
"/task/update"
)
public
ApiResponse
updateTask
(
@RequestBody
TaskForm
form
)
{
public
Object
updateTask
(
@RequestBody
TaskForm
form
)
{
return
ApiResponse
.
ok
()
;
return
"修改成功"
;
}
}
@ApiOperation
(
value
=
"发起活动"
)
@ApiOperation
(
value
=
"发起活动"
)
...
@@ -196,7 +197,7 @@ public class TaskController {
...
@@ -196,7 +197,7 @@ public class TaskController {
@ApiImplicitParam
(
name
=
"taskId"
,
value
=
"活动id"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"long"
)
@ApiImplicitParam
(
name
=
"taskId"
,
value
=
"活动id"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"long"
)
})
})
@PostMapping
(
value
=
"/task/start"
)
@PostMapping
(
value
=
"/task/start"
)
public
ApiResponse
runTask
(
long
taskId
)
{
public
Object
runTask
(
long
taskId
)
{
Activity
activity
=
activityService
.
get
(
taskId
);
Activity
activity
=
activityService
.
get
(
taskId
);
CommonValidator
.
notNull
(
activity
,
"活动不存在"
);
CommonValidator
.
notNull
(
activity
,
"活动不存在"
);
CommonValidator
.
isTrue
(
activity
.
getStatus
()
==
Activity
.
STATUS_WAIT
,
"活动正在运行,不能重复启动"
);
CommonValidator
.
isTrue
(
activity
.
getStatus
()
==
Activity
.
STATUS_WAIT
,
"活动正在运行,不能重复启动"
);
...
@@ -238,7 +239,7 @@ public class TaskController {
...
@@ -238,7 +239,7 @@ public class TaskController {
activity
.
setStatus
(
Activity
.
STATUS_BEGIN
);
activity
.
setStatus
(
Activity
.
STATUS_BEGIN
);
activityService
.
save
(
activity
);
activityService
.
save
(
activity
);
return
ApiResponse
.
ok
()
;
return
"启动成功"
;
}
}
...
@@ -247,7 +248,7 @@ public class TaskController {
...
@@ -247,7 +248,7 @@ public class TaskController {
@ApiImplicitParam
(
name
=
"taskId"
,
value
=
"活动id"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"long"
)
@ApiImplicitParam
(
name
=
"taskId"
,
value
=
"活动id"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"long"
)
})
})
@PostMapping
(
value
=
"/task/pass"
)
@PostMapping
(
value
=
"/task/pass"
)
public
ApiResponse
passTask
(
long
taskId
)
{
public
Object
passTask
(
long
taskId
)
{
Activity
activity
=
activityService
.
get
(
taskId
);
Activity
activity
=
activityService
.
get
(
taskId
);
// 完结活动, 流程跑完
// 完结活动, 流程跑完
// User judge = userService.getAudit();
// User judge = userService.getAudit();
...
@@ -258,13 +259,13 @@ public class TaskController {
...
@@ -258,13 +259,13 @@ public class TaskController {
// taskService.complete(task.getId(), ImmutableMap.of("pass", "true"));
// taskService.complete(task.getId(), ImmutableMap.of("pass", "true"));
// assignment.setStatus(Assignment.STATUS_COMPLETED);
// assignment.setStatus(Assignment.STATUS_COMPLETED);
// activityService.update(activity);
// activityService.update(activity);
return
ApiResponse
.
ok
()
;
return
"审核通过成功"
;
}
}
@ApiOperation
(
value
=
"审核驳回活动"
)
@ApiOperation
(
value
=
"审核驳回活动"
)
@PostMapping
(
value
=
"/task/reject"
)
@PostMapping
(
value
=
"/task/reject"
)
public
ApiResponse
rejectTask
(
@RequestParam
Long
taskId
)
{
public
Object
rejectTask
(
@RequestParam
Long
taskId
)
{
Activity
activity
=
activityService
.
get
(
taskId
);
Activity
activity
=
activityService
.
get
(
taskId
);
// 完结活动, 流程跑完
// 完结活动, 流程跑完
// User judge = userService.getAudit();
// User judge = userService.getAudit();
...
@@ -273,13 +274,13 @@ public class TaskController {
...
@@ -273,13 +274,13 @@ public class TaskController {
// TwinkleValidator.notLessThan(taskList.size(), 1, "启动失败");
// TwinkleValidator.notLessThan(taskList.size(), 1, "启动失败");
// Task task = taskList.get(0);
// Task task = taskList.get(0);
// taskService.complete(task.getId(), ImmutableMap.of("pass", "false"));
// taskService.complete(task.getId(), ImmutableMap.of("pass", "false"));
return
ApiResponse
.
ok
()
;
return
"审核驳回成功"
;
}
}
@ApiOperation
(
value
=
"查看当前活动进程列表"
,
hidden
=
true
)
@ApiOperation
(
value
=
"查看当前活动进程列表"
,
hidden
=
true
)
@PostMapping
(
value
=
"/task/progress"
)
@PostMapping
(
value
=
"/task/progress"
)
public
ApiResponse
viewTasksProgress
()
{
public
Object
viewTasksProgress
()
{
return
ApiResponse
.
ok
()
;
return
""
;
}
}
...
@@ -288,23 +289,24 @@ public class TaskController {
...
@@ -288,23 +289,24 @@ public class TaskController {
@ApiImplicitParam
(
name
=
"taskId"
,
value
=
"活动id"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"long"
)
@ApiImplicitParam
(
name
=
"taskId"
,
value
=
"活动id"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"long"
)
})
})
@PostMapping
(
value
=
"/task/progress/{taskId}"
)
@PostMapping
(
value
=
"/task/progress/{taskId}"
)
public
ApiResponse
viewTaskProgress
(
@PathVariable
long
taskId
)
{
public
Object
viewTaskProgress
(
@PathVariable
long
taskId
)
{
return
ApiResponse
.
ok
()
;
return
""
;
}
}
public
Mission
convert
(
Task
task
,
Map
<
String
,
Object
>
params
)
{
public
Map
<
String
,
Object
>
convert
(
Task
task
,
Map
<
String
,
Object
>
params
)
{
Mission
.
MissionBuilder
builder
=
Mission
.
builder
();
Map
<
String
,
Object
>
mission
=
new
HashMap
<>();
int
type
=
Integer
.
parseInt
(
params
.
get
(
"type"
).
toString
());
mission
.
put
(
"id"
,
task
.
getId
());
builder
.
id
(
task
.
getId
())
mission
.
put
(
"user"
,
params
.
get
(
"username"
).
toString
());
.
user
(
params
.
get
(
"username"
).
toString
())
int
type
=
Integer
.
valueOf
(
params
.
get
(
"type"
).
toString
());
.
taskType
(
type
)
mission
.
put
(
"taskType"
,
type
);
.
createAt
(
DateUtil
.
formatDateTime
(
task
.
getCreateTime
()));
mission
.
put
(
"createAt"
,
DateUtil
.
formatDateTime
(
task
.
getCreateTime
()));
int
missionType
=
0
;
if
(
task
.
getTaskDefinitionKey
().
toLowerCase
().
equals
(
MISSION_LOW_CASE_KEY_DATA_ENTER
))
{
String
mission
=
""
;
mission
.
put
(
"missionType"
,
MISSION_TYPE_DATA_ENTER
);
if
(
task
.
getTaskDefinitionKey
().
toLowerCase
().
equals
(
TaskConstant
.
MISSION_LOW_CASE_KEY_DATA_ENTER
))
{
mission
.
put
(
"mission"
,
MISSION_TEXT_DATA_ENTER
);
missionType
=
TaskConstant
.
MISSION_TYPE_DATA_ENTER
;
mission
=
TaskConstant
.
MISSION_TEXT_DATA_ENTER
;
long
templateId
=
0
;
long
templateId
=
0
;
if
(
type
==
TASK_TYPE_PERSONAL
)
{
if
(
type
==
T
askConstant
.
T
ASK_TYPE_PERSONAL
)
{
String
assignee
=
task
.
getAssignee
();
String
assignee
=
task
.
getAssignee
();
String
[]
array
=
assignee
.
split
(
":"
);
String
[]
array
=
assignee
.
split
(
":"
);
try
{
try
{
...
@@ -312,21 +314,23 @@ public class TaskController {
...
@@ -312,21 +314,23 @@ public class TaskController {
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
}
}
}
else
if
(
type
==
TASK_TYPE_GROUP
)
{
}
else
if
(
type
==
T
askConstant
.
T
ASK_TYPE_GROUP
)
{
templateId
=
Long
.
parseLong
(
params
.
get
(
"templateId"
).
toString
());
templateId
=
Long
.
parseLong
(
params
.
get
(
"templateId"
).
toString
());
}
}
mission
.
put
(
"excelId"
,
templateId
);
builder
.
excelId
(
templateId
);
}
else
if
(
task
.
getTaskDefinitionKey
().
toLowerCase
().
equals
(
MISSION_LOW_CASE_KEY__DATA_AUDIT
))
{
}
else
if
(
task
.
getTaskDefinitionKey
().
toLowerCase
().
equals
(
TaskConstant
.
MISSION_LOW_CASE_KEY__DATA_AUDIT
))
{
mission
.
put
(
"missionType"
,
MISSION_TYPE_DATA_AUDIT
)
;
mission
Type
=
TaskConstant
.
MISSION_TYPE_DATA_AUDIT
;
mission
.
put
(
"mission"
,
MISSION_TEXT_DATA_AUDIT
)
;
mission
=
TaskConstant
.
MISSION_TEXT_DATA_AUDIT
;
}
else
if
(
task
.
getTaskDefinitionKey
().
toLowerCase
().
equals
(
MISSION_LOW_CASE_KEY__MANAGER_AUDIT
))
{
}
else
if
(
task
.
getTaskDefinitionKey
().
toLowerCase
().
equals
(
TaskConstant
.
MISSION_LOW_CASE_KEY__MANAGER_AUDIT
))
{
mission
.
put
(
"missionType"
,
MISSION_TYPE_MANAGER_AUDIT
)
;
mission
Type
=
TaskConstant
.
MISSION_TYPE_MANAGER_AUDIT
;
mission
.
put
(
"mission"
,
MISSION_TEXT_MANAGER_AUDIT
)
;
mission
=
TaskConstant
.
MISSION_TEXT_MANAGER_AUDIT
;
}
else
if
(
task
.
getTaskDefinitionKey
().
toLowerCase
().
equals
(
MISSION_LOW_CASE_KEY__DATA_BACK_FLOW
)
||
}
else
if
(
task
.
getTaskDefinitionKey
().
toLowerCase
().
equals
(
TaskConstant
.
MISSION_LOW_CASE_KEY__DATA_BACK_FLOW
)
||
task
.
getTaskDefinitionKey
().
toLowerCase
().
equals
(
"_26"
))
{
task
.
getTaskDefinitionKey
().
toLowerCase
().
equals
(
"_26"
))
{
mission
.
put
(
"missionType"
,
MISSION_TYPE_DATA_BACK_FLOW
)
;
mission
Type
=
TaskConstant
.
MISSION_TYPE_DATA_BACK_FLOW
;
mission
.
put
(
"mission"
,
MISSION_TEXT_DATA_BACK_FLOW
)
;
mission
=
TaskConstant
.
MISSION_TEXT_DATA_BACK_FLOW
;
}
}
return
mission
;
builder
.
mission
(
mission
)
.
missionType
(
missionType
);
return
builder
.
build
();
}
}
}
}
src/main/java/com/keymobile/rest/controller/UserController.java
View file @
e5d34b2c
package
com
.
keymobile
.
rest
.
controller
;
package
com
.
keymobile
.
rest
.
controller
;
import
com.google.common.collect.ImmutableMap
;
import
com.google.common.collect.ImmutableMap
;
import
com.keymobile.rest.common.bean.ApiResponse
;
import
com.keymobile.rest.service.*
;
import
com.keymobile.rest.service.*
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
...
@@ -21,8 +20,8 @@ public class UserController {
...
@@ -21,8 +20,8 @@ public class UserController {
@ApiOperation
(
value
=
"获取组织树"
,
hidden
=
true
)
@ApiOperation
(
value
=
"获取组织树"
,
hidden
=
true
)
@GetMapping
(
value
=
"/orgs"
)
@GetMapping
(
value
=
"/orgs"
)
public
ApiResponse
getOrgs
()
{
public
Object
getOrgs
()
{
return
ApiResponse
.
ok
(
feignAuthService
.
getOrgs
()
);
return
feignAuthService
.
getOrgs
(
);
}
}
...
@@ -31,9 +30,9 @@ public class UserController {
...
@@ -31,9 +30,9 @@ public class UserController {
@ApiImplicitParam
(
name
=
"orgId"
,
value
=
"机构id"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"long"
)
@ApiImplicitParam
(
name
=
"orgId"
,
value
=
"机构id"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"long"
)
})
})
@GetMapping
(
value
=
"/org/users"
)
@GetMapping
(
value
=
"/org/users"
)
public
ApiResponse
getOrgUsers
(
long
orgId
)
{
public
List
<
Map
>
getOrgUsers
(
long
orgId
)
{
List
<
Map
>
users
=
feignAuthService
.
getUsersByOrgId
(
orgId
);
List
<
Map
>
users
=
feignAuthService
.
getUsersByOrgId
(
orgId
);
return
ApiResponse
.
ok
(
users
)
;
return
users
;
}
}
@ApiOperation
(
value
=
"根据组织id获取用户组"
,
hidden
=
true
)
@ApiOperation
(
value
=
"根据组织id获取用户组"
,
hidden
=
true
)
...
@@ -41,9 +40,9 @@ public class UserController {
...
@@ -41,9 +40,9 @@ public class UserController {
@ApiImplicitParam
(
name
=
"orgId"
,
value
=
"机构id"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"long"
)
@ApiImplicitParam
(
name
=
"orgId"
,
value
=
"机构id"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"long"
)
})
})
@GetMapping
(
value
=
"/groups"
)
@GetMapping
(
value
=
"/groups"
)
public
ApiResponse
getUserGroups
(
long
orgId
)
{
public
List
<
Map
>
getUserGroups
(
long
orgId
)
{
List
<
Map
>
userGroups
=
feignAuthService
.
getUserGroups
(
0
,
orgId
);
List
<
Map
>
userGroups
=
feignAuthService
.
getUserGroups
(
0
,
orgId
);
return
ApiResponse
.
ok
(
userGroups
)
;
return
userGroups
;
}
}
@ApiOperation
(
value
=
"根据用户组id获取用户"
,
hidden
=
true
)
@ApiOperation
(
value
=
"根据用户组id获取用户"
,
hidden
=
true
)
...
@@ -51,14 +50,14 @@ public class UserController {
...
@@ -51,14 +50,14 @@ public class UserController {
@ApiImplicitParam
(
name
=
"userGroupId"
,
value
=
"用户组id"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"long"
)
@ApiImplicitParam
(
name
=
"userGroupId"
,
value
=
"用户组id"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"long"
)
})
})
@GetMapping
(
value
=
"/group/users"
)
@GetMapping
(
value
=
"/group/users"
)
public
ApiResponse
getGroupUsers
(
long
userGroupId
)
{
public
List
<
Map
>
getGroupUsers
(
long
userGroupId
)
{
List
<
Map
>
users
=
feignAuthService
.
getGroupUsers
(
0
,
userGroupId
);
List
<
Map
>
users
=
feignAuthService
.
getGroupUsers
(
0
,
userGroupId
);
return
ApiResponse
.
ok
(
users
)
;
return
users
;
}
}
@ApiOperation
(
value
=
"获取补录范围用户树"
)
@ApiOperation
(
value
=
"获取补录范围用户树"
)
@GetMapping
(
value
=
"/users"
)
@GetMapping
(
value
=
"/users"
)
public
ApiResponse
getUsers
()
{
public
Map
getUsers
()
{
Map
tree
=
(
Map
)
feignAuthService
.
getOrgs
();
Map
tree
=
(
Map
)
feignAuthService
.
getOrgs
();
List
<
Map
>
subNodes
=
(
List
<
Map
>)
tree
.
get
(
"subNodes"
);
List
<
Map
>
subNodes
=
(
List
<
Map
>)
tree
.
get
(
"subNodes"
);
List
<
Map
>
orgs
=
(
List
<
Map
>)
subNodes
.
get
(
0
).
get
(
"subNodes"
);
List
<
Map
>
orgs
=
(
List
<
Map
>)
subNodes
.
get
(
0
).
get
(
"subNodes"
);
...
@@ -77,7 +76,7 @@ public class UserController {
...
@@ -77,7 +76,7 @@ public class UserController {
});
});
org
.
put
(
"subNodes"
,
groups
);
org
.
put
(
"subNodes"
,
groups
);
});
});
return
ApiResponse
.
ok
(
tree
)
;
return
tree
;
}
}
}
}
src/main/java/com/keymobile/rest/vo/Mission.java
0 → 100644
View file @
e5d34b2c
package
com
.
keymobile
.
rest
.
vo
;
import
lombok.Builder
;
import
lombok.Data
;
@Data
@Builder
public
class
Mission
{
private
String
id
;
private
String
user
;
private
int
taskType
;
private
String
createAt
;
private
int
missionType
;
private
String
mission
;
private
long
excelId
;
}
src/main/java/com/keymobile/rest/vo/SimpleTask.java
View file @
e5d34b2c
...
@@ -40,7 +40,6 @@ public class SimpleTask {
...
@@ -40,7 +40,6 @@ public class SimpleTask {
task
=
BeanUtils
.
convertTo
(
activity
,
task
);
task
=
BeanUtils
.
convertTo
(
activity
,
task
);
task
.
setExcelList
(
simpleTemplateList
);
task
.
setExcelList
(
simpleTemplateList
);
return
task
;
return
task
;
}
}
public
static
List
<
SimpleTask
>
convert
(
List
<
Activity
>
activityList
)
{
public
static
List
<
SimpleTask
>
convert
(
List
<
Activity
>
activityList
)
{
...
@@ -50,7 +49,6 @@ public class SimpleTask {
...
@@ -50,7 +49,6 @@ public class SimpleTask {
simpleTaskList
.
add
(
simpleTask
);
simpleTaskList
.
add
(
simpleTask
);
});
});
return
simpleTaskList
;
return
simpleTaskList
;
}
}
}
}
src/main/resources/application-test.yml
View file @
e5d34b2c
...
@@ -9,8 +9,8 @@ eureka:
...
@@ -9,8 +9,8 @@ eureka:
enabled
:
true
enabled
:
true
instance
:
instance
:
prefer-ip-address
:
false
prefer-ip-address
:
false
#
hostname: 192.168.0.48
hostname
:
192.168.0.48
hostname
:
192.168.0.68
#
hostname: 192.168.0.68
hystrix
:
hystrix
:
command
:
command
:
default
:
default
:
...
@@ -28,12 +28,12 @@ spring:
...
@@ -28,12 +28,12 @@ spring:
hibernate
:
hibernate
:
ddl-auto
:
update
ddl-auto
:
update
datasource
:
datasource
:
#
url: jdbc:mysql://192.168.0.192:3306/cmb_dev?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=GMT%2B8
url
:
jdbc:mysql://192.168.0.192:3306/cmb_dev?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=GMT%2B8
#
username: test
username
:
test
#
password: test
password
:
test
url
:
jdbc:mysql://47.105.193.165:3306/dev0?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=GMT%2B8
#
url: jdbc:mysql://47.105.193.165:3306/dev0?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=GMT%2B8
username
:
root
#
username: root
password
:
123456
#
password: 123456
hikari
:
hikari
:
maximum-pool-size
:
3
maximum-pool-size
:
3
servlet
:
servlet
:
...
@@ -41,8 +41,8 @@ spring:
...
@@ -41,8 +41,8 @@ spring:
max-file-size
:
20Mb
max-file-size
:
20Mb
max-request-size
:
100Mb
max-request-size
:
100Mb
redis
:
redis
:
#
host: 192.168.0.192
host
:
192.168.0.192
host
:
127.0.0.1
#
host: 127.0.0.1
port
:
6379
port
:
6379
session
:
session
:
store-type
:
redis
store-type
:
redis
...
@@ -57,10 +57,10 @@ app:
...
@@ -57,10 +57,10 @@ app:
active-process
:
MoreSubProcessStandard.bpmn
active-process
:
MoreSubProcessStandard.bpmn
swagger2
:
swagger2
:
#
host: 192.168.0.240:8762/api/datacollector
host
:
192.168.0.240:8762/api/datacollector
host
:
localhost:8110
#
host: localhost:8110
security
:
security
:
authUser
:
root
authUser
:
root
authPwd
:
pwd
authPwd
:
pwd
# permit: false
permit
:
false
permit
:
true
# permit: true
\ No newline at end of file
\ No newline at end of file
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