Bläddra i källkod

修复重置小分仓额度

lichunlei 2 år sedan
förälder
incheckning
3d82b3d1f0

+ 4 - 4
AppStart/Helper/Profit/ProfitCheckHelper.cs

@@ -34,7 +34,7 @@ namespace MySystem
             }
         }
 
-        private void ExportProfitData()
+        public void ExportProfitData()
         {
             string Month = DateTime.Now.AddMonths(-1).ToString("yyyyMM");
             WebCMSEntities db = new WebCMSEntities();
@@ -103,7 +103,7 @@ namespace MySystem
             db.Dispose();
         }
 
-        private void ExportSubsidyData()
+        public void ExportSubsidyData()
         {
             string Month = DateTime.Now.AddMonths(-1).ToString("yyyyMM");
             WebCMSEntities db = new WebCMSEntities();
@@ -152,7 +152,7 @@ namespace MySystem
             db.Dispose();
         }
 
-        private void CheckProfit()
+        public void CheckProfit()
         {
             DateTime now = DateTime.Now;
             string Month = DateTime.Now.AddMonths(-1).ToString("yyyyMM");
@@ -382,7 +382,7 @@ namespace MySystem
             db.Dispose();
         }
 
-        private void CheckSubsidy()
+        public void CheckSubsidy()
         {
             DateTime now = DateTime.Now;
             string Month = DateTime.Now.AddMonths(-1).ToString("yyyyMM");

+ 2 - 2
AppStart/Helper/Profit/ProfitHelperV2.cs

@@ -38,7 +38,7 @@ namespace MySystem
             while (true)
             {
                 string content = RedisDbconn.Instance.RPop<string>("DoProfitQueue");
-                if(!string.IsNullOrEmpty(content) && DateTime.Now.Day < 6)
+                if(!string.IsNullOrEmpty(content) && DateTime.Now.Day < 11)
                 {
                     StatProfiting();
                 }
@@ -311,7 +311,7 @@ namespace MySystem
             }
             db.Dispose();
 
-            ProfitHelper.Instance.StatProfit();
+            // ProfitHelper.Instance.StatProfit();
         }
         public List<ProfitResult> StartProftForPosByDate(int BrandId, int BankCardType, string Month, int PageNum = 1)
         {

+ 3 - 1
AppStart/Timer/ResetSmallStoreHelper.cs

@@ -41,6 +41,7 @@ public class ResetSmallStoreHelper
                     if(string.IsNullOrEmpty(check))
                     {
                         function.WritePage("/ResetSmallStore/", Month + ".txt", DateTime.Now.ToString());
+                        OtherMySqlConn.op("update UserAccount set ThisMonthPreAmount=0,ValidPreAmount=0 where ThisMonthPreAmount>0");
                         string minId = "0";
                         DataTable minIdDt = OtherMySqlConn.dtable("select min(Id) from ProfitRewardRecord where TradeMonth='" + PreMonth + "'");
                         if(minIdDt.Rows.Count > 0)
@@ -55,6 +56,7 @@ public class ResetSmallStoreHelper
                             index += 1;
                             int UserId = int.Parse(function.CheckInt(dr["UserId"].ToString()));
                             decimal ProfitAmount = decimal.Parse(function.CheckNum(dr[1].ToString()));
+                            decimal PreProfitAmount = ProfitAmount;
                             var prelist = db.PreSendStockDetail.Select(m => new { m.Id, m.BrandId, m.ToUserId, m.Status, m.ApplyFlag }).Where(m => m.ToUserId == UserId && m.Status == 1 && m.ApplyFlag == 0).ToList();
                             foreach(var prepos in prelist)
                             {
@@ -93,7 +95,7 @@ public class ResetSmallStoreHelper
                                 }).Entity;
                                 db.SaveChanges();
                             }
-                            account.ThisMonthPreAmount = ProfitAmount;
+                            account.ThisMonthPreAmount = PreProfitAmount;
                             account.ValidPreAmount = ProfitAmount;
                             if(index % 200 == 0)
                             {