Commit 73dcac44 authored by wdy's avatar wdy

小组成员查询处理中的任务

parent 68ced363
......@@ -20,7 +20,7 @@ public interface TaskMapper extends BaseMapper<Task> {
List<Task> findList(TaskListRequest request);
List<TaskFindResponse> findPending(TaskFindPendingRequest request);
List<TaskFindResponse> findPending(@Param("request")TaskFindPendingRequest request,@Param("userId")Long userId);
List<Task> findFinish(TaskFindFinishRequest request);
......
......@@ -25,7 +25,7 @@ public interface TaskService extends IService<Task> {
* @param request
* @return
*/
List<TaskFindResponse> findPending(TaskFindPendingRequest request);
List<TaskFindResponse> findPending(TaskFindPendingRequest request,Long userId);
/**
* 查询完成的任务
......
......@@ -176,8 +176,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
}
@Override
public List<TaskFindResponse> findPending(TaskFindPendingRequest request) {
List<TaskFindResponse> responses = taskMapper.findPending(request);
public List<TaskFindResponse> findPending(TaskFindPendingRequest request,Long userId) {
List<TaskFindResponse> responses = taskMapper.findPending(request,userId);
for (TaskFindResponse response : responses) {
if (response.getSystemReviewTaskId() != null) {
BigDecimal num = new BigDecimal(((double)reviewDetailsMapper.count(response.getSystemReviewTaskId(),SystemReviewTask.TYPE))* 100);
......
......@@ -52,20 +52,7 @@ public class TaskStatePending extends TaskStateAdapter implements TaskState, Ini
@Override
public void doSubmit(Task task) {
Double subTaskCount = 0.0;
SystemReviewTask systemReviewTask = systemReviewTaskMapper.selectById(task.getSystemReviewTaskId());
CarReviewTask carReviewTask = carReviewTaskMapper.selectById(task.getCarReviewTaskId());
if(task.getSystemReviewTaskId() != null && !Objects.equals(systemReviewTask.getTaskStatus(), SystemReviewTask.STATUS_NEW)) {
subTaskCount = reviewDetailsMapper.count(task.getSystemReviewTaskId(), SystemReviewTask.TYPE);
}
if(task.getCarReviewTaskId() != null && !Objects.equals(carReviewTask.getTaskStatus(), CarReviewTask.TASK_STATUS_NEW)) {
subTaskCount = reviewDetailsMapper.count(task.getCarReviewTaskId(), CarReviewTask.TYPE);
}
if(subTaskCount > 0) {
if (task.getPointer() < task.getMaxPointer()) {
task.setTaskStatus(Task.TASK_STATUS_PENDING);
task.setRunStatus(Task.RUN_STATUS_RUNNABLE);
} else {
......
......@@ -118,7 +118,7 @@ public class TaskController extends BaseController {
@RequestMapping(method = RequestMethod.POST, value = "/findPending")
public TableDataInfo<TaskFindResponse> findPending(@Validated @RequestBody TaskFindPendingRequest request) {
startPage(request);
return getDataTable(taskService.findPending(request));
return getDataTable(taskService.findPending(request,getUserId()));
}
@ApiOperation("查询已归档任务")
......
......@@ -99,24 +99,27 @@
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 ("NEW","PENDING")
<if test="standardId != null and standardId != ''">
and t.standard_id = #{standardId}
t.id IN (
SELECT task_id FROM t_task_user_relation WHERE user_id = #{userId}
)
and t.task_status IN ("NEW","PENDING")
<if test="request.standardId != null and request.standardId != ''">
and t.standard_id = #{request.standardId}
</if>
<if test="taskNo != null and taskNo != ''">
and t.task_no like concat('%',#{taskNo},'%')
<if test="request.taskNo != null and request.taskNo != ''">
and t.task_no like concat('%',#{request.taskNo},'%')
</if>
<if test="taskName != null and taskName != ''">
and t.task_name like concat('%',#{taskName},'%')
<if test="request.taskName != null and request.taskName != ''">
and t.task_name like concat('%',#{request.taskName},'%')
</if>
<if test="productModel != null and productModel != ''">
and t.product_model like concat('%',#{productModel},'%')
<if test="request.productModel != null and request.productModel != ''">
and t.product_model like concat('%',#{request.productModel},'%')
</if>
<if test="inspectionItem != null and inspectionItem != ''">
<if test="request.inspectionItem != null and request.inspectionItem != ''">
AND(
(#{inspectionItem} = 'sraif' AND t.system_review_task_id IS NOT NULL)
(#{request.inspectionItem} = 'sraif' AND t.system_review_task_id IS NOT NULL)
OR
(#{inspectionItem} = 'grfis' AND t.car_review_task_id IS NOT NULL)
(#{request.inspectionItem} = 'grfis' AND t.car_review_task_id IS NOT NULL)
)
</if>
</where>
......
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