|
@@ -110,6 +110,74 @@ namespace MySystem
|
|
db.SaveChanges();
|
|
db.SaveChanges();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ else if(pos.BrandId == 4 || pos.BrandId == 5) //乐刷
|
|
|
|
+ {
|
|
|
|
+ // 电签
|
|
|
|
+ // 电签标准0.63 729702301652492288
|
|
|
|
+ // 电签优惠0.63 729702442300088320
|
|
|
|
+ // 电签pos不加 696339175297294336
|
|
|
|
+
|
|
|
|
+ // 大POS
|
|
|
|
+ // PY-传统POS标准0.63 554666598481842176
|
|
|
|
+ // PY-传统POS优惠0.63 683857388021264384
|
|
|
|
+ // 大pos不加 698228081038991360
|
|
|
|
+
|
|
|
|
+ // 大POS
|
|
|
|
+ // 大POS标准0.6:713806109336940544
|
|
|
|
+ // 大POS优惠0.6:713806774515802112
|
|
|
|
+ // S0大pos不加:698228081038991360
|
|
|
|
+
|
|
|
|
+ // 电签POS
|
|
|
|
+ // 电签标准0.6:712391426860134400
|
|
|
|
+ // 电签优惠0.6:712391668250718208
|
|
|
|
+ // S0电签pos不加:696339175297294336
|
|
|
|
+ string bzConfigId = "", yhConfigId = "", surfeeConfigId = "";
|
|
|
|
+ if(pos.BrandId == 4)
|
|
|
|
+ {
|
|
|
|
+ if(Kind == 1)
|
|
|
|
+ {
|
|
|
|
+ bzConfigId = "729702301652492288";
|
|
|
|
+ yhConfigId = "729702442300088320";
|
|
|
|
+ surfeeConfigId = "696339175297294336";
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ bzConfigId = "712391426860134400";
|
|
|
|
+ yhConfigId = "712391668250718208";
|
|
|
|
+ surfeeConfigId = "696339175297294336";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ if(Kind == 1)
|
|
|
|
+ {
|
|
|
|
+ bzConfigId = "554666598481842176";
|
|
|
|
+ yhConfigId = "683857388021264384";
|
|
|
|
+ surfeeConfigId = "698228081038991360";
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ bzConfigId = "713806109336940544";
|
|
|
|
+ yhConfigId = "713806774515802112";
|
|
|
|
+ surfeeConfigId = "698228081038991360";
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ string content = SetFeeForBrand(pos.PosSn, bzConfigId, yhConfigId, surfeeConfigId, pos.BrandId);
|
|
|
|
+ JsonData obj = JsonMapper.ToObject(content);
|
|
|
|
+ if(obj["code"].ToString() == "0")
|
|
|
|
+ {
|
|
|
|
+ pos.SeoDescription = "设置成功";
|
|
|
|
+ SetRecordResult(db, RecordId, 1, "设置成功");
|
|
|
|
+ db.SaveChanges();
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ string msg = obj["msg"].ToString();
|
|
|
|
+ pos.SeoDescription = msg;
|
|
|
|
+ SetRecordResult(db, RecordId, -1, msg);
|
|
|
|
+ db.SaveChanges();
|
|
|
|
+ }
|
|
|
|
+ }
|
|
// else if(pos.BrandId == 6) //立刷
|
|
// else if(pos.BrandId == 6) //立刷
|
|
// {
|
|
// {
|
|
// string content = SetLiSFee(pos.PosSn, Fee);
|
|
// string content = SetLiSFee(pos.PosSn, Fee);
|
|
@@ -463,6 +531,104 @@ namespace MySystem
|
|
return Convert.ToBase64String(result);
|
|
return Convert.ToBase64String(result);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ #endregion
|
|
|
|
+
|
|
|
|
+ #region 乐刷
|
|
|
|
+
|
|
|
|
+ string LSPrivateKey = "MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAMjld3flY+R+9WTR2MvcR9qWISdmpayL3GNGg9gvzwkXkhDI/E7rX6ndLvVuaBbLWXB+UOh+8Pfw3Gvfv3D2GHZCTzPHOKrs2tyzqC8EmMUDQaoVOI2BY4vtB7IjNe9FlLGZx62JEJrMkHKnOSQxsi+flCoexKc2t1q7kQsO2F+3AgMBAAECgYBmQ7EB/mpQOXSPYucaN0L4eW3dEbqKUBPbEV0yInwgo7f+BWGyhsyGuooZ857W46Leyd5Dy8K8ZAbAfwCD7zJZsSzWsuvWQE991f+n0V7AAnKc3h4OsHa4oITUNo2nD3PvOpWfQx8vSuQuSFQgx0ExdnywS3So16mG2X6J2k87wQJBAPTfV10MNpA1e5oRdX4D4lQ2tVyg5GW72NMhUGWct/FvgcEW3V7xZ0z/gSLfFcGI8c4LGYWRVPIsBnWFx0LSZ6ECQQDSBoqXuF/LobfFFT3D47ixL8d+qDbOJ+ro3p4+iCkdxxJ/ncaqouxsr3fBbkSWh4t+UkbbihO/isPdBwLPZihXAkAc2jwHAKtlLogTzT7UzExcs92GvoZq3klcBy7b6i1aS1M0lycaSsNrNSfYHgUIOsSTDIfDTy59ImbYbhzeaMBBAkEAyfz6i4IJt3jXmZadKWk4NkhiT6CN3OUtGjsH69Hd4UKUuuFNsMwyHzD+NqzLEA5aDOoqNXftGDjnuAnHHRn9zwJAHqPHR5ZOKDN/ujeAIUTwmFFJh8vx6ujv7UTesBbtTsFYW6bZln+X6aS2G3Kdvz3e2cxQyH8ncc0yIh64a1fqyg==";
|
|
|
|
+ string LSPublicKey = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDI5Xd35WPkfvVk0djL3EfaliEnZqWsi9xjRoPYL88JF5IQyPxO61+p3S71bmgWy1lwflDofvD38Nxr379w9hh2Qk8zxziq7Nrcs6gvBJjFA0GqFTiNgWOL7QeyIzXvRZSxmcetiRCazJBypzkkMbIvn5QqHsSnNrdau5ELDthftwIDAQAB";
|
|
|
|
+ string OrgNo1 = "704067708098457600"; //快联盟电签pos
|
|
|
|
+ string OrgNo2 = "704058964878831616"; //快联盟大pos
|
|
|
|
+ string LSReqUrl = "https://lfs-org-push.ileshua.com"; //请求url
|
|
|
|
+
|
|
|
|
+ public string LSDecrypt(string data, string sign)
|
|
|
|
+ {
|
|
|
|
+ var toDecryptArray = Convert.FromBase64String(sign);
|
|
|
|
+ var rsa2 = RSA.Create();
|
|
|
|
+ rsa2.ImportPkcs8PrivateKey(Convert.FromBase64String(LSPrivateKey), out _);
|
|
|
|
+ var ContentArray = rsa2.Decrypt(toDecryptArray, RSAEncryptionPadding.Pkcs1);
|
|
|
|
+ string aeskey = System.Text.Encoding.UTF8.GetString(ContentArray);
|
|
|
|
+ return AesDecrypt(data, aeskey);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public string LSEncrypt(string sign)
|
|
|
|
+ {
|
|
|
|
+ return new RSAHelper(RSAType.RSA, System.Text.Encoding.UTF8, "", LSPublicKey).Encrypt(sign);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public string LSAesEncrypt(string str, string aeskey)
|
|
|
|
+ {
|
|
|
|
+ Byte[] toEncryptArray = Encoding.UTF8.GetBytes(str);
|
|
|
|
+ System.Security.Cryptography.RijndaelManaged rm = new System.Security.Cryptography.RijndaelManaged
|
|
|
|
+ {
|
|
|
|
+ Key = Encoding.UTF8.GetBytes(aeskey),
|
|
|
|
+ Mode = System.Security.Cryptography.CipherMode.ECB,
|
|
|
|
+ Padding = System.Security.Cryptography.PaddingMode.PKCS7
|
|
|
|
+ };
|
|
|
|
+ System.Security.Cryptography.ICryptoTransform cTransform = rm.CreateEncryptor();
|
|
|
|
+ Byte[] resultArray = cTransform.TransformFinalBlock(toEncryptArray, 0, toEncryptArray.Length);
|
|
|
|
+ return Convert.ToBase64String(resultArray);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //设置机具押金
|
|
|
|
+ public string SetDepositForLS(string snNo, string oldMarketId, string newMarketId, int BrandId)
|
|
|
|
+ {
|
|
|
|
+ string data = "{\"snNo\":\"" + snNo + "\",\"marketType\":\"400\",\"oldMarketId\":\"" + oldMarketId + "\",\"newMarketId\":\"" + newMarketId + "\"}";
|
|
|
|
+ return LSReqFunc("/org/pos/updatePosMarket", data, BrandId);
|
|
|
|
+ }
|
|
|
|
+ //查询配置活动信息
|
|
|
|
+ public string QueryActiveForConfig(string snNo, int BrandId)
|
|
|
|
+ {
|
|
|
|
+ string data = "{\"snNo\":\"" + snNo + "\"}";
|
|
|
|
+ return LSReqFunc("/org/pos/getMarketConfig", data, BrandId);
|
|
|
|
+ }
|
|
|
|
+ //查询营销活动信息
|
|
|
|
+ public string QueryActiveForBrand(int marketType, int BrandId)
|
|
|
|
+ {
|
|
|
|
+ string data = "{\"marketType\":\"" + marketType + "\"}";
|
|
|
|
+ return LSReqFunc("/org/pos/marketList", data, BrandId);
|
|
|
|
+ }
|
|
|
|
+ //终端费率模板查询
|
|
|
|
+ public string QueryFeeTmpForBrand(string rateType, string deviceType, int BrandId)
|
|
|
|
+ {
|
|
|
|
+ string data = "{\"rateType\":\"" + rateType + "\",\"deviceType\":\"" + deviceType + "\"}";
|
|
|
|
+ return LSReqFunc("/org/pos/rateConfigList", data, BrandId);
|
|
|
|
+ }
|
|
|
|
+ //终端费率查询
|
|
|
|
+ public string QueryFeeForBrand(string snNo, int BrandId)
|
|
|
|
+ {
|
|
|
|
+ string data = "{\"snNo\":\"" + snNo + "\"}";
|
|
|
|
+ return LSReqFunc("/org/pos/getRateConfig", data, BrandId);
|
|
|
|
+ }
|
|
|
|
+ //终端费率模板修改
|
|
|
|
+ public string SetFeeForBrand(string snNo, string bzConfigId, string yhConfigId, string surfeeConfigId, int BrandId)
|
|
|
|
+ {
|
|
|
|
+ string data = "{\"snNo\":\"" + snNo + "\",\"bzConfigId\":\"" + bzConfigId + "\",\"yhConfigId\":\"" + yhConfigId + "\",\"surfeeConfigId\":\"" + surfeeConfigId + "\"}";
|
|
|
|
+ return LSReqFunc("/org/pos/updatePosRate", data, BrandId);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public string LSReqFunc(string apiPath, string data, int BrandId)
|
|
|
|
+ {
|
|
|
|
+ string aeskey = function.MD5_16(Guid.NewGuid().ToString());
|
|
|
|
+ string req = "{";
|
|
|
|
+ if (BrandId == 4)
|
|
|
|
+ {
|
|
|
|
+ req += "\"orgId\":\"" + OrgNo1 + "\",";
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ req += "\"orgId\":\"" + OrgNo2 + "\",";
|
|
|
|
+ }
|
|
|
|
+ req += "\"requestId\":\"" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8) + "\",";
|
|
|
|
+ req += "\"timeStamp\":\"" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "\",";
|
|
|
|
+ req += "\"version\":\"1.0\",";
|
|
|
|
+ req += "\"data\":\"" + LSAesEncrypt(data, aeskey) + "\",";
|
|
|
|
+ req += "\"sign\":\"" + LSEncrypt(aeskey) + "\"";
|
|
|
|
+ req += "}";
|
|
|
|
+ string result = function.PostWebRequest(LSReqUrl + apiPath, req, "application/json");
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
+
|
|
#endregion
|
|
#endregion
|
|
|
|
|
|
#region 立刷
|
|
#region 立刷
|