Commit b9641c30 authored by wdy's avatar wdy

编辑任务

parent 35c7511d
......@@ -283,31 +283,22 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
if (sampleRelations.size() != 0 && sampleRelations != null) {
// 获取之前的第一个企业名称
TaskSampleRelation taskSampleRelation = sampleRelations.get(0);
Sample sample = sampleManagementMapper.selectSampleManagementById(taskSampleRelation.getSampleId());
Sample oldSample = sampleManagementMapper.selectSampleManagementById(taskSampleRelation.getSampleId());
// 获取编辑任务后的第一个企业名称
TaskSampleRelation taskSampleRelation1 = relations.get(0);
Sample sample1 = sampleManagementMapper.selectSampleManagementById(taskSampleRelation1.getSampleId());
TaskSampleRelation newTaskSampleRelation = relations.get(0);
Sample newSample = sampleManagementMapper.selectSampleManagementById(newTaskSampleRelation.getSampleId());
// 第一个企业名称不相同则修改
if (!Objects.equals(sample.getManufacturingEnterprise(), sample1.getManufacturingEnterprise())){
Task task1 = taskMapper.selectById(request.getId());
// 体系审查对应的留档文件
List<ReviewEnterpriseArchive> reviewEnterpriseArchiveList = reviewEnterpriseArchiveMapper.findList(task1.getSystemReviewTaskId());
if (!Objects.equals(oldSample.getManufacturingEnterprise(), newSample.getManufacturingEnterprise())){
// 留档文件
List<ReviewEnterpriseArchive> reviewEnterpriseArchiveList = reviewEnterpriseArchiveMapper.findList(request.getId());
for (ReviewEnterpriseArchive reviewEnterpriseArchive : reviewEnterpriseArchiveList) {
reviewEnterpriseArchive.setEnterpriseName(sample1.getManufacturingEnterprise());
reviewEnterpriseArchive.setEnterpriseName(newSample.getManufacturingEnterprise());
}
reviewEnterpriseArchiveService.updateBatchById(reviewEnterpriseArchiveList);
// 车辆对应的留档文件
List<ReviewEnterpriseArchive> reviewEnterpriseArchiveList1 = reviewEnterpriseArchiveMapper.findList(task1.getCarReviewTaskId());
for (ReviewEnterpriseArchive reviewEnterpriseArchive1 : reviewEnterpriseArchiveList1) {
reviewEnterpriseArchive1.setEnterpriseName(sample1.getManufacturingEnterprise());
}
reviewEnterpriseArchiveService.updateBatchById(reviewEnterpriseArchiveList1);
}
}
}
......
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