diff --git a/EOM.TSHotelManagement.API/Controllers/Employee/EmployeeController.cs b/EOM.TSHotelManagement.API/Controllers/Employee/EmployeeController.cs index 08b9d8bdf769c8a3db5b5efd1219aa9c7267babb..64a0bad9dc6dec0e98ffba0c10a5704df3392b58 100644 --- a/EOM.TSHotelManagement.API/Controllers/Employee/EmployeeController.cs +++ b/EOM.TSHotelManagement.API/Controllers/Employee/EmployeeController.cs @@ -86,9 +86,9 @@ namespace EOM.TSHotelManagement.WebApi.Controllers [HttpPost] [AllowAnonymous] [IgnoreAntiforgeryToken] - public SingleOutputDto SelectEmployeeInfoByEmployeeIdAndEmployeePwd([FromBody] ReadEmployeeInputDto inputDto) + public SingleOutputDto EmployeeLogin([FromBody] EmployeeLoginDto inputDto) { - return workerService.SelectEmployeeInfoByEmployeeIdAndEmployeePwd(inputDto); + return workerService.EmployeeLogin(inputDto); } /// diff --git a/EOM.TSHotelManagement.Common/Constant/ConsumptionConstant.cs b/EOM.TSHotelManagement.Common/Constant/ConsumptionConstant.cs index 0efbcae53bfa768a1b47a655361eabe8e710f822..0e02f77717ab1ea81d4a462d7d0ba863d9906f8e 100644 --- a/EOM.TSHotelManagement.Common/Constant/ConsumptionConstant.cs +++ b/EOM.TSHotelManagement.Common/Constant/ConsumptionConstant.cs @@ -29,7 +29,7 @@ namespace EOM.TSHotelManagement.Common /// /// 结算状态常量 /// - public class ConsumptionConstant : ConstantBase + public class ConsumptionConstant : CodeConstantBase { public static readonly ConsumptionConstant Settled = new ConsumptionConstant("Settled", "已结算"); public static readonly ConsumptionConstant UnSettle = new ConsumptionConstant("UnSettle", "未结算"); diff --git a/EOM.TSHotelManagement.Common/Constant/SpendTypeConstant.cs b/EOM.TSHotelManagement.Common/Constant/SpendTypeConstant.cs index c6c22d1925fa812b3cf53e9172ec343cbd13ec6b..c03aee1695da5acd98a883f474e5f2b038246ecc 100644 --- a/EOM.TSHotelManagement.Common/Constant/SpendTypeConstant.cs +++ b/EOM.TSHotelManagement.Common/Constant/SpendTypeConstant.cs @@ -2,7 +2,7 @@ namespace EOM.TSHotelManagement.Common { - public class SpendTypeConstant : ConstantBase + public class SpendTypeConstant : CodeConstantBase { public static readonly SpendTypeConstant Product = new SpendTypeConstant("Product", "商品"); public static readonly SpendTypeConstant Room = new SpendTypeConstant("Room", "房间"); diff --git a/EOM.TSHotelManagement.Common/Constant/SystemConstant.cs b/EOM.TSHotelManagement.Common/Constant/SystemConstant.cs index e1fccebb86b46555f2e2e25594c51b2f98519ea9..afeb5e473b7c3f04c379b5ec5de4fdc2d43c7d1a 100644 --- a/EOM.TSHotelManagement.Common/Constant/SystemConstant.cs +++ b/EOM.TSHotelManagement.Common/Constant/SystemConstant.cs @@ -2,7 +2,7 @@ namespace EOM.TSHotelManagement.Common { - public class SystemConstant : ConstantBase + public class SystemConstant : CodeConstantBase { public static readonly SystemConstant MariaDB = new SystemConstant("MariaDB", "Maria DB"); public static readonly SystemConstant PgSql = new SystemConstant("PgSql", "Postgres SQL"); diff --git a/EOM.TSHotelManagement.Common/EOM.TSHotelManagement.Common.csproj b/EOM.TSHotelManagement.Common/EOM.TSHotelManagement.Common.csproj index 326cce3d1c1bbd917de53eafd0e42b9ec897ece9..ae9923076d977f1ac29ed680d0cf389b379b34f9 100644 --- a/EOM.TSHotelManagement.Common/EOM.TSHotelManagement.Common.csproj +++ b/EOM.TSHotelManagement.Common/EOM.TSHotelManagement.Common.csproj @@ -43,9 +43,9 @@ - diff --git a/EOM.TSHotelManagement.Common/Enums/AdminRole.cs b/EOM.TSHotelManagement.Common/Enums/AdminRole.cs new file mode 100644 index 0000000000000000000000000000000000000000..07d4855cbc7cca6ab0a98d00ea2b71c201519991 --- /dev/null +++ b/EOM.TSHotelManagement.Common/Enums/AdminRole.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Text; + +namespace EOM.TSHotelManagement.Common +{ + public enum AdminRole + { + [Description("超级管理员")] + SuperAdmin = 1, + [Description("管理员")] + Admin = 0, + } +} diff --git a/EOM.TSHotelManagement.Contract/Employee/Dto/Employee/EmployeeLoginDto.cs b/EOM.TSHotelManagement.Contract/Employee/Dto/Employee/EmployeeLoginDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..e6797240c2d9018aa26be7d780faa307428ed12f --- /dev/null +++ b/EOM.TSHotelManagement.Contract/Employee/Dto/Employee/EmployeeLoginDto.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace EOM.TSHotelManagement.Contract +{ + public class EmployeeLoginDto: BaseDto + { + public string EmployeeId { get; set; } + public string Password { get; set; } + public string EmailAddress { get; set; } + } +} diff --git a/EOM.TSHotelManagement.Contract/SystemManagement/Dto/Permission/AssignUserPermissionsInputDto.cs b/EOM.TSHotelManagement.Contract/SystemManagement/Dto/Permission/AssignUserPermissionsInputDto.cs index 491b4785a720b608436efeb7b6682843247788f1..d750f0ad4f9c9a695f49ef96c0813f7a85498a64 100644 --- a/EOM.TSHotelManagement.Contract/SystemManagement/Dto/Permission/AssignUserPermissionsInputDto.cs +++ b/EOM.TSHotelManagement.Contract/SystemManagement/Dto/Permission/AssignUserPermissionsInputDto.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace EOM.TSHotelManagement.Contract.SystemManagement.Dto.Permission +namespace EOM.TSHotelManagement.Contract { public class AssignUserPermissionsInputDto : BaseInputDto { diff --git a/EOM.TSHotelManagement.Contract/SystemManagement/Dto/Permission/UserRolePermissionOutputDto.cs b/EOM.TSHotelManagement.Contract/SystemManagement/Dto/Permission/UserRolePermissionOutputDto.cs index bc9aa1ebbc0d46d55e9a47eb95bdc2f44520a5d7..2e22503f512d6a5b8c05e43b0ab87ef102c05ef0 100644 --- a/EOM.TSHotelManagement.Contract/SystemManagement/Dto/Permission/UserRolePermissionOutputDto.cs +++ b/EOM.TSHotelManagement.Contract/SystemManagement/Dto/Permission/UserRolePermissionOutputDto.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace EOM.TSHotelManagement.Contract.SystemManagement.Dto.Permission +namespace EOM.TSHotelManagement.Contract { public class UserRolePermissionOutputDto : BaseOutputDto { diff --git a/EOM.TSHotelManagement.Infrastructure/Constant/ConstantBase.cs b/EOM.TSHotelManagement.Infrastructure/Constant/CodeConstantBase.cs similarity index 88% rename from EOM.TSHotelManagement.Infrastructure/Constant/ConstantBase.cs rename to EOM.TSHotelManagement.Infrastructure/Constant/CodeConstantBase.cs index 2a3f91ba7d7137274e2761160a248324e0012f36..9da800693db7de1afb4d654449ae384c2a40442f 100644 --- a/EOM.TSHotelManagement.Infrastructure/Constant/ConstantBase.cs +++ b/EOM.TSHotelManagement.Infrastructure/Constant/CodeConstantBase.cs @@ -1,13 +1,13 @@ namespace EOM.TSHotelManagement.Infrastructure { - public class ConstantBase where T : ConstantBase + public class CodeConstantBase where T : CodeConstantBase { public string Code { get; } public string Description { get; } private static List _constants = new List(); - protected ConstantBase(string code, string description) + protected CodeConstantBase(string code, string description) { Code = code; Description = description; diff --git a/EOM.TSHotelManagement.Service/Employee/EmployeeService.cs b/EOM.TSHotelManagement.Service/Employee/EmployeeService.cs index 7065b1a64b6013757d287a8f25fe76bedc3503c2..3794b8034375ea23e5aeabea9d7ebf8fd5aaaea2 100644 --- a/EOM.TSHotelManagement.Service/Employee/EmployeeService.cs +++ b/EOM.TSHotelManagement.Service/Employee/EmployeeService.cs @@ -352,11 +352,11 @@ namespace EOM.TSHotelManagement.Service } /// - /// 根据登录名称、密码查询员工信息 + /// 员工端登录 /// - /// + /// /// - public SingleOutputDto SelectEmployeeInfoByEmployeeIdAndEmployeePwd(ReadEmployeeInputDto readEmployeeInputDto) + public SingleOutputDto EmployeeLogin(EmployeeLoginDto employeeLoginDto) { Employee w = new Employee(); var helper = new EnumHelper(); @@ -369,7 +369,7 @@ namespace EOM.TSHotelManagement.Service Description = helper.GetEnumDescription(e) }) .ToList(); - w = workerRepository.GetFirst(a => a.EmployeeId == readEmployeeInputDto.EmployeeId || a.EmailAddress == readEmployeeInputDto.EmailAddress); + w = workerRepository.GetFirst(a => a.EmployeeId == employeeLoginDto.EmployeeId || a.EmailAddress == employeeLoginDto.EmailAddress); if (w == null) { w = null; @@ -379,11 +379,11 @@ namespace EOM.TSHotelManagement.Service try { - correctPassword = dataProtector.EncryptLibCompareEmployeeData(w.Password, readEmployeeInputDto.Password); + correctPassword = dataProtector.EncryptLibCompareEmployeeData(w.Password, employeeLoginDto.Password); } catch (Exception) { - correctPassword = dataProtector.CompareEmployeeData(w.Password, readEmployeeInputDto.Password); + correctPassword = dataProtector.CompareEmployeeData(w.Password, employeeLoginDto.Password); } if (!correctPassword) diff --git a/EOM.TSHotelManagement.Service/Employee/IEmployeeService.cs b/EOM.TSHotelManagement.Service/Employee/IEmployeeService.cs index a0aa98006e20a83c60708652f9db009e6844b51d..0caeb10d10326c4604ba580d1c686b3affa47c12 100644 --- a/EOM.TSHotelManagement.Service/Employee/IEmployeeService.cs +++ b/EOM.TSHotelManagement.Service/Employee/IEmployeeService.cs @@ -65,11 +65,11 @@ namespace EOM.TSHotelManagement.Service SingleOutputDto SelectEmployeeInfoByEmployeeId(ReadEmployeeInputDto readEmployeeInputDto); /// - /// 根据登录名称、密码查询员工信息 + /// 员工端登录 /// - /// + /// /// - SingleOutputDto SelectEmployeeInfoByEmployeeIdAndEmployeePwd(ReadEmployeeInputDto readEmployeeInputDto); + SingleOutputDto EmployeeLogin(EmployeeLoginDto employeeLoginDto); /// /// 修改员工账号密码 diff --git a/EOM.TSHotelManagement.Service/SystemManagement/Administrator/AdminService.cs b/EOM.TSHotelManagement.Service/SystemManagement/Administrator/AdminService.cs index 3388b627cd7d0ecf33a85bbf20cb6f8c62c63cb3..a87ae271ce939852af5eb1200ee276ce01359fb8 100644 --- a/EOM.TSHotelManagement.Service/SystemManagement/Administrator/AdminService.cs +++ b/EOM.TSHotelManagement.Service/SystemManagement/Administrator/AdminService.cs @@ -23,7 +23,6 @@ */ using EOM.TSHotelManagement.Common; using EOM.TSHotelManagement.Contract; -using EOM.TSHotelManagement.Contract.SystemManagement.Dto.Permission; using EOM.TSHotelManagement.Data; using EOM.TSHotelManagement.Domain; using jvncorelib.EncryptorLib; @@ -228,7 +227,7 @@ namespace EOM.TSHotelManagement.Service { try { - if (createAdministratorInputDto.IsSuperAdmin == 1) + if (createAdministratorInputDto.IsSuperAdmin == (int)AdminRole.SuperAdmin) { var haveSuperAdmin = adminRepository.IsAny(a => a.IsSuperAdmin == 1 && a.IsDelete != 1); if (haveSuperAdmin) diff --git a/EOM.TSHotelManagement.Service/SystemManagement/Administrator/IAdminService.cs b/EOM.TSHotelManagement.Service/SystemManagement/Administrator/IAdminService.cs index b17323096c7cf2a9ff7098e1474d021d1906d0ff..ddb36d5817e625f168c632356a783c4844138b4f 100644 --- a/EOM.TSHotelManagement.Service/SystemManagement/Administrator/IAdminService.cs +++ b/EOM.TSHotelManagement.Service/SystemManagement/Administrator/IAdminService.cs @@ -110,14 +110,14 @@ namespace EOM.TSHotelManagement.Service /// /// 用户编码 /// 明细列表(包含 RoleNumber、PermissionNumber、PermissionName、MenuKey) - ListOutputDto ReadUserRolePermissions(string userNumber); + ListOutputDto ReadUserRolePermissions(string userNumber); /// /// 为指定用户分配“直接权限”(通过专属角色 R-USER-{UserNumber} 写入 RolePermission,全量覆盖) /// /// 用户编号与权限编码集合 /// - BaseResponse AssignUserPermissions(Contract.SystemManagement.Dto.Permission.AssignUserPermissionsInputDto input); + BaseResponse AssignUserPermissions(AssignUserPermissionsInputDto input); /// /// 读取指定用户的“直接权限”(仅来自专属角色 R-USER-{UserNumber} 的权限编码列表) diff --git a/EOM.TSHotelManagement.Web.sln b/EOM.TSHotelManagement.Web.sln index cebdc1abdbab11dc58f984edd4f176c3848905a1..b3628c41e7a8d9d69c1184d44a6069c29ba4a5b3 100644 --- a/EOM.TSHotelManagement.Web.sln +++ b/EOM.TSHotelManagement.Web.sln @@ -15,9 +15,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOM.TSHotelManagement.Commo EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOM.TSHotelManagement.Migration", "EOM.TSHotelManagement.Migration\EOM.TSHotelManagement.Migration.csproj", "{A1A986E0-E59D-4913-B63E-D965453B8CC0}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EOM.TSHotelManagement.Contract", "EOM.TSHotelManagement.Contract\EOM.TSHotelManagement.Contract.csproj", "{B83A545B-9FFA-784F-3486-87BB3B50F46D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOM.TSHotelManagement.Contract", "EOM.TSHotelManagement.Contract\EOM.TSHotelManagement.Contract.csproj", "{B83A545B-9FFA-784F-3486-87BB3B50F46D}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EOM.TSHotelManagement.Infrastructure", "EOM.TSHotelManagement.Infrastructure\EOM.TSHotelManagement.Infrastructure.csproj", "{C390E995-B01C-4C4A-9335-3AD14CCFFA2C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOM.TSHotelManagement.Infrastructure", "EOM.TSHotelManagement.Infrastructure\EOM.TSHotelManagement.Infrastructure.csproj", "{C390E995-B01C-4C4A-9335-3AD14CCFFA2C}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -53,10 +53,10 @@ Global {B83A545B-9FFA-784F-3486-87BB3B50F46D}.Debug|x64.Build.0 = Debug|x64 {B83A545B-9FFA-784F-3486-87BB3B50F46D}.Release|x64.ActiveCfg = Release|x64 {B83A545B-9FFA-784F-3486-87BB3B50F46D}.Release|x64.Build.0 = Release|x64 - {C390E995-B01C-4C4A-9335-3AD14CCFFA2C}.Debug|x64.ActiveCfg = Debug|Any CPU - {C390E995-B01C-4C4A-9335-3AD14CCFFA2C}.Debug|x64.Build.0 = Debug|Any CPU - {C390E995-B01C-4C4A-9335-3AD14CCFFA2C}.Release|x64.ActiveCfg = Release|Any CPU - {C390E995-B01C-4C4A-9335-3AD14CCFFA2C}.Release|x64.Build.0 = Release|Any CPU + {C390E995-B01C-4C4A-9335-3AD14CCFFA2C}.Debug|x64.ActiveCfg = Debug|x64 + {C390E995-B01C-4C4A-9335-3AD14CCFFA2C}.Debug|x64.Build.0 = Debug|x64 + {C390E995-B01C-4C4A-9335-3AD14CCFFA2C}.Release|x64.ActiveCfg = Release|x64 + {C390E995-B01C-4C4A-9335-3AD14CCFFA2C}.Release|x64.Build.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/version.txt b/version.txt index 5dd7646c1621f86363ec6a00d00c5d3965f488fd..f96eaa82dab2fdf85cb4dde18b9e2e6069c90a11 100644 Binary files a/version.txt and b/version.txt differ