lrf402788946 4 years ago
parent
commit
e0ef596f1d
1 changed files with 8 additions and 7 deletions
  1. 8 7
      app/service/lesson.js

+ 8 - 7
app/service/lesson.js

@@ -326,10 +326,11 @@ class LessonService extends CrudService {
         lydata = { ...lydata, ...defaults, termid, classid, planyearid, planid };
         noticeList.push(lydata);
       }
-      const dirIsBefore = moment(moment().format('YYYY-MM-DD')).isSameOrBefore(classInfo.startdate); // isSameOrBefore
-      if (dirIsBefore) {
-        noticeList.push(data);
-      }
+      // const dirIsBefore = moment(moment().format('YYYY-MM-DD')).isSameOrBefore(classInfo.startdate); // isSameOrBefore
+      // if (dirIsBefore) {
+      // 班主任,礼仪教师,不限制时间问题,只要未确认,就发送
+      noticeList.push(data);
+      // }
       const { lessons } = l;
       let have_teacherLesson = lessons.filter(f => f.teaid);
       have_teacherLesson = JSON.parse(JSON.stringify(have_teacherLesson));
@@ -338,7 +339,7 @@ class LessonService extends CrudService {
         // 整理时间 TODO,不需要合并时间了,先留着,之后真不需要就删掉
         const { subid, teaid, date } = l;
         // 超过日期了就不发了
-        const isBefore = moment().isSameOrBefore(date);
+        const isBefore = moment(moment().format('YYYY-MM-DD')).isSameOrBefore(date);
         if (!isBefore) continue;
         if (!subid && teaid) continue;
         const r = newArr.find(f => f.subid === subid && f.teaid === teaid);
@@ -497,14 +498,14 @@ class LessonService extends CrudService {
       // 邮件
       if (email) {
         const subject = '吉林省高等学校毕业生就业指导中心通知';
-        await this.ctx.service.util.sendMail('2938260457@qq.com', subject, content);
+        await this.ctx.service.util.sendMail(email, subject, content);
       }
       if (openid) {
         const tourl = this.ctx.app.config.baseUrl + '/msgconfirm/?userid=' + notifiedid + '&noticeid=' + nres._id;
         // TODO 推送
         await this.ctx.service.weixin.sendTemplateDesign(
           this.ctx.app.config.REVIEW_TEMPLATE_ID,
-          'ocPqjswkUejZHq2ANriNrFFC7A3I',
+          openid,
           '您有一个新的通知,请点击信息,确认您已收到信息!',
           '您的安排',
           content,