Bläddra i källkod

更新数据模型
添加企业创客数据统计

lichunlei 3 år sedan
förälder
incheckning
81bf3ed2de

+ 250 - 0
AppStart/Helper/StatBusinessService.cs

@@ -0,0 +1,250 @@
+using System;
+using System.Collections.Generic;
+using Library;
+using LitJson;
+using System.Linq;
+using System.Data;
+using System.Threading;
+using MySystem.PxcModels;
+
+namespace MySystem
+{
+    public class StatBusinessService
+    {
+        public readonly static StatBusinessService Instance = new StatBusinessService();
+        private StatBusinessService()
+        { }
+
+
+
+
+
+
+        // 统计交易额V2
+        public void StartEverDayV2()
+        {
+            Thread th = new Thread(StartEverDayV2Do);
+            th.IsBackground = true;
+            th.Start();
+        }
+        public void StartEverDayV2Do()
+        {
+            while (true)
+            {
+                if(DateTime.Now.Hour >= 3)
+                {
+                    StatTradeAmountEverDayV2();
+                }
+                Thread.Sleep(30000);
+            }
+        }
+        public void StatTradeAmountEverDayV2()
+        {
+            OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
+            function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), "实时执行企业交易额日志");
+            WebCMSEntities db = new WebCMSEntities();
+            using (var tran = db.Database.BeginTransaction())
+            {
+                try
+                {
+                    string startId = function.ReadInstance("/TradeRecord/Id2.txt");
+                    if(string.IsNullOrEmpty(startId))
+                    {
+                        startId = "867041";
+                    }
+                    DataTable idsDt = OtherMySqlConn.dtable("select Id from TradeRecord where Id>=" + startId + " and UserId in (select Id from Users where BusinessFlag=1) and QueryCount=1 order by Id limit 50");
+                    if(idsDt.Rows.Count > 0)
+                    {
+                        string ids = "";
+                        foreach (DataRow idsDr in idsDt.Rows)
+                        {
+                            ids += idsDr["Id"].ToString() + ",";
+                            startId = idsDr["Id"].ToString();
+                        }
+                        DataTable selfDt = OtherMySqlConn.dtable("select UserId,MerchantId,BrandId,BankCardType,QrPayFlag,MerHelpFlag,CapFlag,VipFlag,PayType,DATE_FORMAT(CreateDate,'%Y%m%d'),sum(TradeAmount),count(Id) from TradeRecord where Id in (" + ids.TrimEnd(',') + ") group by UserId,MerchantId,BrandId,BankCardType,QrPayFlag,MerHelpFlag,CapFlag,VipFlag,PayType,DATE_FORMAT(CreateDate,'%Y%m%d')");
+                        if (selfDt.Rows.Count > 0)
+                        {
+                            function.WriteLog("统计人数:" + selfDt.Rows.Count + "\n\n", "实时执行企业交易额日志");
+                            foreach (DataRow selfDr in selfDt.Rows)
+                            {
+                                int UserId = int.Parse(selfDr["UserId"].ToString());
+                                int MerchantId = int.Parse(selfDr["MerchantId"].ToString());
+                                Users user = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
+                                BusinessPartnerMerchant merchant = db.BusinessPartnerMerchant.FirstOrDefault(m => m.MerchantId == MerchantId) ?? new BusinessPartnerMerchant();
+                                int PartnerId = merchant.PartnerId;
+                                int BrandId = int.Parse(selfDr["BrandId"].ToString());
+                                int BankCardType = int.Parse(selfDr["BankCardType"].ToString());
+                                int QrPayFlag = int.Parse(selfDr["QrPayFlag"].ToString());
+                                int MerHelpFlag = int.Parse(selfDr["MerHelpFlag"].ToString());
+                                int CapFlag = int.Parse(selfDr["CapFlag"].ToString());
+                                int VipFlag = int.Parse(selfDr["VipFlag"].ToString());
+                                int PayType = int.Parse(selfDr["PayType"].ToString());
+                                string TradeDate = selfDr[9].ToString();
+                                decimal TradeAmount = decimal.Parse(selfDr[10].ToString());
+                                int TradeCount = int.Parse(selfDr[11].ToString());
+                                string TradeMonth = TradeDate.Substring(0, 6);
+                                BusinessTradeSummary selfStat = db.BusinessTradeSummary.FirstOrDefault(m => m.UserId == UserId && m.PartnerId == PartnerId && m.TradeMonth == TradeMonth && m.TradeDate == TradeDate && m.BrandId == BrandId && m.QueryCount == QrPayFlag && m.VipFlag == VipFlag && m.PayType == PayType);
+                                if (selfStat == null)
+                                {
+                                    selfStat = db.BusinessTradeSummary.Add(new BusinessTradeSummary()
+                                    {
+                                        UserId = UserId,
+                                        PartnerId = PartnerId,
+                                        TradeMonth = TradeMonth,
+                                        TradeDate = TradeDate,
+                                        BrandId = BrandId,
+                                        QueryCount = QrPayFlag,
+                                        VipFlag = VipFlag,
+                                        PayType = PayType,
+                                    }).Entity;
+                                    db.SaveChanges();
+                                }
+                                if (BankCardType == 0)
+                                {
+                                    if (MerHelpFlag == 1)
+                                    {
+                                        selfStat.HelpDirectDebitTradeAmt += TradeAmount;
+                                        if (CapFlag == 1)
+                                        {
+                                            selfStat.HelpDirectDebitCapTradeAmt += TradeAmount;
+                                            selfStat.HelpDirectDebitCapNum += TradeCount;
+                                        }
+                                    }
+                                    else
+                                    {
+                                        selfStat.NotHelpDirectDebitTradeAmt += TradeAmount;
+                                        if (CapFlag == 1)
+                                        {
+                                            selfStat.NotHelpDirectDebitCapTradeAmt += TradeAmount;
+                                            selfStat.NotHelpDirectDebitCapNum += TradeCount;
+                                        }
+                                    }
+                                }
+                                else if (BankCardType != 0)
+                                {
+                                    if (MerHelpFlag == 1)
+                                    {
+                                        selfStat.HelpDirectTradeAmt += TradeAmount;
+                                    }
+                                    else
+                                    {
+                                        selfStat.NotHelpDirectTradeAmt += TradeAmount;
+                                    }
+                                }
+                            }
+                            OtherMySqlConn.op("update TradeRecord set QueryCount=2 where Id in (" + ids.TrimEnd(',') + ")");
+                            function.WritePage("/TradeRecord/", "Id2.txt", startId);
+                        }
+                        db.SaveChanges();
+                    }
+                    tran.Commit();
+                }
+                catch (Exception ex)
+                {
+                    tran.Rollback();
+                    function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "实时执行企业交易额异常");
+                }
+            }
+            db.Dispose();
+            function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "实时执行企业交易额日志");
+        }
+
+
+
+        // 统计创客激活数
+        public void StartPosActNum()
+        {
+            Thread th = new Thread(StartPosActNumFor);
+            th.IsBackground = true;
+            th.Start();
+        }
+        public void StartPosActNumFor()
+        {
+            while (true)
+            {
+                if(DateTime.Now.Hour >= 3)
+                {
+                    StartPosActNumEverTime();
+                }
+                Thread.Sleep(120000);
+            }
+        }
+        public void StartPosActNumEverTime()
+        {
+            OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
+            function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), "实时执行企业激活数日志");
+            WebCMSEntities db = new WebCMSEntities();
+            try
+            {
+                DataTable idsDt = OtherMySqlConn.dtable("select Id from PosMachinesTwo where QueryCount=1 and BuyUserId in (select Id from Users where BusinessFlag=1) and ActivationState=1 and ActivationTime is not null and ActivationTime>='2022-08-01 00:00:00' and BuyUserId>0 limit 50");
+                if(idsDt.Rows.Count > 0)
+                {
+                    string ids = "";
+                    foreach (DataRow idsDr in idsDt.Rows)
+                    {
+                        ids += idsDr["Id"].ToString() + ",";
+                    }
+                    DataTable userDt = OtherMySqlConn.dtable("select Id,BuyUserId,BrandId,ActivationTime from PosMachinesTwo where Id in (" + ids.TrimEnd(',') + ")");
+                    if (userDt.Rows.Count > 0)
+                    {
+                        function.WriteLog("人数:" + userDt.Rows.Count + "\n\n", "实时执行企业激活数日志");
+                        foreach (DataRow userDr in userDt.Rows)
+                        {
+                            int Id = int.Parse(userDr["Id"].ToString());
+                            int UserId = int.Parse(userDr["BuyUserId"].ToString());
+                            int BrandId = int.Parse(userDr["BrandId"].ToString());
+                            string TradeDate = DateTime.Parse(userDr["ActivationTime"].ToString()).ToString("yyyyMMdd");
+                            int ActCount = 1;
+                            string TradeMonth = TradeDate.Substring(0, 6);
+                            string date = TradeDate.Substring(0, 4) + "-" + TradeDate.Substring(4, 2) + "-" + TradeDate.Substring(6, 2);
+                            string start = date + " 00:00:00";
+                            string end = DateTime.Parse(date).AddDays(1).ToString("yyyy-MM-dd") + " 00:00:00";
+                            Users user = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
+                            BusinessPartnerPos pos = db.BusinessPartnerPos.FirstOrDefault(m => m.PosId == Id) ?? new BusinessPartnerPos();
+                            int PartnerId = pos.PartnerId;
+                            BusinessActSummary selfStat = db.BusinessActSummary.FirstOrDefault(m => m.UserId == UserId && m.PartnerId == PartnerId && m.TradeMonth == TradeMonth && m.SeoKeyword == TradeDate && m.BrandId == BrandId);
+                            if (selfStat == null)
+                            {
+                                selfStat = db.BusinessActSummary.Add(new BusinessActSummary()
+                                {
+                                    UserId = UserId,
+                                    PartnerId = PartnerId,
+                                    TradeMonth = TradeMonth,
+                                    SeoKeyword = TradeDate,
+                                    BrandId = BrandId,
+                                }).Entity;
+                                db.SaveChanges();
+                            }
+                            selfStat.ActCount += ActCount;
+                        }
+                        db.SaveChanges();
+                        OtherMySqlConn.op("update PosMachinesTwo set QueryCount=2 where Id in (" + ids.TrimEnd(',') + ")");
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+                function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "实时执行企业激活数异常");
+            }
+            db.Dispose();
+            function.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "\n\n", "实时执行企业激活数日志");
+        }
+
+        
+
+
+
+
+        #region 判断品牌互斥条件,根据身份证号
+
+        public bool CheckRepeatByBrand(WebCMSEntities db, int MerchantId)
+        {
+            int check = db.PosMachinesTwo.Count(m => m.Status > -1 && m.BindMerchantId == MerchantId);
+
+            return false;
+        }
+
+        #endregion
+
+    }
+}

