Browse Source

修复每月重置分仓额度

lichunlei 2 năm trước cách đây
mục cha
commit
07ac49fa1d
2 tập tin đã thay đổi với 48 bổ sung47 xóa
  1. 5 5
      AppStart/Timer/StoreApplyHelper.cs
  2. 43 42
      Startup.cs

+ 5 - 5
AppStart/Timer/StoreApplyHelper.cs

@@ -176,23 +176,23 @@ public class StoreApplyHelper
             }
             decimal AmountMore = 0;
             //仓库中机具占用额度+小分仓机具占用额度
-            DataTable dtmore = CustomerSqlConn.dtable("select count(Id)*200 from PosMachinesTwo pos where StoreId in (select Id from StoreHouse where UserId=" + UserId + ") and BuyUserId=0 and BrandId in (1,2,4,6,7,8) and `Status`>-1", connstr);
+            DataTable dtmore = CustomerSqlConn.dtable("select count(Id)*200 from PosMachinesTwo pos where StoreId in (select Id from StoreHouse where UserId=" + UserId + " and Sort=0) and BuyUserId=0 and BrandId in (1,2,4,6,7,8) and `Status`>-1", connstr);
             if(dtmore.Rows.Count > 0)
             {
                 AmountMore += decimal.Parse(function.CheckNum(dtmore.Rows[0][0].ToString()));
             }
-            dtmore = CustomerSqlConn.dtable("select count(Id)*300 from PosMachinesTwo pos where StoreId in (select Id from StoreHouse where UserId=" + UserId + ") and BuyUserId=0 and BrandId in (3,5,9) and `Status`>-1", connstr);
+            dtmore = CustomerSqlConn.dtable("select count(Id)*300 from PosMachinesTwo pos where StoreId in (select Id from StoreHouse where UserId=" + UserId + " and Sort=0) and BuyUserId=0 and BrandId in (3,5,9) and `Status`>-1", connstr);
             if(dtmore.Rows.Count > 0)
             {
                 AmountMore += decimal.Parse(function.CheckNum(dtmore.Rows[0][0].ToString()));
             }
             //除开小分仓中带“授”标记机具占用额度
-            dtmore = CustomerSqlConn.dtable("select count(Id)*200 from PreSendStockDetail pos where FromStoreId in (select Id from StoreHouse where UserId=" + UserId + ") and BrandId in (1,2,4,6,7,8) and AuthFlag=1 and ApplyFlag=0 and `Status`>-1 and `Status`<2", connstr);
+            dtmore = CustomerSqlConn.dtable("select count(Id)*200 from PreSendStockDetail pos where FromStoreId in (select Id from StoreHouse where UserId=" + UserId + " and Sort=0) and BrandId in (1,2,4,6,7,8) and AuthFlag=1 and ApplyFlag=0 and `Status`>-1 and `Status`<2", connstr);
             if(dtmore.Rows.Count > 0)
             {
                 AmountMore -= decimal.Parse(function.CheckNum(dtmore.Rows[0][0].ToString()));
             }
-            dtmore = CustomerSqlConn.dtable("select count(Id)*300 from PreSendStockDetail pos where FromStoreId in (select Id from StoreHouse where UserId=" + UserId + ") and BrandId in (3,5,9) and AuthFlag=1 and ApplyFlag=0 and `Status`>-1 and `Status`<2", connstr);
+            dtmore = CustomerSqlConn.dtable("select count(Id)*300 from PreSendStockDetail pos where FromStoreId in (select Id from StoreHouse where UserId=" + UserId + " and Sort=0) and BrandId in (3,5,9) and AuthFlag=1 and ApplyFlag=0 and `Status`>-1 and `Status`<2", connstr);
             if(dtmore.Rows.Count > 0)
             {
                 AmountMore -= decimal.Parse(function.CheckNum(dtmore.Rows[0][0].ToString()));
@@ -204,7 +204,7 @@ public class StoreApplyHelper
                 AmountMore += decimal.Parse(function.CheckNum(dr["UseAmount"].ToString()));
             }
             account.FixedAmount = Amount;
