Commit 5b7b4985 authored by wdy's avatar wdy

Merge branch 'wangdingyi' into 'dev'

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

See merge request !159
parents 7a1aa7bf ac5c84a9
...@@ -20,7 +20,7 @@ public interface TaskMapper extends BaseMapper<Task> { ...@@ -20,7 +20,7 @@ public interface TaskMapper extends BaseMapper<Task> {
List<Task> findList(TaskListRequest request); 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); List<Task> findFinish(TaskFindFinishRequest request);
......
...@@ -25,7 +25,7 @@ public interface TaskService extends IService<Task> { ...@@ -25,7 +25,7 @@ public interface TaskService extends IService<Task> {
* @param request * @param request
* @return * @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 ...@@ -176,8 +176,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
} }
@Override @Override
public List<TaskFindResponse> findPending(TaskFindPendingRequest request) { public List<TaskFindResponse> findPending(TaskFindPendingRequest request,Long userId) {
List<TaskFindResponse> responses = taskMapper.findPending(request); List<TaskFindResponse> responses = taskMapper.findPending(request,userId);
for (TaskFindResponse response : responses) { for (TaskFindResponse response : responses) {
if (response.getSystemReviewTaskId() != null) { if (response.getSystemReviewTaskId() != null) {
BigDecimal num = new BigDecimal(((double)reviewDetailsMapper.count(response.getSystemReviewTaskId(),SystemReviewTask.TYPE))* 100); BigDecimal num = new BigDecimal(((double)reviewDetailsMapper.count(response.getSystemReviewTaskId(),SystemReviewTask.TYPE))* 100);
......
...@@ -52,20 +52,7 @@ public class TaskStatePending extends TaskStateAdapter implements TaskState, Ini ...@@ -52,20 +52,7 @@ public class TaskStatePending extends TaskStateAdapter implements TaskState, Ini
@Override @Override
public void doSubmit(Task task) { public void doSubmit(Task task) {
Double subTaskCount = 0.0; if (task.getPointer() < task.getMaxPointer()) {
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) {
task.setTaskStatus(Task.TASK_STATUS_PENDING); task.setTaskStatus(Task.TASK_STATUS_PENDING);
task.setRunStatus(Task.RUN_STATUS_RUNNABLE); task.setRunStatus(Task.RUN_STATUS_RUNNABLE);
} else { } else {
......
...@@ -118,7 +118,7 @@ public class TaskController extends BaseController { ...@@ -118,7 +118,7 @@ public class TaskController extends BaseController {
@RequestMapping(method = RequestMethod.POST, value = "/findPending") @RequestMapping(method = RequestMethod.POST, value = "/findPending")
public TableDataInfo<TaskFindResponse> findPending(@Validated @RequestBody TaskFindPendingRequest request) { public TableDataInfo<TaskFindResponse> findPending(@Validated @RequestBody TaskFindPendingRequest request) {
startPage(request); startPage(request);
return getDataTable(taskService.findPending(request)); return getDataTable(taskService.findPending(request,getUserId()));
} }
@ApiOperation("查询已归档任务") @ApiOperation("查询已归档任务")
......
...@@ -99,24 +99,27 @@ ...@@ -99,24 +99,27 @@
left join t_system_review_task srt on t.system_review_task_id = srt.id 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 left join t_car_review_task crt on t.car_review_task_id = crt.id
<where> <where>
t.task_status IN ("NEW","PENDING") t.id IN (
<if test="standardId != null and standardId != ''"> SELECT task_id FROM t_task_user_relation WHERE user_id = #{userId}
and t.standard_id = #{standardId} )
and t.task_status IN ("NEW","PENDING")
<if test="request.standardId != null and request.standardId != ''">
and t.standard_id = #{request.standardId}
</if> </if>
<if test="taskNo != null and taskNo != ''"> <if test="request.taskNo != null and request.taskNo != ''">
and t.task_no like concat('%',#{taskNo},'%') and t.task_no like concat('%',#{request.taskNo},'%')
</if> </if>
<if test="taskName != null and taskName != ''"> <if test="request.taskName != null and request.taskName != ''">
and t.task_name like concat('%',#{taskName},'%') and t.task_name like concat('%',#{request.taskName},'%')
</if> </if>
<if test="productModel != null and productModel != ''"> <if test="request.productModel != null and request.productModel != ''">
and t.product_model like concat('%',#{productModel},'%') and t.product_model like concat('%',#{request.productModel},'%')
</if> </if>
<if test="inspectionItem != null and inspectionItem != ''"> <if test="request.inspectionItem != null and request.inspectionItem != ''">
AND( 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 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> </if>
</where> </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