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

Merge branch 'feature-dgy-盟主储蓄金变动记录新增变动类型' into feature-dgy-后台测试

# Conflicts:
#	Areas/Admin/Views/MainServer/SysTools/CancelMerAgent.cshtml
DuGuYang пре 3 година
родитељ
комит
7a8a183d06

+ 67 - 0
AppStart/Helper/LeaderAmountMonthChangeQueue.cs

@@ -0,0 +1,67 @@
+using System;
+using System.Collections.Generic;
+using System.Threading;
+using System.Linq;
+using System.Data;
+using MySystem;
+using MySystem.Models;
+using Library;
+using LitJson;
+
+/// <summary>
+/// 每月一号记录上月盟主储蓄金和可提现余额
+/// </summary>
+public class LeaderAmountMonthChangeQueue
+{
+    public readonly static LeaderAmountMonthChangeQueue Instance = new LeaderAmountMonthChangeQueue();
+    private LeaderAmountMonthChangeQueue()
+    {
+    }
+
+    public void Start()
+    {
+        Thread th = new Thread(StartDo);
+        th.IsBackground = true;
+        th.Start();
+    }
+
+    private void StartDo()
+    {
+        while (true)
+        {
+            // if (DateTime.Now.Day == 1)
+            if (DateTime.Now.Hour < 18)
+            {
+                try
+                {
+                    string check = function.ReadInstance("/LeaderAmountMonthChange/check" + DateTime.Now.ToString("yyyy-MM-dd") + ".txt");
+                    if (string.IsNullOrEmpty(check))
+                    {
+                        function.WritePage("/LeaderAmountMonthChange/", "check" + DateTime.Now.ToString("yyyy-MM-dd") + ".txt", DateTime.Now.ToString("HH:mm:ss"));
+                        WebCMSEntities db = new WebCMSEntities();
+                        var leaders = db.Leaders.Select(m => new { m.UserId, m.ExpiredDate }).ToList();
+                        foreach (var item in leaders)
+                        {
+                            var userAccount = db.UserAccount.FirstOrDefault(m => m.Id == item.UserId) ?? new UserAccount();
+                            var leaderInfo = db.Leaders.FirstOrDefault(m => m.Id == item.UserId) ?? new Leaders();
+                            db.LeaderReconRecord.Add(new LeaderReconRecord()
+                            {
+                                CreateDate = DateTime.Now,
+                                UserId = item.UserId,
+                                StatMonth = DateTime.Now.ToString("yyyy-MM"),
+                                ReserveAmount = userAccount.LeaderReserve,
+                                BalanceAmount = userAccount.LeaderBalanceAmount
+                            });
+                            db.SaveChanges();
+                        }
+                    }
+                }
+                catch (Exception ex)
+                {
+                    function.WriteLog(DateTime.Now.ToString() + "\n" + ex.ToString(), "每月一号记录上月盟主储蓄金和可提现余额线程异常");
+                }
+            }
+            Thread.Sleep(1000);
+        }
+    }
+}

+ 5 - 5
AppStart/Helper/SycnProfitServiceV3.cs

@@ -272,14 +272,14 @@ namespace MySystem
             CustomerSqlConn.op("update UserAccount a set BalanceAmount=BalanceAmount+(select ProfitRate from UserProfit where Id=a.Id),TotalAmount=TotalAmount+(select ProfitRate from UserProfit where Id=a.Id) where Id in (select Id from UserProfit)", conn);
 
             string Month = DateTime.Now.AddDays(-90).ToString("yyyy-MM");
-            
-            CustomerSqlConn.op("insert into UserAccountRecord (CreateDate,UpdateDate,UserId,ChangeType,ChangeAmount,BeforeTotalAmount,AfterTotalAmount,BeforeFreezeAmount,AfterFreezeAmount,BeforeBalanceAmount,AfterBalanceAmount) select now(),now(),Id,125,BalanceAmount,TotalAmount BeforeTotalAmount,TotalAmount AfterTotalAmount,FreezeAmount,FreezeAmount,BalanceAmount BeforeBalanceAmount,BalanceAmount-BalanceAmount AfterBalanceAmount from UserAccount where Id in (select Id from Users where AuthFlag=1 and AuthDate<'" + Month + "-01 00:00:00') and BalanceAmount>0 and BalanceAmount<10", conn);
 
-            CustomerSqlConn.op("insert into UserAccountRecord (CreateDate,UpdateDate,UserId,ChangeType,ChangeAmount,BeforeTotalAmount,AfterTotalAmount,BeforeFreezeAmount,AfterFreezeAmount,BeforeBalanceAmount,AfterBalanceAmount) select now(),now(),Id,125,10,TotalAmount BeforeTotalAmount,TotalAmount AfterTotalAmount,FreezeAmount,FreezeAmount,BalanceAmount BeforeBalanceAmount,BalanceAmount-10 AfterBalanceAmount from UserAccount where Id in (select Id from Users where AuthFlag=1 and AuthDate<'" + Month + "-01 00:00:00') and BalanceAmount>=10;", conn);
+            CustomerSqlConn.op("update UserAccount a set BalanceAmount=0 where Id in (select Id from Users where AuthFlag=1 and AuthDate<'" + Month + "-01 00:00:00') and Id not in (select UserId from PosMachinesTwo where `Status`>-1 and BuyUserId!=UserId and UserId not in (select UserId from PullnewSummary) and UserId not in (select BuyUserId from PosMachinesTwo where `Status`>-1)) and BalanceAmount>0 and BalanceAmount<10", conn);
 
-            CustomerSqlConn.op("update UserAccount a set BalanceAmount=0 where Id in (select Id from Users where AuthFlag=1 and AuthDate<'" + Month + "-01 00:00:00') and BalanceAmount>0 and BalanceAmount<10", conn);
+            CustomerSqlConn.op("update UserAccount a set BalanceAmount=BalanceAmount-10 where Id in (select Id from Users where AuthFlag=1 and AuthDate<'" + Month + "-01 00:00:00') and Id not in (select UserId from PosMachinesTwo where `Status`>-1 and BuyUserId!=UserId and UserId not in (select UserId from PullnewSummary) and UserId not in (select BuyUserId from PosMachinesTwo where `Status`>-1)) and BalanceAmount>=10", conn);
+            
+            CustomerSqlConn.op("insert into UserAccountRecord (CreateDate,UpdateDate,UserId,ChangeType,ChangeAmount,BeforeTotalAmount,AfterTotalAmount,BeforeFreezeAmount,AfterFreezeAmount,BeforeBalanceAmount,AfterBalanceAmount) select now(),now(),Id,125,BalanceAmount,TotalAmount BeforeTotalAmount,TotalAmount AfterTotalAmount,FreezeAmount,FreezeAmount,BalanceAmount BeforeBalanceAmount,BalanceAmount-BalanceAmount AfterBalanceAmount from UserAccount where Id in (select Id from Users where AuthFlag=1 and AuthDate<'" + Month + "-01 00:00:00') and Id not in (select UserId from PosMachinesTwo where `Status`>-1 and BuyUserId!=UserId and UserId not in (select UserId from PullnewSummary) and UserId not in (select BuyUserId from PosMachinesTwo where `Status`>-1)) and BalanceAmount>0 and BalanceAmount<10", conn);
 
