Ejemplo n.º 1
0
 /// <summary>
 /// 流转状态操作设置
 /// </summary>
 /// <returns></returns>
 public ActionResult FlowActionSet(long StatusID, long? ActionID)
 {
     FlowActionEntity actionEntity = null;
     if (ActionID == null)
     {
         actionEntity = new FlowActionEntity();
         actionEntity.JournalID = JournalID;
         actionEntity.StatusID = StatusID;
     }
     else
     {
         FlowActionQuery actionQuery = new FlowActionQuery();
         actionQuery.JournalID = JournalID;
         actionQuery.ActionID = ActionID.Value;
         IFlowFacadeService flowService = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>();
         actionEntity = flowService.GetFlowActionEntity(actionQuery);
     }
     return View(actionEntity);
 }
Ejemplo n.º 2
0
 public ActionResult GetFlowActionEntityAjax(long ActionID)
 {
     JsonExecResult<FlowActionEntity> jsonResult = new JsonExecResult<FlowActionEntity>();
     try
     {
         IFlowFacadeService service = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>();
         FlowActionQuery query = new FlowActionQuery();
         query.ActionID = ActionID;
         query.JournalID = JournalID;
         jsonResult.ItemList = new List<FlowActionEntity>();
         jsonResult.ItemList.Add(service.GetFlowActionEntity(query));
         jsonResult.result = EnumJsonResult.success.ToString();
     }
     catch (Exception ex)
     {
         jsonResult.result = EnumJsonResult.error.ToString();
         jsonResult.msg = "获取流程操作出现异常:" + ex.Message;
     }
     return Json(jsonResult);
 }
Ejemplo n.º 3
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 });
        }
Ejemplo n.º 4
0
 public List<FlowActionEntity> GetFlowActionList(FlowActionQuery queryFlowAction)
 {
     try
     {
         IFlowActionService flowActionService = ServiceContainer.Instance.Container.Resolve<IFlowActionService>();
         List<FlowActionEntity> listFlowAction = flowActionService.GetFlowActionList(queryFlowAction);
         return listFlowAction;
     }
     catch (Exception ex)
     {
         LogProvider.Instance.Error("获取审稿操作出现异常:" + ex.Message);
         throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.ExpectationFailed, ex.Message));
     }
 }
