コード例 #1
0
        /// <summary>
        /// 获取退稿
        /// </summary>
        private IList <FlowContribution> GetContributionReturnList()
        {
            IFlowFacadeService service   = ServiceContainer.Instance.Container.Resolve <IFlowFacadeService>();
            CirculationEntity  cirEntity = new CirculationEntity();

            cirEntity.JournalID   = JournalID;
            cirEntity.CStatus     = -100;
            cirEntity.CurrentPage = 1;
            cirEntity.PageSize    = TypeParse.ToInt(Request.Params["pagesize"], 100000);
            Pager <FlowContribution> pager = new Pager <FlowContribution>();

            try
            {
                pager = service.GetFlowContributionList(cirEntity);
            }
            catch (Exception ex)
            {
                WKT.Log.LogProvider.Instance.Error("获取退稿导出数据出现异常:" + ex.Message);
            }
            if (pager != null)
            {
                return(pager.ItemList);
            }
            else
            {
                return(new List <FlowContribution>());
            }
        }
コード例 #2
0
        /// <summary>
        /// 获取接收人信息
        /// </summary>
        /// <param name="CID"></param>
        /// <param name="Status"></param>
        /// <returns></returns>
        private AuthorInfoEntity GetAuthorInfo(Int64 CID, Int32 Status)
        {
            IFlowFacadeService service = ServiceContainer.Instance.Container.Resolve <IFlowFacadeService>();
            CirculationEntity  query   = new CirculationEntity();

            query.JournalID = CurAuthor.JournalID;
            query.CID       = CID;
            if (Status == 0)
            {
                query.EnumCStatus = EnumContributionStatus.New;
            }
            else if (Status == 200)
            {
                query.EnumCStatus = EnumContributionStatus.Employment;
            }
            else if (Status == 100)
            {
                query.EnumCStatus = EnumContributionStatus.Proof;
            }
            else if (Status == -3)
            {
                query.EnumCStatus = EnumContributionStatus.Retreat;
            }
            var model = service.GetContributionProcesser(query);

            return(model);
        }
コード例 #3
0
ファイル: FinanceController.cs プロジェクト: zz110/WKT2015
        public ActionResult FContributeSave(FinanceContributeEntity model)
        {
            IFinanceFacadeAPIService service = ServiceContainer.Instance.Container.Resolve <IFinanceFacadeAPIService>();

            model.JournalID = CurAuthor.JournalID;
            model.InUser    = CurAuthor.AuthorID;
            model.IsSystem  = CurAuthor.GroupID == 1;
            if (model.PKID == 0)
            {
                #region 改变稿件状态 为已经交费
                ISiteConfigFacadeService facadeService    = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>();
                IList <DictValueEntity>  dicteEntity      = null;
                IList <DictValueEntity>  noticDicteEntity = null;
                if (model.FeeType == 1)
                {
                    noticDicteEntity = facadeService.GetDictValueList(new DictValueQuery()
                    {
                        JournalID = CurAuthor.JournalID, DictKey = "PayNotice"
                    });
                    dicteEntity = facadeService.GetDictValueList(new DictValueQuery()
                    {
                        JournalID = CurAuthor.JournalID, DictKey = "Payed"
                    });
                }
                else
                {
                    noticDicteEntity = facadeService.GetDictValueList(new DictValueQuery()
                    {
                        JournalID = CurAuthor.JournalID, DictKey = "PayPageNotice"
                    });
                    dicteEntity = facadeService.GetDictValueList(new DictValueQuery()
                    {
                        JournalID = CurAuthor.JournalID, DictKey = "PagePayed"
                    });
                }
                if (dicteEntity != null && dicteEntity.Count > 0 && noticDicteEntity != null && noticDicteEntity.Count > 0)
                {
                    ISiteConfigFacadeService currentService = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>();
                    CirculationEntity        cirEntity      = new CirculationEntity();
                    cirEntity.JournalID  = CurAuthor.JournalID;
                    cirEntity.SendUserID = CurAuthor.AuthorID;
                    cirEntity.CID        = model.CID;
                    cirEntity.StatusID   = noticDicteEntity.FirstOrDefault <DictValueEntity>().ValueID;
                    cirEntity.ToStatusID = dicteEntity.FirstOrDefault <DictValueEntity>().ValueID;

                    IFlowFacadeService flowService = ServiceContainer.Instance.Container.Resolve <IFlowFacadeService>();
                    flowService.DealFinaceInAccount(cirEntity);
                }

                #endregion
            }
            ExecResult result = service.SaveFinanceContribute(model);

            return(Json(new { result = result.result, msg = result.msg }));
        }