-            CustomerSqlConn.op("update UserAccount a set BalanceAmount=BalanceAmount-10 where Id in (select Id from Users where AuthFlag=1 and AuthDate<'" + Month + "-01 00:00:00') and BalanceAmount>=10", conn);
+            CustomerSqlConn.op("insert into UserAccountRecord (CreateDate,UpdateDate,UserId,ChangeType,ChangeAmount,BeforeTotalAmount,AfterTotalAmount,BeforeFreezeAmount,AfterFreezeAmount,BeforeBalanceAmount,AfterBalanceAmount) select now(),now(),Id,125,10,TotalAmount BeforeTotalAmount,TotalAmount AfterTotalAmount,FreezeAmount,FreezeAmount,BalanceAmount BeforeBalanceAmount,BalanceAmount-10 AfterBalanceAmount from UserAccount where Id in (select Id from Users where AuthFlag=1 and AuthDate<'" + Month + "-01 00:00:00') and Id not in (select UserId from PosMachinesTwo where `Status`>-1 and BuyUserId!=UserId and UserId not in (select UserId from PullnewSummary) and UserId not in (select BuyUserId from PosMachinesTwo where `Status`>-1)) and BalanceAmount>=10;", conn);
         }
 
         #endregion

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

@@ -106,6 +106,12 @@ namespace MySystem.Areas.Admin.Controllers
                     dic["SourceMakerCode"] = sourceUser.MakerCode;
                     dic.Remove("SourceUserId");
                 }
+
+                //变动类型
+                int ChangeType = int.Parse(function.CheckInt(dic["ChangeType"].ToString()));
+                if (ChangeType == 1) dic["ChangeTypeName"] = "增加";
+                if (ChangeType == 2) dic["ChangeTypeName"] = "减少";
+
                 // else
                 // {
                 //     int OrderId = int.Parse(function.CheckInt(dic["OrderId"].ToString()));
@@ -214,7 +220,7 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 SqlString += " and SeoKeyword=" + SeoKeyword;
             }
-            var Sql = "SELECT c.MakerCode '创客编号',c.RealName '创客姓名',DATE_FORMAT(c.CreateDate,'%Y-%m-%d %H:%i:%s') '创建时间',c.Remark '变动类型',c.Type1Num '电签兑换券张数',c.Type2Num '大POS兑换券张数',d.LeaderBalanceAmount '可提现余额',c.ChangeAmt '使用额度',c.BeforeAmt '使用前剩余额度',c.AfterAmt '使用后剩余额度' FROM(SELECT a.*,b.MakerCode,b.RealName FROM(SELECT Id,UserId,CreateDate,ChangeAmt,BeforeAmt,AfterAmt,Remark,REPLACE (JSON_EXTRACT (SeoTitle, '$[0].Num'),'\\\"','') AS 'Type1Num', REPLACE (JSON_EXTRACT (SeoTitle, '$[1].Num'),'\\\"','') AS 'Type2Num' FROM LeaderReserveRecord WHERE 1=1 " + SqlString + ") a LEFT JOIN Users b ON a.UserId=b.Id) c LEFT JOIN UserAccount d ON c.UserId=d.Id";
+            var Sql = "SELECT c.MakerCode '创客编号',c.RealName '创客姓名',DATE_FORMAT(c.CreateDate,'%Y-%m-%d %H:%i:%s') '创建时间',c.Remark '变动类型',(CASE WHEN c.ChangeType=1 THEN '增加' WHEN c.ChangeType=2 THEN '减少' ELSE '' end) '操作类型',c.Type1Num '电签兑换券张数',c.Type2Num '大POS兑换券张数',d.LeaderBalanceAmount '可提现余额',c.ChangeAmt '使用额度',c.BeforeAmt '使用前剩余额度',c.AfterAmt '使用后剩余额度' FROM(SELECT a.*,b.MakerCode,b.RealName FROM(SELECT Id,UserId,CreateDate,ChangeAmt,BeforeAmt,AfterAmt,Remark,ChangeType,REPLACE (JSON_EXTRACT (SeoTitle, '$[0].Num'),'\\\"','') AS 'Type1Num', REPLACE (JSON_EXTRACT (SeoTitle, '$[1].Num'),'\\\"','') AS 'Type2Num' FROM LeaderReserveRecord WHERE 1=1 " + SqlString + ") a LEFT JOIN Users b ON a.UserId=b.Id) c LEFT JOIN UserAccount d ON c.UserId=d.Id";
             var sysAdmin = bsdb.SysAdmin.FirstOrDefault(m => m.AdminName == SysUserName && m.Status > -1);
             var FileName = "盟主储蓄金变动记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
             string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + Sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"}";
@@ -282,6 +288,11 @@ namespace MySystem.Areas.Admin.Controllers
                 dic["Remark"] = leaderReserveRecord.Remark;
                 dic["CreateDate"] = leaderReserveRecord.CreateDate;
 
+                //变动类型
+                int ChangeType = leaderReserveRecord.ChangeType;
+                if (ChangeType == 1) dic["ChangeTypeName"] = "增加";
+                if (ChangeType == 2) dic["ChangeTypeName"] = "减少";
+
                 // //盟主等级
                 // int LeaderLevel = userid_Users.LeaderLevel;
                 // if (LeaderLevel == 1) dic["LeaderLevel"] = "小盟主";
@@ -320,6 +331,7 @@ namespace MySystem.Areas.Admin.Controllers
             ReturnFields.Add("RealName", "创客姓名");
             ReturnFields.Add("CreateDate", "创建时间");
             ReturnFields.Add("Remark", "变动类型");
+            ReturnFields.Add("ChangeTypeName", "操作类型");
             ReturnFields.Add("dPosCoupons", "电签兑换券张数");
             ReturnFields.Add("bPosCoupons", "大POS兑换券张数");
             ReturnFields.Add("LeaderBalanceAmount", "可提现余额");

+ 107 - 3
Areas/Admin/Controllers/MainServer/LeadersController.cs

@@ -119,6 +119,10 @@ namespace MySystem.Areas.Admin.Controllers
                 dic["UserIdRealName"] = userid_Users.RealName;
                 dic["LeaderReserve"] = userAccount.LeaderReserve;
                 dic["LeaderBalanceAmount"] = userAccount.LeaderBalanceAmount;
+                var lastMonth = DateTime.Now.AddMonths(-1).ToString("yyyy-MM");
+                var leaderReconRecord = db.LeaderReconRecord.FirstOrDefault(m => m.UserId == UserId && m.StatMonth == lastMonth) ?? new LeaderReconRecord();
+                dic["LastMonthReserve"] = leaderReconRecord.ReserveAmount;
+                dic["LastMonthBalanceAmount"] = leaderReconRecord.BalanceAmount;
 
                 var ExpiredDate = DateTime.Parse(dic["ExpiredDate"].ToString());
                 if (ExpiredDate > DateTime.Now)
@@ -569,13 +573,13 @@ namespace MySystem.Areas.Admin.Controllers
         /// 导出Excel
         /// </summary>
         /// <returns></returns>
