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
570c19af
Commit
570c19af
authored
Mar 24, 2020
by
chenweisong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更新
parent
55f255a1
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
48 deletions
+46
-48
TaskController.java
...in/java/com/keymobile/rest/controller/TaskController.java
+31
-42
MissionDao.java
src/main/java/com/keymobile/rest/dao/MissionDao.java
+1
-1
GroupDataStandardServiceImpl.java
.../keymobile/rest/service/GroupDataStandardServiceImpl.java
+1
-1
MissionService.java
src/main/java/com/keymobile/rest/service/MissionService.java
+6
-1
ProcessService.java
src/main/java/com/keymobile/rest/service/ProcessService.java
+5
-0
ProcessTest.java
src/test/java/com/keymobile/ProcessTest.java
+2
-3
No files found.
src/main/java/com/keymobile/rest/controller/TaskController.java
View file @
570c19af
...
@@ -191,31 +191,7 @@ public class TaskController {
...
@@ -191,31 +191,7 @@ public class TaskController {
@ApiOperation
(
value
=
"修改活动"
)
@ApiOperation
(
value
=
"修改活动"
)
@PostMapping
(
value
=
"/update"
)
@PostMapping
(
value
=
"/update"
)
public
ApiResponse
updateTask
(
@RequestBody
TaskForm
form
)
{
public
ApiResponse
updateTask
(
@RequestBody
TaskForm
form
)
{
// TwinkleValidator.isFalse((form.getId() == null && form.getId() <= 0), "活动id不能为空");
return
ApiResponse
.
ok
();
// Activity activity = activityService.get(form.getId());
// TwinkleValidator.notNull(activity, "活动不存在");
// int status = assignment.getStatus();
// TwinkleValidator.isFalse(status != Assignment.STATUS_UNRELEASED, "活动已经发起");
// TwinkleValidator.notEmpty(form.getName(), "名称不能为空");
// TwinkleValidator.notNull(form.getType(), "类型不能为空");
// TwinkleValidator.isFalse((form.getExcels() == null || form.getExcels().size() == 0), "补录模板不能为空");
// activity.setType(form.getType());
// activity.setRemark(form.getRemark());
// activity.setName(form.getName());
// activityService.update(activity);
// 新建excel实例
// List<ExcelForm> excelFormList = form.getExcels();
// excelFormList.forEach(excelForm -> {
// Template template = templateService.get(excelForm.getId());
// TwinkleValidator.notNull(template, "模板不存在");
// template.setName(excelForm.getName());
// template.setConfig(excelForm.getConfig());
// template.setRemark(excelForm.getRemark());
// template.setDataAt(excelForm.getDataAt());
// templateService.update(template);
// });
// return ApiResponse.ok(activity.getId());
return
null
;
}
}
@ApiOperation
(
value
=
"发起活动"
)
@ApiOperation
(
value
=
"发起活动"
)
...
@@ -226,7 +202,9 @@ public class TaskController {
...
@@ -226,7 +202,9 @@ public class TaskController {
public
ApiResponse
startTask
(
long
taskId
)
{
public
ApiResponse
startTask
(
long
taskId
)
{
Activity
activity
=
activityService
.
get
(
taskId
);
Activity
activity
=
activityService
.
get
(
taskId
);
TwinkleValidator
.
notNull
(
activity
,
"活动不存在"
);
TwinkleValidator
.
notNull
(
activity
,
"活动不存在"
);
// 根据活动查找需要填写的人 目前只支持一人
List
<
Template
>
templateList
=
activity
.
getTemplateList
();
TwinkleValidator
.
notLessThan
(
templateList
.
size
(),
1
,
"补录模板不存在"
);
// 部署补录流程
// 部署补录流程
Deployment
deploy
=
repositoryService
Deployment
deploy
=
repositoryService
...
@@ -251,35 +229,46 @@ public class TaskController {
...
@@ -251,35 +229,46 @@ public class TaskController {
process
.
setProcessId
(
processInstance
.
getId
());
process
.
setProcessId
(
processInstance
.
getId
());
process
.
setActivity
(
activity
);
process
.
setActivity
(
activity
);
process
.
setMissionList
(
null
);
process
.
setMissionList
(
null
);
// process.setStatus(
);
process
.
setStatus
(
Process
.
STATUS_BEGIN
);
// processService.s
processService
.
save
(
process
);
// 发起人把流程发送到下一个人
// 发起人把流程发送到下一个人
Task
resultTask
=
taskService
.
createTaskQuery
().
processInstanceId
(
processInstance
.
getId
()).
Task
resultTask
=
taskService
.
createTaskQuery
().
processInstanceId
(
processInstance
.
getId
()).
taskInvolvedUser
(
inputUser
).
singleResult
();
taskInvolvedUser
(
inputUser
).
singleResult
();
// 根据活动查找需要填写的人 目前只支持一人
//直接提交标准到下个节点
List
<
Template
>
templateList
=
activity
.
getTemplateList
();
taskService
.
claim
(
resultTask
.
getId
(),
inputUser
);
TwinkleValidator
.
notLessThan
(
templateList
.
size
(),
1
,
"补录模板不存在"
);
//保存审批意见
taskService
.
addComment
(
resultTask
.
getId
(),
processInstance
.
getId
(),
""
);
StringBuilder
users
=
new
StringBuilder
();
templateList
.
forEach
(
template
->
{
List
<
Mission
>
missionList
=
missionService
.
findAllByTemplateIdAndStatus
(
template
.
getId
(),
Mission
.
STATUS_BEGIN
);
users
.
append
();
List
<
String
>
userNameList
=
new
ArrayList
<>();
List
<
Mission
>
allMissions
=
new
ArrayList
<>();
templateList
.
forEach
(
template
->
{
List
<
Mission
>
missionList
=
missionService
.
findAllByTemplateIdAndStatus
(
template
.
getId
(),
Mission
.
STATUS_BEGIN
);
// 当前所有任务的参与人员
missionList
.
forEach
(
mission
->
{
mission
.
setProcess
(
process
);
missionService
.
save
(
mission
);
User
user
=
mission
.
getUser
();
userNameList
.
add
(
user
.
getUsername
());
});
allMissions
.
addAll
(
missionList
);
});
});
process
.
setMissionList
(
allMissions
);
processService
.
save
(
process
);
//如果是开始录入环节,需要给出子任务录入人员
Map
<
String
,
Object
>
vars
=
new
HashMap
<>();
if
(
resultTask
.
getTaskDefinitionKey
().
indexOf
(
"startEntry"
)
>=
0
)
{
// 如果是开始录入环节,需要给出子任务录入人员
if
(
StringUtils
.
isNotBlank
(
assignees
))
{
if
(
resultTask
.
getTaskDefinitionKey
().
contains
(
"startEntry"
))
{
String
[]
commentUsers
=
assignees
.
split
(
","
);
vars
.
put
(
"candiateUserList"
,
userNameList
);
vars
.
put
(
"candiateUserList"
,
Arrays
.
asList
(
commentUsers
));
}
}
}
//审批任务
taskService
.
complete
(
resultTask
.
getId
(),
vars
);
return
ApiResponse
.
ok
();
return
ApiResponse
.
ok
();
}
}
...
...
src/main/java/com/keymobile/rest/dao/MissionDao.java
View file @
570c19af
...
@@ -8,6 +8,6 @@ import java.util.List;
...
@@ -8,6 +8,6 @@ import java.util.List;
public
interface
MissionDao
extends
JpaRepository
<
Mission
,
Long
>
{
public
interface
MissionDao
extends
JpaRepository
<
Mission
,
Long
>
{
List
<
Mission
>
findAllByTemplateIdA
A
ndStatus
(
long
templateId
,
int
status
);
List
<
Mission
>
findAllByTemplateIdAndStatus
(
long
templateId
,
int
status
);
}
}
src/main/java/com/keymobile/rest/service/GroupDataStandardServiceImpl.java
View file @
570c19af
package
com
.
keymobile
.
activiti
.
service
;
package
com
.
keymobile
.
rest
.
service
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
...
...
src/main/java/com/keymobile/rest/service/MissionService.java
View file @
570c19af
...
@@ -29,8 +29,13 @@ public class MissionService {
...
@@ -29,8 +29,13 @@ public class MissionService {
return
info
;
return
info
;
}
}
public
Mission
save
(
Mission
mission
)
{
missionDao
.
save
(
mission
);
return
mission
;
}
public
List
<
Mission
>
findAllByTemplateIdAndStatus
(
long
templateId
,
int
status
)
{
public
List
<
Mission
>
findAllByTemplateIdAndStatus
(
long
templateId
,
int
status
)
{
return
missionDao
.
findAllByTemplateIdA
A
ndStatus
(
templateId
,
status
);
return
missionDao
.
findAllByTemplateIdAndStatus
(
templateId
,
status
);
}
}
}
}
src/main/java/com/keymobile/rest/service/ProcessService.java
View file @
570c19af
package
com
.
keymobile
.
rest
.
service
;
package
com
.
keymobile
.
rest
.
service
;
import
com.keymobile.rest.dao.ProcessDao
;
import
com.keymobile.rest.dao.ProcessDao
;
import
com.keymobile.rest.model.Process
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -11,4 +12,8 @@ public class ProcessService {
...
@@ -11,4 +12,8 @@ public class ProcessService {
private
ProcessDao
processDao
;
private
ProcessDao
processDao
;
public
Process
save
(
Process
process
)
{
processDao
.
save
(
process
);
return
process
;
}
}
}
src/test/java/com/keymobile/ProcessTest.java
View file @
570c19af
...
@@ -36,8 +36,7 @@ public class ProcessTest {
...
@@ -36,8 +36,7 @@ public class ProcessTest {
// ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
// ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
// processEngine.getRepositoryService()
// processEngine.getRepositoryService()
// .createDeployment()
// .createDeployment()
// .addClasspathResource("demo.bpmn")
// .addClasspathResource("MoreSubProcessTest.bpmn")
// .addClasspathResource("demo.bpmn.png")
// .deploy();
// .deploy();
}
}
...
@@ -51,7 +50,7 @@ public class ProcessTest {
...
@@ -51,7 +50,7 @@ public class ProcessTest {
// .complete("32502");
// .complete("32502");
}
}
//
@Test
//
@Test
public
void
zhuguan
()
{
public
void
zhuguan
()
{
// try {
// 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