|
@@ -20,6 +20,18 @@ class SchoolService extends CrudService {
|
|
|
this.schmodel = this.ctx.model.Schtime;
|
|
|
}
|
|
|
|
|
|
+ async create(data) {
|
|
|
+ const { code, name } = data;
|
|
|
+ assert(code, '缺少学校代码');
|
|
|
+ assert(name, '缺少学校名称');
|
|
|
+ const res = await this.model.create(data);
|
|
|
+ if (res) {
|
|
|
+ const obj = { mobile: code, name, type: '2', uid: res._id, passwd: { secret: '12345678' } };
|
|
|
+ await this.umodel.create(obj);
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+
|
|
|
async stuimport(data) {
|
|
|
const { filepath, termid, schid, type, batchid } = data;
|
|
|
assert(filepath, 'filepath不能为空');
|