From f22c4b9230808fed4fec80c435eccb4c833349a0 Mon Sep 17 00:00:00 2001
From: feiyu02 <risaku@163.com>
Date: 星期五, 21 十月 2022 18:36:38 +0800
Subject: [PATCH] 2022.10.21 1.环境守法小程序后台功能首发版本完成

---
 src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/NotificationServiceImpl.kt |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/NotificationServiceImpl.kt b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/NotificationServiceImpl.kt
index 78a5550..be4bb2b 100644
--- a/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/NotificationServiceImpl.kt
+++ b/src/main/kotlin/cn/flightfeather/supervision/lightshare/service/Impl/NotificationServiceImpl.kt
@@ -1,12 +1,12 @@
 package cn.flightfeather.supervision.lightshare.service.Impl
 
+import cn.flightfeather.supervision.common.net.WXHttpService
+import cn.flightfeather.supervision.common.wx.MessageWxVo
+import cn.flightfeather.supervision.common.wx.TemplateManager
+import cn.flightfeather.supervision.common.wx.WxTokenManager
 import cn.flightfeather.supervision.domain.entity.*
 import cn.flightfeather.supervision.domain.enumeration.DistrictType
 import cn.flightfeather.supervision.domain.enumeration.UserType
-import cn.flightfeather.supervision.domain.mapper.NoticeMapper
-import cn.flightfeather.supervision.domain.mapper.NoticeReadStateMapper
-import cn.flightfeather.supervision.domain.mapper.NotificationMapper
-import cn.flightfeather.supervision.domain.mapper.UserinfoMapper
 import cn.flightfeather.supervision.lightshare.repository.MeetingParticipantRepository
 import cn.flightfeather.supervision.lightshare.service.NotificationService
 import cn.flightfeather.supervision.lightshare.vo.NoticeReadStateVo
@@ -14,7 +14,9 @@
 import cn.flightfeather.supervision.push.PushService
 import cn.flightfeather.supervision.domain.enumeration.ParticipantType
 import cn.flightfeather.supervision.domain.enumeration.SceneType
+import cn.flightfeather.supervision.domain.mapper.*
 import cn.flightfeather.supervision.infrastructure.utils.UUIDGenerator
+import com.alibaba.fastjson.JSON
 import com.flightfeather.taizhang.model.enumeration.NotificationType
 import com.flightfeather.taizhang.model.enumeration.WorkSubType
 import com.github.pagehelper.PageHelper
@@ -31,7 +33,8 @@
         val noticeMapper: NoticeMapper,
         val noticeReadStateMapper: NoticeReadStateMapper,
         val userinfoMapper: UserinfoMapper,
-        val meetingParticipantRepository: MeetingParticipantRepository
+        val meetingParticipantRepository: MeetingParticipantRepository,
+        val templateManager: TemplateManager
 ) : NotificationService {
 
     override fun getNotificationUnRead(userId: String, page: Int, per_page: Int, response: HttpServletResponse): List<NotificationVo> {
@@ -288,4 +291,9 @@
         }
         return noticeMapper.insert(notice) == 1
     }
+
+    override fun pushMsgWx(templateId: Int): String {
+        val res = templateManager.sendMsg(templateId, "otZkc5VRlwauEMPqMluQYdVa4zuE", listOf("鍙拌处涓婁紶", "2022骞�10鏈�10鏃�", "3", "璇烽噸鐐瑰叧娉ㄧ幇鍦鸿嚜瀵绘煡閮ㄥ垎"))
+        return if (res) "success" else "fail"
+    }
 }
\ No newline at end of file

--
Gitblit v1.9.3