소스 검색

完成分润逻辑

lichunlei 2 년 전
부모
커밋
9ce2c32af1

+ 115 - 0
AppStart/Helper/Profit/HelpProfitHelper.cs

@@ -0,0 +1,115 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Data;
+using MySystem.PxcModels;
+using Library;
+using System.Threading;
+using Microsoft.Extensions.Hosting;
+using System.Threading.Tasks;
+
+namespace MySystem
+{
+    public class HelpProfitHelper
+    {
+        public readonly static HelpProfitHelper Instance = new HelpProfitHelper();
+        private HelpProfitHelper()
+        {
+        }
+        
+        public void Start()
+        {
+            Thread th = new Thread(StartFor);
+            th.IsBackground = true;
+            th.Start();
+        }
+        public void StartFor()
+        {
+            while (true)
+            {
+                if(DateTime.Now.Hour >= 2 && DateTime.Now.Hour <= 3)
+                {
+                    StatProfitEveryDay(DateTime.Now.AddDays(-1).ToString("yyyyMMdd"));
+                }
+                Thread.Sleep(600000);
+            }
+        }
+        public void StatProfitEveryDay(string Date)
+        {
+            string check = function.ReadInstance("/HelpProfitStat/" + Date + ".txt");
+            if (!string.IsNullOrEmpty(check))
+            {
+                return;
+            }
+            function.WritePage("/HelpProfitStat/", Date + ".txt", DateTime.Now.ToString());
+            WebCMSEntities db = new WebCMSEntities();
+            List<HelpProfitMerTradeSummay> list = db.HelpProfitMerTradeSummay.Where(m => m.TradeDate == Date).ToList();
+            foreach(HelpProfitMerTradeSummay sub in list)
+            {
+                int MerchantId = sub.MerchantId;
+                decimal TradeAmount = sub.TradeAmount;
+                HelpProfitMerchantForUser merchant = db.HelpProfitMerchantForUser.FirstOrDefault(m => m.MerchantId == MerchantId);
+                if(merchant != null)
+                {
+                    int UserId = merchant.UserId;
+                    PosMerchantInfo mer = db.PosMerchantInfo.FirstOrDefault(m => m.Id == MerchantId) ?? new PosMerchantInfo();
+                    Users user = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
+                    decimal money = TradeAmount * 0.0005M;
+                    decimal money2 = TradeAmount * 0.00005M;
+                    UserAccount account = db.UserAccount.FirstOrDefault(m => m.Id == UserId);
+                    if (account == null)
+                    {
+                        account = db.UserAccount.Add(new UserAccount()
+                        {
+                            Id = UserId,
+                            UserId = UserId,
+                        }).Entity;
+                        db.SaveChanges();
+                    }
+                    decimal BeforeBalanceAmount = account.BalanceAmount; //变更前余额
+                    account.HelpProfitBalanceAmount += money;
+                    decimal AfterBalanceAmount = account.BalanceAmount; //变更后余额
+                    HelpProfitAccountRecord accountRecord = db.HelpProfitAccountRecord.Add(new HelpProfitAccountRecord()
+                    {
+                        CreateDate = DateTime.Now,
+                        UpdateDate = DateTime.Now,
+                        UserId = UserId, //创客
+                        ProductType = mer.BrandId, //产品类型
+                        ChangeType = 1,
+                        ChangeAmount = money, //变更金额
+                        BeforeBalanceAmount = BeforeBalanceAmount, //变更前余额
+                        AfterBalanceAmount = AfterBalanceAmount, //变更后余额
+                    }).Entity;
+                    db.SaveChanges();
+
+                    account = db.UserAccount.FirstOrDefault(m => m.Id == user.ParentUserId);
+                    if (account == null)
+                    {
+                        account = db.UserAccount.Add(new UserAccount()
+                        {
+                            Id = user.ParentUserId,
+                            UserId = user.ParentUserId,
+                        }).Entity;
+                        db.SaveChanges();
+                    }
+                    BeforeBalanceAmount = account.BalanceAmount; //变更前余额
+                    account.HelpProfitBalanceAmount += money2;
+                    AfterBalanceAmount = account.BalanceAmount; //变更后余额
+                    accountRecord = db.HelpProfitAccountRecord.Add(new HelpProfitAccountRecord()
+                    {
+                        CreateDate = DateTime.Now,
+                        UpdateDate = DateTime.Now,
+                        UserId = user.ParentUserId, //创客
+                        ProductType = mer.BrandId, //产品类型
+                        ChangeType = 1,
+                        ChangeAmount = money2, //变更金额
+                        BeforeBalanceAmount = BeforeBalanceAmount, //变更前余额
+                        AfterBalanceAmount = AfterBalanceAmount, //变更后余额
+                    }).Entity;
+                    db.SaveChanges();
+                }
+            }
+            db.Dispose();
+        }
+    }
+}