-        public JsonResult ExportExcel(Leaders data, string UserIdMakerCode, string CreateDateData, string LeaderLevelSelect)
+        public JsonResult ExportExcel(Leaders data, string UserIdMakerCode, string LeaderLevelSelect, string LeaderStatusSelect, string LastBuyDateData, string ExpiredDateData, string CreateDateData)
         {
             Dictionary<string, string> Fields = new Dictionary<string, string>();
 
 
             string condition = " and Status>-1";
-            //创客创客编号
+            //创客编号
             if (!string.IsNullOrEmpty(UserIdMakerCode))
             {
                 condition += " and UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
@@ -585,7 +589,20 @@ namespace MySystem.Areas.Admin.Controllers
             {
                 condition += " and LeaderLevel=" + LeaderLevelSelect;
             }
-            //创建时间
+            //状态
+            if (!string.IsNullOrEmpty(LeaderStatusSelect))
+            {
+                var time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+                if (LeaderStatusSelect == "0")
+                {
+                    condition += " and ExpiredDate>'" + time + "'";
+                }
+                else
+                {
+                    condition += " and ExpiredDate<='" + time + "'";
+                }
+            }
+            //首次购买时间
             if (!string.IsNullOrEmpty(CreateDateData))
             {
                 string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
@@ -593,6 +610,22 @@ namespace MySystem.Areas.Admin.Controllers
                 string end = datelist[1];
                 condition += " and CreateDate>='" + start + " 00:00:00' and CreateDate<='" + end + " 23:59:59'";
             }
+            //最后购买时间
+            if (!string.IsNullOrEmpty(LastBuyDateData))
+            {
+                string[] datelist = LastBuyDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                condition += " and LastBuyDate>='" + start + " 00:00:00' and LastBuyDate<='" + end + " 23:59:59'";
+            }
+            //盟主到期时间
+            if (!string.IsNullOrEmpty(ExpiredDateData))
+            {
+                string[] datelist = ExpiredDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                condition += " and ExpiredDate>='" + start + " 00:00:00' and ExpiredDate<='" + end + " 23:59:59'";
+            }
 
 
             Dictionary<string, object> obj = new AdminContentOther(_accessor.HttpContext, PublicFunction.MainTables).IndexData("Leaders", Fields, "Id desc", "0", 1, 20000, condition, "UserId,LeaderLevel,CreateDate", false);
@@ -630,5 +663,76 @@ namespace MySystem.Areas.Admin.Controllers
 
         #endregion
 
+
+        #region 快捷导出Excel
+        public IActionResult QuickExportExcel(string right)
+        {
+            ViewBag.RightInfo = RightInfo;
+            ViewBag.right = right;
+
+            return View();
+        }
+
+        [HttpPost]
+        public string QuickExportExcelDo(string UserIdMakerCode, string LeaderLevelSelect, string LeaderStatusSelect, string LastBuyDateData, string ExpiredDateData, string CreateDateData)
+        {
+            var lastMonth = DateTime.Now.AddMonths(-1).ToString("yyyy-MM");
+            string condition = " and a.Status>-1 and d.StatMonth='" + lastMonth + "'";
+            //创客编号
+            if (!string.IsNullOrEmpty(UserIdMakerCode))
+            {
+                condition += " and a.UserId in (select UserId from UserForMakerCode where MakerCode='" + UserIdMakerCode + "')";
+            }
+            //盟主等级
+            if (!string.IsNullOrEmpty(LeaderLevelSelect))
+            {
+                condition += " and a.LeaderLevel=" + LeaderLevelSelect;
+            }
+            //状态
+            if (!string.IsNullOrEmpty(LeaderStatusSelect))
+            {
+                var time = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+                if (LeaderStatusSelect == "0")
+                {
+                    condition += " and a.ExpiredDate>'" + time + "'";
+                }
+                else
+                {
+                    condition += " and a.ExpiredDate<='" + time + "'";
+                }
+            }
+            //首次购买时间
+            if (!string.IsNullOrEmpty(CreateDateData))
+            {
+                string[] datelist = CreateDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                condition += " and a.CreateDate>='" + start + " 00:00:00' and a.CreateDate<='" + end + " 23:59:59'";
+            }
+            //最后购买时间
+            if (!string.IsNullOrEmpty(LastBuyDateData))
+            {
+                string[] datelist = LastBuyDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                condition += " and a.LastBuyDate>='" + start + " 00:00:00' and a.LastBuyDate<='" + end + " 23:59:59'";
+            }
+            //盟主到期时间
+            if (!string.IsNullOrEmpty(ExpiredDateData))
+            {
+                string[] datelist = ExpiredDateData.Split(new string[] { " - " }, StringSplitOptions.None);
+                string start = datelist[0];
+                string end = datelist[1];
+                condition += " and a.ExpiredDate>='" + start + " 00:00:00' and a.ExpiredDate<='" + end + " 23:59:59'";
+            }
+            var Sql = "SELECT c.MakerCode '创客编号',c.RealName '真实姓名',DATE_FORMAT(a.CreateDate,'%Y-%m-%d %H:%i:%s') '首次购买时间',DATE_FORMAT(a.LastBuyDate,'%Y-%m-%d %H:%i:%s') '最后购买时间',DATE_FORMAT(a.ExpiredDate,'%Y-%m-%d %H:%i:%s') '盟主到期时间',(CASE WHEN a.ExpiredDate>NOW() THEN '未过期' ELSE '已过期' end) '状态',(CASE WHEN a.LeaderLevel=1 THEN '小盟主' WHEN a.LeaderLevel=2 THEN '大盟主' ELSE '' end) '盟主等级',b.LeaderReserve '盟主储蓄金',b.LeaderBalanceAmount '盟主可提现余额',d.ReserveAmount '上月盟主储蓄金',d.BalanceAmount '上月可提现余额' FROM Leaders a LEFT JOIN UserAccount b ON a.Id=b.Id LEFT JOIN Users c ON a.Id=c.Id LEFT JOIN LeaderReconRecord d ON a.Id=d.UserId WHERE 1=1" + condition;
+            var sysAdmin = bsdb.SysAdmin.FirstOrDefault(m => m.AdminName == SysUserName && m.Status > -1);
+            var FileName = "盟主记录" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
+            string SendData = "{\"Operater\":\"" + sysAdmin.Id + "\",\"SqlString\":\"" + Sql + "\",\"FileName\":\"" + FileName + "\",\"MaxCount\":\"0\"}";
+            RedisDbconn.Instance.AddList("ExportQueue", SendData);
+            return "success";
+        }
+        #endregion
+
     }
 }

+ 6 - 2
Areas/Admin/Controllers/MainServer/PosMachinesTwoController.cs

@@ -168,6 +168,7 @@ namespace MySystem.Areas.Admin.Controllers
                 dic["StoreIdName"] = storeid_StoreHouse.StoreName;
                 dic.Remove("StoreId");
                 //产品类型
+                var BId = int.Parse(dic["BrandId"].ToString());
                 dic["BrandId"] = RelationClass.GetKqProductBrandInfo(int.Parse(dic["BrandId"].ToString()));
                 //参加活动
                 dic["ActivityList"] = RelationClass.GetProfitObjectsActivesList(dic["ActivityList"].ToString());
@@ -202,7 +203,8 @@ namespace MySystem.Areas.Admin.Controllers
 
                 //实际押金
                 string SeoKeyword = dic["SeoKeyword"].ToString();
-                if (SeoKeyword.Length > 3)
+                var brand = db.KqProducts.FirstOrDefault(m => m.Id == BId) ?? new KqProducts();
+                if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(SeoKeyword))
                 {
                     SeoKeyword = (decimal.Parse(SeoKeyword) / 100).ToString();
                 }
@@ -846,6 +848,7 @@ namespace MySystem.Areas.Admin.Controllers
                 dic["StoreIdName"] = storeid_StoreHouse.StoreName;
                 dic.Remove("StoreId");
                 //产品类型
