Переглянути джерело

Merge branch 'feature-dgy-创客提现批量设置成功' into feature-dgy-后台测试

DuGuYang 3 роки тому
батько
коміт
b86912f48c
72 змінених файлів з 2932 додано та 340 видалено
  1. 6 6
      AppStart/ExcelHelper.cs
  2. 1 1
      AppStart/Helper/SycnHelpProfitService.cs
  3. 282 132
      AppStart/Helper/SycnProfitServiceV2.cs
  4. 2 2
      AppStart/OssHelper.cs
  5. 13 0
      AppStart/Tables/ProgressUserList.cs
  6. 1 0
      Areas/Admin/Controllers/BsServer/BaseController.cs
  7. 1 1
      Areas/Admin/Controllers/MainServer/ActiveRewardController.cs
  8. 28 0
      Areas/Admin/Controllers/MainServer/ExportTableController.cs
  9. 4 4
      Areas/Admin/Controllers/MainServer/HelpProfitExchangeController.cs
  10. 4 4
      Areas/Admin/Controllers/MainServer/HelpProfitExchangeDetailController.cs
  11. 1 1
      Areas/Admin/Controllers/MainServer/HelpProfitRewardController.cs
  12. 8 8
      Areas/Admin/Controllers/MainServer/MachineChangeController.cs
  13. 2 2
      Areas/Admin/Controllers/MainServer/MerchantDepositReturnsController.cs
  14. 4 4
      Areas/Admin/Controllers/MainServer/OrdersController.cs
  15. 8 8
      Areas/Admin/Controllers/MainServer/PosMachinesFeeChangeRecordController.cs
  16. 8 8
      Areas/Admin/Controllers/MainServer/PosMachinesTwoChangeController.cs
  17. 211 19
      Areas/Admin/Controllers/MainServer/PreSendStockDetailController.cs
  18. 3 3
      Areas/Admin/Controllers/MainServer/ProfitRewardRecordController.cs
  19. 4 4
      Areas/Admin/Controllers/MainServer/SchoolSignInRecordController.cs
  20. 4 4
      Areas/Admin/Controllers/MainServer/SchoolSignInTaskRecordController.cs
  21. 330 16
      Areas/Admin/Controllers/MainServer/StoreHouseAmountRecordController.cs
  22. 29 23
      Areas/Admin/Controllers/MainServer/StoreHouseController.cs
  23. 4 4
      Areas/Admin/Controllers/MainServer/StoreMachineApplyController.cs
  24. 75 33
      Areas/Admin/Controllers/MainServer/SysToolsController.cs
  25. 8 8
      Areas/Admin/Controllers/MainServer/TeamApplyController.cs
  26. 4 4
      Areas/Admin/Controllers/MainServer/TeamDayTopController.cs
  27. 1 1
      Areas/Admin/Controllers/MainServer/TradeRecordController.cs
  28. 1 1
      Areas/Admin/Controllers/MainServer/UserAccountRecordController.cs
  29. 27 2
      Areas/Admin/Controllers/MainServer/UserCashRecordController.cs
  30. 6 3
      Areas/Admin/Controllers/MainServer/UsersController.cs
  31. 15 0
      Areas/Admin/Views/Home/Index.cshtml
  32. 17 0
      Areas/Admin/Views/MainServer/ExportTable/Double.cshtml
  33. 17 0
      Areas/Admin/Views/MainServer/ExportTable/HelpProfit.cshtml
  34. 17 0
      Areas/Admin/Views/MainServer/ExportTable/OpenMachine.cshtml
  35. 17 0
      Areas/Admin/Views/MainServer/ExportTable/Profit.cshtml
  36. 17 0
      Areas/Admin/Views/MainServer/ExportTable/Recommend.cshtml
  37. 17 0
      Areas/Admin/Views/MainServer/ExportTable/StoreHouse.cshtml
  38. 17 0
      Areas/Admin/Views/MainServer/ExportTable/Subsidy.cshtml
  39. 17 0
      Areas/Admin/Views/MainServer/ExportTable/Trade.cshtml
  40. 4 4
      Areas/Admin/Views/MainServer/PreSendStockDetail/Index.cshtml
  41. 237 0
      Areas/Admin/Views/MainServer/PreSendStockDetail/Indexs.cshtml
  42. 12 3
      Areas/Admin/Views/MainServer/StoreHouseAmountRecord/Index.cshtml
  43. 156 0
      Areas/Admin/Views/MainServer/StoreHouseAmountRecord/Indexs.cshtml
  44. 5 0
      Areas/Admin/Views/MainServer/UserCashRecord/Index.cshtml
  45. 7 0
      Controllers/HomeController.cs
  46. 3 3
      Models/BackEndOpRecord.cs
  47. 3 0
      Models/HelpProfitReward.cs
  48. 3 0
      Models/HelpProfitRewardDetail.cs
  49. 3 3
      Models/LeaderAccountRecord.cs
  50. 1 0
      Models/PreSendStockDetail.cs
  51. 3 0
      Models/ProfitRewardExport.cs
  52. 3 0
      Models/ProfitSubsidyExport.cs
  53. 3 0
      Models/SchoolMakerStudy.cs
  54. 3 0
      Models/SchoolMorningMeet.cs
  55. 3 0
      Models/SchoolMorningMeetLog.cs
  56. 24 0
      Models/SmallStoreQuotaRecord.cs
  57. 3 3
      Models/StoreHouseAmountPromiss.cs
  58. 1 0
      Models/StoreHouseAmountRecord.cs
  59. 35 0
      Models/SubsidyRecord.cs
  60. 4 0
      Models/UserAccount.cs
  61. 249 0
      Models/WebCMSEntities.cs
  62. 6 5
      wwwroot/layuiadmin/modules_main/PosMachinesTwoChange_Admin.js
  63. 7 7
      wwwroot/layuiadmin/modules_main/PreSendStockDetail_Admin.js
  64. 451 0
      wwwroot/layuiadmin/modules_main/PreSendStockDetails_Admin.js
  65. 1 1
      wwwroot/layuiadmin/modules_main/SmallStoreHouse_Admin.js
  66. 3 2
      wwwroot/layuiadmin/modules_main/StoreHouseAmountRecord_Admin.js
  67. 420 0
      wwwroot/layuiadmin/modules_main/StoreHouseCardAmountRecord_Admin.js
  68. 13 1
      wwwroot/layuiadmin/modules_main/StoreHouse_Admin.js
  69. 4 0
      wwwroot/layuiadmin/modules_main/UserAccount_Admin.js
  70. 29 0
      wwwroot/layuiadmin/modules_main/UserCashRecord_Admin.js
  71. 0 0
      wwwroot/other/oss/upload-min-oss.js
  72. 2 2
      wwwroot/other/oss/upload-min-oss.jsold

+ 6 - 6
AppStart/ExcelHelper.cs

@@ -230,7 +230,7 @@ namespace MySystem
                                     Time = DateTime.Now,
                                     ErrorContent = ex.ToString(),
                                 };
-                                function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "BsServerAdminError");
+                                function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "导入Excel文件异常");
                             }
                             tran.Dispose();
                         }
@@ -527,7 +527,7 @@ namespace MySystem
                                         Time = DateTime.Now,
                                         ErrorContent = ex.ToString(),
                                     };
-                                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "BsServerAdminError");
+                                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "导入Excel文件异常");
                                 }
                             }
                         }
@@ -802,7 +802,7 @@ namespace MySystem
                                         Time = DateTime.Now,
                                         ErrorContent = ex.ToString(),
                                     };
-                                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "BsServerAdminError");
+                                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "导入Excel文件异常");
                                 }
                             }
                         }
@@ -1008,7 +1008,7 @@ namespace MySystem
                                         Time = DateTime.Now,
                                         ErrorContent = ex.ToString(),
                                     };
-                                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "BsServerAdminError");
+                                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "导入Excel文件异常");
                                 }
                             }
                         }
@@ -1298,7 +1298,7 @@ namespace MySystem
                                         Time = DateTime.Now,
                                         ErrorContent = ex.ToString(),
                                     };
-                                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "BsServerAdminError");
+                                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "导入Excel文件异常");
                                 }
                             }
                         }
@@ -1406,7 +1406,7 @@ namespace MySystem
                                         Time = DateTime.Now,
                                         ErrorContent = ex.ToString(),
                                     };
-                                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "BsServerAdminError");
+                                    function.WriteLog(Newtonsoft.Json.JsonConvert.SerializeObject(msg), "导入Excel文件异常");
                                 }
                             }
                         }

+ 1 - 1
AppStart/Helper/SycnHelpProfitService.cs

@@ -25,7 +25,7 @@ namespace MySystem
         {
             while (true)
             {
-                string content = RedisDbconn.Instance.RPop<string>("SycnHelpProfitQueue");
+                string content = RedisDbconn.Instance.RPop<string>("SycnHelpProfitQueue2");
                 if (!string.IsNullOrEmpty(content))
                 {
                     try

+ 282 - 132
AppStart/Helper/SycnProfitServiceV2.cs

@@ -25,7 +25,7 @@ namespace MySystem
         {
             while (true)
             {
-                string content = RedisDbconn.Instance.RPop<string>("SycnProfitQueue2");
+                string content = RedisDbconn.Instance.RPop<string>("SycnProfitQueue3");
                 if (!string.IsNullOrEmpty(content))
                 {
                     try
@@ -64,8 +64,13 @@ namespace MySystem
         {
             WebCMSEntities db = new WebCMSEntities();
             OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
-            OtherMySqlConn.op("insert into ProfitRecord (CreateDate,CreateMan,SeoTitle,ParentNav,BrandId,UserId,DirectFlag,ProfitAmount) select now(),'root','" + date + "',(select ParentNav from Users where Id=p.UserId)," + BrandId + ",UserId,ProfitType,sum(CreditTradeProfit+DebitNonTradeCapProfit+DebitTradeCapProfit) from ProfitRewardRecord p where CheckStatus=0 and BrandId=" + BrandId + " and UserId>0 and TradeMonth='" + date + "' group by UserId,ProfitType order by UserId");
-            DataTable dt = OtherMySqlConn.dtable("select UserId,sum(CreditTradeProfit+DebitNonTradeCapProfit+DebitTradeCapProfit) from ProfitRewardRecord where CheckStatus=0 and BrandId=" + BrandId + " and UserId>0 and TradeMonth='" + date + "' group by UserId");
+            string StartId = function.ReadInstance("/PublicParams/ProfitRewardRecordId" + date + ".txt");
+            if(string.IsNullOrEmpty(StartId))
+            {
+                StartId = "0";
+            }
+            OtherMySqlConn.op("insert into ProfitRecord (CreateDate,CreateMan,SeoTitle,ParentNav,BrandId,UserId,DirectFlag,ProfitAmount) select now(),'root','" + date + "',(select ParentNav from Users where Id=p.UserId)," + BrandId + ",UserId,ProfitType,sum(CreditTradeProfit+DebitNonTradeCapProfit+DebitTradeCapProfit) from ProfitRewardRecord p where Id>=" + StartId + " and CheckStatus=0 and BrandId=" + BrandId + " and UserId>0 and TradeMonth='" + date + "' group by UserId,ProfitType order by UserId");
+            DataTable dt = OtherMySqlConn.dtable("select UserId,sum(CreditTradeProfit+DebitNonTradeCapProfit+DebitTradeCapProfit) from ProfitRewardRecord where Id>=" + StartId + " and CheckStatus=0 and BrandId=" + BrandId + " and UserId>0 and TradeMonth='" + date + "' group by UserId");
             function.WriteLog("分润:" + BrandId + ":" + dt.Rows.Count, "同步分润数据");
             int index = 0;
             foreach (DataRow dr in dt.Rows)
@@ -75,18 +80,8 @@ namespace MySystem
                 decimal ProfitMoney = decimal.Parse(dr[1].ToString());
                 try
                 {
-                    string IdBrand = UserId + "_" + BrandId;
-                    UserMachineData MachineData = db.UserMachineData.FirstOrDefault(m => m.IdBrand == IdBrand);
-                    if (MachineData == null)
-                    {
-                        MachineData = db.UserMachineData.Add(new UserMachineData()
-                        {
-                            IdBrand = IdBrand,
-                        }).Entity;
-                        db.SaveChanges();
-                    }
-                    MachineData.TradeProfit += ProfitMoney;
-                    db.SaveChanges();
+                    string content = UserId + "|" + BrandId + "|" + ProfitMoney + "|" + index;
+                    RedisDbconn.Instance.AddList("DoTradeProfitQueue", content);
                 }
                 catch (Exception ex)
                 {
@@ -94,73 +89,88 @@ namespace MySystem
                 }
                 function.WriteLog(index.ToString(), "同步分润数据");
             }
-            OtherMySqlConn.op("update ProfitRewardRecord set CheckStatus=1 where CheckStatus=0 and BrandId=" + BrandId + " and UserId>0 and TradeMonth='" + date + "'");
-                
+            OtherMySqlConn.op("update ProfitRewardRecord set CheckStatus=1 where Id>=" + StartId + " and CheckStatus=0 and BrandId=" + BrandId + " and UserId>0 and TradeMonth='" + date + "'");
+
             db.Dispose();
+            dt.Dispose();
+
+            RedisDbconn.Instance.AddList("DoTradeProfitQueue", "end");
+            SycnProfitServiceV2.Instance.StartProfit();
         }
         private void DoTradeProfit2(int BrandId, string date, string SysUserName)
         {
             WebCMSEntities db = new WebCMSEntities();
             OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
-            
-            DataTable dt = OtherMySqlConn.dtable("select UserId,DirectFlag,ProfitAmount from ProfitRecord where BrandId=" + BrandId + " and SeoTitle='" + date + "' and Version=0 and UserId>0");
-            function.WriteLog("分润:" + BrandId + ":" + dt.Rows.Count, "同步分润数据");
-            int index = 0;
-            foreach (DataRow dr in dt.Rows)
+            int startid = 0;
+            bool op = true;
+            while(op)
             {
-                index += 1;
-                int UserId = int.Parse(dr["UserId"].ToString());
-                int DirectFlag = int.Parse(dr["DirectFlag"].ToString());
-                decimal ProfitAmount = decimal.Parse(dr["ProfitAmount"].ToString());
-                var tran = db.Database.BeginTransaction();
-                try
+                DataTable dt = OtherMySqlConn.dtable("select Id,UserId,DirectFlag,ProfitAmount from ProfitRecord where Id>" + startid + " and BrandId=" + BrandId + " and SeoTitle='" + date + "' and Version=0 and UserId>0 order by Id limit 200");
+                if(dt.Rows.Count > 0)
                 {
-                    UserAccount account = db.UserAccount.FirstOrDefault(m => m.Id == UserId);
-                    if (account == null)
+                    function.WriteLog("分润:" + BrandId + ":" + dt.Rows.Count, "同步分润数据");
+                    int index = 0;
+                    foreach (DataRow dr in dt.Rows)
                     {
-                        account = db.UserAccount.Add(new UserAccount()
+                        index += 1;
+                        int UserId = int.Parse(dr["UserId"].ToString());
+                        int DirectFlag = int.Parse(dr["DirectFlag"].ToString());
+                        decimal ProfitAmount = decimal.Parse(dr["ProfitAmount"].ToString());
+                        var tran = db.Database.BeginTransaction();
+                        try
                         {
-                            Id = UserId,
-                            UserId = UserId,
-                        }).Entity;
-                        db.SaveChanges();
+                            UserAccount account = db.UserAccount.FirstOrDefault(m => m.Id == UserId);
+                            if (account == null)
+                            {
+                                account = db.UserAccount.Add(new UserAccount()
+                                {
+                                    Id = UserId,
+                                    UserId = UserId,
+                                }).Entity;
+                                db.SaveChanges();
+                            }
+                            decimal BeforeTotalAmount = account.TotalAmount; //变更前总金额
+                            decimal BeforeFreezeAmount = account.FreezeAmount; //变更前冻结金额
+                            decimal BeforeBalanceAmount = account.BalanceAmount; //变更前余额
+                            account.BalanceAmount += ProfitAmount;
+                            account.TotalAmount += ProfitAmount;
+                            decimal AfterTotalAmount = account.TotalAmount; //变更后总金额
+                            decimal AfterFreezeAmount = account.FreezeAmount; //变更后冻结金额
+                            decimal AfterBalanceAmount = account.BalanceAmount; //变更后余额
+                            UserAccountRecord userAccountRecord = db.UserAccountRecord.Add(new UserAccountRecord()
+                            {
+                                CreateDate = DateTime.Now,
+                                UpdateDate = DateTime.Now,
+                                UserId = UserId, //创客
+                                ProductType = BrandId,
+                                ChangeType = 1, //变动类型
+                                ChangeAmount = ProfitAmount, //变更金额
+                                BeforeTotalAmount = BeforeTotalAmount, //变更前总金额
+                                AfterTotalAmount = AfterTotalAmount, //变更后总金额
+                                BeforeFreezeAmount = BeforeFreezeAmount, //变更前冻结金额
+                                AfterFreezeAmount = AfterFreezeAmount, //变更后冻结金额
+                                BeforeBalanceAmount = BeforeBalanceAmount, //变更前余额
+                                AfterBalanceAmount = AfterBalanceAmount, //变更后余额
+                                Remark = DirectFlag == 1 ? "直拓商户分润" : "品牌推广服务费",
+                            }).Entity;
+                            db.SaveChanges();
+                            tran.Commit();
+                        }
+                        catch (Exception ex)
+                        {
+                            function.WriteLog(DateTime.Now.ToString() + "\n" + UserId + "," + ProfitAmount + "\n" + ex.ToString(), "同步到余额异常");
+                            tran.Rollback();
+                        }
+                        startid = int.Parse(dr["Id"].ToString());
+                        function.WriteLog(index.ToString(), "同步分润数据");
                     }
-                    decimal BeforeTotalAmount = account.TotalAmount; //变更前总金额
-                    decimal BeforeFreezeAmount = account.FreezeAmount; //变更前冻结金额
-                    decimal BeforeBalanceAmount = account.BalanceAmount; //变更前余额
-                    account.BalanceAmount += ProfitAmount;
-                    account.TotalAmount += ProfitAmount;
-                    decimal AfterTotalAmount = account.TotalAmount; //变更后总金额
-                    decimal AfterFreezeAmount = account.FreezeAmount; //变更后冻结金额
-                    decimal AfterBalanceAmount = account.BalanceAmount; //变更后余额
-                    UserAccountRecord userAccountRecord = db.UserAccountRecord.Add(new UserAccountRecord()
-                    {
-                        CreateDate = DateTime.Now,
-                        UpdateDate = DateTime.Now,
-                        UserId = UserId, //创客
-                        ProductType = BrandId,
-                        ChangeType = 1, //变动类型
-                        ChangeAmount = ProfitAmount, //变更金额
-                        BeforeTotalAmount = BeforeTotalAmount, //变更前总金额
-                        AfterTotalAmount = AfterTotalAmount, //变更后总金额
-                        BeforeFreezeAmount = BeforeFreezeAmount, //变更前冻结金额
-                        AfterFreezeAmount = AfterFreezeAmount, //变更后冻结金额
-                        BeforeBalanceAmount = BeforeBalanceAmount, //变更前余额
-                        AfterBalanceAmount = AfterBalanceAmount, //变更后余额
-                        Remark = DirectFlag == 1 ? "直拓商户分润" : "品牌推广服务费",
-                    }).Entity;
-                    db.SaveChanges();
-                    tran.Commit();
                 }
-                catch (Exception ex)
+                else
                 {
-                    function.WriteLog(DateTime.Now.ToString() + "\n" + UserId + "," + ProfitAmount + "\n" + ex.ToString(), "同步到余额异常");
-                    tran.Rollback();
+                    op = false;
                 }
-                function.WriteLog(index.ToString(), "同步分润数据");
             }
             OtherMySqlConn.dtable("update ProfitRecord set Version=1 where BrandId=" + BrandId + " and SeoTitle='" + date + "' and Version=0 and UserId>0");
-                
             db.Dispose();
         }
 
@@ -170,8 +180,16 @@ namespace MySystem
         {
             WebCMSEntities db = new WebCMSEntities();
             OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
+
+            string StartId = function.ReadInstance("/PublicParams/ProfitSubsidyDetailId" + date + ".txt");
+            if(string.IsNullOrEmpty(StartId))
+            {
+                StartId = "0";
+            }
             
-            DataTable dt = OtherMySqlConn.dtable("select SubsidyUserId,sum(SubsidyProfitRate) from ProfitSubsidyDetail where Status=0 and BrandId=" + BrandId + " and TradeMonth='" + date + "' GROUP BY SubsidyUserId");
+            OtherMySqlConn.op("insert into SubsidyRecord (CreateDate,SeoKeyword,SeoTitle,ParentNav,BrandId,UserId,ProfitAmount) select now(),'root','" + date + "',(select ParentNav from Users where Id=p.SubsidyUserId)," + BrandId + ",SubsidyUserId,sum(SubsidyProfitRate) from ProfitSubsidyDetail p where Id>=" + StartId + " and Status=0 and BrandId=" + BrandId + " and TradeMonth='" + date + "' GROUP BY SubsidyUserId");
+
+            DataTable dt = OtherMySqlConn.dtable("select SubsidyUserId,sum(SubsidyProfitRate) from ProfitSubsidyDetail where Id>=" + StartId + " and Status=0 and BrandId=" + BrandId + " and TradeMonth='" + date + "' GROUP BY SubsidyUserId");
             function.WriteLog("补贴:" + BrandId + ":" + dt.Rows.Count, "同步补贴数据");
             int index = 0;
             foreach (DataRow dr in dt.Rows)
@@ -181,94 +199,98 @@ namespace MySystem
                 decimal ProfitMoney = decimal.Parse(dr[1].ToString());
                 try
                 {
-                    Users user = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
-                    string IdBrand = UserId + "_" + BrandId;
-                    UserMachineData MachineData = db.UserMachineData.FirstOrDefault(m => m.IdBrand == IdBrand);
-                    if (MachineData == null)
-                    {
-                        MachineData = db.UserMachineData.Add(new UserMachineData()
-                        {
-                            IdBrand = IdBrand,
-                        }).Entity;
-                        db.SaveChanges();
-                    }
-                    MachineData.OtherProfit += ProfitMoney;
-                    db.SaveChanges();
+                    string content = UserId + "|" + BrandId + "|" + ProfitMoney + "|" + index;
+                    RedisDbconn.Instance.AddList("DoSubsidyProfitQueue", content);
                 }
                 catch (Exception ex)
                 {
                     function.WriteLog(DateTime.Now.ToString() + "\n" + UserId + "," + ProfitMoney + "\n" + ex.ToString(), "同步到补贴异常");
                 }
-                function.WriteLog(index.ToString(), "同步补贴数据");
             }
-            OtherMySqlConn.dtable("update ProfitSubsidyDetail set Status=1 where Status=0 and BrandId=" + BrandId + " and TradeMonth='" + date + "'");
+            OtherMySqlConn.dtable("update ProfitSubsidyDetail set Status=1 where Id>=" + StartId + " and Status=0 and BrandId=" + BrandId + " and TradeMonth='" + date + "'");
                 
             db.Dispose();
+            dt.Dispose();
+            
+            RedisDbconn.Instance.AddList("DoSubsidyProfitQueue", "end");
+            SycnProfitServiceV2.Instance.StartSubsidy();
         }
 
         private void DoSubsidyProfit2(int BrandId, string date)
         {
             WebCMSEntities db = new WebCMSEntities();
             OtherMySqlConn.connstr = Library.ConfigurationManager.AppSettings["SqlConnStr"].ToString();
-            
-            DataTable dt = OtherMySqlConn.dtable("select SubsidyUserId,sum(SubsidyProfitRate) from ProfitSubsidyDetail where Status=1 and BrandId=" + BrandId + " and TradeMonth='" + date + "' GROUP BY SubsidyUserId");
-            function.WriteLog("补贴:" + BrandId + ":" + dt.Rows.Count, "同步补贴数据");
-            int index = 0;
-            foreach (DataRow dr in dt.Rows)
+            int startid = 0;
+            bool op = true;
+            while(op)
             {
-                index += 1;
-                int UserId = int.Parse(dr["SubsidyUserId"].ToString());
-                decimal ProfitMoney = decimal.Parse(dr[1].ToString());
-                var tran = db.Database.BeginTransaction();
-                try
+                DataTable dt = OtherMySqlConn.dtable("select Id,UserId,ProfitAmount from SubsidyRecord where Id>" + startid + " and BrandId=" + BrandId + " and SeoTitle='" + date + "' and Status=0 and UserId>0 order by Id limit 200");
+                if(dt.Rows.Count > 0)
                 {
-                    Users user = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
-                    UserAccount account = db.UserAccount.FirstOrDefault(m => m.Id == UserId);
-                    if (account == null)
+                    function.WriteLog("补贴:" + BrandId + ":" + dt.Rows.Count, "同步补贴数据");
+                    int index = 0;
+                    foreach (DataRow dr in dt.Rows)
                     {
-                        account = db.UserAccount.Add(new UserAccount()
+                        index += 1;
+                        int UserId = int.Parse(dr["UserId"].ToString());
+                        decimal ProfitMoney = decimal.Parse(dr["ProfitAmount"].ToString());
+                        var tran = db.Database.BeginTransaction();
+                        try
                         {
-                            Id = UserId,
-                            UserId = UserId,
-                        }).Entity;
-                        db.SaveChanges();
+                            Users user = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
+                            UserAccount account = db.UserAccount.FirstOrDefault(m => m.Id == UserId);
+                            if (account == null)
+                            {
+                                account = db.UserAccount.Add(new UserAccount()
+                                {
+                                    Id = UserId,
+                                    UserId = UserId,
+                                }).Entity;
+                                db.SaveChanges();
+                            }
+                            decimal BeforeTotalAmount = account.TotalAmount; //变更前总金额
+                            decimal BeforeFreezeAmount = account.FreezeAmount; //变更前冻结金额
+                            decimal BeforeBalanceAmount = account.BalanceAmount; //变更前余额
+                            account.BalanceAmount += ProfitMoney;
+                            account.TotalAmount += ProfitMoney;
+                            decimal AfterTotalAmount = account.TotalAmount; //变更后总金额
+                            decimal AfterFreezeAmount = account.FreezeAmount; //变更后冻结金额
+                            decimal AfterBalanceAmount = account.BalanceAmount; //变更后余额
+                            UserAccountRecord userAccountRecord = db.UserAccountRecord.Add(new UserAccountRecord()
+                            {
+                                CreateDate = DateTime.Now,
+                                UpdateDate = DateTime.Now,
+                                UserId = UserId, //创客
+                                ProductType = BrandId,
+                                ChangeType = 111, //变动类型
+                                ChangeAmount = ProfitMoney, //变更金额
+                                BeforeTotalAmount = BeforeTotalAmount, //变更前总金额
+                                AfterTotalAmount = AfterTotalAmount, //变更后总金额
+                                BeforeFreezeAmount = BeforeFreezeAmount, //变更前冻结金额
+                                AfterFreezeAmount = AfterFreezeAmount, //变更后冻结金额
+                                BeforeBalanceAmount = BeforeBalanceAmount, //变更前余额
+                                AfterBalanceAmount = AfterBalanceAmount, //变更后余额
+                                Remark = "直拓商户补贴",
+                            }).Entity;
+                            db.SaveChanges();
+                            tran.Commit();
+                        }
+                        catch (Exception ex)
+                        {
+                            function.WriteLog(DateTime.Now.ToString() + "\n" + UserId + "," + ProfitMoney + "\n" + ex.ToString(), "同步到补贴异常");
+                            tran.Rollback();
+                        }
+                        startid = int.Parse(dr["Id"].ToString());
+                        function.WriteLog(index.ToString(), "同步补贴数据");
                     }
-                    decimal BeforeTotalAmount = account.TotalAmount; //变更前总金额
-                    decimal BeforeFreezeAmount = account.FreezeAmount; //变更前冻结金额
-                    decimal BeforeBalanceAmount = account.BalanceAmount; //变更前余额
-                    account.BalanceAmount += ProfitMoney;
-                    account.TotalAmount += ProfitMoney;
-                    decimal AfterTotalAmount = account.TotalAmount; //变更后总金额
-                    decimal AfterFreezeAmount = account.FreezeAmount; //变更后冻结金额
-                    decimal AfterBalanceAmount = account.BalanceAmount; //变更后余额
-                    UserAccountRecord userAccountRecord = db.UserAccountRecord.Add(new UserAccountRecord()
-                    {
-                        CreateDate = DateTime.Now,
-                        UpdateDate = DateTime.Now,
-                        UserId = UserId, //创客
-                        ProductType = BrandId,
-                        ChangeType = 111, //变动类型
-                        ChangeAmount = ProfitMoney, //变更金额
-                        BeforeTotalAmount = BeforeTotalAmount, //变更前总金额
-                        AfterTotalAmount = AfterTotalAmount, //变更后总金额
-                        BeforeFreezeAmount = BeforeFreezeAmount, //变更前冻结金额
-                        AfterFreezeAmount = AfterFreezeAmount, //变更后冻结金额
-                        BeforeBalanceAmount = BeforeBalanceAmount, //变更前余额
-                        AfterBalanceAmount = AfterBalanceAmount, //变更后余额
-                        Remark = "直拓商户补贴",
-                    }).Entity;
-                    db.SaveChanges();
-                    tran.Commit();
                 }
-                catch (Exception ex)
+                else
                 {
-                    function.WriteLog(DateTime.Now.ToString() + "\n" + UserId + "," + ProfitMoney + "\n" + ex.ToString(), "同步到补贴异常");
-                    tran.Rollback();
+                    op = false;
                 }
-                function.WriteLog(index.ToString(), "同步补贴数据");
             }
-            OtherMySqlConn.dtable("update ProfitSubsidyDetail set Status=2 where Status=1 and BrandId=" + BrandId + " and TradeMonth='" + date + "'");
-                
+            OtherMySqlConn.dtable("update SubsidyRecord set Status=1 where BrandId=" + BrandId + " and SeoTitle='" + date + "' and Status=0 and UserId>0");
+
             db.Dispose();
         }
 
@@ -354,5 +376,133 @@ namespace MySystem
         }
 
         #endregion
+
+
+
+
+
+
+
+
+
+
+
+        public void StartProfit()
+        {
+            Thread th = new Thread(StartProfitDo);
+            th.IsBackground = true;
+            th.Start();
+        }
+
+        public void StartProfitDo()
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            bool op = true;
+            while (op)
+            {
+                string content = RedisDbconn.Instance.RPop<string>("DoTradeProfitQueue");
+                if (!string.IsNullOrEmpty(content))
+                {
+                    if(content == "end")
+                    {
+                        op = false;
+                    }
+                    else
+                    {
+                        try
+                        {
+                            string[] data = content.Split('|');
+                            int UserId = int.Parse(data[0]);
+                            int BrandId = int.Parse(data[1]);
+                            decimal ProfitMoney = decimal.Parse(data[2]);
+                            int index = int.Parse(data[3]);
+                            
+                            string IdBrand = UserId + "_" + BrandId;
+                            UserMachineData MachineData = db.UserMachineData.FirstOrDefault(m => m.IdBrand == IdBrand);
+                            if (MachineData == null)
+                            {
+                                MachineData = db.UserMachineData.Add(new UserMachineData()
+                                {
+                                    IdBrand = IdBrand,
+                                }).Entity;
+                                db.SaveChanges();
+                            }
+                            MachineData.TradeProfit += ProfitMoney;
+                            db.SaveChanges();
+
+                            function.WriteLog(index.ToString() + "--" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), "同步分润队列数据");
+                        }
+                        catch (Exception ex)
+                        {
+                            function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "同步分润队列数据异常");
+                        }
+                    }
+                }
+                else
+                {
+                    Thread.Sleep(1000);
+                }
+            }
+            db.Dispose();
+        }
+
+        public void StartSubsidy()
+        {
+            Thread th = new Thread(StartSubsidyDo);
+            th.IsBackground = true;
+            th.Start();
+        }
+
+        public void StartSubsidyDo()
+        {
+            WebCMSEntities db = new WebCMSEntities();
+            bool op = true;
+            while (op)
+            {
+                string content = RedisDbconn.Instance.RPop<string>("DoSubsidyProfitQueue");
+                if (!string.IsNullOrEmpty(content))
+                {
+                    if(content == "end")
+                    {
+                        op = false;
+                    }
+                    else
+                    {
+                        try
+                        {
+                            string[] data = content.Split('|');
+                            int UserId = int.Parse(data[0]);
+                            int BrandId = int.Parse(data[1]);
+                            decimal ProfitMoney = decimal.Parse(data[2]);
+                            int index = int.Parse(data[3]);
+
+                            string IdBrand = UserId + "_" + BrandId;
+                            UserMachineData MachineData = db.UserMachineData.FirstOrDefault(m => m.IdBrand == IdBrand);
+                            if (MachineData == null)
+                            {
+                                MachineData = db.UserMachineData.Add(new UserMachineData()
+                                {
+                                    IdBrand = IdBrand,
+                                }).Entity;
+                                db.SaveChanges();
+                            }
+                            MachineData.OtherProfit += ProfitMoney;
+                            db.SaveChanges();
+
+                            function.WriteLog(index.ToString() + "--" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff"), "同步补贴队列数据");
+                        }
+                        catch (Exception ex)
+                        {
+                            function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "同步补贴队列数据异常");
+                        }
+                    }
+                }
+                else
+                {
+                    Thread.Sleep(1000);
+                }
+            }
+            db.Dispose();
+        }
     }
 }

+ 2 - 2
AppStart/OssHelper.cs

@@ -12,8 +12,8 @@ namespace MySystem
 {
     public class OssHelper
     {
-        string key = "LTAI5t7ivibdYZTro4SRVZ9M"; //阿里云AccessKey ID
-        string secret = "nfr1bmbJbMhLuaj10iBORkuFfIAX7M";  //阿里云Access Key Secret
+        string key = "LTAI5tAp9ASZtq4wYzuXfeer"; //阿里云AccessKey ID
+        string secret = "N0o6TwowU8r4aeNWoefMnnus9Q2saW";  //阿里云Access Key Secret
         public string PathName = ConfigurationManager.AppSettings["Database"].ToString();
         public string endpoint = "oss-cn-chengdu.aliyuncs.com";  //endpoint
         public string bucketName = "kexiaoshuang";

+ 13 - 0
AppStart/Tables/ProgressUserList.cs

@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+namespace MySystem
+{
+    public class ProgressUserList
+    {
+        public decimal LastMonth { get; set; }
+        public decimal ThisMonth { get; set; }
+        public int IsOk { get; set; }
+        public int UserId { get; set; }
+        public string ParentNav { get; set; }
+    }
+}

+ 1 - 0
Areas/Admin/Controllers/BsServer/BaseController.cs

@@ -101,6 +101,7 @@ namespace MySystem.Areas.Admin.Controllers
             if(url.Contains("/SystemSet/")) return true;
             if(url.Contains("Task")) return true;
             if(url.Contains("ProfitObject")) return true;
+            if(url.Contains("ExportTable")) return true;
             if (url.Contains("/KqProductBrand/"))
             {
                 url = url.Replace("/KqProductBrand/", "/KqProducts/");

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

@@ -163,7 +163,7 @@ namespace MySystem.Areas.Admin.Controllers
             }
             else
             {
-                var start = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd"));
+                var start = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01");
                 var check = db.ActiveReward.Any(m => m.ActDate >= start && m.BrandId == Convert.ToInt32(BrandId));
                 if (check)
                 {

+ 28 - 0
Areas/Admin/Controllers/MainServer/ExportTableController.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Web;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Data;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.AspNetCore.Http;
+using Microsoft.Extensions.Logging;
+using Microsoft.Extensions.Options;
+using MySystem.Models;
+using Library;
+using LitJson;
+using MySystemLib;
+
+namespace MySystem.Areas.Admin.Controllers
+{
+    [Area("Admin")]
+    [Route("Admin/[controller]/[action]")]
+    public class ExportTableController : BaseController
+    {
+        public ExportTableController(IHttpContextAccessor accessor, ILogger<BaseController> logger, IOptions<Setting> setting) : base(accessor, logger, setting)
+        {
+            OtherMySqlConn.connstr = ConfigurationManager.AppSettings["SqlConnStr"].ToString();
+        }
+
+    }
+}

+ 4 - 4
Areas/Admin/Controllers/MainServer/HelpProfitExchangeController.cs

@@ -60,12 +60,12 @@ namespace MySystem.Areas.Admin.Controllers
             //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
             {
-                condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
             }
             //创客真实姓名
             if (!string.IsNullOrEmpty(UserIdRealName))
             {
-                condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+                condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
             }
             if (!string.IsNullOrEmpty(CreateDateData))
             {
@@ -307,12 +307,12 @@ namespace MySystem.Areas.Admin.Controllers
             //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
             {
-                condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
             }
             //创客真实姓名
             if (!string.IsNullOrEmpty(UserIdRealName))
             {
-                condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+                condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
             }
 
 

+ 4 - 4
Areas/Admin/Controllers/MainServer/HelpProfitExchangeDetailController.cs

@@ -60,12 +60,12 @@ namespace MySystem.Areas.Admin.Controllers
             //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
             {
-                condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
             }
             //创客真实姓名
             if (!string.IsNullOrEmpty(UserIdRealName))
             {
-                condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+                condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
             }
             //券码
             if (!string.IsNullOrEmpty(PosCouponIdSelect))
@@ -319,12 +319,12 @@ namespace MySystem.Areas.Admin.Controllers
             //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
             {
-                condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
             }
             //创客真实姓名
             if (!string.IsNullOrEmpty(UserIdRealName))
             {
-                condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+                condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
             }
             //券码
             if (!string.IsNullOrEmpty(PosCouponIdSelect))

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

@@ -387,7 +387,7 @@ namespace MySystem.Areas.Admin.Controllers
             if (string.IsNullOrEmpty(check))
             {
                 function.WritePage("/HelpBalance/", date + OpTypeString + ".txt", DateTime.Now.ToString());
-                RedisDbconn.Instance.AddList("SycnHelpProfitQueue", date + "#cut#" + OpType + "#cut#" + SysUserName);
+                RedisDbconn.Instance.AddList("SycnHelpProfitQueue2", date + "#cut#" + OpType + "#cut#" + SysUserName);
                 return "success";
             }
             return date + "分润已同步,请勿重复操作";

+ 8 - 8
Areas/Admin/Controllers/MainServer/MachineChangeController.cs

@@ -64,12 +64,12 @@ namespace MySystem.Areas.Admin.Controllers
             //创客真实姓名
             if (!string.IsNullOrEmpty(UserIdRealName))
             {
-                condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+                condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
             }
             //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
             {
-                condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
             }
             //退回产品类型
             if (!string.IsNullOrEmpty(BackProductTypeSelect))
@@ -94,12 +94,12 @@ namespace MySystem.Areas.Admin.Controllers
             //退回仓库归属人创客编号
             if (!string.IsNullOrEmpty(BackStoreUserIdMakerCode))
             {
-                condition += " and BackStoreUserId in (select BackStoreUserId from UsersForMakerCode where MakerCode='" + BackStoreUserIdMakerCode + "')";
+                condition += " and BackStoreUserId in (select BackStoreUserId from UserForMakerCode where MakerCode='" + BackStoreUserIdMakerCode + "')";
             }
             //退回仓库归属人真实姓名
             if (!string.IsNullOrEmpty(BackStoreUserIdRealName))
             {
-                condition += " and BackStoreUserId in (select BackStoreUserId from UsersForRealName where RealName='" + BackStoreUserIdRealName + "')";
+                condition += " and BackStoreUserId in (select BackStoreUserId from UserForRealName where RealName='" + BackStoreUserIdRealName + "')";
             }
             //出库产品类型
             if (!string.IsNullOrEmpty(OutProductTypeSelect))
@@ -385,12 +385,12 @@ namespace MySystem.Areas.Admin.Controllers
             //创客真实姓名
             if (!string.IsNullOrEmpty(UserIdRealName))
             {
-                condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+                condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
             }
             //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
             {
-                condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
             }
             //退回产品类型
             if (!string.IsNullOrEmpty(BackProductTypeSelect))
@@ -415,12 +415,12 @@ namespace MySystem.Areas.Admin.Controllers
             //退回仓库归属人创客编号
             if (!string.IsNullOrEmpty(BackStoreUserIdMakerCode))
             {
-                condition += " and BackStoreUserId in (select BackStoreUserId from UsersForMakerCode where MakerCode='" + BackStoreUserIdMakerCode + "')";
+                condition += " and BackStoreUserId in (select BackStoreUserId from UserForMakerCode where MakerCode='" + BackStoreUserIdMakerCode + "')";
             }
             //退回仓库归属人真实姓名
             if (!string.IsNullOrEmpty(BackStoreUserIdRealName))
             {
-                condition += " and BackStoreUserId in (select BackStoreUserId from UsersForRealName where RealName='" + BackStoreUserIdRealName + "')";
+                condition += " and BackStoreUserId in (select BackStoreUserId from UserForRealName where RealName='" + BackStoreUserIdRealName + "')";
             }
             //出库产品类型
             if (!string.IsNullOrEmpty(OutProductTypeSelect))

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

@@ -340,12 +340,12 @@ namespace MySystem.Areas.Admin.Controllers
             //创客真实姓名
             if (!string.IsNullOrEmpty(UserIdRealName))
             {
-                condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+                condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
             }
             //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
             {
-                condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
             }
 
 

+ 4 - 4
Areas/Admin/Controllers/MainServer/OrdersController.cs

@@ -780,12 +780,12 @@ namespace MySystem.Areas.Admin.Controllers
             //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
             {
-                condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
             }
             //创客真实姓名
             if (!string.IsNullOrEmpty(UserIdRealName))
             {
-                condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+                condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
             }
             //支付方式
             if (!string.IsNullOrEmpty(PayModeSelect))
@@ -830,12 +830,12 @@ namespace MySystem.Areas.Admin.Controllers
             //仓库归属创客编号
             if (!string.IsNullOrEmpty(StoreUserIdMakerCode))
             {
-                condition += " and StoreUserId in (select StoreUserId from UsersForMakerCode where MakerCode='" + StoreUserIdMakerCode + "')";
+                condition += " and StoreUserId in (select StoreUserId from UserForMakerCode where MakerCode='" + StoreUserIdMakerCode + "')";
             }
             //仓库归属创客真实姓名
             if (!string.IsNullOrEmpty(StoreUserIdRealName))
             {
-                condition += " and StoreUserId in (select StoreUserId from UsersForRealName where RealName='" + StoreUserIdRealName + "')";
+                condition += " and StoreUserId in (select StoreUserId from UserForRealName where RealName='" + StoreUserIdRealName + "')";
             }
             //支付状态
             if (!string.IsNullOrEmpty(PayStatusSelect))

+ 8 - 8
Areas/Admin/Controllers/MainServer/PosMachinesFeeChangeRecordController.cs

@@ -66,22 +66,22 @@ namespace MySystem.Areas.Admin.Controllers
             //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
             {
-                condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
             }
             //创客真实姓名
             if (!string.IsNullOrEmpty(UserIdRealName))
             {
-                condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+                condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
             }
             //机具所属人创客编号
             if (!string.IsNullOrEmpty(PosUserIdMakerCode))
             {
-                condition += " and PosUserId in (select PosUserId from UsersForMakerCode where MakerCode='" + PosUserIdMakerCode + "')";
+                condition += " and PosUserId in (select PosUserId from UserForMakerCode where MakerCode='" + PosUserIdMakerCode + "')";
             }
             //机具所属人真实姓名
             if (!string.IsNullOrEmpty(PosUserIdRealName))
             {
-                condition += " and PosUserId in (select PosUserId from UsersForRealName where RealName='" + PosUserIdRealName + "')";
+                condition += " and PosUserId in (select PosUserId from UserForRealName where RealName='" + PosUserIdRealName + "')";
             }
             //品牌
             if (!string.IsNullOrEmpty(SortSelect))
@@ -468,22 +468,22 @@ namespace MySystem.Areas.Admin.Controllers
             //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
             {
-                condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
             }
             //创客真实姓名
             if (!string.IsNullOrEmpty(UserIdRealName))
             {
-                condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+                condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
             }
             //机具所属人创客编号
             if (!string.IsNullOrEmpty(PosUserIdMakerCode))
             {
-                condition += " and PosUserId in (select PosUserId from UsersForMakerCode where MakerCode='" + PosUserIdMakerCode + "')";
+                condition += " and PosUserId in (select PosUserId from UserForMakerCode where MakerCode='" + PosUserIdMakerCode + "')";
             }
             //机具所属人真实姓名
             if (!string.IsNullOrEmpty(PosUserIdRealName))
             {
-                condition += " and PosUserId in (select PosUserId from UsersForRealName where RealName='" + PosUserIdRealName + "')";
+                condition += " and PosUserId in (select PosUserId from UserForRealName where RealName='" + PosUserIdRealName + "')";
             }
             //品牌
             if (!string.IsNullOrEmpty(SortSelect))

+ 8 - 8
Areas/Admin/Controllers/MainServer/PosMachinesTwoChangeController.cs

@@ -59,7 +59,7 @@ namespace MySystem.Areas.Admin.Controllers
             Fields.Add("PosSn", "1"); //SN编号
             Fields.Add("BrandId", "0"); //品牌
 
-            string condition = " and Status>-1 AND BindingState = 1 AND DATE_SUB(CURDATE(), INTERVAL 180 DAY) >= date(BindingTime) and DownFeeFlag =0";
+            string condition = " and Status>-1 AND BindingState = 1 AND DATE_SUB(CURDATE(), INTERVAL 180 DAY) >= date(BindingTime) and UpFeeFlag=1 and DownFeeFlag=0 and SeoDescription!='设置成功'";
             //绑定状态
             if (!string.IsNullOrEmpty(BindingStateSelect))
             {
@@ -463,15 +463,15 @@ namespace MySystem.Areas.Admin.Controllers
         /// <returns></returns>
         public string BatchSetting(string Id)
         {
-            string[] idlist = Id.Split(new char[] { ',' });
+            // string[] idlist = Id.Split(new char[] { ',' });
             AddSysLog(Id, "PosMachinesTwo", "UpFeePosMachinesTwo");
             List<int> posIds = new List<int>();
             List<int> upposIds = new List<int>();
             string userIds = "";
-            foreach (string subids in idlist)
+            DateTime check = DateTime.Now.AddDays(-180);
+            List<PosMachinesTwo> poslist = db.PosMachinesTwo.Where(m => m.Status > -1 && m.BindingState == 1 && m.UpFeeFlag == 1 && m.DownFeeFlag == 0 && m.BindingTime <= check && m.SeoDescription != "设置成功").ToList();
+            foreach (PosMachinesTwo pos in poslist)
             {
-                int id = int.Parse(subids);
-                var pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == id) ?? new PosMachinesTwo();
                 Dictionary<string, object> Fields = new Dictionary<string, object>();
                 Fields.Add("UpFeeFlag", 1);
                 Fields.Add("UpFeeMan", SysUserName);
@@ -487,14 +487,14 @@ namespace MySystem.Areas.Admin.Controllers
                     // PosId:机具Id
                     // Kind:1或2,1为费率0.63,2为费率0.6
                     // OpMan:操作人,app传创客编号,后台传SysUserName
-                    string info = "{\"RecordId\":\"\",\"PosId\":\"" + id + "\",\"Fee\": \"" + 0.63 + "\",\"Kind\": \"" + 1 + "\",\"OpMan\": \"" + SysUserName + "\"}";
+                    string info = "{\"RecordId\":\"\",\"PosId\":\"" + pos.Id + "\",\"Fee\": \"" + 0.63 + "\",\"Kind\": \"" + 1 + "\",\"OpMan\": \"" + SysUserName + "\"}";
                     RedisDbconn.Instance.AddList("SetDepositPostQueue", info);
                 }
                 else
                 {
-                    upposIds.Add(id);
+                    upposIds.Add(pos.Id);
                 }
-                new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("PosMachinesTwo", Fields, id);
+                new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("PosMachinesTwo", Fields, pos.Id);
 
             }
             // string[] lists = userIds.TrimEnd(',').Split(new char[] { ',' });

+ 211 - 19
Areas/Admin/Controllers/MainServer/PreSendStockDetailController.cs

@@ -52,27 +52,41 @@ namespace MySystem.Areas.Admin.Controllers
         /// 预发货库存明细列表
         /// </summary>
         /// <returns></returns>
-        public JsonResult IndexData(PreSendStockDetail data, string StoreIdStoreName, string StoreIdStoreNo, string BrandIdSelect, string ToUserIdMakerCode, string ToUserIdRealName, string ToStoreIdStoreNo, string ToStoreIdStoreName, string SourceStoreIdStoreNo, string SourceStoreIdStoreName, string FromUserIdMakerCode, string FromUserIdRealName, string FromStoreIdStoreNo, string FromStoreIdStoreName, int page = 1, int limit = 30)
+        public JsonResult IndexData(PreSendStockDetail data, string StoreIdStoreName, string StoreIdStoreNo, string CreateDateData, string ApplyDateData, string BrandIdSelect, string ToUserIdMakerCode, string ToUserIdRealName, string ToStoreIdStoreNo, string ToStoreIdStoreName, string SourceStoreIdStoreNo, string SourceStoreIdStoreName, string FromUserIdMakerCode, string FromUserIdRealName, string FromStoreIdStoreNo, string FromStoreIdStoreName, int page = 1, int limit = 30)
         {
 
             Dictionary<string, string> Fields = new Dictionary<string, string>();
             Fields.Add("StoreId", "1");
 
-            Fields.Add("CreateDate", "3"); //时间
+            // Fields.Add("CreateDate", "3"); //时间
             Fields.Add("SnNo", "1"); //SN编号
-            Fields.Add("ApplyDate", "3"); //申请时间
+            // Fields.Add("ApplyDate", "3"); //申请时间
 
 
             string condition = " and Status>-1";
             //仓库名称
             if (!string.IsNullOrEmpty(StoreIdStoreName))
             {
-                condition += " and StoreId in (select StoreId from SmallStoreHouseForStoreName where StoreName='" + StoreIdStoreName + "')";
+                condition += " and StoreId in (select StoreId from StoreForName where Name='" + StoreIdStoreName + "')";
             }
             //仓库编号
             if (!string.IsNullOrEmpty(StoreIdStoreNo))
             {
-                condition += " and StoreId in (select StoreId from SmallStoreHouseForStoreNo where StoreNo='" + StoreIdStoreNo + "')";
+                condition += " and StoreId in (select StoreId from StoreForCode where Code='" + StoreIdStoreNo + "')";
+            }
+            if (!string.IsNullOrEmpty(CreateDateData))
+            {
+                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
+            }
+            if (!string.IsNullOrEmpty(ApplyDateData))
+            {
+                string[] datelist = ApplyDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                condition += " and ApplyDate>='" + start + " 00:00:00' and ApplyDate<='" + end + " 23:59:59'";
             }
             //产品类型
             if (!string.IsNullOrEmpty(BrandIdSelect))
@@ -82,52 +96,52 @@ namespace MySystem.Areas.Admin.Controllers
             //收货人创客编号
             if (!string.IsNullOrEmpty(ToUserIdMakerCode))
             {
-                condition += " and ToUserId in (select ToUserId from UsersForMakerCode where MakerCode='" + ToUserIdMakerCode + "')";
+                condition += " and ToUserId in (select UserId from UserForMakerCode where MakerCode='" + ToUserIdMakerCode + "')";
             }
             //收货人真实姓名
             if (!string.IsNullOrEmpty(ToUserIdRealName))
             {
-                condition += " and ToUserId in (select ToUserId from UsersForRealName where RealName='" + ToUserIdRealName + "')";
+                condition += " and ToUserId in (select UserId from UserForRealName where RealName='" + ToUserIdRealName + "')";
             }
             //收货仓库编号
             if (!string.IsNullOrEmpty(ToStoreIdStoreNo))
             {
-                condition += " and ToStoreId in (select ToStoreId from StoreHouseForStoreNo where StoreNo='" + ToStoreIdStoreNo + "')";
+                condition += " and ToStoreId in (select StoreId from StoreForCode where Code='" + ToStoreIdStoreNo + "')";
             }
             //收货仓库名称
             if (!string.IsNullOrEmpty(ToStoreIdStoreName))
             {
-                condition += " and ToStoreId in (select ToStoreId from StoreHouseForStoreName where StoreName='" + ToStoreIdStoreName + "')";
+                condition += " and ToStoreId in (select StoreId from StoreForName where Name='" + ToStoreIdStoreName + "')";
             }
             //源仓库编号仓库编号
             if (!string.IsNullOrEmpty(SourceStoreIdStoreNo))
             {
-                condition += " and SourceStoreId in (select SourceStoreId from StoreHouseForStoreNo where StoreNo='" + SourceStoreIdStoreNo + "')";
+                condition += " and SourceStoreId in (select StoreId from StoreForCode where Code='" + SourceStoreIdStoreNo + "')";
             }
             //源仓库编号仓库名称
             if (!string.IsNullOrEmpty(SourceStoreIdStoreName))
             {
-                condition += " and SourceStoreId in (select SourceStoreId from StoreHouseForStoreName where StoreName='" + SourceStoreIdStoreName + "')";
+                condition += " and SourceStoreId in (select StoreId from StoreForName where Name=='" + SourceStoreIdStoreName + "')";
             }
             //出货创客编号
             if (!string.IsNullOrEmpty(FromUserIdMakerCode))
             {
-                condition += " and FromUserId in (select FromUserId from UsersForMakerCode where MakerCode='" + FromUserIdMakerCode + "')";
+                condition += " and FromUserId in (select UserId from UserForMakerCode where MakerCode='" + FromUserIdMakerCode + "')";
             }
             //出货创客真实姓名
             if (!string.IsNullOrEmpty(FromUserIdRealName))
             {
-                condition += " and FromUserId in (select FromUserId from UsersForRealName where RealName='" + FromUserIdRealName + "')";
+                condition += " and FromUserId in (select UserId from UserForRealName where RealName='" + FromUserIdRealName + "')";
             }
             //出货仓库编号
             if (!string.IsNullOrEmpty(FromStoreIdStoreNo))
             {
-                condition += " and FromStoreId in (select FromStoreId from StoreHouseForStoreNo where StoreNo='" + FromStoreIdStoreNo + "')";
+                condition += " and FromStoreId in (select StoreId from StoreForCode where Code='" + FromStoreIdStoreNo + "')";
             }
             //出货仓库名称
             if (!string.IsNullOrEmpty(FromStoreIdStoreName))
             {
-                condition += " and FromStoreId in (select FromStoreId from StoreHouseForStoreName where StoreName='" + FromStoreIdStoreName + "')";
+                condition += " and FromStoreId in (select StoreId from StoreForName where Name='" + FromStoreIdStoreName + "')";
             }
 
 
@@ -177,6 +191,10 @@ namespace MySystem.Areas.Admin.Controllers
                 dic["FromStoreIdStoreName"] = fromstoreid_StoreHouse.StoreName;
                 dic.Remove("FromStoreId");
                 dic["CancelFlagName"] = dic["CancelFlag"].ToString() == "1" ? "是" : "否";
+                //是否占用额度
+                int AuthFlag = int.Parse(function.CheckInt(dic["AuthFlag"].ToString()));
+                if (AuthFlag == 0) dic["PayMode"] = "否";
+                if (AuthFlag == 1) dic["PayMode"] = "是";
 
             }
             return Json(obj);
@@ -439,12 +457,12 @@ namespace MySystem.Areas.Admin.Controllers
             //收货人创客编号
             if (!string.IsNullOrEmpty(ToUserIdMakerCode))
             {
-                condition += " and ToUserId in (select ToUserId from UsersForMakerCode where MakerCode='" + ToUserIdMakerCode + "')";
+                condition += " and ToUserId in (select ToUserId from UserForMakerCode where MakerCode='" + ToUserIdMakerCode + "')";
             }
             //收货人真实姓名
             if (!string.IsNullOrEmpty(ToUserIdRealName))
             {
-                condition += " and ToUserId in (select ToUserId from UsersForRealName where RealName='" + ToUserIdRealName + "')";
+                condition += " and ToUserId in (select ToUserId from UserForRealName where RealName='" + ToUserIdRealName + "')";
             }
             //收货仓库编号
             if (!string.IsNullOrEmpty(ToStoreIdStoreNo))
@@ -469,12 +487,12 @@ namespace MySystem.Areas.Admin.Controllers
             //出货创客编号
             if (!string.IsNullOrEmpty(FromUserIdMakerCode))
             {
-                condition += " and FromUserId in (select FromUserId from UsersForMakerCode where MakerCode='" + FromUserIdMakerCode + "')";
+                condition += " and FromUserId in (select FromUserId from UserForMakerCode where MakerCode='" + FromUserIdMakerCode + "')";
             }
             //出货创客真实姓名
             if (!string.IsNullOrEmpty(FromUserIdRealName))
             {
-                condition += " and FromUserId in (select FromUserId from UsersForRealName where RealName='" + FromUserIdRealName + "')";
+                condition += " and FromUserId in (select FromUserId from UserForRealName where RealName='" + FromUserIdRealName + "')";
             }
             //出货仓库编号
             if (!string.IsNullOrEmpty(FromStoreIdStoreNo))
@@ -569,5 +587,179 @@ namespace MySystem.Areas.Admin.Controllers
 
         #endregion
 
+
+        #region 预发货库存明细列表(占额度超过30天未兑换)
+
+        /// <summary>
+        /// 根据条件查询预发货库存明细列表(占额度超过30天未兑换)
+        /// </summary>
+        /// <returns></returns>
+        public IActionResult Indexs(PreSendStockDetail data, string right, string StoreId)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+            ViewBag.StoreId = StoreId;
+
+
+            return View();
+        }
+
+        #endregion
+
+        #region 根据条件查询预发货库存明细列表(占额度超过30天未兑换)
+
+        /// <summary>
+        /// 根据条件查询预发货库存明细列表(占额度超过30天未兑换)
+        /// </summary>
+        /// <returns></returns>
+        public JsonResult IndexsData(PreSendStockDetail data, string StoreIdStoreName, string StoreIdStoreNo, string CreateDateData, string ApplyDateData, string BrandIdSelect, string ToUserIdMakerCode, string ToUserIdRealName, string ToStoreIdStoreNo, string ToStoreIdStoreName, string SourceStoreIdStoreNo, string SourceStoreIdStoreName, string FromUserIdMakerCode, string FromUserIdRealName, string FromStoreIdStoreNo, string FromStoreIdStoreName, int page = 1, int limit = 30)
+        {
+
+            Dictionary<string, string> Fields = new Dictionary<string, string>();
+            Fields.Add("StoreId", "1");
+
+            // Fields.Add("CreateDate", "3"); //时间
+            Fields.Add("SnNo", "1"); //SN编号
+            // Fields.Add("ApplyDate", "3"); //申请时间
+
+
+            // string condition = " and Status>-1 and DATE_SUB(CURDATE(), INTERVAL 30 DAY) >= date(CreateDate) and ApplyFlag =0 and AuthFlag =1";
+            string condition = " and Status=1 and DATE_SUB(CURDATE(), INTERVAL 30 DAY) >= date(CreateDate) and ApplyFlag =0";
+            //仓库名称
+            if (!string.IsNullOrEmpty(StoreIdStoreName))
+            {
+                condition += " and StoreId in (select StoreId from StoreForName where Name='" + StoreIdStoreName + "')";
+            }
+            //仓库编号
+            if (!string.IsNullOrEmpty(StoreIdStoreNo))
+            {
+                condition += " and StoreId in (select StoreId from StoreForCode where Code='" + StoreIdStoreNo + "')";
+            }
+            if (!string.IsNullOrEmpty(CreateDateData))
+            {
+                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
+            }
+            if (!string.IsNullOrEmpty(ApplyDateData))
+            {
+                string[] datelist = ApplyDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                condition += " and ApplyDate>='" + start + " 00:00:00' and ApplyDate<='" + end + " 23:59:59'";
+            }
+            //产品类型
+            if (!string.IsNullOrEmpty(BrandIdSelect))
+            {
+                condition += " and BrandId=" + BrandIdSelect;
+            }
+            //收货人创客编号
+            if (!string.IsNullOrEmpty(ToUserIdMakerCode))
+            {
+                condition += " and ToUserId in (select UserId from UserForMakerCode where MakerCode='" + ToUserIdMakerCode + "')";
+            }
+            //收货人真实姓名
+            if (!string.IsNullOrEmpty(ToUserIdRealName))
+            {
+                condition += " and ToUserId in (select UserId from UserForRealName where RealName='" + ToUserIdRealName + "')";
+            }
+            //收货仓库编号
+            if (!string.IsNullOrEmpty(ToStoreIdStoreNo))
+            {
+                condition += " and ToStoreId in (select StoreId from StoreForCode where Code='" + ToStoreIdStoreNo + "')";
+            }
+            //收货仓库名称
+            if (!string.IsNullOrEmpty(ToStoreIdStoreName))
+            {
+                condition += " and ToStoreId in (select StoreId from StoreForName where Name='" + ToStoreIdStoreName + "')";
+            }
+            //源仓库编号仓库编号
+            if (!string.IsNullOrEmpty(SourceStoreIdStoreNo))
+            {
+                condition += " and SourceStoreId in (select StoreId from StoreForCode where Code='" + SourceStoreIdStoreNo + "')";
+            }
+            //源仓库编号仓库名称
+            if (!string.IsNullOrEmpty(SourceStoreIdStoreName))
+            {
+                condition += " and SourceStoreId in (select StoreId from StoreForName where Name=='" + SourceStoreIdStoreName + "')";
+            }
+            //出货创客编号
+            if (!string.IsNullOrEmpty(FromUserIdMakerCode))
+            {
+                condition += " and FromUserId in (select UserId from UserForMakerCode where MakerCode='" + FromUserIdMakerCode + "')";
+            }
+            //出货创客真实姓名
+            if (!string.IsNullOrEmpty(FromUserIdRealName))
+            {
+                condition += " and FromUserId in (select UserId from UserForRealName where RealName='" + FromUserIdRealName + "')";
+            }
+            //出货仓库编号
+            if (!string.IsNullOrEmpty(FromStoreIdStoreNo))
+            {
+                condition += " and FromStoreId in (select StoreId from StoreForCode where Code='" + FromStoreIdStoreNo + "')";
+            }
+            //出货仓库名称
+            if (!string.IsNullOrEmpty(FromStoreIdStoreName))
+            {
+                condition += " and FromStoreId in (select StoreId from StoreForName where Name='" + FromStoreIdStoreName + "')";
+            }
+
+
+            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("PreSendStockDetail", Fields, "Id desc", "0", page, limit, condition);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            foreach (Dictionary<string, object> dic in diclist)
+            {
+                //仓库
+                int StoreId = int.Parse(function.CheckInt(dic["StoreId"].ToString()));
+                SmallStoreHouse storeid_SmallStoreHouse = db.SmallStoreHouse.FirstOrDefault(m => m.Id == StoreId) ?? new SmallStoreHouse();
+                dic["StoreIdStoreName"] = storeid_SmallStoreHouse.StoreName;
+                dic["StoreIdStoreNo"] = storeid_SmallStoreHouse.StoreNo;
+                dic.Remove("StoreId");
+                //产品类型
+                dic["BrandId"] = RelationClass.GetKqProductBrandInfo(int.Parse(dic["BrandId"].ToString()));
+                //收货人
+                int ToUserId = int.Parse(function.CheckInt(dic["ToUserId"].ToString()));
+                Users touserid_Users = db.Users.FirstOrDefault(m => m.Id == ToUserId) ?? new Users();
+                dic["ToUserIdMakerCode"] = touserid_Users.MakerCode;
+                dic["ToUserIdRealName"] = touserid_Users.RealName;
+                dic.Remove("ToUserId");
+                //收货仓库
+                int ToStoreId = int.Parse(function.CheckInt(dic["ToStoreId"].ToString()));
+                StoreHouse tostoreid_StoreHouse = db.StoreHouse.FirstOrDefault(m => m.Id == ToStoreId) ?? new StoreHouse();
+                dic["ToStoreIdStoreNo"] = tostoreid_StoreHouse.StoreNo;
+                dic["ToStoreIdStoreName"] = tostoreid_StoreHouse.StoreName;
+                dic.Remove("ToStoreId");
+                //源仓库编号
+                int SourceStoreId = int.Parse(function.CheckInt(dic["SourceStoreId"].ToString()));
+                StoreHouse sourcestoreid_StoreHouse = db.StoreHouse.FirstOrDefault(m => m.Id == SourceStoreId) ?? new StoreHouse();
+                dic["SourceStoreIdStoreNo"] = sourcestoreid_StoreHouse.StoreNo;
+                dic["SourceStoreIdStoreName"] = sourcestoreid_StoreHouse.StoreName;
+                dic.Remove("SourceStoreId");
+                dic["ApplyFlagName"] = dic["ApplyFlag"].ToString() == "1" ? "是" : "否";
+                //出货创客
+                int FromUserId = int.Parse(function.CheckInt(dic["FromUserId"].ToString()));
+                Users fromuserid_Users = db.Users.FirstOrDefault(m => m.Id == FromUserId) ?? new Users();
+                dic["FromUserIdMakerCode"] = fromuserid_Users.MakerCode;
+                dic["FromUserIdRealName"] = fromuserid_Users.RealName;
+                dic.Remove("FromUserId");
+                //出货仓库
+                int FromStoreId = int.Parse(function.CheckInt(dic["FromStoreId"].ToString()));
+                StoreHouse fromstoreid_StoreHouse = db.StoreHouse.FirstOrDefault(m => m.Id == FromStoreId) ?? new StoreHouse();
+                dic["FromStoreIdStoreNo"] = fromstoreid_StoreHouse.StoreNo;
+                dic["FromStoreIdStoreName"] = fromstoreid_StoreHouse.StoreName;
+                dic.Remove("FromStoreId");
+                dic["CancelFlagName"] = dic["CancelFlag"].ToString() == "1" ? "是" : "否";
+                //是否占用额度
+                int AuthFlag = int.Parse(function.CheckInt(dic["AuthFlag"].ToString()));
+                if (AuthFlag == 0) dic["PayMode"] = "否";
+                if (AuthFlag == 1) dic["PayMode"] = "是";
+
+            }
+            return Json(obj);
+        }
+
+        #endregion
+
     }
 }

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

@@ -64,7 +64,7 @@ namespace MySystem.Areas.Admin.Controllers
         /// 分润奖励记录列表
         /// </summary>
         /// <returns></returns>
-        public JsonResult IndexData(ProfitRewardRecord data, string right, string BrandId, string MakerCode, string RealName, string ProfitTypeSelect, string CheckStatusSelect, string CreateDateData, int page = 1, int limit = 30)
+        public JsonResult IndexData(ProfitRewardRecord data, string BrandId, string MakerCode, string RealName, string ProfitTypeSelect, string CheckStatusSelect, string CreateDateData, int page = 1, int limit = 30)
         {
 
             Dictionary<string, string> Fields = new Dictionary<string, string>();
@@ -121,7 +121,7 @@ namespace MySystem.Areas.Admin.Controllers
             }
             else
             {
-                var start = DateTime.Now.AddMonths(-1).ToString("yyyyMMdd");
+                var start = DateTime.Now.AddMonths(-1).ToString("yyyyMM") + "01";
                 var check = db.ProfitRewardRecord.Any(m => Convert.ToInt32(m.SeoTitle) >= Convert.ToInt32(start) && m.BrandId == Convert.ToInt32(BrandId));
                 if (check)
                 {
@@ -553,7 +553,7 @@ namespace MySystem.Areas.Admin.Controllers
                 function.WritePage("/Balance/" + BrandId + "/", date + OpTypeString + ".txt", DateTime.Now.ToString());
                 // DoTradeProfit(BrandId, date, OpType);
                 // DoSubsidyProfit(BrandId, date, OpType);
-                RedisDbconn.Instance.AddList("SycnProfitQueue2", BrandId + "#cut#" + date + "#cut#" + OpType + "#cut#" + SysUserName);
+                RedisDbconn.Instance.AddList("SycnProfitQueue3", BrandId + "#cut#" + date + "#cut#" + OpType + "#cut#" + SysUserName);
                 return "success";
             }
             return date + "分润已同步,请勿重复操作";

+ 4 - 4
Areas/Admin/Controllers/MainServer/SchoolSignInRecordController.cs

@@ -63,12 +63,12 @@ namespace MySystem.Areas.Admin.Controllers
             //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
             {
-                condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
             }
             //创客真实姓名
             if (!string.IsNullOrEmpty(UserIdRealName))
             {
-                condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+                condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
             }
 
 
@@ -301,12 +301,12 @@ namespace MySystem.Areas.Admin.Controllers
             //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
             {
-                condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
             }
             //创客真实姓名
             if (!string.IsNullOrEmpty(UserIdRealName))
             {
-                condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+                condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
             }
 
 

+ 4 - 4
Areas/Admin/Controllers/MainServer/SchoolSignInTaskRecordController.cs

@@ -63,12 +63,12 @@ namespace MySystem.Areas.Admin.Controllers
             //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
             {
-                condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
             }
             //创客真实姓名
             if (!string.IsNullOrEmpty(UserIdRealName))
             {
-                condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+                condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
             }
             //任务
             if (!string.IsNullOrEmpty(TaskIdSelect))
@@ -310,12 +310,12 @@ namespace MySystem.Areas.Admin.Controllers
             //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
             {
-                condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
             }
             //创客真实姓名
             if (!string.IsNullOrEmpty(UserIdRealName))
             {
-                condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+                condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
             }
             //任务
             if (!string.IsNullOrEmpty(TaskIdSelect))

+ 330 - 16
Areas/Admin/Controllers/MainServer/StoreHouseAmountRecordController.cs

@@ -51,24 +51,28 @@ namespace MySystem.Areas.Admin.Controllers
         /// 分仓机具额度记录列表
         /// </summary>
         /// <returns></returns>
-        public JsonResult IndexData(StoreHouseAmountRecord data, string UserIdRealName, string UserIdMakerCode, string AmountTypeSelect, string OperateTypeSelect, string ChangeTypeSelect, int page = 1, int limit = 30)
+        public JsonResult IndexData(StoreHouseAmountRecord data, string UserIdRealName, string UserIdMakerCode, string CreateDateData, string AmountTypeSelect, string OperateTypeSelect, string ChangeTypeSelect, string PayModeSelect, int page = 1, int limit = 30)
         {
 
             Dictionary<string, string> Fields = new Dictionary<string, string>();
 
-            Fields.Add("CreateDate", "3"); //时间
-
-
-            string condition = " and Status>-1";
+            string condition = " and Status>=-1";
             //创客真实姓名
             if (!string.IsNullOrEmpty(UserIdRealName))
             {
-                condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+                condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
             }
             //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
             {
-                condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+            }
+            if (!string.IsNullOrEmpty(CreateDateData))
+            {
+                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
             }
             //额度类别
             if (!string.IsNullOrEmpty(AmountTypeSelect))
@@ -85,6 +89,11 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 condition += " and OperateType=" + OperateTypeSelect;
             }
+            //额度类别
+            if (!string.IsNullOrEmpty(PayModeSelect))
+            {
+                condition += " and PayMode=" + PayModeSelect;
+            }
 
 
             Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("StoreHouseAmountRecord", Fields, "Id desc", "0", page, limit, condition);
@@ -115,6 +124,11 @@ namespace MySystem.Areas.Admin.Controllers
                 if (OperateType == 1) dic["OperateType"] = "增加";
                 if (OperateType == 2) dic["OperateType"] = "减少";
                 if (OperateType == 0) dic["OperateType"] = "";
+                //额度类别
+                int PayMode = int.Parse(dic["PayMode"].ToString());
+                if (PayMode == 1) dic["PayMode"] = "支付宝";
+                if (PayMode == 3) dic["PayMode"] = "余额";
+                if (PayMode == 0) dic["PayMode"] = "";
 
             }
             return Json(obj);
@@ -155,7 +169,7 @@ namespace MySystem.Areas.Admin.Controllers
             Fields.Add("SeoTitle", data.SeoTitle);
             Fields.Add("SeoKeyword", data.SeoKeyword);
             Fields.Add("SeoDescription", data.SeoDescription);
-            int Id = new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).Add("StoreHouseAmountRecord", Fields, 0);
+            int Id = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Add("StoreHouseAmountRecord", Fields, 0);
             AddSysLog(data.Id.ToString(), "StoreHouseAmountRecord", "add");
             db.SaveChanges();
 
@@ -199,7 +213,7 @@ namespace MySystem.Areas.Admin.Controllers
             Fields.Add("SeoTitle", data.SeoTitle);
             Fields.Add("SeoKeyword", data.SeoKeyword);
             Fields.Add("SeoDescription", data.SeoDescription);
-            new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).Edit("StoreHouseAmountRecord", Fields, data.Id);
+            new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("StoreHouseAmountRecord", Fields, data.Id);
             AddSysLog(data.Id.ToString(), "StoreHouseAmountRecord", "update");
             db.SaveChanges();
 
