Commit e3eea603 authored by wdy's avatar wdy

编辑任务任务样品中间表无变化修改

parent 054e8bf1
......@@ -212,13 +212,15 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
taskUserRelationService.saveBatch(auditors);
// 保存关联的整车样品信息
List<TaskSampleRelation> partRelationList = taskSampleRelationService.selectByTaskId(request.getId(),TaskSampleRelation.PART_VEHICLE_SAMPLE);
taskSampleRelationService.removeBatchByIds(partRelationList);
List<TaskSampleRelation> relations = request.getSample();
if (relations.size() != 0 && relations != null) {
for (TaskSampleRelation sampleRelation : relations) {
sampleRelation.setTaskId(task.getId());
}
taskSampleRelationService.updateBatchById(relations);
taskSampleRelationService.saveBatch(relations);
}
// 任务样品关系
......@@ -254,13 +256,15 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements Ta
}
// 保存关联的零部件样品信息
List<TaskSampleRelation> relationList = taskSampleRelationService.selectByTaskId(request.getId(),TaskSampleRelation.COMPLETE_VEHICLE_SAMPLE);
taskSampleRelationService.removeBatchByIds(relationList);
List<TaskSampleRelation> partRelations = request.getPartSample();
if (partRelations.size() != 0 && partRelations != null) {
for (TaskSampleRelation partSampleRelation : partRelations) {
partSampleRelation.setTaskId(task.getId());
}
taskSampleRelationService.updateBatchById(partRelations);
taskSampleRelationService.saveBatch(partRelations);
}
}
......
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