瀏覽代碼

过期机具扣费队列更新

lcl 2 年之前
父節點
當前提交
c232883750

二進制
.DS_Store


二進制
AppStart/.DS_Store


二進制
AppStart/Helper/.DS_Store


+ 75 - 0
AppStart/Helper/TimeOutPosChargeReturnService.cs

@@ -0,0 +1,75 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Threading;
+using MySystem.Models;
+using Library;
+
+namespace MySystem
+{
+    /// <summary>
+    /// 过期购买机具循环截止时间超过15天激活扣费退还
+    /// </summary>
+    public class TimeOutPosChargeReturnService
+    {
+        public readonly static TimeOutPosChargeReturnService Instance = new TimeOutPosChargeReturnService();
+        private TimeOutPosChargeReturnService()
+        { }
+
+        public void Start()
+        {
+            Thread th = new Thread(doSomething);
+            th.IsBackground = true;
+            th.Start();
+        }
+
+        public void doSomething()
+        {
+            while (true)
+            {
+                if (DateTime.Now.Hour < 3)
+                {
+                    try
+                    {
+                        string check = function.ReadInstance("/TimeOutPosChargeReturn/check" + DateTime.Now.ToString("yyyy-MM-dd") + ".txt");
+                        if (string.IsNullOrEmpty(check))
+                        {
+                            function.WritePage("/TimeOutPosChargeReturn/", "check" + DateTime.Now.ToString("yyyy-MM-dd") + ".txt", DateTime.Now.ToString("HH:mm:ss"));
+                            WebCMSEntities db = new WebCMSEntities();
+                            DataTable dt = CustomerSqlConn.dtable("SELECT a.Id Id FROM ToChargeBackRecord a LEFT JOIN PosMachinesTwo b ON a.Remark=b.PosSn WHERE a.`Status`=1 AND b.PosSnType=0  AND b.BindingState=1 AND b.ActivationState=1", MysqlConn.SqlConnStr);//循环过期超过15天激活机具退费创客
+                            foreach (DataRow item in dt.Rows)
+                            {
+                                int Id = int.Parse(item["Id"].ToString());
+                                var toChargeBackRecord = db.ToChargeBackRecord.FirstOrDefault(m => m.Id == Id && m.Status == 1) ?? new ToChargeBackRecord();
+                                if (toChargeBackRecord.Id > 0)
+                                {
+                                    var userAccount = db.UserAccount.FirstOrDefault(m => m.Id == toChargeBackRecord.UserId) ?? new UserAccount();
+                                    var userAccountRecord = db.UserAccountRecord.Add(new UserAccountRecord
+                                    {
+                                        CreateDate = DateTime.Now,
+                                        UserId = toChargeBackRecord.UserId,
+                                        BeforeBalanceAmount = userAccount.BalanceAmount,
+                                        AfterBalanceAmount = userAccount.BalanceAmount + toChargeBackRecord.ChargeAmount,
+                                        ChangeAmount = toChargeBackRecord.ChargeAmount,
+                                        ChangeType = 126,//过期购买机具超过15天激活扣费退还
+                                        Remark = "机具货款退还",
+
+                                    }).Entity;
+                                    toChargeBackRecord.Status = 2;//过期购买机具循环截止时间超过15天激活扣费退还标识
+                                    userAccount.BalanceAmount += toChargeBackRecord.ChargeAmount;
+                                    db.SaveChanges();
+                                }
+                            }
+                        }
+                    }
+                    catch (Exception ex)
+                    {
+                        function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "过期购买机具超过15天激活扣费退还");
+                    }
+                }
+                Thread.Sleep(1000);
+            }
+        }
+    }
+}

+ 177 - 0
AppStart/Helper/TimeOutPosChargeService.cs

