|
@@ -237,5 +237,19 @@ class TrainplanService extends CrudService {
|
|
|
return await trainplan.save();
|
|
|
}
|
|
|
|
|
|
+ async updatereteacher({ trainplanid, termid, reteacher }) {
|
|
|
+ assert(trainplanid && termid && reteacher, '缺少参数项');
|
|
|
+ // 根据全年计划表id查出对应的全年计划详细信息
|
|
|
+ const trainplan = await this.model.findById(trainplanid);
|
|
|
+ if (!trainplan) {
|
|
|
+ throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '全年计划信息不存在');
|
|
|
+ }
|
|
|
+ const term = await trainplan.termnum.id(termid);
|
|
|
+ if (term) {
|
|
|
+ term.reteacher = reteacher;
|
|
|
+ }
|
|
|
+ return await trainplan.save();
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
module.exports = TrainplanService;
|