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

            try
            {
                var roleService = new RoleDataService();
                var roleList    = roleService.GetRoleAll().ToList();

                result = ResponseResult <List <RoleEntity> > .Success(roleList);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <List <RoleEntity> > .Error(
                    string.Format("获取角色数据失败!{0}", ex.Message)
                    );
            }
            return(result);
        }
        public ResponseResult <List <UserResourcePermissionView> > RetrieveUserResourceList(ResourceQuery query)
        {
            var result = ResponseResult <List <UserResourcePermissionView> > .Default();

            try
            {
                var resourceService = new ResourceDataService();
                var permissionList  = resourceService.RetrieveUserResourceList(query.UserID);

                result = ResponseResult <List <UserResourcePermissionView> > .Success(permissionList);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <List <UserResourcePermissionView> > .Error(
                    string.Format("获取用户资源权限数据失败!{0}", ex.Message)
                    );
            }
            return(result);
        }
Exemple #3
0
        public ResponseResult <List <ActivityEntity> > GetTaskActivityList(int id)
        {
            var result = ResponseResult <List <ActivityEntity> > .Default();

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

                result = ResponseResult <List <ActivityEntity> > .Success(entity);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <List <ActivityEntity> > .Error(
                    string.Format("获取任务节点信息失败!{0}", ex.Message)
                    );
            }
            return(result);
        }
        public ResponseResult <List <UserAccountEntity> > GetUserAll()
        {
            var result = ResponseResult <List <UserAccountEntity> > .Default();

            try
            {
                var roleService = new RoleService();
                var userList    = roleService.GetUserAll().ToList();

                result = ResponseResult <List <UserAccountEntity> > .Success(userList);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <List <UserAccountEntity> > .Error(
                    string.Format("获取用户数据失败!{0}", ex.Message)
                    );
            }
            return(result);
        }
        public async Task <ResponseResult> StartProcessAsync02([FromBody] WfAppRunner runner)
        {
            var    wfService = new WorkflowService();
            var    task      = wfService.StartProcessAsync(runner);
            string time      = string.Format("webapi time:{0}", System.DateTime.Now.ToString());

            System.Diagnostics.Debug.WriteLine(time);

            var result = await task;

            if (result.Status == WfExecutedStatus.Success)
            {
                return(ResponseResult.Success(task.Status));
            }
            else
            {
                return(ResponseResult.Error(result.Message));
            }
        }
        public ResponseResult <List <RoleResourcePermissionView> > GetRoleResourceList(ResourceQuery query)
        {
            var result = ResponseResult <List <RoleResourcePermissionView> > .Default();

            try
            {
                var resourceService = new ResourceService();
                var permissionList  = resourceService.GetResourceByRoleID(query.RoleID);

                result = ResponseResult <List <RoleResourcePermissionView> > .Success(permissionList);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <List <RoleResourcePermissionView> > .Error(
                    string.Format("获取角色资源权限数据失败!{0}", ex.Message)
                    );
            }
            return(result);
        }
        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(
                    string.Format("获取流程基本信息失败!{0}", ex.Message)
                    );
            }
            return(result);
        }
Exemple #8
0
        public ResponseResult <List <TransitionImage> > QueryCompletedTransitionInstance(TransitionInstanceQuery query)
        {
            var result = ResponseResult <List <TransitionImage> > .Default();

            try
            {
                var wfService = new WorkflowService();
                var itemList  = wfService.GetTransitionInstanceList(query).ToList();

                result = ResponseResult <List <TransitionImage> > .Success(itemList);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <List <TransitionImage> > .Error(string.Format(
                                                                             "获取已完成转移数据失败, 异常信息:{0}",
                                                                             ex.Message));
            }
            return(result);
        }
        public ResponseResult SaveTemplateWithHTMLContent(EntityDefEntity entity)
        {
            var result = ResponseResult.Default();

            try
            {
                IFBMasterService fbService = new FBMasterService();
                fbService.SaveTemplateWithHTMLContent(entity);

                result = ResponseResult.Success(string.Format("保存{0}数据成功!", "表单模板"));
            }
            catch (System.Exception ex)
            {
                result = ResponseResult.Error(
                    string.Format("保存{0}数据失败, 错误:{1}", "表单模板", ex.Message)
                    );
            }
            return(result);
        }
        public ResponseResult <EntityDefEntity> SaveEntityDef(EntityDefEntity entity)
        {
            var result = ResponseResult <EntityDefEntity> .Default();

            try
            {
                IFBMasterService fbService = new FBMasterService();
                var returnEntity           = fbService.SaveEntityDef(entity);

                result = ResponseResult <EntityDefEntity> .Success(returnEntity, string.Format("保存{0}数据成功!", "Form"));
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <EntityDefEntity> .Error(
                    string.Format("保存{0}数据失败, 错误:{1}", "Form", ex.Message)
                    );
            }
            return(result);
        }
