Browse Source

添加实时查询查询终端收单机构

lcl 1 year ago
parent
commit
67e3e4a37d

+ 290 - 0
AppStart/PosChannelHelper.cs

@@ -0,0 +1,290 @@
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Linq;
+using System.Data;
+using MySystem;
+using MySystem.PxcModels;
+using Library;
+using LitJson;
+using System.Security.Cryptography;
+using System.Text;
+using System.IO;
+using System.Net;
+
+public class PosChannelHelper
+{
+    public readonly static PosChannelHelper Instance = new PosChannelHelper();
+    private PosChannelHelper()
+    {
+    }
+
+    public void Start()
+    {
+        Thread th = new Thread(DoWorks);
+        th.IsBackground = true;
+        th.Start();
+    }
+
+    private void DoWorks()
+    {
+        while (true)
+        {
+            try
+            {
+                WebCMSEntities db = new WebCMSEntities();
+                DoSomething(db);
+                db.Dispose();
+                Thread.Sleep(600000);
+            }
+            catch (Exception ex)
+            {
+                function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "补下单机具券奖励异常");
+            }
+            function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "补下单机具券奖励日志");
+        }
+    }
+
+    public void DoSomething(WebCMSEntities db)
+    {
+        List<PosChannelSetRecord> list = db.PosChannelSetRecord.Where(m => m.Status == 0).ToList();
+        foreach(PosChannelSetRecord sub in list)
+        {
+            string jsonString = QueryTermAcqInfo(sub.PosSn);
+            JsonData jsonData = JsonMapper.ToObject(jsonString);
+            if(jsonData["resultCode"].ToString() == "1" && jsonData["ok"].ToString() == "true")
+            {
+                string acqInstId = jsonData["data"]["acqInstId"].ToString();
+                if(sub.ChannelNo == acqInstId)
+                {
+                    PosChannelSetRecord edit = db.PosChannelSetRecord.FirstOrDefault(m => m.Id == sub.Id);
+                    if(edit != null)
+                    {
+                        edit.Status = 1;
+                        db.SaveChanges();
+                    }
+                }
+            }
+        }  
+    }
+
+
+
+
+
+
+    
+        #region 盒易付
+
+        //测试环境
+        // string BoxRequestUrl = "https://openapi-test.iboxpay.com/api";
+        // string BoxAppId = "8840021411446784";
+        // string BoxAppSecret = "xgwGnmYGjVy0GOWOWkQtRk8Hk8ur5tCV";
+        // string BoxPublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjMQxp24mjxDTr13uPW0y+tiO1yXFGw7P/pPQ0oZKK7F6KstEaus7pLEywBZ5XRXE5jgkhR2TS7Ne7djJfbpn5yFc6pPlz3ZsOfBVeB88NEwhx6xzCGX2eqSSkO33n8w2G0xc2ss5HpYBarT00NBZWhrwOXpdRPYLOYHKVU3Rl+FA9xDw/wYfoWvrr+JSfHRGn/ENMmQFEdckAbPauKaQMrZD2kz+PRrhq56eWnCuVQPcaz/jroVT8qQEgkg2IsNy+DwfLOIqm8IySEpxnQ5wN/KvsQJc2wXDQNf9F5kvWwjoqSSP0qJS+oPRXET+zJb+WTk2y5M6AYoC9NodwsC4NwIDAQAB";
+        // string BrhCode = "039001";
+        
+        //生产环境
+        string BoxRequestUrl = "https://openapi.iboxpay.com/api";
+        string BoxAppId = "AP5879017839106039808";
+        string BoxAppSecret = "DGtftIyl6R3nzwPr5YuV5fnmkfwufXRj";
+        string BoxPublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjmjoQirIYZBD9Qon2HkF4j/NAINXtJ7Lzq/WXxTF7t7mg7LNARt0+ZZaeWx8caq2fv5zdsGyyoInL23cBtDI5KmFfK69iA0ygQMK0WbiKqsUB1OpPbT3+9zLuadIJAznjA223lY6CIjTpdLZhaRjImNVqc60bdkx6YsQcA+xW+3r1JH4PPHb7yBEbkKIX8OhyX7U4p0TkbDkAobbjHr5YB9gmYLoSFJMOPfTtSExkv7/Y7IVR9poZAHcr3teFoAiXW3RzxelRtnXxIkl/6AUOKoL5fhr/UTUN+Q18uzNljYWr6SwnTI3EmtzgykaewWtZvV85Xdhe/BjiQ5Xor7YbwIDAQAB";
+        string BrhCode = "039034";
+
+        public string BoxServiceFee(string SnList, string ServiceFee)
+        {
+            function.WriteLog(DateTime.Now.ToString(), "设置盒易付机具服务费");
+            function.WriteLog(SnList, "设置盒易付机具服务费");
+            Dictionary<string, object> reqdic = new Dictionary<string, object>();
+            Dictionary<string, string> headdic = new Dictionary<string, string>();
+            string batchNo = DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8);
+
+            string timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+            headdic.Add("appid", BoxAppId);//开发者id
+            headdic.Add("appsecret", BoxAppSecret);//开发者密码
+            headdic.Add("X-Up-AppId", BoxAppId);
+            headdic.Add("X-Timestamp", timestamp);
+            headdic.Add("X-Sign-Type", "SHA-256");
+            
+            reqdic.Add("snList", SnList.Split(',').ToList());//终端列表
+            if(ServiceFee != "0")
+            {
+                ServiceFee += "00";
+            }
+            reqdic.Add("depositGear", ServiceFee);//押金档位
+            reqdic.Add("modelId", "MHN10916");//费率,固定0.6
+            reqdic.Add("brhCode", BrhCode);//机构号
+            reqdic.Add("batchNo", batchNo);//批次号
+            string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
+
+            headdic.Add("X-Sign", SHA256Sign(timestamp + BoxAppSecret + req));
+            string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
+            function.WriteLog("请求头\n" + head, "设置盒易付机具服务费");
+            function.WriteLog("请求参数\n" + req, "设置盒易付机具服务费");
+            function.WriteLog("请求地址:" + BoxRequestUrl + "/inst/register/terms", "设置盒易付机具服务费");
+            string result = PostWebRequest(BoxRequestUrl + "/inst/register/terms", req, headdic);
+            function.WriteLog("返回\n" + result + "\n\n", "设置盒易付机具服务费");
+            return result;
+        }
+
+        public string BoxFee(string MerNo, string Fee)
+        {
+            function.WriteLog(DateTime.Now.ToString(), "设置盒易付机具费率");
+            function.WriteLog(MerNo, "设置盒易付机具费率");
+            Dictionary<string, object> reqdic = new Dictionary<string, object>();
+            Dictionary<string, string> headdic = new Dictionary<string, string>();
+            string batchNo = DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8);
+
+            string timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+            headdic.Add("appid", BoxAppId);//开发者id
+            headdic.Add("appsecret", BoxAppSecret);//开发者密码
+            headdic.Add("X-Up-AppId", BoxAppId);
+            headdic.Add("X-Timestamp", timestamp);
+            headdic.Add("X-Sign-Type", "SHA-256");
+
+            reqdic.Add("mchtNo", MerNo);//终端列表
+            reqdic.Add("brhCode", BrhCode);//机构号
+            reqdic.Add("tNDiscId", Fee == "0.6" ? "MHN10916" : "MHN10917");//费率模型
+            reqdic.Add("effectiveFlag", "1");//立即生效
+            string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
+
+            headdic.Add("X-Sign", SHA256Sign(timestamp + BoxAppSecret + req));
+            string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
+            function.WriteLog("请求头\n" + head, "设置盒易付机具费率");
+            function.WriteLog("请求参数\n" + req, "设置盒易付机具费率");
+            function.WriteLog("请求地址:" + BoxRequestUrl + "/inst/mcht/update_disc", "设置盒易付机具费率");
+            string result = PostWebRequest(BoxRequestUrl + "/inst/mcht/update_disc", req, headdic);
+            function.WriteLog("返回\n" + result + "\n\n", "设置盒易付机具费率");
+            return result;
+        }
+
+        //查询终端收单机构
+        public string QueryTermAcqInfo(string SnNo)
+        {
+            function.WriteLog(DateTime.Now.ToString(), "查询终端收单机构");
+            function.WriteLog(SnNo, "查询终端收单机构");
+            Dictionary<string, object> reqdic = new Dictionary<string, object>();
+            Dictionary<string, string> headdic = new Dictionary<string, string>();
+
+            string timestamp = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+            headdic.Add("appid", BoxAppId);//开发者id
+            headdic.Add("appsecret", BoxAppSecret);//开发者密码
+            headdic.Add("X-Up-AppId", BoxAppId);
+            headdic.Add("X-Timestamp", timestamp);
+            headdic.Add("X-Sign-Type", "SHA-256");
+            
+            reqdic.Add("tusn", SnNo); //机具号
+            string req = Newtonsoft.Json.JsonConvert.SerializeObject(reqdic);
+
+            headdic.Add("X-Sign", SHA256Sign(timestamp + BoxAppSecret + req));
+            string head = Newtonsoft.Json.JsonConvert.SerializeObject(headdic);
+            function.WriteLog("请求头\n" + head, "查询终端收单机构");
+            function.WriteLog("请求参数\n" + req, "查询终端收单机构");
+            function.WriteLog("请求地址:" + BoxRequestUrl + "/inst/term/queryTermAcqInfo", "查询终端收单机构");
+            string result = PostWebRequest(BoxRequestUrl + "/inst/term/queryTermAcqInfo", req, headdic);
+            function.WriteLog("返回\n" + result + "\n\n", "查询终端收单机构");
+            return result;
+        }
+
+        public string SHA256Sign(string toSignStr)
+        {
+            byte[] toSignByte = Encoding.UTF8.GetBytes(toSignStr);
+            SHA256 sha256 = SHA256.Create();
+            byte[] signByte = sha256.ComputeHash(toSignByte);
+            string sign = Convert.ToBase64String(signByte);
+            return sign;
+        }
+
+        public bool VerifySign(string toSignStr, string signStr)
+        {
+            byte[] toSignByte = Encoding.Default.GetBytes(toSignStr);
+            byte[] signByte = Convert.FromBase64String(signStr);
+            var toKey = Convert.FromBase64String(BoxPublicKey);
+            var rsaroot = RSA.Create();
+            rsaroot.ImportSubjectPublicKeyInfo(toKey, out _);
+            var publicKeyParameters = rsaroot.ExportParameters(false);
+            using (var rsa = RSA.Create())
+            {
+                rsa.ImportParameters(publicKeyParameters);
+                var sha256 = SHA256.Create();
+                var hash = sha256.ComputeHash(toSignByte);
+                return rsa.VerifyHash(hash, signByte, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
+            }
+        }
+
+        public string SignData(string toSignStr)
+        {
+            byte[] toSignByte = Encoding.UTF8.GetBytes(toSignStr);
+            var toKey = Convert.FromBase64String(BoxPublicKey);
+            var rsaroot = RSA.Create();
+            rsaroot.ImportSubjectPublicKeyInfo(toKey, out _);
+            var publicKeyParameters = rsaroot.ExportParameters(false);
+            using (var rsa = RSA.Create())
+            {
+                rsa.ImportParameters(publicKeyParameters);
+                var sha256 = SHA256.Create();
+                var hash = sha256.ComputeHash(toSignByte);
+                byte[] endByte = rsa.SignData(toSignByte, HashAlgorithmName.SHA256, RSASignaturePadding.Pkcs1);
+                return Convert.ToBase64String(endByte);
+            }
+        }
+
+        public string PostWebRequest(string postUrl, string paramData, Dictionary<string, string> headers)
+        {
+            string ret = string.Empty;
+            try
+            {
+                function.WriteLog(DateTime.Now.ToString(), "请求开店宝API日志");
+                function.WriteLog(postUrl, "请求开店宝API日志");
+                function.WriteLog(paramData, "请求开店宝API日志");
+                byte[] postData = System.Text.Encoding.UTF8.GetBytes(paramData);
+                // 设置提交的相关参数 
+                HttpWebRequest request = WebRequest.Create(postUrl) as HttpWebRequest;
+                System.Text.Encoding myEncoding = System.Text.Encoding.UTF8;
+                request.Method = "POST";
+                request.KeepAlive = false;
+                request.AllowAutoRedirect = true;
+                request.ContentType = "application/json";
+                foreach (string key in headers.Keys)
+                {
+                    request.Headers.Add(key, headers[key]);
+                }
+                request.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; .NET CLR  3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)";
+
+                request.ContentLength = postData.Length;
+
+                // 提交请求数据 
+                Stream outputStream = request.GetRequestStream();
+                outputStream.Write(postData, 0, postData.Length);
+                outputStream.Close();
+                HttpWebResponse response;
+                Stream responseStream;
+                StreamReader reader;
+                string srcString;
+                response = request.GetResponse() as HttpWebResponse;
+                responseStream = response.GetResponseStream();
+                reader = new StreamReader(responseStream, System.Text.Encoding.UTF8);
+                srcString = reader.ReadToEnd();
+                ret = srcString;   //返回值赋值
+                reader.Close();
+                function.WriteLog(srcString, "请求开店宝API日志");
+            }
+            catch (WebException ex)
+            {
+                HttpWebResponse response = (HttpWebResponse)ex.Response;
+                Stream myResponseStream = response.GetResponseStream();
+                //获取响应内容
+                StreamReader myStreamReader = new StreamReader(myResponseStream);
+                ret = myStreamReader.ReadToEnd();
+                myResponseStream.Close();
+            }
+            catch (Exception ex)
+            {
+                ret = "fail";
+                function.WriteLog(DateTime.Now.ToString() + "\r\n" + ex.ToString(), "请求开店宝API异常");
+            }
+            return ret;
+        }
+
+        #endregion
+
+}

