Exemple #1
0
        public ResponseResult <List <EntityInfoView> > GetEntityInfoTop10()
        {
            var result = ResponseResult <List <EntityInfoView> > .Default();

            try
            {
                var list = FBDataService.GetEntityInfoTop10();
                result = ResponseResult <List <EntityInfoView> > .Success(list);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <List <EntityInfoView> > .Error(
                    string.Format("获取有最近更新的表单记录失败,错误{0}", ex.Message)
                    );
            }
            return(result);
        }
Exemple #2
0
        public ResponseResult SendEMail(dynamic email)
        {
            ResponseResult result = ResponseResult.Default();

            try
            {
                var logInfoModel = new LogInfoModel();
                logInfoModel.SendEMail(email);
                result = ResponseResult.Success();
            }
            catch
            {
                result = ResponseResult.Error("发送邮件发生错误!");
            }

            return(result);
        }
Exemple #3
0
        public ResponseResult <ProductOrderEntity> SyncOrder()
        {
            var result = ResponseResult <ProductOrderEntity> .Default();

            try
            {
                var entity = ProductOrderService.SyncOrder();
                result = ResponseResult <ProductOrderEntity> .Success(entity, "同步订单数据成功!");
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <ProductOrderEntity> .Error(
                    string.Format("同步订单{0}失败, 错误:{1}", "ProductOrder", ex.Message)
                    );
            }
            return(result);
        }
Exemple #4
0
        public ResponseResult <ProcessFileEntity> QueryProcessFileByID([FromBody] ProcessFileQuery query)
        {
            var result = ResponseResult <ProcessFileEntity> .Default();

            try
            {
                var wfService = new WorkflowService();
                var entity    = wfService.GetProcessFileByID(query.ID);

                result = ResponseResult <ProcessFileEntity> .Success(entity);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <ProcessFileEntity> .Error(LocalizeHelper.GetDesignerMessage("wf2xmlcontroller.queryprocessfile.error", ex.Message));
            }
            return(result);
        }
Exemple #5
0
        public ResponseResult <List <ProcessEntity> > GetProcessListSimple()
        {
            var result = ResponseResult <List <ProcessEntity> > .Default();

            try
            {
                var wfService = new WorkflowService();
                var entity    = wfService.GetProcessListSimple().ToList();

                result = ResponseResult <List <ProcessEntity> > .Success(entity);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <List <ProcessEntity> > .Error(LocalizeHelper.GetDesignerMessage("wf2xmlcontroller.getprocesslist.error", ex.Message));
            }
            return(result);
        }
        public ResponseResult SaveResource(ResourceEntity entity)
        {
            var result = ResponseResult.Default();

            try
            {
                var resourceService = new ResourceService();
                resourceService.SaveResource(entity);

                result = ResponseResult.Success();
            }
            catch (System.Exception ex)
            {
                result = ResponseResult.Error(string.Format("保存资源数据失败!{0}", ex.Message));
            }
            return(result);
        }
        public ResponseResult AddRoleUser(RoleUserEntity entity)
        {
            var result = ResponseResult.Default();

            try
            {
                var roleService = new RoleService();
                roleService.AddRoleUser(entity);

                result = ResponseResult.Success();
            }
            catch (System.Exception ex)
            {
                result = ResponseResult.Error(string.Format("添加用户到角色失败!{0}", ex.Message));
            }
            return(result);
        }
        public ResponseResult <List <EntityAttributeEntity> > GetEntityAttributeList(int id)
        {
            var result = ResponseResult <List <EntityAttributeEntity> > .Default();

            try
            {
                var list = FBMasterService.GetEntityAttributeList(id);
                result = ResponseResult <List <EntityAttributeEntity> > .Success(list);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <List <EntityAttributeEntity> > .Error(
                    string.Format("读取表单字段发生错误:{0}", ex.Message)
                    );
            }
            return(result);
        }
        public ResponseResult <EntityAttributeListView> GetEntityAttributeComp(int id)
        {
            var result = ResponseResult <EntityAttributeListView> .Default();

            try
            {
                var entity = FBMasterService.GetEntityAttributeComp(id);
                result = ResponseResult <EntityAttributeListView> .Success(entity);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <EntityAttributeListView> .Error(
                    string.Format("读取表单字段数据发生错误:{0}", ex.Message)
                    );
            }
            return(result);
        }
