Przeglądaj źródła

取消机具申请订单恢复仓库申请订单数量

lcl 1 rok temu
rodzic
commit
2b16822039

+ 5 - 0
Areas/Admin/Controllers/MainServer/MachineApplyController.cs

@@ -372,6 +372,8 @@ namespace MySystem.Areas.Admin.Controllers
                     string SwapSnExpand = apply.SwapSnExpand;
                     if (!string.IsNullOrEmpty(SwapSnExpand))
                     {
+                        StoreHouse store = db.StoreHouse.FirstOrDefault(m => m.Id == apply.StoreId) ?? new StoreHouse();
+
                         string key = function.MD5_16(apply.UserId + apply.OrderExpand);
                         string[] list = SwapSnExpand.TrimEnd('\n').Split('\n');
                         if (apply.Sort > 0)
@@ -438,6 +440,9 @@ namespace MySystem.Areas.Admin.Controllers
                             function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(apply) + "#cut#" + Newtonsoft.Json.JsonConvert.SerializeObject(order) + "#cut#" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"), "机具申请订单取消日志");
                             db.MachineApply.Remove(apply);
                             db.Orders.Remove(order);
+
+                            //恢复仓库申请订单数量
+                            store.ApplyNum -= list.Length;
                             db.SaveChanges();
                         }
                         else

+ 1 - 0
Models/PosCoupons.cs

@@ -25,5 +25,6 @@ namespace MySystem.Models
         public ulong HelpProfitFlag { get; set; }
         public int OpId { get; set; }
         public int OrderId { get; set; }
+        public int OpenPrizeUserId { get; set; }
     }
 }

+ 1 - 0
Models/StoreHouse.cs

@@ -43,5 +43,6 @@ namespace MySystem.Models
         public string FilePath { get; set; }
         public decimal Deposit { get; set; }
         public int OpId { get; set; }
+        public int ApplyNum { get; set; }
     }
 }

+ 8 - 0
Models/WebCMSEntities.cs

@@ -10374,6 +10374,10 @@ namespace MySystem.Models
 
                 entity.Property(e => e.OpId).HasColumnType("int(11)");
 
+                entity.Property(e => e.OpenPrizeUserId)
+                    .HasColumnType("int(11)")
+                    .HasComment("开机奖励标记");
+
                 entity.Property(e => e.OrderId).HasColumnType("int(11)");
 
                 entity.Property(e => e.QueryCount).HasColumnType("int(11)");
@@ -15583,6 +15587,10 @@ namespace MySystem.Models
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.ApplyNum)
+                    .HasColumnType("int(11)")
+                    .HasComment("出库数");
+
                 entity.Property(e => e.Areas)
                     .HasColumnType("varchar(30)")
                     .HasCharSet("utf8")