Browse Source

提交

master
gwbvipvip 7 months ago
parent
commit
01ae557eb3
3 changed files with 33 additions and 3 deletions
  1. +31
    -1
      BPA.KitChen.GroupMealOrder.Application/Service/WeighOrder/Service/WeighOrderService.cs
  2. +1
    -1
      BPA.KitChen.WeChat/WechatServer/Service/WechatNotityService.cs
  3. +1
    -1
      BPA.KitChen.WeChat/WechatServer/Service/WechatPayService.cs

+ 31
- 1
BPA.KitChen.GroupMealOrder.Application/Service/WeighOrder/Service/WeighOrderService.cs View File

@@ -222,6 +222,19 @@ namespace BPA.KitChen.GroupMealOrder.Application.Service.WeighOrder.Service
{
throw Oops.Oh("餐盘被占用");
}

//查询解绑产盘
var unbindRed = db.Queryable<BPA_WeighOrderDiningPlateUnbindRecord>()
.Where(x => x.WeighOrderId== inputDto.OrderId && x.DiningPlateId == diningPlateInfo.Id)
.Select(t => new WeighOrderDto
{
Id = t.Id.SelectAll(),
}).ToList();
if (unbindRed.Count > 0)
{
throw Oops.Oh("当前订单与餐盘解除绑定");
}

diningPlate.Add(new BPA_WeighOrderDiningPlate()
{
DiningPlateId = diningPlateInfo.Id,
@@ -587,12 +600,13 @@ namespace BPA.KitChen.GroupMealOrder.Application.Service.WeighOrder.Service
{
Id = t.Id.SelectAll(),
}).FirstAsync();

if (res == null || res.States == 1)
{
throw Oops.Oh("无数据");
}


//查询订单商品
var orderGoods = await db.Queryable<BPA_WeighOrderGoods>()
.Where(x => x.OrderId == res.Id)
@@ -625,6 +639,22 @@ namespace BPA.KitChen.GroupMealOrder.Application.Service.WeighOrder.Service
ChipCode = x.ChipCode,
QRCode = x.QRCode,
}).ToListAsync();

var ids= diningPlate.Select(x=>x.DiningPlateId).ToList();
//查询解绑产盘
var unbindRed = db.Queryable<BPA_WeighOrderDiningPlateUnbindRecord>()
.Where(x => x.WeighOrderId == res.Id && ids.Contains(x.DiningPlateId))
.OrderBy(x => x.CreateAt, OrderByType.Desc)
.Select(t => new WeighOrderDto
{
Id = t.Id.SelectAll(),
}).ToList();
if (unbindRed.Count > 0)
{
throw Oops.Oh("没有餐盘或已用被解绑");
}


if (diningPlate != null)
{
foreach (var item in diningPlate)


+ 1
- 1
BPA.KitChen.WeChat/WechatServer/Service/WechatNotityService.cs View File

@@ -68,7 +68,7 @@ namespace BPA.KitChen.WeChat.WechatServer.Service
return WeChatPayNotifyResult.Failure;
}

if (order.States==1&&order.PayStates==1)
if (order.States==1&&order.PayStates==1&&!string.IsNullOrEmpty(order.TransactionId))
{
return WeChatPayNotifyResult.Failure;
}


+ 1
- 1
BPA.KitChen.WeChat/WechatServer/Service/WechatPayService.cs View File

@@ -88,7 +88,7 @@ namespace BPA.KitChen.WeChat.WechatServer.Service
SpBillCreateIp = opt.MchIP,
NotifyUrl = opt.WeChatPayNotifyUrl,
TradeType = "JSAPI",
OpenId =string.IsNullOrEmpty(openid)? order .CreateId: openid
OpenId =string.IsNullOrEmpty(openid)? order .CreateId: openid,
};
var response = await _client.ExecuteAsync(request, PayOpt);
if (response.ReturnCode == WeChatPayCode.Success && response.ResultCode == WeChatPayCode.Success)


Loading…
Cancel
Save