@@ -0,0 +1,177 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Threading;
+using MySystem.Models;
+using Library;
+
+namespace MySystem
+{
+    /// <summary>
+    /// 过期机具执行扣费
+    /// </summary>
+    public class TimeOutPosChargeService
+    {
+        public readonly static TimeOutPosChargeService Instance = new TimeOutPosChargeService();
+        private TimeOutPosChargeService()
+        { }
+
+        public void Start()
+        {
+            Thread th = new Thread(doSomething);
+            th.IsBackground = true;
+            th.Start();
+        }
+
+        public void doSomething()
+        {
+            while (true)
+            {
+                if (DateTime.Now.Hour < 3)
+                {
+                    try
+                    {
+                        string check = function.ReadInstance("/TimeOutPosCharge/check" + DateTime.Now.ToString("yyyy-MM-dd") + ".txt");
+                        if (string.IsNullOrEmpty(check))
+                        {
+                            function.WritePage("/TimeOutPosCharge/", "check" + DateTime.Now.ToString("yyyy-MM-dd") + ".txt", DateTime.Now.ToString("HH:mm:ss"));
+                            WebCMSEntities db = new WebCMSEntities();
+                            var date = DateTime.Now.AddDays(-60).ToString("yyyy-MM-dd 00:00:00");//过期限制时间
+                            var time = DateTime.Parse(date);//过期限制时间
+
+                            DataTable dt = CustomerSqlConn.dtable("SELECT BuyUserId FROM PosMachinesTwo WHERE `Status`>-1 AND BuyUserId>0 AND BindingState=0 AND ActivationState=0 AND ScanQrTrade=0 AND RecycEndDate <'" + date + "' GROUP BY BuyUserId", MysqlConn.SqlConnStr);//扣费创客
+                            var query = db.PosMachinesTwo.Where(m => m.Status > -1 && m.BuyUserId > 0 && m.BindingState == 0 && m.ActivationState == 0 && m.ScanQrTrade == 0 && m.RecycEndDate < time).ToList();//循环过期超过15天机具
+                            var brandInfo = db.KqProducts.ToList();
+                            foreach (DataRow item in dt.Rows)
+                            {
+                                int BuyUserId = int.Parse(item["BuyUserId"].ToString());
+                                var userAccount = db.UserAccount.FirstOrDefault(m => m.Id == BuyUserId);
+                                if (userAccount == null)
+                                {
+                                    userAccount = db.UserAccount.Add(new UserAccount()
+                                    {
+                                        Id = BuyUserId,
+                                        UserId = BuyUserId,
+                                    }).Entity;
+                                    db.SaveChanges();
+                                }
+                                var posInfo = query.Where(m => m.BuyUserId == BuyUserId);
+                                var amount = 0;
+                                foreach (var pos in posInfo)
+                                {
+                                    var poss = db.PosMachinesTwo.FirstOrDefault(m => m.Id == pos.Id) ?? new PosMachinesTwo();
+                                    poss.ScanQrTrade = 999;
+                                    var Brand = brandInfo.FirstOrDefault(m => m.Id == pos.BrandId);
+                                    if (Brand.Name.Contains("电签"))
+                                    {
+                                        amount = 200;
+                                    }
+                                    if (Brand.Name.Contains("大POS"))
+                                    {
+                                        amount = 300;
+                                    }
+                                    userAccount.ToChargeAmount += amount;//增加预扣款
+                                    var toChargeBackRecord = db.ToChargeBackRecord.Add(new ToChargeBackRecord
+                                    {
+                                        CreateDate = DateTime.Now,
+                                        UserId = BuyUserId,
+                                        ChargeAmount = amount,
+                                        ChargeType = 124,//过期机具货款扣费
+                                        Remark = pos.PosSn,
+
+                                    }).Entity;
+                                }
+                            }
+                            db.SaveChanges();
+
+                            DoChargeAmount(db);
+                        }
+                    }
+                    catch (Exception ex)
+                    {
+                        function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "过期机具执行扣费异常");
+                    }
+                }
+                Thread.Sleep(1000);
+            }
+        }
+
+
+
+        public void StartDoChargeAmount()
+        {
+            Thread th = new Thread(doSomething);
+            th.IsBackground = true;
+            th.Start();
+        }
+
+        public void StartDoChargeAmountReady()
+        {
+            while(true)
+            {
+                WebCMSEntities db = new WebCMSEntities();
+                DoChargeAmount(db);
+                db.Dispose();
+                Thread.Sleep(600000);
+            }
+        }
+
+        public void ListenChargeAmount()
+        {
+            Thread th = new Thread(doSomething);
+            th.IsBackground = true;
+            th.Start();
+        }
+
+        public void ListenChargeAmountReady()
+        {
+            while(true)
+            {
+                string content = RedisDbconn.Instance.RPop<string>("DoChargeAmountQueue");
+                if(!string.IsNullOrEmpty(content))
+                {
+                    WebCMSEntities db = new WebCMSEntities();
+                    DoChargeAmount(db, int.Parse(function.CheckInt(content)));
+                    db.Dispose();
+                }
+            }
+        }
+
+        public void DoChargeAmount(WebCMSEntities db, int UserId = 0)
+        {
+            IQueryable<ToChargeBackRecord> list = db.ToChargeBackRecord.Where(m => m.Status == 0);//过期机具扣费记录
+            if(UserId > 0)
+            {
+                list = list.Where(m => m.UserId == UserId);
+            }
+            var info = list.ToList();
+            foreach (var items in info)
+            {
+                var userAccount = db.UserAccount.FirstOrDefault(m => m.Id == items.UserId) ?? new UserAccount();
+                var record = info.FirstOrDefault(m => m.Id == items.Id);
+                if (userAccount.BalanceAmount >= record.ChargeAmount)
+                {
+                    var userAccountRecord = db.UserAccountRecord.Add(new UserAccountRecord
+                    {
+                        CreateDate = DateTime.Now,
+                        UserId = items.UserId,
+                        BeforeBalanceAmount = userAccount.BalanceAmount,
+                        AfterBalanceAmount = userAccount.BalanceAmount - record.ChargeAmount,
+                        ChangeAmount = record.ChargeAmount,
+                        ChangeType = 124,//过期机具货款扣费
+                        Remark = "扣机具货款",
+
+                    }).Entity;
+                    record.Status = 1;
+                    if (userAccount.ToChargeAmount >= record.ChargeAmount)
+                    {
+                        userAccount.ToChargeAmount -= record.ChargeAmount;//扣减预扣款
+                    }
+                    userAccount.BalanceAmount -= record.ChargeAmount;//扣减余额
+                }
+            }
+            db.SaveChanges();
+        }
+    }
+}

