Commit fdccaf92 authored by W_Y's avatar W_Y

启动车辆问卷审查任务

parent 70379d53
package com.ruoyi.service.impl; package com.ruoyi.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser; 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.SecurityUtils;
import com.ruoyi.common.utils.SnowflakeUtil; import com.ruoyi.common.utils.SnowflakeUtil;
import com.ruoyi.domain.*; import com.ruoyi.domain.*;
...@@ -130,6 +132,13 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C ...@@ -130,6 +132,13 @@ public class CarReviewTaskServiceImpl extends ServiceImpl<CarReviewTaskMapper, C
@Override @Override
public void submitReviewTask(CarReviewTaskSubmitRequest request) { public void submitReviewTask(CarReviewTaskSubmitRequest request) {
List<ReviewDetails> detailsList = reviewDetailsMapper.findNoResult(request.getTaskId()); 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 @Override
......
...@@ -8,7 +8,11 @@ import com.ruoyi.web.response.CarReviewTaskViewResponse; ...@@ -8,7 +8,11 @@ import com.ruoyi.web.response.CarReviewTaskViewResponse;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Transactional
@Service
public class StrategyCarReviewTaskFinish implements StrategyCarReviewTask, InitializingBean { public class StrategyCarReviewTaskFinish implements StrategyCarReviewTask, InitializingBean {
@Autowired @Autowired
......
...@@ -12,10 +12,14 @@ import com.ruoyi.web.response.SystemReviewTaskViewResponse; ...@@ -12,10 +12,14 @@ import com.ruoyi.web.response.SystemReviewTaskViewResponse;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@Transactional
@Service
public class StrategyCarReviewTaskNew implements StrategyCarReviewTask, InitializingBean { public class StrategyCarReviewTaskNew implements StrategyCarReviewTask, InitializingBean {
@Autowired @Autowired
......
...@@ -8,7 +8,11 @@ import com.ruoyi.web.response.CarReviewTaskViewResponse; ...@@ -8,7 +8,11 @@ import com.ruoyi.web.response.CarReviewTaskViewResponse;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Transactional
@Service
public class StrategyCarReviewTaskNone implements StrategyCarReviewTask, InitializingBean { public class StrategyCarReviewTaskNone implements StrategyCarReviewTask, InitializingBean {
@Autowired @Autowired
......
...@@ -6,6 +6,7 @@ import com.ruoyi.common.core.domain.R; ...@@ -6,6 +6,7 @@ import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.service.CarReviewTaskService; import com.ruoyi.service.CarReviewTaskService;
import com.ruoyi.web.request.CarReviewTaskCreateRequest; import com.ruoyi.web.request.CarReviewTaskCreateRequest;
import com.ruoyi.web.request.CarReviewTaskStartRequest;
import com.ruoyi.web.request.CarReviewTaskViewRequest; import com.ruoyi.web.request.CarReviewTaskViewRequest;
import com.ruoyi.web.request.SystemReviewTaskViewRequest; import com.ruoyi.web.request.SystemReviewTaskViewRequest;
import com.ruoyi.web.response.CarReviewTaskViewResponse; import com.ruoyi.web.response.CarReviewTaskViewResponse;
...@@ -40,7 +41,7 @@ public class CarReviewTaskController extends BaseController { ...@@ -40,7 +41,7 @@ public class CarReviewTaskController 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")})
@RequestMapping(method = RequestMethod.POST, value = "/view") @RequestMapping(method = RequestMethod.POST, value = "/view")
...@@ -49,5 +50,14 @@ public class CarReviewTaskController extends BaseController { ...@@ -49,5 +50,14 @@ public class CarReviewTaskController extends BaseController {
return R.ok(carReviewTaskViewResponse); 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; package com.ruoyi.web.request;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
@ApiModel(value = "CarReviewTaskStartRequest", description = "启动车辆问卷审查任务")
@Data @Data
public class CarReviewTaskStartRequest { public class CarReviewTaskStartRequest {
@ApiModelProperty("任务id")
private Long taskId; 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