2025-04-24 18:31:27 +08:00

324 lines
12 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 ShopReport2207HeXinController : BaseWechatController
{
private IReportPageList40Service _reportPageList40Service;
private IReport2207Service _report2207Service;
//private IReport40Service _report40Service;
/// <summary>
/// 初始化一个<see cref="GoodsController"/>类型的实例
/// </summary>
public ShopReport2207HeXinController(IReport2207Service report2207Service
, IReportPageList40Service reportPageList40Service
)
{
_reportPageList40Service = reportPageList40Service;
_report2207Service = report2207Service;
//_report40Service = report40Service;
}
#region GetShopHeXinList()
/// <summary>
/// 获取单一门店的年度核心指标
/// </summary>
/// <param name="shopHeXin2207Query"></param>
/// <returns></returns>
[HttpPost]
public List<ShopHeXinResp> GetShopHeXinList(ShopHeXin2207Query shopHeXin2207Query)
{
int? zhiDingmodel = null;
if (this.CurrentLogin.RoleType == Infrastructure.Enumeration.LoginRoleType.Observer)
{
zhiDingmodel = 0;
}
return _report2207Service.GetShopHeXinList(shopHeXin2207Query, zhiDingmodel);
}
#endregion
#region GetShopYeJiReport()
/// <summary>
/// 获取新、老客、散客业绩
/// </summary>
/// <param name="shopYeJi2207Query"></param>
/// <returns></returns>
[HttpPost]
public ShopYeJiResp GetShopYeJiReport(ShopYeJi2207Query shopYeJi2207Query)
{
int? zhiDingmodel = null;
if (this.CurrentLogin.RoleType == Infrastructure.Enumeration.LoginRoleType.Observer)
{
zhiDingmodel = 0;
}
if (this.CurrentLogin.RoleType == Infrastructure.Enumeration.LoginRoleType.Clerk)
{
shopYeJi2207Query.ClerkId = this.CurrentLogin.ClerkId;
}
ShopYeJiResp result = new ShopYeJiResp();
result.ZoneYeJi = _report2207Service.GetJinRiYeJi(shopYeJi2207Query, zhiDingmodel);
var ke = _report2207Service.GetXinLaoKeReport(shopYeJi2207Query, zhiDingmodel);
result.XinKeTitle = ke.XinKeTitle;
result.LaoKeTitle = ke.LaoKeTitle;
result.SanKeTitle = ke.SanKeTitle;
result.XinKe = ke.XinKe;
result.LaoKe = ke.LaoKe;
result.SanKe = ke.SanKe;
result.LaoKeTabText = ke.LaoKeTabText;
result.XinKeTabText = ke.XinKeTabText;
result.SanKeTabText = ke.SanKeTabText;
result.IfShow = _report2207Service.IfShowShouGong(shopYeJi2207Query.ShopId);
return result;
}
#endregion
#region GetShopYeJiTongJi2207List()
/// <summary>
/// 获取单店一年的业绩统计列表
/// </summary>
/// <param name="shopHeXin2207Query"></param>
/// <returns></returns>
[HttpPost]
public List<YeJiTongJi2207> GetShopYeJiTongJiList(ShopHeXin2207Query shopHeXin2207Query)
{
int? zhiDingmodel = null;
if (this.CurrentLogin.RoleType == Infrastructure.Enumeration.LoginRoleType.Observer)
{
zhiDingmodel = 0;
}
if (this.CurrentLogin.RoleType == Infrastructure.Enumeration.LoginRoleType.Clerk)
{
shopHeXin2207Query.ClerkId = this.CurrentLogin.ClerkId;
}
return _report2207Service.GetYeJiTongJi2207List(shopHeXin2207Query, zhiDingmodel);
}
#endregion
#region GetShopDianYuanTongJi2207List()
/// <summary>
/// 获取单店员工统计列表
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
public List<ShopDianYuanTongJi2207> GetShopDianYuanTongJiList(ShopYeJi2207Query req)
{
int? zhiDingmodel = null;
if (this.CurrentLogin.RoleType == Infrastructure.Enumeration.LoginRoleType.Observer)
{
zhiDingmodel = 0;
}
if (this.CurrentLogin.RoleType == Infrastructure.Enumeration.LoginRoleType.Clerk)
{
req.ClerkId = this.CurrentLogin.ClerkId;
}
return _report2207Service.GetShopDianYuanTongJi2207List(req, zhiDingmodel);
}
#endregion
#region GetShopXiaoFeiMingXi()
/// <summary>
/// 获取单店的会员消费明细
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
public List<ShopXiaoFeiMingXi2207> GetShopXiaoFeiMingXi(ShopRiYeJi2207Query req)
{
if (this.CurrentLogin.RoleType == Infrastructure.Enumeration.LoginRoleType.Clerk)
{
req.ClerkId = this.CurrentLogin.ClerkId;
}
return _report2207Service.GetShopXiaoFeiMingXi2207(req);
}
#endregion
#region GetSheetDetail()
/// <summary>
/// 获取会员消费明细展开的订单明细
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet]
public List<OrderDetailResp> GetSheetDetail(Guid id)
{
return _reportPageList40Service.GetFuGouOrderDetail(id);
}
#endregion
#region ShopTiYanTaoYeJi()
/// <summary>
/// 获取单店的体验套业绩列表
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
public List<ShopTiYanTaoYeJi2207> ShopTiYanTaoYeJi(ShopYeJi2207Query req)
{
if (this.CurrentLogin.RoleType == Infrastructure.Enumeration.LoginRoleType.Clerk)
{
req.ClerkId = this.CurrentLogin.ClerkId;
}
return _report2207Service.ShopTiYanTaoYeJi2207(req);
}
#endregion
#region GetShopRiTongJi()
/// <summary>
/// 获取单店的日业绩统计分页列表
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
public PageResult<RiTongJi2207> GetShopRiTongJi(PagedSearch<ShopRiYeJi2207Query> req)
{
if (this.CurrentLogin.RoleType == Infrastructure.Enumeration.LoginRoleType.Clerk)
{
req.Condition.ClerkId = this.CurrentLogin.ClerkId;
}
int? zhiDingmodel = null;
if (this.CurrentLogin.RoleType == Infrastructure.Enumeration.LoginRoleType.Observer)
{
zhiDingmodel = 0;
}
return _report2207Service.GetShopRiTongJi2207(req, zhiDingmodel);
}
#endregion
#region GetShopRiYeJiDetail()
/// <summary>
/// 获取日统计列表的展开明细
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
public List<ItemDetail> GetShopRiYeJiDetail(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.GetShopRiYeJiDetail2207(req, zhiDingmodel);
}
#endregion
#region GetShouGonFeiDetailsList()
/// <summary>
/// 获取手工费明细列表
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
public List<ShouGonFeiList2207Resp> GetShouGonFeiList(ShopYeJi2207Query req)
{
if (this.CurrentLogin.RoleType == Infrastructure.Enumeration.LoginRoleType.Clerk)
{
req.ClerkId = this.CurrentLogin.ClerkId;
}
return _report2207Service.GetShouGonFeiList(req);
}
#endregion
#region GetKeFuConfig()
/// <summary>
/// 获取联系客服二维码详情
/// </summary>
/// <returns></returns>
[HttpGet]
public KeFuConfigView GetKeFuConfig()
{
return _report2207Service.GetKeFuConfig(this.CurrentLogin.MerchantId);
}
#endregion
#region GetShopDianYuanYjJiSort2302List()
/// <summary>
/// 获取单店员工业绩排行榜
/// </summary>
/// <param name="req"></param>
/// <returns></returns>
[HttpPost]
public List<DianYuanYjJiSort2302> GetShopDianYuanYjJiSort2302List(ShopYeJi2207Query req)
{
int? zhiDingmodel = null;
if (this.CurrentLogin.RoleType == Infrastructure.Enumeration.LoginRoleType.Observer)
{
zhiDingmodel = 0;
}
if (this.CurrentLogin.RoleType == Infrastructure.Enumeration.LoginRoleType.Clerk)
{
req.ClerkId = this.CurrentLogin.ClerkId;
}
return _report2207Service.GetShopDianYuanYjJiSort2302List(req, zhiDingmodel);
}
#endregion
#region GetYeJiTabText()
/// <summary>
/// 获取业绩看板的问号文案
/// </summary>
/// <returns></returns>
[HttpGet]
public List<string> GetYeJiTabText()
{
List<string> list = new List<string>();
list.Add("总收款:门店实际总收款金额(订单实付金额+充值金额+预售金额)");
list.Add("总业绩:订单实付金额+消预存金额(不含充值)+预售转销售单金额");
list.Add("护肤业绩:购买护肤品类实付金额+消预存金额+预售转销售金额(护肤类产品,含套装商品如体验套,首单套等套装中的实物商品)");
list.Add("彩妆业绩:购买彩妆品实付金额+消预存金额+预售转销售金额(彩妆类产品)");
list.Add("饰品业绩:购买饰品类实付金额+消预存金额+预售转销售金额(发饰品类+首饰品类)");
list.Add("服务业绩:购买所有不包含产品销售的服务类项目的实付金额+消预存金额+预售转销售金额(如盘发,一次性化妆,修眉等仅提供服务不包含产品销售的服务类型)");
list.Add("其他业绩:购买除饰品类、化妆类、护肤类以外的其他实物产品(如工具类)的实付金额+消预存金额+预售转销售金额");
list.Add("吊牌价:统计销售实物商品的吊牌价格,不含服务类的");
return list;
}
#endregion
//#region AddTaskSetRpShopMemberAnalyzeLog2207(批量刷调度计算业绩新老客)
///// <summary>
///// 批量刷调度计算业绩新老客
///// </summary>
///// <param name="begin"></param>
///// <param name="end"></param>
///// <param name="shopId"></param>
//[HttpGet]
//public void AddTaskSetRpShopMemberAnalyzeLog2207(DateTime begin, DateTime end, Guid? shopId)
//{
// _report2207Service.AddTaskSetRpShopMemberAnalyzeLog2207(begin, end, shopId);
//}
//#endregion
}
}