Exemplo n.º 1
0
        public ActionResult ExpertWorkloadListToExcel(WorkloadQuery query)
        {
            decimal totalMoney           = 0;
            decimal money                = Convert.ToDecimal(Request.Params["Money"]);
            IAuthorFacadeService service = ServiceContainer.Instance.Container.Resolve <IAuthorFacadeService>();

            query.JournalID = JournalID;
            int pageIndex = TypeParse.ToInt(Request.Params["page"], 1);
            IList <WorkloadEntity> listAuthor = service.GetWorkloadList(query);

            for (int i = 0; i < listAuthor.Count; i++)
            {
                listAuthor[i].ExpertReviewFee = (SiteConfig.ExpertReviewFee * listAuthor[i].AlreadyCount).ToString("C2");
                totalMoney += SiteConfig.ExpertReviewFee * listAuthor[i].AlreadyCount;
            }

            string[] titleFiles  = new string[] { "专家姓名", "登录名", "待审稿件", "已审稿件", "审稿费", "发票抬头", "户名", "帐号", "开户行", "专家单位", "专家地址", "邮编", "联系电话", "手机" };
            int[]    titleWidth  = new int[] { 50, 100, 50, 50, 80, 100, 50, 150, 100, 120, 150, 50, 100, 80 };
            string[] dataFiles   = new string[] { "RealName", "LoginName", "WaitCount", "AlreadyCount", "ExpertReviewFee", "InvoiceUnit", "ReserveField1", "ReserveField2", "ReserveField3", "WorkUnit", "Address", "ZipCode", "Tel", "Mobile" };
            string[] fomateFiles = new string[] { "", "", "", "", "", "", "", "", "", "", "", "", "", "" };
            string   strTempPath = "/UploadFile/TempFile/" + "ExpertWorkloadList.xls";

            if (query.isIgnoreNoWork == true)
            {
                listAuthor = listAuthor.Where(p => p.AlreadyCount > 0).OrderByDescending(x => x.AlreadyCount).ToList();
                ExcelHelperEx.CreateExcel <WorkloadEntity>("专家信息列表_审稿费每篇" + money + "元,总计_" + totalMoney + "元", titleFiles, titleWidth, dataFiles, fomateFiles, listAuthor, strTempPath);
            }
            else
            {
                ExcelHelperEx.CreateExcel <WorkloadEntity>("专家信息列表_审稿费每篇" + money + "元,总计_" + totalMoney + "元", titleFiles, titleWidth, dataFiles, fomateFiles, listAuthor, strTempPath);
            }
            return(Json(new { flag = 1, ExcelPath = strTempPath }));
        }
Exemplo n.º 2
0
 public ActionResult FinanceGlanceToExcel(FinanceContributeQuery query)
 {
     try
     {
         IFinanceFacadeAPIService service = ServiceContainer.Instance.Container.Resolve <IFinanceFacadeAPIService>();
         query.JournalID = CurAuthor.JournalID;
         query.Status    = 1;
         query.IsReport  = true;
         IList <FinanceContributeEntity> list = service.GetFinanceGlancePageList(query).ItemList;
         if (list == null || list.Count <= 0)
         {
             return(Content("没有数据不能导出,请先进行查询!"));
         }
         string[] titleFiles  = new string[] { "稿件编号", "稿件标题", "通讯作者", "第一作者", "单位", "费用类型", "交费金额", "备注", "入款人", "入款日期", "发票抬头", "发票号码", "挂号号码", "寄出日期" };
         int[]    titleWidth  = new int[] { 80, 200, 40, 40, 100, 40, 60, 100, 40, 80, 120, 100, 80, 100 };
         string[] dataFiles   = new string[] { "CNumber", "Title", "CommunicationAuthorName", "FirstAuthorName", "WorkUnit", "FeeTypeName", "Amount", "Note", "InUserName", "InComeDate", "InvoiceUnit", "InvoiceNo", "PostNo", "SendDate" };
         string[] fomateFiles = new string[] { "", "", "", "", "", "", "", "", "", "{0:yyyy-MM-dd}", "", "", "", "{0:yyyy-MM-dd}" };
         string   strTempPath = "/UploadFile/TempFile/" + "FinanceGlance.xls";
         ExcelHelperEx.CreateExcel <FinanceContributeEntity>("财务统计一览表", titleFiles, titleWidth, dataFiles, fomateFiles, list, strTempPath);
         return(Json(new { flag = 1, ExcelPath = strTempPath }));
     }
     catch (Exception ex)
     {
         LogProvider.Instance.Error("导出稿件费用信息出现异常:" + ex.Message);
         return(Content("导出稿件费用信息异常!"));
     }
 }