+ 28 - 0
PxcModels/BusinessActSummary.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class BusinessActSummary
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        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; }
+        public int UserId { get; set; }
+        public string TradeDate { get; set; }
+        public string Remark { get; set; }
+        public int ActCount { get; set; }
+        public int BrandId { get; set; }
+        public string TradeMonth { get; set; }
+        public int PartnerId { get; set; }
+    }
+}

+ 26 - 0
PxcModels/BusinessPartner.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class BusinessPartner
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        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; }
+        public int UserId { get; set; }
+        public decimal ThisMonthTrade { get; set; }
+        public string LoginPassword { get; set; }
+        public string Name { get; set; }
+        public string Mobile { get; set; }
+    }
+}

+ 25 - 0
PxcModels/BusinessPartnerMerchant.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class BusinessPartnerMerchant
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        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; }
+        public string MerNo { get; set; }
+        public int MerchantId { get; set; }
+        public int PartnerId { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 25 - 0
PxcModels/BusinessPartnerPos.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class BusinessPartnerPos
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        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; }
+        public string PosSn { get; set; }
+        public int PosId { get; set; }
+        public int PartnerId { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 67 - 0
PxcModels/BusinessTradeSummary.cs

@@ -0,0 +1,67 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class BusinessTradeSummary
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        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; }
+        public int UserId { get; set; }
+        public int PayType { get; set; }
+        public int VipFlag { get; set; }
+        public int TopUserId { get; set; }
+        public decimal HelpNonDirectNonQrDebitTradeAmt { get; set; }
+        public decimal HelpDirectNonQrDebitTradeAmt { get; set; }
+        public decimal HelpNonDirectQrDebitTradeAmt { get; set; }
+        public decimal HelpDirectQrDebitTradeAmt { get; set; }
+        public decimal HelpNonDirectDebitCapNum { get; set; }
+        public decimal HelpNonDirectDebitCapTradeAmt { get; set; }
+        public decimal HelpNonDirectDebitTradeAmt { get; set; }
+        public decimal HelpDirectDebitCapNum { get; set; }
+        public decimal HelpDirectDebitCapTradeAmt { get; set; }
+        public decimal HelpDirectDebitTradeAmt { get; set; }
+        public decimal HelpNonDirectNonQrCreditTradeAmt { get; set; }
+        public decimal HelpDirectNonQrCreditTradeAmt { get; set; }
+        public decimal HelpNonDirectQrCreditTradeAmt { get; set; }
+        public decimal HelpDirectQrCreditTradeAmt { get; set; }
+        public decimal HelpNonDirectCreditTradeAmt { get; set; }
+        public decimal HelpDirectCreditTradeAmt { get; set; }
+        public decimal HelpNonDirectTradeAmt { get; set; }
+        public decimal HelpDirectTradeAmt { get; set; }
+        public decimal NotHelpNonDirectNonQrDebitTradeAmt { get; set; }
+        public decimal NotHelpDirectNonQrDebitTradeAmt { get; set; }
+        public decimal NotHelpNonDirectQrDebitTradeAmt { get; set; }
+        public decimal NotHelpDirectQrDebitTradeAmt { get; set; }
+        public int NotHelpNonDirectDebitCapNum { get; set; }
+        public decimal NotHelpNonDirectDebitCapTradeAmt { get; set; }
+        public decimal NotHelpNonDirectDebitTradeAmt { get; set; }
+        public int NotHelpDirectDebitCapNum { get; set; }
+        public decimal NotHelpDirectDebitCapTradeAmt { get; set; }
+        public decimal NotHelpDirectDebitTradeAmt { get; set; }
+        public decimal NotHelpNonDirectNonQrCreditTradeAmt { get; set; }
+        public decimal NotHelpDirectNonQrCreditTradeAmt { get; set; }
+        public decimal NotHelpNonDirectQrCreditTradeAmt { get; set; }
+        public decimal NotHelpDirectQrCreditTradeAmt { get; set; }
+        public decimal NotHelpNonDirectCreditTradeAmt { get; set; }
+        public decimal NotHelpDirectCreditTradeAmt { get; set; }
+        public decimal NotHelpNonDirectTradeAmt { get; set; }
+        public decimal NotHelpDirectTradeAmt { get; set; }
+        public string MgrName { get; set; }
+        public string MgrNo { get; set; }
+        public int BrandId { get; set; }
+        public string TradeMonth { get; set; }
+        public string TradeDate { get; set; }
+        public int PartnerId { get; set; }
+    }
+}

