Commit aa73859d authored by wdy's avatar wdy

创建任务&查询发布的任务&查询待办任务&查询已办任务

parent 2da01ad0
......@@ -102,10 +102,10 @@ public class Task {
@ApiModelProperty("委托单位邮政编码")
private String entrustedUnitCode;
@ApiModelProperty("整车样品信息id")
@ApiModelProperty("整车样品信息")
private String vehicleSampleInformation;
@ApiModelProperty("零件样品信息id")
@ApiModelProperty("零件样品信息")
private String partSampleInformation;
@ApiModelProperty("任务发起人id")
......
......@@ -59,6 +59,9 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
@Autowired
private TaskStateFacade taskStateFacade;
@Autowired
private TaskSampleRelationService taskSampleRelationService;
@Override
public List<Task> findList(TaskListRequest request) {
......@@ -86,8 +89,6 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
// 构建并保存任务信息
// 总任务
Task task = new Task();
task.setVehicleSampleInformation(String.join(",",request.getVehicleSampleInformation()));
task.setPartSampleInformation(String.join(",",request.getPartSampleInformation()));
task.setTaskInitiatorId(loginUser.getUserId());
task.setTaskInitiator(initiator.getNickName());
task.setTaskInitiatorDept(initiator.getDept().getDeptName());
......@@ -118,6 +119,16 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
taskUserRelationService.saveBatch(auditors);
// 保存关联的样品信息
List<TaskSampleRelation> relations = request.getSample();
if (relations.size() != 0 && relations != null) {
for (TaskSampleRelation sampleRelation : relations) {
sampleRelation.setTaskId(task.getId());
}
taskSampleRelationService.saveBatch(relations);
}
taskStateFacade.doCreate(task, request.getTaskList());
}
......@@ -188,6 +199,14 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
@Override
public List<TaskFindResponse> findCreate(TaskFindRequest request,Long userId) {
List<TaskFindResponse> responses = taskMapper.findByUserId(request,userId);
for (TaskFindResponse response : responses) {
if (response.getSystemReviewTaskId() != null) {
response.setSystemReview(reviewDetailsMapper.count(response.getSystemReviewTaskId(),SystemReviewTask.TYPE));
}
if (response.getCarReviewTaskId() != null) {
response.setCarReview(reviewDetailsMapper.count(response.getCarReviewTaskId(),CarReviewTask.TYPE));
}
}
return responses;
}
......
......@@ -53,6 +53,8 @@ public class TaskStateNew implements TaskState, InitializingBean {
}
task.setNextNode(nextNode);
taskService.updateById(task);
}
@Override
......
......@@ -2,6 +2,7 @@ package com.ruoyi.web.request;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.domain.TaskSampleRelation;
import com.ruoyi.domain.TaskUserRelation;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
......@@ -52,11 +53,8 @@ public class TaskCreateRequest {
@ApiModelProperty("委托单位邮政编码")
private String entrustedUnitCode;
@ApiModelProperty("整车样品信息id")
private List<String> vehicleSampleInformation;
@ApiModelProperty("零件样品信息id")
private List<String> partSampleInformation;
@ApiModelProperty("样品信息")
private List<TaskSampleRelation> sample;
@ApiModelProperty("选择的任务")
List<String> taskList;
......
......@@ -11,12 +11,18 @@ import java.util.Date;
@Data
public class TaskFindFinishRequest extends PageDomain {
@ApiModelProperty("任务编号或名称关键词")
private String taskNoOrName;
@ApiModelProperty("检验依据")
private Long standardId;
@ApiModelProperty("任务开始时间")
private Date taskBeginTime;
@ApiModelProperty("任务编号")
private String taskNo;
@ApiModelProperty("任务结束时间")
private Date taskEndTime;
@ApiModelProperty("任务名称")
private String taskName;
@ApiModelProperty("车辆型号")
private String productModel;
@ApiModelProperty("检验项目")
private String inspectionItem;
}
......@@ -11,12 +11,18 @@ import java.util.Date;
@Data
public class TaskFindPendingRequest extends PageDomain {
@ApiModelProperty("任务编号或名称关键词")
private String taskNoOrName;
@ApiModelProperty("检验依据")
private Long standardId;
@ApiModelProperty("任务开始时间")
private Date taskBeginTime;
@ApiModelProperty("任务编号")
private String taskNo;
@ApiModelProperty("子任务状态")
private String subStatus;
@ApiModelProperty("任务名称")
private String taskName;
@ApiModelProperty("车辆型号")
private String productModel;
@ApiModelProperty("检验项目")
private String inspectionItem;
}
......@@ -6,8 +6,8 @@
<resultMap id="BaseResultMap" type="com.ruoyi.domain.Task">
<id property="id" column="id" jdbcType="BIGINT"/>
<id property="systemReviewTaskId" column="system_review_task_id" jdbcType="BIGINT"/>
<id property="carReviewTaskId" column="car_review_task_id" jdbcType="BIGINT"/>
<result property="systemReviewTaskId" column="system_review_task_id" jdbcType="BIGINT"/>
<result property="carReviewTaskId" column="car_review_task_id" jdbcType="BIGINT"/>
<result property="taskStatus" column="task_status" jdbcType="VARCHAR"/>
<result property="runStatus" column="run_status" jdbcType="VARCHAR"/>
<result property="nextNode" column="next_node" jdbcType="VARCHAR"/>
......@@ -38,8 +38,8 @@
<resultMap id="ResponseMap" type="com.ruoyi.web.response.TaskFindResponse">
<id property="id" column="id" jdbcType="BIGINT"/>
<id property="systemReviewTaskId" column="system_review_task_id" jdbcType="BIGINT"/>
<id property="carReviewTaskId" column="car_review_task_id" jdbcType="BIGINT"/>
<result property="systemReviewTaskId" column="system_review_task_id" jdbcType="BIGINT"/>
<result property="carReviewTaskId" column="car_review_task_id" jdbcType="BIGINT"/>
<result property="taskNo" column="task_no" jdbcType="VARCHAR"/>
<result property="taskName" column="task_name" jdbcType="VARCHAR"/>
<result property="productModel" column="product_model" jdbcType="VARCHAR"/>
......@@ -83,6 +83,7 @@
t.task_no,t.task_name,t.task_status,
t.leader_id,t.leader,
t.task_begin_time,
t.product_model,
t.next_node,
srt.task_begin_time system_task_begin_time,
srt.task_end_time system_task_end_time,
......@@ -94,34 +95,56 @@
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
<where>
t.task_status IN ("RUNNING","RUNNABLE")
<if test="taskNoOrName != null and taskNoOrName != ''">
and (t.task_no = #{taskNoOrName} || t.task_name like concat('%',#{taskNoOrName},'%'))
t.task_status IN ("NEW","PENDING")
<if test="standardId != null and standardId != ''">
and t.standard_id = #{standardId}
</if>
<if test="taskBeginTime != null and taskBeginTime != ''">
and t.task_begin_time = #{taskBeginTime}
<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>
<if test="productModel != null and productModel != ''">
and t.product_model = #{productModel}
</if>
<if test="subStatus != null and subStatus != ''">
and (srt.task_status = #{subStatus} OR crt.task_status = #{subStatus})
<if test="inspectionItem != null and inspectionItem != ''">
AND (
(inspectionItem = 'sraif' AND t.system_review_task_id IS NOT NULL)
OR
(inspectionItem = 'grfis' AND t.car_review_task_id IS NOT NULL)
)
</if>
</where>
order by t.create_time desc
</select>
<select id="findFinish" parameterType="com.ruoyi.web.request.TaskFindFinishRequest" resultType="com.ruoyi.domain.Task">
SELECT t.id, t.system_review_task_id, t.car_review_task_id,
t.task_no,t.task_name,t.task_status,
t.product_model,
t.leader_id,t.leader,
t.task_begin_time,t.task_end_time
FROM t_task t
<where>
t.task_status IN ("FINISH")
<if test="taskNoOrName != null and taskNoOrName != ''">
and (t.task_no = #{taskNoOrName} || t.task_name like concat('%',#{taskNoOrName},'%'))
<if test="standardId != null and standardId != ''">
and t.standard_id = #{standardId}
</if>
<if test="taskBeginTime != null and taskBeginTime != ''">
and t.task_begin_time >= #{taskBeginTime}
<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>
<if test="productModel != null and productModel != ''">
and t.product_model = #{productModel}
</if>
<if test="taskEndTime != null and taskEndTime != ''">
and t.task_end_time &lt;= #{taskEndTime}
<if test="inspectionItem != null and inspectionItem != ''">
AND (
(inspectionItem = 'sraif' AND t.system_review_task_id IS NOT NULL)
OR
(inspectionItem = 'grfis' AND t.car_review_task_id IS NOT NULL)
)
</if>
</where>
</select>
......@@ -176,6 +199,7 @@
and t.task_status = #{request.taskStatus}
</if>
</where>
order by t.create_time desc
</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