Преглед изворни кода

Merge branch 'DuGuYang' of http://47.109.31.237:13000/kxs-end/admin-server into feature-dgy-后台优化

DuGuYang пре 3 година
родитељ
комит
701b3ff52a
42 измењених фајлова са 2398 додато и 143 уклоњено
  1. 90 0
      AppStart/SetDesposit.cs
  2. 4 4
      Areas/Admin/Controllers/MainServer/HelpProfitExchangeController.cs
  3. 4 4
      Areas/Admin/Controllers/MainServer/HelpProfitExchangeDetailController.cs
  4. 8 8
      Areas/Admin/Controllers/MainServer/MachineChangeController.cs
  5. 2 2
      Areas/Admin/Controllers/MainServer/MerchantDepositReturnsController.cs
  6. 4 4
      Areas/Admin/Controllers/MainServer/OrdersController.cs
  7. 8 8
      Areas/Admin/Controllers/MainServer/PosMachinesFeeChangeRecordController.cs
  8. 211 19
      Areas/Admin/Controllers/MainServer/PreSendStockDetailController.cs
  9. 1 1
      Areas/Admin/Controllers/MainServer/ProfitRewardRecordController.cs
  10. 4 4
      Areas/Admin/Controllers/MainServer/SchoolSignInRecordController.cs
  11. 4 4
      Areas/Admin/Controllers/MainServer/SchoolSignInTaskRecordController.cs
  12. 327 16
      Areas/Admin/Controllers/MainServer/StoreHouseAmountRecordController.cs
  13. 5 1
      Areas/Admin/Controllers/MainServer/StoreHouseController.cs
  14. 4 4
      Areas/Admin/Controllers/MainServer/StoreMachineApplyController.cs
  15. 67 32
      Areas/Admin/Controllers/MainServer/SysToolsController.cs
  16. 8 8
      Areas/Admin/Controllers/MainServer/TeamApplyController.cs
  17. 4 4
      Areas/Admin/Controllers/MainServer/TeamDayTopController.cs
  18. 4 4
      Areas/Admin/Views/MainServer/PreSendStockDetail/Index.cshtml
  19. 237 0
      Areas/Admin/Views/MainServer/PreSendStockDetail/Indexs.cshtml
  20. 12 3
      Areas/Admin/Views/MainServer/StoreHouseAmountRecord/Index.cshtml
  21. 156 0
      Areas/Admin/Views/MainServer/StoreHouseAmountRecord/Indexs.cshtml
  22. 3 0
      Models/HelpProfitReward.cs
  23. 3 0
      Models/HelpProfitRewardDetail.cs
  24. 1 0
      Models/PreSendStockDetail.cs
  25. 3 0
      Models/ProfitRewardExport.cs
  26. 3 0
      Models/ProfitSubsidyExport.cs
  27. 3 0
      Models/SchoolMakerStudy.cs
  28. 3 0
      Models/SchoolMorningMeet.cs
  29. 3 0
      Models/SchoolMorningMeetLog.cs
  30. 24 0
      Models/SmallStoreQuotaRecord.cs
  31. 3 3
      Models/StoreHouseAmountPromiss.cs
  32. 1 0
      Models/StoreHouseAmountRecord.cs
  33. 35 0
      Models/SubsidyRecord.cs
  34. 4 0
      Models/UserAccount.cs
  35. 249 0
      Models/WebCMSEntities.cs
  36. 7 7
      wwwroot/layuiadmin/modules_main/PreSendStockDetail_Admin.js
  37. 451 0
      wwwroot/layuiadmin/modules_main/PreSendStockDetails_Admin.js
  38. 1 1
      wwwroot/layuiadmin/modules_main/SmallStoreHouse_Admin.js
  39. 3 2
      wwwroot/layuiadmin/modules_main/StoreHouseAmountRecord_Admin.js
  40. 420 0
      wwwroot/layuiadmin/modules_main/StoreHouseCardAmountRecord_Admin.js
  41. 10 0
      wwwroot/layuiadmin/modules_main/StoreHouse_Admin.js
  42. 4 0
      wwwroot/layuiadmin/modules_main/UserAccount_Admin.js

+ 90 - 0
AppStart/SetDesposit.cs

