Esempio n. 1
0
 public ExecResult AddFlowStatus(FlowStep flowStepEntity)
 {
     ExecResult result = new ExecResult();
     try
     {
         IFlowStatusService flowStatusService = ServiceContainer.Instance.Container.Resolve<IFlowStatusService>();
         bool flag = flowStatusService.AddFlowStatus(flowStepEntity);
         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;
 }
Esempio n. 2
0
 public ActionResult AddFlowStatusAjax(FlowStep flowStepEntity)
 {
     ExecResult exeResult = new ExecResult();
     try
     {
         IFlowFacadeService service = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>();
         FlowStatusEntity statusEntity = null;
         if (flowStepEntity.FlowStatus.CStatus != 0)
         {
             // 判断该状态对应的稿件状态是否存在
             FlowStatusQuery statusQuery = new FlowStatusQuery();
             statusQuery.JournalID = JournalID;
             statusQuery.CStatus = flowStepEntity.FlowStatus.CStatus;
             statusEntity = service.CheckCStatusIsExists(statusQuery);
             if (statusEntity != null)
             {
                 exeResult.result = EnumJsonResult.failure.ToString();
                 exeResult.msg = string.Format("当前选择的稿件状态已经有审稿状态[{0}]匹配,请检查!", statusEntity.StatusName);
                 return Content(JsonConvert.SerializeObject(exeResult));
             }
         }
         flowStepEntity.FlowStatus.JournalID = JournalID;
         flowStepEntity.FlowConfig.JournalID = JournalID;
         exeResult = service.AddFlowStatus(flowStepEntity);
     }
     catch (Exception ex)
     {
         exeResult.result = EnumJsonResult.error.ToString();
         exeResult.msg = "新增审稿状态出现异常:" + ex.Message;
         LogProvider.Instance.Error("新增审稿状态出现异常:" + ex.Message);
     }
     return Content(JsonConvert.SerializeObject(exeResult));
 }
Esempio n. 3
0
 /// <summary>
 /// 新增审稿流程状态及配置
 /// </summary>
 /// <param name="flowStepEntity">FlowStep实体对象</param>
 /// <returns>true:存储成功 false:存储失败</returns>
 public bool AddFlowStatus(FlowStep flowStepEntity)
 {
     return FlowSetBusProvider.AddFlowStatus(flowStepEntity);
 }
Esempio n. 4
0
 /// <summary>
 /// 更新流程状态基本信息及配置信息
 /// </summary>
 /// <param name="flowStepEntity">FlowStep实体对象</param>
 /// <returns>true:更新成功 false:更新失败</returns>
 public bool UpdateFlowStatus(FlowStep flowStepEntity)
 {
     return FlowSetBusProvider.UpdateFlowStatus(flowStepEntity);
 }
Esempio n. 5
0
        /// <summary>
        /// 修改流程状态
        /// </summary>
        /// <returns></returns>
        public ActionResult EditFlowStatus(long StatusID)
        {
            FlowStep stepEntity = new FlowStep();
            try
            {
                FlowStatusQuery query = new FlowStatusQuery();
                query.JournalID = JournalID;
                query.StatusID = StatusID;
                IFlowFacadeService flowService = ServiceContainer.Instance.Container.Resolve<IFlowFacadeService>();
                stepEntity = flowService.GetFlowStepInfo(query);
            }
            catch (Exception ex)
            {
                LogProvider.Instance.Error("获取指定的审稿状态及配置信息时出现异常:" + ex.Message);
            }

            return View(stepEntity);
        }
        /// <summary>
        /// 新增审稿流程状态及配置
        /// </summary>
        /// <param name="flowStepEntity"></param>
        /// <returns></returns>
        public bool AddFlowSet(FlowStep flowStepEntity)
        {
            bool flag = false;

            IDbConnection connection = db.GetConnection();
            connection.Open();
            IDbTransaction transaction = connection.BeginTransaction();
            long FlowStatusID = 0;
            try
            {
                # region insert FlowStatus ,流程状态基本信息

                StringBuilder sqlInsertFlowSetText = new StringBuilder();
                sqlInsertFlowSetText.Append("@JournalID");
                sqlInsertFlowSetText.Append(", @StatusName");
                sqlInsertFlowSetText.Append(", @DisplayName");
                sqlInsertFlowSetText.Append(", @Status");
                sqlInsertFlowSetText.Append(", @SortID");
                sqlInsertFlowSetText.Append(", @RoleID");
                sqlInsertFlowSetText.Append(", @ActionRoleID");
                sqlInsertFlowSetText.Append(", @CStatus");
                sqlInsertFlowSetText.Append(", @Remark");
                sqlInsertFlowSetText.Append(", @InAuthorID");

                DbCommand insertFlowSetCmd = db.GetSqlStringCommand(String.Format("INSERT INTO dbo.FlowStatus ({0}) VALUES ({1}) SELECT @@IDENTITY", sqlInsertFlowSetText.ToString().Replace("@", ""), sqlInsertFlowSetText.ToString()));

                db.AddInParameter(insertFlowSetCmd, "@JournalID", DbType.Int64, flowStepEntity.FlowStatus.JournalID);
                db.AddInParameter(insertFlowSetCmd, "@StatusName", DbType.AnsiString, flowStepEntity.FlowStatus.StatusName);
                db.AddInParameter(insertFlowSetCmd, "@DisplayName", DbType.AnsiString, flowStepEntity.FlowStatus.DisplayName);
                db.AddInParameter(insertFlowSetCmd, "@Status", DbType.Byte, flowStepEntity.FlowStatus.Status);
                db.AddInParameter(insertFlowSetCmd, "@SortID", DbType.Int32, flowStepEntity.FlowStatus.SortID);
                db.AddInParameter(insertFlowSetCmd, "@RoleID", DbType.Int64, flowStepEntity.FlowStatus.RoleID);
                db.AddInParameter(insertFlowSetCmd, "@ActionRoleID", DbType.Int64, flowStepEntity.FlowStatus.ActionRoleID);
                db.AddInParameter(insertFlowSetCmd, "@CStatus", DbType.Int32, flowStepEntity.FlowStatus.CStatus);
                db.AddInParameter(insertFlowSetCmd, "@Remark", DbType.AnsiString, flowStepEntity.FlowStatus.Remark);
                db.AddInParameter(insertFlowSetCmd, "@InAuthorID", DbType.Int64, flowStepEntity.FlowStatus.InAuthorID);

                object objFlowStatusID = db.ExecuteScalar(insertFlowSetCmd, (DbTransaction)transaction);
                if (objFlowStatusID == null)
                {
                    throw new Exception("新增审稿状态出现异常,得到的流程状态ID为空");
                }
                FlowStatusID = TypeParse.ToLong(objFlowStatusID, 0);
                if (FlowStatusID == 0)
                {
                    throw new Exception("新增审稿状态出现异常,得到的流程状态ID为0");
                }

                # endregion

                # region Insert FlowConfig,流程状态配置信息

                StringBuilder sqlInsertFlowConfig = new StringBuilder();

                sqlInsertFlowConfig.Append("@JournalID");
                sqlInsertFlowConfig.Append(", @StatusID");
                sqlInsertFlowConfig.Append(", @IsAllowBack");
                sqlInsertFlowConfig.Append(", @IsMultiPerson");
                sqlInsertFlowConfig.Append(", @MultiPattern");
                sqlInsertFlowConfig.Append(", @TimeoutDay");
                sqlInsertFlowConfig.Append(", @TimeoutPattern");
                sqlInsertFlowConfig.Append(", @IsSMSRemind");
                sqlInsertFlowConfig.Append(", @IsEmailRemind");
                sqlInsertFlowConfig.Append(", @RangeDay");
                sqlInsertFlowConfig.Append(", @RemindCount");
                sqlInsertFlowConfig.Append(", @IsRetraction");

                DbCommand cmdInsertFlowConfig = db.GetSqlStringCommand(String.Format("INSERT INTO dbo.FlowConfig ({0}) VALUES ({1})", sqlInsertFlowConfig.ToString().Replace("@", ""), sqlInsertFlowConfig.ToString()));

                db.AddInParameter(cmdInsertFlowConfig, "@JournalID", DbType.Int64, flowStepEntity.FlowConfig.JournalID);
                db.AddInParameter(cmdInsertFlowConfig, "@StatusID", DbType.Int64, FlowStatusID);
                db.AddInParameter(cmdInsertFlowConfig, "@IsAllowBack", DbType.Byte, flowStepEntity.FlowConfig.IsAllowBack);
                db.AddInParameter(cmdInsertFlowConfig, "@IsMultiPerson", DbType.Boolean, flowStepEntity.FlowConfig.IsMultiPerson);
                db.AddInParameter(cmdInsertFlowConfig, "@MultiPattern", DbType.Byte, flowStepEntity.FlowConfig.MultiPattern);
                db.AddInParameter(cmdInsertFlowConfig, "@TimeoutDay", DbType.Int32, flowStepEntity.FlowConfig.TimeoutDay);
                db.AddInParameter(cmdInsertFlowConfig, "@TimeoutPattern", DbType.Byte, flowStepEntity.FlowConfig.TimeoutPattern);
                db.AddInParameter(cmdInsertFlowConfig, "@IsSMSRemind", DbType.Boolean, flowStepEntity.FlowConfig.IsSMSRemind);
                db.AddInParameter(cmdInsertFlowConfig, "@IsEmailRemind", DbType.Boolean, flowStepEntity.FlowConfig.IsEmailRemind);
                db.AddInParameter(cmdInsertFlowConfig, "@RangeDay", DbType.Int32, flowStepEntity.FlowConfig.RangeDay);
                db.AddInParameter(cmdInsertFlowConfig, "@RemindCount", DbType.Int32, flowStepEntity.FlowConfig.RemindCount);
                db.AddInParameter(cmdInsertFlowConfig, "@IsRetraction", DbType.Boolean, flowStepEntity.FlowConfig.IsRetraction);

                db.ExecuteNonQuery(cmdInsertFlowConfig,(DbTransaction)transaction);

                # endregion

                transaction.Commit();
                flag = true;
            }
Esempio n. 7
0
 /// <summary>
 /// 新增审稿环节
 /// </summary>
 /// <param name="flowStepEntity"></param>
 /// <returns></returns>
 public ExecResult AddFlowStatus(FlowStep flowStepEntity)
 {
     HttpClientHelper clientHelper = new HttpClientHelper();
     ExecResult execResult = clientHelper.PostAuth<ExecResult, FlowStep>(GetAPIUrl(APIConstant.FLOW_ADDFLOWSTATUS), flowStepEntity);
     return execResult;
 }
Esempio n. 8
0
 /// <summary>
 /// 新增审稿流程环节及配置
 /// </summary>
 /// <param name="flowSet">FlowSetEntity实体对象</param>
 /// <returns>true:存储成功 false:存储失败</returns>
 public bool AddFlowStatus(FlowStep flowStepEntity)
 {
     return FlowStatusDataAccess.Instance.AddFlowSet(flowStepEntity);
 }
Esempio n. 9
0
 /// <summary>
 /// 更新流程状态基本信息及配置信息
 /// </summary>
 /// <param name="flowSet">FlowSetEntity实体对象</param>
 /// <returns>true:更新成功 false:更新失败</returns>
 public bool UpdateFlowStatus(FlowStep flowStepEntity)
 {
     return FlowStatusDataAccess.Instance.UpdateFlowStatus(flowStepEntity);
 }