|
@@ -15,12 +15,16 @@ class TeaplanService extends CrudService {
|
|
}
|
|
}
|
|
|
|
|
|
async findteacher({ batchid }) {
|
|
async findteacher({ batchid }) {
|
|
|
|
+ // 查询所有班主任信息
|
|
const headteachers = await this.hmodel.find();
|
|
const headteachers = await this.hmodel.find();
|
|
const newheadteachers = [];
|
|
const newheadteachers = [];
|
|
|
|
+ // 遍历班主任信息
|
|
for (const headteacher of headteachers) {
|
|
for (const headteacher of headteachers) {
|
|
|
|
+ // 查询某班主任对应的班主任全年计划表
|
|
const teaplan = await this.model.findOne({ headteacherid: headteacher.id });
|
|
const teaplan = await this.model.findOne({ headteacherid: headteacher.id });
|
|
if (teaplan) {
|
|
if (teaplan) {
|
|
const nobatchids = teaplan.nobatchid;
|
|
const nobatchids = teaplan.nobatchid;
|
|
|
|
+ // 如果有对应的全年计划表并且该计划表中的不能上课的批次包含指定批次,则添加status='0'的标记
|
|
if (nobatchids.includes(batchid)) {
|
|
if (nobatchids.includes(batchid)) {
|
|
newheadteachers.push({ ...JSON.parse(JSON.stringify(headteacher)), status: '0' });
|
|
newheadteachers.push({ ...JSON.parse(JSON.stringify(headteacher)), status: '0' });
|
|
} else {
|
|
} else {
|