Browse Source

推荐王自动更新,每天凌晨执行

lcl 1 year ago
parent
commit
8576de2f58

+ 6 - 9
AppStart/Helper/RecommandKingHelper.cs

@@ -26,15 +26,11 @@ namespace MySystem
         {
             while (true)
             {
-                Recommend();
-                if(DateTime.Now.Hour > 0 && DateTime.Now.Hour < 9)
+                if(DateTime.Now.Hour > 0 && DateTime.Now.Hour < 6)
                 {
-                    Thread.Sleep(3600000);
-                }
-                else
-                {
-                    Thread.Sleep(600000);
+                    Recommend();
                 }
+                Thread.Sleep(600000);
             }
         }
         public void Recommend()
@@ -43,6 +39,7 @@ namespace MySystem
             DateTime start = DateTime.Parse(DateTime.Now.AddMonths(-0).ToString("yyyy-MM") + "-01 00:00:00");
             DateTime end = start.AddMonths(1);
             string TradeMonth = DateTime.Now.AddMonths(-0).ToString("yyyyMM");
+            CustomerSqlConn.op("delete from RecommendDirectUser where TradeMonth='" + TradeMonth + "'", MysqlConn.SqlConnStr);
             string PreTradeMonth = DateTime.Now.AddMonths(-1).ToString("yyyyMM");
             List<int> ProductIds = new List<int>();
             ProductIds.Add(10);
@@ -56,9 +53,9 @@ namespace MySystem
             ProductIds.Add(40);
             WebCMSEntities db = new WebCMSEntities();
             ReadModels.WebCMSEntities readdb = new ReadModels.WebCMSEntities();
-            // List<int> testuids = readdb.Users.Where(m => m.ParentNav.Contains(",146291,") && m.AuthFlag == 1).ToList().Select(m => m.Id).ToList();
+            List<int> OrderIds = readdb.RecommendOrderCheck.Select(m => m.OrderId).ToList();
             //统计当月下单名单
-            List<int> uids = readdb.Orders.Where(m => m.PayDate >= check && m.Status > 0 && m.Sort == 0 && ProductIds.Contains(m.ProductId)).ToList().Select(m => m.UserId).Distinct().ToList();
+            List<int> uids = readdb.Orders.Where(m => m.PayDate >= check && m.Status > 0 && m.Sort == 0 && ProductIds.Contains(m.ProductId) && !OrderIds.Contains(m.Id)).ToList().Select(m => m.UserId).Distinct().ToList();
             foreach(int uid in uids)
             {
                 int ActCount = 0;

+ 5 - 0
PxcModels/AppBottomNavs.cs

@@ -28,5 +28,10 @@ namespace MySystem.PxcModels
         public string PagPath { get; set; }
         public string ScrollerAnimationImages { get; set; }
         public string Style { get; set; }
+        public string StatusBarColor { get; set; }
+        public int IconSize { get; set; }
+        public string PagDefaultIcon { get; set; }
+        public string PagLocalPath { get; set; }
+        public ulong ShowTitle { get; set; }
     }
 }

+ 1 - 1
PxcModels/PosMachinesTwo.cs

@@ -61,9 +61,9 @@ namespace MySystem.PxcModels
         public int RecycStatus { get; set; }
         public string OutBatchNo { get; set; }
         public int WithholdFlag { get; set; }
+        public int LastMerchantId { get; set; }
         public int IsSupplement { get; set; }
         public int IsOpAct { get; set; }
-        public int LastMerchantId { get; set; }
         public int CardType { get; set; }
         public decimal DownFee { get; set; }
         public int FirstFlag { get; set; }

+ 10 - 0
PxcModels/RecommendOrderCheck.cs

@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class RecommendOrderCheck
+    {
+        public int OrderId { get; set; }
+    }
+}

+ 12 - 0
PxcModels/UserMoveInfo.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class UserMoveInfo
+    {
+        public int UserId { get; set; }
+        public string PayPwd { get; set; }
+        public string LoginPwd { get; set; }
+    }
+}

+ 20 - 0
PxcModels/UserYearEndInCome.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class UserYearEndInCome
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public decimal InComeByYear { get; set; }
+        public string TradeYear { get; set; }
+        public int UserId { get; set; }
+        public int ParentUserId { get; set; }
+        public string ParentNav { get; set; }
+    }
+}

+ 30 - 0
PxcModels/UserYearEndSummary.cs

