|
|
@@ -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) |
|
|
|