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
3bb57e2e
Commit
3bb57e2e
authored
Mar 21, 2020
by
chenweisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
f5f800cb
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
91 additions
and
36 deletions
+91
-36
pom.xml
pom.xml
+4
-4
ExcelController.java
...n/java/com/keymobile/rest/controller/ExcelController.java
+1
-3
SubProcessCtrl.java
...in/java/com/keymobile/rest/controller/SubProcessCtrl.java
+2
-2
TaskController.java
...in/java/com/keymobile/rest/controller/TaskController.java
+45
-11
UserController.java
...in/java/com/keymobile/rest/controller/UserController.java
+23
-10
RecordScope.java
src/main/java/com/keymobile/rest/model/RecordScope.java
+1
-1
RecordScopeService.java
...n/java/com/keymobile/rest/service/RecordScopeService.java
+6
-1
UserService.java
src/main/java/com/keymobile/rest/service/UserService.java
+4
-0
application-test.yml
src/main/resources/application-test.yml
+5
-4
No files found.
pom.xml
View file @
3bb57e2e
...
...
@@ -28,10 +28,10 @@
<!-- <groupId>org.springframework.boot</groupId>-->
<!-- <artifactId>spring-boot-starter-data-mongodb</artifactId>-->
<!-- </dependency>-->
<dependency
>
<groupId>
org.springframework.cloud
</groupId
>
<artifactId>
spring-cloud-starter-netflix-eureka-client
</artifactId
>
</dependency
>
<!-- <dependency>--
>
<!-- <groupId>org.springframework.cloud</groupId>--
>
<!-- <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>--
>
<!-- </dependency>--
>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
...
...
src/main/java/com/keymobile/rest/controller/ExcelController.java
View file @
3bb57e2e
...
...
@@ -11,13 +11,11 @@ import org.activiti.engine.*;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
@Api
(
value
=
"模板
控制器"
)
@Api
(
description
=
"模板
控制器"
)
@RestController
@RequestMapping
(
path
=
"/api"
)
public
class
ExcelController
{
// @Autowired
// private RecordDataService recordDataService;
@Autowired
private
TemplateService
templateService
;
@Autowired
...
...
src/main/java/com/keymobile/rest/controller/SubProcessCtrl.java
View file @
3bb57e2e
...
...
@@ -24,8 +24,8 @@ import org.springframework.web.multipart.MultipartFile;
import
java.util.*
;
@RestController
@RequestMapping
(
path
=
"/rest/subprocess"
)
//
@RestController
//
@RequestMapping(path = "/rest/subprocess")
public
class
SubProcessCtrl
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
SubProcessCtrl
.
class
);
@Autowired
...
...
src/main/java/com/keymobile/rest/controller/TaskController.java
View file @
3bb57e2e
...
...
@@ -13,9 +13,7 @@ import com.keymobile.rest.service.ActivityService;
import
com.keymobile.rest.service.UserService
;
import
com.keymobile.rest.vo.ExcelForm
;
import
com.keymobile.rest.vo.JobForm
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.*
;
import
org.activiti.engine.*
;
import
org.activiti.engine.repository.Deployment
;
import
org.activiti.engine.repository.ProcessDefinition
;
...
...
@@ -29,15 +27,14 @@ import org.springframework.web.bind.annotation.*;
import
java.util.*
;
import
java.util.stream.Collectors
;
@Api
(
description
=
"活动 控制器"
)
@RestController
@RequestMapping
(
path
=
"/api/task"
)
@Api
(
value
=
"活动控制器"
)
public
class
TaskController
{
// 默认启动的固化流程
@Value
(
"${app.active-process}"
)
private
String
process
;
@Autowired
private
ManagementService
managementService
;
@Autowired
...
...
@@ -57,8 +54,13 @@ public class TaskController {
@ApiOperation
(
value
=
"获取首页活动列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"pageNo"
,
value
=
"当前页"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
,
defaultValue
=
"1"
),
@ApiImplicitParam
(
name
=
"pageSize"
,
value
=
"当前页条数"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
,
defaultValue
=
"10"
),
@ApiImplicitParam
(
name
=
"name"
,
value
=
"活动名称"
,
paramType
=
"query"
,
dataType
=
"string"
)
})
@PostMapping
(
value
=
"/list"
)
public
ApiResponse
getTaskList
(
@RequestParam
Integer
pageNo
,
@RequestParam
Integer
pageSize
,
@RequestParam
(
required
=
false
)
@ApiParam
(
name
=
"name"
,
value
=
"活动名称"
)
String
name
)
{
public
ApiResponse
getTaskList
(
int
pageNo
,
int
pageSize
,
String
name
)
{
Page
<
Activity
>
taskList
;
String
orderBy
=
"descending"
;
//
String
propBy
=
"id"
;
// groupBy
...
...
@@ -70,20 +72,52 @@ public class TaskController {
return
ApiResponse
.
ok
(
ImmutableMap
.
of
(
"list"
,
taskList
.
getContent
(),
"total"
,
taskList
.
getTotalElements
()));
}
@ApiOperation
(
value
=
"查看活动"
)
@ApiOperation
(
value
=
"单个活动详情"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"taskId"
,
value
=
"活动id"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"long"
)
})
@PostMapping
(
value
=
"/get"
)
public
ApiResponse
get
(
@RequestParam
@ApiParam
(
required
=
true
,
name
=
"taskId"
,
value
=
"活动id"
)
L
ong
taskId
)
{
public
ApiResponse
get
(
l
ong
taskId
)
{
Activity
activity
=
activityService
.
get
(
taskId
);
TwinkleValidator
.
notNull
(
activity
,
"活动不存在"
);
return
ApiResponse
.
ok
(
activity
);
}
@ApiOperation
(
value
=
"我的任务"
,
notes
=
"补录任务列表及审核任务列表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户id"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"long"
)
})
@PostMapping
(
value
=
"/getMyMissions"
)
public
ApiResponse
getMyMissions
(
long
userId
)
{
User
user
=
userService
.
findById
(
userId
);
TwinkleValidator
.
notNull
(
user
,
"用户不存在"
);
List
<
Activity
>
activityList
=
new
ArrayList
<>();
// 获取任务
// List<Task> tasks = taskService.createNativeTaskQuery()
// .sql("SELECT * FROM " + managementService.getTableName(Task.class) + " T WHERE T.ASSIGNEE_ = #{assignee1} OR T.ASSIGNEE_ = #{assignee2}")
// .parameter("assignee1", user.getUsername()).parameter("assignee2", audit.getUsername())
// .list();
// for (Task task : tasks) {
// String processId = task.getProcessInstanceId();
// Activity activity = assignmentService.findByProcessId(processId);
// if (assignment != null && assignment.getStatus() != Assignment.STATUS_COMPLETED) {
// if (task.getTaskDefinitionKey().equals("addData")) {
// assignment.setKind(Assignment.KIND_RECORD);
// } else {
// assignment.setKind(Assignment.KIND_AUDIT);
// }
// activityList.add(activity);
// }
// }
return
ApiResponse
.
ok
();
}
@ApiOperation
(
value
=
"补录任务列表及审核任务列表"
)
@ApiOperation
(
value
=
"
我的任务"
,
notes
=
"
补录任务列表及审核任务列表"
)
@PostMapping
(
value
=
"/getMyTasks"
)
public
ApiResponse
getMyTasks
()
{
// User user = userService.getNormalUser();
// User audit = userService.getAudit();
List
<
Activity
>
activityList
=
new
ArrayList
<>();
// 获取任务
// List<Task> tasks = taskService.createNativeTaskQuery()
...
...
src/main/java/com/keymobile/rest/controller/UserController.java
View file @
3bb57e2e
package
com
.
keymobile
.
rest
.
controller
;
import
com.keymobile.rest.common.bean.ApiResponse
;
import
com.keymobile.rest.common.validator.TwinkleValidator
;
import
com.keymobile.rest.model.*
;
import
com.keymobile.rest.service.*
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.*
;
@Api
(
value
=
"用户/机构/补录范围 控制器"
)
@Api
(
description
=
"用户/机构/补录范围 控制器"
)
@RestController
@RequestMapping
(
path
=
"/api"
)
public
class
UserController
{
...
...
@@ -27,7 +30,7 @@ public class UserController {
root
.
setId
(
Group
.
ROOT_ID
);
root
.
setName
(
Group
.
ROOT_NAME
);
root
.
setParentId
(
Group
.
ROOT_PARENT_ID
);
root
.
set
ParentId
(
Group
.
ROOT_LEVEL
);
root
.
set
Level
(
Group
.
ROOT_LEVEL
);
}
@ApiOperation
(
value
=
"获取补录人员列表"
)
...
...
@@ -39,19 +42,29 @@ public class UserController {
@ApiOperation
(
value
=
"获取补录范围列表"
)
@PostMapping
(
value
=
"/scope/list"
)
public
ApiResponse
get
Extent
List
()
{
public
ApiResponse
get
Scope
List
()
{
List
<
RecordScope
>
recordScopeList
=
recordScopeService
.
findAll
();
return
ApiResponse
.
ok
(
recordScopeList
);
}
// @ApiOperation(value = "补录范围绑定人员")
// @PostMapping(value = "/scope/bindUser")
// public ApiResponse getExtentList() {
// List<RecordScope> recordScopeList = recordScopeService.findAll();
// return ApiResponse.ok(recordScopeList);
// }
@ApiOperation
(
value
=
"补录范围绑定人员"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"scopeId"
,
value
=
"补录范围id"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"long"
),
@ApiImplicitParam
(
name
=
"userId"
,
value
=
"用户id"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"long"
)
})
@PostMapping
(
value
=
"/scope/bindUser"
)
public
ApiResponse
bindUser
(
long
scopeId
,
long
userId
)
{
RecordScope
scope
=
recordScopeService
.
findById
(
scopeId
);
TwinkleValidator
.
notNull
(
scope
,
"所选范围不存在"
);
User
user
=
userService
.
findById
(
userId
);
TwinkleValidator
.
notNull
(
user
,
"所选用户不存在"
);
TwinkleValidator
.
isTrue
(
scope
.
getGroup
().
getId
()
==
user
.
getGroup
().
getId
(),
"所选用户与所选范围不属于统一机构"
);
scope
.
setUser
(
user
);
recordScopeService
.
update
(
scope
);
return
ApiResponse
.
ok
();
}
@ApiOperation
(
value
=
"获取机构
数据
"
)
@ApiOperation
(
value
=
"获取机构
列表
"
)
@PostMapping
(
value
=
"/group/list"
)
public
ApiResponse
getGroupList
()
{
return
ApiResponse
.
ok
(
getGroupTree
());
...
...
src/main/java/com/keymobile/rest/model/RecordScope.java
View file @
3bb57e2e
...
...
@@ -29,7 +29,7 @@ public class RecordScope implements Serializable {
@Column
(
nullable
=
false
,
columnDefinition
=
(
"integer(2) comment '补录角色'"
))
private
int
role
;
@ManyToOne
@ManyToOne
(
fetch
=
FetchType
.
EAGER
)
private
Group
group
;
@ManyToOne
...
...
src/main/java/com/keymobile/rest/service/RecordScopeService.java
View file @
3bb57e2e
...
...
@@ -19,7 +19,6 @@ public class RecordScopeService {
@Autowired
private
GroupDao
groupDao
;
@PostConstruct
private
void
init
()
{
List
<
Group
>
groupList
=
groupDao
.
findAll
();
...
...
@@ -39,9 +38,15 @@ public class RecordScopeService {
});
}
public
RecordScope
findById
(
long
id
)
{
return
recordScopeDao
.
getOne
(
id
);
}
public
List
<
RecordScope
>
findAll
()
{
return
recordScopeDao
.
findAll
();
}
public
void
update
(
RecordScope
recordScope
)
{
recordScopeDao
.
save
(
recordScope
);
}
}
src/main/java/com/keymobile/rest/service/UserService.java
View file @
3bb57e2e
...
...
@@ -21,4 +21,8 @@ public class UserService {
return
userDao
.
findAll
();
}
public
User
findById
(
long
id
)
{
return
userDao
.
getOne
(
id
);
}
}
src/main/resources/application-test.yml
View file @
3bb57e2e
...
...
@@ -17,8 +17,8 @@ spring:
jpa
:
show-sql
:
true
database-platform
:
org.hibernate.dialect.MySQL5Dialect
# hibernate:
# ddl-auto: update
# hibernate:
# ddl-auto: update
datasource
:
url
:
jdbc:mysql://47.105.193.165:3306/dev0?useUnicode=true&characterEncoding=UTF-8&allowMultiQueries=true&serverTimezone=GMT%2B8
username
:
root
...
...
@@ -30,7 +30,8 @@ spring:
max-file-size
:
20Mb
max-request-size
:
100Mb
redis
:
host
:
192.168.0.192
# host: 192.168.0.192
host
:
127.0.0.1
port
:
6379
session
:
store-type
:
redis
...
...
@@ -42,7 +43,7 @@ server:
port
:
8110
app
:
active-process
:
RecordStandardProcess
.bpmn
active-process
:
MoreSubProcessTest
.bpmn
swagger2
:
host
:
localhost:8110
...
...
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