コード例 #4
0
 /// <summary>
 /// 根据当前所处环节获取稿件列表
 /// </summary>
 /// <param name="cirEntity"></param>
 /// <returns></returns>
 public Pager <FlowContribution> GetFlowContributionList(CirculationEntity cirEntity)
 {
     if (cirEntity.CStatus == null)// 获取正常的稿件处理列表
     {
         return(FlowCirculationDataAccess.Instance.GetFlowContributionList(cirEntity));
     }
     else
     {
         // 获取指定状态的稿件列表,例如:退稿
         return(FlowCirculationDataAccess.Instance.GetStatusContributionList(cirEntity));
     }
 }
コード例 #5
0
ファイル: ExpertStatController.cs プロジェクト: zz110/WKT2015
        public ActionResult GetEditorContributionListAjax(CirculationEntity cirEntity)
        {
            IFlowFacadeService service = ServiceContainer.Instance.Container.Resolve <IFlowFacadeService>();

            cirEntity.JournalID = JournalID;
            cirEntity.IsHandled = cirEntity.Status;
            int pageIndex = TypeParse.ToInt(Request.Params["page"], 1);

            cirEntity.CurrentPage = pageIndex;
            cirEntity.PageSize    = TypeParse.ToInt(Request.Params["pagesize"], 10);
            Pager <FlowContribution> pager = service.GetFlowContributionList(cirEntity);

            return(Json(new { Rows = pager.ItemList, Total = pager.TotalRecords }));
        }
コード例 #6
0
        /// <summary>
        /// 作者投稿后调用该方法进入审稿流程
        /// </summary>
        /// <returns></returns>
        public bool AuthorContribution(CirculationEntity cirEntity)
        {
            bool flag = false;
            bool isFirstContribute = FlowCirculationDataAccess.Instance.IsFirstContribute(cirEntity);

            if (isFirstContribute)
            {
                // 第一次投稿
                flag = FlowCirculationDataAccess.Instance.AuthorContribute(cirEntity);
            }
            else
            {
                flag = FlowCirculationDataAccess.Instance.ProcessDealBackContribution(cirEntity);
            }
            return(flag);
        }
コード例 #7
0
        /// <summary>
        /// 审稿相关数据处理
        /// </summary>
        /// <param name="model"></param>
        private void GetFlow(ContributionInfoEntity model, EnumContributionStatus enumStatus)
        {
            FlowCirculationBusiness business = new FlowCirculationBusiness();
            CirculationEntity       item     = new CirculationEntity();

            item.CID               = model.CID;
            item.AuthorID          = model.AuthorID;
            item.CNumber           = model.CNumber;
            item.JournalID         = model.JournalID;
            item.SubjectCategoryID = model.SubjectCat;
            item.EnumCStatus       = enumStatus;
            item.CPath             = model.ContributePath;
            item.FigurePath        = model.FigurePath;
            item.OtherPath         = model.IntroLetterPath;
            business.AuthorContribution(item);
        }
コード例 #8
0
        /// <summary>
        /// 获取稿件的处理日志
        /// </summary>
        /// <param name="cirEntity">稿件ID,JournalID,分组</param>
        /// <returns></returns>
        public IList <FlowLogInfoEntity> GetFlowLog(CirculationEntity cirEntity)
        {
            IList <FlowLogInfoEntity> listFlowLog = FlowCirculationDataAccess.Instance.GetFlowLog(cirEntity);
            long TempUserID = 0;

            foreach (FlowLogInfoEntity item in listFlowLog)
            {
                // 如果是原路返回
                if (item.ActionType == 2)
                {
                    TempUserID      = item.SendUserID;
                    item.SendUserID = item.RecUserID;
                    item.RecUserID  = TempUserID;
                }
            }
            return(listFlowLog);
        }
