using Microsoft.Win32; using MyCode.Project.Domain.Config; using MyCode.Project.Domain.Dtos.Request.Act; using MyCode.Project.Domain.Message.Request.DouYin; using MyCode.Project.Domain.Message.Request.Report40; using MyCode.Project.Domain.Message.Request.User; using MyCode.Project.Domain.Message.Response.DouYin; using MyCode.Project.Domain.Message.Response.Message; using MyCode.Project.Domain.Message.Response.Report40; using MyCode.Project.Domain.Message.Response.User; using MyCode.Project.Domain.Message.Response.Wechat; using MyCode.Project.Domain.Model; using MyCode.Project.Infrastructure.Cache; using MyCode.Project.Infrastructure.Common; using MyCode.Project.Infrastructure.Constant; using MyCode.Project.Infrastructure.Exceptions; using MyCode.Project.Infrastructure.PayModels; using MyCode.Project.Infrastructure.WebPost; using MyCode.Project.OutSideService; using MyCode.Project.Services; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using Senparc.Weixin.TenPay; using Senparc.Weixin.TenPay.V3; using System; using System.Collections.Generic; using System.Threading; using System.Web.Http; namespace MyCode.Project.WebApi.Controllers { /// /// 测试2接口 /// public class Test2Controller : BaseAPIController { private ITest1Service _test1Service; private IReport2307Service _report2307Service; private IMemberServiceInvService _memberServiceInvService; private IReport2207Service _report2207Service; private IReport2303Service _report2303Service; private IMemberComplimentaryAccountService _memberComplimentaryAccountService; private IReport2308Service _report2308Service; public Test2Controller(ITest1Service test1Service , IReport2307Service report2307Service , IMemberServiceInvService memberServiceInvService , IReport2207Service report2207Service , IReport2303Service report2303Service, IMemberComplimentaryAccountService memberComplimentaryAccountService, IReport2308Service report2308Service) { _report2303Service = report2303Service; _test1Service = test1Service; _report2307Service = report2307Service; _memberServiceInvService = memberServiceInvService; _report2207Service = report2207Service; _memberComplimentaryAccountService = memberComplimentaryAccountService; _report2308Service = report2308Service; } #region /// /// 测试计算订单明细的分摊单价的公共方法 /// /// [HttpGet] public List TestGetCalPriceAndRevenuePrice(Guid id) { return _test1Service.TestGetCalPriceAndRevenuePrice(id); } #endregion ///// ///// 20230721阿明要的报表 ///// ///// ///// //[HttpGet] //public void Save20230721ReportData(DateTime begin, Guid? zhiDingShopId) //{ // if (zhiDingShopId.HasValue) // _report2307Service.Save20230721ReportData(begin, zhiDingShopId.Value); // else // _report2307Service.SaveAllShopReportData(begin); //} //#region MoveCard(把卡券复制到服务表) ///// ///// 把卡券复制到服务表 ///// //[HttpGet] //public void MoveCard() //{ // _test1Service.MoveCard(); //} //#endregion //#region MoveCardServiceInv(把剩余卡券的服务次数转移到服务表的次数) ///// ///// 把剩余卡券的服务次数转移到服务表的次数 ///// //[HttpGet] //public void MoveCardServiceInv() //{ // _test1Service.MoveCardServiceInv(); //} //#endregion #region MoveServiceInv(相同加盟商的服务次数转移店铺) /// /// 相同加盟商的服务次数转移店铺 /// [HttpGet] public void MoveServiceInv(Guid? customerId, Guid fromShopId, Guid toShopId) { _memberServiceInvService.MoveServiceInv(customerId, fromShopId, toShopId); } #endregion [HttpGet] [AllowAnonymous] public void TaskFenXiReportToCache() { _report2207Service.TaskFenXiReportToCache(); } /// /// 重新计算具体某个店铺某个月的诊断四表某些字段的数据3 /// /// /// [HttpGet] public void Save2309ReportData(DateTime begin, Guid? zhiDingShopId) { if (zhiDingShopId.HasValue) _report2303Service.Save2309ReportData(begin, zhiDingShopId.Value); else _report2303Service.SaveAllShopReportData2309(begin); } /// /// 批量刷旧数据的诊断四表日报 /// /// /// [HttpGet] public void BatchSave2301ReportDataEveryDays(DateTime begin, DateTime end, Guid? shopId = null) { //shopId = null; _report2303Service.BatchSave2301ReportDataEveryDays(begin, end, shopId); } /// /// 增加每日诊断四表的调度任务 /// /// /// [HttpGet] public void TaskAddWorkProcessOf2301ReportDataEveryDays() { _report2303Service.TaskAddWorkProcessOf2301ReportDataEveryDays(); } #region BatchSetNcPrice(刷NC单价) /// /// 刷NC单价 /// /// /// /// [HttpGet] public void BatchSetNcPrice(DateTime begin, DateTime end, Guid shopId) { _memberComplimentaryAccountService.BatchSetNcPrice(begin, end, shopId); } #endregion #region BatchSetNcPrice(补记录销售订单的样板店指标) /// /// 补记录销售订单的样板店指标 /// /// /// /// [HttpGet] public void BuLuYangBanDianReportDays(DateTime begin, DateTime end, Guid? shopId) { _report2303Service.BuLuYangBanDianReportDays(begin, end, shopId); } #endregion /// /// 刷手工费 /// /// /// [HttpGet] public void BatchSetShouGongFei(DateTime begin, DateTime end, Guid shopId) { _report2303Service.BatchSetShouGongFei(begin, end, shopId); } #region MoveMemberAccountToNewShop(从旧店铺转移会员余额到新店铺,跨加盟商) /// /// 从旧店铺转移会员余额到新店铺,跨加盟商 /// /// 旧店铺编码 /// 新店铺编码 /// 新店铺的营销关系挂哪个店员 [HttpGet] public void MoveMemberAccountToNewShop(string oldShopCode, string newShopCode, Guid clerkId) { _memberServiceInvService.MoveMemberAccountToNewShop(oldShopCode, newShopCode, clerkId); } #endregion ///// ///// 不删表重新计算所有店铺某天的诊断四表日报表的某些字段数据到报表数据库 ///// ///// ///// //[HttpGet] //public void BatchSaveShopReportEveryDayData2403(DateTime begin, DateTime end, Guid? shopId = null) //{ // if (shopId.HasValue) // { // DateTime days = begin; // for (int i = 0; days <= end; i++) // { // DateTime begin1 = days; // _report2308Service.SaveReportEveryDayData2403(begin, shopId.Value); // days = begin1.AddDays(1); // Thread.Sleep(1000); // } // } // else // _report2308Service.SaveAllShopReportEveryDayData2403(begin, end); //} } }