Эх сурвалжийг харах

统计盈利期,费率0.6

lichunlei 1 жил өмнө
parent
commit
118c6581d0

+ 83 - 0
AppStart/Helper/StatService.cs

@@ -299,6 +299,89 @@ namespace MySystem
                                     }
                                 }
 
+
+                                //盈利期,费率0.6
+                                TradeDaySummary2 selfStat2 = db.TradeDaySummary2.FirstOrDefault(m => m.UserId == UserId && m.TradeMonth == TradeMonth && m.TradeDate == TradeDate && m.BrandId == BrandId && m.QueryCount == QrPayFlag && m.VipFlag == VipFlag && m.PayType == PayType && m.SeoTitle == "self");
+                                if (selfStat2 == null)
+                                {
+                                    selfStat2 = db.TradeDaySummary2.Add(new TradeDaySummary2()
+                                    {
+                                        UserId = UserId,
+                                        TradeMonth = TradeMonth,
+                                        TradeDate = TradeDate,
+                                        BrandId = BrandId,
+                                        QueryCount = QrPayFlag,
+                                        VipFlag = VipFlag,
+                                        PayType = PayType,
+                                        SeoTitle = "self",
+                                    }).Entity;
+                                    db.SaveChanges();
+                                }
+                                if (BankCardType == 0)
+                                {
+                                    if (Version == 2)
+                                    {
+                                        selfStat2.ProfitDebitTradeAmt += TradeAmount;
+                                        if (CapFlag == 1)
+                                        {
+                                            selfStat2.ProfitDebitCapTradeAmt += TradeAmount;
+                                            selfStat2.ProfitDebitCapNum += TradeCount;
+                                        }
+                                    }
+                                }
+                                else if (BankCardType != 0)
+                                {
+                                    if (Version == 2)
+                                    {
+                                        selfStat2.ProfitTradeAmt += TradeAmount;
+                                    }
+                                }
+                                ParentNav += "," + UserId + ",";
+                                if (!string.IsNullOrEmpty(ParentNav))
+                                {
+                                    string[] ParentNavList = ParentNav.Trim(',').Replace(",,", ",").Split(',');
+                                    foreach (string NavUserIdString in ParentNavList)
+                                    {
+                                        int NavUserId = int.Parse(NavUserIdString);
+                                        TradeDaySummary2 teamStat2 = db.TradeDaySummary2.FirstOrDefault(m => m.UserId == NavUserId && m.TradeMonth == TradeMonth && m.TradeDate == TradeDate && m.BrandId == BrandId && m.QueryCount == QrPayFlag && m.VipFlag == VipFlag && m.PayType == PayType && m.SeoTitle == "team");
+                                        if (teamStat2 == null)
+                                        {
+                                            teamStat2 = db.TradeDaySummary2.Add(new TradeDaySummary2()
+                                            {
+                                                UserId = NavUserId,
+                                                TradeMonth = TradeMonth,
+                                                TradeDate = TradeDate,
+                                                BrandId = BrandId,
+                                                QueryCount = QrPayFlag,
+                                                VipFlag = VipFlag,
+                                                PayType = PayType,
+                                                SeoTitle = "team",
+                                            }).Entity;
+                                            db.SaveChanges();
+                                        }
+                                        if (BankCardType == 0)
+                                        {
+                                            if (Version == 2)
+                                            {
+                                                teamStat2.ProfitDebitTradeAmt += TradeAmount;
+                                                if (CapFlag == 1)
+                                                {
+                                                    teamStat2.ProfitDebitCapTradeAmt += TradeAmount;
+                                                    teamStat2.ProfitDebitCapNum += TradeCount;
+                                                }
+                                            }
+                                        }
+                                        else if (BankCardType != 0)
+                                        {
+                                            if (Version == 2)
+                                            {
+                                                teamStat2.ProfitTradeAmt += TradeAmount;
+                                            }
+                                        }
+                                    }
+                                }
+
+
                                 Dictionary<string, object> statData = new Dictionary<string, object>();
                                 statData.Add("UserId", UserId);
                                 statData.Add("BrandId", BrandId);

