Ver Fonte

Redis暂时梳理完毕

lcl há 2 anos atrás
pai
commit
555f1fd9ac
43 ficheiros alterados com 1730 adições e 747 exclusões
  1. 89 0
      AppStart/Redis/Mysql/MerchantAmountSummary.cs
  2. 74 0
      AppStart/Redis/Mysql/UserAmountSummary.cs
  3. 0 264
      AppStart/Redis/Mysql/UserTradeDaySummaryDbconnV2.cs
  4. 1 1
      Areas/Api/Controllers/BaseController.cs
  5. 1 9
      Areas/Api/Controllers/WeChatController.cs
  6. 17 20
      Areas/Api/Controllers/v1/MainServer/ConsumerOrdersController.cs
  7. 1 1
      Areas/Api/Controllers/v1/MainServer/ConsumersController.cs
  8. 7 8
      Areas/Api/Controllers/v1/MainServer/MerchantInfoController.cs
  9. 8 7
      Areas/Api/Controllers/v1/MainServer/PosMachinesController.cs
  10. 7 23
      Areas/Api/Controllers/v1/MainServer/ServiceCenterController.cs
  11. 1 1
      Areas/Api/Controllers/v1/MainServer/UploadParamsController.cs
  12. 1 1
      Areas/Api/Controllers/v1/MainServer/UserBackKindController.cs
  13. 20 27
      Areas/Api/Controllers/v1/MainServer/UserCardRecordController.cs
  14. 0 1
      Areas/Api/Controllers/v1/MainServer/UserCashRecordController.cs
  15. 1 1
      Areas/Api/Controllers/v1/MainServer/UserCenterIconListController.cs
  16. 1 1
      Areas/Api/Controllers/v1/MainServer/UserLevelSetController.cs
  17. 11 342
      Areas/Api/Controllers/v1/MainServer/UsersController.cs
  18. 2 0
      Config/Base.cs
  19. 1 0
      MainModels/ConsumerOrders.cs
  20. 24 0
      MainModels/MerchantAmountSummay.cs
  21. 2 0
      MainModels/PosMerchantInfoBak.cs
  22. 1 0
      MainModels/TradeRecord.cs
  23. 23 0
      MainModels/UserAmountSummary.cs
  24. 209 0
      MainModels/WebCMSEntities.cs
  25. 4 4
      Services/ActivityInfoService.cs
  26. 4 4
      Services/AdvertismentService.cs
  27. 4 4
      Services/ColService.cs
  28. 4 4
      Services/ConsumerOrdersService.cs
  29. 4 4
      Services/ConsumerProfitService.cs
  30. 132 0
      Services/ConsumersService.cs
  31. 4 4
      Services/IndexIconListService.cs
  32. 132 0
      Services/KqProductsService.cs
  33. 132 0
      Services/MerchantAmountSummayService.cs
  34. 4 4
      Services/MerchantForMobileService.cs
  35. 4 4
      Services/MerchantQrCodeService.cs
  36. 4 4
      Services/PageInfoService.cs
  37. 4 4
      Services/PosMachinesService.cs
  38. 132 0
      Services/ServiceCenterService.cs
  39. 132 0
      Services/UploadParamsService.cs
  40. 132 0
      Services/UserBackKindService.cs
  41. 132 0
      Services/UserCardForWeChatService.cs
  42. 132 0
      Services/UserCenterIconListService.cs
  43. 132 0
      Services/UserLevelSetService.cs

+ 89 - 0
AppStart/Redis/Mysql/MerchantAmountSummary.cs

@@ -0,0 +1,89 @@
+using System;
+using System.Collections.Generic;
+using Library;
+using System.Linq;
+using System.Data;
+using MySystem.MainModels;
+
+namespace MySystem
+{
+    public class MerchantAmountSummary
+    {
+        public readonly static MerchantAmountSummary Instance = new MerchantAmountSummary();
+        public MerchantAmountSummary()
+        { }
+
+        public decimal GetTrade(int MerchantId)
+        {
+            decimal amt = 0;
+            WebCMSEntities db = new WebCMSEntities();
+            bool check = db.MerchantAmountSummay.Any(m => m.MerchantId == MerchantId);
+            if (check)
+            {
+                amt = db.MerchantAmountSummay.Where(m => m.MerchantId == MerchantId).Sum(m => m.TradeAmount);
+            }
+            db.Dispose();
+            return amt;
+        }
+        public decimal GetTradeByMonth(int MerchantId, string TradeMonth)
+        {
+            decimal amt = 0;
+            WebCMSEntities db = new WebCMSEntities();
+            bool check = db.MerchantAmountSummay.Any(m => m.MerchantId == MerchantId && m.TradeMonth == TradeMonth);
+            if (check)
+            {
+                amt = db.MerchantAmountSummay.Where(m => m.MerchantId == MerchantId && m.TradeMonth == TradeMonth).Sum(m => m.TradeAmount);
+            }
+            db.Dispose();
+            return amt;
+        }
+
+        public decimal GetTradeByDate(int MerchantId, string TradeDate)
+        {
+            decimal amt = 0;
+            WebCMSEntities db = new WebCMSEntities();
+            bool check = db.MerchantAmountSummay.Any(m => m.MerchantId == MerchantId && m.TradeDate == TradeDate);
+            if (check)
+            {
+                amt = db.MerchantAmountSummay.Where(m => m.MerchantId == MerchantId && m.TradeDate == TradeDate).Sum(m => m.TradeAmount);
+            }
+            db.Dispose();
+            return amt;
+        }
+
+        public decimal GetTradeByMode(int MerchantId, int PayMode, string TradeDate)
+        {
+            decimal amt = 0;
+            WebCMSEntities db = new WebCMSEntities();
+            bool check = db.MerchantAmountSummay.Any(m => m.MerchantId == MerchantId && m.PayMode == PayMode && m.TradeDate == TradeDate);
+            if (check)
+            {
+                amt = db.MerchantAmountSummay.Where(m => m.MerchantId == MerchantId && m.PayMode == PayMode && m.TradeDate == TradeDate).Sum(m => m.TradeAmount);
+            }
+            db.Dispose();
+            return amt;
+        }
+
+        public DataTable GetTradeListByDate(int MerchantId, string TradeMonth, int PageNum, int PageSize)
+        {
+            int skipNum = 0;
+            if (PageNum > 1)
+            {
+                skipNum = PageSize * (PageNum - 1);
+            }
+            DataTable dt = CustomerSqlConn.dtable("select TradeDate,sum(if(PayMode=1, TradeAmount, 0)),sum(if(PayMode=2, TradeAmount, 0)),sum(TradeAmount),sum(QueryCount) from MerchantAmountSummay where MerchantId=1 and TradeMonth='" + TradeMonth + "' group by TradeDate order by TradeDate desc limit " + skipNum + "," + PageSize, AppConfig.Base.SqlConnStr);
+            return dt;
+        }
+
+        public DataTable GetTradeListByMonth(int MerchantId, int PageNum, int PageSize)
+        {
+            int skipNum = 0;
+            if (PageNum > 1)
+            {
+                skipNum = PageSize * (PageNum - 1);
+            }
+            DataTable dt = CustomerSqlConn.dtable("select TradeMonth,sum(if(PayMode=1, TradeAmount, 0)),sum(if(PayMode=2, TradeAmount, 0)),sum(TradeAmount),sum(QueryCount) from MerchantAmountSummay where MerchantId=1 group by TradeMonth order by TradeMonth desc limit " + skipNum + "," + PageSize, AppConfig.Base.SqlConnStr);
+            return dt;
+        }
+    }
+}

+ 74 - 0
AppStart/Redis/Mysql/UserAmountSummary.cs

@@ -0,0 +1,74 @@
+using System;
+using System.Collections.Generic;
+using Library;
+using System.Linq;
+using MySystem.MainModels;
+
+namespace MySystem
+{
+    public class UserAmountSummary
+    {
+        public readonly static UserAmountSummary Instance = new UserAmountSummary();
+        public UserAmountSummary()
+        { }
+
+        public decimal GetTrade(int UserId, string kind = "self")
+        {
+            decimal amt = 0;
+            WebCMSEntities db = new WebCMSEntities();
+            bool check = db.UserAmountSummary.Any(m => m.UserId == UserId && m.SeoTitle == kind);
+            if (check)
+            {
+                if (kind == "self")
+                {
+                    amt = db.UserAmountSummary.Where(m => m.UserId == UserId && m.SeoTitle == kind).Sum(m => m.TotalAmount);
+                }
+                else if (kind == "team")
+                {
+                    amt = db.UserAmountSummary.Where(m => m.UserId == UserId && m.SeoTitle == kind).Sum(m => m.TotalAmount);
+                }
+            }
+            db.Dispose();
+            return amt;
+        }
+        public decimal GetTradeByMonth(int UserId, string TradeMonth, string kind = "self")
+        {
+            decimal amt = 0;
+            WebCMSEntities db = new WebCMSEntities();
+            bool check = db.UserAmountSummary.Any(m => m.UserId == UserId && m.TradeMonth == TradeMonth &&m.SeoTitle == kind);
+            if (check)
+            {
+                if (kind == "self")
+                {
+                    amt = db.UserAmountSummary.Where(m => m.UserId == UserId && m.TradeMonth == TradeMonth &&m.SeoTitle == kind).Sum(m => m.TotalAmount);
+                }
+                else if (kind == "team")
+                {
+                    amt = db.UserAmountSummary.Where(m => m.UserId == UserId && m.TradeMonth == TradeMonth &&m.SeoTitle == kind).Sum(m => m.TotalAmount);
+                }
+            }
+            db.Dispose();
+            return amt;
+        }
+
+        public decimal GetTradeByDate(int UserId, string TradeDate, string kind = "self")
+        {
+            decimal amt = 0;
+            WebCMSEntities db = new WebCMSEntities();
+            bool check = db.UserAmountSummary.Any(m => m.UserId == UserId && m.TradeDate == TradeDate &&m.SeoTitle == kind);
+            if (check)
+            {
+                if (kind == "self")
+                {
+                    amt = db.UserAmountSummary.Where(m => m.UserId == UserId && m.TradeDate == TradeDate &&m.SeoTitle == kind).Sum(m => m.TotalAmount);
+                }
+                else if (kind == "team")
+                {
+                    amt = db.UserAmountSummary.Where(m => m.UserId == UserId && m.TradeDate == TradeDate &&m.SeoTitle == kind).Sum(m => m.TotalAmount);
+                }
+            }
+            db.Dispose();
+            return amt;
+        }
+    }
+}

+ 0 - 264
AppStart/Redis/Mysql/UserTradeDaySummaryDbconnV2.cs

