|
|
|
@ -4,7 +4,9 @@ import cn.hutool.core.collection.CollUtil;
|
|
|
|
|
import cn.iocoder.yudao.module.bpm.controller.admin.task.vo.task.BpmTaskRespVO;
|
|
|
|
|
import cn.iocoder.yudao.module.bpm.service.task.BpmTaskService;
|
|
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
|
|
|
|
|
|
|
import org.springframework.validation.annotation.Validated;
|
|
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
|
|
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
|
|
@ -19,11 +21,13 @@ import java.io.IOException;
|
|
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
|
|
|
|
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
|
|
|
|
|
|
|
|
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
|
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
|
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog;
|
|
|
|
|
|
|
|
|
|
import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.*;
|
|
|
|
|
|
|
|
|
|
import cn.iocoder.yudao.module.archives.controller.admin.turnover.vo.*;
|
|
|
|
@ -93,6 +97,7 @@ public class TurnOverController {
|
|
|
|
|
List<TurnOverDO> list = pageResult.getList();
|
|
|
|
|
if (CollUtil.isNotEmpty(list)) {
|
|
|
|
|
for (TurnOverDO t : list) {
|
|
|
|
|
if (t.getProcessInstanceId() != null) {
|
|
|
|
|
List<BpmTaskRespVO> taskListByProcessInstanceId = taskService.getTaskListByProcessInstanceId(t.getProcessInstanceId());
|
|
|
|
|
Optional<BpmTaskRespVO> latestTask = taskListByProcessInstanceId.stream()
|
|
|
|
|
.filter(task -> task.getEndTime() != null)
|
|
|
|
@ -108,8 +113,7 @@ public class TurnOverController {
|
|
|
|
|
updateReqVO.setStatus(latest.getResult().toString());
|
|
|
|
|
turnOverService.updateTurnOver(updateReqVO);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// 没有找到有endTime的任务
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
PageResult<TurnOverDO> pageResult2 = turnOverService.getTurnOverPage(pageVO);
|
|
|
|
|