Commit 56afeb8e authored by neo's avatar neo

[Bugfix] fixed approval use instacneId not taskid

parent bff27b8c
...@@ -125,7 +125,7 @@ public class ApprovalService { ...@@ -125,7 +125,7 @@ public class ApprovalService {
@Transactional @Transactional
public void checkTask(String taskId, String decide,String comment) { public void checkTask(String instanceId, String decide,String comment) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
PeriodApprove pa = new PeriodApprove(); PeriodApprove pa = new PeriodApprove();
switch (decide) { switch (decide) {
...@@ -140,22 +140,34 @@ public class ApprovalService { ...@@ -140,22 +140,34 @@ public class ApprovalService {
default: default:
throw new BadParameterException("not support decide param type"); throw new BadParameterException("not support decide param type");
} }
List<Attachment> attachments = taskService.getTaskAttachments(taskId); List<Task> tasks = taskService.createTaskQuery().taskAssignee(Constant.ASSIGNEE_MANAGER).processInstanceId(
if (attachments != null && attachments.size() == 1) { instanceId).list();
String uuid = attachments.get(0).getDescription();
taskService.complete(taskId, map); if (tasks != null && tasks.size() == 1) {
Task task = tasks.get(0);
pa.setId(uuid); List<Attachment> attachments = taskService.getTaskAttachments(task.getId());
periodApproveMapper.updateByPrimaryKeySelective(pa);
pa.setApprovalBy("Admin"); if (attachments != null && attachments.size() == 1) {
pa.setApprovalTime(new Date()); String uuid = attachments.get(0).getDescription();
pa.setApprovalResualt(comment); taskService.complete(task.getId(), map);
periodApproveMapper.selectByPrimaryKey(uuid);
pa.setId(uuid);
periodApproveMapper.updateByPrimaryKeySelective(pa);
pa.setApprovalBy("Admin");
pa.setApprovalTime(new Date());
pa.setApprovalResualt(comment);
periodApproveMapper.selectByPrimaryKey(uuid);
} else {
logger.warn("task must not null or size gt 1");
}
} else { } else {
logger.warn("task must not null or size gt 1"); logger.warn("task must not null or size eq 1");
} }
} }
public Template getTemplateInfo(Long templateId) { public Template getTemplateInfo(Long templateId) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment