|
|
|
@ -112,16 +112,25 @@ public class SaveOrUpdateTaskDomainServiceImpl implements SaveOrUpdateTaskDomain |
|
|
|
dto.setBusinessId(subProductLine.getBusinessId()); |
|
|
|
} |
|
|
|
// 经典模式:补全分类冗余字段
|
|
|
|
if (ExamModeEnum.CLASSIC.getValue().equals(dto.getExamMode()) && dto.getClassicCategoryId() != null) { |
|
|
|
ClassicCategoryEntity category = classicCategoryBaseService.getById(dto.getClassicCategoryId()); |
|
|
|
if (category != null) { |
|
|
|
dto.setClassicCategoryName(category.getName()); |
|
|
|
// 如果是二级分类,补全父级信息
|
|
|
|
if (category.getParentId() != null && category.getParentId() != 0) { |
|
|
|
dto.setClassicCategoryParentId(category.getParentId()); |
|
|
|
ClassicCategoryEntity parentCategory = classicCategoryBaseService.getById(category.getParentId()); |
|
|
|
if (parentCategory != null) { |
|
|
|
dto.setClassicCategoryParentName(parentCategory.getName()); |
|
|
|
if (ExamModeEnum.CLASSIC.getValue().equals(dto.getExamMode())) { |
|
|
|
// 如果前端没传 classicCategoryId,从套题组推导
|
|
|
|
if (dto.getClassicCategoryId() == null && dto.getClassicPaperSetId() != null) { |
|
|
|
ClassicPaperSetEntity paperSet = classicPaperSetBaseService.getById(dto.getClassicPaperSetId()); |
|
|
|
if (paperSet != null) { |
|
|
|
dto.setClassicCategoryId(paperSet.getClassicCategoryId()); |
|
|
|
} |
|
|
|
} |
|
|
|
if (dto.getClassicCategoryId() != null) { |
|
|
|
ClassicCategoryEntity category = classicCategoryBaseService.getById(dto.getClassicCategoryId()); |
|
|
|
if (category != null) { |
|
|
|
dto.setClassicCategoryName(category.getName()); |
|
|
|
// 如果是二级分类,补全父级信息
|
|
|
|
if (category.getParentId() != null && category.getParentId() != 0) { |
|
|
|
dto.setClassicCategoryParentId(category.getParentId()); |
|
|
|
ClassicCategoryEntity parentCategory = classicCategoryBaseService.getById(category.getParentId()); |
|
|
|
if (parentCategory != null) { |
|
|
|
dto.setClassicCategoryParentName(parentCategory.getName()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|