+ 3 - 0
PxcModels/BackEndOpRecord.cs

@@ -9,8 +9,11 @@ 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; }

+ 33 - 0
PxcModels/HelpProfitAccountRecord.cs

@@ -0,0 +1,33 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class HelpProfitAccountRecord
+    {
+        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 TransRecordNo { get; set; }
+        public string Remark { get; set; }
+        public decimal AfterBalanceAmount { get; set; }
+        public decimal BeforeBalanceAmount { get; set; }
+        public decimal AfterFreezeAmount { get; set; }
+        public decimal BeforeFreezeAmount { get; set; }
+        public decimal AfterTotalAmount { get; set; }
+        public decimal BeforeTotalAmount { get; set; }
+        public decimal ChangeAmount { get; set; }
+        public int ProductType { get; set; }
+        public int ChangeType { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 23 - 0
PxcModels/HelpProfitExchange.cs

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

+ 25 - 0
PxcModels/HelpProfitExchangeDetail.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class HelpProfitExchangeDetail
+    {
+        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 RecordId { get; set; }
+        public string ExchangeCode { get; set; }
+        public int PosCouponId { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 11 - 0
PxcModels/HelpProfitMerIds.cs

@@ -0,0 +1,11 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class HelpProfitMerIds
+    {
+        public int MerchantId { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 26 - 0
PxcModels/HelpProfitMerTradeSummay.cs

@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class HelpProfitMerTradeSummay
+    {
+        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 BrandId { get; set; }
+        public decimal TradeAmount { get; set; }
+        public string TradeDate { get; set; }
+        public string TradeMonth { get; set; }
+        public int MerchantId { get; set; }
+    }
+}

+ 24 - 0
PxcModels/HelpProfitMerchantForUser.cs

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

+ 29 - 0
PxcModels/HelpProfitRebateDetail.cs

@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class HelpProfitRebateDetail
+    {
+        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 Remark { get; set; }
+        public decimal DebitRewardAmount { get; set; }
+        public decimal CreditRewardAmount { get; set; }
+        public int MerchantId { get; set; }
+        public int ProductType { get; set; }
+        public int UserId { get; set; }
+        public string TradeDate { get; set; }
+        public string TradeMonth { get; set; }
+    }
+}

+ 3 - 0
PxcModels/LeaderAccountRecord.cs

@@ -9,8 +9,11 @@ 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; }

+ 3 - 0
PxcModels/StoreHouseAmountPromiss.cs

@@ -9,8 +9,11 @@ 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; }

+ 1 - 0
PxcModels/UserAccount.cs

@@ -37,5 +37,6 @@ namespace MySystem.PxcModels
         public decimal LeaderReserve { get; set; }
         public decimal ValidAmount { get; set; }
         public decimal LeaderBalanceAmount { get; set; }
+        public decimal HelpProfitBalanceAmount { get; set; }
     }
 }

+ 3 - 1
PxcModels/Users.cs

@@ -83,8 +83,10 @@ namespace MySystem.PxcModels
         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; }
+        public decimal ValidAmount { get; set; }
         public string DeviceType { get; set; }
+        public DateTime? HelpProfitAgreeDate { get; set; }
+        public ulong HelpProfitAgree { get; set; }
     }
 }

+ 408 - 106
PxcModels/WebCMSEntities.cs

@@ -49,6 +49,13 @@ namespace MySystem.PxcModels
         public virtual DbSet<FileUpdateInfo> FileUpdateInfo { get; set; }
         public virtual DbSet<FluxProfitDetail> FluxProfitDetail { get; set; }
         public virtual DbSet<FluxProfitSummary> FluxProfitSummary { get; set; }
+        public virtual DbSet<HelpProfitAccountRecord> HelpProfitAccountRecord { get; set; }
+        public virtual DbSet<HelpProfitExchange> HelpProfitExchange { get; set; }
+        public virtual DbSet<HelpProfitExchangeDetail> HelpProfitExchangeDetail { get; set; }
+        public virtual DbSet<HelpProfitMerIds> HelpProfitMerIds { get; set; }
+        public virtual DbSet<HelpProfitMerTradeSummay> HelpProfitMerTradeSummay { get; set; }
+        public virtual DbSet<HelpProfitMerchantForUser> HelpProfitMerchantForUser { get; set; }
+        public virtual DbSet<HelpProfitRebateDetail> HelpProfitRebateDetail { get; set; }
         public virtual DbSet<IndexIconList> IndexIconList { get; set; }
         public virtual DbSet<KqProductBrand> KqProductBrand { get; set; }
         public virtual DbSet<KqProductOrgs> KqProductOrgs { get; set; }
