init 初始化订单地址记录
This commit is contained in:
parent
81573d783d
commit
eb36004b29
@ -0,0 +1,70 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using ARW.Model.Models.Business.OrderManage.OrderCustomerAddreses;
|
||||||
|
|
||||||
|
namespace ARW.Model.Dto.Business.OrderManage.OrderCustomerAddreses
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 订单收货地址记录输入对象
|
||||||
|
///
|
||||||
|
/// @author lwh
|
||||||
|
/// @date 2023-08-29
|
||||||
|
/// </summary>
|
||||||
|
public class OrderCustomerAddressDto
|
||||||
|
{
|
||||||
|
|
||||||
|
public int OrderCustomerAddressId { get; set; }
|
||||||
|
|
||||||
|
public long OrderCustomerAddressGuid { get; set; }
|
||||||
|
|
||||||
|
[Required(ErrorMessage = "订单guid不能为空")]
|
||||||
|
public long OrderGuid { get; set; }
|
||||||
|
|
||||||
|
[Required(ErrorMessage = "客户guid不能为空")]
|
||||||
|
public long CustomerGuid { get; set; }
|
||||||
|
|
||||||
|
[Required(ErrorMessage = "客户地址guid不能为空")]
|
||||||
|
public long CustomerAddressGuid { get; set; }
|
||||||
|
|
||||||
|
[Required(ErrorMessage = "收货人姓名不能为空")]
|
||||||
|
public string ConsigneeName { get; set; }
|
||||||
|
|
||||||
|
[Required(ErrorMessage = "联系电话不能为空")]
|
||||||
|
public string Phont { get; set; }
|
||||||
|
|
||||||
|
[Required(ErrorMessage = "省份ID不能为空")]
|
||||||
|
public int ProvinceId { get; set; }
|
||||||
|
|
||||||
|
[Required(ErrorMessage = "城市ID不能为空")]
|
||||||
|
public int CityId { get; set; }
|
||||||
|
|
||||||
|
[Required(ErrorMessage = "区/县ID不能为空")]
|
||||||
|
public int RegionId { get; set; }
|
||||||
|
|
||||||
|
[Required(ErrorMessage = "详细地址不能为空")]
|
||||||
|
public string Detail { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 订单收货地址记录查询对象
|
||||||
|
///
|
||||||
|
/// @author lwh
|
||||||
|
/// @date 2023-08-29
|
||||||
|
/// </summary>
|
||||||
|
public class OrderCustomerAddressQueryDto : PagerInfo
|
||||||
|
{
|
||||||
|
|
||||||
|
public string ids { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,114 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using SqlSugar;
|
||||||
|
using OfficeOpenXml.Attributes;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
namespace ARW.Model.Models.Business.OrderManage.OrderCustomerAddreses
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 订单收货地址记录,数据实体对象
|
||||||
|
///
|
||||||
|
/// @author lwh
|
||||||
|
/// @date 2023-08-29
|
||||||
|
/// </summary>
|
||||||
|
[SugarTable("tb_order_customer_address")]
|
||||||
|
public class OrderCustomerAddress : BusinessBase
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :
|
||||||
|
/// 空值 : false
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "order_customer_address_id")]
|
||||||
|
public int OrderCustomerAddressId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :
|
||||||
|
/// 空值 : false
|
||||||
|
/// </summary>
|
||||||
|
[JsonConverter(typeof(ValueToStringConverter))]
|
||||||
|
[SugarColumn(IsPrimaryKey = true, IsIdentity = false, ColumnName = "order_customer_address_guid")]
|
||||||
|
public long OrderCustomerAddressGuid { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :订单guid
|
||||||
|
/// 空值 : false
|
||||||
|
/// </summary>
|
||||||
|
[JsonConverter(typeof(ValueToStringConverter))]
|
||||||
|
[SugarColumn(ColumnName = "order_guid")]
|
||||||
|
public long OrderGuid { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :客户guid
|
||||||
|
/// 空值 : false
|
||||||
|
/// </summary>
|
||||||
|
[JsonConverter(typeof(ValueToStringConverter))]
|
||||||
|
[SugarColumn(ColumnName = "customer_guid")]
|
||||||
|
public long CustomerGuid { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :客户地址guid
|
||||||
|
/// 空值 : false
|
||||||
|
/// </summary>
|
||||||
|
[JsonConverter(typeof(ValueToStringConverter))]
|
||||||
|
[SugarColumn(ColumnName = "customer_address_guid")]
|
||||||
|
public long CustomerAddressGuid { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :收货人姓名
|
||||||
|
/// 空值 : false
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "consignee_name")]
|
||||||
|
public string ConsigneeName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :联系电话
|
||||||
|
/// 空值 : false
|
||||||
|
/// </summary>
|
||||||
|
public string Phont { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :省份ID
|
||||||
|
/// 空值 : false
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "province_id")]
|
||||||
|
public int ProvinceId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :城市ID
|
||||||
|
/// 空值 : false
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "city_id")]
|
||||||
|
public int CityId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :区/县ID
|
||||||
|
/// 空值 : false
|
||||||
|
/// </summary>
|
||||||
|
[SugarColumn(ColumnName = "region_id")]
|
||||||
|
public int RegionId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :详细地址
|
||||||
|
/// 空值 : false
|
||||||
|
/// </summary>
|
||||||
|
public string Detail { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,88 @@
|
|||||||
|
using Newtonsoft.Json;
|
||||||
|
using OfficeOpenXml.Attributes;
|
||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
|
||||||
|
namespace ARW.Model.Vo.Business.OrderManage.OrderCustomerAddreses
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 订单收货地址记录展示对象
|
||||||
|
///
|
||||||
|
/// @author lwh
|
||||||
|
/// @date 2023-08-29
|
||||||
|
/// </summary>
|
||||||
|
public class OrderCustomerAddressVo
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :
|
||||||
|
/// </summary>
|
||||||
|
public int OrderCustomerAddressId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :
|
||||||
|
/// </summary>
|
||||||
|
[JsonConverter(typeof(ValueToStringConverter))]
|
||||||
|
public long OrderCustomerAddressGuid { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :订单guid
|
||||||
|
/// </summary>
|
||||||
|
[JsonConverter(typeof(ValueToStringConverter))]
|
||||||
|
public long OrderGuid { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :客户guid
|
||||||
|
/// </summary>
|
||||||
|
[JsonConverter(typeof(ValueToStringConverter))]
|
||||||
|
public long CustomerGuid { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :客户地址guid
|
||||||
|
/// </summary>
|
||||||
|
[JsonConverter(typeof(ValueToStringConverter))]
|
||||||
|
public long CustomerAddressGuid { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :收货人姓名
|
||||||
|
/// </summary>
|
||||||
|
public string ConsigneeName { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :联系电话
|
||||||
|
/// </summary>
|
||||||
|
public string Phont { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :省份ID
|
||||||
|
/// </summary>
|
||||||
|
public int ProvinceId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :城市ID
|
||||||
|
/// </summary>
|
||||||
|
public int CityId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :区/县ID
|
||||||
|
/// </summary>
|
||||||
|
public int RegionId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 描述 :详细地址
|
||||||
|
/// </summary>
|
||||||
|
public string Detail { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,20 @@
|
|||||||
|
using System;
|
||||||
|
using Infrastructure.Attribute;
|
||||||
|
using ARW.Repository.System;
|
||||||
|
using ARW.Model.Models.Business.OrderManage.OrderCustomerAddreses;
|
||||||
|
|
||||||
|
namespace ARW.Repository.Business.OrderManage.OrderCustomerAddreses
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 订单收货地址记录仓储
|
||||||
|
///
|
||||||
|
/// @author lwh
|
||||||
|
/// @date 2023-08-29
|
||||||
|
/// </summary>
|
||||||
|
[AppService(ServiceLifetime = LifeTime.Transient)]
|
||||||
|
public class OrderCustomerAddressRepository : BaseRepository<OrderCustomerAddress>
|
||||||
|
{
|
||||||
|
#region 业务逻辑代码
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,98 @@
|
|||||||
|
using Infrastructure.Attribute;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using SqlSugar;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using Infrastructure;
|
||||||
|
using ARW.Model;
|
||||||
|
using ARW.Repository;
|
||||||
|
using ARW.Repository.Business.OrderManage.OrderCustomerAddreses;
|
||||||
|
using ARW.Service.Business.IBusinessService.OrderManage.OrderCustomerAddreses;
|
||||||
|
using ARW.Model.Dto.Business.OrderManage.OrderCustomerAddreses;
|
||||||
|
using ARW.Model.Models.Business.OrderManage.OrderCustomerAddreses;
|
||||||
|
using ARW.Model.Vo.Business.OrderManage.OrderCustomerAddreses;
|
||||||
|
|
||||||
|
namespace ARW.Service.Business.BusinessService.OrderManage.OrderCustomerAddreses
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 订单收货地址记录接口实现类
|
||||||
|
///
|
||||||
|
/// @author lwh
|
||||||
|
/// @date 2023-08-29
|
||||||
|
/// </summary>
|
||||||
|
[AppService(ServiceType = typeof(IOrderCustomerAddressService), ServiceLifetime = LifeTime.Transient)]
|
||||||
|
public class OrderCustomerAddressServiceImpl : BaseService<OrderCustomerAddress>, IOrderCustomerAddressService
|
||||||
|
{
|
||||||
|
private readonly OrderCustomerAddressRepository _OrderCustomerAddressRepository;
|
||||||
|
|
||||||
|
public OrderCustomerAddressServiceImpl(OrderCustomerAddressRepository OrderCustomerAddressRepository)
|
||||||
|
{
|
||||||
|
this._OrderCustomerAddressRepository = OrderCustomerAddressRepository;
|
||||||
|
}
|
||||||
|
|
||||||
|
#region 业务逻辑代码
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查询订单收货地址记录分页列表
|
||||||
|
/// </summary>
|
||||||
|
public async Task<PagedInfo<OrderCustomerAddressVo>> GetOrderCustomerAddressList(OrderCustomerAddressQueryDto parm)
|
||||||
|
{
|
||||||
|
//开始拼装查询条件d
|
||||||
|
var predicate = Expressionable.Create<OrderCustomerAddress>();
|
||||||
|
|
||||||
|
var query = _OrderCustomerAddressRepository
|
||||||
|
.Queryable()
|
||||||
|
.Where(predicate.ToExpression())
|
||||||
|
.OrderBy(s => s.Update_time,OrderByType.Desc)
|
||||||
|
.Select(s => new OrderCustomerAddressVo
|
||||||
|
{
|
||||||
|
OrderCustomerAddressId = s.OrderCustomerAddressId,
|
||||||
|
OrderCustomerAddressGuid = s.OrderCustomerAddressGuid,
|
||||||
|
OrderGuid = s.OrderGuid,
|
||||||
|
CustomerGuid = s.CustomerGuid,
|
||||||
|
CustomerAddressGuid = s.CustomerAddressGuid,
|
||||||
|
ConsigneeName = s.ConsigneeName,
|
||||||
|
Phont = s.Phont,
|
||||||
|
ProvinceId = s.ProvinceId,
|
||||||
|
CityId = s.CityId,
|
||||||
|
RegionId = s.RegionId,
|
||||||
|
Detail = s.Detail,
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
return await query.ToPageAsync(parm);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 添加或修改订单收货地址记录
|
||||||
|
/// </summary>
|
||||||
|
public async Task<string> AddOrUpdateOrderCustomerAddress(OrderCustomerAddress model)
|
||||||
|
{
|
||||||
|
if (model.OrderCustomerAddressId != 0)
|
||||||
|
{
|
||||||
|
var response = await _OrderCustomerAddressRepository.UpdateAsync(model);
|
||||||
|
return "修改成功!";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
var response = await _OrderCustomerAddressRepository.InsertReturnSnowflakeIdAsync(model);
|
||||||
|
return "添加成功!";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#region Excel处理
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,41 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using ARW.Model;
|
||||||
|
using ARW.Model.Dto.Business.OrderManage.OrderCustomerAddreses;
|
||||||
|
using ARW.Model.Models.Business.OrderManage.OrderCustomerAddreses;
|
||||||
|
using ARW.Model.Vo.Business.OrderManage.OrderCustomerAddreses;
|
||||||
|
|
||||||
|
namespace ARW.Service.Business.IBusinessService.OrderManage.OrderCustomerAddreses
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 订单收货地址记录接口类
|
||||||
|
///
|
||||||
|
/// @author lwh
|
||||||
|
/// @date 2023-08-29
|
||||||
|
/// </summary>
|
||||||
|
public interface IOrderCustomerAddressService : IBaseService<OrderCustomerAddress>
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 获取订单收货地址记录分页列表
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parm"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<PagedInfo<OrderCustomerAddressVo>> GetOrderCustomerAddressList(OrderCustomerAddressQueryDto parm);
|
||||||
|
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 添加或修改订单收货地址记录
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="parm"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
Task<string> AddOrUpdateOrderCustomerAddress(OrderCustomerAddress parm);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user