浏览代码

好哒小蓝环点餐码入库程序

lcl 4 月之前
父节点
当前提交
4ee8f35698

+ 258 - 0
AppStart/HaoDa/GetHaoDaBlueCircleBindService.cs

@@ -0,0 +1,258 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Data;
+using System.Threading;
+using Library;
+using System.Net;
+using System.IO;
+using MySystem.SpModels;
+
+namespace MySystem
+{
+    /// <summary>
+    /// 获取好哒ftp数据
+    /// </summary>
+    public class GetHaoDaBlueCircleBindService
+    {
+        public readonly static GetHaoDaBlueCircleBindService Instance = new GetHaoDaBlueCircleBindService();
+        private GetHaoDaBlueCircleBindService()
+        { }
+
+        public void Start()
+        {
+            //每天凌晨执行获取好哒FTP昨日交易数据
+            Thread th = new Thread(GetBlueCircleBindDataReady);
+            th.IsBackground = true;
+            th.Start();
+        }
+
+        /// <summary>
+        /// 获取好哒FTP昨日交易数据
+        /// </summary>
+        public void GetBlueCircleBindDataReady()
+        {
+            while (true)
+            {
+                if (DateTime.Now > DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd") + " 10:05:00"))
+                {
+                    SaveBlueCircleBindData(DateTime.Now.ToString("yyyyMMdd"));
+                    Thread.Sleep(2000);
+                }
+                Thread.Sleep(180000);
+            }
+        }
+
+        public void StartListen()
+        {
+            //每天凌晨执行获取好哒FTP昨日交易数据
+            Thread th2 = new Thread(ListenBlueCircleBindDataReady);
+            th2.IsBackground = true;
+            th2.Start();
+        }
+        /// <summary>
+        /// 获取好哒FTP昨日交易数据
+        /// </summary>
+        public void ListenBlueCircleBindDataReady()
+        {
+            while (true)
+            {
+                string content = RedisDbconn.Instance.RPop<string>("ListenBlueCircleBindDataQueue");
+                if (!string.IsNullOrEmpty(content))
+                {
+                    SaveBlueCircleBindData(content);
+                    Thread.Sleep(2000);
+                }
+                else
+                {
+                    Thread.Sleep(60000);
+                }
+            }
+        }
+
+        public void SaveBlueCircleBindData(string Date, bool IsRedis = false)
+        {
+            // 要下载的文件路径
+            string filePath = "/haoda-deposit/xlh_bind_" + Date + ".csv";
+
+            try
+            {
+                // 创建FtpWebRequest对象
+                FtpWebRequest request = (FtpWebRequest)WebRequest.Create(GetHaoDaFTPInfoService.Instance.ftpServerAddress + filePath);
+                request.Method = WebRequestMethods.Ftp.DownloadFile;
+                request.Credentials = new NetworkCredential(GetHaoDaFTPInfoService.Instance.ftpUser, GetHaoDaFTPInfoService.Instance.ftpPassword);
+
+                // 使用WebResponse获取响应
+                FtpWebResponse response = (FtpWebResponse)request.GetResponse();
+
+                // 打开数据流
+                Stream responseStream = response.GetResponseStream();
+                StreamReader reader = new StreamReader(responseStream);
+                // 读取数据
+                string fileContents = reader.ReadToEnd();
+                if (!string.IsNullOrEmpty(fileContents))
+                {
+                    MpMainModels2.WebCMSEntities db = new MpMainModels2.WebCMSEntities();
+                    List<string> SnNos = db.HdBlueCircleTmp.Select(m => m.SnNo).ToList();
+                    List<string> ChkSnNos = new List<string>();
+                    var DataInfo = fileContents.TrimEnd('\n').Split('\n', 2);
+                    if (DataInfo.Length > 1)
+                    {
+                        int index = 0;
+                        var DataList = DataInfo[1].Split('\n');
+                        foreach (var DataListItem in DataList)
+                        {
+                            if(IsRedis)
+                            {
+                                RedisDbconn.Instance.AddList("ListenBlueCircleBindDataByOneQueue", DataListItem);
+                            }
+                            else
+                            {
+                                SaveBlueCircleBindDataOneReady(db, DataListItem);
+                                index += 1;
+                                if(index % 200 == 0 && index > 0)
+                                {
+                                    index = 0;
+                                    db.SaveChanges();
+                                }
+                            }
+                        }
+                        if(!IsRedis)
+                        {
+                            index = 0;
+                            db.SaveChanges();
+                        }
+                    }
+                    db.Dispose();
+                }
+
+                // 关闭响应
+                reader.Dispose();
+                responseStream.Dispose();
+                response.Close();
+            }
+            catch (WebException ex)
+            {
+                function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "获取好哒FTP文件数据异常");
+            }
+        }
+
+
+
+
+        public void StartBlueCircleBindListenBridge()
+        {
+            Thread th2 = new Thread(ListenBlueCircleBindDataBridgeReady);
+            th2.IsBackground = true;
+            th2.Start();
+        }
+        public void ListenBlueCircleBindDataBridgeReady()
+        {
+            while (true)
+            {
+                string content = RedisDbconn.Instance.RPop<string>("cache:ListenBlueCircleBindDataByOneQueue");
+                if (!string.IsNullOrEmpty(content))
+                {
+                    RedisDbconn.Instance.AddList("ListenBlueCircleBindDataByOneQueue", content);
+                }
+                else
+                {
+                    Thread.Sleep(10000);
+                }
+            }
+        }
+        public void StartBlueCircleBindListenByOne()
+        {
+            //每天凌晨执行获取好哒FTP昨日交易数据
+            Thread th2 = new Thread(ListenBlueCircleBindDataByOneReady);
+            th2.IsBackground = true;
+            th2.Start();
+        }
+        /// <summary>
+        /// 获取好哒FTP昨日交易数据
+        /// </summary>
+        public void ListenBlueCircleBindDataByOneReady()
+        {
+            int index = 0;
+            MpMainModels2.WebCMSEntities db = new MpMainModels2.WebCMSEntities();
+            bool dbConn = true;
+            while (true)
+            {
+                string content = RedisDbconn.Instance.RPop<string>("ListenBlueCircleBindDataByOneQueue");
+                if (!string.IsNullOrEmpty(content))
+                {
+                    if(!dbConn)
+                    {
+                        db = new MpMainModels2.WebCMSEntities();
+                        dbConn = true;
+                    }
+                    SaveBlueCircleBindDataOneReady(db, content);
+                    index += 1;
+                    if(index % 200 == 0 && index > 0)
+                    {
+                        index = 0;
+                        db.SaveChanges();
+                    }
+                }
+                else
+                {
+                    index = 0;
+                    if(dbConn)
+                    {
+                        db.SaveChanges();
+                        db.Dispose();
+                        dbConn = false;
+                    }
+                }
+            }
+        }
+        public void SaveBlueCircleBindDataOneReady(MpMainModels2.WebCMSEntities db, string content)
+        {
+            try
+            {
+                var DataListInfo = content.Split(',');
+
+                string sn_no = DataListInfo[0]; //SN号
+                string bind_date = DataListInfo[1]; //绑定日期
+                string bind_date_detail = DataListInfo[2]; //绑定时间
+                string mcht_no = DataListInfo[3]; //商户号
+                string mcht_nm = DataListInfo[4]; //商户名称
+                string through_date = DataListInfo[5]; //截止日期
+                string channel_kind = DataListInfo[6]; //商户类型
+
+                MpMainModels2.HdBlueCircleTmp edit = db.HdBlueCircleTmp.FirstOrDefault(m => m.SnNo == sn_no);
+                if(edit == null)
+                {
+                    function.WriteLog(DateTime.Now.ToString() + ":add:" + sn_no, "好哒小蓝环绑定");
+                    db.HdBlueCircleTmp.Add(new MpMainModels2.HdBlueCircleTmp()
+                    {
+                        SnNo = sn_no,
+                        BindDate = bind_date,
+                        BindDateDetail = bind_date_detail,
+                        MchtNo = mcht_no,
+                        MchtNm = mcht_nm,
+                        ThroughDate = through_date,
+                        ChannelKind = channel_kind,
+                    });
+                }
+                else
+                {
+                    function.WriteLog(DateTime.Now.ToString() + ":update:" + sn_no, "好哒小蓝环绑定");
+                    edit.Status = 0;
+                    edit.BindDate = bind_date;
+                    edit.BindDateDetail = bind_date_detail;
+                    edit.MchtNo = mcht_no;
+                    edit.MchtNm = mcht_nm;
+                    edit.ThroughDate = through_date;
+                    edit.ChannelKind = channel_kind;
+                }
+                db.SaveChanges();
+            }
+            catch(Exception ex)
+            {
+                function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "好哒小蓝环绑定异常");
+            }
+        }
+
+    }
+}