@@ -141,7 +148,6 @@ namespace MySystem.PxcModels
         public virtual DbSet<ProfitRecord> ProfitRecord { get; set; }
         public virtual DbSet<ProfitRewardRecord> ProfitRewardRecord { get; set; }
         public virtual DbSet<ProfitSubsidyDetail> ProfitSubsidyDetail { get; set; }
-        public virtual DbSet<ProfitSubsidyDetail04> ProfitSubsidyDetail04 { get; set; }
         public virtual DbSet<PublicAccountSet> PublicAccountSet { get; set; }
         public virtual DbSet<PullNewAct> PullNewAct { get; set; }
         public virtual DbSet<PullNewDetail> PullNewDetail { get; set; }
@@ -646,9 +652,6 @@ namespace MySystem.PxcModels
 
             modelBuilder.Entity<ActivityRedPackageStock>(entity =>
             {
-                entity.HasIndex(e => new { e.UserId, e.ActivityDate })
-                    .HasName("ActivityRedPackageStockIndex");
-
                 entity.Property(e => e.Id).HasColumnType("int(11)");
 
                 entity.Property(e => e.ActivityDate)
@@ -1166,6 +1169,11 @@ namespace MySystem.PxcModels
 
                 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.QueryCount).HasColumnType("int(11)");
 
                 entity.Property(e => e.Remark)
@@ -1213,6 +1221,13 @@ namespace MySystem.PxcModels
                     .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.Version).HasColumnType("int(11)");
             });
 
             modelBuilder.Entity<BankInfo>(entity =>
@@ -2633,6 +2648,363 @@ namespace MySystem.PxcModels
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<HelpProfitAccountRecord>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.AfterBalanceAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.AfterFreezeAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.AfterTotalAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.BeforeBalanceAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.BeforeFreezeAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.BeforeTotalAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.ChangeAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.ChangeType).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.ProductType).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.TransRecordNo)
+                    .HasColumnType("varchar(32)")
+                    .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<HelpProfitExchange>(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.ExchangeCount).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<HelpProfitExchangeDetail>(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.ExchangeCode)
+                    .HasColumnType("varchar(20)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.PosCouponId).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.RecordId).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<HelpProfitMerIds>(entity =>
+            {
+                entity.HasKey(e => e.MerchantId)
+                    .HasName("PRIMARY");
+
+                entity.Property(e => e.MerchantId).HasColumnType("int(11)");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<HelpProfitMerTradeSummay>(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.MerchantId).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.TradeAmount).HasColumnType("decimal(18,2)");
+
+                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.Version).HasColumnType("int(11)");
+            });
+
+            modelBuilder.Entity<HelpProfitMerchantForUser>(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.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<HelpProfitRebateDetail>(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.CreditRewardAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.DebitRewardAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.MerchantId).HasColumnType("int(11)");
+
+                entity.Property(e => e.ProductType).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<IndexIconList>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -2995,6 +3367,11 @@ namespace MySystem.PxcModels
 
                 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.ProductType).HasColumnType("int(11)");
 
                 entity.Property(e => e.QueryCount).HasColumnType("int(11)");
