|
@@ -28,10 +28,11 @@ class SchoolService extends CrudService {
|
|
|
throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '计划信息不存在');
|
|
|
}
|
|
|
const planid = plan.id;
|
|
|
+ const planyearid = plan.planyearid;
|
|
|
// 取得excle中数据
|
|
|
const _filepath = this.ctx.app.config.baseUrl + filepath;
|
|
|
console.log(_filepath);
|
|
|
- const studatas = await this.getImportXLSXData(_filepath, termid, schid, planid);
|
|
|
+ const studatas = await this.getImportXLSXData(_filepath, termid, schid, planid, planyearid);
|
|
|
console.log(studatas);
|
|
|
// 将得到的数据校验
|
|
|
const datacheck = await this.datacheck(studatas);
|
|
@@ -51,7 +52,7 @@ class SchoolService extends CrudService {
|
|
|
}
|
|
|
|
|
|
// 获取导入的XLSX文件中的数据
|
|
|
- async getImportXLSXData(filepath, termid, schid, planid) {
|
|
|
+ async getImportXLSXData(filepath, termid, schid, planid, planyearid) {
|
|
|
console.log(filepath);
|
|
|
const file = await this.ctx.curl(filepath);
|
|
|
const workbook = XLSX.read(file.data);
|
|
@@ -88,6 +89,7 @@ class SchoolService extends CrudService {
|
|
|
termid,
|
|
|
schid,
|
|
|
planid,
|
|
|
+ planyearid,
|
|
|
});
|
|
|
}
|
|
|
exceldata = [ ...exceldata, ..._datas ];
|