Commit 2e52721a authored by wdy's avatar wdy

Merge branch 'wangdingyi' into 'dev'

签字确认任务

See merge request !324
parents 8e632b90 465d1b94
...@@ -2,11 +2,13 @@ package com.ruoyi.service.impl; ...@@ -2,11 +2,13 @@ package com.ruoyi.service.impl;
import com.ruoyi.common.DataStatisticsUtils; import com.ruoyi.common.DataStatisticsUtils;
import com.ruoyi.common.constant.HttpStatus; import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.domain.*; import com.ruoyi.domain.*;
import com.ruoyi.domain.vo.ReviewEnterpriseArchiveFileVO; import com.ruoyi.domain.vo.ReviewEnterpriseArchiveFileVO;
import com.ruoyi.mapper.*; import com.ruoyi.mapper.*;
import com.ruoyi.service.*; import com.ruoyi.service.*;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.web.response.CarReviewTaskViewResponse; import com.ruoyi.web.response.CarReviewTaskViewResponse;
import com.ruoyi.web.response.UserNameResponse; import com.ruoyi.web.response.UserNameResponse;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
...@@ -79,6 +81,9 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init ...@@ -79,6 +81,9 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
@Autowired @Autowired
private AutomobileEnterpriseMapper automobileEnterpriseMapper; private AutomobileEnterpriseMapper automobileEnterpriseMapper;
@Autowired
private ISysUserService sysUserService;
// PENDING状态下 // PENDING状态下
// 1.standard字段查询当前最新问卷 // 1.standard字段查询当前最新问卷
// 2.查询场景变更任务 // 2.查询场景变更任务
...@@ -145,12 +150,17 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init ...@@ -145,12 +150,17 @@ public class StrategyCarReviewTaskPending implements StrategyCarReviewTask, Init
// 4. 修改任务状态为 SIGNED 待签字 // 4. 修改任务状态为 SIGNED 待签字
carReviewTask.setTaskStatus(CarReviewTask.TASK_STATUS_SIGNED); carReviewTask.setTaskStatus(CarReviewTask.TASK_STATUS_SIGNED);
// 7. 设置问卷结果 // 5. 设置问卷结果
if (reviewDetailsResultMapper.findNotPass(carReviewTask.getId()) > 0) { if (reviewDetailsResultMapper.findNotPass(carReviewTask.getId()) > 0) {
carReviewTask.setTaskResult("REJECT"); carReviewTask.setTaskResult("REJECT");
} else { } else {
carReviewTask.setTaskResult("PASS"); carReviewTask.setTaskResult("PASS");
} }
// 6. 设置签字图片
SysUser sysUser = sysUserService.selectUserById(carReviewTask.getLeaderId());
carReviewTask.setImagesUrl(sysUser.getSignaturePicture());
carReviewTaskMapper.updateById(carReviewTask); carReviewTaskMapper.updateById(carReviewTask);
} }
} }
......
...@@ -4,11 +4,13 @@ import cn.hutool.core.collection.CollUtil; ...@@ -4,11 +4,13 @@ import cn.hutool.core.collection.CollUtil;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.ruoyi.common.constant.HttpStatus; import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.domain.ModelTestTask; import com.ruoyi.domain.ModelTestTask;
import com.ruoyi.mapper.ModelTestTaskMapper; import com.ruoyi.mapper.ModelTestTaskMapper;
import com.ruoyi.service.StrategyModelTestTask; import com.ruoyi.service.StrategyModelTestTask;
import com.ruoyi.service.TestUseCaseService; import com.ruoyi.service.TestUseCaseService;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.web.response.ModelTestResponse; import com.ruoyi.web.response.ModelTestResponse;
import com.ruoyi.web.response.ModelTestUrlResponse; import com.ruoyi.web.response.ModelTestUrlResponse;
import lombok.Data; import lombok.Data;
...@@ -42,6 +44,9 @@ public class StrategyModelTestTaskPending implements StrategyModelTestTask, Init ...@@ -42,6 +44,9 @@ public class StrategyModelTestTaskPending implements StrategyModelTestTask, Init
@Autowired @Autowired
private TestUseCaseService testUseCaseService; private TestUseCaseService testUseCaseService;
@Autowired
private ISysUserService sysUserService;
private static String url = "https://10.12.48.78:8090/DescribeProjectTestResult"; private static String url = "https://10.12.48.78:8090/DescribeProjectTestResult";
@Override @Override
...@@ -78,12 +83,15 @@ public class StrategyModelTestTaskPending implements StrategyModelTestTask, Init ...@@ -78,12 +83,15 @@ public class StrategyModelTestTaskPending implements StrategyModelTestTask, Init
} }
// 进行中的任务, 点击返回后, 判断当前用例完成程度, 用例都完成后状态改为待签字 // 进行中的任务, 点击返回后, 判断当前用例完成程度, 用例都完成后状态改为待签字
if (sumCount.equals(currentCount.get())) { if (sumCount.equals(currentCount.get())) {
SysUser sysUser = sysUserService.selectUserById(modelTestTask.getLeaderId());
modelTestTaskMapper.update(new ModelTestTask(), modelTestTaskMapper.update(new ModelTestTask(),
new LambdaUpdateWrapper<ModelTestTask>() new LambdaUpdateWrapper<ModelTestTask>()
.set(ModelTestTask::getTaskEndTime, new Date()) .set(ModelTestTask::getTaskEndTime, new Date())
.set(ModelTestTask::getTaskStatus, ModelTestTask.TASK_STATUS_SIGNED) .set(ModelTestTask::getTaskStatus, ModelTestTask.TASK_STATUS_SIGNED)
.set(failedCount.get() > 0, ModelTestTask::getTaskResult, ModelTestTask.TASK_STATUS_REJECT) .set(failedCount.get() > 0, ModelTestTask::getTaskResult, ModelTestTask.TASK_STATUS_REJECT)
.set(failedCount.get().equals(0), ModelTestTask::getTaskResult, ModelTestTask.TASK_STATUS_PASS) .set(failedCount.get().equals(0), ModelTestTask::getTaskResult, ModelTestTask.TASK_STATUS_PASS)
.set(ModelTestTask::getImagesUrl,sysUser.getSignaturePicture())
.eq(ModelTestTask::getId, modelTestTask.getId())); .eq(ModelTestTask::getId, modelTestTask.getId()));
} }
} }
......
...@@ -65,26 +65,21 @@ public class StrategyModelTestTaskSigned implements StrategyModelTestTask, Initi ...@@ -65,26 +65,21 @@ public class StrategyModelTestTaskSigned implements StrategyModelTestTask, Initi
@Override @Override
public void doSubmitTest(ModelTestTask modelTestTask, List<String> imagesUrl) { public void doSubmitTest(ModelTestTask modelTestTask, List<String> imagesUrl) {
SysUser user = SecurityUtils.getLoginUser().getUser(); SysUser user = SecurityUtils.getLoginUser().getUser();
if (imagesUrl != null && imagesUrl.size() != 0) { modelTestTaskMapper.update(new ModelTestTask(),
modelTestTaskMapper.update(new ModelTestTask(), new LambdaUpdateWrapper<ModelTestTask>()
new LambdaUpdateWrapper<ModelTestTask>() .set(ModelTestTask::getTaskStatus, ModelTestTask.TASK_STATUS_FINISH)
.set(ModelTestTask::getTaskStatus, ModelTestTask.TASK_STATUS_FINISH) .set(ModelTestTask::getTaskEndTime, new Date())
.set(ModelTestTask::getTaskEndTime, new Date()) .set(ModelTestTask::getSubmitId, user.getUserId())
.set(ModelTestTask::getSubmitId, user.getUserId()) .set(ModelTestTask::getSubmitName, user.getNickName())
.set(ModelTestTask::getSubmitName, user.getNickName()) .set(ModelTestTask::getImagesUrl, StringUtils.join(imagesUrl, ","))
.set(ModelTestTask::getImagesUrl, StringUtils.join(imagesUrl, ",")) .eq(ModelTestTask::getId, modelTestTask.getId()));
.eq(ModelTestTask::getId, modelTestTask.getId())); // 改总任务状态
// 改总任务状态 // 通过modelId查询总任务ID
// 通过modelId查询总任务ID List<Task> taskList = taskMapper.selectList(new QueryWrapper<Task>().eq("model_test_task_id", modelTestTask.getId()));
List<Task> taskList = taskMapper.selectList(new QueryWrapper<Task>().eq("model_test_task_id", modelTestTask.getId())); if (CollUtil.isNotEmpty(taskList)) {
if (CollUtil.isNotEmpty(taskList)) { Task task = taskList.get(0);
Task task = taskList.get(0); taskStateFacade.doSubmit(task);
taskStateFacade.doSubmit(task);
}
} else {
throw new ServiceException("请提交签字图片", HttpStatus.ERROR);
} }
} }
@Override @Override
......
...@@ -2,11 +2,13 @@ package com.ruoyi.service.impl; ...@@ -2,11 +2,13 @@ package com.ruoyi.service.impl;
import com.ruoyi.common.DataStatisticsUtils; import com.ruoyi.common.DataStatisticsUtils;
import com.ruoyi.common.constant.HttpStatus; import com.ruoyi.common.constant.HttpStatus;
import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.domain.*; import com.ruoyi.domain.*;
import com.ruoyi.domain.vo.ReviewEnterpriseArchiveFileVO; import com.ruoyi.domain.vo.ReviewEnterpriseArchiveFileVO;
import com.ruoyi.mapper.*; import com.ruoyi.mapper.*;
import com.ruoyi.service.*; import com.ruoyi.service.*;
import com.ruoyi.system.service.ISysUserService;
import com.ruoyi.web.response.SystemReviewTaskViewResponse; import com.ruoyi.web.response.SystemReviewTaskViewResponse;
import com.ruoyi.web.response.UserNameResponse; import com.ruoyi.web.response.UserNameResponse;
import org.springframework.beans.factory.InitializingBean; import org.springframework.beans.factory.InitializingBean;
...@@ -68,6 +70,9 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask ...@@ -68,6 +70,9 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
@Autowired @Autowired
private AutomobileEnterpriseMapper automobileEnterpriseMapper; private AutomobileEnterpriseMapper automobileEnterpriseMapper;
@Autowired
private ISysUserService sysUserService;
@Override @Override
public void doStart(SystemReviewTask systemReviewTask) { public void doStart(SystemReviewTask systemReviewTask) {
throw new ServiceException("不能开始一个已经开始的任务", HttpStatus.ERROR); throw new ServiceException("不能开始一个已经开始的任务", HttpStatus.ERROR);
...@@ -114,6 +119,11 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask ...@@ -114,6 +119,11 @@ public class StrategySystemReviewTaskPending implements StrategySystemReviewTask
} else { } else {
systemReviewTask.setTaskResult("PASS"); systemReviewTask.setTaskResult("PASS");
} }
// 6. 设置签字图片
SysUser sysUser = sysUserService.selectUserById(systemReviewTask.getLeaderId());
systemReviewTask.setImagesUrl(sysUser.getSignaturePicture());
systemReviewTaskMapper.updateById(systemReviewTask); systemReviewTaskMapper.updateById(systemReviewTask);
} }
} }
......
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