Browse Source

Merge branch 'release'

lcl 1 year ago
parent
commit
077d6a332a

+ 2 - 0
Controllers/HomeController.cs

@@ -10,6 +10,8 @@ using LitJson;
 using System.Data;
 using MySystem.Models.Main;
 using System.Text.RegularExpressions;
+using Aop.Api.Domain;
+using MySystem.Models;
 
 namespace MySystem.Controllers
 {

+ 1 - 0
Models/Main/ConsumerOrders.cs

@@ -35,5 +35,6 @@ namespace MySystem.Models.Main
         public string TradePayNo { get; set; }
         public int SetRecordId { get; set; }
         public int SettleAmount { get; set; }
+        public ulong ReturnFlag { get; set; }
     }
 }

+ 7 - 0
Models/Main/MerchantInfo.cs

@@ -48,5 +48,12 @@ namespace MySystem.Models.Main
         public int ExamineStatus { get; set; }
         public int Months { get; set; }
         public int IsAct { get; set; }
+        public DateTime? EndTime { get; set; }
+        public DateTime? StartTime { get; set; }
+        public string BusinessHours { get; set; }
+        public string BriefIntroduction { get; set; }
+        public int Popularity { get; set; }
+        public decimal Latitude { get; set; }
+        public decimal Longitude { get; set; }
     }
 }

+ 37 - 0
Models/Main/WebCMSEntities.cs

@@ -2295,6 +2295,11 @@ namespace MySystem.Models.Main
 
                 entity.Property(e => e.QueryCount).HasColumnType("int(11)");
 
+                entity.Property(e => e.ReturnFlag)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'")
+                    .HasComment("返现队列标记");
+
                 entity.Property(e => e.ReturnMoney).HasColumnType("decimal(18,2)");
 
                 entity.Property(e => e.SeoDescription)
@@ -6761,6 +6766,18 @@ namespace MySystem.Models.Main
 
                 entity.Property(e => e.BindStatus).HasColumnType("int(11)");
 
+                entity.Property(e => e.BriefIntroduction)
+                    .HasColumnType("longtext")
+                    .HasComment("简介")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.BusinessHours)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("营业时间段")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.CreateDate).HasColumnType("datetime");
 
                 entity.Property(e => e.CreateMan)
@@ -6768,6 +6785,10 @@ namespace MySystem.Models.Main
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.EndTime)
+                    .HasColumnType("datetime")
+                    .HasComment("营业结束时间");
+
                 entity.Property(e => e.ExamineStatus)
                     .HasColumnType("int(11)")
                     .HasComment("服务费考核状态");
@@ -6784,6 +6805,10 @@ namespace MySystem.Models.Main
 
                 entity.Property(e => e.LastConsumeDate).HasColumnType("datetime");
 
+                entity.Property(e => e.Latitude)
+                    .HasColumnType("decimal(18,8)")
+                    .HasComment("纬度");
+
                 entity.Property(e => e.LoginPwd)
                     .HasColumnType("varchar(32)")
                     .HasCharSet("utf8")
@@ -6794,6 +6819,10 @@ namespace MySystem.Models.Main
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.Longitude)
+                    .HasColumnType("decimal(18,8)")
+                    .HasComment("经度");
+
                 entity.Property(e => e.Mobile)
                     .HasColumnType("varchar(11)")
                     .HasCharSet("utf8")
@@ -6813,6 +6842,10 @@ namespace MySystem.Models.Main
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.Popularity)
+                    .HasColumnType("int(11)")
+                    .HasComment("人气值");
+
                 entity.Property(e => e.QueryCount).HasColumnType("int(11)");
 
                 entity.Property(e => e.SeoDescription)
@@ -6836,6 +6869,10 @@ namespace MySystem.Models.Main
 
                 entity.Property(e => e.Sort).HasColumnType("int(11)");
 
+                entity.Property(e => e.StartTime)
+                    .HasColumnType("datetime")
+                    .HasComment("营业开始时间");
+
                 entity.Property(e => e.Status).HasColumnType("int(11)");
 
                 entity.Property(e => e.TotalActActual).HasColumnType("decimal(18,2)");

+ 6 - 0
Models/Main1/ConsumerOrders.cs

@@ -29,5 +29,11 @@ namespace MySystem.Models.Main1
         public ulong IsAct { get; set; }
         public int UserId { get; set; }
         public decimal MerchantActualAmount { get; set; }
+        public string DivideLog { get; set; }
+        public string TradePayNo { get; set; }
+        public int SetRecordId { get; set; }
+        public int DivideFlag { get; set; }
+        public DateTime? DivideDate { get; set; }
+        public ulong ReturnFlag { get; set; }
     }
 }

