Commit e66b128f authored by W_Y's avatar W_Y

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

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