+ 83 - 0
AppStart/Helper/TimeOutPosSendMessageService.cs

@@ -0,0 +1,83 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Threading;
+using MySystem.Models;
+using Library;
+
+namespace MySystem
+{
+    /// <summary>
+    /// 过期机具预扣费消息推送
+    /// </summary>
+    public class TimeOutPosSendMessageService
+    {
+        public readonly static TimeOutPosSendMessageService Instance = new TimeOutPosSendMessageService();
+        private TimeOutPosSendMessageService()
+        { }
+
+        public void Start()
+        {
+            Thread th = new Thread(doSomething);
+            th.IsBackground = true;
+            th.Start();
+        }
+
+        public void doSomething()
+        {
+            while (true)
+            {
+                if (DateTime.Now.Hour < 3)
+                {
+                    try
+                    {
+                        string check = function.ReadInstance("/TimeOutPosSendMessage/check" + DateTime.Now.ToString("yyyy-MM-dd") + ".txt");
+                        if (string.IsNullOrEmpty(check))
+                        {
+                            function.WritePage("/TimeOutPosSendMessage/", "check" + DateTime.Now.ToString("yyyy-MM-dd") + ".txt", DateTime.Now.ToString("HH:mm:ss"));
+                            WebCMSEntities db = new WebCMSEntities();
+                            var date = DateTime.Now.AddDays(-55).ToString("yyyy-MM-dd 00:00:00");//过期限制时间
+                            var time = DateTime.Parse(date);//过期限制时间
+
+                            DataTable dt = CustomerSqlConn.dtable("SELECT BuyUserId FROM PosMachinesTwo WHERE `Status`>-1 AND BuyUserId>0 AND BindingState=0 AND ActivationState=0 AND ScanQrTrade=0 AND RecycEndDate <'" + date + "' GROUP BY BuyUserId", MysqlConn.SqlConnStr);//消息推送创客
+                            var query = db.PosMachinesTwo.Where(m => m.Status > -1 && m.BuyUserId > 0 && m.BindingState == 0 && m.ActivationState == 0 && m.ScanQrTrade == 0 && m.RecycEndDate < time).ToList();//循环过期超过10天机具
+                            var brandInfo = db.KqProducts.ToList();
+                            foreach (DataRow item in dt.Rows)
+                            {
+                                int BuyUserId = int.Parse(item["BuyUserId"].ToString());
+                                var BrandName = "";
+                                var PosSn = "";
+                                var SendInfo = "";
+                                foreach (var items in brandInfo)
+                                {
+                                    int BrandId = int.Parse(items.Id.ToString());
+                                    BrandName = items.Name.ToString();
+                                    var posInfo = query.Where(m => m.BuyUserId == BuyUserId && m.BrandId == BrandId);
+                                    foreach (var pos in posInfo)
+                                    {
+                                        PosSn += BrandName +":"+pos.PosSn + "," + "<br/>";
+                                    }
+                                }
+                                SendInfo = PosSn.TrimEnd(',') + "<br/>";
+                                RedisDbconn.Instance.AddList("MsgPersonalQueue", Newtonsoft.Json.JsonConvert.SerializeObject(new MsgPersonal()
+                                {
+                                    UserId = BuyUserId, //创客
+                                    Title = "机具循环过期提醒", //标题
+                                    Content = "<div class='f16'>尊敬的创客您好:<br/>您的" + SendInfo + "循环已过期五十五天以上,请在五日内完成激活或通过机具回收回寄该机具。</ div > ",//内容
+                                    Summary = "系统检测到您的部分机具可回收,请打开我的-回收机具及时处理!",
+                                    CreateDate = DateTime.Now,
+                                }));
+                            }
+                        }
+                    }
+                    catch (Exception ex)
+                    {
+                        function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "过期机具预扣费消息推送异常");
+                    }
+                }
+                Thread.Sleep(1000);
+            }
+        }
+    }
+}