@@ -223,7 +237,7 @@ namespace MySystem.Areas.Admin.Controllers
                 int id = int.Parse(subid);
                 Dictionary<string, object> Fields = new Dictionary<string, object>();
                 Fields.Add("Status", -1);
-                new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).Edit("StoreHouseAmountRecord", Fields, id);
+                new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("StoreHouseAmountRecord", Fields, id);
             }
             db.SaveChanges();
 
@@ -247,7 +261,7 @@ namespace MySystem.Areas.Admin.Controllers
                 int id = int.Parse(subid);
                 Dictionary<string, object> Fields = new Dictionary<string, object>();
                 Fields.Add("Status", 1);
-                new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).Edit("StoreHouseAmountRecord", Fields, id);
+                new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("StoreHouseAmountRecord", Fields, id);
             }
             db.SaveChanges();
             return "success";
@@ -270,7 +284,7 @@ namespace MySystem.Areas.Admin.Controllers
                 int id = int.Parse(subid);
                 Dictionary<string, object> Fields = new Dictionary<string, object>();
                 Fields.Add("Status", 0);
-                new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).Edit("StoreHouseAmountRecord", Fields, id);
+                new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("StoreHouseAmountRecord", Fields, id);
             }
             db.SaveChanges();
             return "success";
@@ -285,7 +299,7 @@ namespace MySystem.Areas.Admin.Controllers
         /// <param name="Id"></param>
         public string Sort(int Id, int Sort)
         {
-            new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).Sort("StoreHouseAmountRecord", Sort, Id);
+            new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Sort("StoreHouseAmountRecord", Sort, Id);
 
             AddSysLog(Id.ToString(), "StoreHouseAmountRecord", "sort");
             return "success";