Ejemplo n.º 5
0
 /// <summary>
 /// 获取指定审稿状态下可以做的操作,带有权限
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public List<FlowActionEntity> GetFlowActionByStatus(FlowActionQuery query)
 {
     List<FlowActionEntity> list = new List<FlowActionEntity>();
     DbCommand cmd = db.GetStoredProcCommand("UP_GetHaveRightActionListByStatusID");
     db.AddInParameter(cmd, "@JournalID", DbType.Int64, query.JournalID);
     db.AddInParameter(cmd, "@StatusID", DbType.Int64, query.StatusID);
     db.AddInParameter(cmd, "@AuthorID", DbType.Int64, query.AuthorID);
     db.AddInParameter(cmd, "@RoleID", DbType.Int64, query.RoleID);
     using (IDataReader dr = db.ExecuteReader(cmd))
     {
         FlowActionEntity flowActionEntity = null;
         while (dr.Read())
         {
             flowActionEntity = new FlowActionEntity();
             flowActionEntity.ActionID = (Int64)dr["ActionID"];
             flowActionEntity.StatusID = (Int64)dr["StatusID"];
             flowActionEntity.ActionName = (String)dr["ActionName"];
             flowActionEntity.DisplayName = (String)dr["DisplayName"];
             flowActionEntity.ActionType = (Byte)dr["ActionType"];
             list.Add(flowActionEntity);
         }
         dr.Close();
     }
     return list;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// 根据条件获取所有实体对象
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public List<FlowActionEntity> GetFlowActionList(FlowActionQuery query)
 {
     List<FlowActionEntity> list = new List<FlowActionEntity>();
     StringBuilder sqlCommandText = new StringBuilder();
     sqlCommandText.Append("SELECT ActionID,JournalID,StatusID,ActionName,DisplayName,ActionType,CStatus,ActionRoleID,SMSTemplate,EmailTemplate,TOStatusID,Status,IsShowLog,IsRetractionSendMsg,SortID,AddDate FROM dbo.FlowAction WITH(NOLOCK)");
     string whereSQL = FlowActionQueryToSQLWhere(query);
     string orderBy = FlowActionQueryToSQLOrder(query);
     if (!string.IsNullOrEmpty(whereSQL)) sqlCommandText.Append(" WHERE " + whereSQL);
     if (!string.IsNullOrEmpty(orderBy)) sqlCommandText.Append(" ORDER BY " + orderBy);
     DbCommand cmd = db.GetSqlStringCommand(sqlCommandText.ToString());
     using (IDataReader dr = db.ExecuteReader(cmd))
     {
         list = MakeFlowActionList(dr);
     }
     return list;
 }
Ejemplo n.º 7
0
 /// <summary>
 /// 获取操作实体
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public FlowActionEntity GetFlowActionEntity(FlowActionQuery query)
 {
     return FlowActionBusProvider.GetFlowActionEntity(query);
 }
Ejemplo n.º 8
0
 /// <summary>
 /// 将查询实体转换为Order语句
 /// <param name="query">查询实体</param>
 /// <returns>获取Order语句,不包含Order</returns>
 /// </summary>
 public string FlowActionQueryToSQLOrder(FlowActionQuery query)
 {
     return " SortID ASC, ActionID DESC";
 }
Ejemplo n.º 9
0
 /// <summary>
 /// 获取所有符合查询条件的数据
 /// </summary>
 /// <param name="flowActionQuery">FlowActionQuery查询实体对象</param>
 /// <returns>List<FlowActionEntity></returns>
 public List<FlowActionEntity> GetFlowActionList(FlowActionQuery flowActionQuery)
 {
     return FlowActionBusProvider.GetFlowActionList(flowActionQuery);
 }
Ejemplo n.º 10
0
 /// <summary>
 /// 根据当前操作状态获取可以做的操作
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public List<FlowActionEntity> GetFlowActionByStatus(FlowActionQuery query)
 {
     return FlowActionBusProvider.GetFlowActionByStatus(query);
 }
Ejemplo n.º 11
0
 /// <summary>
 /// 获取所有符合查询条件的数据
 /// </summary>
 /// <param name="flowActionQuery">FlowActionQuery查询实体对象</param>
 /// <returns>List<FlowActionEntity></returns>
 public List<FlowActionEntity> GetFlowActionList(FlowActionQuery flowActionQuery)
 {
     return FlowActionDataAccess.Instance.GetFlowActionList(flowActionQuery);
 }
Ejemplo n.º 12
0
 /// <summary>
 /// 获取操作实体
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public FlowActionEntity GetFlowActionEntity(FlowActionQuery query)
 {
     return FlowActionDataAccess.Instance.GetFlowActionEntity(query);
 }
Ejemplo n.º 13
0
 /// <summary>
 /// 根据当前操作状态获取可以做的操作
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public List<FlowActionEntity> GetFlowActionByStatus(FlowActionQuery query)
 {
     return FlowActionDataAccess.Instance.GetFlowActionByStatus(query);
 }
Ejemplo n.º 14
0
 public ActionResult GetFlowActionListAjax(FlowActionQuery query)
 {
     IFlowFacadeService service = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>();
     query.JournalID = JournalID;
     List<FlowActionEntity> listResult = service.GetFlowActionList(query);
     return Json(new { Rows = listResult });
 }
Ejemplo n.º 15
0
 /// <summary>
 /// 根据当前操作状态获取可以做的操作
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public List<FlowActionEntity> GetFlowActionByStatus(FlowActionQuery query)
 {
     HttpClientHelper clientHelper = new HttpClientHelper();
     List<FlowActionEntity> flowActionList = clientHelper.PostAuth<List<FlowActionEntity>, FlowActionQuery>(GetAPIUrl(APIConstant.FLOW_GETFLOWACTIONBYSTATUS), query);
     return flowActionList;
 }
Ejemplo n.º 16
0
 public ActionResult GetFlowActionListByIDAjax(FlowActionQuery query)
 {
     JsonExecResult<FlowActionEntity> jsonResult = new JsonExecResult<FlowActionEntity>();
     try
     {
         IFlowFacadeService service = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>();
         query.JournalID = JournalID;
         jsonResult.ItemList = service.GetFlowActionList(query);
         jsonResult.result = EnumJsonResult.success.ToString();
     }
     catch (Exception ex)
     {
         jsonResult.result = EnumJsonResult.error.ToString();
         jsonResult.msg = "根据步骤ID获取流程操作列表出现异常:" + ex.Message;
     }
     return Json(jsonResult);
 }
Ejemplo n.º 17
0
 /// <summary>
 /// 获取操作实体
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public FlowActionEntity GetFlowActionEntity(FlowActionQuery query)
 {
     HttpClientHelper clientHelper = new HttpClientHelper();
     FlowActionEntity flowActionEntity = clientHelper.PostAuth<FlowActionEntity, FlowActionQuery>(GetAPIUrl(APIConstant.FLOW_GETFLOWACTIONENTITY), query);
     return flowActionEntity;
 }
Ejemplo n.º 18
0
 /// <summary>
 /// 将查询实体转换为Where语句
 /// <param name="query">查询实体</param>
 /// <returns>获取Where语句,不包含Where</returns>
 /// </summary>
 public string FlowActionQueryToSQLWhere(FlowActionQuery query)
 {
     StringBuilder sbWhere = new StringBuilder(" JournalID = " + query.JournalID);
     if (query.StatusID > 0)
     {
         sbWhere.Append(" AND StatusID = " + query.StatusID);
     }
     else if (query.ToStatusID > 0)
     {
         sbWhere.Append(" AND ToStatusID = " + query.ToStatusID);
     }
     else if (query.ActionName.Length > 0)
     {
         sbWhere.Append(" AND ActionName like '%" + query.ActionName+"%'");
     }
     return sbWhere.ToString();
 }
Ejemplo n.º 19
0
 /// <summary>
 /// 获取指定审稿状态下的审稿操作列表
 /// </summary>
 /// <param name="queryFlowSet"></param>
 /// <returns></returns>
 public List<FlowActionEntity> GetFlowActionList(FlowActionQuery queryFlowAction)
 {
     HttpClientHelper clientHelper = new HttpClientHelper();
     List<FlowActionEntity> flowActionList = clientHelper.PostAuth<List<FlowActionEntity>, FlowActionQuery>(GetAPIUrl(APIConstant.FLOW_GETFLOWACTIONLIST), queryFlowAction);
     FlowStatusQuery statusQuery = new FlowStatusQuery();
     statusQuery.JournalID = queryFlowAction.JournalID;
     IDictionary<long, string> dictGetFlowStatus = GetFlowStatusDictStatusName(statusQuery);
     string value = "";
     foreach (FlowActionEntity item in flowActionList)
     {
         dictGetFlowStatus.TryGetValue(item.TOStatusID, out value);
         item.StatusName = value;
         value = "";
     }
     return flowActionList;
 }
Ejemplo n.º 20
0
 /// <summary>
 /// 获取操作实体
 /// </summary>
 /// <param name="query"></param>
 /// <returns></returns>
 public FlowActionEntity GetFlowActionEntity(FlowActionQuery query)
 {
     FlowActionEntity flowActionEntity = null;
     StringBuilder sqlCommandText = new StringBuilder();
     sqlCommandText.Append("SELECT [ActionID],[JournalID],[StatusID],[ActionName],[DisplayName],[ActionType],[SMSTemplate],[EmailTemplate],[TOStatusID],[CStatus],ActionRoleID,[SortID],[Status],IsShowLog,IsRetractionSendMsg FROM dbo.FlowAction fa WITH(NOLOCK) WHERE fa.JournalID=@JournalID AND fa.ActionID=@ActionID ");
     DbCommand cmd = db.GetSqlStringCommand(sqlCommandText.ToString());
     db.AddInParameter(cmd, "@JournalID", DbType.Int64, query.JournalID);
     db.AddInParameter(cmd, "@ActionID", DbType.Int64, query.ActionID);
     using (IDataReader dr = db.ExecuteReader(cmd))
     {
         flowActionEntity = MakeFlowAction(dr);
     }
     return flowActionEntity;
 }
Ejemplo n.º 21
0
 public ActionResult GetFlowActionByStatus(FlowActionQuery query)
 {
     JsonExecResult<FlowActionEntity> jsonResult = new JsonExecResult<FlowActionEntity>();
     IFlowFacadeService service = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>();
     query.JournalID = JournalID;
     query.AuthorID = CurAuthor.AuthorID;
     query.RoleID = CurAuthor.RoleID == null ? 0 : CurAuthor.RoleID.Value;
     try
     {
         List<FlowActionEntity> listResult = service.GetFlowActionByStatus(query);
         jsonResult.ItemList = listResult;
         jsonResult.result = EnumJsonResult.success.ToString();
     }
     catch (Exception ex)
     {
         jsonResult.result = EnumJsonResult.error.ToString();
         jsonResult.msg = "获取当前状态下的可做操作出现异常:" + ex.Message;
     }
     return Json(jsonResult);
 }
Ejemplo n.º 22
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 });
        }
