OrderMessageHelper.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. using MySystem.Models.Main;
  3. using System.Linq;
  4. namespace MySystem
  5. {
  6. public class OrderMessageHelper
  7. {
  8. public static void SendOrderMsg(ConsumerOrders order)
  9. {
  10. WebCMSEntities db = new WebCMSEntities();
  11. MerchantInfo merchant = db.MerchantInfo.FirstOrDefault(m => m.Id == order.MerchantId) ?? new MerchantInfo();
  12. OrderMessage msg = new OrderMessage()
  13. {
  14. brandId = merchant.BrandId + 1, //品牌/通道(0直联,1银联,2好哒)
  15. status = order.Status, //订单状态(0待支付,1已支付)
  16. createDate = order.CreateDate.Value, //创建时间
  17. payDate = order.UpdateDate.Value, //支付时间
  18. hdOrderNo = order.SeoTitle, //好哒订单号
  19. tradeNo = order.SeoKeyword, //支付宝微信平台交易号
  20. snNo = order.SnNo, //码牌SN
  21. payMoney = order.PayMoney, //支付金额
  22. payMode = order.PayMode, //支付方式(1支付宝,2微信)
  23. orderNo = order.OrderNo, //订单号
  24. consumerId = order.ConsumerId, //消费者Id
  25. merchantId = order.MerchantId, //商户Id
  26. isAct = (int)order.IsAct, //活动标识(1活动,0非活动)
  27. userId = order.UserId, //创客Id
  28. merchantActualAmount = order.MerchantActualAmount, //商家实收金额
  29. };
  30. db.Dispose();
  31. RedisDbconn.Instance.AddList("MpOrderQueue", Newtonsoft.Json.JsonConvert.SerializeObject(msg));
  32. }
  33. }
  34. }