@@ -334,12 +348,12 @@ namespace MySystem.Areas.Admin.Controllers
             //创客真实姓名
             if (!string.IsNullOrEmpty(UserIdRealName))
             {
-                condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+                condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
             }
             //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
             {
-                condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
             }
             //额度类别
             if (!string.IsNullOrEmpty(AmountTypeSelect))
@@ -353,7 +367,7 @@ namespace MySystem.Areas.Admin.Controllers
             }
 
 
-            Dictionary<string, object> obj = new AdminContent(_accessor.HttpContext, PublicFunction.MainTables).IndexData("StoreHouseAmountRecord", Fields, "Id desc", "0", 1, 20000, condition, "UserId,ApplyId,UseAmount,BeforeAmount,AfterAmount,AmountType,OperateType", false);
+            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("StoreHouseAmountRecord", Fields, "Id desc", "0", 1, 20000, condition, "UserId,ApplyId,UseAmount,BeforeAmount,AfterAmount,AmountType,OperateType", false);
             List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
             foreach (Dictionary<string, object> dic in diclist)
             {
@@ -398,5 +412,305 @@ namespace MySystem.Areas.Admin.Controllers
 
         #endregion
 
+
+        #region 银行卡临额提现记录列表
+
+        /// <summary>
+        /// 根据条件查询分仓机具额度记录列表
+        /// </summary>
+        /// <returns></returns>
+        public IActionResult Indexs(StoreHouseAmountRecord data, string right)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+
+            return View();
+        }
+
+        #endregion
+
+        #region 银行卡临额提现记录列表
+
+        /// <summary>
+        /// 分仓机具额度记录列表
+        /// </summary>
+        /// <returns></returns>
+        public JsonResult IndexsData(StoreHouseAmountRecord data, string UserIdRealName, string UserIdMakerCode, string CreateDateData, string AmountTypeSelect, string OperateTypeSelect, string ChangeTypeSelect, string PayModeSelect, string StatusSelect = "0", int page = 1, int limit = 30)
+        {
+
+            Dictionary<string, string> Fields = new Dictionary<string, string>();
+
+            string condition = " and Status>=-1 and PayMode=1 and Sort=3";
+            //创客真实姓名
+            if (!string.IsNullOrEmpty(UserIdRealName))
+            {
+                condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
+            }
+            //创客编号
+            if (!string.IsNullOrEmpty(UserIdMakerCode))
+            {
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+            }
+            if (!string.IsNullOrEmpty(CreateDateData))
+            {
+                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
+            }
+            //额度类别
+            if (!string.IsNullOrEmpty(AmountTypeSelect))
+            {
+                condition += " and AmountType=" + AmountTypeSelect;
+            }
+            //变动类别
+            if (!string.IsNullOrEmpty(ChangeTypeSelect))
+            {
+                condition += " and Sort=" + ChangeTypeSelect;
+            }
+            //操作类别
+            if (!string.IsNullOrEmpty(OperateTypeSelect))
+            {
+                condition += " and OperateType=" + OperateTypeSelect;
+            }
+            //额度类别
+            if (!string.IsNullOrEmpty(PayModeSelect))
+            {
+                condition += " and PayMode=" + PayModeSelect;
+            }
+            //状态
+            if (!string.IsNullOrEmpty(StatusSelect))
+            {
+                condition += " and Status=" + StatusSelect;
+            }
+
+
+            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("StoreHouseAmountRecord", Fields, "Id desc", "0", page, limit, condition);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            foreach (Dictionary<string, object> dic in diclist)
+            {
+                //创客
+                int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
+                Users userid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
+                dic["UserIdRealName"] = userid_Users.RealName;
+                dic["UserIdMakerCode"] = userid_Users.MakerCode;
+                dic["CertId"] = userid_Users.CertId;
+                dic["SettleBankCardNo"] = userid_Users.SettleBankCardNo;
+                dic["SettleBankName"] = userid_Users.SettleBankName;
+                dic["Mobile"] = userid_Users.Mobile;
+                dic["Type"] = "临额提现";
+                dic.Remove("UserId");
+                //申请单
+                dic["ApplyId"] = RelationClass.GetStoreMachineApplyInfo(int.Parse(dic["ApplyId"].ToString()));
+                //额度类别
+                int AmountType = int.Parse(dic["AmountType"].ToString());
+                if (AmountType == 0) dic["AmountType"] = "固定额度";
+                if (AmountType == 1) dic["AmountType"] = "临时额度";
+                //变动类别
+                int ChangeType = int.Parse(dic["Sort"].ToString());
+                if (ChangeType == 1) dic["ChangeType"] = "购买临时额度";
+                if (ChangeType == 2) dic["ChangeType"] = "增减分仓临时额度";
+                if (ChangeType == 3) dic["ChangeType"] = "调低额度返回余额";
+                if (ChangeType == 4) dic["ChangeType"] = "仓库发货|预发机申请";
+                if (ChangeType == 5) dic["ChangeType"] = "后台仓库调拨";
+                //操作类别
+                int OperateType = int.Parse(dic["OperateType"].ToString());
+                if (OperateType == 1) dic["OperateType"] = "增加";
+                if (OperateType == 2) dic["OperateType"] = "减少";
+                if (OperateType == 0) dic["OperateType"] = "";
+                //额度类别
+                int PayMode = int.Parse(dic["PayMode"].ToString());
+                if (PayMode == 1) dic["PayMode"] = "支付宝";
+                if (PayMode == 3) dic["PayMode"] = "余额";
+                if (PayMode == 0) dic["PayMode"] = "";
+                //状态
+                int Status = int.Parse(dic["Status"].ToString());
+                if (Status == 0) dic["Status"] = "待处理";
+                if (Status == 2) dic["Status"] = "处理中";
+                if (Status == 1) dic["Status"] = "成功";
+                if (Status == -1) dic["Status"] = "失败";
+                decimal UseAmount = Convert.ToDecimal(dic["UseAmount"].ToString());
+                dic["UseAmount"] = UseAmount / 2;
+            }
+            return Json(obj);
+        }
+
+        #endregion
+
+
+        #region 银行卡临额提现记录导出Excel
+
+        /// <summary>
+        /// 导出Excel
+        /// </summary>
+        /// <returns></returns>
+        public JsonResult ExportsExcel(StoreHouseAmountRecord data, string UserIdRealName, string UserIdMakerCode, string CreateDateData, string StatusSelect)
+        {
+            Dictionary<string, string> Fields = new Dictionary<string, string>();
+            // Fields.Add("CreateDate", "3"); //时间
+
+
+            string condition = " and PayMode=1 and Sort=3";
+            //创客真实姓名
+            if (!string.IsNullOrEmpty(UserIdRealName))
+            {
+                condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
+            }
+            //创客编号
+            if (!string.IsNullOrEmpty(UserIdMakerCode))
+            {
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+            }
+            if (!string.IsNullOrEmpty(CreateDateData))
+            {
+                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
+            }
+            //状态
+            if (!string.IsNullOrEmpty(StatusSelect))
+            {
+                condition += " and Status=" + StatusSelect;
+            }
+
+            var Ids = "";
+            Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("StoreHouseAmountRecord", Fields, "Id desc", "0", 1, 20000, condition, "Id,UserId,UseAmount", false);
+            List<Dictionary<string, object>> diclist = obj["data"] as List<Dictionary<string, object>>;
+            foreach (Dictionary<string, object> dic in diclist)
+            {
+                //创客
+                int UserId = int.Parse(function.CheckInt(dic["UserId"].ToString()));
+                Users userid_Users = db.Users.FirstOrDefault(m => m.Id == UserId) ?? new Users();
+                dic["UserIdRealName"] = userid_Users.RealName;
+                dic["UserIdMakerCode"] = userid_Users.MakerCode;
+                decimal UseAmount = Convert.ToDecimal(dic["UseAmount"].ToString());
+                dic["UseAmount"] = UseAmount / 2;
+                dic["CertId"] = userid_Users.CertId;
+                dic["SettleBankCardNo"] = userid_Users.SettleBankCardNo;
+                dic["SettleBankName"] = userid_Users.SettleBankName;
+                dic["Mobile"] = userid_Users.Mobile;
+                dic["Type"] = "临额提现";
+                dic["IsOk"] = "";
+                dic.Remove("UserId");
+
+                //记录Id
+                int Id = int.Parse(function.CheckInt(dic["Id"].ToString()));
+                dic["Id"] = Id;
+                Ids += Id + ",";
+            }
+            Ids = Ids.TrimEnd(',');
+
+            Dictionary<string, object> result = new Dictionary<string, object>();
+            result.Add("Status", "1");
+            result.Add("Info", "Excel报表-" + DateTime.Now.ToString("yyyy-MM-ddTHH:mm:ss") + ".xlsx");
+            result.Add("Obj", diclist);
+            Dictionary<string, object> ReturnFields = new Dictionary<string, object>();
+            ReturnFields.Add("Id", "记录ID");
+            ReturnFields.Add("UserIdRealName", "创客真实姓名");
+            ReturnFields.Add("UserIdMakerCode", "创客编号");
+            ReturnFields.Add("UseAmount", "申请提现临额");
+            ReturnFields.Add("CertId", "身份证号");
+            ReturnFields.Add("SettleBankCardNo", "银行卡号");
+            ReturnFields.Add("SettleBankName", "银行名称");
+            ReturnFields.Add("Mobile", "手机号");
+            ReturnFields.Add("Type", "交易类型");
+            ReturnFields.Add("IsOk", "是否成功(是、否)");
+
+            result.Add("Fields", ReturnFields);
+            OtherMySqlConn.op("UPDATE StoreHouseAmountRecord SET `Status`=2 WHERE Id IN(" + Ids + ") AND `Status`=0");
+            AddSysLog("0", "StoreHouseAmountRecord", "ExportExcel");
+            return Json(result);
+        }
+
+        #endregion
+
+
+        #region 
+
+        /// <summary>
+        /// 开启
+        /// </summary>
+        /// <returns></returns>
+        public string BatchSetting(string Id)
+        {
+            string[] idlist = Id.Split(new char[] { ',' });
+            AddSysLog(Id, "StoreHouseCardAmountRecord", "BatchSetting");
+            foreach (string subid in idlist)
+            {
+                int id = int.Parse(subid);
+                Dictionary<string, object> Fields = new Dictionary<string, object>();
+                Fields.Add("Status", -1);
+                new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("StoreHouseAmountRecord", Fields, id);
+            }
+            db.SaveChanges();
+            return "success";
+        }
+
+        #endregion
+
+
+        #region 银行卡临额提现记录结果导入Excel
+        /// <summary>
+        /// 银行卡临额提现记录结果导入Excel
+        /// </summary>
+        /// <param name="ExcelData"></param>
+        public string Imports(string ExcelData)
+        {
+            ExcelData = HttpUtility.UrlDecode(ExcelData);
+            JsonData list = JsonMapper.ToObject(ExcelData);
+            string error = "";
+            List<int> IdList = new List<int>();
+            List<int> IdLists = new List<int>();
+            for (int i = 1; i < list.Count; i++)
+            {
+                JsonData dr = list[i];
+                string itemJson = dr.ToJson();
+                string Id = itemJson.Contains("\"A\"") ? dr["A"].ToString() : "";
+                string IsOk = itemJson.Contains("\"J\"") ? dr["J"].ToString() : "";
+                if (IdList.Contains(Convert.ToInt32(Id)))
+                {
+                    error += "以下操作失败" + Id + ',' + "该记录重复" + '\n';
+                }
+                else if (IsOk == "否")
+                {
+                    IdLists.Add(Convert.ToInt32(Id));
+                }
+                else
+                {
+                    IdList.Add(Convert.ToInt32(Id));
+                }
+            }
+            if (!string.IsNullOrEmpty(error))
+            {
+                return "Warning|" + error;
+            }
+            else
+            {
+                var Info = db.StoreHouseAmountRecord.Where(m => IdList.Contains(m.Id)).ToList();//成功
+                var Infos = db.StoreHouseAmountRecord.Where(m => IdLists.Contains(m.Id)).ToList();//失败
+                foreach (var item in Info)
+                {
+                    item.Status = 1;//设置为成功
+                    db.SaveChanges();
+                }
+                foreach (var items in Infos)
+                {
+                    items.Status = -1;//设置为失败
+                    var userAccount = db.UserAccount.FirstOrDefault(m => m.Id == items.UserId) ?? new UserAccount();
+                    if (userAccount.Id > 0)
+                    {
+                        userAccount.TempAmount += items.UseAmount;//退还卡充值临额
+                        userAccount.ValidAmount += items.UseAmount;//退还可用额度
+                    }
+                    db.SaveChanges();
+                }
+            }
+            AddSysLog("0", "StoreHouseCardAmountRecord", "Import");
+            return "success";
+        }
+        #endregion
+
     }
 }

+ 29 - 23
Areas/Admin/Controllers/MainServer/StoreHouseController.cs

@@ -77,22 +77,23 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 DataTable dt = OtherMySqlConn.dtable("SELECT Id FROM Users WHERE RealName like '%" + UserIdRealName + "%'");
                 var Count = dt.Rows.Count;
-                int times = 0;
+                // int times = 0;
                 string UserIds = "";
                 foreach (DataRow item in dt.Rows)
                 {
-                    times++;
-                    if (times == Count)
-                    {
-                        UserIds += item["Id"].ToString();
-                    }
-                    else
-                    {
-                        UserIds += item["Id"].ToString() + ",";
-                    }
+                    // times++;
+                    // if (times == Count)
+                    // {
+                    //     UserIds += item["Id"].ToString();
+                    // }
+                    // else
+                    // {
+                    //     UserIds += item["Id"].ToString() + ",";
+                    // }
+                    UserIds += item["Id"].ToString() + ",";
                 }
                 // condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
-                condition += " and UserId in (" + UserIds + ")";
+                condition += " and UserId in (" + UserIds.TrimEnd(',') + ")";
             }
             //仓库管理员真实姓名
 
@@ -100,22 +101,23 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 DataTable dts = OtherMySqlConn.dtable("SELECT Id FROM Users WHERE RealName like '%" + ManageUserIdRealName + "%'");
                 var Counts = dts.Rows.Count;
-                int time = 1;
+                // int time = 1;
                 string UserIdss = "";
                 foreach (DataRow items in dts.Rows)
                 {
-                    time++;
-                    if (time == Counts)
-                    {
-                        UserIdss += items["Id"].ToString();
-                    }
-                    else
-                    {
-                        UserIdss += items["Id"].ToString() + ",";
-                    }
+                    // time++;
+                    // if (time == Counts)
+                    // {
+                    //     UserIdss += items["Id"].ToString();
+                    // }
+                    // else
+                    // {
+                    //     UserIdss += items["Id"].ToString() + ",";
+                    // }
+                    UserIdss += items["Id"].ToString() + ",";
                 }
                 // condition += " and ManageUserId in (select ManageUserId from UserForRealName where RealName='" + ManageUserIdRealName + "')";
-                condition += " and UserId in (" + UserIdss + ")";
+                condition += " and UserId in (" + UserIdss.TrimEnd(',') + ")";
             }
             //仓库管理员手机号
             if (!string.IsNullOrEmpty(ManageUserIdMobile))
@@ -178,9 +180,11 @@ namespace MySystem.Areas.Admin.Controllers
                 var amount = db.UserAccount.FirstOrDefault(m => m.Id == UserId) ?? new UserAccount();
                 var ValidAmount = amount.ValidAmount;
                 var FixedAmount = amount.FixedAmount;
-                var TempAmount = amount.TempAmount;
+                var TempAmount = amount.TempAmount + amount.TempAmountForBalance;
                 var check = db.StoreHouseAmountPromiss.Any(m => m.ToUserId == UserId);
                 decimal PromissAmount = 0;
+                var ThisMonthPreAmount = amount.ThisMonthPreAmount;
+                var ValidPreAmount = amount.ValidPreAmount;
                 if (check)
                 {
                     PromissAmount = db.StoreHouseAmountPromiss.Where(m => m.Status == 1 && m.ToUserId == UserId).Sum(m => m.PromissAmount);
@@ -189,6 +193,8 @@ namespace MySystem.Areas.Admin.Controllers
                 dic["FixedAmount"] = FixedAmount.ToString();//固定额度
                 dic["TempAmount"] = TempAmount.ToString();//临时额度
                 dic["PromissAmount"] = PromissAmount.ToString();//担保金额
+                dic["ThisMonthPreAmount"] = PromissAmount.ToString();//本月小分仓额度
+                dic["ValidPreAmount"] = PromissAmount.ToString();//可用小分仓额度
             }
             return Json(obj);
         }

+ 4 - 4
Areas/Admin/Controllers/MainServer/StoreMachineApplyController.cs

@@ -71,12 +71,12 @@ namespace MySystem.Areas.Admin.Controllers
             //创客真实姓名
             if (!string.IsNullOrEmpty(UserIdRealName))
             {
-                condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+                condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
             }
             //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
             {
-                condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
             }
 
             if (!string.IsNullOrEmpty(StatusSelect))
@@ -376,12 +376,12 @@ namespace MySystem.Areas.Admin.Controllers
             //创客真实姓名
             if (!string.IsNullOrEmpty(UserIdRealName))
             {
-                condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+                condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
             }
             //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
             {
-                condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
             }
 
 

+ 75 - 33
Areas/Admin/Controllers/MainServer/SysToolsController.cs

@@ -355,6 +355,41 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 pos.BindMerchantId = merchant.Id;
             }
+            // var makerCode = db.UserForMakerCode.FirstOrDefault(m => m.MakerCode == MakerCode) ?? new UserForMakerCode();
+            // var prePos = db.PreSendStockDetail.FirstOrDefault(m => m.ToUserId == makerCode.UserId && m.SnId == pos.Id && m.CreateDate < DateTime.Now.AddDays(-30) && m.AuthFlag == 1 && m.ApplyFlag == 0) ?? new PreSendStockDetail();
+            // if (makerCode.UserId > 0 && prePos.Id > 0)
+            // {
+            //     if (prePos.CreateDate <= DateTime.Now.AddDays(-30))
+            //     {
+            //         var brandInfo = db.KqProducts.FirstOrDefault(m => m.Id == prePos.BrandId);
+            //         var amount = 0;
+            //         if (brandInfo.Name.Contains("电签"))
+            //         {
+            //             amount = 200;
+            //         }
+            //         if (brandInfo.Name.Contains("大POS"))
+            //         {
+            //             amount = 300;
+            //         }
+            //         var userAccount = db.UserAccount.FirstOrDefault(m => m.Id == makerCode.UserId) ?? new UserAccount();
+            //         if (userAccount.Id > 0)
+            //         {
+            //             userAccount.SmallStoreDeposit -= amount;
+            //             var add = db.UserAccountRecord.Add(new UserAccountRecord()
+            //             {
+            //                 CreateDate = DateTime.Now,
+            //                 Remark = "小分仓押金退还",
+            //                 ChangeType = 65,
+            //                 BeforeBalanceAmount = userAccount.SmallStoreDeposit + amount, //变更前小分仓押金
+            //                 AfterBalanceAmount = userAccount.SmallStoreDeposit, //变更后小分仓押金
+            //                 ChangeAmount = amount,//变动金额
+            //                 UserId = userAccount.Id,
+
+            //             }).Entity;
+            //             db.SaveChanges();
+            //         }
+            //     }
+            // }
             db.SaveChanges();
             function.WriteLog(DateTime.Now.ToString() + "\n" + SysUserName + "\nMakerCode:" + MakerCode + ", PosSn:" + PosSn + ", MerNo:" + MerNo + ", AddActPrize:" + AddActPrize + ", IsPre:" + IsPre, "机具补录日志");
             return "success";
@@ -408,31 +443,31 @@ namespace MySystem.Areas.Admin.Controllers
                 int StartId = int.Parse(function.CheckInt(SpTradeRecordId));
                 if (pos.BrandId == 1)
                 {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId &&m.TradeSnNo == pos.PosSn && m.ProductType == "1" && m.SerEntryMode != "N" && m.MerNo.StartsWith("M700")).Sum(m => m.TradeAmount) / 100;
+                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "1" && m.SerEntryMode != "N" && m.MerNo.StartsWith("M700")).Sum(m => m.TradeAmount) / 100;
                 }
                 else if (pos.BrandId == 2)
                 {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId &&m.TradeSnNo == pos.PosSn && m.ProductType == "2").Sum(m => m.TradeAmount);
+                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "2").Sum(m => m.TradeAmount);
                 }
                 else if (pos.BrandId == 3)
                 {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId &&m.TradeSnNo == pos.PosSn && m.ProductType == "1" && m.SerEntryMode != "N" && m.MerNo.StartsWith("M900")).Sum(m => m.TradeAmount) / 100;
