Commit 2f330bff authored by 王飞's avatar 王飞

Merge branch 'wangdingyi' into 'dev'

开始任务,预览留档文件

See merge request !122
parents 84e1cf7d f6295953
...@@ -74,9 +74,6 @@ public class Task { ...@@ -74,9 +74,6 @@ public class Task {
@ApiModelProperty("任务运行状态[RUNNABLE(可运行的)、RUNNING(运行中的)]") @ApiModelProperty("任务运行状态[RUNNABLE(可运行的)、RUNNING(运行中的)]")
private String runStatus; private String runStatus;
@ApiModelProperty("下一个节点 SUB_TASK_SRAIF(体系审查子任务)、SUB_TASK_TRFIS(车辆实验子任务)、SUB_TASK_GRFIS(车辆问卷子任务)")
private String nextNode;
@ApiModelProperty("任务编号") @ApiModelProperty("任务编号")
private String taskNo; private String taskNo;
...@@ -165,6 +162,7 @@ public class Task { ...@@ -165,6 +162,7 @@ public class Task {
private int maxPointer; private int maxPointer;
// 返回当前节点的下一个节点 // 返回当前节点的下一个节点
public String getNextNode() { public String getNextNode() {
String[] split = taskList.split(","); String[] split = taskList.split(",");
if(pointer + 1 > maxPointer) { if(pointer + 1 > maxPointer) {
......
...@@ -7,8 +7,10 @@ import com.ruoyi.common.core.domain.model.LoginUser; ...@@ -7,8 +7,10 @@ import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.domain.ReviewEnterpriseArchive; import com.ruoyi.domain.ReviewEnterpriseArchive;
import com.ruoyi.domain.Task;
import com.ruoyi.domain.vo.ReviewEnterpriseArchiveViewItemVO; import com.ruoyi.domain.vo.ReviewEnterpriseArchiveViewItemVO;
import com.ruoyi.domain.vo.ReviewEnterpriseArchiveViewVO; import com.ruoyi.domain.vo.ReviewEnterpriseArchiveViewVO;
import com.ruoyi.mapper.TaskMapper;
import com.ruoyi.service.ReviewEnterpriseArchiveService; import com.ruoyi.service.ReviewEnterpriseArchiveService;
import com.ruoyi.mapper.ReviewEnterpriseArchiveMapper; import com.ruoyi.mapper.ReviewEnterpriseArchiveMapper;
import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.ISysUserService;
...@@ -41,14 +43,29 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp ...@@ -41,14 +43,29 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp
@Autowired @Autowired
private ReviewEnterpriseArchiveService reviewEnterpriseArchiveService; private ReviewEnterpriseArchiveService reviewEnterpriseArchiveService;
@Autowired
private TaskMapper taskMapper;
@Override @Override
public List<ReviewEnterpriseArchiveViewVO> view(Long taskId) { public List<ReviewEnterpriseArchiveViewVO> view(Long taskId) {
Task task = taskMapper.selectById(taskId);
List<ReviewEnterpriseArchive> archives = reviewEnterpriseArchiveMapper.findByTaskId(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 @Override
...@@ -111,6 +128,7 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp ...@@ -111,6 +128,7 @@ public class ReviewEnterpriseArchiveServiceImpl extends ServiceImpl<ReviewEnterp
} }
private void setReviewEnterpriseArchiveViewItemVO(ReviewEnterpriseArchiveViewVO view, List<ReviewEnterpriseArchiveViewItemVO> viewItems) { private void setReviewEnterpriseArchiveViewItemVO(ReviewEnterpriseArchiveViewVO view, List<ReviewEnterpriseArchiveViewItemVO> viewItems) {
if (viewItems == null) return;
List<ReviewEnterpriseArchiveViewItemVO> subList = new ArrayList(); List<ReviewEnterpriseArchiveViewItemVO> subList = new ArrayList();
Long archiveId = view.getId(); Long archiveId = view.getId();
......
package com.ruoyi.service.impl; 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.domain.Task;
import com.ruoyi.service.CarReviewTaskService; import com.ruoyi.service.CarReviewTaskService;
import com.ruoyi.service.SystemReviewTaskService; import com.ruoyi.service.SystemReviewTaskService;
...@@ -29,15 +31,16 @@ public abstract class TaskStateAdapter implements TaskState { ...@@ -29,15 +31,16 @@ public abstract class TaskStateAdapter implements TaskState {
if (Objects.equals(task.getNextNode(), Task.SUB_TASK_SRAIF)) { if (Objects.equals(task.getNextNode(), Task.SUB_TASK_SRAIF)) {
systemReviewTaskService.start(task.getSystemReviewTaskId()); systemReviewTaskService.start(task.getSystemReviewTaskId());
task.setNextNode(Task.SUB_TASK_GRFIS);
taskService.updateById(task); taskService.updateById(task);
} else if (Objects.equals(task.getNextNode(), Task.SUB_TASK_GRFIS)) { } else if (Objects.equals(task.getNextNode(), Task.SUB_TASK_GRFIS)) {
carReviewTaskService.startReviewTask(task.getCarReviewTaskId()); carReviewTaskService.startReviewTask(task.getCarReviewTaskId());
task.setNextNode(Task.SUB_TASK_TRFIS);
taskService.updateById(task); 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; ...@@ -14,7 +14,7 @@ import java.util.List;
@Transactional @Transactional
@Service @Service
public class TaskStateFinish implements TaskState, InitializingBean { public class TaskStateFinish extends TaskStateAdapter implements TaskState, InitializingBean {
@Autowired @Autowired
private TaskStateContext taskStateContext; private TaskStateContext taskStateContext;
......
...@@ -42,9 +42,6 @@ public class TaskFindResponse { ...@@ -42,9 +42,6 @@ public class TaskFindResponse {
@ApiModelProperty("任务运行状态[RUNNABLE(可运行的)、RUNNING(运行中的)]") @ApiModelProperty("任务运行状态[RUNNABLE(可运行的)、RUNNING(运行中的)]")
private String runStatus; private String runStatus;
@ApiModelProperty("下一个节点 SUB_TASK_SRAIF(体系审查子任务)、SUB_TASK_TRFIS(车辆实验子任务)、SUB_TASK_GRFIS(车辆问卷子任务)")
private String nextNode;
@ApiModelProperty("总任务开始时间") @ApiModelProperty("总任务开始时间")
private Date taskBeginTime; private Date taskBeginTime;
......
...@@ -35,9 +35,6 @@ public class TaskGetInfoResponse { ...@@ -35,9 +35,6 @@ public class TaskGetInfoResponse {
@ApiModelProperty("任务运行状态[RUNNABLE(可运行的)、RUNNING(运行中的)]") @ApiModelProperty("任务运行状态[RUNNABLE(可运行的)、RUNNING(运行中的)]")
private String runStatus; private String runStatus;
@ApiModelProperty("下一个节点 SUB_TASK_SRAIF(体系审查子任务)、SUB_TASK_TRFIS(车辆实验子任务)、SUB_TASK_GRFIS(车辆问卷子任务)")
private String nextNode;
@ApiModelProperty("任务编号") @ApiModelProperty("任务编号")
private String taskNo; private String taskNo;
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
<result property="carReviewTaskId" column="car_review_task_id" jdbcType="BIGINT"/> <result property="carReviewTaskId" column="car_review_task_id" jdbcType="BIGINT"/>
<result property="taskStatus" column="task_status" jdbcType="VARCHAR"/> <result property="taskStatus" column="task_status" jdbcType="VARCHAR"/>
<result property="runStatus" column="run_status" jdbcType="VARCHAR"/> <result property="runStatus" column="run_status" jdbcType="VARCHAR"/>
<result property="nextNode" column="next_node" jdbcType="VARCHAR"/>
<result property="taskNo" column="task_no" jdbcType="VARCHAR"/> <result property="taskNo" column="task_no" jdbcType="VARCHAR"/>
<result property="taskName" column="task_name" jdbcType="VARCHAR"/> <result property="taskName" column="task_name" jdbcType="VARCHAR"/>
<result property="confidentialityLevel" column="confidentiality_level" jdbcType="VARCHAR"/> <result property="confidentialityLevel" column="confidentiality_level" jdbcType="VARCHAR"/>
...@@ -35,6 +34,8 @@ ...@@ -35,6 +34,8 @@
<result property="standardNo" column="standard_no" jdbcType="VARCHAR"/> <result property="standardNo" column="standard_no" jdbcType="VARCHAR"/>
<result property="file" column="file" jdbcType="VARCHAR"/> <result property="file" column="file" jdbcType="VARCHAR"/>
<result property="taskList" column="task_list" 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>
<resultMap id="ResponseMap" type="com.ruoyi.web.response.TaskFindResponse"> <resultMap id="ResponseMap" type="com.ruoyi.web.response.TaskFindResponse">
...@@ -47,7 +48,6 @@ ...@@ -47,7 +48,6 @@
<result property="productModel" column="product_model" jdbcType="VARCHAR"/> <result property="productModel" column="product_model" jdbcType="VARCHAR"/>
<result property="taskStatus" column="task_status" jdbcType="VARCHAR"/> <result property="taskStatus" column="task_status" jdbcType="VARCHAR"/>
<result property="runStatus" column="run_status" jdbcType="VARCHAR"/> <result property="runStatus" column="run_status" jdbcType="VARCHAR"/>
<result property="nextNode" column="next_node" jdbcType="VARCHAR"/>
<result property="taskBeginTime" column="task_begin_time" jdbcType="TIMESTAMP"/> <result property="taskBeginTime" column="task_begin_time" jdbcType="TIMESTAMP"/>
<result property="taskEndTime" column="task_end_time" jdbcType="TIMESTAMP"/> <result property="taskEndTime" column="task_end_time" jdbcType="TIMESTAMP"/>
<result property="systemTaskBeginTime" column="system_task_begin_time" jdbcType="TIMESTAMP"/> <result property="systemTaskBeginTime" column="system_task_begin_time" jdbcType="TIMESTAMP"/>
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
<select id="findList" parameterType="com.ruoyi.web.request.TaskListRequest" resultMap="BaseResultMap"> <select id="findList" parameterType="com.ruoyi.web.request.TaskListRequest" resultMap="BaseResultMap">
SELECT id, system_review_task_id, car_review_task_id, SELECT id, system_review_task_id, car_review_task_id,
task_status,next_node,task_no,task_name,confidentiality_level, task_status,task_no,task_name,confidentiality_level,
product_name,product_model, product_name,product_model,
entrusted_unit,entrusted_unit_address,entrusted_unit_phone, entrusted_unit,entrusted_unit_address,entrusted_unit_phone,
entrusted_unit_code,vehicle_sample_information,part_sample_information, entrusted_unit_code,vehicle_sample_information,part_sample_information,
...@@ -87,7 +87,6 @@ ...@@ -87,7 +87,6 @@
t.leader_id,t.leader, t.leader_id,t.leader,
t.task_begin_time, t.task_begin_time,
t.product_model, t.product_model,
t.next_node,
srt.task_begin_time system_task_begin_time, srt.task_begin_time system_task_begin_time,
srt.task_end_time system_task_end_time, srt.task_end_time system_task_end_time,
srt.task_status review_status, srt.task_status review_status,
...@@ -168,7 +167,6 @@ ...@@ -168,7 +167,6 @@
t.leader_id,t.leader, t.leader_id,t.leader,
t.task_begin_time, t.task_begin_time,
t.task_end_time, t.task_end_time,
t.next_node,
srt.task_begin_time system_task_begin_time, srt.task_begin_time system_task_begin_time,
srt.task_end_time system_task_end_time, srt.task_end_time system_task_end_time,
srt.task_status review_status, srt.task_status review_status,
...@@ -241,7 +239,7 @@ ...@@ -241,7 +239,7 @@
</select> </select>
<select id="getByUserIdTemporary" resultType="com.ruoyi.domain.Task"> <select id="getByUserIdTemporary" resultType="com.ruoyi.domain.Task">
SELECT id, system_review_task_id, car_review_task_id, SELECT id, system_review_task_id, car_review_task_id,
task_status,run_status,next_node,task_no,task_name,confidentiality_level, task_status,run_status,task_no,task_name,confidentiality_level,
product_name,product_model, product_name,product_model,
entrusted_unit,entrusted_unit_address,entrusted_unit_phone, entrusted_unit,entrusted_unit_address,entrusted_unit_phone,
entrusted_unit_code,vehicle_sample_information,part_sample_information, entrusted_unit_code,vehicle_sample_information,part_sample_information,
...@@ -254,7 +252,7 @@ ...@@ -254,7 +252,7 @@
</select> </select>
<select id="getBySubtaskId" resultType="com.ruoyi.domain.Task"> <select id="getBySubtaskId" resultType="com.ruoyi.domain.Task">
SELECT id, system_review_task_id, car_review_task_id, SELECT id, system_review_task_id, car_review_task_id,
task_status,run_status,next_node,task_no,task_name,confidentiality_level, task_status,run_status,task_no,task_name,confidentiality_level,
product_name,product_model, product_name,product_model,
entrusted_unit,entrusted_unit_address,entrusted_unit_phone, entrusted_unit,entrusted_unit_address,entrusted_unit_phone,
entrusted_unit_code,vehicle_sample_information,part_sample_information, entrusted_unit_code,vehicle_sample_information,part_sample_information,
......
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