+ 3 - 3
Models/MsgAlert.cs

@@ -9,11 +9,8 @@ namespace MySystem.Models
         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; }
         public DateTime? UpdateDate { get; set; }
-        public string CreateMan { get; set; }
-        public string UpdateMan { get; set; }
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }
@@ -36,5 +33,8 @@ namespace MySystem.Models
         public string Summary { get; set; }
         public string Title { get; set; }
         public int MsgType { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public int Version { get; set; }
     }
 }

+ 4 - 1
Models/PosMachinesTwo.cs

@@ -52,9 +52,12 @@ namespace MySystem.Models
         public DateTime? UpFeeDate { get; set; }
         public ulong DownFeeFlag { get; set; }
         public ulong UpFeeFlag { get; set; }
-        public int OpId { get; set; }
         public decimal OpReserve3 { get; set; }
         public decimal OpReserve2 { get; set; }
         public decimal OpReserve1 { get; set; }
+        public int OpId { get; set; }
+        public DateTime? RecycStartDate { get; set; }
+        public string SourcePosSn { get; set; }
+        public int RecycStatus { get; set; }
     }
 }

+ 26 - 0
Models/PreAmountRecord.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class PreAmountRecord
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int PayMode { get; set; }
+        public int OperateType { get; set; }
+        public int AmountType { get; set; }
+        public decimal AfterAmount { get; set; }
+        public decimal BeforeAmount { get; set; }
+        public decimal UseAmount { get; set; }
+        public int ApplyId { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 27 - 0
Models/RecycMachineOrder.cs

@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class RecycMachineOrder
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int BrandId { get; set; }
+        public string RecycOrderNo { get; set; }
+        public DateTime? CancelDate { get; set; }
+        public DateTime? ResultDate { get; set; }
+        public string ErpCode { get; set; }
+        public string ErpName { get; set; }
+        public int PostType { get; set; }
+        public int RecycStoreId { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 23 - 0
Models/RecycMachineOrderPos.cs

@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class RecycMachineOrderPos
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int BrandId { get; set; }
+        public DateTime? CancelDate { get; set; }
+        public DateTime? ResultDate { get; set; }
+        public string SnNo { get; set; }
+        public int OrderId { get; set; }
+    }
+}

+ 0 - 3
Models/SchoolMaterials.cs

@@ -9,11 +9,8 @@ namespace MySystem.Models
         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; }
         public DateTime? UpdateDate { get; set; }
-        public string CreateMan { get; set; }
-        public string UpdateMan { get; set; }
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }

+ 0 - 3
Models/SchoolSignInData.cs

@@ -9,11 +9,8 @@ namespace MySystem.Models
         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; }
         public DateTime? UpdateDate { get; set; }