+                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "1" && m.SerEntryMode != "N" && m.MerNo.StartsWith("M900")).Sum(m => m.TradeAmount) / 100;
                 }
                 else if (pos.BrandId == 4 || pos.BrandId == 5)
                 {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId &&m.TradeSnNo == pos.PosSn && m.ProductType == "4").Sum(m => m.TradeAmount) / 100;
+                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "4").Sum(m => m.TradeAmount) / 100;
                 }
                 else if (pos.BrandId == 6)
                 {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId &&m.TradeSnNo == pos.PosSn && m.ProductType == "6").Sum(m => m.TradeAmount) / 100;
+                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "6").Sum(m => m.TradeAmount) / 100;
                 }
                 else if (pos.BrandId == 8)
                 {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId &&m.TradeSnNo == pos.PosSn && m.ProductType == "8").Sum(m => m.TradeAmount) / 100;
+                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "8").Sum(m => m.TradeAmount) / 100;
                 }
                 else if (pos.BrandId == 9)
                 {
-                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId &&m.TradeSnNo == pos.PosSn && m.ProductType == "9").Sum(m => m.TradeAmount) / 100;
+                    CreditTrade = spdb.TradeRecord.Where(m => m.Id > StartId && m.TradeSnNo == pos.PosSn && m.ProductType == "9").Sum(m => m.TradeAmount) / 100;
                 }
                 pos.CreditTrade = CreditTrade;
                 db.SaveChanges();
@@ -1065,7 +1100,7 @@ namespace MySystem.Areas.Admin.Controllers
                 Users user = db.Users.FirstOrDefault(m => m.Id == reward.UserId) ?? new Users();
                 DepositGet = "已领取";
                 DepositUser = "创客编号:" + user.MakerCode + ",姓名:" + user.RealName + ",手机号:" + user.Mobile;
-                var fAmount = db.ActiveReward.FirstOrDefault(m => m.KqSnNo == pos.PosSn && m.ActType == 0);                
+                var fAmount = db.ActiveReward.FirstOrDefault(m => m.KqSnNo == pos.PosSn && m.ActType == 0);
                 if (fAmount != null)
                 {
                     headAmount = fAmount.RewardAmount;
@@ -1614,7 +1649,6 @@ namespace MySystem.Areas.Admin.Controllers
                     storeFromUserAcount.ValidAmount += amount;
                     storeBackUserAcount.ValidAmount -= amount;
 
-
                     newpos.BuyUserId = oldpos.BuyUserId;
                     newpos.UserId = oldpos.UserId;
                     newpos.RecycEndDate = oldpos.RecycEndDate;
@@ -1632,6 +1666,7 @@ namespace MySystem.Areas.Admin.Controllers
                     newpos.SeoKeyword = oldpos.SeoKeyword;
                     newpos.PrizeParams = oldpos.PrizeParams;
                     newpos.LeaderUserId = oldpos.LeaderUserId;
+                    newpos.BindMerchantId = oldpos.BindMerchantId;
 
                     newpos.StoreId = oldpos.StoreId;
                     newpos.UserId = oldpos.UserId;
@@ -1641,6 +1676,13 @@ namespace MySystem.Areas.Admin.Controllers
                     oldpos.BuyUserId = 0;
                     oldpos.UserId = 0;
                     oldpos.Status = -1;
+
+                    PosMerchantInfo merchant = db.PosMerchantInfo.FirstOrDefault(m => m.Id == newpos.BindMerchantId);
+                    if(merchant != null)
+                    {
+                        merchant.KqSnNo = newpos.PosSn;
+                        merchant.ActiveStatus = newpos.ActivationState;
+                    }
                     db.SaveChanges();
 
                     BrokenMachineChange add = db.BrokenMachineChange.Add(new BrokenMachineChange()
@@ -2198,27 +2240,27 @@ namespace MySystem.Areas.Admin.Controllers
                     data["OrderNo"] = order.OrderNo;
                     data["MakerCode"] = user.MakerCode;
                     data["RealName"] = user.RealName;
-                    if(SnNoList.Length > i)
+                    if (SnNoList.Length > i)
                     {
                         string SourceSn = SnNoList[i].Split(':')[0];
                         data["ComeSn"] = SnNoList[i];
                         data["ComeSnParam"] = SourceSn;
                         MachineForSnNo machineFor = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == SourceSn) ?? new MachineForSnNo();
                         PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == machineFor.SnId) ?? new PosMachinesTwo();
-                        if(pos.LeaderUserId > 0)
+                        if (pos.LeaderUserId > 0)
                         {
                             Users leader = db.Users.FirstOrDefault(m => m.Id == pos.LeaderUserId) ?? new Users();
                             data["ComeSnMakerCode"] = leader.MakerCode;
                             data["ComeSnRealName"] = leader.RealName;
                         }
                     }
-                    if(OrderSnNo.Length > i)
+                    if (OrderSnNo.Length > i)
                     {
                         string SendSn = OrderSnNo[i];
                         data["SendSn"] = OrderSnNo[i];
                         MachineForSnNo machineFor = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == SendSn) ?? new MachineForSnNo();
                         PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == machineFor.SnId) ?? new PosMachinesTwo();
-                        if(pos.LeaderUserId > 0)
+                        if (pos.LeaderUserId > 0)
                         {
                             Users leader = db.Users.FirstOrDefault(m => m.Id == pos.LeaderUserId) ?? new Users();
                             data["SendSnMakerCode"] = leader.MakerCode;
@@ -2244,27 +2286,27 @@ namespace MySystem.Areas.Admin.Controllers
                     data["OrderNo"] = order.OrderNo;
                     data["MakerCode"] = user.MakerCode;
                     data["RealName"] = user.RealName;
-                    if(SnNoList.Length > i)
+                    if (SnNoList.Length > i)
                     {
                         string SourceSn = SnNoList[i].Split(':')[0];
                         data["ComeSn"] = SnNoList[i];
                         data["ComeSnParam"] = SourceSn;
                         MachineForSnNo machineFor = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == SourceSn) ?? new MachineForSnNo();
                         PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == machineFor.SnId) ?? new PosMachinesTwo();
-                        if(pos.LeaderUserId > 0)
+                        if (pos.LeaderUserId > 0)
                         {
                             Users leader = db.Users.FirstOrDefault(m => m.Id == pos.LeaderUserId) ?? new Users();
                             data["ComeSnMakerCode"] = leader.MakerCode;
                             data["ComeSnRealName"] = leader.RealName;
                         }
                     }
-                    if(OrderSnNo.Length > i)
+                    if (OrderSnNo.Length > i)
                     {
                         string SendSn = OrderSnNo[i];
                         data["SendSn"] = OrderSnNo[i];
                         MachineForSnNo machineFor = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == SendSn) ?? new MachineForSnNo();
                         PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == machineFor.SnId) ?? new PosMachinesTwo();
-                        if(pos.LeaderUserId > 0)
+                        if (pos.LeaderUserId > 0)
                         {
                             Users leader = db.Users.FirstOrDefault(m => m.Id == pos.LeaderUserId) ?? new Users();
                             data["SendSnMakerCode"] = leader.MakerCode;
@@ -2476,7 +2518,7 @@ namespace MySystem.Areas.Admin.Controllers
         {
             Dictionary<string, string> dic = new Dictionary<string, string>();
             string result = "";
-            PosMachinesTwo pos = db.PosMachinesTwo .FirstOrDefault(m => m.PosSn == PosSn);
+            PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == PosSn);
             if (pos == null)
             {
                 result += "机具SN号不存在\n";
@@ -2484,14 +2526,14 @@ namespace MySystem.Areas.Admin.Controllers
                 dic.Add("result", result);
                 return dic;
             }
-            if(pos.BindingState == 0)
+            if (pos.BindingState == 0)
             {
                 result += "机具未绑定\n";
                 dic.Add("code", "1");
                 dic.Add("result", result);
                 return dic;
             }
-            if(pos.ActivationState == 0)
+            if (pos.ActivationState == 0)
             {
                 result += "机具未激活\n";
                 dic.Add("code", "1");
@@ -2554,7 +2596,7 @@ namespace MySystem.Areas.Admin.Controllers
                 return "商户不存在";
             }
             bool check = db.OpenRewardDetail.Any(m => m.SnNo == pos.PosSn);
-            if(check)
+            if (check)
             {
                 return "开机奖励已发放,请勿重复操作";
             }
@@ -2705,15 +2747,15 @@ namespace MySystem.Areas.Admin.Controllers
                         }
                     }
                     string result = "";
-                    if(!PrizeFlag.Contains("20"))
+                    if (!PrizeFlag.Contains("20"))
                     {
                         result += "20元奖励未发,请检查上级是否满足条件\n";
                     }
-                    if(!PrizeFlag.Contains("10"))
+                    if (!PrizeFlag.Contains("10"))
                     {
                         result += "10元奖励未发,请检查上级是否满足条件\n";
                     }
-                    if(string.IsNullOrEmpty(result))
+                    if (string.IsNullOrEmpty(result))
                     {
                         return "发放成功";
                     }
@@ -2723,7 +2765,7 @@ namespace MySystem.Areas.Admin.Controllers
             db.Dispose();
             return "操作失败";
         }
-        
+
         #endregion
 
         #region 查询机具流量费分佣
@@ -2741,7 +2783,7 @@ namespace MySystem.Areas.Admin.Controllers
         {
             Dictionary<string, string> dic = new Dictionary<string, string>();
             string result = "";
-            PosMachinesTwo pos = db.PosMachinesTwo .FirstOrDefault(m => m.PosSn == PosSn);
+            PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == PosSn);
             if (pos == null)
             {
                 result += "机具SN号不存在\n";
@@ -2749,14 +2791,14 @@ namespace MySystem.Areas.Admin.Controllers
                 dic.Add("result", result);
                 return dic;
             }
-            if(pos.BindingState == 0)
+            if (pos.BindingState == 0)
             {
                 result += "机具未绑定\n";
                 dic.Add("code", "1");
                 dic.Add("result", result);
                 return dic;
             }
-            if(pos.ActivationState == 0)
+            if (pos.ActivationState == 0)
             {
                 result += "机具未激活\n";
                 dic.Add("code", "1");
@@ -2812,21 +2854,21 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 return "商户不存在";
             }
-            if(pos.BrandId == 6)
+            if (pos.BrandId == 6)
             {
                 return "立刷不支持流量费分佣";
             }
-            if(decimal.Parse(function.CheckNum(pos.SeoKeyword)) <= 0)
+            if (decimal.Parse(function.CheckNum(pos.SeoKeyword)) <= 0)
             {
                 return "无押金机,不支持流量费分佣";
             }
             bool check = db.FluxProfitDetail.Any(m => m.MerNo == merchant.KqMerNo);
-            if(check)
+            if (check)
             {
                 return "开机奖励已发放,请勿重复操作";
             }
             SpModels.TradeFluxRecord trade = spdb.TradeFluxRecord.FirstOrDefault(m => m.TradeSnNo == pos.PosSn);