@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class UserYearEndSummary
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public int SeniorShareHolder { get; set; }
+        public int MiddleShareHolder { get; set; }
+        public int JuniorShareHolder { get; set; }
+        public decimal PersonalTradeAmountByYear { get; set; }
+        public int FifteenMillionTradeAmountUserCount { get; set; }
+        public int EightMillionTradeAmountUserCount { get; set; }
+        public int ThreeMillionTradeAmountUserCount { get; set; }
+        public int TeamMerchantActCountByYear { get; set; }
+        public int TeamTotalMakerByYear { get; set; }
+        public int PersonalMakerAddByYear { get; set; }
+        public decimal TeamTradeAmountByYear { get; set; }
+        public string TradeYear { get; set; }
+        public int UserId { get; set; }
+        public int? ParentUserId { get; set; }
+        public string ParentNav { get; set; }
+    }
+}

File diff suppressed because it is too large
+ 194 - 174
PxcModels/WebCMSEntities.cs


+ 5 - 0
ReadModels/AppBottomNavs.cs

@@ -28,5 +28,10 @@ namespace MySystem.ReadModels
         public string PagPath { get; set; }
         public string ScrollerAnimationImages { get; set; }
         public string Style { get; set; }
+        public string StatusBarColor { get; set; }
+        public int IconSize { get; set; }
+        public string PagDefaultIcon { get; set; }
+        public string PagLocalPath { get; set; }
+        public ulong ShowTitle { get; set; }
     }
 }

+ 10 - 0
ReadModels/RecommendOrderCheck.cs

@@ -0,0 +1,10 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.ReadModels
+{
+    public partial class RecommendOrderCheck
+    {
+        public int OrderId { get; set; }
+    }
+}

+ 12 - 0
ReadModels/UserMoveInfo.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.ReadModels
+{
+    public partial class UserMoveInfo
+    {
+        public int UserId { get; set; }
+        public string PayPwd { get; set; }
+        public string LoginPwd { get; set; }
+    }
+}

+ 20 - 0
ReadModels/UserYearEndInCome.cs

@@ -0,0 +1,20 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.ReadModels
+{
+    public partial class UserYearEndInCome
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public decimal InComeByYear { get; set; }
+        public string TradeYear { get; set; }
+        public int UserId { get; set; }
+        public int ParentUserId { get; set; }
+        public string ParentNav { get; set; }
+    }
+}

+ 2 - 0
ReadModels/UserYearEndSummary.cs

@@ -24,5 +24,7 @@ namespace MySystem.ReadModels
         public decimal TeamTradeAmountByYear { get; set; }
         public string TradeYear { get; set; }
         public int UserId { get; set; }
+        public int? ParentUserId { get; set; }
+        public string ParentNav { get; set; }
     }
 }

+ 131 - 1
ReadModels/WebCMSEntities.cs

@@ -184,6 +184,7 @@ namespace MySystem.ReadModels
         public virtual DbSet<PullNewDetail> PullNewDetail { get; set; }
         public virtual DbSet<PullnewSummary> PullnewSummary { get; set; }
         public virtual DbSet<RecommendDirectUser> RecommendDirectUser { get; set; }
+        public virtual DbSet<RecommendOrderCheck> RecommendOrderCheck { get; set; }
         public virtual DbSet<RecommendTradeSummary> RecommendTradeSummary { get; set; }
         public virtual DbSet<RecycMachineOrder> RecycMachineOrder { get; set; }
         public virtual DbSet<RecycMachineOrderPos> RecycMachineOrderPos { get; set; }
@@ -276,6 +277,7 @@ namespace MySystem.ReadModels
         public virtual DbSet<UserLoginRecord> UserLoginRecord { get; set; }
         public virtual DbSet<UserMachineData> UserMachineData { get; set; }
         public virtual DbSet<UserMallLargeSn> UserMallLargeSn { get; set; }
+        public virtual DbSet<UserMoveInfo> UserMoveInfo { get; set; }
         public virtual DbSet<UserOfflineSignInRecords> UserOfflineSignInRecords { get; set; }
         public virtual DbSet<UserProfit> UserProfit { get; set; }
         public virtual DbSet<UserProfitSet> UserProfitSet { get; set; }
@@ -291,6 +293,7 @@ namespace MySystem.ReadModels
         public virtual DbSet<UserSwapWhite> UserSwapWhite { get; set; }
         public virtual DbSet<UserTradeDaySummary> UserTradeDaySummary { get; set; }
         public virtual DbSet<UserTradeMonthSummary> UserTradeMonthSummary { get; set; }
+        public virtual DbSet<UserYearEndInCome> UserYearEndInCome { get; set; }
         public virtual DbSet<UserYearEndSummary> UserYearEndSummary { get; set; }
         public virtual DbSet<Users> Users { get; set; }
 
@@ -298,7 +301,7 @@ namespace MySystem.ReadModels
         {
             if (!optionsBuilder.IsConfigured)
             {
-                optionsBuilder.UseMySql(Library.ConfigurationManager.AppSettings["Pxc1SqlConnStr"].ToString(), x => x.ServerVersion("5.7.17-mysql"));
+                optionsBuilder.UseMySql(Library.ConfigurationManager.AppSettings["ReadSqlConnStr"].ToString(), x => x.ServerVersion("5.7.17-mysql"));
             }
         }
 