-        public string CreateMan { get; set; }
-        public string UpdateMan { get; set; }
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }

+ 0 - 3
Models/SchoolSignInRecord.cs

@@ -9,11 +9,8 @@ namespace MySystem.Models
         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; }
         public DateTime? UpdateDate { get; set; }
-        public string CreateMan { get; set; }
-        public string UpdateMan { get; set; }
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }

+ 0 - 3
Models/SchoolSignInTask.cs

@@ -9,11 +9,8 @@ namespace MySystem.Models
         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; }
         public DateTime? UpdateDate { get; set; }
-        public string CreateMan { get; set; }
-        public string UpdateMan { get; set; }
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }

+ 0 - 3
Models/SchoolSignInTaskRecord.cs

@@ -9,11 +9,8 @@ namespace MySystem.Models
         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; }
         public DateTime? UpdateDate { get; set; }
-        public string CreateMan { get; set; }
-        public string UpdateMan { get; set; }
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }

+ 23 - 0
Models/ToChargeBackRecord.cs

@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class ToChargeBackRecord
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public string Field1 { get; set; }
+        public string Remark { get; set; }
+        public int ChargeType { get; set; }
+        public decimal ChargeAmount { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 6 - 3
Models/UserAccount.cs

@@ -38,10 +38,13 @@ namespace MySystem.Models
         public decimal ValidAmount { get; set; }
         public decimal LeaderBalanceAmount { get; set; }
         public decimal HelpProfitBalanceAmount { get; set; }
-        public decimal TempAmountForBalance { get; set; }
-        public decimal ThisMonthPreAmount { get; set; }
-        public decimal ValidPreAmount { get; set; }
         public decimal SmallStoreDeposit { get; set; }
+        public decimal ValidPreAmount { get; set; }
+        public decimal ThisMonthPreAmount { get; set; }
+        public decimal TempAmountForBalance { get; set; }
         public decimal StoreDeposit { get; set; }
+        public decimal PreTempAmountForBalance { get; set; }
+        public decimal PreTempAmount { get; set; }
+        public decimal ToChargeAmount { get; set; }
     }
 }

文件差異過大導致無法顯示
+ 213 - 530
Models/WebCMSEntities.cs


+ 3 - 3
PxcModels/MsgAlert.cs

@@ -9,11 +9,8 @@ namespace MySystem.PxcModels
         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; }
         public DateTime? UpdateDate { get; set; }
-        public string CreateMan { get; set; }
-        public string UpdateMan { get; set; }
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }
@@ -36,5 +33,8 @@ namespace MySystem.PxcModels
         public string Summary { get; set; }
         public string Title { get; set; }
         public int MsgType { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public int Version { get; set; }
     }
 }

+ 4 - 1
PxcModels/PosMachinesTwo.cs

@@ -52,9 +52,12 @@ namespace MySystem.PxcModels
         public DateTime? UpFeeDate { get; set; }
         public ulong DownFeeFlag { get; set; }
         public ulong UpFeeFlag { get; set; }
-        public int OpId { get; set; }
         public decimal OpReserve3 { get; set; }
         public decimal OpReserve2 { get; set; }
         public decimal OpReserve1 { get; set; }
+        public int OpId { get; set; }
+        public DateTime? RecycStartDate { get; set; }
+        public string SourcePosSn { get; set; }
+        public int RecycStatus { get; set; }
     }
 }

+ 26 - 0
PxcModels/PreAmountRecord.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class PreAmountRecord
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int PayMode { get; set; }
+        public int OperateType { get; set; }
+        public int AmountType { get; set; }
+        public decimal AfterAmount { get; set; }
+        public decimal BeforeAmount { get; set; }
+        public decimal UseAmount { get; set; }
+        public int ApplyId { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 27 - 0
PxcModels/RecycMachineOrder.cs

@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class RecycMachineOrder
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int BrandId { get; set; }
+        public string RecycOrderNo { get; set; }
+        public DateTime? CancelDate { get; set; }
+        public DateTime? ResultDate { get; set; }
+        public string ErpCode { get; set; }
+        public string ErpName { get; set; }
+        public int PostType { get; set; }
+        public int RecycStoreId { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 23 - 0
PxcModels/RecycMachineOrderPos.cs

@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class RecycMachineOrderPos
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int BrandId { get; set; }
+        public DateTime? CancelDate { get; set; }
+        public DateTime? ResultDate { get; set; }
+        public string SnNo { get; set; }
+        public int OrderId { get; set; }
+    }
+}

