fixed 初步完善订单表格
This commit is contained in:
parent
c925f697d2
commit
f68693a0de
@ -35,16 +35,6 @@ namespace ARW.Model.Models.Business.OrderManage.Orders
|
||||
public long OrderGuid { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :商品guid
|
||||
/// 空值 : false
|
||||
/// </summary>
|
||||
[EpplusTableColumn(Header = "商品guid")]
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[SugarColumn(ColumnName = "goods_guid")]
|
||||
public long GoodsGuid { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :订单流水guid
|
||||
/// 空值 : false
|
||||
|
41
ARW.Model/Vo/Business/OrderManage/Orders/OrderGoodsVo.cs
Normal file
41
ARW.Model/Vo/Business/OrderManage/Orders/OrderGoodsVo.cs
Normal file
@ -0,0 +1,41 @@
|
||||
using Newtonsoft.Json;
|
||||
using OfficeOpenXml.Attributes;
|
||||
using SqlSugar;
|
||||
using System;
|
||||
|
||||
namespace ARW.Model.Vo.Business.OrderManage.Orders
|
||||
{
|
||||
/// <summary>
|
||||
/// 订单展示对象
|
||||
///
|
||||
/// @author lwh
|
||||
/// @date 2023-08-29
|
||||
/// </summary>
|
||||
public class OrderGoodsVo
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// 商品名称
|
||||
/// </summary>
|
||||
public string GoodsName { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商品图片
|
||||
/// </summary>
|
||||
public string GoodsPicture { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商品规格值
|
||||
/// </summary>
|
||||
public string GoodsSpecName { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 商品单价
|
||||
/// </summary>
|
||||
public decimal GoodsPrice { get; set; }
|
||||
|
||||
}
|
||||
}
|
@ -29,21 +29,10 @@ namespace ARW.Model.Vo.Business.OrderManage.Orders
|
||||
[EpplusIgnore]
|
||||
public long OrderGuid { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :商品guid
|
||||
/// 商品信息
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[EpplusTableColumn(Header = "商品guid")]
|
||||
public long GoodsGuid { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :订单流水guid
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[EpplusTableColumn(Header = "订单流水guid")]
|
||||
public long PaymentGuid { get; set; }
|
||||
public OrderGoodsVo GoodsInfo { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
@ -53,14 +42,20 @@ namespace ARW.Model.Vo.Business.OrderManage.Orders
|
||||
[EpplusTableColumn(Header = "客户guid")]
|
||||
public long CustomerGuid { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户名称
|
||||
/// </summary>
|
||||
public string CustomerNickName { get; set;}
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :店铺guid
|
||||
/// 客户手机号
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[EpplusIgnore]
|
||||
public long? ShopGuid { get; set; }
|
||||
public string CustomerMobilePhoneNumber { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 客户头像
|
||||
/// </summary>
|
||||
public string CustomerAvatar { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :订单号
|
||||
@ -69,49 +64,12 @@ namespace ARW.Model.Vo.Business.OrderManage.Orders
|
||||
public string OrderNumber { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :商品总金额
|
||||
/// </summary>
|
||||
[EpplusTableColumn(Header = "商品总金额")]
|
||||
public decimal GoodsTotalAmoun { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :订单金额
|
||||
/// </summary>
|
||||
[EpplusTableColumn(Header = "订单金额")]
|
||||
public decimal OrderAmount { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :优惠券guid
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[EpplusIgnore]
|
||||
public long? CouponGuid { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :优惠券抵扣金额
|
||||
/// </summary>
|
||||
[EpplusIgnore]
|
||||
public decimal CouponMoney { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :积分抵扣金额
|
||||
/// </summary>
|
||||
[EpplusIgnore]
|
||||
public decimal PointsMoney { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :积分抵扣数量
|
||||
/// </summary>
|
||||
[EpplusIgnore]
|
||||
public decimal PointsNum { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :实际付款金额(包含运费)
|
||||
/// </summary>
|
||||
@ -120,23 +78,15 @@ namespace ARW.Model.Vo.Business.OrderManage.Orders
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :后台修改的订单金额(差价)
|
||||
/// 描述 :运费金额
|
||||
/// </summary>
|
||||
[EpplusIgnore]
|
||||
public decimal UpdatePrice { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :买家留言
|
||||
/// </summary>
|
||||
[EpplusIgnore]
|
||||
public string OrderRemark { get; set; }
|
||||
|
||||
[EpplusTableColumn(Header = "运费金额")]
|
||||
public decimal ExpressPrice { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :支付方式(1微信支付 2余额支付)
|
||||
/// </summary>
|
||||
[EpplusTableColumn(Header = "支付方式(1微信支付 2余额支付)")]
|
||||
[EpplusTableColumn(Header = "支付方式")]
|
||||
public int PayType { get; set; }
|
||||
|
||||
|
||||
@ -147,13 +97,6 @@ namespace ARW.Model.Vo.Business.OrderManage.Orders
|
||||
public int PayStatus { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :付款时间
|
||||
/// </summary>
|
||||
[EpplusTableColumn(Header = "付款时间", NumberFormat = "yyyy-MM-dd HH:mm:ss")]
|
||||
public DateTime? PayTime { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :配送方式(1快递配送)
|
||||
/// </summary>
|
||||
@ -161,103 +104,27 @@ namespace ARW.Model.Vo.Business.OrderManage.Orders
|
||||
public int DeliveryType { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :运费金额
|
||||
/// </summary>
|
||||
[EpplusTableColumn(Header = "运费金额")]
|
||||
public decimal ExpressPrice { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :物流公司guid
|
||||
/// </summary>
|
||||
[JsonConverter(typeof(ValueToStringConverter))]
|
||||
[EpplusIgnore]
|
||||
public long? LogisticsCompanyGuid { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :物流公司
|
||||
/// </summary>
|
||||
[EpplusIgnore]
|
||||
public string LogisticsCompany { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :物流单号
|
||||
/// </summary>
|
||||
[EpplusIgnore]
|
||||
public string LogisticsTrackingNumber { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :发货状态(1未发货 2已发货)
|
||||
/// </summary>
|
||||
[EpplusTableColumn(Header = "发货状态(1未发货 2已发货)")]
|
||||
public int DeliveryStatus { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :发货时间
|
||||
/// </summary>
|
||||
[EpplusIgnore]
|
||||
public DateTime? DeliveryTime { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :收货状态(1未收货 2已收货)
|
||||
/// </summary>
|
||||
[EpplusTableColumn(Header = "收货状态(1未收货 2已收货)")]
|
||||
public int ReceiptStatus { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :收货时间
|
||||
/// </summary>
|
||||
[EpplusIgnore]
|
||||
public DateTime? ReceiptTime { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :订单状态(1进行中 2取消 3待取消 4已完成)
|
||||
/// </summary>
|
||||
[EpplusTableColumn(Header = "订单状态(1进行中 2取消 3待取消 4已完成)")]
|
||||
public int OrderStatus { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :赠送的积分数量
|
||||
/// 下单时间
|
||||
/// </summary>
|
||||
[EpplusIgnore]
|
||||
public decimal PointsBonus { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :订单是否已结算(1未结算 2已结算)
|
||||
/// </summary>
|
||||
[EpplusTableColumn(Header = "订单是否已结算(1未结算 2已结算)")]
|
||||
public int IsSettled { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :微信支付交易号
|
||||
/// </summary>
|
||||
[EpplusIgnore]
|
||||
public string TransactionId { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :是否已评价(1否 2是)
|
||||
/// </summary>
|
||||
[EpplusTableColumn(Header = "是否已评价(1否 2是)")]
|
||||
public int IsComment { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 描述 :订单来源(1普通订单)
|
||||
/// </summary>
|
||||
[EpplusTableColumn(Header = "订单来源(1普通订单)")]
|
||||
public int OrderSource { get; set; }
|
||||
|
||||
public DateTime CreateTime { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ namespace ARW.Service.Business.BusinessService.GoodsManager.GoodsSpecs.GoodsSkus
|
||||
GoodsSkuStockNum = sku.GoodsSkuStockNum,
|
||||
GoodsSkuWeight = sku.GoodsSkuWeight
|
||||
}).ToList();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -147,6 +147,36 @@ namespace ARW.Service.Business.BusinessService.GoodsManager.GoodsSpecs.GoodsSkus
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取全部规格值名称
|
||||
/// </summary>
|
||||
/// <param name="skuId"></param>
|
||||
/// <returns></returns>
|
||||
public async Task<string> GetSpecValueFullName(int skuId)
|
||||
{
|
||||
var str = "";
|
||||
// 从数据库中查询规格值名称
|
||||
var sku = await _GoodsSkuRepository.GetByIdAsync(skuId);
|
||||
if (sku != null)
|
||||
{
|
||||
var specValue = await _SpecValueRepository.GetByIdAsync(sku.SpecValueId);
|
||||
str += specValue.SpecValueName;
|
||||
if (sku.SpecSecondValueId != 0)
|
||||
{
|
||||
var specSecondValue = await _SpecValueRepository.GetByIdAsync(sku.SpecSecondValueId);
|
||||
str += " " + specSecondValue.SpecValueName;
|
||||
}
|
||||
if (sku.SpecThirdValueId != 0)
|
||||
{
|
||||
var specThirdValue = await _SpecValueRepository.GetByIdAsync(sku.SpecThirdValueId);
|
||||
str += " " + specThirdValue.SpecValueName;
|
||||
}
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
#region Excel处理
|
||||
|
||||
|
||||
|
@ -14,6 +14,10 @@ using ARW.Service.Business.IBusinessService.OrderManage.Orders;
|
||||
using ARW.Model.Dto.Business.OrderManage.Orders;
|
||||
using ARW.Model.Models.Business.OrderManage.Orders;
|
||||
using ARW.Model.Vo.Business.OrderManage.Orders;
|
||||
using ARW.Repository.Business.GoodsManager.Goodss;
|
||||
using ARW.Repository.Business.GoodsManager.GoodsSpecs.GoodsSkus;
|
||||
using ARW.Service.Business.IBusinessService.GoodsManager.GoodsSpecs.GoodsSkus;
|
||||
using ARW.Model.Models.Business.Custom.Customers;
|
||||
|
||||
namespace ARW.Service.Business.BusinessService.OrderManage.Orders
|
||||
{
|
||||
@ -27,19 +31,23 @@ namespace ARW.Service.Business.BusinessService.OrderManage.Orders
|
||||
public class OrderServiceImpl : BaseService<Order>, IOrderService
|
||||
{
|
||||
private readonly OrderRepository _OrderRepository;
|
||||
private readonly GoodsRepository _GoodsRepository;
|
||||
private readonly IGoodsSkuService _GoodsSkuService;
|
||||
|
||||
public OrderServiceImpl(OrderRepository OrderRepository)
|
||||
public OrderServiceImpl(OrderRepository OrderRepository, GoodsRepository goodsRepository, IGoodsSkuService goodsSkuService)
|
||||
{
|
||||
this._OrderRepository = OrderRepository;
|
||||
_GoodsRepository = goodsRepository;
|
||||
_GoodsSkuService = goodsSkuService;
|
||||
}
|
||||
|
||||
#region 业务逻辑代码
|
||||
|
||||
|
||||
/// <summary>
|
||||
#region 业务逻辑代码
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 查询订单分页列表
|
||||
/// </summary>
|
||||
public async Task<PagedInfo<OrderVo>> GetOrderList(OrderQueryDto parm)
|
||||
public async Task<PagedInfo<OrderVo>> GetOrderList(OrderQueryDto parm)
|
||||
{
|
||||
//开始拼装查询条件d
|
||||
var predicate = Expressionable.Create<Order>();
|
||||
@ -54,51 +62,60 @@ namespace ARW.Service.Business.BusinessService.OrderManage.Orders
|
||||
predicate = predicate.AndIF(parm.OrderStatus != null, s => s.OrderStatus == parm.OrderStatus);
|
||||
var query = _OrderRepository
|
||||
.Queryable()
|
||||
.LeftJoin<Customer>((s, c) => s.CustomerGuid == c.CustomerGuid)
|
||||
.Where(predicate.ToExpression())
|
||||
.OrderBy(s => s.Create_time,OrderByType.Desc)
|
||||
.Select(s => new OrderVo
|
||||
.OrderBy(s => s.Create_time, OrderByType.Desc)
|
||||
.Select((s, c) => new OrderVo
|
||||
{
|
||||
OrderId = s.OrderId,
|
||||
OrderGuid = s.OrderGuid,
|
||||
GoodsGuid = s.GoodsGuid,
|
||||
PaymentGuid = s.PaymentGuid,
|
||||
CustomerGuid = s.CustomerGuid,
|
||||
ShopGuid = s.ShopGuid,
|
||||
OrderNumber = s.OrderNumber,
|
||||
GoodsTotalAmoun = s.GoodsTotalAmoun,
|
||||
OrderAmount = s.OrderAmount,
|
||||
CouponGuid = s.CouponGuid,
|
||||
CouponMoney = s.CouponMoney,
|
||||
PointsMoney = s.PointsMoney,
|
||||
PointsNum = s.PointsNum,
|
||||
PayPrice = s.PayPrice,
|
||||
UpdatePrice = s.UpdatePrice,
|
||||
OrderRemark = s.OrderRemark,
|
||||
PayType = s.PayType,
|
||||
PayStatus = s.PayStatus,
|
||||
PayTime = s.PayTime,
|
||||
DeliveryType = s.DeliveryType,
|
||||
ExpressPrice = s.ExpressPrice,
|
||||
LogisticsCompanyGuid = s.LogisticsCompanyGuid,
|
||||
LogisticsCompany = s.LogisticsCompany,
|
||||
LogisticsTrackingNumber = s.LogisticsTrackingNumber,
|
||||
DeliveryStatus = s.DeliveryStatus,
|
||||
DeliveryTime = s.DeliveryTime,
|
||||
ReceiptStatus = s.ReceiptStatus,
|
||||
ReceiptTime = s.ReceiptTime,
|
||||
OrderStatus = s.OrderStatus,
|
||||
PointsBonus = s.PointsBonus,
|
||||
IsSettled = s.IsSettled,
|
||||
TransactionId = s.TransactionId,
|
||||
IsComment = s.IsComment,
|
||||
OrderSource = s.OrderSource,
|
||||
});
|
||||
|
||||
OrderId = s.OrderId,
|
||||
OrderGuid = s.OrderGuid,
|
||||
CustomerGuid = s.CustomerGuid,
|
||||
CustomerNickName = c.CustomerNickname,
|
||||
CustomerMobilePhoneNumber = c.CustomerMobilePhoneNumber,
|
||||
CustomerAvatar = c.CustomerAvatar,
|
||||
OrderNumber = s.OrderNumber,
|
||||
OrderAmount = s.OrderAmount,
|
||||
PayPrice = s.PayPrice,
|
||||
PayType = s.PayType,
|
||||
PayStatus = s.PayStatus,
|
||||
DeliveryType = s.DeliveryType,
|
||||
ExpressPrice = s.ExpressPrice,
|
||||
DeliveryStatus = s.DeliveryStatus,
|
||||
ReceiptStatus = s.ReceiptStatus,
|
||||
OrderStatus = s.OrderStatus,
|
||||
CreateTime = s.Create_time
|
||||
});
|
||||
|
||||
return await query.ToPageAsync(parm);
|
||||
var list = await query.ToPageAsync(parm);
|
||||
|
||||
foreach (var item in list.Result)
|
||||
{
|
||||
|
||||
// 获取商品信息
|
||||
//var goods = await _GoodsRepository.GetFirstAsync(s => s.GoodsGuid == item.GoodsGuid) ?? throw new CustomException("商品不存在");
|
||||
//item.GoodsInfo = new OrderGoodsVo();
|
||||
//item.GoodsInfo.GoodsName = goods.GoodsName;
|
||||
//item.GoodsInfo.GoodsPicture = goods.GoodsPicture;
|
||||
//if (item.GoodsSkuId != 0)
|
||||
//{
|
||||
// var specName = await _GoodsSkuService.GetSpecValueFullName(item.GoodsSkuId);
|
||||
// var sku = await _GoodsSkuService.GetByIdAsync(item.GoodsSkuId);
|
||||
// item.GoodsInfo.GoodsSpecName = specName;
|
||||
// item.GoodsInfo.GoodsPrice = sku.GoodsSkuPrice;
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// item.GoodsInfo.GoodsPrice = goods.GoodsPriceHighest;
|
||||
//}
|
||||
}
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 添加或修改订单
|
||||
/// </summary>
|
||||
public async Task<string> AddOrUpdateOrder(Order model)
|
||||
@ -118,7 +135,7 @@ namespace ARW.Service.Business.BusinessService.OrderManage.Orders
|
||||
|
||||
#region Excel处理
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Excel数据导出处理
|
||||
/// </summary>
|
||||
@ -128,10 +145,10 @@ namespace ARW.Service.Business.BusinessService.OrderManage.Orders
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -28,5 +28,13 @@ namespace ARW.Service.Business.IBusinessService.GoodsManager.GoodsSpecs.GoodsSku
|
||||
Task<GoodsSpecSkutVo> GetGoodsSkuList(GoodsSkuQueryDto parm);
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取全部规格值名称
|
||||
/// </summary>
|
||||
/// <param name="skuId"></param>
|
||||
/// <returns></returns>
|
||||
Task<string> GetSpecValueFullName(int skuId);
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user