From 5464bf2beb3f07a6f3843f88df887f95cbe983af Mon Sep 17 00:00:00 2001
From: doum <doum>
Date: 星期二, 06 一月 2026 17:05:03 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/wuhuyancao' into wuhuyancao

---
 server/meeting/meeting_service/src/main/java/com/doumee/core/wx/WxPlatNotice.java |   26 ++++++++++++++------------
 1 files changed, 14 insertions(+), 12 deletions(-)

diff --git a/server/meeting/meeting_service/src/main/java/com/doumee/core/wx/WxPlatNotice.java b/server/meeting/meeting_service/src/main/java/com/doumee/core/wx/WxPlatNotice.java
index 85565d8..68808e5 100644
--- a/server/meeting/meeting_service/src/main/java/com/doumee/core/wx/WxPlatNotice.java
+++ b/server/meeting/meeting_service/src/main/java/com/doumee/core/wx/WxPlatNotice.java
@@ -9,6 +9,7 @@
 import com.doumee.dao.business.dao.SmsEmailMapper;
 import com.doumee.dao.business.model.Bookings;
 import com.doumee.dao.business.model.SmsEmail;
+import com.doumee.dao.system.model.SystemDictData;
 import com.github.xiaoymin.knife4j.core.util.CollectionUtils;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
@@ -27,6 +28,12 @@
 @Component
 public class WxPlatNotice {
 
+    public String  getAccessToken(String appid,String secret) {
+        String url = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid="+appid+"&secret="+secret;
+        String response = HttpsUtil.get(url,false);
+        JSONObject json = JSONObject.parseObject(response);
+        return json.getString("access_token");
+    }
     public void  testSendNotice(List<String> openIds,String token){
         if(CollectionUtils.isNotEmpty(openIds)){
             String postUrL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token;
@@ -120,8 +127,6 @@
     }
 
     public void createBeginWxNotice(SystemDictDataBiz systemDictDataBiz, SmsEmailMapper smsEmailMapper, Bookings bookings, String openId){
-        Map<String,Object> map = new HashMap<>();
-
         //鏁翠綋鍙傛暟map
         Map<String, Object> paramMap = new HashMap<String, Object>();
         //娑堟伅涓婚鏄剧ず鐩稿叧map
@@ -169,13 +174,12 @@
         smsEmail.setCreateDate(new Date());
         smsEmail.setTitle("浼氳鍗冲皢寮�濮嬫彁閱�");
         smsEmail.setInfo(DateUtil.getFomartDate(DateUtil.getXMinuteAfterDate(bookings.getStartTime(),-earlyMin),"yyyy-MM-dd HH:mm:ss"));
-        smsEmail.setContent(JSONObject.toJSONString(map));
+        smsEmail.setContent(JSONObject.toJSONString(paramMap));
+        smsEmailMapper.insert(smsEmail);
     }
 
 
     public void createEndWxNotice(SystemDictDataBiz systemDictDataBiz, SmsEmailMapper smsEmailMapper, Bookings bookings,  String openId){
-        Map<String,Object> map = new HashMap<>();
-
         //鏁翠綋鍙傛暟map
         Map<String, Object> paramMap = new HashMap<String, Object>();
         //娑堟伅涓婚鏄剧ず鐩稿叧map
@@ -203,12 +207,6 @@
         paramMap.put("touser", openId);
         paramMap.put("data", dataMap);
 
-        smsEmailMapper.delete(new QueryWrapper<SmsEmail>().lambda()
-                .eq(SmsEmail::getObjType,Constants.FIVE.toString())
-                .eq(SmsEmail::getStatus,Constants.TWO)
-                .eq(SmsEmail::getType,Constants.TWO)
-                .eq(SmsEmail::getObjId,bookings.getId())
-        );
 
         SmsEmail smsEmail = new SmsEmail();
         smsEmail.setPhone(openId);
@@ -222,7 +220,11 @@
         smsEmail.setTitle("浼氳鍗冲皢寮�濮嬫彁閱�");
         Integer endMin= Integer.valueOf(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.OVER_NOTICE_WX).getCode());
         smsEmail.setInfo(DateUtil.getFomartDate(DateUtil.getXMinuteAfterDate(bookings.getEndTime(),-endMin),"yyyy-MM-dd HH:mm:ss"));
-        smsEmail.setContent(JSONObject.toJSONString(map));
+        smsEmail.setContent(JSONObject.toJSONString(paramMap));
+
+        smsEmailMapper.insert(smsEmail);
+
+
     }
 
 

--
Gitblit v1.9.3