Commit 162ad8fe authored by wdy's avatar wdy

用户取消审核任务

parent 962af034
......@@ -17,6 +17,13 @@ import java.util.List;
public interface ReviewSceneChangeTaskUserRelationMapper extends BaseMapper<ReviewSceneChangeTaskUserRelation> {
List<ReviewSceneChangeTaskUserRelation> findListByTaskId(@Param("taskId") Long taskId);
/**
* 查询当前任务未处理的列表
* @param taskId
* @return
*/
List<ReviewSceneChangeTaskUserRelation> findListByTaskIdCancel(@Param("taskId") Long taskId);
}
......
......@@ -3,10 +3,7 @@ package com.ruoyi.service;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.domain.ReviewSceneChangeTask;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.web.request.ReviewSceneChangeTaskFindCreateRequest;
import com.ruoyi.web.request.ReviewSceneChangeTaskFindFinishRequest;
import com.ruoyi.web.request.ReviewSceneChangeTaskFindPendingRequest;
import com.ruoyi.web.request.ReviewSceneChangeTaskPassRequest;
import com.ruoyi.web.request.*;
import com.ruoyi.web.response.ReviewDetailsListResponse;
import com.ruoyi.web.response.ReviewKeyPointListResponse;
import com.ruoyi.web.response.ReviewOpinionResponse;
......@@ -127,4 +124,9 @@ public interface ReviewSceneChangeTaskService extends IService<ReviewSceneChange
* */
List<ReviewOpinionResponse> getReviewerOpinion(Long id);
/**
* 取消审核
* @return
*/
void cancel(ReviewSceneChangeTaskCancelRequest request);
}
......@@ -14,4 +14,10 @@ public interface ReviewSceneChangeTaskUserRelationService extends IService<Revie
List<ReviewSceneChangeTaskUserRelation> findListByTaskId(Long taskId);
/**
* 查询当前任务未处理的列表
* @param taskId
* @return
*/
List<ReviewSceneChangeTaskUserRelation> findListByTaskIdCancel(Long taskId);
}
......@@ -18,10 +18,7 @@ import com.ruoyi.service.ReviewTaskInboxService;
import com.ruoyi.system.mapper.SysUserRoleMapper;
import com.ruoyi.system.service.ISysDeptService;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.web.request.ReviewSceneChangeTaskFindCreateRequest;
import com.ruoyi.web.request.ReviewSceneChangeTaskFindFinishRequest;
import com.ruoyi.web.request.ReviewSceneChangeTaskFindPendingRequest;
import com.ruoyi.web.request.ReviewSceneChangeTaskPassRequest;
import com.ruoyi.web.request.*;
import com.ruoyi.web.response.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -540,6 +537,17 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
List<ReviewOpinionResponse> list = reviewSceneChangeTaskMapper.getReviewerOpinion(id);
return list;
}
/**
* 取消审核
* @return
*/
@Override
public void cancel(ReviewSceneChangeTaskCancelRequest request) {
ReviewSceneChangeTask task = getById(request.getId());
task.setTaskStatus(ReviewSceneChangeTask.STATUS_CLOSE);
updateById(task);
}
}
......
......@@ -26,6 +26,16 @@ public class ReviewSceneChangeTaskUserRelationServiceImpl extends ServiceImpl<Re
public List<ReviewSceneChangeTaskUserRelation> findListByTaskId(Long taskId) {
return reviewSceneChangeTaskUserRelationMapper.findListByTaskId(taskId);
}
/**
* 查询当前任务未处理的列表
* @param taskId
* @return
*/
@Override
public List<ReviewSceneChangeTaskUserRelation> findListByTaskIdCancel(Long taskId) {
return reviewSceneChangeTaskUserRelationMapper.findListByTaskIdCancel(taskId);
}
}
......
......@@ -285,4 +285,18 @@ public class ReviewSceneChangeTaskController extends BaseController {
List<GetSceneListResponse> getSceneListResponses = reviewSceneService.getSceneListById(id);
return R.ok(getSceneListResponses);
}
/**
* 取消审核
* @return
*/
@ApiOperation("取消审核")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "取消审核", businessType = BusinessType.UPDATE)
@RequestMapping(method = RequestMethod.POST, value = "/cancel")
public R<String> audit(@Validated @RequestBody ReviewSceneChangeTaskCancelRequest request) {
reviewSceneChangeTaskService.cancel(request);
return R.ok();
}
}
package com.ruoyi.web.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "ReviewSceneChangeTaskCancelRequest", description = "取消审核任务")
@Data
public class ReviewSceneChangeTaskCancelRequest {
@ApiModelProperty(value = "id",required = true)
private Long id;
}
......@@ -61,7 +61,7 @@
<select id="findPendingListByUserId" resultType="com.ruoyi.web.response.ReviewSceneChangeTaskResponse">
SELECT sct.*, sctu.decision FROM t_review_scene_change_task sct
LEFT JOIN t_review_scene_change_task_user_relation sctu ON sct.id = sctu.task_id
WHERE sctu.user_id = #{userId} and sctu.decision IS NULL and sctu.role_id = 103
WHERE sctu.user_id = #{userId} and sct.task_status = 'PENDING' and sctu.decision IS NULL and sctu.role_id = 103
<if test="request.operationSort != null and request.operationSort != ''">
and sct.operation_sort = #{request.operationSort}
</if>
......
......@@ -24,4 +24,8 @@
SELECT id, task_id, user_id, decision, decision_time, name, role_id, comment, dept FROM t_review_scene_change_task_user_relation
WHERE task_id = #{taskId}
</select>
<select id="findListByTaskIdCancel" resultType="com.ruoyi.domain.ReviewSceneChangeTaskUserRelation">
SELECT id, task_id, user_id, decision, decision_time, name, role_id, comment, dept FROM t_review_scene_change_task_user_relation
WHERE task_id = #{taskId} and decision is null
</select>
</mapper>
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