Commit 68ba0f1a authored by wdy's avatar wdy

提交任务

parent 528fe45f
......@@ -3,6 +3,8 @@ package com.ruoyi.service;
import com.ruoyi.domain.CarReviewTask;
import com.ruoyi.web.response.CarReviewTaskViewResponse;
import java.util.List;
public interface StrategyCarReviewTask {
CarReviewTaskViewResponse doView(CarReviewTask carReviewTask);
......@@ -11,5 +13,5 @@ public interface StrategyCarReviewTask {
void doConfirmReview(CarReviewTask carReviewTask);
void doSubmitReview(CarReviewTask carReviewTask, String imagesUrl);
void doSubmitReview(CarReviewTask carReviewTask, List<String> imagesUrl);
}
......@@ -3,13 +3,15 @@ package com.ruoyi.service;
import com.ruoyi.domain.SystemReviewTask;
import com.ruoyi.web.response.SystemReviewTaskViewResponse;
import java.util.List;
public interface StrategySystemReviewTask {
void doStart(SystemReviewTask systemReviewTask);
void doConfirm(SystemReviewTask systemReviewTask);
void doSubmit(SystemReviewTask systemReviewTask, String imagesUrl);
void doSubmit(SystemReviewTask systemReviewTask, List<String> imagesUrl);
void doClose(SystemReviewTask systemReviewTask);
......
......@@ -11,6 +11,8 @@ import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Transactional
@Service
public class StrategyCarReviewTaskFinish implements StrategyCarReviewTask, InitializingBean {
......@@ -44,7 +46,7 @@ public class StrategyCarReviewTaskFinish implements StrategyCarReviewTask, Initi
}
@Override
public void doSubmitReview(CarReviewTask carReviewTask,String imagesUrl) {
public void doSubmitReview(CarReviewTask carReviewTask, List<String> imagesUrl) {
throw new ServiceException("不能提交一个结束的任务", HttpStatus.ERROR);
}
......
......@@ -67,7 +67,7 @@ public class StrategyCarReviewTaskNew implements StrategyCarReviewTask, Initiali
}
@Override
public void doSubmitReview(CarReviewTask carReviewTask,String imagesUrl) {
public void doSubmitReview(CarReviewTask carReviewTask,List<String> imagesUrl) {
throw new ServiceException("不能提交一个未开始的任务", HttpStatus.ERROR);
}
......
......@@ -121,7 +121,7 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
}
@Override
public void doSubmitReview(CarReviewTask carReviewTask,String imagesUrl) {
public void doSubmitReview(CarReviewTask carReviewTask,List<String> imagesUrl) {
throw new ServiceException("不能提交一个未确认的任务", HttpStatus.ERROR);
......
......@@ -4,6 +4,7 @@ import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.domain.*;
import com.ruoyi.mapper.CarReviewTaskMapper;
import com.ruoyi.mapper.ReviewDetailsMapper;
......@@ -68,7 +69,7 @@ public class StrategyCarReviewTaskSigned implements StrategyCarReviewTask, Initi
}
@Override
public void doSubmitReview(CarReviewTask carReviewTask, String imagesUrl) {
public void doSubmitReview(CarReviewTask carReviewTask, List<String> imagesUrl) {
// 1. 填充review_submit_time
carReviewTask.setTaskEndTime(new Date());
......@@ -83,7 +84,8 @@ public class StrategyCarReviewTaskSigned implements StrategyCarReviewTask, Initi
carReviewTask.setSubmitName(loginUser.getNickName());
// 4. 保存签名图片地址
carReviewTask.setImagesUrl(imagesUrl);
String joinImageUrl = StringUtils.join(imagesUrl,",");
carReviewTask.setImagesUrl(joinImageUrl);
// 5.再找带该子任务所属的总任务,将总任务的状态由 RUNNING 改回 RUNNABLE
Task task = taskMapper.selectById(taskMapper.findByCarReviewTaskId(carReviewTask.getId()));
......
......@@ -11,6 +11,8 @@ import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Transactional
@Service
public class StrategySystemReviewTaskClose implements StrategySystemReviewTask, InitializingBean {
......@@ -26,7 +28,7 @@ public class StrategySystemReviewTaskClose implements StrategySystemReviewTask,
}
@Override
public void doSubmit(SystemReviewTask systemReviewTask, String imagesUrl) {
public void doSubmit(SystemReviewTask systemReviewTask, List<String> imagesUrl) {
throw new ServiceException("不能提交一个已关闭的任务", HttpStatus.ERROR);
}
......
......@@ -11,6 +11,8 @@ import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Transactional
@Service
public class StrategySystemReviewTaskFinish implements StrategySystemReviewTask, InitializingBean {
......@@ -26,7 +28,7 @@ public class StrategySystemReviewTaskFinish implements StrategySystemReviewTask,
}
@Override
public void doSubmit(SystemReviewTask systemReviewTask, String imagesUrl) {
public void doSubmit(SystemReviewTask systemReviewTask, List<String> imagesUrl) {
throw new ServiceException("不能提交一个已完成的任务", HttpStatus.ERROR);
}
......
......@@ -40,7 +40,7 @@ public class StrategySystemReviewTaskNew implements StrategySystemReviewTask, In
}
@Override
public void doSubmit(SystemReviewTask systemReviewTask, String imagesUrl) {
public void doSubmit(SystemReviewTask systemReviewTask, List<String> imagesUrl) {
throw new ServiceException("不能提交一个尚未开始的任务", HttpStatus.ERROR);
}
......
......@@ -59,7 +59,7 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
}
@Override
public void doSubmit(SystemReviewTask systemReviewTask, String imagesUrl) {
public void doSubmit(SystemReviewTask systemReviewTask, List<String> imagesUrl) {
throw new ServiceException("不能提交一个未确认的任务", HttpStatus.ERROR);
}
......
......@@ -4,6 +4,7 @@ import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.domain.*;
import com.ruoyi.mapper.ReviewDetailsMapper;
import com.ruoyi.mapper.ReviewDetailsResultMapper;
......@@ -57,7 +58,7 @@ public class StrategySystemReviewTaskSigned implements StrategySystemReviewTask,
}
@Override
public void doSubmit(SystemReviewTask systemReviewTask, String imagesUrl) {
public void doSubmit(SystemReviewTask systemReviewTask, List<String> imagesUrl) {
// 1. 填充task_end_time
systemReviewTask.setTaskEndTime(new Date());
......@@ -72,7 +73,8 @@ public class StrategySystemReviewTaskSigned implements StrategySystemReviewTask,
systemReviewTask.setSubmitByName(loginUser.getNickName());
// 4.保存签名图片地址
systemReviewTask.setImagesUrl(imagesUrl);
String joinImageUrl = StringUtils.join(imagesUrl,",");
systemReviewTask.setImagesUrl(joinImageUrl);
// 5.再找带该子任务所属的总任务,将总任务的状态由 RUNNING 改回 RUNNABLE
Task task = taskMapper.selectById(taskMapper.findBySystemReviewTaskId(systemReviewTask.getId()));
......
......@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@ApiModel(value = "CarReviewTaskSubmitRequest", description = "提交车辆审查问卷")
@Data
public class CarReviewTaskSubmitRequest {
......@@ -12,6 +14,6 @@ public class CarReviewTaskSubmitRequest {
private Long taskId;
@ApiModelProperty("图片地址")
private String imagesUrl;
private List<String> imagesUrl;
}
......@@ -4,6 +4,8 @@ import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@ApiModel(value = "SystemReviewTaskSubmitRequest", description = "提交体系审查问卷")
@Data
public class SystemReviewTaskSubmitRequest {
......@@ -12,6 +14,6 @@ public class SystemReviewTaskSubmitRequest {
private Long taskId;
@ApiModelProperty("图片地址")
private String imagesUrl;
private List<String> imagesUrl;
}
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