From e4a06e0730dc0aa6ced97cbb3362d6b8ef473d39 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 27 三月 2025 15:56:34 +0800
Subject: [PATCH] 最新版本541200007

---
 server/visits/dmvisit_service/src/main/java/com/doumee/core/wx/wxPlat/WxPlatNotice.java |  155 +++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 137 insertions(+), 18 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 e0c6a02..408a033 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.*;
@@ -254,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") );
@@ -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)
@@ -394,7 +386,6 @@
                 }
                 String jumpUrl = Constants.getWxUrl(systemDictDataBiz.queryByCode(Constants.PLATFORM,Constants.WX_REDIRECT_URL).getCode(),
                         wxUrlParams,platformBooks.getId().toString());
-
                 String postUrL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token;
                 //鏁翠綋鍙傛暟map
                 Map<String, Object> paramMap = new HashMap<String, Object>();
@@ -437,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{
@@ -525,7 +517,7 @@
                                        List<String> openIds){
         try{
             if(CollectionUtils.isNotEmpty(openIds)){
-                WxNoticeConfig wxNoticeConfig =  wxNoticeConfigMapper.selectOne(new QueryWrapper<WxNoticeConfig>().lambda().eq(WxNoticeConfig::getObjType,WxPlatConstants.visit)
+                WxNoticeConfig wxNoticeConfig =  wxNoticeConfigMapper.selectOne(new QueryWrapper<WxNoticeConfig>().lambda().eq(WxNoticeConfig::getObjType,WxPlatConstants.platformJob)
                         .eq(WxNoticeConfig::getObjCode,objCode)
                         .eq(WxNoticeConfig::getStatus, Constants.ZERO)
                         .last(" limit 1")
@@ -625,23 +617,150 @@
                     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"));
                     }
                 }
             }
         }catch (Exception e){
 
         }
-
     }
 
 
