Browse Source

补返现

lcl 6 months ago
parent
commit
f94da8eb5b
1 changed files with 6 additions and 100 deletions
  1. 6 100
      Controllers/HomeController.cs

+ 6 - 100
Controllers/HomeController.cs

@@ -12,6 +12,7 @@ using MySystem.Models.Main;
 using System.Text.RegularExpressions;
 using Aop.Api.Domain;
 using MySystem.Models;
+using Microsoft.Extensions.Localization;
 
 namespace MySystem.Controllers
 {
@@ -35,7 +36,7 @@ namespace MySystem.Controllers
             return "ok";
         }
 
-        public string test()
+        public string partorder()
         {
             List<string> hdorders = new List<string>();
             WebCMSEntities db = new WebCMSEntities();
@@ -117,110 +118,15 @@ namespace MySystem.Controllers
             return "ok";
         }
 
-        public string bindapp(int mid)
+        public string addreturn()
         {
-            // DataTable dt = CustomerSqlConn.dtable("select Id,MchtNo from MerchantAddInfo where HdStatus=3 and CreateDate>='2023-10-01 00:00:00' and MchtNo!='' and MchtNo is not null", AppConfig.Base.SqlConnStr);
-            // DataTable dt = CustomerSqlConn.dtable("select Id,MchtNo from MerchantAddInfo where Id=" + mid, AppConfig.Base.SqlConnStr);
-            // foreach(DataRow dr in dt.Rows)
-            // {
-            //     CheckWeChatSignService.Instance.StartDo(new QueryMerchantStatus()
-            //     {
-            //         MerchantId = dr["Id"].ToString(),
-            //         MerchantNo = dr["MchtNo"].ToString(),
-            //     });
-            // }
-
-            // Models.Main1.WebCMSEntities db1 = new Models.Main1.WebCMSEntities();
-            // WebCMSEntities db = new WebCMSEntities();
-            // MerchantAddInfo merchantadd = db.MerchantAddInfo.FirstOrDefault(m => m.Id == 1147);
-            // MerchantInfo merchant = db.MerchantInfo.FirstOrDefault(m => m.Id == 1147);
-            // string pwd = "417027";
-            // merchant.LoginPwd = function.MD532(pwd);
-            // Models.Main1.MerchantLoginInfo info = db1.MerchantLoginInfo.FirstOrDefault(m => m.LoginMobile == merchantadd.MobilePhone);
-            // if (info == null)
-            // {
-            //     info = db1.MerchantLoginInfo.Add(new Models.Main1.MerchantLoginInfo()
-            //     {
-            //         LoginMobile = merchantadd.MobilePhone,
-            //     }).Entity;
-            //     db1.SaveChanges();
-            // }
-            // info.LoginPwd = function.MD532(pwd);
-            // db1.SaveChanges();
-            // Models.Main1.MerchantAccountLinkInfo infolink = db1.MerchantAccountLinkInfo.FirstOrDefault(m => m.LoginId == info.Id && m.MerchantId == merchantadd.Id && m.Kind == 2);
-            // if (infolink == null)
-            // {
-            //     infolink = db1.MerchantAccountLinkInfo.Add(new Models.Main1.MerchantAccountLinkInfo()
-            //     {
-            //         LoginId = info.Id,
-            //         MerchantId = merchantadd.Id,
-            //         Kind = 2,
-            //     }).Entity;
-            //     db1.SaveChanges();
-            // }
-            // db1.Dispose();
-            // db.Dispose();
-
-            return "ok";
-        }
-    
-        
-        public string clearQueue(int OrderId, int MerchantId, int PayMode)
-        {
-            // List<ConsumerOrders> list = RedisDbconn.Instance.GetList<ConsumerOrders>("ConsumerOrdersHd:Divi:" + PayMode + ":" + MerchantId + "", 1, 100000);
-            // foreach(ConsumerOrders sub in list)
-            // {
-            //     if(sub.Id == OrderId)
-            //     {
-            //         RedisDbconn.Instance.DelFromList("ConsumerOrdersHd:Divi:2:1272", sub);
-            //     }
-            // }
-            return "ok";
-        }
-    
-    
-        //补返现
-        public string back(string no)
-        {
-            WebCMSEntities db = new WebCMSEntities();
-            ConsumerOrders order = db.ConsumerOrders.FirstOrDefault(m => m.OrderNo == no);
-            if(order != null)
+            List<int> ids = new List<int>();
+            foreach(int id in ids)
             {
-                List<ConsumerOrders> list = RedisDbconn.Instance.GetList<ConsumerOrders>("ConsumerOrdersHd:Divi:" + order.PayMode + ":" + order.MerchantId + "", 1, 100000);
-                ConsumerOrders check = list.FirstOrDefault(m => m.Id == order.Id);
-                bool op = db.ConsumerProfit.Any(m => m.OrderId == order.Id);
-                if(check == null)
-                {
-                    if(!op)
-                    {
-                        RedisDbconn.Instance.AddList("ConsumerOrdersHd:Divi:" + order.PayMode + ":List", order.Id.ToString());
-                    }
-                    else
-                    {
-                        RedisDbconn.Instance.AddList("ConsumerOrdersHd:Divi:" + order.PayMode + ":" + order.MerchantId, order);
-                    }
-                }
-                db.Dispose();
+                RedisDbconn.Instance.AddList("ConsumerOrdersHd:Divi:2:List", id.ToString());
             }
             return "ok";
         }
 
-        public string goonback(int mid, int pm, string date)
-        {
-            DateTime start = DateTime.Parse(date + " 00:00:00");
-            DateTime end = start.AddDays(1);
-            WebCMSEntities db = new WebCMSEntities();
-            List<ConsumerOrders> queue = RedisDbconn.Instance.GetList<ConsumerOrders>("ConsumerOrdersHd:Divi:" + pm + ":" + mid + "", 1, 100000);
-            List<ConsumerOrders> list = db.ConsumerOrders.Where(m => m.MerchantId == mid && m.PayMode == pm && m.Status > 0 && m.IsAct == 1 && m.CreateDate >= start && m.CreateDate < end).ToList();
-            foreach(ConsumerOrders sub in list)
-            {
-                if(!queue.Any(m => m.Id == sub.Id) && sub.CurDivi < sub.MaxDivi)
-                {
-                    RedisDbconn.Instance.AddList("ConsumerOrdersHd:Divi:" + pm + ":" + mid, sub);
-                }
-            }
-            db.Dispose();
-            return "ok";
-        }
     }
 }