Commit 56afeb8e authored by neo's avatar neo

[Bugfix] fixed approval use instacneId not taskid

parent bff27b8c
......@@ -125,7 +125,7 @@ public class ApprovalService {
@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<>();
PeriodApprove pa = new PeriodApprove();
switch (decide) {
......@@ -140,22 +140,34 @@ public class ApprovalService {
default:
throw new BadParameterException("not support decide param type");
}
List<Attachment> attachments = taskService.getTaskAttachments(taskId);
if (attachments != null && attachments.size() == 1) {
String uuid = attachments.get(0).getDescription();
taskService.complete(taskId, map);
pa.setId(uuid);
periodApproveMapper.updateByPrimaryKeySelective(pa);
pa.setApprovalBy("Admin");
pa.setApprovalTime(new Date());
pa.setApprovalResualt(comment);
periodApproveMapper.selectByPrimaryKey(uuid);
List<Task> tasks = taskService.createTaskQuery().taskAssignee(Constant.ASSIGNEE_MANAGER).processInstanceId(
instanceId).list();
if (tasks != null && tasks.size() == 1) {
Task task = tasks.get(0);
List<Attachment> attachments = taskService.getTaskAttachments(task.getId());
if (attachments != null && attachments.size() == 1) {
String uuid = attachments.get(0).getDescription();
taskService.complete(task.getId(), map);
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 {
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) {
......
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