k94314517
2024-12-25 0843f9b1526b7680f5cd419cf1f2d2fff44562ee
server/visits/dmvisit_service/src/main/java/com/doumee/core/wx/wxPlat/WxPlatNotice.java
@@ -8,6 +8,7 @@
import com.doumee.core.utils.DateUtil;
import com.doumee.core.utils.Http;
import com.doumee.core.utils.HttpsUtil;
import com.doumee.dao.business.MemberMapper;
import com.doumee.dao.business.VisitsMapper;
import com.doumee.dao.business.WxNoticeConfigMapper;
import com.doumee.dao.business.model.*;
@@ -353,6 +354,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 +378,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 +396,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>();
@@ -642,7 +643,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){
        }
    }
}