From b33f2e78ffd4fd401698b84a33dc3c293793c62f Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期二, 18 二月 2025 16:22:33 +0800
Subject: [PATCH] 最新版本541200007

---
 server/visits/dmvisit_service/src/main/java/com/doumee/core/wx/wxPlat/WxPlatNotice.java |   77 +++++++++++++++++++++-----------------
 1 files changed, 42 insertions(+), 35 deletions(-)

diff --git a/server/visits/dmvisit_service/src/main/java/com/doumee/core/wx/wxPlat/WxPlatNotice.java b/server/visits/dmvisit_service/src/main/java/com/doumee/core/wx/wxPlat/WxPlatNotice.java
index e94cb63..2cecf5e 100644
--- a/server/visits/dmvisit_service/src/main/java/com/doumee/core/wx/wxPlat/WxPlatNotice.java
+++ b/server/visits/dmvisit_service/src/main/java/com/doumee/core/wx/wxPlat/WxPlatNotice.java
@@ -1,25 +1,16 @@
 package com.doumee.core.wx.wxPlat;
 
-import cn.emay.sdk.util.json.gson.JsonObject;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.doumee.biz.system.SystemDictDataBiz;
 import com.doumee.core.utils.Constants;
 import com.doumee.core.utils.DateUtil;
-import com.doumee.core.utils.Http;
 import com.doumee.core.utils.HttpsUtil;
-import com.doumee.dao.business.VisitsMapper;
 import com.doumee.dao.business.WxNoticeConfigMapper;
 import com.doumee.dao.business.model.*;
 import com.github.xiaoymin.knife4j.core.util.CollectionUtils;
 import lombok.extern.slf4j.Slf4j;
-import me.chanjar.weixin.common.error.WxErrorException;
-import me.chanjar.weixin.mp.api.WxMpService;
-import me.chanjar.weixin.mp.bean.template.WxMpTemplateData;
-import me.chanjar.weixin.mp.bean.template.WxMpTemplateMessage;
 import org.apache.commons.lang3.StringUtils;
-import org.apache.commons.lang3.time.DateFormatUtils;
-import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
 import java.util.*;
@@ -101,10 +92,10 @@
                         wxUrlParams = Constants.WxUrlParams.VISIT_RECORD_USER;
                     }
                 }
-                String url = Constants.getWxUrl(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.WX_REDIRECT_URL).getCode(),
+                String jumpUrl = Constants.getWxUrl(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.WX_REDIRECT_URL).getCode(),
                         wxUrlParams
                         ,visits.getId().toString());
-                String jumpUrl = systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_QRCODE_PREFIX).getCode().replace( "${param}", url);
+
                 
                 String postUrL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token;
                 //鏁翠綋鍙傛暟map
@@ -134,6 +125,7 @@
                     paramMap.put("touser", openId);
                     paramMap.put("data", dataMap);
                     String response = HttpsUtil.postJson(postUrL, JSONObject.toJSONString(paramMap));
+                    log.warn("路==++--路鎺ㄩ�佸井淇℃ā鏉夸俊鎭烦杞湴鍧�锛歿}路--++==路", jumpUrl);
                     if(StringUtils.isBlank(response)){
                         log.warn("路==++--路鎺ㄩ�佸井淇℃ā鏉夸俊鎭細{}路--++==路", "澶辫触");
                     }else{
@@ -166,9 +158,9 @@
                 if(Objects.isNull(wxNoticeConfig)){
                     return;
                 }
-                String url = Constants.getWxUrl(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.WX_REDIRECT_URL).getCode(),
+                String jumpUrl = Constants.getWxUrl(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.WX_REDIRECT_URL).getCode(),
                         Constants.WxUrlParams.HIDDEN_DANGER,hiddenDanger.getId().toString());
-                String jumpUrl = systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_QRCODE_PREFIX).getCode().replace( "${param}", url);
+
 
                 String postUrL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token;
                 //鏁翠綋鍙傛暟map
@@ -233,9 +225,9 @@
                 if(Objects.isNull(wxNoticeConfig)){
                     return;
                 }
-                String url = Constants.getWxUrl(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.WX_REDIRECT_URL).getCode(),
+                String jumpUrl = Constants.getWxUrl(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.WX_REDIRECT_URL).getCode(),
                         Constants.WxUrlParams.HIDDEN_DANGER,hiddenDanger.getId().toString());
-                String jumpUrl = systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_QRCODE_PREFIX).getCode().replace( "${param}", url);
+
 
                 String postUrL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token;
                 //鏁翠綋鍙傛暟map
@@ -253,7 +245,7 @@
                 thing13.put("value",Constants.equalsInteger(hiddenDanger.getStatus(),Constants.ONE)?"闅愭偅宸叉暣鏀�":"闅愭偅宸查��鍥�");
                 //鎻愪氦浜�
                 Map<String, Object> thing10 = new HashMap<String,Object>();