+                var BId = int.Parse(dic["BrandId"].ToString());
                 dic["BrandId"] = RelationClass.GetKqProductBrandInfo(int.Parse(dic["BrandId"].ToString()));
                 decimal ScanQrTrade = decimal.Parse(dic["ScanQrTrade"].ToString());
                 var brandInfo = dic["BrandId"].ToString();
@@ -904,7 +907,8 @@ namespace MySystem.Areas.Admin.Controllers
 
                 //实际押金
                 string SeoKeyword = dic["SeoKeyword"].ToString();
-                if (SeoKeyword.Length > 2)
+                var brand = db.KqProducts.FirstOrDefault(m => m.Id == BId) ?? new KqProducts();
+                if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(SeoKeyword))
                 {
                     SeoKeyword = (decimal.Parse(SeoKeyword) / 100).ToString();
                 }

+ 16 - 26
Areas/Admin/Controllers/MainServer/PosMerchantInfoListController.cs

@@ -263,17 +263,11 @@ namespace MySystem.Areas.Admin.Controllers
                 var pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == KqSnNo) ?? new PosMachinesTwo();
 
                 //实际押金
-                string SeoKeyword = "0";
-                if (!string.IsNullOrEmpty(pos.SeoKeyword))
+                string SeoKeyword = pos.SeoKeyword;
+                var brand = db.KqProducts.FirstOrDefault(m => m.Id == pos.BrandId) ?? new KqProducts();
+                if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(SeoKeyword))
                 {
-                    if (pos.BrandId != 2 && pos.BrandId != 7 && pos.BrandId != 10 && pos.BrandId != 11)
-                    {
-                        SeoKeyword = (decimal.Parse(pos.SeoKeyword) / 100).ToString();
-                    }
-                    else
-                    {
-                        SeoKeyword = pos.SeoKeyword;
-                    }
+                    SeoKeyword = (decimal.Parse(SeoKeyword) / 100).ToString();
                 }
                 dic["SeoKeyword"] = SeoKeyword;
 
@@ -300,11 +294,12 @@ namespace MySystem.Areas.Admin.Controllers
                 {
                     string KqSnNo = item["KqSnNo"].ToString();
                     var pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == KqSnNo) ?? new PosMachinesTwo();
+                    var brand = db.KqProducts.FirstOrDefault(m => m.Id == pos.BrandId) ?? new KqProducts();
                     if (!string.IsNullOrEmpty(pos.SeoKeyword))
                     {
-                        if (pos.BrandId != 2 && pos.BrandId != 7 && pos.BrandId != 10 && pos.BrandId != 11)
+                        if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(pos.SeoKeyword))
                         {
-                            ReturnAmount += decimal.Parse(pos.SeoKeyword) / 100;
+                            ReturnAmount += (decimal.Parse(pos.SeoKeyword) / 100);
                         }
                         else
                         {
@@ -377,17 +372,10 @@ namespace MySystem.Areas.Admin.Controllers
                 dic.Remove("UserId");
 
                 //实际押金
-                string SeoKeyword = "0";
-                if (!string.IsNullOrEmpty(pos.SeoKeyword))
+                string SeoKeyword = pos.SeoKeyword;
+                if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(SeoKeyword))
                 {
-                    if (pos.BrandId != 2 && pos.BrandId != 7 && pos.BrandId != 10 && pos.BrandId != 11)
-                    {
-                        SeoKeyword = (decimal.Parse(pos.SeoKeyword) / 100).ToString();
-                    }
-                    else
-                    {
-                        SeoKeyword = pos.SeoKeyword;
-                    }
+                    SeoKeyword = (decimal.Parse(SeoKeyword) / 100).ToString();
                 }
                 dic["SeoKeyword"] = SeoKeyword;
             }
@@ -558,10 +546,11 @@ namespace MySystem.Areas.Admin.Controllers
                 foreach (DataRow item in dt.Rows)
                 {
                     var BindMerchantId = item["BindMerchantId"].ToString();
-                    var BrandId = item["BrandId"].ToString();
+                    var BrandId = int.Parse(item["BrandId"].ToString());
                     var PosSn = item["PosSn"].ToString();
                     var SeoKeyword = item["SeoKeyword"].ToString();
-                    if (BrandId != "2" && BrandId != "7")
+                    var brand = db.KqProducts.FirstOrDefault(m => m.Id == BrandId) ?? new KqProducts();
+                    if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(SeoKeyword))
                     {
                         SeoKeyword = (decimal.Parse(SeoKeyword) / 100).ToString();
                     }
@@ -648,10 +637,11 @@ namespace MySystem.Areas.Admin.Controllers
                 foreach (DataRow item in dt.Rows)
                 {
                     var BindMerchantId = item["BindMerchantId"].ToString();
-                    var BrandId = item["BrandId"].ToString();
+                    var BrandId = int.Parse(item["BrandId"].ToString());
                     var PosSn = item["PosSn"].ToString();
                     var SeoKeyword = item["SeoKeyword"].ToString();
-                    if (BrandId != "2" && BrandId != "7")
+                    var brand = db.KqProducts.FirstOrDefault(m => m.Id == BrandId) ?? new KqProducts();
+                    if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(SeoKeyword))
                     {
                         SeoKeyword = (decimal.Parse(SeoKeyword) / 100).ToString();
                     }

+ 5 - 0
Areas/Admin/Controllers/MainServer/StoreMachineApplyController.cs

@@ -540,6 +540,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
                 if (BrandId == 12) FromStoreId = 5907;
+                if (BrandId == 13) FromStoreId = 6381;
                 CheckSendInfo items = checksendInfos.FirstOrDefault(m => m.BrandId == BrandId);
                 if (items == null)
                 {
@@ -571,6 +572,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
                 if (BrandId == 12) FromStoreId = 5907;
+                if (BrandId == 13) FromStoreId = 6381;
                 var brandInfo = db.KqProducts.FirstOrDefault(m => m.Id == BrandIds);
                 CheckSendInfo items = checksendInfos.FirstOrDefault(m => m.BrandId == BrandIds) ?? new CheckSendInfo();
                 if (items.Num > num)
@@ -618,6 +620,8 @@ namespace MySystem.Areas.Admin.Controllers
                     if (BrandId == 9) FromStoreId = 4832;
                     if (BrandId == 10) FromStoreId = 5512;
                     if (BrandId == 11) FromStoreId = 5513;
+                    if (BrandId == 12) FromStoreId = 5907;
+                    if (BrandId == 13) FromStoreId = 6381;
                     if (PosSnList.Contains(SnNo))
                     {
                         error += "以下操作失败" + SnNo + ',' + "该机具重复发货" + '\n';
@@ -658,6 +662,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
                 if (BrandId == 12) FromStoreId = 5907;
+                if (BrandId == 13) FromStoreId = 6381;
                 tostore = db.StoreHouse.FirstOrDefault(m => m.UserId == apply.UserId && m.BrandId == BrandId.ToString() && m.Status > -1 && m.Sort == 0);
                 SendInfo item = sendInfos.FirstOrDefault(m => m.FromStoreId == FromStoreId && m.ToStoreId == tostore.Id && m.BrandId == BrandId);
                 if (item == null)

+ 14 - 18
Areas/Admin/Controllers/MainServer/UsersController.cs

@@ -2552,16 +2552,14 @@ namespace MySystem.Areas.Admin.Controllers
                             var ThirdMakerCode = ""; //次次顶级创客编号
                             var ThirdRealName = ""; //次次顶级创客姓名
                             var mer = db.PosMerchantInfo.FirstOrDefault(m => m.Id == pos.BindMerchantId) ?? new PosMerchantInfo();
-                            if (!string.IsNullOrEmpty(pos.SeoKeyword))
+                            var brand = db.KqProducts.FirstOrDefault(m => m.Id == pos.BrandId) ?? new KqProducts();
+                            if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(pos.SeoKeyword))
                             {
-                                if (pos.BrandId != 2 && pos.BrandId != 7 && pos.BrandId != 10 && pos.BrandId != 11)
-                                {
-                                    SeoKeyword = (decimal.Parse(pos.SeoKeyword) / 100).ToString();
-                                }
-                                else
-                                {
-                                    SeoKeyword = pos.SeoKeyword;
-                                }
+                                SeoKeyword = (decimal.Parse(SeoKeyword) / 100).ToString();
+                            }
+                            else
+                            {
+                                SeoKeyword = pos.SeoKeyword;
                             }
                             var user = db.Users.FirstOrDefault(m => m.Id == pos.BuyUserId) ?? new Users();
                             var userAccount = db.UserAccount.FirstOrDefault(m => m.Id == user.Id) ?? new UserAccount();
@@ -2637,16 +2635,14 @@ namespace MySystem.Areas.Admin.Controllers
                             var ThirdMakerCode = ""; //次次顶级创客编号
                             var ThirdRealName = ""; //次次顶级创客姓名
                             var pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == mer.KqSnNo) ?? new PosMachinesTwo();