@@ -960,6 +963,10 @@ namespace MySystem.ReadModels
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.IconSize)
+                    .HasColumnType("int(11)")
+                    .HasComment("图标尺寸");
+
                 entity.Property(e => e.NoPageHint)
                     .HasColumnType("varchar(50)")
                     .HasCharSet("utf8")
@@ -975,6 +982,18 @@ namespace MySystem.ReadModels
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.PagDefaultIcon)
+                    .HasColumnType("varchar(200)")
+                    .HasComment("pag默认图标")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.PagLocalPath)
+                    .HasColumnType("varchar(200)")
+                    .HasComment("pag文件路径")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.PagPath)
                     .HasColumnType("varchar(200)")
                     .HasCharSet("utf8")
@@ -1017,10 +1036,21 @@ namespace MySystem.ReadModels
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.ShowTitle)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'")
+                    .HasComment("是否显示标题");
+
                 entity.Property(e => e.Sort).HasColumnType("int(11)");
 
                 entity.Property(e => e.Status).HasColumnType("int(11)");
 
+                entity.Property(e => e.StatusBarColor)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("状态栏底色")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.Style)
                     .HasColumnType("varchar(30)")
                     .HasCharSet("utf8")
@@ -13027,6 +13057,18 @@ namespace MySystem.ReadModels
                 entity.Property(e => e.UserId).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<RecommendOrderCheck>(entity =>
+            {
+                entity.HasKey(e => e.OrderId)
+                    .HasName("PRIMARY");
+
+                entity.HasComment("推荐王订单");
+
+                entity.Property(e => e.OrderId)
+                    .HasColumnType("int(11)")
+                    .HasComment("订单Id");
+            });
+
             modelBuilder.Entity<RecommendTradeSummary>(entity =>
             {
                 entity.HasIndex(e => new { e.UserId, e.TradeMonth, e.PosSn })
@@ -19260,6 +19302,30 @@ namespace MySystem.ReadModels
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<UserMoveInfo>(entity =>
+            {
+                entity.HasKey(e => e.UserId)
+                    .HasName("PRIMARY");
+
+                entity.HasComment("创客迁移字段表");
+
+                entity.Property(e => e.UserId)
+                    .HasColumnType("int(11)")
+                    .HasComment("创客Id");
+
+                entity.Property(e => e.LoginPwd)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("登录密码")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.PayPwd)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("支付密码")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+            });
+
             modelBuilder.Entity<UserOfflineSignInRecords>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -20422,6 +20488,63 @@ namespace MySystem.ReadModels
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<UserYearEndInCome>(entity =>
+            {
+                entity.HasComment("创客年终总结");
+
+                entity.Property(e => e.Id)
+                    .HasColumnName("id")
+                    .HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate)
+                    .HasColumnName("create_date")
+                    .HasColumnType("datetime")
+                    .HasComment("创建时间");
+
+                entity.Property(e => e.InComeByYear)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("年度团队交易额");
+
+                entity.Property(e => e.ParentNav)
+                    .HasColumnType("longtext")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ParentUserId)
+                    .HasColumnType("int(11)")
+                    .HasComment("上级创客Id");
+
+                entity.Property(e => e.Sort)
+                    .HasColumnName("sort")
+                    .HasColumnType("int(11)")
+                    .HasComment("排序序号");
+
+                entity.Property(e => e.Status)
+                    .HasColumnName("status")
+                    .HasColumnType("int(11)")
+                    .HasComment("状态");
+
+                entity.Property(e => e.TradeYear)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("统计年份")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate)
+                    .HasColumnName("update_date")
+                    .HasColumnType("datetime")
+                    .HasComment("修改时间");
+
+                entity.Property(e => e.UserId)
+                    .HasColumnType("int(11)")
+                    .HasComment("创客Id");
+
+                entity.Property(e => e.Version)
+                    .HasColumnName("version")
+                    .HasColumnType("int(11)")
+                    .HasComment("版本号");
+            });
+
             modelBuilder.Entity<UserYearEndSummary>(entity =>
             {
                 entity.HasComment("创客年终总结");
@@ -20451,6 +20574,13 @@ namespace MySystem.ReadModels
                     .HasColumnType("int(11)")
                     .HasComment("团队新增中级股东");
 
+                entity.Property(e => e.ParentNav)
+                    .HasColumnType("longtext")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ParentUserId).HasColumnType("int(11)");
+
                 entity.Property(e => e.PersonalMakerAddByYear)
                     .HasColumnType("int(11)")
                     .HasComment("年度个人新增团队成员");

Some files were not shown because too many files changed in this diff