コード例 #9
0
ファイル: HomeController.cs プロジェクト: zz110/WKT2015
        public ActionResult GetContributionList(long SiteID, string EMail)
        {
            string contributions = string.Empty;

            //根据邮箱获取作者实体-得到作者ID
            IAuthorFacadeService authorService = ServiceContainer.Instance.Container.Resolve <IAuthorFacadeService>();
            AuthorInfoQuery      query         = new AuthorInfoQuery();

            query.LoginName = EMail;
            query.JournalID = SiteID;
            query.GroupID   = (int)EnumMemberGroup.Author;
            AuthorInfoEntity authorInfoEntity = authorService.GetAuthorInfo(query);

            //获取作者最新状态的稿件列表
            IFlowFacadeService flowService = ServiceContainer.Instance.Container.Resolve <IFlowFacadeService>();
            CirculationEntity  cirEntity   = new CirculationEntity();

            cirEntity.JournalID   = SiteID;
            cirEntity.CurAuthorID = authorInfoEntity.AuthorID;
            //int pageIndex = TypeParse.ToInt(Request.Params["page"], 1);
            cirEntity.CurrentPage = 1;
            cirEntity.PageSize    = TypeParse.ToInt(Request.Params["pagesize"], 100);
            Pager <FlowContribution> pager = flowService.GetAuthorContributionList(cirEntity);

            if (pager.ItemList.Count == 0)
            {
                return(base.Json(new { code = "1000002", msg = "没有查询到符合条件的数据。" }, JsonRequestBehavior.AllowGet));//没有稿件数据
            }
            else if (pager.ItemList.Count == 1)
            {
                return(base.Json(new { code = "1000003", msg = "查询到1条符合条件的数据。" }, JsonRequestBehavior.AllowGet));
            }
            else
            {
                contributions += "[";
                for (int i = 0; i < pager.ItemList.Count; i++)
                {
                    contributions += "{\"Title\":\"" + pager.ItemList[i].Title + "\",\"AuthorName\":\"" + pager.ItemList[i].AuthorName + "\",\"AuditStatus\":\"" + pager.ItemList[i].AuditStatus + "\",\"AddDate\":\"" + pager.ItemList[i].AddDate + "\"},";
                }
                contributions.Remove(contributions.LastIndexOf(','), 1);
                contributions += "]";
                return(base.Json(new { code = "1000004", msg = "查询到" + pager.ItemList.Count + "条符合条件的数据。", Contributions = contributions }, JsonRequestBehavior.AllowGet));
            }
        }
コード例 #10
0
 /// <summary>
 /// 得到下一步骤信息
 /// </summary>
 /// <param name="ciEntity">流转信息</param>
 /// <returns></returns>
 public FlowStep GetNextFlowStep(CirculationEntity cirEntity)
 {
     return(FlowCirculationDataAccess.Instance.GetNextFlowStep(cirEntity));
 }
コード例 #11
0
 /// <summary>
 /// 得到稿件的处理人
 /// </summary>
 /// <param name="cirEntity">稿件ID(CID)、稿件状态(EnumCStatus)、编辑部ID(JournalID)</param>
 /// <returns></returns>
 public AuthorInfoEntity GetContributionProcesser(CirculationEntity cirEntity)
 {
     return(FlowCirculationBusProvider.GetContributionProcesser(cirEntity));
 }
コード例 #12
0
 /// <summary>
 /// 获取作者最新稿件状态稿件列表
 /// </summary>
 /// <param name="cirEntity"></param>
 /// <returns></returns>
 public Pager <FlowContribution> GetAuthorContributionList(CirculationEntity cirEntity)
 {
     return(FlowCirculationDataAccess.Instance.GetAuthorContributionList(cirEntity));
 }
コード例 #13
0
 /// <summary>
 /// 获取作者最新稿件状态稿件列表
 /// </summary>
 /// <param name="cirEntity"></param>
 /// <returns></returns>
 public Pager <FlowContribution> GetAuthorContributionList(CirculationEntity cirEntity)
 {
     return(FlowCirculationBusProvider.GetAuthorContributionList(cirEntity));
 }
コード例 #14
0
 /// <summary>
 /// 得到稿件的处理人
 /// </summary>
 /// <param name="cirEntity">稿件ID(CID)、稿件状态(EnumCStatus)、编辑部ID(JournalID)</param>
 /// <returns></returns>
 public AuthorInfoEntity GetContributionProcesser(CirculationEntity cirEntity)
 {
     return(FlowCirculationDataAccess.Instance.GetContributionProcesser(cirEntity));
 }
コード例 #15
0
 /// <summary>
 /// 得到下一步骤信息
 /// </summary>
 /// <param name="ciEntity">流转信息</param>
 /// <returns></returns>
 public FlowStep GetNextFlowStep(CirculationEntity cirEntity)
 {
     return(FlowCirculationBusProvider.GetNextFlowStep(cirEntity));
 }
コード例 #16
0
 /// <summary>
 /// 获取同步状态稿件列表,例如:专家拒审,作者退修、已发校样、录用、退稿稿件列表
 /// </summary>
 /// <param name="cirEntity">需要传值:JournalID,CurAuthorID,EnumCStatus</param>
 /// <returns></returns>
 public Pager <FlowContribution> GetSynchroStatusContributionList(CirculationEntity cirEntity)
 {
     return(FlowCirculationBusProvider.GetSynchroStatusContributionList(cirEntity));
 }