Exemplo n.º 3
0
        public ActionResult FinanceAccountToExcel(ContributionInfoQuery query)
        {
            IFinanceFacadeAPIService service = ServiceContainer.Instance.Container.Resolve <IFinanceFacadeAPIService>();

            query.JournalID = CurAuthor.JournalID;
            query.IsReport  = true;
            IList <FinanceAccountEntity> list = service.GetFinanceAccountPageList(query).ItemList;

            string[] titleFiles  = new string[] { "稿件编号", "稿件标题", "审稿费(通知)", "版面费(通知)", "审稿费(已入款)", "备注", "版面费(已入款)", "备注", "第一作者", "通讯作者", "联系电话", "手机", "发票单位", "邮编", "投稿日期" };
            int[]    titleWidth  = new int[] { 60, 200, 60, 60, 70, 80, 70, 80, 50, 50, 70, 70, 120, 40, 120 };
            string[] dataFiles   = new string[] { "CNumber", "Title", "ReadingFeeNoticeStatus", "LayoutFeeNoticeStatus", "ReadingFeeStr", "Note", "LayoutFeeStr", "PageNote", "FirstAuthor", "CommunicationAuthor", "Tel", "Mobile", "InvoiceUnit", "ZipCode", "AddDate" };
            string[] fomateFiles = new string[] { "", "", "", "", "", "", "", "", "", "", "", "", "", "", "{0:yyyy-MM-dd}" };
            string   strTempPath = "/UploadFile/TempFile/" + "FinanceAccount.xls";

            ExcelHelperEx.CreateExcel <FinanceAccountEntity>("作者版面费报表", titleFiles, titleWidth, dataFiles, fomateFiles, list, strTempPath);
            return(Json(new { flag = 1, ExcelPath = strTempPath }));
        }
Exemplo n.º 4
0
 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("导出作者稿费信息异常!"));
     }
 }
Exemplo n.º 5
0
        public ActionResult FinancePageFeeRenderToExcel(FinanceContributeQuery query)
        {
            IFinanceFacadeAPIService service = ServiceContainer.Instance.Container.Resolve <IFinanceFacadeAPIService>();

            query.JournalID = CurAuthor.JournalID;
            //query.Status = 1;
            query.IsReport = true;
            IList <FinanceContributeEntity> list = service.GetFinancePageFeeReportPageList(query).ItemList;

            string[] titleFiles  = new string[] { "稿件编号", "稿件标题", "版面费", "备注", "通讯作者", "联系电话", "手机", "Email", "工作单位", "发票单位", "联系地址", "邮编", "投稿日期" };
            int[]    titleWidth  = new int[] { 80, 200, 40, 100, 80, 100, 80, 80, 150, 150, 150, 80, 100 };
            string[] dataFiles   = new string[] { "CNumber", "Title", "PageMoney", "Note", "AuthorName", "Tel", "Mobile", "Email", "WorkUnit", "InvoiceUnit", "Address", "ZipCode", "AddDate" };
            string[] fomateFiles = new string[] { "", "", "", "", "", "", "", "", "", "", "", "", "{0:yyyy-MM-dd}" };
            string   strTempPath = "/UploadFile/TempFile/" + "FinanceContribute.xls";

            ExcelHelperEx.CreateExcel <FinanceContributeEntity>("作者版面费报表", titleFiles, titleWidth, dataFiles, fomateFiles, list, strTempPath);
            return(Json(new { flag = 1, ExcelPath = strTempPath }));
        }
Exemplo n.º 6
0
        public ActionResult IssueListToExcel(IssueContentQuery query)
        {
            IIssueFacadeService service = ServiceContainer.Instance.Container.Resolve <IIssueFacadeService>();

            query.JournalID = CurAuthor.JournalID;
            IList <IssueContentEntity> list = service.GetIssueContentList(query);

            for (int i = 0; i < list.Count; i++)
            {
                list[i].Title    = WKT.Common.Utils.Utils.ClearHtmlNbsp(list[i].Title);
                list[i].Authors  = WKT.Common.Utils.Utils.ClearHtmlNbsp(list[i].Authors);
                list[i].FilePath = "http://" + WKT.Common.Utils.Utils.GetHost() + list[i].FilePath;
            }

            string[] titleFiles  = new string[] { "标题", "年", "卷", "期", "作者", "关键字", "下载地址", "文件大小", "文件类型", "添加日期" };
            int[]    titleWidth  = new int[] { 300, 40, 40, 40, 100, 100, 200, 50, 50, 135 };
            string[] dataFiles   = new string[] { "Title", "Year", "Volume", "Issue", "Authors", "Keywords", "FilePath", "FileSize", "FileExt", "AddDate" };
            string[] fomateFiles = new string[] { "", "", "", "", "", "", "", "", "", "{0:yyyy-MM-dd}" };
            string   strTempPath = "/UploadFile/TempFile/" + "IssueList.xls";

            ExcelHelperEx.CreateExcel <IssueContentEntity>("期刊列表", titleFiles, titleWidth, dataFiles, fomateFiles, list, strTempPath);
            return(Json(new { flag = 1, ExcelPath = strTempPath }));
        }
