public ActionResult FinanceGaoFeeToExcel(ContributionInfoQuery query) { try { IFinanceFacadeAPIService service = ServiceContainer.Instance.Container.Resolve <IFinanceFacadeAPIService>(); query.JournalID = CurAuthor.JournalID; query.Status = 1; query.IsReport = true; if (SiteConfig.GaoFeeText3 > 0) { query.isPageFeeGet = true; } IList <FinanceAccountEntity> list = service.GetFinanceGaoFeePageList(query).ItemList; if (list == null || list.Count <= 0) { return(Content("没有数据不能导出,请先进行查询!")); } string strTempPath = "/UploadFile/TempFile/" + "FinanceGaoFee.xls"; if (SiteConfig.GaoFeeText3 > 0) { for (int i = 0; i < list.Count; i++) { list[i].ArticlePaymentFee = list[i].LayoutFee * SiteConfig.GaoFeeText3 / 100; } string[] titleFiles = new string[] { "稿件编号", "稿件标题", "第一作者", "通讯作者", "发票抬头", "应付稿费", "手机", "联系电话", "单位", "地址", "邮编" }; int[] titleWidth = new int[] { 80, 200, 40, 40, 100, 60, 80, 90, 100, 150, 60 }; string[] dataFiles = new string[] { "CNumber", "Title", "FirstAuthor", "CommunicationAuthor", "InvoiceUnit", "ArticlePaymentFee", "Mobile", "Tel", "WorkUnit", "Address", "ZipCode" }; string[] fomateFiles = new string[] { "", "", "", "", "", "", "", "", "", "", "" }; ExcelHelperEx.CreateExcel <FinanceAccountEntity>("作者稿费统计一览表", titleFiles, titleWidth, dataFiles, fomateFiles, list, strTempPath); } else { string[] titleFiles = new string[] { "稿件编号", "稿件标题", "第一作者", "通讯作者", "发票抬头", "应付稿费", "稿费备注", "手机", "联系电话", "单位", "地址", "邮编" }; int[] titleWidth = new int[] { 80, 200, 40, 40, 100, 60, 80, 80, 90, 100, 150, 60 }; string[] dataFiles = new string[] { "CNumber", "Title", "FirstAuthor", "CommunicationAuthor", "InvoiceUnit", "ArticlePaymentFeeStr", "ArticlePaymentNote", "Mobile", "Tel", "WorkUnit", "Address", "ZipCode" }; string[] fomateFiles = new string[] { "", "", "", "", "", "", "", "", "", "", "", "" }; ExcelHelperEx.CreateExcel <FinanceAccountEntity>("作者稿费统计一览表", titleFiles, titleWidth, dataFiles, fomateFiles, list, strTempPath); } return(Json(new { flag = 1, ExcelPath = strTempPath })); } catch (Exception ex) { LogProvider.Instance.Error("导出作者稿费信息出现异常:" + ex.Message); return(Content("导出作者稿费信息异常!")); } }
public ActionResult GetFinanceGaoFeePageList(ContributionInfoQuery query) { IFinanceFacadeAPIService service = ServiceContainer.Instance.Container.Resolve <IFinanceFacadeAPIService>(); query.JournalID = CurAuthor.JournalID; if (SiteConfig.GaoFeeText3 > 0) { query.isPageFeeGet = true; } query.OrderStr = Request.Params["sortorder"];//排序类型(只按稿件编号排序) query.CurrentPage = Convert.ToInt32(Request.Params["page"]); query.PageSize = Convert.ToInt32(Request.Params["pagesize"]); Pager <FinanceAccountEntity> pager = service.GetFinanceGaoFeePageList(query); if (SiteConfig.GaoFeeText3 > 0) { return(Json(new { Rows = pager.ItemList, Total = pager.TotalRecords, SolidMoney = (pager.Money * SiteConfig.GaoFeeText3 / 100).ToString("C2") })); } else { return(Json(new { Rows = pager.ItemList, Total = pager.TotalRecords, SolidMoney = pager.Money.ToString("C2") })); } }