Commit 5de4250c authored by wdy's avatar wdy

方法复用

parent baf324b3
...@@ -302,25 +302,24 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta ...@@ -302,25 +302,24 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
TaskGetInfoResponse response = new TaskGetInfoResponse(); TaskGetInfoResponse response = new TaskGetInfoResponse();
Task task = taskService.getById(request.getId()); Task task = taskService.getById(request.getId());
if (task != null) {
BeanUtils.copyBeanProp(response, task); BeanUtils.copyBeanProp(response, task);
// 小组成员 // 小组成员
List<TaskUserRelation> relation = taskUserRelationService.selectQTeamMembers(request.getId()); response.setAuditors(setAuditors(request.getId()));
response.setAuditors(relation);
// 整车样品信息 // 整车样品信息
List<TaskSampleRelation> relationList = taskSampleRelationService.selectByTaskId(request.getId(),TaskSampleRelation.COMPLETE_VEHICLE_SAMPLE); response.setCompleteVehicleSample(setSampleList(request.getId(),TaskSampleRelation.COMPLETE_VEHICLE_SAMPLE));
if (relationList.size() != 0 && relationList != null) {
List<Sample> completeVehicleSampleList = sampleManagementMapper.findByIdList(relationList);
response.setCompleteVehicleSample(completeVehicleSampleList);
}
// 零部件样品信息 // 零部件样品信息
List<TaskSampleRelation> partRelationList = taskSampleRelationService.selectByTaskId(request.getId(),TaskSampleRelation.PART_VEHICLE_SAMPLE); response.setPartVehicleSample(setSampleList(request.getId(),TaskSampleRelation.PART_VEHICLE_SAMPLE));
if (partRelationList.size() != 0 && partRelationList != null) {
List<Sample> partVehicleSampleList = sampleManagementMapper.findByIdList(partRelationList);
response.setPartVehicleSample(partVehicleSampleList);
}
return response; return response;
} else {
return null;
}
} }
@Override @Override
...@@ -408,22 +407,16 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta ...@@ -408,22 +407,16 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
if (task != null && task.getId() != null) { if (task != null && task.getId() != null) {
BeanUtils.copyBeanProp(response, task); BeanUtils.copyBeanProp(response, task);
// 小组成员 // 小组成员
List<TaskUserRelation> relation = taskUserRelationService.selectQTeamMembers(task.getId()); response.setAuditors(setAuditors(task.getId()));
response.setAuditors(relation);
// 整车样品信息 // 整车样品信息
List<TaskSampleRelation> relationList = taskSampleRelationService.selectByTaskId(task.getId(), TaskSampleRelation.COMPLETE_VEHICLE_SAMPLE); response.setCompleteVehicleSample(setSampleList(task.getId(), TaskSampleRelation.COMPLETE_VEHICLE_SAMPLE));
if (relationList.size() != 0 && relationList != null) {
List<Sample> completeVehicleSampleList = sampleManagementMapper.findByIdList(relationList);
response.setCompleteVehicleSample(completeVehicleSampleList);
}
// 零部件样品信息 // 零部件样品信息
List<TaskSampleRelation> partRelationList = taskSampleRelationService.selectByTaskId(task.getId(), TaskSampleRelation.PART_VEHICLE_SAMPLE); response.setPartVehicleSample(setSampleList(task.getId(), TaskSampleRelation.PART_VEHICLE_SAMPLE));
if (partRelationList.size() != 0 && partRelationList != null) {
List<Sample> partVehicleSampleList = sampleManagementMapper.findByIdList(partRelationList);
response.setPartVehicleSample(partVehicleSampleList);
}
return response; return response;
} else { } else {
return null; return null;
...@@ -436,25 +429,44 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta ...@@ -436,25 +429,44 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
public TaskGetInfoResponse getBySubtaskId(TaskSubGetInfoRequest request) { public TaskGetInfoResponse getBySubtaskId(TaskSubGetInfoRequest request) {
TaskGetInfoResponse response = new TaskGetInfoResponse(); TaskGetInfoResponse response = new TaskGetInfoResponse();
Task task = taskMapper.getBySubtaskId(request.getId()); Task task = taskMapper.getBySubtaskId(request.getId());
if (task != null) {
BeanUtils.copyBeanProp(response, task); BeanUtils.copyBeanProp(response, task);
// 小组成员 // 小组成员
List<TaskUserRelation> relation = taskUserRelationService.selectQTeamMembers(task.getId()); response.setAuditors(setAuditors(task.getId()));
response.setAuditors(relation);
// 整车样品信息 // 整车样品信息
List<TaskSampleRelation> relationList = taskSampleRelationService.selectByTaskId(task.getId(),TaskSampleRelation.COMPLETE_VEHICLE_SAMPLE); response.setCompleteVehicleSample(setSampleList(task.getId(),TaskSampleRelation.COMPLETE_VEHICLE_SAMPLE));
if (relationList.size() != 0 && relationList != null) {
List<Sample> completeVehicleSampleList = sampleManagementMapper.findByIdList(relationList);
response.setCompleteVehicleSample(completeVehicleSampleList);
}
// 零部件样品信息 // 零部件样品信息
List<TaskSampleRelation> partRelationList = taskSampleRelationService.selectByTaskId(task.getId(),TaskSampleRelation.PART_VEHICLE_SAMPLE); response.setPartVehicleSample(setSampleList(task.getId(),TaskSampleRelation.PART_VEHICLE_SAMPLE));
if (partRelationList.size() != 0 && partRelationList != null) {
List<Sample> partVehicleSampleList = sampleManagementMapper.findByIdList(partRelationList);
response.setPartVehicleSample(partVehicleSampleList);
}
return response; return response;
} else {
return null;
}
}
public List<TaskUserRelation> setAuditors ( Long id) {
// 小组成员
List<TaskUserRelation> relation = taskUserRelationService.selectQTeamMembers(id);
return relation;
}
public List<Sample> setSampleList(Long id,String type) {
// 样品信息
List<TaskSampleRelation> relationList = taskSampleRelationService.selectByTaskId(id,type);
if (relationList.size() != 0 && relationList != null) {
List<Sample> SampleList = sampleManagementMapper.findByIdList(relationList);
return SampleList;
} else {
return null;
}
} }
public Long saveSystemReview(TaskCreateRequest request,SysUser initiator,Standard standard,TaskUserRelation leader) { public Long saveSystemReview(TaskCreateRequest request,SysUser initiator,Standard standard,TaskUserRelation leader) {
......
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