public ActionResult AuthorManuscript(Int64[] CIDs)
 {
     IAuthorPlatformFacadeService service = ServiceContainer.Instance.Container.Resolve<IAuthorPlatformFacadeService>();
     ContributionInfoQuery query = new ContributionInfoQuery();
     query.JournalID = CurAuthor.JournalID;
     query.CIDs = CIDs;
     query.Status = -100;
     ExecResult result = service.ChangeContributionInfoStatus(query);
     return Json(new { result = result.result, msg = result.result.Equals(EnumJsonResult.success.ToString()) ? "撤稿成功!" : "撤稿失败!" });
 }
 public ActionResult Draft(RetractionsBillsEntity model, bool isAutoHandle)
 {
     IAuthorPlatformFacadeService service = ServiceContainer.Instance.Container.Resolve<IAuthorPlatformFacadeService>();
     model.JournalID = CurAuthor.JournalID;
     model.AuthorID = CurAuthor.AuthorID;
     ExecResult result = service.DraftContributionInfo(model);
     if (isAutoHandle == true)
     {
         ContributionInfoQuery cQueryEntity = new ContributionInfoQuery();
         cQueryEntity.JournalID = CurAuthor.JournalID;
         cQueryEntity.CID = model.CID;
         IContributionFacadeService cservice = ServiceContainer.Instance.Container.Resolve<IContributionFacadeService>();
         cservice.DealWithdrawal(cQueryEntity);
     }
     return Json(new { result = result.result, msg = result.msg });
 }
 public ExecResult CancelDelete(ContributionInfoQuery cEntity)
 {
     IContributionInfoService service = ServiceContainer.Instance.Container.Resolve<IContributionInfoService>();
     bool flag = service.CancelDelete(cEntity);
     ExecResult result = new ExecResult();
     if (flag)
     {
         result.result = EnumJsonResult.success.ToString();
     }
     else
     {
         result.result = EnumJsonResult.error.ToString();
         result.msg = "撤销删除出现异常,请稍后再试";
     }
     return result;
 }
        public ActionResult CancelDelete(long CID)
        {
            ExecResult execResult = new ExecResult();
            try
            {
                ContributionInfoQuery cQueryEntity = new ContributionInfoQuery();
                cQueryEntity.JournalID = JournalID;
                cQueryEntity.CID = CID;
                IContributionFacadeService service = ServiceContainer.Instance.Container.Resolve<IContributionFacadeService>();
                execResult = service.CancelDelete(cQueryEntity);
            }
            catch (Exception ex)
            {
                execResult.result = EnumJsonResult.error.ToString();
                execResult.msg = "撤销删除状态出现异常:" + ex.Message;
                WKT.Log.LogProvider.Instance.Error("撤销删除状态出现异常:" + ex.Message);
            }

            return Content(JsonConvert.SerializeObject(execResult));
        }
 private ContributionInfoEntity GetModel2(Int64 CID)
 {
     ContributionInfoEntity model = null;
     if (CID > 0)
     {
         ContributionInfoQuery query = new ContributionInfoQuery();
         query.JournalID = CurAuthor.JournalID;
         query.IsAuxiliary = true;
         query.CID = CID;
         query.isModify = true;
         IAuthorPlatformFacadeService service = ServiceContainer.Instance.Container.Resolve<IAuthorPlatformFacadeService>();
         model = service.GetContributionInfoModel(query);
     }
     if (model == null)
         model = new ContributionInfoEntity();
     IContributionFacadeService serviceSet = ServiceContainer.Instance.Container.Resolve<IContributionFacadeService>();
     model.FieldList = serviceSet.GetFieldsSet().ToList();
     model.ContributeAuthorFieldList = serviceSet.GetContributionAuthorFieldsSet().ToList();
     if (model.FieldList == null)
         model.FieldList = new List<FieldsSet>();
     return model;
 }
        /// <summary>
        /// 原始稿件及附件下载(作者界面)
        /// </summary>
        /// <param name="cid">稿件ID</param>
        /// <param name="downType">下载类型1=稿件 2=附件 3=介绍信</param>
        /// <returns></returns>
        public ActionResult DownloadCIDByEditor(long cid, string fileName, int downType,long AuthorID)
        {
            long[] CIDs = { cid };
            string filePath = string.Empty;
            HttpCookie cookie = System.Web.HttpContext.Current.Request.Cookies["WKT_SSO.CN"];

            ContributionInfoQuery query = new ContributionInfoQuery();
            IAuthorPlatformFacadeService service = ServiceContainer.Instance.Container.Resolve<IAuthorPlatformFacadeService>();
            query.JournalID = SiteConfig.SiteID;
            query.AuthorID = AuthorID;
            query.CIDs = CIDs;
            query.CurrentPage = 1;
            query.PageSize = Convert.ToInt32(Request.Params["pagesize"]);
            query.OrderStr = " AddDate desc";
            Pager<ContributionInfoEntity> pager = service.GetContributionInfoPageList(query);
            if (cookie != null)
            {
                #region MyRegion
                if (downType == 1)
                    filePath = GetUploadPath(pager.ItemList[0].ContributePath);
                if (downType == 2)
                    filePath = GetUploadPath(pager.ItemList[0].FigurePath);
                if (downType == 3)
                    filePath = GetUploadPath(pager.ItemList[0].IntroLetterPath);
                #endregion
                fileName += Path.GetExtension(filePath);
                try
                {
                    FileStream myFile = new FileStream(filePath, FileMode.Open, FileAccess.Read, FileShare.ReadWrite);
                    BinaryReader br = new BinaryReader(myFile);
                    try
                    {
                        #region MyRegion
                        Response.AddHeader("Accept-Ranges", "bytes");
                        Response.Buffer = false;
                        long fileLength = myFile.Length;
                        long startBytes = 0;

                        double pack = 10240; //10K bytes
                        //int sleep = 200;   //每秒5次   即5*10K bytes每秒
                        int sleep = (int)Math.Floor(1000 * pack / 204800) + 1;
                        if (Request.Headers["Range"] != null)
                        {
                            Response.StatusCode = 206;
                            string[] range = Request.Headers["Range"].Split(new char[] { '=', '-' });
                            startBytes = Convert.ToInt64(range[1]);
                        }

                        Response.AddHeader("Content-Length", (fileLength - startBytes).ToString());
                        if (startBytes != 0)
                        {
                            //Response.AddHeader("Content-Range", string.Format(" bytes {0}-{1}/{2}", startBytes, fileLength-1, fileLength));
                        }
                        Response.AddHeader("Connection", "Keep-Alive");
                        Response.ContentType = "application/octet-stream";
                        if (Request.Browser.Browser == "Firefox")
                        {
                            Response.AddHeader("Content-Disposition", "attachment;filename=" + fileName);
                        }
                        else
                        {
                            Response.AddHeader("Content-Disposition", "attachment;filename=" + HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
                        }
                        br.BaseStream.Seek(startBytes, SeekOrigin.Begin);
                        int maxCount = (int)Math.Floor((fileLength - startBytes) / pack) + 1;

                        for (int i = 0; i < maxCount; i++)
                        {
                            if (Response.IsClientConnected)
                            {
                                Response.BinaryWrite(br.ReadBytes(int.Parse(pack.ToString())));
                                Thread.Sleep(sleep);
                            }
                            else
                            {
                                i = maxCount;
                            }
                        }
                        #endregion
                    }
                    catch (Exception ex)
                    {
                        return Content("无法完成下载!详细信息:" + ex.Message);
                    }
                    finally
                    {
                        br.Close();
                        myFile.Close();
                    }
                }
                catch (Exception ex)
                {

                    return Content("无法完成下载!详细信息:" + ex.Message);
                }
                return null;

            }
            else
            {
                return null;
            }
        }
 /// <summary>
 /// 更新介绍信标记
 /// </summary>
 /// <param name="model"></param>
 /// <returns></returns>
 public bool UpdateIntroLetter(ContributionInfoQuery model)
 {
     return ContributionInfoDataAccess.Instance.UpdateIntroLetter(model);
 }
 /// <summary>
 /// 获取稿件分页数据
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public Pager<ContributionInfoEntity> GetContributionInfoPageList(ContributionInfoQuery query)
 {
     return ContributionInfoDataAccess.Instance.GetContributionInfoPageList(query);
 }
 public ActionResult GetFinanceAccountPageList(ContributionInfoQuery query)
 {
     IFinanceFacadeAPIService service = ServiceContainer.Instance.Container.Resolve<IFinanceFacadeAPIService>();
     query.JournalID = CurAuthor.JournalID;
     query.OrderStr = Request.Params["sortorder"];//排序类型(只按稿件编号排序)
     query.CurrentPage = Convert.ToInt32(Request.Params["page"]);
     query.PageSize = Convert.ToInt32(Request.Params["pagesize"]);
     Pager<FinanceAccountEntity> pager = service.GetFinanceAccountPageList(query);
     return Json(new { Rows = pager.ItemList, Total = pager.TotalRecords });
 }
 public ActionResult FinanceOutAccountRenderToExcel(ContributionInfoQuery query, string strDict)
 {
     try
     {
         IFinanceFacadeAPIService service = ServiceContainer.Instance.Container.Resolve<IFinanceFacadeAPIService>();
         query.JournalID = CurAuthor.JournalID;
         query.IsReport = true;
         IList<FinanceAccountEntity> list = service.GetFinanceAccountPageList(query).ItemList;
         if (list == null || list.Count <= 0)
         {
             return Content("没有数据不能导出,请先进行查询!");
         }
         strDict = Server.UrlDecode(strDict);
         JavaScriptSerializer s = new JavaScriptSerializer();
         Dictionary<string, object> JsonData = (Dictionary<string, object>)s.DeserializeObject(strDict);
         IDictionary<string, string> dict = ((object[])JsonData.First().Value).Select(p => (Dictionary<string, object>)p).ToDictionary(p => p["key"].ToString(), q => q["value"].ToString());
         IList<FinanceAccountEntity> outList = list.Select(o => { o.LayoutFee = Math.Round(o.LayoutFee / 100 * query.Percent); return o; }).ToList<FinanceAccountEntity>();
         RenderToExcel.ExportListToExcel<FinanceAccountEntity>(list, dict
             , null
             , "出款_导出" + DateTime.Now.ToString("yyyy-MM-dd"), false, "xls");
         return Content("导出成功!");
     }
     catch (Exception ex)
     {
         LogProvider.Instance.Error("导出入款登记与通知信息出现异常:" + ex.Message);
         return Content("导出入款登记与通知信息异常!");
     }
 }
 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 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 });
        }
 /// <summary>
 /// 获取财务入款通知分页列表
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public Pager<FinanceAccountEntity> GetFinanceAccountPageList(ContributionInfoQuery query)
 {
     return FinanceContributeDataAccess.Instance.GetFinanceAccountPageList(query);
 }
        /// <summary>
        /// 获取财务出款通知分页列表
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public Pager<FinanceAccountEntity> GetFinanceOutAccountPageList(ContributionInfoQuery query)
        {
            StringBuilder strSql = new StringBuilder(@"
                              SELECT
                                    a.CID
                                    ,a.CNumber
                                    ,a.AuthorID as UserID
                                    ,ad.Address
                                    ,ad.InvoiceUnit
                                    ,ad.Tel
                                    ,ad.Mobile
                                    ,b.PKID as ReadingFeeID
                                    ,b.Status as ReadingFeeStatus
                                    ,b.Amount as ReadingFee
                                    ,a.Title
                                    ,d.CAuthorID as AuthorID
                                    ,d.AuthorName
                                    ,d.WorkUnit
                                    ,a.AddDate
                                    ,a.Year
                                    ,a.Issue
                              FROM dbo.ContributionInfo a with(nolock)
                              LEFT JOIN  (select distinct (AuthorID),JournalID, Address,InvoiceUnit,Tel,Mobile  from  dbo.AuthorDetail  ) as  ad  ON a.AuthorID=ad.AuthorID AND a.JournalID=ad.JournalID
                              LEFT JOIN dbo.FinanceContribute b  ON a.JournalID=b.JournalID and a.CID=b.CID and b.FeeType=2
                              INNER JOIN dbo.ContributionAuthor d  ON a.JournalID=d.JouranalID and a.CID=d.CID and d.IsCommunication=1
                              WHERE [email protected] AND (a.Status<>-999 or a.Status=0 ) AND a.Year>0 AND a.Issue>0  ");
            int recordCount = 0;
            List<SqlParameter> listParameters = new List<SqlParameter>();
            SqlParameter pJournalID = new SqlParameter("@JournalID", SqlDbType.BigInt);
            pJournalID.Value = query.JournalID;
            listParameters.Add(pJournalID);

            if (!string.IsNullOrWhiteSpace(query.CNumber))
            {
                strSql.Append(" AND a.CNumber LIKE '%" + query.CNumber + "%'");
            }

            query.Title = SecurityUtils.SafeSqlString(query.Title);

            if (!string.IsNullOrWhiteSpace(query.Title))
            {
                strSql.Append(" AND a.Title LIKE '%" + query.Title + "%'");
            }

            if (query.Year > 0)
            {
                strSql.Append(" AND a.Year=" + query.Year);
            }

            if (query.Issue > 0)
            {
                strSql.Append(" AND a.Issue=" + query.Issue);
            }

            // 投稿日期
            if (query.StartDate != null)
            {
                strSql.Append(" AND a.AddDate>='").Append(query.StartDate.Value.Date).Append("'");
            }
            if (query.EndDate != null)
            {
                strSql.Append(" AND a.AddDate<'").Append(query.EndDate.Value.AddDays(1).Date).Append("'");
            }
            DataSet ds = new DataSet();
            if (query.IsReport)
            {
                DbCommand cmd = db.GetSqlStringCommand(strSql.ToString());
                foreach (SqlParameter para in listParameters)
                {
                    db.AddInParameter(cmd, para.ParameterName, para.DbType, para.Value);
                }
                ds = db.ExecuteDataSet(cmd);
            }
            else
            {
                ds = db.PageingQuery(query.CurrentPage, query.PageSize, strSql.ToString(), "a.CNumber DESC", listParameters.ToArray(), ref recordCount);
            }
            Pager<FinanceAccountEntity> pager = new Pager<FinanceAccountEntity>();
            if (ds != null && ds.Tables.Count > 0)
            {
                List<FinanceAccountEntity> list = new List<FinanceAccountEntity>();
                if (ds != null)
                {
                    FinanceAccountEntity model = null;
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        model = new FinanceAccountEntity();
                        model.CID = dr.GetDataRowValue<Int64>("CID");
                        model.CNumber = dr.GetDataRowValue<String>("CNumber");
                        model.UserID = dr.GetDataRowValue<Int64>("UserID");
                        model.Address = dr.GetDataRowValue<String>("Address");
                        model.Tel = dr.GetDataRowValue<String>("Tel");
                        model.Mobile = dr.GetDataRowValue<String>("Mobile");
                        model.InvoiceUnit = dr.GetDataRowValue<String>("InvoiceUnit");
                        model.ReadingFeeID = dr.GetDataRowValue<Int64>("ReadingFeeID");
                        model.ReadingFeeStatus = dr.GetDataRowValue<Byte?>("ReadingFeeStatus");
                        model.LayoutFee = dr.GetDataRowValue<Decimal>("ReadingFee");
                        model.Title = dr.GetDataRowValue<String>("Title");
                        model.AuthorID = dr.GetDataRowValue<Int64>("AuthorID");
                        model.FirstAuthor = dr.GetDataRowValue<String>("AuthorName");
                        model.CommunicationAuthor = dr.GetDataRowValue<String>("AuthorName");
                        model.AddDate = dr.GetDataRowValue<DateTime>("AddDate");
                        model.Year = dr.IsNull("Year") ? 0 : TypeParse.ToInt(dr["Year"]);
                        model.Issue = dr.IsNull("Issue") ? 0 : TypeParse.ToInt(dr["Issue"]);
                        list.Add(model);
                    }
                }
                pager.ItemList = list;
            }
            pager.CurrentPage = query.CurrentPage;
            pager.PageSize = query.PageSize;
            pager.TotalRecords = recordCount;
            return pager;
        }
        /// <summary>
        /// 获取财务入款通知分页列表
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        public Pager<FinanceAccountEntity> GetFinanceInAccountPageList(ContributionInfoQuery query)
        {
            string orderby = "a.CID DESC";
            if (query.OrderStr != null)
            {
                orderby = "a.CID " + query.OrderStr + " | t.CID " + query.OrderStr + "";
            }

            StringBuilder strSql = null;
            strSql = new StringBuilder(@"
                              SELECT
                                    a.CID
                                    ,a.CNumber
                                    ,a.AuthorID as UserID
                                    ,ad.Address
                                    ,ad.InvoiceUnit
                                    ,ad.Tel
                                    ,ad.Mobile
                                    ,ad.ZipCode
                                    ,e.NoticeID as ReadingFeeNotice
                                    ,f.NoticeID as LayoutFeeNotice
                                    ,b.PKID as ReadingFeeID
                                    ,b.Status as ReadingFeeStatus
                                    ,b.Amount as ReadingFee
                                    ,b.Note
                                    ,c.PKID as LayoutFeeID
                                    ,c.Status as LayoutFeeStatus
                                    ,c.Amount as LayoutFee
                                    ,c.Note as PageNote
                                    ,a.Title
                                    ,dbo.fn_GetContributionCurrentEditor(a.JournalID,a.CID) as EditAuthorID
                                    ,dd.CAuthorID as FirstAuthorID
                                    ,dd.AuthorName as FirstAuthorName
                                    ,d.CAuthorID as CommunicationAuthorID
                                    ,d.AuthorName as CommunicationAuthorName
                                    ,a.AddDate
                                    ,a.Flag
                              FROM dbo.ContributionInfo a with(nolock)
                              LEFT JOIN  (select distinct (AuthorID),JournalID, Address,InvoiceUnit,Tel,Mobile,ZipCode  from  dbo.AuthorDetail  ) as  ad  ON a.AuthorID=ad.AuthorID AND a.JournalID=ad.JournalID
                              LEFT JOIN dbo.FinanceContribute b  ON a.JournalID=b.JournalID and a.CID=b.CID and b.FeeType=1
                              LEFT JOIN dbo.FinanceContribute c  ON a.JournalID=c.JournalID and a.CID=c.CID and c.FeeType=2
                              INNER JOIN dbo.ContributionAuthor d  ON a.JournalID=d.JouranalID and a.CID=d.CID and d.IsCommunication=1
                              INNER JOIN dbo.ContributionAuthor dd  ON a.JournalID=dd.JouranalID and a.CID=dd.CID and dd.IsFirst=1
                              LEFT JOIN dbo.PayNotice e  ON a.JournalID=e.JournalID and a.CID=e.CID and e.PayType=1
                              LEFT JOIN dbo.PayNotice f  ON a.JournalID=f.JournalID and a.CID=f.CID and f.PayType=2
                              WHERE [email protected] AND (a.Status<>-999 or a.Status=0 ) ");

            int recordCount = 0;
            List<SqlParameter> listParameters = new List<SqlParameter>();
            SqlParameter pJournalID = new SqlParameter("@JournalID", SqlDbType.BigInt);
            pJournalID.Value = query.JournalID;
            listParameters.Add(pJournalID);
            if (query.AuthorID != null)
            {
                SqlParameter pAuthorID = new SqlParameter("@AuthorID", SqlDbType.BigInt);
                pAuthorID.Value = query.AuthorID.Value;
                listParameters.Add(pAuthorID);
                strSql.Append(" AND [email protected]");
            }

            if (!string.IsNullOrWhiteSpace(query.CNumber))
            {
                strSql.Append(" AND a.CNumber LIKE '%" + query.CNumber + "%'");
            }
            if (query.SubjectCat != null)
            {
                strSql.Append(" AND  a.SubjectCat LIKE '%" + query.SubjectCat + "%'");
            }
            query.Title = SecurityUtils.SafeSqlString(query.Title);

            if (!string.IsNullOrWhiteSpace(query.Title))
            {
                strSql.Append(" AND a.Title LIKE '%" + query.Title + "%'");
            }
            query.Keyword = SecurityUtils.SafeSqlString(query.Keyword);
            if (!string.IsNullOrWhiteSpace(query.Keyword))
            {
                strSql.Append(" AND a.Keywords LIKE '%" + query.Keyword + "%'");
            }
            if (!string.IsNullOrWhiteSpace(query.Flag))
            {
                SqlParameter pFlag = new SqlParameter("@Flag", SqlDbType.VarChar, 20);
                pFlag.Value = SecurityUtils.SafeSqlString(query.Flag);
                listParameters.Add(pFlag);
                strSql.Append(" AND [email protected]");
            }
            // 第一作者
            if (!string.IsNullOrWhiteSpace(query.FirstAuthor))
            {
                SqlParameter PFirst = new SqlParameter("@AuthorName", SqlDbType.VarChar, 50);
                PFirst.Value = SecurityUtils.SafeSqlString(query.FirstAuthor);
                listParameters.Add(PFirst);
                strSql.Append(" AND dd.AuthorName = @AuthorName");
            }
            // 通信作者
            if (!string.IsNullOrWhiteSpace(query.CommunicationAuthor))
            {
                SqlParameter PCommunication = new SqlParameter("@AuthorName", SqlDbType.VarChar, 50);
                PCommunication.Value = SecurityUtils.SafeSqlString(query.CommunicationAuthor);
                listParameters.Add(PCommunication);
                strSql.Append(" AND d.AuthorName = @AuthorName");
            }
            // 投稿日期
            if (query.StartDate != null)
            {
                strSql.Append(" AND a.AddDate>='").Append(query.StartDate.Value.Date).Append("'");
            }
            if (query.EndDate != null)
            {
                strSql.Append(" AND a.AddDate<'").Append(query.EndDate.Value.AddDays(1).Date).Append("'");
            }

            // 录用年期
            if (query.Year != null)
            {
                strSql.Append(" AND a.Year='").Append(query.Year).Append("'");
            }
            if (query.Issue != null)
            {
                strSql.Append(" AND a.Issue='").Append(query.Issue).Append("'");
            }

            DataSet ds = new DataSet();
            if (query.IsReport)
            {
                DbCommand cmd = db.GetSqlStringCommand(strSql.ToString());
                foreach (SqlParameter para in listParameters)
                {
                    db.AddInParameter(cmd, para.ParameterName, para.DbType, para.Value);
                }
                ds = db.ExecuteDataSet(cmd);
            }
            else
            {
                ds = db.PageingQuery(query.CurrentPage, query.PageSize, strSql.ToString(), orderby, listParameters.ToArray(), ref recordCount);
            }
            Pager<FinanceAccountEntity> pager = new Pager<FinanceAccountEntity>();
            if (ds != null && ds.Tables.Count > 0)
            {
                List<FinanceAccountEntity> list = new List<FinanceAccountEntity>();
                if (ds != null)
                {
                    FinanceAccountEntity model = null;
                    foreach (DataRow dr in ds.Tables[0].Rows)
                    {
                        model = new FinanceAccountEntity();
                        model.CID = dr.GetDataRowValue<Int64>("CID");
                        model.CNumber = dr.GetDataRowValue<String>("CNumber");
                        model.UserID = dr.GetDataRowValue<Int64>("UserID");
                        model.Address = dr.GetDataRowValue<String>("Address");
                        model.Tel = dr.GetDataRowValue<String>("Tel");
                        model.Mobile = dr.GetDataRowValue<String>("Mobile");
                        model.ZipCode = dr.GetDataRowValue<String>("ZipCode");
                        model.InvoiceUnit = dr.GetDataRowValue<String>("InvoiceUnit");
                        model.ReadingFeeNotice = dr.GetDataRowValue<Int64>("ReadingFeeNotice");
                        model.ReadingFeeNoticeStatus = dr.GetDataRowValue<Int64>("ReadingFeeNotice") == 0 ? "未通知" : "已通知";
                        model.LayoutFeeNoticeStatus = dr.GetDataRowValue<Int64>("LayoutFeeNotice") == 0 ? "未通知" : "已通知";
                        model.LayoutFeeNotice = dr.GetDataRowValue<Int64>("LayoutFeeNotice");
                        model.ReadingFeeID = dr.GetDataRowValue<Int64>("ReadingFeeID");
                        model.ReadingFeeStatus = dr.GetDataRowValue<Byte?>("ReadingFeeStatus");
                        model.ReadingFee = dr.GetDataRowValue<Decimal>("ReadingFee");
                        model.Note = dr.GetDataRowValue<String>("Note");
                        model.LayoutFeeID = dr.GetDataRowValue<Int64>("LayoutFeeID");
                        model.LayoutFeeStatus = dr.GetDataRowValue<Byte?>("LayoutFeeStatus");
                        model.LayoutFee = dr.GetDataRowValue<Decimal>("LayoutFee");
                        model.PageNote = dr.GetDataRowValue<String>("PageNote");
                        model.Title = dr.GetDataRowValue<String>("Title");
                        model.EditAuthorID = dr.GetDataRowValue<Int64>("EditAuthorID");
                        model.FirstAuthorID = dr.GetDataRowValue<Int64>("FirstAuthorID");
                        model.AuthorID = dr.GetDataRowValue<Int64>("UserID");
                        model.FirstAuthor = dr.GetDataRowValue<String>("FirstAuthorName");
                        model.CommunicationAuthorID = dr.GetDataRowValue<Int64>("CommunicationAuthorID");
                        model.CommunicationAuthor = dr.GetDataRowValue<String>("CommunicationAuthorName");
                        model.AddDate = dr.GetDataRowValue<DateTime>("AddDate");
                        model.Flag = dr.GetDataRowValue<String>("Flag");
                        list.Add(model);
                    }
                }
                pager.ItemList = list;
            }
            pager.CurrentPage = query.CurrentPage;
            pager.PageSize = query.PageSize;
            pager.TotalRecords = recordCount;
            return pager;
        }
 /// <summary>
 /// 获取稿件的附件
 /// </summary>
 /// <param name="cQuery">稿件ID</param>
 /// <returns></returns>
 public string GetContributionAttachment(ContributionInfoQuery cQuery)
 {
     return ContributionInfoDataAccess.Instance.GetContributionAttachment(cQuery);
 }
 /// <summary>
 /// 获取稿件作者数据字典
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public IDictionary<Int64, String> GetContributionAuthorDict(ContributionInfoQuery query)
 {
     return ContributionInfoDataAccess.Instance.GetContributionAuthorDict(query);
 }
 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") });
 }
 /// <summary>
 /// 更新稿件状态及审核状态
 /// </summary>        
 /// <param name="cEntity">稿件信息</param>
 /// <returns></returns>
 public bool UpdateContributionStatus(ContributionInfoQuery cEntity)
 {
     return ContributionInfoDataAccess.Instance.UpdateContributionStatus(cEntity);
 }
 public ActionResult GetFinanceOutAccountPageList(ContributionInfoQuery query)
 {
     IFinanceFacadeAPIService service = ServiceContainer.Instance.Container.Resolve<IFinanceFacadeAPIService>();
     query.JournalID = CurAuthor.JournalID;
     query.Year = Convert.ToInt32(query.Year) == 0 ? -1 : query.Year;
     query.Issue = Convert.ToInt32(query.Issue) == 0 ? -1 : query.Issue;
     query.CurrentPage = Convert.ToInt32(Request.Params["page"]);
     query.PageSize = Convert.ToInt32(Request.Params["pagesize"]);
     Pager<FinanceAccountEntity> pager = service.GetFinanceAccountPageList(query);
     return Json(new { Rows = pager.ItemList, Total = pager.TotalRecords });
 }
    private void GetFilePath()
    {
        // 根据稿件ID或者流程日志ID得到稿件路径
            long CIDParam = 0;
            if (!string.IsNullOrEmpty(Request.QueryString["CID"]))
            {
                CIDParam = TypeParse.ToLong(Request.QueryString["CID"], 0);
            }
            // 日志ID
            long FlowLogID = 0;
            if (!string.IsNullOrEmpty(Request.QueryString["FlowID"]))
            {
                FlowLogID = TypeParse.ToLong(Request.QueryString["FlowID"], 0);
            }

            if (CIDParam > 0)
            {
                IContributionFacadeService cService = ServiceContainer.Instance.Container.Resolve<IContributionFacadeService>();
                // 得到稿件路径
                ContributionInfoQuery cQuery = new ContributionInfoQuery();
                cQuery.JournalID = SiteConfig.SiteID;
                cQuery.CID = CIDParam;
                _filePath = cService.GetContributionAttachment(cQuery);
            }
            else if (FlowLogID > 0)
            {
                IFlowFacadeService flowService = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>();
                // 附件路径
                FlowLogQuery logQuery = new FlowLogQuery();
                logQuery.JournalID = SiteConfig.SiteID;
                logQuery.FlowLogID = FlowLogID;
                _filePath = flowService.GetFlowLogAttachment(logQuery);
            }

            if (!string.IsNullOrEmpty(Request.QueryString["fileName"]))
            {
                _fileName = Request.QueryString["fileName"];
            }
            else
            {
                _fileName = "在线审阅稿件";
            }
    }
        /// <summary>
        /// 提交审稿单
        /// </summary>
        /// <param name="auditBillEntity"></param>
        /// <returns></returns>
        public bool SubmitAuditBill(AuditBillEntity auditBillEntity)
        {
            bool flag = false;

            // 得到审稿操作信息
            FlowActionQuery actionQuery = new FlowActionQuery();
            actionQuery.ActionID = auditBillEntity.ActionID;
            actionQuery.JournalID = auditBillEntity.JournalID;
            FlowActionEntity actionEntity = new FlowActionService().GetFlowActionEntity(actionQuery);

            // 得到审稿状态及配置信息
            FlowStatusQuery flowStatusQuery = new FlowStatusQuery();
            flowStatusQuery.JournalID = auditBillEntity.JournalID;
            flowStatusQuery.StatusID = actionEntity == null ? 0 : actionEntity.StatusID;
            FlowStep flowStep = new FlowStatusService().GetFlowStep(flowStatusQuery);

            //得到稿件信息
            ContributionInfoEntity contributionInfoEntity = new ContributionInfoEntity();
            ContributionInfoQuery query = new ContributionInfoQuery();
            query.JournalID = auditBillEntity.JournalID;
            query.CID = auditBillEntity.CID;
            ContributionInfoService service = new ContributionInfoService();
            contributionInfoEntity=service.GetContributionInfo(query);

            if (contributionInfoEntity.AuthorID == Convert.ToInt64(auditBillEntity.ReveiverList.Split(',')[0]))
            {
                auditBillEntity.ReveiverList = contributionInfoEntity.AuthorID.ToString();
                flag = FlowCirculationBusProvider.ProcessFlowCirulation(auditBillEntity);
            }
            else
                flag = FlowCirculationBusProvider.ProcessFlowCirulation(auditBillEntity);

            if (flag)
            {
                if (flowStep.FlowConfig != null)
                {
                    if (flowStep.FlowConfig.IsEmailRemind)
                    {
                        /// TODO:记录定期发送邮件的任务
                    }

                    if (flowStep.FlowConfig.IsSMSRemind)
                    {
                        /// TODO:记录定期发送短信的任务
                    }
                }
            }
            return flag;
        }
 public ActionResult GetContributionAuthorListAjax(ContributionInfoQuery query)
 {
     query.JournalID = CurAuthor.JournalID;
     query.IsAuxiliary = true;
     IAuthorPlatformFacadeService service = ServiceContainer.Instance.Container.Resolve<IAuthorPlatformFacadeService>();
     IList<ContributionInfoEntity> list = service.GetContributionInfoList(query);
     return Json(list);
 }
 public Pager<FinanceAccountEntity> GetFinanceOutAccountPageList(ContributionInfoQuery query)
 {
     IFinanceContributeService service = ServiceContainer.Instance.Container.Resolve<IFinanceContributeService>();
     return service.GetFinanceOutAccountPageList(query);
 }
 public ActionResult GetPageList(ContributionInfoQuery query)
 {
     IAuthorPlatformFacadeService service = ServiceContainer.Instance.Container.Resolve<IAuthorPlatformFacadeService>();
     query.JournalID = CurAuthor.JournalID;
     query.AuthorID = CurAuthor.AuthorID;
     query.CurrentPage = Convert.ToInt32(Request.Params["page"]);
     query.PageSize = Convert.ToInt32(Request.Params["pagesize"]);
     query.OrderStr = " AddDate desc";
     Pager<ContributionInfoEntity> pager = service.GetContributionInfoPageList(query);
     return Json(new { Rows = pager.ItemList, Total = pager.TotalRecords });
 }
 /// <summary>
 /// 撤销删除
 /// </summary>
 /// <param name="cEntity"></param>
 /// <returns></returns>
 public bool CancelDelete(ContributionInfoQuery cEntity)
 {
     return ContributionInfoDataAccess.Instance.CancelDelete(cEntity);
 }
        public ActionResult SaveToWord(string cNumber, string title, string year, string issue, string startDate, string endDate, string fileName)
        {
            StringBuilder sb = new StringBuilder();
            ContributionInfoQuery query = new ContributionInfoQuery();
            query.JournalID = CurAuthor.JournalID;
            query.IsAuxiliary = true;
            query.CNumber = cNumber;
            query.Title = title;
            if (year == "")
                query.Year = null;
            else
                query.Year = int.Parse(year);
            if (issue == "")
                query.Issue = null;
            else
                query.Issue = int.Parse(issue);
            if (startDate == "")
                query.StartDate = null;
            else
                query.StartDate = Convert.ToDateTime(startDate);
            if (endDate == "")
                query.EndDate = null;
            else
                query.EndDate = Convert.ToDateTime(endDate);
            IAuthorPlatformFacadeService service = ServiceContainer.Instance.Container.Resolve<IAuthorPlatformFacadeService>();
            IList<ContributionInfoEntity> list = service.GetContributionInfoList(query);
            sb.Append("<div id=\"divWorkloadList\" style=\"margin-left:10px;width:1100px;float:left;\">");

            for (int i = 0; i < list.Count; i++)
            {
                for (int j = 0; j < list[i].AuthorList.Count;j++ )
                {
                    sb.Append("<table border=\"0\" bgcolor=\"#ffffff\" cellpadding=\"4\" cellspacing=\"0\" style=\"border: solid 1px #333; float:left; margin-right:10px; margin-bottom:10px;width:450px;height:20px;font-size:12px;\">");
                    sb.Append("<tr><td height=\"25\">" + list[i].AuthorList[j].ZipCode + "</td></tr>");
                    sb.Append("<tr><td height=\"25\">&nbsp;&nbsp;邮:" + list[i].AuthorList[j].Address + "</td></tr>");
                    sb.Append("<tr><td height=\"30\">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + list[i].AuthorList[j].AuthorName + "(收)</td></tr>");
                    sb.Append("<tr><td height=\"30\" align=\"right\">北京市天坛西里2号《药物分析杂志》编辑部 邮编:100050 &nbsp;&nbsp;&nbsp;&nbsp;</td></tr>");
                    sb.Append("</table>");
                }
            }

            sb.Append("</div>");
            RenderToWord.HtmlToWord(Server.UrlDecode(sb.ToString()), "123.doc", true);
            return Content("导出成功!");
        }
 /// <summary>
 /// 改变稿件状态
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public bool ChangeStatus(ContributionInfoQuery query)
 {
     return ContributionInfoDataAccess.Instance.ChangeStatus(query);
 }
Exemple #29
0
        public XmlDocument GetMagazineDoc(string strManuId, string strUserID, string strSafetyCode)
        {
            docs rootDoc = new docs();
            docmodel docEntity = new docmodel();
            try
            {
                // 验证令牌正确性
                TokenQuery tokenQuery = new TokenQuery();
                tokenQuery.JournalID = TypeParse.ToLong(strUserID,0);
                tokenQuery.AuthorID = 0;
                tokenQuery.Token = strSafetyCode;
                tokenQuery.ExpireDate = DateTime.Now.AddDays(-7);
                IAuthorFacadeService authorService = ServiceContainer.Instance.Container.Resolve<IAuthorFacadeService>();
                TokenEntity tokenEntity = authorService.GetToken(tokenQuery);

                if (tokenEntity != null)
                {
                    IAuthorPlatformFacadeService cService = ServiceContainer.Instance.Container.Resolve<IAuthorPlatformFacadeService>();
                    // 得到稿件路径
                    ContributionInfoQuery cQuery = new ContributionInfoQuery();
                    cQuery.JournalID = SiteConfig.SiteID;
                    cQuery.CID = TypeParse.ToLong(strManuId);
                    ContributionInfoEntity cEntity = cService.GetContributionInfoModel(cQuery);
                    if (cEntity != null)
                    {
                        docEntity.title = cEntity.Title;
                        docEntity.manuid = cEntity.CID.ToString();
                        docEntity.name = SiteConfig.SiteName;
                        docEntity.state = "true";
                        docEntity.author = new authorentity { chinesename = "", englishname = "" };
                        docEntity.url = "http://" + Utils.GetHost() + SiteConfig.RootPath + "/Plugins/Download.aspx?CID=" + cEntity.CID;
                    }
                    else
                    {
                        docEntity.title = "对不起,没有该稿件信息";
                        docEntity.manuid = "0";
                        docEntity.name = SiteConfig.SiteName;
                        docEntity.state = "false";
                        docEntity.url = "";
                    }
                }
                else
                {
                    docEntity.title = "安全码无效,请检查";
                    docEntity.manuid = "0";
                    docEntity.name = "";
                    docEntity.state = "false";
                    docEntity.url = "";
                }
                docEntity.author = new authorentity { chinesename = "", englishname = "" };
                docEntity.date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
                rootDoc.doc = docEntity;
            }
            catch (Exception ex)
            {
                LogProvider.Instance.Error("方正获取稿件信息出现异常:" + ex.Message);
            }

            string retrun = XmlUtils.Serialize(rootDoc);
            XmlDocument  xd=new XmlDocument ();
            XmlDeclaration xmldecl;
            xmldecl = xd.CreateXmlDeclaration("1.0","utf-8", null);
            XmlElement root = xd.DocumentElement;
            xd.InsertBefore(xmldecl, root);
            xd.LoadXml(retrun);
            return xd;
        }
 /// <summary>
 /// 处理撤稿申请
 /// </summary>        
 /// <param name="cEntity">稿件信息</param>
 /// <returns></returns>
 public bool DealWithdrawal(ContributionInfoQuery cEntity)
 {
     return ContributionInfoDataAccess.Instance.DealWithdrawal(cEntity);
 }