Exemple #11
0
        public ResponseResult UpdateLeave([FromBody] HrsLeaveEntity entity)
        {
            var result = ResponseResult.Default();

            try
            {
                var hrsService = new HrsLeaveService();
                var entityDB   = hrsService.GetByID(entity.ID);
                entityDB.Opinions = entity.Opinions;
                hrsService.Update(entityDB);

                result = ResponseResult.Success();
            }
            catch (System.Exception ex)
            {
                result = ResponseResult.Error(ex.Message);
            }
            return(result);
        }
        public ResponseResult <ResourceNode> GetResourceNodeAll()
        {
            var result = ResponseResult <ResourceNode> .Default();

            try
            {
                var resourceService = new ResourceDataService();
                var resourceList    = resourceService.GetResourceNodeAll();

                result = ResponseResult <ResourceNode> .Success(resourceList);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <ResourceNode> .Error(
                    string.Format("获取资源节点数据失败!{0}", ex.Message)
                    );
            }
            return(result);
        }
Exemple #13
0
        public IActionResult Index(RoleQuery model)
        {
            var            response    = new ResponseResult <PaggingResult <RoleResult> >();
            List <SysRole> allDataList = null;

            using (_dbContext)
            {
                allDataList = _dbContext.SysRole.ToList();
            }
            var mapConfig = new MapperConfiguration(cfg => {
                cfg.CreateMap <int?, string>().ConvertUsing(new UtcStringTimeTypeConverter());
                cfg.CreateMap <DateTime?, string>().ConvertUsing(new UtcDateTimeTypeConverter());
                cfg.CreateMap <SysRole, RoleResult>();
            });
            var datas = allDataList.MapTo <SysRole, RoleResult
                                           >(mapConfig);

            return(Ok(response.Success("数据获取成功", new PaggingResult <RoleResult>(new Pagging(model.Page, model.PageSize, allDataList.Count), datas))));
        }
Exemple #14
0
        public ResponseResult <List <NodeView> > GetPrevActivityUserTree([FromBody] WfAppRunner runner)
        {
            var result = ResponseResult <List <NodeView> > .Default();

            try
            {
                var wfService = new WorkflowService();
                var prevSteps = wfService.GetPreviousActivityTree(runner).ToList();

                //追加模拟用户
                prevSteps = ProcessModelMimic.AppendMimicUser(prevSteps, runner).ToList();
                result    = ResponseResult <List <NodeView> > .Success(prevSteps);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <List <NodeView> > .Error(ex.Message);
            }
            return(result);
        }
        public ResponseResult CheckDispatched(int id)
        {
            //检查是否已经进入流程阶段
            var result = ResponseResult.Default();

            using (var session = DbFactory.CreateSession())
            {
                var orderEntity = session.GetRepository <ProductOrderEntity>().GetByID(id);
                if (orderEntity.Status == 1)
                {
                    result = ResponseResult.Success();
                }
                else
                {
                    result = ResponseResult.Error("订单已经进入流程状态,不能再次派单!");
                }
                return(result);
            }
        }