-            if(trade != null)
+            if (trade != null)
             {
                 try
                 {
@@ -2971,7 +3013,7 @@ namespace MySystem.Areas.Admin.Controllers
             db.Dispose();
             return "操作失败";
         }
-        
+
         #endregion
 
         #region 设置立刷费率

+ 8 - 8
Areas/Admin/Controllers/MainServer/TeamApplyController.cs

@@ -74,12 +74,12 @@ namespace MySystem.Areas.Admin.Controllers
             //队长创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
             {
-                condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
             }
             //队长真实姓名
             if (!string.IsNullOrEmpty(UserIdRealName))
             {
-                condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+                condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
             }
             //审核结果
             if (!string.IsNullOrEmpty(AuditResultSelect))
@@ -94,12 +94,12 @@ namespace MySystem.Areas.Admin.Controllers
             //顶级创客编号
             if (!string.IsNullOrEmpty(TopUserIdMakerCode))
             {
-                condition += " and TopUserId in (select TopUserId from UsersForMakerCode where MakerCode='" + TopUserIdMakerCode + "')";
+                condition += " and TopUserId in (select TopUserId from UserForMakerCode where MakerCode='" + TopUserIdMakerCode + "')";
             }
             //顶级创客真实姓名
             if (!string.IsNullOrEmpty(TopUserIdRealName))
             {
-                condition += " and TopUserId in (select TopUserId from UsersForRealName where RealName='" + TopUserIdRealName + "')";
+                condition += " and TopUserId in (select TopUserId from UserForRealName where RealName='" + TopUserIdRealName + "')";
             }
             //组队状态
             if (!string.IsNullOrEmpty(TeamStatusSelect))
@@ -439,12 +439,12 @@ namespace MySystem.Areas.Admin.Controllers
             //队长创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
             {
-                condition += " and UserId in (select UserId from UsersForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+                condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
             }
             //队长真实姓名
             if (!string.IsNullOrEmpty(UserIdRealName))
             {
-                condition += " and UserId in (select UserId from UsersForRealName where RealName='" + UserIdRealName + "')";
+                condition += " and UserId in (select UserId from UserForRealName where RealName='" + UserIdRealName + "')";
             }
             //审核结果
             if (!string.IsNullOrEmpty(AuditResultSelect))
@@ -459,12 +459,12 @@ namespace MySystem.Areas.Admin.Controllers
             //顶级创客编号
             if (!string.IsNullOrEmpty(TopUserIdMakerCode))
             {
-                condition += " and TopUserId in (select TopUserId from UsersForMakerCode where MakerCode='" + TopUserIdMakerCode + "')";
+                condition += " and TopUserId in (select TopUserId from UserForMakerCode where MakerCode='" + TopUserIdMakerCode + "')";
             }
             //顶级创客真实姓名
             if (!string.IsNullOrEmpty(TopUserIdRealName))
             {
-                condition += " and TopUserId in (select TopUserId from UsersForRealName where RealName='" + TopUserIdRealName + "')";
+                condition += " and TopUserId in (select TopUserId from UserForRealName where RealName='" + TopUserIdRealName + "')";
             }
             //组队状态
             if (!string.IsNullOrEmpty(TeamStatusSelect))

+ 4 - 4
Areas/Admin/Controllers/MainServer/TeamDayTopController.cs

@@ -67,7 +67,7 @@ namespace MySystem.Areas.Admin.Controllers
             //顶级创客真实姓名
             if (!string.IsNullOrEmpty(TopUserIdRealName))
             {
-                condition += " and TopUserId in (select TopUserId from UsersForRealName where RealName='" + TopUserIdRealName + "')";
+                condition += " and TopUserId in (select TopUserId from UserForRealName where RealName='" + TopUserIdRealName + "')";
             }
             //队伍队伍编码
             if (!string.IsNullOrEmpty(TeamIdTeamNo))
@@ -87,7 +87,7 @@ namespace MySystem.Areas.Admin.Controllers
             //团队长创客真实姓名
             if (!string.IsNullOrEmpty(TeamUserIdRealName))
             {
-                condition += " and TeamUserId in (select TeamUserId from UsersForRealName where RealName='" + TeamUserIdRealName + "')";
+                condition += " and TeamUserId in (select TeamUserId from UserForRealName where RealName='" + TeamUserIdRealName + "')";
             }
 
 
@@ -335,7 +335,7 @@ namespace MySystem.Areas.Admin.Controllers
             //顶级创客真实姓名
             if (!string.IsNullOrEmpty(TopUserIdRealName))
             {
-                condition += " and TopUserId in (select TopUserId from UsersForRealName where RealName='" + TopUserIdRealName + "')";
+                condition += " and TopUserId in (select TopUserId from UserForRealName where RealName='" + TopUserIdRealName + "')";
             }
             //队伍队伍编码
             if (!string.IsNullOrEmpty(TeamIdTeamNo))
@@ -355,7 +355,7 @@ namespace MySystem.Areas.Admin.Controllers
             //团队长创客真实姓名
             if (!string.IsNullOrEmpty(TeamUserIdRealName))
             {
-                condition += " and TeamUserId in (select TeamUserId from UsersForRealName where RealName='" + TeamUserIdRealName + "')";
+                condition += " and TeamUserId in (select TeamUserId from UserForRealName where RealName='" + TeamUserIdRealName + "')";
             }
 
 

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

@@ -144,7 +144,7 @@ namespace MySystem.Areas.Admin.Controllers
             }
             else
             {
-                var start = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd"));
+                var start = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01");
                 var check = db.TradeRecord.Any(m => m.CreateDate >= start && m.BrandId == Convert.ToInt32(BrandId));
                 if (check)
                 {

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

@@ -108,7 +108,7 @@ namespace MySystem.Areas.Admin.Controllers
             }
             else
             {
-                var start = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd"));
+                var start = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01");
                 var check = db.UserAccountRecord.Any(m => m.CreateDate >= start);
                 if (check)
                 {

+ 27 - 2
Areas/Admin/Controllers/MainServer/UserCashRecordController.cs

@@ -123,7 +123,7 @@ namespace MySystem.Areas.Admin.Controllers
             }
             else
             {
-                var start = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd"));
+                var start = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01");
                 var check = db.UserCashRecord.Any(m => m.CreateDate >= start && m.TradeType < 3);
                 if (check)
                 {
@@ -349,6 +349,31 @@ namespace MySystem.Areas.Admin.Controllers
 
         #endregion
 
+
+        #region 批量设置成功
+
+        /// <summary>
+        /// 批量设置成功
+        /// </summary>
+        /// <returns></returns>
+        public string BatchSetting(string Id)
+        {
+            string[] idlist = Id.Split(new char[] { ',' });
+            AddSysLog(Id, "UserCashRecord", "BatchSetting");
+            foreach (string subid in idlist)
+            {
+                int id = int.Parse(subid);
+                Dictionary<string, object> Fields = new Dictionary<string, object>();
+                Fields.Add("Status", 1);//设置提现记录为成功
+                new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).Edit("UserCashRecord", Fields, id);
+
+            }
+            db.SaveChanges();
+            return "success";
+        }
+
+        #endregion
+
         #region 排序
         /// <summary>
         /// 排序
@@ -599,7 +624,7 @@ namespace MySystem.Areas.Admin.Controllers
                 // var end = Convert.ToDateTime(start).AddMonths(1);
                 // condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<'" + end + " 00:00:00'";
 
-                var start = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToString("yyyy-MM-dd"));
+                var start = Convert.ToDateTime(DateTime.Now.AddMonths(-1).ToString("yyyy-MM") + "-01");
                 var check = db.UserCashRecord.Any(m => m.CreateDate >= start && m.TradeType == 3);
                 if (check)
                 {

+ 6 - 3
Areas/Admin/Controllers/MainServer/UsersController.cs

@@ -68,10 +68,13 @@ namespace MySystem.Areas.Admin.Controllers
             Fields.Add("SettleAmount", "3"); //结算金额
             Fields.Add("CashFreezeAmt", "3"); //冻结金额
             Fields.Add("UserLevel", "0"); //创客等级
-            if (ShowFlag == 0)
+            if (SelfId == 0 && ParentId == 0)
             {
-                Dictionary<string, object> objs = new Dictionary<string, object>();
-                return Json(objs);
+                if (ShowFlag == 0)
+                {
+                    Dictionary<string, object> objs = new Dictionary<string, object>();
+                    return Json(objs);
+                }
             }
 
             string condition = " and Status>-1";

+ 15 - 0
Areas/Admin/Views/Home/Index.cshtml

@@ -224,6 +224,21 @@
                                 <dd data-name="grid">
                                     <a lay-href="/Admin/SysTools/CheckMachine2">机具补录</a>
                                 </dd>
+                                <dd data-name="grid">
+                                    <a href="javascript:;" title="每月表格">导出每月表格<span class="layui-nav-more"></span></a>
+                                    <dl class="layui-nav-child">
+                                        <dd data-name="list"><a lay-href="/Admin/ExportTable/Profit" title="分润">分润</a></dd>
+                                        <dd data-name="list"><a lay-href="/Admin/ExportTable/Subsidy" title="补贴">补贴</a></dd>
+                                        <dd data-name="list"><a lay-href="/Admin/ExportTable/Trade?min=3000000&max=10000000" title="交易额300万-1000万名单">交易额300万-1000万名单</a></dd>
+                                        <dd data-name="list"><a lay-href="/Admin/ExportTable/Trade?min=10000000&max=10000000000" title="交易额满1000万名单">交易额满1000万名单</a></dd>
+                                        <dd data-name="list"><a lay-href="/Admin/ExportTable/OpenMachine" title="开机排行">开机排行</a></dd>
+                                        <dd data-name="list"><a lay-href="/Admin/ExportTable/PullNew" title="有效拉新排行">有效拉新排行</a></dd>
+                                        <dd data-name="list"><a lay-href="/Admin/ExportTable/Recommend" title="666推荐王">666推荐王</a></dd>
+                                        <dd data-name="list"><a lay-href="/Admin/ExportTable/Double" title="888翻倍奖">888翻倍奖</a></dd>
+                                        <dd data-name="list"><a lay-href="/Admin/ExportTable/StoreHouse" title="分仓数据">分仓数据</a></dd>
+                                        <dd data-name="list"><a lay-href="/Admin/ExportTable/HelpProfit" title="助利宝分润">助利宝分润</a></dd>
+                                    </dl>
+                                </dd>
                             </dl>
                         </li>
                         }

+ 17 - 0
Areas/Admin/Views/MainServer/ExportTable/Double.cshtml

@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <title></title>
+    <meta name="renderer" content="webkit">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport"
+        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
+</head>
+
+<body>
+    @Html.Raw(ViewBag.html);
+</body>
+
+</html>

+ 17 - 0
Areas/Admin/Views/MainServer/ExportTable/HelpProfit.cshtml

@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <title></title>
+    <meta name="renderer" content="webkit">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport"
+        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
+</head>
+
+<body>
+    @Html.Raw(ViewBag.html);
+</body>
+
+</html>

+ 17 - 0
Areas/Admin/Views/MainServer/ExportTable/OpenMachine.cshtml

@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <title></title>
+    <meta name="renderer" content="webkit">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport"
+        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
+</head>
+
+<body>
+    @Html.Raw(ViewBag.html);
+</body>
+
+</html>

+ 17 - 0
Areas/Admin/Views/MainServer/ExportTable/Profit.cshtml

@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <title></title>
+    <meta name="renderer" content="webkit">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport"
+        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
+</head>
+
+<body>
+    @Html.Raw(ViewBag.html);
+</body>
+
+</html>

+ 17 - 0
Areas/Admin/Views/MainServer/ExportTable/Recommend.cshtml

@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <title></title>
+    <meta name="renderer" content="webkit">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport"
+        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
+</head>
+
+<body>
+    @Html.Raw(ViewBag.html);
+</body>
+
+</html>

+ 17 - 0
Areas/Admin/Views/MainServer/ExportTable/StoreHouse.cshtml

@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <title></title>
+    <meta name="renderer" content="webkit">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport"
+        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
+</head>
+
+<body>
+    @Html.Raw(ViewBag.html);
+</body>
+
+</html>

+ 17 - 0
Areas/Admin/Views/MainServer/ExportTable/Subsidy.cshtml

@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <title></title>
+    <meta name="renderer" content="webkit">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport"
+        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
+</head>
+
+<body>
+    @Html.Raw(ViewBag.html);
+</body>
+
+</html>

+ 17 - 0
Areas/Admin/Views/MainServer/ExportTable/Trade.cshtml

@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <title></title>
+    <meta name="renderer" content="webkit">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport"
+        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
+</head>
+
+<body>
+    @Html.Raw(ViewBag.html);
+</body>
+
+</html>

+ 4 - 4
Areas/Admin/Views/MainServer/PreSendStockDetail/Index.cshtml

@@ -45,7 +45,7 @@
         <div class="layui-card">
             <div class="layui-form layui-card-header layuiadmin-card-header-auto">
                 <div class="layui-form-item">
-                    <div class="layui-inline">
+                    @* <div class="layui-inline">
                         <label class="layui-form-label">仓库名称</label>
                         <div class="layui-input-inline">
                             <input class="layui-input" type="text" name="StoreIdStoreName" autocomplete="off">
@@ -56,7 +56,7 @@
                         <div class="layui-input-inline">
                             <input class="layui-input" type="text" name="StoreIdStoreNo" autocomplete="off">
                         </div>
-                    </div>
+                    </div> *@
                     <div class="layui-inline">
                         <label class="layui-form-label">创建时间</label>
                         <div class="layui-input-inline">
@@ -95,7 +95,7 @@
                             <input class="layui-input" type="text" name="ToUserIdRealName" autocomplete="off">
                         </div>
                     </div>
-                    <div class="layui-inline">
+                    @* <div class="layui-inline">
                         <label class="layui-form-label">收货仓库编号</label>
                         <div class="layui-input-inline">
                             <input class="layui-input" type="text" name="ToStoreIdStoreNo" autocomplete="off">
@@ -106,7 +106,7 @@
                         <div class="layui-input-inline">
                             <input class="layui-input" type="text" name="ToStoreIdStoreName" autocomplete="off">
                         </div>
-                    </div>
+                    </div> *@
                     @* <div class="layui-inline">
                         <label class="layui-form-label">源仓库编号</label>
                         <div class="layui-input-inline">

+ 237 - 0
Areas/Admin/Views/MainServer/PreSendStockDetail/Indexs.cshtml

@@ -0,0 +1,237 @@
+@{
+    string RightInfo = ViewBag.RightInfo as string;
+    string right = ViewBag.right as string;
+    string StoreId = ViewBag.StoreId as string;
+
+}
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <title>预发货库存明细</title>
+    <meta name="renderer" content="webkit">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport"
+        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
+    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
+    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
+    <script src="/admin/js/jquery-1.10.1.min.js"></script>
+    <style>
+        .layui-input-inline {
+            width: 175px !important;
+        }
+
+        .layui-form-label {
+            width: 85px !important;
+        }
+
+        .layui-inline {
+            margin-right: 0px !important;
+        }
+
+        .w100 {
+            width: 100px !important;
+        }
+
+        .ml50 {
+            margin-left: 50px !important;
+        }
+    </style>
+</head>
+
+<body>
+    <div class="layui-fluid">
+        <div class="layui-card">
+            <div class="layui-form layui-card-header layuiadmin-card-header-auto">
+                <div class="layui-form-item">
+                    @* <div class="layui-inline">
+                        <label class="layui-form-label">仓库名称</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="StoreIdStoreName" autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">仓库编号</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="StoreIdStoreNo" autocomplete="off">
+                        </div>
+                    </div> *@
+                    <div class="layui-inline">
+                        <label class="layui-form-label">创建时间</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" readonly name="CreateDateData" id="CreateDate"
+                                placeholder="" autocomplete="off">
+                        </div>
+                    </div>
+                    @{Dictionary<string, string> KqProductsDic = new MySystem.DictionaryClass().getKqProductsDic();}
+                    <div class="layui-inline">
+                        <label class="layui-form-label">产品类型</label>
+                        <div class="layui-input-inline">
+                            <select id="BrandIdSelect" name="BrandIdSelect" lay-search="">
+                                <option value="">全部...</option>
+                                @foreach (string key in KqProductsDic.Keys)
+                                {
+                                    <option value="@key">@KqProductsDic[key]</option>
+                                }
+                            </select>
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">SN编号</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="SnNo" placeholder="" autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">收货人创客编号</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="ToUserIdMakerCode" autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">收货人真实姓名</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="ToUserIdRealName" autocomplete="off">
+                        </div>
+                    </div>
+                    @* <div class="layui-inline">
+                        <label class="layui-form-label">收货仓库编号</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="ToStoreIdStoreNo" autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">收货仓库名称</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="ToStoreIdStoreName" autocomplete="off">
+                        </div>
+                    </div> *@
+                    @* <div class="layui-inline">
+                        <label class="layui-form-label">源仓库编号</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="SourceStoreIdStoreNo" autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">源仓库名称</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="SourceStoreIdStoreName" autocomplete="off">
+                        </div>
+                    </div> *@
+                    <div class="layui-inline">
+                        <label class="layui-form-label">申请时间</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" readonly name="ApplyDateData" id="ApplyDate"
+                                placeholder="" autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">出货创客编号</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="FromUserIdMakerCode" autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">出货创客姓名</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="FromUserIdRealName" autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">出货仓库编号</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="FromStoreIdStoreNo" autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">出货仓库名称</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="FromStoreIdStoreName" autocomplete="off">
+                        </div>
+                    </div>
+
+                    <div class="layui-inline ml50">
+                        <button class="layui-btn" lay-submit lay-filter="LAY-list-front-search">
+                            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>查询
+                        </button>
+                        <button class="layui-btn" lay-submit lay-filter="LAY-list-front-searchall">
+                            <i class="layui-icon layui-icon-list layuiadmin-button-btn"></i>全部
+                        </button>
+                    </div>
+                </div>
+            </div>
+
+            <div class="layui-card-body">
+                <div style="padding-bottom: 10px;">
+                    @if (RightInfo.Contains("," + right + "_add,"))
+                    {
+                        <button class="layui-btn" data-type="add"><i
+                            class="layui-icon layui-icon-add-1 layuiadmin-button-btn"></i>添加</button>
+                    }
+                    @if (RightInfo.Contains("," + right + "_delete,"))
+                    {
+                        <button class="layui-btn" data-type="batchdel"><i
+                            class="layui-icon layui-icon-delete layuiadmin-button-btn"></i>删除</button>
+                    }
+                    @if (RightInfo.Contains("," + right + "_edit,"))
+                    {
+                        <button class="layui-btn" data-type="ExportExcel"><i
+                            class="layui-icon layui-icon-export layuiadmin-button-btn"></i>导出</button>
+
+                    }
+                </div>
+
+                <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>
+                <script type="text/html" id="table-list-tools">
+                    @if (RightInfo.Contains("," + right + "_edit,"))
+                    {
+                        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
+                    }
+                    @if (RightInfo.Contains("," + right + "_delete,"))
+                    {
+                        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
+                    }
+                    @if (RightInfo.Contains("," + right + "_edit,"))
+                    {
+
+                    }
+                </script>
+            </div>
+        </div>
+    </div>
+    <div id="excelForm" style="display:none; padding:20px;">
+        <div class="layui-tab-item layui-show">
+            <div class="layui-form-item">
+                <label class="layui-form-label">模板下载</label>
+                <div class="layui-form-mid layui-word-aux" id="excelTemp">
+                </div>
+            </div>
+            <div class="layui-form-item">
+                <label class="layui-form-label">excel文件</label>
+                <div class="layui-form-mid layui-word-aux">
+                    <div class="layui-upload">
+                        <input type="file" id="ExcelFile" name="ExcelFile" value="">
+                    </div>
+                    <div class="mt10" id="ExcelFileList">
+                    </div>
+                </div>
+            </div>
+        </div>
+        <div class="layui-form-item ml10">
+            <div class="layui-input-block">
+                <button type="button" class="layui-btn" onclick="ConfirmImport()">立即导入</button>
+            </div>
+        </div>
+    </div>
+
+    <script src="/layuiadmin/layui/layui.js"></script>
+    <script
+        src="/layuiadmin/modules_main/PreSendStockDetails_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+    <script>
+        var StoreId = '@StoreId';
+
+    </script>
+</body>
+
+</html>

+ 12 - 3
Areas/Admin/Views/MainServer/StoreHouseAmountRecord/Index.cshtml

@@ -96,7 +96,16 @@
                             </select>
                         </div>
                     </div>
-
+                    <div class="layui-inline">
+                        <label class="layui-form-label">额度类别</label>
+                        <div class="layui-input-inline">
+                            <select id="PayModeSelect" name="PayModeSelect" lay-search="">
+                                <option value="">全部...</option>
+                                <option value="1">支付宝</option>
+                                <option value="3">余额</option>
+                            </select>
+                        </div>
+                    </div>
                     <div class="layui-inline ml50">
                         <button class="layui-btn" lay-submit lay-filter="LAY-list-front-search">
                             <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>查询
@@ -132,11 +141,11 @@
                 <script type="text/html" id="table-list-tools">
                     @if (RightInfo.Contains("," + right + "_edit,"))
                     {
-                        <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
+                            <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
                     }
                     @if (RightInfo.Contains("," + right + "_delete,"))
                     {
-                        <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
+                            <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
                     }
                     @if (RightInfo.Contains("," + right + "_edit,"))
                     {

+ 156 - 0
Areas/Admin/Views/MainServer/StoreHouseAmountRecord/Indexs.cshtml

@@ -0,0 +1,156 @@
+@{
+    string RightInfo = ViewBag.RightInfo as string;
+    string right = ViewBag.right as string;
+
+}
+<!DOCTYPE html>
+<html>
+
+<head>
+    <meta charset="utf-8">
+    <title>分仓机具额度记录</title>
+    <meta name="renderer" content="webkit">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+    <meta name="viewport"
+        content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
+    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
+    <link rel="stylesheet" href="/layuiadmin/style/admin.css" media="all">
+    <script src="/admin/js/jquery-1.10.1.min.js"></script>
+    <style>
+        .layui-input-inline {
+            width: 175px !important;
+        }
+
+        .layui-form-label {
+            width: 85px !important;
+        }
+
+        .layui-inline {
+            margin-right: 0px !important;
+        }
+
+        .w100 {
+            width: 100px !important;
+        }
+
+        .ml50 {
+            margin-left: 50px !important;
+        }
+    </style>
+</head>
+
+<body>
+    <div class="layui-fluid">
+        <div class="layui-card">
+            <div class="layui-form layui-card-header layuiadmin-card-header-auto">
+                <div class="layui-form-item">
+                    <div class="layui-inline">
+                        <label class="layui-form-label">创客真实姓名</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="UserIdRealName" autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">创客编号</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="UserIdMakerCode" autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">创建时间</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" readonly name="CreateDateData" id="CreateDate"
+                                placeholder="" autocomplete="off">
+                        </div>
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">状态</label>
+                        <div class="layui-input-inline">
+                            <select id="StatusSelect" name="StatusSelect" lay-search="">
+                                <option value="">全部...</option>
+                                <option value="0" selected="selected">待处理</option>
+                                <option value="2">处理中</option>
+                                <option value="1">成功</option>
+                                <option value="-1">失败</option>
+                            </select>
+                        </div>
+                    </div>
+                    <div class="layui-inline ml50">
+                        <button class="layui-btn" lay-submit lay-filter="LAY-list-front-search">
+                            <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>查询
+                        </button>
+                        <button class="layui-btn" lay-submit lay-filter="LAY-list-front-searchall">
+                            <i class="layui-icon layui-icon-list layuiadmin-button-btn"></i>全部
+                        </button>
+                    </div>
+                </div>
+            </div>
+
+            <div class="layui-card-body">
+                <div style="padding-bottom: 10px;">
+                    @if (RightInfo.Contains("," + right + "_add,"))
+                    {
+                        <button class="layui-btn" data-type="add"><i
+                            class="layui-icon layui-icon-add-1 layuiadmin-button-btn"></i>添加</button>
+                    }
+                    @if (RightInfo.Contains("," + right + "_delete,"))
+                    {
+                        <button class="layui-btn" data-type="batchdel"><i
+                            class="layui-icon layui-icon-delete layuiadmin-button-btn"></i>删除</button>
+                    }
+                    @if (RightInfo.Contains("," + right + "_export,"))
+                    {
+                        <button class="layui-btn" data-type="ExportExcel"><i
+                            class="layui-icon layui-icon-export layuiadmin-button-btn"></i>导出</button>
+
+                    }
+                    @if (RightInfo.Contains("," + right + "_import,"))
+                    {
+                        <button class="layui-btn" data-type="ImportData"><i
+                            class="layui-icon layui-icon-upload layuiadmin-button-btn"></i>导入结果</button>
+                    }
+                </div>
+
+                <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>
+                <script type="text/html" id="table-list-tools">
+                    @* @if (RightInfo.Contains("," + right + "_edit,"))
+                    {
+                            <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i class="layui-icon layui-icon-edit"></i>编辑</a>
+                    }
+                    @if (RightInfo.Contains("," + right + "_delete,"))
+                    {
+                            <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i class="layui-icon layui-icon-delete"></i>删除</a>
+                    } *@
+                </script>
+            </div>
+        </div>
+    </div>
+    <div id="excelForm" style="display:none; padding:20px;">
+        <div class="layui-tab-item layui-show">
+            <div class="layui-form-item">
+                <label class="layui-form-label">excel文件</label>
+                <div class="layui-form-mid layui-word-aux">
+                    <div class="layui-upload">
+                        <input type="file" id="ExcelFile" name="ExcelFile" value="">
+                    </div>
+                    <div class="mt10" id="ExcelFileList">
+                    </div>
+                </div>
+            </div>
+        </div>
+        <div class="layui-form-item ml10">
+            <div class="layui-input-block">
+                <button type="button" class="layui-btn" onclick="ConfirmImport()">立即导入</button>
+            </div>
+        </div>
+    </div>
+
+    <script src="/layuiadmin/layui/layui.js"></script>
+    <script
+        src="/layuiadmin/modules_main/StoreHouseCardAmountRecord_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+    <script>
+
+    </script>
+</body>
+
+</html>

+ 5 - 0
Areas/Admin/Views/MainServer/UserCashRecord/Index.cshtml

@@ -128,6 +128,11 @@
                             <button class="layui-btn" data-type="Cash"><i
                                 class="layui-icon layui-icon-up layuiadmin-button-btn"></i>提交到代付平台</button>
                         }
+                        @if (RightInfo.Contains("," + right + "_batchset,"))
+                        {
+                            <button class="layui-btn" data-type="BatchSetting"><i
+                                class="layui-icon layui-icon-edit layuiadmin-button-btn"></i>批量设置成功</button>
+                        }
                     </div>
                 </div>
             </div>

+ 7 - 0
Controllers/HomeController.cs

@@ -172,5 +172,12 @@ namespace MySystem.Controllers
             db.Dispose();
             return html;
         }
+    
+        public string test()
+        {
+            return "ok";
+        }
+    
+    
     }
 }

+ 3 - 3
Models/BackEndOpRecord.cs

@@ -9,11 +9,8 @@ namespace MySystem.Models
         public int Sort { get; set; }
         public int QueryCount { get; set; }
         public int Status { get; set; }
-        public int Version { get; set; }
         public DateTime? CreateDate { get; set; }
         public DateTime? UpdateDate { get; set; }
-        public string CreateMan { get; set; }
-        public string UpdateMan { get; set; }
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }
@@ -24,5 +21,8 @@ namespace MySystem.Models
         public string TableChName { get; set; }
         public string SysRealName { get; set; }
         public string SysUserName { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public int Version { get; set; }
     }
 }

+ 3 - 0
Models/HelpProfitReward.cs

@@ -9,8 +9,11 @@ namespace MySystem.Models
         public int Sort { get; set; }
         public int QueryCount { get; set; }
         public int Status { get; set; }
+        public int Version { get; set; }
         public DateTime? CreateDate { get; set; }
         public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }

+ 3 - 0
Models/HelpProfitRewardDetail.cs

@@ -9,8 +9,11 @@ namespace MySystem.Models
         public int Sort { get; set; }
         public int QueryCount { get; set; }
         public int Status { get; set; }
+        public int Version { get; set; }
         public DateTime? CreateDate { get; set; }
         public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }

+ 3 - 3
Models/LeaderAccountRecord.cs

@@ -9,11 +9,8 @@ namespace MySystem.Models
         public int Sort { get; set; }
         public int QueryCount { get; set; }
         public int Status { get; set; }
-        public int Version { get; set; }
         public DateTime? CreateDate { get; set; }
         public DateTime? UpdateDate { get; set; }
-        public string CreateMan { get; set; }
-        public string UpdateMan { get; set; }
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }
@@ -29,5 +26,8 @@ namespace MySystem.Models
         public int ProductType { get; set; }
         public int ChangeType { get; set; }
         public int UserId { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public int Version { get; set; }
     }
 }

+ 1 - 0
Models/PreSendStockDetail.cs

@@ -28,5 +28,6 @@ namespace MySystem.Models
         public string SnNo { get; set; }
         public int BrandId { get; set; }
         public int StoreId { get; set; }
+        public ulong AuthFlag { get; set; }
     }
 }

+ 3 - 0
Models/ProfitRewardExport.cs

@@ -9,8 +9,11 @@ namespace MySystem.Models
         public int Sort { get; set; }
         public int QueryCount { get; set; }
         public int Status { get; set; }
+        public int Version { get; set; }
         public DateTime? CreateDate { get; set; }
         public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }

+ 3 - 0
Models/ProfitSubsidyExport.cs

@@ -9,8 +9,11 @@ namespace MySystem.Models
         public int Sort { get; set; }
         public int QueryCount { get; set; }
         public int Status { get; set; }
+        public int Version { get; set; }
         public DateTime? CreateDate { get; set; }
         public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }

+ 3 - 0
Models/SchoolMakerStudy.cs

@@ -9,8 +9,11 @@ namespace MySystem.Models
         public int Sort { get; set; }
         public int QueryCount { get; set; }
         public int Status { get; set; }
+        public int Version { get; set; }
         public DateTime? CreateDate { get; set; }
         public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }

+ 3 - 0
Models/SchoolMorningMeet.cs

@@ -9,8 +9,11 @@ namespace MySystem.Models
         public int Sort { get; set; }
         public int QueryCount { get; set; }
         public int Status { get; set; }
+        public int Version { get; set; }
         public DateTime? CreateDate { get; set; }
         public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }

+ 3 - 0
Models/SchoolMorningMeetLog.cs

@@ -9,8 +9,11 @@ namespace MySystem.Models
         public int Sort { get; set; }
         public int QueryCount { get; set; }
         public int Status { get; set; }
+        public int Version { get; set; }
         public DateTime? CreateDate { get; set; }
         public DateTime? UpdateDate { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }

+ 24 - 0
Models/SmallStoreQuotaRecord.cs

@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class SmallStoreQuotaRecord
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int OperateType { get; set; }
+        public decimal AfterAmount { get; set; }
+        public decimal BeforeAmount { get; set; }
+        public decimal UseAmount { get; set; }
+        public int ApplyId { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 3 - 3
Models/StoreHouseAmountPromiss.cs

@@ -9,16 +9,16 @@ namespace MySystem.Models
         public int Sort { get; set; }
         public int QueryCount { get; set; }
         public int Status { get; set; }
-        public int Version { get; set; }
         public DateTime? CreateDate { get; set; }
         public DateTime? UpdateDate { get; set; }
-        public string CreateMan { get; set; }
-        public string UpdateMan { get; set; }
         public string SeoTitle { get; set; }
         public string SeoKeyword { get; set; }
         public string SeoDescription { get; set; }
         public decimal PromissAmount { get; set; }
         public int ToUserId { get; set; }
         public int FromUserId { get; set; }
+        public string CreateMan { get; set; }
+        public string UpdateMan { get; set; }
+        public int Version { get; set; }
     }
 }

+ 1 - 0
Models/StoreHouseAmountRecord.cs

@@ -21,5 +21,6 @@ namespace MySystem.Models
         public decimal UseAmount { get; set; }
         public int ApplyId { get; set; }
         public int UserId { get; set; }
+        public int PayMode { get; set; }
     }
 }

+ 35 - 0
Models/SubsidyRecord.cs

@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class SubsidyRecord
+    {
+        public int Id { get; set; }
+        public int Sort { get; set; }
+        public int QueryCount { get; set; }
+        public int Status { get; set; }
+        public DateTime? CreateDate { get; set; }
+        public DateTime? UpdateDate { get; set; }
+        public string SeoTitle { get; set; }
+        public string SeoKeyword { get; set; }
+        public string SeoDescription { get; set; }
+        public int TradeId { get; set; }
+        public string ParentNav { get; set; }
+        public string Remark { get; set; }
+        public int BrandId { get; set; }
+        public ulong DirectFlag { get; set; }
+        public int CapFlag { get; set; }
+        public int QrPayFlag { get; set; }
+        public decimal ProfitAmount { get; set; }
+        public DateTime? ClearDate { get; set; }
+        public DateTime? TradeDate { get; set; }
+        public string SnNo { get; set; }
+        public int MerBuddyType { get; set; }
+        public int HelpMonthCount { get; set; }
+        public ulong MerHelpFlag { get; set; }
+        public string MerNo { get; set; }
+        public int MerchantId { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 4 - 0
Models/UserAccount.cs

@@ -38,5 +38,9 @@ namespace MySystem.Models
         public decimal ValidAmount { get; set; }
         public decimal LeaderBalanceAmount { get; set; }
         public decimal HelpProfitBalanceAmount { get; set; }
+        public decimal TempAmountForBalance { get; set; }
+        public decimal ThisMonthPreAmount { get; set; }
+        public decimal ValidPreAmount { get; set; }
+        public decimal SmallStoreDeposit { get; set; }
     }
 }

+ 249 - 0
Models/WebCMSEntities.cs

@@ -177,6 +177,7 @@ namespace MySystem.Models
         public virtual DbSet<ServiceCenter> ServiceCenter { get; set; }
         public virtual DbSet<SetMerchantTypeRecord> SetMerchantTypeRecord { get; set; }
         public virtual DbSet<SmallStoreHouse> SmallStoreHouse { get; set; }
+        public virtual DbSet<SmallStoreQuotaRecord> SmallStoreQuotaRecord { get; set; }
         public virtual DbSet<SpOrderNos> SpOrderNos { get; set; }
         public virtual DbSet<StoreBalance> StoreBalance { get; set; }
         public virtual DbSet<StoreChangeHistory> StoreChangeHistory { get; set; }
@@ -191,6 +192,7 @@ namespace MySystem.Models
         public virtual DbSet<StoreStockChange> StoreStockChange { get; set; }
         public virtual DbSet<StoreSwapSn> StoreSwapSn { get; set; }
         public virtual DbSet<SubsidyCheck> SubsidyCheck { get; set; }
+        public virtual DbSet<SubsidyRecord> SubsidyRecord { get; set; }
         public virtual DbSet<SysAdmin> SysAdmin { get; set; }
         public virtual DbSet<SysAdminRole> SysAdminRole { get; set; }
         public virtual DbSet<SysLog> SysLog { get; set; }
