Sfoglia il codice sorgente

发放分润调整

lcl 1 anno fa
parent
commit
27fc35bc0a
2 ha cambiato i file con 22 aggiunte e 0 eliminazioni
  1. 20 0
      AppStart/Helper/SycnProfitServiceV3.cs
  2. 2 0
      Startup.cs

+ 20 - 0
AppStart/Helper/SycnProfitServiceV3.cs

@@ -70,6 +70,26 @@ namespace MySystem
             
             CustomerSqlConn.op("update ProfitRewardRecord set CheckStatus=1 where Id>=" + StartId + " and CheckStatus=0 and BrandId=" + BrandId + " and UserId>0 and TradeMonth='" + date + "'", MysqlConn.connstr);
 
+            DataTable dt = OtherMySqlConn.dtable("select UserId,sum(ProfitAmount) from ProfitRecord where BrandId=" + BrandId + " and UserId>0 and SeoTitle='" + date + "' group by UserId");
+            function.WriteLog("分润:" + BrandId + ":" + dt.Rows.Count, "同步分润数据");
+            int index = 0;
+            foreach (DataRow dr in dt.Rows)
+            {
+                index += 1;
+                int UserId = int.Parse(dr["UserId"].ToString());
+                decimal ProfitMoney = decimal.Parse(dr[1].ToString());
+                try
+                {
+                    string content = UserId + "|0|" + ProfitMoney + "|" + index;
+                    RedisDbconn.Instance.AddList("DoTradeProfitQueue", content);
+                }
+                catch (Exception ex)
+                {
+                    function.WriteLog(DateTime.Now.ToString() + "\n" + UserId + "," + ProfitMoney + "\n" + ex.ToString(), "同步到余额异常");
+                }
+                function.WriteLog(index.ToString(), "同步分润数据");
+            }
+
             db.Dispose();
         }
         private void DoTradeProfit2(int BrandId, string date, string SysUserName)

+ 2 - 0
Startup.cs

@@ -136,6 +136,8 @@ namespace MySystem
 
             
             SycnProfitServiceV3.Instance.Start();
+            SycnProfitServiceV2.Instance.StartProfit();
+            
         }