@@ -0,0 +1,90 @@
+using System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Threading;
+using MySystem.Models;
+using Library;
+
+namespace MySystem
+{
+    /// <summary>
+    /// 设置预发机超过30天预发押金自动扣减
+    /// </summary>
+    public class SetDesposit
+    {
+        public readonly static SetDesposit Instance = new SetDesposit();
+        private SetDesposit()
+        { }
+
+        public void Start()
+        {
+            Thread th = new Thread(doSomething);
+            th.IsBackground = true;
+            th.Start();
+        }
+
+        public void doSomething()
+        {
+            while (true)
+            {
+                if (DateTime.Now.Hour > 0 && DateTime.Now.Hour < 17)
+                {
+                    try
+                    {
+                        string check = function.ReadInstance("/SetDesposit/check" + DateTime.Now.ToString("yyyy-MM-dd") + ".txt");
+                        if (string.IsNullOrEmpty(check))
+                        {
+                            function.WritePage("/SetDesposit/", "check" + DateTime.Now.ToString("yyyy-MM-dd") + ".txt", DateTime.Now.ToString("HH:mm:ss"));
+                            WebCMSEntities db = new WebCMSEntities();
+                            var date = DateTime.Now.AddDays(-30);
+                            bool op = true;
+                            while (op)
+                            {
+                                var smallPos = db.PreSendStockDetail.Where(m => m.Status == 1 && m.Sort == 0 && m.CreateDate <= date && m.ApplyFlag == 0).ToList();
+                                foreach (var item in smallPos)
+                                {
+                                    var tuserAccount = db.UserAccount.FirstOrDefault(m => m.Id == item.ToUserId) ?? new UserAccount();
+                                    var brandInfo = db.KqProducts.FirstOrDefault(m => m.Id == item.BrandId);
+                                    var amount = 0;
+                                    if (brandInfo.Name.Contains("电签"))
+                                    {
+                                        amount = 200;
+                                    }
+                                    if (brandInfo.Name.Contains("大POS"))
+                                    {
+                                        amount = 300;
+                                    }
+                                    if (tuserAccount.Id > 0)
+                                    {
+                                        tuserAccount.SmallStoreDeposit += amount;//添加小分仓押金
+                                        var add = db.UserAccountRecord.Add(new UserAccountRecord()
+                                        {
+                                            CreateDate = DateTime.Now,
+                                            Remark = "小分仓押金暂扣",
+                                            ChangeType = 63,
+                                            BeforeBalanceAmount = tuserAccount.SmallStoreDeposit - amount, //变更前余额
+                                            AfterBalanceAmount = tuserAccount.SmallStoreDeposit, //变更后余额
+                                            ChangeAmount = amount, //变更金额
+                                            UserId = item.ToUserId,
+
+                                        }).Entity;
+                                        db.SaveChanges();
+                                    }
+                                    item.Sort = 1;
+                                    db.SaveChanges();
+                                }
+                            }
+                            db.Dispose();
+                        }
+                    }
+                    catch (Exception ex)
+                    {
+                        function.WriteLog(DateTime.Now.ToString() + ":" + ex.ToString(), "设置预发机超过30天预发押金自动扣减异常");
+                    }
+                }
+                Thread.Sleep(5000);
+            }
+        }
+    }
+}

+ 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))

+ 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))

+ 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
+
     }
 }

+ 1 - 1
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>();

+ 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))

+ 327 - 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,302 @@ 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"] = "失败";
+
+            }
+            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;
+                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 + ")");
+            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
+
     }
 }

+ 5 - 1
Areas/Admin/Controllers/MainServer/StoreHouseController.cs

@@ -178,9 +178,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 +191,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 + "')";
             }
 
 

+ 67 - 32
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;
@@ -2198,27 +2233,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 +2279,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 +2511,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 +2519,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 +2589,7 @@ namespace MySystem.Areas.Admin.Controllers
                 return "商户不存在";
             }
             bool check = db.OpenRewardDetail.Any(m => m.SnNo == pos.PosSn);
-            if(check)
+            if (check)
             {
                 return "开机奖励已发放,请勿重复操作";
             }
@@ -2705,15 +2740,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 +2758,7 @@ namespace MySystem.Areas.Admin.Controllers
             db.Dispose();
             return "操作失败";
         }
-        
+
         #endregion
 
         #region 查询机具流量费分佣
@@ -2741,7 +2776,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 +2784,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 +2847,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 +3006,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 + "')";
             }
 
 

+ 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>

+ 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; }

+ 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)

+ 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) : '';
+    });
+});

+ 10 - 0
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: '操作',

+ 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},