快递模块调整:发件时,返回当前登陆人的寄件信息

optimize
zhangxiaofeng 11 months ago
parent 5df190bfc3
commit 956309e223

@ -28,10 +28,6 @@ namespace Myshipping.Application.Entity
/// </summary>
public string CurrentStateDesc { get; set; }
/// <summary>
/// 快递状态
/// </summary>
public string State { get; set; }
/// <summary>
/// 快递公司
/// </summary>
public string KDCompany { get; set; }

@ -257,6 +257,48 @@ namespace Myshipping.Application
return await Get(entity.Id);
}
/// <summary>
/// 获取当前登陆人的寄件信息(最后一次寄件信息或登陆人的个人信息)
/// </summary>
[HttpGet("GetSenderInfo")]
public async Task<object> GetSenderInfo()
{
var order = await _orderRep.AsQueryable()
.Where(o => o.CreatedUserId == UserManager.UserId)
.OrderBy(o => o.Id, OrderByType.Desc)
.FirstAsync();
// 如果当前登陆人没有创建过快递订单,则只返回当前登陆人所在公司;否则返回最新一条快递单的寄件人信息
if (order != null)
{
return new
{
expressDeliveryAddressDto = new ExpressDeliveryAddressDto()
{
Address = order.FJAddress,
City = order.FJCity,
Company = order.FJCompany,
People = order.FJPeople,
Province = order.FJProvince,
ProvinceId = order.FJProvinceId,
Tel = order.FJTel,
Type = 2
}
};
}
else
{
return new
{
expressDeliveryAddressDto = new ExpressDeliveryAddressDto()
{
Company = UserManager.TENANT_NAME,
People = UserManager.Name,
Type = 2
}
};
}
}
/// <summary>
/// 删除单据

Loading…
Cancel
Save