コード例 #1
0
 /// <summary>
 /// 处理审稿流程
 /// </summary>
 /// <param name="auditBillEntity"></param>
 /// <returns></returns>
 public bool ProcessFlowCirulation(AuditBillEntity auditBillEntity)
 {
     if (auditBillEntity.ActionID == -1)
     {
         return FlowCirculationDataAccess.Instance.ProcessFlowCirulationNoAction(auditBillEntity);
     }
     else
     {
         return FlowCirculationDataAccess.Instance.ProcessFlowCirulation(auditBillEntity);
     }
 }
コード例 #2
0
 /// <summary>
 /// 处理审稿流程
 /// </summary>
 /// <param name="auditBillEntity"></param>
 /// <returns></returns>
 public bool ProcessFlowCirulation(AuditBillEntity auditBillEntity)
 {
     return FlowCirculationBusProvider.ProcessFlowCirulation(auditBillEntity);
 }
コード例 #3
0
        /// <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;
        }
コード例 #4
0
        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 });
        }
コード例 #5
0
        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 });
        }
コード例 #6
0
 public ActionResult SubmitAuditBillAjax(AuditBillEntity auditBillEntity)
 {
     ExecResult exeResult = new ExecResult();
     IFlowFacadeService service = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>();
     auditBillEntity.JournalID = JournalID;
     auditBillEntity.Processer = CurAuthor.AuthorID;
     //zhanglc
     auditBillEntity.CPath = string.IsNullOrEmpty(auditBillEntity.CPath) ? "" : auditBillEntity.CPath;
     auditBillEntity.CFileName = string.IsNullOrEmpty(auditBillEntity.CFileName) ? "" : auditBillEntity.CFileName;
     auditBillEntity.FigurePath = string.IsNullOrEmpty(auditBillEntity.FigurePath) ? "" : auditBillEntity.FigurePath;
     auditBillEntity.FFileName = string.IsNullOrEmpty(auditBillEntity.FFileName) ? "" : auditBillEntity.FFileName;
     auditBillEntity.OtherPath = string.IsNullOrEmpty(auditBillEntity.OtherPath) ? "" : auditBillEntity.OtherPath;
     exeResult = service.SubmitAuditBill(auditBillEntity);
     return base.Content(JsonConvert.SerializeObject(exeResult));
 }
コード例 #7
0
 public ActionResult SendSysMessageAjax(AuditBillEntity auditBillEntity)
 {
     ExecResult exeResult = new ExecResult();
     IFlowFacadeService service = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>();
     auditBillEntity.JournalID = JournalID;
     auditBillEntity.Processer = CurAuthor.AuthorID;
     exeResult = service.SendSysMessage(auditBillEntity);
     return Content(JsonConvert.SerializeObject(exeResult));
 }
コード例 #8
0
 public ExecResult SubmitAuditBill(AuditBillEntity auditBillEntity)
 {
     ExecResult result = new ExecResult();
     try
     {
         IFlowCirculationService flowCirService = ServiceContainer.Instance.Container.Resolve<IFlowCirculationService>();
         bool flag = flowCirService.SubmitAuditBill(auditBillEntity);
         if (flag)
         {
             result.result = EnumJsonResult.success.ToString();
             result.msg = "成功";
         }
         else
         {
             result.result = EnumJsonResult.failure.ToString();
             result.msg = "提交审稿单失败,请确认信息是否正确";
         }
     }
     catch (Exception ex)
     {
         result.result = EnumJsonResult.error.ToString();
         result.msg = "提交审稿单时出现异常:" + ex.Message;
     }
     return result;
 }