|
@@ -22,9 +22,9 @@ namespace MySystem
|
|
|
dataContent.Add("id_card", mer.SeoKeyword); //商户身份证
|
|
|
dataContent.Add("mer_name", mer.MerName); //商户姓名
|
|
|
dataContent.Add("mer_mobile", mer.MerMobile); //商户手机号
|
|
|
- dataContent.Add("request_id", mer.CreateTime.Value.ToString("yyyyMMddHHmmssfff") + function.get_Random(8)); //流水号
|
|
|
+ dataContent.Add("request_id", getRequestId(mer.Id, "bind")); //流水号
|
|
|
dataContent.Add("bind_time", mer.CreateTime.Value.ToString("yyyy-MM-dd HH:mm:ss")); //绑定时间
|
|
|
- dataContent.Add("brand", mer.ProductType); //品牌
|
|
|
+ dataContent.Add("brand", int.Parse(function.CheckInt(mer.ProductType))); //品牌
|
|
|
Push("bind", dataContent);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
@@ -42,9 +42,9 @@ namespace MySystem
|
|
|
dataContent.Add("id_card", mer.LegalIdCard); //商户身份证
|
|
|
dataContent.Add("mer_name", mer.MerName); //商户姓名
|
|
|
dataContent.Add("mer_mobile", ""); //商户手机号
|
|
|
- dataContent.Add("request_id", mer.CreateTime.Value.ToString("yyyyMMddHHmmssfff") + function.get_Random(8)); //流水号
|
|
|
+ dataContent.Add("request_id", getRequestId(mer.Id, "merchant")); //流水号
|
|
|
dataContent.Add("bind_time", mer.CreateTime.Value.ToString("yyyy-MM-dd HH:mm:ss")); //绑定时间
|
|
|
- dataContent.Add("brand", mer.ProductType); //品牌
|
|
|
+ dataContent.Add("brand", int.Parse(function.CheckInt(mer.ProductType))); //品牌
|
|
|
Push("bind", dataContent);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
@@ -61,9 +61,9 @@ namespace MySystem
|
|
|
Dictionary<string, object> dataContent = new Dictionary<string, object>();
|
|
|
dataContent.Add("pos_sn", mer.MerSnNo); //机具sn
|
|
|
dataContent.Add("mer_no", mer.MerNo); //商户号
|
|
|
- dataContent.Add("request_id", DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8)); //流水号
|
|
|
+ dataContent.Add("request_id", getRequestId(mer.Id, "unbind")); //流水号
|
|
|
dataContent.Add("un_bind_time", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); //绑定时间
|
|
|
- dataContent.Add("brand", mer.ProductType); //品牌
|
|
|
+ dataContent.Add("brand", int.Parse(function.CheckInt(mer.ProductType))); //品牌
|
|
|
Push("un_bind", dataContent);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
@@ -78,12 +78,12 @@ namespace MySystem
|
|
|
try
|
|
|
{
|
|
|
Dictionary<string, object> dataContent = new Dictionary<string, object>();
|
|
|
- dataContent.Add("request_id", DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8)); //流水号
|
|
|
+ dataContent.Add("request_id", getRequestId(mer.Id, "changebind")); //流水号
|
|
|
dataContent.Add("mer_no", mer.MerNo); //商户号
|
|
|
dataContent.Add("source_pos_sn", mer.MerSnNo); //来源机具sn
|
|
|
- dataContent.Add("source_brand", mer.ProductType); //来源品牌
|
|
|
+ dataContent.Add("source_brand", int.Parse(function.CheckInt(mer.ProductType))); //来源品牌
|
|
|
dataContent.Add("to_pos_sn", mer.MerNewSnNo); //兑换机具sn
|
|
|
- dataContent.Add("to_brand", mer.ProductType); //兑换品牌
|
|
|
+ dataContent.Add("to_brand", int.Parse(function.CheckInt(mer.ProductType))); //兑换品牌
|
|
|
dataContent.Add("change_bind_time", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); //换绑时间
|
|
|
Push("change_bind", dataContent);
|
|
|
}
|
|
@@ -101,10 +101,10 @@ namespace MySystem
|
|
|
Dictionary<string, object> dataContent = new Dictionary<string, object>();
|
|
|
dataContent.Add("pos_sn", act.SnNo); //机具sn
|
|
|
dataContent.Add("mer_no", act.MerNo); //商户号
|
|
|
- dataContent.Add("request_id", DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8)); //流水号
|
|
|
+ dataContent.Add("request_id", getRequestId(act.Id, "deposit")); //流水号
|
|
|
dataContent.Add("deposit_amount", act.SeoTitle); //押金金额
|
|
|
dataContent.Add("trade_time", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); //交易时间
|
|
|
- dataContent.Add("brand", act.ProductType); //品牌
|
|
|
+ dataContent.Add("brand", int.Parse(function.CheckInt(act.ProductType))); //品牌
|
|
|
Push("deposit", dataContent);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
@@ -119,10 +119,10 @@ namespace MySystem
|
|
|
Dictionary<string, object> dataContent = new Dictionary<string, object>();
|
|
|
dataContent.Add("pos_sn", trade.TradeSnNo); //机具sn
|
|
|
dataContent.Add("mer_no", trade.MerNo); //商户号
|
|
|
- dataContent.Add("request_id", DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8)); //流水号
|
|
|
+ dataContent.Add("request_id", getRequestId(trade.Id, "deposit1")); //流水号
|
|
|
dataContent.Add("deposit_amount", trade.TradeAmount); //押金金额
|
|
|
dataContent.Add("trade_time", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); //交易时间
|
|
|
- dataContent.Add("brand", trade.ProductType); //品牌
|
|
|
+ dataContent.Add("brand", int.Parse(function.CheckInt(trade.ProductType))); //品牌
|
|
|
Push("deposit", dataContent);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
@@ -139,9 +139,9 @@ namespace MySystem
|
|
|
Dictionary<string, object> dataContent = new Dictionary<string, object>();
|
|
|
dataContent.Add("pos_sn", act.SnNo); //机具sn
|
|
|
dataContent.Add("mobile", act.MerMobile); //商户号
|
|
|
- dataContent.Add("request_id", DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8)); //流水号
|
|
|
+ dataContent.Add("request_id", getRequestId(act.Id, "active")); //流水号
|
|
|
dataContent.Add("activation_time", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")); //激活时间
|
|
|
- dataContent.Add("brand", act.ProductType); //品牌
|
|
|
+ dataContent.Add("brand", int.Parse(function.CheckInt(act.ProductType))); //品牌
|
|
|
Push("active", dataContent);
|
|
|
}
|
|
|
catch (Exception ex)
|
|
@@ -156,29 +156,104 @@ namespace MySystem
|
|
|
try
|
|
|
{
|
|
|
int QrPayFlag = 0;
|
|
|
+ int BankCardType = 1;
|
|
|
if (trade.ProductType == "1")
|
|
|
{
|
|
|
if (trade.TradeType == "02") QrPayFlag = 1;
|
|
|
+ BankCardType = int.Parse(trade.BankCardType);
|
|
|
}
|
|
|
else if (trade.ProductType == "2")
|
|
|
{
|
|
|
if (trade.TradeType == "CLOUD_PAY") QrPayFlag = 1;
|
|
|
+ if (trade.TradeType == "CREDIT_BY_CARD")
|
|
|
+ {
|
|
|
+ BankCardType = 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ BankCardType = 0;
|
|
|
+ }
|
|
|
}
|
|
|
else if (trade.ProductType == "4")
|
|
|
{
|
|
|
if (trade.TradeType == "200") QrPayFlag = 1;
|
|
|
+ if (trade.BankCardType == "100")
|
|
|
+ {
|
|
|
+ BankCardType = 1;
|
|
|
+ }
|
|
|
+ else if (trade.BankCardType == "200")
|
|
|
+ {
|
|
|
+ BankCardType = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (trade.ProductType == "6")
|
|
|
+ {
|
|
|
+ if (trade.BankCardType == "02" || trade.BankCardType == "12")
|
|
|
+ {
|
|
|
+ BankCardType = 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ BankCardType = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (trade.ProductType == "7")
|
|
|
+ {
|
|
|
+ if (trade.BankCardType == "OA" || trade.BankCardType == "CC" || trade.BankCardType == "SCC")
|
|
|
+ {
|
|
|
+ BankCardType = 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ BankCardType = 0;
|
|
|
+ }
|
|
|
}
|
|
|
else if (trade.ProductType == "8" || trade.ProductType == "9")
|
|
|
{
|
|
|
if (trade.TradeType == "200") QrPayFlag = 1;
|
|
|
+ if (trade.BankCardType == "100")
|
|
|
+ {
|
|
|
+ BankCardType = 1;
|
|
|
+ }
|
|
|
+ else if (trade.BankCardType == "200")
|
|
|
+ {
|
|
|
+ BankCardType = 0;
|
|
|
+ }
|
|
|
}
|
|
|
else if (trade.ProductType == "10" || trade.ProductType == "11")
|
|
|
{
|
|
|
if (trade.TradeType == "F010") QrPayFlag = 1;
|
|
|
+ if (trade.BankCardType == "01")
|
|
|
+ {
|
|
|
+ BankCardType = 1;
|
|
|
+ }
|
|
|
+ else if (trade.BankCardType == "00")
|
|
|
+ {
|
|
|
+ BankCardType = 0;
|
|
|
+ }
|
|
|
}
|
|
|
else if (trade.ProductType == "12") //盒易付
|
|
|
{
|
|
|
if (trade.Field3 == "1") QrPayFlag = 1;
|
|
|
+ if (trade.BankCardType == "C")
|
|
|
+ {
|
|
|
+ BankCardType = 1;
|
|
|
+ }
|
|
|
+ else if (trade.BankCardType == "D")
|
|
|
+ {
|
|
|
+ BankCardType = 0;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else if (trade.ProductType == "15")
|
|
|
+ {
|
|
|
+ if (trade.BankCardType == "02")
|
|
|
+ {
|
|
|
+ BankCardType = 1;
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ BankCardType = 0;
|
|
|
+ }
|
|
|
}
|
|
|
Dictionary<string, object> dataContent = new Dictionary<string, object>();
|
|
|
dataContent.Add("pos_sn", trade.TradeSnNo); //机具sn
|
|
@@ -186,8 +261,8 @@ namespace MySystem
|
|
|
dataContent.Add("request_id", trade.TradeSerialNo); //流水号
|
|
|
dataContent.Add("trade_amount", trade.TradeAmount); //交易金额
|
|
|
dataContent.Add("trade_time", trade.CreateDate.Value.ToString("yyyy-MM-dd HH:mm:ss")); //交易时间
|
|
|
- dataContent.Add("brand", trade.ProductType); //品牌
|
|
|
- dataContent.Add("card_type", trade.BankCardType); //卡类型
|
|
|
+ dataContent.Add("brand", int.Parse(function.CheckInt(trade.ProductType))); //品牌
|
|
|
+ dataContent.Add("card_type", BankCardType); //卡类型
|
|
|
dataContent.Add("qr_pay_flag", QrPayFlag); //云闪付标记
|
|
|
Push("trade", dataContent);
|
|
|
}
|
|
@@ -204,5 +279,14 @@ namespace MySystem
|
|
|
data.Add("data_content", dataContent);
|
|
|
RedisDbconn.Instance.AddList("KxsPosDataQueue", Newtonsoft.Json.JsonConvert.SerializeObject(data));
|
|
|
}
|
|
|
+
|
|
|
+ public static string getRequestId(int id, string type)
|
|
|
+ {
|
|
|
+ if(id > 0)
|
|
|
+ {
|
|
|
+ return function.MD5_32(id.ToString() + type);
|
|
|
+ }
|
|
|
+ return DateTime.Now.ToString("yyyyMMddHHmmssfff") + function.get_Random(8);
|
|
|
+ }
|
|
|
}
|
|
|
}
|