Commit 4c6ab9b0 authored by 王飞's avatar 王飞

Merge branch 'wangdingyi' into 'dev'

查询处理中总任务&处理完成总任务

See merge request !58
parents a16f6728 914ae58d
...@@ -31,6 +31,10 @@ public class CarReviewTask implements Serializable { ...@@ -31,6 +31,10 @@ public class CarReviewTask implements Serializable {
public static final String TASK_STATUS_FINISH = "FINISH"; public static final String TASK_STATUS_FINISH = "FINISH";
@TableField(exist = false)
public static final String TYPE = "car";
@TableField(exist = false) @TableField(exist = false)
public static final String REVIEW_STATUS_NONE = "NONE"; public static final String REVIEW_STATUS_NONE = "NONE";
......
...@@ -36,6 +36,10 @@ public class SystemReviewTask { ...@@ -36,6 +36,10 @@ public class SystemReviewTask {
public static final String STATUS_CLOSE = "CLOSE"; public static final String STATUS_CLOSE = "CLOSE";
@TableField(exist = false)
public static final String TYPE = "system";
/** /**
* 主键 * 主键
*/ */
......
...@@ -89,6 +89,10 @@ public class Task { ...@@ -89,6 +89,10 @@ public class Task {
@ApiModelProperty("样品名称") @ApiModelProperty("样品名称")
private String sampleName; private String sampleName;
@ApiModelProperty("生产企业id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long productionId;
@ApiModelProperty("生产企业") @ApiModelProperty("生产企业")
private String productionEnterprise; private String productionEnterprise;
......
...@@ -17,7 +17,7 @@ public interface ReviewDetailsMapper extends BaseMapper<ReviewDetails> { ...@@ -17,7 +17,7 @@ public interface ReviewDetailsMapper extends BaseMapper<ReviewDetails> {
* @param taskId * @param taskId
* @return * @return
*/ */
List<ReviewDetails> findNoResult(@Param("taskId") Long taskId); List<ReviewDetails> findNoResult(@Param("taskId") Long taskId, @Param("type") String type);
Long count (@Param("taskId")Long taskId, @Param("type")String type); Long count (@Param("taskId")Long taskId, @Param("type")String type);
} }
...@@ -90,11 +90,11 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init ...@@ -90,11 +90,11 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
@Override @Override
public void doConfirmReview(CarReviewTask carReviewTask) { public void doConfirmReview(CarReviewTask carReviewTask) {
List<ReviewDetails> detailsList = reviewDetailsMapper.findNoResult(carReviewTask.getId()); List<ReviewDetails> detailsList = reviewDetailsMapper.findNoResult(carReviewTask.getId(),CarReviewTask.TYPE);
List<ReviewTaskInbox> inboxList = reviewTaskInboxMapper.findConfirmListByTaskId(carReviewTask.getId()); List<ReviewTaskInbox> inboxList = reviewTaskInboxMapper.findConfirmListByTaskId(carReviewTask.getId());
if (detailsList != null) { if (detailsList.size() != 0 && detailsList != null) {
throw new ServiceException("存在未填写的问卷,请填写完整", HttpStatus.ERROR, detailsList); throw new ServiceException("存在未填写的问卷,请填写完整", HttpStatus.ERROR, detailsList);
}else if (inboxList != null ) { } else if (inboxList.size() != 0 && inboxList != null){
throw new ServiceException("存在未确认的场景变更信息,请确认", HttpStatus.ERROR); throw new ServiceException("存在未确认的场景变更信息,请确认", HttpStatus.ERROR);
}else { }else {
// 1. 获取最新问卷 // 1. 获取最新问卷
......
...@@ -72,12 +72,11 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask ...@@ -72,12 +72,11 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
@Override @Override
public void doConfirm(SystemReviewTask systemReviewTask) { public void doConfirm(SystemReviewTask systemReviewTask) {
// TODO List<ReviewDetails> detailsList = reviewDetailsMapper.findNoResult(systemReviewTask.getId(),SystemReviewTask.TYPE);
List<ReviewDetails> detailsList = reviewDetailsMapper.findNoResult(systemReviewTask.getId());
List<ReviewTaskInbox> inboxList = reviewTaskInboxMapper.findConfirmListByTaskId(systemReviewTask.getId()); List<ReviewTaskInbox> inboxList = reviewTaskInboxMapper.findConfirmListByTaskId(systemReviewTask.getId());
if (detailsList != null) { if (detailsList.size() != 0 && detailsList != null) {
throw new ServiceException("存在未填写的问卷,请填写完整", HttpStatus.ERROR, detailsList); throw new ServiceException("存在未填写的问卷,请填写完整", HttpStatus.ERROR, detailsList);
} else if (inboxList != null){ } else if (inboxList.size() != 0 && inboxList != null){
throw new ServiceException("存在未确认的场景变更信息,请确认", HttpStatus.ERROR); throw new ServiceException("存在未确认的场景变更信息,请确认", HttpStatus.ERROR);
} else { } else {
// 1. 获取最新问卷 // 1. 获取最新问卷
......
...@@ -8,10 +8,7 @@ import com.ruoyi.common.utils.SecurityUtils; ...@@ -8,10 +8,7 @@ import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.SnowflakeUtil; import com.ruoyi.common.utils.SnowflakeUtil;
import com.ruoyi.common.utils.bean.BeanUtils; import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.domain.*; import com.ruoyi.domain.*;
import com.ruoyi.mapper.CarReviewTaskMapper; import com.ruoyi.mapper.*;
import com.ruoyi.mapper.ReviewDetailsMapper;
import com.ruoyi.mapper.SystemReviewTaskMapper;
import com.ruoyi.mapper.TaskMapper;
import com.ruoyi.service.*; import com.ruoyi.service.*;
import com.ruoyi.system.service.ISysUserService; import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.web.request.*; import com.ruoyi.web.request.*;
...@@ -58,6 +55,9 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta ...@@ -58,6 +55,9 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
@Autowired @Autowired
private ReviewDetailsMapper reviewDetailsMapper; private ReviewDetailsMapper reviewDetailsMapper;
@Autowired
private AutomobileEnterpriseMapper automobileEnterpriseMapper;
@Override @Override
public List<Task> findList(TaskListRequest request) { public List<Task> findList(TaskListRequest request) {
return taskMapper.findList(request); return taskMapper.findList(request);
...@@ -93,6 +93,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta ...@@ -93,6 +93,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
task.setName(standard.getName()); task.setName(standard.getName());
task.setStandardNo(standard.getStandardNo()); task.setStandardNo(standard.getStandardNo());
task.setFile(standard.getFile()); task.setFile(standard.getFile());
AutomobileEnterprise automobileEnterprise = automobileEnterpriseMapper.selectById(request.getProductionId());
task.setProductionEnterprise(automobileEnterprise.getEnterpriseName());
BeanUtils.copyBeanProp(task, request); BeanUtils.copyBeanProp(task, request);
Long systemReviewTaskId = null; Long systemReviewTaskId = null;
......
package com.ruoyi.web.request; package com.ruoyi.web.request;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.entity.SysDictData; import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.domain.TaskUserRelation; import com.ruoyi.domain.TaskUserRelation;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -53,8 +54,8 @@ public class TaskCreateRequest { ...@@ -53,8 +54,8 @@ public class TaskCreateRequest {
@ApiModelProperty("样品名称") @ApiModelProperty("样品名称")
private String sampleName; private String sampleName;
@ApiModelProperty("生产企业") @ApiModelProperty("生产企业id")
private String productionEnterprise; private Long productionId;
@ApiModelProperty("送样者") @ApiModelProperty("送样者")
private String sampleSender; private String sampleSender;
......
...@@ -11,11 +11,8 @@ import java.util.Date; ...@@ -11,11 +11,8 @@ import java.util.Date;
@Data @Data
public class TaskFindFinishRequest extends PageDomain { public class TaskFindFinishRequest extends PageDomain {
@ApiModelProperty("任务编号") @ApiModelProperty("任务编号或名称关键词")
private String taskNo; private String taskNoOrName;
@ApiModelProperty("名称关键词")
private String taskName;
@ApiModelProperty("任务开始时间") @ApiModelProperty("任务开始时间")
private Date taskBeginTime; private Date taskBeginTime;
......
...@@ -11,11 +11,8 @@ import java.util.Date; ...@@ -11,11 +11,8 @@ import java.util.Date;
@Data @Data
public class TaskFindPendingRequest extends PageDomain { public class TaskFindPendingRequest extends PageDomain {
@ApiModelProperty("任务编号") @ApiModelProperty("任务编号或名称关键词")
private String taskNo; private String taskNoOrName;
@ApiModelProperty("名称关键词")
private String taskName;
@ApiModelProperty("任务开始时间") @ApiModelProperty("任务开始时间")
private Date taskBeginTime; private Date taskBeginTime;
......
...@@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModel; ...@@ -5,6 +5,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import java.util.Date;
@ApiModel(value = "TaskFindPendingResponse", description = "进行中的总任务") @ApiModel(value = "TaskFindPendingResponse", description = "进行中的总任务")
@Data @Data
public class TaskFindPendingResponse { public class TaskFindPendingResponse {
...@@ -30,6 +32,9 @@ public class TaskFindPendingResponse { ...@@ -30,6 +32,9 @@ public class TaskFindPendingResponse {
@ApiModelProperty("任务状态(NEW、PENDING、FINISH)") @ApiModelProperty("任务状态(NEW、PENDING、FINISH)")
private String taskStatus; private String taskStatus;
@ApiModelProperty("总任务开始时间")
private Date taskBeginTime;
@JsonFormat(shape = JsonFormat.Shape.STRING) @JsonFormat(shape = JsonFormat.Shape.STRING)
@ApiModelProperty("审核组长id") @ApiModelProperty("审核组长id")
private Long leaderId; private Long leaderId;
...@@ -40,18 +45,30 @@ public class TaskFindPendingResponse { ...@@ -40,18 +45,30 @@ public class TaskFindPendingResponse {
@ApiModelProperty("体系审查任务状态") @ApiModelProperty("体系审查任务状态")
private String reviewStatus; private String reviewStatus;
@ApiModelProperty("车型审查任务状态")
private String carReviewStatus;
@ApiModelProperty("测试任务状态")
private String carTestStatus;
@ApiModelProperty("体系审查任务进度") @ApiModelProperty("体系审查任务进度")
private Long systemReview; private Long systemReview;
@ApiModelProperty("体系问卷任务开始时间")
private Date systemTaskBeginTime;
@ApiModelProperty("体系问卷任务开始时间")
private Date systemTaskEndTime;
@ApiModelProperty("车型审查任务状态")
private String carReviewStatus;
@ApiModelProperty("车型审查任务进度") @ApiModelProperty("车型审查任务进度")
private Long carReview; private Long carReview;
@ApiModelProperty("车辆问卷任务开始时间")
private Date carTaskBeginTime;
@ApiModelProperty("车辆问卷任务开始时间")
private Date carTaskEndTime;
@ApiModelProperty("测试任务状态")
private String carTestStatus;
@ApiModelProperty("测试任务进度") @ApiModelProperty("测试任务进度")
private Long carTest; private Long carTest;
} }
...@@ -66,6 +66,10 @@ public class TaskGetInfoResponse { ...@@ -66,6 +66,10 @@ public class TaskGetInfoResponse {
@ApiModelProperty("样品名称") @ApiModelProperty("样品名称")
private String sampleName; private String sampleName;
@ApiModelProperty("生产企业id")
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long productionId;
@ApiModelProperty("生产企业") @ApiModelProperty("生产企业")
private String productionEnterprise; private String productionEnterprise;
......
...@@ -15,7 +15,11 @@ ...@@ -15,7 +15,11 @@
</select> </select>
<select id="findNoResult" resultType="com.ruoyi.domain.ReviewDetails"> <select id="findNoResult" resultType="com.ruoyi.domain.ReviewDetails">
SELECT * FROM t_review_details WHERE id NOT IN (SELECT review_details_id FROM t_review_details_result WHERE task_id = #{taskId}) SELECT * FROM t_review_details trd
LEFT JOIN t_review_keypoint trk ON trd.review_keypoint_id = trk.id
LEFT JOIN t_review_standard trs ON trk.review_standard_id = trs.id
WHERE trd.id NOT IN (SELECT review_details_id FROM t_review_details_result WHERE task_id = #{taskId})
AND trs.type = #{type}
</select> </select>
<select id="count" resultType="long"> <select id="count" resultType="long">
......
...@@ -11,19 +11,22 @@ ...@@ -11,19 +11,22 @@
<result property="imagesUrl" column="images_url" jdbcType="VARCHAR"/> <result property="imagesUrl" column="images_url" jdbcType="VARCHAR"/>
<result property="reviewDetailsId" column="review_details_id" jdbcType="BIGINT"/> <result property="reviewDetailsId" column="review_details_id" jdbcType="BIGINT"/>
<result property="taskId" column="task_id" jdbcType="BIGINT"/> <result property="taskId" column="task_id" jdbcType="BIGINT"/>
<result property="userId" column="user_id" jdbcType="BIGINT"/>
<result property="userName" column="user_name" jdbcType="VARCHAR"/>
<result property="lastModifyTime" column="last_modify_time" jdbcType="TIMESTAMP"/>
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id,passed,scene_id, select id,passed,scene_id,
scene,imagesUrl,review_details_id, scene,imagesUrl,review_details_id,
task_no task_id from t_review_details_result
</sql> </sql>
<select id="findByTaskId" resultType="com.ruoyi.domain.ReviewDetailsResult"> <select id="findByTaskId" resultType="com.ruoyi.domain.ReviewDetailsResult">
SELECT id, passed, comment, images_url, review_details_id, task_id FROM t_review_details_result WHERE task_id = #{taskId} SELECT id, passed, comment, images_url, review_details_id, task_id, user_id, user_name, last_modify_time FROM t_review_details_result WHERE task_id = #{taskId}
</select> </select>
<select id="findByTaskIdAndDetailsId" resultType="com.ruoyi.domain.ReviewDetailsResult"> <select id="findByTaskIdAndDetailsId" resultType="com.ruoyi.domain.ReviewDetailsResult">
SELECT id, passed, comment, images_url, review_details_id, task_id SELECT id, passed, comment, images_url, review_details_id, task_id, user_id, user_name, last_modify_time
FROM t_review_details_result FROM t_review_details_result
WHERE task_id = #{taskId} and review_details_id = #{reviewDetailsId} WHERE task_id = #{taskId} and review_details_id = #{reviewDetailsId}
</select> </select>
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
<result property="carIdentificationCode" column="car_identification_code" jdbcType="VARCHAR"/> <result property="carIdentificationCode" column="car_identification_code" jdbcType="VARCHAR"/>
<result property="confidentialityLevel" column="confidentiality_level" jdbcType="VARCHAR"/> <result property="confidentialityLevel" column="confidentiality_level" jdbcType="VARCHAR"/>
<result property="sampleName" column="sample_name" jdbcType="VARCHAR"/> <result property="sampleName" column="sample_name" jdbcType="VARCHAR"/>
<result property="productionId" column="production_id" jdbcType="BIGINT"/>
<result property="productionEnterprise" column="production_enterprise" jdbcType="VARCHAR"/> <result property="productionEnterprise" column="production_enterprise" jdbcType="VARCHAR"/>
<result property="sampleSender" column="sample_sender" jdbcType="VARCHAR"/> <result property="sampleSender" column="sample_sender" jdbcType="VARCHAR"/>
<result property="sendDate" column="send_date" jdbcType="TIMESTAMP"/> <result property="sendDate" column="send_date" jdbcType="TIMESTAMP"/>
...@@ -48,6 +49,11 @@ ...@@ -48,6 +49,11 @@
<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="taskBeginTime" column="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="carTaskBeginTime" column="car_task_begin_time" jdbcType="TIMESTAMP"/>
<result property="carTaskEndTime" column="car_task_end_time" jdbcType="TIMESTAMP"/>
<result property="leaderId" column="leader_id" jdbcType="BIGINT"/> <result property="leaderId" column="leader_id" jdbcType="BIGINT"/>
<result property="leader" column="leader" jdbcType="VARCHAR"/> <result property="leader" column="leader" jdbcType="VARCHAR"/>
<result property="reviewStatus" column="review_status" jdbcType="VARCHAR"/> <result property="reviewStatus" column="review_status" jdbcType="VARCHAR"/>
...@@ -60,7 +66,7 @@ ...@@ -60,7 +66,7 @@
task_no,task_name,task_status,product_name,product_model, task_no,task_name,task_status,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_enterprise, confidentiality_level,sample_name,production_id,production_enterprise,
sample_sender,send_date,sample_number,production_date, sample_sender,send_date,sample_number,production_date,
trademark,inspection_basis,task_initiator,task_initiator_dept, trademark,inspection_basis,task_initiator,task_initiator_dept,
task_begin_time,task_end_time,create_time, task_begin_time,task_end_time,create_time,
...@@ -82,7 +88,11 @@ ...@@ -82,7 +88,11 @@
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,
srt.task_begin_time system_task_begin_time,
srt.task_end_time system_task_end_time,
srt.task_status review_status, 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.review_status car_review_status,
crt.test_status car_test_status crt.test_status car_test_status
FROM t_task t FROM t_task t
...@@ -90,11 +100,8 @@ ...@@ -90,11 +100,8 @@
left join t_car_review_task crt on t.car_review_task_id = crt.id left join t_car_review_task crt on t.car_review_task_id = crt.id
<where> <where>
t.task_status IN ("NEW","PENDING") t.task_status IN ("NEW","PENDING")
<if test="taskNo != null and taskNo != ''"> <if test="taskNoOrName != null and taskNoOrName != ''">
and t.task_no = #{taskNo} and (t.task_no = #{taskNoOrName} || t.task_name like concat('%',#{taskNoOrName},'%'))
</if>
<if test="taskName != null and taskName != ''">
and t.task_name like concat('%',#{taskName},'%')
</if> </if>
<if test="taskBeginTime != null and taskBeginTime != ''"> <if test="taskBeginTime != null and taskBeginTime != ''">
and t.task_begin_time = #{taskBeginTime} and t.task_begin_time = #{taskBeginTime}
...@@ -112,17 +119,14 @@ ...@@ -112,17 +119,14 @@
FROM t_task t FROM t_task t
<where> <where>
t.task_status IN ("FINISH") t.task_status IN ("FINISH")
<if test="taskNo != null and taskNo != ''"> <if test="taskNoOrName != null and taskNoOrName != ''">
and t.task_no = #{taskNo} and (t.task_no = #{taskNoOrName} || t.task_name like concat('%',#{taskNoOrName},'%'))
</if>
<if test="taskName != null and taskName != ''">
and t.task_name like concat('%',#{taskName},'%')
</if> </if>
<if test="taskBeginTime != null and taskBeginTime != ''"> <if test="taskBeginTime != null and taskBeginTime != ''">
and t.task_begin_time = #{taskBeginTime} and t.task_begin_time >= #{taskBeginTime}
</if> </if>
<if test="taskEndTime != null and taskEndTime != ''"> <if test="taskEndTime != null and taskEndTime != ''">
and t.task_end_time = #{taskEndTime} and t.task_end_time &lt;= #{taskEndTime}
</if> </if>
</where> </where>
</select> </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