Ejemplo n.º 23
0
        public JsonResult ValidateIsPayNotice(long actionID)
        {
            ISiteConfigFacadeService facadeService = ServiceContainer.Instance.Container.Resolve<ISiteConfigFacadeService>();
            DictEntity PayNoticeDict = facadeService.GetDictModelByKey(new DictQuery() { JournalID = CurAuthor.JournalID, DictKey = "PayNotice" });//通知交审稿费
            DictEntity PayedDict = facadeService.GetDictModelByKey(new DictQuery() { JournalID = CurAuthor.JournalID, DictKey = "Payed" });//已交审稿费

            DictEntity PayPageNoticeDict = facadeService.GetDictModelByKey(new DictQuery() { JournalID = CurAuthor.JournalID, DictKey = "PayPageNotice" });//通知交版面费
            DictEntity PagePayedDict = facadeService.GetDictModelByKey(new DictQuery() { JournalID = CurAuthor.JournalID, DictKey = "PagePayed" });//已交版面费

            #region 验证操作-通知交审稿费
            if (PayNoticeDict != null)
            {
                ISiteConfigFacadeService currentService = ServiceContainer.Instance.Container.Resolve<ISiteConfigFacadeService>();
                IList<DictValueEntity> list = currentService.GetDictValueList(new DictValueQuery() { JournalID = CurAuthor.JournalID, DictKey = PayNoticeDict.DictKey });
                if (list != null && list.Count > 0)
                {
                    DictValueEntity entity = list.Single<DictValueEntity>();
                    if (entity != null)
                    {
                        FlowActionQuery actionQuery = new FlowActionQuery();
                        actionQuery.JournalID = JournalID;
                        actionQuery.ActionID = actionID;
                        IFlowFacadeService flowService = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>();
                        FlowActionEntity actionEntity = flowService.GetFlowActionEntity(actionQuery);
                        if (actionEntity != null)
                        {
                            if (actionEntity.TOStatusID == entity.ValueID)
                            {
                                return Json(new { flag = 1, AuthorID = (CurAuthor != null ? CurAuthor.AuthorID : 0), payType = 1 });
                            }
                        }

                    }

                }
            }
            #endregion

            #region 验证操作-已交审稿费
            if (PayedDict != null)
            {
                ISiteConfigFacadeService currentService = ServiceContainer.Instance.Container.Resolve<ISiteConfigFacadeService>();
                IList<DictValueEntity> list = currentService.GetDictValueList(new DictValueQuery() { JournalID = CurAuthor.JournalID, DictKey = PayedDict.DictKey });
                if (list != null && list.Count > 0)
                {
                    DictValueEntity entity = list.SingleOrDefault<DictValueEntity>();
                    if (entity != null)
                    {
                        FlowActionQuery actionQuery = new FlowActionQuery();
                        actionQuery.JournalID = JournalID;
                        actionQuery.ActionID = actionID;
                        IFlowFacadeService flowService = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>();
                        FlowActionEntity actionEntity = flowService.GetFlowActionEntity(actionQuery);
                        if (actionEntity != null)
                        {
                            if (actionEntity.TOStatusID == entity.ValueID)
                            {
                                return Json(new { flag = 2, AuthorID = (CurAuthor != null ? CurAuthor.AuthorID : 0), payType = 1 });
                            }
                        }

                    }

                }
            }
            #endregion

            #region 验证操作-通知交版面费
            if (PayPageNoticeDict != null)
            {
                ISiteConfigFacadeService currentService = ServiceContainer.Instance.Container.Resolve<ISiteConfigFacadeService>();
                IList<DictValueEntity> list = currentService.GetDictValueList(new DictValueQuery() { JournalID = CurAuthor.JournalID, DictKey = PayPageNoticeDict.DictKey });
                if (list != null && list.Count > 0)
                {
                    DictValueEntity entity = list.SingleOrDefault<DictValueEntity>();
                    if (entity != null)
                    {
                        FlowActionQuery actionQuery = new FlowActionQuery();
                        actionQuery.JournalID = JournalID;
                        actionQuery.ActionID = actionID;
                        IFlowFacadeService flowService = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>();
                        FlowActionEntity actionEntity = flowService.GetFlowActionEntity(actionQuery);
                        if (actionEntity != null)
                        {
                            if (actionEntity.TOStatusID == entity.ValueID)
                            {
                                return Json(new { flag = 1, AuthorID = (CurAuthor != null ? CurAuthor.AuthorID : 0), payType = 2 });
                            }
                        }

                    }

                }
            }
            #endregion

            #region 验证操作-已交版面费
            if (PagePayedDict != null)
            {
                ISiteConfigFacadeService currentService = ServiceContainer.Instance.Container.Resolve<ISiteConfigFacadeService>();
                IList<DictValueEntity> list = currentService.GetDictValueList(new DictValueQuery() { JournalID = CurAuthor.JournalID, DictKey = PagePayedDict.DictKey });
                if (list != null && list.Count > 0)
                {
                    DictValueEntity entity = list.SingleOrDefault<DictValueEntity>();
                    if (entity != null)
                    {
                        FlowActionQuery actionQuery = new FlowActionQuery();
                        actionQuery.JournalID = JournalID;
                        actionQuery.ActionID = actionID;
                        IFlowFacadeService flowService = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>();
                        FlowActionEntity actionEntity = flowService.GetFlowActionEntity(actionQuery);
                        if (actionEntity != null)
                        {
                            if (actionEntity.TOStatusID == entity.ValueID)
                            {
                                return Json(new { flag = 2, AuthorID = (CurAuthor != null ? CurAuthor.AuthorID : 0), payType = 2 });
                            }
                        }

                    }

                }
            }
            #endregion

            return Json(new { flag = 0 });
        }
Ejemplo n.º 24
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;
        }
Ejemplo n.º 25
0
 public FlowActionEntity GetFlowActionEntity(FlowActionQuery query)
 {
     try
     {
         IFlowActionService flowActionService = ServiceContainer.Instance.Container.Resolve<IFlowActionService>();
         FlowActionEntity flowActionEntity = flowActionService.GetFlowActionEntity(query);
         return flowActionEntity;
     }
     catch (Exception ex)
     {
         LogProvider.Instance.Error("获取操作实体出现异常:" + ex.Message);
         throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.ExpectationFailed, ex.Message));
     }
 }