+ 19 - 0
PxcModels/PosChannelSetRecord.cs

@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class PosChannelSetRecord
+    {
+        public int Id { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public int MerId { get; set; }
+        public int PosId { get; set; }
+        public string ChannelNo { get; set; }
+        public string MerNo { get; set; }
+        public string PosSn { get; set; }
+        public int BrandId { get; set; }
+    }
+}

+ 24 - 0
PxcModels/UserRankWhiteSetRecord.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class UserRankWhiteSetRecord
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public int BeforeLevel { get; set; }
+        public DateTime? ExpireDate { get; set; }
+        public DateTime? PresetDate { get; set; }
+        public string OperateMan { get; set; }
+        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; }
+    }
+}

+ 20 - 0
PxcModels/UserSetUnAuthRecord.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class UserSetUnAuthRecord
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string Remark { get; set; }
+        public string Operator { get; set; }
+        public string MakerCode { get; set; }
+        public string RealName { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 1 - 0
PxcModels/Users.cs

@@ -97,5 +97,6 @@ namespace MySystem.PxcModels
         public string BusinessLogo { get; set; }
         public string BusinessName { get; set; }
         public DateTime? LogOutDate { get; set; }
+        public int LimitPosCount { get; set; }
     }
 }

+ 181 - 0
PxcModels/WebCMSEntities.cs

