|
@@ -90,18 +90,18 @@ class TeaplanService extends CrudService {
|
|
|
const teaplanList = await this.model.find({ trainplanid });
|
|
|
// 查询所有班主任信息
|
|
|
const headteacherList = await this.hmodel.find();
|
|
|
- for (const teaplan of teaplanList) {
|
|
|
- // 过滤出班主任信息表中id为此班主任全年计划信息班主任id的数据
|
|
|
- const headteacherInfo = _.filter(headteacherList, item => item.id === teaplan.headteacherid);
|
|
|
- // 如果班主任信息列表中班主任上报了班主任全年计划,将其移除
|
|
|
- if (headteacherInfo.length === 0) {
|
|
|
- _.remove(headteacherList, item => item.id === teaplan.headteacherid);
|
|
|
- }
|
|
|
- }
|
|
|
+ // for (const teaplan of teaplanList) {
|
|
|
+ // // 过滤出班主任信息表中id为此班主任全年计划信息班主任id的数据
|
|
|
+ // const headteacherInfo = _.filter(headteacherList, item => item.id === teaplan.headteacherid);
|
|
|
+ // // 如果班主任信息列表中班主任上报了班主任全年计划,将其移除
|
|
|
+ // if (headteacherInfo.length === 0) {
|
|
|
+ // _.remove(headteacherList, item => item.id === teaplan.headteacherid);
|
|
|
+ // }
|
|
|
+ // }
|
|
|
// 遍历所有批次信息
|
|
|
// 将全年计划中的批次信息取出放在一个数组中
|
|
|
let teaListKfp = [];
|
|
|
- let teaListAll = headteacherList;
|
|
|
+ let teaListAll = _.cloneDeep(JSON.parse(JSON.stringify(headteacherList)));
|
|
|
for (const term of trainplan.termnum) {
|
|
|
for (const batch of term.batchnum) {
|
|
|
if (teaListAll.length === 0) {
|
|
@@ -113,11 +113,12 @@ class TeaplanService extends CrudService {
|
|
|
// 遍历班主任全年计划表中的不能上课的日期
|
|
|
for (const nodate of teaplan.nodate) {
|
|
|
// 如果不能上课的日期在该批次的开始时间和结束时间中,将该班主任从班主任列表中删除
|
|
|
- if (!moment(nodate).isBetween(batch.startdate, batch.enddate, null, '[]')) {
|
|
|
- const headteacher_ = await this.hmodel.findById(teaplan.headteacherid);
|
|
|
- if (headteacher_) {
|
|
|
- teaListAll.push(headteacher_);
|
|
|
- }
|
|
|
+ if (moment(nodate).isBetween(batch.startdate, batch.enddate, null, '[]')) {
|
|
|
+ // const headteacher_ = await this.hmodel.findById(teaplan.headteacherid);
|
|
|
+ // if (headteacher_) {
|
|
|
+ // teaListAll.push(headteacher_);
|
|
|
+ // }
|
|
|
+ _.remove(teaListAll, item => item.id === teaplan.headteacherid);
|
|
|
}
|
|
|
}
|
|
|
}
|