Commit d4347e51 authored by 王飞's avatar 王飞

Merge branch 'wangdingyi' into 'dev'

车辆问卷状态修改

See merge request !60
parents 53225c24 3ffee819
...@@ -27,8 +27,6 @@ public class CarReviewTask implements Serializable { ...@@ -27,8 +27,6 @@ public class CarReviewTask implements Serializable {
@TableField(exist = false)
public static final String TASK_STATUS_NONE = "NONE";
@TableField(exist = false) @TableField(exist = false)
public static final String TASK_STATUS_NEW = "NEW"; public static final String TASK_STATUS_NEW = "NEW";
@TableField(exist = false) @TableField(exist = false)
...@@ -55,7 +53,7 @@ public class CarReviewTask implements Serializable { ...@@ -55,7 +53,7 @@ public class CarReviewTask implements Serializable {
/** /**
* 任务状态(PENDING、FINISH) * 任务状态(PENDING、FINISH)
*/ */
@ApiModelProperty("任务状态[NONE、NEW、PENDING、FINISH]") @ApiModelProperty("任务状态[NEW、PENDING、FINISH]")
private String taskStatus; private String taskStatus;
/** /**
......
...@@ -24,7 +24,9 @@ import java.util.List; ...@@ -24,7 +24,9 @@ import java.util.List;
public class Task { public class Task {
@TableField(exist = false) @TableField(exist = false)
public static final String STATUS_NEW = "NEW"; public static final String STATUS_RUNNABLE = "RUNNABLE";
@TableField(exist = false)
public static final String STATUS_RUNNING = "RUNNING";
@TableField(exist = false) @TableField(exist = false)
public static final String STATUS_FINISH = "FINISH"; public static final String STATUS_FINISH = "FINISH";
...@@ -59,6 +61,9 @@ public class Task { ...@@ -59,6 +61,9 @@ public class Task {
@ApiModelProperty("任务状态(NEW、FINISH)") @ApiModelProperty("任务状态(NEW、FINISH)")
private String taskStatus; private String taskStatus;
@ApiModelProperty("下一个节点 SUB_TASK_SRAIF(体系审查子任务)、SUB_TASK_TRFIS(车辆实验子任务)、SUB_TASK_GRFIS(车辆问卷子任务)")
private String nextNode;
@ApiModelProperty("产品名称") @ApiModelProperty("产品名称")
private String productName; private String productName;
......
...@@ -93,8 +93,6 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C ...@@ -93,8 +93,6 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C
.setFile(standard.getFile()); .setFile(standard.getFile());
if (request.getReview()) { if (request.getReview()) {
task.setTaskStatus(CarReviewTask.TASK_STATUS_NEW); task.setTaskStatus(CarReviewTask.TASK_STATUS_NEW);
} else {
task.setTaskStatus(CarReviewTask.TASK_STATUS_NONE);
} }
carReviewTaskService.save(task); carReviewTaskService.save(task);
......
package com.ruoyi.service.impl;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.domain.CarReviewTask;
import com.ruoyi.service.StrategyCarReviewTask;
import com.ruoyi.web.response.CarReviewTaskViewResponse;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Transactional
@Service
public class StrategyCarReviewTaskNone implements StrategyCarReviewTask, InitializingBean {
@Autowired
private StrategyCarReviewTaskContext strategyCarReviewTaskContext;
@Autowired
private ApplicationContext applicationContext;
@Override
public CarReviewTaskViewResponse doView(CarReviewTask carReviewTask) {
throw new ServiceException("不能查看一个不存在的任务", HttpStatus.ERROR);
}
@Override
public void doStartReview(CarReviewTask carReviewTask) {
throw new ServiceException("不能开始一个不存在的任务", HttpStatus.ERROR);
}
@Override
public void doConfirmReview(CarReviewTask carReviewTask) {
throw new ServiceException("不能确认一个不存在的任务", HttpStatus.ERROR);
}
@Override
public void doSubmitReview(CarReviewTask carReviewTask,String imagesUrl) {
throw new ServiceException("不能提交一个不存在的任务", HttpStatus.ERROR);
}
@Override
public void afterPropertiesSet() throws Exception {
strategyCarReviewTaskContext.putResource(CarReviewTask.TASK_STATUS_NONE, applicationContext.getBean(this.getClass()));
}
}
...@@ -86,7 +86,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta ...@@ -86,7 +86,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
Task task = new Task(); Task task = new Task();
task.setTaskInitiator(initiator.getNickName()); task.setTaskInitiator(initiator.getNickName());
task.setTaskInitiatorDept(initiator.getDept().getDeptName()); task.setTaskInitiatorDept(initiator.getDept().getDeptName());
task.setTaskStatus(Task.STATUS_NEW); task.setTaskStatus(Task.STATUS_RUNNABLE);
task.setLeaderId(leader.getUserId()); task.setLeaderId(leader.getUserId());
task.setLeader(leader.getName()); task.setLeader(leader.getName());
task.setCreateTime(new Date()); task.setCreateTime(new Date());
...@@ -101,9 +101,15 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta ...@@ -101,9 +101,15 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
Long carReviewTaskId = null; Long carReviewTaskId = null;
if (request.getTaskList().contains(Task.SUB_TASK_SRAIF)) { if (request.getTaskList().contains(Task.SUB_TASK_SRAIF)) {
task.setNextNode(Task.SUB_TASK_SRAIF);
// 保存体系审查任务 // 保存体系审查任务
systemReviewTaskId = saveSystemReview(request,initiator,standard,leader); systemReviewTaskId = saveSystemReview(request,initiator,standard,leader);
} else if (request.getTaskList().contains(Task.SUB_TASK_GRFIS)) {
task.setNextNode(Task.SUB_TASK_GRFIS);
} else if (request.getTaskList().contains(Task.SUB_TASK_TRFIS)) {
task.setNextNode(Task.SUB_TASK_TRFIS);
} }
if (request.getTaskList().contains(Task.SUB_TASK_GRFIS)) { if (request.getTaskList().contains(Task.SUB_TASK_GRFIS)) {
// 保存车型审查问卷任务 // 保存车型审查问卷任务
carReviewTaskId = saveCarReview(request,initiator,standard,leader); carReviewTaskId = saveCarReview(request,initiator,standard,leader);
...@@ -207,11 +213,10 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta ...@@ -207,11 +213,10 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
.setTaskNo(request.getTaskNo()) .setTaskNo(request.getTaskNo())
.setTaskInitiator(initiator.getNickName()) .setTaskInitiator(initiator.getNickName())
.setTaskInitiatorDept(initiator.getDept().getDeptName()) .setTaskInitiatorDept(initiator.getDept().getDeptName())
.setTaskStatus(taskList.contains(Task.SUB_TASK_GRFIS) ? CarReviewTask.TASK_STATUS_NEW : CarReviewTask.TASK_STATUS_NONE) .setTaskStatus(CarReviewTask.TASK_STATUS_NEW)
.setLeaderId(leader.getUserId()) .setLeaderId(leader.getUserId())
.setLeader(leader.getName()) .setLeader(leader.getName())
.setCreateTime(new Date()) .setCreateTime(new Date())
.setTaskBeginTime(new Date())
.setStandardId(standard.getId()) .setStandardId(standard.getId())
.setName(standard.getName()) .setName(standard.getName())
.setStandardNo(standard.getStandardNo()) .setStandardNo(standard.getStandardNo())
......
...@@ -32,6 +32,9 @@ public class TaskFindPendingResponse { ...@@ -32,6 +32,9 @@ public class TaskFindPendingResponse {
@ApiModelProperty("任务状态(NEW、PENDING、FINISH)") @ApiModelProperty("任务状态(NEW、PENDING、FINISH)")
private String taskStatus; private String taskStatus;
@ApiModelProperty("下一个节点 SUB_TASK_SRAIF(体系审查子任务)、SUB_TASK_TRFIS(车辆实验子任务)、SUB_TASK_GRFIS(车辆问卷子任务)")
private String nextNode;
@ApiModelProperty("总任务开始时间") @ApiModelProperty("总任务开始时间")
private Date taskBeginTime; private Date taskBeginTime;
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<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="taskStatus" column="task_status" jdbcType="VARCHAR"/> <result property="taskStatus" column="task_status" jdbcType="VARCHAR"/>
<result property="nextNode" column="next_node" jdbcType="VARCHAR"/>
<result property="productName" column="product_name" jdbcType="VARCHAR"/> <result property="productName" column="product_name" jdbcType="VARCHAR"/>
<result property="productModel" column="product_model" jdbcType="VARCHAR"/> <result property="productModel" column="product_model" jdbcType="VARCHAR"/>
<result property="entrustedUnit" column="entrusted_unit" jdbcType="VARCHAR"/> <result property="entrustedUnit" column="entrusted_unit" jdbcType="VARCHAR"/>
...@@ -49,6 +50,7 @@ ...@@ -49,6 +50,7 @@
<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="taskStatus" column="task_status" jdbcType="VARCHAR"/> <result property="taskStatus" column="task_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="systemTaskBeginTime" column="system_task_begin_time" jdbcType="TIMESTAMP"/> <result property="systemTaskBeginTime" column="system_task_begin_time" jdbcType="TIMESTAMP"/>
<result property="systemTaskEndTime" column="system_task_end_time" jdbcType="TIMESTAMP"/> <result property="systemTaskEndTime" column="system_task_end_time" jdbcType="TIMESTAMP"/>
...@@ -62,7 +64,7 @@ ...@@ -62,7 +64,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_no,task_name,task_status,product_name,product_model, task_no,task_name,task_status,next_node,product_name,product_model,
entrusted_unit,entrusted_unit_address,entrusted_unit_phone, entrusted_unit,entrusted_unit_address,entrusted_unit_phone,
entrusted_unit_code,car_type,car_identification_code, entrusted_unit_code,car_type,car_identification_code,
confidentiality_level,sample_name,production_id,production_enterprise, confidentiality_level,sample_name,production_id,production_enterprise,
...@@ -87,6 +89,7 @@ ...@@ -87,6 +89,7 @@
t.task_no,t.task_name,t.task_status, t.task_no,t.task_name,t.task_status,
t.leader_id,t.leader, t.leader_id,t.leader,
t.task_begin_time, t.task_begin_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,
......
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