liuyu 4 سال پیش
والد
کامیت
81399b3cfd
1فایلهای تغییر یافته به همراه5 افزوده شده و 6 حذف شده
  1. 5 6
      app/service/school.js

+ 5 - 6
app/service/school.js

@@ -32,6 +32,9 @@ class SchoolService extends CrudService {
     }
     // 取得学校预计人数
     const num_ = this.getschnum(plan, type, schid, termid);
+    console.log('*******************');
+    console.log(num_);
+    console.log('*******************');
     const planid = plan.id;
     const planyearid = plan.planyearid;
     // 取得excle中数据
@@ -54,11 +57,11 @@ class SchoolService extends CrudService {
       throw new BusinessError(ErrorCode.DATA_NOT_EXIST, '期信息不存在');
     }
     const nowtime = moment().locale('zh-cn').format('YYYY-MM-DD HH:mm:ss');
-    if (studatas.length > Number(num_)) {
+    if (studatas.length > num_) {
       const jobdata = { code: schid, name: schname, planid: plan.id, termid, term: trem_.term, filepath, studs: JSON.stringify(studatas), plannum: num_, schnum: studatas.length, isstore: '0', createtime: nowtime, type, reason: '学校上传人数超过预期人数' };
       await this.jmodel.create(jobdata);
       throw new BusinessError(ErrorCode.SERVICE_FAULT, '学校上传人数超过预期人数');
-    } else if (studatas.length < Number(num_)) {
+    } else if (studatas.length < num_) {
       const jobdata = { code: schid, name: schname, planid: plan.id, termid, term: trem_.term, filepath, studs: JSON.stringify(studatas), plannum: num_, schnum: studatas.length, isstore: '0', createtime: nowtime, type, reason: '学校上传人数少于预期人数' };
       await this.jmodel.create(jobdata);
       throw new BusinessError(ErrorCode.SERVICE_FAULT, '学校上传人数少于预期人数');
@@ -105,10 +108,6 @@ class SchoolService extends CrudService {
     });
     arr = arr.flat();
     const obj_ = _.find(arr, { termid, type });
-    console.log('*******************');
-    console.log(arr);
-    console.log(obj_);
-    console.log('*******************');
     return obj_.number;
   }