+ 28 - 0
PxcModels/LeaderReserveRecord.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class LeaderReserveRecord
+    {
+        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 ChangeType { get; set; }
+        public int OrderId { get; set; }
+        public int SourceUserId { get; set; }
+        public string Remark { get; set; }
+        public decimal AfterAmt { get; set; }
+        public decimal BeforeAmt { get; set; }
+        public decimal ChangeAmt { get; set; }
+        public string TradeDate { get; set; }
+        public string TradeMonth { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 1 - 0
PxcModels/Orders.cs

@@ -63,5 +63,6 @@ namespace MySystem.PxcModels
         public string RealName { get; set; }
         public string OrderNo { get; set; }
         public int UserId { get; set; }
+        public int ParentOrderId { get; set; }
     }
 }

+ 1 - 0
PxcModels/PosMachinesTwo.cs

@@ -45,5 +45,6 @@ namespace MySystem.PxcModels
         public int BindingState { get; set; }
         public int LeaderUserId { get; set; }
         public int PreUserId { get; set; }
+        public int IsFirst { get; set; }
     }
 }

+ 21 - 0
PxcModels/RecommendDirectUser.cs

@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class RecommendDirectUser
+    {
+        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 TradeMonth { get; set; }
+        public int DirectUserId { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 22 - 0
PxcModels/RecommendTradeSummary.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class RecommendTradeSummary
+    {
+        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 decimal TradeAmount { get; set; }
+        public string TradeMonth { get; set; }
+        public string PosSn { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 10 - 0
PxcModels/SpOrderNos.cs

@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class SpOrderNos
+    {
+        public string OrderNo { get; set; }
+    }
+}

+ 2 - 0
PxcModels/StoreHouse.cs

@@ -37,5 +37,7 @@ namespace MySystem.PxcModels
         public int UserId { get; set; }
         public string StoreName { get; set; }
         public string StoreNo { get; set; }
+        public DateTime? AuthDate { get; set; }
+        public ulong AuthFlag { get; set; }
     }
 }

+ 25 - 0
PxcModels/StoreHouseAmountRecord.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class StoreHouseAmountRecord
+    {
+        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 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; }
+    }
+}