コード例 #17
0
 /// <summary>
 /// 处理在入款时改变稿件状态
 /// </summary>
 /// <param name="auditBillEntity"></param>
 /// <returns></returns>
 public bool DealFinaceInAccount(CirculationEntity cirEntity)
 {
     return(FlowCirculationBusProvider.DealFinaceInAccount(cirEntity));
 }
コード例 #18
0
ファイル: FinanceController.cs プロジェクト: zz110/WKT2015
        public ActionResult SavePayNotice(PayNoticeEntity model)
        {
            IFinanceFacadeAPIService service = ServiceContainer.Instance.Container.Resolve <IFinanceFacadeAPIService>();

            model.JournalID = CurAuthor.JournalID;
            model.SendUser  = CurAuthor.AuthorID;
            model.Status    = 0;
            model.Body      = Server.UrlDecode(model.Body).Replace("${金额}$", model.Amount.ToString());
            if (model.NoticeID == 0)
            {
                #region 改变稿件状态  为 通知交审稿费

                int actionID = 0;
                ISiteConfigFacadeService facadeService = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>();
                DictEntity dicteEntity = null;
                if (model.PayType == 1)//审稿费
                {
                    dicteEntity = facadeService.GetDictModelByKey(new DictQuery()
                    {
                        JournalID = CurAuthor.JournalID, DictKey = "PayNotice"
                    });
                }
                else //版面费
                {
                    dicteEntity = facadeService.GetDictModelByKey(new DictQuery()
                    {
                        JournalID = CurAuthor.JournalID, DictKey = "PayPageNotice"
                    });
                }
                if (dicteEntity != null)
                {
                    ISiteConfigFacadeService currentService = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>();
                    IList <DictValueEntity>  list           = currentService.GetDictValueList(new DictValueQuery()
                    {
                        JournalID = CurAuthor.JournalID, DictKey = dicteEntity.DictKey
                    });
                    if (list != null && list.Count > 0)
                    {
                        DictValueEntity entity = list.Single <DictValueEntity>();
                        if (entity != null)
                        {
                            actionID = entity.ValueID;
                            #region 获取流程操作

                            FlowActionQuery actionQuery = new FlowActionQuery();
                            actionQuery.JournalID  = JournalID;
                            actionQuery.ToStatusID = actionID;
                            IFlowFacadeService       flowService      = ServiceContainer.Instance.Container.Resolve <IFlowFacadeService>();
                            IList <FlowActionEntity> actionEntityList = flowService.GetFlowActionList(actionQuery);
                            //long statusID = actionEntity != null ? actionEntity.StatusID : 0;

                            #endregion

                            #region 根据审稿状态获取  审稿流程日志ID

                            CirculationEntity cirQuery        = new CirculationEntity();
                            AuditBillEntity   auditBillEntity = new AuditBillEntity();
                            cirQuery.CID       = model.CID;
                            cirQuery.JournalID = JournalID;
                            cirQuery.GroupID   = 1;
                            IFlowFacadeService        flowInfoLogService = ServiceContainer.Instance.Container.Resolve <IFlowFacadeService>();
                            IList <FlowLogInfoEntity> flowLogEntityList  = flowInfoLogService.GetFlowLog(cirQuery);
                            FlowActionEntity          single             = null;
                            FlowLogInfoEntity         flowLogEntity      = null;
                            if (flowLogEntityList != null && flowLogEntityList.Count > 0)
                            {
                                auditBillEntity.ReveiverList = flowLogEntityList[flowLogEntityList.Count - 1].SendUserID.ToString();
                                flowLogEntity = flowLogEntityList.OrderByDescending(o => o.FlowLogID).Take(1).SingleOrDefault();
                                single        = actionEntityList.Where(o => o.StatusID == flowLogEntity.TargetStatusID).FirstOrDefault();
                            }

                            #endregion

                            IFlowFacadeService flowFacadeService = ServiceContainer.Instance.Container.Resolve <IFlowFacadeService>();

                            auditBillEntity.JournalID = JournalID;
                            auditBillEntity.Processer = CurAuthor.AuthorID;


                            if (single != null)
                            {
                                auditBillEntity.ActionID = single.ActionID;
                                auditBillEntity.StatusID = single.StatusID;
                            }
                            auditBillEntity.ActionType = 1;
                            auditBillEntity.CID        = model.CID;
                            if (flowLogEntity != null)
                            {
                                auditBillEntity.FlowLogID  = flowLogEntity.FlowLogID;
                                auditBillEntity.CPath      = "";
                                auditBillEntity.FigurePath = "";
                                auditBillEntity.OtherPath  = "";
                            }
                            flowFacadeService.SubmitAuditBill(auditBillEntity);
                        }
                    }
                }

                #endregion
            }
            ExecResult result = service.SavePayNotice(model);

            return(Json(new { result = result.result, msg = result.msg }));
        }
