lrf402788946 4 tahun lalu
induk
melakukan
420675700b
1 mengubah file dengan 5 tambahan dan 4 penghapusan
  1. 5 4
      app/service/apply.js

+ 5 - 4
app/service/apply.js

@@ -288,7 +288,6 @@ class ApplyService extends CrudService {
    * @param {Object} param planid:年度计划id,ids,发送的期列表;classtype:发送班级类型 undefined 都发,有的话就找指定班级类型发
    */
   async arrangeSendMsg({ planid, ids, classtype }) {
-    console.log(classtype);
     const trainplan = await this.trainmodel.findById(planid);
     if (!trainplan) {
       throw new BusinessError(ErrorCode.DATA_EXISTED, '年度计划不存在');
@@ -318,7 +317,9 @@ class ApplyService extends CrudService {
     arr = _.orderBy(arr, [ 'day' ], [ 'asc' ]);
     for (const l of arr) {
       // 教师id,期数,班级名,上课的日期,课程名
-      const { teaid, term, name, day, subname, termid, classid, type } = l;
+      const { teaid, term, name, day, subname, termid, classid, type, status } = l;
+      // 已确认的教师不发信息
+      if (status === '1') continue;
       // 判断发送的班级类型
       if (!(classtype && classtype === type)) continue;
       const tea = teaList.find(f => f._id === teaid);
@@ -386,7 +387,7 @@ class ApplyService extends CrudService {
       return;
     }
     const subject = '吉林省高等学校毕业生就业指导中心通知(系统邮件,请勿回复)'; //
-    this.ctx.service.util.sendMail('2938260457@qq.com', subject, content);
+    this.ctx.service.util.sendMail(email, subject, content);
   }
   /**
    * 计划-教师初步课表发送微信推送
@@ -403,7 +404,7 @@ class ApplyService extends CrudService {
     // TODO or notTODO 发送微信推送记录
     await this.ctx.service.weixin.sendTemplateDesign(
       this.ctx.app.config.REVIEW_TEMPLATE_ID,
-      'ocPqjswkUejZHq2ANriNrFFC7A3I',
+      openid,
       '您有一个新的通知',
       '您有新的安排',
       content,