88 lines
3.2 KiB
C#
88 lines
3.2 KiB
C#
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
|
||
}
|
||
}
|