129 lines
4.5 KiB
C#
129 lines
4.5 KiB
C#
|
using MyCode.Project.Domain.Message.Act.Common;
|
|||
|
using MyCode.Project.Domain.Message.Act.Report2301;
|
|||
|
using MyCode.Project.Domain.Message.Common;
|
|||
|
using MyCode.Project.Domain.Message.Request.Goods;
|
|||
|
using MyCode.Project.Domain.Message.Request.OnlineGoods;
|
|||
|
using MyCode.Project.Domain.Message.Response.Activity;
|
|||
|
using MyCode.Project.Domain.Message.Response.Goods;
|
|||
|
using MyCode.Project.Domain.Message.Response.OnlineGoods;
|
|||
|
using MyCode.Project.Infrastructure.Common;
|
|||
|
using MyCode.Project.Infrastructure.Constant;
|
|||
|
using MyCode.Project.Services;
|
|||
|
using System;
|
|||
|
using System.Collections.Generic;
|
|||
|
using System.Web.Http;
|
|||
|
|
|||
|
namespace MyCode.Project.WebApi.Areas.Wechat.Controllers
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// 收银台商品相关的接口
|
|||
|
/// </summary>
|
|||
|
public class OnlineGoodsController : BaseWechatController
|
|||
|
{
|
|||
|
private IOnlineGoodsService _OnlineGoodsService;
|
|||
|
private IRpShopUseAppletDataService _rpShopUseAppletDataService;
|
|||
|
private ISalesSheetService _salesSheetService;
|
|||
|
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 初始化一个<see cref="GoodsController"/>类型的实例
|
|||
|
/// </summary>
|
|||
|
public OnlineGoodsController(IOnlineGoodsService onlineGoodsService
|
|||
|
, IRpShopUseAppletDataService rpShopUseAppletDataService
|
|||
|
,ISalesSheetService salesSheetService)
|
|||
|
{
|
|||
|
_OnlineGoodsService = onlineGoodsService;
|
|||
|
_rpShopUseAppletDataService = rpShopUseAppletDataService;
|
|||
|
_salesSheetService = salesSheetService;
|
|||
|
}
|
|||
|
|
|||
|
#region GetSellsPageList(销售商品列表)
|
|||
|
/// <summary>
|
|||
|
/// 销售商品列表
|
|||
|
/// </summary>
|
|||
|
/// <param name="search">查询条件</param>
|
|||
|
/// <returns></returns>
|
|||
|
[HttpPost]
|
|||
|
public PageResult<OnlineGoodsStockPageListResp> GetSellsPageList(PagedSearch<OnlineGoodsStockPageListQuery> search)
|
|||
|
{
|
|||
|
return this._OnlineGoodsService.GetSellsPageList(search, this.CurrentLogin.MerchantId);
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region GetOnlineDeptTreeList(获取商品分类列表)
|
|||
|
/// <summary>
|
|||
|
/// 获取商品分类列表
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
[HttpGet]
|
|||
|
public List<OnlineDeptTreeListResp> GetOnlineDeptTreeList()
|
|||
|
{
|
|||
|
return this._OnlineGoodsService.GetOnlineDeptTreeList();
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region GetOnlineGoodsDetail(获取商品电商资料详情)
|
|||
|
/// <summary>
|
|||
|
/// 获取商品电商资料详情
|
|||
|
/// </summary>
|
|||
|
/// <param name="req"></param>
|
|||
|
/// <returns></returns>
|
|||
|
[HttpPost]
|
|||
|
public OnlineGoodsDetailResp GetOnlineGoodsDetail(OnlineGoodsItem req)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
_rpShopUseAppletDataService.SetData(30, req.ShopId, this.CurrentLogin);
|
|||
|
}
|
|||
|
catch
|
|||
|
{ }
|
|||
|
return this._OnlineGoodsService.GetOnlineGoodsDetail(req);
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region GetGoodsSharePic(门店端获取商品详情拼接海报的多个图片)
|
|||
|
/// <summary>
|
|||
|
/// 门店端获取商品详情拼接海报的多个图片
|
|||
|
/// </summary>
|
|||
|
/// <param name="req"></param>
|
|||
|
/// <returns></returns>
|
|||
|
[HttpPost]
|
|||
|
public CustomerSharePicResp GetGoodsSharePic(ShopOnlineGoodsItem req)
|
|||
|
{
|
|||
|
return this._OnlineGoodsService.GetGoodsSharePic(req,this.CurrentLogin,true);
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region GetOnlineDeptTreeList(获取商品分类列表)
|
|||
|
/// <summary>
|
|||
|
/// 获取商品分类列表
|
|||
|
/// </summary>
|
|||
|
/// <returns></returns>
|
|||
|
[HttpPost]
|
|||
|
[AllowAnonymous]
|
|||
|
public List<OnlineDeptTreeListResp> GetLxmOnlineDeptTreeList(BfyApiKeyAct request)
|
|||
|
{
|
|||
|
if (request.LxmZHMDReportKey.ToLower() == Const.LxmSysTemReportKey.ToLower())
|
|||
|
{
|
|||
|
return this._OnlineGoodsService.GetOnlineDeptTreeList();
|
|||
|
}
|
|||
|
else
|
|||
|
return null;
|
|||
|
}
|
|||
|
#endregion
|
|||
|
|
|||
|
#region GetDetailListByCode(根据抖音码获取对应的商品列表)
|
|||
|
/// <summary>
|
|||
|
/// 根据抖音码获取对应的商品列表
|
|||
|
/// </summary>
|
|||
|
/// <param name="act"></param>
|
|||
|
/// <returns></returns>
|
|||
|
[HttpPost]
|
|||
|
public List<TuanGouGoodsPageListResp> GetDetailListByCode(DouYinUrlAct act)
|
|||
|
{
|
|||
|
return _salesSheetService.GetDetailListByCode(act.Code, act.ShopId);
|
|||
|
}
|
|||
|
#endregion
|
|||
|
}
|
|||
|
}
|