您的位置:首页 > 娱乐 > 八卦 > 试玩无限刷一天赚500_下载手机app_中国市场营销网网站_网站推广seo是什么

试玩无限刷一天赚500_下载手机app_中国市场营销网网站_网站推广seo是什么

2024/12/23 9:50:27 来源:https://blog.csdn.net/dongjing991/article/details/143515416  浏览:    关键词:试玩无限刷一天赚500_下载手机app_中国市场营销网网站_网站推广seo是什么
试玩无限刷一天赚500_下载手机app_中国市场营销网网站_网站推广seo是什么

前言

JAVA中 将信息 推送到企业微信

	// 企微消息推送messageprivate String getMessage(String name, String problemType, String pushResults, Long orderId,java.util.Date submitTime, java.util.Date payTime) {String message = "对接方:+<font color=\"info\">" + name + "</font>" + "\n" + ">问题类型:+<font color=\"info\">"+ problemType + "</font>" + "\n" + ">推送结果:+<font color=\"info\">" + pushResults + "</font>" + "\n"+ ">订单号:+<font color=\"info\">" + orderId + "</font>" + "\n" + ">订单产生时间:+<font color=\"info\">"+ submitTime + "</font>" + "\n" + ">订单支付时间:+<font color=\"info\">" + payTime + "</font>" + "\n"+ ">最后重推时间:+<font color=\"info\">" + new Date() + "</font>";return message;}

业务逻辑实现

                    LoggerFactory.getLogger(CtgExtendController.class).info("企业微信消息发送开始");String message = getMessage(log);String url = ConfigDao.getAppConfig().getConfig("fail_order_push_robot","https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=49308bf4-3e4c-47d8-95a9-1dbfd7984b66");ExceptionMessageModel exceptionMessageModel = new ExceptionMessageModel();exceptionMessageModel.setMessage(message);exceptionMessageModel.setRobotUrl(url);exceptionMessageModel.setTemplateCode(WxEtpRobotMsgEnum.MSG_ORDER_PUSH_H5.msgCode);exceptionMessageModel.setJsonParam(JSONUtility.objectToNotNullJson(resVo));//发送消息实现if (StringUtils.isNotBlank(exceptionMessageModel.getTemplateCode()) && StringUtils.isNotBlank(exceptionMessageModel.getJsonParam())) {//优先取配置项中的模板配置String msg = WxEtpRobotMsgEnum.covertMsg(exceptionMessageModel.getTemplateCode(), exceptionMessageModel.getJsonParam());if(StringUtils.isNotBlank(msg)){exceptionMessageModel.setMessage(msg);}}LoggerFactory.getLogger(CtgExtendController.class).info("异常信息推送埋点进入,入参:"+ exceptionMessageModel.toString());WxRobotUtil.sendMsg(exceptionMessageModel.getRobotUrl(), exceptionMessageModel.getMessage());LoggerFactory.getLogger(CtgExtendController.class).info("企业微信消息发送成功");

public class WxRobotUtil {
    private static final Logger logger= LoggerFactory.getLogger(WxRobotUtil.class);

    public static void sendMsg(String url,String msg){
        new CommonThread("","WxRobotUtil"){
            @Override
            public void run() {
               try {
                   //拼装发送消息
                   Map<String, Object> map = new HashMap<>();
                   Map<String, String> param = new HashMap<>();
                   map.put("msgtype", "markdown");
                   param.put("content","时间:"+new Date().getDateTimeStr()+"\n"+msg);
                   map.put("markdown", param);
                   String result = HttpUtility.doPost(url, JSONUtility.objectToJson(map), ContentType.APPLICATION_JSON.getMimeType());
                   logger.info("微信机器人消息:"+url+"---"+msg);
               }
               catch (Exception e){
                   logger.error("异常:"+url+"---"+msg,e);
               }
            }
        }.start();
    }
}

public class WxRobotUtil {private static final Logger logger= LoggerFactory.getLogger(WxRobotUtil.class);public static void sendMsg(String url,String msg){new CommonThread("","WxRobotUtil"){@Overridepublic void run() {try {//拼装发送消息Map<String, Object> map = new HashMap<>();Map<String, String> param = new HashMap<>();map.put("msgtype", "markdown");param.put("content","时间:"+new Date().getDateTimeStr()+"\n"+msg);map.put("markdown", param);String result = HttpUtility.doPost(url, JSONUtility.objectToJson(map), ContentType.APPLICATION_JSON.getMimeType());logger.info("微信机器人消息:"+url+"---"+msg);}catch (Exception e){logger.error("异常:"+url+"---"+msg,e);}}}.start();}
}

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com