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

107 lines
4.2 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.Linq;
using System.Web.Http;
namespace MyCode.Project.WebApi.Areas.Wechat.Controllers
{
/// <summary>
/// 2022年7月版本的总部管理者看板报表--商品+分析页面
/// </summary>
public class ManagerReport2207ShangPinController : BaseWechatController
{
private IReport2207Service _report2207Service;
private IUserService _userService;
//private IReport40Service _report40Service;
/// <summary>
/// 初始化一个<see cref="GoodsController"/>类型的实例
/// </summary>
public ManagerReport2207ShangPinController(IReport2207Service report2207Service
, IUserService userService
)
{
_userService = userService;
_report2207Service = report2207Service;
//_report40Service = report40Service;
}
#region GetShopGoods()
/// <summary>
/// 获取单店的商品中间面板统计数据
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
public PageResult<ManagerShopGoods2207> GetShopGoodsTongJi(PagedSearch<ManagerYeJi2207Query> req)
{
if (req.Condition.IfAllShop == 1)
{
var ids = _userService.GetShopListByLoginId(this.CurrentLogin.UserId, this.CurrentLogin.RoleId, this.CurrentLogin.OrganizationId);
//if (req.Condition.ShopIds != null && req.Condition.ShopIds.Count > 0)
//{
// ids = ids.Where(t => !req.Condition.ShopIds.Contains(t)).ToList();
//}
req.Condition.ShopIds = ids;
}
return _report2207Service.GetManagerZiShopGoodsTongJi2207(req);
}
#endregion
#region GetShopFenXiReport()
/// <summary>
/// 获取多个店的分析页面的数据
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
public ShopFenXiReport2207 GetFenXiReport(ManagerFenXiReport2207Query req)
{
if (req.IfAllShop == 1)
{
var ids = _userService.GetShopListByLoginId(this.CurrentLogin.UserId, this.CurrentLogin.RoleId, this.CurrentLogin.OrganizationId);
//if (req.ShopIds != null && req.ShopIds.Count > 0)
//{
// ids = ids.Where(t => !req.ShopIds.Contains(t)).ToList();
//}
req.ShopIds = ids;
}
ShopFenXiReport2207Query shopFenXiReport2207Query = new ShopFenXiReport2207Query();
shopFenXiReport2207Query.DuiBi = req.DuiBi;
shopFenXiReport2207Query.ShopIds = req.ShopIds;
shopFenXiReport2207Query.TimeSearch = req.TimeSearch;
return _report2207Service.GetShopFenXiReport2207(shopFenXiReport2207Query,0,0);
}
#endregion
#region GetShopAppUseData(使)
/// <summary>
/// 获取多店的门店使用情况
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
public ManagerAppUseData2207 GetShopAppUseData(PagedSearch<ManagerHeXin2207Query> req)
{
if (req.Condition.IfAllShop == 1)
{
var ids = _userService.GetShopListByLoginId(this.CurrentLogin.UserId, this.CurrentLogin.RoleId, this.CurrentLogin.OrganizationId);
//if (req.Condition.ShopIds != null && req.Condition.ShopIds.Count > 0)
//{
// ids = ids.Where(t => !req.Condition.ShopIds.Contains(t)).ToList();
//}
req.Condition.ShopIds = ids;
}
return _report2207Service.GetShopAppUseData2207(req);
}
#endregion
}
}