Pārlūkot izejas kodu

重推金控交易数据

lcl 8 mēneši atpakaļ
vecāks
revīzija
37cb7365f0
2 mainītis faili ar 56 papildinājumiem un 0 dzēšanām
  1. 53 0
      AppStart/Helper/TmpHelper.cs
  2. 3 0
      Startup.cs

+ 53 - 0
AppStart/Helper/TmpHelper.cs

@@ -0,0 +1,53 @@
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Linq;
+using System.Data;
+using MySystem;
+using MySystem.SpModels;
+
+public class TmpHelper
+{
+    public readonly static TmpHelper Instance = new TmpHelper();
+    private TmpHelper()
+    {
+    }
+
+    public void Start()
+    {
+        Thread th = new Thread(DoWorks);
+        th.IsBackground = true;
+        th.Start();
+    }
+
+    private void DoWorks()
+    {
+        try
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            DoSomething(db);
+            db.Dispose();
+        }
+        catch (Exception ex)
+        {
+            Utils.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "tmp重推金控交易数据异常");
+        }
+    }
+
+    public void DoSomething(WebCMSEntities db)
+    {
+        List<string> orderNos = new List<string>();
+        DateTime start = DateTime.Parse("2025-10-17 10:21:15");
+        DateTime end = DateTime.Parse("2025-10-27 11:25:10");
+        List<TradeRecord> trades = db.TradeRecord.Where(m => m.Id >= 142418748 && m.Id <= 142676302 && m.ProductType == "27" && m.CreateDate >= start && m.CreateDate <= end && m.ErrorCode == "0.007").OrderBy(m => m.Id).ToList();
+        foreach (TradeRecord trade in trades.ToList())
+        {
+            if(!orderNos.Contains(trade.TradeSerialNo))
+            {
+                PosPushDataNewHelper.Trade(trade);
+                Utils.WriteLog(trade.TradeSnNo + "--" + trade.TradeSerialNo, "tmp重推金控交易数据");
+                orderNos.Add(trade.TradeSerialNo);
+            }
+        }
+    }
+}

+ 3 - 0
Startup.cs

@@ -195,6 +195,9 @@ namespace MySystem
                 SpDataHelper.Instance.Start("MainDataQueue");
                 SpDataHelper.Instance.StartData();
 
+
+                TmpHelper.Instance.Start();
+
                 // PosFeeHelper.Instance.Start(); //初始化机具名单
 
                 // WifiCheckHelper.Instance.DoSomething();