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