コード例 #19
0
ファイル: FinanceController.cs プロジェクト: zz110/WKT2015
        public ActionResult BatchSavePayNotice(PayNoticeEntity model)
        {
            IFinanceFacadeAPIService service = ServiceContainer.Instance.Container.Resolve <IFinanceFacadeAPIService>();
            IList <PayNoticeEntity>  list    = (IList <PayNoticeEntity>)TempData["list"];

            if (list != null && list.Count > 0)
            {
                #region 批量改变稿件状态  为 通知交审稿费
                int actionID = 0;
                ISiteConfigFacadeService facadeService = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>();
                DictEntity dicteEntity = null;
                if (model.PayType == 1)//审稿费
                {
                    dicteEntity = facadeService.GetDictModelByKey(new DictQuery()
                    {
                        JournalID = CurAuthor.JournalID, DictKey = "PayNotice"
                    });
                }
                else //版面费
                {
                    dicteEntity = facadeService.GetDictModelByKey(new DictQuery()
                    {
                        JournalID = CurAuthor.JournalID, DictKey = "PayPageNotice"
                    });
                }
                if (dicteEntity != null)
                {
                    ISiteConfigFacadeService currentService = ServiceContainer.Instance.Container.Resolve <ISiteConfigFacadeService>();
                    IList <DictValueEntity>  currentList    = currentService.GetDictValueList(new DictValueQuery()
                    {
                        JournalID = CurAuthor.JournalID, DictKey = dicteEntity.DictKey
                    });
                    if (currentList != null && currentList.Count > 0)
                    {
                        DictValueEntity entity = currentList.Single <DictValueEntity>();
                        if (entity != null)
                        {
                            actionID = entity.ValueID;
                            IFlowFacadeService flowFacadeService = ServiceContainer.Instance.Container.Resolve <IFlowFacadeService>();

                            #region 获取流程操作

                            FlowActionQuery actionQuery = new FlowActionQuery();
                            actionQuery.JournalID  = JournalID;
                            actionQuery.ToStatusID = actionID;
                            IFlowFacadeService       flowService      = ServiceContainer.Instance.Container.Resolve <IFlowFacadeService>();
                            IList <FlowActionEntity> actionEntityList = flowService.GetFlowActionList(actionQuery);
                            #endregion

                            foreach (var item in list)
                            {
                                item.Status   = 0;
                                item.Body     = Server.UrlDecode(model.Body).Replace("${金额}$", model.Amount.ToString()).Replace("${接收人}$", item.AuthorName).Replace("${邮箱}$", item.LoginName).Replace("${稿件编号}$", item.CNumber).Replace("${稿件标题}$", item.CTitle).Replace("${手机}$", item.Mobile);
                                item.SendUser = CurAuthor.AuthorID;
                                item.Amount   = model.Amount;
                                item.Title    = model.Title;
                                if (item.NoticeID == 0)
                                {
                                    #region 根据审稿状态获取  审稿流程日志ID

                                    CirculationEntity cirQuery = new CirculationEntity();
                                    cirQuery.CID       = item.CID;
                                    cirQuery.JournalID = JournalID;
                                    cirQuery.GroupID   = 1;
                                    IFlowFacadeService        flowInfoLogService = ServiceContainer.Instance.Container.Resolve <IFlowFacadeService>();
                                    IList <FlowLogInfoEntity> flowLogEntityList  = flowInfoLogService.GetFlowLog(cirQuery);
                                    FlowActionEntity          single             = null;
                                    FlowLogInfoEntity         flowLogEntity      = null;
                                    if (flowLogEntityList != null && flowLogEntityList.Count > 0)
                                    {
                                        flowLogEntity = flowLogEntityList.OrderByDescending(o => o.FlowLogID).Take(1).SingleOrDefault();
                                        single        = actionEntityList.Where(o => o.StatusID == flowLogEntity.TargetStatusID).SingleOrDefault();
                                    }
                                    #endregion

                                    #region 批量提交审稿状态

                                    AuditBillEntity auditBillEntity = new AuditBillEntity();
                                    auditBillEntity.JournalID  = JournalID;
                                    auditBillEntity.Processer  = CurAuthor.AuthorID;
                                    auditBillEntity.ActionType = 1;
                                    auditBillEntity.CID        = item.CID;
                                    if (single != null && flowLogEntity != null)
                                    {
                                        auditBillEntity.ActionID     = single.ActionID;
                                        auditBillEntity.StatusID     = single.StatusID;
                                        auditBillEntity.ReveiverList = flowLogEntity.RecUserID.ToString();
                                        auditBillEntity.FlowLogID    = flowLogEntity.FlowLogID;
                                        auditBillEntity.CPath        = string.IsNullOrEmpty(flowLogEntity.CPath) ? "" : flowLogEntity.CPath;
                                        auditBillEntity.FigurePath   = string.IsNullOrEmpty(flowLogEntity.FigurePath) ? "" : flowLogEntity.FigurePath;
                                        auditBillEntity.OtherPath    = string.IsNullOrEmpty(flowLogEntity.OtherPath) ? "" : flowLogEntity.OtherPath;
                                        flowFacadeService.SubmitAuditBill(auditBillEntity);
                                    }

                                    #endregion
                                }
                            }
                        }
                    }
                }
                #endregion
            }

            ExecResult result = service.BatchSavePayNotice(list);

            return(Json(new { result = result.result, msg = result.msg }));
        }