Exemplo n.º 7
0
        public ActionResult WorkloadListForEditorToExcel(FlowStatusQuery fquery)
        {
            JsonExecResult <FlowStatusEntity> jsonResult0 = new JsonExecResult <FlowStatusEntity>();
            JsonExecResult <FlowStatusEntity> jsonResult1 = new JsonExecResult <FlowStatusEntity>();
            IFlowFacadeService fservice = ServiceContainer.Instance.Container.Resolve <IFlowFacadeService>();

            fquery.JournalID = JournalID;


            List <WorkloadEntity> list = new List <WorkloadEntity>();

            #region 已处理
            try
            {
                fquery.IsHandled     = 1;//1=已处理
                jsonResult1.ItemList = fservice.GetHaveRightFlowStatusForStat(fquery);
                if (jsonResult1.ItemList != null)
                {
                    int WorkCount = 0;
                    jsonResult1.ItemList = jsonResult1.ItemList.Where(p => p.ContributionCount > 0).ToList <FlowStatusEntity>();
                    for (int n = 0; n < jsonResult1.ItemList.Count; n++)
                    {
                        WorkloadEntity workloadEntity = new WorkloadEntity();
                        workloadEntity.StatusName   = jsonResult1.ItemList[n].StatusName;
                        workloadEntity.AlreadyCount = jsonResult1.ItemList[n].ContributionCount;
                        WorkCount += jsonResult1.ItemList[n].ContributionCount;
                        workloadEntity.RealName = Request.Params["RealName"];
                        list.Add(workloadEntity);
                    }
                    WorkloadEntity workloadEntityCount = new WorkloadEntity();
                    workloadEntityCount.StatusName   = "已处理总计:";
                    workloadEntityCount.AlreadyCount = WorkCount;
                    list.Add(workloadEntityCount);
                }
            }
            catch (Exception ex)
            {
                jsonResult1.result = EnumJsonResult.error.ToString();
                jsonResult1.msg    = "获取当前人可以处理的稿件状态出现异常:" + ex.Message;
            }
            #endregion

            #region 待处理
            try
            {
                fquery.IsHandled     = 0;//0=待处理
                jsonResult0.ItemList = fservice.GetHaveRightFlowStatusForStat(fquery);
                if (jsonResult0.ItemList != null)
                {
                    int WaitCount = 0;
                    jsonResult0.ItemList = jsonResult0.ItemList.Where(p => p.ContributionCount > 0).ToList <FlowStatusEntity>();
                    for (int m = 0; m < jsonResult0.ItemList.Count; m++)
                    {
                        WorkloadEntity workloadEntity = new WorkloadEntity();
                        workloadEntity.StatusName   = jsonResult0.ItemList[m].StatusName;
                        workloadEntity.AlreadyCount = jsonResult0.ItemList[m].ContributionCount;
                        WaitCount += jsonResult0.ItemList[m].ContributionCount;
                        workloadEntity.RealName = Request.Params["RealName"];
                        list.Add(workloadEntity);
                    }
                    WorkloadEntity workloadEntityCount = new WorkloadEntity();
                    workloadEntityCount.StatusName   = "待处理总计:";
                    workloadEntityCount.AlreadyCount = WaitCount;
                    list.Add(workloadEntityCount);
                }
            }
            catch (Exception ex)
            {
                jsonResult0.result = EnumJsonResult.error.ToString();
                jsonResult0.msg    = "获取当前人可以处理的稿件状态出现异常:" + ex.Message;
            }
            #endregion

            string[] titleFiles  = new string[] { "编辑姓名", "稿件状态", "数量" };
            int[]    titleWidth  = new int[] { 80, 80, 80 };
            string[] dataFiles   = new string[] { "RealName", "StatusName", "AlreadyCount" };
            string[] fomateFiles = new string[] { "", "", "" };
            string   strTempPath = "/UploadFile/TempFile/" + "WorkloadListForEditor.xls";
            ExcelHelperEx.CreateExcel <WorkloadEntity>("编辑(" + Request.Params["RealName"] + ")工作量统计", titleFiles, titleWidth, dataFiles, fomateFiles, list, strTempPath);

            return(Json(new { flag = 1, ExcelPath = strTempPath }));
        }
Exemplo n.º 8
0
        public ActionResult WorkloadListToExcel(WorkloadQuery query)
        {
            IRoleAuthorFacadeService roleAuthorService = ServiceContainer.Instance.Container.Resolve <IRoleAuthorFacadeService>();
            RoleAuthorQuery          roleAuthorQuery   = new RoleAuthorQuery();

            roleAuthorQuery.JournalID = JournalID;
            roleAuthorQuery.GroupID   = 1;
            roleAuthorQuery.OrderStr  = " AI.AuthorID ASC";
            roleAuthorQuery.RealName  = query.RealName;
            if (query.RoleID > 0)
            {
                roleAuthorQuery.RoleID = query.RoleID;
            }
            int pageIndex = TypeParse.ToInt(Request.Params["page"], 1);
            IList <RoleAuthorEntity> listRoleAuthor = roleAuthorService.GetRoleAuthorDetailList(roleAuthorQuery);
            List <WorkloadEntity>    list           = new List <WorkloadEntity> ();

            for (int i = 0; i < listRoleAuthor.Count; i++)
            {
                WorkloadEntity  workloadEntity = new WorkloadEntity();
                FlowStatusQuery fquery         = new FlowStatusQuery();
                JsonExecResult <FlowStatusEntity> jsonResult0 = new JsonExecResult <FlowStatusEntity>();
                JsonExecResult <FlowStatusEntity> jsonResult1 = new JsonExecResult <FlowStatusEntity>();
                IFlowFacadeService fservice = ServiceContainer.Instance.Container.Resolve <IFlowFacadeService>();
                fquery.JournalID   = JournalID;
                fquery.CurAuthorID = listRoleAuthor[i].AuthorID;
                fquery.RoleID      = listRoleAuthor[i].RoleID;
                fquery.StartDate   = query.StartDate;
                fquery.EndDate     = query.EndDate;
                #region 待处理
                try
                {
                    fquery.IsHandled     = 0;//0=待处理
                    jsonResult0.ItemList = fservice.GetHaveRightFlowStatusForStat(fquery);
                    if (jsonResult0.ItemList != null && jsonResult0.ItemList.Count > 0)
                    {
                        jsonResult0.ItemList = jsonResult0.ItemList.Where(p => p.ContributionCount > 0).ToList <FlowStatusEntity>();
                        for (int m = 0; m < jsonResult0.ItemList.Count; m++)
                        {
                            workloadEntity.WaitCount += jsonResult0.ItemList[m].ContributionCount;
                        }
                    }
                }
                catch (Exception ex)
                {
                    jsonResult0.result = EnumJsonResult.error.ToString();
                    jsonResult0.msg    = "获取当前人可以处理的稿件状态出现异常:" + ex.Message;
                }
                #endregion

                #region 已处理
                try
                {
                    fquery.IsHandled     = 1;//1=已处理
                    jsonResult1.ItemList = fservice.GetHaveRightFlowStatusForStat(fquery);
                    if (jsonResult1.ItemList != null && jsonResult1.ItemList.Count > 0)
                    {
                        jsonResult1.ItemList = jsonResult1.ItemList.Where(p => p.ContributionCount > 0).ToList <FlowStatusEntity>();
                        for (int n = 0; n < jsonResult1.ItemList.Count; n++)
                        {
                            workloadEntity.WorkCount += jsonResult1.ItemList[n].ContributionCount;
                        }
                    }
                }
                catch (Exception ex)
                {
                    jsonResult1.result = EnumJsonResult.error.ToString();
                    jsonResult1.msg    = "获取当前人可以处理的稿件状态出现异常:" + ex.Message;
                }
                #endregion

                workloadEntity.AuthorID = listRoleAuthor[i].AuthorID;
                workloadEntity.RealName = listRoleAuthor[i].RealName;
                if (workloadEntity.WorkCount > 0)
                {
                    list.Add(workloadEntity);
                }
            }
            //去除固定的不需统计的人员ID
            list.Where(p => p.AuthorID != 84381 && p.AuthorID != 84386 && p.AuthorID != 84388 && p.AuthorID != 95844);
            //去除List中的重复项
            List <WorkloadEntity> WorkloadList = list.Distinct(new Compare <WorkloadEntity>((x, y) => (null != x && null != y) && (x.AuthorID == y.AuthorID))).ToList();

            string[] titleFiles  = new string[] { "编辑姓名", "已处理", "待处理" };
            int[]    titleWidth  = new int[] { 80, 80, 80 };
            string[] dataFiles   = new string[] { "RealName", "WorkCount", "WaitCount" };
            string[] fomateFiles = new string[] { "", "", "" };
            string   strTempPath = "/UploadFile/TempFile/" + "WorkloadListAll.xls";
            ExcelHelperEx.CreateExcel <WorkloadEntity>("编辑部工作量统计", titleFiles, titleWidth, dataFiles, fomateFiles, WorkloadList, strTempPath);
            return(Json(new { flag = 1, ExcelPath = strTempPath }));
        }