+ 24 - 0
Models/Main1/CustomQuery.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models.Main1
+{
+    public partial class CustomQuery
+    {
+        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 AdminNames { get; set; }
+        public string Title { get; set; }
+        public string SqlContent { get; set; }
+    }
+}

+ 21 - 0
Models/Main1/ExportExcels.cs

@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models.Main1
+{
+    public partial class ExportExcels
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public string FileName { get; set; }
+        public int SysId { get; set; }
+        public string FileUrl { get; set; }
+    }
+}

+ 1 - 0
Models/Main1/MerchantAddInfo.cs

@@ -144,5 +144,6 @@ namespace MySystem.Models.Main1
         public string OutMchtNo { get; set; }
         public string AliMerchantId { get; set; }
         public string WeChatMerchantId { get; set; }
+        public string MerchantType { get; set; }
     }
 }

+ 29 - 0
Models/Main1/MerchantDepositBack.cs

@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models.Main1
+{
+    public partial class MerchantDepositBack
+    {
+        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 int UserId { get; set; }
+        public string ApplyNo { get; set; }
+        public int ReturnWay { get; set; }
+        public decimal ReturnAmount { get; set; }
+        public string BankCardNo { get; set; }
+        public string AlipayAccountNo { get; set; }
+        public int MerchantId { get; set; }
+    }
+}

+ 25 - 0
Models/Main1/MerchantDepositOrder.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models.Main1
+{
+    public partial class MerchantDepositOrder
+    {
+        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 OrderNo { get; set; }
+        public decimal ActPayPrice { get; set; }
+        public int UserId { get; set; }
+        public int MerchantId { get; set; }
+    }
+}

+ 12 - 0
Models/Main1/MerchantInfo.cs

@@ -43,5 +43,17 @@ namespace MySystem.Models.Main1
         public int ActStat { get; set; }
         public DateTime? SignDate { get; set; }
         public decimal AllocationAmount { get; set; }
+        public decimal ActMaxAmount { get; set; }
+        public decimal ActCurrentAmount { get; set; }
+        public int IsAct { get; set; }
+        public int ExamineStatus { get; set; }
+        public int Months { get; set; }
+        public DateTime? EndTime { get; set; }
+        public DateTime? StartTime { get; set; }
+        public string BusinessHours { get; set; }
+        public string BriefIntroduction { get; set; }
+        public int Popularity { get; set; }
+        public decimal Latitude { get; set; }
+        public decimal Longitude { get; set; }
     }
 }

+ 34 - 0
Models/Main1/MerchantParamSetRecord.cs

@@ -0,0 +1,34 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models.Main1
+{
+    public partial class MerchantParamSetRecord
+    {
+        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 AfterDiviPersons { get; set; }
+        public decimal AfterDiviPercent { get; set; }
+        public int AfterProfitDays { get; set; }
+        public decimal AfterGetPercent { get; set; }
+        public decimal AfterMinPayMoney { get; set; }
+        public int AfterIsAll { get; set; }
+        public int MerchantId { get; set; }
+        public int BeforeDiviPersons { get; set; }
+        public decimal BeforeDiviPercent { get; set; }
+        public int BeforeProfitDays { get; set; }
+        public decimal BeforeGetPercent { get; set; }
+        public decimal BeforeMinPayMoney { get; set; }
+        public int BeforeIsAll { get; set; }
+    }
+}

+ 2 - 2
Models/Main1/MerchantTradeSummary.cs

@@ -17,14 +17,14 @@ namespace MySystem.Models.Main1
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }
+        public decimal AliPayInFactAmount { get; set; }
+        public decimal WeChatInfactAmount { get; set; }
         public int OderCount { get; set; }
         public decimal InFactAmount { get; set; }
         public decimal TradeAmount { get; set; }
         public string TradeDate { get; set; }
         public string TradeMonth { get; set; }
         public int MerchantId { get; set; }
-        public decimal AliPayInFactAmount { get; set; }
-        public decimal WeChatInfactAmount { get; set; }
         public decimal ActAmount { get; set; }
         public decimal NonActAmount { get; set; }
     }

+ 23 - 0
Models/Main1/SysWithdrawalApplyRecord.cs

@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models.Main1
+{
+    public partial class SysWithdrawalApplyRecord
+    {
+        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 AccountNo { get; set; }
+        public string ApplyNo { get; set; }
+    }
+}

+ 570 - 2
Models/Main1/WebCMSEntities.cs

