Explorar el Código

增加wifi退款逻辑

lcl hace 1 mes
padre
commit
41da2b4606

+ 1 - 0
AppStart/Helper/SycnSpServer/SycnSpTradeWifiService.cs

@@ -50,6 +50,7 @@ namespace MySystem
                                 TradeAmount = TradeAmount, //交易金额
                                 BrandId = BrandId, //品牌
                                 Remark = trade.MerNo, //备注
+                                OrderNo = trade.TradeSerialNo,
                             }).Entity;
                             db.SpOrderNos.Add(new PxcModels.SpOrderNos()
                             {

+ 60 - 0
AppStart/WifiRefundHelper.cs

@@ -0,0 +1,60 @@
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Linq;
+using System.Data;
+using MySystem;
+using MySystem.PxcModels;
+using Library;
+using LitJson;
+
+public class WifiRefundHelper
+{
+    public readonly static WifiRefundHelper Instance = new WifiRefundHelper();
+    private WifiRefundHelper()
+    {
+    }
+
+    public void Start()
+    {
+        Thread th = new Thread(DoWorks);
+        th.IsBackground = true;
+        th.Start();
+    }
+
+    private void DoWorks()
+    {
+        while (true)
+        {
+            try
+            {
+                string content = RedisDbconn.Instance.RPop<string>("WifiRefundQueue");
+                if(!string.IsNullOrEmpty(content))
+                {
+                    DoSomething(content);
+                }
+                else
+                {
+                    Thread.Sleep(60000);
+                }
+            }
+            catch (Exception ex)
+            {
+                function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "WIFI退款异常");
+            }
+        }
+    }
+
+    public void DoSomething(string OrderNo)
+    {
+        WebCMSEntities db = new WebCMSEntities();
+        WifiTradeRecord edit = db.WifiTradeRecord.FirstOrDefault(m => m.OrderNo == OrderNo);
+        if(edit != null)
+        {
+            edit.DoMonths = edit.Duration + 1;
+            edit.Status = -1;
+            db.SaveChanges();
+        }
+        db.Dispose();
+    }
+}

+ 0 - 1
PxcModels/LeaderCompTmp.cs

@@ -9,6 +9,5 @@ namespace MySystem.PxcModels
         public string EveryMonthData { get; set; }
         public string ParentNav { get; set; }
         public int ParentUserId { get; set; }
-        public int LeaderType { get; set; }
     }
 }

+ 1 - 1
PxcModels/PosFeeWarningRecord.cs

@@ -7,7 +7,6 @@ namespace MySystem.PxcModels
     {
         public int Id { get; set; }
         public int Sort { get; set; }
-        public int QueryCount { get; set; }
         public int Status { get; set; }
         public int Version { get; set; }
         public DateTime? CreateDate { get; set; }
@@ -23,6 +22,7 @@ namespace MySystem.PxcModels
         public string PosSn { get; set; }
         public int BrandId { get; set; }
         public int PosId { get; set; }
+        public int QueryCount { get; set; }
         public DateTime? DoDate { get; set; }
     }
 }

+ 2 - 2
PxcModels/UserRankWhiteSetRecord.cs

@@ -11,8 +11,6 @@ namespace MySystem.PxcModels
         public int Version { get; set; }
         public DateTime? CreateDate { get; set; }
         public DateTime? UpdateDate { get; set; }
-        public string Remark { get; set; }
-        public int UserType { get; set; }
         public int BeforeLevel { get; set; }
         public DateTime? ExpireDate { get; set; }
         public DateTime? PresetDate { get; set; }
@@ -20,5 +18,7 @@ namespace MySystem.PxcModels
         public int Level { get; set; }
         public int SetType { get; set; }
         public int UserId { get; set; }
+        public int UserType { get; set; }
+        public string Remark { get; set; }
     }
 }

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 91 - 532
PxcModels/WebCMSEntities.cs


+ 1 - 0
PxcModels/WifiTradeRecord.cs

@@ -18,5 +18,6 @@ namespace MySystem.PxcModels
         public int DoMonths { get; set; }
         public string LastMonth { get; set; }
         public string MerNo { get; set; }
+        public string OrderNo { get; set; }
     }
 }

+ 1 - 0
Startup.cs

@@ -185,6 +185,7 @@ namespace MySystem
                 SycnSpMerchantRecordService.Instance.Start(); //同步SP商户记录数据
                 WifiTradeHelper.Instance.Start(); //每月1号统计上月wifi交易
                 WifiUnBindHelper.Instance.Start(); //wifi解绑
+                WifiRefundHelper.Instance.Start(); //wifi退款
                 WifiChangeBindHelper.Instance.Start(); //wifi换绑
                 SycnJavaUsersService.Instance.Start(); //同步创客基本信息
 

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio