Bladeren bron

每月发放分润,链接数据库模式调整

lichunlei 3 jaren geleden
bovenliggende
commit
dad6eafe4d

+ 14 - 14
AppStart/Helper/SycnProfitServiceV2.cs

@@ -100,12 +100,12 @@ namespace MySystem
         private void DoTradeProfit2(int BrandId, string date, string SysUserName)
         {
             WebCMSEntities db = new WebCMSEntities();
-            OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
+            string conn = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
             int startid = 0;
             bool op = true;
             while(op)
             {
-                DataTable dt = OtherMySqlConn.dtable("select Id,UserId,DirectFlag,ProfitAmount from ProfitRecord where Id>" + startid + " and BrandId=" + BrandId + " and SeoTitle='" + date + "' and Version=0 and UserId>0 order by Id limit 200");
+                DataTable dt = CustomerSqlConn.dtable("select Id,UserId,DirectFlag,ProfitAmount from ProfitRecord where Id>" + startid + " and BrandId=" + BrandId + " and SeoTitle='" + date + "' and Version=0 and UserId>0 order by Id limit 200", conn);
                 if(dt.Rows.Count > 0)
                 {
                     function.WriteLog("分润:" + BrandId + ":" + dt.Rows.Count, "同步分润数据");
@@ -170,7 +170,7 @@ namespace MySystem
                     op = false;
                 }
             }
-            OtherMySqlConn.dtable("update ProfitRecord set Version=1 where BrandId=" + BrandId + " and SeoTitle='" + date + "' and Version=0 and UserId>0");
+            CustomerSqlConn.op("update ProfitRecord set Version=1 where BrandId=" + BrandId + " and SeoTitle='" + date + "' and Version=0 and UserId>0", conn);
             db.Dispose();
         }
 
@@ -179,7 +179,7 @@ namespace MySystem
         private void DoSubsidyProfit(int BrandId, string date)
         {
             WebCMSEntities db = new WebCMSEntities();
-            OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
+            string conn = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
 
             string StartId = function.ReadInstance("/PublicParams/ProfitSubsidyDetailId" + date + ".txt");
             if(string.IsNullOrEmpty(StartId))
@@ -187,9 +187,9 @@ namespace MySystem
                 StartId = "0";
             }
             
-            OtherMySqlConn.op("insert into SubsidyRecord (CreateDate,SeoKeyword,SeoTitle,ParentNav,BrandId,UserId,ProfitAmount) select now(),'root','" + date + "',(select ParentNav from Users where Id=p.SubsidyUserId)," + BrandId + ",SubsidyUserId,sum(SubsidyProfitRate) from ProfitSubsidyDetail p where Id>=" + StartId + " and Status=0 and BrandId=" + BrandId + " and TradeMonth='" + date + "' GROUP BY SubsidyUserId");
+            CustomerSqlConn.op("insert into SubsidyRecord (CreateDate,SeoKeyword,SeoTitle,ParentNav,BrandId,UserId,ProfitAmount) select now(),'root','" + date + "',(select ParentNav from Users where Id=p.SubsidyUserId)," + BrandId + ",SubsidyUserId,sum(SubsidyProfitRate) from ProfitSubsidyDetail p where Id>=" + StartId + " and Status=0 and BrandId=" + BrandId + " and TradeMonth='" + date + "' GROUP BY SubsidyUserId", conn);
 
-            DataTable dt = OtherMySqlConn.dtable("select SubsidyUserId,sum(SubsidyProfitRate) from ProfitSubsidyDetail where Id>=" + StartId + " and Status=0 and BrandId=" + BrandId + " and TradeMonth='" + date + "' GROUP BY SubsidyUserId");
+            DataTable dt = CustomerSqlConn.dtable("select SubsidyUserId,sum(SubsidyProfitRate) from ProfitSubsidyDetail where Id>=" + StartId + " and Status=0 and BrandId=" + BrandId + " and TradeMonth='" + date + "' GROUP BY SubsidyUserId", conn);
             function.WriteLog("补贴:" + BrandId + ":" + dt.Rows.Count, "同步补贴数据");
             int index = 0;
             foreach (DataRow dr in dt.Rows)
@@ -207,7 +207,7 @@ namespace MySystem
                     function.WriteLog(DateTime.Now.ToString() + "\n" + UserId + "," + ProfitMoney + "\n" + ex.ToString(), "同步到补贴异常");
                 }
             }
-            OtherMySqlConn.dtable("update ProfitSubsidyDetail set Status=1 where Id>=" + StartId + " and Status=0 and BrandId=" + BrandId + " and TradeMonth='" + date + "'");
+            CustomerSqlConn.op("update ProfitSubsidyDetail set Status=1 where Id>=" + StartId + " and Status=0 and BrandId=" + BrandId + " and TradeMonth='" + date + "'", conn);
                 
             db.Dispose();
             dt.Dispose();
@@ -219,12 +219,12 @@ namespace MySystem
         private void DoSubsidyProfit2(int BrandId, string date)
         {
             WebCMSEntities db = new WebCMSEntities();
-            OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
+            string conn = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
             int startid = 0;
             bool op = true;
             while(op)
             {
-                DataTable dt = OtherMySqlConn.dtable("select Id,UserId,ProfitAmount from SubsidyRecord where Id>" + startid + " and BrandId=" + BrandId + " and SeoTitle='" + date + "' and Status=0 and UserId>0 order by Id limit 200");
+                DataTable dt = CustomerSqlConn.dtable("select Id,UserId,ProfitAmount from SubsidyRecord where Id>" + startid + " and BrandId=" + BrandId + " and SeoTitle='" + date + "' and Status=0 and UserId>0 order by Id limit 200", conn);
                 if(dt.Rows.Count > 0)
                 {
                     function.WriteLog("补贴:" + BrandId + ":" + dt.Rows.Count, "同步补贴数据");
@@ -289,7 +289,7 @@ namespace MySystem
                     op = false;
                 }
             }
-            OtherMySqlConn.dtable("update SubsidyRecord set Status=1 where BrandId=" + BrandId + " and SeoTitle='" + date + "' and Status=0 and UserId>0");
+            CustomerSqlConn.op("update SubsidyRecord set Status=1 where BrandId=" + BrandId + " and SeoTitle='" + date + "' and Status=0 and UserId>0", conn);
 
             db.Dispose();
         }
@@ -299,8 +299,8 @@ namespace MySystem
 
         public void DoHelpProfit(string month)
         {
-            OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
-            OtherMySqlConn.dtable("update HelpProfitReward set Status=1 where Status=0 and TradeMonth='" + month + "'");
+            string conn = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
+            CustomerSqlConn.dtable("update HelpProfitReward set Status=1 where Status=0 and TradeMonth='" + month + "'", conn);
         }
 
         #endregion
@@ -310,9 +310,9 @@ namespace MySystem
         public void DoHelpProfit2(string month)
         {
             WebCMSEntities db = new WebCMSEntities();
-            OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
+            string conn = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
             
-            DataTable dt = OtherMySqlConn.dtable("select UserId,RewardType,sum(CreditRewardAmount),sum(CreditTradeAmt) from HelpProfitReward where Status=1 and TradeMonth='" + month + "' GROUP BY UserId,RewardType");
+            DataTable dt = CustomerSqlConn.dtable("select UserId,RewardType,sum(CreditRewardAmount),sum(CreditTradeAmt) from HelpProfitReward where Status=1 and TradeMonth='" + month + "' GROUP BY UserId,RewardType", conn);
             function.WriteLog("数量:" + dt.Rows.Count, "同步助力宝分润数据");
             int index = 0;
             foreach (DataRow dr in dt.Rows)

+ 1 - 0
Models/Orders.cs

@@ -64,5 +64,6 @@ namespace MySystem.Models
         public string OrderNo { get; set; }
         public int UserId { get; set; }
         public int ParentOrderId { get; set; }
+        public int OpId { get; set; }
     }
 }

+ 1 - 0
Models/PosCouponRecord.cs

@@ -19,5 +19,6 @@ namespace MySystem.Models
         public int ToUserId { get; set; }
         public int FromUserId { get; set; }
         public int PosCouponId { get; set; }
+        public int OpId { get; set; }
     }
 }

+ 6 - 0
Models/Users.cs

@@ -88,5 +88,11 @@ namespace MySystem.Models
         public string DeviceType { get; set; }
         public DateTime? HelpProfitAgreeDate { get; set; }
         public ulong HelpProfitAgree { get; set; }
+        public int ThisMonthSend { get; set; }
+        public int StoreStock { get; set; }
+        public DateTime? CreateStoreDate { get; set; }
+        public ulong IsSign { get; set; }
+        public DateTime? SignDate { get; set; }
+        public string SignPic { get; set; }
     }
 }

+ 21 - 0
Models/WebCMSEntities.cs

@@ -7836,6 +7836,8 @@ namespace MySystem.Models
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
                 entity.Property(e => e.OrderNo)
                     .HasColumnType("varchar(30)")
                     .HasCharSet("utf8")
@@ -8257,6 +8259,8 @@ namespace MySystem.Models
 
                 entity.Property(e => e.FromUserId).HasColumnType("int(11)");
 
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
                 entity.Property(e => e.OrderNo)
                     .HasColumnType("varchar(50)")
                     .HasCharSet("utf8")
@@ -17753,6 +17757,8 @@ namespace MySystem.Models
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.CreateStoreDate).HasColumnType("datetime");
+
                 entity.Property(e => e.DeviceId)
                     .HasColumnType("varchar(128)")
                     .HasCharSet("utf8")
@@ -17805,6 +17811,10 @@ namespace MySystem.Models
                     .HasColumnType("bit(1)")
                     .HasDefaultValueSql("b'0'");
 
+                entity.Property(e => e.IsSign)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'");
+
                 entity.Property(e => e.LeaderLevel).HasColumnType("int(11)");
 
                 entity.Property(e => e.LockStatus)
@@ -17933,20 +17943,31 @@ namespace MySystem.Models
 
                 entity.Property(e => e.Sex).HasColumnType("int(11)");
 
+                entity.Property(e => e.SignDate).HasColumnType("datetime");
+
                 entity.Property(e => e.SignImgUrl)
                     .HasColumnType("varchar(200)")
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.SignPic)
+                    .HasColumnType("varchar(200)")
+                    .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.StoreStock).HasColumnType("int(11)");
+
                 entity.Property(e => e.Tags)
                     .HasColumnType("varchar(200)")
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.ThisMonthSend).HasColumnType("int(11)");
+
                 entity.Property(e => e.ThisMonthTrade).HasColumnType("decimal(18,2)");
 
                 entity.Property(e => e.UpdateDate).HasColumnType("datetime");

+ 20 - 0
OpModels/PosCoupons.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class PosCoupons
+    {
+        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 PosCouponId { get; set; }
+        public int OpId { get; set; }
+    }
+}

+ 21 - 0
OpModels/PosMachines.cs

@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class PosMachines
+    {
+        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 PosId { get; set; }
+        public int OpId { get; set; }
+        public int BrandId { get; set; }
+    }
+}

+ 22 - 0
OpModels/StoreActMerDaySummary.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class StoreActMerDaySummary
+    {
+        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 ActCount { get; set; }
+        public int BrandId { get; set; }
+        public string TradeDate { get; set; }
+        public int OpId { get; set; }
+    }
+}

+ 22 - 0
OpModels/StoreActMerMonthSummary.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class StoreActMerMonthSummary
+    {
+        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 ActCount { get; set; }
+        public int BrandId { get; set; }
+        public string TradeMonth { get; set; }
+        public int OpId { get; set; }
+    }
+}

+ 27 - 0
OpModels/StoreMachineApply.cs

@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class StoreMachineApply
+    {
+        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 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 BrandId { get; set; }
+    }
+}

+ 22 - 0
OpModels/StoreSendDaySummary.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class StoreSendDaySummary
+    {
+        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 SendCount { get; set; }
+        public int BrandId { get; set; }
+        public string TradeDate { get; set; }
+        public int OpId { get; set; }
+    }
+}

+ 22 - 0
OpModels/StoreSendMonthSummary.cs

@@ -0,0 +1,22 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.OpModels
+{
+    public partial class StoreSendMonthSummary
+    {
+        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 SendCount { get; set; }
+        public int BrandId { get; set; }
+        public string TradeMonth { get; set; }
+        public int OpId { get; set; }
+    }
+}

+ 1 - 0
OpModels/SysAdmin.cs

@@ -30,5 +30,6 @@ namespace MySystem.OpModels
         public string RealName { get; set; }
         public string Password { get; set; }
         public string AdminName { get; set; }
+        public int TotalMachineCount { get; set; }
     }
 }

+ 306 - 3
OpModels/WebCMSEntities.cs

@@ -39,11 +39,18 @@ namespace MySystem.OpModels
         public virtual DbSet<PosCouponMonthSummary> PosCouponMonthSummary { get; set; }
         public virtual DbSet<PosCouponOrders> PosCouponOrders { get; set; }
         public virtual DbSet<PosCouponRecord> PosCouponRecord { get; set; }
+        public virtual DbSet<PosCoupons> PosCoupons { get; set; }
+        public virtual DbSet<PosMachines> PosMachines { get; set; }
         public virtual DbSet<PublicAccountSet> PublicAccountSet { get; set; }
         public virtual DbSet<RightDic> RightDic { get; set; }
         public virtual DbSet<SendDaySummary> SendDaySummary { get; set; }
         public virtual DbSet<SendMonthSummary> SendMonthSummary { get; set; }
+        public virtual DbSet<StoreActMerDaySummary> StoreActMerDaySummary { get; set; }
+        public virtual DbSet<StoreActMerMonthSummary> StoreActMerMonthSummary { get; set; }
         public virtual DbSet<StoreForOperate> StoreForOperate { get; set; }
+        public virtual DbSet<StoreMachineApply> StoreMachineApply { get; set; }
+        public virtual DbSet<StoreSendDaySummary> StoreSendDaySummary { get; set; }
+        public virtual DbSet<StoreSendMonthSummary> StoreSendMonthSummary { get; set; }
         public virtual DbSet<SysAdmin> SysAdmin { get; set; }
         public virtual DbSet<SysAdminRole> SysAdminRole { get; set; }
         public virtual DbSet<SysLog> SysLog { get; set; }
@@ -102,7 +109,7 @@ namespace MySystem.OpModels
                 entity.Property(e => e.Status).HasColumnType("int(11)");
 
                 entity.Property(e => e.TradeDate)
-                    .HasColumnType("varchar(6)")
+                    .HasColumnType("varchar(8)")
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
@@ -1334,7 +1341,7 @@ namespace MySystem.OpModels
                 entity.Property(e => e.Status).HasColumnType("int(11)");
 
                 entity.Property(e => e.TradeDate)
-                    .HasColumnType("varchar(6)")
+                    .HasColumnType("varchar(8)")
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
@@ -1569,6 +1576,76 @@ namespace MySystem.OpModels
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<PosCoupons>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.OpId).HasColumnType("int(11)");
+
+                entity.Property(e => e.PosCouponId).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");
+            });
+
+            modelBuilder.Entity<PosMachines>(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.OpId).HasColumnType("int(11)");
+
+                entity.Property(e => e.PosId).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");
+            });
+
             modelBuilder.Entity<PublicAccountSet>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -1833,7 +1910,7 @@ namespace MySystem.OpModels
                 entity.Property(e => e.Status).HasColumnType("int(11)");
 
                 entity.Property(e => e.TradeDate)
-                    .HasColumnType("varchar(6)")
+                    .HasColumnType("varchar(8)")
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
@@ -1900,6 +1977,88 @@ namespace MySystem.OpModels
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<StoreActMerDaySummary>(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.OpId).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.TradeDate)
+                    .HasColumnType("varchar(8)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+            });
+
+            modelBuilder.Entity<StoreActMerMonthSummary>(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.OpId).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");
+            });
+
             modelBuilder.Entity<StoreForOperate>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -1946,6 +2105,148 @@ namespace MySystem.OpModels
                 entity.Property(e => e.Version).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.ApplyNum).HasColumnType("int(11)");
+
+                entity.Property(e => e.BrandId).HasColumnType("int(11)");
+
+                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.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)")
+                    .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<StoreSendDaySummary>(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.OpId).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SendCount).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.TradeDate)
+                    .HasColumnType("varchar(8)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+            });
+
+            modelBuilder.Entity<StoreSendMonthSummary>(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.OpId).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SendCount).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");
+            });
+
             modelBuilder.Entity<SysAdmin>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -2032,6 +2333,8 @@ namespace MySystem.OpModels
 
                 entity.Property(e => e.StoreCount).HasColumnType("int(11)");
 
+                entity.Property(e => e.TotalMachineCount).HasColumnType("int(11)");
+
                 entity.Property(e => e.UpdateDate).HasColumnType("datetime");
 
                 entity.Property(e => e.UpdateMan)

+ 8 - 8
Startup.cs

@@ -134,12 +134,12 @@ namespace MySystem
                     pattern: "{controller=Home}/{action=Index}/{Id?}");
             });
 
-            ResetUserTradeService.Instance.Start();
-            ResetMerchantTradeService.Instance.Start();
-            SycnProfitServiceV2.Instance.Start();
-            SycnHelpProfitService.Instance.Start();
-            ExcelHelper.Instance.Start();
-            TestHelper.Instance.Start();
+            // ResetUserTradeService.Instance.Start();
+            // ResetMerchantTradeService.Instance.Start();
+            // SycnProfitServiceV2.Instance.Start();
+            // SycnHelpProfitService.Instance.Start();
+            // ExcelHelper.Instance.Start();
+            // TestHelper.Instance.Start();
         }
 
 
@@ -154,11 +154,11 @@ namespace MySystem
         {
             Dictionary<string, Dictionary<string, string>> tables = new Dictionary<string, Dictionary<string, string>>();
             Library.OtherMySqlConn.connstr = Configuration["Setting:SqlConnStr"];
-            System.Data.DataTable tablecollection = Library.OtherMySqlConn.dtable("select DISTINCT TABLE_NAME from information_schema.columns where table_schema = 'KxsMainServer2'");
+            System.Data.DataTable tablecollection = Library.OtherMySqlConn.dtable("select DISTINCT TABLE_NAME from information_schema.columns where table_schema = 'KxsMainServer'");
             foreach (System.Data.DataRow subtable in tablecollection.Rows)
             {
                 Dictionary<string, string> Columns = new Dictionary<string, string>();
-                System.Data.DataTable columncollection = Library.OtherMySqlConn.dtable("select COLUMN_NAME,DATA_TYPE from information_schema.columns where table_schema = 'KxsMainServer2' and TABLE_NAME='" + subtable["TABLE_NAME"].ToString() + "'");
+                System.Data.DataTable columncollection = Library.OtherMySqlConn.dtable("select COLUMN_NAME,DATA_TYPE from information_schema.columns where table_schema = 'KxsMainServer' and TABLE_NAME='" + subtable["TABLE_NAME"].ToString() + "'");
                 foreach (System.Data.DataRow column in columncollection.Rows)
                 {
                     string datatype = column["DATA_TYPE"].ToString();