Exemple #16
0
        public ResponseResult <List <TaskEntity> > GetTaskList()
        {
            var result = ResponseResult <List <TaskEntity> > .Default();

            try
            {
                var wfService = new WfDataService();
                var entity    = wfService.GetTaskList().ToList();

                result = ResponseResult <List <TaskEntity> > .Success(entity);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <List <TaskEntity> > .Error(
                    string.Format("获取任务实例数据失败!{0}", ex.Message)
                    );
            }
            return(result);
        }
Exemple #17
0
        public IActionResult Index(DictDataQuery model)
        {
            var response = new ResponseResult <PaggingResult <DictDataModel> >();
            List <SysDictData> allDataList = null;
            var predicate = PredicateBuilder.True <SysDictData>();

            if (model.DictTypeId > 0)
            {
                predicate = predicate.And(a => a.DictTypeId == model.DictTypeId);
            }
            if (!string.IsNullOrEmpty(model.DictLabel))
            {
                predicate = predicate.And(a => a.DictLabel == model.DictLabel);
            }
            if (!string.IsNullOrEmpty(model.DictValue))
            {
                predicate = predicate.And(a => a.DictValue == model.DictValue);
            }
            if (model.Status > 0)
            {
                predicate = predicate.And(a => a.Status == model.Status);
            }
            using (_dbContext)
            {
                allDataList = (from dict in _dbContext.SysDictData
                               join dictType in _dbContext.SysDictType on dict.DictTypeId equals dictType.Id
                               where (model.DictTypeId > 0 ? dict.DictTypeId == model.DictTypeId : true) &&
                               (string.IsNullOrWhiteSpace(model.DictLabel) ? true : dict.DictLabel == model.DictLabel) &&
                               (string.IsNullOrWhiteSpace(model.DictValue) ? true : dict.DictValue == model.DictValue) &&
                               (model.Status > 0 ? dict.Status == model.Status : true) &&
                               (string.IsNullOrWhiteSpace(model.DictType) ? true : dictType.DictType == model.DictType)
                               select new SysDictData(dict, dictType.DictType, dictType.DictValueType)).ToList();
            }
            var mapConfig = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap <int?, string>().ConvertUsing(new UtcStringTimeTypeConverter());
                cfg.CreateMap <DateTime?, string>().ConvertUsing(new UtcDateTimeTypeConverter());
                cfg.CreateMap <SysDictData, DictDataModel>();
            });
            var datas = allDataList.MapTo <SysDictData, DictDataModel>(mapConfig);

            return(Ok(response.Success("数据获取成功", new PaggingResult <DictDataModel>(new Pagging(model.Page, model.PageSize, allDataList.Count), datas))));
        }
Exemple #18
0
        public async Task <ServiceResponse <GetProductGroupDto> > EditProductGroup(EditProductGroupDto editProductGroup)
        {
            var productgroup = await _dbContext.ProductGroups.FirstOrDefaultAsync(x => x.Id == editProductGroup.Id);

            if (productgroup == null)
            {
                return(ResponseResult.Failure <GetProductGroupDto>("productgroup not found."));
            }
            productgroup.Name        = editProductGroup.Name;
            productgroup.IsActive    = editProductGroup.IsActive;
            productgroup.UserId      = Guid.Parse(GetUserId());
            productgroup.CreatedDate = Now();
            _dbContext.ProductGroups.Update(productgroup);
            await _dbContext.SaveChangesAsync();

            var dto = _mapper.Map <GetProductGroupDto>(productgroup);

            return(ResponseResult.Success(dto));
        }
Exemple #19
0
        public ResponseResult <List <LogEntity> > GetLogList()
        {
            var result = ResponseResult <List <LogEntity> > .Default();

            try
            {
                var wfService = new WfDataService();
                var entity    = wfService.GetLogList().ToList();

                result = ResponseResult <List <LogEntity> > .Success(entity);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <List <LogEntity> > .Error(
                    string.Format("读取{0}数据失败, 错误:{1}", "Log", ex.Message)
                    );
            }
            return(result);
        }
