Commit b52bff1c authored by 盖献康's avatar 盖献康

Merge branch 'dev' of...

Merge branch 'dev' of ssh://gitlab.91isoft.com:10022/wangfei/vehicle-quality-review into gaixiankang
parents d987ede0 6d11cada
......@@ -113,6 +113,10 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
return taskMapper.findList(request);
}
/**
* 创建任务
* @param request
*/
@Override
public void createTask(TaskCreateRequest request) {
......@@ -148,9 +152,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
}
}
Long sum = taskMapper.findTaskName(request.getTaskName());
// TODO 任务名称验重
// Long sum = taskMapper.findTaskName(request.getTaskName());
// if (sum > 0) {
// throw new ServiceException("任务名称重复,请检查", HttpStatus.ERROR);
// } else {
......@@ -201,9 +204,6 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
taskService.save(task);
// 总任务包含车型试验,添加任务-场景关联信息
// saveTaskScenario(task.getId(), request.getTestScenarioList());
// 构建并保存该任务所关联的审核组信息
saveUserRelation(auditors,task);
......@@ -220,6 +220,12 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
// }
}
/**
* 查询用户待办任务
* @param request
* @param userId
* @return
*/
@Override
public List<TaskFindResponse> findPending(TaskFindPendingRequest request,Long userId) {
List<TaskFindResponse> responses = taskMapper.findPending(request,userId);
......@@ -237,17 +243,10 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
List<CarReviewTask> carReviewTaskList = carReviewTaskMapper.findByTaskList(responses);
setCarProgress(carReviewTaskList,responses);
// 车型试验子任务列表
// List<ModelTestTask> modelTestTaskList = modelTestTaskMapper.findByTaskList(responses);
// setModelProgress(modelTestTaskList,responses);
// 设置车型试验进度
setModelSchedule(responses);
// 任务是否有选择场景
// List<TaskScenarioResponse> scenarioResponseList = taskMapper.findByTaskList(responses);
// setTaskScenario(scenarioResponseList,responses);
// 显示下一任务节点
for (TaskFindResponse response : responses) {
String[] taskList = response.getTaskList().split(",");
if (response.getPointer() < taskList.length) {
......@@ -262,6 +261,11 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
return responses;
}
/**
* 已归档任务
* @param request
* @return
*/
@Override
public List<Task> findFinish(TaskFindFinishRequest request) {
......@@ -277,12 +281,15 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
return taskList;
}
/**
* 编辑任务
* @param request
*/
@Override
public void editTask(TaskEditRequest request) {
Task oldTask = taskMapper.findByName(request.getTaskName());
// TODO 任务名称验重
// Task oldTask = taskMapper.findByName(request.getTaskName());
// if (oldTask == null || Objects.equals(oldTask.getId(), request.getId())) {
// 构建任务创建者
LoginUser loginUser = SecurityUtils.getLoginUser();
......@@ -307,7 +314,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
setTaskList(request.getTaskList(),task);
BeanUtils.copyBeanProp(task, request);
// 子任务发变化
// 子任务发变化
changeSubTask(request,task,initiator,standard,leader);
task.setMaxPointer(request.getTaskList().size());
......@@ -334,6 +341,10 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
}
/**
* 删除任务
* @param request
*/
@Override
public void deleteTask(TaskDeleteRequest request) {
Task task = taskMapper.selectById(request.getId());
......@@ -367,12 +378,22 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
taskMapper.deleteById(request.getId());
}
/**
* 开始任务
* @param request
*/
@Override
public void startTask(TaskStartRequest request) {
Task task = taskMapper.selectById(request.getId());
taskStateFacade.doStart(task, request);
}
/**
* 用户创建的任务
* @param request
* @param userId
* @return
*/
@Override
public List<TaskFindResponse> findCreate(TaskFindRequest request,Long userId) {
List<TaskFindResponse> responses = taskMapper.findByUserId(request,userId);
......@@ -390,12 +411,10 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
List<CarReviewTask> carReviewTaskList = carReviewTaskMapper.findByTaskList(responses);
setCarProgress(carReviewTaskList,responses);
// 车型试验子任务列表
// List<ModelTestTask> modelTestTaskList = modelTestTaskMapper.findByTaskList(responses);
// setModelProgress(modelTestTaskList,responses);
// 设置车型试验进度
setModelSchedule(responses);
// 显示下一任务节点
for (TaskFindResponse response : responses) {
String[] taskList = response.getTaskList().split(",");
if (response.getPointer() < taskList.length) {
......@@ -409,6 +428,11 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
return responses;
}
/**
* 获取任务详情
* @param request
* @return
*/
@Override
public TaskGetInfoResponse getInfo(TaskGetInfoRequest request) {
......@@ -423,9 +447,6 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
response.setTaskList(taskList);
}
// 测试场景
// response.setTestScenarioList(selectTestScenarioList(task));
// 小组成员
response.setAuditors(setAuditors(request.getId()));
......@@ -464,6 +485,12 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
return list;
}
/**
* 已办任务
* @param request
* @param userId
* @return
*/
@Override
public List<Task> findUserFinish(TaskFindFinishRequest request,Long userId) {
......@@ -479,82 +506,95 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
return taskList;
}
/**
* 新增暂存任务
* @param request
*/
@Override
public void temporaryStorageTask(TaskCreateRequest request) {
Long sum = taskMapper.findTaskName(request.getTaskName());
// TODO 任务名称验重
// Long sum = taskMapper.findTaskName(request.getTaskName());
// if (sum > 0) {
// throw new ServiceException("任务名称重复,请检查", HttpStatus.ERROR);
// } else {
// 构建任务创建者
LoginUser loginUser = SecurityUtils.getLoginUser();
SysUser initiator = sysUserService.selectUserById(loginUser.getUserId());
Standard standard = standardService.findListById(request.getStandardId());
// 构建并保存任务信息
// 总任务
Task task = new Task();
task.setTaskInitiatorId(loginUser.getUserId());
task.setTaskInitiator(initiator.getNickName());
if (initiator.getDept() != null) {
task.setTaskInitiatorDept(initiator.getDept().getDeptName());
}
task.setTaskStatus(Task.TASK_STATUS_TEMPORARILY);
String joinTaskList = StringUtils.join(request.getTaskList(),",");
if (StrUtil.isNotEmpty(joinTaskList)) {
task.setTaskList(joinTaskList);
}
BeanUtils.copyBeanProp(task, request);
TaskGetInfoResponse temporaryStorageTask = taskService.getByUserId(loginUser.getUserId());
if (temporaryStorageTask != null) {
TaskEditRequest editRequest = new TaskEditRequest();
BeanUtils.copyBeanProp(editRequest,request);
editRequest.setId(temporaryStorageTask.getId());
taskService.editTemporaryStorageTask(editRequest);
} else {
SysUser initiator = sysUserService.selectUserById(loginUser.getUserId());
Standard standard = standardService.findListById(request.getStandardId());
// 构建并保存任务信息
// 总任务
Task task = new Task();
task.setTaskInitiatorId(loginUser.getUserId());
task.setTaskInitiator(initiator.getNickName());
if (initiator.getDept() != null) {
task.setTaskInitiatorDept(initiator.getDept().getDeptName());
}
task.setTaskStatus(Task.TASK_STATUS_TEMPORARILY);
String joinTaskList = StringUtils.join(request.getTaskList(),",");
if (StrUtil.isNotEmpty(joinTaskList)) {
task.setTaskList(joinTaskList);
}
BeanUtils.copyBeanProp(task, request);
if (standard != null) {
task.setName(standard.getName());
task.setStandardNo(standard.getStandardNo());
task.setFile(standard.getFile());
}
if (standard != null) {
task.setName(standard.getName());
task.setStandardNo(standard.getStandardNo());
task.setFile(standard.getFile());
}
// 找到审查组长
TaskUserRelation leader = null;
List<TaskUserRelation> auditors = request.getAuditors();
if (auditors != null && auditors.size() != 0) {
for(TaskUserRelation auditor : auditors) {
if(auditor.getIsLeader() == 1) {
leader = auditor;
break;
// 找到审查组长
TaskUserRelation leader = null;
List<TaskUserRelation> auditors = request.getAuditors();
if (auditors != null && auditors.size() != 0) {
for(TaskUserRelation auditor : auditors) {
if(auditor.getIsLeader() == 1) {
leader = auditor;
break;
}
}
}
// 任务组长
task.setLeaderId(leader.getUserId());
task.setLeader(leader.getName());
}
// 任务组长
task.setLeaderId(leader.getUserId());
task.setLeader(leader.getName());
}
// 暂存
taskService.save(task);
// 暂存
taskService.save(task);
// 测试场景
// saveTaskScenario(task.getId(), request.getTestScenarioList());
// 保存任务与小组信息
saveUserRelation(auditors,task);
// 保存任务与小组信息
saveUserRelation(auditors,task);
// 保存关联的整车样品信息和零部件样品信息
List<TaskSampleRelation> relations = request.getSample();
List<TaskSampleRelation> partRelations = request.getPartSample();
saveSampleRelation(relations,partRelations,task);
// 保存关联的整车样品信息和零部件样品信息
List<TaskSampleRelation> relations = request.getSample();
List<TaskSampleRelation> partRelations = request.getPartSample();
saveSampleRelation(relations,partRelations,task);
// 保存任务关联的文件信息
saveFileList(request.getFileList(),task);
}
// 保存任务关联的文件信息
saveFileList(request.getFileList(),task);
// }
}
/**
* 编辑暂存
* @param request
*/
@Override
public void editTemporaryStorageTask(TaskEditRequest request) {
// Task oldTask = taskMapper.findByName(request.getTaskName());
// TODO 任务名称验重
// Task oldTask = taskMapper.findByName(request.getTaskName());
// if (oldTask == null || Objects.equals(oldTask.getId(), request.getId())) {
// 构建任务创建者
LoginUser loginUser = SecurityUtils.getLoginUser();
......@@ -565,7 +605,9 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
// 总任务
Task task = new Task();
String joinTaskList = StringUtils.join(request.getTaskList(),",");
task.setTaskList(joinTaskList);
if (StrUtil.isNotEmpty(joinTaskList)) {
task.setTaskList(joinTaskList);
}
BeanUtils.copyBeanProp(task, request);
if (standard != null) {
......@@ -574,9 +616,6 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
task.setFile(standard.getFile());
}
// taskScenarioRelationMapper.delete(new QueryWrapper<TaskScenarioRelation>().lambda().eq(TaskScenarioRelation::getTaskId, task.getId()));
// saveTaskScenario(task.getId(), request.getTestScenarioList());
// 找到审查组长
TaskUserRelation leader = null;
List<TaskUserRelation> auditors = request.getAuditors();
......@@ -612,6 +651,11 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
}
/**
* 获取用户暂存任务
* @param userId
* @return
*/
@Override
public TaskGetInfoResponse getByUserId(Long userId) {
......@@ -627,9 +671,6 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
// response.setTaskList(taskList);
// }
// 测试场景
// response.setTestScenarioList(selectTestScenarioList(task));
// 小组成员
response.setAuditors(setAuditors(task.getId()));
......@@ -650,6 +691,11 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
}
/**
* 根据子任务获取总任务详情
* @param request
* @return
*/
@Override
public TaskGetInfoResponse getBySubtaskId(TaskSubGetInfoRequest request) {
TaskGetInfoResponse response = new TaskGetInfoResponse();
......@@ -673,6 +719,11 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
}
/**
* 数据统计
* @param request
* @return
*/
@Override
public DataStatisticsResponse dataStatistics(TaskGetInfoRequest request) {
......
......@@ -116,12 +116,12 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
// 测试详情
String testDetails = stepResultVO.getDescription();
if (testDetails != null) {
convertMarkdownToHtml(testDetails);
testDetails = convertMarkdownToHtml(testDetails);
}
testDetailsVO += testDetails + "`";
testDetailsVO += testDetails + "<br> ";
}
testDetailsVO = testDetailsVO.substring(0, testDetailsVO.length() - 1);
testRecords.setTestMethod(StringUtils.join(stepList,"`"));
testRecords.setTestMethod(StringUtils.join(stepList,"\n"));
testRecords.setTestDetails(testDetailsVO);
}
......@@ -202,7 +202,7 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
// 测试详情
String testDetails = stepResultVO.getDescription();
if (testDetails != null) {
convertMarkdownToHtml(testDetails);
testDetails = convertMarkdownToHtml(testDetails);
}
testDetailsVO += testDetails + "`";
}
......@@ -237,7 +237,7 @@ public class TestRecordsServiceImpl extends ServiceImpl<TestRecordsMapper, TestR
// jsoup标准化标签,生成闭合标签
doc.outputSettings().syntax(org.jsoup.nodes.Document.OutputSettings.Syntax.xml);
doc.outputSettings().escapeMode(Entities.EscapeMode.xhtml);
return doc.html();
return doc.body().html();
}
@Override
......
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