|  |  |  | 
|---|
|  |  |  | @Override | 
|---|
|  |  |  | public void handle(String consumerTag, Delivery message) throws IOException { | 
|---|
|  |  |  | try { | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | String messages = new String(message.getBody(), "UTF-8"); | 
|---|
|  |  |  | JSONObject messageJsonParam=JSONObject.parseObject(messages); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | bulderParam.put("gzhAppid", gzhAppid.getParamValue()); | 
|---|
|  |  |  | bulderParam.put("template_id", template.getUuid()); | 
|---|
|  |  |  | bulderParam.put("messageJsonParam", messageJsonParam); | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //调用模板计算出消息体 | 
|---|
|  |  |  | Map msgResult = templateMessageBulder.buildMsg(bulderParam); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | if(msgResult.containsKey("error")){ | 
|---|
|  |  |  | //错误消息处理 | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | LogUtil.error("模板消息发送内容:"+msgResult.get("error")); | 
|---|
|  |  |  | return; | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | 
|---|
|  |  |  | LogUtil.debug("微信小程序模板消息推送结果:" + result.toString()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } catch (Exception e) { | 
|---|
|  |  |  | LogUtil.error("消费者执行异常", e); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|