78 lines
2.3 KiB
C#
78 lines
2.3 KiB
C#
|
|
using MyCode.Project.Domain.Message.Request.BaoDian;
|
|||
|
|
using MyCode.Project.Domain.Message.Response.LxmZHMDReport;
|
|||
|
|
using MyCode.Project.Infrastructure;
|
|||
|
|
using MyCode.Project.Infrastructure.Common;
|
|||
|
|
using MyCode.Project.Infrastructure.Enumeration;
|
|||
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Text;
|
|||
|
|
using System.Threading.Tasks;
|
|||
|
|
|
|||
|
|
namespace MyCode.Project.Services.BLL.ReportExport
|
|||
|
|
{
|
|||
|
|
public class OldMemberALLDetailsExport : BaseExport
|
|||
|
|
{
|
|||
|
|
#region 初始化
|
|||
|
|
private readonly IBaoDianService _baoDianService;
|
|||
|
|
public OldMemberALLDetailsExport(IBaoDianService baoDianService)
|
|||
|
|
{
|
|||
|
|
_baoDianService = baoDianService;
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
#region Execute(执行)
|
|||
|
|
public override string Execute()
|
|||
|
|
{
|
|||
|
|
var pageSearch = base.GetPageSearch<OldMemberReportReq>(Condition);
|
|||
|
|
|
|||
|
|
var resultData = new ReportCalRateResp()
|
|||
|
|
{
|
|||
|
|
Total = 0,
|
|||
|
|
Rate = 0.01m
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
var result = new Result()
|
|||
|
|
{
|
|||
|
|
Data = resultData,
|
|||
|
|
Code = ResultCode.Success
|
|||
|
|
};
|
|||
|
|
|
|||
|
|
if (base.ExcelFileType == (int)ExportFileType.Zip)
|
|||
|
|
{
|
|||
|
|
//类型为0是报表专用,验证客户端是否在线
|
|||
|
|
WebSocketBLL.CheckOnline(ReportId, 0);
|
|||
|
|
|
|||
|
|
//开始运算,先发送个进度0%,表明开始
|
|||
|
|
WebSocketBLL.SendSocketMsg(ReportId, JsonHelper.ToJson(result, false, true));
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
var list = _baoDianService.GetOldMemberALLDetails(pageSearch, this.CurrentUser);
|
|||
|
|
|
|||
|
|
resultData.Total = list.Count;
|
|||
|
|
|
|||
|
|
list.ForEach(x => {
|
|||
|
|
var dataResult = new
|
|||
|
|
{
|
|||
|
|
op =x.MemberList
|
|||
|
|
};
|
|||
|
|
var fileName = $"{x.DisPlayMonth}_{x.CustomerName}_{x.Code}_{x.ShopName}";
|
|||
|
|
base.AddExcelProcess(fileName, dataResult);
|
|||
|
|
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
if (base.ExcelFileType == (int)ExportFileType.Zip)
|
|||
|
|
{
|
|||
|
|
resultData.Rate = 0.02m;
|
|||
|
|
result.Data = resultData;
|
|||
|
|
WebSocketBLL.SendSocketMsg(ReportId, JsonHelper.ToJson(result, false, true));
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
return base.Execute();
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
#endregion
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|