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
03a361e6
Commit
03a361e6
authored
Mar 06, 2020
by
chenweisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
b3f8ecf7
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
104 additions
and
48 deletions
+104
-48
IndexCtrl.java
src/main/java/com/keymobile/rest/ctrl/IndexCtrl.java
+19
-13
ExcelService.java
src/main/java/com/keymobile/rest/service/ExcelService.java
+7
-2
TaskService.java
src/main/java/com/keymobile/rest/service/TaskService.java
+56
-18
application-test.yml
src/main/resources/application-test.yml
+2
-0
demo.bpmn
src/main/resources/demo.bpmn
+4
-4
ProcessTest.java
src/test/java/com/keymobile/ProcessTest.java
+16
-11
No files found.
src/main/java/com/keymobile/rest/ctrl/IndexCtrl.java
View file @
03a361e6
...
@@ -9,7 +9,9 @@ import com.keymobile.rest.service.TaskService;
...
@@ -9,7 +9,9 @@ import com.keymobile.rest.service.TaskService;
import
com.keymobile.rest.service.UserService
;
import
com.keymobile.rest.service.UserService
;
import
com.keymobile.rest.vo.DataVo
;
import
com.keymobile.rest.vo.DataVo
;
import
com.keymobile.rest.vo.ExcelVO
;
import
com.keymobile.rest.vo.ExcelVO
;
import
com.keymobile.rest.vo.TaskVO
;
import
com.sun.xml.internal.ws.wsdl.writer.document.ParamType
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Page
;
...
@@ -25,9 +27,6 @@ import java.util.Map;
...
@@ -25,9 +27,6 @@ import java.util.Map;
@RequestMapping
(
path
=
"/api"
)
@RequestMapping
(
path
=
"/api"
)
public
class
IndexCtrl
{
public
class
IndexCtrl
{
private
int
pageSize
=
10
;
private
String
orderBy
=
"descending"
;
//
private
String
propBy
=
"id"
;
// groupBy
@Autowired
@Autowired
private
TaskService
taskService
;
private
TaskService
taskService
;
...
@@ -40,17 +39,16 @@ public class IndexCtrl {
...
@@ -40,17 +39,16 @@ public class IndexCtrl {
@ApiOperation
(
value
=
"获取首页收数列表"
)
@ApiOperation
(
value
=
"获取首页收数列表"
)
@PostMapping
(
value
=
"/task/list"
)
@PostMapping
(
value
=
"/task/list"
)
public
Map
getTaskList
(
@RequestParam
(
required
=
false
)
String
name
,
@RequestParam
(
required
=
false
)
Integer
pageNo
)
{
public
Map
getTaskList
(
@RequestParam
Integer
pageNo
,
@RequestParam
Integer
pageSize
,
@RequestParam
(
required
=
false
)
String
name
)
{
if
(
pageNo
==
null
)
{
pageNo
=
1
;
}
Page
<
Task
>
taskList
;
Page
<
Task
>
taskList
;
String
orderBy
=
"descending"
;
//
String
propBy
=
"id"
;
// groupBy
if
(
name
!=
null
)
{
if
(
name
!=
null
)
{
taskList
=
taskService
.
findAllByName
(
name
,
pageNo
,
pageSize
,
orderBy
,
propBy
);
taskList
=
taskService
.
findAllByName
(
name
,
pageNo
,
pageSize
,
orderBy
,
propBy
);
}
else
{
}
else
{
taskList
=
taskService
.
findAll
(
pageNo
,
pageSize
,
orderBy
,
propBy
);
taskList
=
taskService
.
findAll
(
pageNo
,
pageSize
,
orderBy
,
propBy
);
}
}
return
ImmutableMap
.
of
(
"code"
,
200
,
"data"
,
taskList
.
getContent
(
));
return
ImmutableMap
.
of
(
"code"
,
200
,
"data"
,
ImmutableMap
.
of
(
"list"
,
taskList
.
getContent
(),
"total"
,
taskList
.
getTotalElements
()
));
}
}
...
@@ -62,9 +60,17 @@ public class IndexCtrl {
...
@@ -62,9 +60,17 @@ public class IndexCtrl {
}
}
@ApiOperation
(
value
=
"新建收数"
)
@ApiOperation
(
value
=
"新建收数"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"name"
,
value
=
"收数名称"
,
dataType
=
"String"
,
required
=
true
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"type"
,
value
=
"收数类型 1为手动发起 2为自动发起"
,
dataType
=
"Integer"
,
required
=
true
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"startAt"
,
value
=
"自动发起需要提写的时间"
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"userIds"
,
value
=
"补录人员ids 用逗号隔开"
,
dataType
=
"String"
,
paramType
=
"query"
),
@ApiImplicitParam
(
name
=
"excelIds"
,
value
=
"新建的模板ids 用逗号隔开"
,
dataType
=
"String"
,
paramType
=
"query"
),
})
@PostMapping
(
value
=
"/task/create"
)
@PostMapping
(
value
=
"/task/create"
)
public
Map
createTask
(
TaskVO
vo
)
{
public
Map
createTask
(
@RequestParam
String
name
,
@RequestParam
Integer
type
,
long
id
=
taskService
.
create
(
vo
);
@RequestParam
(
required
=
false
)
String
startAt
,
@RequestParam
(
required
=
false
)
String
userIds
,
@RequestParam
(
required
=
false
)
String
excelIds
)
{
long
id
=
taskService
.
create
(
name
,
type
,
startAt
,
userIds
,
excelIds
);
return
ImmutableMap
.
of
(
"code"
,
200
,
"data"
,
id
);
return
ImmutableMap
.
of
(
"code"
,
200
,
"data"
,
id
);
}
}
...
@@ -107,8 +113,8 @@ public class IndexCtrl {
...
@@ -107,8 +113,8 @@ public class IndexCtrl {
@ApiOperation
(
value
=
"新建模板"
)
@ApiOperation
(
value
=
"新建模板"
)
@PostMapping
(
value
=
"/excel/create"
)
@PostMapping
(
value
=
"/excel/create"
)
public
Map
saveExcel
(
ExcelVO
vo
)
{
public
Map
saveExcel
(
@RequestParam
String
config
,
@RequestParam
(
required
=
false
)
String
desc
)
{
int
id
=
excelService
.
create
(
vo
);
long
id
=
excelService
.
create
(
config
,
desc
);
return
ImmutableMap
.
of
(
"code"
,
200
,
"data"
,
id
);
return
ImmutableMap
.
of
(
"code"
,
200
,
"data"
,
id
);
}
}
...
...
src/main/java/com/keymobile/rest/service/ExcelService.java
View file @
03a361e6
package
com
.
keymobile
.
rest
.
service
;
package
com
.
keymobile
.
rest
.
service
;
import
com.keymobile.rest.dao.*
;
import
com.keymobile.rest.dao.*
;
import
com.keymobile.rest.model.Excel
;
import
com.keymobile.rest.vo.ExcelVO
;
import
com.keymobile.rest.vo.ExcelVO
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -18,7 +19,11 @@ public class ExcelService {
...
@@ -18,7 +19,11 @@ public class ExcelService {
private
RecordInfoDao
recordInfoDao
;
private
RecordInfoDao
recordInfoDao
;
public
int
create
(
ExcelVO
vo
)
{
public
long
create
(
String
config
,
String
desc
)
{
return
0
;
Excel
excel
=
new
Excel
();
excel
.
setConfig
(
config
);
excel
.
setDesc
(
desc
);
excelDao
.
save
(
excel
);
return
excel
.
getId
();
}
}
}
}
src/main/java/com/keymobile/rest/service/TaskService.java
View file @
03a361e6
...
@@ -9,14 +9,17 @@ import com.keymobile.rest.model.Excel;
...
@@ -9,14 +9,17 @@ import com.keymobile.rest.model.Excel;
import
com.keymobile.rest.model.RecordInfo
;
import
com.keymobile.rest.model.RecordInfo
;
import
com.keymobile.rest.model.Task
;
import
com.keymobile.rest.model.Task
;
import
com.keymobile.rest.model.User
;
import
com.keymobile.rest.model.User
;
import
com.keymobile.rest.vo.TaskVO
;
import
javassist.compiler.ast.ASTList
;
import
javassist.compiler.ast.ASTList
;
import
org.activiti.engine.ProcessEngine
;
import
org.activiti.engine.ProcessEngines
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.data.domain.Sort
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
java.sql.Array
;
import
java.sql.Array
;
import
java.sql.Timestamp
;
import
java.sql.Timestamp
;
...
@@ -36,36 +39,40 @@ public class TaskService {
...
@@ -36,36 +39,40 @@ public class TaskService {
@Autowired
@Autowired
private
RecordInfoDao
recordInfoDao
;
private
RecordInfoDao
recordInfoDao
;
@Value
(
"${}"
)
private
String
PRO
=
""
;
public
Task
get
(
long
id
)
{
public
Task
get
(
long
id
)
{
return
taskDao
.
getOne
(
id
);
return
taskDao
.
getOne
(
id
);
}
}
public
long
create
(
TaskVO
vo
)
{
public
long
create
(
String
name
,
Integer
type
,
String
startAt
,
String
userIds
,
String
excelIds
)
{
Timestamp
now
=
Timestamp
.
valueOf
(
DateUtil
.
getDateTime
());
Timestamp
now
=
Timestamp
.
valueOf
(
DateUtil
.
getDateTime
());
Task
task
=
new
Task
();
Task
task
=
new
Task
();
task
.
setCreateAt
(
now
);
task
.
setCreateAt
(
now
);
task
.
setStatus
(
Task
.
STATUS_UNRELEASED
);
task
.
setStatus
(
Task
.
STATUS_UNRELEASED
);
task
.
setJudge
(
vo
.
getJudge
()
);
task
.
setJudge
(
Task
.
JUDGE_NEED
);
task
.
setName
(
vo
.
getName
()
);
task
.
setName
(
name
);
task
.
setType
(
vo
.
getType
()
);
task
.
setType
(
type
);
if
(
vo
.
getType
()
==
Task
.
TYPE_AUTO
)
{
if
(
type
==
Task
.
TYPE_AUTO
)
{
task
.
setStartAt
(
vo
.
getStartAt
(
));
task
.
setStartAt
(
Timestamp
.
valueOf
(
startAt
));
}
}
task
.
setUser
(
getLoginUser
());
task
.
setUser
(
getLoginUser
());
taskDao
.
save
(
task
);
taskDao
.
save
(
task
);
// 新建excel实例
// 新建excel实例
if
(
vo
.
getExcelIds
()
!=
null
)
{
if
(
excelIds
!=
null
)
{
String
[]
excelId
s
=
vo
.
getExcelIds
()
.
split
(
","
);
String
[]
excelId
Arr
=
excelIds
.
split
(
","
);
List
<
Long
>
ids
=
Arrays
.
asList
(
excelId
s
).
stream
().
map
(
Long:
:
parseLong
).
collect
(
Collectors
.
toList
());
List
<
Long
>
ids
=
Arrays
.
asList
(
excelId
Arr
).
stream
().
map
(
Long:
:
parseLong
).
collect
(
Collectors
.
toList
());
List
<
Excel
>
excelList
=
excelDao
.
findAllByIdIn
(
ids
);
List
<
Excel
>
excelList
=
excelDao
.
findAllByIdIn
(
ids
);
excelList
.
forEach
(
excel
->
{
excelList
.
forEach
(
excel
->
{
excel
.
setTask
(
task
);
excel
.
setTask
(
task
);
// 新建补录人员任务关联
// 新建补录人员任务关联
if
(
vo
.
getUserIds
()
!=
null
)
{
if
(
userIds
!=
null
)
{
String
[]
userStrId
s
=
vo
.
getUserIds
()
.
split
(
","
);
String
[]
userStrId
Arr
=
userIds
.
split
(
","
);
List
<
Long
>
userId
s
=
Arrays
.
asList
(
userStrIds
).
stream
().
map
(
Long:
:
parseLong
).
collect
(
Collectors
.
toList
());
List
<
Long
>
userId
List
=
Arrays
.
asList
(
userStrIdArr
).
stream
().
map
(
Long:
:
parseLong
).
collect
(
Collectors
.
toList
());
List
<
User
>
userList
=
userDao
.
findAllByIdIn
(
userId
s
);
List
<
User
>
userList
=
userDao
.
findAllByIdIn
(
userId
List
);
userList
.
forEach
(
user
->
{
userList
.
forEach
(
user
->
{
RecordInfo
info
=
new
RecordInfo
();
RecordInfo
info
=
new
RecordInfo
();
info
.
setUser
(
user
);
info
.
setUser
(
user
);
...
@@ -82,7 +89,15 @@ public class TaskService {
...
@@ -82,7 +89,15 @@ public class TaskService {
public
void
start
(
long
id
)
{
public
void
start
(
long
id
)
{
Task
task
=
taskDao
.
getOne
(
id
);
// 启动流程
// 启动流程
// 获取流的引擎
ProcessEngine
processEngine
=
ProcessEngines
.
getDefaultProcessEngine
();
processEngine
.
getRepositoryService
()
.
createDeployment
()
.
addClasspathResource
(
"demo.bpmn"
)
.
addClasspathResource
(
"demo.bpmn.png"
)
.
deploy
();
}
}
public
void
pass
(
long
id
)
{
public
void
pass
(
long
id
)
{
...
@@ -93,6 +108,16 @@ public class TaskService {
...
@@ -93,6 +108,16 @@ public class TaskService {
}
}
public
Page
<
Task
>
findAll
(
int
pageNo
,
int
pageSize
)
{
Pageable
pageable
=
convert
(
pageNo
,
pageSize
);
return
taskDao
.
findAll
(
pageable
);
}
public
Page
<
Task
>
findAllByName
(
String
name
,
int
pageNo
,
int
pageSize
)
{
Pageable
pageable
=
convert
(
pageNo
,
pageSize
);
return
taskDao
.
findAllByNameLike
((
"%"
+
name
+
"%"
),
pageable
);
}
public
Page
<
Task
>
findAll
(
int
pageNo
,
int
pageSize
,
String
orderBy
,
String
propBy
)
{
public
Page
<
Task
>
findAll
(
int
pageNo
,
int
pageSize
,
String
orderBy
,
String
propBy
)
{
Pageable
pageable
=
convert
(
pageNo
,
pageSize
,
orderBy
,
propBy
);
Pageable
pageable
=
convert
(
pageNo
,
pageSize
,
orderBy
,
propBy
);
return
taskDao
.
findAll
(
pageable
);
return
taskDao
.
findAll
(
pageable
);
...
@@ -104,14 +129,27 @@ public class TaskService {
...
@@ -104,14 +129,27 @@ public class TaskService {
}
}
private
Pageable
convert
(
int
pageNo
,
int
pageSize
,
String
orderBy
,
String
propBy
)
{
private
Pageable
convert
(
int
pageNo
,
int
pageSize
,
String
orderBy
,
String
propBy
)
{
pageNo
--;
if
(
pageNo
<
0
)
{
pageNo
=
0
;
}
Sort
.
Direction
direction
=
orderBy
.
equals
(
"descending"
)
?
Sort
.
Direction
.
DESC
:
Sort
.
Direction
.
ASC
;
Sort
.
Direction
direction
=
orderBy
.
equals
(
"descending"
)
?
Sort
.
Direction
.
DESC
:
Sort
.
Direction
.
ASC
;
Sort
order_
;
Sort
sort
;
if
(
propBy
.
contains
(
"-"
))
{
if
(
propBy
.
contains
(
"-"
))
{
order_
=
Sort
.
by
(
direction
,
propBy
.
split
(
"-"
));
sort
=
Sort
.
by
(
direction
,
propBy
.
split
(
"-"
));
}
else
{
}
else
{
order_
=
Sort
.
by
(
direction
,
propBy
);
sort
=
Sort
.
by
(
direction
,
propBy
);
}
Pageable
pageable
=
PageRequest
.
of
(
pageNo
,
pageSize
,
sort
);
return
pageable
;
}
private
Pageable
convert
(
int
pageNo
,
int
pageSize
)
{
pageNo
--;
if
(
pageNo
<
0
)
{
pageNo
=
0
;
}
}
Pageable
pageable
=
PageRequest
.
of
(
pageNo
,
pageSize
,
order_
);
Pageable
pageable
=
PageRequest
.
of
(
pageNo
,
pageSize
);
return
pageable
;
return
pageable
;
}
}
...
...
src/main/resources/application-test.yml
View file @
03a361e6
...
@@ -47,6 +47,8 @@ server:
...
@@ -47,6 +47,8 @@ server:
# prefer-ip-address: true
# prefer-ip-address: true
# hostname: 192.168.0.13
# hostname: 192.168.0.13
security
:
security
:
permit
:
true
permit
:
true
authUser
:
root
authUser
:
root
...
...
src/main/resources/demo.bpmn
View file @
03a361e6
...
@@ -2,10 +2,10 @@
...
@@ -2,10 +2,10 @@
<definitions
xmlns=
"http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:activiti=
"http://activiti.org/bpmn"
xmlns:bpmndi=
"http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:omgdc=
"http://www.omg.org/spec/DD/20100524/DC"
xmlns:omgdi=
"http://www.omg.org/spec/DD/20100524/DI"
xmlns:tns=
"http://www.activiti.org/test"
xmlns:xsd=
"http://www.w3.org/2001/XMLSchema"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
expressionLanguage=
"http://www.w3.org/1999/XPath"
id=
"m1583416072125"
name=
""
targetNamespace=
"http://www.activiti.org/test"
typeLanguage=
"http://www.w3.org/2001/XMLSchema"
>
<definitions
xmlns=
"http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:activiti=
"http://activiti.org/bpmn"
xmlns:bpmndi=
"http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:omgdc=
"http://www.omg.org/spec/DD/20100524/DC"
xmlns:omgdi=
"http://www.omg.org/spec/DD/20100524/DI"
xmlns:tns=
"http://www.activiti.org/test"
xmlns:xsd=
"http://www.w3.org/2001/XMLSchema"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
expressionLanguage=
"http://www.w3.org/1999/XPath"
id=
"m1583416072125"
name=
""
targetNamespace=
"http://www.activiti.org/test"
typeLanguage=
"http://www.w3.org/2001/XMLSchema"
>
<process
id=
"demo"
isClosed=
"false"
isExecutable=
"true"
name=
"demo"
processType=
"None"
>
<process
id=
"demo"
isClosed=
"false"
isExecutable=
"true"
name=
"demo"
processType=
"None"
>
<startEvent
id=
"Start"
name=
"Start"
/>
<startEvent
id=
"Start"
name=
"Start"
/>
<userTask
activiti:assignee=
"chenws"
activiti:exclusive=
"true"
id=
"
_3
"
name=
"请假"
/>
<userTask
activiti:assignee=
"chenws"
activiti:exclusive=
"true"
id=
"
请假
"
name=
"请假"
/>
<sequenceFlow
id=
"_4"
sourceRef=
"Start"
targetRef=
"
_3
"
/>
<sequenceFlow
id=
"_4"
sourceRef=
"Start"
targetRef=
"
请假
"
/>
<userTask
activiti:assignee=
"主管"
activiti:exclusive=
"true"
id=
"主管"
name=
"主管"
/>
<userTask
activiti:assignee=
"主管"
activiti:exclusive=
"true"
id=
"主管"
name=
"主管"
/>
<sequenceFlow
id=
"_6"
sourceRef=
"
_3
"
targetRef=
"主管"
/>
<sequenceFlow
id=
"_6"
sourceRef=
"
请假
"
targetRef=
"主管"
/>
<userTask
activiti:assignee=
"总监"
activiti:exclusive=
"true"
id=
"总监"
name=
"总监"
/>
<userTask
activiti:assignee=
"总监"
activiti:exclusive=
"true"
id=
"总监"
name=
"总监"
/>
<sequenceFlow
id=
"_8"
sourceRef=
"主管"
targetRef=
"总监"
/>
<sequenceFlow
id=
"_8"
sourceRef=
"主管"
targetRef=
"总监"
/>
<endEvent
id=
"_9"
name=
"EndEvent"
/>
<endEvent
id=
"_9"
name=
"EndEvent"
/>
...
@@ -19,7 +19,7 @@
...
@@ -19,7 +19,7 @@
<omgdc:Bounds
height=
"32.0"
width=
"32.0"
x=
"0.0"
y=
"0.0"
/>
<omgdc:Bounds
height=
"32.0"
width=
"32.0"
x=
"0.0"
y=
"0.0"
/>
</bpmndi:BPMNLabel>
</bpmndi:BPMNLabel>
</bpmndi:BPMNShape>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape
bpmnElement=
"
_3"
id=
"Shape-_3
"
>
<bpmndi:BPMNShape
bpmnElement=
"
请假"
id=
"Shape-请假
"
>
<omgdc:Bounds
height=
"55.0"
width=
"85.0"
x=
"155.0"
y=
"115.0"
/>
<omgdc:Bounds
height=
"55.0"
width=
"85.0"
x=
"155.0"
y=
"115.0"
/>
<bpmndi:BPMNLabel>
<bpmndi:BPMNLabel>
<omgdc:Bounds
height=
"55.0"
width=
"85.0"
x=
"0.0"
y=
"0.0"
/>
<omgdc:Bounds
height=
"55.0"
width=
"85.0"
x=
"0.0"
y=
"0.0"
/>
...
...
src/test/java/com/keymobile/ProcessTest.java
View file @
03a361e6
...
@@ -53,13 +53,18 @@ public class ProcessTest {
...
@@ -53,13 +53,18 @@ public class ProcessTest {
@Test
@Test
public
void
zhuguan
()
{
public
void
zhuguan
()
{
try
{
// try {
ProcessEngine
processEngine
=
ProcessEngines
.
getDefaultProcessEngine
();
ProcessEngine
processEngine
=
ProcessEngines
.
getDefaultProcessEngine
();
List
<
ProcessDefinition
>
processDefList
=
processEngine
.
getRepositoryService
().
createProcessDefinitionQuery
()
//
.
orderByProcessDefinitionVersion
().
asc
()
//按照版本的升序排列
// List<ProcessDefinition> processDefList = processEngine.getRepositoryService().createProcessDefinitionQuery()
.
list
();
// .orderByProcessDefinitionVersion().asc()//按照版本的升序排列
for
(
ProcessDefinition
processDefinition
:
processDefList
)
{
// .list();
System
.
out
.
println
(
processDefinition
.
getName
());
// for (ProcessDefinition processDefinition : processDefList) {
// System.out.println(processDefinition.getName());
//
// runtimeService.startProcessInstanceByKey(processDefinition.getKey());//流程的名称,也可以使用ByID来启动流
// repositoryService.deleteDeployment(processDefinition.getDeploymentId());
// repositoryService.deleteDeployment(processDefinition.getDeploymentId());
// repositoryService.suspendProcessDefinitionByKey(processDefinition.getKey());
// repositoryService.suspendProcessDefinitionByKey(processDefinition.getKey());
...
@@ -73,9 +78,9 @@ public class ProcessTest {
...
@@ -73,9 +78,9 @@ public class ProcessTest {
// runtimeService.deleteProcessInstance(pi.getId(), "删除原因");//删除流程
// runtimeService.deleteProcessInstance(pi.getId(), "删除原因");//删除流程
// });
// });
}
//
}
List
<
Task
>
tasks
=
processEngine
.
getTaskService
().
createTaskQuery
().
list
();
List
<
Task
>
tasks
=
processEngine
.
getTaskService
().
createTaskQuery
().
taskAssignee
(
"chenws"
).
list
();
for
(
Task
task
:
tasks
)
{
for
(
Task
task
:
tasks
)
{
System
.
out
.
println
(
task
.
getName
()
+
"***"
+
task
.
getAssignee
());
System
.
out
.
println
(
task
.
getName
()
+
"***"
+
task
.
getAssignee
());
}
}
...
@@ -83,8 +88,8 @@ public class ProcessTest {
...
@@ -83,8 +88,8 @@ public class ProcessTest {
// DeploymentBuilder deployBuilder = repositoryService.createDeployment().;
// DeploymentBuilder deployBuilder = repositoryService.createDeployment().;
}
catch
(
Exception
e
)
{
//
} catch (Exception e) {
System
.
out
.
println
(
e
.
getMessage
());
//
System.out.println(e.getMessage());
}
//
}
}
}
}
}
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