Exemple #20
0
        public ResponseResult <List <Role> > GetRoleAll()
        {
            var result = ResponseResult <List <Role> > .Default();

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

                result = ResponseResult <List <Role> > .Success(entity);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <List <Role> > .Error(
                    string.Format("获取角色数据失败!{0}", ex.Message)
                    );
            }
            return(result);
        }
Exemple #21
0
        public ResponseResult <ProcessEntity> CreateProcess(ProcessEntity entity)
        {
            var result = ResponseResult <ProcessEntity> .Default();

            try
            {
                var wfService = new WorkflowService();
                var processID = wfService.CreateProcess(entity);

                entity.ID = processID;

                result = ResponseResult <ProcessEntity> .Success(entity);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <ProcessEntity> .Error(string.Format("创建流程记录失败,错误:{0}", ex.Message));
            }
            return(result);
        }
Exemple #22
0
        public ResponseResult SaveProcessFile(ProcessFileEntity entity)
        {
            var result = ResponseResult.Default();

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

                result = ResponseResult.Success();
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <ProcessFileEntity> .Error(
                    string.Format("保存流程XML文件失败!{0}", ex.Message)
                    );
            }
            return(result);
        }
Exemple #23
0
        public ResponseResult <ProcessEntity> GetProcess(string id)
        {
            var result = ResponseResult <ProcessEntity> .Default();

            try
            {
                var wfService = new WorkflowService();
                var entity    = wfService.GetProcess(id);

                result = ResponseResult <ProcessEntity> .Success(entity);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <ProcessEntity> .Error(
                    string.Format("获取流程基本信息失败!{0}", ex.Message)
                    );
            }
            return(result);
        }
Exemple #24
0
        public ResponseResult <ProcessFileEntity> QueryProcessFile(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(
                    string.Format("获取流程XML文件失败!{0}", ex.Message)
                    );
            }
            return(result);
        }
Exemple #25
0
        public ResponseResult CreateNewLeave([FromBody] HrsLeaveRunner entityRunner)
        {
            var result = ResponseResult.Default();

            try
            {
                var hrsService = new HrsLeaveService();
                var entity     = entityRunner.Entity;
                hrsService.RegisterWfAppRunner(entityRunner.Runner);
                hrsService.Submit(entity);

                result = ResponseResult.Success();
            }
            catch (System.Exception ex)
            {
                result = ResponseResult.Error(ex.Message);
            }
            return(result);
        }
        public async Task <ServiceResponse <GetProductDto> > EditProduct(EditProductDto editProduct)
        {
            //Find product from id
            var product = await _dBContext.Products.Include(x => x.ProductGroup).FirstOrDefaultAsync(x => x.Id == editProduct.Id);

            //return if not found
            if (product == null)
            {
                return(ResponseResult.Failure <GetProductDto>($"Product Id '{editProduct.Id}' is not found"));
            }

            var productGrp = await _dBContext.ProductGroups.FirstOrDefaultAsync(x => x.Id == editProduct.ProductGroupId);

            if (productGrp == null)
            {
                return(ResponseResult.Failure <GetProductDto>($"ProductGroup Id {editProduct.ProductGroupId} is not found"));
            }
            //let's update data
            try
            {
                product.Name           = editProduct.Name;
                product.Price          = editProduct.Price;
                product.ProductGroupId = editProduct.ProductGroupId;
                product.StockCount     = editProduct.StockCount;
                product.IsActive       = editProduct.IsActive;
                //code update data
                _dBContext.Update(product);
                //Save update above
                await _dBContext.SaveChangesAsync();

                //Get productDto to return
                GetProductDto prodDto = _mapper.Map <GetProductDto>(product);
                return(ResponseResult.Success(prodDto));
            }
            catch (System.Exception ex)
            {
                //Write log
                _log.LogError($"Update product is error detail: {ex.Message}");
                //Return
                return(ResponseResult.Failure <GetProductDto>($"Update product error detail: {ex.Message}"));
            }
        }
