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

280 lines
11 KiB
C#
Raw Permalink 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.Request.User;
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 MillionShopExtensionController : BaseWechatController
{
private IMillionShopExtensionService _millionShopExtensionService;
/// <summary>
/// 初始化一个<see cref="MillionShopExtensionController"/>类型的实例
/// </summary>
public MillionShopExtensionController(IMillionShopExtensionService millionShopExtensionService)
{
_millionShopExtensionService = millionShopExtensionService;
}
#region GetShopMonthEx
/// <summary>
/// 获取店铺纳新月度与日指标
/// </summary>
/// <param name="ShopID">店铺ID加盟商查看时需传</param>
/// <param name="TargetType">指标类型 0月度 1日指标</param>
/// <returns></returns>
[HttpGet]
public ExtensionResp GetShopMonthEx(Guid? ShopID,int TargetType)
{
ShopID = ShopID.HasValue ? ShopID : this.CurrentLogin.ShopId;
return _millionShopExtensionService.GetShopMonthEx(ShopID.Value,TargetType);
}
#endregion
#region SetMonthExDetail
/// <summary>
/// 设置店铺纳新月度与日指标
/// </summary>
/// <returns></returns>
[HttpPost]
public void SetMonthExDetail(ExtensionReq request)
{
request.ShopID = request.ShopID.HasValue ? request.ShopID.Value : this.CurrentLogin.ShopId;
_millionShopExtensionService.SetMonthExDetail(request, this.CurrentLogin);
}
#endregion
#region GetShopMonthInvite
/// <summary>
/// 获取店铺邀约月度与日指标
/// </summary>
/// <param name="ShopID">店铺ID加盟商查看时需传</param>
/// <param name="TargetType">指标类型 0月度 1日指标</param>
/// <returns></returns>
[HttpGet]
public InviteResp GetShopMonthInvite(Guid? ShopID, int TargetType)
{
ShopID = ShopID.HasValue ? ShopID : this.CurrentLogin.ShopId;
return _millionShopExtensionService.GetShopMonthInvite(ShopID.Value,TargetType);
}
#endregion
#region SetMonthExDetail
/// <summary>
/// 设置店铺邀约月度与日指标
/// </summary>
/// <returns></returns>
[HttpPost]
public void SetMonthInviteDetail(InviteReq request)
{
request.ShopID = request.ShopID.HasValue ? request.ShopID.Value : this.CurrentLogin.ShopId;
_millionShopExtensionService.SetMonthInviteDetail(request, this.CurrentLogin);
}
#endregion
#region GetShopMonthNurse
/// <summary>
/// 获取店铺护理月度与日指标
/// </summary>
/// <param name="ShopID">店铺ID加盟商查看时需传</param>
/// <param name="TargetType">指标类型 0月度 1日指标</param>
/// <returns></returns>
[HttpGet]
public NurseResp GetShopMonthNurse(Guid? ShopID, int TargetType)
{
ShopID = ShopID.HasValue ? ShopID : this.CurrentLogin.ShopId;
return _millionShopExtensionService.GetShopMonthNurse(ShopID.Value,TargetType);
}
#endregion
#region SetMonthExDetail
/// <summary>
/// 设置店铺护理月度与日指标
/// </summary>
/// <returns></returns>
[HttpPost]
public void SetMonthNurseDetail(NurseReq request)
{
request.ShopID = request.ShopID.HasValue ? request.ShopID.Value : this.CurrentLogin.ShopId;
_millionShopExtensionService.SetMonthNurseDetail(request, this.CurrentLogin);
}
#endregion
#region GetShopMonthExperience
/// <summary>
/// 获取店铺体验月度与日指标
/// </summary>
/// <param name="ShopID">店铺ID加盟商查看时需传</param>
/// <param name="TargetType">指标类型 0月度 1日指标</param>
/// <returns></returns>
[HttpGet]
public ExperienceResp GetShopMonthExperience(Guid? ShopID, int TargetType)
{
ShopID = ShopID.HasValue ? ShopID : this.CurrentLogin.ShopId;
return _millionShopExtensionService.GetShopMonthExperience(ShopID.Value, TargetType);
}
#endregion
#region SetMonthExDetail
/// <summary>
/// 设置店铺体验月度与日指标
/// </summary>
/// <returns></returns>
[HttpPost]
public void SetMonthExperienceDetail(ExperienceReq request)
{
request.ShopID = request.ShopID.HasValue ? request.ShopID.Value : this.CurrentLogin.ShopId;
_millionShopExtensionService.SetMonthExperienceDetail(request, this.CurrentLogin);
}
#endregion
#region GetShopMonthFission
/// <summary>
/// 获取店铺裂变月度与日指标
/// </summary>
/// <param name="ShopID">店铺ID加盟商查看时需传</param>
/// <param name="TargetType">指标类型 0月度 1日指标</param>
/// <returns></returns>
[HttpGet]
public FissionResp GetShopMonthFission(Guid? ShopID, int TargetType)
{
ShopID = ShopID.HasValue ? ShopID : this.CurrentLogin.ShopId;
return _millionShopExtensionService.GetShopMonthFission(ShopID.Value, TargetType);
}
#endregion
#region SetMonthFissionDetail
/// <summary>
/// 设置店铺裂变月度与日指标
/// </summary>
/// <returns></returns>
[HttpPost]
public void SetMonthFissionDetail(FissionReq request)
{
request.ShopID = request.ShopID.HasValue ? request.ShopID.Value : this.CurrentLogin.ShopId;
_millionShopExtensionService.SetMonthFissionDetail(request, this.CurrentLogin);
}
#endregion
#region GetShopMonthSheet
/// <summary>
/// 获取店铺核销月度与日指标
/// </summary>
/// <param name="ShopID">店铺ID加盟商查看时需传</param>
/// <param name="TargetType">指标类型 0月度 1日指标</param>
/// <returns></returns>
[HttpGet]
public FissionResp GetShopMonthSheet(Guid? ShopID, int TargetType)
{
ShopID = ShopID.HasValue ? ShopID : this.CurrentLogin.ShopId;
return _millionShopExtensionService.GetShopMonthSheet(ShopID.Value, TargetType);
}
#endregion
#region SetMonthSheetDetail
/// <summary>
/// 设置店铺核销月度与日指标
/// </summary>
/// <returns></returns>
[HttpPost]
public void SetMonthSheetDetail(FissionReq request)
{
request.ShopID = request.ShopID.HasValue ? request.ShopID.Value : this.CurrentLogin.ShopId;
_millionShopExtensionService.SetMonthSheetDetail(request, this.CurrentLogin);
}
#endregion
#region GetClerkZHplan -
/// <summary>
/// 消息-店员获取本人五项指标任务安排或查看本人五项指标数据
/// </summary>
/// <param name="id">消息任务公告主键ID</param>
/// <param name="type">查看类型 0本人任务 1本人任务数据</param>
/// <returns></returns>
[HttpGet]
public ZHWorkResp GetClerkZHplan(Guid id,int type)
{
return _millionShopExtensionService.GetClerkZHplan(id,type,this.CurrentLogin);
}
#endregion
#region GetClerkZHResult -
/// <summary>
/// 消息-店员提交五项指标数据
/// </summary>
/// <returns></returns>
[HttpPost]
public void GetClerkZHResult(ZHWorkResp request)
{
_millionShopExtensionService.GetClerkZHResult(request, this.CurrentLogin);
}
#endregion
#region GetShopZHplan -
/// <summary>
/// 消息-加盟商获取店铺早会指标安排
/// </summary>
/// <param name="id">消息任务公告主键ID</param>
/// <returns></returns>
[HttpGet]
public ZHWCClerkResp GetShopZHplan(Guid id)
{
return _millionShopExtensionService.GetShopZHplan(id);
}
#endregion
#region ()
/// <summary>
/// 门店今日业绩(新的站内消息内容)
/// </summary>
/// <param name="shopId">店铺主键</param>
[HttpGet]
public Guid RefreshMessage(Guid shopId)
{
if (this.CurrentLogin.RoleType== Infrastructure.Enumeration.LoginRoleType.Clerk)
{
ClerkKPIInfo act = new ClerkKPIInfo();
act.ClerkID = this.CurrentLogin.ClerkId.Value;
act.OpenId = null;
act.Time = DateTime.Now;
string json = JsonHelper.ToJson(act);
_millionShopExtensionService.SendTodaySalesPerforClerk(json);
return Guid.NewGuid();
}
else
{
return _millionShopExtensionService.AddSysMessage(shopId, this.CurrentLogin.UserId, (int)this.CurrentLogin.RoleType, 0, DateTime.Now);
}
}
#endregion
//#region 门店今日业绩(新的站内消息内容)
///// <summary>
///// 门店今日业绩(新的站内消息内容)
///// </summary>
///// <param name="shopId">店铺主键</param>
//[AllowAnonymous]
//public void AddSysMessage(Guid shopId, Guid loginId, int roleType)
//{
// _millionShopExtensionService.AddSysMessage(shopId, loginId, roleType);
//}
//#endregion
}
}