Просмотр исходного кода

Merge branch 'feature-dgy-后台优化' into feature-dgy-后台测试

DuGuYang 3 лет назад
Родитель
Сommit
91732a31f2
1 измененных файлов с 12 добавлено и 8 удалено
  1. 12 8
      Areas/Admin/Controllers/MainServer/StoreMachineApplyController.cs

+ 12 - 8
Areas/Admin/Controllers/MainServer/StoreMachineApplyController.cs

@@ -460,6 +460,7 @@ namespace MySystem.Areas.Admin.Controllers
             Dictionary<string, object> Obj = new Dictionary<string, object>();
             List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
             List<SendInfo> sendInfos = new List<SendInfo>();
+            List<CheckSendInfo> checksendInfos = new List<CheckSendInfo>();
             StoreMachineApply apply = db.StoreMachineApply.FirstOrDefault(m => m.Id == data.Id) ?? new StoreMachineApply();
             JsonData ApplyList = JsonMapper.ToObject(apply.SendSn);
             decimal ApplyAmount = 0;
@@ -522,18 +523,15 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandId == 7) FromStoreId = 1047;
                 if (BrandId == 8) FromStoreId = 4831;
                 if (BrandId == 9) FromStoreId = 4832;
-                tostore = db.StoreHouse.FirstOrDefault(m => m.UserId == apply.UserId && m.BrandId == BrandId.ToString() && m.Status > -1);
-                SendInfo items = sendInfos.FirstOrDefault(m => m.FromStoreId == FromStoreId && m.ToStoreId == tostore.Id && m.BrandId == BrandId);
+                CheckSendInfo items = checksendInfos.FirstOrDefault(m => m.BrandId == BrandId);
                 if (items == null)
                 {
-                    SendInfo rows = new SendInfo()
+                    CheckSendInfo rows = new CheckSendInfo()
                     {
-                        FromStoreId = FromStoreId,
-                        ToStoreId = tostore.Id,
                         BrandId = BrandId,
                         Num = 1
                     };
-                    sendInfos.Add(rows);
+                    checksendInfos.Add(rows);
                 }
                 else
                 {
@@ -554,8 +552,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandIds == 8) FromStoreId = 4831;
                 if (BrandIds == 9) FromStoreId = 4832;
                 var brandInfo = db.KqProducts.FirstOrDefault(m => m.Id == BrandIds);
-                tostore = db.StoreHouse.FirstOrDefault(m => m.UserId == apply.UserId && m.BrandId == BrandIds.ToString() && m.Status > -1);
-                SendInfo items = sendInfos.FirstOrDefault(m => m.FromStoreId == FromStoreId && m.ToStoreId == tostore.Id && m.BrandId == BrandIds) ?? new SendInfo();
+                CheckSendInfo items = checksendInfos.FirstOrDefault(m => m.BrandId == BrandIds) ?? new CheckSendInfo();
                 if (items.Num > num)
                 {
                     return "Warning|" + "该条发货记录的" + brandInfo.Name + "发货数量过多!";
@@ -816,5 +813,12 @@ namespace MySystem.Areas.Admin.Controllers
             public int Num { get; set; }
         }
 
+         //检查发货信息实体类
+        private class CheckSendInfo
+        {
+            public int BrandId { get; set; }
+            public int Num { get; set; }
+        }
+
     }
 }