-                thing10.put("value",hiddenDanger.getCheckorName());
+                thing10.put("value",hiddenDanger.getMemberName());
                 //閫氱煡鏃堕棿
                 Map<String, Object> time16 = new HashMap<String,Object>();
                 time16.put("value", DateUtil.getFomartDate(hiddenDanger.getDealTime(),"yyyy骞碝M鏈坉d鏃� HH:mm:ss") );
@@ -304,9 +296,8 @@
                 if(Objects.isNull(wxNoticeConfig)){
                     return;
                 }
-                String url = Constants.getWxUrl(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.WX_REDIRECT_URL).getCode(),
+                String jumpUrl = Constants.getWxUrl(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.WX_REDIRECT_URL).getCode(),
                         Constants.WxUrlParams.CAR_USE,carUseBook.getId().toString());
-                String jumpUrl = systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_QRCODE_PREFIX).getCode().replace( "${param}", url);
 
                 String postUrL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token;
                 //鏁翠綋鍙傛暟map
@@ -353,6 +344,7 @@
                     paramMap.put("touser", openId);
                     paramMap.put("data", dataMap);
                     String response = HttpsUtil.postJson(postUrL, JSONObject.toJSONString(paramMap));
+                    log.warn("路==++--路鎺ㄩ�佸井淇℃ā鏉夸俊鎭細{}", jumpUrl);
                     if(StringUtils.isBlank(response)){
                         log.warn("路==++--路鎺ㄩ�佸井淇℃ā鏉夸俊鎭細{}路--++==路", "澶辫触");
                     }else{
@@ -376,8 +368,8 @@
      * @param openIds
      * @param sendType 0=鐢宠浜猴紱1=瀹℃壒浜�
      */
-    public void  sendPlatformBookTemplateNotice(SystemDictDataBiz systemDictDataBiz,WxNoticeConfigMapper wxNoticeConfigMapper, PlatformBooks platformBooks, String objCode,String token,
-                                       List<String> openIds,Integer sendType){
+    public void  sendPlatformBookTemplateNotice(SystemDictDataBiz systemDictDataBiz, WxNoticeConfigMapper wxNoticeConfigMapper, PlatformBooks platformBooks, String objCode, String token,
+                                                List<String> openIds, Integer sendType){
         try{
             if(CollectionUtils.isNotEmpty(openIds)){
                 WxNoticeConfig wxNoticeConfig =  wxNoticeConfigMapper.selectOne(new QueryWrapper<WxNoticeConfig>().lambda().eq(WxNoticeConfig::getObjType,WxPlatConstants.platformBook)
@@ -392,10 +384,8 @@
                 if(!objCode.equals(WxPlatConstants.platformBookContent.platformBookUpload)){
                     wxUrlParams = Constants.WxUrlParams.PLATFORM_BOOK;
                 }
-                String url = Constants.getWxUrl(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.WX_REDIRECT_URL).getCode(),
+                String jumpUrl = Constants.getWxUrl(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.WX_REDIRECT_URL).getCode(),
                         wxUrlParams,platformBooks.getId().toString());
-                String jumpUrl = systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_QRCODE_PREFIX).getCode().replace( "${param}", url);
-
                 String postUrL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token;
                 //鏁翠綋鍙傛暟map
                 Map<String, Object> paramMap = new HashMap<String, Object>();
@@ -438,6 +428,7 @@
                     paramMap.put("touser", openId);
                     paramMap.put("data", dataMap);
                     String response = HttpsUtil.postJson(postUrL, JSONObject.toJSONString(paramMap));
+                    log.warn("路==++--路鎺ㄩ�佸井淇℃ā鏉夸俊鎭細{}", JSONObject.toJSONString(paramMap));
                     if(StringUtils.isBlank(response)){
                         log.warn("路==++--路鎺ㄩ�佸井淇℃ā鏉夸俊鎭細{}路--++==路", "澶辫触");
                     }else{
@@ -473,9 +464,8 @@
                     return;
                 }
 
-                String url = Constants.getWxUrl(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.WX_REDIRECT_URL).getCode(),
+                String jumpUrl = Constants.getWxUrl(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.WX_REDIRECT_URL).getCode(),
                         Constants.WxUrlParams.PLATFORM_JOB_DRIVER,platformJob.getId().toString());
-                String jumpUrl = systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_QRCODE_PREFIX).getCode().replace( "${param}", url);
 
                 String postUrL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token;
                 //鏁翠綋鍙傛暟map
@@ -536,9 +526,8 @@
                     return;
                 }
 
-                String url = Constants.getWxUrl(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.WX_REDIRECT_URL).getCode(),
+                String jumpUrl = Constants.getWxUrl(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.WX_REDIRECT_URL).getCode(),
                         Constants.WxUrlParams.PLATFORM_JOB_DRIVER,platformJob.getId().toString());
