Commit e66b128f authored by W_Y's avatar W_Y

根据id查询场景变更任务&审核任务

parent 29e0a6c3
......@@ -2,6 +2,7 @@ package com.ruoyi.service;
import com.ruoyi.domain.ReviewSceneChangeTask;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.web.request.ReviewSceneChangeTaskPassRequest;
import com.ruoyi.web.response.ReviewSceneChangeTaskResponse;
import java.util.Date;
......@@ -33,6 +34,12 @@ public interface ReviewSceneChangeTaskService extends IService<ReviewSceneChange
*/
void reject(Long taskId, String comment);
/**
* 审核一个任务
* @param request
*/
void audit(ReviewSceneChangeTaskPassRequest request);
/**
* 关闭一个任务
* @param taskId
......
......@@ -13,6 +13,7 @@ import com.ruoyi.service.ReviewSceneChangeTaskUserRelationService;
import com.ruoyi.service.ReviewSceneService;
import com.ruoyi.service.ReviewTaskInboxService;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.web.request.ReviewSceneChangeTaskPassRequest;
import com.ruoyi.web.response.ReviewSceneChangeTaskResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -87,11 +88,22 @@ public class ReviewSceneChangeTaskServiceImpl extends ServiceImpl<ReviewSceneCha
doProcess(taskId, comment, ReviewSceneChangeTask.RESULT_PASS);
}
@Override
public void reject(Long taskId, String comment) {
doProcess(taskId, comment, ReviewSceneChangeTask.RESULT_REJECT);
}
@Override
public void audit(ReviewSceneChangeTaskPassRequest request) {
if (request.getPassed().equals("0")) {
doProcess(request.getTaskId(), request.getComment(), ReviewSceneChangeTask.RESULT_REJECT);
} else {
doProcess(request.getTaskId(), request.getComment(), ReviewSceneChangeTask.RESULT_PASS);
}
}
public void doProcess(Long taskId, String comment, String decision) {
ReviewSceneChangeTask task = getById(taskId);
......
......@@ -17,12 +17,10 @@ import io.swagger.annotations.ApiOperation;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.apache.xmlbeans.impl.xb.xsdschema.Public;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
@Api(tags = "场景变更任务")
@RestController
......@@ -46,27 +44,14 @@ public class ReviewSceneChangeTaskController extends BaseController {
return R.ok();
}
@ApiOperation("审核通过任务")
@ApiOperation("审核任务")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "审核通过任务", businessType = BusinessType.UPDATE)
@RequestMapping(method = RequestMethod.POST, value = "/pass")
public R<String> pass(@Validated @RequestBody ReviewSceneChangeTaskPassRequest request) {
reviewSceneChangeTaskService.pass(request.getTaskId(),request.getComment());
return R.ok();
}
@ApiOperation("审核驳回任务")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@Log(title = "审核驳回任务", businessType = BusinessType.UPDATE)
@RequestMapping(method = RequestMethod.POST, value = "/reject")
public R<String> reject(@Validated @RequestBody ReviewSceneChangeTaskPassRequest request) {
reviewSceneChangeTaskService.reject(request.getTaskId(),request.getComment());
@Log(title = "审核任务", businessType = BusinessType.UPDATE)
@RequestMapping(method = RequestMethod.POST, value = "/audit")
public R<String> audit(@Validated @RequestBody ReviewSceneChangeTaskPassRequest request) {
reviewSceneChangeTaskService.audit(request);
return R.ok();
}
......@@ -91,7 +76,7 @@ public class ReviewSceneChangeTaskController extends BaseController {
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/findFinish")
public TableDataInfo<ReviewSceneChangeTaskResponse> findFinish(ReviewSceneChangeTaskFindFinishRequest request) {
public TableDataInfo<ReviewSceneChangeTaskResponse> findFinish(@Validated @RequestBody ReviewSceneChangeTaskFindFinishRequest request) {
startPage(request);
return getDataTable(reviewSceneChangeTaskService.findFinishListByUserId(getUserId()));
}
......@@ -104,9 +89,17 @@ public class ReviewSceneChangeTaskController extends BaseController {
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/findCreate")
public TableDataInfo<ReviewSceneChangeTask> findCreate(ReviewSceneChangeTaskFindCreateRequest request) {
public TableDataInfo<ReviewSceneChangeTask> findCreate(@Validated @RequestBody ReviewSceneChangeTaskFindCreateRequest request) {
startPage(request);
return getDataTable(reviewSceneChangeTaskService.findCreateListByUserId(getUserId()));
}
@ApiOperation("查询任务详情")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/getById")
public R<ReviewSceneChangeTask> getInfo(@Validated @RequestBody ReviewSceneChangeTaskGetInfoRequest request) {
return R.ok(reviewSceneChangeTaskService.getById(request.getId()));
}
}
package com.ruoyi.web.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel
public class ReviewSceneChangeTaskGetInfoRequest {
@ApiModelProperty("ID")
private Long id;
}
......@@ -13,4 +13,7 @@ public class ReviewSceneChangeTaskPassRequest {
@ApiModelProperty("评论")
private String comment;
@ApiModelProperty("是否通过(0:不通过 1:通过)")
private String passed;
}
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