+ 0 - 0
AppStart/GetHaoDaFTPInfoService.cs → AppStart/HaoDa/GetHaoDaFTPInfoService.cs


+ 264 - 0
AppStart/HaoDa/GetHaoDaOrderCodeBindService.cs

@@ -0,0 +1,264 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Data;
+using System.Threading;
+using Library;
+using System.Net;
+using System.IO;
+using MySystem.SpModels;
+
+namespace MySystem
+{
+    /// <summary>
+    /// 获取好哒ftp数据
+    /// </summary>
+    public class GetHaoDaOrderCodeBindService
+    {
+        public readonly static GetHaoDaOrderCodeBindService Instance = new GetHaoDaOrderCodeBindService();
+        private GetHaoDaOrderCodeBindService()
+        { }
+
+        public void Start()
+        {
+            //每天凌晨执行获取好哒FTP昨日交易数据
+            Thread th = new Thread(GetOrderCodeBindDataReady);
+            th.IsBackground = true;
+            th.Start();
+        }
+
+        /// <summary>
+        /// 获取好哒FTP昨日交易数据
+        /// </summary>
+        public void GetOrderCodeBindDataReady()
+        {
+            while (true)
+            {
+                if (DateTime.Now > DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd") + " 10:05:00"))
+                {
+                    SaveOrderCodeBindData(DateTime.Now.ToString("yyyyMMdd"));
+                    Thread.Sleep(2000);
+                }
+                Thread.Sleep(180000);
+            }
+        }
+
+        public void StartListen()
+        {
+            //每天凌晨执行获取好哒FTP昨日交易数据
+            Thread th2 = new Thread(ListenOrderCodeBindDataReady);
+            th2.IsBackground = true;
+            th2.Start();
+        }
+        /// <summary>
+        /// 获取好哒FTP昨日交易数据
+        /// </summary>
+        public void ListenOrderCodeBindDataReady()
+        {
+            while (true)
+            {
+                string content = RedisDbconn.Instance.RPop<string>("ListenOrderCodeBindDataQueue");
+                if (!string.IsNullOrEmpty(content))
+                {
+                    SaveOrderCodeBindData(content);
+                    Thread.Sleep(2000);
+                }
+                else
+                {
+                    Thread.Sleep(60000);
+                }
+            }
+        }
+
+        public void SaveOrderCodeBindData(string Date, bool IsRedis = false)
+        {
+            // 要下载的文件路径
+            string filePath = "/haoda-deposit/xlh_bind_" + Date + ".csv";
+
+            try
+            {
+                // 创建FtpWebRequest对象
+                FtpWebRequest request = (FtpWebRequest)WebRequest.Create(GetHaoDaFTPInfoService.Instance.ftpServerAddress + filePath);
+                request.Method = WebRequestMethods.Ftp.DownloadFile;
+                request.Credentials = new NetworkCredential(GetHaoDaFTPInfoService.Instance.ftpUser, GetHaoDaFTPInfoService.Instance.ftpPassword);
+
+                // 使用WebResponse获取响应
+                FtpWebResponse response = (FtpWebResponse)request.GetResponse();
+
+                // 打开数据流
+                Stream responseStream = response.GetResponseStream();
+                StreamReader reader = new StreamReader(responseStream);
+                // 读取数据
+                string fileContents = reader.ReadToEnd();
+                if (!string.IsNullOrEmpty(fileContents))
+                {
+                    MpMainModels2.WebCMSEntities db = new MpMainModels2.WebCMSEntities();
+                    List<string> SnNos = db.HdOrderCodeTmp.Select(m => m.Sn).ToList();
+                    List<string> ChkSnNos = new List<string>();
+                    var DataInfo = fileContents.TrimEnd('\n').Split('\n', 2);
+                    if (DataInfo.Length > 1)
+                    {
+                        int index = 0;
+                        var DataList = DataInfo[1].Split('\n');
+                        foreach (var DataListItem in DataList)
+                        {
+                            if(IsRedis)
+                            {
+                                RedisDbconn.Instance.AddList("ListenOrderCodeBindDataByOneQueue", DataListItem);
+                            }
+                            else
+                            {
+                                SaveOrderCodeBindDataOneReady(db, DataListItem);
+                                index += 1;
+                                if(index % 200 == 0 && index > 0)
+                                {
+                                    index = 0;
+                                    db.SaveChanges();
+                                }
+                            }
+                        }
+                        if(!IsRedis)
+                        {
+                            index = 0;
+                            db.SaveChanges();
+                        }
+                    }
+                    db.Dispose();
+                }
+
+                // 关闭响应
+                reader.Dispose();
+                responseStream.Dispose();
+                response.Close();
+            }
+            catch (WebException ex)
+            {
+                function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "获取好哒FTP文件数据异常");
+            }
+        }
+
+
+
+
+        public void StartOrderCodeBindListenBridge()
+        {
+            Thread th2 = new Thread(ListenOrderCodeBindDataBridgeReady);
+            th2.IsBackground = true;
+            th2.Start();
+        }
+        public void ListenOrderCodeBindDataBridgeReady()
+        {
+            while (true)
+            {
+                string content = RedisDbconn.Instance.RPop<string>("cache:ListenOrderCodeBindDataByOneQueue");
+                if (!string.IsNullOrEmpty(content))
+                {
+                    RedisDbconn.Instance.AddList("ListenOrderCodeBindDataByOneQueue", content);
+                }
+                else
+                {
+                    Thread.Sleep(10000);
+                }
+            }
+        }
+        public void StartOrderCodeBindListenByOne()
+        {
+            //每天凌晨执行获取好哒FTP昨日交易数据
+            Thread th2 = new Thread(ListenOrderCodeBindDataByOneReady);
+            th2.IsBackground = true;
+            th2.Start();
+        }
+        /// <summary>
+        /// 获取好哒FTP昨日交易数据
+        /// </summary>
+        public void ListenOrderCodeBindDataByOneReady()
+        {
+            int index = 0;
+            MpMainModels2.WebCMSEntities db = new MpMainModels2.WebCMSEntities();
+            bool dbConn = true;
+            while (true)
+            {
+                string content = RedisDbconn.Instance.RPop<string>("ListenOrderCodeBindDataByOneQueue");
+                if (!string.IsNullOrEmpty(content))
+                {
+                    if(!dbConn)
+                    {
+                        db = new MpMainModels2.WebCMSEntities();
+                        dbConn = true;
+                    }
+                    SaveOrderCodeBindDataOneReady(db, content);
+                    index += 1;
+                    if(index % 200 == 0 && index > 0)
+                    {
+                        index = 0;
+                        db.SaveChanges();
+                    }
+                }
+                else
+                {
+                    index = 0;
+                    if(dbConn)
+                    {
+                        db.SaveChanges();
+                        db.Dispose();
+                        dbConn = false;
+                    }
+                }
+            }
+        }
+        public void SaveOrderCodeBindDataOneReady(MpMainModels2.WebCMSEntities db, string content)
+        {
+            try
+            {
+                var DataListInfo = content.Split(',');
+
+                string sn = DataListInfo[0];
+                string create_time = DataListInfo[1];
+                string mcht_no = DataListInfo[2];
+                string mcht_nm = DataListInfo[3];
+                string through_date = DataListInfo[4];
+                string channel_kind = DataListInfo[5];
+                string opr_name = DataListInfo[6];
+                string opr_invite_code = DataListInfo[7];
+                string sync_status = DataListInfo[8];
+
+                MpMainModels2.HdOrderCodeTmp edit = db.HdOrderCodeTmp.FirstOrDefault(m => m.Sn == sn);
+                if(edit == null)
+                {
+                    function.WriteLog(DateTime.Now.ToString() + ":add:" + sn, "好哒点餐码绑定");
+                    db.HdOrderCodeTmp.Add(new MpMainModels2.HdOrderCodeTmp()
+                    {
+                        Sn = sn,
+                        CreateTime = DateTime.Parse(create_time),
+                        MchtNo = mcht_no,
+                        MchtNm = mcht_nm,
+                        ThroughDate = through_date,
+                        ChannelKind = channel_kind,
+                        OprName = opr_name,
+                        OprInviteCode = opr_invite_code,
+                        SyncStatus = sync_status,
+                    });
+                }
+                else
+                {
+                    function.WriteLog(DateTime.Now.ToString() + ":update:" + sn, "好哒点餐码绑定");
+                    edit.Status = 0;
+                    edit.CreateTime = DateTime.Parse(create_time);
+                    edit.MchtNo = mcht_no;
+                    edit.MchtNm = mcht_nm;
+                    edit.ThroughDate = through_date;
+                    edit.ChannelKind = channel_kind;
+                    edit.OprName = opr_name;
+                    edit.OprInviteCode = opr_invite_code;
+                    edit.SyncStatus = sync_status;
+                }
+                db.SaveChanges();
+            }
+            catch(Exception ex)
+            {
+                function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "好哒点餐码绑定异常");
+            }
+        }
+
+    }
+}

