Ver código fonte

新的激活规则
盟主储备金规则调整

lcl 1 ano atrás
pai
commit
f3f5cde106

+ 12 - 2
AppStart/Helper/AlipayPayBack2Service.cs

@@ -622,6 +622,7 @@ namespace MySystem
                                                 PosCoupons coupon = db.PosCoupons.FirstOrDefault(m => m.Id == couponId);
                                                 if(coupon != null)
                                                 {
+                                                    // TODO: 判断是否在盟主可提现记录里有没有未使用的储蓄金
                                                     coupon.LeaderUserId = puser.Id;
                                                 }
                                             }
@@ -725,7 +726,7 @@ namespace MySystem
                             if(account.LeaderReserve >= TotalPrice)
                             {
                                 OpReserve(db, order, LeaderUserId, TotalPrice, 2, 0, "推荐小盟主");
-                                OpLeaderAccount(db, order, LeaderUserId, TotalPrice);
+                                OpLeaderAccount(db, order, LeaderUserId, TotalPrice, 1, 1);
                                 LeaderUserId = 0;
                                 result = false;
                             }
@@ -879,7 +880,7 @@ namespace MySystem
             db.SaveChanges();
         }
         //操作盟主可提现余额
-        public void OpLeaderAccount(WebCMSEntities db, Orders order, int UserId, decimal Money, int Count = 1)
+        public void OpLeaderAccount(WebCMSEntities db, Orders order, int UserId, decimal Money, int Count = 1, int Kind = 0)
         {
             UserAccount account = db.UserAccount.FirstOrDefault(m => m.Id == UserId);
             if (account == null)
@@ -896,6 +897,13 @@ namespace MySystem
             {
                 ChangeType = 117;
             }
+            int LeaderId = 0;
+            decimal LeaderReserve = 0;
+            if(Kind == 1)
+            {
+                LeaderId = UserId;
+                LeaderReserve = Money * Count;
+            }
             decimal BeforeLeaderBalanceAmount = account.LeaderBalanceAmount; //变更前余额
             account.LeaderBalanceAmount += Money * Count;
             decimal AfterLeaderBalanceAmount = account.LeaderBalanceAmount; //变更后余额
@@ -909,6 +917,8 @@ namespace MySystem
                 BeforeBalanceAmount = BeforeLeaderBalanceAmount, //变更前余额
                 AfterBalanceAmount = AfterLeaderBalanceAmount, //变更后余额
                 QueryCount = order.Id,
+                LeaderId = LeaderId,
+                LeaderReserve = LeaderReserve,
             }).Entity;
             db.SaveChanges();
         }

+ 3 - 0
AppStart/Helper/SycnSpServer/SycnSpTradeService.cs

@@ -364,6 +364,9 @@ namespace MySystem
                                                 RedisDbconn.Instance.AddList("OperatePrizeQueue", pos.Id);
                                             }
                                             AlipayPayBack2Service.Instance.ActReserveBack(pos.OpId, pos.OpReserve1, pos.OpReserve2, pos.OpReserve3);
+
+                                            //补激活前的交易
+                                            RedisDbconn.Instance.AddList("AddTradeRecordByPosIdQueue", pos.Id.ToString());
                                         }
                                         if (TradeAmount > 0)
                                         {

+ 2 - 0
PxcModels/LeaderAccountRecord.cs

@@ -29,5 +29,7 @@ namespace MySystem.PxcModels
         public string CreateMan { get; set; }
         public string UpdateMan { get; set; }
         public int Version { get; set; }
+        public decimal LeaderReserve { get; set; }
+        public int LeaderId { get; set; }
     }
 }

+ 1 - 0
PxcModels/MachineApply.cs

@@ -56,5 +56,6 @@ namespace MySystem.PxcModels
         public int UserId { get; set; }
         public string ApplyNo { get; set; }
         public int OperateId { get; set; }
+        public string OutBatchNo { get; set; }
     }
 }

+ 1 - 0
PxcModels/PosMachinesTwo.cs

@@ -59,5 +59,6 @@ namespace MySystem.PxcModels
         public DateTime? RecycStartDate { get; set; }
         public string SourcePosSn { get; set; }
         public int RecycStatus { get; set; }
+        public string OutBatchNo { get; set; }
     }
 }

+ 24 - 0
PxcModels/SettlementCardChangeRecord.cs

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

+ 1 - 0
PxcModels/Users.cs

@@ -96,5 +96,6 @@ namespace MySystem.PxcModels
         public int ThisMonthSend { get; set; }
         public string BusinessLogo { get; set; }
         public string BusinessName { get; set; }
+        public DateTime? LogOutDate { get; set; }
     }
 }

+ 99 - 0
PxcModels/WebCMSEntities.cs

@@ -193,6 +193,7 @@ namespace MySystem.PxcModels
         public virtual DbSet<SchoolSignInTaskRecord> SchoolSignInTaskRecord { get; set; }
         public virtual DbSet<ServiceCenter> ServiceCenter { get; set; }
         public virtual DbSet<SetMerchantTypeRecord> SetMerchantTypeRecord { get; set; }
+        public virtual DbSet<SettlementCardChangeRecord> SettlementCardChangeRecord { get; set; }
         public virtual DbSet<SmallStoreHouse> SmallStoreHouse { get; set; }
         public virtual DbSet<SmallStoreQuotaRecord> SmallStoreQuotaRecord { get; set; }
         public virtual DbSet<SpOrderNos> SpOrderNos { get; set; }
@@ -4092,6 +4093,14 @@ namespace MySystem.PxcModels
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.LeaderId)
+                    .HasColumnType("int(11)")
+                    .HasComment("大盟主Id");
+
+                entity.Property(e => e.LeaderReserve)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("大盟主储备金");
+
                 entity.Property(e => e.ProductType).HasColumnType("int(11)");
 
                 entity.Property(e => e.QueryCount).HasColumnType("int(11)");
@@ -5003,6 +5012,12 @@ namespace MySystem.PxcModels
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.OutBatchNo)
+                    .HasColumnType("varchar(2000)")
+                    .HasComment("出库批次号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.ProductName)
                     .HasColumnType("varchar(32)")
                     .HasCharSet("utf8")
@@ -9558,6 +9573,12 @@ namespace MySystem.PxcModels
 
                 entity.Property(e => e.OrderId).HasColumnType("int(11)");
 
+                entity.Property(e => e.OutBatchNo)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("出库批次号")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.PosSn)
                     .HasColumnType("varchar(50)")
                     .HasCharSet("utf8")
@@ -13269,6 +13290,80 @@ namespace MySystem.PxcModels
                 entity.Property(e => e.UpdateDate).HasColumnType("datetime");
             });
 
+            modelBuilder.Entity<SettlementCardChangeRecord>(entity =>
+            {
+                entity.HasComment("结算卡变更记录");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.AfterCardNo)
+                    .HasColumnType("varchar(30)")
+                    .HasComment("修改后结算卡")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.BeforeCardNo)
+                    .HasColumnType("varchar(30)")
+                    .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.UserId)
+                    .HasColumnType("int(11)")
+                    .HasComment("创客Id");
+
+                entity.Property(e => e.Version)
+                    .HasColumnType("int(11)")
+                    .HasComment("版本号");
+            });
+
             modelBuilder.Entity<SmallStoreHouse>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -18812,6 +18907,10 @@ namespace MySystem.PxcModels
                     .HasColumnType("bit(1)")
                     .HasDefaultValueSql("b'0'");
 
+                entity.Property(e => e.LogOutDate)
+                    .HasColumnType("datetime")
+                    .HasComment("注销时间");
+
                 entity.Property(e => e.LoginPwd)
                     .HasColumnType("varchar(32)")
                     .HasCharSet("utf8")