Commit 5778c8eb authored by 王飞's avatar 王飞

Merge branch 'wangdingyi' into 'dev'

字段修改,车辆问卷状态修改

See merge request !59
parents 4c6ab9b0 b51a6844
......@@ -22,40 +22,21 @@ import lombok.experimental.Accessors;
@Accessors(chain = true)
@Data
public class CarReviewTask implements Serializable {
@TableField(exist = false)
public static final String TASK_STATUS_NEW = "NEW";
@TableField(exist = false)
public static final String TASK_STATUS_PENDING = "PENDING";
@TableField(exist = false)
public static final String TASK_STATUS_FINISH = "FINISH";
@TableField(exist = false)
public static final String TYPE = "car";
@TableField(exist = false)
public static final String REVIEW_STATUS_NONE = "NONE";
public static final String TASK_STATUS_NONE = "NONE";
@TableField(exist = false)
public static final String REVIEW_STATUS_NEW = "NEW";
@TableField(exist = false)
public static final String REVIEW_STATUS_PENDING = "PENDING";
@TableField(exist = false)
public static final String REVIEW_STATUS_SIGNED = "SIGNED";
@TableField(exist = false)
public static final String REVIEW_STATUS_FINISH = "FINISH";
@TableField(exist = false)
public static final String TEST_STATUS_NONE = "NONE";
public static final String TASK_STATUS_NEW = "NEW";
@TableField(exist = false)
public static final String TEST_STATUS_NEW = "NEW";
public static final String TASK_STATUS_PENDING = "PENDING";
@TableField(exist = false)
public static final String TEST_STATUS_PENDING = "PENDING";
public static final String TASK_STATUS_SIGNED = "SIGNED";
@TableField(exist = false)
public static final String TEST_STATUS_FINISH = "FINISH";
public static final String TASK_STATUS_FINISH = "FINISH";
/**
* 主键
......@@ -74,7 +55,7 @@ public class CarReviewTask implements Serializable {
/**
* 任务状态(PENDING、FINISH)
*/
@ApiModelProperty("任务状态(PENDING、FINISH)")
@ApiModelProperty("任务状态[NONE、NEW、PENDING、FINISH]")
private String taskStatus;
/**
......@@ -158,50 +139,20 @@ public class CarReviewTask implements Serializable {
@ApiModelProperty("文件路径")
private String file;
/**
* 车型问卷审查任务状态[NONE、NEW、PENDING、FINISH]
*/
@ApiModelProperty("车型问卷审查任务状态[NONE、NEW、PENDING、FINISH]")
private String reviewStatus;
/**
* 车型测试任务状态[NONE、NEW、PENDING、FINISH]
*/
@ApiModelProperty("车型测试任务状态[NONE、NEW、PENDING、FINISH]")
private String testStatus;
/**
* 车型问卷开始时间
*/
@ApiModelProperty("车型问卷开始时间")
private Date reviewStartTime;
/**
* 车型问卷提交时间
*/
@ApiModelProperty("车型问卷提交时间")
private Date reviewSubmitTime;
/**
* 车型问卷提交人id
*/
@JsonFormat(shape = JsonFormat.Shape.STRING)
@ApiModelProperty("车型问卷提交人id")
private Long reviewSubmitId;
@ApiModelProperty("提交人id")
private Long submitId;
/**
* 车型问卷提交人姓名
*/
@ApiModelProperty("车型问卷提交人姓名")
private String reviewSubmitName;
/**
* 车型问卷审查结果
*/
@ApiModelProperty("车型问卷审查结果")
private String reviewResult;
private String submitName;
@ApiModelProperty("问卷签名图片地址")
private String reviewImagesUrl;
private String imagesUrl;
}
......@@ -87,21 +87,14 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C
.setLeaderId(leader.getUserId())
.setLeader(leader.getName())
.setCreateTime(new Date())
.setTaskBeginTime(new Date())
.setStandardId(standard.getId())
.setName(standard.getName())
.setStandardNo(standard.getStandardNo())
.setFile(standard.getFile());
if (request.getReview()) {
task.setReviewStatus(CarReviewTask.REVIEW_STATUS_NEW);
task.setTaskStatus(CarReviewTask.TASK_STATUS_NEW);
} else {
task.setReviewStatus(CarReviewTask.REVIEW_STATUS_NONE);
}
if (request.getTest()) {
task.setTestStatus(CarReviewTask.TEST_STATUS_NEW);
} else {
task.setTestStatus(CarReviewTask.TEST_STATUS_NONE);
task.setTaskStatus(CarReviewTask.TASK_STATUS_NONE);
}
carReviewTaskService.save(task);
......@@ -117,27 +110,27 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C
@Override
public CarReviewTaskViewResponse viewReviewTask(Long taskId) {
CarReviewTask carReviewTask = carReviewTaskService.getById(taskId);
return strategyCarReviewTaskContext.getResource(carReviewTask.getReviewStatus()).doView(carReviewTask);
return strategyCarReviewTaskContext.getResource(carReviewTask.getTaskStatus()).doView(carReviewTask);
}
@Override
public void startReviewTask(CarReviewTaskStartRequest request) {
CarReviewTask carReviewTask = carReviewTaskService.getById(request.getTaskId());
strategyCarReviewTaskContext.getResource(carReviewTask.getReviewStatus()).doStartReview(carReviewTask);
strategyCarReviewTaskContext.getResource(carReviewTask.getTaskStatus()).doStartReview(carReviewTask);
}
@Override
public void confirmReviewTask(CarReviewTaskConfirmRequest request) {
CarReviewTask carReviewTask = carReviewTaskService.getById(request.getTaskId());
strategyCarReviewTaskContext.getResource(carReviewTask.getReviewStatus()).doConfirmReview(carReviewTask);
strategyCarReviewTaskContext.getResource(carReviewTask.getTaskStatus()).doConfirmReview(carReviewTask);
}
@Override
public void submitReviewTask(CarReviewTaskSubmitRequest request) {
CarReviewTask carReviewTask = carReviewTaskService.getById(request.getTaskId());
strategyCarReviewTaskContext.getResource(carReviewTask.getReviewStatus()).doSubmitReview(carReviewTask,request.getImagesUrl());
strategyCarReviewTaskContext.getResource(carReviewTask.getTaskStatus()).doSubmitReview(carReviewTask,request.getImagesUrl());
}
@Override
......
......@@ -72,7 +72,7 @@ public class ReviewTaskInboxServiceImpl extends ServiceImpl<ReviewTaskInboxMappe
public void doSaveNotifyByCarReview(Long reviewSceneChangeTaskId) {
// 查找所有受变更影响的体系审查任务(所有PENDING状态的任务)
List<CarReviewTask> pendingTasks = carReviewTaskService.findListByReviewStatus(CarReviewTask.REVIEW_STATUS_PENDING);
List<CarReviewTask> pendingTasks = carReviewTaskService.findListByStatus(CarReviewTask.TASK_STATUS_PENDING);
// 构建并保存提醒消息
List<ReviewTaskInbox> inboxes = new ArrayList();
......
......@@ -50,6 +50,6 @@ public class StrategyCarReviewTaskFinish implements StrategyCarReviewTask, Initi
@Override
public void afterPropertiesSet() throws Exception {
strategyCarReviewTaskContext.putResource(CarReviewTask.REVIEW_STATUS_FINISH, applicationContext.getBean(this.getClass()));
strategyCarReviewTaskContext.putResource(CarReviewTask.TASK_STATUS_FINISH, applicationContext.getBean(this.getClass()));
}
}
......@@ -56,8 +56,8 @@ public class StrategyCarReviewTaskNew implements StrategyCarReviewTask, Initiali
@Override
public void doStartReview(CarReviewTask carReviewTask) {
carReviewTask.setReviewStartTime(new Date());
carReviewTask.setReviewStatus(CarReviewTask.REVIEW_STATUS_PENDING);
carReviewTask.setTaskBeginTime(new Date());
carReviewTask.setTaskStatus(CarReviewTask.TASK_STATUS_PENDING);
carReviewTaskMapper.updateById(carReviewTask);
}
......@@ -73,6 +73,6 @@ public class StrategyCarReviewTaskNew implements StrategyCarReviewTask, Initiali
@Override
public void afterPropertiesSet() throws Exception {
strategyCarReviewTaskContext.putResource(CarReviewTask.REVIEW_STATUS_NEW, applicationContext.getBean(this.getClass()));
strategyCarReviewTaskContext.putResource(CarReviewTask.TASK_STATUS_NEW, applicationContext.getBean(this.getClass()));
}
}
......@@ -45,6 +45,6 @@ public class StrategyCarReviewTaskNone implements StrategyCarReviewTask, Initial
@Override
public void afterPropertiesSet() throws Exception {
strategyCarReviewTaskContext.putResource(CarReviewTask.REVIEW_STATUS_NONE, applicationContext.getBean(this.getClass()));
strategyCarReviewTaskContext.putResource(CarReviewTask.TASK_STATUS_NONE, applicationContext.getBean(this.getClass()));
}
}
......@@ -108,13 +108,13 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
carReviewTask.setStandard(standardTree);
// 4. 修改任务状态为 SIGNED 待签字
carReviewTask.setReviewStatus(CarReviewTask.REVIEW_STATUS_SIGNED);
carReviewTask.setTaskStatus(CarReviewTask.TASK_STATUS_SIGNED);
// 7. 设置问卷结果
if (reviewDetailsResultMapper.findNotPass(carReviewTask.getId()) > 0) {
carReviewTask.setReviewResult("REJECT");
carReviewTask.setTaskResult("REJECT");
} else {
carReviewTask.setReviewResult("PASS");
carReviewTask.setTaskResult("PASS");
}
carReviewTaskMapper.updateById(carReviewTask);
}
......@@ -151,6 +151,6 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
@Override
public void afterPropertiesSet() throws Exception {
strategyCarReviewTaskContext.putResource(CarReviewTask.REVIEW_STATUS_PENDING, applicationContext.getBean(this.getClass()));
strategyCarReviewTaskContext.putResource(CarReviewTask.TASK_STATUS_PENDING, applicationContext.getBean(this.getClass()));
}
}
......@@ -63,19 +63,19 @@ public class StrategyCarReviewTaskSigned implements StrategyCarReviewTask, Initi
public void doSubmitReview(CarReviewTask carReviewTask, String imagesUrl) {
// 1. 填充review_submit_time
carReviewTask.setReviewSubmitTime(new Date());
carReviewTask.setTaskEndTime(new Date());
// 2. 修改任务状态为 FINISH
carReviewTask.setReviewStatus(CarReviewTask.REVIEW_STATUS_FINISH);
carReviewTask.setTaskStatus(CarReviewTask.TASK_STATUS_FINISH);
// 3. 填写当前用户id
// 获取当前登陆人
SysUser loginUser = SecurityUtils.getLoginUser().getUser();
carReviewTask.setReviewSubmitId(loginUser.getUserId());
carReviewTask.setReviewSubmitName(loginUser.getNickName());
carReviewTask.setSubmitId(loginUser.getUserId());
carReviewTask.setSubmitName(loginUser.getNickName());
// 4. 保存签名图片地址
carReviewTask.setReviewImagesUrl(imagesUrl);
carReviewTask.setImagesUrl(imagesUrl);
carReviewTaskMapper.updateById(carReviewTask);
......@@ -84,6 +84,6 @@ public class StrategyCarReviewTaskSigned implements StrategyCarReviewTask, Initi
@Override
public void afterPropertiesSet() throws Exception {
strategyCarReviewTaskContext.putResource(CarReviewTask.REVIEW_STATUS_SIGNED, applicationContext.getBean(this.getClass()));
strategyCarReviewTaskContext.putResource(CarReviewTask.TASK_STATUS_SIGNED, applicationContext.getBean(this.getClass()));
}
}
......@@ -104,7 +104,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
// 保存体系审查任务
systemReviewTaskId = saveSystemReview(request,initiator,standard,leader);
}
if (request.getTaskList().contains(Task.SUB_TASK_GRFIS) || request.getTaskList().contains(Task.SUB_TASK_TRFIS)) {
if (request.getTaskList().contains(Task.SUB_TASK_GRFIS)) {
// 保存车型审查问卷任务
carReviewTaskId = saveCarReview(request,initiator,standard,leader);
}
......@@ -126,10 +126,10 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
List<TaskFindPendingResponse> responses = taskMapper.findPending(request);
for (TaskFindPendingResponse response : responses) {
if (response.getSystemReviewTaskId() != null) {
response.setSystemReview(reviewDetailsMapper.count(response.getSystemReviewTaskId(),"system"));
response.setSystemReview(reviewDetailsMapper.count(response.getSystemReviewTaskId(),SystemReviewTask.TYPE));
}
if (response.getCarReviewTaskId() != null) {
response.setCarReview(reviewDetailsMapper.count(response.getCarReviewTaskId(),"car"));
response.setCarReview(reviewDetailsMapper.count(response.getCarReviewTaskId(),CarReviewTask.TYPE));
}
}
return responses;
......@@ -207,7 +207,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
.setTaskNo(request.getTaskNo())
.setTaskInitiator(initiator.getNickName())
.setTaskInitiatorDept(initiator.getDept().getDeptName())
.setTaskStatus(CarReviewTask.TASK_STATUS_NEW)
.setTaskStatus(taskList.contains(Task.SUB_TASK_GRFIS) ? CarReviewTask.TASK_STATUS_NEW : CarReviewTask.TASK_STATUS_NONE)
.setLeaderId(leader.getUserId())
.setLeader(leader.getName())
.setCreateTime(new Date())
......@@ -215,9 +215,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
.setStandardId(standard.getId())
.setName(standard.getName())
.setStandardNo(standard.getStandardNo())
.setFile(standard.getFile())
.setReviewStatus(taskList.contains(Task.SUB_TASK_GRFIS) ? CarReviewTask.REVIEW_STATUS_NEW : CarReviewTask.REVIEW_STATUS_NONE)
.setTestStatus(taskList.contains(Task.SUB_TASK_TRFIS) ? CarReviewTask.TEST_STATUS_NEW : CarReviewTask.TEST_STATUS_NONE);
.setFile(standard.getFile());
carReviewTaskService.save(task);
return task.getId();
......
......@@ -21,14 +21,9 @@
<result property="name" column="name" jdbcType="VARCHAR"/>
<result property="standardNo" column="standard_no" jdbcType="VARCHAR"/>
<result property="file" column="file" jdbcType="VARCHAR"/>
<result property="reviewStatus" column="review_status" jdbcType="VARCHAR"/>
<result property="testStatus" column="test_status" jdbcType="VARCHAR"/>
<result property="reviewStartTime" column="review_start_time" jdbcType="TIMESTAMP"/>
<result property="reviewSubmitTime" column="review_submit_time" jdbcType="TIMESTAMP"/>
<result property="reviewSubmitId" column="review_submit_id" jdbcType="BIGINT"/>
<result property="reviewSubmitName" column="review_submit_name" jdbcType="VARCHAR"/>
<result property="reviewResult" column="review_result" jdbcType="VARCHAR"/>
<result property="reviewImagesUrl" column="review_images_url" jdbcType="VARCHAR"/>
<result property="submitId" column="submit_id" jdbcType="BIGINT"/>
<result property="submitName" column="submit_name" jdbcType="VARCHAR"/>
<result property="imagesUrl" column="images_url" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
......@@ -37,19 +32,17 @@
task_begin_time,task_end_time,standard,
create_time,leader_id,
leader,standard_id,name,
standard_no,file,review_status,
test_status,review_start_time,
review_submit_time,
review_submit_id,
review_submit_name,
review_result,review_images_url
standard_no,file,
submit_id,
submit_name,
images_url
</sql>
<select id="findListByReviewStatus" resultType="com.ruoyi.domain.CarReviewTask">
SELECT id,task_no,task_status,task_initiator,task_initiator_dept,task_result,task_begin_time,task_end_time,standard,create_time,leader_id,leader,standard_id,name,standard_no,file,review_status,test_status,review_start_time,review_submit_time,review_submit_id,review_submit_name,review_result,review_images_url
SELECT id,task_no,task_status,task_initiator,task_initiator_dept,task_result,task_begin_time,task_end_time,standard,create_time,leader_id,leader,standard_id,name,standard_no,file,submit_id,submit_name,images_url
FROM t_car_review_task WHERE review_status = #{reviewStatus} AND task_status = 'PENDING'
</select>
<select id="findListByTaskStatus" resultType="com.ruoyi.domain.CarReviewTask">
SELECT id,task_no,task_status,task_initiator,task_initiator_dept,task_result,task_begin_time,task_end_time,standard,create_time,leader_id,leader,standard_id,name,standard_no,file,review_status,test_status,review_start_time,review_submit_time,review_submit_id,review_submit_name,review_result,review_images_url
SELECT id,task_no,task_status,task_initiator,task_initiator_dept,task_result,task_begin_time,task_end_time,standard,create_time,leader_id,leader,standard_id,name,standard_no,file,submit_id,submit_name,images_url
FROM t_car_review_task WHERE task_status = #{taskStatus}
</select>
</mapper>
......@@ -58,7 +58,6 @@
<result property="leader" column="leader" jdbcType="VARCHAR"/>
<result property="reviewStatus" column="review_status" jdbcType="VARCHAR"/>
<result property="carReviewStatus" column="car_review_status" jdbcType="VARCHAR"/>
<result property="carTestStatus" column="car_test_status" jdbcType="VARCHAR"/>
</resultMap>
<select id="findList" parameterType="com.ruoyi.web.request.TaskListRequest" resultMap="BaseResultMap">
......@@ -91,10 +90,9 @@
srt.task_begin_time system_task_begin_time,
srt.task_end_time system_task_end_time,
srt.task_status review_status,
crt.review_start_time car_task_begin_time,
crt.review_submit_time car_task_end_time,
crt.review_status car_review_status,
crt.test_status car_test_status
crt.task_begin_time car_task_begin_time,
crt.task_end_time car_task_end_time,
crt.task_status car_review_status
FROM t_task t
left join t_system_review_task srt on t.system_review_task_id = srt.id
left join t_car_review_task crt on t.car_review_task_id = crt.id
......@@ -107,7 +105,7 @@
and t.task_begin_time = #{taskBeginTime}
</if>
<if test="subStatus != null and subStatus != ''">
and (srt.task_status = #{subStatus} OR crt.review_status = #{subStatus} OR crt.test_status = #{subStatus})
and (srt.task_status = #{subStatus} OR crt.task_status = #{subStatus})
</if>
</where>
</select>
......
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