+ 17 - 0
MpMainModels2/HdBlueCircleTmp.cs

@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.MpMainModels2
+{
+    public partial class HdBlueCircleTmp
+    {
+        public string SnNo { get; set; }
+        public string ChannelKind { get; set; }
+        public string ThroughDate { get; set; }
+        public string MchtNm { get; set; }
+        public string MchtNo { get; set; }
+        public string BindDateDetail { get; set; }
+        public string BindDate { get; set; }
+        public int Status { get; set; }
+    }
+}

+ 19 - 0
MpMainModels2/HdOrderCodeTmp.cs

@@ -0,0 +1,19 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.MpMainModels2
+{
+    public partial class HdOrderCodeTmp
+    {
+        public string Sn { get; set; }
+        public string SyncStatus { get; set; }
+        public string OprInviteCode { get; set; }
+        public string OprName { get; set; }
+        public string ChannelKind { get; set; }
+        public string ThroughDate { get; set; }
+        public string MchtNm { get; set; }
+        public string MchtNo { get; set; }
+        public DateTime? CreateTime { get; set; }
+        public int Status { get; set; }
+    }
+}

+ 25 - 0
MpMainModels2/UserAmountSummaryNewAfter.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.MpMainModels2
+{
+    public partial class UserAmountSummaryNewAfter
+    {
+        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 decimal TotalAmount { get; set; }
+        public string TradeMonth { get; set; }
+        public string TradeDate { get; set; }
+        public int UserId { get; set; }
+        public int TradeCount { get; set; }
+        public int IsAct { get; set; }
+    }
+}