@@ -1,264 +0,0 @@
-using System;
-using System.Collections.Generic;
-using Library;
-using System.Linq;
-using MySystem.MainModels;
-
-namespace MySystem
-{
-    public class UserTradeDaySummaryDbconnV2
-    {
-        public readonly static UserTradeDaySummaryDbconnV2 Instance = new UserTradeDaySummaryDbconnV2();
-        public UserTradeDaySummaryDbconnV2()
-        { }
-
-        // TODO:读取很慢,感觉redis没生效
-
-        #region 获取单个字段
-        //个人业绩
-        public decimal GetTrade(int UserId, int BankCardType, string kind = "self")
-        {
-            decimal amt = 0;
-            WebCMSEntities db = new WebCMSEntities();
-            bool check = db.UserTradeDaySummary.Any(m => m.UserId == UserId && m.SeoTitle == kind);
-            if (check)
-            {
-                if (kind == "self")
-                {
-                    if (BankCardType == 0)
-                    {
-                        amt = db.UserTradeDaySummary.Where(m => m.UserId == UserId && m.SeoTitle == kind).Sum(m => m.DirectDebitTradeAmt);
-                    }
-                    else
-                    { 
-                        amt = db.UserTradeDaySummary.Where(m => m.UserId == UserId && m.SeoTitle == kind).Sum(m => m.DirectTradeAmt);
-                    }
-                }
-                else if (kind == "team")
-                {
-                    if (BankCardType == 0)
-                    {
-                        amt = db.UserTradeDaySummary.Where(m => m.UserId == UserId && m.SeoTitle == kind).Sum(m => m.NonDirectDebitTradeAmt);
-                    }
-                    else
-                    { 
-                        amt = db.UserTradeDaySummary.Where(m => m.UserId == UserId && m.SeoTitle == kind).Sum(m => m.NonDirectTradeAmt);
-                    }
-                }
-            }
-            // RedisDbconn.Instance.Set(key, amt);
-            db.Dispose();
-            return amt;
-        }
-        public decimal GetDateTrade(int UserId, string TradeDate, int BankCardType, string kind = "self")
-        {
-            decimal amt = 0;
-            WebCMSEntities db = new WebCMSEntities();
-            bool check = db.UserTradeDaySummary.Any(m => m.UserId == UserId && m.TradeDate == TradeDate && m.SeoTitle == kind);
-            if (check)
-            {
-                if (kind == "self")
-                {
-                    if (BankCardType == 0)
-                    {
-                        amt = db.UserTradeDaySummary.Where(m => m.UserId == UserId && m.TradeDate == TradeDate && m.SeoTitle == kind).Sum(m => m.DirectDebitTradeAmt);
-                    }
-                    else
-                    { 
-                        amt = db.UserTradeDaySummary.Where(m => m.UserId == UserId && m.TradeDate == TradeDate && m.SeoTitle == kind).Sum(m => m.DirectTradeAmt);
-                    }
-                }
-                else if (kind == "team")
-                {
-                    if (BankCardType == 0)
-                    {
-                        amt = db.UserTradeDaySummary.Where(m => m.UserId == UserId && m.TradeDate == TradeDate && m.SeoTitle == kind).Sum(m => m.NonDirectDebitTradeAmt);
-                    }
-                    else
-                    { 
-                        amt = db.UserTradeDaySummary.Where(m => m.UserId == UserId && m.TradeDate == TradeDate && m.SeoTitle == kind).Sum(m => m.NonDirectTradeAmt);
-                    }
-                }
-            }
-            // RedisDbconn.Instance.Set(key, amt);
-            db.Dispose();
-            return amt;
-        }
-        public decimal GetMonthTrade(int UserId, string TradeMonth, int BankCardType, string kind = "self")
-        {
-            decimal amt = 0;
-            WebCMSEntities db = new WebCMSEntities();
-            bool check = db.UserTradeDaySummary.Any(m => m.UserId == UserId && m.TradeMonth == TradeMonth && m.SeoTitle == kind);
-            if (check)
-            {
-                if (kind == "self")
-                {
-                    if (BankCardType == 0)
-                    {
-                        amt = db.UserTradeDaySummary.Where(m => m.UserId == UserId && m.TradeMonth == TradeMonth && m.SeoTitle == kind).Sum(m => m.DirectDebitTradeAmt);
-                    }
-                    else
-                    {
-                        amt = db.UserTradeDaySummary.Where(m => m.UserId == UserId && m.TradeMonth == TradeMonth && m.SeoTitle == kind).Sum(m => m.DirectTradeAmt);
-                    }
-                }
-                else if (kind == "team")
-                {
-                    if (BankCardType == 0)
-                    {
-                        amt = db.UserTradeDaySummary.Where(m => m.UserId == UserId && m.TradeMonth == TradeMonth && m.SeoTitle == kind).Sum(m => m.NonDirectDebitTradeAmt);
-                    }
-                    else 
-                    { 
-                        amt = db.UserTradeDaySummary.Where(m => m.UserId == UserId && m.TradeMonth == TradeMonth && m.SeoTitle == kind).Sum(m => m.NonDirectTradeAmt);
-                    }
-                }
-            }
-            // RedisDbconn.Instance.Set(key, amt);
-            db.Dispose();
-            return amt;
-        }
-        public decimal GetDateTradeForBrand(int UserId, string TradeDate, int BrandId, int BankCardType, string kind = "self")
-        {
-            decimal amt = 0;
-            WebCMSEntities db = new WebCMSEntities();
-            bool check = db.UserTradeDaySummary.Any(m => m.UserId == UserId && m.BrandId == BrandId && m.TradeDate == TradeDate && m.
-            SeoTitle == kind);
-            if (check)
-            {
-                if (kind == "self")
-                {
-                    if (BankCardType == 0)
-                    {
-                        amt = db.UserTradeDaySummary.Where(m => m.UserId == UserId && m.BrandId == BrandId && m.TradeDate == TradeDate && m.SeoTitle == kind).Sum(m => m.DirectDebitTradeAmt);
-                    }
-                    else
-                    { 
-                        amt = db.UserTradeDaySummary.Where(m => m.UserId == UserId && m.BrandId == BrandId && m.TradeDate == TradeDate && m.SeoTitle == kind).Sum(m => m.DirectTradeAmt);
-                    }
-                }
-                else if (kind == "team")
-                {
-                    if (BankCardType == 0)
-                    {
-                        amt = db.UserTradeDaySummary.Where(m => m.UserId == UserId && m.BrandId == BrandId && m.TradeDate == TradeDate && m.SeoTitle == kind).Sum(m => m.NonDirectDebitTradeAmt);
-                    }
-                    else
-                    { 
-                        amt = db.UserTradeDaySummary.Where(m => m.UserId == UserId && m.BrandId == BrandId && m.TradeDate == TradeDate && m.SeoTitle == kind).Sum(m => m.NonDirectTradeAmt);
-                    }
-                }
-            }
-            // RedisDbconn.Instance.Set(key, amt);
-            db.Dispose();
-            return amt;
-        }
-        public decimal GetMonthTradeForBrand(int UserId, string TradeMonth, int BrandId, int BankCardType, string kind = "self")
-        {
-            decimal amt = 0;
-            WebCMSEntities db = new WebCMSEntities();
-            bool check = db.UserTradeDaySummary.Any(m => m.UserId == UserId && m.BrandId == BrandId && m.TradeMonth == TradeMonth && m.
-            SeoTitle == kind);
-            if (check)
-            {
-                if (kind == "self")
-                {
-                    if (BankCardType == 0)
-                    {
-                        amt = db.UserTradeDaySummary.Where(m => m.UserId == UserId && m.BrandId == BrandId && m.TradeMonth == TradeMonth && m.SeoTitle == kind).Sum(m => m.DirectDebitTradeAmt);
-                    }
-                    else
-                    { 
-                        amt = db.UserTradeDaySummary.Where(m => m.UserId == UserId && m.BrandId == BrandId && m.TradeMonth == TradeMonth && m.SeoTitle == kind).Sum(m => m.DirectTradeAmt);
-                    }
-                }
-                else if (kind == "team")
-                {
-                    if (BankCardType == 0)
-                    {
-                        amt = db.UserTradeDaySummary.Where(m => m.UserId == UserId && m.BrandId == BrandId && m.TradeMonth == TradeMonth && m.SeoTitle == kind).Sum(m => m.NonDirectDebitTradeAmt);
-                    }
-                    else
-                    { 
-                        amt = db.UserTradeDaySummary.Where(m => m.UserId == UserId && m.BrandId == BrandId && m.TradeMonth == TradeMonth && m.SeoTitle == kind).Sum(m => m.NonDirectTradeAmt);
-                    }
-                }
-            }
-            // RedisDbconn.Instance.Set(key, amt);
-            db.Dispose();
-            return amt;
-        }
-        public decimal GetDateTradeForCloud(int UserId, string TradeDate, int QrPayFlag, int BankCardType, string kind = "self")
-        {
-            decimal amt = 0;
-            WebCMSEntities db = new WebCMSEntities();
-            bool check = db.TradeDaySummary.Any(m => m.UserId == UserId && m.QueryCount == QrPayFlag && m.TradeDate == TradeDate && m.
-            SeoTitle == kind);
-            if (check)
-            {
-                if (kind == "self")
-                {
-                    if (BankCardType == 0)
-                    {
-                        amt = db.TradeDaySummary.Where(m => m.UserId == UserId && m.QueryCount == QrPayFlag && m.TradeDate == TradeDate && m.SeoTitle == kind).Sum(m => m.HelpDirectDebitTradeAmt + m.NotHelpDirectDebitTradeAmt + m.ProfitDirectDebitTradeAmt);
-                    }
-                    else
-                    { 
-                        amt = db.TradeDaySummary.Where(m => m.UserId == UserId && m.QueryCount == QrPayFlag && m.TradeDate == TradeDate && m.SeoTitle == kind).Sum(m => m.HelpDirectTradeAmt + m.NotHelpDirectTradeAmt + m.ProfitDirectTradeAmt);
-                    }
-                }
-                else if (kind == "team")
-                {
-                    if (BankCardType == 0)
-                    {
-                        amt = db.TradeDaySummary.Where(m => m.UserId == UserId && m.QueryCount == QrPayFlag && m.TradeDate == TradeDate && m.SeoTitle == kind).Sum(m => m.HelpNonDirectDebitTradeAmt + m.NotHelpNonDirectDebitTradeAmt + m.ProfitNonDirectDebitTradeAmt);
-                    }
-                    else
-                    { 
-                        amt = db.TradeDaySummary.Where(m => m.UserId == UserId && m.QueryCount == QrPayFlag && m.TradeDate == TradeDate && m.SeoTitle == kind).Sum(m => m.HelpNonDirectTradeAmt + m.NotHelpNonDirectTradeAmt + m.ProfitNonDirectTradeAmt);
-                    }
-                }
-            }
-            // RedisDbconn.Instance.Set(key, amt);
-            db.Dispose();
-            return amt;
-        }
-        public decimal GetMonthTradeForCloud(int UserId, string TradeMonth, int QrPayFlag, int BankCardType, string kind = "self")
-        {
-            decimal amt = 0;
-            WebCMSEntities db = new WebCMSEntities();
-            bool check = db.TradeDaySummary.Any(m => m.UserId == UserId && m.QueryCount == QrPayFlag && m.TradeMonth == TradeMonth && m.
-            SeoTitle == kind);
-            if (check)
-            {
-                if (kind == "self")
-                {
-                    if (BankCardType == 0)
-                    {
-                        amt = db.TradeDaySummary.Where(m => m.UserId == UserId && m.QueryCount == QrPayFlag && m.TradeMonth == TradeMonth && m.SeoTitle == kind).Sum(m => m.HelpDirectDebitTradeAmt + m.NotHelpDirectDebitTradeAmt + m.ProfitDirectDebitTradeAmt);
-                    }
-                    else
-                    { 
-                        amt = db.TradeDaySummary.Where(m => m.UserId == UserId && m.QueryCount == QrPayFlag && m.TradeMonth == TradeMonth && m.SeoTitle == kind).Sum(m => m.HelpDirectTradeAmt + m.NotHelpDirectTradeAmt + m.ProfitDirectTradeAmt);
-                    }
-                }
-                else if (kind == "team")
-                {
-                    if (BankCardType == 0)
-                    {
-                        amt = db.TradeDaySummary.Where(m => m.UserId == UserId && m.QueryCount == QrPayFlag && m.TradeMonth == TradeMonth && m.SeoTitle == kind).Sum(m => m.HelpNonDirectDebitTradeAmt + m.NotHelpNonDirectDebitTradeAmt + m.ProfitNonDirectDebitTradeAmt);
-                    }
-                    else
-                    { 
-                        amt = db.TradeDaySummary.Where(m => m.UserId == UserId && m.QueryCount == QrPayFlag && m.TradeMonth == TradeMonth && m.SeoTitle == kind).Sum(m => m.HelpNonDirectTradeAmt + m.NotHelpNonDirectTradeAmt + m.ProfitNonDirectTradeAmt);
-                    }
-                }
-            }
-            // RedisDbconn.Instance.Set(key, amt);
-            db.Dispose();
-            return amt;
-        }
-        #endregion
-
-    }
-}

+ 1 - 1
Areas/Api/Controllers/BaseController.cs

@@ -183,7 +183,7 @@ namespace MySystem.Areas.Api.Controllers
 
         public string DefaultRealName(MainModels.Users user)
         {
-            return string.IsNullOrEmpty(user.RealName) ? "客小爽" + user.MakerCode : user.RealName;
+            return string.IsNullOrEmpty(user.RealName) ? "码牌" + user.MakerCode : user.RealName;
         }
 
         #endregion

+ 1 - 9
Areas/Api/Controllers/WeChatController.cs

@@ -48,14 +48,6 @@ namespace MySystem.Areas.Api.Controllers.v1
             // Dictionary<string, string> dic = new WeChatFunction(_accessor.HttpContext).Pay(AppId, MchId, SubMchId, 0.1M, DateTime.Now.ToString("yyyyMMddHHmmssfff"), Description, OpenId, Key, NotifyUrl);
             Dictionary<string, string> dic = new WeChatFunction(_accessor.HttpContext).Refund(AppId, MchId, SubMchId, 1M, 1M, "2022020817492424848364549", DateTime.Now.ToString("yyyyMMddHHmmssfff"), Description, OpenId, Key, NotifyUrl);
             return dic;
-        }
-
-        public string t2()
-        {
-            MerchantForMobile find = RedisDbconn.Instance.Get<MerchantForMobile>("MerchantForMobile:19938245853");
-            return "ok";
-        }
-
-        
+        }        
     }
 }

+ 17 - 20
Areas/Api/Controllers/v1/MainServer/ConsumerOrdersController.cs

@@ -10,6 +10,7 @@ using System.Web;
 using MySystem.MainModels;
 using LitJson;
 using Library;
+using System.Data;
 
 namespace MySystem.Areas.Api.Controllers.v1
 {
@@ -41,18 +42,16 @@ namespace MySystem.Areas.Api.Controllers.v1
             int PageSize = int.Parse(function.CheckInt(data["PageSize"].ToString()));
             int PageNum = int.Parse(function.CheckInt(data["PageNum"].ToString()));
             List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
-            List<string> Dates = RedisDbconn.Instance.GetList<string>("ConsumerStat:" + MerchantId + ":" + Month, PageNum, PageSize);
-            foreach (string Date in Dates)
+            DataTable dt = MerchantAmountSummary.Instance.GetTradeListByDate(MerchantId, Month, PageNum, PageSize);
+            foreach (DataRow dr in dt.Rows)
             {
-                string DateString = Date.Replace("-", "");
                 Dictionary<string, object> curData = new Dictionary<string, object>();
-                curData.Add("Date", Date); //日期
-                MerchantIndexStat MonthIndexStat = RedisDbconn.Instance.Get<MerchantIndexStat>("MerchantIndexStat:" + MerchantId + ":" + DateString) ?? new MerchantIndexStat();
-                curData.Add("Amount", MonthIndexStat.TotalActual); //实收金额
-                curData.Add("WeChatAmount", MonthIndexStat.WeChatTotalActual); //微信实收
-                curData.Add("AlipayAmount", MonthIndexStat.AlipayTotalActual); //微信实收
-                curData.Add("OrderCount", MonthIndexStat.TotalOrder); //订单数
-                curData.Add("AddCount", MonthIndexStat.TotalUser); //新增会员
+                curData.Add("Date", dr["TradeDate"].ToString()); //日期
+                curData.Add("Amount", dr[2].ToString()); //实收金额
+                curData.Add("WeChatAmount", dr[0].ToString()); //微信实收
+                curData.Add("AlipayAmount", dr[1].ToString()); //微信实收
+                curData.Add("OrderCount", dr[3].ToString()); //订单数
+                curData.Add("AddCount", 0); //新增会员
                 dataList.Add(curData);
             }
             return dataList;
@@ -77,18 +76,16 @@ namespace MySystem.Areas.Api.Controllers.v1
             int PageSize = int.Parse(function.CheckInt(data["PageSize"].ToString()));
             int PageNum = int.Parse(function.CheckInt(data["PageNum"].ToString()));
             List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
-            List<string> Months = RedisDbconn.Instance.GetList<string>("ConsumerStat:" + MerchantId, PageNum, PageSize);
-            foreach (string Month in Months)
+            DataTable dt = MerchantAmountSummary.Instance.GetTradeListByMonth(MerchantId, PageNum, PageSize);
+            foreach (DataRow dr in dt.Rows)
             {
-                string MonthString = Month.Replace("-", "");
                 Dictionary<string, object> curData = new Dictionary<string, object>();
-                curData.Add("Month", Month); //日期
-                MerchantIndexStat MonthIndexStat = RedisDbconn.Instance.Get<MerchantIndexStat>("MerchantIndexStat:" + MerchantId + ":" + MonthString) ?? new MerchantIndexStat();
-                curData.Add("Amount", MonthIndexStat.TotalActual); //实收金额
-                curData.Add("WeChatAmount", MonthIndexStat.WeChatTotalActual); //微信实收
-                curData.Add("AlipayAmount", MonthIndexStat.AlipayTotalActual); //微信实收
-                curData.Add("OrderCount", MonthIndexStat.TotalOrder); //订单数
-                curData.Add("AddCount", MonthIndexStat.TotalUser); //新增会员
+                curData.Add("Date", dr["TradeMonth"].ToString()); //日期
+                curData.Add("Amount", dr[2].ToString()); //实收金额
+                curData.Add("WeChatAmount", dr[0].ToString()); //微信实收
+                curData.Add("AlipayAmount", dr[1].ToString()); //微信实收
+                curData.Add("OrderCount", dr[3].ToString()); //订单数
+                curData.Add("AddCount", 0); //新增会员
                 dataList.Add(curData);
             }
             return dataList;

+ 1 - 1
Areas/Api/Controllers/v1/MainServer/ConsumersController.cs

@@ -197,7 +197,7 @@ namespace MySystem.Areas.Api.Controllers.v1
                 {
                     Id = ConsumerId,
                     CreateDate = DateTime.Now,
-                    NickName = "客小爽用户" + function.get_Random(6),
+                    NickName = "码牌用户" + function.get_Random(6),
                     // HeadPhoto = avatarUrl,
                     Mobile = mobile,
                     AlipayUserId = AlipayUserId,

+ 7 - 8
Areas/Api/Controllers/v1/MainServer/MerchantInfoController.cs

@@ -527,11 +527,11 @@ namespace MySystem.Areas.Api.Controllers.v1
             }
             while(Start <= DateTime.Now)
             {
-                MerchantIndexStat query = RedisDbconn.Instance.Get<MerchantIndexStat>("MerchantIndexStat:" + Id + ":" + Start.ToString("yyyyMMdd")) ?? new MerchantIndexStat();
-                TotalAmount += query.TotalAmount;
-                TotalOrder += query.TotalOrder;
-                TotalUser += query.TotalUser;
-                TotalActual += query.TotalActual;
+                MerchantAmountSummay query = new MerchantAmountSummayService().Query(Id, Start.ToString("yyyyMMdd"));
+                // TotalAmount += query.TradeAmount;
+                TotalOrder += query.TradeAmount;
+                // TotalUser += query.TotalUser;
+                // TotalActual += query.TotalActual;
                 Start = Start.AddDays(1);
             }
             Obj.Add("TotalAmount", TotalActual); //平台总收益
@@ -600,9 +600,8 @@ namespace MySystem.Areas.Api.Controllers.v1
             {
                 string Date = DateTime.Now.AddDays(-i).ToString("yyyyMMdd");
                 // ConsumeCount += 0;
-                MerchantIndexStat DateIndexStat = RedisDbconn.Instance.Get<MerchantIndexStat>("MerchantIndexStat:" + Id + ":" + Date) ?? new MerchantIndexStat();
-                WeChatTotal += DateIndexStat.WeChatTotalActual;
-                AlipayTotal += DateIndexStat.AlipayTotalActual;
+                WeChatTotal += MerchantAmountSummary.Instance.GetTradeByMode(Id, 2, Date);
+                AlipayTotal += MerchantAmountSummary.Instance.GetTradeByMode(Id, 1, Date);
             }
             Obj.Add("SevenDayConsumer", ConsumeCount); //近7日新增会员
             Obj.Add("WeChatTotal", WeChatTotal); //微信实收

+ 8 - 7
Areas/Api/Controllers/v1/MainServer/PosMachinesController.cs

@@ -128,10 +128,9 @@ namespace MySystem.Areas.Api.Controllers.v1
             int PageNum = int.Parse(function.CheckInt(data["PageNum"].ToString()));
             string CheckKey = "_" + BindMerchantId;
             List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
-            List<int> query = RedisDbconn.Instance.GetList<int>("MerchantQrCodeList:" + BindMerchantId, 1, 1000);
-            foreach (int MerchantQrCodeId in query)
+            List<MerchantQrCode> query = new MerchantQrCodeService().List(new List<FieldItem>(), " and MerchantId=" + BindMerchantId, 1, 1000);
+            foreach (MerchantQrCode subdata in query)
             {
-                MerchantQrCode subdata = RedisDbconn.Instance.Get<MerchantQrCode>("MerchantQrCode:" + MerchantQrCodeId) ?? new MerchantQrCode();
                 Dictionary<string, object> curData = new Dictionary<string, object>();
                 curData.Add("BindingTime", subdata.UpdateDate == null ? "" : subdata.UpdateDate.Value.ToString("yyyy-MM-dd HH:mm:ss")); //绑定时间
                 curData.Add("PosSn", subdata.SnNo); //SN编号
@@ -155,10 +154,11 @@ namespace MySystem.Areas.Api.Controllers.v1
         {
             JsonData data = JsonMapper.ToObject(value);
             int BindMerchantId = int.Parse(function.CheckInt(data["BindMerchantId"].ToString())); //绑定商户
-            string QrCodeId = data["QrCodeId"].ToString(); //二维码Id
+            // string QrCodeId = data["QrCodeId"].ToString(); //二维码Id
+            int QrCodeId = int.Parse(function.CheckInt(data["QrCodeId"].ToString())); //二维码Id
             string MachineId = data["MachineId"].ToString(); //音箱Id
             Dictionary<string, object> Obj = new Dictionary<string, object>();
-            MerchantQrCode qrcode = RedisDbconn.Instance.Get<MerchantQrCode>("MerchantQrCode:" + QrCodeId) ?? new MerchantQrCode();
+            MerchantQrCode qrcode = new MerchantQrCodeService().Query(QrCodeId);
             PosMachines machine = PosMachinesDbconn.Instance.Get(MachineId) ?? new PosMachines();
             MachineForQrCode query = new MachineForQrCode()
             {
@@ -190,11 +190,12 @@ namespace MySystem.Areas.Api.Controllers.v1
             int PageSize = int.Parse(function.CheckInt(data["PageSize"].ToString()));
             int PageNum = int.Parse(function.CheckInt(data["PageNum"].ToString()));
             List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
-            List<PosMachines> query = RedisDbconn.Instance.GetList<PosMachines>("PosMachines", PageNum, PageSize);
+            string condition = "";
             if (!string.IsNullOrEmpty(data["BindMerchantId"].ToString()))
             {
-                query = query.Where(m => m.BindMerchantId == BindMerchantId).ToList();
+                condition += " and BindMerchantId=" + BindMerchantId;
             }
+            List<PosMachines> query = new PosMachinesService().List(new List<FieldItem>(), condition, PageNum, PageSize);
             foreach (var subdata in query)
             {
                 Dictionary<string, object> curData = new Dictionary<string, object>();

+ 7 - 23
Areas/Api/Controllers/v1/MainServer/ServiceCenterController.cs

@@ -41,20 +41,12 @@ namespace MySystem.Areas.Api.Controllers.v1
             int PageSize = int.Parse(function.CheckInt(data["PageSize"].ToString()));
             int PageNum = int.Parse(function.CheckInt(data["PageNum"].ToString()));
             List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
-            List<ServiceCenter> querys = RedisDbconn.Instance.GetList<ServiceCenter>("ServiceCenterList", 1, 1000000);
+            string condition = "";
             if (CategoryId > 0)
             {
-                querys = querys.Where(m => m.CategoryId == CategoryId).ToList();
-            }
-            if (PageNum == 1)
-            {
-                querys = querys.Take(PageSize).ToList();
-            }
-            else
-            {
-                int skipNum = PageSize * (PageNum - 1);
-                querys = querys.Skip(skipNum).Take(PageSize).ToList();
+                condition += " and CategoryId=" + CategoryId;
             }
+            List<ServiceCenter> querys = new ServiceCenterService().List(new List<FieldItem>(), condition, PageNum, PageSize);
             foreach (ServiceCenter subdata in querys)
             {
                 Dictionary<string, object> curData = new Dictionary<string, object>();
@@ -84,20 +76,12 @@ namespace MySystem.Areas.Api.Controllers.v1
             int PageSize = int.Parse(function.CheckInt(data["PageSize"].ToString()));
             int PageNum = int.Parse(function.CheckInt(data["PageNum"].ToString()));
             List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
-            List<ServiceCenter> querys = RedisDbconn.Instance.GetList<ServiceCenter>("ServiceCenterList", 1, 1000000);
+            string condition = "";
             if (!string.IsNullOrEmpty(SearchKey))
             {
-                querys = querys.Where(m => m.Title.Contains(SearchKey)).ToList();
-            }
-            if (PageNum == 1)
-            {
-                querys = querys.Take(PageSize).ToList();
-            }
-            else
-            {
-                int skipNum = PageSize * (PageNum - 1);
-                querys = querys.Skip(skipNum).Take(PageSize).ToList();
+                condition += " and Title like '%" + SearchKey + "%'";
             }
+            List<ServiceCenter> querys = new ServiceCenterService().List(new List<FieldItem>(), condition, PageNum, PageSize);
             foreach (ServiceCenter subdata in querys)
             {
                 Dictionary<string, object> curData = new Dictionary<string, object>();
@@ -125,7 +109,7 @@ namespace MySystem.Areas.Api.Controllers.v1
             JsonData data = JsonMapper.ToObject(value);
             Dictionary<string, object> Obj = new Dictionary<string, object>();
             int Id = int.Parse(function.CheckInt(data["Id"].ToString()));
-            ServiceCenter query = RedisDbconn.Instance.Get<ServiceCenter>("ServiceCenter:" + Id) ?? new ServiceCenter();
+            ServiceCenter query = new ServiceCenterService().Query(Id);
             Obj.Add("Title", query.Title); //标题
             Obj.Add("Content", CheckContentImage(query.Content)); //内容
             return Obj;

+ 1 - 1
Areas/Api/Controllers/v1/MainServer/UploadParamsController.cs

@@ -41,7 +41,7 @@ namespace MySystem.Areas.Api.Controllers.v1
             Dictionary<string, object> Obj = new Dictionary<string, object>();
             UploadParams query = new UploadParams();
             int Id = int.Parse(function.CheckInt(data["Id"].ToString()));
-            query = RedisDbconn.Instance.Get<UploadParams>("UploadParams:" + Id) ?? new UploadParams();
+            query = new UploadParamsService().Query(Id);
             Obj.Add("PicUrl", ""); //图片地址
             return Obj;
         }

+ 1 - 1
Areas/Api/Controllers/v1/MainServer/UserBackKindController.cs

@@ -38,7 +38,7 @@ namespace MySystem.Areas.Api.Controllers.v1
             int PageSize = int.Parse(function.CheckInt(data["PageSize"].ToString()));
             int PageNum = int.Parse(function.CheckInt(data["PageNum"].ToString()));
             List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
-            List<UserBackKind> query = RedisDbconn.Instance.GetList<UserBackKind>("UserBackKind", PageNum, PageSize);
+            List<UserBackKind> query = new UserBackKindService().List(new List<FieldItem>(), "", PageNum, PageSize);
             foreach (var subdata in query)
             {
                 Dictionary<string, object> curData = new Dictionary<string, object>();

+ 20 - 27
Areas/Api/Controllers/v1/MainServer/UserCardRecordController.cs

@@ -45,65 +45,57 @@ namespace MySystem.Areas.Api.Controllers.v1
             int PageSize = int.Parse(function.CheckInt(data["PageSize"].ToString()));
             int PageNum = int.Parse(function.CheckInt(data["PageNum"].ToString()));
             List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
-            List<ConsumerOfMerchant> query = RedisDbconn.Instance.GetList<ConsumerOfMerchant>("ConsumerOfMerchant:" + MerchantId, 1, 1000000);
+            string condition = "";
             if (!string.IsNullOrEmpty(data["SearchKey"].ToString()))
             {
-                query = query.Where(m => m.NickName.Contains(SearchKey)).ToList();
+                condition += " and NickName like '%" + SearchKey + "%'";
             }
             if (!string.IsNullOrEmpty(data["CardFlag"].ToString()))
             {
-                query = query.Where(m => m.CardFlag == CardFlag).ToList();
+                condition += " and CardFlag=" + CardFlag;
             }
             if (!string.IsNullOrEmpty(data["ConsumerFlag"].ToString()))
             {
-                DateTime check = DateTime.Parse(DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd") + "00:00:00");
+                string check = DateTime.Now.AddDays(-7).ToString("yyyy-MM-dd") + "00:00:00";
                 if (ConsumerFlag == 1)
                 {
-                    query = query.Where(m => m.LastConsumDate >= check).ToList();
+                    condition += " and LastConsumDate>='" + check + "'";
                 }
                 else if (ConsumerFlag == 0)
                 { 
-                    query = query.Where(m => m.LastConsumDate < check).ToList();
+                    condition += " and LastConsumDate<'" + check + "'";
                 }
             }
+            string OrderBy = "Id desc";
             if (!string.IsNullOrEmpty(data["Sort"].ToString()))
             {
                 if (Sort == "1")
                 {
-                    query = query.OrderByDescending(m => m.LastConsumDate).ToList();
+                    OrderBy = "LastConsumDate desc";
                 }
                 else if (Sort == "2")
                 {
-                    query = query.OrderByDescending(m => m.Id).ToList();
+                    OrderBy = "Id desc";
                 }
                 else if (Sort == "3")
                 {
-                    query = query.OrderByDescending(m => m.TotalConsumCount).ToList();
+                    OrderBy = "TotalConsumCount desc";
                 }
                 else if (Sort == "4")
                 {
-                    query = query.OrderByDescending(m => m.TotalAmount).ToList();
+                    OrderBy = "TotalAmount desc";
                 }
             }
             else
             { 
-                query = query.OrderByDescending(m => m.Id).ToList();
+                OrderBy = "Id desc";
             }
-            if (PageNum == 1)
-            {
-                query = query.Take(PageSize).ToList();
-            }
-            else
-            {
-                int skipNum = PageSize * (PageNum - 1);
-                query = query.Skip(skipNum).Take(PageSize).ToList();
-            }
-            foreach (var subdata in query)
+            List<Consumers> query = new ConsumersService().List(new List<FieldItem>() , condition, PageNum, PageSize, OrderBy);
+            foreach (var ConsumersData in query)
             {
                 Dictionary<string, object> curData = new Dictionary<string, object>();
-                curData.Add("ConsumerId", RelationClass.GetConsumersInfo(subdata.Id)); //消费者
+                curData.Add("ConsumerId", RelationClass.GetConsumersInfo(ConsumersData.Id)); //消费者
                 Dictionary<string, object> Consumer = new Dictionary<string, object>();
-                Consumers ConsumersData = ConsumersDbconn.Instance.Get(subdata.Id) ?? new Consumers();
                 Consumer.Add("NickName", ConsumersData.NickName); //昵称
                 Consumer.Add("HeadPhoto", ConsumersData.HeadPhoto); //头像
                 Consumer.Add("CurIntgegral", ConsumersData.CurIntgegral); //当前积分
@@ -112,12 +104,11 @@ namespace MySystem.Areas.Api.Controllers.v1
                 Consumer.Add("LastConsumDate", ConsumersData.LastConsumDate); //最近消费时间
                 curData.Add("Consumer", Consumer);
 
-                curData.Add("CreateDate", subdata.CreateDate == null ? "" : subdata.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss")); //CreateDate
+                curData.Add("CreateDate", ConsumersData.CreateDate == null ? "" : ConsumersData.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss")); //CreateDate
                 int ConsumeCount = 0;
                 for (int i = 0; i < 7; i++)
                 {
                     string Date = DateTime.Now.AddDays(-i).ToString("yyyyMMdd");
-                    ConsumeCount += RedisDbconn.Instance.Get<int>("ConsumeCount:" + subdata.Id + ":" + Date);
                 }
                 curData.Add("ConsumeCount", ConsumeCount); //近7日消费次数
                 dataList.Add(curData);
@@ -142,7 +133,8 @@ namespace MySystem.Areas.Api.Controllers.v1
             JsonData data = JsonMapper.ToObject(value);
             int ConsumerId = int.Parse(function.CheckInt(data["ConsumerId"].ToString())); //消费者
             int MerchantId = int.Parse(function.CheckInt(data["MerchantId"].ToString())); //商户
-            UserCardForWeChat card = RedisDbconn.Instance.Get<UserCardForWeChat>("UserCardForWeChat:" + MerchantId) ?? new UserCardForWeChat();Dictionary<string, object> Obj = new Dictionary<string, object>();
+            UserCardForWeChat card = new UserCardForWeChatService().Query(MerchantId);
+            Dictionary<string, object> Obj = new Dictionary<string, object>();
             UserCardRecord query = new UserCardRecord()
             {
                 CreateDate = DateTime.Now, //创建时间
@@ -169,7 +161,8 @@ namespace MySystem.Areas.Api.Controllers.v1
         {
             JsonData data = JsonMapper.ToObject(value);
             int MerchantId = int.Parse(function.CheckInt(data["MerchantId"].ToString())); //商户
-            UserCardForWeChat card = RedisDbconn.Instance.Get<UserCardForWeChat>("UserCardForWeChat:" + MerchantId) ?? new UserCardForWeChat();Dictionary<string, object> Obj = new Dictionary<string, object>();
+            UserCardForWeChat card = new UserCardForWeChatService().Query(MerchantId);
+            Dictionary<string, object> Obj = new Dictionary<string, object>();
             Dictionary<string, object> cardExt = new WeChatFunction(_accessor.HttpContext).GetUserCard(MerchantId);
             Obj.Add("CardId", card.Id);
             Obj.Add("CardExt", cardExt);

+ 0 - 1
Areas/Api/Controllers/v1/MainServer/UserCashRecordController.cs

@@ -111,7 +111,6 @@ namespace MySystem.Areas.Api.Controllers.v1
                 AfterBalanceAmount = AfterBalanceAmount, //变更后余额
             });
             maindb.SaveChanges();
-            RedisDbconn.Instance.Clear("UserCashRecordList:" + UserId);
             return new AppResultJson() { Status = "1", Info = "", Data = Obj };
         }
         #endregion

+ 1 - 1
Areas/Api/Controllers/v1/MainServer/UserCenterIconListController.cs

@@ -39,7 +39,7 @@ namespace MySystem.Areas.Api.Controllers.v1
             int PageSize = int.Parse(function.CheckInt(data["PageSize"].ToString()));
             int PageNum = int.Parse(function.CheckInt(data["PageNum"].ToString()));
             List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
-            List<UserCenterIconList> query = RedisDbconn.Instance.GetList<UserCenterIconList>("UserCenterIconList", PageNum, PageSize);
+            List<UserCenterIconList> query = new UserCenterIconListService().List(new List<FieldItem>(), "", PageNum, PageSize);
             foreach (var subdata in query)
             {
                 Dictionary<string, object> curData = new Dictionary<string, object>();

+ 1 - 1
Areas/Api/Controllers/v1/MainServer/UserLevelSetController.cs

@@ -39,7 +39,7 @@ namespace MySystem.Areas.Api.Controllers.v1
             int PageSize = int.Parse(function.CheckInt(data["PageSize"].ToString()));
             int PageNum = int.Parse(function.CheckInt(data["PageNum"].ToString()));
             List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
-            List<UserLevelSet> query = RedisDbconn.Instance.GetList<UserLevelSet>("UserLevelSet", PageNum, PageSize);
+            List<UserLevelSet> query = new UserLevelSetService().List(new List<FieldItem>(), "", PageNum, PageSize);
             foreach (var subdata in query)
             {
                 Dictionary<string, object> curData = new Dictionary<string, object>();

+ 11 - 342
Areas/Api/Controllers/v1/MainServer/UsersController.cs

@@ -188,7 +188,6 @@ namespace MySystem.Areas.Api.Controllers.v1
                     }).Entity;
                     maindb.SaveChanges();
                 }
-                RedisDbconn.Instance.Clear("UserForMobile:" + Mobile);
             }
             else
             {
@@ -381,11 +380,11 @@ namespace MySystem.Areas.Api.Controllers.v1
             Users user = maindb.Users.FirstOrDefault(m => m.Id == query.UserId) ?? new Users();
             if (user.Status == -1)
             {
-                return Json(new AppResultJson() { Status = "-1", Info = "账号已注销,请联系客小爽客服", Data = Obj });
+                return Json(new AppResultJson() { Status = "-1", Info = "账号已注销,请联系码牌客服", Data = Obj });
             }
             if (user.Status == 1)
             {
-                return Json(new AppResultJson() { Status = "-1", Info = "账号已锁定,请联系客小爽客服", Data = Obj });
+                return Json(new AppResultJson() { Status = "-1", Info = "账号已锁定,请联系码牌客服", Data = Obj });
             }
             if (LoginPwd != "ke#xiao@s_2022")
             {
@@ -421,11 +420,11 @@ namespace MySystem.Areas.Api.Controllers.v1
             Users user = maindb.Users.FirstOrDefault(m => m.Id == query.UserId) ?? new Users();
             if (user.Status == -1)
             {
-                return Json(new AppResultJson() { Status = "-1", Info = "账号已注销,请联系客小爽客服", Data = Obj });
+                return Json(new AppResultJson() { Status = "-1", Info = "账号已注销,请联系码牌客服", Data = Obj });
             }
             if (user.Status == 1)
             {
-                return Json(new AppResultJson() { Status = "-1", Info = "账号已锁定,请联系客小爽客服", Data = Obj });
+                return Json(new AppResultJson() { Status = "-1", Info = "账号已锁定,请联系码牌客服", Data = Obj });
             }
             if (LoginPwd != "ke#xiao@s_2022")
             {
@@ -778,7 +777,6 @@ namespace MySystem.Areas.Api.Controllers.v1
                     auth.BankCardAccount = SettleBankCardNo; //银行卡账号
                 }
                 maindb.SaveChanges();
-                RedisDbconn.Instance.AddList("CashPersonalCreateQueue", Id.ToString());
             }
             return new AppResultJson() { Status = "1", Info = "", Data = Obj };
         }
@@ -816,7 +814,6 @@ namespace MySystem.Areas.Api.Controllers.v1
                 query.SettleBankCardNo = SettleBankCardNo; //结算银行卡号
                 query.BankCardPositiveImage = BankCardPositiveImage; //银行卡正面照
                 maindb.SaveChanges();
-                RedisDbconn.Instance.AddList("CashPersonalCreateQueue", Id.ToString());
                 return Json(new AppResultJson() { Status = "1", Info = "", Data = Obj });
             }
             return Json(new AppResultJson() { Status = "-1", Info = "认证失败,请重试", Data = Obj });
@@ -834,15 +831,6 @@ namespace MySystem.Areas.Api.Controllers.v1
         {
             JsonData data = JsonMapper.ToObject(value);
             int Id = int.Parse(function.CheckInt(data["Id"].ToString()));
-            string cashCheck = RedisDbconn.Instance.Get<string>("CashPersonalAddResult:" + Id);
-            if (string.IsNullOrEmpty(cashCheck))
-            {
-                return new AppResultJson() { Status = "0", Info = "" };
-            }
-            if (cashCheck != "success")
-            {
-                return new AppResultJson() { Status = "-1", Info = cashCheck };
-            }
             string MobileCode = data["MobileCode"].ToString(); //短信验证码
             string Mobile = data["Mobile"].ToString();
             string BankName = data["BankName"].ToString(); //开户行全称
@@ -1027,8 +1015,6 @@ namespace MySystem.Areas.Api.Controllers.v1
                             BankMobile = BankMobile, //银行预留手机号码
                         }).Entity;
                         maindb.SaveChanges();
-                        // RedisDbconn.Instance.AddList("MakeReferenceQrCode", query.Id.ToString());
-                        RedisDbconn.Instance.AddList("CashPersonalCreateQueue", Id.ToString());
 
                         //实名认证成功后消息推送
                         Users users = maindb.Users.FirstOrDefault(m => m.Id == query.ParentUserId);
@@ -1037,15 +1023,10 @@ namespace MySystem.Areas.Api.Controllers.v1
                             UserId = users.Id, //创客Id
                             MsgType = 2,
                             Title = "来新人啦", //标题
-                            Summary = "您的客小爽系统有新人加入了,请进入客小爽-我的创客中查看!",//简介
+                            Summary = "您的码牌系统有新人加入了,请进入码牌-我的创客中查看!",//简介
                             CreateDate = DateTime.Now,
 
                         }));
-
-                        var TradeMonth = DateTime.Now.ToString("yyyyMMdd");
-                        string SendData = "{\"Kind\":\"2\",\"Data\":{\"UserId\":\"" + users.Id + "\",\"DirectUserId\":\"" + Id + "\",\"TradeMonth\":\"" + TradeMonth + "\"}}";
-                        RedisDbconn.Instance.AddList("RecommendActStatQueue", SendData);
-
                         return new AppResultJson() { Status = "1", Info = "", Data = Obj };
                     }
                     else
@@ -1062,193 +1043,6 @@ namespace MySystem.Areas.Api.Controllers.v1
         }
 
 
-        // 提交代付签约
-        // [Authorize]
-        // public JsonResult PostAuthCheck(string value)
-        // {
-        //     value = DesDecrypt(value);
-        //     function.WriteLog(value, "提交代付签约");
-        //     JsonData data = JsonMapper.ToObject(value);            
-        //     int Id = int.Parse(function.CheckInt(data["Id"].ToString()));
-        //     string RealName = data["RealName"].ToString(); //真实姓名
-        //     string CertId = data["CertId"].ToString(); //身份证号
-        //     string Areas = data["Areas"].ToString(); //所在地区
-        //     string Mobile = data["Mobile"].ToString(); //手机号
-        //     string BankName = data["BankName"].ToString(); //开户行全称
-        //     string SettleBankName = data["SettleBankName"].ToString(); //结算银行名称
-        //     string SettleBankCardNo = data["SettleBankCardNo"].ToString(); //结算银行卡号
-        //     string CertFrontImage = data["CertFrontImage"].ToString(); //身份证正面照
-        //     string CertReverseImage = data["CertReverseImage"].ToString(); //身份证反面照
-        //     string HandCertImage = data["HandCertImage"].ToString(); //手持身份证
-        //     string BankCardPositiveImage = data["BankCardPositiveImage"].ToString(); //银行卡正面照
-        //     string BankMobile = data["BankMobile"].ToString(); //银行预留手机号
-        //     string Distribute = "";
-        //     if (value.Contains("\"Distribute\""))
-        //     {
-        //         Distribute = data["Distribute"].ToString();
-        //     }
-        //     if (string.IsNullOrEmpty(data["BankMobile"].ToString()))
-        //     {
-        //         return Json(new AppResultJson() { Status = "-1", Info = "请填写手机号" });
-        //     }
-        //     if (data["BankMobile"].ToString().Length > 11)
-        //     {
-        //         return Json(new AppResultJson() { Status = "-1", Info = "手机号最多11个字符" });
-        //     }
-        //     if (function.CheckMobile(data["BankMobile"].ToString()) == "")
-        //     {
-        //         return Json(new AppResultJson() { Status = "-1", Info = "请填写正确的手机号" });
-        //     }
-        //     Dictionary<string, object> Obj = new Dictionary<string, object>();
-        //     bool checkCertId = maindb.Users.Any(m => m.Id != Id && m.CertId == CertId);
-        //     if (checkCertId)
-        //     {
-        //         return Json(new AppResultJson() { Status = "-1", Info = "您输入的身份证号已经认证过了,请更换身份证" });
-        //     }
-        //     Users query = maindb.Users.FirstOrDefault(m => m.Id == Id);
-        //     if (query != null)
-        //     {
-        //         query.RealName = RealName; //真实姓名
-        //         query.CertId = CertId; //身份证号
-        //         query.Areas = Areas; //所在地区
-        //         query.SeoTitle = BankName;
-        //         query.SettleBankCardNo = SettleBankCardNo; //结算银行卡号
-        //         query.SettleBankName = SettleBankName; //结算银行名称
-        //         // query.CertFrontImage = CertFrontImage; //身份证正面照
-        //         // query.CertReverseImage = CertReverseImage; //身份证反面照
-        //         query.HandCertImage = HandCertImage; //手持身份证
-        //         query.BankCardPositiveImage = BankCardPositiveImage; //银行卡正面照
-        //         maindb.SaveChanges();
-        //         RedisDbconn.Instance.Set("FrontCertImg:" + Id, CertFrontImage, 600);
-        //         RedisDbconn.Instance.Set("BackCertImg:" + Id, CertReverseImage, 600);
-        //         RedisDbconn.Instance.AddList("CashPersonalCreateQueue", Id.ToString());
-        //         return Json(new AppResultJson() { Status = "1", Info = "", Data = Obj });
-        //     }
-        //     return Json(new AppResultJson() { Status = "-1", Info = "认证失败,请重试", Data = Obj });
-        // } 
-
-        // [Authorize]
-        // public JsonResult PostAuth2(string value)
-        // {
-        //     value = DesDecrypt(value);
-        //     JsonData data = JsonMapper.ToObject(value);
-        //     AppResultJson result = PostAuth2Do(value);
-        //     return Json(new AppResultJson() { Status = result.Status, Info = result.Info, Data = result.Data });
-        // }
-        // public AppResultJson PostAuth2Do(string value)
-        // {
-        //     JsonData data = JsonMapper.ToObject(value);
-        //     int Id = int.Parse(function.CheckInt(data["Id"].ToString()));
-        //     string cashCheck = RedisDbconn.Instance.Get<string>("CashPersonalAddResult:" + Id);
-        //     if(string.IsNullOrEmpty(cashCheck))
-        //     {
-        //         return new AppResultJson() { Status = "0", Info = "" };
-        //     }
-        //     if(cashCheck != "success")
-        //     {
-        //         return new AppResultJson() { Status = "-1", Info = cashCheck };
-        //     }
-        //     string RealName = data["RealName"].ToString(); //真实姓名
-        //     string CertId = data["CertId"].ToString(); //身份证号
-        //     string Areas = data["Areas"].ToString(); //所在地区
-        //     string Mobile = data["Mobile"].ToString(); //手机号
-        //     string BankName = data["BankName"].ToString(); //开户行全称
-        //     string SettleBankName = data["SettleBankName"].ToString(); //结算银行名称
-        //     string SettleBankCardNo = data["SettleBankCardNo"].ToString(); //结算银行卡号
-        //     string CertFrontImage = data["CertFrontImage"].ToString(); //身份证正面照
-        //     string CertReverseImage = data["CertReverseImage"].ToString(); //身份证反面照
-        //     string HandCertImage = data["HandCertImage"].ToString(); //手持身份证
-        //     string BankCardPositiveImage = data["BankCardPositiveImage"].ToString(); //银行卡正面照
-        //     string BankMobile = data["BankMobile"].ToString(); //银行预留手机号
-        //     string Distribute = "";
-        //     if (value.Contains("\"Distribute\""))
-        //     {
-        //         Distribute = data["Distribute"].ToString();
-        //     }
-        //     if (string.IsNullOrEmpty(data["BankMobile"].ToString()))
-        //     {
-        //         return new AppResultJson() { Status = "-1", Info = "请填写手机号" };
-        //     }
-        //     if (data["BankMobile"].ToString().Length > 11)
-        //     {
-        //         return new AppResultJson() { Status = "-1", Info = "手机号最多11个字符" };
-        //     }
-        //     if (function.CheckMobile(data["BankMobile"].ToString()) == "")
-        //     {
-        //         return new AppResultJson() { Status = "-1", Info = "请填写正确的手机号" };
-        //     }
-        //     Dictionary<string, object> Obj = new Dictionary<string, object>();
-        //     bool checkCertId = maindb.Users.Any(m => m.Id != Id && m.CertId == CertId);
-        //     if (checkCertId)
-        //     {
-        //         return new AppResultJson() { Status = "-1", Info = "您输入的身份证号已经认证过了,请更换身份证" };
-        //     }
-        //     Users query = maindb.Users.FirstOrDefault(m => m.Id == Id);
-        //     if (query != null)
-        //     {
-        //         string result = BankCardCheckForThree.Instance.Do(SettleBankCardNo, CertId, RealName);
-        //         JsonData jsonObj = JsonMapper.ToObject(result);
-        //         if (jsonObj["code"].ToString() == "200")
-        //         {
-        //             if (jsonObj["data"]["result"].ToString() == "0")
-        //             {
-        //                 query.AuthFlag = 1;
-        //                 query.AuthDate = DateTime.Now;
-        //                 query.RealName = RealName; //真实姓名
-        //                 query.CertId = CertId; //身份证号
-        //                 query.Areas = Areas; //所在地区
-        //                 query.SeoTitle = BankName;
-        //                 query.SettleBankCardNo = SettleBankCardNo; //结算银行卡号
-        //                 query.SettleBankName = SettleBankName; //结算银行名称
-        //                 query.CertFrontImage = CertFrontImage; //身份证正面照
-        //                 query.CertReverseImage = CertReverseImage; //身份证反面照
-        //                 query.HandCertImage = HandCertImage; //手持身份证
-        //                 query.BankCardPositiveImage = BankCardPositiveImage; //银行卡正面照
-        //                 maindb.SaveChanges();
-        //                 UserAuthRecord auth = maindb.UserAuthRecord.Add(new UserAuthRecord()
-        //                 {
-        //                     CreateDate = DateTime.Now,
-        //                     UserId = Id, //创客
-        //                     RealName = RealName, //真实姓名
-        //                     IdcardNo = CertId, //身份证号码
-        //                     BankCardAccount = SettleBankCardNo, //银行卡账号
-        //                     BankMobile = BankMobile, //银行预留手机号码
-        //                 }).Entity;
-        //                 maindb.SaveChanges();
-        //                 RedisDbconn.Instance.AddList("MakeReferenceQrCode", query.Id.ToString());
-
-        //                 //实名认证成功后消息推送
-        //                 Users users = maindb.Users.FirstOrDefault(m => m.Id == query.ParentUserId);
-        //                 RedisDbconn.Instance.AddList("MsgPersonalQueue", Newtonsoft.Json.JsonConvert.SerializeObject(new MsgPersonal()
-        //                 {
-        //                     UserId = users.Id, //创客Id
-        //                     MsgType = 2,
-        //                     Title = "来新人啦", //标题
-        //                     Summary = "您的客小爽系统有新人加入了,请进入客小爽-我的创客中查看!",//简介
-        //                     CreateDate = DateTime.Now,
-
-        //                 }));
-
-        //                 var TradeMonth = DateTime.Now.ToString("yyyyMMdd");
-        //                 string SendData = "{\"Kind\":\"2\",\"Data\":{\"UserId\":\"" + users.Id + "\",\"DirectUserId\":\"" + Id + "\",\"TradeMonth\":\"" + TradeMonth + "\"}}";
-        //                 RedisDbconn.Instance.AddList("RecommendActStatQueue", SendData);
-
-        //                 return new AppResultJson() { Status = "1", Info = "", Data = Obj };
-        //             }
-        //             else
-        //             {
-        //                 return new AppResultJson() { Status = "-1", Info = jsonObj["data"]["desc"].ToString() };
-        //             }
-        //         }
-        //         else
-        //         {
-        //             return new AppResultJson() { Status = "-1", Info = jsonObj["msg"].ToString() };
-        //         }
-        //     }
-        //     return new AppResultJson() { Status = "-1", Info = "认证失败,请重试" };
-        // }
-
-
         [Authorize]
         public JsonResult PostAuth2(string value, string CertFrontBase64, string CertReverseBase64)
         {
@@ -1330,9 +1124,6 @@ namespace MySystem.Areas.Api.Controllers.v1
                             BankMobile = BankMobile, //银行预留手机号码
                         }).Entity;
                         maindb.SaveChanges();
-                        RedisDbconn.Instance.Set("FrontCertImg:" + Id, CertFrontBase64, 600);
-                        RedisDbconn.Instance.Set("BackCertImg:" + Id, CertReverseBase64, 600);
-                        RedisDbconn.Instance.AddList("CashPersonalCreateQueue", Id.ToString());
 
                         //实名认证成功后消息推送
                         Users users = maindb.Users.FirstOrDefault(m => m.Id == query.ParentUserId);
@@ -1341,15 +1132,11 @@ namespace MySystem.Areas.Api.Controllers.v1
                             UserId = users.Id, //创客Id
                             MsgType = 2,
                             Title = "来新人啦", //标题
-                            Summary = "您的客小爽系统有新人加入了,请进入客小爽-我的创客中查看!",//简介
+                            Summary = "您的码牌系统有新人加入了,请进入码牌-我的创客中查看!",//简介
                             CreateDate = DateTime.Now,
 
                         }));
 
-                        var TradeMonth = DateTime.Now.ToString("yyyyMMdd");
-                        string SendData = "{\"Kind\":\"2\",\"Data\":{\"UserId\":\"" + users.Id + "\",\"DirectUserId\":\"" + Id + "\",\"TradeMonth\":\"" + TradeMonth + "\"}}";
-                        RedisDbconn.Instance.AddList("RecommendActStatQueue", SendData);
-
                         return new AppResultJson() { Status = "1", Info = "", Data = Obj };
                     }
                     else
@@ -1422,128 +1209,12 @@ namespace MySystem.Areas.Api.Controllers.v1
                     auth.BankMobile = BankMobile; //银行预留手机号码
                 }
                 maindb.SaveChanges();
-                RedisDbconn.Instance.AddList("CashPersonalCreateQueue", Id.ToString());
                 return new AppResultJson() { Status = "1", Info = "", Data = Obj };
             }
             return new AppResultJson() { Status = "-1", Info = "认证失败,请重试" };
         }
 
 
-        // 提交代付签约
-        // [Authorize]
-        // public JsonResult CashAuthCheck(string value)
-        // {
-        //     value = DesDecrypt(value);
-        //     JsonData data = JsonMapper.ToObject(value);
-        //     int Id = int.Parse(function.CheckInt(data["Id"].ToString()));
-        //     string CertFrontImage = data["CertFrontImage"].ToString(); //身份证正面照
-        //     string CertReverseImage = data["CertReverseImage"].ToString(); //身份证反面照
-        //     // string BankName = data["BankName"].ToString(); //开户行全称
-        //     string SettleBankName = data["SettleBankName"].ToString(); //结算银行名称
-        //     string SettleBankCardNo = data["SettleBankCardNo"].ToString(); //结算银行卡号
-        //     string BankMobile = data["BankMobile"].ToString(); //银行预留手机号
-        //     if (string.IsNullOrEmpty(data["BankMobile"].ToString()))
-        //     {
-        //         return Json(new AppResultJson() { Status = "-1", Info = "请填写手机号" });
-        //     }
-        //     if (data["BankMobile"].ToString().Length > 11)
-        //     {
-        //         return Json(new AppResultJson() { Status = "-1", Info = "手机号最多11个字符" });
-        //     }
-        //     if (function.CheckMobile(data["BankMobile"].ToString()) == "")
-        //     {
-        //         return Json(new AppResultJson() { Status = "-1", Info = "请填写正确的手机号" });
-        //     }
-        //     Dictionary<string, object> Obj = new Dictionary<string, object>();
-        //     string check = RedisDbconn.Instance.Get<string>("CashAuth:" + Id);
-        //     if (!string.IsNullOrEmpty(check))
-        //     {
-        //         return Json(new AppResultJson() { Status = "-1", Info = "资料审核中, 请稍后再试" });
-        //     }
-        //     RedisDbconn.Instance.Set("CashAuth:" + Id, "1");
-        //     RedisDbconn.Instance.SetExpire("CashAuth:" + Id, 300);
-        //     Users query = maindb.Users.FirstOrDefault(m => m.Id == Id);
-        //     if (query != null)
-        //     {
-        //         query.SettleBankCardNo = SettleBankCardNo; //结算银行卡号
-        //         query.SettleBankName = SettleBankName; //结算银行名称
-        //         // query.CertFrontImage = CertFrontImage; //身份证正面照
-        //         // query.CertReverseImage = CertReverseImage; //身份证反面照
-        //         RedisDbconn.Instance.Set("FrontCertImg:" + Id, CertFrontImage, 600);
-        //         RedisDbconn.Instance.Set("BackCertImg:" + Id, CertReverseImage, 600);
-        //         RedisDbconn.Instance.AddList("CashPersonalCreateQueue", Id.ToString());
-        //         return Json(new AppResultJson() { Status = "1", Info = "", Data = Obj });
-        //     }
-        //     return Json(new AppResultJson() { Status = "-1", Info = "认证失败,请重试", Data = Obj });
-        // }
-
-        // [Authorize]
-        // public JsonResult CashAuth2(string value)
-        // {
-        //     value = DesDecrypt(value);
-        //     JsonData data = JsonMapper.ToObject(value);
-        //     AppResultJson result = CashAuth2Do(value);
-        //     return Json(new AppResultJson() { Status = result.Status, Info = result.Info, Data = result.Data });
-        // }
-        // public AppResultJson CashAuth2Do(string value)
-        // {
-        //     JsonData data = JsonMapper.ToObject(value);
-        //     int Id = int.Parse(function.CheckInt(data["Id"].ToString()));
-        //     string cashCheck = RedisDbconn.Instance.Get<string>("CashPersonalAddResult:" + Id);
-        //     if(string.IsNullOrEmpty(cashCheck))
-        //     {
-        //         return new AppResultJson() { Status = "0", Info = "" };
-        //     }
-        //     if(cashCheck != "success")
-        //     {
-        //         return new AppResultJson() { Status = "-1", Info = cashCheck };
-        //     }
-        //     string CertFrontImage = data["CertFrontImage"].ToString(); //身份证正面照
-        //     string CertReverseImage = data["CertReverseImage"].ToString(); //身份证反面照
-        //     // string BankName = data["BankName"].ToString(); //开户行全称
-        //     string SettleBankName = data["SettleBankName"].ToString(); //结算银行名称
-        //     string SettleBankCardNo = data["SettleBankCardNo"].ToString(); //结算银行卡号
-        //     string BankMobile = data["BankMobile"].ToString(); //银行预留手机号
-        //     if (string.IsNullOrEmpty(data["BankMobile"].ToString()))
-        //     {
-        //         return new AppResultJson() { Status = "-1", Info = "请填写手机号" };
-        //     }
-        //     if (data["BankMobile"].ToString().Length > 11)
-        //     {
-        //         return new AppResultJson() { Status = "-1", Info = "手机号最多11个字符" };
-        //     }
-        //     if (function.CheckMobile(data["BankMobile"].ToString()) == "")
-        //     {
-        //         return new AppResultJson() { Status = "-1", Info = "请填写正确的手机号" };
-        //     }
-        //     Dictionary<string, object> Obj = new Dictionary<string, object>();
-        //     string check = RedisDbconn.Instance.Get<string>("CashAuth:" + Id);
-        //     if (!string.IsNullOrEmpty(check))
-        //     {
-        //         return new AppResultJson() { Status = "-1", Info = "资料审核中, 请稍后再试" };
-        //     }
-        //     RedisDbconn.Instance.Set("CashAuth:" + Id, "1");
-        //     RedisDbconn.Instance.SetExpire("CashAuth:" + Id, 300);
-        //     Users query = maindb.Users.FirstOrDefault(m => m.Id == Id);
-        //     if (query != null)
-        //     {
-        //         query.SettleBankCardNo = SettleBankCardNo; //结算银行卡号
-        //         query.SettleBankName = SettleBankName; //结算银行名称
-        //         query.CertFrontImage = CertFrontImage; //身份证正面照
-        //         query.CertReverseImage = CertReverseImage; //身份证反面照
-        //         UserAuthRecord auth = maindb.UserAuthRecord.FirstOrDefault(m => m.UserId == Id);
-        //         if (auth != null)
-        //         {
-        //             auth.BankCardAccount = SettleBankCardNo; //银行卡账号
-        //             auth.BankMobile = BankMobile; //银行预留手机号码
-        //         }
-        //         maindb.SaveChanges();
-        //         return new AppResultJson() { Status = "1", Info = "", Data = Obj };
-        //     }
-        //     return new AppResultJson() { Status = "-1", Info = "认证失败,请重试" };
-        // }
-
-
         [Authorize]
         public JsonResult CashAuth2(string value, string CertFrontBase64, string CertReverseBase64)
         {
@@ -1597,9 +1268,6 @@ namespace MySystem.Areas.Api.Controllers.v1
                     auth.BankMobile = BankMobile; //银行预留手机号码
                 }
                 maindb.SaveChanges();
-                RedisDbconn.Instance.Set("FrontCertImg:" + Id, CertFrontBase64, 600);
-                RedisDbconn.Instance.Set("BackCertImg:" + Id, CertReverseBase64, 600);
-                RedisDbconn.Instance.AddList("CashPersonalCreateQueue", Id.ToString());
                 return new AppResultJson() { Status = "1", Info = "", Data = Obj };
             }
             return new AppResultJson() { Status = "-1", Info = "认证失败,请重试" };
@@ -2132,7 +1800,7 @@ namespace MySystem.Areas.Api.Controllers.v1
             Obj.Add("TradeTotal", TradeTotal); //总交易
             Obj.Add("ActTotal", ActTotal); //总激活数
 
-            List<KqProducts> products = RedisDbconn.Instance.GetList<KqProducts>("KqProducts", 1, 100);
+            List<KqProducts> products = new KqProductsService().List(new List<FieldItem>(), "", 1, 100);
             List<KqProducts> productall = products.Prepend(new KqProducts()
             {
                 Id = 0,
@@ -2391,10 +2059,11 @@ namespace MySystem.Areas.Api.Controllers.v1
             JsonData data = JsonMapper.ToObject(value);
             int UserId = int.Parse(function.CheckInt(data["UserId"].ToString())); //创客Id
             Dictionary<string, object> Obj = new Dictionary<string, object>();
-            int MakerTotal = maindb.Users.Count(m => m.ParentUserId == UserId); //RedisDbconn.Instance.Get<int>("TotalUser:" + UserId);
-            int AuthCount = maindb.Users.Count(m => m.ParentUserId == UserId && m.AuthFlag == 1); //RedisDbconn.Instance.Get<int>("TotalUser:Auth:" + UserId);
+            int MakerTotal = maindb.Users.Count(m => m.ParentUserId == UserId);
+            int AuthCount = maindb.Users.Count(m => m.ParentUserId == UserId && m.AuthFlag == 1);
             int NotAuthCount = MakerTotal - AuthCount;
-            int ThisMonthCount = RedisDbconn.Instance.Get<int>("TotalUser:" + UserId + ":" + DateTime.Now.ToString("yyyyMM"));
+            DateTime start = DateTime.Parse(DateTime.Now.ToString("yyyy-MM-dd") + " 00:00:00");
+            int ThisMonthCount = maindb.Users.Count(m => m.ParentUserId == UserId && m.AuthFlag == 1 && m.AuthDate >= start);
             Obj.Add("MakerTotal", MakerTotal); //创客总数
             Obj.Add("AuthCount", AuthCount); //已实名总数
             Obj.Add("NotAuthCount", NotAuthCount); //未实名总数

+ 2 - 0
Config/Base.cs

@@ -9,6 +9,8 @@ namespace AppConfig
         public static string Host = Library.ConfigurationManager.AppSettings["Host"].ToString();
         public static string Database = Library.ConfigurationManager.AppSettings["Database"].ToString();
         public static string defaultImage = Library.ConfigurationManager.AppSettings["Host"].ToString() + "/skin/app/default/static/images/default.jpg";
+        
+        public static string SqlConnStr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
         #region 数据库结构
         public static Dictionary<string, Dictionary<string, string>> mainTables = new Dictionary<string, Dictionary<string, string>>();
         public static Dictionary<string, Dictionary<string, string>> bsTables = new Dictionary<string, Dictionary<string, string>>();

+ 1 - 0
MainModels/ConsumerOrders.cs

@@ -27,5 +27,6 @@ namespace MySystem.MainModels
         public int ConsumerId { get; set; }
         public int MerchantId { get; set; }
         public ulong IsAct { get; set; }
+        public int UserId { get; set; }
     }
 }

+ 24 - 0
MainModels/MerchantAmountSummay.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.MainModels
+{
+    public partial class MerchantAmountSummay
+    {
+        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 int PayMode { get; set; }
+        public decimal TotalActual { get; set; }
+        public decimal TradeAmount { get; set; }
+        public string TradeDate { get; set; }
+        public string TradeMonth { get; set; }
+        public int MerchantId { get; set; }
+    }
+}

+ 2 - 0
MainModels/PosMerchantInfoBak.cs

@@ -43,5 +43,7 @@ namespace MySystem.MainModels
         public string MerchantMobile { get; set; }
         public string MerchantName { get; set; }
         public string MerchantNo { get; set; }
+        public int StandardMonths { get; set; }
+        public int StandardStatus { get; set; }
     }
 }

+ 1 - 0
MainModels/TradeRecord.cs

@@ -40,5 +40,6 @@ namespace MySystem.MainModels
         public string ParentNav { get; set; }
         public int PayType { get; set; }
         public int VipFlag { get; set; }
+        public int ActStatus { get; set; }
     }
 }

+ 23 - 0
MainModels/UserAmountSummary.cs

@@ -0,0 +1,23 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.MainModels
+{
+    public partial class UserAmountSummary
+    {
+        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 int PayMode { get; set; }
+        public decimal TotalAmount { get; set; }
+        public string TradeMonth { get; set; }
+        public string TradeDate { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 209 - 0
MainModels/WebCMSEntities.cs

@@ -83,6 +83,7 @@ namespace MySystem.MainModels
         public virtual DbSet<MenuRight> MenuRight { get; set; }
         public virtual DbSet<MerchantAddInfo> MerchantAddInfo { get; set; }
         public virtual DbSet<MerchantAdmin> MerchantAdmin { get; set; }
+        public virtual DbSet<MerchantAmountSummay> MerchantAmountSummay { get; set; }
         public virtual DbSet<MerchantAuth> MerchantAuth { get; set; }
         public virtual DbSet<MerchantClass> MerchantClass { get; set; }
         public virtual DbSet<MerchantCol> MerchantCol { get; set; }
@@ -216,10 +217,12 @@ namespace MySystem.MainModels
         public virtual DbSet<ToChargeBackRecord> ToChargeBackRecord { get; set; }
         public virtual DbSet<TradeDaySummary> TradeDaySummary { get; set; }
         public virtual DbSet<TradeRecord> TradeRecord { get; set; }
+        public virtual DbSet<TradeRecordTest> TradeRecordTest { get; set; }
         public virtual DbSet<UploadParams> UploadParams { get; set; }
         public virtual DbSet<UserAccount> UserAccount { get; set; }
         public virtual DbSet<UserAccountRecord> UserAccountRecord { get; set; }
         public virtual DbSet<UserAddress> UserAddress { get; set; }
+        public virtual DbSet<UserAmountSummary> UserAmountSummary { get; set; }
         public virtual DbSet<UserAuthRecord> UserAuthRecord { get; set; }
         public virtual DbSet<UserBack> UserBack { get; set; }
         public virtual DbSet<UserBackKind> UserBackKind { get; set; }
@@ -2159,6 +2162,8 @@ namespace MySystem.MainModels
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
@@ -5396,6 +5401,54 @@ namespace MySystem.MainModels
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<MerchantAmountSummay>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.MerchantId).HasColumnType("int(11)");
+
+                entity.Property(e => e.PayMode).HasColumnType("int(11)");
+
+                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.TotalActual).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.TradeAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.TradeDate)
+                    .HasColumnType("varchar(8)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.TradeMonth)
+                    .HasColumnType("varchar(6)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+            });
+
             modelBuilder.Entity<MerchantAuth>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -8858,6 +8911,9 @@ namespace MySystem.MainModels
 
             modelBuilder.Entity<PosMerchantInfoBak>(entity =>
             {
+                entity.HasIndex(e => new { e.KqSnNo, e.KqMerNo })
+                    .HasName("PosMerchantInfoBakIndex");
+
                 entity.Property(e => e.Id).HasColumnType("int(11)");
 
                 entity.Property(e => e.ActType).HasColumnType("int(11)");
@@ -8974,6 +9030,10 @@ namespace MySystem.MainModels
 
                 entity.Property(e => e.Sort).HasColumnType("int(11)");
 
+                entity.Property(e => e.StandardMonths).HasColumnType("int(11)");
+
+                entity.Property(e => e.StandardStatus).HasColumnType("int(11)");
+
                 entity.Property(e => e.Status).HasColumnType("int(11)");
 
                 entity.Property(e => e.TopUserId).HasColumnType("int(11)");
@@ -14516,6 +14576,8 @@ namespace MySystem.MainModels
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
 
+                entity.Property(e => e.ActStatus).HasColumnType("int(11)");
+
                 entity.Property(e => e.BankCardType).HasColumnType("int(11)");
 
                 entity.Property(e => e.BrandId).HasColumnType("int(11)");
@@ -14622,6 +14684,107 @@ namespace MySystem.MainModels
                 entity.Property(e => e.VipFlag).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<TradeRecordTest>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.BankCardType).HasColumnType("int(11)");
+
+                entity.Property(e => e.BrandId).HasColumnType("int(11)");
+
+                entity.Property(e => e.CapFlag).HasColumnType("int(11)");
+
+                entity.Property(e => e.ClearDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.DirectFlag)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'");
+
+                entity.Property(e => e.HelpMonthCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.MerBuddyType).HasColumnType("int(11)");
+
+                entity.Property(e => e.MerHelpFlag)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'");
+
+                entity.Property(e => e.MerNo)
+                    .HasColumnType("varchar(32)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.MerUserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.MerchantId).HasColumnType("int(11)");
+
+                entity.Property(e => e.QrPayFlag).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.RecordNo)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Remark)
+                    .HasColumnType("varchar(64)")
+                    .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.SnNo)
+                    .HasColumnType("varchar(32)")
+                    .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.TopUserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.TradeAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.TradeDate).HasColumnType("datetime");
+
+                entity.Property(e => e.TradeSerialNo)
+                    .HasColumnType("varchar(48)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
+            });
+
             modelBuilder.Entity<UploadParams>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -14937,6 +15100,52 @@ namespace MySystem.MainModels
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<UserAmountSummary>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.PayMode).HasColumnType("int(11)");
+
+                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.TotalAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.TradeDate)
+                    .HasColumnType("varchar(8)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.TradeMonth)
+                    .HasColumnType("varchar(6)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+            });
+
             modelBuilder.Entity<UserAuthRecord>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");

+ 4 - 4
Services/ActivityInfoService.cs

@@ -23,9 +23,9 @@ namespace MySystem
         /// <param name="page">页码</param>
         /// <param name="limit">每页条数</param>
         /// <returns></returns>
-        public List<ActivityInfo> List(List<FieldItem> fields, string condition, int page = 1, int limit = 30)
+        public List<ActivityInfo> List(List<FieldItem> fields, string condition, int page = 1, int limit = 30, string orderby = "Id desc")
         {
-            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("ActivityInfo", fields, "Id desc", "0", page, limit, condition);
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("ActivityInfo", fields, orderby, "0", page, limit, condition);
             List<ActivityInfo> diclist = obj["data"] as List<ActivityInfo>;
             return diclist;
         }
@@ -111,9 +111,9 @@ namespace MySystem
         /// <param name="fields">查询条件(单个字段)</param>
         /// <param name="condition">查询条件(sql语句)</param>
         /// <returns></returns>
-        public Dictionary<string, object> ExportExcel(List<FieldItem> fields, string condition)
+        public Dictionary<string, object> ExportExcel(List<FieldItem> fields, string condition, string orderby = "Id desc")
         {
-            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("ActivityInfo", fields, "Id desc", "0", 1, 20000, condition, "Id", false);
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("ActivityInfo", fields, orderby, "0", 1, 20000, condition, "Id", false);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
             foreach (Dictionary<string, object> dic in diclist)
             {

+ 4 - 4
Services/AdvertismentService.cs

@@ -23,9 +23,9 @@ namespace MySystem
         /// <param name="page">页码</param>
         /// <param name="limit">每页条数</param>
         /// <returns></returns>
-        public List<Advertisment> List(List<FieldItem> fields, string condition, int page = 1, int limit = 30)
+        public List<Advertisment> List(List<FieldItem> fields, string condition, int page = 1, int limit = 30, string orderby = "Id desc")
         {
-            Dictionary<string, object> obj = new DbService(AppConfig.Base.bsTables, _conn).IndexData("Advertisment", fields, "Id desc", "0", page, limit, condition);
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.bsTables, _conn).IndexData("Advertisment", fields, orderby, "0", page, limit, condition);
             List<Advertisment> diclist = obj["data"] as List<Advertisment>;
             return diclist;
         }
@@ -111,9 +111,9 @@ namespace MySystem
         /// <param name="fields">查询条件(单个字段)</param>
         /// <param name="condition">查询条件(sql语句)</param>
         /// <returns></returns>
-        public Dictionary<string, object> ExportExcel(List<FieldItem> fields, string condition)
+        public Dictionary<string, object> ExportExcel(List<FieldItem> fields, string condition, string orderby = "Id desc")
         {
-            Dictionary<string, object> obj = new DbService(AppConfig.Base.bsTables, _conn).IndexData("Advertisment", fields, "Id desc", "0", 1, 20000, condition, "Id", false);
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.bsTables, _conn).IndexData("Advertisment", fields, orderby, "0", 1, 20000, condition, "Id", false);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
             foreach (Dictionary<string, object> dic in diclist)
             {

+ 4 - 4
Services/ColService.cs

@@ -23,9 +23,9 @@ namespace MySystem
         /// <param name="page">页码</param>
         /// <param name="limit">每页条数</param>
         /// <returns></returns>
-        public List<Col> List(List<FieldItem> fields, string condition, int page = 1, int limit = 30)
+        public List<Col> List(List<FieldItem> fields, string condition, int page = 1, int limit = 30, string orderby = "Id desc")
         {
-            Dictionary<string, object> obj = new DbService(AppConfig.Base.bsTables, _conn).IndexData("Col", fields, "Id desc", "0", page, limit, condition);
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.bsTables, _conn).IndexData("Col", fields, orderby, "0", page, limit, condition);
             List<Col> diclist = obj["data"] as List<Col>;
             return diclist;
         }
@@ -111,9 +111,9 @@ namespace MySystem
         /// <param name="fields">查询条件(单个字段)</param>
         /// <param name="condition">查询条件(sql语句)</param>
         /// <returns></returns>
-        public Dictionary<string, object> ExportExcel(List<FieldItem> fields, string condition)
+        public Dictionary<string, object> ExportExcel(List<FieldItem> fields, string condition, string orderby = "Id desc")
         {
-            Dictionary<string, object> obj = new DbService(AppConfig.Base.bsTables, _conn).IndexData("Col", fields, "Id desc", "0", 1, 20000, condition, "Id", false);
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.bsTables, _conn).IndexData("Col", fields, orderby, "0", 1, 20000, condition, "Id", false);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
             foreach (Dictionary<string, object> dic in diclist)
             {

+ 4 - 4
Services/ConsumerOrdersService.cs

@@ -23,9 +23,9 @@ namespace MySystem
         /// <param name="page">页码</param>
         /// <param name="limit">每页条数</param>
         /// <returns></returns>
-        public List<ConsumerOrders> List(List<FieldItem> fields, string condition, int page = 1, int limit = 30)
+        public List<ConsumerOrders> List(List<FieldItem> fields, string condition, int page = 1, int limit = 30, string orderby = "Id desc")
         {
-            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("ConsumerOrders", fields, "Id desc", "0", page, limit, condition);
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("ConsumerOrders", fields, orderby, "0", page, limit, condition);
             List<ConsumerOrders> diclist = obj["data"] as List<ConsumerOrders>;
             return diclist;
         }
@@ -111,9 +111,9 @@ namespace MySystem
         /// <param name="fields">查询条件(单个字段)</param>
         /// <param name="condition">查询条件(sql语句)</param>
         /// <returns></returns>
-        public Dictionary<string, object> ExportExcel(List<FieldItem> fields, string condition)
+        public Dictionary<string, object> ExportExcel(List<FieldItem> fields, string condition, string orderby = "Id desc")
         {
-            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("ConsumerOrders", fields, "Id desc", "0", 1, 20000, condition, "Id", false);
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("ConsumerOrders", fields, orderby, "0", 1, 20000, condition, "Id", false);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
             foreach (Dictionary<string, object> dic in diclist)
             {

+ 4 - 4
Services/ConsumerProfitService.cs

@@ -23,9 +23,9 @@ namespace MySystem
         /// <param name="page">页码</param>
         /// <param name="limit">每页条数</param>
         /// <returns></returns>
-        public List<ConsumerProfit> List(List<FieldItem> fields, string condition, int page = 1, int limit = 30)
+        public List<ConsumerProfit> List(List<FieldItem> fields, string condition, int page = 1, int limit = 30, string orderby = "Id desc")
         {
-            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("ConsumerProfit", fields, "Id desc", "0", page, limit, condition);
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("ConsumerProfit", fields, orderby, "0", page, limit, condition);
             List<ConsumerProfit> diclist = obj["data"] as List<ConsumerProfit>;
             return diclist;
         }
@@ -111,9 +111,9 @@ namespace MySystem
         /// <param name="fields">查询条件(单个字段)</param>
         /// <param name="condition">查询条件(sql语句)</param>
         /// <returns></returns>
-        public Dictionary<string, object> ExportExcel(List<FieldItem> fields, string condition)
+        public Dictionary<string, object> ExportExcel(List<FieldItem> fields, string condition, string orderby = "Id desc")
         {
-            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("ConsumerProfit", fields, "Id desc", "0", 1, 20000, condition, "Id", false);
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("ConsumerProfit", fields, orderby, "0", 1, 20000, condition, "Id", false);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
             foreach (Dictionary<string, object> dic in diclist)
             {

+ 132 - 0
Services/ConsumersService.cs

@@ -0,0 +1,132 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using MySystem.MainModels;
+using Library;
+using LitJson;
+
+namespace MySystem
+{
+    public class ConsumersService
+    {
+        string _conn = "";
+        public ConsumersService()
+        {
+            _conn = ConfigurationManager.AppSettings["SqlConnStr"].ToString();
+        }
+
+        /// <summary>
+        /// 查询列表
+        /// </summary>
+        /// <param name="fields">查询条件(单个字段)</param>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <param name="page">页码</param>
+        /// <param name="limit">每页条数</param>
+        /// <returns></returns>
+        public List<Consumers> List(List<FieldItem> fields, string condition, int page = 1, int limit = 30, string orderby = "Id desc")
+        {
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("Consumers", fields, orderby, "0", page, limit, condition);
+            List<Consumers> diclist = obj["data"] as List<Consumers>;
+            return diclist;
+        }
+
+        /// <summary>
+        /// 查询一条记录
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <returns></returns>
+        public Consumers Query(int Id)
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            Consumers editData = db.Consumers.FirstOrDefault(m => m.Id == Id) ?? new Consumers();
+            db.Dispose();
+            return editData;
+        }
+
+        /// <summary>
+        /// 添加数据
+        /// </summary>
+        /// <param name="Fields">要设置的字段</param>
+        /// <returns></returns>
+        public int Add(Dictionary<string, object> Fields)
+        {
+            return new DbService(AppConfig.Base.mainTables, _conn).Add("Consumers", Fields, 0);
+        }
+
+        /// <summary>
+        /// 修改数据
+        /// </summary>
+        /// <param name="Fields">要设置的字段</param>
+        /// <param name="Id">主键Id</param>
+        public void Edit(Dictionary<string, object> Fields, int Id)
+        {
+            new DbService(AppConfig.Base.mainTables, _conn).Edit("Consumers", Fields, Id);
+        }
+
+        /// <summary>
+        /// 删除数据
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        public void Delete(int Id)
+        {
+            new DbService(AppConfig.Base.mainTables, _conn).Delete("Consumers", Id);
+        }
+
+        /// <summary>
+        /// 排序
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <param name="Sort">排序序号</param>
+        public void Sort(int Id, int Sort)
+        {
+            new DbService(AppConfig.Base.mainTables, _conn).Sort("Consumers", Sort, Id);
+        }
+
+        /// <summary>
+        /// 导入数据
+        /// </summary>
+        /// <param name="ExcelData">json数据</param>
+        public void Import(string ExcelData)
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            JsonData list = JsonMapper.ToObject(ExcelData);
+            for (int i = 1; i < list.Count;i++ )
+            {
+                JsonData dr = list[i];
+                
+                db.Consumers.Add(new Consumers()
+                {
+                    CreateDate = DateTime.Now,
+                    UpdateDate = DateTime.Now,
+                    
+                });
+                db.SaveChanges();
+            }
+            db.Dispose();
+        }
+
+        /// <summary>
+        /// 导出excel表格
+        /// </summary>
+        /// <param name="fields">查询条件(单个字段)</param>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <returns></returns>
+        public Dictionary<string, object> ExportExcel(List<FieldItem> fields, string condition, string orderby = "Id desc")
+        {
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("Consumers", fields, orderby, "0", 1, 20000, condition, "Id", false);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            foreach (Dictionary<string, object> dic in diclist)
+            {
+            }
+
+            Dictionary<string, object> result = new Dictionary<string, object>();
+            result.Add("Status", "1");
+            result.Add("Info", "Excel报表-" + DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss") + ".xlsx");
+            result.Add("Obj", diclist);
+            Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
+
+            result.Add("Fields", ReturnFields);
+            return result;
+        }
+    }
+}

+ 4 - 4
Services/IndexIconListService.cs

@@ -23,9 +23,9 @@ namespace MySystem
         /// <param name="page">页码</param>
         /// <param name="limit">每页条数</param>
         /// <returns></returns>
-        public List<IndexIconList> List(List<FieldItem> fields, string condition, int page = 1, int limit = 30)
+        public List<IndexIconList> List(List<FieldItem> fields, string condition, int page = 1, int limit = 30, string orderby = "Id desc")
         {
-            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("IndexIconList", fields, "Id desc", "0", page, limit, condition);
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("IndexIconList", fields, orderby, "0", page, limit, condition);
             List<IndexIconList> diclist = obj["data"] as List<IndexIconList>;
             return diclist;
         }
@@ -111,9 +111,9 @@ namespace MySystem
         /// <param name="fields">查询条件(单个字段)</param>
         /// <param name="condition">查询条件(sql语句)</param>
         /// <returns></returns>
-        public Dictionary<string, object> ExportExcel(List<FieldItem> fields, string condition)
+        public Dictionary<string, object> ExportExcel(List<FieldItem> fields, string condition, string orderby = "Id desc")
         {
-            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("IndexIconList", fields, "Id desc", "0", 1, 20000, condition, "Id", false);
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("IndexIconList", fields, orderby, "0", 1, 20000, condition, "Id", false);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
             foreach (Dictionary<string, object> dic in diclist)
             {

+ 132 - 0
Services/KqProductsService.cs

@@ -0,0 +1,132 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using MySystem.MainModels;
+using Library;
+using LitJson;
+
+namespace MySystem
+{
+    public class KqProductsService
+    {
+        string _conn = "";
+        public KqProductsService()
+        {
+            _conn = ConfigurationManager.AppSettings["SqlConnStr"].ToString();
+        }
+
+        /// <summary>
+        /// 查询列表
+        /// </summary>
+        /// <param name="fields">查询条件(单个字段)</param>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <param name="page">页码</param>
+        /// <param name="limit">每页条数</param>
+        /// <returns></returns>
+        public List<KqProducts> List(List<FieldItem> fields, string condition, int page = 1, int limit = 30, string orderby = "Id desc")
+        {
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("KqProducts", fields, orderby, "0", page, limit, condition);
+            List<KqProducts> diclist = obj["data"] as List<KqProducts>;
+            return diclist;
+        }
+
+        /// <summary>
+        /// 查询一条记录
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <returns></returns>
+        public KqProducts Query(int Id)
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            KqProducts editData = db.KqProducts.FirstOrDefault(m => m.Id == Id) ?? new KqProducts();
+            db.Dispose();
+            return editData;
+        }
+
+        /// <summary>
+        /// 添加数据
+        /// </summary>
+        /// <param name="Fields">要设置的字段</param>
+        /// <returns></returns>
+        public int Add(Dictionary<string, object> Fields)
+        {
+            return new DbService(AppConfig.Base.mainTables, _conn).Add("KqProducts", Fields, 0);
+        }
+
+        /// <summary>
+        /// 修改数据
+        /// </summary>
+        /// <param name="Fields">要设置的字段</param>
+        /// <param name="Id">主键Id</param>
+        public void Edit(Dictionary<string, object> Fields, int Id)
+        {
+            new DbService(AppConfig.Base.mainTables, _conn).Edit("KqProducts", Fields, Id);
+        }
+
+        /// <summary>
+        /// 删除数据
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        public void Delete(int Id)
+        {
+            new DbService(AppConfig.Base.mainTables, _conn).Delete("KqProducts", Id);
+        }
+
+        /// <summary>
+        /// 排序
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <param name="Sort">排序序号</param>
+        public void Sort(int Id, int Sort)
+        {
+            new DbService(AppConfig.Base.mainTables, _conn).Sort("KqProducts", Sort, Id);
+        }
+
+        /// <summary>
+        /// 导入数据
+        /// </summary>
+        /// <param name="ExcelData">json数据</param>
+        public void Import(string ExcelData)
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            JsonData list = JsonMapper.ToObject(ExcelData);
+            for (int i = 1; i < list.Count;i++ )
+            {
+                JsonData dr = list[i];
+                
+                db.KqProducts.Add(new KqProducts()
+                {
+                    CreateDate = DateTime.Now,
+                    UpdateDate = DateTime.Now,
+                    
+                });
+                db.SaveChanges();
+            }
+            db.Dispose();
+        }
+
+        /// <summary>
+        /// 导出excel表格
+        /// </summary>
+        /// <param name="fields">查询条件(单个字段)</param>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <returns></returns>
+        public Dictionary<string, object> ExportExcel(List<FieldItem> fields, string condition, string orderby = "Id desc")
+        {
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("KqProducts", fields, orderby, "0", 1, 20000, condition, "Id", false);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            foreach (Dictionary<string, object> dic in diclist)
+            {
+            }
+
+            Dictionary<string, object> result = new Dictionary<string, object>();
+            result.Add("Status", "1");
+            result.Add("Info", "Excel报表-" + DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss") + ".xlsx");
+            result.Add("Obj", diclist);
+            Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
+
+            result.Add("Fields", ReturnFields);
+            return result;
+        }
+    }
+}

+ 132 - 0
Services/MerchantAmountSummayService.cs

@@ -0,0 +1,132 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using MySystem.MainModels;
+using Library;
+using LitJson;
+
+namespace MySystem
+{
+    public class MerchantAmountSummayService
+    {
+        string _conn = "";
+        public MerchantAmountSummayService()
+        {
+            _conn = ConfigurationManager.AppSettings["SqlConnStr"].ToString();
+        }
+
+        /// <summary>
+        /// 查询列表
+        /// </summary>
+        /// <param name="fields">查询条件(单个字段)</param>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <param name="page">页码</param>
+        /// <param name="limit">每页条数</param>
+        /// <returns></returns>
+        public List<MerchantAmountSummay> List(List<FieldItem> fields, string condition, int page = 1, int limit = 30, string orderby = "Id desc")
+        {
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("MerchantAmountSummay", fields, orderby, "0", page, limit, condition);
+            List<MerchantAmountSummay> diclist = obj["data"] as List<MerchantAmountSummay>;
+            return diclist;
+        }
+
+        /// <summary>
+        /// 查询一条记录
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <returns></returns>
+        public MerchantAmountSummay Query(int MerchantId, string TradeDate)
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            MerchantAmountSummay editData = db.MerchantAmountSummay.FirstOrDefault(m => m.MerchantId == MerchantId && m.TradeDate == TradeDate) ?? new MerchantAmountSummay();
+            db.Dispose();
+            return editData;
+        }
+
+        /// <summary>
+        /// 添加数据
+        /// </summary>
+        /// <param name="Fields">要设置的字段</param>
+        /// <returns></returns>
+        public int Add(Dictionary<string, object> Fields)
+        {
+            return new DbService(AppConfig.Base.mainTables, _conn).Add("MerchantAmountSummay", Fields, 0);
+        }
+
+        /// <summary>
+        /// 修改数据
+        /// </summary>
+        /// <param name="Fields">要设置的字段</param>
+        /// <param name="Id">主键Id</param>
+        public void Edit(Dictionary<string, object> Fields, int Id)
+        {
+            new DbService(AppConfig.Base.mainTables, _conn).Edit("MerchantAmountSummay", Fields, Id);
+        }
+
+        /// <summary>
+        /// 删除数据
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        public void Delete(int Id)
+        {
+            new DbService(AppConfig.Base.mainTables, _conn).Delete("MerchantAmountSummay", Id);
+        }
+
+        /// <summary>
+        /// 排序
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <param name="Sort">排序序号</param>
+        public void Sort(int Id, int Sort)
+        {
+            new DbService(AppConfig.Base.mainTables, _conn).Sort("MerchantAmountSummay", Sort, Id);
+        }
+
+        /// <summary>
+        /// 导入数据
+        /// </summary>
+        /// <param name="ExcelData">json数据</param>
+        public void Import(string ExcelData)
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            JsonData list = JsonMapper.ToObject(ExcelData);
+            for (int i = 1; i < list.Count;i++ )
+            {
+                JsonData dr = list[i];
+                
+                db.MerchantAmountSummay.Add(new MerchantAmountSummay()
+                {
+                    CreateDate = DateTime.Now,
+                    UpdateDate = DateTime.Now,
+                    
+                });
+                db.SaveChanges();
+            }
+            db.Dispose();
+        }
+
+        /// <summary>
+        /// 导出excel表格
+        /// </summary>
+        /// <param name="fields">查询条件(单个字段)</param>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <returns></returns>
+        public Dictionary<string, object> ExportExcel(List<FieldItem> fields, string condition, string orderby = "Id desc")
+        {
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("MerchantAmountSummay", fields, orderby, "0", 1, 20000, condition, "Id", false);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            foreach (Dictionary<string, object> dic in diclist)
+            {
+            }
+
+            Dictionary<string, object> result = new Dictionary<string, object>();
+            result.Add("Status", "1");
+            result.Add("Info", "Excel报表-" + DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss") + ".xlsx");
+            result.Add("Obj", diclist);
+            Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
+
+            result.Add("Fields", ReturnFields);
+            return result;
+        }
+    }
+}

+ 4 - 4
Services/MerchantForMobileService.cs

@@ -23,9 +23,9 @@ namespace MySystem
         /// <param name="page">页码</param>
         /// <param name="limit">每页条数</param>
         /// <returns></returns>
-        public List<MerchantForMobile> List(List<FieldItem> fields, string condition, int page = 1, int limit = 30)
+        public List<MerchantForMobile> List(List<FieldItem> fields, string condition, int page = 1, int limit = 30, string orderby = "Id desc")
         {
-            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("MerchantForMobile", fields, "Id desc", "0", page, limit, condition);
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("MerchantForMobile", fields, orderby, "0", page, limit, condition);
             List<MerchantForMobile> diclist = obj["data"] as List<MerchantForMobile>;
             return diclist;
         }
@@ -108,9 +108,9 @@ namespace MySystem
         /// <param name="fields">查询条件(单个字段)</param>
         /// <param name="condition">查询条件(sql语句)</param>
         /// <returns></returns>
-        public Dictionary<string, object> ExportExcel(List<FieldItem> fields, string condition)
+        public Dictionary<string, object> ExportExcel(List<FieldItem> fields, string condition, string orderby = "Id desc")
         {
-            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("MerchantForMobile", fields, "Id desc", "0", 1, 20000, condition, "Id", false);
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("MerchantForMobile", fields, orderby, "0", 1, 20000, condition, "Id", false);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
             foreach (Dictionary<string, object> dic in diclist)
             {

+ 4 - 4
Services/MerchantQrCodeService.cs

@@ -23,9 +23,9 @@ namespace MySystem
         /// <param name="page">页码</param>
         /// <param name="limit">每页条数</param>
         /// <returns></returns>
-        public List<MerchantQrCode> List(List<FieldItem> fields, string condition, int page = 1, int limit = 30)
+        public List<MerchantQrCode> List(List<FieldItem> fields, string condition, int page = 1, int limit = 30, string orderby = "Id desc")
         {
-            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("MerchantQrCode", fields, "Id desc", "0", page, limit, condition);
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("MerchantQrCode", fields, orderby, "0", page, limit, condition);
             List<MerchantQrCode> diclist = obj["data"] as List<MerchantQrCode>;
             return diclist;
         }
@@ -116,9 +116,9 @@ namespace MySystem
         /// <param name="fields">查询条件(单个字段)</param>
         /// <param name="condition">查询条件(sql语句)</param>
         /// <returns></returns>
-        public Dictionary<string, object> ExportExcel(List<FieldItem> fields, string condition)
+        public Dictionary<string, object> ExportExcel(List<FieldItem> fields, string condition, string orderby = "Id desc")
         {
-            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("MerchantQrCode", fields, "Id desc", "0", 1, 20000, condition, "Id", false);
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("MerchantQrCode", fields, orderby, "0", 1, 20000, condition, "Id", false);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
             foreach (Dictionary<string, object> dic in diclist)
             {

+ 4 - 4
Services/PageInfoService.cs

@@ -23,9 +23,9 @@ namespace MySystem
         /// <param name="page">页码</param>
         /// <param name="limit">每页条数</param>
         /// <returns></returns>
-        public List<PageInfo> List(List<FieldItem> fields, string condition, int page = 1, int limit = 30)
+        public List<PageInfo> List(List<FieldItem> fields, string condition, int page = 1, int limit = 30, string orderby = "Id desc")
         {
-            Dictionary<string, object> obj = new DbService(AppConfig.Base.bsTables, _conn).IndexData("PageInfo", fields, "Id desc", "0", page, limit, condition);
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.bsTables, _conn).IndexData("PageInfo", fields, orderby, "0", page, limit, condition);
             List<PageInfo> diclist = obj["data"] as List<PageInfo>;
             return diclist;
         }
@@ -111,9 +111,9 @@ namespace MySystem
         /// <param name="fields">查询条件(单个字段)</param>
         /// <param name="condition">查询条件(sql语句)</param>
         /// <returns></returns>
-        public Dictionary<string, object> ExportExcel(List<FieldItem> fields, string condition)
+        public Dictionary<string, object> ExportExcel(List<FieldItem> fields, string condition, string orderby = "Id desc")
         {
-            Dictionary<string, object> obj = new DbService(AppConfig.Base.bsTables, _conn).IndexData("PageInfo", fields, "Id desc", "0", 1, 20000, condition, "Id", false);
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.bsTables, _conn).IndexData("PageInfo", fields, orderby, "0", 1, 20000, condition, "Id", false);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
             foreach (Dictionary<string, object> dic in diclist)
             {

+ 4 - 4
Services/PosMachinesService.cs

@@ -23,9 +23,9 @@ namespace MySystem
         /// <param name="page">页码</param>
         /// <param name="limit">每页条数</param>
         /// <returns></returns>
-        public List<PosMachines> List(List<FieldItem> fields, string condition, int page = 1, int limit = 30)
+        public List<PosMachines> List(List<FieldItem> fields, string condition, int page = 1, int limit = 30, string orderby = "Id desc")
         {
-            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("PosMachines", fields, "Id desc", "0", page, limit, condition);
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("PosMachines", fields, orderby, "0", page, limit, condition);
             List<PosMachines> diclist = obj["data"] as List<PosMachines>;
             return diclist;
         }
@@ -111,9 +111,9 @@ namespace MySystem
         /// <param name="fields">查询条件(单个字段)</param>
         /// <param name="condition">查询条件(sql语句)</param>
         /// <returns></returns>
-        public Dictionary<string, object> ExportExcel(List<FieldItem> fields, string condition)
+        public Dictionary<string, object> ExportExcel(List<FieldItem> fields, string condition, string orderby = "Id desc")
         {
-            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("PosMachines", fields, "Id desc", "0", 1, 20000, condition, "Id", false);
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("PosMachines", fields, orderby, "0", 1, 20000, condition, "Id", false);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
             foreach (Dictionary<string, object> dic in diclist)
             {

+ 132 - 0
Services/ServiceCenterService.cs

@@ -0,0 +1,132 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using MySystem.MainModels;
+using Library;
+using LitJson;
+
+namespace MySystem
+{
+    public class ServiceCenterService
+    {
+        string _conn = "";
+        public ServiceCenterService()
+        {
+            _conn = ConfigurationManager.AppSettings["SqlConnStr"].ToString();
+        }
+
+        /// <summary>
+        /// 查询列表
+        /// </summary>
+        /// <param name="fields">查询条件(单个字段)</param>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <param name="page">页码</param>
+        /// <param name="limit">每页条数</param>
+        /// <returns></returns>
+        public List<ServiceCenter> List(List<FieldItem> fields, string condition, int page = 1, int limit = 30, string orderby = "Id desc")
+        {
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("ServiceCenter", fields, orderby, "0", page, limit, condition);
+            List<ServiceCenter> diclist = obj["data"] as List<ServiceCenter>;
+            return diclist;
+        }
+
+        /// <summary>
+        /// 查询一条记录
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <returns></returns>
+        public ServiceCenter Query(int Id)
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            ServiceCenter editData = db.ServiceCenter.FirstOrDefault(m => m.Id == Id) ?? new ServiceCenter();
+            db.Dispose();
+            return editData;
+        }
+
+        /// <summary>
+        /// 添加数据
+        /// </summary>
+        /// <param name="Fields">要设置的字段</param>
+        /// <returns></returns>
+        public int Add(Dictionary<string, object> Fields)
+        {
+            return new DbService(AppConfig.Base.mainTables, _conn).Add("ServiceCenter", Fields, 0);
+        }
+
+        /// <summary>
+        /// 修改数据
+        /// </summary>
+        /// <param name="Fields">要设置的字段</param>
+        /// <param name="Id">主键Id</param>
+        public void Edit(Dictionary<string, object> Fields, int Id)
+        {
+            new DbService(AppConfig.Base.mainTables, _conn).Edit("ServiceCenter", Fields, Id);
+        }
+
+        /// <summary>
+        /// 删除数据
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        public void Delete(int Id)
+        {
+            new DbService(AppConfig.Base.mainTables, _conn).Delete("ServiceCenter", Id);
+        }
+
+        /// <summary>
+        /// 排序
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <param name="Sort">排序序号</param>
+        public void Sort(int Id, int Sort)
+        {
+            new DbService(AppConfig.Base.mainTables, _conn).Sort("ServiceCenter", Sort, Id);
+        }
+
+        /// <summary>
+        /// 导入数据
+        /// </summary>
+        /// <param name="ExcelData">json数据</param>
+        public void Import(string ExcelData)
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            JsonData list = JsonMapper.ToObject(ExcelData);
+            for (int i = 1; i < list.Count;i++ )
+            {
+                JsonData dr = list[i];
+                
+                db.ServiceCenter.Add(new ServiceCenter()
+                {
+                    CreateDate = DateTime.Now,
+                    UpdateDate = DateTime.Now,
+                    
+                });
+                db.SaveChanges();
+            }
+            db.Dispose();
+        }
+
+        /// <summary>
+        /// 导出excel表格
+        /// </summary>
+        /// <param name="fields">查询条件(单个字段)</param>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <returns></returns>
+        public Dictionary<string, object> ExportExcel(List<FieldItem> fields, string condition, string orderby = "Id desc")
+        {
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("ServiceCenter", fields, orderby, "0", 1, 20000, condition, "Id", false);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            foreach (Dictionary<string, object> dic in diclist)
+            {
+            }
+
+            Dictionary<string, object> result = new Dictionary<string, object>();
+            result.Add("Status", "1");
+            result.Add("Info", "Excel报表-" + DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss") + ".xlsx");
+            result.Add("Obj", diclist);
+            Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
+
+            result.Add("Fields", ReturnFields);
+            return result;
+        }
+    }
+}

+ 132 - 0
Services/UploadParamsService.cs

@@ -0,0 +1,132 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using MySystem.Models;
+using Library;
+using LitJson;
+
+namespace MySystem
+{
+    public class UploadParamsService
+    {
+        string _conn = "";
+        public UploadParamsService()
+        {
+            _conn = ConfigurationManager.AppSettings["SqlConnStr"].ToString();
+        }
+
+        /// <summary>
+        /// 查询列表
+        /// </summary>
+        /// <param name="fields">查询条件(单个字段)</param>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <param name="page">页码</param>
+        /// <param name="limit">每页条数</param>
+        /// <returns></returns>
+        public List<UploadParams> List(List<FieldItem> fields, string condition, int page = 1, int limit = 30, string orderby = "Id desc")
+        {
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("UploadParams", fields, orderby, "0", page, limit, condition);
+            List<UploadParams> diclist = obj["data"] as List<UploadParams>;
+            return diclist;
+        }
+
+        /// <summary>
+        /// 查询一条记录
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <returns></returns>
+        public UploadParams Query(int Id)
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            UploadParams editData = db.UploadParams.FirstOrDefault(m => m.Id == Id) ?? new UploadParams();
+            db.Dispose();
+            return editData;
+        }
+
+        /// <summary>
+        /// 添加数据
+        /// </summary>
+        /// <param name="Fields">要设置的字段</param>
+        /// <returns></returns>
+        public int Add(Dictionary<string, object> Fields)
+        {
+            return new DbService(AppConfig.Base.mainTables, _conn).Add("UploadParams", Fields, 0);
+        }
+
+        /// <summary>
+        /// 修改数据
+        /// </summary>
+        /// <param name="Fields">要设置的字段</param>
+        /// <param name="Id">主键Id</param>
+        public void Edit(Dictionary<string, object> Fields, int Id)
+        {
+            new DbService(AppConfig.Base.mainTables, _conn).Edit("UploadParams", Fields, Id);
+        }
+
+        /// <summary>
+        /// 删除数据
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        public void Delete(int Id)
+        {
+            new DbService(AppConfig.Base.mainTables, _conn).Delete("UploadParams", Id);
+        }
+
+        /// <summary>
+        /// 排序
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <param name="Sort">排序序号</param>
+        public void Sort(int Id, int Sort)
+        {
+            new DbService(AppConfig.Base.mainTables, _conn).Sort("UploadParams", Sort, Id);
+        }
+
+        /// <summary>
+        /// 导入数据
+        /// </summary>
+        /// <param name="ExcelData">json数据</param>
+        public void Import(string ExcelData)
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            JsonData list = JsonMapper.ToObject(ExcelData);
+            for (int i = 1; i < list.Count;i++ )
+            {
+                JsonData dr = list[i];
+                
+                db.UploadParams.Add(new UploadParams()
+                {
+                    CreateDate = DateTime.Now,
+                    UpdateDate = DateTime.Now,
+                    
+                });
+                db.SaveChanges();
+            }
+            db.Dispose();
+        }
+
+        /// <summary>
+        /// 导出excel表格
+        /// </summary>
+        /// <param name="fields">查询条件(单个字段)</param>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <returns></returns>
+        public Dictionary<string, object> ExportExcel(List<FieldItem> fields, string condition, string orderby = "Id desc")
+        {
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("UploadParams", fields, orderby, "0", 1, 20000, condition, "Id", false);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            foreach (Dictionary<string, object> dic in diclist)
+            {
+            }
+
+            Dictionary<string, object> result = new Dictionary<string, object>();
+            result.Add("Status", "1");
+            result.Add("Info", "Excel报表-" + DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss") + ".xlsx");
+            result.Add("Obj", diclist);
+            Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
+
+            result.Add("Fields", ReturnFields);
+            return result;
+        }
+    }
+}

+ 132 - 0
Services/UserBackKindService.cs

@@ -0,0 +1,132 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using MySystem.MainModels;
+using Library;
+using LitJson;
+
+namespace MySystem
+{
+    public class UserBackKindService
+    {
+        string _conn = "";
+        public UserBackKindService()
+        {
+            _conn = ConfigurationManager.AppSettings["SqlConnStr"].ToString();
+        }
+
+        /// <summary>
+        /// 查询列表
+        /// </summary>
+        /// <param name="fields">查询条件(单个字段)</param>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <param name="page">页码</param>
+        /// <param name="limit">每页条数</param>
+        /// <returns></returns>
+        public List<UserBackKind> List(List<FieldItem> fields, string condition, int page = 1, int limit = 30, string orderby = "Id desc")
+        {
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("UserBackKind", fields, orderby, "0", page, limit, condition);
+            List<UserBackKind> diclist = obj["data"] as List<UserBackKind>;
+            return diclist;
+        }
+
+        /// <summary>
+        /// 查询一条记录
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <returns></returns>
+        public UserBackKind Query(int Id)
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            UserBackKind editData = db.UserBackKind.FirstOrDefault(m => m.Id == Id) ?? new UserBackKind();
+            db.Dispose();
+            return editData;
+        }
+
+        /// <summary>
+        /// 添加数据
+        /// </summary>
+        /// <param name="Fields">要设置的字段</param>
+        /// <returns></returns>
+        public int Add(Dictionary<string, object> Fields)
+        {
+            return new DbService(AppConfig.Base.mainTables, _conn).Add("UserBackKind", Fields, 0);
+        }
+
+        /// <summary>
+        /// 修改数据
+        /// </summary>
+        /// <param name="Fields">要设置的字段</param>
+        /// <param name="Id">主键Id</param>
+        public void Edit(Dictionary<string, object> Fields, int Id)
+        {
+            new DbService(AppConfig.Base.mainTables, _conn).Edit("UserBackKind", Fields, Id);
+        }
+
+        /// <summary>
+        /// 删除数据
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        public void Delete(int Id)
+        {
+            new DbService(AppConfig.Base.mainTables, _conn).Delete("UserBackKind", Id);
+        }
+
+        /// <summary>
+        /// 排序
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <param name="Sort">排序序号</param>
+        public void Sort(int Id, int Sort)
+        {
+            new DbService(AppConfig.Base.mainTables, _conn).Sort("UserBackKind", Sort, Id);
+        }
+
+        /// <summary>
+        /// 导入数据
+        /// </summary>
+        /// <param name="ExcelData">json数据</param>
+        public void Import(string ExcelData)
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            JsonData list = JsonMapper.ToObject(ExcelData);
+            for (int i = 1; i < list.Count;i++ )
+            {
+                JsonData dr = list[i];
+                
+                db.UserBackKind.Add(new UserBackKind()
+                {
+                    CreateDate = DateTime.Now,
+                    UpdateDate = DateTime.Now,
+                    
+                });
+                db.SaveChanges();
+            }
+            db.Dispose();
+        }
+
+        /// <summary>
+        /// 导出excel表格
+        /// </summary>
+        /// <param name="fields">查询条件(单个字段)</param>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <returns></returns>
+        public Dictionary<string, object> ExportExcel(List<FieldItem> fields, string condition, string orderby = "Id desc")
+        {
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("UserBackKind", fields, orderby, "0", 1, 20000, condition, "Id", false);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            foreach (Dictionary<string, object> dic in diclist)
+            {
+            }
+
+            Dictionary<string, object> result = new Dictionary<string, object>();
+            result.Add("Status", "1");
+            result.Add("Info", "Excel报表-" + DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss") + ".xlsx");
+            result.Add("Obj", diclist);
+            Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
+
+            result.Add("Fields", ReturnFields);
+            return result;
+        }
+    }
+}

+ 132 - 0
Services/UserCardForWeChatService.cs

@@ -0,0 +1,132 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using MySystem.MainModels;
+using Library;
+using LitJson;
+
+namespace MySystem
+{
+    public class UserCardForWeChatService
+    {
+        string _conn = "";
+        public UserCardForWeChatService()
+        {
+            _conn = ConfigurationManager.AppSettings["SqlConnStr"].ToString();
+        }
+
+        /// <summary>
+        /// 查询列表
+        /// </summary>
+        /// <param name="fields">查询条件(单个字段)</param>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <param name="page">页码</param>
+        /// <param name="limit">每页条数</param>
+        /// <returns></returns>
+        public List<UserCardForWeChat> List(List<FieldItem> fields, string condition, int page = 1, int limit = 30, string orderby = "Id desc")
+        {
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("UserCardForWeChat", fields, orderby, "0", page, limit, condition);
+            List<UserCardForWeChat> diclist = obj["data"] as List<UserCardForWeChat>;
+            return diclist;
+        }
+
+        /// <summary>
+        /// 查询一条记录
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <returns></returns>
+        public UserCardForWeChat Query(int MerchantId)
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            UserCardForWeChat editData = db.UserCardForWeChat.FirstOrDefault(m => m.MerchantId == MerchantId) ?? new UserCardForWeChat();
+            db.Dispose();
+            return editData;
+        }
+
+        /// <summary>
+        /// 添加数据
+        /// </summary>
+        /// <param name="Fields">要设置的字段</param>
+        /// <returns></returns>
+        public int Add(Dictionary<string, object> Fields)
+        {
+            return new DbService(AppConfig.Base.mainTables, _conn).Add("UserCardForWeChat", Fields, 0);
+        }
+
+        /// <summary>
+        /// 修改数据
+        /// </summary>
+        /// <param name="Fields">要设置的字段</param>
+        /// <param name="Id">主键Id</param>
+        public void Edit(Dictionary<string, object> Fields, int Id)
+        {
+            new DbService(AppConfig.Base.mainTables, _conn).Edit("UserCardForWeChat", Fields, Id);
+        }
+
+        /// <summary>
+        /// 删除数据
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        public void Delete(int Id)
+        {
+            new DbService(AppConfig.Base.mainTables, _conn).Delete("UserCardForWeChat", Id);
+        }
+
+        /// <summary>
+        /// 排序
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <param name="Sort">排序序号</param>
+        public void Sort(int Id, int Sort)
+        {
+            new DbService(AppConfig.Base.mainTables, _conn).Sort("UserCardForWeChat", Sort, Id);
+        }
+
+        /// <summary>
+        /// 导入数据
+        /// </summary>
+        /// <param name="ExcelData">json数据</param>
+        public void Import(string ExcelData)
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            JsonData list = JsonMapper.ToObject(ExcelData);
+            for (int i = 1; i < list.Count;i++ )
+            {
+                JsonData dr = list[i];
+                
+                db.UserCardForWeChat.Add(new UserCardForWeChat()
+                {
+                    CreateDate = DateTime.Now,
+                    UpdateDate = DateTime.Now,
+                    
+                });
+                db.SaveChanges();
+            }
+            db.Dispose();
+        }
+
+        /// <summary>
+        /// 导出excel表格
+        /// </summary>
+        /// <param name="fields">查询条件(单个字段)</param>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <returns></returns>
+        public Dictionary<string, object> ExportExcel(List<FieldItem> fields, string condition, string orderby = "Id desc")
+        {
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("UserCardForWeChat", fields, orderby, "0", 1, 20000, condition, "Id", false);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            foreach (Dictionary<string, object> dic in diclist)
+            {
+            }
+
+            Dictionary<string, object> result = new Dictionary<string, object>();
+            result.Add("Status", "1");
+            result.Add("Info", "Excel报表-" + DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss") + ".xlsx");
+            result.Add("Obj", diclist);
+            Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
+
+            result.Add("Fields", ReturnFields);
+            return result;
+        }
+    }
+}

+ 132 - 0
Services/UserCenterIconListService.cs

@@ -0,0 +1,132 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using MySystem.MainModels;
+using Library;
+using LitJson;
+
+namespace MySystem
+{
+    public class UserCenterIconListService
+    {
+        string _conn = "";
+        public UserCenterIconListService()
+        {
+            _conn = ConfigurationManager.AppSettings["SqlConnStr"].ToString();
+        }
+
+        /// <summary>
+        /// 查询列表
+        /// </summary>
+        /// <param name="fields">查询条件(单个字段)</param>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <param name="page">页码</param>
+        /// <param name="limit">每页条数</param>
+        /// <returns></returns>
+        public List<UserCenterIconList> List(List<FieldItem> fields, string condition, int page = 1, int limit = 30, string orderby = "Id desc")
+        {
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("UserCenterIconList", fields, orderby, "0", page, limit, condition);
+            List<UserCenterIconList> diclist = obj["data"] as List<UserCenterIconList>;
+            return diclist;
+        }
+
+        /// <summary>
+        /// 查询一条记录
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <returns></returns>
+        public UserCenterIconList Query(int Id)
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            UserCenterIconList editData = db.UserCenterIconList.FirstOrDefault(m => m.Id == Id) ?? new UserCenterIconList();
+            db.Dispose();
+            return editData;
+        }
+
+        /// <summary>
+        /// 添加数据
+        /// </summary>
+        /// <param name="Fields">要设置的字段</param>
+        /// <returns></returns>
+        public int Add(Dictionary<string, object> Fields)
+        {
+            return new DbService(AppConfig.Base.mainTables, _conn).Add("UserCenterIconList", Fields, 0);
+        }
+
+        /// <summary>
+        /// 修改数据
+        /// </summary>
+        /// <param name="Fields">要设置的字段</param>
+        /// <param name="Id">主键Id</param>
+        public void Edit(Dictionary<string, object> Fields, int Id)
+        {
+            new DbService(AppConfig.Base.mainTables, _conn).Edit("UserCenterIconList", Fields, Id);
+        }
+
+        /// <summary>
+        /// 删除数据
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        public void Delete(int Id)
+        {
+            new DbService(AppConfig.Base.mainTables, _conn).Delete("UserCenterIconList", Id);
+        }
+
+        /// <summary>
+        /// 排序
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <param name="Sort">排序序号</param>
+        public void Sort(int Id, int Sort)
+        {
+            new DbService(AppConfig.Base.mainTables, _conn).Sort("UserCenterIconList", Sort, Id);
+        }
+
+        /// <summary>
+        /// 导入数据
+        /// </summary>
+        /// <param name="ExcelData">json数据</param>
+        public void Import(string ExcelData)
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            JsonData list = JsonMapper.ToObject(ExcelData);
+            for (int i = 1; i < list.Count;i++ )
+            {
+                JsonData dr = list[i];
+                
+                db.UserCenterIconList.Add(new UserCenterIconList()
+                {
+                    CreateDate = DateTime.Now,
+                    UpdateDate = DateTime.Now,
+                    
+                });
+                db.SaveChanges();
+            }
+            db.Dispose();
+        }
+
+        /// <summary>
+        /// 导出excel表格
+        /// </summary>
+        /// <param name="fields">查询条件(单个字段)</param>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <returns></returns>
+        public Dictionary<string, object> ExportExcel(List<FieldItem> fields, string condition, string orderby = "Id desc")
+        {
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("UserCenterIconList", fields, orderby, "0", 1, 20000, condition, "Id", false);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            foreach (Dictionary<string, object> dic in diclist)
+            {
+            }
+
+            Dictionary<string, object> result = new Dictionary<string, object>();
+            result.Add("Status", "1");
+            result.Add("Info", "Excel报表-" + DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss") + ".xlsx");
+            result.Add("Obj", diclist);
+            Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
+
+            result.Add("Fields", ReturnFields);
+            return result;
+        }
+    }
+}

+ 132 - 0
Services/UserLevelSetService.cs

@@ -0,0 +1,132 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using MySystem.MainModels;
+using Library;
+using LitJson;
+
+namespace MySystem
+{
+    public class UserLevelSetService
+    {
+        string _conn = "";
+        public UserLevelSetService()
+        {
+            _conn = ConfigurationManager.AppSettings["SqlConnStr"].ToString();
+        }
+
+        /// <summary>
+        /// 查询列表
+        /// </summary>
+        /// <param name="fields">查询条件(单个字段)</param>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <param name="page">页码</param>
+        /// <param name="limit">每页条数</param>
+        /// <returns></returns>
+        public List<UserLevelSet> List(List<FieldItem> fields, string condition, int page = 1, int limit = 30, string orderby = "Id desc")
+        {
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("UserLevelSet", fields, orderby, "0", page, limit, condition);
+            List<UserLevelSet> diclist = obj["data"] as List<UserLevelSet>;
+            return diclist;
+        }
+
+        /// <summary>
+        /// 查询一条记录
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <returns></returns>
+        public UserLevelSet Query(int Id)
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            UserLevelSet editData = db.UserLevelSet.FirstOrDefault(m => m.Id == Id) ?? new UserLevelSet();
+            db.Dispose();
+            return editData;
+        }
+
+        /// <summary>
+        /// 添加数据
+        /// </summary>
+        /// <param name="Fields">要设置的字段</param>
+        /// <returns></returns>
+        public int Add(Dictionary<string, object> Fields)
+        {
+            return new DbService(AppConfig.Base.mainTables, _conn).Add("UserLevelSet", Fields, 0);
+        }
+
+        /// <summary>
+        /// 修改数据
+        /// </summary>
+        /// <param name="Fields">要设置的字段</param>
+        /// <param name="Id">主键Id</param>
+        public void Edit(Dictionary<string, object> Fields, int Id)
+        {
+            new DbService(AppConfig.Base.mainTables, _conn).Edit("UserLevelSet", Fields, Id);
+        }
+
+        /// <summary>
+        /// 删除数据
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        public void Delete(int Id)
+        {
+            new DbService(AppConfig.Base.mainTables, _conn).Delete("UserLevelSet", Id);
+        }
+
+        /// <summary>
+        /// 排序
+        /// </summary>
+        /// <param name="Id">主键Id</param>
+        /// <param name="Sort">排序序号</param>
+        public void Sort(int Id, int Sort)
+        {
+            new DbService(AppConfig.Base.mainTables, _conn).Sort("UserLevelSet", Sort, Id);
+        }
+
+        /// <summary>
+        /// 导入数据
+        /// </summary>
+        /// <param name="ExcelData">json数据</param>
+        public void Import(string ExcelData)
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            JsonData list = JsonMapper.ToObject(ExcelData);
+            for (int i = 1; i < list.Count;i++ )
+            {
+                JsonData dr = list[i];
+                
+                db.UserLevelSet.Add(new UserLevelSet()
+                {
+                    CreateDate = DateTime.Now,
+                    UpdateDate = DateTime.Now,
+                    
+                });
+                db.SaveChanges();
+            }
+            db.Dispose();
+        }
+
+        /// <summary>
+        /// 导出excel表格
+        /// </summary>
+        /// <param name="fields">查询条件(单个字段)</param>
+        /// <param name="condition">查询条件(sql语句)</param>
+        /// <returns></returns>
+        public Dictionary<string, object> ExportExcel(List<FieldItem> fields, string condition, string orderby = "Id desc")
+        {
+            Dictionary<string, object> obj = new DbService(AppConfig.Base.mainTables, _conn).IndexData("UserLevelSet", fields, orderby, "0", 1, 20000, condition, "Id", false);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            foreach (Dictionary<string, object> dic in diclist)
+            {
+            }
+
+            Dictionary<string, object> result = new Dictionary<string, object>();
+            result.Add("Status", "1");
+            result.Add("Info", "Excel报表-" + DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss") + ".xlsx");
+            result.Add("Obj", diclist);
+            Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
+
+            result.Add("Fields", ReturnFields);
+            return result;
+        }
+    }
+}