-            account.ValidAmount = Amount + PromissAmount + account.TempAmount - AmountMore;
+            account.ValidAmount = Amount + PromissAmount + account.TempAmount + account.TempAmountForBalance - AmountMore;
             function.WriteLog("UserId:" + UserId + ";FixedAmount:" + account.FixedAmount + ";AmountMore:" + AmountMore + ";ValidAmount:" + account.ValidAmount, "计算分仓申请机具额度日志");
         }
         db.SaveChanges();

+ 43 - 42
Startup.cs

@@ -91,8 +91,8 @@ namespace MySystem
             // services.AddHostedService<SycnSpTimer>(); //同步SP数据
 
             // services.AddHostedService<TimerStatTimer>(); //实时统计创客、激活商户数
-            services.AddHostedService<PosTradeStatTimer>(); // 统计头天的交易额、商户型创客、激活奖励、开机奖励
-            services.AddHostedService<AlipayPayBack2Timer>(); //支付宝回调处理
+            // services.AddHostedService<PosTradeStatTimer>(); // 统计头天的交易额、商户型创客、激活奖励、开机奖励
+            // services.AddHostedService<AlipayPayBack2Timer>(); //支付宝回调处理
 
             //services.AddHttpContextAccessor();
 
@@ -135,14 +135,15 @@ namespace MySystem
             {
                 app.UseDeveloperExceptionPage();
                 // app.UseExceptionHandler("/Home/Error");
-                Library.ConfigurationManager.EnvironmentFlag = 1;
+                // Library.ConfigurationManager.EnvironmentFlag = 1;
             }
             else
             {
                 app.UseExceptionHandler("/Home/Error");
                 app.UseHsts();
-                Library.ConfigurationManager.EnvironmentFlag = 2;
+                // Library.ConfigurationManager.EnvironmentFlag = 2;
             }
+            Library.ConfigurationManager.EnvironmentFlag = 2;
             Library.function.WritePage("/", "WebRootPath.txt", env.WebRootPath);
             // app.UseStatusCodePagesWithReExecute("/public/errpage/pc/{0}.html");
 
@@ -188,47 +189,47 @@ namespace MySystem
             });
 
             //必须打开的
-            ActiveRewardTimer.Instance.Start(); //实时处理激活记录
-            ChangePosTimer.Instance.Start(); //售后换新执行机具数据转移
-            SycnSpBindService.Instance.Start(); //同步SP绑定数据
-            SycnSpMerchantService.Instance.Start(); //同步SP商户数据
-            SycnSpActiveService.Instance.Start(); //同步SP激活数据
-            SycnSpTradeService.Instance.Start(); //同步SP交易数据
-            SycnSpChangeBindService.Instance.Start(); //同步SP换绑数据
-            SycnSpUnBindService.Instance.Start(); //同步SP解绑数据
-            RedPackageV2Helper.Instance.Start(); //每天生成红包
-            RedPackageV2Helper.Instance.StartStatTop10(); //红包活动统计排行
-            RedPackageV2Helper.Instance.StartSendPrize(); //红包活动发奖
-            BalancePayBackService.Instance.Start(); //余额支付队列
-            ReservePayBackService.Instance.Start(); //储备金支付队列
-            LeaderPrizeService.Instance.Start(); //大盟主奖励发奖
-            OperatePrizeService.Instance.Start(); //运营中心奖励发奖
-            MessageCenterService.Instance.Start(); // 消息队列
-            RecommendActStatService.Instance.Start(); //推荐王奖励数据统计
+            // ActiveRewardTimer.Instance.Start(); //实时处理激活记录
+            // ChangePosTimer.Instance.Start(); //售后换新执行机具数据转移
+            // SycnSpBindService.Instance.Start(); //同步SP绑定数据
+            // SycnSpMerchantService.Instance.Start(); //同步SP商户数据
+            // SycnSpActiveService.Instance.Start(); //同步SP激活数据
+            // SycnSpTradeService.Instance.Start(); //同步SP交易数据
+            // SycnSpChangeBindService.Instance.Start(); //同步SP换绑数据
+            // SycnSpUnBindService.Instance.Start(); //同步SP解绑数据
+            // RedPackageV2Helper.Instance.Start(); //每天生成红包
+            // RedPackageV2Helper.Instance.StartStatTop10(); //红包活动统计排行
+            // RedPackageV2Helper.Instance.StartSendPrize(); //红包活动发奖
+            // BalancePayBackService.Instance.Start(); //余额支付队列
+            // ReservePayBackService.Instance.Start(); //储备金支付队列
+            // LeaderPrizeService.Instance.Start(); //大盟主奖励发奖
+            // OperatePrizeService.Instance.Start(); //运营中心奖励发奖
+            // MessageCenterService.Instance.Start(); // 消息队列
+            // RecommendActStatService.Instance.Start(); //推荐王奖励数据统计
             StoreApplyHelper.Instance.Start(); // 每月1号重置仓库额度