コード例 #20
0
ファイル: UploadController.cs プロジェクト: zz110/WKT2015
        /// <summary>
        /// 文件下载_根据稿件ID_流程ID
        /// </summary>
        /// <param name="cid">稿件ID</param>
        /// <param name="fileName">文件名</param>
        /// <param name="downType1">下载类型1:1=下载CPath;2=下载FigurePath;3=OtherPath</param>
        /// <param name="downType2">下载类型2:1=原稿件(最后一条数据);2=最新稿件(第一条数据);3=过程稿件</param>
        /// <param name="isDown">是否下载过:false=未下载过;true=下载过</param>
        /// <returns></returns>
        public ActionResult Download(long cid, long FlowLogID, string fileName, int downType1, int downType2, bool isDown)
        {
            string             filePath    = string.Empty;
            HttpCookie         cookie      = System.Web.HttpContext.Current.Request.Cookies["WKT_SSO.CN"];
            IFlowFacadeService flowService = ServiceContainer.Instance.Container.Resolve <IFlowFacadeService>();
            CirculationEntity  ce          = new CirculationEntity();

            ce.CID       = cid;
            ce.JournalID = SiteConfig.SiteID;
            ce.GroupID   = 1;
            IList <FlowLogInfoEntity> flowLogList = flowService.GetFlowLog(ce);

            if (cookie != null)
            {
                #region MyRegion
                if (downType2 == 1)//下载原稿件
                {
                    if (downType1 == 1)
                    {
                        filePath = GetUploadPath(flowLogList[flowLogList.Count - 1].CPath);
                    }
                    if (downType1 == 2)
                    {
                        filePath = GetUploadPath(flowLogList[flowLogList.Count - 1].FigurePath);
                    }
                    if (downType1 == 3)
                    {
                        filePath = GetUploadPath(flowLogList[flowLogList.Count - 1].OtherPath);
                    }
                }
                #endregion
                #region MyRegion
                if (downType2 == 2)//下载最新稿件
                {
                    if (downType1 == 1)
                    {
                        filePath = GetUploadPath(flowLogList[0].CPath);
                    }
                    if (downType1 == 2)
                    {
                        filePath = GetUploadPath(flowLogList[0].FigurePath);
                    }
                    if (downType1 == 3)
                    {
                        filePath = GetUploadPath(flowLogList[flowLogList.Count - 1].OtherPath);
                    }
                }
                #endregion
                #region MyRegion
                if (downType2 == 3)//下载过程稿件
                {
                    for (int i = 0; i < flowLogList.Count; i++)
                    {
                        if (flowLogList[i].FlowLogID == FlowLogID)
                        {
                            if (downType1 == 1)
                            {
                                filePath = GetUploadPath(flowLogList[i].CPath);
                            }
                            if (downType1 == 2)
                            {
                                filePath = GetUploadPath(flowLogList[i].FigurePath);
                            }
                            if (downType1 == 3)
                            {
                                filePath = GetUploadPath(flowLogList[i].OtherPath);
                            }
                        }
                    }
                }
                #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

                        # region 更新下载状态
                        if (isDown == false)
                        {
                            try
                            {
                                FlowLogQuery query = new FlowLogQuery();
                                query.JournalID = SiteConfig.SiteID;
                                query.FlowLogID = FlowLogID;
                                flowService.UpdateFlowLogIsDown(query);
                            }
                            catch (Exception ex)
                            {
                                WKT.Log.LogProvider.Instance.Error("更新审稿日志的下载状态出现异常:" + ex.Message);
                            }
                        }

                        # endregion
                    }
                    catch (Exception ex)
                    {
                        return(Content("无法完成下载!详细信息:" + ex.Message));
                    }
                    finally
                    {
                        br.Close();
                        myFile.Close();
                    }
                }