Exemple #10
0
        public ResponseResult <HrsLeaveEntity> GetLeave(int id)
        {
            var result = ResponseResult <HrsLeaveEntity> .Default();

            try
            {
                var hrsService = new HrsLeaveService();
                var entity     = hrsService.GetByID(id);

                result = ResponseResult <HrsLeaveEntity> .Success(entity);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <HrsLeaveEntity> .Error(ex.Message);
            }
            return(result);
        }
Exemple #11
0
        public ResponseResult <List <HrsLeaveEntity> > QueryLeave([FromBody] HrsLeaveQuery query)
        {
            var result = ResponseResult <List <HrsLeaveEntity> > .Default();

            try
            {
                var hrsService = new HrsLeaveService();
                var list       = hrsService.QueryLeave(query);

                result = ResponseResult <List <HrsLeaveEntity> > .Success(list);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <List <HrsLeaveEntity> > .Error(ex.Message);
            }
            return(result);
        }
Exemple #12
0
        public ResponseResult <ProcessFileEntity> QueryProcessFile([FromBody] ProcessFileQuery query)
        {
            var result = ResponseResult <ProcessFileEntity> .Default();

            try
            {
                var wfService = new WorkflowService();
                var entity    = wfService.GetProcessFile(query.ProcessGUID, query.Version);

                result = ResponseResult <ProcessFileEntity> .Success(entity);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <ProcessFileEntity> .Error(ex.Message);
            }
            return(result);
        }
Exemple #13
0
        public ResponseResult <dynamic> GetEntityInfoWithAttrValue(int id)
        {
            var result = ResponseResult <dynamic> .Default();

            try
            {
                var entity = FBDataService.GetEntityInfoWithAttrValue(id);
                result = ResponseResult <dynamic> .Success(entity);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <dynamic> .Error(
                    string.Format("获取单挑表单数据失败,错误{0}", ex.Message)
                    );
            }
            return(result);
        }
Exemple #14
0
        public ResponseResult <List <EntityAttrValueItem> > QueryEntityAttrValue(EntityInfoEntity entity)
        {
            var result = ResponseResult <List <EntityAttrValueItem> > .Default();

            try
            {
                var list = FBDataService.QueryEntityAttrValue(entity.ID);
                result = ResponseResult <List <EntityAttrValueItem> > .Success(list);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <List <EntityAttrValueItem> > .Error(
                    string.Format("获取表单属性记录失败,错误{0}", ex.Message)
                    );
            }
            return(result);
        }
Exemple #15
0
        public ResponseResult <dynamic> Insert <T>(T entity) where T : class
        {
            var result = ResponseResult <dynamic> .Default();

            try
            {
                var newId = QuickRepository.Insert <T>(entity);
                result = ResponseResult <dynamic> .Success(newId, "插入数据成功!");
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <dynamic> .Error(
                    string.Format("插入数据{0}失败, 异常信息:{1}", typeof(T).ToString(), ex.Message)
                    );
            }
            return(result);
        }
        public ResponseResult <EntityDefEntity> GetEntityDefByID(int id)
        {
            var result = ResponseResult <EntityDefEntity> .Default();

            try
            {
                var entity = QuickReporsitory.GetById <EntityDefEntity>(id);
                result = ResponseResult <EntityDefEntity> .Success(entity);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <EntityDefEntity> .Error(
                    string.Format("读取{0}数据失败, 错误:{1}", "EntityDef", ex.Message)
                    );
            }
            return(result);
        }
