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

88 lines
3.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using MyCode.Project.Domain.Message.Request.Clerk;
using MyCode.Project.Domain.Message.Request.Million;
using MyCode.Project.Domain.Message.Request.Target;
using MyCode.Project.Domain.Message.Response.CardCover;
using MyCode.Project.Domain.Message.Response.MillionPolicy;
using MyCode.Project.Domain.Message.Response.Shop;
using MyCode.Project.Domain.Message.Response.Target;
using MyCode.Project.Domain.Message.Response.User;
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>
///百万店--业绩指标 相关
/// </summary>
public class MillionShopKPIController : BaseWechatController
{
private IMillionShopKPIService _millionShopKPIService;
/// <summary>
/// 初始化一个<see cref="MillionShopKPIController"/>类型的实例
/// </summary>
public MillionShopKPIController(IMillionShopKPIService millionShopKPIService)
{
_millionShopKPIService = millionShopKPIService;
}
#region GetShopKPIModel
/// <summary>
/// 获取该店铺的计算业绩方式
/// </summary>
/// <param name="ShopID">店铺ID加盟商查看时需传</param>
/// <returns></returns>
[HttpGet]
public List<KPIModelResp> GetShopKPIModel(Guid? ShopID)
{
ShopID = ShopID.HasValue ? ShopID : this.CurrentLogin.ShopId;
return _millionShopKPIService.GetShopKPIModel(ShopID.Value);
}
#endregion
#region SetShopKPIModel
/// <summary>
/// 设置店铺的计算业绩方式
/// </summary>
/// <returns></returns>
[HttpPost]
public void SetShopKPIModel(KPIModelReq request)
{
request.ShopID = request.ShopID.HasValue ? request.ShopID.Value : this.CurrentLogin.ShopId;
_millionShopKPIService.SetShopKPIModel(request);
}
#endregion
#region GetShopMonthKPI
/// <summary>
/// 获取店铺业绩月度与日指标
/// </summary>
/// <param name="ShopID">店铺ID加盟商查看时需传</param>
/// <param name="TargetType">指标类型 0月度 1日指标</param>
/// <returns></returns>
[HttpGet]
public MonthKPIResp GetShopMonthKPI(Guid? ShopID,int TargetType)
{
ShopID = ShopID.HasValue ? ShopID : this.CurrentLogin.ShopId;
return _millionShopKPIService.GetShopMonthKPI(ShopID.Value, TargetType);
}
#endregion
#region SetMonthKPIDetail
/// <summary>
/// 设置店员业绩月度与日指标
/// </summary>
/// <returns></returns>
[HttpPost]
public void SetMonthKPIDetail(MonthKPIReq request)
{
request.ShopID = request.ShopID.HasValue ? request.ShopID.Value : this.CurrentLogin.ShopId;
_millionShopKPIService.SetMonthKPIDetail(request, this.CurrentLogin);
}
#endregion
}
}