lrf402788946 4 tahun lalu
induk
melakukan
ed9309b76f
4 mengubah file dengan 12 tambahan dan 6 penghapusan
  1. 1 1
      app/controller/weixin.js
  2. 6 4
      app/service/apply.js
  3. 4 0
      app/service/lesson.js
  4. 1 1
      config/config.default.js

+ 1 - 1
app/controller/weixin.js

@@ -184,7 +184,7 @@ class WeixinController extends Controller {
     console.warn('-------');
     console.warn(`openid=>${appopenid}`);
     const state = uuid();
-    const key = `appopenid:${state}`;
+    const key = `appinfo:${state}`;
     await this.app.redis.set(key, appopenid, 'EX', 600);
     const res = await this.ctx.service.user.findByAppOpenid(appopenid);
     console.warn({ user: res, openid: appopenid });

+ 6 - 4
app/service/apply.js

@@ -171,9 +171,6 @@ class ApplyService extends CrudService {
     await trainplan.save();
   }
 
-  arrangeLesson() {
-
-  }
 
   /**
    * 拍平了的课表=>termnum
@@ -282,7 +279,12 @@ class ApplyService extends CrudService {
     return arr;
   }
 
-  async arrangeSendMsg({ planid, ids }) {
+
+  /**
+   * 发送消息
+   * @param {Object} param planid:年度计划id,ids,发送的期列表;classtype:发送班级类型 undefined 都发,有的话就找指定班级类型发
+   */
+  async arrangeSendMsg({ planid, ids, classtype }) {
     const trainplan = await this.trainmodel.findById(planid);
     if (!trainplan) {
       throw new BusinessError(ErrorCode.DATA_EXISTED, '年度计划不存在');

+ 4 - 0
app/service/lesson.js

@@ -454,6 +454,10 @@ class LessonService extends CrudService {
           if (!r) {
             nres.notified.push({ content, username, notifiedid });
             await nres.save();
+          } else {
+            // 有这个人,需要查这个人是否接收到信息,接收到信息,就不需要再次发送了
+            const { status } = r;
+            if (status !== '0') continue;
           }
         }
       }

+ 1 - 1
config/config.default.js

@@ -71,7 +71,7 @@ module.exports = appInfo => {
   // 导出配置
   config.cdn = {
     repos_root_path: '/usr/local/workspace/service-file/upload',
-    repos_root_url_excel: '/excel',
+    repos_root_url_excel: '/excel/',
   };
   // mq配置
   // config.amqp = {