-                String jumpUrl = systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_QRCODE_PREFIX).getCode().replace( "${param}", url);
 
                 String postUrL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token;
                 //鏁翠綋鍙傛暟map
@@ -597,9 +586,8 @@
                     return;
                 }
 
-                String url = Constants.getWxUrl(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.WX_REDIRECT_URL).getCode(),
+                String jumpUrl = Constants.getWxUrl(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.WX_REDIRECT_URL).getCode(),
                         Constants.WxUrlParams.PLATFORM_JOB_DRIVER,platformJob.getId().toString());
-                String jumpUrl = systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.SIGN_IN_QRCODE_PREFIX).getCode().replace( "${param}", url);
 
                 String postUrL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token;
                 //鏁翠綋鍙傛暟map
@@ -613,14 +601,14 @@
                 Map<String, Object> car_number3 = new HashMap<String,Object>();
                 car_number3.put("value",platformJob.getCarCodeFront());
                 //鏈堝彴鍙�
-                Map<String, Object> character_string7 = new HashMap<String,Object>();
-                character_string7.put("value", "A001");
+                Map<String, Object> thing9 = new HashMap<String,Object>();
+                thing9.put("value", platformJob.getPlatformName());
                 //鏃堕棿
                 Map<String, Object> time4 = new HashMap<String,Object>();
                 time4.put("value", DateUtil.getFomartDate(new Date(),"yyyy骞碝M鏈坉d鏃� HH:mm:ss") );
                 dataMap.put("const6",const6);
                 dataMap.put("car_number3",car_number3);
-                dataMap.put("character_string7",character_string7);
+                dataMap.put("thing9",thing9);
                 dataMap.put("time4",time4);
                 for (String openId:openIds) {
                     paramMap.clear();
@@ -629,12 +617,12 @@
                     paramMap.put("touser", openId);
                     paramMap.put("data", dataMap);
                     String response = HttpsUtil.postJson(postUrL, JSONObject.toJSONString(paramMap));
-                    log.warn("路==++--路鎺ㄩ�佸井淇℃ā鏉夸俊鎭唴瀹癸細{}", JSONObject.toJSONString(paramMap));
+                    log.error("路==++--路鎺ㄩ�佸井淇℃ā鏉夸俊鎭唴瀹癸細{}", JSONObject.toJSONString(paramMap));
                     if(StringUtils.isBlank(response)){
-                        log.warn("路==++--路鎺ㄩ�佸井淇℃ā鏉夸俊鎭細{}路--++==路", "澶辫触");
+                        log.error("路==++--路鎺ㄩ�佸井淇℃ā鏉夸俊鎭細{}路--++==路", "澶辫触");
                     }else{
                         JSONObject json = JSONObject.parseObject(response);
-                        log.warn("路==++--路鎺ㄩ�佸井淇℃ā鏉夸俊鎭細{}路--++==路", Constants.equalsInteger(json.getInteger("errcode"),Constants.ZERO)?"鎴愬姛":"澶辫触"+json.getString("errmsg"));
+                        log.error("路==++--路鎺ㄩ�佸井淇℃ā鏉夸俊鎭細{}路--++==路", Constants.equalsInteger(json.getInteger("errcode"),Constants.ZERO)?"鎴愬姛":"澶辫触"+json.getString("errmsg"));
                     }
                 }
             }
@@ -645,7 +633,26 @@
     }
 
 
+    public void  sendMeetTemplateNotice(SystemDictDataBiz systemDictDataBiz,SmsEmail smsEmail,String token){
+        try{
+                String jumpUrl = Constants.getWxUrl(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.WX_REDIRECT_URL).getCode(),
+                        Constants.WxUrlParams.MEETING,smsEmail.getObjId().toString());
+                String postUrL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token;
+                JSONObject jsonObject = JSONObject.parseObject(smsEmail.getContent());
+                jsonObject.put("url",jumpUrl);
+                String response = HttpsUtil.postJson(postUrL, JSONObject.toJSONString(jsonObject));
+                log.warn("路==++--路鎺ㄩ�佸井淇℃ā鏉夸俊鎭唴瀹癸細{}", JSONObject.toJSONString(jsonObject));
+                if(StringUtils.isBlank(response)){
+                    log.warn("路==++--路鎺ㄩ�佸井淇℃ā鏉夸俊鎭細{}路--++==路", "澶辫触");
+                }else{
+                    JSONObject json = JSONObject.parseObject(response);
+                    log.warn("路==++--路鎺ㄩ�佸井淇℃ā鏉夸俊鎭細{}路--++==路", Constants.equalsInteger(json.getInteger("errcode"),Constants.ZERO)?"鎴愬姛":"澶辫触"+json.getString("errmsg"));
+                }
+        }catch (Exception e){
 
+        }
+
+    }
 
 
 }

--
Gitblit v1.9.3