|
@@ -75,15 +75,15 @@ class BedroomService extends CrudService {
|
|
|
console.log(bedroom.code);
|
|
|
// 判断当前寝室号是否已有
|
|
|
// 根据期id查找所有当期学生列表
|
|
|
- const _stu = await this.getbedroomstudents(termid, batchid, bedroom.id);
|
|
|
+ const _stu = await this.getbedroomstudents(termid, batchid, bedroom.code);
|
|
|
console.log(_stu.length);
|
|
|
if (bedroom.number !== _stu.length) {
|
|
|
let i = 0;
|
|
|
let _gender = '';
|
|
|
for (const stud of studentList) {
|
|
|
console.log('stu---' + stud.bedroom);
|
|
|
- if (stud.bedroomid) {
|
|
|
- if (stud.bedroomid === bedroom.id) {
|
|
|
+ if (stud.bedroom) {
|
|
|
+ if (stud.bedroom === bedroom.code) {
|
|
|
i = i + 1;
|
|
|
}
|
|
|
continue;
|
|
@@ -144,9 +144,9 @@ class BedroomService extends CrudService {
|
|
|
}
|
|
|
|
|
|
// 取得符合条件的学生列表
|
|
|
- async getbedroomstudents(termid, batchid, bedroomid) {
|
|
|
+ async getbedroomstudents(termid, batchid, bedroom) {
|
|
|
// 根据期id查找所有当期学生列表
|
|
|
- const studentList = await this.smodel.find({ termid, batchid, bedroomid });
|
|
|
+ const studentList = await this.smodel.find({ termid, batchid, bedroom });
|
|
|
return studentList;
|
|
|
}
|
|
|
}
|