1.task实体中添加关联实体id字段
2.修改同步任务逻辑
Showing
3 changed files
with
25 additions
and
12 deletions
... | @@ -33,6 +33,10 @@ public class Task implements Serializable { | ... | @@ -33,6 +33,10 @@ public class Task implements Serializable { |
33 | @Column(name = "task_template_id", nullable = false) | 33 | @Column(name = "task_template_id", nullable = false) |
34 | private Long taskTemplateId; | 34 | private Long taskTemplateId; |
35 | 35 | ||
36 | /** 关联实体id */ | ||
37 | @Column(name = "entity_id", nullable = false) | ||
38 | private String entityId; | ||
39 | |||
36 | @Transient | 40 | @Transient |
37 | private String taskTemplateCode; | 41 | private String taskTemplateCode; |
38 | 42 | ... | ... |
... | @@ -19,6 +19,9 @@ public class TaskDTO implements Serializable { | ... | @@ -19,6 +19,9 @@ public class TaskDTO implements Serializable { |
19 | /** 任务模板id */ | 19 | /** 任务模板id */ |
20 | private Long taskTemplateId; | 20 | private Long taskTemplateId; |
21 | 21 | ||
22 | /** 关联实体id */ | ||
23 | private String entityId; | ||
24 | |||
22 | /** 任务重复类型,-1:不限次;1:单次;>1:多次 */ | 25 | /** 任务重复类型,-1:不限次;1:单次;>1:多次 */ |
23 | private Integer taskRepeatType; | 26 | private Integer taskRepeatType; |
24 | 27 | ... | ... |
1 | package com.topdraw.business.process.service.impl; | 1 | package com.topdraw.business.process.service.impl; |
2 | 2 | ||
3 | import com.alibaba.fastjson.JSONObject; | ||
3 | import com.topdraw.business.module.task.attribute.domain.TaskAttr; | 4 | import com.topdraw.business.module.task.attribute.domain.TaskAttr; |
4 | import com.topdraw.business.module.task.attribute.service.TaskAttrService; | 5 | import com.topdraw.business.module.task.attribute.service.TaskAttrService; |
5 | import com.topdraw.business.module.task.attribute.service.dto.TaskAttrDTO; | 6 | import com.topdraw.business.module.task.attribute.service.dto.TaskAttrDTO; |
... | @@ -50,10 +51,10 @@ public class TaskOperationServiceImpl implements TaskOperationService { | ... | @@ -50,10 +51,10 @@ public class TaskOperationServiceImpl implements TaskOperationService { |
50 | TaskDTO taskDTO = this.findByCode(code); | 51 | TaskDTO taskDTO = this.findByCode(code); |
51 | if (Objects.isNull(taskDTO.getId())) { | 52 | if (Objects.isNull(taskDTO.getId())) { |
52 | TaskDTO taskDTO_ = this.taskService.create(task); | 53 | TaskDTO taskDTO_ = this.taskService.create(task); |
53 | if (Objects.nonNull(taskDTO_.getId())) { | 54 | /*if (Objects.nonNull(taskDTO_.getId())) { |
54 | task.setId(taskDTO_.getId()); | 55 | task.setId(taskDTO_.getId()); |
55 | this.createTaskAttr(task); | 56 | this.createTaskAttr(task); |
56 | } | 57 | }*/ |
57 | } | 58 | } |
58 | } | 59 | } |
59 | 60 | ||
... | @@ -72,17 +73,23 @@ public class TaskOperationServiceImpl implements TaskOperationService { | ... | @@ -72,17 +73,23 @@ public class TaskOperationServiceImpl implements TaskOperationService { |
72 | String code = task.getCode(); | 73 | String code = task.getCode(); |
73 | TaskDTO taskDTO = this.findByCode(code); | 74 | TaskDTO taskDTO = this.findByCode(code); |
74 | if (Objects.nonNull(taskDTO.getId())) { | 75 | if (Objects.nonNull(taskDTO.getId())) { |
75 | Long id = taskDTO.getId(); | 76 | Task task1 = new Task(); |
76 | task.setId(id); | 77 | BeanUtils.copyProperties(taskDTO, task1); |
77 | 78 | ||
79 | Long id = taskDTO.getId(); | ||
80 | task1.setId(id); | ||
78 | String taskTemplateCode = task.getTaskTemplateCode(); | 81 | String taskTemplateCode = task.getTaskTemplateCode(); |
79 | TaskTemplateDTO taskTemplateDTO = this.taskTemplateOperationService.findByCode(taskTemplateCode); | 82 | if (StringUtils.isNotBlank(taskTemplateCode)) { |
80 | Long templateId = taskTemplateDTO.getId(); | 83 | TaskTemplateDTO taskTemplateDTO = this.taskTemplateOperationService.findByCode(taskTemplateCode); |
81 | task.setTaskTemplateId(templateId); | 84 | Long templateId = taskTemplateDTO.getId(); |
82 | TaskDTO update = this.update(task); | 85 | task1.setTaskTemplateId(templateId); |
83 | if (Objects.nonNull(update)) { | ||
84 | this.updateTaskAttr(task); | ||
85 | } | 86 | } |
87 | |||
88 | task1.copy(task); | ||
89 | TaskDTO update = this.update(task1); | ||
90 | /*if (Objects.nonNull(update)) { | ||
91 | this.updateTaskAttr(task); | ||
92 | }*/ | ||
86 | } | 93 | } |
87 | 94 | ||
88 | } | 95 | } |
... | @@ -129,8 +136,7 @@ public class TaskOperationServiceImpl implements TaskOperationService { | ... | @@ -129,8 +136,7 @@ public class TaskOperationServiceImpl implements TaskOperationService { |
129 | } | 136 | } |
130 | 137 | ||
131 | private TaskDTO findByCode(String code){ | 138 | private TaskDTO findByCode(String code){ |
132 | TaskDTO taskDTO = this.taskService.findByCode(code); | 139 | return this.taskService.findByCode(code); |
133 | return taskDTO; | ||
134 | } | 140 | } |
135 | 141 | ||
136 | } | 142 | } | ... | ... |
-
Please register or sign in to post a comment