|
@@ -190,12 +190,18 @@ public class CourseServiceImpl implements CourseService {
|
|
|
|
|
|
couse.setCode(code);
|
|
|
|
|
|
- try {
|
|
|
- CourseLevel cl = CourseLevel.valueOf(trimAndNullIfBlank(line[2]));
|
|
|
- couse.setLevel(cl);
|
|
|
- } catch (Exception e) {
|
|
|
- msg.append(" 课程层次错误");
|
|
|
+ String level = trimAndNullIfBlank(line[2]);
|
|
|
+ if (StringUtils.isBlank(level)) {
|
|
|
+ msg.append(" 课程层次不能为空");
|
|
|
hasError = true;
|
|
|
+ } else {
|
|
|
+ try {
|
|
|
+ CourseLevel cl = CourseLevel.getCourseLevel(level);
|
|
|
+ couse.setLevel(cl);
|
|
|
+ } catch (Exception e) {
|
|
|
+ msg.append(" 课程层次错误");
|
|
|
+ hasError = true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (hasError) {
|