+ 25 - 0
MpMainModels2/UserAmountSummaryNewBefore.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.MpMainModels2
+{
+    public partial class UserAmountSummaryNewBefore
+    {
+        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 decimal TotalAmount { get; set; }
+        public string TradeMonth { get; set; }
+        public string TradeDate { get; set; }
+        public int UserId { get; set; }
+        public int TradeCount { get; set; }
+        public int IsAct { get; set; }
+    }
+}

+ 25 - 0
MpMainModels2/UserAmountSummaryOldAfter.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.MpMainModels2
+{
+    public partial class UserAmountSummaryOldAfter
+    {
+        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 decimal TotalAmount { get; set; }
+        public string TradeMonth { get; set; }
+        public string TradeDate { get; set; }
+        public int UserId { get; set; }
+        public int TradeCount { get; set; }
+        public int IsAct { get; set; }
+    }
+}

+ 25 - 0
MpMainModels2/UserAmountSummaryOldBefore.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.MpMainModels2
+{
+    public partial class UserAmountSummaryOldBefore
+    {
+        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 decimal TotalAmount { get; set; }
+        public string TradeMonth { get; set; }
+        public string TradeDate { get; set; }
+        public int UserId { get; set; }
+        public int TradeCount { get; set; }
+        public int IsAct { get; set; }
+    }
+}