+ 8 - 15
PxcModels/StoreMachineApply.cs

@@ -9,26 +9,19 @@ 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; }
-        public DateTime? ApplyTime { get; set; }
-        public int? BrandId { get; set; }
+        public int UserId { get; set; }
+        public string SendSn { get; set; }
+        public string ErpCode { get; set; }
+        public string SendMode { get; set; }
+        public decimal UseAmount { get; set; }
+        public int SendNum { get; set; }
+        public int ApplyNum { get; set; }
         public string ApplyNo { get; set; }
-        public int? ApplyNum { get; set; }
-        public int? SendNum { get; set; }
-        public int? BoxNum { get; set; }
-        public int? LastApply { get; set; }
-        public int? MaxApply { get; set; }
-        public int? ActualApply { get; set; }
-        public int? UserId { get; set; }
-        public int? StoreId { get; set; }
-        public int? OrderId { get; set; }
-        public string SwapSnExpand { get; set; }
+        public int BrandId { get; set; }
     }
 }

+ 4 - 0
PxcModels/UserAccount.cs

@@ -32,5 +32,9 @@ namespace MySystem.PxcModels
         public int UserProperty { get; set; }
         public int UserType { get; set; }
         public int UserId { get; set; }
+        public decimal TempAmount { get; set; }
+        public decimal FixedAmount { get; set; }
+        public decimal LeaderReserve { get; set; }
+        public decimal ValidAmount { get; set; }
     }
 }

