lcl 1 год назад
Родитель
Сommit
12433d4af1

+ 73 - 0
AppStart/Helper/AlipayPayBackFeeService.cs

@@ -0,0 +1,73 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Data;
+using System.Threading;
+using MySystem.Models;
+using Library;
+using LitJson;
+
+namespace MySystem
+{
+    public class AlipayPayBackFeeService
+    {
+        public readonly static AlipayPayBackFeeService Instance = new AlipayPayBackFeeService();
+        private AlipayPayBackFeeService()
+        { }
+
+
+        public void Start()
+        {
+            Thread th = new Thread(dosomething);
+            th.IsBackground = true;
+            th.Start();
+        }
+        
+        private void dosomething()
+        { 
+            bool op = true;
+            while (op)
+            {
+                string content = RedisDbconn.Instance.RPop<string>("AlipayCallBack1");
+                if (!string.IsNullOrEmpty(content))
+                {
+                    try
+                    {
+                        sloveAlipayCallBack(content);
+                    }
+                    catch(Exception ex)
+                    {
+                        function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "直联支付宝支付回调异常");
+                    }
+                }
+                else
+                {
+                    Thread.Sleep(2000);
+                }
+            }
+        }
+
+        public void sloveAlipayCallBack(string content)
+        { 
+            JsonData jsonObj = JsonMapper.ToObject(content);
+            string OrderNo = jsonObj["out_trade_no"].ToString();
+            string TradeNo = jsonObj["transaction_id"].ToString();
+            decimal TotalFee = decimal.Parse(function.CheckNum(jsonObj["total_fee"].ToString()));
+            WebCMSEntities db = new WebCMSEntities();
+            MerchantDepositOrder order = db.MerchantDepositOrder.FirstOrDefault(m => m.OrderNo == OrderNo && m.Status == 0);
+            if(order != null)
+            {
+                order.Status = 1;
+                order.UpdateDate = DateTime.Now;
+                MerchantInfo mer = db.MerchantInfo.FirstOrDefault(m => m.Id == order.MerchantId);
+                if(mer != null)
+                {
+                    mer.IsAct = 1;
+                }
+                db.SaveChanges();
+            }
+            db.Dispose();
+        }
+
+    }
+}

+ 29 - 0
Models/MerchantDepositBack.cs

@@ -0,0 +1,29 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    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/MerchantDepositOrder.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    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; }
+    }
+}

+ 3 - 0
Models/MerchantInfo.cs

@@ -45,5 +45,8 @@ namespace MySystem.Models
         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; }
     }
 }

+ 188 - 0
Models/WebCMSEntities.cs

@@ -92,6 +92,8 @@ namespace MySystem.Models
         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; }
@@ -6283,6 +6285,180 @@ namespace MySystem.Models
                 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)");
@@ -6544,6 +6720,14 @@ namespace MySystem.Models
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                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'");
@@ -6567,6 +6751,10 @@ namespace MySystem.Models
                     .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")

+ 2 - 0
Startup.cs

@@ -185,6 +185,8 @@ namespace MySystem
                 ProfitShareService.Instance.Start(); //分账状态监控队列,分账完成则提交返现(微信)
                 AlipayShareService.Instance.Start(); //分账状态监控队列,分账完成则提交返现(支付宝)
                 ProfitHelper.Instance.StartListenProfit(); //每月分润
+
+                AlipayPayBackFeeService.Instance.Start();
             }
             // HaoDaExtHelper.Instance.StartWeChat();
             // HaoDaExtHelper.Instance.StartAlipay();