+ 374 - 1
MpMainModels2/WebCMSEntities.cs

@@ -58,7 +58,9 @@ namespace MySystem.MpMainModels2
         public virtual DbSet<FluxProfitDetail> FluxProfitDetail { get; set; }
         public virtual DbSet<FluxProfitSummary> FluxProfitSummary { get; set; }
         public virtual DbSet<HaoDaAreaCode> HaoDaAreaCode { get; set; }
+        public virtual DbSet<HdBlueCircleTmp> HdBlueCircleTmp { get; set; }
         public virtual DbSet<HdDepositTmp> HdDepositTmp { get; set; }
+        public virtual DbSet<HdOrderCodeTmp> HdOrderCodeTmp { get; set; }
         public virtual DbSet<HdOrderTmp> HdOrderTmp { get; set; }
         public virtual DbSet<HdQrCodeTmp> HdQrCodeTmp { get; set; }
         public virtual DbSet<HdRefundOrderNos> HdRefundOrderNos { get; set; }
@@ -250,6 +252,10 @@ namespace MySystem.MpMainModels2
         public virtual DbSet<UserAmountSummary> UserAmountSummary { get; set; }
         public virtual DbSet<UserAmountSummaryAfter> UserAmountSummaryAfter { get; set; }
         public virtual DbSet<UserAmountSummaryBefore> UserAmountSummaryBefore { get; set; }