+ 2 - 0
PxcModels/PosMachinesTwo.cs

@@ -64,5 +64,7 @@ namespace MySystem.PxcModels
         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; }
     }
 }

+ 51 - 0
PxcModels/SimposMerchantInfo.cs

@@ -0,0 +1,51 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class SimposMerchantInfo
+    {
+        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 EmployeeName { get; set; }
+        public string EmployeeNo { get; set; }
+        public decimal ActAmount { get; set; }
+        public string ActStatusName { get; set; }
+        public string ProductTypeName { get; set; }
+        public string ActivityName { get; set; }
+        public string ProductName { get; set; }
+        public int Type { get; set; }
+        public int StandardMonths { get; set; }
+        public int StandardStatus { get; set; }
+        public int TopUserId { get; set; }
+        public int MerUserType { get; set; }
+        public string Remark { get; set; }
+        public int BrandId { get; set; }
+        public int SnStoreId { get; set; }
+        public DateTime? MerStandardDate { get; set; }
+        public int SnType { get; set; }
+        public int MerUserId { get; set; }
+        public int UserId { get; set; }
+        public string MgrName { get; set; }
+        public int DirectUserId { get; set; }
+        public int ActiveStatus { get; set; }
+        public int MerStatus { get; set; }
+        public string KqSnNo { get; set; }
+        public string KqMerNo { get; set; }
+        public string MerIdcardNo { get; set; }
+        public string MerRealName { get; set; }
+        public string MerchantMobile { get; set; }
+        public string MerchantName { get; set; }
+        public string MerchantNo { get; set; }
+    }
+}

+ 32 - 0
PxcModels/TradeDaySummary2.cs