@@ -141,6 +141,7 @@ namespace MySystem.PxcModels
         public virtual DbSet<Orders> Orders { get; set; }
         public virtual DbSet<PageInfo> PageInfo { get; set; }
         public virtual DbSet<PageUpdateInfo> PageUpdateInfo { get; set; }
+        public virtual DbSet<PosChannelSetRecord> PosChannelSetRecord { get; set; }
         public virtual DbSet<PosCouponForUser> PosCouponForUser { get; set; }
         public virtual DbSet<PosCouponOrders> PosCouponOrders { get; set; }
         public virtual DbSet<PosCouponRecord> PosCouponRecord { get; set; }
@@ -289,7 +290,9 @@ namespace MySystem.PxcModels
         public virtual DbSet<UserRank> UserRank { get; set; }
         public virtual DbSet<UserRankWhite> UserRankWhite { get; set; }
         public virtual DbSet<UserRankWhiteBefore> UserRankWhiteBefore { get; set; }
+        public virtual DbSet<UserRankWhiteSetRecord> UserRankWhiteSetRecord { get; set; }
         public virtual DbSet<UserRebateDetail> UserRebateDetail { get; set; }
+        public virtual DbSet<UserSetUnAuthRecord> UserSetUnAuthRecord { get; set; }
         public virtual DbSet<UserSimActSummary> UserSimActSummary { get; set; }
         public virtual DbSet<UserSnActInfo> UserSnActInfo { get; set; }
         public virtual DbSet<UserSnDelayChange> UserSnDelayChange { get; set; }
