|
@@ -24,13 +24,6 @@ class LessonService extends CrudService {
|
|
|
if (!res) {
|
|
|
throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '全年计划信息不存在');
|
|
|
}
|
|
|
- // 取得课程模板信息
|
|
|
- const _lessonmode = await this.lmodel.findOne({ type: '0' });
|
|
|
- if (!_lessonmode) {
|
|
|
- throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '课程模板信息不存在');
|
|
|
- }
|
|
|
- // 取得模板内容并转化成json
|
|
|
- const lessonmode = JSON.parse(_lessonmode.lessons);
|
|
|
const terms = res.termnum;
|
|
|
// 循环取得所有期
|
|
|
for (const elm of terms) {
|
|
@@ -49,6 +42,13 @@ class LessonService extends CrudService {
|
|
|
});
|
|
|
// 循环班级
|
|
|
for (const cla of _classs) {
|
|
|
+ // 取得课程模板信息
|
|
|
+ const _lessonmode = await this.lmodel.findOne({ type: cla.type });
|
|
|
+ if (!_lessonmode) {
|
|
|
+ throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '课程模板信息不存在');
|
|
|
+ }
|
|
|
+ // 取得模板内容并转化成json
|
|
|
+ const lessonmode = JSON.parse(_lessonmode.lessons);
|
|
|
// 记录天数
|
|
|
let i = 1;
|
|
|
// 循环天数
|