liuyu %!s(int64=4) %!d(string=hai) anos
pai
achega
92a1fcbd17
Modificáronse 3 ficheiros con 11 adicións e 3 borrados
  1. 3 0
      app/controller/.job.js
  2. 1 0
      app/model/job.js
  3. 7 3
      app/service/school.js

+ 3 - 0
app/controller/.job.js

@@ -6,6 +6,7 @@ module.exports = {
       'planid',
       'termid',
       'term',
+      'batchid',
       'filepath',
       'studs',
       'plannum',
@@ -28,6 +29,7 @@ module.exports = {
       'planid',
       'termid',
       'term',
+      'batchid',
       'filepath',
       'studs',
       'plannum',
@@ -52,6 +54,7 @@ module.exports = {
         planid: 'planid',
         termid: 'termid',
         term: 'term',
+        batchid: 'batchid',
         filepath: 'filepath',
         studs: 'studs',
         plannum: 'plannum',

+ 1 - 0
app/model/job.js

@@ -9,6 +9,7 @@ const JobSchema = {
   planid: { type: String, required: false, maxLength: 200 }, // 计划id
   termid: { type: String, required: false, maxLength: 200 }, // 期id
   term: { type: String, required: false, maxLength: 500 }, // 期名称
+  batchid: { type: String, required: false, maxLength: 200 }, // 批次id
   filepath: { type: String, required: false, maxLength: 500 }, // 文件地址
   studs: { type: String, required: false }, // 学生数据
   plannum: { type: String, required: false, maxLength: 20 }, // 计划人数

+ 7 - 3
app/service/school.js

@@ -21,7 +21,7 @@ class SchoolService extends CrudService {
   }
 
   async stuimport(data) {
-    const { filepath, termid, schid, type } = data;
+    const { filepath, termid, schid, type, batchid } = data;
     assert(filepath, 'filepath不能为空');
     assert(termid, 'termid不能为空');
     assert(schid, 'schid不能为空');
@@ -46,7 +46,8 @@ class SchoolService extends CrudService {
       schid,
       planid,
       planyearid,
-      type
+      type,
+      batchid
     );
     // 将得到的数据校验
     const datacheck = await this.datacheck(studatas);
@@ -70,6 +71,7 @@ class SchoolService extends CrudService {
         planid: plan.id,
         termid,
         term: trem_.term,
+        batchid,
         filepath,
         studs: JSON.stringify(studatas),
         plannum: num_,
@@ -91,6 +93,7 @@ class SchoolService extends CrudService {
         planid: plan.id,
         termid,
         term: trem_.term,
+        batchid,
         filepath,
         studs: JSON.stringify(studatas),
         plannum: num_,
@@ -152,7 +155,7 @@ class SchoolService extends CrudService {
   }
 
   // 获取导入的XLSX文件中的数据
-  async getImportXLSXData(filepath, termid, schid, planid, planyearid, type) {
+  async getImportXLSXData(filepath, termid, schid, planid, planyearid, type, batchid) {
     console.log(filepath);
     const file = await this.ctx.curl(filepath);
     const workbook = XLSX.read(file.data);
@@ -209,6 +212,7 @@ class SchoolService extends CrudService {
         edua_system: data[theadRule[17]],
         diy: diy_,
         termid,
+        batchid,
         schid,
         planid,
         planyearid,