@@ -621,6 +623,9 @@ namespace MySystem.Models
 
             modelBuilder.Entity<ActivityRedPackageJoins>(entity =>
             {
+                entity.HasIndex(e => new { e.UserId, e.ActivityDate })
+                    .HasName("ActivityRedPackageJoinsIndex");
+
                 entity.Property(e => e.Id).HasColumnType("int(11)");
 
                 entity.Property(e => e.ActivityDate)
@@ -672,6 +677,9 @@ namespace MySystem.Models
 
             modelBuilder.Entity<ActivityRedPackageStock>(entity =>
             {
+                entity.HasIndex(e => e.ActivityDate)
+                    .HasName("ActivityRedPackageStockIndex");
+
                 entity.Property(e => e.Id).HasColumnType("int(11)");
 
                 entity.Property(e => e.ActivityDate)
@@ -3275,6 +3283,11 @@ namespace MySystem.Models
 
                 entity.Property(e => e.CreateDate).HasColumnType("datetime");
 
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.CreditRewardAmount).HasColumnType("decimal(18,2)");
 
                 entity.Property(e => e.CreditTradeAmt).HasColumnType("decimal(18,2)");
@@ -3334,7 +3347,14 @@ namespace MySystem.Models
 
                 entity.Property(e => e.UpdateDate).HasColumnType("datetime");
 
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.UserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
             modelBuilder.Entity<HelpProfitRewardDetail>(entity =>
@@ -3347,6 +3367,11 @@ namespace MySystem.Models
 
                 entity.Property(e => e.CreateDate).HasColumnType("datetime");
 
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.CreditRewardAmount).HasColumnType("decimal(18,2)");
 
                 entity.Property(e => e.CreditTradeAmt).HasColumnType("decimal(18,2)");
@@ -3443,7 +3468,14 @@ namespace MySystem.Models
 
                 entity.Property(e => e.UpdateDate).HasColumnType("datetime");
 
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.UserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
             modelBuilder.Entity<IndexIconList>(entity =>
@@ -7391,6 +7423,9 @@ namespace MySystem.Models
 
             modelBuilder.Entity<OrderProduct>(entity =>
             {
+                entity.HasIndex(e => e.OrderId)
+                    .HasName("OrderProductIndex");
+
                 entity.Property(e => e.Id).HasColumnType("int(11)");
 
                 entity.Property(e => e.CreateDate).HasColumnType("datetime");
@@ -7614,6 +7649,9 @@ namespace MySystem.Models
                 entity.HasIndex(e => e.StoreId)
                     .HasName("OrdersStoreIdIndex");
 
+                entity.HasIndex(e => new { e.UserId, e.ParentOrderId })
+                    .HasName("OrdersListIndex");
+
                 entity.Property(e => e.Id).HasColumnType("int(11)");
 
                 entity.Property(e => e.ActualPay).HasColumnType("decimal(18,2)");
@@ -8728,6 +8766,10 @@ namespace MySystem.Models
                     .HasColumnType("bit(1)")
                     .HasDefaultValueSql("b'0'");
 
+                entity.Property(e => e.AuthFlag)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'");
+
                 entity.Property(e => e.BrandId).HasColumnType("int(11)");
 
                 entity.Property(e => e.CancelDate).HasColumnType("datetime");
@@ -10301,6 +10343,11 @@ namespace MySystem.Models
 
                 entity.Property(e => e.CreateDate).HasColumnType("datetime");
 
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.CreditTradeAmt).HasColumnType("decimal(18,2)");
 
                 entity.Property(e => e.CreditTradeProfit).HasColumnType("decimal(18,2)");
@@ -10365,7 +10412,14 @@ namespace MySystem.Models
 
                 entity.Property(e => e.UpdateDate).HasColumnType("datetime");
 
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.UserLevel).HasColumnType("int(11)");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
             modelBuilder.Entity<ProfitRewardRecord>(entity =>
@@ -10913,6 +10967,11 @@ namespace MySystem.Models
 
                 entity.Property(e => e.CreateDate).HasColumnType("datetime");
 
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.CreditTradeAmt).HasColumnType("decimal(18,2)");
 
                 entity.Property(e => e.DirectFlag)
@@ -10967,7 +11026,14 @@ namespace MySystem.Models
 
                 entity.Property(e => e.UpdateDate).HasColumnType("datetime");
 
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.UserLevel).HasColumnType("int(11)");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
             modelBuilder.Entity<PublicAccountSet>(entity =>
@@ -11515,6 +11581,11 @@ namespace MySystem.Models
 
                 entity.Property(e => e.CreateDate).HasColumnType("datetime");
 
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.Detail)
                     .HasColumnType("varchar(200)")
                     .HasCharSet("utf8")
@@ -11553,10 +11624,17 @@ namespace MySystem.Models
 
                 entity.Property(e => e.UpdateDate).HasColumnType("datetime");
 
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.Url)
                     .HasColumnType("varchar(500)")
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
             modelBuilder.Entity<SchoolMaterials>(entity =>
@@ -11644,6 +11722,11 @@ namespace MySystem.Models
 
                 entity.Property(e => e.CreateDate).HasColumnType("datetime");
 
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.Lecturer)
                     .HasColumnType("varchar(30)")
                     .HasCharSet("utf8")
@@ -11684,10 +11767,17 @@ namespace MySystem.Models
 
                 entity.Property(e => e.UpdateDate).HasColumnType("datetime");
 
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.Url)
                     .HasColumnType("varchar(500)")
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
             modelBuilder.Entity<SchoolMorningMeetLog>(entity =>
@@ -11696,6 +11786,11 @@ namespace MySystem.Models
 
                 entity.Property(e => e.CreateDate).HasColumnType("datetime");
 
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.MeetId).HasColumnType("int(11)");
 
                 entity.Property(e => e.QueryCount).HasColumnType("int(11)");
@@ -11721,7 +11816,14 @@ namespace MySystem.Models
 
                 entity.Property(e => e.UpdateDate).HasColumnType("datetime");
 
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
                 entity.Property(e => e.UserId).HasColumnType("int(11)");
+
+                entity.Property(e => e.Version).HasColumnType("int(11)");
             });
 
             modelBuilder.Entity<SchoolSignInData>(entity =>
@@ -12126,6 +12228,48 @@ namespace MySystem.Models
                 entity.Property(e => e.UserId).HasColumnType("int(11)");
             });
 
