示例#1
0
 public JsonActionResult <string> ExportCouponTotalReport([FromBody] CouponReportFilter filter)
 {
     return(SafeExecute(() =>
     {
         var exportHelper = new ExportHelper(new[]
         {
             new ExportInfo("Name", "优惠券标题"),
             new ExportInfo("UseCondition", "使用条件"),
             new ExportInfo("CreateDate", "创建时间"),
             new ExportInfo("CouponTemplateCode", "优惠券模板编号"),
             new ExportInfo("BrowseTimes", "浏览量"),
             new ExportInfo("PutInDate", "投放时间"),
             new ExportInfo("GetNumber", "领取人数"),
             new ExportInfo("GetTimes", "领取数量"),
             new ExportInfo("Validity", "有效期"),
             new ExportInfo("VerificationNumber", "核销人数"),
             new ExportInfo("VerificationTimes", "核销次数"),
             new ExportInfo("VerificationRate", "核销率"),
             new ExportInfo("Remark", "备注")
         });
         var data = new List <CouponTotalReportDto>();
         //if (filter.TimeAvailable)
         //{
         filter.Start = null;
         filter.Limit = null;
         var totalCount = 0;
         data = this.CouponService.CouponTotalReportData(filter, ref totalCount).ToList();
         //}
         var res = exportHelper.Export(data);
         this.CouponService.AddTitleToExcel(filter, res, true);
         return res;
     }));
 }
示例#2
0
 public PagedActionResult <CouponTotalReportDto> GetCouponTotalReportData([FromBody] CouponReportFilter filter)
 {
     return(SafeGetPagedData <CouponTotalReportDto>((result) =>
     {
         var totalCount = 0;
         var data = this.CouponService.CouponTotalReportData(filter, ref totalCount);
         result.Data = data;
         result.TotalCount = totalCount;
     }));
 }
示例#3
0
 public PagedActionResult <CouponReportDto> GetCouponReportData([FromBody] CouponReportFilter filter)
 {
     return(SafeGetPagedData <CouponReportDto>((result) =>
     {
         //if (!ModelState.IsValid)
         //{
         //    throw new DomainException("参数错误!");
         //}
         var data = this.CouponService.CouponReportData(filter);
         result.Data = data;
     }));
 }
示例#4
0
 public JsonActionResult <string> ExportCouponReport([FromBody] CouponReportFilter filter)
 {
     return(SafeExecute(() =>
     {
         var exportHelper = new ExportHelper(new[]
         {
             new ExportInfo("Date", "日期"),
             new ExportInfo("BrowseTime", "浏览量"),
             new ExportInfo("GetNumber", "领取人数"),
             new ExportInfo("GetTime", "领取次数"),
             new ExportInfo("VerificationNumber", "核销人数"),
             new ExportInfo("VerificationTime", "核销次数"),
         });
         var data = new List <CouponReportExportDto>();
         if (filter.TimeAvailable)
         {
             data = this.CouponService.ExportCouponReport(filter).ToList();
         }
         var res = exportHelper.Export(data);
         this.CouponService.AddTitleToExcel(filter, res, false);
         return res;
     }));
 }