+        public virtual DbSet<UserAmountSummaryNewAfter> UserAmountSummaryNewAfter { get; set; }
+        public virtual DbSet<UserAmountSummaryNewBefore> UserAmountSummaryNewBefore { get; set; }
+        public virtual DbSet<UserAmountSummaryOldAfter> UserAmountSummaryOldAfter { get; set; }
+        public virtual DbSet<UserAmountSummaryOldBefore> UserAmountSummaryOldBefore { get; set; }
         public virtual DbSet<UserAuthRecord> UserAuthRecord { get; set; }
         public virtual DbSet<UserBack> UserBack { get; set; }
         public virtual DbSet<UserBackKind> UserBackKind { get; set; }
@@ -2495,6 +2501,9 @@ namespace MySystem.MpMainModels2
 
             modelBuilder.Entity<ConsumerOrders>(entity =>
             {
+                entity.HasIndex(e => e.MerchantId)
+                    .HasName("ConsumerOrdersIndex2");
+
                 entity.HasIndex(e => new { e.OrderNo, e.SnNo, e.MerchantId, e.PayMode, e.CreateDate })
                     .HasName("ConsumerOrdersIndex");
 
@@ -3393,6 +3402,68 @@ namespace MySystem.MpMainModels2
                     .HasCollation("utf8_general_ci");
             });
 
+            modelBuilder.Entity<HdBlueCircleTmp>(entity =>
+            {
+                entity.HasKey(e => e.SnNo)
+                    .HasName("PRIMARY");
+
+                entity.HasComment("好哒小蓝环绑定临时表");
+
+                entity.Property(e => e.SnNo)
+                    .HasColumnName("sn_no")
+                    .HasColumnType("varchar(50)")
+                    .HasComment("SN号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.BindDate)
+                    .HasColumnName("bind_date")
+                    .HasColumnType("varchar(8)")
+                    .HasComment("绑定日期")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.BindDateDetail)
+                    .HasColumnName("bind_date_detail")
+                    .HasColumnType("varchar(14)")
+                    .HasComment("绑定时间")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ChannelKind)
+                    .HasColumnName("channel_kind")
+                    .HasColumnType("varchar(10)")
+                    .HasComment("商户类型")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.MchtNm)
+                    .HasColumnName("mcht_nm")
+                    .HasColumnType("varchar(50)")
+                    .HasComment("商户名称")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.MchtNo)
+                    .HasColumnName("mcht_no")
+                    .HasColumnType("varchar(50)")
+                    .HasComment("商户号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Status)
+                    .HasColumnName("status")
+                    .HasColumnType("int(11)")
+                    .HasComment("状态");
+
+                entity.Property(e => e.ThroughDate)
+                    .HasColumnName("through_date")
+                    .HasColumnType("varchar(14)")
+                    .HasComment("截止日期")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+            });
+
             modelBuilder.Entity<HdDepositTmp>(entity =>
             {
                 entity.HasKey(e => e.SnNo)
@@ -3473,6 +3544,80 @@ namespace MySystem.MpMainModels2
                     .HasComment("状态");
             });
 
