Ver a proveniência

提交

master
gwbvipvip há 9 meses
ascendente
cometimento
8f2cda1a0c
3 ficheiros alterados com 33 adições e 14 eliminações
  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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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 Ver ficheiro

@@ -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; }
}
}

Carregando…
Cancelar
Guardar