コード例 #21
0
        /// <summary>
        /// 专家拒审
        /// </summary>
        /// <param name="cirEntity">CID,AuthorID,CNumber,JournalID,EnumCStatus</param>
        /// <returns></returns>
        public bool ExpertDeledit(CirculationEntity cirEntity)
        {
            bool result = FlowCirculationBusProvider.AuthorContribution(cirEntity);

            return(result);
        }
コード例 #22
0
ファイル: UploadController.cs プロジェクト: zz110/WKT2015
        public JsonResult CheckAuthorFileAjax(long cid, long AuthorID)
        {
            HttpCookie         cookie      = Request.Cookies["WKT_SSO.CN"];
            IFlowFacadeService flowService = ServiceContainer.Instance.Container.Resolve <IFlowFacadeService>(new ResolverOverride[0]);
            CirculationEntity  ce          = new CirculationEntity
            {
                CID       = cid,
                JournalID = SiteConfig.SiteID,
                GroupID   = 2
            };
            IList <FlowLogInfoEntity> flowLogList = flowService.GetFlowLog(ce);

            if (flowLogList.Count == 1)//如果是新稿件
            {
                if (flowLogList[0].FigurePath != "" && flowLogList[0].OtherPath != "")
                {
                    return(base.Json(new { flag = "19" }));
                }
                else if (flowLogList[0].FigurePath != "")
                {
                    return(base.Json(new { flag = "12" }));
                }
                else if (flowLogList[0].OtherPath != "")
                {
                    return(base.Json(new { flag = "13" }));
                }
                else
                {
                    return(base.Json(new { flag = "10" }));
                }
            }
            else //如果不是新稿件
            {
                if (flowLogList[0].CPath != "")//如果存在修改稿
                {
                    #region 判断最新的附件/介绍信
                    if (flowLogList[0].FigurePath != "" && flowLogList[0].OtherPath != "")
                    {
                        return(base.Json(new { flag = "29" }));
                    }
                    else if (flowLogList[0].FigurePath != "")
                    {
                        return(base.Json(new { flag = "22" }));
                    }
                    else if (flowLogList[0].OtherPath != "")
                    {
                        return(base.Json(new { flag = "23" }));
                    }
                    //else
                    //    return base.Json(new { flag = "20" });
                    #endregion

                    #region 判断原始的附件/介绍信
                    if (flowLogList[flowLogList.Count - 1].FigurePath != "" && flowLogList[flowLogList.Count - 1].OtherPath != "")
                    {
                        return(base.Json(new { flag = "39" }));
                    }
                    else if (flowLogList[flowLogList.Count - 1].FigurePath != "")
                    {
                        return(base.Json(new { flag = "32" }));
                    }
                    else if (flowLogList[flowLogList.Count - 1].OtherPath != "")
                    {
                        return(base.Json(new { flag = "33" }));
                    }
                    else
                    {
                        return(base.Json(new { flag = "30" }));
                    }
                    #endregion
                }
                else//如果不存在修改稿
                {
                    #region 判断最新的附件/介绍信
                    if (flowLogList[0].FigurePath != "" && flowLogList[0].OtherPath != "")
                    {
                        return(base.Json(new { flag = "49" }));
                    }
                    else if (flowLogList[0].FigurePath != "")
                    {
                        return(base.Json(new { flag = "42" }));
                    }
                    else if (flowLogList[0].OtherPath != "")
                    {
                        return(base.Json(new { flag = "43" }));
                    }
                    //else
                    //    return base.Json(new { flag = "40" });
                    #endregion

                    #region 判断原始的附件/介绍信
                    if (flowLogList[flowLogList.Count - 1].FigurePath != "" && flowLogList[flowLogList.Count - 1].OtherPath != "")
                    {
                        return(base.Json(new { flag = "59" }));
                    }
                    else if (flowLogList[flowLogList.Count - 1].FigurePath != "")
                    {
                        return(base.Json(new { flag = "52" }));
                    }
                    else if (flowLogList[flowLogList.Count - 1].OtherPath != "")
                    {
                        return(base.Json(new { flag = "53" }));
                    }
                    else
                    {
                        return(base.Json(new { flag = "50" }));
                    }
                    #endregion
                }
            }
        }
