|
@@ -879,17 +879,18 @@ public class ImportPaperService {
|
|
|
}
|
|
|
}
|
|
|
if(isFirstEmpty){
|
|
|
- importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum)+"中,小题一级属性值不存在,请检查");
|
|
|
+ importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum)+"中,小题一级属性值与课程属性中一级属性不匹配,请检查");
|
|
|
throw new PaperException(importPaperCheck.errorInfo);
|
|
|
}
|
|
|
if(isSecondEmpty){
|
|
|
- importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum)+"中,小题二级属性值不存在,请检查");
|
|
|
+ importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum)+"中,小题二级属性值与课程属性中二级属性不匹配,请检查");
|
|
|
throw new PaperException(importPaperCheck.errorInfo);
|
|
|
}
|
|
|
}
|
|
|
//一级属性有值,二级属性为空
|
|
|
else if(StringUtils.isNotBlank(firstProperty) && StringUtils.isBlank(secondProperty)){
|
|
|
- boolean isEmpty = true;
|
|
|
+ boolean isFirstEmpty = true;
|
|
|
+ boolean isSecondEmpty = true;
|
|
|
//根据课程查询所有课程属性树
|
|
|
List<CourseProperty> courseProperties = coursePropertyRepo.findByCourseCodeAndEnable(paper.getCourse().getCode(), true);
|
|
|
if(courseProperties == null || courseProperties.size()<1){
|
|
@@ -902,15 +903,15 @@ public class ImportPaperService {
|
|
|
List<Property> propertieParents = propertyRepo.findAll(Example.of(propertyParent));
|
|
|
//存在一级属性
|
|
|
if(propertieParents!=null && propertieParents.size()>0){
|
|
|
- isEmpty = false;
|
|
|
+ isFirstEmpty = false;
|
|
|
for(Property proParent:propertieParents){
|
|
|
//根据一级属性查询二级属性
|
|
|
List<Property> proSons = propertyRepo.findByParentIdOrderByNumber(proParent.getId());
|
|
|
- //存在二级属性,报错
|
|
|
+ //存在二级属性,跳过
|
|
|
if(proSons!=null && proSons.size()>0){
|
|
|
- importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum)+"中,小题二级属性值为空,请检查");
|
|
|
- throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ continue;
|
|
|
}else {
|
|
|
+ isSecondEmpty = false;
|
|
|
//保存试题属性
|
|
|
QuesProperty quesProperty = new QuesProperty(proParent, null,courseProperty);
|
|
|
String idNumber = quesProperty.getCoursePropertyName() + "-" + quesProperty.getFirstProperty().getId();
|
|
@@ -920,8 +921,12 @@ public class ImportPaperService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if(isEmpty){
|
|
|
- importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum)+"中,小题一级属性值不存在,请检查");
|
|
|
+ if(isFirstEmpty){
|
|
|
+ importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum)+"中,小题一级属性值与课程属性中一级属性不匹配,请检查");
|
|
|
+ throw new PaperException(importPaperCheck.errorInfo);
|
|
|
+ }
|
|
|
+ if(isSecondEmpty){
|
|
|
+ importPaperCheck.setErrorInfo(getQuesNumInfo(importPaperCheck.quesName, subQuesNum)+"中,小题二级属性值与课程属性中二级属性不匹配,请检查");
|
|
|
throw new PaperException(importPaperCheck.errorInfo);
|
|
|
}
|
|
|
}//一级,二级都为空
|