|
@@ -59,7 +59,7 @@ namespace MySystem
|
|
|
string OrderNo = jsonObj["outOrderNo"].ToString();
|
|
|
string HdOrderNo = jsonObj["orderNo"].ToString();
|
|
|
string TradeNo = "";
|
|
|
- if(content.Contains("\"payChannelOrderNo\""))
|
|
|
+ if (content.Contains("\"payChannelOrderNo\""))
|
|
|
{
|
|
|
TradeNo = jsonObj["payChannelOrderNo"].ToString();
|
|
|
}
|
|
@@ -80,17 +80,27 @@ namespace MySystem
|
|
|
LogHelper.Instance.WriteLog("赋值", "微信支付回调监控");
|
|
|
MerchantInfo merchant = db.MerchantInfo.FirstOrDefault(m => m.Id == order.MerchantId) ?? new MerchantInfo();
|
|
|
MerchantAddInfo addinfo = db.MerchantAddInfo.FirstOrDefault(m => m.Id == order.MerchantId) ?? new MerchantAddInfo();
|
|
|
- if(addinfo.Status == 1 && order.PayMode == 2)
|
|
|
+ if (addinfo.Status == 1 && order.PayMode == 2)
|
|
|
{
|
|
|
addinfo.Status = 2;
|
|
|
merchant.Status = 2;
|
|
|
addinfo.WeChatRemark = "";
|
|
|
+ // if (merchant.Latitude == 0)
|
|
|
+ // {
|
|
|
+ // //签约成功调用腾讯地图接口获取地址
|
|
|
+ // RedisDbconn.Instance.AddList("GetTencentAddressInfoQueue", "{\"Address\":\"" + merchant.Areas + merchant.Address + "\"}");
|
|
|
+ // }
|
|
|
}
|
|
|
- else if(addinfo.QueryCount == 1 && order.PayMode == 1)
|
|
|
+ else if (addinfo.QueryCount == 1 && order.PayMode == 1)
|
|
|
{
|
|
|
addinfo.QueryCount = 2;
|
|
|
merchant.QueryCount = 2;
|
|
|
addinfo.AlipayRemark = "";
|
|
|
+ // if (merchant.Latitude == 0)
|
|
|
+ // {
|
|
|
+ // //签约成功调用腾讯地图接口获取地址
|
|
|
+ // RedisDbconn.Instance.AddList("GetTencentAddressInfoQueue", "{\"Address\":\"" + merchant.Areas + merchant.Address + "\"}");
|
|
|
+ // }
|
|
|
}
|
|
|
order.UserId = merchant.UserId;
|
|
|
LogHelper.Instance.WriteLog("创客:" + merchant.UserId, "微信支付回调监控");
|
|
@@ -108,17 +118,17 @@ namespace MySystem
|
|
|
|
|
|
Models.Main1.WebCMSEntities db1 = new Models.Main1.WebCMSEntities();
|
|
|
var machines = db1.PosMachines.Select(m => new { m.SeoDescription, m.DeviceKind, m.BrandId, m.Detail, m.BindMerchantId }).Where(m => m.DeviceKind == "2" && m.BindMerchantId == order.MerchantId);
|
|
|
- foreach(var machine in machines)
|
|
|
+ foreach (var machine in machines)
|
|
|
{
|
|
|
- if(!string.IsNullOrEmpty(addinfo.AliMerchantId) && machine.BrandId == 1)
|
|
|
+ if (!string.IsNullOrEmpty(addinfo.AliMerchantId) && machine.BrandId == 1)
|
|
|
{
|
|
|
AliIotFunction.Instance.IotTradeVoice(machine.SeoDescription, addinfo.AliMerchantId, order.PayMoney.ToString("f2"), "OTHER");
|
|
|
}
|
|
|
- else if(machine.BrandId == 2)
|
|
|
+ else if (machine.BrandId == 2)
|
|
|
{
|
|
|
TianYuVoiceHelper.Instance.doSomething(DateTime.Now.ToString("yyyyMMddHHmmssfff"), machine.Detail, order.PayMoney.ToString("f2"));
|
|
|
}
|
|
|
- else if(machine.BrandId == 3)
|
|
|
+ else if (machine.BrandId == 3)
|
|
|
{
|
|
|
MqLinksHelper.Instance.doSomething(machine.Detail, order.PayMoney.ToString("f2"));
|
|
|
}
|
|
@@ -176,7 +186,7 @@ namespace MySystem
|
|
|
string acctNo = AppConfig.Haoda.AcctNo; //账户号,分账接收方账户号
|
|
|
string sacctNo = merchantAdd.MchtNo; //账户号,收款商户号
|
|
|
string acctType = "0"; //账户类型(0:商户收款账户(大B),1:分账接收方账户(小B))
|
|
|
-
|
|
|
+
|
|
|
decimal settleAmount = (decimal)order.SettleAmount / 100M;
|
|
|
decimal divideAmt = (1 - 0.0038M) * order.PayMoney;
|
|
|
divideAmt = decimal.Parse(divideAmt.ToString("f2"));
|
|
@@ -184,10 +194,10 @@ namespace MySystem
|
|
|
hdfee = decimal.Parse(hdfee.ToString("f2"));
|
|
|
decimal servicefee = 0.01M * order.PayMoney - hdfee;
|
|
|
servicefee = decimal.Parse(servicefee.ToString("f2"));
|
|
|
- decimal amount = order.PayMoney*(1-0.0038M) - servicefee;
|
|
|
+ decimal amount = order.PayMoney * (1 - 0.0038M) - servicefee;
|
|
|
amount = decimal.Parse(amount.ToString("f2"));
|
|
|
decimal otherAmt = settleAmount - servicefee - amount;
|
|
|
- if(otherAmt != 0)
|
|
|
+ if (otherAmt != 0)
|
|
|
{
|
|
|
amount += otherAmt;
|
|
|
}
|
|
@@ -198,7 +208,7 @@ namespace MySystem
|
|
|
string amountAmount = amount.ToString("f0");
|
|
|
string result = HaoDaHelper.Instance.OrderDivideAccounts(OrderDivideAccountsUtil.AddValue(applyNo, mchtNo, orderNo, acctNo, sacctNo, acctType, amountAmount, seviceAmount));
|
|
|
order.DivideLog = "请求分账日志:" + result;
|
|
|
- if(result.Contains("\"resultCode\":\"0\"") && (result.Contains("分账金额不足") || result.Contains("不存在")))
|
|
|
+ if (result.Contains("\"resultCode\":\"0\"") && (result.Contains("分账金额不足") || result.Contains("不存在")))
|
|
|
{
|
|
|
Status = 1;
|
|
|
}
|
|
@@ -216,7 +226,7 @@ namespace MySystem
|
|
|
}
|
|
|
}
|
|
|
order.Status = Status;
|
|
|
- if(Status == 2)
|
|
|
+ if (Status == 2)
|
|
|
{
|
|
|
order.DivideFlag = 1;
|
|
|
order.DivideDate = DateTime.Now;
|
|
@@ -284,10 +294,10 @@ namespace MySystem
|
|
|
hdfee = decimal.Parse(hdfee.ToString("f2"));
|
|
|
decimal servicefee = 0.01M * order.SettleAmount - hdfee;
|
|
|
servicefee = decimal.Parse(servicefee.ToString("f2"));
|
|
|
- decimal amount = order.SettleAmount*(1-0.0038M) - servicefee;
|
|
|
+ decimal amount = order.SettleAmount * (1 - 0.0038M) - servicefee;
|
|
|
amount = decimal.Parse(amount.ToString("f2"));
|
|
|
decimal otherAmt = divideAmt - servicefee - amount;
|
|
|
- if(otherAmt != 0)
|
|
|
+ if (otherAmt != 0)
|
|
|
{
|
|
|
amount += otherAmt;
|
|
|
}
|
|
@@ -335,7 +345,7 @@ namespace MySystem
|
|
|
{
|
|
|
//{"id":137403,"mchtNo":"1494637","tradeMchtNo":"030500107115593","channelMchtNo":"030500107115593","orderNo":"G2231123C02179895853","channelOrderNo":"50231123B00032642694","txSubCode":31,"paymentType":2,"status":0,"partStatus":0,"partAmount":0,"payAmount":1000,"payServiceFee":4,"settleAmount":996,"totalPerkAmount":0,"payTime":"2023-11-23 23:36:05","algoDate":"2023-11-23 00:00:00","bizDate":"2023-11-23 00:00:00","storeNo":"21627867","deviceSn":" ","cupsNo":"ylzf","cardType":0,"notPartAmount":996,"realAmount":996}
|
|
|
LogHelper.Instance.WriteLog(DateTime.Now.ToString() + "\n" + content, "监听支付结算订单");
|
|
|
- if(content.Contains("\"settleAmount\"") && content.Contains("\"txSubCode\":31,"))
|
|
|
+ if (content.Contains("\"settleAmount\"") && content.Contains("\"txSubCode\":31,"))
|
|
|
{
|
|
|
LogHelper.Instance.WriteLog("符合条件", "监听支付结算订单");
|
|
|
JsonData jsonObj = JsonMapper.ToObject(content);
|
|
@@ -345,7 +355,7 @@ namespace MySystem
|
|
|
LogHelper.Instance.WriteLog("settleAmount:" + settleAmount, "监听支付结算订单");
|
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
|
ConsumerOrders order = db.ConsumerOrders.FirstOrDefault(m => m.SeoTitle == orderNo);
|
|
|
- if(order != null)
|
|
|
+ if (order != null)
|
|
|
{
|
|
|
order.SettleAmount = settleAmount;
|
|
|
db.SaveChanges();
|