Ver código fonte

增加大批次id

liuyu 4 anos atrás
pai
commit
751323526f
2 arquivos alterados com 6 adições e 2 exclusões
  1. 2 0
      app/service/attendance.js
  2. 4 2
      app/service/school.js

+ 2 - 0
app/service/attendance.js

@@ -80,6 +80,8 @@ class AttendanceService extends CrudService {
         const newdatastu = { termid: student.termid,
           batchid: student.batchid,
           classid: student.classid,
+          planyearid: student.planyearid,
+          planid: student.planid,
           studentid: student.id,
           stuname: student.name,
           schname: student.school_name,

+ 4 - 2
app/service/school.js

@@ -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 ];