-                            if (!string.IsNullOrEmpty(pos.SeoKeyword))
+                            var brand = db.KqProducts.FirstOrDefault(m => m.Id == pos.BrandId) ?? new KqProducts();
+                            if (brand.Id > 0 && brand.SingleDepositApi == 0 && !string.IsNullOrEmpty(pos.SeoKeyword))
                             {
-                                if (pos.BrandId != 2 && pos.BrandId != 7 && pos.BrandId != 10 && pos.BrandId != 11)
-                                {
-                                    SeoKeyword = (decimal.Parse(pos.SeoKeyword) / 100).ToString();
-                                }
-                                else
-                                {
-                                    SeoKeyword = pos.SeoKeyword;
-                                }
+                                SeoKeyword = (decimal.Parse(SeoKeyword) / 100).ToString();
+                            }
+                            else
+                            {
+                                SeoKeyword = pos.SeoKeyword;
                             }
                             var user = db.Users.FirstOrDefault(m => m.Id == pos.BuyUserId) ?? new Users();
                             var userAccount = db.UserAccount.FirstOrDefault(m => m.Id == user.Id) ?? new UserAccount();

+ 4 - 0
Areas/Admin/Controllers/OperateServer/StoreMachineApplyOperateController.cs

@@ -643,6 +643,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
                 if (BrandId == 12) FromStoreId = 5907;
+                if (BrandId == 13) FromStoreId = 6381;
                 CheckSendInfo items = checksendInfos.FirstOrDefault(m => m.BrandId == BrandId);
                 if (items == null)
                 {
@@ -674,6 +675,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
                 if (BrandId == 12) FromStoreId = 5907;
+                if (BrandId == 13) FromStoreId = 6381;
                 var brandInfo = db.KqProducts.FirstOrDefault(m => m.Id == BrandIds);
                 CheckSendInfo items = checksendInfos.FirstOrDefault(m => m.BrandId == BrandIds) ?? new CheckSendInfo();
                 if (items.Num > num)
@@ -706,6 +708,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
                 if (BrandId == 12) FromStoreId = 5907;
+                if (BrandId == 13) FromStoreId = 6381;
                 Models.MachineForSnNo posInfo = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == SnNo) ?? new Models.MachineForSnNo();
                 var pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == posInfo.SnId && m.StoreId == FromStoreId && m.UserId == 0 && m.BuyUserId == 0 && m.PreUserId == 0) ?? new Models.PosMachinesTwo();
                 if (pos.BindingState == 1 || pos.ActivationState == 1)
@@ -774,6 +777,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
                 if (BrandId == 12) FromStoreId = 5907;
+                if (BrandId == 13) FromStoreId = 6381;
                 tostore = db.StoreHouse.FirstOrDefault(m => m.Sort > 0 && m.UserId == apply.UserId && m.BrandId == BrandId.ToString() && m.Status == 1);
                 SendInfo item = sendInfos.FirstOrDefault(m => m.FromStoreId == FromStoreId && m.ToStoreId == tostore.Id && m.BrandId == BrandId);
                 if (item == null)

+ 4 - 0
Areas/Admin/Controllers/OperateServer/StoreMachineApplysOperateController.cs

@@ -540,6 +540,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
                 if (BrandId == 12) FromStoreId = 5907;
+                if (BrandId == 13) FromStoreId = 6381;
                 CheckSendInfo items = checksendInfos.FirstOrDefault(m => m.BrandId == BrandId);
                 if (items == null)
                 {
@@ -571,6 +572,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
                 if (BrandId == 12) FromStoreId = 5907;
+                if (BrandId == 13) FromStoreId = 6381;
                 var brandInfo = db.KqProducts.FirstOrDefault(m => m.Id == BrandIds);
                 CheckSendInfo items = checksendInfos.FirstOrDefault(m => m.BrandId == BrandIds) ?? new CheckSendInfo();
                 if (items.Num > num)
@@ -603,6 +605,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
                 if (BrandId == 12) FromStoreId = 5907;
+                if (BrandId == 13) FromStoreId = 6381;
                 MachineForSnNo posInfo = db.MachineForSnNo.FirstOrDefault(m => m.SnNo == SnNo) ?? new MachineForSnNo();
                 var pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == posInfo.SnId && m.StoreId == FromStoreId && m.UserId == 0 && m.BuyUserId == 0 && m.PreUserId == 0) ?? new PosMachinesTwo();
                 if (pos.BindingState == 1 || pos.ActivationState == 1)
@@ -658,6 +661,7 @@ namespace MySystem.Areas.Admin.Controllers
                 if (BrandId == 10) FromStoreId = 5512;
                 if (BrandId == 11) FromStoreId = 5513;
                 if (BrandId == 12) FromStoreId = 5907;
+                if (BrandId == 13) FromStoreId = 6381;
                 tostore = db.StoreHouse.FirstOrDefault(m => m.Sort > 0 && m.UserId == apply.UserId && m.BrandId == BrandId.ToString() && m.Status == 1);
                 SendInfo item = sendInfos.FirstOrDefault(m => m.FromStoreId == FromStoreId && m.ToStoreId == tostore.Id && m.BrandId == BrandId);
                 if (item == null)

+ 54 - 77
Areas/Admin/Views/MainServer/LeaderReserveRecord/Index.cshtml

@@ -70,98 +70,75 @@
                                 <option value="购机奖励">购机奖励</option>
                             </select>
                         </div>
-                        <div class="layui-inline">
-                            <label class="layui-form-label">订单编号</label>
-                            <div class="layui-input-inline">
-                                <input class="layui-input" type="text" name="SeoKeyword" 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 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>
-                            @if (RightInfo.Contains("," + right + "_export,"))
-                            {
-                                <button class="layui-btn" data-type="ExportExcel"><i
-                                        class="layui-icon layui-icon-export layuiadmin-button-btn"></i>导出</button>
-                            }
+                    </div>
+                    <div class="layui-inline">
+                        <label class="layui-form-label">订单编号</label>
+                        <div class="layui-input-inline">
+                            <input class="layui-input" type="text" name="SeoKeyword" autocomplete="off">
                         </div>
                     </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>
 