@@ -9811,6 +9814,55 @@ namespace MySystem.PxcModels
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<PosChannelSetRecord>(entity =>
+            {
+                entity.HasComment("机具通道修改记录");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ChannelNo)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("通道编号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.CreateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("创建时间");
+
+                entity.Property(e => e.MerId)
+                    .HasColumnType("int(11)")
+                    .HasComment("商户Id");
+
+                entity.Property(e => e.MerNo)
+                    .HasColumnType("varchar(30)")
+                    .HasComment("商户号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.PosId)
+                    .HasColumnType("int(11)")
+                    .HasComment("机具Id");
+
+                entity.Property(e => e.PosSn)
+                    .HasColumnType("varchar(30)")
+                    .HasComment("机具号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Status)
+                    .HasColumnType("int(11)")
+                    .HasComment("状态");
+
+                entity.Property(e => e.UpdateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("修改时间");
+
+                entity.Property(e => e.BrandId)
+                    .HasColumnType("int(11)")
+                    .HasComment("品牌");
+            });
+
             modelBuilder.Entity<PosCouponForUser>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -20167,6 +20219,73 @@ namespace MySystem.PxcModels
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<UserRankWhiteSetRecord>(entity =>
+            {
+                entity.HasComment("创客预设职级设置记录");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.BeforeLevel)
+                    .HasColumnType("int(11)")
+                    .HasComment("预设前职级");
+
+                entity.Property(e => e.CreateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("创建时间");
+
+                entity.Property(e => e.ExpireDate)
+                    .HasColumnType("datetime")
+                    .HasComment("到期时间");
+
+                entity.Property(e => e.Level)
+                    .HasColumnType("int(11)")
+                    .HasComment("预设等级");
+
+                entity.Property(e => e.OperateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("操作人")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.PresetDate)
+                    .HasColumnType("datetime")
+                    .HasComment("预设时间");
+
+                entity.Property(e => e.Remark)
+                    .HasColumnType("varchar(200)")
+                    .HasComment("备注")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SetType)
+                    .HasColumnType("int(11)")
+                    .HasComment("变动类型");
+
+                entity.Property(e => e.Sort)
+                    .HasColumnType("int(11)")
+                    .HasComment("排序序号");
+
+                entity.Property(e => e.Status)
+                    .HasColumnType("int(11)")
+                    .HasComment("状态");
+
+                entity.Property(e => e.UpdateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("修改时间");
+
+                entity.Property(e => e.UserId)
+                    .HasColumnType("int(11)")
+                    .HasComment("创客Id");
+
+                entity.Property(e => e.UserType)
+                    .HasColumnType("int(11)")
+                    .HasComment("设置创客类型");
+
+                entity.Property(e => e.Version)
+                    .HasColumnType("int(11)")
+                    .HasComment("版本号");
+            });
+
             modelBuilder.Entity<UserRebateDetail>(entity =>
             {
                 entity.HasComment("返利明细表");
@@ -20272,10 +20391,68 @@ namespace MySystem.PxcModels
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<UserSetUnAuthRecord>(entity =>
+            {
+                entity.HasComment("设置创客为未实名记录");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("创建时间");
+
+                entity.Property(e => e.MakerCode)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("创客编号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Operator)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("操作人")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.RealName)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("创客姓名")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Remark)
+                    .HasColumnType("varchar(200)")
+                    .HasComment("备注")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort)
+                    .HasColumnType("int(11)")
+                    .HasComment("排序序号");
+
+                entity.Property(e => e.Status)
+                    .HasColumnType("int(11)")
+                    .HasComment("状态");
+
+                entity.Property(e => e.UpdateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("修改时间");
+
+                entity.Property(e => e.UserId)
+                    .HasColumnType("int(11)")
+                    .HasComment("创客Id");
+
+                entity.Property(e => e.Version)
+                    .HasColumnType("int(11)")
+                    .HasComment("版本号");
+            });
+
             modelBuilder.Entity<UserSimActSummary>(entity =>
             {
                 entity.HasComment("广电卡激活数统计");
 
+                entity.HasIndex(e => new { e.UserId, e.Kind })
+                    .HasName("UserSimActSummaryIndex");
+
                 entity.Property(e => e.Id).HasColumnType("int(11)");
 
                 entity.Property(e => e.ActCount)
@@ -21334,6 +21511,10 @@ namespace MySystem.PxcModels
 
                 entity.Property(e => e.LeaderLevel).HasColumnType("int(11)");
 
+                entity.Property(e => e.LimitPosCount)
+                    .HasColumnType("int(11)")
+                    .HasComment("限制机具划拨数");
+
                 entity.Property(e => e.LockStatus)
                     .HasColumnType("bit(1)")
                     .HasDefaultValueSql("b'0'");

+ 2 - 0
Startup.cs

@@ -237,6 +237,8 @@ namespace MySystem
                 DepositReturnService.Instance.Start(); //退押金到支付宝余额
                 StoreApplyHelper.Instance.ResetStoreReserve(); //重置分仓额度
                 AddPosCouponPrizeHelper.Instance.Start(); //补机具券奖励
+                
+                PosChannelHelper.Instance.Start(); //实时查询查询终端收单机构
             // }