DuGuYang пре 3 година
родитељ
комит
6376a36cd2
1 измењених фајлова са 162 додато и 7 уклоњено
  1. 162 7
      AppStart/PublicChangePosFee.cs

+ 162 - 7
AppStart/PublicChangePosFee.cs

@@ -88,7 +88,7 @@ namespace MySystem
 
 
 
-        
+
         #region 开店宝-设置押金
         public string SetKDBDeposit(string SnIds, string DepositId)
         {
@@ -100,13 +100,13 @@ namespace MySystem
                 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 + "已设置押金,请勿重复设置";
+                    return "机具" + pos.PosSn + "已设置押金,请勿重复设置";
                 }
                 function.WriteLog(DateTime.Now.ToString() + ":请求参数," + pos.PosSn + ":" + "299", "开店宝-设置押金-返回报文");
                 string content = PublicImportDataService.Instance.ModifyDeposit(pos.PosSn, "299");
                 if (content == "fail")
-                { 
-                    return"机具" + pos.PosSn + "设置失败";
+                {
+                    return "机具" + pos.PosSn + "设置失败";
                 }
                 function.WriteLog(DateTime.Now.ToString() + "\n" + content, "开店宝-设置押金-返回报文");
 
@@ -141,7 +141,7 @@ namespace MySystem
         {
             string check = RedisDbconn.Instance.Get<string>("SetLsPosDepositWait:" + SnIds);
             if (!string.IsNullOrEmpty(check))
-            { 
+            {
                 return "操作频繁,请稍后再试";
             }
             RedisDbconn.Instance.Set("SetLsPosDepositWait:" + SnIds, SnIds);
@@ -180,12 +180,12 @@ namespace MySystem
                 content = PublicImportDataService.Instance.SetDepositForLS(pos.PosSn, OldId, NewId, pos.BrandId);
                 function.WriteLog(DateTime.Now.ToString() + "\n" + content, "乐刷-设置押金-返回报文");
                 if (content == "fail")
-                { 
+                {
                     return "机具" + pos.PosSn + "设置失败";
                 }
                 jsonObj = JsonMapper.ToObject(content);
                 if (jsonObj["code"].ToString() != "0")
-                { 
+                {
                     return jsonObj["msg"].ToString();
                 }
                 function.WriteLog(DateTime.Now.ToString() + "\n" + content, "乐刷-设置押金-返回报文");
@@ -219,6 +219,114 @@ namespace MySystem
 
 
 
+        #region 立刷-设置押金
+        public string SetLISDeposit(string SnIds, string DepositId)
+        {
+            string check = RedisDbconn.Instance.Get<string>("SetLisPosDepositWait:" + SnIds);
+            if (!string.IsNullOrEmpty(check))
+            {
+                return "操作频繁,请稍后再试";
+            }
+            RedisDbconn.Instance.Set("SetLisPosDepositWait:" + SnIds, SnIds);
+            RedisDbconn.Instance.SetExpire("SetLisPosDepositWait:" + 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.SetLiSDeposit(pos.PosSn, int.Parse(DepositId));
+                function.WriteLog(DateTime.Now.ToString() + "\n" + content, "立刷-设置押金-返回报文");
+                JsonData jsonObj = JsonMapper.ToObject(content);
+                if (jsonObj["ret_code"].ToString() != "00")
+                {
+                    return jsonObj["ret_msg"].ToString();
+                }
+                function.WriteLog(DateTime.Now.ToString() + "\n" + content, "立刷-设置押金-返回报文");
+                var BeforeDeposit = 0;
+                if (string.IsNullOrEmpty(pos.PrizeParams))
+                {
+                    if (RelationClass.GetKqProductBrandInfo(pos.BrandId) == "立刷云电签")
+                    {
+                        BeforeDeposit = 249;
+                    }
+                    else
+                    {
+                        BeforeDeposit = 299;
+                    }
+                }
+                else
+                {
+                    BeforeDeposit = int.Parse(pos.PrizeParams);
+                }
+                pos.PrizeParams = DepositId;
+                db.SaveChanges();
+            }
+            return "设置成功";
+        }
+        #endregion
+
+
+
+        #region 盛付通-设置押金
+        public string SetSFTDeposit(string SnIds, string DepositId)
+        {
+            string check = RedisDbconn.Instance.Get<string>("SetSftDepositWait:" + SnIds);
+            if (!string.IsNullOrEmpty(check))
+            {
+                return "操作频繁,请稍后再试";
+            }
+            RedisDbconn.Instance.Set("SetSftDepositWait:" + SnIds, SnIds);
+            RedisDbconn.Instance.SetExpire("SetSftDepositWait:" + 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.SetDepositForSft(pos.PosSn, DepositId);
+                function.WriteLog(DateTime.Now.ToString() + "\n" + content, "盛付通-设置押金-返回报文");
+                JsonData jsonObj = JsonMapper.ToObject(content);
+                if (jsonObj["respCode"].ToString() != "00")
+                {
+                    return jsonObj["errorMsg"].ToString();
+                }
+                var BeforeDeposit = 0;
+                if (string.IsNullOrEmpty(pos.PrizeParams))
+                {
+                    if (RelationClass.GetKqProductBrandInfo(pos.BrandId) == "立刷云电签")
+                    {
+                        BeforeDeposit = 249;
+                    }
+                    else
+                    {
+                        BeforeDeposit = 299;
+                    }
+                }
+                else
+                {
+                    BeforeDeposit = int.Parse(pos.PrizeParams);
+                }
+                pos.PrizeParams = DepositId.Replace("2021POS", "");
+                db.SaveChanges();
+            }
+            return "设置成功";
+        }
+        #endregion
+
+
+
+
         #region 海科-设置押金
         public string SetHKDeposit(string SnIds, string DepositId)
         {
@@ -300,5 +408,52 @@ namespace MySystem
         }
         #endregion
 
+
+
+        #region 联动-设置押金
+        public string SetLDDeposit(string SnIds, string DepositId)
+        {
+            string check = RedisDbconn.Instance.Get<string>("SetDepositWait:" + SnIds);
+            if (!string.IsNullOrEmpty(check))
+            {
+                return "操作频繁,请稍后再试";
+            }
+            RedisDbconn.Instance.Set("SetDepositWait:" + SnIds, SnIds);
+            RedisDbconn.Instance.SetExpire("SetDepositWait:" + 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.LDServiceFee(pos.PosSn, int.Parse(DepositId), pos.BrandId);
+                function.WriteLog(DateTime.Now.ToString() + "\n" + content, "联动-设置押金-返回报文");
+                JsonData jsonObj = JsonMapper.ToObject(content);
+                if (jsonObj["code"].ToString() != "000000")
+                {
+                    return jsonObj["msg"].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
+
     }
 }