@@ -48,8 +48,10 @@ namespace MySystem.Models.Main1
         public virtual DbSet<CouponAssignRecords> CouponAssignRecords { get; set; }
         public virtual DbSet<Coupons> Coupons { get; set; }
         public virtual DbSet<CouponsForUser> CouponsForUser { get; set; }
+        public virtual DbSet<CustomQuery> CustomQuery { get; set; }
         public virtual DbSet<CustomTagSet> CustomTagSet { get; set; }
         public virtual DbSet<ErpCompanys> ErpCompanys { get; set; }
+        public virtual DbSet<ExportExcels> ExportExcels { get; set; }
         public virtual DbSet<FileUpdateInfo> FileUpdateInfo { get; set; }
         public virtual DbSet<FluxProfitDetail> FluxProfitDetail { get; set; }
         public virtual DbSet<FluxProfitSummary> FluxProfitSummary { get; set; }
@@ -92,6 +94,8 @@ namespace MySystem.Models.Main1
         public virtual DbSet<MerchantClass> MerchantClass { get; set; }
         public virtual DbSet<MerchantCol> MerchantCol { get; set; }
         public virtual DbSet<MerchantComment> MerchantComment { get; set; }
+        public virtual DbSet<MerchantDepositBack> MerchantDepositBack { get; set; }
+        public virtual DbSet<MerchantDepositOrder> MerchantDepositOrder { get; set; }
         public virtual DbSet<MerchantDepositReturns> MerchantDepositReturns { get; set; }
         public virtual DbSet<MerchantDepositSet> MerchantDepositSet { get; set; }
         public virtual DbSet<MerchantDiviSummay> MerchantDiviSummay { get; set; }
@@ -101,6 +105,7 @@ namespace MySystem.Models.Main1
         public virtual DbSet<MerchantInfo> MerchantInfo { get; set; }
         public virtual DbSet<MerchantLoginInfo> MerchantLoginInfo { get; set; }
         public virtual DbSet<MerchantParamSet> MerchantParamSet { get; set; }
+        public virtual DbSet<MerchantParamSetRecord> MerchantParamSetRecord { get; set; }
         public virtual DbSet<MerchantQrCode> MerchantQrCode { get; set; }
         public virtual DbSet<MerchantRebateDetail> MerchantRebateDetail { get; set; }
         public virtual DbSet<MerchantTradeSummary> MerchantTradeSummary { get; set; }
@@ -212,6 +217,7 @@ namespace MySystem.Models.Main1
         public virtual DbSet<SysAdminRole> SysAdminRole { get; set; }
         public virtual DbSet<SysLog> SysLog { get; set; }
         public virtual DbSet<SysRechargeRecord> SysRechargeRecord { get; set; }
+        public virtual DbSet<SysWithdrawalApplyRecord> SysWithdrawalApplyRecord { get; set; }
         public virtual DbSet<SystemSet> SystemSet { get; set; }
         public virtual DbSet<TeamApply> TeamApply { get; set; }
         public virtual DbSet<TeamApplyForTeamName> TeamApplyForTeamName { get; set; }
@@ -2255,6 +2261,20 @@ namespace MySystem.Models.Main1
 
                 entity.Property(e => e.CurDivi).HasColumnType("decimal(18,2)");
 
+                entity.Property(e => e.DivideDate)
+                    .HasColumnType("datetime")
+                    .HasComment("提交分账时间");
+
+                entity.Property(e => e.DivideFlag)
+                    .HasColumnType("int(11)")
+                    .HasComment("分账标记");
+
+                entity.Property(e => e.DivideLog)
+                    .HasColumnType("mediumtext")
+                    .HasComment("分账结果日志")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.IsAct)
                     .HasColumnType("bit(1)")
                     .HasDefaultValueSql("b'0'");
@@ -2278,6 +2298,11 @@ namespace MySystem.Models.Main1
 
                 entity.Property(e => e.QueryCount).HasColumnType("int(11)");
 
+                entity.Property(e => e.ReturnFlag)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'")
+                    .HasComment("返现队列标记");
+
                 entity.Property(e => e.ReturnMoney).HasColumnType("decimal(18,2)");
 
                 entity.Property(e => e.SeoDescription)
@@ -2295,6 +2320,10 @@ namespace MySystem.Models.Main1
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.SetRecordId)
+                    .HasColumnType("int(11)")
+                    .HasComment("活动记录Id");
+
                 entity.Property(e => e.SnNo)
                     .HasColumnType("varchar(50)")
                     .HasCharSet("utf8")
@@ -2304,6 +2333,12 @@ namespace MySystem.Models.Main1
 
                 entity.Property(e => e.Status).HasColumnType("int(11)");
 