-                <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 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>
-
-                    <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>
-                    <script type="text/html" id="table-list-tools">
-
-                <div class="layui-card-body">
-                    <table id="LAY-list-manage" lay-filter="LAY-list-manage"></table>
-                    <script type="text/html" id="table-list-tools">
-                </script>
                 </div>
             </div>
+            <div class="layui-card-body">
+                <div style="padding-bottom: 10px;">
+                    @if (RightInfo.Contains("," + right + "_export,"))
+                    {
+                        <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">
+                    </script>
+            </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 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 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 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 class="layui-form-item ml10">
-                <div class="layui-input-block">
-                    <button type="button" class="layui-btn" onclick="ConfirmImport()">立即导入</button>
-                </div>
+        </div>
+        <div class="layui-form-item ml10">
+            <div class="layui-input-block">
+                <button type="button" class="layui-btn" onclick="ConfirmImport()">立即导入</button>
             </div>
         </div>
-        <script src="/layuiadmin/layui/layui.js"></script>
-        <script
-            src="/layuiadmin/modules_main/LeaderReserveRecord_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
-        <script>
-        </script>
+    </div>
+    <script src="/layuiadmin/layui/layui.js"></script>
+    <script
+        src="/layuiadmin/modules_main/LeaderReserveRecord_Admin.js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+    <script>
+    </script>
 </body>
 
 </html>

+ 1 - 1
Areas/Admin/Views/MainServer/Leaders/Index.cshtml

@@ -115,7 +115,7 @@
                         <button class="layui-btn" data-type="batchdel"><i
                             class="layui-icon layui-icon-delete layuiadmin-button-btn"></i>删除</button>
                     }
-                    @if (RightInfo.Contains("," + right + "_edit,"))
+                    @if (RightInfo.Contains("," + right + "_export,"))
                     {
                         <button class="layui-btn" data-type="ExportExcel"><i
                             class="layui-icon layui-icon-export layuiadmin-button-btn"></i>导出</button>

+ 5 - 6
Areas/Admin/Views/MainServer/SysTools/CancelMerAgent.cshtml

@@ -92,12 +92,11 @@
                                 window.location.reload();
                             });
                         } else {
-                            @* layer.msg(data); *@
-                                layer.msg(data, {
-                                    time: 2000
-                                }, function () {
-                                    table.reload('LAY-list-manage'); //数据刷新
-                                });
+                            layer.msg(data, {
+                                time: 2000
+                            }, function () {
+                                table.reload('LAY-list-manage'); //数据刷新
+                            });
                         }
                     }
                 });

+ 23 - 20
Areas/Admin/Views/MainServer/SysTools/SetMerAgent.cshtml

@@ -1,20 +1,23 @@
 @{
     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">
+    <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">
     <script src="/admin/js/jquery-1.10.1.min.js"></script>
     <script src="/admin/js/LAreaData2.js"></script>
 </head>
+
 <body>
 
     <div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-form-useradmin">
@@ -38,17 +41,15 @@
                                 <div class="layui-form-item">
                                     <label class="layui-form-label">机具SN</label>
                                     <div class="layui-input-inline">
-                                        <input class="layui-input" type="text" id="PosSn"
-                                            name="PosSn" maxlength="50" lay-verify="required|"
-                                            autocomplete="off" placeholder="请输入机具SN">
+                                        <input class="layui-input" type="text" id="PosSn" name="PosSn" maxlength="50"
+                                            lay-verify="required|" autocomplete="off" placeholder="请输入机具SN">
                                     </div>
                                 </div>
                                 <div class="layui-form-item">
                                     <label class="layui-form-label">商户编号</label>
                                     <div class="layui-input-inline">
-                                        <input class="layui-input" type="text" id="MerNo"
-                                            name="MerNo" maxlength="50" lay-verify="required|"
-                                            autocomplete="off" placeholder="请输入商户编号">
+                                        <input class="layui-input" type="text" id="MerNo" name="MerNo" maxlength="50"
+                                            lay-verify="required|" autocomplete="off" placeholder="请输入商户编号">
                                     </div>
                                 </div>
                                 <div class="layui-form-item">
@@ -73,7 +74,8 @@
     </div>
 
     <script src="/layuiadmin/layui/layui.js"></script>
-    <script src="/other/oss/upload-min@(MySystem.OssHelper.Instance.OssStatus ? "-oss" : "").js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
+    <script
+        src="/other/oss/upload-min@(MySystem.OssHelper.Instance.OssStatus ? "-oss" : "").js?r=@DateTime.Now.ToString("yyyyMMddHHmmss")"></script>
     <script src="/other/mybjq/kindeditor-min.js"></script>
     <script src="/other/mybjq/lang/zh_CN.js"></script>
     <script>
@@ -105,11 +107,11 @@
                 }
             });
         }
-        
-                    
+
+
         //编辑器
         KindEditor.ready(function (K) {
-            
+
         });
 
         var ids = "";
@@ -215,7 +217,7 @@
             });
         }
 
-        
+
         var tree;
         var element;
         var upload;
@@ -235,30 +237,31 @@
             tree = layui.tree;
             element = layui.element;
             upload = layui.upload;
-        
+
             //Hash地址的定位
             var layid = location.hash.replace(/^#test=/, '');
             element.tabChange('test', layid);
             element.on('tab(test)', function (elem) {
                 location.hash = 'test=' + $(this).attr('lay-id');
             });
-    
+
             //日期
-            
+
 
             //上传文件
-            
+
 
             //穿梭框
-            
+
 
             //TreeView,比如权限管理
-            
+
 
             //省市区
-            
+
         })
 
     </script>
 </body>
+
 </html>

+ 30 - 0
Models/LeaderCompPrizeBak.cs

@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class LeaderCompPrizeBak
+    {
+        public int Id { get; set; }
+        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 string ParentNav { get; set; }
+        public int ParentUserId { get; set; }
+        public decimal CompPrize { get; set; }
+        public ulong IsComp { get; set; }
+        public int SecDirectCount { get; set; }
+        public int NotDirectCount { get; set; }
+        public int DirectCount { get; set; }
+        public int UserId { get; set; }
+        public string StatMonth { get; set; }
+    }
+}

+ 13 - 0
Models/LeaderCompTmpBak.cs

@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class LeaderCompTmpBak
+    {
+        public int Id { get; set; }
+        public string ParentNav { get; set; }
+        public int ParentUserId { get; set; }
+        public string EveryMonthData { get; set; }
+    }
+}

+ 31 - 0
Models/LeaderCompTradeStatBak.cs

@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class LeaderCompTradeStatBak
+    {
+        public int Id { get; set; }
+        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 SelfResultTradeAmount { get; set; }
+        public decimal SelfTradeAmount { get; set; }
+        public decimal CheckSelfTradeAmount { get; set; }
+        public decimal ResultTradeAmount { get; set; }
+        public decimal TradeAmount { get; set; }
+        public decimal CheckTradeAmount { get; set; }
+        public string ParentNav { get; set; }
+        public int ParentUserId { get; set; }
+        public int UserId { get; set; }
+        public string StatMonth { get; set; }
+    }
+}

+ 25 - 0
Models/LeaderReconRecord.cs

