package com.matrix.system.shopXcx.mqTask; import com.alibaba.fastjson.JSONObject; import com.matrix.component.asyncmessage.MessageHandler; import com.matrix.system.hive.dao.OnlinebookingDao; import com.matrix.system.hive.dao.SysShopInfoDao; import com.matrix.system.shopXcx.dao.ShopProductDao; import com.matrix.system.shopXcx.dao.ShopWxtemplateMsgDao; import com.matrix.system.shopXcx.mqTask.templateMsg.AppointmentSuccess; import com.matrix.system.shopXcx.shopEnum.TemplateMsgType; import com.rabbitmq.client.DeliverCallback; import com.rabbitmq.client.Delivery; import org.springframework.beans.factory.annotation.Autowired; import java.io.IOException; import java.util.Map; /** * 发送预约成功提醒消息 */ public class TemplateMsgTask implements MessageHandler { @Autowired OnlinebookingDao onlinebookingDao; @Autowired SysShopInfoDao shopInfoDao; @Autowired ShopProductDao productDao; @Autowired ShopWxtemplateMsgDao wxtemplateMsgDao; @Autowired AppointmentSuccess appointmentSuccess; @Override public String getName() { return "发送预约成功提醒消息"; } @Override public String getRouteKey() { return AsyncMessageRouting.ORDER_OUT_SOTORE; } @Override public void handle(Map param){ Integer templateMsgType = (Integer) param.get("templateMsgType"); String content = param.get("content") + ""; if (TemplateMsgType.APPOINTMENT_SUCCESS.getCode().equals(templateMsgType)) { appointmentSuccess.sendTemplateMsg(content); } } }