+                entity.Property(e => e.TradePayNo)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("支付交易号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.UpdateDate).HasColumnType("datetime");
 
                 entity.Property(e => e.UpdateMan)
@@ -2725,6 +2760,82 @@ namespace MySystem.Models.Main1
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<CustomQuery>(entity =>
+            {
+                entity.HasComment("自定义查询");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.AdminNames)
+                    .HasColumnType("varchar(500)")
+                    .HasComment("后台账号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                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.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.SqlContent)
+                    .HasColumnType("mediumtext")
+                    .HasComment("sql语句")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Status)
+                    .HasColumnType("int(11)")
+                    .HasComment("状态");
+
+                entity.Property(e => e.Title)
+                    .HasColumnType("varchar(50)")
+                    .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.Version)
+                    .HasColumnType("int(11)")
+                    .HasComment("版本号");
+            });
+
             modelBuilder.Entity<CustomTagSet>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -2839,6 +2950,48 @@ namespace MySystem.Models.Main1
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<ExportExcels>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.FileName)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.FileUrl)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.SysId).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+            });
+
             modelBuilder.Entity<FileUpdateInfo>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -5308,7 +5461,7 @@ namespace MySystem.Models.Main1
                     .HasCollation("utf8_general_ci");
 
                 entity.Property(e => e.BizStoreAddress)
-                    .HasColumnType("varchar(50)")
+                    .HasColumnType("varchar(100)")
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
@@ -5502,6 +5655,12 @@ namespace MySystem.Models.Main1
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.MerchantType)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("商户类型")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.MiniProgramAppid)
                     .HasColumnType("varchar(50)")
                     .HasCharSet("utf8")
@@ -5816,7 +5975,7 @@ namespace MySystem.Models.Main1
                     .HasCollation("utf8_general_ci");
 
                 entity.Property(e => e.WeChatSignUrl)
-                    .HasColumnType("longtext")
+                    .HasColumnType("varchar(500)")
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
@@ -6283,6 +6442,180 @@ namespace MySystem.Models.Main1
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<MerchantDepositBack>(entity =>
+            {
+                entity.HasComment("商户服务费退还记录");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.AlipayAccountNo)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("支付宝账号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ApplyNo)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("申请单号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.BankCardNo)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("银行卡号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                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.MerchantId)
+                    .HasColumnType("int(11)")
+                    .HasComment("商户Id");
+
+                entity.Property(e => e.QueryCount)
+                    .HasColumnType("int(11)")
+                    .HasComment("点击量");
+
+                entity.Property(e => e.Remark)
+                    .HasColumnType("varchar(200)")
+                    .HasComment("备注")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ReturnAmount)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("退还金额");
+
+                entity.Property(e => e.ReturnWay)
+                    .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.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("创客Id");
+
+                entity.Property(e => e.Version)
+                    .HasColumnType("int(11)")
+                    .HasComment("版本号");
+            });
+
+            modelBuilder.Entity<MerchantDepositOrder>(entity =>
+            {
+                entity.HasComment("商户服务费缴纳记录");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ActPayPrice)
+                    .HasColumnType("decimal(18,2)")
+                    .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.MerchantId)
+                    .HasColumnType("int(11)")
+                    .HasComment("商户Id");
+
+                entity.Property(e => e.OrderNo)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("订单号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                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.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("创客Id");
+
+                entity.Property(e => e.Version)
+                    .HasColumnType("int(11)")
+                    .HasComment("版本号");
+            });
+
             modelBuilder.Entity<MerchantDepositReturns>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -6503,6 +6836,14 @@ namespace MySystem.Models.Main1
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
 
+                entity.Property(e => e.ActCurrentAmount)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("活动已返金额");
+
+                entity.Property(e => e.ActMaxAmount)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("活动应返金额");
+
                 entity.Property(e => e.ActStat)
                     .HasColumnType("int(11)")
                     .HasComment("激活统计标记");
@@ -6529,6 +6870,18 @@ namespace MySystem.Models.Main1
 
                 entity.Property(e => e.BindStatus).HasColumnType("int(11)");
 
+                entity.Property(e => e.BriefIntroduction)
+                    .HasColumnType("longtext")
+                    .HasComment("简介")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.BusinessHours)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("营业时间段")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.CreateDate).HasColumnType("datetime");
 
                 entity.Property(e => e.CreateMan)
