DuGuYang 3 tahun lalu
induk
melakukan
e1c18dafc4
1 mengubah file dengan 78 tambahan dan 35 penghapusan
  1. 78 35
      AppStart/PublicChangePosFee.cs

+ 78 - 35
AppStart/PublicChangePosFee.cs

@@ -25,13 +25,13 @@ namespace MySystem
         #region 金控-设置押金
         #region 金控-设置押金
         public string SetJKDeposit(string SnIds, string DepositId)
         public string SetJKDeposit(string SnIds, string DepositId)
         {
         {
-            string check = RedisDbconn.Instance.Get<string>("SetDepositWait:" + SnIds);
+            string check = RedisDbconn.Instance.Get<string>("SetJKPosDepositWait:" + SnIds);
             if (!string.IsNullOrEmpty(check))
             if (!string.IsNullOrEmpty(check))
             {
             {
                 return "操作频繁,请稍后再试";
                 return "操作频繁,请稍后再试";
             }
             }
-            RedisDbconn.Instance.Set("SetDepositWait:" + SnIds, SnIds);
-            RedisDbconn.Instance.SetExpire("SetDepositWait:" + SnIds, 120);
+            RedisDbconn.Instance.Set("SetJKPosDepositWait:" + SnIds, SnIds);
+            RedisDbconn.Instance.SetExpire("SetJKPosDepositWait:" + SnIds, 120);
             Dictionary<string, object> Obj = new Dictionary<string, object>();
             Dictionary<string, object> Obj = new Dictionary<string, object>();
             string[] SnIdList = SnIds.Split(',');
             string[] SnIdList = SnIds.Split(',');
             foreach (string SnId in SnIdList)
             foreach (string SnId in SnIdList)
@@ -92,7 +92,13 @@ namespace MySystem
         #region 开店宝-设置押金
         #region 开店宝-设置押金
         public string SetKDBDeposit(string SnIds, string DepositId)
         public string SetKDBDeposit(string SnIds, string DepositId)
         {
         {
-            Dictionary<string, object> Obj = new Dictionary<string, object>();
+            string check = RedisDbconn.Instance.Get<string>("SetKDBPosDepositWait:" + SnIds);
+            if (!string.IsNullOrEmpty(check))
+            {
+                return "操作频繁,请稍后再试";
+            }
+            RedisDbconn.Instance.Set("SetKDBPosDepositWait:" + SnIds, SnIds);
+            RedisDbconn.Instance.SetExpire("SetKDBPosDepositWait:" + SnIds, 120);
             string[] SnIdList = SnIds.Split(',');
             string[] SnIdList = SnIds.Split(',');
             foreach (string SnId in SnIdList)
             foreach (string SnId in SnIdList)
             {
             {
@@ -137,15 +143,15 @@ namespace MySystem
 
 
 
 
         #region 乐刷-设置押金
         #region 乐刷-设置押金
-        public string SetDeposit(string SnIds, string DepositId)
+        public string SetLSDeposit(string SnIds, string DepositId)
         {
         {
-            string check = RedisDbconn.Instance.Get<string>("SetLsPosDepositWait:" + SnIds);
+            string check = RedisDbconn.Instance.Get<string>("SetLSPosDepositWait:" + SnIds);
             if (!string.IsNullOrEmpty(check))
             if (!string.IsNullOrEmpty(check))
             {
             {
                 return "操作频繁,请稍后再试";
                 return "操作频繁,请稍后再试";
             }
             }
-            RedisDbconn.Instance.Set("SetLsPosDepositWait:" + SnIds, SnIds);
-            RedisDbconn.Instance.SetExpire("SetLsPosDepositWait:" + SnIds, 120);
+            RedisDbconn.Instance.Set("SetLSPosDepositWait:" + SnIds, SnIds);
+            RedisDbconn.Instance.SetExpire("SetLSPosDepositWait:" + SnIds, 120);
             Dictionary<string, object> Obj = new Dictionary<string, object>();
             Dictionary<string, object> Obj = new Dictionary<string, object>();
             string[] SnIdList = SnIds.Split(',');
             string[] SnIdList = SnIds.Split(',');
             foreach (string SnId in SnIdList)
             foreach (string SnId in SnIdList)
@@ -222,13 +228,13 @@ namespace MySystem
         #region 立刷-设置押金
         #region 立刷-设置押金
         public string SetLISDeposit(string SnIds, string DepositId)
         public string SetLISDeposit(string SnIds, string DepositId)
         {
         {
-            string check = RedisDbconn.Instance.Get<string>("SetLisPosDepositWait:" + SnIds);
+            string check = RedisDbconn.Instance.Get<string>("SetLISPosDepositWait:" + SnIds);
             if (!string.IsNullOrEmpty(check))
             if (!string.IsNullOrEmpty(check))
             {
             {
                 return "操作频繁,请稍后再试";
                 return "操作频繁,请稍后再试";
             }
             }
-            RedisDbconn.Instance.Set("SetLisPosDepositWait:" + SnIds, SnIds);
-            RedisDbconn.Instance.SetExpire("SetLisPosDepositWait:" + SnIds, 120);
+            RedisDbconn.Instance.Set("SetLISPosDepositWait:" + SnIds, SnIds);
+            RedisDbconn.Instance.SetExpire("SetLISPosDepositWait:" + SnIds, 120);
             Dictionary<string, object> Obj = new Dictionary<string, object>();
             Dictionary<string, object> Obj = new Dictionary<string, object>();
             string[] SnIdList = SnIds.Split(',');
             string[] SnIdList = SnIds.Split(',');
             foreach (string SnId in SnIdList)
             foreach (string SnId in SnIdList)
@@ -276,13 +282,13 @@ namespace MySystem
         #region 盛付通-设置押金
         #region 盛付通-设置押金
         public string SetSFTDeposit(string SnIds, string DepositId)
         public string SetSFTDeposit(string SnIds, string DepositId)
         {
         {
-            string check = RedisDbconn.Instance.Get<string>("SetSftDepositWait:" + SnIds);
+            string check = RedisDbconn.Instance.Get<string>("SetSFTPosDepositWait:" + SnIds);
             if (!string.IsNullOrEmpty(check))
             if (!string.IsNullOrEmpty(check))
             {
             {
                 return "操作频繁,请稍后再试";
                 return "操作频繁,请稍后再试";
             }
             }
-            RedisDbconn.Instance.Set("SetSftDepositWait:" + SnIds, SnIds);
-            RedisDbconn.Instance.SetExpire("SetSftDepositWait:" + SnIds, 120);
+            RedisDbconn.Instance.Set("SetSFTPosDepositWait:" + SnIds, SnIds);
+            RedisDbconn.Instance.SetExpire("SetSFTPosDepositWait:" + SnIds, 120);
             Dictionary<string, object> Obj = new Dictionary<string, object>();
             Dictionary<string, object> Obj = new Dictionary<string, object>();
             string[] SnIdList = SnIds.Split(',');
             string[] SnIdList = SnIds.Split(',');
             foreach (string SnId in SnIdList)
             foreach (string SnId in SnIdList)
@@ -304,14 +310,7 @@ namespace MySystem
                 var BeforeDeposit = 0;
                 var BeforeDeposit = 0;
                 if (string.IsNullOrEmpty(pos.PrizeParams))
                 if (string.IsNullOrEmpty(pos.PrizeParams))
                 {
                 {
-                    if (RelationClass.GetKqProductBrandInfo(pos.BrandId) == "立刷云电签")
-                    {
-                        BeforeDeposit = 249;
-                    }
-                    else
-                    {
-                        BeforeDeposit = 299;
-                    }
+                    BeforeDeposit = 299;
                 }
                 }
                 else
                 else
                 {
                 {
@@ -330,12 +329,12 @@ namespace MySystem
         #region 海科-设置押金
         #region 海科-设置押金
         public string SetHKDeposit(string SnIds, string DepositId)
         public string SetHKDeposit(string SnIds, string DepositId)
         {
         {
-            string check = RedisDbconn.Instance.Get<string>("SetHkPosDepositWait:" + SnIds);
+            string check = RedisDbconn.Instance.Get<string>("SetHKPosDepositWait:" + SnIds);
             if (!string.IsNullOrEmpty(check))
             if (!string.IsNullOrEmpty(check))
             {
             {
                 return "操作频繁,请稍后再试";
                 return "操作频繁,请稍后再试";
             }
             }
-            RedisDbconn.Instance.Set("SetHkPosDepositWait:" + SnIds, SnIds);
+            RedisDbconn.Instance.Set("SetHKPosDepositWait:" + SnIds, SnIds);
             RedisDbconn.Instance.SetExpire("SetHkPosDepositWait:" + SnIds, 120);
             RedisDbconn.Instance.SetExpire("SetHkPosDepositWait:" + SnIds, 120);
             Dictionary<string, object> Obj = new Dictionary<string, object>();
             Dictionary<string, object> Obj = new Dictionary<string, object>();
             string[] SnIdList = SnIds.Split(',');
             string[] SnIdList = SnIds.Split(',');
@@ -383,14 +382,7 @@ namespace MySystem
                 var BeforeDeposit = 0;
                 var BeforeDeposit = 0;
                 if (string.IsNullOrEmpty(pos.PrizeParams))
                 if (string.IsNullOrEmpty(pos.PrizeParams))
                 {
                 {
-                    if (RelationClass.GetKqProductBrandInfo(pos.BrandId) == "立刷云电签")
-                    {
-                        BeforeDeposit = 249;
-                    }
-                    else
-                    {
-                        BeforeDeposit = 299;
-                    }
+                    BeforeDeposit = 299;
                 }
                 }
                 else
                 else
                 {
                 {
@@ -413,13 +405,13 @@ namespace MySystem
         #region 联动-设置押金
         #region 联动-设置押金
         public string SetLDDeposit(string SnIds, string DepositId)
         public string SetLDDeposit(string SnIds, string DepositId)
         {
         {
-            string check = RedisDbconn.Instance.Get<string>("SetDepositWait:" + SnIds);
+            string check = RedisDbconn.Instance.Get<string>("SetLDPosDepositWait:" + SnIds);
             if (!string.IsNullOrEmpty(check))
             if (!string.IsNullOrEmpty(check))
             {
             {
                 return "操作频繁,请稍后再试";
                 return "操作频繁,请稍后再试";
             }
             }
-            RedisDbconn.Instance.Set("SetDepositWait:" + SnIds, SnIds);
-            RedisDbconn.Instance.SetExpire("SetDepositWait:" + SnIds, 120);
+            RedisDbconn.Instance.Set("SetLDPosDepositWait:" + SnIds, SnIds);
+            RedisDbconn.Instance.SetExpire("SetLDPosDepositWait:" + SnIds, 120);
             Dictionary<string, object> Obj = new Dictionary<string, object>();
             Dictionary<string, object> Obj = new Dictionary<string, object>();
             string[] SnIdList = SnIds.Split(',');
             string[] SnIdList = SnIds.Split(',');
             foreach (string SnId in SnIdList)
             foreach (string SnId in SnIdList)
@@ -455,5 +447,56 @@ namespace MySystem
         }
         }
         #endregion
         #endregion
 
 
+
+
+        #region 盒易付-设置押金
+        public string SetHYFDeposit(string SnIds, string DepositId)
+        {
+            string check = RedisDbconn.Instance.Get<string>("SetHYFPosDepositWait:" + SnIds);
+            if (!string.IsNullOrEmpty(check))
+            {
+                return "操作频繁,请稍后再试";
+            }
+            RedisDbconn.Instance.Set("SetHYFPosDepositWait:" + SnIds, SnIds);
+            RedisDbconn.Instance.SetExpire("SetHYFPosDepositWait:" + SnIds, 120);
+            Dictionary<string, object> Obj = new Dictionary<string, object>();
+            string[] SnIdList = SnIds.Split(',');
+            foreach (string SnId in SnIdList)
+            {
+                int SnIdNum = int.Parse(SnId);
+                PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.Id == SnIdNum && m.BindingState == 0 && (string.IsNullOrEmpty(m.SeoKeyword) || m.SeoKeyword == "0"));
+                if (pos == null)
+                {
+                    return "机具" + pos.PosSn + "已设置押金,请勿重复设置";
+                }
+                function.WriteLog(DateTime.Now.ToString() + ":请求参数," + pos.PosSn + ":" + DepositId, "盒易付-设置押金-返回报文");
+                string content = PublicImportDataService.Instance.BoxServiceFee(pos.PosSn, DepositId);
+                function.WriteLog(DateTime.Now.ToString() + "\n" + content, "盒易付-设置押金-返回报文");
+                if (content == "fail")
+                {
+                    return "机具" + pos.PosSn + "设置失败";
+                }
+                JsonData jsonObj = JsonMapper.ToObject(content);
+                if (jsonObj["resultCode"].ToString() != "1")
+                {
+                    return jsonObj["errorDesc"].ToString();
+                }
+                var BeforeDeposit = 0;
+                if (string.IsNullOrEmpty(pos.PrizeParams))
+                {
+                    BeforeDeposit = 299;
+                }
+                else
+                {
+                    BeforeDeposit = int.Parse(pos.PrizeParams);
+                }
+                decimal amount = decimal.Parse(DepositId);
+                pos.PrizeParams = amount.ToString("f0");
+                db.SaveChanges();
+            }
+            return "设置成功";
+        }
+        #endregion
+
     }
     }
 }
 }