Commit c61358c5 authored by wdy's avatar wdy

开始任务,预览留档文件

parent 84e1cf7d
......@@ -7,8 +7,10 @@ import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.domain.ReviewEnterpriseArchive;
import com.ruoyi.domain.Task;
import com.ruoyi.domain.vo.ReviewEnterpriseArchiveViewItemVO;
import com.ruoyi.domain.vo.ReviewEnterpriseArchiveViewVO;
import com.ruoyi.mapper.TaskMapper;
import com.ruoyi.service.ReviewEnterpriseArchiveService;
import com.ruoyi.mapper.ReviewEnterpriseArchiveMapper;
import com.ruoyi.system.service.ISysUserService;
......@@ -41,14 +43,29 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp
@Autowired
private ReviewEnterpriseArchiveService reviewEnterpriseArchiveService;
@Autowired
private TaskMapper taskMapper;
@Override
public List<ReviewEnterpriseArchiveViewVO> view(Long taskId) {
Task task = taskMapper.selectById(taskId);
List<ReviewEnterpriseArchive> archives = reviewEnterpriseArchiveMapper.findByTaskId(taskId);
List<ReviewEnterpriseArchiveViewItemVO> viewItems = reviewEnterpriseArchiveMapper.findViewItemVOByTaskId(taskId);
return buildReviewEnterpriseArchiveViewVO(archives, viewItems);
List<ReviewEnterpriseArchiveViewVO> resultList = new ArrayList<>();
resultList.addAll(
buildReviewEnterpriseArchiveViewVO(archives, reviewEnterpriseArchiveMapper.findViewItemVOByTaskId(task.getSystemReviewTaskId()))
);
resultList.addAll(
buildReviewEnterpriseArchiveViewVO(archives, reviewEnterpriseArchiveMapper.findViewItemVOByTaskId(task.getCarReviewTaskId()))
);
return resultList;
}
@Override
......@@ -111,6 +128,7 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp
}
private void setReviewEnterpriseArchiveViewItemVO(ReviewEnterpriseArchiveViewVO view, List<ReviewEnterpriseArchiveViewItemVO> viewItems) {
if (viewItems == null) return;
List<ReviewEnterpriseArchiveViewItemVO> subList = new ArrayList();
Long archiveId = view.getId();
......
package com.ruoyi.service.impl;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.domain.Task;
import com.ruoyi.service.CarReviewTaskService;
import com.ruoyi.service.SystemReviewTaskService;
......@@ -29,15 +31,16 @@ public abstract class TaskStateAdapter implements TaskState {
if (Objects.equals(task.getNextNode(), Task.SUB_TASK_SRAIF)) {
systemReviewTaskService.start(task.getSystemReviewTaskId());
task.setNextNode(Task.SUB_TASK_GRFIS);
taskService.updateById(task);
} else if (Objects.equals(task.getNextNode(), Task.SUB_TASK_GRFIS)) {
carReviewTaskService.startReviewTask(task.getCarReviewTaskId());
task.setNextNode(Task.SUB_TASK_TRFIS);
taskService.updateById(task);
} else {
throw new ServiceException("已没有可执行的子任务节点", HttpStatus.ERROR);
}
task.setPointer(task.getPointer() + 1);
taskService.updateById(task);
}
}
......@@ -14,7 +14,7 @@ import java.util.List;
@Transactional
@Service
public class TaskStateFinish implements TaskState, InitializingBean {
public class TaskStateFinish extends TaskStateAdapter implements TaskState, InitializingBean {
@Autowired
private TaskStateContext taskStateContext;
......
......@@ -35,6 +35,8 @@
<result property="standardNo" column="standard_no" jdbcType="VARCHAR"/>
<result property="file" column="file" jdbcType="VARCHAR"/>
<result property="taskList" column="task_list" jdbcType="VARCHAR"/>
<result property="pointer" column="pointer" jdbcType="BIGINT"/>
<result property="maxPointer" column="max_pointer" jdbcType="BIGINT"/>
</resultMap>
<resultMap id="ResponseMap" type="com.ruoyi.web.response.TaskFindResponse">
......
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