+    /**
+     * 鏈堝彴绛惧埌閫氱煡
+     * @param wxNoticeConfigMapper
+     * @param platformJob
+     * @param objCode
+     * @param token
+     * @param openIds
+     */
+    public void  sendPlatformJobSignNotice(WxNoticeConfigMapper wxNoticeConfigMapper, PlatformJob platformJob, String objCode,String token,
+                                               List<String> openIds){
+        try{
+            if(CollectionUtils.isNotEmpty(openIds)){
+                WxNoticeConfig wxNoticeConfig =  wxNoticeConfigMapper.selectOne(new QueryWrapper<WxNoticeConfig>().lambda().eq(WxNoticeConfig::getObjType,WxPlatConstants.platformJob)
+                        .eq(WxNoticeConfig::getObjCode,objCode)
+                        .eq(WxNoticeConfig::getStatus, Constants.ZERO)
+                        .last(" limit 1")
+                );
+                if(Objects.isNull(wxNoticeConfig)){
+                    return;
+                }
+                String postUrL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token;
+                //鏁翠綋鍙傛暟map
+                Map<String, Object> paramMap = new HashMap<String, Object>();
+                //娑堟伅涓婚鏄剧ず鐩稿叧map
+                Map<String, Object> dataMap = new HashMap<String, Object>();
+                //杞︾墝鍙�
+                Map<String, Object> car_number1 = new HashMap<String,Object>();
+                car_number1.put("value",platformJob.getCarCodeFront());
+                //鍙告満濮撳悕
+                Map<String, Object> thing2 = new HashMap<String,Object>();
+                thing2.put("value",platformJob.getDriverName());
+                //绛惧埌鏃堕棿
+                Map<String, Object> time5 = new HashMap<String,Object>();
+                time5.put("value", DateUtil.getFomartDate(platformJob.getSignDate(),"yyyy骞碝M鏈坉d鏃� HH:mm:ss"));
 
+                dataMap.put("car_number1",car_number1);
+                dataMap.put("thing2",thing2);
+                dataMap.put("time5",time5);
+                for (String openId:openIds) {
+                    paramMap.clear();
+                    paramMap.put("template_id", wxNoticeConfig.getTempId());
+                    paramMap.put("touser", openId);
+                    paramMap.put("data", dataMap);
+                    String response = HttpsUtil.postJson(postUrL, JSONObject.toJSONString(paramMap));
+                    log.error("路==++--路鎺ㄩ�佸井淇℃ā鏉夸俊鎭唴瀹癸細{}", JSONObject.toJSONString(paramMap));
+                    if(StringUtils.isBlank(response)){
+                        log.error("路==++--路鎺ㄩ�佸井淇℃ā鏉夸俊鎭細{}路--++==路", "澶辫触");
+                    }else{
+                        JSONObject json = JSONObject.parseObject(response);
+                        log.error("路==++--路鎺ㄩ�佸井淇℃ā鏉夸俊鎭細{}路--++==路", Constants.equalsInteger(json.getInteger("errcode"),Constants.ZERO)?"鎴愬姛":"澶辫触"+json.getString("errmsg"));
+                    }
+                }
+            }
+        }catch (Exception e){
+
+        }
+    }
+
+    public void  sendUnFinishNotice(WxNoticeConfigMapper wxNoticeConfigMapper,Integer unFinishNum,String objCode,String token,
+                                           List<String> openIds){
+        try{
+            if(CollectionUtils.isNotEmpty(openIds)){
+                WxNoticeConfig wxNoticeConfig =  wxNoticeConfigMapper.selectOne(new QueryWrapper<WxNoticeConfig>().lambda().eq(WxNoticeConfig::getObjType,WxPlatConstants.platformJob)
+                        .eq(WxNoticeConfig::getObjCode,objCode)
+                        .eq(WxNoticeConfig::getStatus, Constants.ZERO)
+                        .last(" limit 1")
+                );
+                if(Objects.isNull(wxNoticeConfig)){
+                    return;
+                }
+                String postUrL = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token="+token;
+                //鏁翠綋鍙傛暟map
+                Map<String, Object> paramMap = new HashMap<String, Object>();
+                //娑堟伅涓婚鏄剧ず鐩稿叧map
+                Map<String, Object> dataMap = new HashMap<String, Object>();
+                //杞︾墝鍙�
+                Map<String, Object> const1 = new HashMap<String,Object>();
+                const1.put("value","浣滀笟浠诲姟鏈畬鎴�");
+                //鍙告満濮撳悕
+                Map<String, Object> thing2 = new HashMap<String,Object>();
+                thing2.put("value",unFinishNum+"涓�");
+                //绛惧埌鏃堕棿
+                Map<String, Object> time3 = new HashMap<String,Object>();
+                time3.put("value", DateUtil.getFomartDate(new Date(),"yyyy骞碝M鏈坉d鏃� HH:mm:ss"));
+
+                dataMap.put("const1",const1);
+                dataMap.put("thing2",thing2);
+                dataMap.put("time3",time3);
+                for (String openId:openIds) {
+                    paramMap.clear();
+                    paramMap.put("template_id", wxNoticeConfig.getTempId());
+                    paramMap.put("touser", openId);
+                    paramMap.put("data", dataMap);
+                    String response = HttpsUtil.postJson(postUrL, JSONObject.toJSONString(paramMap));
+                    log.error("路==++--路鎺ㄩ�佸井淇℃ā鏉夸俊鎭唴瀹癸細{}", JSONObject.toJSONString(paramMap));
+                    if(StringUtils.isBlank(response)){
+                        log.error("路==++--路鎺ㄩ�佸井淇℃ā鏉夸俊鎭細{}路--++==路", "澶辫触");
+                    }else{
+                        JSONObject json = JSONObject.parseObject(response);
+                        log.error("路==++--路鎺ㄩ�佸井淇℃ā鏉夸俊鎭細{}路--++==路", Constants.equalsInteger(json.getInteger("errcode"),Constants.ZERO)?"鎴愬姛":"澶辫触"+json.getString("errmsg"));
+                    }
+                }
+            }
+        }catch (Exception e){
+
+        }
+    }
+    
+
+    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