11 changed files with 257 additions and 13 deletions
@ -0,0 +1,27 @@ |
|||||
|
using BBWYB.Server.Business; |
||||
|
using BBWYB.Server.Model.Dto; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
|
||||
|
namespace BBWYB.Server.API.Controllers |
||||
|
{ |
||||
|
public class PurchaserController : BaseApiController |
||||
|
{ |
||||
|
private PurchaserBusiness purchaserBusiness; |
||||
|
|
||||
|
public PurchaserController(IHttpContextAccessor httpContextAccessor, PurchaserBusiness purchaserBusiness) : base(httpContextAccessor) |
||||
|
{ |
||||
|
this.purchaserBusiness = purchaserBusiness; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 查询采购商列表
|
||||
|
/// </summary>
|
||||
|
/// <param name="request"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost] |
||||
|
public ListResponse<PurchaserResponse> QueryPurchaserList([FromBody] QueryPurchaserRequest request) |
||||
|
{ |
||||
|
return purchaserBusiness.QueryPurchaserList(request); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
using BBWYB.Common.Log; |
||||
|
using BBWYB.Common.Models; |
||||
|
using BBWYB.Server.Model.Dto; |
||||
|
using Yitter.IdGenerator; |
||||
|
|
||||
|
namespace BBWYB.Server.Business |
||||
|
{ |
||||
|
public class PurchaserBusiness : BaseBusiness, IDenpendency |
||||
|
{ |
||||
|
public PurchaserBusiness(IFreeSql fsql, NLogManager nLogManager, IIdGenerator idGenerator) : base(fsql, nLogManager, idGenerator) |
||||
|
{ |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public ListResponse<PurchaserResponse> QueryPurchaserList(QueryPurchaserRequest request) |
||||
|
{ |
||||
|
return new ListResponse<PurchaserResponse>(); |
||||
|
} |
||||
|
} |
||||
|
} |
@ -0,0 +1,27 @@ |
|||||
|
using FreeSql.DataAnnotations; |
||||
|
|
||||
|
namespace BBWYB.Server.Model.Db |
||||
|
{ |
||||
|
|
||||
|
[Table(Name = "purchasercategorytagsbasicinfo", DisableSyncStructure = true)] |
||||
|
public partial class PurchaserCategoryTagsBasicInfo |
||||
|
{ |
||||
|
|
||||
|
[Column(DbType = "bigint", IsPrimary = true)] |
||||
|
public long Id { get; set; } |
||||
|
|
||||
|
[Column(DbType = "datetime")] |
||||
|
public DateTime? CreateTime { get; set; } |
||||
|
|
||||
|
[Column(StringLength = 50)] |
||||
|
public string Name { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 类型 主营类目=0 标签=1
|
||||
|
/// </summary>
|
||||
|
[Column(MapType = typeof(int?))] |
||||
|
public Enums.PurchaserBasicInfoType? Type { get; set; } |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,27 @@ |
|||||
|
using FreeSql.DataAnnotations; |
||||
|
|
||||
|
namespace BBWYB.Server.Model.Db |
||||
|
{ |
||||
|
|
||||
|
[Table(Name = "purchaser_categorytagsbasicinfo_relation", DisableSyncStructure = true)] |
||||
|
public partial class Purchaser_CategoryTagsBasicInfo_Relation |
||||
|
{ |
||||
|
|
||||
|
[Column(DbType = "bigint", IsPrimary = true)] |
||||
|
public long Id { get; set; } |
||||
|
|
||||
|
[Column(DbType = "bigint")] |
||||
|
public long? BasicExtendedInfoId { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 关系类型 主营类目=0 标签=1
|
||||
|
/// </summary>
|
||||
|
[Column(DbType = "int")] |
||||
|
public Enums.PurchaserBasicInfoType? BasicType { get; set; } |
||||
|
|
||||
|
[Column(StringLength = 50)] |
||||
|
public string PurchaserId { get; set; } |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,31 @@ |
|||||
|
namespace BBWYB.Server.Model.Dto |
||||
|
{ |
||||
|
public class QueryPurchaserRequest |
||||
|
{ |
||||
|
public string Spu { get; set; } |
||||
|
|
||||
|
public string Sku { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 采购商Id集合
|
||||
|
/// </summary>
|
||||
|
public List<string> PurchaserIdList { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 主营类目Id集合
|
||||
|
/// </summary>
|
||||
|
public List<long> CategoryIdList { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 供应商产地
|
||||
|
/// </summary>
|
||||
|
public string Location { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 页码 从1开始
|
||||
|
/// </summary>
|
||||
|
public int PageIndex { get; set; } |
||||
|
|
||||
|
public int PageSize { get; set; } |
||||
|
} |
||||
|
} |
@ -0,0 +1,9 @@ |
|||||
|
namespace BBWYB.Server.Model.Dto |
||||
|
{ |
||||
|
public class ListResponse<T> where T : class |
||||
|
{ |
||||
|
public List<T> Items { get; set; } |
||||
|
|
||||
|
public long TotalCount { get; set; } |
||||
|
} |
||||
|
} |
@ -0,0 +1,8 @@ |
|||||
|
using BBWYB.Server.Model.Db; |
||||
|
|
||||
|
namespace BBWYB.Server.Model.Dto |
||||
|
{ |
||||
|
public class ProductSkuResponse : ProductSku |
||||
|
{ |
||||
|
} |
||||
|
} |
@ -0,0 +1,8 @@ |
|||||
|
using BBWYB.Server.Model.Db; |
||||
|
|
||||
|
namespace BBWYB.Server.Model.Dto |
||||
|
{ |
||||
|
public class PurchaserCategoryTagsBasicInfoResponse: PurchaserCategoryTagsBasicInfo |
||||
|
{ |
||||
|
} |
||||
|
} |
@ -0,0 +1,64 @@ |
|||||
|
using BBWYB.Server.Model.Db; |
||||
|
|
||||
|
namespace BBWYB.Server.Model.Dto |
||||
|
{ |
||||
|
public class PurchaserResponse : Purchaser |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 类目集合
|
||||
|
/// </summary>
|
||||
|
public IList<PurchaserCategoryTagsBasicInfoResponse> CategoryList { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 标签集合
|
||||
|
/// </summary>
|
||||
|
public IList<PurchaserCategoryTagsBasicInfoResponse> TagList { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 绑定SPU数
|
||||
|
/// </summary>
|
||||
|
public long? BindingSpuCount { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 采购SPU数
|
||||
|
/// </summary>
|
||||
|
public long? PurchasedSpuCount { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 绑定SKU数
|
||||
|
/// </summary>
|
||||
|
public long? BindingSkuCount { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 采购SKU数
|
||||
|
/// </summary>
|
||||
|
public long? PurchasedSkuCount { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 采购订单数
|
||||
|
/// </summary>
|
||||
|
public long? PurchaseOrderCount { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 采购金额
|
||||
|
/// </summary>
|
||||
|
public decimal? PurchaseAmount { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 上次采购时间
|
||||
|
/// </summary>
|
||||
|
public DateTime? LastPurchaseTime { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 最近30天具有采购行为的店铺SKU
|
||||
|
/// </summary>
|
||||
|
public IList<ProductSkuResponse> Recent30dProductSku { get; set; } |
||||
|
|
||||
|
public PurchaserResponse() |
||||
|
{ |
||||
|
CategoryList = new List<PurchaserCategoryTagsBasicInfoResponse>(); |
||||
|
TagList = new List<PurchaserCategoryTagsBasicInfoResponse>(); |
||||
|
Recent30dProductSku = new List<ProductSkuResponse>(); |
||||
|
} |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue