浏览代码

Merge branch 'feat-lcl-推送订单到MQ' into release-mainserver

lcl 10 月之前
父节点
当前提交
0c7aedefc6
共有 2 个文件被更改,包括 26 次插入0 次删除
  1. 2 0
      AppStart/Helper/AlipayPayBack2Service.cs
  2. 24 0
      AppStart/Helper/LeaderApplyCouponsHelper.cs

+ 2 - 0
AppStart/Helper/AlipayPayBack2Service.cs

@@ -132,6 +132,8 @@ namespace MySystem
                     if (pro.ProductId == 10 || pro.ProductId == 11 || pro.ProductId == 27 || pro.ProductId == 28 || pro.ProductId == 34 || pro.ProductId == -2)
                     {
                         order.Status = 2;
+                        if(pro.ProductId == 28) Utils.Instance.SendMqOrder(order);
+
                         int BuyCount = pro.ProductCount;
                         int Kind = 0;
                         int BeforeLeaderLevel = 0;

+ 24 - 0
AppStart/Helper/LeaderApplyCouponsHelper.cs

@@ -35,10 +35,12 @@ namespace MySystem
                         var Id = int.Parse(content);
                         WebCMSEntities db = new WebCMSEntities();
                         var queryList = db.LeaderReserveRecord.FirstOrDefault(m => m.Id == Id) ?? new LeaderReserveRecord();
+                        var user = db.Users.FirstOrDefault(m => m.Id == queryList.UserId) ?? new Users();
 
                         List<int> couponIds = new List<int>();
                         List<string> codes = new List<string>();                        
                         int count = 0;
+                        int BuyCount = 0;
 
                         JsonData ApplyList = JsonMapper.ToObject(queryList.SeoTitle);
                         for (int i = 0; i < ApplyList.Count; i++)
@@ -63,6 +65,7 @@ namespace MySystem
                                     codes.Add(item.ExchangeCode);
                                 }
                                 count += couponIds.Count / 3;
+                                BuyCount += num / 3;
                             }
                             //大机
                             if (type == 2)
@@ -82,12 +85,33 @@ namespace MySystem
                                     codes.Add(items.ExchangeCode);
                                 }
                                 count += couponIds.Count / 2;
+                                BuyCount += num / 2;
                             }
                             db.SaveChanges();
                         }
                         db.SaveChanges();
                         
                         dosomething(Id, couponIds, codes, count);
+
+                        //推动数据到MQ
+                        Utils.Instance.SendMqOrder(new Orders()
+                        {
+                            Id = queryList.Id,
+                            Status = 2,
+                            CreateDate = queryList.CreateDate,
+                            Remark = queryList.Remark,
+                            BuyCount = BuyCount,
+                            PayStatus = 1,
+                            ProductId = 10000,
+                            DeliveryType = 0,
+                            PayMode = 4,
+                            PayDate = queryList.CreateDate,
+                            TotalPrice = queryList.ChangeAmt,
+                            Mobile = user.Mobile,
+                            RealName = user.RealName,
+                            OrderNo = queryList.SeoKeyword,
+                            UserId = queryList.UserId,
+                        });
                     }
                     catch (Exception ex)
                     {