| | |
| | | |
| | | |
| | | 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 org.springframework.beans.factory.annotation.Autowired; |
| | | |
| | | import java.io.IOException; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 发送预约成功提醒消息 |
| | | */ |
| | | public class TemplateMsgTask implements DeliverCallback { |
| | | public class TemplateMsgTask implements MessageHandler { |
| | | |
| | | @Autowired |
| | | OnlinebookingDao onlinebookingDao; |
| | |
| | | |
| | | |
| | | @Override |
| | | public void handle(String consumerTag, Delivery message) throws IOException { |
| | | public String getName() { |
| | | return "发送预约成功提醒消息"; |
| | | } |
| | | |
| | | String msg = new String(message.getBody(), "UTF-8"); |
| | | JSONObject object = JSONObject.parseObject(msg); |
| | | Integer templateMsgType = (Integer) object.get("templateMsgType"); |
| | | String content = object.get("content") + ""; |
| | | @Override |
| | | public String getRouteKey() { |
| | | return AsyncMessageRouting.ORDER_OUT_SOTORE; |
| | | } |
| | | |
| | | @Override |
| | | public void handle(Map<String,Object> param){ |
| | | |
| | | Integer templateMsgType = (Integer) param.get("templateMsgType"); |
| | | String content = param.get("content") + ""; |
| | | |
| | | if (TemplateMsgType.APPOINTMENT_SUCCESS.getCode().equals(templateMsgType)) { |
| | | appointmentSuccess.sendTemplateMsg(content); |