| | |
| | | using System.Data; |
| | | using Model.ModelDto.LogDto; |
| | | using Utility; |
| | | using Model.ModelVm.LogVm; |
| | | |
| | | namespace Wms.Controllers |
| | | { |
| | |
| | | /// <exception cref="System.Exception">捕获异常</exception> |
| | | [HttpPost] |
| | | [ServiceFilter(typeof(ApiResponseActionFilter))] |
| | | [UnitOfWork] |
| | | public async Task InsertUserinfo(UserInfoDto UserInfoDto) |
| | | { |
| | | await _userInforServer.InsertUserInfo(UserInfoDto); |
| | | await _operation.InsertOperation("系统设置", "用户管理", UserInfoDto.UserNo, "添加", "添加用户信息 用户号:" + UserInfoDto.UserNo, _userManager.UserId); |
| | | |
| | | await _operation.InsertOperation(new OperationInputVm() |
| | | { |
| | | ParentName = "系统设置", |
| | | MenuName = "用户管理", |
| | | FkNo = UserInfoDto.UserNo, |
| | | TypeName = "添加", |
| | | Msg = "添加用户信息 用户号:" + UserInfoDto.UserNo |
| | | }); |
| | | } |
| | | |
| | | |
| | |
| | | /// <exception cref="System.Exception">异常</exception> |
| | | [HttpGet] |
| | | [ServiceFilter(typeof(ApiResponseActionFilter))] |
| | | [UnitOfWork] |
| | | public async Task DeleteUserInfo(int userids) |
| | | { |
| | | //获取用户信息 |
| | | SysUserInfor user = await _userInforServer.GetUserInfoById(userids); |
| | | await _userInforServer.DeleteUserinfo(user); |
| | | await _operation.InsertOperation("系统设置", "用户管理", user.UserNo, "删除", "删除用户信息 用户号:" + user.UserNo, _userManager.UserId); |
| | | await _operation.InsertOperation(new OperationInputVm() |
| | | { |
| | | ParentName = "系统设置", |
| | | MenuName = "用户管理", |
| | | FkNo = user.UserNo, |
| | | TypeName = "删除", |
| | | Msg = "删除用户信息 用户号:" + user.UserNo |
| | | }); |
| | | } |
| | | |
| | | |
| | |
| | | /// <exception cref="System.Exception">捕获异常</exception> |
| | | [HttpPost] |
| | | [ServiceFilter(typeof(ApiResponseActionFilter))] |
| | | [UnitOfWork] |
| | | public async Task UpdateUserinfo(UserInfoDto userdto) |
| | | { |
| | | await _userInforServer.UpdateUserinfo(userdto); |
| | | await _operation.InsertOperation("系统设置", "用户管理", userdto.UserNo, "修改", "修改用户信息 用户号:" + userdto.UserNo, _userManager.UserId); |
| | | |
| | | await _operation.InsertOperation(new OperationInputVm() |
| | | { |
| | | ParentName = "系统设置", |
| | | MenuName = "用户管理", |
| | | FkNo = userdto.UserNo, |
| | | TypeName = "编辑", |
| | | Msg = "修改用户信息 用户号:" + userdto.UserNo |
| | | }); |
| | | } |
| | | |
| | | |
| | |
| | | //获取当前操作用户id |
| | | SysUserInfor user = await _userInforServer.GetUserInfoById(_userManager.UserId); |
| | | if (user == null) |
| | | { |
| | | throw Oops.Bah("找不到用户信息"); |
| | | } |
| | | if (user.PassWord != pwdOld) |
| | | { |
| | | throw Oops.Bah("原密码不正确"); |
| | | } |
| | | else |
| | | { |
| | | //修改密码 |
| | | int i = await _userInforServer.UptUserPassWord(pwdNew, _userManager.UserId); |
| | | if (i <= 0) |
| | | throw Oops.Bah("修改密码失败"); |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// x天后提醒用户修改密码 |
| | |
| | | public async Task InsertRoleInfo(RoleDto roledto) |
| | | { |
| | | await _rolesServer.InsertRoleInfo(roledto); |
| | | await _operation.InsertOperation("系统设置", "角色权限", roledto.RoleNo, "添加", "添加角色信息 角色号:" + roledto.RoleNo, _userManager.UserId); |
| | | |
| | | await _operation.InsertOperation(new OperationInputVm() |
| | | { |
| | | ParentName = "系统设置", |
| | | MenuName = "角色权限", |
| | | FkNo = roledto.RoleNo, |
| | | TypeName = "添加", |
| | | Msg = "添加角色信息 角色号:" + roledto.RoleNo |
| | | }); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | //根据角色id获取角色信息 |
| | | SysRoles role = await _rolesServer.GetRoleInfoById(roleids); |
| | | await _rolesServer.DeleteRoleInfo(role); |
| | | await _operation.InsertOperation("系统设置", "角色权限", role.RoleNo, "删除", "删除角色信息 角色号:" + role.RoleNo, _userManager.UserId); |
| | | await _operation.InsertOperation(new OperationInputVm() |
| | | { |
| | | ParentName = "系统设置", |
| | | MenuName = "角色权限", |
| | | FkNo = role.RoleNo, |
| | | TypeName = "删除", |
| | | Msg = "删除角色信息 角色号:" + role.RoleNo |
| | | }); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | public async Task UpdateRolesInfo(SysRoles role) |
| | | { |
| | | await _rolesServer.UpdateRoleInfo(role); |
| | | await _operation.InsertOperation("系统设置", "角色权限", role.RoleNo, "修改", "修改角色信息 角色号:" + role.RoleNo, _userManager.UserId); |
| | | await _operation.InsertOperation(new OperationInputVm() |
| | | { |
| | | ParentName = "系统设置", |
| | | MenuName = "角色权限", |
| | | FkNo = role.RoleNo, |
| | | TypeName = "编辑", |
| | | Msg = "修改角色信息 角色号:" + role.RoleNo |
| | | }); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | SysRoles roles = await _rolesServer.GetRoleInfoById(id); |
| | | //保存角色权限信息 |
| | | await _roleRightServer.InsertRoleRight(MenuNo, roles.RoleNo); |
| | | await _operation.InsertOperation("系统设置", "角色权限", roles.RoleNo, "修改", "分配角色权限 角色号:" + roles.RoleNo, _userManager.UserId); |
| | | |
| | | await _operation.InsertOperation(new OperationInputVm() |
| | | { |
| | | ParentName = "系统设置", |
| | | MenuName = "角色权限", |
| | | FkNo = roles.RoleNo, |
| | | TypeName = "编辑", |
| | | Msg = "分配角色权限 角色号:" + roles.RoleNo |
| | | }); |
| | | } |
| | | |
| | | #endregion |
| | |
| | | /// <summary> |
| | | /// 获取操作日志信息列表 |
| | | /// </summary> |
| | | /// <param name="menuName">菜单名称</param> |
| | | /// <param name="type">操作类型</param> |
| | | /// <param name="msg">操作内容</param> |
| | | /// <param name="menuNo">菜单号</param> |
| | | /// <param name="parentNo">模块号</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | public IActionResult GetSysOperationList(string menuName, string type, string msg, string menuNo, string parentNo) |
| | | [HttpPost] |
| | | [ServiceFilter(typeof(ApiResponseActionFilter))] |
| | | public async Task<SqlSugarPagedList<OperationDto>> GetSysOperationList(GetOperationVm model) |
| | | { |
| | | List<OperationDto> operation = _operation.GetSysOperationList(menuName, type, msg, menuNo, parentNo); |
| | | return Ok(new |
| | | { |
| | | data = operation, |
| | | code = 0, |
| | | msg = "成功" |
| | | }); |
| | | return await _operation.GetSysOperationList(model); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="dicName">字典名称</param> |
| | | /// <returns></returns> |
| | | [HttpGet] |
| | | public IActionResult GetDicTypeList(string dicName) |
| | | [ServiceFilter(typeof(ApiResponseActionFilter))] |
| | | public async Task<List<SysDictionary>> GetDicTypeList(string dicName) |
| | | { |
| | | List<SysDictionary> diclist = _operation.GetDicTypeList(dicName); |
| | | return Ok(new |
| | | { |
| | | data = diclist, |
| | | code = 0, |
| | | msg = "成功" |
| | | }); |
| | | return await _operation.GetDicTypeList(dicName); |
| | | } |
| | | |
| | | #endregion |