Exemple #27
0
        public IActionResult GetAllMenus()
        {
            var            response = new ResponseResult <IEnumerable <MenuResult> >();
            List <SysMenu> sysMenus = null;

            using (_dbContext)
            {
                sysMenus = _dbContext.SysMenu.ToList();
            }
            if (sysMenus.IsEmpty())
            {
                return(Ok(response.Error(ResponseCode.ERROR_CODE__DB__NO_ROW, "请先添加菜单")));
            }
            var menuResults = from item in sysMenus.Where(a => a.ParentId == 0).OrderBy(a => a.OrderNum)
                              select new MenuResult
            {
                Id             = item.Id,
                MenuName       = item.MenuName,
                ParentId       = item.ParentId,
                OrderNum       = item.OrderNum,
                Url            = item.Url,
                MenuType       = item.MenuType,
                Visible        = item.Visible,
                Perms          = item.Perms,
                Icon           = item.Icon,
                IsFrame        = (byte)(item.MenuType == 1?2:0),
                Component      = string.Empty,
                CreateBy       = item.CreateBy,
                CreatedAt      = item.CreatedAt?.ToUtcDateTimeString(),
                UpdateBy       = item.UpdateBy,
                UpdatedAt      = item.UpdatedAt?.ToUtcDateTimeString(),
                Remark         = item.Remark,
                ChildrenList   = GetChildMenus(item.Id, sysMenus),
                RouteCache     = (byte)(item.MenuType == 1 ? 2 : 0),
                RouteComponent = string.Empty,
                RouteName      = string.Empty,
                RoutePath      = string.Empty,
            };

            return(Ok(response.Success("数据获取成功", menuResults)));
            //return Ok("{\"code\":0,\"data\":[{\"id\":53,\"menu_name\":\"系统管理\",\"parent_id\":0,\"order_num\":1,\"url\":\"\",\"menu_type\":1,\"visible\":1,\"perms\":\"\",\"icon\":\"cog\",\"is_frame\":2,\"component\":\"\",\"create_by\":0,\"created_at\":\"2019-10-23T14:07:28+08:00\",\"update_by\":81,\"updated_at\":\"2020-02-21T17:24:17+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":2,\"route_component\":\"\",\"children_list\":[{\"id\":111,\"menu_name\":\"用户管理\",\"parent_id\":53,\"order_num\":1,\"url\":\"/management/user\",\"menu_type\":1,\"visible\":1,\"perms\":\"\",\"icon\":\"user-circle\",\"is_frame\":2,\"component\":\"management/user\",\"create_by\":77,\"created_at\":\"2019-12-09T21:28:22+08:00\",\"update_by\":1,\"updated_at\":\"2019-12-24T17:06:42+08:00\",\"remark\":\"\",\"route_name\":\"management-user\",\"route_path\":\"management/user\",\"route_cache\":2,\"route_component\":\"management/user\",\"children_list\":[{\"id\":133,\"menu_name\":\"用户新增\",\"parent_id\":111,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:user:add\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T18:12:10+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T18:12:10+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]},{\"id\":132,\"menu_name\":\"用户查询\",\"parent_id\":111,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:user:query\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T18:11:39+08:00\",\"update_by\":1,\"updated_at\":\"2019-12-24T17:09:55+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]},{\"id\":135,\"menu_name\":\"用户删除\",\"parent_id\":111,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:user:remove\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T18:12:43+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T18:12:43+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]},{\"id\":134,\"menu_name\":\"用户修改\",\"parent_id\":111,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:user:edit\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T18:12:30+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T18:12:30+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]}]},{\"id\":85,\"menu_name\":\"角色管理\",\"parent_id\":53,\"order_num\":2,\"url\":\"/management/role\",\"menu_type\":1,\"visible\":1,\"perms\":\"\",\"icon\":\"users\",\"is_frame\":2,\"component\":\"management/role\",\"create_by\":0,\"created_at\":\"2019-10-25T00:05:07+08:00\",\"update_by\":1,\"updated_at\":\"2019-12-21T19:22:08+08:00\",\"remark\":\"\",\"route_name\":\"management-role\",\"route_path\":\"management/role\",\"route_cache\":2,\"route_component\":\"management/role\",\"children_list\":[{\"id\":123,\"menu_name\":\"角色删除\",\"parent_id\":85,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:role:remove\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T18:02:27+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T18:02:27+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]},{\"id\":122,\"menu_name\":\"角色修改\",\"parent_id\":85,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:role:edit\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T18:02:12+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T18:02:12+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]},{\"id\":121,\"menu_name\":\"角色新增\",\"parent_id\":85,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:role:add\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T18:01:49+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T18:01:49+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]},{\"id\":120,\"menu_name\":\"角色查询\",\"parent_id\":85,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:role:query\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T18:01:29+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T18:01:29+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]},{\"id\":148,\"menu_name\":\"角色修改 - 数据权限\",\"parent_id\":85,\"order_num\":1,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:role:editData\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-29T15:24:52+08:00\",\"update_by\":1,\"updated_at\":\"2019-12-29T15:29:57+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]}]},{\"id\":81,\"menu_name\":\"菜单管理\",\"parent_id\":53,\"order_num\":3,\"url\":\"/management/menu\",\"menu_type\":1,\"visible\":1,\"perms\":\"\",\"icon\":\"navicon\",\"is_frame\":2,\"component\":\"management/menu\",\"create_by\":0,\"created_at\":\"2019-10-24T22:26:57+08:00\",\"update_by\":1,\"updated_at\":\"2019-12-21T19:22:01+08:00\",\"remark\":\"\",\"route_name\":\"management-menu\",\"route_path\":\"management/menu\",\"route_cache\":2,\"route_component\":\"management/menu\",\"children_list\":[{\"id\":119,\"menu_name\":\"菜单删除\",\"parent_id\":81,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:menu:remove\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T17:59:38+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T17:59:38+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]},{\"id\":118,\"menu_name\":\"菜单修改\",\"parent_id\":81,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:menu:edit\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T17:59:19+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T17:59:19+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]},{\"id\":117,\"menu_name\":\"菜单新增\",\"parent_id\":81,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:menu:add\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T17:58:58+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T17:58:58+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]},{\"id\":116,\"menu_name\":\"菜单查询\",\"parent_id\":81,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:menu:query\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T16:55:34+08:00\",\"update_by\":1,\"updated_at\":\"2019-12-22T17:57:50+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]}]},{\"id\":112,\"menu_name\":\"部门管理\",\"parent_id\":53,\"order_num\":4,\"url\":\"/management/dept\",\"menu_type\":1,\"visible\":1,\"perms\":\"\",\"icon\":\"bank\",\"is_frame\":2,\"component\":\"management/dept\",\"create_by\":77,\"created_at\":\"2019-12-10T08:51:52+08:00\",\"update_by\":1,\"updated_at\":\"2019-12-22T18:49:41+08:00\",\"remark\":\"\",\"route_name\":\"management-dept\",\"route_path\":\"management/dept\",\"route_cache\":2,\"route_component\":\"management/dept\",\"children_list\":[{\"id\":137,\"menu_name\":\"部门新增\",\"parent_id\":112,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:dept:add\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T18:13:29+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T18:13:29+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]},{\"id\":136,\"menu_name\":\"部门查询\",\"parent_id\":112,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:dept:query\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T18:13:14+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T18:13:14+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]},{\"id\":139,\"menu_name\":\"部门删除\",\"parent_id\":112,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:dept:remove\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T18:13:54+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T18:13:54+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]},{\"id\":138,\"menu_name\":\"部门修改\",\"parent_id\":112,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:dept:edit\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T18:13:42+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T18:13:42+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]}]},{\"id\":113,\"menu_name\":\"岗位管理\",\"parent_id\":53,\"order_num\":5,\"url\":\"/management/post\",\"menu_type\":1,\"visible\":1,\"perms\":\"\",\"icon\":\"briefcase\",\"is_frame\":2,\"component\":\"management/post\",\"create_by\":77,\"created_at\":\"2019-12-10T08:52:27+08:00\",\"update_by\":1,\"updated_at\":\"2019-12-22T18:49:56+08:00\",\"remark\":\"\",\"route_name\":\"management-post\",\"route_path\":\"management/post\",\"route_cache\":2,\"route_component\":\"management/post\",\"children_list\":[{\"id\":143,\"menu_name\":\"岗位删除\",\"parent_id\":113,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:post:remove\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T18:15:21+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T18:15:21+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]},{\"id\":142,\"menu_name\":\"岗位修改\",\"parent_id\":113,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:post:edit\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T18:15:07+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T18:15:07+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]},{\"id\":141,\"menu_name\":\"岗位新增\",\"parent_id\":113,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:post:add\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T18:14:48+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T18:14:48+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]},{\"id\":140,\"menu_name\":\"岗位查询\",\"parent_id\":113,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:post:query\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T18:14:28+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T18:14:28+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]}]},{\"id\":88,\"menu_name\":\"字典管理\",\"parent_id\":53,\"order_num\":6,\"url\":\"/management/dict\",\"menu_type\":1,\"visible\":1,\"perms\":\"\",\"icon\":\"book\",\"is_frame\":2,\"component\":\"management/dict\",\"create_by\":0,\"created_at\":\"2019-10-25T00:05:36+08:00\",\"update_by\":1,\"updated_at\":\"2019-12-22T18:50:03+08:00\",\"remark\":\"\",\"route_name\":\"management-dict\",\"route_path\":\"management/dict\",\"route_cache\":2,\"route_component\":\"management/dict\",\"children_list\":[{\"id\":127,\"menu_name\":\"字典删除\",\"parent_id\":88,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:dict:remove\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T18:04:56+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T18:04:56+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]},{\"id\":126,\"menu_name\":\"字典修改\",\"parent_id\":88,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:dict:edit\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T18:04:38+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T18:04:38+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]},{\"id\":125,\"menu_name\":\"字典新增\",\"parent_id\":88,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:dict:add\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T18:04:20+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T18:04:20+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]},{\"id\":124,\"menu_name\":\"字典查询\",\"parent_id\":88,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:dict:query\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T18:04:05+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T18:04:05+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]},{\"id\":149,\"menu_name\":\"字典详情\",\"parent_id\":88,\"order_num\":1,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:dict:detail\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-29T15:41:16+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-29T15:41:16+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]}]},{\"id\":115,\"menu_name\":\"字典数据\",\"parent_id\":53,\"order_num\":7,\"url\":\"/management/dict-data\",\"menu_type\":1,\"visible\":2,\"perms\":\"\",\"icon\":\"\",\"is_frame\":2,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T14:17:55+08:00\",\"update_by\":1,\"updated_at\":\"2019-12-22T18:50:14+08:00\",\"remark\":\"\",\"route_name\":\"management-dict-data\",\"route_path\":\"management/dict-data\",\"route_cache\":2,\"route_component\":\"management/dict-data\",\"children_list\":[{\"id\":145,\"menu_name\":\"字典数据新增\",\"parent_id\":115,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:dict-data:add\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T18:16:41+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T18:16:41+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]},{\"id\":144,\"menu_name\":\"字典数据查询\",\"parent_id\":115,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:dict-data:query\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T18:16:20+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T18:16:20+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]},{\"id\":147,\"menu_name\":\"字典数据删除\",\"parent_id\":115,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:dict-data:remove\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T18:17:15+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T18:17:15+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]},{\"id\":146,\"menu_name\":\"字典数据修改\",\"parent_id\":115,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:dict-data:edit\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T18:16:59+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T18:16:59+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]}]},{\"id\":94,\"menu_name\":\"参数设置\",\"parent_id\":53,\"order_num\":8,\"url\":\"/management/config\",\"menu_type\":1,\"visible\":1,\"perms\":\"\",\"icon\":\"cubes\",\"is_frame\":2,\"component\":\"management/config\",\"create_by\":0,\"created_at\":\"2019-10-28T20:26:04+08:00\",\"update_by\":1,\"updated_at\":\"2019-12-22T18:50:27+08:00\",\"remark\":\"\",\"route_name\":\"management-config\",\"route_path\":\"management/config\",\"route_cache\":2,\"route_component\":\"management/config\",\"children_list\":[{\"id\":131,\"menu_name\":\"参数删除\",\"parent_id\":94,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:config:remove\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T18:07:37+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T18:07:37+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]},{\"id\":130,\"menu_name\":\"参数修改\",\"parent_id\":94,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:config:edit\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T18:06:46+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T18:06:46+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]},{\"id\":129,\"menu_name\":\"参数新增\",\"parent_id\":94,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:config:add\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T18:06:30+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T18:06:30+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]},{\"id\":128,\"menu_name\":\"参数查询\",\"parent_id\":94,\"order_num\":0,\"url\":\"\",\"menu_type\":2,\"visible\":1,\"perms\":\"system:config:query\",\"icon\":\"\",\"is_frame\":0,\"component\":\"\",\"create_by\":1,\"created_at\":\"2019-12-22T18:06:01+08:00\",\"update_by\":0,\"updated_at\":\"2019-12-22T18:06:01+08:00\",\"remark\":\"\",\"route_name\":\"\",\"route_path\":\"\",\"route_cache\":0,\"route_component\":\"\",\"children_list\":[]}]}]}],\"msg\":\"OK\",\"time_stamp\":\"2020-04-06T14:12:28.909935396+08:00\"}");
        }
