Commit e4224c73 authored by 王飞's avatar 王飞

Merge branch 'wangfei' into 'dev'

Wangfei

See merge request !29
parents a602cf86 7e263db0
package com.ruoyi.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* 车型审查任务
* @TableName t_car_review_task
*/
@TableName(value ="t_car_review_task")
@Data
public class CarReviewTask implements Serializable {
@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 REVIEW_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_FINISH = "FINISH";
@TableField(exist = false)
public static final String TEST_STATUS_NONE = "NONE";
@TableField(exist = false)
public static final String TEST_STATUS_NEW = "NEW";
@TableField(exist = false)
public static final String TEST_STATUS_PENDING = "PENDING";
@TableField(exist = false)
public static final String TEST_STATUS_FINISH = "FINISH";
/**
* 主键
*/
@ApiModelProperty("主键")
@TableId(type = IdType.ASSIGN_ID)
private Long id;
/**
* 任务编号
*/
@ApiModelProperty("任务编号")
private String taskNo;
/**
* 任务状态(PENDING、FINISH)
*/
@ApiModelProperty("任务状态(PENDING、FINISH)")
private String taskStatus;
/**
* 任务发起人姓名
*/
@ApiModelProperty("任务发起人姓名")
private String taskInitiator;
/**
* 任务发起人部门
*/
@ApiModelProperty("任务发起人部门")
private String taskInitiatorDept;
/**
* 任务结果(PASS、REJECT)
*/
@ApiModelProperty("任务结果(PASS、REJECT)")
private String taskResult;
/**
* 任务开始时间
*/
@ApiModelProperty("任务开始时间")
private Date taskBeginTime;
/**
* 任务结束时间
*/
@ApiModelProperty("任务结束时间")
private Date taskEndTime;
/**
* 审查标准
*/
@ApiModelProperty("审查标准")
private Object standard;
/**
* 占位(开发人员根据具体业务自行增加业务字段)
*/
@ApiModelProperty("占位(开发人员根据具体业务自行增加业务字段)")
private String bizInfo;
/**
* 创建时间
*/
@ApiModelProperty("创建时间")
private Date createTime;
/**
* 审查组长id
*/
@ApiModelProperty("审查组长id")
private Long leaderId;
/**
* 审查组长姓名
*/
@ApiModelProperty("审查组长姓名")
private String leader;
/**
* 关联标准表id
*/
@ApiModelProperty("关联标准表id")
private Long standardId;
/**
* 标准名称
*/
@ApiModelProperty("标准名称")
private String name;
/**
* 标准号
*/
@ApiModelProperty("标准号")
private String standardNo;
/**
* 文件路径
*/
@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;
}
\ No newline at end of file
......@@ -77,6 +77,12 @@ public class ReviewSceneChangeTask {
@ApiModelProperty("审查标准")
private String standard;
/**
* 检查类型[system(体系审查)、car(车型审查)]
*/
@ApiModelProperty("检查类型[system(体系审查)、car(车型审查)]")
private String type;
/**
* 审查要点id
*/
......
......@@ -9,14 +9,14 @@ import lombok.Data;
import lombok.experimental.Accessors;
/**
* 体系审查任务收件箱(目前用来获取审查场景变更通知)
* @TableName t_system_review_task_inbox
* 审查问卷任务收件箱(目前用来获取审查场景变更通知)
* @TableName t_review_task_inbox
*/
@ApiModel
@TableName(value ="t_system_review_task_inbox")
@Accessors(chain = true)
@Data
public class SystemReviewTaskInbox {
public class ReviewTaskInbox {
/**
* 主键
*/
......@@ -28,7 +28,7 @@ public class SystemReviewTaskInbox {
* 体系审查任务id
*/
@ApiModelProperty("体系审查任务id")
private Long systemReviewTaskId;
private Long reviewTaskId;
/**
* 场景变更任务id
......
package com.ruoyi.mapper;
import com.ruoyi.domain.CarReviewTask;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* @author wangfei
* @description 针对表【t_car_review_task(车型审查任务)】的数据库操作Mapper
* @createDate 2024-01-08 13:14:13
* @Entity com.ruoyi.domain.CarReviewTask
*/
@Repository
public interface CarReviewTaskMapper extends BaseMapper<CarReviewTask> {
List<CarReviewTask> findListByReviewStatus(@Param("reviewStatus") String reviewStatus);
}
package com.ruoyi.mapper;
import com.ruoyi.domain.SystemReviewTaskInbox;
import com.ruoyi.domain.ReviewTaskInbox;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
......@@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
* @createDate 2023-12-26 09:55:39
* @Entity com.ruoyi.domain.SystemReviewTaskInbox
*/
public interface SystemReviewTaskInboxMapper extends BaseMapper<SystemReviewTaskInbox> {
public interface ReviewTaskInboxMapper extends BaseMapper<ReviewTaskInbox> {
}
......
package com.ruoyi.service;
import com.ruoyi.domain.CarReviewTask;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.web.request.*;
import com.ruoyi.web.response.SystemReviewTaskViewResponse;
import java.util.List;
/**
* @author wangfei
* @description 针对表【t_car_review_task(车型审查任务)】的数据库操作Service
* @createDate 2024-01-08 13:14:13
*/
public interface CarReviewTaskService extends IService<CarReviewTask> {
/**
* 根据问卷状态查询进行中的任务
* @param reviewStatus
* @return
*/
List<CarReviewTask> findListByReviewStatus(String reviewStatus);
/**
* 创建一个车辆审查任务
*/
void createTask(CarReviewTaskCreateRequest request);
/**
* 查看车辆审查任务
* @param taskId
* @return
*/
SystemReviewTaskViewResponse view(Long taskId);
/**
* 开始一个车辆审查任务中的问卷任务
*/
void startReviewTask(CarReviewTaskStartRequest request);
/**
* 提交一个车辆审查任务中的问卷任务
* @param request
*/
void submitReviewTask(CarReviewTaskSubmitRequest request);
/**
* 根据状态查找车辆审查任务
* @return
*/
List<CarReviewTask> findListByStatus(String status);
/**
* 查询处理中的任务
* @return
*/
List<CarReviewTask> findListInProcess();
}
package com.ruoyi.service;
import com.ruoyi.domain.SystemReviewTaskInbox;
import com.ruoyi.domain.ReviewTaskInbox;
import com.baomidou.mybatisplus.extension.service.IService;
/**
......@@ -8,12 +8,12 @@ import com.baomidou.mybatisplus.extension.service.IService;
* @description 针对表【t_system_review_task_inbox(体系审查任务收件箱(目前用来获取审查场景变更通知))】的数据库操作Service
* @createDate 2023-12-26 09:55:39
*/
public interface SystemReviewTaskInboxService extends IService<SystemReviewTaskInbox> {
public interface ReviewTaskInboxService extends IService<ReviewTaskInbox> {
/**
* 对受变更影响的问卷生成提醒消息
* @param reviewSceneChangeTaskId
*/
void saveNotify(Long reviewSceneChangeTaskId);
void saveNotify(Long reviewSceneChangeTaskId, String type);
}
package com.ruoyi.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.domain.CarReviewTask;
import com.ruoyi.service.CarReviewTaskService;
import com.ruoyi.mapper.CarReviewTaskMapper;
import com.ruoyi.web.request.CarReviewTaskCreateRequest;
import com.ruoyi.web.request.CarReviewTaskStartRequest;
import com.ruoyi.web.request.CarReviewTaskSubmitRequest;
import com.ruoyi.web.response.SystemReviewTaskViewResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
/**
* @author wangfei
* @description 针对表【t_car_review_task(车型审查任务)】的数据库操作Service实现
* @createDate 2024-01-08 13:14:13
*/
@Transactional
@Service
public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, CarReviewTask>
implements CarReviewTaskService{
@Autowired
private CarReviewTaskMapper carReviewTaskMapper;
@Override
public List<CarReviewTask> findListByReviewStatus(String reviewStatus) {
return carReviewTaskMapper.findListByReviewStatus(reviewStatus);
}
@Override
public void createTask(CarReviewTaskCreateRequest request) {
}
@Override
public SystemReviewTaskViewResponse view(Long taskId) {
return null;
}
@Override
public void startReviewTask(CarReviewTaskStartRequest request) {
}
@Override
public void submitReviewTask(CarReviewTaskSubmitRequest request) {
}
@Override
public List<CarReviewTask> findListByStatus(String status) {
return null;
}
@Override
public List<CarReviewTask> findListInProcess() {
return null;
}
}
......@@ -11,7 +11,7 @@ import com.ruoyi.service.ReviewSceneChangeTaskService;
import com.ruoyi.mapper.ReviewSceneChangeTaskMapper;
import com.ruoyi.service.ReviewSceneChangeTaskUserRelationService;
import com.ruoyi.service.ReviewSceneService;
import com.ruoyi.service.SystemReviewTaskInboxService;
import com.ruoyi.service.ReviewTaskInboxService;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.web.response.ReviewSceneChangeTaskResponse;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -44,7 +44,7 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
private ReviewSceneService reviewSceneService;
@Autowired
private SystemReviewTaskInboxService systemReviewTaskInboxService;
private ReviewTaskInboxService reviewTaskInboxService;
@Autowired
private ReviewSceneChangeTaskMapper reviewSceneChangeTaskMapper;
......@@ -129,7 +129,7 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
reviewSceneService.change(task);
// 通知受影响的问卷
systemReviewTaskInboxService.saveNotify(taskId);
reviewTaskInboxService.saveNotify(taskId, task.getType());
}
}
......
package com.ruoyi.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.domain.CarReviewTask;
import com.ruoyi.domain.ReviewStandard;
import com.ruoyi.domain.SystemReviewTask;
import com.ruoyi.domain.SystemReviewTaskInbox;
import com.ruoyi.service.SystemReviewTaskInboxService;
import com.ruoyi.mapper.SystemReviewTaskInboxMapper;
import com.ruoyi.domain.ReviewTaskInbox;
import com.ruoyi.service.CarReviewTaskService;
import com.ruoyi.service.ReviewTaskInboxService;
import com.ruoyi.mapper.ReviewTaskInboxMapper;
import com.ruoyi.service.SystemReviewTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -20,27 +25,70 @@ import java.util.List;
*/
@Transactional
@Service
public class SystemReviewTaskInboxServiceImpl extends ServiceImpl<SystemReviewTaskInboxMapper, SystemReviewTaskInbox> implements SystemReviewTaskInboxService {
public class ReviewTaskInboxServiceImpl extends ServiceImpl<ReviewTaskInboxMapper, ReviewTaskInbox> implements ReviewTaskInboxService {
@Autowired
private SystemReviewTaskService systemReviewTaskService;
@Autowired
private CarReviewTaskService carReviewTaskService;
/**
* 保存场景变更对进行中的问卷产生的影响,用于提醒问卷使用者场景发生了变更。
* 体系审查任务、侧性审查任务分别查询不同的表
* @param reviewSceneChangeTaskId
* @param type
*/
@Override
public void saveNotify(Long reviewSceneChangeTaskId) {
public void saveNotify(Long reviewSceneChangeTaskId, String type) {
if(ReviewStandard.TYPE_SYSTEM.equals(type)) {
doSaveNotifyBySystemReview(reviewSceneChangeTaskId);
} else if(ReviewStandard.TYPE_CAR.equals(type)) {
doSaveNotifyByCarReview(reviewSceneChangeTaskId);
} else {
throw new ServiceException("未知的检查类型[" + type + "]",HttpStatus.ERROR);
}
}
public void doSaveNotifyByCarReview(Long reviewSceneChangeTaskId) {
// 查找所有受变更影响的体系审查任务(所有PENDING状态的任务)
List<CarReviewTask> pendingTasks = carReviewTaskService.findListByReviewStatus(CarReviewTask.REVIEW_STATUS_PENDING);
// 构建并保存提醒消息
List<ReviewTaskInbox> inboxes = new ArrayList();
for(CarReviewTask task : pendingTasks) {
ReviewTaskInbox inbox = new ReviewTaskInbox()
.setReviewSceneChangeTaskId(reviewSceneChangeTaskId)
.setReviewTaskId(task.getId())
.setIsConfirm(0);
inboxes.add(inbox);
}
saveBatch(inboxes);
}
public void doSaveNotifyBySystemReview(Long reviewSceneChangeTaskId) {
// 查找所有受变更影响的体系审查任务(所有PENDING状态的任务)
List<SystemReviewTask> pendingTasks = systemReviewTaskService.findListByStatus(SystemReviewTask.STATUS_PENDING);
// 构建并保存提醒消息
List<SystemReviewTaskInbox> inboxes = new ArrayList();
List<ReviewTaskInbox> inboxes = new ArrayList();
for(SystemReviewTask task : pendingTasks) {
SystemReviewTaskInbox inbox = new SystemReviewTaskInbox()
ReviewTaskInbox inbox = new ReviewTaskInbox()
.setReviewSceneChangeTaskId(reviewSceneChangeTaskId)
.setSystemReviewTaskId(task.getId())
.setReviewTaskId(task.getId())
.setIsConfirm(0);
inboxes.add(inbox);
}
saveBatch(inboxes);
}
}
......
package com.ruoyi.web;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Api("车辆审查任务")
@RestController
@RequestMapping("/car/review/task")
public class CarReviewTaskController {
}
package com.ruoyi.web.request;
public class CarReviewTaskCreateRequest {
}
package com.ruoyi.web.request;
import lombok.Data;
@Data
public class CarReviewTaskStartRequest {
private Long taskId;
}
package com.ruoyi.web.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "CarReviewTaskSubmitRequest", description = "提交车辆审查问卷")
@Data
public class CarReviewTaskSubmitRequest {
@ApiModelProperty("任务id")
private Long taskId;
@ApiModelProperty("图片地址")
private String imagesUrl;
}
......@@ -26,6 +26,12 @@ public class ReviewSceneChangeTaskCreateRequest {
@ApiModelProperty("审查标准")
private String standard;
/**
* 检查类型[system(体系审查)、car(车型审查)]
*/
@ApiModelProperty("检查类型[system(体系审查)、car(车型审查)]")
private String type;
/**
* 审查要点id
*/
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.mapper.CarReviewTaskMapper">
<resultMap id="BaseResultMap" type="com.ruoyi.domain.CarReviewTask">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="taskNo" column="task_no" jdbcType="VARCHAR"/>
<result property="taskStatus" column="task_status" jdbcType="VARCHAR"/>
<result property="taskInitiator" column="task_initiator" jdbcType="VARCHAR"/>
<result property="taskInitiatorDept" column="task_initiator_dept" jdbcType="VARCHAR"/>
<result property="taskResult" column="task_result" jdbcType="VARCHAR"/>
<result property="taskBeginTime" column="task_begin_time" jdbcType="TIMESTAMP"/>
<result property="taskEndTime" column="task_end_time" jdbcType="TIMESTAMP"/>
<result property="standard" column="standard" jdbcType="OTHER"/>
<result property="bizInfo" column="biz_info" jdbcType="VARCHAR"/>
<result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
<result property="leaderId" column="leader_id" jdbcType="BIGINT"/>
<result property="leader" column="leader" jdbcType="VARCHAR"/>
<result property="standardId" column="standard_id" jdbcType="BIGINT"/>
<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"/>
</resultMap>
<sql id="Base_Column_List">
id,task_no,task_status,
task_initiator,task_initiator_dept,task_result,
task_begin_time,task_end_time,standard,
biz_info,create_time,leader_id,
leader,standard_id,name,
standard_no,file,review_status,
test_status
</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,biz_info,create_time,leader_id,leader,standard_id,name,standard_no,file,review_status,test_status
FROM t_system_review_task WHERE review_status = #{reviewStatus} AND task_status = 'PENDING'
</select>
</mapper>
......@@ -2,17 +2,16 @@
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.mapper.SystemReviewTaskInboxMapper">
<mapper namespace="com.ruoyi.mapper.ReviewTaskInboxMapper">
<resultMap id="BaseResultMap" type="com.ruoyi.domain.SystemReviewTaskInbox">
<resultMap id="BaseResultMap" type="com.ruoyi.domain.ReviewTaskInbox">
<id property="id" column="id" jdbcType="BIGINT"/>
<result property="systemReviewTaskId" column="system_review_task_id" jdbcType="BIGINT"/>
<result property="reviewTaskId" column="review_task_id" jdbcType="BIGINT"/>
<result property="reviewSceneChangeTaskId" column="review_scene_change_task_id" jdbcType="BIGINT"/>
<result property="isConfirm" column="is_confirm" jdbcType="TINYINT"/>
</resultMap>
<sql id="Base_Column_List">
id,system_review_task_id,review_scene_change_task_id,
is_confirm
id,review_task_id,review_scene_change_task_id,is_confirm
</sql>
</mapper>
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