using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; using System.Threading.Tasks; using XYY.Core.Standard.Mvc; using XYY.Model.Standard.Finance; using XYY.Service.Standard.Finance; using static XYY.Api.Finance.Controllers.FinanceController; namespace XYY.Api.Finance.Controllers { [Route("api/[controller]/[action]")] [ApiController] public class SMPReportsController : ApiControllerBase { private readonly ISMPReportsService _reportsService; public SMPReportsController(ISMPReportsService reportsService) { _reportsService = reportsService; } [AllowAnonymous] [HttpPost] public async Task> GetEFFinanceBillGroup(BillSerach serach) { var result = await _reportsService.GetEFFinanceBillGroup(serach.StartDate, serach.EndDate, serach.ChannelId, serach.CustomerId,serach.SalesmanUserId,serach.BranchCompanyId); return result; } [AllowAnonymous] [HttpPost] public async Task> GetEFFinanceBillGroupAsCustomer(BillSerach serach) { return await _reportsService.CacheGetEFFinanceBillGroupAsCustomer(serach.StartDate, serach.EndDate); } [AllowAnonymous] [HttpPost] public async Task> GetEFFinanceBillGroupAsChannel(BillSerach serach) { return await _reportsService.CacheGetEFFinanceBillGroupAsChannel(serach.StartDate, serach.EndDate); } [AllowAnonymous] [HttpPost] public async Task ExportEFFinanceBillGroup(BillSerach serach) { var list = await _reportsService.ExportEFFinanceBillGroup(serach.StartDate, serach.EndDate, serach.ChannelId, serach.CustomerId, serach.SalesmanUserId, serach.BranchCompanyId); return CSVFile("数据透视表.xls", list); } } }