-            StoreApplyHelper.Instance.StartEverTime();
-            StatService.Instance.StatUserLevel(); //升级
-            ProfitHelperV2.Instance.StatProfit(); //创客分润
-            StatService.Instance.StartOpenReward(); //实时获取开机奖励
-            StatService.Instance.ListenFluxRecord(); //实时获取流量费分佣
+            // StoreApplyHelper.Instance.StartEverTime();
+            // StatService.Instance.StatUserLevel(); //升级
+            // ProfitHelperV2.Instance.StatProfit(); //创客分润
+            // StatService.Instance.StartOpenReward(); //实时获取开机奖励
+            // StatService.Instance.ListenFluxRecord(); //实时获取流量费分佣
             //必须打开的
 
-            HelpProfitPreMerchantHelper.Instance.Start(); //助利宝每天增加指定数量商机
-            SetDepositService.Instance.Start(); //调整费率(通知、标记)
-            SetDepositPostService.Instance.Start(); //提交支付公司设置费率接口
-            SetDepositPostService.Instance.StartKdb(); //监控开店宝费率设置结果
-            SetFeeFlagService.Instance.Start(); //118天提前通知创客费率调升消息
-            ResetSmallStoreHelper.Instance.Start(); //每月重置小分仓额度
-            OperateService.Instance.Start(); //运营中心每天统计一次发货量、库存
-            OperateAmountService.Instance.Start(); //运营中心额度变更
-            OperateStockService.Instance.Start(); //运营中心库存实时更新
-            StoreApplyHelper.Instance.ResetStoreReserve(); //重置分仓额度
-            LeaderApplyCouponsHelper.Instance.Start(); //盟主储蓄金申请机具券打标记
-            // UserMonthFeeHelper.Instance.Start(); //每月创客服务费
-            // UserMonthFeeHelper.Instance.Start2(); //临时扣创客服务费
-            DepositReturnService.Instance.Start(); //退押金到支付宝余额
-            // PosExpiredHelper.Instance.Start(); //过期机具提醒
-            PosExpiredHelper.Instance.StartPay(); //过期机具扣费
+            // HelpProfitPreMerchantHelper.Instance.Start(); //助利宝每天增加指定数量商机
+            // SetDepositService.Instance.Start(); //调整费率(通知、标记)
+            // SetDepositPostService.Instance.Start(); //提交支付公司设置费率接口
+            // SetDepositPostService.Instance.StartKdb(); //监控开店宝费率设置结果
+            // SetFeeFlagService.Instance.Start(); //118天提前通知创客费率调升消息
+            // ResetSmallStoreHelper.Instance.Start(); //每月重置小分仓额度
+            // OperateService.Instance.Start(); //运营中心每天统计一次发货量、库存
+            // OperateAmountService.Instance.Start(); //运营中心额度变更
+            // OperateStockService.Instance.Start(); //运营中心库存实时更新
+            // StoreApplyHelper.Instance.ResetStoreReserve(); //重置分仓额度
+            // LeaderApplyCouponsHelper.Instance.Start(); //盟主储蓄金申请机具券打标记
+            // // UserMonthFeeHelper.Instance.Start(); //每月创客服务费
+            // // UserMonthFeeHelper.Instance.Start2(); //临时扣创客服务费
+            // DepositReturnService.Instance.Start(); //退押金到支付宝余额
+            // // PosExpiredHelper.Instance.Start(); //过期机具提醒
+            // PosExpiredHelper.Instance.StartPay(); //过期机具扣费
 
             // StatService.Instance.StartPosActNum(); //实时统计激活数
             // StatService.Instance.StartNewUserNum(); //实时统计新增创客数