Browse Source

提交

master
gwbvipvip 9 months ago
parent
commit
8f2cda1a0c
3 changed files with 33 additions and 14 deletions
  1. +2
    -0
      BPA.KitChen.GroupMealOrder.Application/Service/WeighOrder/Dtos/WeighOrderDto.cs
  2. +26
    -14
      BPA.KitChen.GroupMealOrder.Application/Service/WeighOrder/Service/WeighOrderService.cs
  3. +5
    -0
      BPA.KitChen.GroupMealOrder.Core/Entity/BPA_WeighOrderGoods.cs

+ 2
- 0
BPA.KitChen.GroupMealOrder.Application/Service/WeighOrder/Dtos/WeighOrderDto.cs View File

@@ -65,6 +65,8 @@ namespace BPA.KitChen.GroupMealOrder.Application.Service.WeighOrder.Dtos

public decimal TotalAmount { get; set; }

public decimal Price { get; set; }


/// <summary>
/// 商品商品重量


+ 26
- 14
BPA.KitChen.GroupMealOrder.Application/Service/WeighOrder/Service/WeighOrderService.cs View File

@@ -179,6 +179,7 @@ namespace BPA.KitChen.GroupMealOrder.Application.Service.WeighOrder.Service
TotalAmount = thisGoods.Price * item.GoodsWeight,
Id = Guid.NewGuid().ToString(),
DiningPlateId = thisdiningPlate.Id,
Price= thisGoods.Price

});
}
@@ -596,9 +597,33 @@ namespace BPA.KitChen.GroupMealOrder.Application.Service.WeighOrder.Service
GroupId = x.GroupId,
Id = x.Id,
OrderId = x.OrderId,
TotalAmount = x.TotalAmount,
DiningPlateId = x.DiningPlateId,
Price=x.Price,
}).ToList();



//查询订单餐盘
var diningPlate = await db.Queryable<BPA_WeighOrderDiningPlate>()
.Where(x => x.WeighOrderId == item.Id)
.Select(x => new WeighOrderDiningPlateDto()
{
DiningPlateId = x.DiningPlateId,
OrderId = x.WeighOrderId,
ChipCode = x.ChipCode,
QRCode = x.QRCode,
}).ToListAsync();
// item.DiningPlateInfo = diningPlate;
if (diningPlate != null)
{
foreach (var item2 in diningPlate)
{
var goods = item.GoodsInfo.Where(x => x.DiningPlateId == item2.DiningPlateId).ToList();
item2.GoodsInfo = goods;
}
item.DiningPlateInfo = diningPlate;
}
item.GoodsInfo = item.GoodsInfo
.GroupBy(x => x.GoodsId)
.Select(x => new WeighOrderGoodsDto()
@@ -611,20 +636,6 @@ namespace BPA.KitChen.GroupMealOrder.Application.Service.WeighOrder.Service
OrderId = x.FirstOrDefault()?.OrderId,
})
.ToList();

//查询订单餐盘
var diningPlate = await db.Queryable<BPA_WeighOrderDiningPlate>()
.Where(x => x.WeighOrderId == item.Id)
.Select(x => new WeighOrderDiningPlateDto()
{
DiningPlateId = x.DiningPlateId,
OrderId = x.WeighOrderId,
ChipCode = x.ChipCode,
QRCode = x.QRCode,
}).ToListAsync();
item.DiningPlateInfo = diningPlate;

item.TotalAmount = item.GoodsInfo.Sum(x => x.TotalAmount);
}


@@ -682,6 +693,7 @@ namespace BPA.KitChen.GroupMealOrder.Application.Service.WeighOrder.Service
OrderId = x.OrderId,
DiningPlateId = x.DiningPlateId,
TotalAmount = x.TotalAmount,
Price = x.Price,
}).ToList();
}



+ 5
- 0
BPA.KitChen.GroupMealOrder.Core/Entity/BPA_WeighOrderGoods.cs View File

@@ -75,5 +75,10 @@ namespace BPA.KitChen.GroupMealOrder.Core.Entity
/// </summary>
[SugarColumn(ColumnDataType = "nvarchar(64)", ColumnDescription = "创建人", IsNullable = true)]
public string CreateBy { get; set; }

/// <summary>
/// 单价
/// </summary>
public decimal Price { get; set; }
}
}

Loading…
Cancel
Save