Commit fdccaf92 authored by W_Y's avatar W_Y

启动车辆问卷审查任务

parent 70379d53
package com.ruoyi.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.SnowflakeUtil;
import com.ruoyi.domain.*;
......@@ -130,6 +132,13 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C
@Override
public void submitReviewTask(CarReviewTaskSubmitRequest request) {
List<ReviewDetails> detailsList = reviewDetailsMapper.findNoResult(request.getTaskId());
if (detailsList != null) {
throw new ServiceException("存在未填写的问卷,请填写完整", HttpStatus.ERROR, detailsList);
} else {
CarReviewTask carReviewTask = carReviewTaskService.getById(request.getTaskId());
strategyCarReviewTaskContext.getResource(carReviewTask.getReviewStatus()).doSubmitReview(carReviewTask);
}
}
@Override
......
......@@ -8,7 +8,11 @@ import com.ruoyi.web.response.CarReviewTaskViewResponse;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Transactional
@Service
public class StrategyCarReviewTaskFinish implements StrategyCarReviewTask, InitializingBean {
@Autowired
......
......@@ -12,10 +12,14 @@ import com.ruoyi.web.response.SystemReviewTaskViewResponse;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
@Transactional
@Service
public class StrategyCarReviewTaskNew implements StrategyCarReviewTask, InitializingBean {
@Autowired
......
......@@ -8,7 +8,11 @@ import com.ruoyi.web.response.CarReviewTaskViewResponse;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Transactional
@Service
public class StrategyCarReviewTaskNone implements StrategyCarReviewTask, InitializingBean {
@Autowired
......
......@@ -6,6 +6,7 @@ import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.service.CarReviewTaskService;
import com.ruoyi.web.request.CarReviewTaskCreateRequest;
import com.ruoyi.web.request.CarReviewTaskStartRequest;
import com.ruoyi.web.request.CarReviewTaskViewRequest;
import com.ruoyi.web.request.SystemReviewTaskViewRequest;
import com.ruoyi.web.response.CarReviewTaskViewResponse;
......@@ -40,7 +41,7 @@ public class CarReviewTaskController extends BaseController {
return R.ok();
}
@ApiOperation("查看车辆审查任务详情")
@ApiOperation("查看车辆问卷审查任务详情")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/view")
......@@ -49,5 +50,14 @@ public class CarReviewTaskController extends BaseController {
return R.ok(carReviewTaskViewResponse);
}
@ApiOperation("启动车辆问卷审查任务")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/startReview")
public R<String>startReview(@Validated @RequestBody CarReviewTaskStartRequest request) {
carReviewTaskService.startReviewTask(request);
return R.ok();
}
}
package com.ruoyi.web.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ApiModel(value = "CarReviewTaskStartRequest", description = "启动车辆问卷审查任务")
@Data
public class CarReviewTaskStartRequest {
@ApiModelProperty("任务id")
private Long taskId;
}
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