@@ -6536,6 +6889,18 @@ namespace MySystem.Models.Main1
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.EndTime)
+                    .HasColumnType("datetime")
+                    .HasComment("营业结束时间");
+
+                entity.Property(e => e.ExamineStatus)
+                    .HasColumnType("int(11)")
+                    .HasComment("服务费考核状态");
+
+                entity.Property(e => e.IsAct)
+                    .HasColumnType("int(11)")
+                    .HasComment("商户激活标记");
+
                 entity.Property(e => e.IsAuth)
                     .HasColumnType("bit(1)")
                     .HasDefaultValueSql("b'0'");
@@ -6544,6 +6909,10 @@ namespace MySystem.Models.Main1
 
                 entity.Property(e => e.LastConsumeDate).HasColumnType("datetime");
 
+                entity.Property(e => e.Latitude)
+                    .HasColumnType("decimal(18,8)")
+                    .HasComment("纬度");
+
                 entity.Property(e => e.LoginPwd)
                     .HasColumnType("varchar(32)")
                     .HasCharSet("utf8")
@@ -6554,11 +6923,19 @@ namespace MySystem.Models.Main1
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.Longitude)
+                    .HasColumnType("decimal(18,8)")
+                    .HasComment("经度");
+
                 entity.Property(e => e.Mobile)
                     .HasColumnType("varchar(11)")
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.Months)
+                    .HasColumnType("int(11)")
+                    .HasComment("达标月数");
+
                 entity.Property(e => e.Name)
                     .HasColumnType("varchar(50)")
                     .HasCharSet("utf8")
@@ -6569,6 +6946,10 @@ namespace MySystem.Models.Main1
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.Popularity)
+                    .HasColumnType("int(11)")
+                    .HasComment("人气值");
+
                 entity.Property(e => e.QueryCount).HasColumnType("int(11)");
 
                 entity.Property(e => e.SeoDescription)
@@ -6592,6 +6973,10 @@ namespace MySystem.Models.Main1
 
                 entity.Property(e => e.Sort).HasColumnType("int(11)");
 
+                entity.Property(e => e.StartTime)
+                    .HasColumnType("datetime")
+                    .HasComment("营业开始时间");
+
                 entity.Property(e => e.Status).HasColumnType("int(11)");
 
                 entity.Property(e => e.TotalActActual).HasColumnType("decimal(18,2)");
