lrf402788946 4 years ago
parent
commit
e21f0c9e66
3 changed files with 5 additions and 8 deletions
  1. 4 2
      app/service/apply.js
  2. 1 1
      app/service/school.js
  3. 0 5
      app/service/teacher.js

+ 4 - 2
app/service/apply.js

@@ -151,9 +151,10 @@ class ApplyService extends CrudService {
     if (!termnum) return;
     termnum = JSON.parse(JSON.stringify(termnum));
     // 过滤出确认的期,TODO:没有做通知
-    termnum = termnum.filter(f => ids.includes(f._id));
+    // termnum = termnum.filter(f => );
     // 找到每个教师的位置,然后把状态(status)改成1=>已确认
     for (const t of termnum) {
+      if (!ids.includes(t._id)) continue;
       const { term } = t;
       if (!(t.batchnum && _.isArray(t.batchnum))) continue;
       for (const b of t.batchnum) {
@@ -314,11 +315,12 @@ class ApplyService extends CrudService {
       const tea = teaList.find(f => f._id === teaid);
       const teauser = teauserList.find(f => f.uid === teaid);
       // 文案
-      const msg = `${_.get(tea, 'name', '')}老师您好:
+      let msg = `${_.get(tea, 'name', '')}老师您好:
       吉林省高等学校毕业生就业指导中心-双困生培训系统提醒您:
       ${term}期-${name.includes('班') ? name : `${name}班`}
       ${day}(星期${this.dayList[moment(day).days()]})
       有您的课程安排:${subname}`;
+      msg = `${msg}\n 如果您无法进行授课,请及时联系中心负责人`;
       // 邮箱与微信都发送
       const { email } = tea;
       if (email) {

+ 1 - 1
app/service/school.js

@@ -50,7 +50,7 @@ class SchoolService extends CrudService {
     const planid = plan.id;
     const planyearid = plan.planyearid;
     // 取得excle中数据
-    const _filepath = 'http://127.0.0.1' + filepath; // this.ctx.app.config.baseUrl http://127.0.0.1:2001 http://jytz.jilinjobs.cn
+    const _filepath = 'http://127.0.0.1' + filepath; // this.ctx.app.config.baseUrl http://127.0.0.1 http://jytz.jilinjobs.cn
     const studatas = await this.getImportXLSXData(
       _filepath,
       termid,

+ 0 - 5
app/service/teacher.js

@@ -17,7 +17,6 @@ class TeacherService extends CrudService {
   }
 
   async query(info, { skip, limit }) {
-    console.log(skip, limit);
     let res = await this.model
       .find(info)
       .skip(Number(skip))
@@ -81,10 +80,8 @@ class TeacherService extends CrudService {
         detail = '您已通过审核被正式录入教师库';
       }
       const date = await this.ctx.service.util.updatedate();
-      console.log(teacher.id);
 
       const user = await this.umodel.findOne({ uid: teacher.id, type: '3' });
-      console.log(user);
 
       if (user && user.openid) {
         await this.ctx.service.weixin.sendTemplateMsg(
@@ -112,7 +109,6 @@ class TeacherService extends CrudService {
     assert(filepath, 'filepath不能为空');
     // 取得excle中数据
     const _filepath = this.ctx.app.config.baseUrl + filepath;
-    console.log(_filepath);
     const teadatas = await this.getImportXLSXData(_filepath);
     // 将得到的数据校验
     const datacheck = await this.datacheck(teadatas);
@@ -135,7 +131,6 @@ class TeacherService extends CrudService {
 
   // 获取导入的XLSX文件中的数据
   async getImportXLSXData(filepath) {
-    console.log(filepath);
     const file = await this.ctx.curl(filepath);
     const workbook = XLSX.read(file.data);
     // 读取内容