Browse Source

测试费率

lcl 1 year ago
parent
commit
887ba68f14
2 changed files with 32 additions and 17 deletions
  1. 16 9
      AppStart/Helper/SetDepositPostService.cs
  2. 16 8
      Controllers/HomeController.cs

+ 16 - 9
AppStart/Helper/SetDepositPostService.cs

@@ -509,10 +509,10 @@ namespace MySystem
         // string AgencyId = "3013890202";
 
         // 修改费率接口
-        public string ModifyFee(string PosSn, decimal Fee)
+        public string ModifyFee(string PosSn, decimal Rate, string Fee = "0")
         {
             string url = KdbApiUrl + "/pos/rate/modify/single/remote";
-            string content = "{\"posSn\":\"" + PosSn + "\",\"type\":\"贷记卡刷卡\",\"rate\":\"" + Fee + "\",\"d0Fee\":\"0\"}";
+            string content = "{\"posSn\":\"" + PosSn + "\",\"type\":\"贷记卡刷卡\",\"rate\":\"" + Rate + "\",\"d0Fee\":\"0\"}";
             return PostKDB(url, content);
         }
 
@@ -854,7 +854,7 @@ namespace MySystem
         }
 
         #endregion
-            
+
         #region 盛付通
         string OrgId = "38844193";
         // 生产环境
@@ -878,7 +878,7 @@ namespace MySystem
         }
 
         //设置机具押金
-        public string SetFeeForSft(string merchantId, string fee)
+        public string SetFeeForSft(string merchantId, string Rate, string fee = "0")
         {
             Dictionary<string, object> req = new Dictionary<string, object>();
             req.Add("orgPromoterId", OrgId);
@@ -889,9 +889,17 @@ namespace MySystem
             List<Dictionary<string, object>> feeList = new List<Dictionary<string, object>>();
             Dictionary<string, object> feeItem = new Dictionary<string, object>();
             feeItem.Add("feeType", "CC");
-            feeItem.Add("feeRate", fee);
-            feeItem.Add("feeDisRate", fee);
+            feeItem.Add("feeRate", Rate);
+            feeItem.Add("feeDisRate", Rate);
             feeList.Add(feeItem);
+            if(fee != "0")
+            {
+                feeItem = new Dictionary<string, object>();
+                feeItem.Add("feeType", "T0_CC");
+                feeItem.Add("feeRate", fee);
+                feeItem.Add("feeDisRate", fee);
+                feeList.Add(feeItem);
+            }
             item.Add("feeList", feeList);
             merchantFeeList.Add(item);
             req.Add("merchantFeeList", merchantFeeList);
@@ -1096,7 +1104,7 @@ namespace MySystem
             return result;
         }
 
-        public string LDFeeRate(string MerNo, string Fee, int BrandId)
+        public string LDFeeRate(string MerNo, string Fee, int BrandId, int addRate = 0)
         {
             function.WriteLog(DateTime.Now.ToString(), "设置联动机具费率");
             function.WriteLog(MerNo, "设置联动机具费率");
@@ -1108,7 +1116,7 @@ namespace MySystem
             reqdic.Add("agentNumber", AgentNo); // 代理编号
             reqdic.Add("mercModel", MercModel); // 商户模式
             reqdic.Add("rate", Fee); // 费率 如 0.0053
-            reqdic.Add("addRate", 0); // 附加费 如0
+            reqdic.Add("addRate", addRate); // 附加费 如0
             reqdic.Add("rateType", "M015"); // 秒刷 M015 扫码 S010 特惠 T015
             reqdic.Add("mercId", MerNo); // 商户编号
             reqdic.Add("cardType", "01"); // 01 贷记卡 02 扫码
@@ -1126,7 +1134,6 @@ namespace MySystem
         }
 
         #endregion
-
         
         #region 盒易付
 

+ 16 - 8
Controllers/HomeController.cs

@@ -176,14 +176,22 @@ namespace MySystem.Controllers
             //     TradeChangeService.Instance.StatTradeAmount(id, 2, 1);
             // }
 
-            WebCMSEntities db = new WebCMSEntities();
-            PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == "8610086012" && m.ActivationState == 0 && !string.IsNullOrEmpty(m.SeoKeyword) && m.SeoKeyword != "0" && (m.CreditTrade >= 1000 || m.BrandId == 14));
-            if(pos != null)
-            {
-                SycnSpTradeService.Instance.ActPos(db, pos, 0, 30);
-            }
-            db.Dispose();
-            return "ok";
+            // WebCMSEntities db = new WebCMSEntities();
+            // PosMachinesTwo pos = db.PosMachinesTwo.FirstOrDefault(m => m.PosSn == "8610086012" && m.ActivationState == 0 && !string.IsNullOrEmpty(m.SeoKeyword) && m.SeoKeyword != "0" && (m.CreditTrade >= 1000 || m.BrandId == 14));
+            // if(pos != null)
+            // {
+            //     SycnSpTradeService.Instance.ActPos(db, pos, 0, 30);
+            // }
+            // db.Dispose();
+
+            string result = "";
+
+            // result += SetDepositPostService.Instance.ModifyFee("00005002681889119293", 0.0063M, "3") + "\n\n";
+            result += SetDepositPostService.Instance.SetFeeForSft("39103661", "0.6300", "3") + "\n\n";
+            // result += SetDepositPostService.Instance.LDFeeRate("110000004032435", "0.0063", 10, 3) + "\n\n";
+            // result += SetDepositPostService.Instance.LDFeeRate("110000004008674", "0.0063", 11, 3) + "\n\n";
+
+            return result;
         }