@@ -6746,6 +7131,116 @@ namespace MySystem.Models.Main1
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<MerchantParamSetRecord>(entity =>
+            {
+                entity.HasComment("商户活动配置历史记录");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.AfterDiviPercent)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("修改后最大分红比例");
+
+                entity.Property(e => e.AfterDiviPersons)
+                    .HasColumnType("int(11)")
+                    .HasComment("修改后单笔订单分红人数");
+
+                entity.Property(e => e.AfterGetPercent)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("修改后商家实收比例");
+
+                entity.Property(e => e.AfterIsAll)
+                    .HasColumnType("int(11)")
+                    .HasComment("修改后是否收全额");
+
+                entity.Property(e => e.AfterMinPayMoney)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("修改后订单参与门槛");
+
+                entity.Property(e => e.AfterProfitDays)
+                    .HasColumnType("int(11)")
+                    .HasComment("修改后分红期限(天)");
+
+                entity.Property(e => e.BeforeDiviPercent)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("修改前最大分红比例");
+
+                entity.Property(e => e.BeforeDiviPersons)
+                    .HasColumnType("int(11)")
+                    .HasComment("修改前单笔订单分红人数");
+
+                entity.Property(e => e.BeforeGetPercent)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("修改前商家实收比例");
+
+                entity.Property(e => e.BeforeIsAll)
+                    .HasColumnType("int(11)")
+                    .HasComment("修改前是否收全额");
+
+                entity.Property(e => e.BeforeMinPayMoney)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("修改前订单参与门槛");
+
+                entity.Property(e => e.BeforeProfitDays)
+                    .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.MerchantId)
+                    .HasColumnType("int(11)")
+                    .HasComment("商户Id");
+
+                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.UpdateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("更新时间");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("更新人")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version)
+                    .HasColumnType("int(11)")
+                    .HasComment("版本号");
+            });
+
             modelBuilder.Entity<MerchantQrCode>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -14623,6 +15118,76 @@ namespace MySystem.Models.Main1
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<SysWithdrawalApplyRecord>(entity =>
+            {
+                entity.HasComment("润观米提现申请记录");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.AccountNo)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("账户号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ApplyNo)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("申请单号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                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.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.UpdateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("更新时间");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("更新人")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version)
+                    .HasColumnType("int(11)")
+                    .HasComment("版本号");
+            });
+
             modelBuilder.Entity<SystemSet>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -16048,6 +16613,9 @@ namespace MySystem.Models.Main1
 
             modelBuilder.Entity<UserAmountSummary>(entity =>
             {
+                entity.HasIndex(e => new { e.UserId, e.IsAct, e.TradeMonth, e.TradeDate, e.SeoTitle })
+                    .HasName("UserAmountSummaryIndex");
+
                 entity.Property(e => e.Id).HasColumnType("int(11)");
 
                 entity.Property(e => e.CreateDate).HasColumnType("datetime");

+ 38 - 0
Models/Tables/TmpOrder.cs

@@ -0,0 +1,38 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class TmpOrder
+    {
+        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 CurDivi { get; set; }
+        public decimal MaxDivi { get; set; }
+        public string SnNo { get; set; }
+        public decimal ReturnMoney { get; set; }
+        public decimal PayMoney { get; set; }
+        public int PayMode { get; set; }
+        public string OrderNo { get; set; }
+        public int ConsumerId { get; set; }
+        public int MerchantId { get; set; }
+        public ulong IsAct { get; set; }
+        public int UserId { get; set; }
+        public decimal MerchantActualAmount { get; set; }
+        public string DivideLog { get; set; }
+        public string TradePayNo { get; set; }
+        public int SetRecordId { get; set; }
+        public int DivideFlag { get; set; }
+        public DateTime? DivideDate { get; set; }
+    }
+}

+ 1 - 0
Startup.cs

@@ -161,6 +161,7 @@ namespace MySystem
                 ProfitHelper.Instance.StartListenWxTrade(); //返现队列-微信
                 ProfitHelper.Instance.StartSetDivi(); //设置订单当前返现金额
                 ProfitHelper.Instance.StartListenProfit(); //每月分润
+                ProfitCheckHelper.Instance.Start(); //检查订单是否在队列里
 
                 AlipayPayBackFeeService.Instance.Start();
                 ActiveRewardService.Instance.StartAct();

+ 69 - 0
Util/HaoDa/ProfitCheckHelper.cs

@@ -0,0 +1,69 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Data;
+using MySystem.Models.Main;
+using Library;
+using System.Threading;
+using Microsoft.Extensions.Hosting;
+using System.Threading.Tasks;
+using LitJson;
+
+namespace MySystem
+{
+    public class ProfitCheckHelper
+    {
+        public readonly static ProfitCheckHelper Instance = new ProfitCheckHelper();
+        private ProfitCheckHelper()
+        {
+        }
+
+        #region 检查订单是否在队列里
+        public void Start()
+        {
+            Thread th = new Thread(StartDo);
+            th.IsBackground = true;
+            th.Start();
+        }
+        public void StartDo()
+        {
+            while (true)
+            {
+                string orderidstring = RedisDbconn.Instance.RPop<string>("ConsumerProfitCheck");
+                if (!string.IsNullOrEmpty(orderidstring))
+                {
+                    DoSomeThing(orderidstring);
+                    Thread.Sleep(2000);
+                }
+                else
+                {
+                    Thread.Sleep(60000);
+                }
+            }
+        }
+
+        public void DoSomeThing(string orderidstring)
+        { 
+            try
+            {
+                int orderId = int.Parse(function.CheckInt(orderidstring));
+                WebCMSEntities db = new WebCMSEntities();
+                ConsumerOrders order = db.ConsumerOrders.FirstOrDefault(m => m.Id == orderId);
+                if(order != null)
+                {
+                    var list = RedisDbconn.Instance.GetList<ConsumerOrders>("ConsumerOrdersHd:Divi:" + order.PayMode + ":" + order.MerchantId);
+                    if(!list.Any(m => m.Id == orderId) && !db.ConsumerProfit.Any(m => m.OrderId == orderId))
+                    {
+                        RedisDbconn.Instance.AddList("ConsumerOrdersHd:Divi:" + order.PayMode + ":List", order.Id.ToString());
+                    }
+                }
+                db.Dispose();
+            }
+            catch(Exception ex)
+            {
+                function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "检查订单是否在队列里异常");
+            }
+        }
+        #endregion
+    }
+}

+ 46 - 19
Util/HaoDa/ProfitHelper.cs

@@ -8,6 +8,7 @@ using System.Threading;
 using Microsoft.Extensions.Hosting;
 using System.Threading.Tasks;
 using LitJson;