Exemple #28
0
        public ResponseResult AppAddTask(string taskName, string shipId, string routeId, string userId)
        {
            var        result     = ResponseResult.Default();
            AppService appService = new AppService();

            try
            {
                if (string.IsNullOrEmpty(taskName))
                {
                    return(ResponseResult.Error("taskId不能为空"));
                }
                if (string.IsNullOrEmpty(shipId))
                {
                    return(ResponseResult.Error("parameterId不能为空"));
                }
                if (string.IsNullOrEmpty(routeId))
                {
                    return(ResponseResult.Error("routeId不能为空"));
                }
                if (string.IsNullOrEmpty(userId))
                {
                    return(ResponseResult.Error("userId不能为空"));
                }
                else
                {
                    bool status = appService.AppAddTask(taskName, Convert.ToInt32(shipId), Convert.ToInt32(routeId), Convert.ToInt32(userId));
                    if (status == true)
                    {
                        return(ResponseResult.Success("添加成功"));
                    }
                    else
                    {
                        return(ResponseResult.Error("添加失败,同一用户下任务名不能重复"));
                    }
                }
            }
            catch (System.Exception ex)
            {
                result = ResponseResult.Error(ex.Message);
            }
            return(result);
        }
        public ResponseResult <List <ActivityInstanceEntity> > QueryReadyActivityInstance([FromBody] TaskQuery query)
        {
            var result = ResponseResult <List <ActivityInstanceEntity> > .Default();

            try
            {
                var wfService = new WorkflowService();
                var itemList  = wfService.GetRunningActivityInstance(query).ToList();


                result = ResponseResult <List <ActivityInstanceEntity> > .Success(itemList);
            }
            catch (System.Exception ex)
            {
                result = ResponseResult <List <ActivityInstanceEntity> > .Error(string.Format(
                                                                                    "获取待办任务数据失败, 异常信息:{0}",
                                                                                    ex.Message));
            }
            return(result);
        }
        [HttpPost("RunProcessApp")]//pass
        public ResponseResult RunProcessApp([FromBody] WfAppRunner runner)
        {
            using (var session = DbFactory.CreateSession())
            {
                var transaction = session.DbContext.Database.BeginTransaction();
                var wfService   = new WorkflowService();
                var result      = wfService.RunProcessApp(runner, session);

                if (result.Status == WfExecutedStatus.Success)
                {
                    transaction.Commit();
                    return(ResponseResult.Success());
                }
                else
                {
                    transaction.Rollback();
                    return(ResponseResult.Error(result.Message));
                }
            }
        }