@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+
+namespace MySystem.Models
+{
+    public partial class LeaderReconRecord
+    {
+        public int Id { get; set; }
+        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 BalanceAmount { get; set; }
+        public decimal ReserveAmount { get; set; }
+        public string StatMonth { get; set; }
+        public int UserId { get; set; }
+    }
+}

+ 207 - 3
Models/WebCMSEntities.cs

@@ -71,8 +71,12 @@ namespace MySystem.Models
         public virtual DbSet<KqProducts> KqProducts { get; set; }
         public virtual DbSet<LeaderAccountRecord> LeaderAccountRecord { get; set; }
         public virtual DbSet<LeaderCompPrize> LeaderCompPrize { get; set; }
+        public virtual DbSet<LeaderCompPrizeBak> LeaderCompPrizeBak { get; set; }
         public virtual DbSet<LeaderCompTmp> LeaderCompTmp { get; set; }
+        public virtual DbSet<LeaderCompTmpBak> LeaderCompTmpBak { get; set; }
         public virtual DbSet<LeaderCompTradeStat> LeaderCompTradeStat { get; set; }
+        public virtual DbSet<LeaderCompTradeStatBak> LeaderCompTradeStatBak { get; set; }
+        public virtual DbSet<LeaderReconRecord> LeaderReconRecord { get; set; }
         public virtual DbSet<LeaderReserveRecord> LeaderReserveRecord { get; set; }
         public virtual DbSet<Leaders> Leaders { get; set; }
         public virtual DbSet<MachineApply> MachineApply { get; set; }
@@ -4290,6 +4294,105 @@ namespace MySystem.Models
                     .HasComment("版本号");
             });
 
+            modelBuilder.Entity<LeaderCompPrizeBak>(entity =>
+            {
+                entity.HasComment("领导人达标奖bak");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.CompPrize)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("达标奖励");
+
+                entity.Property(e => e.CreateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("创建时间");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("创建人")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.DirectCount)
+                    .HasColumnType("int(11)")
+                    .HasComment("直推达标人数");
+
+                entity.Property(e => e.IsComp)
+                    .HasColumnType("bit(1)")
+                    .HasDefaultValueSql("b'0'")
+                    .HasComment("是否达标");
+
+                entity.Property(e => e.NotDirectCount)
+                    .HasColumnType("int(11)")
+                    .HasComment("间推达标人数");
+
+                entity.Property(e => e.ParentNav)
+                    .HasColumnType("varchar(1000)")
+                    .HasComment("上级创客集合")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ParentUserId)
+                    .HasColumnType("int(11)")
+                    .HasComment("上级创客");
+
+                entity.Property(e => e.QueryCount)
+                    .HasColumnType("int(11)")
+                    .HasComment("点击量");
+
+                entity.Property(e => e.SecDirectCount)
+                    .HasColumnType("int(11)")
+                    .HasComment("达标上线人数");
+
+                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)")
+                    .HasComment("排序序号");
+
+                entity.Property(e => e.StatMonth)
+                    .HasColumnType("varchar(20)")
+                    .HasComment("统计月份")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Status)
+                    .HasColumnType("int(11)")
+                    .HasComment("状态");
+
+                entity.Property(e => e.UpdateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("更新时间");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("更新人")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UserId)
+                    .HasColumnType("int(11)")
+                    .HasComment("创客");
+
+                entity.Property(e => e.Version)
+                    .HasColumnType("int(11)")
+                    .HasComment("版本号");
+            });
+
             modelBuilder.Entity<LeaderCompTmp>(entity =>
             {
                 entity.HasComment("领导人达标奖临时存储");
@@ -4315,6 +4418,31 @@ namespace MySystem.Models
                     .HasComment("上级创客");
             });
 
+            modelBuilder.Entity<LeaderCompTmpBak>(entity =>
+            {
+                entity.HasComment("领导人达标奖临时存储bak");
+
+                entity.Property(e => e.Id)
+                    .HasColumnType("int(11)")
+                    .HasComment("用户Id");
+
+                entity.Property(e => e.EveryMonthData)
+                    .HasColumnType("mediumtext")
+                    .HasComment("每月达标数据")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ParentNav)
+                    .HasColumnType("varchar(1000)")
+                    .HasComment("上级创客集合")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.ParentUserId)
+                    .HasColumnType("int(11)")
+                    .HasComment("上级创客");
+            });
+
             modelBuilder.Entity<LeaderCompTradeStat>(entity =>
             {
                 entity.HasComment("领导人达标奖交易额统计");
@@ -4417,9 +4545,9 @@ namespace MySystem.Models
                     .HasComment("版本号");
             });
 