+            modelBuilder.Entity<SmallStoreQuotaRecord>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.AfterAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.ApplyId).HasColumnType("int(11)");
+
+                entity.Property(e => e.BeforeAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.OperateType).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UseAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+            });
+
             modelBuilder.Entity<SpOrderNos>(entity =>
             {
                 entity.HasKey(e => e.OrderNo)
@@ -12526,6 +12670,8 @@ namespace MySystem.Models
 
                 entity.Property(e => e.OperateType).HasColumnType("int(11)");
 
+                entity.Property(e => e.PayMode).HasColumnType("int(11)");
+
                 entity.Property(e => e.QueryCount).HasColumnType("int(11)");
 
                 entity.Property(e => e.SeoDescription)
@@ -12688,6 +12834,9 @@ namespace MySystem.Models
 
             modelBuilder.Entity<StoreSnActivateSummary>(entity =>
             {
+                entity.HasIndex(e => new { e.StoreId, e.TradeMonth, e.TradeDate, e.BrandId })
+                    .HasName("StoreSnActivateSummaryIndex");
+
                 entity.Property(e => e.Id).HasColumnType("int(11)");
 
                 entity.Property(e => e.ActivateNum).HasColumnType("int(11)");
@@ -12761,6 +12910,12 @@ namespace MySystem.Models
 
             modelBuilder.Entity<StoreStockChange>(entity =>
             {
+                entity.HasIndex(e => new { e.StoreId, e.TransType, e.CreateDate })
+                    .HasName("StoreStockChangeIndex");
+
+                entity.HasIndex(e => new { e.ToUserId, e.Sort, e.BrandId })
+                    .HasName("StoreStockChangeIndex2");
+
                 entity.Property(e => e.Id).HasColumnType("int(11)");
 
                 entity.Property(e => e.ActRewardUserId).HasColumnType("int(11)");
@@ -13002,6 +13157,86 @@ namespace MySystem.Models
                 entity.Property(e => e.UserId).HasColumnType("int(11) unsigned");
             });
 
+            modelBuilder.Entity<SubsidyRecord>(entity =>
+            {
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.BrandId).HasColumnType("int(11)");
+
+                entity.Property(e => e.CapFlag).HasColumnType("int(11)");
+
+                entity.Property(e => e.ClearDate).HasColumnType("datetime");
+
+                entity.Property(e => e.CreateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.DirectFlag)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'");
+
+                entity.Property(e => e.HelpMonthCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.MerBuddyType).HasColumnType("int(11)");
+
+                entity.Property(e => e.MerHelpFlag)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'");
+
+                entity.Property(e => e.MerNo)
+                    .HasColumnType("varchar(32)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.MerchantId).HasColumnType("int(11)");
+
+                entity.Property(e => e.ParentNav)
+                    .HasColumnType("varchar(1000)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ProfitAmount).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.QrPayFlag).HasColumnType("int(11)");
+
+                entity.Property(e => e.QueryCount).HasColumnType("int(11)");
+
+                entity.Property(e => e.Remark)
+                    .HasColumnType("varchar(64)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoDescription)
+                    .HasColumnType("varchar(500)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoKeyword)
+                    .HasColumnType("varchar(200)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SeoTitle)
+                    .HasColumnType("varchar(100)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.SnNo)
+                    .HasColumnType("varchar(32)")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Sort).HasColumnType("int(11)");
+
+                entity.Property(e => e.Status).HasColumnType("int(11)");
+
+                entity.Property(e => e.TradeDate).HasColumnType("datetime");
+
+                entity.Property(e => e.TradeId).HasColumnType("int(11)");
+
+                entity.Property(e => e.UpdateDate).HasColumnType("datetime");
+
+                entity.Property(e => e.UserId).HasColumnType("int(11)");
+            });
+
             modelBuilder.Entity<SysAdmin>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");
@@ -14385,6 +14620,8 @@ namespace MySystem.Models
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
 
+                entity.Property(e => e.SmallStoreDeposit).HasColumnType("decimal(18,2)");
+
                 entity.Property(e => e.Sort).HasColumnType("int(11)");
 
                 entity.Property(e => e.Status).HasColumnType("int(11)");
@@ -14397,6 +14634,10 @@ namespace MySystem.Models
 
                 entity.Property(e => e.TempAmount).HasColumnType("decimal(18,2)");
 
+                entity.Property(e => e.TempAmountForBalance).HasColumnType("decimal(18,2)");
+
+                entity.Property(e => e.ThisMonthPreAmount).HasColumnType("decimal(18,2)");
+
                 entity.Property(e => e.TotalAmount).HasColumnType("decimal(18,2)");
 
                 entity.Property(e => e.TotalOverProfit).HasColumnType("decimal(18,2)");
@@ -14420,6 +14661,8 @@ namespace MySystem.Models
 
                 entity.Property(e => e.ValidAmount).HasColumnType("decimal(18,2)");
 
+                entity.Property(e => e.ValidPreAmount).HasColumnType("decimal(18,2)");
+
                 entity.Property(e => e.Version).HasColumnType("int(11)");
 
                 entity.Property(e => e.WithdrawAmount).HasColumnType("decimal(18,2)");
@@ -14427,6 +14670,9 @@ namespace MySystem.Models
 
             modelBuilder.Entity<UserAccountRecord>(entity =>
             {
+                entity.HasIndex(e => e.UserId)
+                    .HasName("UserAccountRecordIndex");
+
                 entity.Property(e => e.Id).HasColumnType("int(11)");
 
                 entity.Property(e => e.AfterBalanceAmount).HasColumnType("decimal(18,2)");
@@ -16142,6 +16388,9 @@ namespace MySystem.Models
 
             modelBuilder.Entity<UserRebateDetail>(entity =>
             {
+                entity.HasIndex(e => new { e.UserId, e.TradeMonth, e.TradeDate, e.RebateType, e.ProductType, e.SeoTitle })
+                    .HasName("UserRebateDetailIndex");
+
                 entity.Property(e => e.Id).HasColumnType("int(11)");
 
                 entity.Property(e => e.ChannelMerNo)

+ 6 - 5
wwwroot/layuiadmin/modules_main/PosMachinesTwoChange_Admin.js

@@ -153,6 +153,7 @@ layui.config({
             , { field: 'DownFeeFlag', width: 200, title: '调降标记', sort: true }
             , { field: 'DownFeeDate', width: 200, title: '调降时间', sort: true }
             , { field: 'DownFeeMan', width: 200, title: '调降人', sort: true }
+            , { field: 'SeoDescription', width: 500, title: '备注', sort: true }
             , { title: '操作', width: 100, align: 'center', fixed: 'right', toolbar: '#table-list-tools' }
         ]]
         , where: {
@@ -454,10 +455,10 @@ layui.config({
         , BatchSetting: function () {
             var checkStatus = table.checkStatus('LAY-list-manage')
                 , data = checkStatus.data; //得到选中的数据
-            if (data.length < 1) {
-                parent.layer.msg("请选择要设置调升费率的项");
-            } else {
-                var ids = "";
+            // if (data.length < 1) {
+            //     parent.layer.msg("请选择要设置调升费率的项");
+            // } else {
+                var ids = "0";
                 $.each(data, function (index, value) {
                     ids += data[index].Id + ",";
                 });
@@ -484,7 +485,7 @@ layui.config({
                         }
                     });
                 });
-            }
+            // }
         }
         , Open: function () {
             var checkStatus = table.checkStatus('LAY-list-manage')

+ 7 - 7
wwwroot/layuiadmin/modules_main/PreSendStockDetail_Admin.js

@@ -32,7 +32,7 @@ layui.config({
     var laydate = layui.laydate;
     var layCreateDate = laydate.render({
         elem: '#CreateDate',
-        type: 'datetime',
+        type: 'date',
         range: true,
         trigger: 'click',
         change: function (value, date, endDate) {
@@ -60,7 +60,7 @@ layui.config({
     var layApplyDate = laydate.render({
         elem: '#ApplyDate',
         trigger: 'click',
-        type: 'datetime',
+        type: 'date',
         range: true,
         change: function (value, date, endDate) {
             var op = true;
@@ -119,16 +119,16 @@ layui.config({
         , cols: [[
             { type: 'checkbox', fixed: 'left' }
             , { field: 'Id', fixed: 'left', title: 'ID', width: 80, sort: true, unresize: true }
-            , { field: 'StoreIdStoreName', width: 200, title: '仓库名称', sort: true }
-            , { field: 'StoreIdStoreNo', width: 200, title: '仓库编号', sort: true }
+            // , { field: 'StoreIdStoreName', width: 200, title: '仓库名称', sort: true }
+            // , { field: 'StoreIdStoreNo', width: 200, title: '仓库编号', sort: true }
             , { field: 'CreateDate', width: 200, title: '创建时间', sort: true }
             , { field: 'BrandId', width: 200, title: '产品类型', sort: true }
             , { field: 'SnNo', width: 200, title: 'SN编号', sort: true }
-            , { field: 'SnId', width: 200, title: 'SNID', sort: true }
+            // , { field: 'SnId', width: 200, title: 'SNID', sort: true }
             , { field: 'ToUserIdMakerCode', width: 200, title: '收货人创客编号', sort: true }
             , { field: 'ToUserIdRealName', width: 200, title: '收货人真实姓名', sort: true }
-            , { field: 'ToStoreIdStoreNo', width: 200, title: '收货仓库编号', sort: true }
-            , { field: 'ToStoreIdStoreName', width: 200, title: '收货仓库名称', sort: true }
+            // , { field: 'ToStoreIdStoreNo', width: 200, title: '收货仓库编号', sort: true }
+            // , { field: 'ToStoreIdStoreName', width: 200, title: '收货仓库名称', sort: true }
             // , { field: 'SourceStoreIdStoreNo', width: 200, title: '源仓库编号', sort: true }
             // , { field: 'SourceStoreIdStoreName', width: 200, title: '源仓库名称', sort: true }
             , { field: 'ApplyFlagName', width: 200, title: '申请标记', sort: true }

+ 451 - 0
wwwroot/layuiadmin/modules_main/PreSendStockDetails_Admin.js

@@ -0,0 +1,451 @@
+var ExcelData, ExcelKind;
+function ConfirmImport() {
+    $.ajax({
+        type: "POST",
+        url: "/Admin/PreSendStockDetail/Import?r=" + Math.random(1),
+        data: "ExcelData=" + encodeURIComponent(JSON.stringify(ExcelData)),
+        dataType: "text",
+        success: function (data) {
+            if (data == "success") {
+                layer.msg("导入成功", { time: 2000 }, function () {
+                    window.location.reload();
+                });
+            } else {
+                layer.msg(data);
+            }
+        }
+    });
+}
+
+var excel;
+layui.config({
+    base: '/layuiadmin/' //静态资源所在路径
+}).extend({
+    myexcel: 'layui/lay/modules/excel',
+    index: 'lib/index' //主入口模块
+}).use(['index', 'table', 'excel', 'laydate'], function () {
+    var $ = layui.$
+        , form = layui.form
+        , table = layui.table;
+
+    //- 筛选条件-日期
+    var laydate = layui.laydate;
+    var layCreateDate = laydate.render({
+        elem: '#CreateDate',
+        type: 'date',
+        range: true,
+        trigger: 'click',
+        change: function (value, date, endDate) {
+            var op = true;
+            if (date.year == endDate.year && endDate.month - date.month <= 1) {
+                if (endDate.month - date.month == 1 && endDate.date > date.date) {
+                    op = false;
+                    layCreateDate.hint('日期范围请不要超过1个月');
+                    setTimeout(function () {
+                        $(".laydate-btns-confirm").addClass("laydate-disabled");
+                    }, 1);
+                }
+            } else {
+                op = false;
+                layCreateDate.hint('日期范围请不要超过1个月');
+                setTimeout(function () {
+                    $(".laydate-btns-confirm").addClass("laydate-disabled");
+                }, 1);
+            }
+            if (op) {
+                $('#CreateDate').val(value);
+            }
+        }
+    });
+    var layApplyDate = laydate.render({
+        elem: '#ApplyDate',
+        trigger: 'click',
+        type: 'date',
+        range: true,
+        change: function (value, date, endDate) {
+            var op = true;
+            if (date.year == endDate.year && endDate.month - date.month <= 1) {
+                if (endDate.month - date.month == 1 && endDate.date > date.date) {
+                    op = false;
+                    layApplyDate.hint('日期范围请不要超过1个月');
+                    setTimeout(function () {
+                        $(".laydate-btns-confirm").addClass("laydate-disabled");
+                    }, 1);
+                }
+            } else {
+                op = false;
+                layApplyDate.hint('日期范围请不要超过1个月');
+                setTimeout(function () {
+                    $(".laydate-btns-confirm").addClass("laydate-disabled");
+                }, 1);
+            }
+            if (op) {
+                $('#ApplyDate').val(value);
+            }
+        }
+    });
+
+
+    //excel导入
+    excel = layui.excel;
+    $('#ExcelFile').change(function (e) {
+        var files = e.target.files;
+        excel.importExcel(files, {}, function (data) {
+            ExcelData = data[0].sheet1;
+        });
+    });
+
+    //监听单元格编辑
+    table.on('edit(LAY-list-manage)', function (obj) {
+        var value = obj.value //得到修改后的值
+            , data = obj.data //得到所在行所有键值
+            , field = obj.field; //得到字段
+        if (field == "Sort") {
+            $.ajax({
+                type: "POST",
+                url: "/Admin/PreSendStockDetail/Sort?r=" + Math.random(1),
+                data: "Id=" + data.Id + "&Sort=" + value,
+                dataType: "text",
+                success: function (data) {
+                }
+            });
+        }
+    });
+
+    //列表数据
+    table.render({
+        elem: '#LAY-list-manage'
+        , url: '/Admin/PreSendStockDetail/IndexsData' //模拟接口
+        , cols: [[
+            { type: 'checkbox', fixed: 'left' }
+            , { field: 'Id', fixed: 'left', title: 'ID', width: 80, sort: true, unresize: true }
+            // , { field: 'StoreIdStoreName', width: 200, title: '仓库名称', sort: true }
+            // , { field: 'StoreIdStoreNo', width: 200, title: '仓库编号', sort: true }
+            , { field: 'CreateDate', width: 200, title: '创建时间', sort: true }
+            , { field: 'BrandId', width: 200, title: '产品类型', sort: true }
+            , { field: 'SnNo', width: 200, title: 'SN编号', sort: true }
+            // , { field: 'SnId', width: 200, title: 'SNID', sort: true }
+            , { field: 'ToUserIdMakerCode', width: 200, title: '收货人创客编号', sort: true }
+            , { field: 'ToUserIdRealName', width: 200, title: '收货人真实姓名', sort: true }
+            // , { field: 'ToStoreIdStoreNo', width: 200, title: '收货仓库编号', sort: true }
+            // , { field: 'ToStoreIdStoreName', width: 200, title: '收货仓库名称', sort: true }
+            // , { field: 'SourceStoreIdStoreNo', width: 200, title: '源仓库编号', sort: true }
+            // , { field: 'SourceStoreIdStoreName', width: 200, title: '源仓库名称', sort: true }
+            , { field: 'ApplyFlagName', width: 200, title: '申请标记', sort: true }
+            , { field: 'ApplyDate', width: 200, title: '申请时间', sort: true }
+            , { field: 'FromUserIdMakerCode', width: 200, title: '出货创客编号', sort: true }
+            , { field: 'FromUserIdRealName', width: 200, title: '出货创客真实姓名', sort: true }
+            , { field: 'FromStoreIdStoreNo', width: 200, title: '出货仓库编号', sort: true }
+            , { field: 'FromStoreIdStoreName', width: 200, title: '出货仓库名称', sort: true }
+            , { field: 'CancelFlagName', width: 200, title: '撤回标记', sort: true }
+            , { field: 'CancelDate', width: 200, title: '撤回时间', sort: true }
+            , { field: 'AuthFlag', width: 200, title: '占用额度', sort: true }
+            // , { field: 'Sort', fixed: 'right', title: '排序', width: 80, edit: 'text' }s
+            , { title: '操作', width: 180, align: 'center', fixed: 'right', toolbar: '#table-list-tools' }
+        ]]
+        , where: {
+            StoreId: StoreId
+        }
+        , page: true
+        , limit: 30
+        , height: 'full-220'
+        , text: '对不起,加载出现异常!'
+        , done: function (res, curr, count) {
+            $(".layui-none").text("无数据");
+        }
+    });
+
+    //监听工具条
+    table.on('tool(LAY-list-manage)', function (obj) {
+        var data = obj.data;
+        if (obj.event === 'del') {
+            var index = layer.confirm('确定要删除吗?删除后不能恢复!', function (index) {
+                $.ajax({
+                    type: "POST",
+                    url: "/Admin/PreSendStockDetail/Delete?r=" + Math.random(1),
+                    data: "Id=" + data.Id,
+                    dataType: "text",
+                    success: function (data) {
+                        if (data == "success") {
+                            obj.del();
+                            layer.close(index);
+                        } else {
+                            parent.layer.msg(data);
+                        }
+                    }
+                });
+            });
+        } else if (obj.event === 'edit') {
+            var tr = $(obj.tr);
+            var perContent = layer.open({
+                type: 2
+                , title: '预发货库存明细-编辑'
+                , content: 'Edit?Id=' + data.Id + '&StoreId=' + StoreId + ''
+                , maxmin: true
+                , area: ['500px', '450px']
+                , btn: ['确定', '取消']
+                , yes: function (index, layero) {
+                    var iframeWindow = window['layui-layer-iframe' + index]
+                        , submitID = 'LAY-list-front-submit'
+                        , submit = layero.find('iframe').contents().find('#' + submitID);
+
+                    setTimeout(function () {
+                        layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
+                            var errObj = $(this).find('.layui-form-danger');
+                            if (errObj.length > 0) {
+                                iframeWindow.element.tabChange('mytabbar', String(i + 1));
+                                submit.click();
+                            }
+                        });
+                    }, 300);
+
+
+
+
+
+
+                    //监听提交
+                    iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
+                        var field = data.field; //获取提交的字段
+                        var userdata = "";
+                        for (var prop in field) {
+                            userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
+                        }
+                        //提交 Ajax 成功后,静态更新表格中的数据
+                        //$.ajax({});
+
+                        $.ajax({
+                            type: "POST",
+                            url: "/Admin/PreSendStockDetail/Edit?r=" + Math.random(1),
+                            data: userdata,
+                            dataType: "text",
+                            success: function (data) {
+                                layer.close(index); //关闭弹层
+                                if (data == "success") {
+                                    table.reload('LAY-list-manage'); //数据刷新
+                                } else {
+                                    layer.msg(data);
+                                }
+                            }
+                        });
+                    });
+
+                    submit.trigger('click');
+                }
+                , success: function (layero, index) {
+
+                }
+            });
+            layer.full(perContent);
+        }
+    });
+
+
+    //监听搜索
+    form.on('submit(LAY-list-front-search)', function (data) {
+        var field = data.field;
+
+        //执行重载
+        table.reload('LAY-list-manage', {
+            where: field,
+            page: {
+                curr: 1
+            }
+        });
+    });
+    form.on('submit(LAY-list-front-searchall)', function (data) {
+        table.reload('LAY-list-manage', {
+            where: null,
+            page: {
+                curr: 1
+            }
+        });
+    });
+
+    //事件
+    var active = {
+        batchdel: function () {
+            var checkStatus = table.checkStatus('LAY-list-manage')
+                , data = checkStatus.data; //得到选中的数据
+            if (data.length < 1) {
+                parent.layer.msg("请选择要删除的项");
+            } else {
+                var ids = "";
+                $.each(data, function (index, value) {
+                    ids += data[index].Id + ",";
+                });
+                ids = ids.substring(0, ids.length - 1);
+                var index = layer.confirm('确定要删除吗?删除后不能恢复!', function (index) {
+                    $.ajax({
+                        type: "POST",
+                        url: "/Admin/PreSendStockDetail/Delete?r=" + Math.random(1),
+                        data: "Id=" + ids,
+                        dataType: "text",
+                        success: function (data) {
+                            layer.close(index);
+                            if (data == "success") {
+                                table.reload('LAY-list-manage');
+                            } else {
+                                layer.msg(data);
+                            }
+                        }
+                    });
+                });
+            }
+        }
+        , add: function () {
+            var perContent = layer.open({
+                type: 2
+                , title: '预发货库存明细-添加'
+                , content: 'Add?StoreId=' + StoreId + ''
+                , maxmin: true
+                , area: ['500px', '450px']
+                , btn: ['确定', '取消']
+                , yes: function (index, layero) {
+                    var iframeWindow = window['layui-layer-iframe' + index]
+                        , submitID = 'LAY-list-front-submit'
+                        , submit = layero.find('iframe').contents().find('#' + submitID);
+
+                    setTimeout(function () {
+                        layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
+                            var errObj = $(this).find('.layui-form-danger');
+                            if (errObj.length > 0) {
+                                iframeWindow.element.tabChange('mytabbar', String(i + 1));
+                                submit.click();
+                            }
+                        });
+                    }, 300);
+
+
+
+
+
+
+                    //监听提交
+                    iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
+                        var field = data.field; //获取提交的字段
+                        var userdata = "";
+                        for (var prop in field) {
+                            userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
+                        }
+                        //提交 Ajax 成功后,静态更新表格中的数据
+                        //$.ajax({});
+
+                        $.ajax({
+                            type: "POST",
+                            url: "/Admin/PreSendStockDetail/Add?r=" + Math.random(1),
+                            data: userdata,
+                            dataType: "text",
+                            success: function (data) {
+                                layer.close(index); //关闭弹层
+                                if (data == "success") {
+                                    table.reload('LAY-list-manage'); //数据刷新
+                                } else {
+                                    layer.msg(data);
+                                }
+                            }
+                        });
+                    });
+
+                    submit.trigger('click');
+                }
+            });
+            layer.full(perContent);
+        }
+        , ImportData: function () {
+            ExcelKind = 1;
+            layer.open({
+                type: 1,
+                title: '导入',
+                maxmin: false,
+                area: ['460px', '280px'],
+                content: $('#excelForm'),
+                cancel: function () {
+                }
+            });
+            $("#excelTemp").html('<a href="/excelfile/模板文件.xlsx">点击下载模板文件</a>');
+        }
+        , ExportExcel: function () {
+            var userdata = '';
+            $(".layuiadmin-card-header-auto input").each(function (i) {
+                userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
+            });
+            $(".layuiadmin-card-header-auto select").each(function (i) {
+                userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
+            });
+            $.ajax({
+                type: "GET",
+                url: "/Admin/PreSendStockDetail/ExportExcel?r=" + Math.random(1),
+                data: userdata,
+                dataType: "json",
+                success: function (data) {
+                    data.Obj.unshift(data.Fields);
+                    excel.exportExcel(data.Obj, data.Info, 'xlsx');
+                }
+            });
+        }
+        , Open: function () {
+            var checkStatus = table.checkStatus('LAY-list-manage')
+                , data = checkStatus.data; //得到选中的数据
+            if (data.length < 1) {
+                parent.layer.msg("请选择要开启的项");
+            } else {
+                var ids = "";
+                $.each(data, function (index, value) {
+                    ids += data[index].Id + ",";
+                });
+                ids = ids.substring(0, ids.length - 1);
+                var index = layer.confirm('确定要开启吗?', function (index) {
+                    $.ajax({
+                        type: "POST",
+                        url: "/Admin/PreSendStockDetail/Open?r=" + Math.random(1),
+                        data: "Id=" + ids,
+                        dataType: "text",
+                        success: function (data) {
+                            layer.close(index);
+                            if (data == "success") {
+                                table.reload('LAY-list-manage');
+                            } else {
+                                layer.msg(data);
+                            }
+                        }
+                    });
+                });
+            }
+        }
+        , Close: function () {
+            var checkStatus = table.checkStatus('LAY-list-manage')
+                , data = checkStatus.data; //得到选中的数据
+            if (data.length < 1) {
+                parent.layer.msg("请选择要关闭的项");
+            } else {
+                var ids = "";
+                $.each(data, function (index, value) {
+                    ids += data[index].Id + ",";
+                });
+                ids = ids.substring(0, ids.length - 1);
+                var index = layer.confirm('确定要关闭吗?', function (index) {
+                    $.ajax({
+                        type: "POST",
+                        url: "/Admin/PreSendStockDetail/Close?r=" + Math.random(1),
+                        data: "Id=" + ids,
+                        dataType: "text",
+                        success: function (data) {
+                            layer.close(index);
+                            if (data == "success") {
+                                table.reload('LAY-list-manage');
+                            } else {
+                                layer.msg(data);
+                            }
+                        }
+                    });
+                });
+            }
+        }
+    };
+
+    $('.layui-btn').on('click', function () {
+        var type = $(this).data('type');
+        active[type] ? active[type].call(this) : '';
+    });
+});

+ 1 - 1
wwwroot/layuiadmin/modules_main/SmallStoreHouse_Admin.js

@@ -32,7 +32,7 @@ layui.config({
     var laydate = layui.laydate;
     var layCreateDate = laydate.render({
         elem: '#CreateDate',
-        type: 'datetime',
+        type: 'date',
         range: true,
         trigger: 'click',
         change: function (value, date, endDate) {

+ 3 - 2
wwwroot/layuiadmin/modules_main/StoreHouseAmountRecord_Admin.js

@@ -32,7 +32,7 @@ layui.config({
     var laydate = layui.laydate;
     var layCreateDate = laydate.render({
         elem: '#CreateDate',
-        type: 'datetime',
+        type: 'date',
         range: true,
         trigger: 'click',
         change: function (value, date, endDate) {
@@ -102,8 +102,9 @@ layui.config({
             , { field: 'AmountType', width: 200, title: '额度类别', sort: true }
             , { field: 'ChangeType', width: 200, title: '变动类别', sort: true }
             , { field: 'OperateType', width: 200, title: '操作类别', sort: true }
+            , { field: 'PayMode', width: 200, title: '额度类别', sort: true }
 
-            , { field: 'Sort', fixed: 'right', title: '排序', width: 80, edit: 'text' }
+            // , { field: 'Sort', fixed: 'right', title: '排序', width: 80, edit: 'text' }
             , { title: '操作', align: 'center', fixed: 'right', toolbar: '#table-list-tools' }
         ]]
         , where: {

+ 420 - 0
wwwroot/layuiadmin/modules_main/StoreHouseCardAmountRecord_Admin.js

@@ -0,0 +1,420 @@
+var ExcelData, ExcelKind;
+function ConfirmImport() {
+    $.ajax({
+        type: "POST",
+        url: "/Admin/StoreHouseAmountRecord/Imports?r=" + Math.random(1),
+        data: "ExcelData=" + encodeURIComponent(JSON.stringify(ExcelData)),
+        dataType: "text",
+        success: function (data) {
+            if (data == "success") {
+                layer.msg("导入结果成功", { time: 2000 }, function () {
+                    window.location.reload();
+                });
+            }  else if (data.indexOf("warning") == 0) {
+                var datalist = data.split('|');
+                layer.alert(datalist[0], { time: 20000 }, function () {
+                    window.location.reload();
+                });
+            } else {
+                layer.msg(data);
+            }
+        }
+    });
+}
+
+var excel;
+layui.config({
+    base: '/layuiadmin/' //静态资源所在路径
+}).extend({
+    myexcel: 'layui/lay/modules/excel',
+    index: 'lib/index' //主入口模块
+}).use(['index', 'table', 'excel', 'laydate'], function () {
+    var $ = layui.$
+        , form = layui.form
+        , table = layui.table;
+
+    //- 筛选条件-日期
+    var laydate = layui.laydate;
+    var layCreateDate = laydate.render({
+        elem: '#CreateDate',
+        type: 'date',
+        range: true,
+        trigger: 'click',
+        change: function (value, date, endDate) {
+            var op = true;
+            if (date.year == endDate.year && endDate.month - date.month <= 1) {
+                if (endDate.month - date.month == 1 && endDate.date > date.date) {
+                    op = false;
+                    layCreateDate.hint('日期范围请不要超过1个月');
+                    setTimeout(function () {
+                        $(".laydate-btns-confirm").addClass("laydate-disabled");
+                    }, 1);
+                }
+            } else {
+                op = false;
+                layCreateDate.hint('日期范围请不要超过1个月');
+                setTimeout(function () {
+                    $(".laydate-btns-confirm").addClass("laydate-disabled");
+                }, 1);
+            }
+            if (op) {
+                $('#CreateDate').val(value);
+            }
+        }
+    });
+
+
+    //excel导入
+    excel = layui.excel;
+    $('#ExcelFile').change(function (e) {
+        var files = e.target.files;
+        excel.importExcel(files, {}, function (data) {
+            ExcelData = data[0].sheet1;
+        });
+    });
+
+    //监听单元格编辑
+    table.on('edit(LAY-list-manage)', function (obj) {
+        var value = obj.value //得到修改后的值
+            , data = obj.data //得到所在行所有键值
+            , field = obj.field; //得到字段
+        if (field == "Sort") {
+            $.ajax({
+                type: "POST",
+                url: "/Admin/StoreHouseAmountRecord/Sort?r=" + Math.random(1),
+                data: "Id=" + data.Id + "&Sort=" + value,
+                dataType: "text",
+                success: function (data) {
+                }
+            });
+        }
+    });
+
+    //列表数据
+    table.render({
+        elem: '#LAY-list-manage'
+        , url: '/Admin/StoreHouseAmountRecord/IndexsData' //模拟接口
+        , cols: [[
+            { type: 'checkbox', fixed: 'left' }
+            , { field: 'Id', fixed: 'left', title: 'ID', width: 80, sort: true, unresize: true }
+            , { field: 'Status', width: 200, title: '状态', sort: true }
+            , { field: 'UserIdRealName', width: 200, title: '创客真实姓名', sort: true }
+            , { field: 'UserIdMakerCode', width: 200, title: '创客创客编号', sort: true }
+            , { field: 'CreateDate', width: 200, title: '创建时间', sort: true }
+            , { field: 'UseAmount', width: 200, title: '申请提现临额', sort: true }
+            , { field: 'CertId', width: 200, title: '身份证号', sort: true }
+            , { field: 'SettleBankCardNo', width: 200, title: '银行卡号', sort: true }
+            , { field: 'SettleBankName', width: 200, title: '银行名称', sort: true }
+            , { field: 'Mobile', width: 200, title: '手机号', sort: true }
+            , { field: 'Type', width: 200, title: '交易类型', sort: true }
+
+            // , { field: 'Sort', fixed: 'right', title: '排序', width: 80, edit: 'text' }
+            // , { title: '操作', align: 'center', fixed: 'right', toolbar: '#table-list-tools' }
+        ]]
+        , where: {
+
+        }
+        , page: true
+        , limit: 30
+        , height: 'full-220'
+        , text: '对不起,加载出现异常!'
+        , done: function (res, curr, count) {
+            $(".layui-none").text("无数据");
+        }
+    });
+
+    //监听工具条
+    table.on('tool(LAY-list-manage)', function (obj) {
+        var data = obj.data;
+        if (obj.event === 'del') {
+            var index = layer.confirm('确定要删除吗?删除后不能恢复!', function (index) {
+                $.ajax({
+                    type: "POST",
+                    url: "/Admin/StoreHouseAmountRecord/Delete?r=" + Math.random(1),
+                    data: "Id=" + data.Id,
+                    dataType: "text",
+                    success: function (data) {
+                        if (data == "success") {
+                            obj.del();
+                            layer.close(index);
+                        } else {
+                            parent.layer.msg(data);
+                        }
+                    }
+                });
+            });
+        } else if (obj.event === 'edit') {
+            var tr = $(obj.tr);
+            var perContent = layer.open({
+                type: 2
+                , title: '分仓机具额度记录-编辑'
+                , content: 'Edit?Id=' + data.Id + ''
+                , maxmin: true
+                , area: ['500px', '450px']
+                , btn: ['确定', '取消']
+                , yes: function (index, layero) {
+                    var iframeWindow = window['layui-layer-iframe' + index]
+                        , submitID = 'LAY-list-front-submit'
+                        , submit = layero.find('iframe').contents().find('#' + submitID);
+
+                    setTimeout(function () {
+                        layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
+                            var errObj = $(this).find('.layui-form-danger');
+                            if (errObj.length > 0) {
+                                iframeWindow.element.tabChange('mytabbar', String(i + 1));
+                                submit.click();
+                            }
+                        });
+                    }, 300);
+
+
+
+
+
+
+                    //监听提交
+                    iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
+                        var field = data.field; //获取提交的字段
+                        var userdata = "";
+                        for (var prop in field) {
+                            userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
+                        }
+                        //提交 Ajax 成功后,静态更新表格中的数据
+                        //$.ajax({});
+
+                        $.ajax({
+                            type: "POST",
+                            url: "/Admin/StoreHouseAmountRecord/Edit?r=" + Math.random(1),
+                            data: userdata,
+                            dataType: "text",
+                            success: function (data) {
+                                layer.close(index); //关闭弹层
+                                if (data == "success") {
+                                    table.reload('LAY-list-manage'); //数据刷新
+                                } else {
+                                    layer.msg(data);
+                                }
+                            }
+                        });
+                    });
+
+                    submit.trigger('click');
+                }
+                , success: function (layero, index) {
+
+                }
+            });
+            layer.full(perContent);
+        }
+    });
+
+
+    //监听搜索
+    form.on('submit(LAY-list-front-search)', function (data) {
+        var field = data.field;
+
+        //执行重载
+        table.reload('LAY-list-manage', {
+            where: field,
+            page: {
+                curr: 1
+            }
+        });
+    });
+    form.on('submit(LAY-list-front-searchall)', function (data) {
+        table.reload('LAY-list-manage', {
+            where: null,
+            page: {
+                curr: 1
+            }
+        });
+    });
+
+    //事件
+    var active = {
+        batchdel: function () {
+            var checkStatus = table.checkStatus('LAY-list-manage')
+                , data = checkStatus.data; //得到选中的数据
+            if (data.length < 1) {
+                parent.layer.msg("请选择要删除的项");
+            } else {
+                var ids = "";
+                $.each(data, function (index, value) {
+                    ids += data[index].Id + ",";
+                });
+                ids = ids.substring(0, ids.length - 1);
+                var index = layer.confirm('确定要删除吗?删除后不能恢复!', function (index) {
+                    $.ajax({
+                        type: "POST",
+                        url: "/Admin/StoreHouseAmountRecord/Delete?r=" + Math.random(1),
+                        data: "Id=" + ids,
+                        dataType: "text",
+                        success: function (data) {
+                            layer.close(index);
+                            if (data == "success") {
+                                table.reload('LAY-list-manage');
+                            } else {
+                                layer.msg(data);
+                            }
+                        }
+                    });
+                });
+            }
+        }
+        , add: function () {
+            var perContent = layer.open({
+                type: 2
+                , title: '分仓机具额度记录-添加'
+                , content: 'Add'
+                , maxmin: true
+                , area: ['500px', '450px']
+                , btn: ['确定', '取消']
+                , yes: function (index, layero) {
+                    var iframeWindow = window['layui-layer-iframe' + index]
+                        , submitID = 'LAY-list-front-submit'
+                        , submit = layero.find('iframe').contents().find('#' + submitID);
+
+                    setTimeout(function () {
+                        layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
+                            var errObj = $(this).find('.layui-form-danger');
+                            if (errObj.length > 0) {
+                                iframeWindow.element.tabChange('mytabbar', String(i + 1));
+                                submit.click();
+                            }
+                        });
+                    }, 300);
+
+
+
+
+
+
+                    //监听提交
+                    iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
+                        var field = data.field; //获取提交的字段
+                        var userdata = "";
+                        for (var prop in field) {
+                            userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
+                        }
+                        //提交 Ajax 成功后,静态更新表格中的数据
+                        //$.ajax({});
+
+                        $.ajax({
+                            type: "POST",
+                            url: "/Admin/StoreHouseAmountRecord/Add?r=" + Math.random(1),
+                            data: userdata,
+                            dataType: "text",
+                            success: function (data) {
+                                layer.close(index); //关闭弹层
+                                if (data == "success") {
+                                    table.reload('LAY-list-manage'); //数据刷新
+                                } else {
+                                    layer.msg(data);
+                                }
+                            }
+                        });
+                    });
+
+                    submit.trigger('click');
+                }
+            });
+            layer.full(perContent);
+        }
+        , ImportData: function () {
+            ExcelKind = 1;
+            layer.open({
+                type: 1,
+                title: '导入',
+                maxmin: false,
+                area: ['460px', '280px'],
+                content: $('#excelForm'),
+                cancel: function () {
+                }
+            });
+            $("#excelTemp");
+        }
+        , ExportExcel: function () {
+            var userdata = '';
+            $(".layuiadmin-card-header-auto input").each(function (i) {
+                userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
+            });
+            $(".layuiadmin-card-header-auto select").each(function (i) {
+                userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
+            });
+            $.ajax({
+                type: "GET",
+                url: "/Admin/StoreHouseAmountRecord/ExportsExcel?r=" + Math.random(1),
+                data: userdata,
+                dataType: "json",
+                success: function (data) {
+                    data.Obj.unshift(data.Fields);
+                    excel.exportExcel(data.Obj, data.Info, 'xlsx');
+                    window.location.reload();
+                }
+            });
+        }
+        , BatchSetting: function () {
+            var checkStatus = table.checkStatus('LAY-list-manage')
+                , data = checkStatus.data; //得到选中的数据
+            if (data.length < 1) {
+                parent.layer.msg("请选择要设置的项");
+            } else {
+                var ids = "";
+                $.each(data, function (index, value) {
+                    ids += data[index].Id + ",";
+                });
+                ids = ids.substring(0, ids.length - 1);
+                var index = layer.confirm('确定批量设置完成记录吗?', function (index) {
+                    $.ajax({
+                        type: "POST",
+                        url: "/Admin/StoreHouseAmountRecord/BatchSetting?r=" + Math.random(1),
+                        data: "Id=" + ids,
+                        dataType: "text",
+                        success: function (data) {
+                            layer.close(index);
+                            if (data == "success") {
+                                table.reload('LAY-list-manage');
+                            } else {
+                                layer.msg(data);
+                            }
+                        }
+                    });
+                });
+            }
+        }
+        , Close: function () {
+            var checkStatus = table.checkStatus('LAY-list-manage')
+                , data = checkStatus.data; //得到选中的数据
+            if (data.length < 1) {
+                parent.layer.msg("请选择要关闭的项");
+            } else {
+                var ids = "";
+                $.each(data, function (index, value) {
+                    ids += data[index].Id + ",";
+                });
+                ids = ids.substring(0, ids.length - 1);
+                var index = layer.confirm('确定要关闭吗?', function (index) {
+                    $.ajax({
+                        type: "POST",
+                        url: "/Admin/StoreHouseAmountRecord/Close?r=" + Math.random(1),
+                        data: "Id=" + ids,
+                        dataType: "text",
+                        success: function (data) {
+                            layer.close(index);
+                            if (data == "success") {
+                                table.reload('LAY-list-manage');
+                            } else {
+                                layer.msg(data);
+                            }
+                        }
+                    });
+                });
+            }
+        }
+    };
+
+    $('.layui-btn').on('click', function () {
+        var type = $(this).data('type');
+        active[type] ? active[type].call(this) : '';
+    });
+});

+ 13 - 1
wwwroot/layuiadmin/modules_main/StoreHouse_Admin.js

@@ -280,6 +280,16 @@ layui.config({
                 width: 110,
                 title: '担保额度',
                 sort: true
+            }, {
+                field: 'ThisMonthPreAmount',
+                width: 150,
+                title: '本月小分仓额度',
+                sort: true
+            }, {
+                field: 'ValidPreAmount',
+                width: 150,
+                title: '可用小分仓额度',
+                sort: true
             }
             , {
                 title: '操作',
@@ -488,8 +498,10 @@ layui.config({
         }
     });
     form.on('submit(LAY-list-front-searchall)', function (data) {
+        var field = data.field;
+        field.ShowFlag = 1;
         table.reload('LAY-list-manage', {
-            where: null,
+            where: field,
             page: {
                 curr: 1
             }

+ 4 - 0
wwwroot/layuiadmin/modules_main/UserAccount_Admin.js

@@ -106,6 +106,10 @@ layui.config({
                 { field: 'TotalAmount', width: 120, title: '账户总金额' ,sort: true},
                 { field: 'FreezeAmount', width: 110, title: '冻结金额' ,sort: true},
                 { field: 'BalanceAmount', width: 110, title: '余额' ,sort: true},
+                { field: 'TempAmount', width: 110, title: '支付宝临时额度' ,sort: true},
+                { field: 'TempAmountForBalance', width: 110, title: '余额临时额度' ,sort: true},
+                { field: 'ThisMonthPreAmount', width: 110, title: '本月预发额度' ,sort: true},
+                { field: 'ValidPreAmount', width: 110, title: '可用预发额度' ,sort: true},
                 { field: 'AccountStatusName', width: 110, title: '账户状态' ,sort: true},
                 { field: 'SeoDescription', width: 100, title: '备注' ,sort: true},
                 // { field: 'CreateDate', width: 200, title: '创建时间' ,sort: true},

+ 29 - 0
wwwroot/layuiadmin/modules_main/UserCashRecord_Admin.js

@@ -551,6 +551,35 @@ layui.config({
                 }
             });
         },
+        BatchSetting: function () {
+            var checkStatus = table.checkStatus('LAY-list-manage'),
+                data = checkStatus.data; //得到选中的数据
+            if (data.length < 1) {
+                parent.layer.msg("请选择要设置的项");
+            } else {
+                var ids = "";
+                $.each(data, function (index, value) {
+                    ids += data[index].Id + ",";
+                });
+                ids = ids.substring(0, ids.length - 1);
+                var index = layer.confirm('确定要设为成功状态吗?', function (index) {
+                    $.ajax({
+                        type: "POST",
+                        url: "/Admin/UserCashRecord/BatchSetting?r=" + Math.random(1),
+                        data: "Id=" + ids,
+                        dataType: "text",
+                        success: function (data) {
+                            layer.close(index);
+                            if (data == "success") {
+                                table.reload('LAY-list-manage');
+                            } else {
+                                layer.msg(data);
+                            }
+                        }
+                    });
+                });
+            }
+        },
         Open: function () {
             var checkStatus = table.checkStatus('LAY-list-manage'),
                 data = checkStatus.data; //得到选中的数据

Різницю між файлами не показано, бо вона завелика
+ 0 - 0
wwwroot/other/oss/upload-min-oss.js


+ 2 - 2
wwwroot/other/oss/upload-min-oss.jsold

@@ -23,8 +23,8 @@ const client = new OSS({
     // yourRegion填写Bucket所在地域。以华东1(杭州)为例,yourRegion填写为oss-cn-hangzhou。
     region: 'oss-cn-chengdu',
     // 从STS服务获取的临时访问密钥(AccessKey ID和AccessKey Secret)。
-    accessKeyId: 'LTAI5t7ivibdYZTro4SRVZ9M',
-    accessKeySecret: 'nfr1bmbJbMhLuaj10iBORkuFfIAX7M',
+    accessKeyId: 'LTAI5tAp9ASZtq4wYzuXfeer',
+    accessKeySecret: 'N0o6TwowU8r4aeNWoefMnnus9Q2saW',
     // 从STS服务获取的安全令牌(SecurityToken)。
     //- stsToken: 'yourSecurityToken',
     // 填写Bucket名称。

Деякі файли не було показано, через те що забагато файлів було змінено