+ 0 - 3
PxcModels/SchoolMaterials.cs

@@ -9,11 +9,8 @@ namespace MySystem.PxcModels
         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; }
         public DateTime? UpdateDate { get; set; }
-        public string CreateMan { get; set; }
-        public string UpdateMan { get; set; }
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }

+ 0 - 3
PxcModels/SchoolSignInData.cs

@@ -9,11 +9,8 @@ namespace MySystem.PxcModels
         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; }
         public DateTime? UpdateDate { get; set; }
-        public string CreateMan { get; set; }
-        public string UpdateMan { get; set; }
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }

+ 0 - 3
PxcModels/SchoolSignInRecord.cs

@@ -9,11 +9,8 @@ namespace MySystem.PxcModels
         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; }
         public DateTime? UpdateDate { get; set; }
-        public string CreateMan { get; set; }
-        public string UpdateMan { get; set; }
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }

+ 0 - 3
PxcModels/SchoolSignInTask.cs

@@ -9,11 +9,8 @@ namespace MySystem.PxcModels
         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; }
         public DateTime? UpdateDate { get; set; }
-        public string CreateMan { get; set; }
-        public string UpdateMan { get; set; }
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }

+ 0 - 3
PxcModels/SchoolSignInTaskRecord.cs

@@ -9,11 +9,8 @@ namespace MySystem.PxcModels
         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; }
         public DateTime? UpdateDate { get; set; }
-        public string CreateMan { get; set; }
-        public string UpdateMan { get; set; }
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }

+ 23 - 0
PxcModels/ToChargeBackRecord.cs

@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class ToChargeBackRecord
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public string Field1 { get; set; }
+        public string Remark { get; set; }
+        public int ChargeType { get; set; }
+        public decimal ChargeAmount { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 6 - 3
PxcModels/UserAccount.cs

@@ -38,10 +38,13 @@ namespace MySystem.PxcModels
         public decimal ValidAmount { get; set; }
         public decimal LeaderBalanceAmount { get; set; }
         public decimal HelpProfitBalanceAmount { get; set; }
-        public decimal TempAmountForBalance { get; set; }
-        public decimal ThisMonthPreAmount { get; set; }
-        public decimal ValidPreAmount { get; set; }
         public decimal SmallStoreDeposit { get; set; }
+        public decimal ValidPreAmount { get; set; }
+        public decimal ThisMonthPreAmount { get; set; }
+        public decimal TempAmountForBalance { get; set; }
         public decimal StoreDeposit { get; set; }
+        public decimal PreTempAmountForBalance { get; set; }
+        public decimal PreTempAmount { get; set; }
+        public decimal ToChargeAmount { get; set; }
     }
 }

文件差異過大導致無法顯示
+ 213 - 530
PxcModels/WebCMSEntities.cs


+ 4 - 2
Startup.cs

@@ -228,8 +228,10 @@ namespace MySystem
             // UserMonthFeeHelper.Instance.Start(); //每月创客服务费
             // UserMonthFeeHelper.Instance.Start2(); //临时扣创客服务费
             DepositReturnService.Instance.Start(); //退押金到支付宝余额
-            // PosExpiredHelper.Instance.Start(); //过期机具提醒
-            PosExpiredHelper.Instance.StartPay(); //过期机具扣费
+            TimeOutPosSendMessageService.Instance.Start(); //过期机具提醒
+            TimeOutPosChargeService.Instance.Start(); //过期机具计算扣费,并添加到待扣款记录
+            TimeOutPosChargeService.Instance.StartDoChargeAmount(); //实时监听待扣款记录,并扣费
+            TimeOutPosChargeService.Instance.ListenChargeAmount(); //实时等待过期机具扣款指令,并扣费
 
             DepositReturnStatService.Instance.Start(); //每月1号统计达标商户(退押需要的)
             AutoOpOrderService.Instance.StartOrderCancel(); //自动取消超时订单(15分钟)

部分文件因文件數量過多而無法顯示