MeiSaiSiXieTongApi/MyCode.Project.WebApi/Areas/Wechat/Controllers/ShopReport2207ShangPinController.cs
2025-04-24 18:31:27 +08:00

109 lines
3.8 KiB
C#

using MyCode.Project.Domain.Message.Request.Report40;
using MyCode.Project.Domain.Message.Response.Report40;
using MyCode.Project.Domain.Message.Response.ReturnVisitLog;
using MyCode.Project.Infrastructure.Common;
using MyCode.Project.Services;
using System;
using System.Collections.Generic;
using System.Web.Http;
namespace MyCode.Project.WebApi.Areas.Wechat.Controllers
{
/// <summary>
/// 2022年7月版本的门店端业绩看板报表--商品+分析页面
/// </summary>
public class ShopReport2207ShangPinController : BaseWechatController
{
private IReport2207Service _report2207Service;
//private IReport40Service _report40Service;
/// <summary>
/// 初始化一个<see cref="GoodsController"/>类型的实例
/// </summary>
public ShopReport2207ShangPinController(IReport2207Service report2207Service
)
{
_report2207Service = report2207Service;
//_report40Service = report40Service;
}
#region GetShopGoods()
/// <summary>
/// 获取单店的商品中间面板统计数据
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
public ShopGoods2207 GetShopGoods(ShopYeJi2207Query req)
{
if (this.CurrentLogin.RoleType == Infrastructure.Enumeration.LoginRoleType.Clerk)
{
req.ClerkId = this.CurrentLogin.ClerkId;
}
return _report2207Service.GetShopGoods2207(req);
}
#endregion
#region GetShopGoodsPangHangBang(0= 1= 2= 3= 4= 5=)
/// <summary>
/// 获取单店的商品销售0=销售排行榜 1=护肤类 2=彩妆类 3=发饰类 4=其他类 5=服务
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
public PageResult<ShopGoodsPaiHangBang2207> GetShopGoodsPangHangBang(PagedSearch<ShopHuiGoodsPangHangJi2207Query> req)
{
if (this.CurrentLogin.RoleType == Infrastructure.Enumeration.LoginRoleType.Clerk)
{
req.Condition.ClerkId = this.CurrentLogin.ClerkId;
}
return _report2207Service.GetShopGoodsPangHangBang2207(req);
}
#endregion
#region GetShopFenXiReport()
/// <summary>
/// 获取单个或者多个店的分析页面的数据
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
public ShopFenXiReport2207 GetShopFenXiReport(ShopFenXiReport2207Query req)
{
return _report2207Service.GetShopFenXiReport2207(req);
}
#endregion
#region GetKPIDetail("门店指标")
/// <summary>
/// 获取单店的"门店指标"数据列表
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
public List<MonthKPI2207Resp> GetKPIDetail(ShopRiYeJiDetail2207Query req)
{
if (this.CurrentLogin.RoleType == Infrastructure.Enumeration.LoginRoleType.Clerk)
{
req.ClerkId = this.CurrentLogin.ClerkId;
}
int? zhiDingmodel = null;
if (this.CurrentLogin.RoleType == Infrastructure.Enumeration.LoginRoleType.Observer)
{
zhiDingmodel = 0;
}
return _report2207Service.GetKPIDetail2207(req, zhiDingmodel);
}
#endregion
//[HttpGet]
//[AllowAnonymous]
//public DateTime test(DateTime ddd)
//{
// return ddd.AddMonths(-1);
//}
}
}