Exemple #17
0
        public ResponseResult DeleteProcess(ProcessEntity entity)
        {
            var result = ResponseResult.Default();

            try
            {
                var wfService = new WorkflowService();
                wfService.DeleteProcess(entity.ProcessGUID, entity.Version);

                result = ResponseResult.Success();
            }
            catch (System.Exception ex)
            {
                result = ResponseResult.Error(string.Format("删除流程记录失败,错误:{0}", ex.Message));
            }
            return(result);
        }
        public ResponseResult <EntityAttributeEntity> SaveAttributeWithTemplate(EntityAttributeView view)
        {
            var result = ResponseResult <EntityAttributeEntity> .Default();

            try
            {
                var attrEntity = FBMasterService.SaveAttributeWithTemplate(view);
                result = ResponseResult <EntityAttributeEntity> .Success(attrEntity);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <EntityAttributeEntity> .Error(
                    string.Format("保存字段和表单模板内容失败, 错误:{0}", ex.Message)
                    );
            }
            return(result);
        }
Exemple #19
0
        public ResponseResult <NextStepInfo> GetNextStepInfo([FromBody] WfAppRunner runner)
        {
            var result = ResponseResult <NextStepInfo> .Default();

            try
            {
                var wfService = new WorkflowService();

                var nextStepInfo = wfService.GetNextStepInfo(runner, runner.Conditions);
                result = ResponseResult <NextStepInfo> .Success(nextStepInfo);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <NextStepInfo> .Error(ex.Message);
            }
            return(result);
        }
        public ResponseResult DeleteAttributeWithTemplate(EntityAttributeListView view)
        {
            var result = ResponseResult.Default();

            try
            {
                var isOk = FBMasterService.DeleteAttributeWithTemplate(view);
                result = ResponseResult.Success();
            }
            catch (System.Exception ex)
            {
                result = ResponseResult.Error(
                    string.Format("保存字段和表单模板内容失败, 错误:{0}", ex.Message)
                    );
            }
            return(result);
        }
        public ResponseResult DeleteRole(RoleEntity entity)
        {
            var result = ResponseResult.Default();

            try
            {
                var roleService = new RoleService();
                roleService.DeleteRole(entity);

                result = ResponseResult.Success();
            }
            catch (System.Exception ex)
            {
                result = ResponseResult.Error(string.Format("删除角色数据失败!{0}", ex.Message));
            }
            return(result);
        }
        public ResponseResult <List <EntityDefEntity> > GetEntityDefList2()
        {
            var result = ResponseResult <List <EntityDefEntity> > .Default();

            try
            {
                var list = FBMasterService.GetEntityDefList2();
                result = ResponseResult <List <EntityDefEntity> > .Success(list);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <List <EntityDefEntity> > .Error(
                    string.Format("读取{0}数据失败, 错误:{1}", "EntityDefList", ex.Message)
                    );
            }
            return(result);
        }
Exemple #23
0
        public ResponseResult <ProcessEntity> GetProcessByVersion([FromBody] ProcessEntity obj)
        {
            var result = ResponseResult <ProcessEntity> .Default();

            try
            {
                var wfService = new WorkflowService();
                var entity    = wfService.GetProcessByVersion(obj.ProcessGUID, obj.Version);

                result = ResponseResult <ProcessEntity> .Success(entity);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <ProcessEntity> .Error(LocalizeHelper.GetDesignerMessage("wf2xmlcontroller.queryprocess.error", ex.Message));
            }
            return(result);
        }
Exemple #24
0
        public ResponseResult <T> Get <T>(dynamic id) where T : class
        {
            var result = ResponseResult <T> .Default();

            try
            {
                var entity = QuickRepository.GetById <T>(id);
                result = ResponseResult <T> .Success(entity, "读取数据成功!");
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <T> .Error(
                    string.Format("获取数据{0}失败, 异常信息:{1}!", typeof(T).ToString(), ex.Message)
                    );
            }
            return(result);
        }
        public ResponseResult Start2(WfAppRunner runner)
        {
            var            result = ResponseResult.Default();
            IDbConnection  conn   = SessionFactory.CreateConnection();
            IDbTransaction trans  = null;

            try
            {
                trans = conn.BeginTransaction();
                IWorkflowService wfService = new WorkflowService();
                //var wfResult = wfService.CreateRunner(runner)
                //            .Start(conn, trans);
                var wfResult = wfService.CreateRunner(runner.UserID, runner.UserName)
                               .UseApp(runner.AppInstanceID, runner.AppName, runner.AppInstanceCode)
                               .UseProcess(runner.ProcessGUID, runner.Version)
                               .Subscribe(EventFireTypeEnum.OnProcessStarted, (delegateContext, delegateService) => {
                    var processInstanceID = delegateContext.ProcessInstanceID;
                    return(true);
                })
                               .Start(conn, trans);
                if (wfResult.Status == WfExecutedStatus.Success)
                {
                    result = ResponseResult.Success(wfResult.Message);
                    trans.Commit();
                }
                else
                {
                    result = ResponseResult.Error(wfResult.Message);
                    trans.Rollback();
                }
            }
            catch (System.Exception ex)
            {
                result = ResponseResult.Error(ex.Message);
                trans.Rollback();
            }
            finally
            {
                trans.Dispose();
                if (conn.State == ConnectionState.Open)
                {
                    conn.Close();
                }
            }
            return(result);
        }
        public ResponseResult <List <NodeView> > GetFirstStepRoleUserTree([FromBody] WfAppRunner runner)
        {
            var result = ResponseResult <List <NodeView> > .Default();

            try
            {
                var wfservice    = new WorkflowService();
                var nodeViewList = wfservice.GetFirstActivityRoleUserTree(runner, runner.Conditions).ToList <NodeView>();
                result = ResponseResult <List <NodeView> > .Success(nodeViewList, "获取流程第一个办理节点信息成功!");
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <List <NodeView> > .Error(string.Format(
                                                                      " 读取第一个办理节点发生异常: {0}",
                                                                      ex.Message));
            }
            return(result);
        }
        public ResponseResult <List <NodeView> > GetNextStepRoleUserTree([FromBody] WfAppRunner runner)
        {
            var result = ResponseResult <List <NodeView> > .Default();

            try
            {
                var wfservice    = new WorkflowService();
                var nodeViewList = wfservice.GetNextActivityRoleUserTree(runner).ToList <NodeView>();
                result = ResponseResult <List <NodeView> > .Success(nodeViewList, "获取流程下一步信息成功!");
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <List <NodeView> > .Error(string.Format(
                                                                      " 请确认角色身份是否切换?! {0}",
                                                                      ex.Message));
            }
            return(result);
        }
        [HttpPost("QueryReadyTasks")]//pass
        public ResponseResult <WorkTaskPageView> QueryReadyTasks([FromBody] WorkTaskQueryParm query)
        {
            var result = ResponseResult <WorkTaskPageView> .Default();

            try
            {
                var _service = new ResourceService();
                var itemList = _service.GetReadyTasks(query);
                result = ResponseResult <WorkTaskPageView> .Success(itemList);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <WorkTaskPageView> .Error(string.Format(
                                                                      "获取当前用户待办任务数据失败, 异常信息:{0}",
                                                                      ex.Message));
            }
            return(result);
        }
        public ResponseResult <List <Role> > QueryProcessRoleUserList([FromBody] ProcessQuery query)
        {
            var result = ResponseResult <List <Role> > .Default();

            try
            {
                var wfService = new WorkflowService();
                var roleList  = wfService.GetRoleUserListByProcess(query.ProcessGUID, query.Version).ToList();
                result = ResponseResult <List <Role> > .Success(roleList, "成功获取流程定义的角色用户数据!");
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <List <Role> > .Error(string.Format(
                                                                  "获取流程定义的角色用户数据失败, 异常信息:{0}",
                                                                  ex.Message));
            }
            return(result);
        }
Exemple #30
0
        public ResponseResult TriggerTimingStartupProcess()
        {
            var result = ResponseResult.Default();

            try
            {
                var scheService = new SchedulerService();
                var processList = scheService.GetStartupTimingProcessList();

                var message = scheService.TriggerTimingStartupProcess(processList[0]);
                result = ResponseResult.Success(message);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult.Error(ex.Message);
            }
            return(result);
        }