Procházet zdrojové kódy

立刷费率批量查询

lcl před 3 týdny
rodič
revize
55d0d5605d

+ 4 - 4
AppStart/Helper/PublicImportDataService.cs

@@ -597,13 +597,13 @@ namespace MySystem
         public string QueryLiSDeposit(string merchNo, string sn)
         {
             Dictionary<string, object> dic = new Dictionary<string, object>();
-            dic.Add("agentId", LiSAgentId);
+            dic.Add("agentId", LiSWeAgentId);
             dic.Add("deviceSn", sn);
             dic.Add("merchNo", merchNo);
             dic.Add("signMethod", "02");
-            string content = LiSAgentId + sn + merchNo + "02";
-            // string content = "{\"agentId\":\"" + LiSAgentId + "\",\"deviceSn\":\"" + sn + "\",\"merchNo\":\"" + merchNo + "\",\"signMethod\":\"02\"}";
-            string signstr = LiSSign(content);
+            string content = LiSWeAgentId + sn + merchNo + "02";
+            // string content = "{\"agentId\":\"" + LiSWeAgentId + "\",\"deviceSn\":\"" + sn + "\",\"merchNo\":\"" + merchNo + "\",\"signMethod\":\"02\"}";
+            string signstr = LiSWeSign(content);
             dic.Add("signData", signstr);
             string req = Newtonsoft.Json.JsonConvert.SerializeObject(dic);
             Utils.WriteLog("请求地址:" + LiSReqUrl + "FEE001", "查询商户费率");

+ 57 - 28
AppStart/Helper/TmpService.cs

@@ -177,17 +177,17 @@ namespace MySystem
                 //     Thread.Sleep(500);
                 // }
 
-                poslist = function.ReadInstance("tmpdata/lkbdq0.txt").Split('\n').ToList();
-                merids = db.KxsMachine.Where(m => poslist.Contains(m.PosSn) && m.BrandId == 15 && m.MerchantId > 0).ToList().Select(m => m.MerchantId).ToList();
-                mernos = db.KxsMerchant.Where(m => merids.Contains(m.Id)).ToList().Select(m => m.MerchantNo).ToList();
-                foreach(string merno in poslist)
-                {
-                    List<string> mernoList = new List<string>();
-                    mernoList.Add(merno);
-                    string result = PublicImportDataService.Instance.PospFee(mernoList, "LKB_0.65", "联客宝0.65");
-                    function.WriteLog(merno + "\n" + result + "\n\n", "tmp来客吧电签临时费率0");
-                    Thread.Sleep(500);
-                }
+                // poslist = function.ReadInstance("tmpdata/lkbdq0.txt").Split('\n').ToList();
+                // merids = db.KxsMachine.Where(m => poslist.Contains(m.PosSn) && m.BrandId == 15 && m.MerchantId > 0).ToList().Select(m => m.MerchantId).ToList();
+                // mernos = db.KxsMerchant.Where(m => merids.Contains(m.Id)).ToList().Select(m => m.MerchantNo).ToList();
+                // foreach(string merno in poslist)
+                // {
+                //     List<string> mernoList = new List<string>();
+                //     mernoList.Add(merno);
+                //     string result = PublicImportDataService.Instance.PospFee(mernoList, "LKB_0.65", "联客宝0.65");
+                //     function.WriteLog(merno + "\n" + result + "\n\n", "tmp来客吧电签临时费率0");
+                //     Thread.Sleep(500);
+                // }
 
                 // //联动电签
                 // poslist = function.ReadInstance("tmpdata/3.txt").Split('\n').ToList();
@@ -239,27 +239,56 @@ namespace MySystem
                 // }
 
                 //联动力POS
-                mernos = function.ReadInstance("tmpdata/zzb.txt").Replace("\r", "").Split('\n').ToList();
-                foreach(string merno in mernos)
-                {
-                    // string content = SetDepositPostService.Instance.LDZZBFeeRate(merno, 0.68M, 3);
-                    string content = SetDepositPostService.Instance.LDZZBFeeRate(merno, 0.68M, 0);
-                    JsonData jsonObj = JsonMapper.ToObject(content);
-                    string aesKey = jsonObj["encryptKey"].ToString();
-                    aesKey = SetDepositPostService.Instance.LDZZBDecrypt(aesKey);
-                    content += SetDepositPostService.Instance.AesDecrypt(jsonObj["data"].ToString(), aesKey);
-                    function.WriteLog(merno + "\n" + content + "\n\n", "tmp联动力POS临时费率");
-                    Thread.Sleep(1000);
-                }
+                // mernos = function.ReadInstance("tmpdata/zzb.txt").Replace("\r", "").Split('\n').ToList();
+                // foreach(string merno in mernos)
+                // {
+                //     // string content = SetDepositPostService.Instance.LDZZBFeeRate(merno, 0.68M, 3);
+                //     string content = SetDepositPostService.Instance.LDZZBFeeRate(merno, 0.68M, 0);
+                //     JsonData jsonObj = JsonMapper.ToObject(content);
+                //     string aesKey = jsonObj["encryptKey"].ToString();
+                //     aesKey = SetDepositPostService.Instance.LDZZBDecrypt(aesKey);
+                //     content += SetDepositPostService.Instance.AesDecrypt(jsonObj["data"].ToString(), aesKey);
+                //     function.WriteLog(merno + "\n" + content + "\n\n", "tmp联动力POS临时费率");
+                //     Thread.Sleep(1000);
+                // }
 
                 //盒易付
-                mernos = function.ReadInstance("tmpdata/hyf.txt").Replace("\r", "").Split('\n').ToList();
-                foreach(string merno in mernos)
+                // mernos = function.ReadInstance("tmpdata/hyf.txt").Replace("\r", "").Split('\n').ToList();
+                // foreach(string merno in mernos)
+                // {
+                //     string content = SetDepositPostService.Instance.BoxFee(merno, "0.65");
+                //     function.WriteLog(merno + "\n" + content + "\n\n", "tmp盒易付临时费率");
+                //     Thread.Sleep(1000);
+                // }
+
+                //批量查询立刷费率
+                poslist = function.ReadInstance("tmpdata/lishua.txt").Split('\n').ToList();
+            foreach(var pos in poslist)
+            {
+                string rateNum = "0";
+                string feeNum = "0";
+                string[] data = pos.Split('|');
+                string content = PublicImportDataService.Instance.QueryLiSDeposit(data[1], "");
+                JsonData jsonObj = JsonMapper.ToObject(content);
+                JsonData feeList = jsonObj["feeList"];
+                foreach (JsonData fee in feeList)
                 {
-                    string content = SetDepositPostService.Instance.BoxFee(merno, "0.65");
-                    function.WriteLog(merno + "\n" + content + "\n\n", "tmp盒易付临时费率");
-                    Thread.Sleep(1000);
+                    string feeCalcType = fee["feeCalcType"].ToString();
+                    if(feeCalcType == "M5" || feeCalcType == "T0")
+                    {
+                        string rate = fee["rate"].ToString();
+                        if(feeCalcType == "M5")
+                        {
+                            rateNum = rate;
+                        }
+                        else if(feeCalcType == "T0")
+                        {
+                            feeNum = rate;
+                        }
+                    }
                 }
+                function.WriteLog("" + data[0] + "|" + data[1] + "|" + rateNum + "|" + feeNum, "tmp立刷费率批量查询");
+            }
             }
             catch(Exception ex)
             {