DuGuYang 3 ani în urmă
părinte
comite
231518f95e

+ 23 - 15
AppStart/PublicChangePosFee.cs

@@ -18,11 +18,12 @@ namespace MySystem
 {
     public class PublicChangePosFee
     {
-        public WebCMSEntities db = new WebCMSEntities();
+        public static WebCMSEntities db = new WebCMSEntities();
 
         #region 金控-设置押金
-        public string SetJKDeposit(string SnIds)
+        public static string SetJKDeposit(string SnIds)
         {
+            string DepositId = "299";
             string check = RedisDbconn.Instance.Get<string>("SetJKPosDepositWait:" + SnIds);
             if (!string.IsNullOrEmpty(check))
             {
@@ -40,8 +41,8 @@ namespace MySystem
                 {
                     return "机具" + pos.PosSn + "已设置押金,请勿重复设置";
                 }
-                function.WriteLog(DateTime.Now.ToString() + ":请求参数," + pos.PosSn + ":" + "299", "金控-设置押金-返回报文");
-                string content = function.GetWebRequest("http://sp.kexiaoshuang.com/api/test/SetDeposit?sn=" + pos.PosSn + "&num=" + "299");
+                function.WriteLog(DateTime.Now.ToString() + ":请求参数," + pos.PosSn + ":" + DepositId, "金控-设置押金-返回报文");
+                string content = function.GetWebRequest("http://sp.kexiaoshuang.com/api/test/SetDeposit?sn=" + pos.PosSn + "&num=" + DepositId);
                 function.WriteLog(DateTime.Now.ToString() + "\n" + content, "金控-设置押金-返回报文");
                 if (content == "fail")
                 {
@@ -81,8 +82,9 @@ namespace MySystem
 
 
         #region 开店宝-设置押金
-        public string SetKDBDeposit(string SnIds)
+        public static string SetKDBDeposit(string SnIds)
         {
+            string DepositId = "473";
             string check = RedisDbconn.Instance.Get<string>("SetKDBPosDepositWait:" + SnIds);
             if (!string.IsNullOrEmpty(check))
             {
@@ -99,8 +101,8 @@ namespace MySystem
                 {
                     return "机具" + pos.PosSn + "已设置押金,请勿重复设置";
                 }
-                function.WriteLog(DateTime.Now.ToString() + ":请求参数," + pos.PosSn + ":" + "299", "开店宝-设置押金-返回报文");
-                string content = PublicImportDataService.Instance.ModifyDeposit(pos.PosSn, "299");
+                function.WriteLog(DateTime.Now.ToString() + ":请求参数," + pos.PosSn + ":" + DepositId, "开店宝-设置押金-返回报文");
+                string content = PublicImportDataService.Instance.ModifyDeposit(pos.PosSn, DepositId);
                 if (content == "fail")
                 {
                     return "机具" + pos.PosSn + "设置失败";
@@ -116,7 +118,7 @@ namespace MySystem
                 {
                     BeforeDeposit = int.Parse(pos.PrizeParams);
                 }
-                decimal amount = decimal.Parse(PublicImportDataService.Instance.GetDepositAmount("299"));
+                decimal amount = decimal.Parse(PublicImportDataService.Instance.GetDepositAmount(DepositId));
                 pos.PrizeParams = amount.ToString("f0");
                 db.SaveChanges();
             }
@@ -127,8 +129,9 @@ namespace MySystem
 
 
         #region 乐刷-设置押金
-        public string SetLSDeposit(string SnIds, string DepositId = "300")
+        public static string SetLSDeposit(string SnIds)
         {
+            string DepositId = "300";
             string check = RedisDbconn.Instance.Get<string>("SetLSPosDepositWait:" + SnIds);
             if (!string.IsNullOrEmpty(check))
             {
@@ -203,8 +206,9 @@ namespace MySystem
 
 
         #region 立刷-设置押金
-        public string SetLISDeposit(string SnIds, string DepositId = "249")
+        public static string SetLISDeposit(string SnIds)
         {
+            string DepositId = "249";
             string check = RedisDbconn.Instance.Get<string>("SetLISPosDepositWait:" + SnIds);
             if (!string.IsNullOrEmpty(check))
             {
@@ -257,8 +261,9 @@ namespace MySystem
 
 
         #region 盛付通-设置押金
-        public string SetSFTDeposit(string SnIds, string DepositId)
+        public static string SetSFTDeposit(string SnIds)
         {
+            string DepositId = "2021POS299";
             string check = RedisDbconn.Instance.Get<string>("SetSFTPosDepositWait:" + SnIds);
             if (!string.IsNullOrEmpty(check))
             {
@@ -304,8 +309,9 @@ namespace MySystem
 
 
         #region 海科-设置押金
-        public string SetHKDeposit(string SnIds, string DepositId = "300")
+        public static string SetHKDeposit(string SnIds)
         {
+            string DepositId = "300";
             string check = RedisDbconn.Instance.Get<string>("SetHKPosDepositWait:" + SnIds);
             if (!string.IsNullOrEmpty(check))
             {
@@ -380,8 +386,9 @@ namespace MySystem
 
 
         #region 联动-设置押金
-        public string SetLDDeposit(string SnIds, string DepositId = "299")
+        public static string SetLDDeposit(string SnIds)
         {
+            string DepositId = "299";
             string check = RedisDbconn.Instance.Get<string>("SetLDPosDepositWait:" + SnIds);
             if (!string.IsNullOrEmpty(check))
             {
@@ -427,8 +434,9 @@ namespace MySystem
 
 
         #region 盒易付-设置押金
-        public string SetHYFDeposit(string SnIds, string DepositId = "299")
+        public static string SetHYFDeposit(string SnIds)
         {
+            string DepositId = "299";
             string check = RedisDbconn.Instance.Get<string>("SetHYFPosDepositWait:" + SnIds);
             if (!string.IsNullOrEmpty(check))
             {
@@ -477,7 +485,7 @@ namespace MySystem
 
 
         #region 
-        public string SeeInfo(string Brand)
+        public static string SeeInfo(string Brand)
         {
             var info = "";
             //KDB

+ 72 - 0
Areas/Admin/Controllers/MainServer/SysToolsController.cs

@@ -5710,6 +5710,78 @@ namespace MySystem.Areas.Admin.Controllers
                 foreach (int SnId in SnIds)
                 {
                     var posInfo = db.PosMachinesTwo.FirstOrDefault(m => m.Id == SnId) ?? new PosMachinesTwo();
+                    //金控
+                    if (posInfo.BrandId == 1 || posInfo.BrandId == 3)
+                    {
+                        var info = PublicChangePosFee.SetJKDeposit(SnId.ToString());
+                        if (info != "设置成功")
+                        {
+                            return info;
+                        }
+                    }
+                    //开店宝
+                    if (posInfo.BrandId == 2)
+                    {
+                        var info = PublicChangePosFee.SetJKDeposit(SnId.ToString());
+                        if (info != "设置成功")
+                        {
+                            return info;
+                        }
+                    }
+                    //乐刷
+                    if (posInfo.BrandId == 4 || posInfo.BrandId == 5)
+                    {
+                        var info = PublicChangePosFee.SetJKDeposit(SnId.ToString());
+                        if (info != "设置成功")
+                        {
+                            return info;
+                        }
+                    }
+                    //立刷
+                    if (posInfo.BrandId == 6)
+                    {
+                        var info = PublicChangePosFee.SetJKDeposit(SnId.ToString());
+                        if (info != "设置成功")
+                        {
+                            return info;
+                        }
+                    }
+                    //盛付通
+                    if (posInfo.BrandId == 7)
+                    {
+                        var info = PublicChangePosFee.SetJKDeposit(SnId.ToString());
+                        if (info != "设置成功")
+                        {
+                            return info;
+                        }
+                    }
+                    //海科
+                    if (posInfo.BrandId == 8 || posInfo.BrandId == 9)
+                    {
+                        var info = PublicChangePosFee.SetJKDeposit(SnId.ToString());
+                        if (info != "设置成功")
+                        {
+                            return info;
+                        }
+                    }
+                    //联动
+                    if (posInfo.BrandId == 10 || posInfo.BrandId == 11)
+                    {
+                        var info = PublicChangePosFee.SetJKDeposit(SnId.ToString());
+                        if (info != "设置成功")
+                        {
+                            return info;
+                        }
+                    }
+                    //盒易付
+                    if (posInfo.BrandId == 12 || posInfo.BrandId == 13)
+                    {
+                        var info = PublicChangePosFee.SetJKDeposit(SnId.ToString());
+                        if (info != "设置成功")
+                        {
+                            return info;
+                        }
+                    }
                 }
                 var query = SnIds + ";";
                 function.WriteLog(DateTime.Now.ToString() + ":请求参数," + query + ":" + SysUserName + "-" + SysRealName, "调整机具服务费");

+ 1 - 1
Areas/Admin/Views/MainServer/SysTools/ChangePosFee.cshtml

@@ -62,7 +62,7 @@
                 layer.msg('请输入机具SN');
             }
             else {
-                var index = layer.confirm('确定要划拨吗?', function (index) {
+                var index = layer.confirm('确定要调整对应机具费率吗?', function (index) {
                     var indexs = layer.load(1, {
                         shade: [0.5, '#000']
                     });