-            modelBuilder.Entity<LeaderCompTradeStat>(entity =>
+            modelBuilder.Entity<LeaderCompTradeStatBak>(entity =>
             {
-                entity.HasComment("领导人达标奖交易额统计");
+                entity.HasComment("领导人达标奖交易额统计bak");
 
                 entity.Property(e => e.Id).HasColumnType("int(11)");
 
@@ -4487,7 +4615,7 @@ namespace MySystem.Models
                     .HasComment("排序序号");
 
                 entity.Property(e => e.StatMonth)
-                    .HasColumnType("varchar(6)")
+                    .HasColumnType("varchar(20)")
                     .HasComment("统计月份")
                     .HasCharSet("utf8")
                     .HasCollation("utf8_general_ci");
@@ -4519,6 +4647,82 @@ namespace MySystem.Models
                     .HasComment("版本号");
             });
 
+            modelBuilder.Entity<LeaderReconRecord>(entity =>
+            {
+                entity.HasComment("盟主对账记录");
+
+                entity.Property(e => e.Id).HasColumnType("int(11)");
+
+                entity.Property(e => e.BalanceAmount)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("可提现余额");
+
+                entity.Property(e => e.CreateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("创建时间");
+
+                entity.Property(e => e.CreateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("创建人")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.QueryCount)
+                    .HasColumnType("int(11)")
+                    .HasComment("点击量");
+
+                entity.Property(e => e.ReserveAmount)
+                    .HasColumnType("decimal(18,2)")
+                    .HasComment("储蓄金金额");
+
+                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)")
+                    .HasComment("排序序号");
+
+                entity.Property(e => e.StatMonth)
+                    .HasColumnType("varchar(20)")
+                    .HasComment("月份")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.Status)
+                    .HasColumnType("int(11)")
+                    .HasComment("状态");
+
+                entity.Property(e => e.UpdateDate)
+                    .HasColumnType("datetime")
+                    .HasComment("更新时间");
+
+                entity.Property(e => e.UpdateMan)
+                    .HasColumnType("varchar(50)")
+                    .HasComment("更新人")
+                    .HasCharSet("utf8")
+                    .HasCollation("utf8_general_ci");
+
+                entity.Property(e => e.UserId)
+                    .HasColumnType("int(11)")
+                    .HasComment("创客Id");
+
+                entity.Property(e => e.Version)
+                    .HasColumnType("int(11)")
+                    .HasComment("版本号");
+            });
+
             modelBuilder.Entity<LeaderReserveRecord>(entity =>
             {
                 entity.Property(e => e.Id).HasColumnType("int(11)");

+ 1 - 0
Startup.cs

@@ -141,6 +141,7 @@ namespace MySystem
             ExcelHelper.Instance.Start();
             OpExcelHelper.Instance.Start();
             SycnUserMachineCountHelper.Instance.Start(); //重置创客机具数量
+            LeaderAmountMonthChangeQueue.Instance.Start(); // 每月一号记录上月盟主储蓄金和可提现余额
         }
 
 

+ 1 - 1
wwwroot/layuiadmin/modules/Advertisment_Admin.js

@@ -71,7 +71,7 @@ layui.config({
             , { field: 'PicPath', title: '图片', width: 60, templet: '#imgTpl', unresize: true }
 
             , { field: 'Sort', fixed: 'right', title: '排序', width: 80, edit: 'text' }
-            , { title: '操作', width: 220, align: 'center', fixed: 'right', toolbar: '#table-list-tools' }
+            , { title: '操作', width: 300, align: 'center', fixed: 'right', toolbar: '#table-list-tools' }
         ]]
         , page: true
         , limit: 30

+ 12 - 11
wwwroot/layuiadmin/modules_main/LeaderReserveRecord_Admin.js

@@ -92,18 +92,19 @@ layui.config({
         , cols: [[
             { type: 'checkbox', fixed: 'left' }
             , { field: 'Id', fixed: 'left', title: 'ID', width: 80, sort: true, unresize: true }
-            , { field: 'UserIdMakerCode', width: 200, title: '创客编号', sort: true }
-            , { field: 'UserIdRealName', width: 200, title: '真实姓名', sort: true }
-            , { field: 'CreateDate', width: 200, title: '创建时间', sort: true }
-            , { field: 'Remark', width: 200, title: '变动类型', sort: true }
-            , { field: 'SourceMakerCode', width: 200, title: '购券创客', sort: true }
+            , { field: 'UserIdMakerCode', width: 110, title: '创客编号', sort: true }
+            , { field: 'UserIdRealName', width: 110, title: '真实姓名', sort: true }
+            , { field: 'CreateDate', width: 180, title: '创建时间', sort: true }
+            , { field: 'Remark', width: 110, title: '变动类型', sort: true }
+            , { field: 'ChangeTypeName', width: 110, title: '操作类型', sort: true }
+            , { field: 'SourceMakerCode', width: 110, title: '购券创客', sort: true }
             , { field: 'SeoKeyword', width: 200, title: '订单编号', sort: true }
-            , { field: 'dPosCoupons', width: 200, title: '电签兑换券', sort: true }
-            , { field: 'bPosCoupons', width: 200, title: '大POS兑换券', sort: true }
-            , { field: 'LeaderBalanceAmount', width: 200, title: '可提现余额', sort: true }
-            , { field: 'ChangeAmt', width: 200, title: '使用额度', sort: true }
-            , { field: 'BeforeAmt', width: 200, title: '使用前剩余额度', sort: true }
-            , { field: 'AfterAmt', width: 200, title: '使用后剩余额度', sort: true }
+            , { field: 'dPosCoupons', width: 150, title: '电签兑换券', sort: true }
+            , { field: 'bPosCoupons', width: 150, title: '大POS兑换券', sort: true }
+            , { field: 'LeaderBalanceAmount', width: 130, title: '可提现余额', sort: true }
+            , { field: 'ChangeAmt', width: 130, title: '使用额度', sort: true }
+            , { field: 'BeforeAmt', width: 180, title: '使用前剩余额度', sort: true }
+            , { field: 'AfterAmt', width: 180, title: '使用后剩余额度', sort: true }
             , { field: 'PosCoupons', width: 400, title: '券码', sort: true }
 
             // , { field: 'Sort', fixed: 'right', title: '排序', width: 80, edit: 'text' }

+ 45 - 18
wwwroot/layuiadmin/modules_main/Leaders_Admin.js

@@ -148,15 +148,17 @@ layui.config({
         , cols: [[
             { type: 'checkbox', fixed: 'left' }
             , { field: 'Id', fixed: 'left', title: 'ID', width: 80, sort: true, unresize: true }
-            , { field: 'UserIdMakerCode', width: 200, title: '创客编号', sort: true }
-            , { field: 'UserIdRealName', width: 200, title: '真实姓名', sort: true }
-            , { field: 'CreateDate', width: 200, title: '首次购买时间', sort: true }
-            , { field: 'LastBuyDate', width: 200, title: '最后购买时间', sort: true }
-            , { field: 'ExpiredDate', width: 200, title: '盟主到期时间', sort: true }
-            , { field: 'LeaderStatus', width: 200, title: '状态', sort: true }
-            , { field: 'LeaderLevel', width: 200, title: '盟主等级', sort: true }
-            , { field: 'LeaderReserve', width: 200, title: '盟主储蓄金', sort: true }
-            , { field: 'LeaderBalanceAmount', width: 200, title: '盟主可提现余额', sort: true }
+            , { field: 'UserIdMakerCode', width: 110, title: '创客编号', sort: true }
+            , { field: 'UserIdRealName', width: 110, title: '真实姓名', sort: true }
+            , { field: 'CreateDate', width: 180, title: '首次购买时间', sort: true }
+            , { field: 'LastBuyDate', width: 180, title: '最后购买时间', sort: true }
+            , { field: 'ExpiredDate', width: 180, title: '盟主到期时间', sort: true }
+            , { field: 'LeaderStatus', width: 100, title: '状态', sort: true }
+            , { field: 'LeaderLevel', width: 100, title: '盟主等级', sort: true }
+            , { field: 'LeaderReserve', width: 150, title: '盟主储蓄金', sort: true }
+            , { field: 'LeaderBalanceAmount', width: 150, title: '盟主可提现余额', sort: true }
+            , { field: 'LastMonthReserve', width: 150, title: '上月盟主储蓄金', sort: true }
+            , { field: 'LastMonthBalanceAmount', width: 150, title: '上月可提现余额', sort: true }
 
             , { title: '操作', align: 'center', fixed: 'right', toolbar: '#table-list-tools' }
         ]]
@@ -438,15 +440,40 @@ layui.config({
             $(".layuiadmin-card-header-auto select").each(function (i) {
                 userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
             });
-            $.ajax({
-                type: "GET",
-                url: "/Admin/Leaders/ExportExcel?r=" + Math.random(1),
-                data: userdata,
-                dataType: "json",
-                success: function (data) {
-                    data.Obj.unshift(data.Fields);
-                    excel.exportExcel(data.Obj, data.Info, 'xlsx');
-                }
+            // $.ajax({
+            //     type: "GET",
+            //     url: "/Admin/Leaders/ExportExcel?r=" + Math.random(1),
+            //     data: userdata,
+            //     dataType: "json",
+            //     success: function (data) {
+            //         data.Obj.unshift(data.Fields);
+            //         excel.exportExcel(data.Obj, data.Info, 'xlsx');
+            //     }
+            // });
+            var index = layer.confirm('确定导出吗?', function (index) {
+                var indexs = layer.load(1, {
+                    shade: [0.5, '#000']
+                });
+                $.ajax({
+                    type: "POST",
+                    url: "/Admin/Leaders/QuickExportExcelDo?r=" + Math.random(1),
+                    data: userdata,
+                    dataType: "text",
+                    success: function (data) {
+                        layer.close(index); //关闭弹层
+                        if (data == "success") {
+                            layer.close(indexs); //关闭弹层
+                            layer.msg('导出成功,请到我的下载中点击下载文件', {
+                                time: 1000
+                            }, function () {
+                                window.location.reload();
+                            });
+                        } else {
+                            layer.close(indexs); //关闭弹层
+                            layer.msg(data);
+                        }
+                    }
+                });
             });
         }
         , Open: function () {