+using MySystem.Models;
 
 namespace MySystem
 {
@@ -108,7 +109,10 @@ namespace MySystem
                                 {
                                     function.WriteLog("返现队列开始", "返现逻辑日志");
                                     RedisDbconn.Instance.AddRightList("ConsumerOrdersHd:Divi:" + PayMode + ":" + order.MerchantId, order);
+                                    order.ReturnFlag = 1;
+                                    db.SaveChanges();
                                     DiviMoney = DiviMoney / DiviPersons;
+                                    DiviMoney = Math.Round(DiviMoney, 2);
                                     List<int> deletes = new List<int>();
                                     long CurDiviPersons = DiviPersons;
                                     long QueueCount = RedisDbconn.Instance.Count("ConsumerOrdersHd:Divi:" + PayMode + ":" + MerchantId);
@@ -123,7 +127,6 @@ namespace MySystem
                                     }
 
                                     // 减去自己付的订单
-                                    int OutCount = 0; // 出局人数
                                     List<int> orderids = new List<int>();
                                     function.WriteLog("人数:" + CurDiviPersons, "返现逻辑日志");
                                     while (CurDiviPersons > 0)
@@ -131,11 +134,12 @@ namespace MySystem
                                         ConsumerOrders suborder = RedisDbconn.Instance.RPop<ConsumerOrders>("ConsumerOrdersHd:Divi:" + PayMode + ":" + MerchantId);
                                         if (suborder != null)
                                         {
+                                            decimal TmpCurDivi = suborder.CurDivi;
                                             function.WriteLog("返现对象订单:" + suborder.Id, "返现逻辑日志");
                                             MerchantParamSet subset = Newtonsoft.Json.JsonConvert.DeserializeObject<MerchantParamSet>(suborder.SeoDescription);
                                             int subProfitDays = subset.ProfitDays; //分红期限(天)
                                             bool IsOut = suborder.UpdateDate.Value.AddDays(subProfitDays) < DateTime.Now ? true : false;
-                                            if (suborder.CurDivi < suborder.MaxDivi && !IsOut)
+                                            if (suborder.CurDivi < suborder.MaxDivi && suborder.MaxDivi - suborder.CurDivi >= 0.01M && !IsOut)
                                             {
                                                 function.WriteLog("没出局:" + suborder.CurDivi + "--" + suborder.MaxDivi, "返现逻辑日志");
                                                 //如果没过期并且当前退款金额没超过最大退款金额,就执行
@@ -151,6 +155,7 @@ namespace MySystem
                                                     MerchantAddInfo merchantAdd = db.MerchantAddInfo.FirstOrDefault(m => m.Id == suborder.MerchantId) ?? new MerchantAddInfo();
                                                     
                                                     //聚合支付退款
+                                                    bool BackStatus = false;
                                                     decimal RefundAmount = GetMoney * 100;
                                                     RefundAmount = Math.Round(RefundAmount, 2);
                                                     if(!orderids.Contains(suborder.Id))
@@ -158,7 +163,7 @@ namespace MySystem
                                                         function.WriteLog("请求退款接口", "返现逻辑日志");
                                                         string RefundNo = "HDTK" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8);
                                                         var info = HaoDaHelper.Instance.AggregatedPayRefund(merchantAdd.OutMchtNo, merchantAdd.StoreNo, RefundNo, suborder.OrderNo, RefundAmount.ToString("f0"));
-                                                        if(info.Contains("\"resultCode\":\"1\""))
+                                                        if(info.Contains("\"resultCode\":\"1\"") && info.Contains("\"tradeStatus\":\"2\""))
                                                         {
                                                             db.ConsumerProfit.Add(new ConsumerProfit()
                                                             {
@@ -174,33 +179,54 @@ namespace MySystem
                                                                 SeoDescription = RefundNo,
                                                             });
                                                             db.SaveChanges();
+                                                            BackStatus = true;
                                                         }
                                                         function.WriteLog("接口返回:" + info, "返现逻辑日志");
                                                         orderids.Add(suborder.Id);
                                                     }
 
-                                                    merchant.ActCurrentAmount += Math.Round(GetMoney, 2); //活动已返金额
-                                                    db.SaveChanges();
-                                                    function.WriteLog(suborder.CurDivi + ":" + suborder.MaxDivi, "返现逻辑日志");
-                                                    if (suborder.CurDivi < suborder.MaxDivi)
-                                                    {
-                                                        function.WriteLog("返现未达最大值继续", "返现逻辑日志");
-                                                        RedisDbconn.Instance.AddList("ConsumerOrdersHd:Divi:" + PayMode + ":" + MerchantId, suborder);
-                                                    }
-                                                    else
+                                                    if(BackStatus)
                                                     {
-                                                        function.WriteLog("返现达最大值,出局", "返现逻辑日志");
-                                                        // RedisDbconn.Instance.DelFromList("ConsumerOrdersHd:Divi:" + PayMode + ":" + MerchantId, suborder);
-                                                        OutCount += 1;
+                                                        merchant.ActCurrentAmount += Math.Round(GetMoney, 2); //活动已返金额
+                                                        db.SaveChanges();
+                                                        function.WriteLog(suborder.CurDivi + ":" + suborder.MaxDivi, "返现逻辑日志");
+                                                        if (suborder.CurDivi < suborder.MaxDivi)
+                                                        {
+                                                            function.WriteLog("返现未达最大值继续", "返现逻辑日志");
+                                                            // RedisDbconn.Instance.AddList("ConsumerOrdersHd:Divi:" + PayMode + ":" + MerchantId, suborder);
+                                                            RedisDbconn.Instance.SetList("ConsumerOrdersHd:Divi:" + PayMode + ":" + MerchantId, 0, suborder);
+                                                            RedisDbconn.Instance.AddList("ConsumerOrdersSetDiviHd", "{\"OrderId\":\"" + suborder.Id + "\",\"DiviAmt\":\"" + suborder.CurDivi + "\"}");
+                                                        }
+                                                        else
+                                                        {
+                                                            suborder.CurDivi = TmpCurDivi;
+                                                            function.WriteLog("返现达最大值,出局", "返现逻辑日志");
+                                                            ConsumerOrders editOrder = db.ConsumerOrders.FirstOrDefault(m => m.Id == suborder.Id);
+                                                            if (editOrder != null)
+                                                            {
+                                                                editOrder.ReturnFlag = 0;
+                                                                db.SaveChanges();
+                                                                RedisDbconn.Instance.AddList("ConsumerOrdersSetDiviHd", "{\"OrderId\":\"" + suborder.Id + "\",\"DiviAmt\":\"" + suborder.MaxDivi + "\"}");
+                                                            }
+                                                            RedisDbconn.Instance.DelFromList("ConsumerOrdersHd:Divi:" + PayMode + ":" + MerchantId, suborder);
+                                                        }
                                                     }
                                                     Thread.Sleep(1000);
-
-                                                    RedisDbconn.Instance.AddList("ConsumerOrdersSetDiviHd", "{\"OrderId\":\"" + suborder.Id + "\",\"DiviAmt\":\"" + suborder.CurDivi + "\"}");
                                                 }
                                             }
                                             else
                                             {
                                                 //否者计算人数不计入退款名额
+                                                suborder.CurDivi = TmpCurDivi;
+                                                function.WriteLog("返现达最大值,出局", "返现逻辑日志");
+                                                ConsumerOrders editOrder = db.ConsumerOrders.FirstOrDefault(m => m.Id == suborder.Id);
+                                                if (editOrder != null)
+                                                {
+                                                    editOrder.ReturnFlag = 0;
+                                                    db.SaveChanges();
+                                                    RedisDbconn.Instance.AddList("ConsumerOrdersSetDiviHd", "{\"OrderId\":\"" + suborder.Id + "\",\"DiviAmt\":\"" + suborder.MaxDivi + "\"}");
+                                                }
+                                                RedisDbconn.Instance.DelFromList("ConsumerOrdersHd:Divi:" + PayMode + ":" + MerchantId, suborder);
                                                 CurDiviPersons += 1;
                                                 function.WriteLog("出局:CurDiviPersons:" + CurDiviPersons, "返现逻辑日志");
                                             }
@@ -222,8 +248,9 @@ namespace MySystem
                 }
                 catch (Exception ex)
                 {
-                    LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ":" + ex.ToString(), "自定义分润程序监听队列异常");
+                    LogHelper.Instance.WriteLog(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + ":" + ex.ToString(), "分红返现异常");
                     tran.Rollback();
+                    RedisDbconn.Instance.AddList("ConsumerProfitCheck", orderidstring);
                 }
             }
             db.Dispose();            
@@ -519,7 +546,7 @@ namespace MySystem
         {
             while (true)
             {
-                string content = RedisDbconn.Instance.RPop<string>("ConsumerOrdersSetDivi");
+                string content = RedisDbconn.Instance.RPop<string>("ConsumerOrdersSetDiviHd");
                 if (!string.IsNullOrEmpty(content))
                 {
                     SetDivi(content);

+ 1 - 2
Util/RedisDbconn.cs

@@ -127,8 +127,7 @@ namespace MySystem
         #region 修改列表对象
         public bool SetList(string key, int index, object value)
         {
-            long itemindex = RedisHelper.LLen(key) - index - 1;
-            return RedisHelper.LSet(key, itemindex, value);
+            return RedisHelper.LSet(key, index, value);
             // return false;
         }
         #endregion