コード例 #23
0
        /// <summary>
        /// 保存审稿单
        /// </summary>
        /// <param name="list"></param>
        /// <returns></returns>
        public ExecResult SaveReviewBillContent(ReviewBillContentQuery query)
        {
            ExecResult execResult = new ExecResult();
            List <ReviewBillContentEntity> list = new List <ReviewBillContentEntity>();
            bool result = true;

            if (query.list != null && query.list.Count > 0)
            {
                list = query.list.ToList();
                if (list == null || list.Count == 0)
                {
                    execResult.result = EnumJsonResult.failure.ToString();
                    execResult.msg    = "没有需要保存的数据!";
                }
                foreach (var item in list)
                {
                    item.JournalID = query.JournalID;
                    item.AddUser   = query.AddUser.Value;
                }

                ReviewBillService service = new ReviewBillService();
                var billList = service.GetReviewBillList(new ReviewBillQuery()
                {
                    JournalID = query.JournalID, PItemID = 0
                });
                ReviewBillContentEntity model = null;
                foreach (var item in billList)
                {
                    if (list.Find(p => p.ItemID == item.ItemID) != null)
                    {
                        continue;
                    }
                    model = new ReviewBillContentEntity();
                    model.ItemContentID = 0;
                    model.JournalID     = query.JournalID;
                    model.AddUser       = query.AddUser.Value;
                    model.CID           = list[0].CID;
                    model.ItemID        = item.ItemID;
                    model.ContentValue  = string.Empty;
                    model.IsChecked     = false;
                    list.Add(model);
                }
                result = ReviewBillContentBusProvider.SaveReviewBillContent(list);
            }
            if (result)
            {
                FlowCirculationBusiness business = new FlowCirculationBusiness();
                CirculationEntity       item     = new CirculationEntity();
                item.CID       = query.CID == null ? 0 : query.CID.Value;
                item.AuthorID  = query.AddUser.Value;
                item.JournalID = query.JournalID;
                if (query.IsEnExpert == true)
                {
                    if (query.IsReReview == true)
                    {
                        item.EnumCStatus = EnumContributionStatus.ReAuditedEn;
                    }
                    else
                    {
                        item.EnumCStatus = EnumContributionStatus.AuditedEn;
                    }
                }
                else
                {
                    if (query.IsReReview == true)
                    {
                        item.EnumCStatus = EnumContributionStatus.ReAudited;
                    }
                    else
                    {
                        item.EnumCStatus = EnumContributionStatus.Audited;
                    }
                }

                item.DealAdvice = WKT.Common.Security.SecurityUtils.SafeSqlString(query.DealAdvice);
                item.CPath      = query.PathUrl;
                item.CFileName  = query.CFileName;
                item.OtherPath  = query.OtherPath;
                item.FigurePath = query.figurePath;
                item.FFileName  = query.FFileName;
                item.IsHaveBill = 1;

                //专家审回到固定编辑设置
                DictValueBusiness         siteConfigBusiness = new DictValueBusiness();
                DictValueQuery            DictQuery          = new DictValueQuery();
                IDictionary <int, string> dict = siteConfigBusiness.GetDictValueDcit(query.JournalID, "ExpertToEditor");
                if (dict != null && dict.Count > 0)
                {
                    foreach (var dictItem in dict)
                    {
                        item.IsExpertToEditor = true;
                        item.RecUserID        = Convert.ToInt64(dictItem.Value);
                    }
                }

                if (business.AuthorContribution(item))
                {
                    execResult.result = EnumJsonResult.success.ToString();
                    execResult.msg    = "保存审稿单成功!";
                }
                else
                {
                    execResult.result = EnumJsonResult.success.ToString();
                    execResult.msg    = "保存审核信息失败!";
                }
            }
            else
            {
                execResult.result = EnumJsonResult.failure.ToString();
                execResult.msg    = "保存审稿单失败!";
            }
            return(execResult);
        }
コード例 #24
0
 /// <summary>
 /// 处理在入款时改变稿件状态
 /// </summary>
 /// <param name="auditBillEntity"></param>
 /// <returns></returns>
 public bool DealFinaceInAccount(CirculationEntity cirEntity)
 {
     return(FlowCirculationDataAccess.Instance.DealFinaceInAccount(cirEntity));
 }
コード例 #25
0
 /// <summary>
 /// 获取稿件的处理日志
 /// </summary>
 /// <param name="cirEntity">稿件ID,JournalID,分组</param>
 /// <returns></returns>
 public IList <FlowLogInfoEntity> GetFlowLog(CirculationEntity cirEntity)
 {
     return(FlowCirculationBusProvider.GetFlowLog(cirEntity));
 }