+ 3 - 0
PxcModels/Users.cs

@@ -82,5 +82,8 @@ namespace MySystem.PxcModels
         public int CashStatus { get; set; }
         public string CashNote { get; set; }
         public decimal ThisMonthTrade { get; set; }
+        public int LeaderLevel { get; set; }
+        public decimal ValidAmount { get; set; }
+        public int BusinessFlag { get; set; }
     }
 }

+ 637 - 54
PxcModels/WebCMSEntities.cs

@@ -29,6 +29,11 @@ namespace MySystem.PxcModels
         public virtual DbSet<AppVideo> AppVideo { get; set; }
         public virtual DbSet<AppVideoList> AppVideoList { get; set; }
         public virtual DbSet<BankInfo> BankInfo { get; set; }
+        public virtual DbSet<BusinessActSummary> BusinessActSummary { get; set; }
+        public virtual DbSet<BusinessPartner> BusinessPartner { get; set; }
+        public virtual DbSet<BusinessPartnerMerchant> BusinessPartnerMerchant { get; set; }
+        public virtual DbSet<BusinessPartnerPos> BusinessPartnerPos { get; set; }
+        public virtual DbSet<BusinessTradeSummary> BusinessTradeSummary { get; set; }
         public virtual DbSet<Col> Col { get; set; }
         public virtual DbSet<ConsumerOpenIds> ConsumerOpenIds { get; set; }
         public virtual DbSet<ConsumerOrderForNo> ConsumerOrderForNo { get; set; }
@@ -48,6 +53,7 @@ namespace MySystem.PxcModels
         public virtual DbSet<KqProductOrgs> KqProductOrgs { get; set; }
         public virtual DbSet<KqProductRuleSet> KqProductRuleSet { get; set; }
         public virtual DbSet<KqProducts> KqProducts { get; set; }
+        public virtual DbSet<LeaderReserveRecord> LeaderReserveRecord { get; set; }
         public virtual DbSet<MachineApply> MachineApply { get; set; }
         public virtual DbSet<MachineApplyDetail> MachineApplyDetail { get; set; }
         public virtual DbSet<MachineChange> MachineChange { get; set; }
@@ -138,15 +144,19 @@ namespace MySystem.PxcModels
         public virtual DbSet<PullNewAct> PullNewAct { get; set; }
         public virtual DbSet<PullNewDetail> PullNewDetail { get; set; }
         public virtual DbSet<PullnewSummary> PullnewSummary { get; set; }
+        public virtual DbSet<RecommendDirectUser> RecommendDirectUser { get; set; }
+        public virtual DbSet<RecommendTradeSummary> RecommendTradeSummary { get; set; }
         public virtual DbSet<RightDic> RightDic { get; set; }
         public virtual DbSet<ServiceCenter> ServiceCenter { get; set; }
         public virtual DbSet<SetMerchantTypeRecord> SetMerchantTypeRecord { get; set; }
         public virtual DbSet<SmallStoreHouse> SmallStoreHouse { get; set; }
+        public virtual DbSet<SpOrderNos> SpOrderNos { get; set; }
         public virtual DbSet<StoreBalance> StoreBalance { get; set; }
         public virtual DbSet<StoreChangeHistory> StoreChangeHistory { get; set; }
         public virtual DbSet<StoreForCode> StoreForCode { get; set; }
         public virtual DbSet<StoreForName> StoreForName { get; set; }
         public virtual DbSet<StoreHouse> StoreHouse { get; set; }
