|
@@ -20,7 +20,7 @@ class SchoolService extends CrudService {
|
|
|
}
|
|
|
|
|
|
async stuimport(data) {
|
|
|
- const { filepath, termid, schid } = data;
|
|
|
+ const { filepath, termid, schid, type } = data;
|
|
|
assert(filepath, 'filepath不能为空');
|
|
|
assert(termid, 'termid不能为空');
|
|
|
assert(schid, 'schid不能为空');
|
|
@@ -40,7 +40,7 @@ class SchoolService extends CrudService {
|
|
|
// 取得excle中数据
|
|
|
const _filepath = this.ctx.app.config.baseUrl + filepath;
|
|
|
console.log(_filepath);
|
|
|
- const studatas = await this.getImportXLSXData(_filepath, termid, schid, planid, planyearid);
|
|
|
+ const studatas = await this.getImportXLSXData(_filepath, termid, schid, planid, planyearid, type);
|
|
|
console.log(studatas);
|
|
|
// 将得到的数据校验
|
|
|
const datacheck = await this.datacheck(studatas);
|
|
@@ -75,7 +75,7 @@ class SchoolService extends CrudService {
|
|
|
}
|
|
|
|
|
|
// 获取导入的XLSX文件中的数据
|
|
|
- async getImportXLSXData(filepath, termid, schid, planid, planyearid) {
|
|
|
+ async getImportXLSXData(filepath, termid, schid, planid, planyearid, type) {
|
|
|
console.log(filepath);
|
|
|
const file = await this.ctx.curl(filepath);
|
|
|
const workbook = XLSX.read(file.data);
|
|
@@ -132,6 +132,7 @@ class SchoolService extends CrudService {
|
|
|
schid,
|
|
|
planid,
|
|
|
planyearid,
|
|
|
+ type,
|
|
|
});
|
|
|
}
|
|
|
exceldata = [ ...exceldata, ..._datas ];
|