|
@@ -78,7 +78,7 @@ namespace MySystem
|
|
|
MerchantInfo merchant = db.MerchantInfo.FirstOrDefault(m => m.Id == order.MerchantId) ?? new MerchantInfo();
|
|
|
order.UserId = merchant.UserId;
|
|
|
ConsumerOrders check = db.ConsumerOrders.FirstOrDefault(m => m.Id < order.Id && m.Status > 0 && m.PayMode == order.PayMode && m.MerchantId == order.MerchantId);
|
|
|
- if(check != null)
|
|
|
+ if (check != null)
|
|
|
{
|
|
|
order.QueryCount = check.QueryCount + 1;
|
|
|
}
|
|
@@ -90,13 +90,13 @@ namespace MySystem
|
|
|
|
|
|
//语音播报
|
|
|
var machines = db.PosMachines.Select(m => new { m.DeviceKind, m.BrandId, m.Detail, m.BindMerchantId }).Where(m => m.DeviceKind == "1" && m.BindMerchantId == order.MerchantId);
|
|
|
- foreach(var machine in machines)
|
|
|
+ foreach (var machine in machines)
|
|
|
{
|
|
|
- if(machine.BrandId == 2)
|
|
|
+ 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"));
|
|
|
}
|
|
@@ -150,12 +150,12 @@ namespace MySystem
|
|
|
WebCMSEntities db = new WebCMSEntities();
|
|
|
DateTime checkDate = DateTime.Now.AddMinutes(-1);
|
|
|
var list = db.ConsumerOrders.Select(m => new { m.Id, m.CreateDate, m.Status, m.IsAct, m.PayMode }).Where(m => m.Status == 1 && m.PayMode == 2 && m.IsAct == 1 && m.CreateDate < checkDate).OrderBy(m => m.Id).Take(10).ToList();
|
|
|
- foreach(var sub in list)
|
|
|
+ foreach (var sub in list)
|
|
|
{
|
|
|
LogHelper.Instance.WriteLog(DateTime.Now.ToString(), "微信分账队列异常");
|
|
|
LogHelper.Instance.WriteLog("Id:" + sub.Id, "微信分账队列异常");
|
|
|
ConsumerOrders order = db.ConsumerOrders.FirstOrDefault(m => m.Id == sub.Id);
|
|
|
- if(order != null)
|
|
|
+ if (order != null)
|
|
|
{
|
|
|
order.Status = 2;
|
|
|
MerchantInfo merchant = db.MerchantInfo.FirstOrDefault(m => m.Id == order.MerchantId) ?? new MerchantInfo();
|
|
@@ -163,11 +163,11 @@ namespace MySystem
|
|
|
LogHelper.Instance.WriteLog("IsAct:" + order.IsAct, "微信分账队列监听");
|
|
|
LogHelper.Instance.WriteLog("PayMoney:" + order.PayMoney, "微信分账队列监听");
|
|
|
LogHelper.Instance.WriteLog("MinPayMoney:" + set.MinPayMoney, "微信分账队列监听");
|
|
|
- if(order.IsAct == 1 && order.PayMoney >= set.MinPayMoney)
|
|
|
+ if (order.IsAct == 1 && order.PayMoney >= set.MinPayMoney)
|
|
|
{
|
|
|
MerchantAddInfo merchantAdd = db.MerchantAddInfo.FirstOrDefault(m => m.Id == order.MerchantId) ?? new MerchantAddInfo();
|
|
|
//添加分账接收方
|
|
|
- if(merchant.Version == 0)
|
|
|
+ if (merchant.Version == 0)
|
|
|
{
|
|
|
WeChatFunction.Instance.AddReceive(merchantAdd.SubMchid, "MERCHANT_ID", WeChatFunction.Instance.MchId, WeChatFunction.Instance.MchName, "PARTNER");
|
|
|
merchant.Version = 1;
|
|
@@ -176,7 +176,7 @@ namespace MySystem
|
|
|
LogHelper.Instance.WriteLog("准备分账", "微信分账队列监听");
|
|
|
//发起分账
|
|
|
decimal fee = order.PayMoney; //单位:分
|
|
|
- if(fee >= 1)
|
|
|
+ if (fee >= 1)
|
|
|
{
|
|
|
string TradeNo = order.SeoTitle;
|
|
|
string OrderNo = order.OrderNo;
|
|
@@ -199,6 +199,7 @@ namespace MySystem
|
|
|
string ProfitShareResult = WeChatFunction.Instance.ProfitShare(merchantAdd.SubMchid, TradeNo, OrderNo, Receivers);
|
|
|
LogHelper.Instance.WriteLog("分账结果:" + ProfitShareResult, "微信分账队列监听");
|
|
|
order.DivideLog = "请求分账日志:" + ProfitShareResult;
|
|
|
+ order.DivideFlag = 1;
|
|
|
db.SaveChanges();
|
|
|
|
|
|
//开始监听分账状态
|
|
@@ -258,7 +259,7 @@ namespace MySystem
|
|
|
{
|
|
|
//发起分账
|
|
|
decimal fee = order.PayMoney; //单位:分
|
|
|
- if(fee >= 1)
|
|
|
+ if (fee >= 1)
|
|
|
{
|
|
|
string TradeNo = order.SeoTitle;
|
|
|
string OrderNo = order.OrderNo;
|
|
@@ -276,6 +277,7 @@ namespace MySystem
|
|
|
string ProfitShareResult = WeChatFunction.Instance.ProfitShare(merchantAdd.SubMchid, TradeNo, OrderNo, Receivers);
|
|
|
LogHelper.Instance.WriteLog("分账结果:" + ProfitShareResult, "微信分账队列监听");
|
|
|
order.DivideLog = "请求分账日志:" + ProfitShareResult;
|
|
|
+ order.DivideFlag = 1;
|
|
|
db.SaveChanges();
|
|
|
|
|
|
//开始监听分账状态
|