+            modelBuilder.Entity<HdOrderCodeTmp>(entity =>
+            {
+                entity.HasKey(e => e.Sn)
+                    .HasName("PRIMARY");
+
+                entity.HasComment("好哒点餐码绑定临时表");
+
+                entity.Property(e => e.Sn)
+                    .HasColumnName("sn")
+                    .HasColumnType("varchar(50)")
+                    .HasComment("SN号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ChannelKind)
+                    .HasColumnName("channel_kind")
+                    .HasColumnType("varchar(10)")
+                    .HasComment("商户类型")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.CreateTime)
+                    .HasColumnName("create_time")
+                    .HasColumnType("datetime")
+                    .HasComment("创建时间");
+
+                entity.Property(e => e.MchtNm)
+                    .HasColumnName("mcht_nm")
+                    .HasColumnType("varchar(50)")
+                    .HasComment("商户名称")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.MchtNo)
+                    .HasColumnName("mcht_no")
+                    .HasColumnType("varchar(30)")
+                    .HasComment("商户号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.OprInviteCode)
+                    .HasColumnName("opr_invite_code")
+                    .HasColumnType("varchar(20)")
+                    .HasComment("邀请码")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.OprName)
+                    .HasColumnName("opr_name")
+                    .HasColumnType("varchar(20)")
+                    .HasComment("操作员")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Status)
+                    .HasColumnName("status")
+                    .HasColumnType("int(11)")
+                    .HasComment("状态");
+
+                entity.Property(e => e.SyncStatus)
+                    .HasColumnName("sync_status")
+                    .HasColumnType("varchar(5)")
+                    .HasComment("同步状态")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ThroughDate)
+                    .HasColumnName("through_date")
+                    .HasColumnType("varchar(14)")
+                    .HasComment("截止日期")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+            });
+
             modelBuilder.Entity<HdOrderTmp>(entity =>
             {
                 entity.HasKey(e => e.OrderNo)
@@ -5873,7 +6018,7 @@ namespace MySystem.MpMainModels2
                     .HasCollation("utf8_general_ci");
 
                 entity.Property(e => e.CertMerchantName)
-                    .HasColumnType("varchar(30)")
+                    .HasColumnType("varchar(50)")
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
@@ -17441,6 +17586,234 @@ namespace MySystem.MpMainModels2
                 entity.Property(e => e.UserId).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<UserAmountSummaryNewAfter>(entity =>
+            {
+                entity.HasIndex(e => new { e.UserId, e.IsAct, e.TradeMonth, e.TradeDate, e.PayMode, e.SeoTitle, e.Sort })
+                    .HasName("UserAmountSummaryAfterIndex");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.IsAct)
+                    .HasColumnType("int(11)")
+                    .HasComment("是否活动");
+
+                entity.Property(e => e.PayMode).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TotalAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.TradeCount)
+                    .HasColumnType("int(11)")
+                    .HasComment("交易笔数");
+
+                entity.Property(e => e.TradeDate)
+                    .HasColumnType("varchar(8)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.TradeMonth)
+                    .HasColumnType("varchar(6)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<UserAmountSummaryNewBefore>(entity =>
+            {
+                entity.HasIndex(e => new { e.UserId, e.IsAct, e.TradeMonth, e.TradeDate, e.PayMode, e.SeoTitle, e.Sort })
+                    .HasName("UserAmountSummaryBeforeIndex");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.IsAct)
+                    .HasColumnType("int(11)")
+                    .HasComment("是否活动");
+
+                entity.Property(e => e.PayMode).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TotalAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.TradeCount)
+                    .HasColumnType("int(11)")
+                    .HasComment("交易笔数");
+
+                entity.Property(e => e.TradeDate)
+                    .HasColumnType("varchar(8)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.TradeMonth)
+                    .HasColumnType("varchar(6)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<UserAmountSummaryOldAfter>(entity =>
+            {
+                entity.HasIndex(e => new { e.UserId, e.IsAct, e.TradeMonth, e.TradeDate, e.PayMode, e.SeoTitle, e.Sort })
+                    .HasName("UserAmountSummaryAfterIndex");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.IsAct)
+                    .HasColumnType("int(11)")
+                    .HasComment("是否活动");
+
+                entity.Property(e => e.PayMode).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TotalAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.TradeCount)
+                    .HasColumnType("int(11)")
+                    .HasComment("交易笔数");
+
+                entity.Property(e => e.TradeDate)
+                    .HasColumnType("varchar(8)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.TradeMonth)
+                    .HasColumnType("varchar(6)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<UserAmountSummaryOldBefore>(entity =>
+            {
+                entity.HasIndex(e => new { e.UserId, e.IsAct, e.TradeMonth, e.TradeDate, e.PayMode, e.SeoTitle, e.Sort })
+                    .HasName("UserAmountSummaryBeforeIndex");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.IsAct)
+                    .HasColumnType("int(11)")
+                    .HasComment("是否活动");
+
+                entity.Property(e => e.PayMode).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TotalAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.TradeCount)
+                    .HasColumnType("int(11)")
+                    .HasComment("交易笔数");
+
+                entity.Property(e => e.TradeDate)
+                    .HasColumnType("varchar(8)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.TradeMonth)
+                    .HasColumnType("varchar(6)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+            });
+
             modelBuilder.Entity<UserAuthRecord>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");