Exemplo n.º 1
0
        public JsonResult GetSystemOperLogInfos(SysOperationLogInfoModel info)
        {
            LayuiGridResult result = new LayuiGridResult()
            {
                code = 0
            };
            var list = new AdminOperLogManager().GetAdminOperationLogList(info.StartCreationDate, info.EndCreationDate, info.Name, info.Description, info.OperationName, info.PageIndex - 1, info.PageSize);

            result = new LayuiGridResult {
                data = list.Data, msg = "成功", count = list.TotalCount
            };
            return(Json(result, JsonRequestBehavior.AllowGet));
        }
Exemplo n.º 2
0
        public JsonResult CompleteRecharge()
        {
            try
            {
                string orderId = PreconditionAssert.IsNotEmptyString(Request["orderId"], "订单ID不能为空");
                if (!string.IsNullOrWhiteSpace(Request["sta"]) && Request["sta"] == "Fail")
                {
                    var result = base.FundClient.ManualCompleteFillMoneyOrder(orderId, GameBiz.Core.FillMoneyStatus.Failed, CurrentUser1.UserToken);

                    AdminOperLogManager operLog = new AdminOperLogManager();
                    operLog.AddOperationLog(new AdminOperationLog()
                    {
                        CreationDate  = DateTime.Now,
                        Description   = string.Format("操作员【{0}】充值手工置为失败【{1}】,订单号【{2}】", User.Identity.Name, result.IsSuccess ? "成功" : "失败", orderId),
                        OperationName = "手工充值",
                        OperUserId    = CurUser.UserId,
                        UserId        = ""
                    });
                    return(Json(new { IsSuccess = result.IsSuccess, Msg = (result.IsSuccess ? "手工置为失败成功" : "手工置为失败失败") }));
                }
                else
                {
                    var result = base.FundClient.ManualCompleteFillMoneyOrder(orderId, GameBiz.Core.FillMoneyStatus.Success, CurrentUser1.UserToken);

                    AdminOperLogManager operLog = new AdminOperLogManager();
                    operLog.AddOperationLog(new AdminOperationLog()
                    {
                        CreationDate  = DateTime.Now,
                        Description   = string.Format("操作员【{0}】充值手工置为成功【{1}】,订单号【{2}】", User.Identity.Name, result.IsSuccess ? "成功" : "失败", orderId),
                        OperationName = "手工充值",
                        OperUserId    = CurUser.UserId,
                        UserId        = ""
                    });
                    return(Json(new { IsSuccess = result.IsSuccess, Msg = result.Message }));
                }
            }
            catch (Exception ex)
            {
                return(Json(new { IsSuccess = false, Msg = ex.Message }));
            }
        }
Exemplo n.º 3
0
        public JsonResult UpdateRoleFunciton(OperationRoleModel model)
        {
            CommonResult r = new CommonResult();

            try
            {
                if (!CheckRights("UPDATEROLE"))
                {
                    r.code    = (int)ResultCodeEnum.NoAuth;
                    r.message = "您没有修改角色的权限";
                    return(Json(r));
                }
                var roleInfo = new AdminRole();
                roleInfo.Name = PreconditionAssert.IsNotEmptyString(model.RoleName, "角色名不能为空");
                roleInfo.Id   = PreconditionAssert.IsNotEmptyString(model.RoleId, "角色编号不能为空");
                var roleById = RoleManager.FindById(model.RoleId);
                if (roleById == null)
                {
                    r.code    = (int)ResultCodeEnum.NotFound;
                    r.message = "指定的角色不存在";
                    return(Json(r));
                }
                var roleCount = RoleManager.GetRoleCountByRoleName(model.RoleName);
                if (roleCount >= 2)
                {
                    r.code    = (int)ResultCodeEnum.NotFound;
                    r.message = "指定的角色已经存在";
                    return(Json(r));
                }
                if (IdentityManager.RoleType.SuperAdmin == model.RoleType)
                {
                    var res = RoleManager.UpdateRole(roleInfo);// GlobalCache.ExternalClient.UpdateSystemRole(roleInfo, CurrentUser.UserToken);
                    if (res > 0)
                    {
                        r.code    = (int)ResultCodeEnum.OK;
                        r.message = "更新成功";
                    }
                    else
                    {
                        r.code    = (int)ResultCodeEnum.SystemError;
                        r.message = "更新失败";
                    }
                    return(Json(r));
                }
                var funIds = (List <string>)(PreconditionAssert.IsNotNull(model.FunctionIds, "功能编号集异常"));

                var pers = funIds.Select(p =>
                {
                    return(new AdminRolePermission()
                    {
                        RoleId = model.RoleId,
                        PermissionId = p,
                        CreationDate = DateTime.Now
                    });
                }).ToList();

                AdminRolePermissionManager m = new AdminRolePermissionManager();
                m.DeleteAndAddRolePermissions(model.RoleId, pers);
                AdminOperLogManager operLog = new AdminOperLogManager();
                operLog.AddOperationLog(new AdminOperationLog()
                {
                    CreationDate  = DateTime.Now,
                    Description   = "操作员【" + User.Identity.Name + "】修改角色,角色名称:" + model.RoleName + ",角色编号:" + model.RoleId,
                    OperationName = "角色管理",
                    OperUserId    = CurUser.UserId,
                    UserId        = ""
                });

                RoleManager.UpdateRole(roleInfo);
                return(Json(r));
            }
            catch (Exception ex)
            {
                logger.Error("UpdateRoleFunciton", ex);
                return(Json(new { IsSuccess = false, Msg = ex.Message }));
            }
        }