+        public virtual DbSet<StoreHouseAmountRecord> StoreHouseAmountRecord { get; set; }
         public virtual DbSet<StoreMachineApply> StoreMachineApply { get; set; }
         public virtual DbSet<StoreMallOrderSummary> StoreMallOrderSummary { get; set; }
         public virtual DbSet<StoreSnActivateSummary> StoreSnActivateSummary { get; set; }
@@ -1201,6 +1211,384 @@ namespace MySystem.PxcModels
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<BusinessActSummary>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ActCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.BrandId).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.PartnerId).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.Remark)
+                    .HasColumnType("varchar(64)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                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.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.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<BusinessPartner>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.LoginPassword)
+                    .HasColumnType("varchar(32)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Mobile)
+                    .HasColumnType("varchar(15)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Name)
+                    .HasColumnType("varchar(30)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                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.ThisMonthTrade).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<BusinessPartnerMerchant>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.MerNo)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.MerchantId).HasColumnType("int(11)");
+
+                entity.Property(e => e.PartnerId).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.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<BusinessPartnerPos>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.PartnerId).HasColumnType("int(11)");
+
+                entity.Property(e => e.PosId).HasColumnType("int(11)");
+
+                entity.Property(e => e.PosSn)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                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.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<BusinessTradeSummary>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.BrandId).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.HelpDirectCreditTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.HelpDirectDebitCapNum).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.HelpDirectDebitCapTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.HelpDirectDebitTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.HelpDirectNonQrCreditTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.HelpDirectNonQrDebitTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.HelpDirectQrCreditTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.HelpDirectQrDebitTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.HelpDirectTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.HelpNonDirectCreditTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.HelpNonDirectDebitCapNum).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.HelpNonDirectDebitCapTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.HelpNonDirectDebitTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.HelpNonDirectNonQrCreditTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.HelpNonDirectNonQrDebitTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.HelpNonDirectQrCreditTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.HelpNonDirectQrDebitTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.HelpNonDirectTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.MgrName)
+                    .HasColumnType("varchar(32)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.MgrNo)
+                    .HasColumnType("varchar(16)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.NotHelpDirectCreditTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.NotHelpDirectDebitCapNum).HasColumnType("int(11)");
+
+                entity.Property(e => e.NotHelpDirectDebitCapTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.NotHelpDirectDebitTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.NotHelpDirectNonQrCreditTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.NotHelpDirectNonQrDebitTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.NotHelpDirectQrCreditTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.NotHelpDirectQrDebitTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.NotHelpDirectTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.NotHelpNonDirectCreditTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.NotHelpNonDirectDebitCapNum).HasColumnType("int(11)");
+
+                entity.Property(e => e.NotHelpNonDirectDebitCapTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.NotHelpNonDirectDebitTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.NotHelpNonDirectNonQrCreditTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.NotHelpNonDirectNonQrDebitTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.NotHelpNonDirectQrCreditTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.NotHelpNonDirectQrDebitTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.NotHelpNonDirectTradeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.PartnerId).HasColumnType("int(11)");
+
+                entity.Property(e => e.PayType).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.TopUserId).HasColumnType("int(11)");
+
+                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.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+
+                entity.Property(e => e.VipFlag).HasColumnType("int(11)");
+            });
+
             modelBuilder.Entity<Col>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -2514,6 +2902,65 @@ namespace MySystem.PxcModels
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<LeaderReserveRecord>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.AfterAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.BeforeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.ChangeAmt).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.ChangeType).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.OrderId).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.Remark)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                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.SourceUserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                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<MachineApply>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -6046,6 +6493,9 @@ namespace MySystem.PxcModels
 
             modelBuilder.Entity<Orders>(entity =>
             {
+                entity.HasIndex(e => e.StoreId)
+                    .HasName("OrdersStoreIdIndex");
+
                 entity.Property(e => e.Id).HasColumnType("int(11)");
 
                 entity.Property(e => e.ActualPay).HasColumnType("decimal(18,2)");
@@ -6109,6 +6559,8 @@ namespace MySystem.PxcModels
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.ParentOrderId).HasColumnType("int(11)");
+
                 entity.Property(e => e.PayDate).HasColumnType("datetime");
 
                 entity.Property(e => e.PayMode).HasColumnType("int(11)");
@@ -6790,6 +7242,8 @@ namespace MySystem.PxcModels
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.IsFirst).HasColumnType("int(11)");
+
                 entity.Property(e => e.IsPurchase).HasColumnType("int(11)");
 
                 entity.Property(e => e.IsVip)