@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.PxcModels
+{
+    public partial class TradeDaySummary2
+    {
+        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 decimal ProfitDebitCapNum { get; set; }
+        public decimal ProfitDebitCapTradeAmt { get; set; }
+        public decimal ProfitDebitTradeAmt { get; set; }
+        public decimal ProfitTradeAmt { get; set; }
+        public int PayType { get; set; }
+        public int VipFlag { get; set; }
+        public int TopUserId { get; set; }
+        public int BrandId { get; set; }
+        public string TradeMonth { get; set; }
+        public string TradeDate { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 329 - 0
PxcModels/WebCMSEntities.cs

@@ -198,6 +198,7 @@ namespace MySystem.PxcModels
         public virtual DbSet<SetMerchantTypeRecord> SetMerchantTypeRecord { get; set; }
         public virtual DbSet<SettlementCardChangeRecord> SettlementCardChangeRecord { get; set; }
         public virtual DbSet<SimCardDaySummary> SimCardDaySummary { get; set; }
+        public virtual DbSet<SimposMerchantInfo> SimposMerchantInfo { get; set; }
         public virtual DbSet<SmallStoreHouse> SmallStoreHouse { get; set; }
         public virtual DbSet<SmallStoreQuotaRecord> SmallStoreQuotaRecord { get; set; }
         public virtual DbSet<SpOrderNos> SpOrderNos { get; set; }
@@ -236,6 +237,7 @@ namespace MySystem.PxcModels
         public virtual DbSet<ToChargeBackRecordSub> ToChargeBackRecordSub { get; set; }
         public virtual DbSet<ToChargeByStage> ToChargeByStage { get; set; }
         public virtual DbSet<TradeDaySummary> TradeDaySummary { get; set; }
+        public virtual DbSet<TradeDaySummary2> TradeDaySummary2 { get; set; }
         public virtual DbSet<TradeRecord> TradeRecord { get; set; }
         public virtual DbSet<TradeRecordTest> TradeRecordTest { get; set; }
         public virtual DbSet<UploadParams> UploadParams { get; set; }
@@ -3797,6 +3799,9 @@ namespace MySystem.PxcModels
             {
                 entity.HasComment("助利宝创客交易额统计");
 
+                entity.HasIndex(e => new { e.UserId, e.TradeDate, e.TradeMonth, e.SeoTitle })
+                    .HasName("HelpProfitUserTradeSummayIndex");
+
                 entity.Property(e => e.Id).HasColumnType("int(11)");
 
                 entity.Property(e => e.BrandId)
@@ -9756,6 +9761,10 @@ namespace MySystem.PxcModels
 
                 entity.Property(e => e.BuyUserId).HasColumnType("int(11)");
 
+                entity.Property(e => e.CardType)
+                    .HasColumnType("int(11)")
+                    .HasComment("卡类型");
+
                 entity.Property(e => e.CreateDate).HasColumnType("datetime");
 
                 entity.Property(e => e.CreditTrade).HasColumnType("decimal(18,2)");
@@ -9782,6 +9791,10 @@ namespace MySystem.PxcModels
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.DownFee)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("费率调降值");
+
                 entity.Property(e => e.DownFeeDate).HasColumnType("datetime");
 
                 entity.Property(e => e.DownFeeFlag)
@@ -13748,6 +13761,216 @@ namespace MySystem.PxcModels
                     .HasComment("版本号");
             });
 
+            modelBuilder.Entity<SimposMerchantInfo>(entity =>
+            {
+                entity.ToTable("SIMPosMerchantInfo");
+
+                entity.HasComment("广电卡商户信息");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ActAmount)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("实付金额");
+
+                entity.Property(e => e.ActStatusName)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("激活状态名称")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ActiveStatus)
+                    .HasColumnType("int(11)")
+                    .HasComment("商户激活状态");
+
+                entity.Property(e => e.ActivityName)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("促销活动名称")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.BrandId)
+                    .HasColumnType("int(11)")
+                    .HasComment("品牌");
+
+                entity.Property(e => e.CreateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("创建时间");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("创建人")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.DirectUserId)
+                    .HasColumnType("int(11)")
+                    .HasComment("直属创客编号");
+
+                entity.Property(e => e.EmployeeName)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("员工姓名")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.EmployeeNo)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("员工工号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.KqMerNo)
+                    .HasColumnType("varchar(32)")
+                    .HasComment("渠道商户编码")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.KqSnNo)
+                    .HasColumnType("varchar(32)")
+                    .HasComment("渠道SN号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.MerIdcardNo)
+                    .HasColumnType("varchar(18)")
+                    .HasComment("商户身份证号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.MerRealName)
+                    .HasColumnType("varchar(16)")
+                    .HasComment("商户真实姓名")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.MerStandardDate)
+                    .HasColumnType("datetime")
+                    .HasComment("商户激活时间");
+
+                entity.Property(e => e.MerStatus)
+                    .HasColumnType("int(11)")
+                    .HasComment("商户状态");
+
+                entity.Property(e => e.MerUserId)
+                    .HasColumnType("int(11)")
+                    .HasComment("商户创客");
+
+                entity.Property(e => e.MerUserType)
+                    .HasColumnType("int(11)")
+                    .HasComment("商户创客类型");
+
+                entity.Property(e => e.MerchantMobile)
+                    .HasColumnType("varchar(11)")
+                    .HasComment("商户手机号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.MerchantName)
+                    .HasColumnType("varchar(32)")
+                    .HasComment("商户姓名")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.MerchantNo)
+                    .HasColumnType("varchar(16)")
+                    .HasComment("商户编号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.MgrName)
+                    .HasColumnType("varchar(32)")
+                    .HasComment("渠道经理姓名")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ProductName)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("商品名称")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ProductTypeName)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("商品类型名称")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.QueryCount)
+                    .HasColumnType("int(11)")
+                    .HasComment("点击量");
+
+                entity.Property(e => e.Remark)
+                    .HasColumnType("varchar(64)")
+                    .HasComment("备注")
+                    .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.SnStoreId)
+                    .HasColumnType("int(11)")
+                    .HasComment("SN仓库");
+
+                entity.Property(e => e.SnType)
+                    .HasColumnType("int(11)")
+                    .HasComment("机具类型");
+
+                entity.Property(e => e.Sort)
+                    .HasColumnType("int(11)")
+                    .HasComment("排序序号");
+
+                entity.Property(e => e.StandardMonths)
+                    .HasColumnType("int(11)")
+                    .HasComment("退押达标月");
+
+                entity.Property(e => e.StandardStatus)
+                    .HasColumnType("int(11)")
+                    .HasComment("退押达标状态");
+
+                entity.Property(e => e.Status)
+                    .HasColumnType("int(11)")
+                    .HasComment("状态");
+
+                entity.Property(e => e.TopUserId)
+                    .HasColumnType("int(11)")
+                    .HasComment("顶级创客");
+
+                entity.Property(e => e.Type)
+                    .HasColumnType("int(11)")
+                    .HasComment("兑换类型");
+
+                entity.Property(e => e.UpdateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("更新时间");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("更新人")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UserId)
+                    .HasColumnType("int(11)")
+                    .HasComment("创客");
+
+                entity.Property(e => e.Version)
+                    .HasColumnType("int(11)")
+                    .HasComment("版本号");
+            });
+
             modelBuilder.Entity<SmallStoreHouse>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -16117,6 +16340,112 @@ namespace MySystem.PxcModels
                 entity.Property(e => e.VipFlag).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<TradeDaySummary2>(entity =>
+            {
+                entity.HasComment("交易日汇总");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.BrandId)
+                    .HasColumnType("int(11)")
+                    .HasComment("品牌");
+
+                entity.Property(e => e.CreateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("创建时间");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("创建人")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.PayType)
+                    .HasColumnType("int(11)")
+                    .HasComment("支付方式");
+
+                entity.Property(e => e.ProfitDebitCapNum)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("直营商户借记卡封顶交易总数(盈利期)");
+
+                entity.Property(e => e.ProfitDebitCapTradeAmt)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("直营商户借记卡封顶交易总金额(盈利期)");
+
+                entity.Property(e => e.ProfitDebitTradeAmt)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("直营商户借记卡交易总额(盈利期)");
+
+                entity.Property(e => e.ProfitTradeAmt)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("直营商户交易总额(盈利期)");
+
+                entity.Property(e => e.QueryCount)
+                    .HasColumnType("int(11)")
+                    .HasComment("点击量");
+
+                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)")
+                    .HasComment("排序序号");
+
+                entity.Property(e => e.Status)
+                    .HasColumnType("int(11)")
+                    .HasComment("状态");
+
+                entity.Property(e => e.TopUserId)
+                    .HasColumnType("int(11)")
+                    .HasComment("顶级创客");
+
+                entity.Property(e => e.TradeDate)
+                    .HasColumnType("varchar(8)")
+                    .HasComment("交易日")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.TradeMonth)
+                    .HasColumnType("varchar(6)")
+                    .HasComment("交易月")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("更新时间");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("更新人")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UserId)
+                    .HasColumnType("int(11)")
+                    .HasComment("创客");
+
+                entity.Property(e => e.Version)
+                    .HasColumnType("int(11)")
+                    .HasComment("版本号");
+
+                entity.Property(e => e.VipFlag)
+                    .HasColumnType("int(11)")
+                    .HasComment("会员标记");
+            });
+
             modelBuilder.Entity<TradeRecord>(entity =>
             {
                 entity.HasIndex(e => new { e.BrandId, e.UserId, e.MerchantId, e.MerNo, e.SnNo, e.CreateDate })