@@ -3030,7 +3407,14 @@ namespace MySystem.PxcModels
 
                 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<LeaderReserveRecord>(entity =>
@@ -9485,108 +9869,6 @@ namespace MySystem.PxcModels
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
-            modelBuilder.Entity<ProfitSubsidyDetail04>(entity =>
-            {
-                entity.Property(e => e.Id).HasColumnType("int(11)");
-
-                entity.Property(e => e.BelongUserId).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.CreditProfitRate).HasColumnType("decimal(18,2)");
-
-                entity.Property(e => e.CreditTradeAmt).HasColumnType("decimal(18,2)");
-
-                entity.Property(e => e.MerHelpFlag)
-                    .HasColumnType("bit(1)")
-                    .HasDefaultValueSql("b'0'");
-
-                entity.Property(e => e.MerNo)
-                    .HasColumnType("varchar(32)")
-                    .HasCharSet("utf8")
-                    .HasCollation("utf8_general_ci");
-
-                entity.Property(e => e.MerRegTime).HasColumnType("datetime");
-
-                entity.Property(e => e.MerStandardDate).HasColumnType("datetime");
-
-                entity.Property(e => e.MerchantId).HasColumnType("int(11)");
-
-                entity.Property(e => e.NonQrCreditTradeAmt).HasColumnType("decimal(18,2)");
-
-                entity.Property(e => e.ProductName)
-                    .HasColumnType("varchar(16)")
-                    .HasCharSet("utf8")
-                    .HasCollation("utf8_general_ci");
-
-                entity.Property(e => e.QrCreditTradeAmt).HasColumnType("decimal(18,2)");
-
-                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
-
-                entity.Property(e => e.RecordNo)
-                    .HasColumnType("varchar(32)")
-                    .HasCharSet("utf8")
-                    .HasCollation("utf8_general_ci");
-
-                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.SnNo)
-                    .HasColumnType("varchar(32)")
-                    .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.SubsidyProfit).HasColumnType("decimal(18,2)");
-
-                entity.Property(e => e.SubsidyProfitRate).HasColumnType("decimal(18,2)");
-
-                entity.Property(e => e.SubsidyType).HasColumnType("int(11)");
-
-                entity.Property(e => e.SubsidyUserId).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.UpdateMan)
-                    .HasColumnType("varchar(50)")
-                    .HasCharSet("utf8")
-                    .HasCollation("utf8_general_ci");
-
-                entity.Property(e => e.Version).HasColumnType("int(11)");
-            });
-
             modelBuilder.Entity<PublicAccountSet>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -10654,6 +10936,11 @@ namespace MySystem.PxcModels
 
                 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.FromUserId).HasColumnType("int(11)");
 
                 entity.Property(e => e.PromissAmount).HasColumnType("decimal(18,2)");
@@ -10682,6 +10969,13 @@ namespace MySystem.PxcModels
                 entity.Property(e => e.ToUserId).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.Version).HasColumnType("int(11)");
             });
 
             modelBuilder.Entity<StoreHouseAmountRecord>(entity =>
@@ -12481,6 +12775,8 @@ namespace MySystem.PxcModels
 
                 entity.Property(e => e.FreezeAmount).HasColumnType("decimal(18,2)");
 
+                entity.Property(e => e.HelpProfitBalanceAmount).HasColumnType("decimal(18,2)");
+
                 entity.Property(e => e.LeaderBalanceAmount).HasColumnType("decimal(18,2)");
 
                 entity.Property(e => e.LeaderReserve).HasColumnType("decimal(18,2)");
@@ -15188,6 +15484,12 @@ namespace MySystem.PxcModels
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.HelpProfitAgree)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'");
+
+                entity.Property(e => e.HelpProfitAgreeDate).HasColumnType("datetime");
+
                 entity.Property(e => e.IdCardEndNo)
                     .HasColumnType("varchar(4)")
                     .HasCharSet("utf8")

+ 2 - 2
appsettings.json

@@ -17,8 +17,8 @@
     "Host": "http://localhost:5047/",
     "SourceHost": "http://bs.kexiaoshuang.com/",
     "Database": "KxsMainServer",
-    "SqlConnStr": "server=47.109.31.237;port=3306;user=KxsMainServer;password=Rw2imhXQQt5ODWIF;database=KxsMainServer;charset=utf8;",
-    "Pxc1SqlConnStr": "server=47.109.31.237;port=3306;user=KxsMainServer;password=Rw2imhXQQt5ODWIF;database=KxsMainServer;charset=utf8;",
+    "SqlConnStr": "server=47.109.31.237;port=3306;user=KxsMainServer2;password=FrW8ZfxlcaVdm1r0;database=KxsMainServer2;charset=utf8;",
+    "Pxc1SqlConnStr": "server=47.109.31.237;port=3306;user=KxsMainServer2;password=FrW8ZfxlcaVdm1r0;database=KxsMainServer2;charset=utf8;",
     "SpSqlConnStr": "server=47.109.31.237;port=3306;user=KxsSpServer;password=jJ9qKsvwWgQA9xWG;database=KxsSpServer;charset=utf8;",
     "RedisConnStr": "47.109.31.237:6379,password=klm@redis,DefaultDatabase=1,poolsize=500,preheat=50,asyncPipeline=true",
     "TendisConnStr": "47.109.31.237:6379,password=klm@redis,DefaultDatabase=1,poolsize=500,preheat=50,asyncPipeline=true",