浏览代码

后台仓库调拨逻辑更新,入库减,出库加

lichunlei 2 年之前
父节点
当前提交
5512c64da1
共有 1 个文件被更改,包括 6 次插入4 次删除
  1. 6 4
      AppStart/Timer/StoreApplyHelper.cs

+ 6 - 4
AppStart/Timer/StoreApplyHelper.cs

@@ -234,22 +234,24 @@ public class StoreApplyHelper
                     {
                         int StoreId = int.Parse(jsonObj["Data"]["StoreId"].ToString());
                         int BrandId = int.Parse(jsonObj["Data"]["BrandId"].ToString());
-                        int OpStoreNum = int.Parse(jsonObj["Data"]["OpStoreNum"].ToString());
+                        string OpStorrString = jsonObj["Data"]["OpStoreNum"].ToString();
+                        int OpType = OpStorrString.StartsWith("-") ? 0 : 1;
+                        int OpStoreNum = int.Parse(OpStorrString.Replace("-", ""));
                         StoreHouse store = db.StoreHouse.FirstOrDefault(m => m.Id == StoreId);
                         if(store != null)
                         {
                             decimal Amount = 0;
                             if(BrandId == 1 || BrandId == 2 || BrandId == 4 || BrandId == 6 || BrandId == 7 || BrandId == 8)
                             {
-                                Amount += 200;
+                                Amount += 200 * OpStoreNum;
                             }
                             else if(BrandId == 3 || BrandId == 5 || BrandId == 9)
                             {
-                                Amount += 300;
+                                Amount += 300 * OpStoreNum;
                             }
                             if(Amount > 0)
                             {
-                                AddAmount(db, store.UserId, Amount, 1);
+                                AddAmount(db, store.UserId, Amount, OpType);
                             }
                         }
                     }