@@ -9338,6 +9792,9 @@ namespace MySystem.PxcModels
 
             modelBuilder.Entity<PullnewSummary>(entity =>
             {
+                entity.HasIndex(e => new { e.UserId, e.StatMonth, e.StatDate, e.SeoTitle })
+                    .HasName("PullnewSummaryIndex");
+
                 entity.Property(e => e.Id).HasColumnType("int(11)");
 
                 entity.Property(e => e.BizSnDelayDay).HasColumnType("int(11)");
@@ -9405,6 +9862,89 @@ namespace MySystem.PxcModels
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<RecommendDirectUser>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.DirectUserId).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.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<RecommendTradeSummary>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.PosSn)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                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.TradeAmount).HasColumnType("decimal(18,2)");
+
+                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<RightDic>(entity =>
             {
                 entity.Property(e => e.Id)
@@ -9641,6 +10181,17 @@ namespace MySystem.PxcModels
                 entity.Property(e => e.UserId).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<SpOrderNos>(entity =>
+            {
+                entity.HasKey(e => e.OrderNo)
+                    .HasName("PRIMARY");
+
+                entity.Property(e => e.OrderNo)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+            });
+
             modelBuilder.Entity<StoreBalance>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -9859,6 +10410,12 @@ namespace MySystem.PxcModels
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.AuthDate).HasColumnType("datetime");
+
+                entity.Property(e => e.AuthFlag)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'");
+
                 entity.Property(e => e.BrandId)
                     .HasColumnType("varchar(30)")
                     .HasCharSet("utf8")
@@ -9960,60 +10517,83 @@ namespace MySystem.PxcModels
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
-            modelBuilder.Entity<StoreMachineApply>(entity =>
+            modelBuilder.Entity<StoreHouseAmountRecord>(entity =>
             {
-                entity.HasComment("机具申请记录表");
-
                 entity.Property(e => e.Id).HasColumnType("int(11)");
 
-                entity.Property(e => e.ActualApply)
-                    .HasColumnType("int(11)")
-                    .HasComment("实际申请台数");
+                entity.Property(e => e.AfterAmount).HasColumnType("decimal(18,2)");
 
-                entity.Property(e => e.ApplyNo)
-                    .HasColumnType("varchar(50)")
-                    .HasComment("申请单号")
-                    .HasCharSet("latin1")
-                    .HasCollation("latin1_swedish_ci");
+                entity.Property(e => e.AmountType).HasColumnType("int(11)");
 
-                entity.Property(e => e.ApplyNum)
-                    .HasColumnType("int(11)")
-                    .HasComment("申请箱数");
+                entity.Property(e => e.ApplyId).HasColumnType("int(11)");
 
-                entity.Property(e => e.ApplyTime).HasColumnType("datetime");
+                entity.Property(e => e.BeforeAmount).HasColumnType("decimal(18,2)");
 
-                entity.Property(e => e.BoxNum)
-                    .HasColumnType("int(11)")
-                    .HasComment("每箱台数");
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
 
-                entity.Property(e => e.BrandId)
-                    .HasColumnType("int(11)")
-                    .HasComment("产品Id");
+                entity.Property(e => e.OperateType).HasColumnType("int(11)");
 
-                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
 
-                entity.Property(e => e.CreateMan)
+                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.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UseAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<StoreMachineApply>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ApplyNo)
                     .HasColumnType("varchar(50)")
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
-                entity.Property(e => e.LastApply)
-                    .HasColumnType("int(11)")
-                    .HasComment("上月申请台数");
+                entity.Property(e => e.ApplyNum).HasColumnType("int(11)");
 
-                entity.Property(e => e.MaxApply)
-                    .HasColumnType("int(11)")
-                    .HasComment("最多申请台数");
+                entity.Property(e => e.BrandId).HasColumnType("int(11)");
 
-                entity.Property(e => e.OrderId)
-                    .HasColumnType("int(11)")
-                    .HasComment("订单Id");
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.ErpCode)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
 
                 entity.Property(e => e.QueryCount).HasColumnType("int(11)");
 
-                entity.Property(e => e.SendNum)
-                    .HasColumnType("int(11)")
-                    .HasComment("发货箱数");
+                entity.Property(e => e.SendMode)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SendNum).HasColumnType("int(11)");
+
+                entity.Property(e => e.SendSn)
+                    .HasColumnType("mediumtext")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
 
                 entity.Property(e => e.SeoDescription)
                     .HasColumnType("varchar(500)")
@@ -10034,28 +10614,11 @@ namespace MySystem.PxcModels
 
                 entity.Property(e => e.Status).HasColumnType("int(11)");
 
-                entity.Property(e => e.StoreId)
-                    .HasColumnType("int(11)")
-                    .HasComment("仓库Id");
-
-                entity.Property(e => e.SwapSnExpand)
-                    .HasColumnType("mediumtext")
-                    .HasComment("已发货机具SN号")
-                    .HasCharSet("utf8")
-                    .HasCollation("utf8_general_ci");
-
                 entity.Property(e => e.UpdateDate).HasColumnType("datetime");
 
-                entity.Property(e => e.UpdateMan)
-                    .HasColumnType("varchar(50)")
-                    .HasCharSet("utf8")
-                    .HasCollation("utf8_general_ci");
-
-                entity.Property(e => e.UserId)
-                    .HasColumnType("int(11)")
-                    .HasComment("创客Id");
+                entity.Property(e => e.UseAmount).HasColumnType("decimal(18,2)");
 
-                entity.Property(e => e.Version).HasColumnType("int(11)");
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
             });
 
             modelBuilder.Entity<StoreMallOrderSummary>(entity =>
@@ -11309,6 +11872,9 @@ namespace MySystem.PxcModels
 
             modelBuilder.Entity<TradeDaySummary>(entity =>
             {
+                entity.HasIndex(e => new { e.UserId, e.TradeMonth, e.TradeDate, e.BrandId, e.QueryCount, e.VipFlag, e.PayType, e.SeoTitle })
+                    .HasName("TradeDaySummaryIndex");
+
                 entity.Property(e => e.Id).HasColumnType("int(11)");
 
                 entity.Property(e => e.BrandId).HasColumnType("int(11)");
@@ -11744,8 +12310,12 @@ namespace MySystem.PxcModels
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.FixedAmount).HasColumnType("decimal(18,2)");
+
                 entity.Property(e => e.FreezeAmount).HasColumnType("decimal(18,2)");
 
+                entity.Property(e => e.LeaderReserve).HasColumnType("decimal(18,2)");
+
                 entity.Property(e => e.LockStatus).HasColumnType("int(11)");
 
                 entity.Property(e => e.QueryCount).HasColumnType("int(11)");
@@ -11775,6 +12345,8 @@ namespace MySystem.PxcModels
 
                 entity.Property(e => e.TeamTotalServiceProfit).HasColumnType("decimal(18,2)");
 
+                entity.Property(e => e.TempAmount).HasColumnType("decimal(18,2)");
+
                 entity.Property(e => e.TotalAmount).HasColumnType("decimal(18,2)");
 
                 entity.Property(e => e.TotalOverProfit).HasColumnType("decimal(18,2)");
@@ -11796,6 +12368,8 @@ namespace MySystem.PxcModels
 
                 entity.Property(e => e.UserType).HasColumnType("int(11)");
 
+                entity.Property(e => e.ValidAmount).HasColumnType("decimal(18,2)");
+
                 entity.Property(e => e.Version).HasColumnType("int(11)");
 
                 entity.Property(e => e.WithdrawAmount).HasColumnType("decimal(18,2)");
@@ -14235,6 +14809,9 @@ namespace MySystem.PxcModels
 
             modelBuilder.Entity<UserTradeMonthSummary>(entity =>
             {
+                entity.HasIndex(e => new { e.UserId, e.BrandId, e.TradeMonth, e.SeoKeyword, e.SeoTitle })
+                    .HasName("UserTradeMonthSummaryIndex");
+
                 entity.Property(e => e.Id).HasColumnType("int(11)");
 
                 entity.Property(e => e.ActiveBuddyMerStatus).HasColumnType("int(11)");
@@ -14351,6 +14928,8 @@ namespace MySystem.PxcModels
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.BusinessFlag).HasColumnType("int(11)");
+
                 entity.Property(e => e.CarIds)
                     .HasColumnType("varchar(100)")
                     .HasCharSet("utf8")
@@ -14444,6 +15023,8 @@ namespace MySystem.PxcModels
                     .HasColumnType("bit(1)")
                     .HasDefaultValueSql("b'0'");
 
+                entity.Property(e => e.LeaderLevel).HasColumnType("int(11)");
+
                 entity.Property(e => e.LockStatus)
                     .HasColumnType("bit(1)")
                     .HasDefaultValueSql("b'0'");
@@ -14599,6 +15180,8 @@ namespace MySystem.PxcModels
 
                 entity.Property(e => e.UserType).HasColumnType("int(11)");
 
+                entity.Property(e => e.ValidAmount).HasColumnType("decimal(18,2)");
+
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });