Kaynağa Gözat

Merge branch 'feature-dgy-后台测试' into test-adminserver

# Conflicts:
#	Startup.cs
DuGuYang 2 yıl önce
ebeveyn
işleme
5d4b525712
36 değiştirilmiş dosya ile 769 ekleme ve 66 silme
  1. 85 0
      AppStart/Helper/SIMActCountService.cs
  2. 17 4
      AppStart/Helper/SIMPosMerchantTradeService.cs
  3. 2 1
      Areas/Admin/Controllers/MainServer/ActivityInfoController.cs
  4. 1 0
      Areas/Admin/Controllers/MainServer/CouponAssignRecordsController.cs
  5. 1 0
      Areas/Admin/Controllers/MainServer/CustomQueryController.cs
  6. 1 0
      Areas/Admin/Controllers/MainServer/CustomQueryDoController.cs
  7. 1 0
      Areas/Admin/Controllers/MainServer/CustomTagSetController.cs
  8. 1 0
      Areas/Admin/Controllers/MainServer/HelpProfitRewardController.cs
  9. 1 0
      Areas/Admin/Controllers/MainServer/IndexIconListController.cs
  10. 1 0
      Areas/Admin/Controllers/MainServer/KqProductsController.cs
  11. 1 0
      Areas/Admin/Controllers/MainServer/LeaderReserveRecordController.cs
  12. 1 0
      Areas/Admin/Controllers/MainServer/LeadersController.cs
  13. 4 1
      Areas/Admin/Controllers/MainServer/MerchantDepositReturnsController.cs
  14. 1 1
      Areas/Admin/Controllers/MainServer/PreAmountRecordController.cs
  15. 1 0
      Areas/Admin/Controllers/MainServer/PreSendStockDetailController.cs
  16. 1 0
      Areas/Admin/Controllers/MainServer/ProductsController.cs
  17. 3 1
      Areas/Admin/Controllers/MainServer/ProfitRewardRecordController.cs
  18. 1 0
      Areas/Admin/Controllers/MainServer/ServiceCenterController.cs
  19. 1 0
      Areas/Admin/Controllers/MainServer/StoreBalanceController.cs
  20. 2 2
      Areas/Admin/Controllers/MainServer/StoreHouseAmountRecordController.cs
  21. 96 2
      Areas/Admin/Controllers/MainServer/StoreHouseController.cs
  22. 281 22
      Areas/Admin/Controllers/MainServer/SysToolsController.cs
  23. 2 1
      Areas/Admin/Controllers/MainServer/ToChargeBackRecordController.cs
  24. 18 4
      Areas/Admin/Controllers/MainServer/TradeRecordController.cs
  25. 1 0
      Areas/Admin/Controllers/MainServer/UserAccountRecordController.cs
  26. 3 0
      Areas/Admin/Controllers/MainServer/UserCashRecordController.cs
  27. 1 0
      Areas/Admin/Controllers/MainServer/UserCashRecordForBusinessController.cs
  28. 1 0
      Areas/Admin/Controllers/MainServer/UserRankWhiteController.cs
  29. 7 1
      Areas/Admin/Controllers/MainServer/UsersController.cs
  30. 92 0
      Areas/Admin/Controllers/OperateServer/StoreHouseOperateController.cs
  31. 1 1
      Areas/Admin/Controllers/OperateServer/UserCashRecordOperateController.cs
  32. 1 1
      Areas/Admin/Controllers/OperateServer/UserCashRecordOperatesController.cs
  33. 79 24
      Controllers/HomeController.cs
  34. 18 0
      Models/UserSimActSummary.cs
  35. 40 0
      Models/WebCMSEntities.cs
  36. 1 0
      Startup.cs

+ 85 - 0
AppStart/Helper/SIMActCountService.cs

@@ -0,0 +1,85 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Threading;
+using MySystem.Models;
+using Library;
+using LitJson;
+
+namespace MySystem
+{
+    public class SIMActCountService
+    {
+        public readonly static SIMActCountService Instance = new SIMActCountService();
+        private SIMActCountService()
+        { }
+
+        public void Start()
+        {
+            Thread th = new Thread(doSomething);
+            th.IsBackground = true;
+            th.Start();
+        }
+
+        public void doSomething()
+        {
+            while (true)
+            {
+                string content = RedisDbconn.Instance.RPop<string>("SIMActCountQueue");
+                if (!string.IsNullOrEmpty(content))
+                {
+                    try
+                    {
+                        JsonData jsonObj = JsonMapper.ToObject(content);
+                        int UserId = int.Parse(jsonObj["UserId"].ToString());
+                        int ActCount = int.Parse(jsonObj["ActCount"].ToString());
+                        WebCMSEntities db = new WebCMSEntities();
+                        Users user = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
+                        string ParentNav = user.ParentNav;
+                        UserSimActSummary selfStat = db.UserSimActSummary.FirstOrDefault(m => m.UserId == UserId && m.Kind == 0);
+                        if (selfStat == null)
+                        {
+                            selfStat = db.UserSimActSummary.Add(new UserSimActSummary()
+                            {
+                                UserId = UserId
+                            }).Entity;
+                            db.SaveChanges();
+                        }
+                        selfStat.ActCount += ActCount;
+                        ParentNav += "," + UserId + ",";
+                        if (!string.IsNullOrEmpty(ParentNav))
+                        {
+                            string[] ParentNavList = ParentNav.Trim(',').Replace(",,", ",").Split(',');
+                            foreach (string NavUserIdString in ParentNavList)
+                            {
+                                int NavUserId = int.Parse(NavUserIdString);
+                                UserSimActSummary teamStat = db.UserSimActSummary.FirstOrDefault(m => m.UserId == NavUserId && m.Kind == 1);
+                                if (teamStat == null)
+                                {
+                                    teamStat = db.UserSimActSummary.Add(new UserSimActSummary()
+                                    {
+                                        UserId = NavUserId,
+                                        Kind = 1,
+                                    }).Entity;
+                                    db.SaveChanges();
+                                }
+                                teamStat.ActCount += ActCount;
+                            }
+                        }
+                        db.SaveChanges();
+                        db.Dispose();
+                    }
+                    catch (Exception ex)
+                    {
+                        function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "广电卡激活数变更异常");
+                    }
+                }
+                else
+                {
+                    Thread.Sleep(60000);
+                }
+            }
+        }
+    }
+}

+ 17 - 4
AppStart/Helper/SIMPosMerchantTradeService.cs

@@ -395,31 +395,44 @@ namespace MySystem
                 SimposMerchantInfo checkSimMer = db.SimposMerchantInfo.FirstOrDefault(m => m.KqMerNo == sIMTradeInfo.Mobile && m.KqSnNo == sIMTradeInfo.SimNo);
                 if (checkSimMer != null)
                 {
-                    checkSimMer.Status = -1;
                     if (sIMTradeInfo.UserStatus.Contains("欠费") && checkSimMer.Status != -1)
                     {
                         checkSimMer.Status = -2;
                     }
+                    else
+                    {
+                        checkSimMer.Status = -1;
+                    }
                     db.SaveChanges();
                 }
                 PosMerchantInfo checkMer = db.PosMerchantInfo.FirstOrDefault(m => m.KqMerNo == sIMTradeInfo.Mobile && m.KqSnNo == sIMTradeInfo.SimNo);
                 if (checkMer != null)
                 {
-                    checkMer.Status = -1;
                     if (sIMTradeInfo.UserStatus.Contains("欠费") && checkMer.Status != -1)
                     {
                         checkMer.Status = -2;
                     }
+                    else
+                    {
+                        checkMer.Status = -1;
+                    }
                     db.SaveChanges();
                 }
                 PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == sIMTradeInfo.SimNo);
                 if (pos != null)
-                {
-                    pos.Status = -1;
+                {                    
+                    if(pos.QueryCount == 1 && pos.Status == 0)
+                    {
+                        RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"" + pos.BuyUserId + "\",\"ActCount\":\"1\"}");
+                    }
                     if (sIMTradeInfo.UserStatus.Contains("欠费") && pos.Status != -1)
                     {
                         pos.Status = -2;
                     }
+                    else
+                    {
+                        pos.Status = -1;
+                    }
                     db.SaveChanges();
                 }
             }

+ 2 - 1
Areas/Admin/Controllers/MainServer/ActivityInfoController.cs

@@ -197,7 +197,7 @@ namespace MySystem.Areas.Admin.Controllers
         }
 
         #endregion
-        
+
         #region 详情
 
         public IActionResult Detail(string right, int Id = 0)
@@ -403,6 +403,7 @@ namespace MySystem.Areas.Admin.Controllers
                     RedisDbconn.Instance.Set("ActivityInfo:" + Id, edit);
                 }
             }
+            AddSysLog("Id:" + Id + "All:" + All, "ActivityInfo", "SetRedis");
         }
 
         #endregion

+ 1 - 0
Areas/Admin/Controllers/MainServer/CouponAssignRecordsController.cs

@@ -452,6 +452,7 @@ namespace MySystem.Areas.Admin.Controllers
                 }
             }
             db.SaveChanges();
+            AddSysLog("0", "CouponAssignRecords", "AssignCoupon");
         }
 
         #endregion

+ 1 - 0
Areas/Admin/Controllers/MainServer/CustomQueryController.cs

@@ -547,6 +547,7 @@ namespace MySystem.Areas.Admin.Controllers
                     new CustomRedisDbconn(ConnectStr).AddNumber(key, decimal.Parse(val));
                 }
             }
+            AddSysLog("0", "CustomQuery", "Confirm");
             return "success";
         }
 

+ 1 - 0
Areas/Admin/Controllers/MainServer/CustomQueryDoController.cs

@@ -448,6 +448,7 @@ namespace MySystem.Areas.Admin.Controllers
             }
             string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + sql + "\",\"ConnectStr\":\"" + item.DatabaseConnect + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"" + SubSqlString + "}";
             RedisDbconn.Instance.AddList("ExportQueue", SendData);
+            AddSysLog("0", "CustomQueryDo", "ExportExcel");
             return "success";
         }
 

+ 1 - 0
Areas/Admin/Controllers/MainServer/CustomTagSetController.cs

@@ -320,6 +320,7 @@ namespace MySystem.Areas.Admin.Controllers
             List<CustomTagSet> sets = db.CustomTagSet.ToList();
             RedisDbconn.Instance.Clear("CustomTagSet");
             RedisDbconn.Instance.AddList("CustomTagSet", sets.ToArray());
+            AddSysLog("0", "CustomTagSet", "SyncAll");
             return "success";
         }
 

+ 1 - 0
Areas/Admin/Controllers/MainServer/HelpProfitRewardController.cs

@@ -390,6 +390,7 @@ namespace MySystem.Areas.Admin.Controllers
                 RedisDbconn.Instance.AddList("SycnHelpProfitQueue2", date + "#cut#" + OpType + "#cut#" + SysUserName);
                 return "success";
             }
+            AddSysLog("0", "HelpProfitReward", "SycnData");
             return date + "分润已同步,请勿重复操作";
         }
 

+ 1 - 0
Areas/Admin/Controllers/MainServer/IndexIconListController.cs

@@ -327,6 +327,7 @@ namespace MySystem.Areas.Admin.Controllers
             List<IndexIconList> query = db.IndexIconList.Where(m => m.Status > -1).OrderByDescending(m => m.Sort).ThenByDescending(m => m.Id).ToList();
             RedisDbconn.Instance.Clear("IndexIconList");
             RedisDbconn.Instance.AddList("IndexIconList", query.ToArray());
+            AddSysLog("0", "IndexIconList", "SetRedis");
         }
 
         #endregion

+ 1 - 0
Areas/Admin/Controllers/MainServer/KqProductsController.cs

@@ -324,6 +324,7 @@ namespace MySystem.Areas.Admin.Controllers
             List<KqProducts> query = db.KqProducts.Where(m => m.Status > -1).OrderByDescending(m => m.Sort).ThenByDescending(m => m.Id).ToList();
             RedisDbconn.Instance.Clear("KqProductList");
             RedisDbconn.Instance.AddList("KqProductList", query.ToArray());
+            AddSysLog("0", "KqProducts", "SetRedis");
         }
 
         #endregion

+ 1 - 0
Areas/Admin/Controllers/MainServer/LeaderReserveRecordController.cs

@@ -245,6 +245,7 @@ namespace MySystem.Areas.Admin.Controllers
             var FileName = "盟主储蓄金变动记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
             string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + Sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"}";
             RedisDbconn.Instance.AddList("ExportQueue", SendData);
+            AddSysLog("0", "LeaderReserveRecord", "QuickExportExcelDo");
             return "success";
         }
         #endregion

+ 1 - 0
Areas/Admin/Controllers/MainServer/LeadersController.cs

@@ -778,6 +778,7 @@ namespace MySystem.Areas.Admin.Controllers
             var FileName = "盟主记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
             string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + Sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"}";
             RedisDbconn.Instance.AddList("ExportQueue", SendData);
+            AddSysLog("0", "Leader", "QuickExportExcelDo");
             return "success";
         }
         #endregion

+ 4 - 1
Areas/Admin/Controllers/MainServer/MerchantDepositReturnsController.cs

@@ -555,6 +555,7 @@ namespace MySystem.Areas.Admin.Controllers
                 return "Warning|" + error;
             }
             db.SaveChanges();
+            AddSysLog("0", "MerchantDepositReturns", "Import");
             return "success";
         }
         #endregion
@@ -608,6 +609,7 @@ namespace MySystem.Areas.Admin.Controllers
                 return "Warning|" + error;
             }
             db.SaveChanges();
+            AddSysLog("0", "MerchantDepositReturns", "Imports");
             return "success";
         }
         #endregion
@@ -636,8 +638,9 @@ namespace MySystem.Areas.Admin.Controllers
             }
             DataTable dt = OtherMySqlConn.dtable("UPDATE MerchantDepositReturns SET `Status`=3  WHERE Id IN(" + Ids.TrimEnd(',') + ")");
             string text = string.Format("商户押金退还,记录Id: '" + Ids.TrimEnd(',') + "',操作人: '" + SysUserName + "_" + SysRealName + "',Time'" + DateTime.Now + "'");
-            function.WriteLog(text, "商户押金退还");
+            // function.WriteLog(text, "商户押金退还");
             RedisDbconn.Instance.AddList("ToAlipayAccountQueue", Ids.TrimEnd(','));
+            AddSysLog(text, "MerchantDepositReturns", "Imports");
             return "success";
         }
 

+ 1 - 1
Areas/Admin/Controllers/MainServer/PreAmountRecordController.cs

@@ -387,7 +387,7 @@ namespace MySystem.Areas.Admin.Controllers
             var FileName = "小分仓临额提现提现记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
             string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + Sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"}";
             RedisDbconn.Instance.AddList("ExportQueue", SendData);
-            AddSysLog(Ids, "PreAmountRecord", "ExportExcel");
+            AddSysLog(Ids, "PreAmountRecord", "QuickExportExcelDo");
             return "success";
         }
         #endregion

+ 1 - 0
Areas/Admin/Controllers/MainServer/PreSendStockDetailController.cs

@@ -473,6 +473,7 @@ namespace MySystem.Areas.Admin.Controllers
             var FileName = "小分仓记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
             string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + Sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"}";
             RedisDbconn.Instance.AddList("ExportQueue", SendData);
+            AddSysLog("0", "PreSendStockDetail", "QuickExportExcelDo");
             return "success";
         }
         #endregion

+ 1 - 0
Areas/Admin/Controllers/MainServer/ProductsController.cs

@@ -461,6 +461,7 @@ namespace MySystem.Areas.Admin.Controllers
                     }
                 }
             }
+            AddSysLog("Id:" + Id + "All:" + All, "Products", "SetRedis");
         }
 
         #endregion

+ 3 - 1
Areas/Admin/Controllers/MainServer/ProfitRewardRecordController.cs

@@ -102,7 +102,7 @@ namespace MySystem.Areas.Admin.Controllers
                 var checks = db.ProfitRewardRecord.Any(m => m.CreateDate <= end && m.BrandId == Convert.ToInt32(BrandId));
                 if (check)
                 {
-                    var sId = db.ProfitRewardRecord.Where(m => m.CreateDate >= start  && m.BrandId == Convert.ToInt32(BrandId)).Min(m => m.Id);
+                    var sId = db.ProfitRewardRecord.Where(m => m.CreateDate >= start && m.BrandId == Convert.ToInt32(BrandId)).Min(m => m.Id);
                     condition += "  and Id >=" + sId;
                 }
                 if (checks)
@@ -551,6 +551,7 @@ namespace MySystem.Areas.Admin.Controllers
                 RedisDbconn.Instance.AddList("SycnProfitQueue2", BrandId + "#cut#" + date + "#cut#" + OpType + "#cut#" + SysUserName);
                 return "success";
             }
+            AddSysLog("BrandId:" + BrandId + "OpType:" + OpType, "ProfitRewardRecord", "SycnData");
             return date + "分润已同步,请勿重复操作";
         }
 
@@ -571,6 +572,7 @@ namespace MySystem.Areas.Admin.Controllers
                 DoSubsidyProfitByCondi(forMakerCode.UserId, BrandId, date, OpType);
                 return "success";
             }
+            AddSysLog("BrandId:" + BrandId + "MakerCode:" + MakerCode + "OpType:" + OpType, "ProfitRewardRecord", "SycnData");
             return date + "分润已同步,请勿重复操作";
         }
 

+ 1 - 0
Areas/Admin/Controllers/MainServer/ServiceCenterController.cs

@@ -368,6 +368,7 @@ namespace MySystem.Areas.Admin.Controllers
                     RedisDbconn.Instance.Set("ServiceCenter:" + Id, edit);
                 }
             }
+            AddSysLog("Id:" + Id + "CategoryId:" + CategoryId, "ServiceCenter", "SetRedis");
         }
 
         #endregion

+ 1 - 0
Areas/Admin/Controllers/MainServer/StoreBalanceController.cs

@@ -479,6 +479,7 @@ namespace MySystem.Areas.Admin.Controllers
             var FileName = "仓库库存变动记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
             string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + Sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"}";
             RedisDbconn.Instance.AddList("ExportQueue", SendData);
+            AddSysLog("0", "StoreBalance", "QuickExportExcelDo");
             return "success";
         }
         #endregion

+ 2 - 2
Areas/Admin/Controllers/MainServer/StoreHouseAmountRecordController.cs

@@ -634,7 +634,7 @@ namespace MySystem.Areas.Admin.Controllers
 
             result.Add("Fields", ReturnFields);
             OtherMySqlConn.op("UPDATE StoreHouseAmountRecord SET `Status`=2 WHERE Id IN(" + Ids + ") AND `Status`=0");
-            AddSysLog("0", "StoreHouseAmountRecord", "ExportExcel");
+            AddSysLog("0", "StoreHouseAmountRecord", "ExportsExcel");
             return Json(result);
         }
 
@@ -796,7 +796,7 @@ namespace MySystem.Areas.Admin.Controllers
                     db.SaveChanges();
                 }
             }
-            AddSysLog("0", "StoreHouseCardAmountRecord", "Import");
+            AddSysLog("0", "StoreHouseCardAmountRecord", "Imports");
             return "success";
         }
         #endregion

+ 96 - 2
Areas/Admin/Controllers/MainServer/StoreHouseController.cs

@@ -858,7 +858,7 @@ namespace MySystem.Areas.Admin.Controllers
                 }
             }
             RedisDbconn.Instance.Set("StoreForName:" + data.StoreName, Id);
-            AddSysLog(data.Id.ToString(), "StoreHouse", "add");
+            AddSysLog(data.Id.ToString(), "StoreHouse", "Edits");
             db.SaveChanges();
             opdb.SaveChanges();
             SetRedis(Id, user.UserId);
@@ -984,6 +984,7 @@ namespace MySystem.Areas.Admin.Controllers
         {
             string key = function.MD5_16(Guid.NewGuid().ToString());
             RedisDbconn.Instance.AddList("ExcelImport10", ExcelPath + "#cut#" + Kind + "#cut#" + key + "#cut#" + SysUserName);
+            AddSysLog(ExcelPath, "StoreHouse", "ImportPost");
             return "success|" + key;
         }
         public string CheckImport(string key)
@@ -1219,6 +1220,17 @@ namespace MySystem.Areas.Admin.Controllers
                                 opData.Add(posInfo.BuyUserId + ":" + posInfo.BrandId);
                             }
 
+                            var BeforeDeposit = 0;
+                            if (string.IsNullOrEmpty(pos.PrizeParams))
+                            {
+                                BeforeDeposit = 299;
+                                if (pos.BrandId == 6) BeforeDeposit = 249;
+                            }
+                            else
+                            {
+                                BeforeDeposit = int.Parse(pos.PrizeParams);
+                            }
+
                             posInfo.StoreId = toStore.Id;
                             posInfo.BuyUserId = 0;
                             posInfo.UserId = 0;
@@ -1249,6 +1261,41 @@ namespace MySystem.Areas.Admin.Controllers
                             fromStore.LaveNum -= 1;
                             posInfo.FirstFlag = 0;
                             posInfo.IsExecute = 0;
+
+                            //机具回仓重置服务费和费率(服务费默认为299,立刷为249 费率为0.6)
+                            Dictionary<string, object> req = new Dictionary<string, object>();
+                            var DepositId = "299";
+                            req.Add("PosSnId", pos.Id);
+                            req.Add("BrandId", pos.BrandId);
+                            if (pos.BrandId == 6) DepositId = "249";
+                            req.Add("Deposit", DepositId);
+                            //重置服务费
+                            RedisDbconn.Instance.AddList("ChangePosFeeQueue", Newtonsoft.Json.JsonConvert.SerializeObject(req));
+
+                            //添加设置押金添加记录
+                            PublicFunction.MerchantDepositSet(pos.BrandId, 0, pos.Id, pos.PosSn, BeforeDeposit, decimal.Parse(DepositId), "");
+
+                            var ChangeFee = 0.60M;
+                            var ChangeKind = 3;
+                            var OpMan = "系统";
+                            var posMachinesFeeChangeRecord = db.PosMachinesFeeChangeRecord.Add(new PosMachinesFeeChangeRecord()
+                            {
+                                CreateDate = DateTime.Now, //创建时间
+                                SeoDescription = "系统添加-过期机具回仓重置费率",
+                                Sort = pos.BrandId, //品牌Id
+                                PosId = pos.Id, //机具Id
+                                PosSn = pos.PosSn,
+                                ChangeFee = ChangeFee, //调整费率
+                            }).Entity;
+                            db.SaveChanges();
+
+                            // PosId:机具Id
+                            // Kind:1或2,1为费率0.63+3,2为费率0.63,3为费率0.6
+                            // OpMan:操作人,app传创客编号,后台传SysUserName
+                            //重置费率
+                            string infos = "{\"RecordId\":\"" + posMachinesFeeChangeRecord.Id + "\",\"PosId\":\"" + pos.Id + "\",\"Fee\": \"" + ChangeFee.ToString("f0").TrimEnd('0') + "\",\"Kind\": \"" + ChangeKind + "\",\"OpMan\": \"" + OpMan + "\"}";
+                            RedisDbconn.Instance.AddList("SetDepositQueue", infos);
+
                             PublicFunction.ClearPosHistory(db, posInfo.PosSn); //清除机具历史记录
                             db.SaveChanges();
                         }
@@ -1315,6 +1362,17 @@ namespace MySystem.Areas.Admin.Controllers
                                 opData.Add(posInfo.BuyUserId + ":" + posInfo.BrandId);
                             }
 
+                            var BeforeDeposit = 0;
+                            if (string.IsNullOrEmpty(pos.PrizeParams))
+                            {
+                                BeforeDeposit = 299;
+                                if (pos.BrandId == 6) BeforeDeposit = 249;
+                            }
+                            else
+                            {
+                                BeforeDeposit = int.Parse(pos.PrizeParams);
+                            }
+
                             posInfo.StoreId = toStore.Id;
                             posInfo.BuyUserId = 0;
                             posInfo.UserId = 0;
@@ -1343,6 +1401,41 @@ namespace MySystem.Areas.Admin.Controllers
                             toStore.TotalNum += 1;
                             posInfo.FirstFlag = 0;
                             posInfo.IsExecute = 0;
+
+                            //机具回仓重置服务费和费率(服务费默认为299,立刷为249 费率为0.6)
+                            Dictionary<string, object> req = new Dictionary<string, object>();
+                            var DepositId = "299";
+                            req.Add("PosSnId", pos.Id);
+                            req.Add("BrandId", pos.BrandId);
+                            if (pos.BrandId == 6) DepositId = "249";
+                            req.Add("Deposit", DepositId);
+                            //重置服务费
+                            RedisDbconn.Instance.AddList("ChangePosFeeQueue", Newtonsoft.Json.JsonConvert.SerializeObject(req));
+
+                            //添加设置押金添加记录
+                            PublicFunction.MerchantDepositSet(pos.BrandId, 0, pos.Id, pos.PosSn, BeforeDeposit, decimal.Parse(DepositId), "");
+
+                            var ChangeFee = 0.60M;
+                            var ChangeKind = 3;
+                            var OpMan = "系统";
+                            var posMachinesFeeChangeRecord = db.PosMachinesFeeChangeRecord.Add(new PosMachinesFeeChangeRecord()
+                            {
+                                CreateDate = DateTime.Now, //创建时间
+                                SeoDescription = "系统添加-过期机具回仓重置费率",
+                                Sort = pos.BrandId, //品牌Id
+                                PosId = pos.Id, //机具Id
+                                PosSn = pos.PosSn,
+                                ChangeFee = ChangeFee, //调整费率
+                            }).Entity;
+                            db.SaveChanges();
+
+                            // PosId:机具Id
+                            // Kind:1或2,1为费率0.63+3,2为费率0.63,3为费率0.6
+                            // OpMan:操作人,app传创客编号,后台传SysUserName
+                            //重置费率
+                            string infos = "{\"RecordId\":\"" + posMachinesFeeChangeRecord.Id + "\",\"PosId\":\"" + pos.Id + "\",\"Fee\": \"" + ChangeFee.ToString("f0").TrimEnd('0') + "\",\"Kind\": \"" + ChangeKind + "\",\"OpMan\": \"" + OpMan + "\"}";
+                            RedisDbconn.Instance.AddList("SetDepositQueue", infos);
+                            
                             PublicFunction.ClearPosHistory(db, posInfo.PosSn); //清除机具历史记录
                             db.SaveChanges();
                         }
@@ -1355,7 +1448,7 @@ namespace MySystem.Areas.Admin.Controllers
                     PublicFunction.SycnMachineCount(int.Parse(datalist[0]), int.Parse(datalist[1]));
                 }
             }
-            AddSysLog("0", "MachinesRejectStore", "Import");
+            AddSysLog("0", "MachinesRejectStore", "RejectStore");
             return "success";
         }
         #endregion
@@ -1832,6 +1925,7 @@ namespace MySystem.Areas.Admin.Controllers
             var FileName = "仓库统计管理记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
             string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + Sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"}";
             RedisDbconn.Instance.AddList("ExportQueue", SendData);
+            AddSysLog("0", "StoreHouse", "StatQuickExportExcelDo");
             return "success";
         }
         #endregion

+ 281 - 22
Areas/Admin/Controllers/MainServer/SysToolsController.cs

@@ -72,6 +72,7 @@ namespace MySystem.Areas.Admin.Controllers
                     }
                     db.SaveChanges();
                     function.WriteLog(DateTime.Now.ToString() + ":下级:" + MakerCode + ", 上级:" + ParentMakerCode, "换线日志");
+                    AddSysLog("MakerCode:" + MakerCode + "ParentMakerCode:" + ParentMakerCode, "SysTools", "RelationForUserDo");
                     return "success";
                 }
                 return "创客编号不存在";
@@ -108,6 +109,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string CheckMachineDo(string MakerCode, string PosSn, int AddActPrize = 0, int IsSend = 0)
         {
+            AddSysLog("MakerCode:" + MakerCode + "PosSn:" + PosSn + "AddActPrize:" + AddActPrize, "SysTools", "CheckMachineDo");
             if (string.IsNullOrEmpty(MakerCode))
             {
                 return "请输入创客编号";
@@ -345,6 +347,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string CheckMachine2Do(string MakerCode, string PosSn, string MerNo = "", int AddActPrize = 0)
         {
+            AddSysLog("MakerCode:" + MakerCode + "PosSn:" + PosSn + "AddActPrize:" + AddActPrize, "SysTools", "CheckMachine2Do");
             if (string.IsNullOrEmpty(MakerCode))
             {
                 return "请输入创客编号";
@@ -531,6 +534,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string CheckMachineForTeam1Do(string MakerCode, string PosSn, int AddActPrize = 0, int IsSend = 0)
         {
+            AddSysLog("MakerCode:" + MakerCode + "PosSn:" + PosSn + "AddActPrize:" + AddActPrize, "SysTools", "CheckMachineForTeam1Do");
             if (string.IsNullOrEmpty(MakerCode))
             {
                 return "请输入创客编号";
@@ -968,6 +972,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string SetMerAgentDo(string MakerCode, string PosSn, string MerNo, int IsSend = 0)
         {
+            AddSysLog("MakerCode:" + MakerCode + "PosSn:" + PosSn + "MerNo:" + MerNo, "SysTools", "SetMerAgentDo");
             if (string.IsNullOrEmpty(MakerCode))
             {
                 return "请输入创客编号";
@@ -1093,6 +1098,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string CancelMerAgentDo(string MakerCode, string PosSn, int IsSend = 0)
         {
+            AddSysLog("MakerCode:" + MakerCode + "PosSn:" + PosSn, "SysTools", "CancelMerAgentDo");
             if (string.IsNullOrEmpty(MakerCode))
             {
                 return "请输入创客编号";
@@ -1200,6 +1206,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string SeeSnDetailDo(string PosSn)
         {
+            AddSysLog("PosSn:" + PosSn, "SysTools", "SeeSnDetailDo");
             if (string.IsNullOrEmpty(PosSn))
             {
                 return "请输入机具SN";
@@ -1464,6 +1471,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string MakeCouponsDo(int Kind, int Number)
         {
+            AddSysLog("Kind:" + Kind + "Number:" + Number, "SysTools", "MakeCouponsDo");
             DateTime checkTime = DateTime.Parse("1900-01-01");
             string checkTimeString = RedisDbconn.Instance.Get<string>("MakerCouponsQueueCheckTime");
             if (!string.IsNullOrEmpty(checkTimeString))
@@ -1493,6 +1501,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public JsonResult ExportPosDo()
         {
+            AddSysLog("0", "SysTools", "ExportPosDo");
             WebCMSEntities db = new WebCMSEntities();
             List<PosMachinesTwo> poses = db.PosMachinesTwo.Where(m => m.CreditTrade < 1000 && m.BindingState == 1).ToList();
             int total = poses.Count;
@@ -1581,6 +1590,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string ChangePosDo(string OldSn, string NewSn, string BackStoreNo, string OutStoreNo, string MerNo = "", int IsSend = 0)
         {
+            AddSysLog("0", "SysTools", "ChangePosDo");
             if (string.IsNullOrEmpty(OldSn))
             {
                 return "请输入原机具SN";
@@ -1836,6 +1846,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string ChangeBadPosDo(string ChangeType, string MakerCode, string StoreCode, string OldSn, string NewSn, string FromStoreNo, string BackStoreNo, int IsSend = 0)
         {
+            AddSysLog("0", "SysTools", "ChangeBadPosDo");
             string[] OldSnList;
             string[] NewSnList;
             decimal amount = 0;
@@ -1994,6 +2005,17 @@ namespace MySystem.Areas.Admin.Controllers
                         opData.Add(oldpos.BuyUserId + ":" + oldpos.BrandId);
                     }
 
+                    var BeforeDeposit = 0;
+                    if (string.IsNullOrEmpty(oldpos.PrizeParams))
+                    {
+                        BeforeDeposit = 299;
+                        if (oldpos.BrandId == 6) BeforeDeposit = 249;
+                    }
+                    else
+                    {
+                        BeforeDeposit = int.Parse(oldpos.PrizeParams);
+                    }
+
                     oldpos.StoreId = storeBack.Id;
                     oldpos.QueryCount = 0;
                     oldpos.UpdateDate = null;
@@ -2037,6 +2059,41 @@ namespace MySystem.Areas.Admin.Controllers
                     oldpos.Status = -1;
                     oldpos.FirstFlag = 0;
                     oldpos.IsExecute = 0;
+
+                    //机具回仓重置服务费和费率(服务费默认为299,立刷为249 费率为0.6)
+                    Dictionary<string, object> req = new Dictionary<string, object>();
+                    var DepositId = "299";
+                    req.Add("PosSnId", oldpos.Id);
+                    req.Add("BrandId", oldpos.BrandId);
+                    if (oldpos.BrandId == 6) DepositId = "249";
+                    req.Add("Deposit", DepositId);
+                    //重置服务费
+                    RedisDbconn.Instance.AddList("ChangePosFeeQueue", Newtonsoft.Json.JsonConvert.SerializeObject(req));
+
+                    //添加设置押金添加记录
+                    PublicFunction.MerchantDepositSet(oldpos.BrandId, 0, oldpos.Id, oldpos.PosSn, BeforeDeposit, decimal.Parse(DepositId), "");
+
+                    var ChangeFee = 0.60M;
+                    var ChangeKind = 3;
+                    var OpMan = "系统";
+                    var posMachinesFeeChangeRecord = db.PosMachinesFeeChangeRecord.Add(new PosMachinesFeeChangeRecord()
+                    {
+                        CreateDate = DateTime.Now, //创建时间
+                        SeoDescription = "系统添加-过期机具回仓重置费率",
+                        Sort = oldpos.BrandId, //品牌Id
+                        PosId = oldpos.Id, //机具Id
+                        PosSn = oldpos.PosSn,
+                        ChangeFee = ChangeFee, //调整费率
+                    }).Entity;
+                    db.SaveChanges();
+
+                    // PosId:机具Id
+                    // Kind:1或2,1为费率0.63+3,2为费率0.63,3为费率0.6
+                    // OpMan:操作人,app传创客编号,后台传SysUserName
+                    //重置费率
+                    string infos = "{\"RecordId\":\"" + posMachinesFeeChangeRecord.Id + "\",\"PosId\":\"" + oldpos.Id + "\",\"Fee\": \"" + ChangeFee.ToString("f0").TrimEnd('0') + "\",\"Kind\": \"" + ChangeKind + "\",\"OpMan\": \"" + OpMan + "\"}";
+                    RedisDbconn.Instance.AddList("SetDepositQueue", infos);
+
                     PublicFunction.ClearPosHistory(db, oldpos.PosSn); //清除机具历史记录
                     db.SaveChanges();
                     opdb.SaveChanges();
@@ -2230,6 +2287,17 @@ namespace MySystem.Areas.Admin.Controllers
                         }
                     }
 
+                    var BeforeDeposit = 0;
+                    if (string.IsNullOrEmpty(oldpos.PrizeParams))
+                    {
+                        BeforeDeposit = 299;
+                        if (oldpos.BrandId == 6) BeforeDeposit = 249;
+                    }
+                    else
+                    {
+                        BeforeDeposit = int.Parse(oldpos.PrizeParams);
+                    }
+
                     oldpos.StoreId = storeBack.Id;
                     oldpos.QueryCount = 0;
                     oldpos.UpdateDate = null;
@@ -2273,6 +2341,41 @@ namespace MySystem.Areas.Admin.Controllers
                     oldpos.Status = -1;
                     oldpos.FirstFlag = 0;
                     oldpos.IsExecute = 0;
+
+                    //机具回仓重置服务费和费率(服务费默认为299,立刷为249 费率为0.6)
+                    Dictionary<string, object> req = new Dictionary<string, object>();
+                    var DepositId = "299";
+                    req.Add("PosSnId", oldpos.Id);
+                    req.Add("BrandId", oldpos.BrandId);
+                    if (oldpos.BrandId == 6) DepositId = "249";
+                    req.Add("Deposit", DepositId);
+                    //重置服务费
+                    RedisDbconn.Instance.AddList("ChangePosFeeQueue", Newtonsoft.Json.JsonConvert.SerializeObject(req));
+
+                    //添加设置押金添加记录
+                    PublicFunction.MerchantDepositSet(oldpos.BrandId, 0, oldpos.Id, oldpos.PosSn, BeforeDeposit, decimal.Parse(DepositId), "");
+
+                    var ChangeFee = 0.60M;
+                    var ChangeKind = 3;
+                    var OpMan = "系统";
+                    var posMachinesFeeChangeRecord = db.PosMachinesFeeChangeRecord.Add(new PosMachinesFeeChangeRecord()
+                    {
+                        CreateDate = DateTime.Now, //创建时间
+                        SeoDescription = "系统添加-过期机具回仓重置费率",
+                        Sort = oldpos.BrandId, //品牌Id
+                        PosId = oldpos.Id, //机具Id
+                        PosSn = oldpos.PosSn,
+                        ChangeFee = ChangeFee, //调整费率
+                    }).Entity;
+                    db.SaveChanges();
+
+                    // PosId:机具Id
+                    // Kind:1或2,1为费率0.63+3,2为费率0.63,3为费率0.6
+                    // OpMan:操作人,app传创客编号,后台传SysUserName
+                    //重置费率
+                    string infos = "{\"RecordId\":\"" + posMachinesFeeChangeRecord.Id + "\",\"PosId\":\"" + oldpos.Id + "\",\"Fee\": \"" + ChangeFee.ToString("f0").TrimEnd('0') + "\",\"Kind\": \"" + ChangeKind + "\",\"OpMan\": \"" + OpMan + "\"}";
+                    RedisDbconn.Instance.AddList("SetDepositQueue", infos);
+
                     PublicFunction.ClearPosHistory(db, oldpos.PosSn); //清除机具历史记录
                     db.SaveChanges();
                     opdb.SaveChanges();
@@ -2341,6 +2444,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string ChangePosCrossBrandDo(string MakerCode, string OldSn, string BackStoreNo, string NewSn, string FromStoreNo, int IsSend = 0)
         {
+            AddSysLog("0", "SysTools", "ChangePosCrossBrandDo");
             string[] OldSnList;
             string[] NewSnList;
             decimal amount = 0;
@@ -2558,6 +2662,17 @@ namespace MySystem.Areas.Admin.Controllers
                     opData.Add(oldpos.BuyUserId + ":" + oldpos.BrandId);
                 }
 
+                var BeforeDeposit = 0;
+                if (string.IsNullOrEmpty(oldpos.PrizeParams))
+                {
+                    BeforeDeposit = 299;
+                    if (oldpos.BrandId == 6) BeforeDeposit = 249;
+                }
+                else
+                {
+                    BeforeDeposit = int.Parse(oldpos.PrizeParams);
+                }
+
                 oldpos.StoreId = storeBack.Id;
                 oldpos.QueryCount = 0;
                 oldpos.UpdateDate = null;
@@ -2601,6 +2716,40 @@ namespace MySystem.Areas.Admin.Controllers
                 oldpos.FirstFlag = 0;
                 oldpos.IsExecute = 0;
 
+                //机具回仓重置服务费和费率(服务费默认为299,立刷为249 费率为0.6)
+                Dictionary<string, object> req = new Dictionary<string, object>();
+                var DepositId = "299";
+                req.Add("PosSnId", oldpos.Id);
+                req.Add("BrandId", oldpos.BrandId);
+                if (oldpos.BrandId == 6) DepositId = "249";
+                req.Add("Deposit", DepositId);
+                //重置服务费
+                RedisDbconn.Instance.AddList("ChangePosFeeQueue", Newtonsoft.Json.JsonConvert.SerializeObject(req));
+
+                //添加设置押金添加记录
+                PublicFunction.MerchantDepositSet(oldpos.BrandId, 0, oldpos.Id, oldpos.PosSn, BeforeDeposit, decimal.Parse(DepositId), "");
+
+                var ChangeFee = 0.60M;
+                var ChangeKind = 3;
+                var OpMan = "系统";
+                var posMachinesFeeChangeRecord = db.PosMachinesFeeChangeRecord.Add(new PosMachinesFeeChangeRecord()
+                {
+                    CreateDate = DateTime.Now, //创建时间
+                    SeoDescription = "系统添加-过期机具回仓重置费率",
+                    Sort = oldpos.BrandId, //品牌Id
+                    PosId = oldpos.Id, //机具Id
+                    PosSn = oldpos.PosSn,
+                    ChangeFee = ChangeFee, //调整费率
+                }).Entity;
+                db.SaveChanges();
+
+                // PosId:机具Id
+                // Kind:1或2,1为费率0.63+3,2为费率0.63,3为费率0.6
+                // OpMan:操作人,app传创客编号,后台传SysUserName
+                //重置费率
+                string infos = "{\"RecordId\":\"" + posMachinesFeeChangeRecord.Id + "\",\"PosId\":\"" + oldpos.Id + "\",\"Fee\": \"" + ChangeFee.ToString("f0").TrimEnd('0') + "\",\"Kind\": \"" + ChangeKind + "\",\"OpMan\": \"" + OpMan + "\"}";
+                RedisDbconn.Instance.AddList("SetDepositQueue", infos);
+
                 PublicFunction.ClearPosHistory(db, oldpos.PosSn); //清除机具历史记录
                 db.SaveChanges();
                 opdb.SaveChanges();
@@ -2644,6 +2793,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string UnbindDo(string PosSn, string MakerCode, string MerNo, int IsSend = 0)
         {
+            AddSysLog("PosSn:" + PosSn + "MakerCode:" + MakerCode + "MerNo:" + MerNo, "SysTools", "UnbindDo");
             if (string.IsNullOrEmpty(PosSn))
             {
                 return "请输入机具SN";
@@ -2798,6 +2948,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string ChangeSignQuanDo(string Coupons, string MakerCode)
         {
+            AddSysLog("0", "SysTools", "ChangeSignQuanDo");
             if (string.IsNullOrEmpty(Coupons))
             {
                 return "请输入机具券码,多个券码用回车分隔";
@@ -2843,6 +2994,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string ChangeSignSnDo(string PosSn, string MakerCode)
         {
+            AddSysLog("0", "SysTools", "ChangeSignSnDo");
             if (string.IsNullOrEmpty(PosSn))
             {
                 return "请输入机具SN,多个SN用回车分隔";
@@ -2902,6 +3054,7 @@ namespace MySystem.Areas.Admin.Controllers
 
         public IActionResult LoopData(string SwapSnExpand, string SnNos, int page = 1, int limit = 30)
         {
+            AddSysLog("0", "SysTools", "LoopData");
             Dictionary<string, string> Fields = new Dictionary<string, string>();
             Fields.Add("SwapSnExpand", "1"); //申请机具SN
             Fields.Add("SnNos", "1"); //发货机具SN
@@ -3036,6 +3189,7 @@ namespace MySystem.Areas.Admin.Controllers
 
         public string SourceLoopData(string SnNo, int page = 1, int limit = 30)
         {
+            AddSysLog("0", "SysTools", "SourceLoopData");
             var result = "";
             var machineForSnNo = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == SnNo) ?? new MachineForSnNo();
             var pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == machineForSnNo.SnId) ?? new PosMachinesTwo();
@@ -3071,6 +3225,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public Dictionary<string, string> Prize100Do(string MakerCode)
         {
+            AddSysLog("MakerCode:" + MakerCode, "SysTools", "Prize100Do");
             Dictionary<string, string> dic = new Dictionary<string, string>();
             string result = "";
             UserForMakerCode forMakerCode = db.UserForMakerCode.FirstOrDefault(m => m.MakerCode == MakerCode);
@@ -3148,6 +3303,7 @@ namespace MySystem.Areas.Admin.Controllers
         }
         public string AddPrize100(int Id)
         {
+            AddSysLog(Id, "SysTools", "AddPrize100");
             Orders order = db.Orders.FirstOrDefault(m => m.Id == Id);
             if (order != null)
             {
@@ -3192,6 +3348,7 @@ namespace MySystem.Areas.Admin.Controllers
         }
         public void DirectPrize(WebCMSEntities db, int OrderId, int UserId, int Count = 1)
         {
+            AddSysLog("OrderId:" + OrderId + "UserId:" + UserId, "SysTools", "DirectPrize");
             UserAccount account = db.UserAccount.FirstOrDefault(m => m.Id == UserId);
             if (account == null)
             {
@@ -3243,6 +3400,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public Dictionary<string, string> OpenPrizeDo(string PosSn)
         {
+            AddSysLog("PosSn:" + PosSn, "SysTools", "OpenPrizeDo");
             Dictionary<string, string> dic = new Dictionary<string, string>();
             string result = "";
             PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == PosSn);
@@ -3302,6 +3460,7 @@ namespace MySystem.Areas.Admin.Controllers
         }
         public string AddOpenPrize(int Id)
         {
+            AddSysLog(Id, "SysTools", "AddOpenPrize");
             PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == Id && m.ActivationState == 1);
             if (pos == null)
             {
@@ -3330,15 +3489,6 @@ namespace MySystem.Areas.Admin.Controllers
             Users user = db.Users.FirstOrDefault(m => m.Id == pos.BuyUserId);
             if (user != null)
             {
-                if (pos.IsFirst == 1 && pos.BindingTime > DateTime.Now.AddDays(-30) && pos.CardType < 100)
-                {
-                    RedisDbconn.Instance.AddList("OpenRewardQueue", pos.Id.ToString());
-                }
-                else
-                {
-                    return "操作失败" + pos.PosSn + ',' + "不满足发放条件首台绑定30天内非营训机" + '\n';
-                }
-
                 if (pos.IsFirst == 1 && pos.ActivationState == 1 && pos.BindingTime.Value.AddDays(30) <= DateTime.Now && pos.BindingTime.Value.AddDays(60) > DateTime.Now && pos.CreditTrade >= 10000 && pos.CardType < 100)
                 {
                     RedisDbconn.Instance.AddList("LeaderRewardQueue", pos.Id.ToString());
@@ -3347,8 +3497,6 @@ namespace MySystem.Areas.Admin.Controllers
                 {
                     return "操作失败" + pos.PosSn + ',' + "不满足发放条件首台绑定30天到60天交易超过10000元内非营训机" + '\n';
                 }
-                // RedisDbconn.Instance.AddList("OpenRewardQueue", Id.ToString());
-                // RedisDbconn.Instance.AddList("LeaderRewardQueue", Id.ToString());
                 return "操作成功,请稍后查询";
             }
             db.Dispose();
@@ -3370,6 +3518,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public Dictionary<string, string> FluxPrizeDo(string PosSn)
         {
+            AddSysLog("PosSn:" + PosSn, "SysTools", "FluxPrizeDo");
             Dictionary<string, string> dic = new Dictionary<string, string>();
             string result = "";
             PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == PosSn);
@@ -3424,6 +3573,7 @@ namespace MySystem.Areas.Admin.Controllers
         }
         public string AddFluxPrize(int Id)
         {
+            AddSysLog(Id, "SysTools", "AddFluxPrize");
             PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == Id && m.ActivationState == 1);
             if (pos == null)
             {
@@ -3615,6 +3765,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string LisFeeDo(string PosSns, decimal Fee, string Kind, string Fix)
         {
+            AddSysLog("PosSns:" + PosSns, "SysTools", "LisFeeDo");
             if (string.IsNullOrEmpty(PosSns))
             {
                 return "请输入机具号";
@@ -3667,6 +3818,7 @@ namespace MySystem.Areas.Admin.Controllers
         // 设置费率
         public string SetLiSFee(string sn, decimal serviceFee)
         {
+            AddSysLog("PosSn:" + sn + "serviceFee:" + serviceFee, "SysTools", "SetLiSFee");
             Dictionary<string, object> dic = new Dictionary<string, object>();
             dic.Add("agentId", LiSAgentId);
             dic.Add("deviceSn", sn);
@@ -3689,6 +3841,7 @@ namespace MySystem.Areas.Admin.Controllers
         // 设置押金
         public string SetLiSDeposit(string sn, int serviceFee)
         {
+            AddSysLog("PosSn:" + sn + "serviceFee:" + serviceFee, "SysTools", "SetLiSDeposit");
             serviceFee = serviceFee * 100;
             Dictionary<string, object> dic = new Dictionary<string, object>();
             dic.Add("agentId", LiSAgentId);
@@ -3790,6 +3943,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string CheckThreeElementsDo(string bankcard, string idcard, string name)
         {
+            AddSysLog("bankcard:" + bankcard + "idcard:" + idcard + "name:" + name, "SysTools", "CheckThreeElementsDo");
             var host = "https://bankcard3c.shumaidata.com";
             var path = "/bankcard3c";
             var method = "GET";
@@ -3873,6 +4027,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string CheckFourElementsDo(string bankcard, string idcard, string mobile, string name)
         {
+            AddSysLog("bankcard:" + bankcard + "idcard:" + idcard + "name:" + name + "mobile:" + mobile, "SysTools", "CheckFourElementsDo");
             var host = "https://bankcard4c.shumaidata.com";
             var path = "/bankcard4c";
             var method = "GET";
@@ -3968,6 +4123,7 @@ namespace MySystem.Areas.Admin.Controllers
         public string SyncMerchantStatusDo(string PosSn)
         {
 
+            AddSysLog("PosSn:" + PosSn, "SysTools", "SyncMerchantStatusDo");
             if (string.IsNullOrEmpty(PosSn))
             {
                 return "请输入机具号";
@@ -4012,6 +4168,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string PosRewardReissuedDo(string PosSn)
         {
+            AddSysLog("PosSn:" + PosSn, "SysTools", "PosRewardReissuedDo");
             if (string.IsNullOrEmpty(PosSn))
             {
                 return "请输入机具SN";
@@ -4032,15 +4189,6 @@ namespace MySystem.Areas.Admin.Controllers
                 {
                     if (posInfo.Id > 0)
                     {
-                        if (posInfo.IsFirst == 1 && posInfo.BindingTime > DateTime.Now.AddDays(-30) && posInfo.CardType < 100)
-                        {
-                            RedisDbconn.Instance.AddList("OpenRewardQueue", posInfo.Id.ToString());
-                        }
-                        else
-                        {
-                            return "操作失败" + posInfo.PosSn + ',' + "不满足发放条件首台绑定30天内非营训机" + '\n';
-                        }
-
                         if (posInfo.IsFirst == 1 && posInfo.ActivationState == 1 && posInfo.BindingTime.Value.AddDays(30) <= DateTime.Now && posInfo.BindingTime.Value.AddDays(60) > DateTime.Now && posInfo.CreditTrade >= 10000 && posInfo.CardType < 100)
                         {
                             RedisDbconn.Instance.AddList("LeaderRewardQueue", posInfo.Id.ToString());
@@ -4049,8 +4197,6 @@ namespace MySystem.Areas.Admin.Controllers
                         {
                             return "操作失败" + posInfo.PosSn + ',' + "不满足发放条件首台绑定30天到60天交易超过10000元内非营训机" + '\n';
                         }
-                        // RedisDbconn.Instance.AddList("OpenRewardQueue", posInfo.Id.ToString());
-                        // RedisDbconn.Instance.AddList("LeaderRewardQueue", posInfo.Id.ToString());
                     }
 
                 }
@@ -4080,6 +4226,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string SetPosFeeDo(string PosSn, int FeeType, int RecordFlag = 0)
         {
+            AddSysLog("PosSn:" + PosSn + "FeeType:" + FeeType + "RecordFlag:" + RecordFlag, "SysTools", "SetPosFeeDo");
             if (string.IsNullOrEmpty(PosSn))
             {
                 return "请输入机具SN";
@@ -4153,6 +4300,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string RelationPosAndMerchantDo(string PosSn, string MerchantNo, string MerchantName)
         {
+            AddSysLog("PosSn:" + PosSn + "MerchantNo:" + MerchantNo + "MerchantName:" + MerchantName, "SysTools", "RelationPosAndMerchantDo");
             if (string.IsNullOrEmpty(PosSn))
             {
                 return "请输入机具SN";
@@ -4202,6 +4350,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string SetMerchantInfoDo(string PosSn, string MerchantNo, string MerchantName, string MerIdcardNo, string MerchantMobile)
         {
+            AddSysLog("PosSn:" + PosSn + "MerchantNo:" + MerchantNo + "MerchantName:" + MerchantName + "MerIdcardNo:" + MerIdcardNo + "MerchantMobile:" + MerchantMobile, "SysTools", "SetMerchantInfoDo");
             if (string.IsNullOrEmpty(PosSn))
             {
                 return "请输入机具SN";
@@ -4258,6 +4407,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string AuthMakerDo(string MakerCode, string RealName, string CertId, string BackCard, string BackName)
         {
+            AddSysLog("MakerCode:" + MakerCode + "RealName:" + RealName + "CertId:" + CertId + "BackName:" + BackName, "SysTools", "AuthMakerDo");
             if (string.IsNullOrEmpty(MakerCode))
             {
                 return "请输入创客编号";
@@ -4384,6 +4534,7 @@ namespace MySystem.Areas.Admin.Controllers
 
         public string TransferPosDo(string PosSn, string FromMakerCode, string ToMakerCode)
         {
+            AddSysLog("PosSn:" + PosSn + "FromMakerCode:" + FromMakerCode + "ToMakerCode:" + ToMakerCode, "SysTools", "TransferPosDo");
             if (string.IsNullOrEmpty(PosSn))
             {
                 return "请输入机具SN";
@@ -4516,6 +4667,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string RestoreStatusDo(string OrderNo)
         {
+            AddSysLog("OrderNo:" + OrderNo, "SysTools", "RestoreStatusDo");
             if (string.IsNullOrEmpty(OrderNo))
             {
                 return "请输入提现订单编号";
@@ -4557,6 +4709,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string SeeUserLoopDo(string MakerCode)
         {
+            AddSysLog("MakerCode:" + MakerCode, "SysTools", "SeeUserLoopDo");
             var userForMakerCode = db.UserForMakerCode.FirstOrDefault(m => m.MakerCode == MakerCode) ?? new UserForMakerCode();
             var user = db.Users.FirstOrDefault(m => m.Id == userForMakerCode.UserId) ?? new Users();
             var pos = db.PosMachinesTwo.Where(m => m.Status > -1 && m.BuyUserId == user.Id).ToList();
@@ -4594,6 +4747,7 @@ namespace MySystem.Areas.Admin.Controllers
 
         public string CashWithoutUserDo(string Content)
         {
+            AddSysLog("Content:" + Content, "SysTools", "CashWithoutUserDo");
             CustomTagSet set = db.CustomTagSet.FirstOrDefault(m => m.Tags == "CashWithoutUser");
             if (set == null)
             {
@@ -4625,6 +4779,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string BadPosToStoreDo(string OldSn)
         {
+            AddSysLog("OldSn:" + OldSn, "SysTools", "BadPosToStoreDo");
             string[] OldSnList;
             OldSnList = OldSn.Replace("\r", "").Split('\n');
             string error = "";
@@ -4638,6 +4793,18 @@ namespace MySystem.Areas.Admin.Controllers
                 {
                     opData.Add(oldpos.BuyUserId + ":" + oldpos.BrandId);
                 }
+
+                var BeforeDeposit = 0;
+                if (string.IsNullOrEmpty(oldpos.PrizeParams))
+                {
+                    BeforeDeposit = 299;
+                    if (oldpos.BrandId == 6) BeforeDeposit = 249;
+                }
+                else
+                {
+                    BeforeDeposit = int.Parse(oldpos.PrizeParams);
+                }
+
                 oldpos.Status = 1;
                 oldpos.PosSnType = 0;
                 oldpos.QueryCount = 0;
@@ -4681,6 +4848,41 @@ namespace MySystem.Areas.Admin.Controllers
                 oldpos.UserId = 0;
                 oldpos.FirstFlag = 0;
                 oldpos.IsExecute = 0;
+
+                //机具回仓重置服务费和费率(服务费默认为299,立刷为249 费率为0.6)
+                Dictionary<string, object> req = new Dictionary<string, object>();
+                var DepositId = "299";
+                req.Add("PosSnId", oldpos.Id);
+                req.Add("BrandId", oldpos.BrandId);
+                if (oldpos.BrandId == 6) DepositId = "249";
+                req.Add("Deposit", DepositId);
+                //重置服务费
+                RedisDbconn.Instance.AddList("ChangePosFeeQueue", Newtonsoft.Json.JsonConvert.SerializeObject(req));
+
+                //添加设置押金添加记录
+                PublicFunction.MerchantDepositSet(oldpos.BrandId, 0, oldpos.Id, oldpos.PosSn, BeforeDeposit, decimal.Parse(DepositId), "");
+
+                var ChangeFee = 0.60M;
+                var ChangeKind = 3;
+                var OpMan = "系统";
+                var posMachinesFeeChangeRecord = db.PosMachinesFeeChangeRecord.Add(new PosMachinesFeeChangeRecord()
+                {
+                    CreateDate = DateTime.Now, //创建时间
+                    SeoDescription = "系统添加-过期机具回仓重置费率",
+                    Sort = oldpos.BrandId, //品牌Id
+                    PosId = oldpos.Id, //机具Id
+                    PosSn = oldpos.PosSn,
+                    ChangeFee = ChangeFee, //调整费率
+                }).Entity;
+                db.SaveChanges();
+
+                // PosId:机具Id
+                // Kind:1或2,1为费率0.63+3,2为费率0.63,3为费率0.6
+                // OpMan:操作人,app传创客编号,后台传SysUserName
+                //重置费率
+                string infos = "{\"RecordId\":\"" + posMachinesFeeChangeRecord.Id + "\",\"PosId\":\"" + oldpos.Id + "\",\"Fee\": \"" + ChangeFee.ToString("f0").TrimEnd('0') + "\",\"Kind\": \"" + ChangeKind + "\",\"OpMan\": \"" + OpMan + "\"}";
+                RedisDbconn.Instance.AddList("SetDepositQueue", infos);
+
                 PublicFunction.ClearPosHistory(db, oldpos.PosSn); //清除机具历史记录
             }
             if (!string.IsNullOrEmpty(error))
@@ -4709,6 +4911,7 @@ namespace MySystem.Areas.Admin.Controllers
 
         public string TransferPosCouponDo(string Kind, string PosCouponCodes, string FromMakerCode, string ToMakerCode, string LeaderMakerCode = "")
         {
+            AddSysLog("Kind:" + Kind + "PosCouponCodes:" + PosCouponCodes + "FromMakerCode:" + FromMakerCode + "ToMakerCode:" + ToMakerCode + "LeaderMakerCode:" + LeaderMakerCode, "SysTools", "TransferPosCouponDo");
             if (string.IsNullOrEmpty(Kind))
             {
                 return "请选择划拨的券类型";
@@ -4842,6 +5045,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string RefundPosFeeDo(string PosSn, string BackStoreNo, int IsBack = 0)
         {
+            AddSysLog("PosSn:" + PosSn + "BackStoreNo:" + BackStoreNo + "IsBack:" + IsBack, "SysTools", "RefundPosFeeDo");
             if (string.IsNullOrEmpty(PosSn))
             {
                 return "请输入机具SN";
@@ -5007,6 +5211,17 @@ namespace MySystem.Areas.Admin.Controllers
                         opData.Add(pos.BuyUserId + ":" + pos.BrandId);
                     }
 
+                    var BeforeDeposit = 0;
+                    if (string.IsNullOrEmpty(pos.PrizeParams))
+                    {
+                        BeforeDeposit = 299;
+                        if (pos.BrandId == 6) BeforeDeposit = 249;
+                    }
+                    else
+                    {
+                        BeforeDeposit = int.Parse(pos.PrizeParams);
+                    }
+
                     pos.StoreId = BackStore.Id;//变更机具所属仓库,重置为仓库机
                     pos.Status = 1;
                     pos.QueryCount = 0;
@@ -5050,6 +5265,41 @@ namespace MySystem.Areas.Admin.Controllers
                     pos.UserId = 0;
                     pos.FirstFlag = 0;
                     pos.IsExecute = 0;
+
+                    //机具回仓重置服务费和费率(服务费默认为299,立刷为249 费率为0.6)
+                    Dictionary<string, object> req = new Dictionary<string, object>();
+                    var DepositId = "299";
+                    req.Add("PosSnId", pos.Id);
+                    req.Add("BrandId", pos.BrandId);
+                    if (pos.BrandId == 6) DepositId = "249";
+                    req.Add("Deposit", DepositId);
+                    //重置服务费
+                    RedisDbconn.Instance.AddList("ChangePosFeeQueue", Newtonsoft.Json.JsonConvert.SerializeObject(req));
+
+                    //添加设置押金添加记录
+                    PublicFunction.MerchantDepositSet(pos.BrandId, 0, pos.Id, pos.PosSn, BeforeDeposit, decimal.Parse(DepositId), "");
+
+                    var ChangeFee = 0.60M;
+                    var ChangeKind = 3;
+                    var OpMan = "系统";
+                    var posMachinesFeeChangeRecord = db.PosMachinesFeeChangeRecord.Add(new PosMachinesFeeChangeRecord()
+                    {
+                        CreateDate = DateTime.Now, //创建时间
+                        SeoDescription = "系统添加-过期机具回仓重置费率",
+                        Sort = pos.BrandId, //品牌Id
+                        PosId = pos.Id, //机具Id
+                        PosSn = pos.PosSn,
+                        ChangeFee = ChangeFee, //调整费率
+                    }).Entity;
+                    db.SaveChanges();
+
+                    // PosId:机具Id
+                    // Kind:1或2,1为费率0.63+3,2为费率0.63,3为费率0.6
+                    // OpMan:操作人,app传创客编号,后台传SysUserName
+                    //重置费率
+                    string infos = "{\"RecordId\":\"" + posMachinesFeeChangeRecord.Id + "\",\"PosId\":\"" + pos.Id + "\",\"Fee\": \"" + ChangeFee.ToString("f0").TrimEnd('0') + "\",\"Kind\": \"" + ChangeKind + "\",\"OpMan\": \"" + OpMan + "\"}";
+                    RedisDbconn.Instance.AddList("SetDepositQueue", infos);
+
                     PublicFunction.ClearPosHistory(db, pos.PosSn); //清除机具历史记录
                 }
                 else
@@ -5113,6 +5363,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string AddMerchantnfoDo(string PosSn, string MerSn)
         {
+            AddSysLog("PosSn+:" + PosSn + "MerSn:" + MerSn, "SysTools", "AddMerchantnfoDo");
             if (string.IsNullOrEmpty(PosSn))
             {
                 return "请输入机具号";
@@ -5190,6 +5441,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string SeeMerchantTradeDetailDo(string PosSn)
         {
+            AddSysLog("PosSn:" + PosSn, "SysTools", "SeeMerchantTradeDetailDo");
             if (string.IsNullOrEmpty(PosSn))
             {
                 return "请输入机具SN";
@@ -5447,6 +5699,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string RestoreUserInfoDo(string MakerCode)
         {
+            AddSysLog("MakerCode:" + MakerCode, "SysTools", "RestoreUserInfoDo");
             var user = db.Users.FirstOrDefault(m => m.Status == -1 && m.MakerCode == MakerCode) ?? new Users();
             if (user.Id == 0)
             {
@@ -5496,6 +5749,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string QrCodeEncryptionDo(string SnNos)
         {
+            AddSysLog("0", "SysTools", "QrCodeEncryptionDo");
             string[] SnNo = SnNos.Replace("\r", "").Replace("\n", ",").Split(',');
             string code = "";
             string sn = "";
@@ -5522,6 +5776,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string QrCodeDescryptionDo(string SnNos)
         {
+            AddSysLog("0", "SysTools", "QrCodeDescryptionDo");
             string[] SnNo = SnNos.Replace("\r", "").Replace("\n", ",").Split(',');
             string code = "";
             string sn = "";
@@ -5556,6 +5811,7 @@ namespace MySystem.Areas.Admin.Controllers
         }
         public string SeeUserLevel4InfoDo(string MakerCode, string MakerCodes)
         {
+            AddSysLog("0", "SysTools", "SeeUserLevel4InfoDo");
             var user = db.Users.FirstOrDefault(m => m.MakerCode == MakerCode) ?? new Users();
             string[] SnNo = MakerCodes.Replace("\r", "").Replace("\n", ",").Split(',');
             string code = "";
@@ -5588,6 +5844,7 @@ namespace MySystem.Areas.Admin.Controllers
         #region 直营团队数据
         public JsonResult Team1InfoDo(string MakerCode, string BindingTime, string ActivationTime, string PosFeeSelect, string BrandId, int page = 1, int limit = 30)
         {
+            AddSysLog("0", "SysTools", "Team1InfoDo");
             string conn = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
             List<Dictionary<string, object>> dataList = new List<Dictionary<string, object>>();
             string condition = " where 1=1";
@@ -5726,6 +5983,7 @@ namespace MySystem.Areas.Admin.Controllers
             var FileName = MakerCode + RealName + "直营团队数据记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
             string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + Sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"}";
             RedisDbconn.Instance.AddList("ExportQueue", SendData);
+            AddSysLog("0", "SysTools", "ExportTeam1InfoExcelDo");
             return "success";
         }
         #endregion
@@ -5744,6 +6002,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string ChangePosFeeDo(string PosSn, string BrandId, string Deposit)
         {
+            AddSysLog("0", "SysTools", "ChangePosFeeDo");
             if (string.IsNullOrEmpty(PosSn))
             {
                 return "请输入机具SN";

+ 2 - 1
Areas/Admin/Controllers/MainServer/ToChargeBackRecordController.cs

@@ -641,7 +641,7 @@ namespace MySystem.Areas.Admin.Controllers
                 function.WriteLog(text, "机具回收确认退还");//机具回收确认退还
             }
             db.SaveChanges();
-            AddSysLog("0", "ToChargeBackRecord", "Import");
+            AddSysLog("0", "ToChargeBackRecord", "Imports");
             return "success";
         }
         #endregion
@@ -811,6 +811,7 @@ namespace MySystem.Areas.Admin.Controllers
             var FileName = "创客预扣款记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
             string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + Sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"}";
             RedisDbconn.Instance.AddList("ExportQueue", SendData);
+            AddSysLog("0", "ToChargeBackRecord", "QuickExportExcelDo");
             return "success";
         }
         #endregion

+ 18 - 4
Areas/Admin/Controllers/MainServer/TradeRecordController.cs

@@ -602,31 +602,44 @@ namespace MySystem.Areas.Admin.Controllers
                     SimposMerchantInfo checkSimMer = db.SimposMerchantInfo.FirstOrDefault(m => m.KqMerNo == Mobile && m.KqSnNo == SimNo);
                     if (checkSimMer != null)
                     {
-                        checkSimMer.Status = -1;
                         if (UserStatus.Contains("欠费") && checkSimMer.Status != -1)
                         {
                             checkSimMer.Status = -2;
                         }
+                        else
+                        {
+                            checkSimMer.Status = -1;
+                        }
                         db.SaveChanges();
                     }
                     PosMerchantInfo checkMer = db.PosMerchantInfo.FirstOrDefault(m => m.KqMerNo == Mobile && m.KqSnNo == SimNo);
                     if (checkMer != null)
                     {
-                        checkMer.Status = -1;
                         if (UserStatus.Contains("欠费") && checkMer.Status != -1)
                         {
                             checkMer.Status = -2;
                         }
+                        else
+                        {
+                            checkMer.Status = -1;
+                        }
                         db.SaveChanges();
                     }
                     PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == SimNo);
                     if (pos != null)
                     {
-                        pos.Status = -1;
+                        if (pos.QueryCount == 1 && pos.Status == 0)
+                        {
+                            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"" + pos.BuyUserId + "\",\"ActCount\":\"1\"}");
+                        }
                         if (UserStatus.Contains("欠费") && pos.Status != -1)
                         {
                             pos.Status = -2;
                         }
+                        else
+                        {
+                            pos.Status = -1;
+                        }
                         db.SaveChanges();
                     }
                 }
@@ -686,7 +699,7 @@ namespace MySystem.Areas.Admin.Controllers
                     DoCount += 1;
                 }
             }
-            AddSysLog("0", "TradeRecord", "Import");
+            AddSysLog("0", "TradeRecord", "ImportTradePost");
             return "success|" + DoCount;
         }
         #endregion
@@ -700,6 +713,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string ImportByQueuePost(string ExcelPath, int Kind = 0)
         {
+            AddSysLog("ExcelPath:" + ExcelPath + "Kind:" + Kind, "TradeRecord", "ImportByQueuePost");
             string key = function.MD5_16(Guid.NewGuid().ToString());
             RedisDbconn.Instance.AddList("SIMPosMerchantTradeQueue", ExcelPath + "#cut#" + Kind + "#cut#" + key + "#cut#" + SysUserName);
             return "success|" + key;

+ 1 - 0
Areas/Admin/Controllers/MainServer/UserAccountRecordController.cs

@@ -797,6 +797,7 @@ namespace MySystem.Areas.Admin.Controllers
             var FileName = "创客账户变动记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
             string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + Sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"}";
             RedisDbconn.Instance.AddList("ExportQueue", SendData);
+            AddSysLog("0", "UserAccountRecord", "QuickExportExcelDo");
             return "success";
         }
         #endregion

+ 3 - 0
Areas/Admin/Controllers/MainServer/UserCashRecordController.cs

@@ -474,6 +474,7 @@ namespace MySystem.Areas.Admin.Controllers
         [HttpPost]
         public string ImportPost(string ExcelPath)
         {
+            AddSysLog("0", "UserCashRecord", "ImportPost");
             string key = function.MD5_16(Guid.NewGuid().ToString());
             RedisDbconn.Instance.AddList("ExcelImport10", ExcelPath + "#cut#UserCashRecord#cut#" + key + "#cut#" + SysUserName);
             return "success|" + key;
@@ -740,6 +741,7 @@ namespace MySystem.Areas.Admin.Controllers
             var FileName = "创客提现记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
             string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + Sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"}";
             RedisDbconn.Instance.AddList("ExportQueue", SendData);
+            AddSysLog("0", "UserAccountRecord", "UserQuickExportExcelDo");
             return "success";
         }
         #endregion
@@ -1125,6 +1127,7 @@ namespace MySystem.Areas.Admin.Controllers
             var FileName = "盟主提现记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
             string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + Sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"}";
             RedisDbconn.Instance.AddList("ExportQueue", SendData);
+            AddSysLog("0", "UserAccountRecord", "LeaderQuickExportExcelDo");
             return "success";
         }
         #endregion

+ 1 - 0
Areas/Admin/Controllers/MainServer/UserCashRecordForBusinessController.cs

@@ -240,6 +240,7 @@ namespace MySystem.Areas.Admin.Controllers
             var FileName = "直营团队提现记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
             string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + Sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"}";
             RedisDbconn.Instance.AddList("ExportQueue", SendData);
+            AddSysLog("0", "UserCashRecordForBusiness", "QuickExportExcelDo");
             return "success";
         }
         #endregion

+ 1 - 0
Areas/Admin/Controllers/MainServer/UserRankWhiteController.cs

@@ -557,6 +557,7 @@ namespace MySystem.Areas.Admin.Controllers
             var FileName = "创客预设职级记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
             string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + Sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"}";
             RedisDbconn.Instance.AddList("ExportQueue", SendData);
+            AddSysLog("0", "UserRankWhite", "QuickExportExcelDo");
             return "success";
         }
         #endregion

+ 7 - 1
Areas/Admin/Controllers/MainServer/UsersController.cs

@@ -462,6 +462,7 @@ namespace MySystem.Areas.Admin.Controllers
             DataTable dt = OtherMySqlConn.dtable("update SmallStoreHouse s set TotalNum=(select count(Id) from PreSendStockDetail where ToUserId=s.UserId and ApplyFlag=0 and Status>-1 and Status<2),LaveNum=10-(select count(Id) from PreSendStockDetail where ToUserId=s.UserId and ApplyFlag=0 and Status>-1 and Status<2) where UserId=" + Id);
             string text = string.Format("重置小分仓机具数,UserId: '" + Id + "',操作人: '" + SysUserName + "_" + SysRealName + "',Time'" + DateTime.Now + "'");
             function.WriteLog(text, "重置小分仓机具数");
+            AddSysLog("0", "Users", "ResetSmallPosCount");
             return "success";
         }
 
@@ -475,6 +476,7 @@ namespace MySystem.Areas.Admin.Controllers
             var apptoken = RedisDbconn.Instance.GetKeys("apptoken:*" + UserId);
             RedisDbconn.Instance.Clear("utoken:*" + UserId);
             RedisDbconn.Instance.Clear("apptoken:*" + UserId);
+            AddSysLog(Id, "Users", "ClearToken");
             return "success";
         }
 
@@ -726,6 +728,7 @@ namespace MySystem.Areas.Admin.Controllers
         // 满足以上全部条件的用户可申请注销,申请后用户二次填写确认填写信息(姓名、手机号、身份证号)即可完成注销
         public string Cancel(string UserId)
         {
+            AddSysLog("0", "Users", "Cancel");
             Users user = db.Users.FirstOrDefault(m => m.Id == Convert.ToInt32(UserId));
             if (user != null)
             {
@@ -987,6 +990,7 @@ namespace MySystem.Areas.Admin.Controllers
                 user.RiskRemark = data.RiskRemark;
                 db.SaveChanges();
             }
+            AddSysLog("0", "Users", "Risk");
             return "success";
         }
 
@@ -1507,7 +1511,7 @@ namespace MySystem.Areas.Admin.Controllers
             ReturnFields.Add("UserLevel", "创客等级");
 
             result.Add("Fields", ReturnFields);
-            AddSysLog("0", "Users", "ExportExcel");
+            AddSysLog("0", "Users", "ExportSJExcel");
             return Json(result);
         }
 
@@ -1578,6 +1582,7 @@ namespace MySystem.Areas.Admin.Controllers
                 function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "统计创客的交易额异常");
                 return "同步异常";
             }
+            AddSysLog("0", "Users", "SycnTradeAmountDo");
             return "success";
         }
 
@@ -2975,6 +2980,7 @@ namespace MySystem.Areas.Admin.Controllers
             var FileName = "批量查询创客信息" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
             string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"}";
             RedisDbconn.Instance.AddList("ExportQueue", SendData);
+            AddSysLog("0", "Users", "ExportBatchSeeUserInfoExcelDo");
             return "success";
         }
         #endregion

+ 92 - 0
Areas/Admin/Controllers/OperateServer/StoreHouseOperateController.cs

@@ -716,6 +716,17 @@ namespace MySystem.Areas.Admin.Controllers
                                     opData.Add(posInfo.BuyUserId + ":" + posInfo.BrandId);
                                 }
 
+                                var BeforeDeposit = 0;
+                                if (string.IsNullOrEmpty(posInfo.PrizeParams))
+                                {
+                                    BeforeDeposit = 299;
+                                    if (posInfo.BrandId == 6) BeforeDeposit = 249;
+                                }
+                                else
+                                {
+                                    BeforeDeposit = int.Parse(posInfo.PrizeParams);
+                                }
+
                                 posInfo.StoreId = toStore.Id;
                                 posInfo.BuyUserId = 0;
                                 posInfo.UserId = 0;
@@ -746,6 +757,41 @@ namespace MySystem.Areas.Admin.Controllers
                                 toStore.LaveNum += 1;
                                 fromStore.TotalNum -= 1;
                                 fromStore.LaveNum -= 1;
+
+                                //机具回仓重置服务费和费率(服务费默认为299,立刷为249 费率为0.6)
+                                Dictionary<string, object> req = new Dictionary<string, object>();
+                                var DepositId = "299";
+                                req.Add("PosSnId", posInfo.Id);
+                                req.Add("BrandId", posInfo.BrandId);
+                                if (posInfo.BrandId == 6) DepositId = "249";
+                                req.Add("Deposit", DepositId);
+                                //重置服务费
+                                RedisDbconn.Instance.AddList("ChangePosFeeQueue", Newtonsoft.Json.JsonConvert.SerializeObject(req));
+
+                                //添加设置押金添加记录
+                                PublicFunction.MerchantDepositSet(posInfo.BrandId, 0, posInfo.Id, posInfo.PosSn, BeforeDeposit, decimal.Parse(DepositId), "");
+
+                                var ChangeFee = 0.60M;
+                                var ChangeKind = 3;
+                                var OpMan = "系统";
+                                var posMachinesFeeChangeRecord = db.PosMachinesFeeChangeRecord.Add(new PosMachinesFeeChangeRecord()
+                                {
+                                    CreateDate = DateTime.Now, //创建时间
+                                    SeoDescription = "系统添加-过期机具回仓重置费率",
+                                    Sort = posInfo.BrandId, //品牌Id
+                                    PosId = posInfo.Id, //机具Id
+                                    PosSn = posInfo.PosSn,
+                                    ChangeFee = ChangeFee, //调整费率
+                                }).Entity;
+                                db.SaveChanges();
+
+                                // PosId:机具Id
+                                // Kind:1或2,1为费率0.63+3,2为费率0.63,3为费率0.6
+                                // OpMan:操作人,app传创客编号,后台传SysUserName
+                                //重置费率
+                                string infos = "{\"RecordId\":\"" + posMachinesFeeChangeRecord.Id + "\",\"PosId\":\"" + posInfo.Id + "\",\"Fee\": \"" + ChangeFee.ToString("f0").TrimEnd('0') + "\",\"Kind\": \"" + ChangeKind + "\",\"OpMan\": \"" + OpMan + "\"}";
+                                RedisDbconn.Instance.AddList("SetDepositQueue", infos);
+
                                 PublicFunction.ClearPosHistory(db, posInfo.PosSn); //清除机具历史记录
                                 db.SaveChanges();
                             }
@@ -811,6 +857,17 @@ namespace MySystem.Areas.Admin.Controllers
                                     opData.Add(posInfo.BuyUserId + ":" + posInfo.BrandId);
                                 }
 
+                                var BeforeDeposit = 0;
+                                if (string.IsNullOrEmpty(posInfo.PrizeParams))
+                                {
+                                    BeforeDeposit = 299;
+                                    if (posInfo.BrandId == 6) BeforeDeposit = 249;
+                                }
+                                else
+                                {
+                                    BeforeDeposit = int.Parse(posInfo.PrizeParams);
+                                }
+
                                 posInfo.StoreId = toStore.Id;
                                 posInfo.BuyUserId = 0;
                                 posInfo.UserId = 0;
@@ -839,6 +896,41 @@ namespace MySystem.Areas.Admin.Controllers
                                 fuserMachineData.UnBindCount -= 1;
                                 toStore.LaveNum += 1;
                                 toStore.TotalNum += 1;
+
+                                //机具回仓重置服务费和费率(服务费默认为299,立刷为249 费率为0.6)
+                                Dictionary<string, object> req = new Dictionary<string, object>();
+                                var DepositId = "299";
+                                req.Add("PosSnId", posInfo.Id);
+                                req.Add("BrandId", posInfo.BrandId);
+                                if (posInfo.BrandId == 6) DepositId = "249";
+                                req.Add("Deposit", DepositId);
+                                //重置服务费
+                                RedisDbconn.Instance.AddList("ChangePosFeeQueue", Newtonsoft.Json.JsonConvert.SerializeObject(req));
+
+                                //添加设置押金添加记录
+                                PublicFunction.MerchantDepositSet(posInfo.BrandId, 0, posInfo.Id, posInfo.PosSn, BeforeDeposit, decimal.Parse(DepositId), "");
+
+                                var ChangeFee = 0.60M;
+                                var ChangeKind = 3;
+                                var OpMan = "系统";
+                                var posMachinesFeeChangeRecord = db.PosMachinesFeeChangeRecord.Add(new PosMachinesFeeChangeRecord()
+                                {
+                                    CreateDate = DateTime.Now, //创建时间
+                                    SeoDescription = "系统添加-过期机具回仓重置费率",
+                                    Sort = posInfo.BrandId, //品牌Id
+                                    PosId = posInfo.Id, //机具Id
+                                    PosSn = posInfo.PosSn,
+                                    ChangeFee = ChangeFee, //调整费率
+                                }).Entity;
+                                db.SaveChanges();
+
+                                // PosId:机具Id
+                                // Kind:1或2,1为费率0.63+3,2为费率0.63,3为费率0.6
+                                // OpMan:操作人,app传创客编号,后台传SysUserName
+                                //重置费率
+                                string infos = "{\"RecordId\":\"" + posMachinesFeeChangeRecord.Id + "\",\"PosId\":\"" + posInfo.Id + "\",\"Fee\": \"" + ChangeFee.ToString("f0").TrimEnd('0') + "\",\"Kind\": \"" + ChangeKind + "\",\"OpMan\": \"" + OpMan + "\"}";
+                                RedisDbconn.Instance.AddList("SetDepositQueue", infos);
+                                
                                 PublicFunction.ClearPosHistory(db, posInfo.PosSn); //清除机具历史记录
                                 db.SaveChanges();
                             }

+ 1 - 1
Areas/Admin/Controllers/OperateServer/UserCashRecordOperateController.cs

@@ -524,7 +524,7 @@ namespace MySystem.Areas.Admin.Controllers
         /// <returns></returns>
         public string ReduceDo(int Id, string Remark)
         {
-            AddSysLog(Id, "UserCashRecord", "Reduce");
+            AddSysLog(Id, "OpUserCashRecord", "Reduce");
             UserCashRecord edit = opdb.UserCashRecord.FirstOrDefault(m => m.Id == Id);
             if (edit != null)
             {

+ 1 - 1
Areas/Admin/Controllers/OperateServer/UserCashRecordOperatesController.cs

@@ -582,7 +582,7 @@ namespace MySystem.Areas.Admin.Controllers
         /// <returns></returns>
         public string ReduceDo(int Id, string Remark)
         {
-            AddSysLog(Id, "UserCashRecord", "Reduce");
+            AddSysLog(Id, "OpUserCashRecord", "Reduce");
             UserCashRecord edit = opdb.UserCashRecord.FirstOrDefault(m => m.Id == Id);
             if (edit != null)
             {

+ 79 - 24
Controllers/HomeController.cs

@@ -178,30 +178,85 @@ namespace MySystem.Controllers
     
         public string test(string p)
         {
-            
-            // BsModels.WebCMSEntities db = new BsModels.WebCMSEntities();
-            // var sysadmins = db.SysAdmin.ToList();
-            // foreach(var sysadmin in sysadmins)
-            // {
-            //     BsModels.SysAdmin edit = db.SysAdmin.FirstOrDefault(m => m.Id == sysadmin.Id);
-            //     if(edit != null)
-            //     {
-            //         string pwd = function.get_Random(8);
-            //         edit.Password = function.MD5_32(pwd);
-            //         db.SaveChanges();
-            //         function.WriteLog(edit.AdminName + ":" + pwd, "pwd");
-            //     }
-            // }
-            // db.Dispose();
-
-            // WebCMSEntities db = new WebCMSEntities();
-            // List<string> nos = new List<string>();
-            // nos.Add("BC2024010814562964923941884");
-            // List<UserCashRecord> list = db.UserCashRecord.Where(m => nos.Contains(m.CashOrderNo)).ToList();
-            // foreach (UserCashRecord edit in list)
-            // {
-            //     RedisDbconn.Instance.AddList("JkCashPayApplyQueue", Newtonsoft.Json.JsonConvert.SerializeObject(edit));
-            // }
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"174\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"391\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"392\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"588\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"607\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"4273\",\"ActCount\":\"5\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"54784\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"56153\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"120862\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"125505\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"127366\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"129563\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"136041\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"137182\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"138250\",\"ActCount\":\"2\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"142975\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"143114\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"155982\",\"ActCount\":\"2\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"156928\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"162971\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"166743\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"168049\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"168585\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"170205\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"172119\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"172725\",\"ActCount\":\"2\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"173164\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"173658\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"173706\",\"ActCount\":\"2\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"173790\",\"ActCount\":\"3\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"173793\",\"ActCount\":\"2\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"173802\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"173828\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"174149\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"174282\",\"ActCount\":\"3\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"174384\",\"ActCount\":\"2\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"174447\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"174506\",\"ActCount\":\"2\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"174651\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"174889\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"174909\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"174912\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"174957\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"174987\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"175113\",\"ActCount\":\"4\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"175156\",\"ActCount\":\"4\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"175309\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"175325\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"175336\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"175471\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"175486\",\"ActCount\":\"2\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"175655\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"175748\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"175780\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"175910\",\"ActCount\":\"2\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"175937\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"175952\",\"ActCount\":\"2\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"176048\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"176176\",\"ActCount\":\"3\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"176356\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"176468\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"176648\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"177017\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"177073\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"177342\",\"ActCount\":\"3\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"177350\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"177592\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"177598\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"178374\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"178386\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"178388\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"178905\",\"ActCount\":\"2\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"179058\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"179555\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"180360\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"180961\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"181484\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"181897\",\"ActCount\":\"1\"}");	
+            RedisDbconn.Instance.AddList("SIMActCountQueue", "{\"UserId\":\"182771\",\"ActCount\":\"1\"}");	
             return "ok";
         }
 

+ 18 - 0
Models/UserSimActSummary.cs

@@ -0,0 +1,18 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class UserSimActSummary
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int Status { get; set; }
+        public int Version { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public int ActCount { get; set; }
+        public int UserId { get; set; }
+        public int Kind { get; set; }
+    }
+}

+ 40 - 0
Models/WebCMSEntities.cs

@@ -290,6 +290,7 @@ namespace MySystem.Models
         public virtual DbSet<UserRankWhite> UserRankWhite { get; set; }
         public virtual DbSet<UserRankWhiteBefore> UserRankWhiteBefore { get; set; }
         public virtual DbSet<UserRebateDetail> UserRebateDetail { get; set; }
+        public virtual DbSet<UserSimActSummary> UserSimActSummary { get; set; }
         public virtual DbSet<UserSnActInfo> UserSnActInfo { get; set; }
         public virtual DbSet<UserSnDelayChange> UserSnDelayChange { get; set; }
         public virtual DbSet<UserStoreChange> UserStoreChange { get; set; }
@@ -20275,6 +20276,45 @@ namespace MySystem.Models
                 entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<UserSimActSummary>(entity =>
+            {
+                entity.HasComment("广电卡激活数统计");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.ActCount)
+                    .HasColumnType("int(11)")
+                    .HasComment("激活数");
+
+                entity.Property(e => e.CreateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("创建时间");
+
+                entity.Property(e => e.Kind)
+                    .HasColumnType("int(11)")
+                    .HasComment("类型");
+
+                entity.Property(e => e.Sort)
+                    .HasColumnType("int(11)")
+                    .HasComment("排序序号");
+
+                entity.Property(e => e.Status)
+                    .HasColumnType("int(11)")
+                    .HasComment("状态");
+
+                entity.Property(e => e.UpdateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("修改时间");
+
+                entity.Property(e => e.UserId)
+                    .HasColumnType("int(11)")
+                    .HasComment("创客");
+
+                entity.Property(e => e.Version)
+                    .HasColumnType("int(11)")
+                    .HasComment("版本号");
+            });
+
             modelBuilder.Entity<UserSnActInfo>(entity =>
             {
                 entity.HasComment("机具激活限制信息");

+ 1 - 0
Startup.cs

@@ -155,6 +155,7 @@ namespace MySystem
                 SIMPosMerchantTradeService.Instance.Start(); //导入广电卡数据
                 GetRadioCardInfoService.Instance.Start(); //获取行销宝信息
                 SycnUserMachineCountHelper.Instance.Start(); //重置创客机具数量
+                SIMActCountService.Instance.Start(); //统计注销欠费卡张数
 
                 TestHelper.Instance.Start(); //生成兑换券