diff --git a/EOM.TSHotelManagement.Application/Business/Cash/CashService.cs b/EOM.TSHotelManagement.Application/Business/Asset/AssetService.cs similarity index 39% rename from EOM.TSHotelManagement.Application/Business/Cash/CashService.cs rename to EOM.TSHotelManagement.Application/Business/Asset/AssetService.cs index d039526a6caa06fa713641c5c1ed5ffcd0692109..c039351590f8a6025f005dd6dac20139c8a37d93 100644 --- a/EOM.TSHotelManagement.Application/Business/Cash/CashService.cs +++ b/EOM.TSHotelManagement.Application/Business/Asset/AssetService.cs @@ -21,114 +21,138 @@ *SOFTWARE. * */ +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Util; using EOM.TSHotelManagement.EntityFramework; +using SqlSugar; namespace EOM.TSHotelManagement.Application { /// /// 资产信息接口实现类 /// - public class CashService : ICashService + public class AssetService : IAssetService { /// /// 资产信息 /// - private readonly GenericRepository cashRepository; + private readonly GenericRepository assetRepository; /// /// 部门 /// - private readonly GenericRepository deptRepository; + private readonly GenericRepository deptRepository; /// /// 员工 /// - private readonly GenericRepository workerRepository; + private readonly GenericRepository employeeRepository; /// /// /// - /// + /// /// - /// - public CashService(GenericRepository cashRepository, GenericRepository deptRepository, GenericRepository workerRepository) + /// + public AssetService(GenericRepository assetRepository, GenericRepository deptRepository, GenericRepository employeeRepository) { - this.cashRepository = cashRepository; + this.assetRepository = assetRepository; this.deptRepository = deptRepository; - this.workerRepository = workerRepository; + this.employeeRepository = employeeRepository; } /// /// 添加资产信息 /// - /// + /// /// - public bool AddCashInfo(Cash cash) + public BaseOutputDto AddAssetInfo(CreateAssetInputDto asset) { - return cashRepository.Insert(cash); + try + { + var result = assetRepository.Insert(EntityMapper.Map(asset)); + } + catch (Exception ex) + { + return new BaseOutputDto() { Message = LocalizationHelper.GetLocalizedString(ex.Message,ex.Message),StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } /// /// 查询资产信息 /// /// - public List SelectCashInfoAll() + public ListOutputDto SelectAssetInfoAll(ReadAssetInputDto asset) { //查询所有部门信息 - List depts = new List(); + List depts = new List(); depts = deptRepository.GetList(a => a.IsDelete != 1); //查询所有员工信息 - List workers = new List(); - workers = workerRepository.GetList(a => a.IsDelete != 1); - List cs = new List(); - cs = cashRepository.GetList(a => a.IsDelete != 1); - cs.ForEach(source => + List employees = new List(); + employees = employeeRepository.GetList(a => a.IsDelete != 1); + + ListOutputDto cs = new ListOutputDto(); + + var where = Expressionable.Create(); + + int totalCount = 0; + if (asset.Page != 0 && asset.PageSize != 0) { - var dept = depts.FirstOrDefault(a => a.dept_no.Equals(source.CashClub)); - source.DeptName = dept == null ? "" : dept.dept_name; - var worker = workers.FirstOrDefault(a => a.WorkerId.Equals(source.CashPerson)); - source.PersonName = worker == null ? "" : worker.WorkerName; + cs.listSource = EntityMapper.MapList(assetRepository.AsQueryable().Where(where.ToExpression()).OrderBy(a => a.AssetNumber) + .ToPageList((int)asset.Page, (int)asset.PageSize, ref totalCount)); + cs.total = totalCount; + } - source.CashPriceStr = source.CashPrice == 0 ? "" : Decimal.Parse(source.CashPrice.ToString()).ToString("#,##0.00").ToString(); + cs.listSource.ForEach(source => + { + var dept = depts.FirstOrDefault(a => a.DepartmentNumber.Equals(source.DepartmentCode)); + source.DepartmentName = dept == null ? "" : dept.DepartmentName; + var worker = employees.FirstOrDefault(a => a.EmployeeId.Equals(source.AcquiredByEmployeeId)); + source.AcquiredByEmployeeName = worker == null ? "" : worker.EmployeeName; + + source.AssetValueFormatted = source.AssetValue == 0 ? "" : Decimal.Parse(source.AssetValue.ToString()).ToString("#,##0.00").ToString(); }); + return cs; } /// /// 更新资产信息 /// - /// + /// /// - public bool UpdCashInfo(Cash cash) + public BaseOutputDto UpdAssetInfo(UpdateAssetInputDto asset) { - return cashRepository.Update(a => new Cash() + try { - CashName = cash.CashName, - CashClub = cash.CashClub, - CashSource = cash.CashSource, - CashPrice = cash.CashPrice, - CashTime = cash.CashTime, - CashPerson = cash.CashPerson, - IsDelete = cash.IsDelete, - DataChgUsr = cash.DataChgUsr, - DataChgDate = cash.DataChgDate - }, a => a.CashNo == cash.CashNo); + assetRepository.Update(EntityMapper.Map(asset)); + } + catch (Exception ex) + { + return new BaseOutputDto() { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } /// /// 删除资产信息 /// - /// + /// /// - public bool DelCashInfo(Cash cash) + public BaseOutputDto DelAssetInfo(DeleteAssetInputDto asset) { - return cashRepository.Update(a => new Cash() + try + { + assetRepository.Update(EntityMapper.Map(asset)); + } + catch (Exception ex) { - IsDelete = 1, - DataChgUsr = cash.DataChgUsr - }, a => a.CashNo == cash.CashNo); + return new BaseOutputDto() { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } } } diff --git a/EOM.TSHotelManagement.Application/Business/Cash/ICashService.cs b/EOM.TSHotelManagement.Application/Business/Asset/IAssetService.cs similarity index 83% rename from EOM.TSHotelManagement.Application/Business/Cash/ICashService.cs rename to EOM.TSHotelManagement.Application/Business/Asset/IAssetService.cs index 8774b9fe34ca20e5edcf044e6ad277e1b4174fea..bb66f3e87fc67e40022010665f11d11d0b79854d 100644 --- a/EOM.TSHotelManagement.Application/Business/Cash/ICashService.cs +++ b/EOM.TSHotelManagement.Application/Business/Asset/IAssetService.cs @@ -21,6 +21,7 @@ *SOFTWARE. * */ +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; namespace EOM.TSHotelManagement.Application @@ -28,33 +29,33 @@ namespace EOM.TSHotelManagement.Application /// /// 资产信息接口 /// - public interface ICashService + public interface IAssetService { /// /// 添加资产信息 /// /// /// - bool AddCashInfo(Cash cash); + BaseOutputDto AddAssetInfo(CreateAssetInputDto cash); /// /// 查询资产信息 /// /// - List SelectCashInfoAll(); + ListOutputDto SelectAssetInfoAll(ReadAssetInputDto asset); /// /// 更新资产信息 /// /// /// - bool UpdCashInfo(Cash cash); + BaseOutputDto UpdAssetInfo(UpdateAssetInputDto cash); /// /// 删除资产信息 /// /// /// - bool DelCashInfo(Cash cash); + BaseOutputDto DelAssetInfo(DeleteAssetInputDto cash); } } \ No newline at end of file diff --git a/EOM.TSHotelManagement.Application/Business/Customer/CustoService.cs b/EOM.TSHotelManagement.Application/Business/Customer/CustomerService.cs similarity index 30% rename from EOM.TSHotelManagement.Application/Business/Customer/CustoService.cs rename to EOM.TSHotelManagement.Application/Business/Customer/CustomerService.cs index 7a80320d456b15c4699b5454c691ee44e2941858..ec12ff0883d0bbf8c1766bb576a60598628555be 100644 --- a/EOM.TSHotelManagement.Application/Business/Customer/CustoService.cs +++ b/EOM.TSHotelManagement.Application/Business/Customer/CustomerService.cs @@ -30,45 +30,37 @@ using System.ComponentModel; using EOM.TSHotelManagement.Common; using Microsoft.AspNetCore.DataProtection; using jvncorelib.EncryptorLib; -using NPOI.SS.Formula.Functions; +using EOM.TSHotelManagement.Common.Contract; +using EOM.TSHotelManagement.Common.Util; +using System.Linq; namespace EOM.TSHotelManagement.Application { /// /// 客户信息接口实现类 /// - public class CustoService : ICustoService + public class CustomerService : ICustomerService { /// /// 客户信息 /// - private readonly GenericRepository custoRepository; + private readonly GenericRepository custoRepository; /// /// 消费情况 /// private readonly GenericRepository spendRepository; - /// - /// 性别类型 - /// - private readonly GenericRepository sexTypeRepository; - /// /// 证件类型 /// - private readonly GenericRepository passPortTypeRepository; + private readonly GenericRepository passPortTypeRepository; /// /// 客户类型 /// private readonly GenericRepository custoTypeRepository; - /// - /// 加密 - /// - private readonly jvncorelib.EncryptorLib.EncryptLib encrypt; - /// /// 数据保护 /// @@ -79,62 +71,71 @@ namespace EOM.TSHotelManagement.Application /// /// /// - /// /// /// /// /// - public CustoService(GenericRepository custoRepository, GenericRepository spendRepository, GenericRepository sexTypeRepository, GenericRepository passPortTypeRepository, GenericRepository custoTypeRepository, EncryptLib encrypt, IDataProtectionProvider dataProtectionProvider) + public CustomerService(GenericRepository custoRepository, GenericRepository spendRepository, GenericRepository passPortTypeRepository, GenericRepository custoTypeRepository, IDataProtectionProvider dataProtectionProvider) { this.custoRepository = custoRepository; this.spendRepository = spendRepository; - this.sexTypeRepository = sexTypeRepository; this.passPortTypeRepository = passPortTypeRepository; this.custoTypeRepository = custoTypeRepository; - this.encrypt = encrypt; this.dataProtector = dataProtectionProvider.CreateProtector("CustomerInfoProtector"); } - #region 添加客户信息 /// /// 添加客户信息 /// /// - /// - public bool InsertCustomerInfo(Custo custo) + public BaseOutputDto InsertCustomerInfo(CreateCustomerInputDto custo) { - string NewID = dataProtector.Protect(custo.CustoID); - string NewTel = dataProtector.Protect(custo.CustoTel); - custo.CustoID = NewID; - custo.CustoTel = NewTel; - return custoRepository.Insert(custo); + string NewID = dataProtector.Protect(custo.IdCardNumber); + string NewTel = dataProtector.Protect(custo.CustomerPhoneNumber); + custo.IdCardNumber = NewID; + custo.CustomerPhoneNumber = NewTel; + try + { + var result = custoRepository.Insert(EntityMapper.Map(custo)); + } + catch (Exception ex) + { + LogHelper.LogError(LocalizationHelper.GetLocalizedString("Insert Customer Failed", "客户信息添加失败"), ex); + return new BaseOutputDto(StatusCodeConstants.InternalServerError, LocalizationHelper.GetLocalizedString("Insert Customer Failed", "客户信息添加失败")); + } + + return new BaseOutputDto(StatusCodeConstants.Success, LocalizationHelper.GetLocalizedString("Insert Customer Success", "客户信息添加成功")); } - #endregion /// /// 更新客户信息 /// /// /// - public bool UpdCustomerInfo(Custo custo) + public BaseOutputDto UpdCustomerInfo(UpdateCustomerInputDto custo) { - string NewID = dataProtector.Protect(custo.CustoID); - string NewTel = dataProtector.Protect(custo.CustoTel); - custo.CustoID = NewID; - custo.CustoTel = NewTel; - return custoRepository.Update(a => new Custo() + string NewID = dataProtector.Protect(custo.IdCardNumber); + string NewTel = dataProtector.Protect(custo.CustomerPhoneNumber); + custo.IdCardNumber = NewID; + custo.CustomerPhoneNumber = NewTel; + try { - CustoName = custo.CustoName, - CustoSex = custo.CustoSex, - CustoType = custo.CustoType, - CustoBirth = custo.CustoBirth, - CustoAddress = custo.CustoAddress, - CustoID = custo.CustoID, - CustoTel = custo.CustoTel, - PassportType = custo.PassportType, - DataChgUsr = custo.DataChgUsr, - DataChgDate = custo.DataChgDate - }, a => a.CustoNo == custo.CustoNo); + var result = custoRepository.Update(EntityMapper.Map(custo)); + + if (result) + { + return new BaseOutputDto(StatusCodeConstants.Success, LocalizationHelper.GetLocalizedString("Update Customer Success", "客户信息更新成功")); + } + else + { + return new BaseOutputDto(StatusCodeConstants.InternalServerError, LocalizationHelper.GetLocalizedString("Update Customer Failed", "客户信息更新失败")); + } + } + catch (Exception ex) + { + LogHelper.LogError(LocalizationHelper.GetLocalizedString("Update Customer Failed", "客户信息更新失败"), ex); + return new BaseOutputDto(StatusCodeConstants.InternalServerError, LocalizationHelper.GetLocalizedString("Update Customer Failed", "客户信息更新失败")); + } } /// @@ -142,58 +143,80 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool DelCustomerInfo(Custo custo) + public BaseOutputDto DelCustomerInfo(DeleteCustomerInputDto custo) { - var occupied = Convert.ToInt32(RoomStateConstant.Occupied.Code); - var isOccupied = custoRepository.Change().IsAny(a => a.CustoNo == custo.CustoNo && a.RoomStateId == occupied); - var haveUnSettle = custoRepository.Change().IsAny(a => a.CustoNo == custo.CustoNo && a.MoneyState == SpendConsts.UnSettle); + var occupied = Convert.ToInt32(RoomState.Occupied); + var isOccupied = custoRepository.Change().IsAny(a => a.CustomerNumber == custo.CustomerNumber && a.RoomStateId == occupied); + var haveUnSettle = custoRepository.Change().IsAny(a => a.CustomerNumber == custo.CustomerNumber && a.SettlementStatus == SpendConsts.UnSettle); if (isOccupied) - return false; + return new BaseOutputDto(StatusCodeConstants.InternalServerError, LocalizationHelper.GetLocalizedString("Customer is currently occupying a room", "客户当前正在占用房间")); if (haveUnSettle) - return false; + return new BaseOutputDto(StatusCodeConstants.InternalServerError, LocalizationHelper.GetLocalizedString("Customer has unsettled bills", "客户有未结算的账单")); - return custoRepository.Update(a => new Custo() + var result = custoRepository.Update(a => new Customer() { IsDelete = custo.IsDelete, DataChgUsr = custo.DataChgUsr, DataChgDate = custo.DataChgDate - }, a => a.CustoNo == custo.CustoNo); + }, a => a.CustomerNumber == custo.CustomerNumber); + + if (result) + { + return new BaseOutputDto(StatusCodeConstants.Success, LocalizationHelper.GetLocalizedString("Delete Customer Success", "客户信息删除成功")); + } + else + { + return new BaseOutputDto(StatusCodeConstants.InternalServerError, LocalizationHelper.GetLocalizedString("Delete Customer Failed", "客户信息删除失败")); + } } /// /// 更新客户类型(即会员等级) /// - /// - /// + /// /// - public bool UpdCustomerTypeByCustoNo(string custoNo, int userType) + public BaseOutputDto UpdCustomerTypeByCustoNo(UpdateCustomerInputDto updateCustomerInputDto) { - return custoRepository.Update(a => new Custo() + try + { + var result = custoRepository.Update(EntityMapper.Map(updateCustomerInputDto)); + + if (result) + { + return new BaseOutputDto(StatusCodeConstants.Success, LocalizationHelper.GetLocalizedString("Update Customer Type Success", "客户类型更新成功")); + } + else + { + return new BaseOutputDto(StatusCodeConstants.InternalServerError, LocalizationHelper.GetLocalizedString("Update Customer Type Failed", "客户类型更新失败")); + } + } + catch (Exception ex) { - CustoType = userType - }, a => a.CustoNo.Equals(custoNo)); + LogHelper.LogError(LocalizationHelper.GetLocalizedString("Update Customer Type Failed", "客户类型更新失败"), ex); + return new BaseOutputDto(StatusCodeConstants.InternalServerError, LocalizationHelper.GetLocalizedString("Update Customer Type Failed", "客户类型更新失败")); + } } /// - /// 查询酒店盈利情况 + /// 查询酒店盈利情况(用于报表) /// /// public List SelectAllMoney() { List custoSpends = new List(); - var listSource = spendRepository.GetList(a => a.MoneyState.Equals(SpendConsts.Settled)).OrderBy(a => a.SpendTime).ToList(); + var listSource = spendRepository.GetList(a => a.SettlementStatus.Equals(SpendConsts.Settled)).OrderBy(a => a.ConsumptionTime).ToList(); var listDates = new List(); listSource.ForEach(source => { - var year = Convert.ToDateTime(source.SpendTime).ToString("yyyy"); + var year = Convert.ToDateTime(source.ConsumptionTime).ToString("yyyy"); if (!custoSpends.Select(a => a.Years).ToList().Contains(year)) { - var startDate = new DateTime(Convert.ToDateTime(source.SpendTime).Year, 1, 1, 0, 0, 0); - var endDate = new DateTime(Convert.ToDateTime(source.SpendTime).Year, 12, 31, 23, 59, 59); + var startDate = new DateTime(Convert.ToDateTime(source.ConsumptionTime).Year, 1, 1, 0, 0, 0); + var endDate = new DateTime(Convert.ToDateTime(source.ConsumptionTime).Year, 12, 31, 23, 59, 59); custoSpends.Add(new CustoSpend { Years = year, - Money = listSource.Where(a => a.SpendTime >= startDate && a.SpendTime <= endDate).Sum(a => a.SpendMoney) + Money = listSource.Where(a => a.ConsumptionTime >= startDate && a.ConsumptionTime <= endDate).Sum(a => a.ConsumptionAmount) }); } }); @@ -206,200 +229,253 @@ namespace EOM.TSHotelManagement.Application /// 查询所有客户信息 /// /// - public OSelectAllDto SelectCustoAll(int? pageIndex, int? pageSize, bool onlyVip = false) + public ListOutputDto SelectCustomers(ReadCustomerInputDto readCustomerInputDto) { - OSelectAllDto oSelectCustoAllDto = new OSelectAllDto(); + ListOutputDto oSelectCustoAllDto = new ListOutputDto(); //查询出所有性别类型 - List sexTypes = new List(); - sexTypes = sexTypeRepository.GetList(); + var helper = new EnumHelper(); + var genders = Enum.GetValues(typeof(GenderType)) + .Cast() + .Select(e => new EnumDto + { + Id = (int)e, + Name = e.ToString(), + Description = helper.GetEnumDescription(e) + }) + .ToList(); //查询出所有证件类型 - List passPortTypes = new List(); + List passPortTypes = new List(); passPortTypes = passPortTypeRepository.GetList(); //查询出所有客户类型 List custoTypes = new List(); custoTypes = custoTypeRepository.GetList(); //查询出所有客户信息 - List custos = new List(); + List custos = new List(); - var count = 0; + var where = Expressionable.Create(); - if (pageIndex != 0 && pageSize != 0) - { - custos = custoRepository.AsQueryable().ToPageList((int)pageIndex, (int)pageSize, ref count); - if (onlyVip) - { - custos = custoRepository.AsQueryable().Where(a => a.CustoType != 0).ToPageList((int)pageIndex, (int)pageSize, ref count); - } - } - else - { - custos = custoRepository.AsQueryable().ToList(); - } + where = where.And(a => a.IsDelete == readCustomerInputDto.IsDelete); - custos.ForEach(source => + if (!readCustomerInputDto.CustomerNumber.IsNullOrEmpty()) { - try - { - //解密身份证号码 - var sourceStr = source.CustoID.Contains('·') ? encrypt.Decryption(source.CustoID) : dataProtector.Unprotect(source.CustoID); - source.CustoID = sourceStr; - //解密联系方式 - var sourceTelStr = source.CustoTel.Contains('·') ? encrypt.Decryption(source.CustoTel) : dataProtector.Unprotect(source.CustoTel); - source.CustoTel = sourceTelStr; - } - catch (Exception) - { - source.CustoID = source.CustoID; - source.CustoTel = source.CustoTel; - } - //性别类型 - var sexType = sexTypes.FirstOrDefault(a => a.sexId == source.CustoSex); - source.SexName = sexType.sexName.IsNullOrEmpty() ? "" : sexType.sexName; - //证件类型 - var passPortType = passPortTypes.FirstOrDefault(a => a.PassportId == source.PassportType); - source.PassportName = passPortType.PassportName.IsNullOrEmpty() ? "" : passPortType.PassportName; - //客户类型 - var custoType = custoTypes.FirstOrDefault(a => a.UserType == source.CustoType); - source.typeName = custoType.TypeName.IsNullOrEmpty() ? "" : custoType.TypeName; - }); - - oSelectCustoAllDto.listSource = custos; - oSelectCustoAllDto.total = count; - - return oSelectCustoAllDto; - } - - /// - /// 查询指定客户信息 - /// - /// - public OSelectAllDto SelectCustomers(Custo custo) - { - var customers = new OSelectAllDto(); - - var where = Expressionable.Create(); - - //查询出所有性别类型 - List sexTypes = new List(); - sexTypes = sexTypeRepository.GetList(); - //查询出所有证件类型 - List passPortTypes = new List(); - passPortTypes = passPortTypeRepository.GetList(); - //查询出所有客户类型 - List custoTypes = new List(); - custoTypes = custoTypeRepository.GetList(); - //查询出所有客户信息 - List custos = new List(); - - if (!custo.CustoNo.IsNullOrEmpty()) - { - where = where.And(a => a.CustoNo.Equals(custo.CustoNo)); + where = where.And(a => a.CustomerNumber.Equals(readCustomerInputDto.CustomerNumber)); } - if (!custo.CustoName.IsNullOrEmpty()) + if (!readCustomerInputDto.CustomerName.IsNullOrEmpty()) { - where = where.And(a => a.CustoName.Contains(custo.CustoName)); + where = where.And(a => a.CustomerName.Contains(readCustomerInputDto.CustomerName)); } - if (!custo.CustoTel.IsNullOrEmpty()) + if (!readCustomerInputDto.CustomerPhoneNumber.IsNullOrEmpty()) { - where = where.And(a => a.CustoTel.Contains(custo.CustoTel)); + where = where.And(a => a.CustomerPhoneNumber.Contains(readCustomerInputDto.CustomerPhoneNumber)); } - if (!custo.CustoAddress.IsNullOrEmpty()) + if (!readCustomerInputDto.IdCardNumber.IsNullOrEmpty()) { - where = where.And(a => a.CustoAddress.Contains(custo.CustoAddress)); + where = where.And(a => a.IdCardNumber.Contains(readCustomerInputDto.IdCardNumber)); } - if (!custo.CustoID.IsNullOrEmpty()) + + var count = 0; + + if (!readCustomerInputDto.IgnorePaging && readCustomerInputDto.Page != 0 && readCustomerInputDto.PageSize != 0) { - where = where.And(a => a.CustoID.Contains(custo.CustoID)); + custos = custoRepository.AsQueryable().Where(where.ToExpression()).OrderBy(a => a.CustomerNumber) + .ToPageList((int)readCustomerInputDto.Page, (int)readCustomerInputDto.PageSize, ref count); } - if (!custo.IsDelete.IsNullOrEmpty()) + else { - where = where.And(a => a.IsDelete == custo.IsDelete); + custos = custoRepository.AsQueryable().Where(where.ToExpression()).OrderBy(a => a.CustomerNumber).ToList(); } - int totalCount = 0; - if (custo.Page != 0 && custo.PageSize != 0) - { - customers.listSource = custoRepository.AsQueryable().Where(where.ToExpression()).OrderBy(a => a.CustoNo) - .ToPageList((int)custo.Page, (int)custo.PageSize, ref totalCount); - customers.total = totalCount; - } + var customerOutputDtos = EntityMapper.MapList(custos); - customers.listSource.ForEach(source => + customerOutputDtos.ForEach(source => { try { //解密身份证号码 - var sourceStr = source.CustoID.Contains('·') ? encrypt.Decryption(source.CustoID) : dataProtector.Unprotect(source.CustoID); - source.CustoID = sourceStr; + var sourceStr = dataProtector.Unprotect(source.IdCardNumber); + source.IdCardNumber = sourceStr; //解密联系方式 - var sourceTelStr = source.CustoTel.Contains('·') ? encrypt.Decryption(source.CustoTel) : dataProtector.Unprotect(source.CustoTel); - source.CustoTel = sourceTelStr; + var sourceTelStr = dataProtector.Unprotect(source.CustomerPhoneNumber); + source.CustomerPhoneNumber = sourceTelStr; } catch (Exception) { - source.CustoID = source.CustoID; - source.CustoTel = source.CustoTel; + source.IdCardNumber = source.IdCardNumber; + source.CustomerPhoneNumber = source.CustomerPhoneNumber; } + //性别类型 - var sexType = sexTypes.FirstOrDefault(a => a.sexId == source.CustoSex); - source.SexName = sexType.sexName.IsNullOrEmpty() ? "" : sexType.sexName; + var sexType = genders.FirstOrDefault(a => a.Id == source.CustomerGender); + source.GenderName = sexType?.Description ?? ""; + //证件类型 - var passPortType = passPortTypes.FirstOrDefault(a => a.PassportId == source.PassportType); - source.PassportName = passPortType.PassportName.IsNullOrEmpty() ? "" : passPortType.PassportName; + var passPortType = passPortTypes.FirstOrDefault(a => a.PassportId == source.PassportId); + source.PassportName = passPortType?.PassportName ?? ""; + //客户类型 - var custoType = custoTypes.FirstOrDefault(a => a.UserType == source.CustoType); - source.typeName = custoType.TypeName.IsNullOrEmpty() ? "" : custoType.TypeName; + var custoType = custoTypes.FirstOrDefault(a => a.CustomerType == source.CustomerType); + source.CustomerTypeName = custoType?.CustomerTypeName ?? ""; }); - return customers; + oSelectCustoAllDto.listSource = customerOutputDtos; + oSelectCustoAllDto.total = count; + return oSelectCustoAllDto; } /// /// 查询指定客户信息 /// /// - public List SelectCustoByInfo(Custo custo) + //public ListOutputDto SelectCustomers(Customer custo) + //{ + // var customers = new ListOutputDto(); + + // var where = Expressionable.Create(); + + // //查询出所有性别类型 + // List sexTypes = new List(); + // sexTypes = sexTypeRepository.GetList(); + // //查询出所有证件类型 + // List passPortTypes = new List(); + // passPortTypes = passPortTypeRepository.GetList(); + // //查询出所有客户类型 + // List custoTypes = new List(); + // custoTypes = custoTypeRepository.GetList(); + // //查询出所有客户信息 + // List custos = new List(); + + // if (!custo.CustomerNumber.IsNullOrEmpty()) + // { + // where = where.And(a => a.CustomerNumber.Equals(custo.CustomerNumber)); + // } + // if (!custo.CustomerName.IsNullOrEmpty()) + // { + // where = where.And(a => a.CustomerName.Contains(custo.CustomerName)); + // } + // if (!custo.CustomerPhoneNumber.IsNullOrEmpty()) + // { + // where = where.And(a => a.CustomerPhoneNumber.Contains(custo.CustomerPhoneNumber)); + // } + // if (!custo.CustomerAddress.IsNullOrEmpty()) + // { + // where = where.And(a => a.CustomerAddress.Contains(custo.CustomerAddress)); + // } + // if (!custo.PassportID.IsNullOrEmpty()) + // { + // where = where.And(a => a.PassportID.Contains(custo.PassportID)); + // } + // if (!custo.IsDelete.IsNullOrEmpty()) + // { + // where = where.And(a => a.IsDelete == custo.IsDelete); + // } + + // int totalCount = 0; + // if (custo.Page != 0 && custo.PageSize != 0) + // { + // customers.listSource = custoRepository.AsQueryable().Where(where.ToExpression()).OrderBy(a => a.CustomerNumber) + // .ToPageList((int)custo.Page, (int)custo.PageSize, ref totalCount); + // customers.total = totalCount; + // } + + // customers.listSource.ForEach(source => + // { + // try + // { + // //解密身份证号码 + // var sourceStr = source.PassportID.Contains('·') ? encrypt.Decryption(source.PassportID) : dataProtector.Unprotect(source.PassportID); + // source.PassportID = sourceStr; + // //解密联系方式 + // var sourceTelStr = source.CustomerPhoneNumber.Contains('·') ? encrypt.Decryption(source.CustomerPhoneNumber) : dataProtector.Unprotect(source.CustomerPhoneNumber); + // source.CustomerPhoneNumber = sourceTelStr; + // } + // catch (Exception) + // { + // source.PassportID = source.PassportID; + // source.CustomerPhoneNumber = source.CustomerPhoneNumber; + // } + // //性别类型 + // var sexType = sexTypes.FirstOrDefault(a => a.GenderId == source.CustomerGender); + // source.GenderName = sexType.GenderName.IsNullOrEmpty() ? "" : sexType.GenderName; + // //证件类型 + // var passPortType = passPortTypes.FirstOrDefault(a => a.PassportId == source.PassportType); + // source.PassportTypeName = passPortType.PassportName.IsNullOrEmpty() ? "" : passPortType.PassportName; + // //客户类型 + // var custoType = custoTypes.FirstOrDefault(a => a.CustomerType == source.CustomerType); + // source.CustomerTypeName = custoType.CustomerTypeName.IsNullOrEmpty() ? "" : custoType.CustomerTypeName; + // }); + + // return customers; + + //} + + /// + /// 查询指定客户信息 + /// + /// + public SingleOutputDto SelectCustoByInfo(ReadCustomerInputDto custo) { //查询出所有性别类型 - List sexTypes = new List(); - sexTypes = sexTypeRepository.GetList(); + var helper = new EnumHelper(); + var genders = Enum.GetValues(typeof(GenderType)) + .Cast() + .Select(e => new EnumDto + { + Id = (int)e, + Name = e.ToString(), + Description = helper.GetEnumDescription(e) + }) + .ToList(); //查询出所有证件类型 - List passPortTypes = new List(); + List passPortTypes = new List(); passPortTypes = passPortTypeRepository.GetList(); //查询出所有客户类型 List custoTypes = new List(); custoTypes = custoTypeRepository.GetList(); //查询出所有客户信息 - List custos = new List(); - if (!custo.CustoNo.IsNullOrEmpty()) + SingleOutputDto singleOutputDto = new SingleOutputDto(); + + var where = Expressionable.Create(); + + if (!custo.CustomerNumber.IsNullOrEmpty()) { - custos = custoRepository.GetList(a => a.CustoNo.Contains(custo.CustoNo)).OrderBy(a => a.CustoNo).ToList(); + where = where.And(a => a.CustomerNumber.Contains(custo.CustomerNumber)); } - if (!custo.CustoName.IsNullOrEmpty()) + if (!custo.CustomerName.IsNullOrEmpty()) { - custos = custoRepository.GetList(a => a.CustoName.Contains(custo.CustoName)).OrderBy(a => a.CustoNo).ToList(); + where = where.And(a => a.CustomerName.Contains(custo.CustomerName)); } - custos.ForEach(source => + + var customer = custoRepository.AsQueryable().Where(where.ToExpression()).Single(); + + try { //解密身份证号码 - var sourceStr = source.CustoID.Contains("·") ? encrypt.Decryption(source.CustoID) : source.CustoID; - source.CustoID = sourceStr; + var sourceStr = dataProtector.Unprotect(customer.IdCardNumber); + customer.IdCardNumber = sourceStr; //解密联系方式 - var sourceTelStr = source.CustoTel.Contains("·") ? encrypt.Decryption(source.CustoTel) : source.CustoTel; - source.CustoTel = sourceTelStr; - //性别类型 - var sexType = sexTypes.FirstOrDefault(a => a.sexId == source.CustoSex); - source.SexName = sexType.sexName.IsNullOrEmpty() ? "" : sexType.sexName; - //证件类型 - var passPortType = passPortTypes.FirstOrDefault(a => a.PassportId == source.PassportType); - source.PassportName = passPortType.PassportName.IsNullOrEmpty() ? "" : passPortType.PassportName; - //客户类型 - var custoType = custoTypes.FirstOrDefault(a => a.UserType == source.CustoType); - source.typeName = custoType.TypeName.IsNullOrEmpty() ? "" : custoType.TypeName; - }); - return custos; + var sourceTelStr = dataProtector.Unprotect(customer.CustomerPhoneNumber); + customer.CustomerPhoneNumber = sourceTelStr; + } + catch (Exception) + { + customer.IdCardNumber = customer.IdCardNumber; + customer.CustomerPhoneNumber = customer.CustomerPhoneNumber; + } + //性别类型 + var sexType = genders.FirstOrDefault(a => a.Id == customer.CustomerGender); + customer.GenderName = sexType.Description.IsNullOrEmpty() ? "" : sexType.Description; + //证件类型 + var passPortType = passPortTypes.FirstOrDefault(a => a.PassportId == customer.PassportId); + customer.PassportName = passPortType.PassportName.IsNullOrEmpty() ? "" : passPortType.PassportName; + //客户类型 + var custoType = custoTypes.FirstOrDefault(a => a.CustomerType == customer.CustomerType); + customer.CustomerTypeName = custoType.CustomerTypeName.IsNullOrEmpty() ? "" : custoType.CustomerTypeName; + + singleOutputDto.Source = EntityMapper.Map(customer); + + return singleOutputDto; } /// @@ -407,30 +483,30 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public Custo SelectCardInfoByCustoNo(string CustoNo) - { - Custo c = custoRepository.GetSingle(a => a.CustoNo.Equals(CustoNo)); - if (c.IsNullOrEmpty()) - { - return null; - } - //性别类型 - var sexType = sexTypeRepository.GetSingle(a => a.sexId == c.CustoSex); - c.SexName = sexType.sexName.IsNullOrEmpty() ? "" : sexType.sexName; - //证件类型 - var passPortType = passPortTypeRepository.GetSingle(a => a.PassportId == c.PassportType); - c.PassportName = passPortType.PassportName.IsNullOrEmpty() ? "" : passPortType.PassportName; - //客户类型 - var custoType = custoTypeRepository.GetSingle(a => a.UserType == c.CustoType); - c.typeName = custoType.TypeName.IsNullOrEmpty() ? "" : custoType.TypeName; - //解密身份证号码 - var sourceStr = c.CustoID.Contains("·") ? encrypt.Decryption(c.CustoID) : c.CustoID; - c.CustoID = sourceStr; - //解密联系方式 - var sourceTelStr = c.CustoTel.Contains("·") ? encrypt.Decryption(c.CustoTel) : c.CustoTel; - c.CustoTel = sourceTelStr; - return c; - } + //public Customer SelectCardInfoByCustoNo(string CustoNo) + //{ + // Customer c = custoRepository.GetSingle(a => a.CustomerNumber.Equals(CustoNo)); + // if (c.IsNullOrEmpty()) + // { + // return null; + // } + // //性别类型 + // var sexType = sexTypeRepository.GetSingle(a => a.GenderId == c.CustomerGender); + // c.GenderName = sexType.GenderName.IsNullOrEmpty() ? "" : sexType.GenderName; + // //证件类型 + // var passPortType = passPortTypeRepository.GetSingle(a => a.PassportId == c.PassportType); + // c.PassportTypeName = passPortType.PassportName.IsNullOrEmpty() ? "" : passPortType.PassportName; + // //客户类型 + // var custoType = custoTypeRepository.GetSingle(a => a.CustomerType == c.CustomerType); + // c.CustomerTypeName = custoType.CustomerTypeName.IsNullOrEmpty() ? "" : custoType.CustomerTypeName; + // //解密身份证号码 + // var sourceStr = c.PassportID.Contains("·") ? encrypt.Decryption(c.PassportID) : c.PassportID; + // c.PassportID = sourceStr; + // //解密联系方式 + // var sourceTelStr = c.CustomerPhoneNumber.Contains("·") ? encrypt.Decryption(c.CustomerPhoneNumber) : c.CustomerPhoneNumber; + // c.CustomerPhoneNumber = sourceTelStr; + // return c; + //} } } diff --git a/EOM.TSHotelManagement.Application/Business/Customer/ICustoService.cs b/EOM.TSHotelManagement.Application/Business/Customer/ICustomerService.cs similarity index 75% rename from EOM.TSHotelManagement.Application/Business/Customer/ICustoService.cs rename to EOM.TSHotelManagement.Application/Business/Customer/ICustomerService.cs index 2afc7429309e327acde87368795a980d932d3bcd..081e48547edb5188f5845c13b40022a9af2d25f2 100644 --- a/EOM.TSHotelManagement.Application/Business/Customer/ICustoService.cs +++ b/EOM.TSHotelManagement.Application/Business/Customer/ICustomerService.cs @@ -21,6 +21,7 @@ *SOFTWARE. * */ +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; namespace EOM.TSHotelManagement.Application @@ -28,39 +29,37 @@ namespace EOM.TSHotelManagement.Application /// /// 客户信息接口 /// - public interface ICustoService + public interface ICustomerService { /// /// 添加客户信息 /// /// /// - bool InsertCustomerInfo(Custo custo); + BaseOutputDto InsertCustomerInfo(CreateCustomerInputDto custo); /// /// 更新客户信息 /// /// /// - bool UpdCustomerInfo(Custo custo); + BaseOutputDto UpdCustomerInfo(UpdateCustomerInputDto custo); /// /// 删除客户信息 /// /// /// - bool DelCustomerInfo(Custo custo); + BaseOutputDto DelCustomerInfo(DeleteCustomerInputDto custo); /// /// 更新客户类型(即会员等级) /// - /// - /// /// - bool UpdCustomerTypeByCustoNo(string custoNo, int userType); + BaseOutputDto UpdCustomerTypeByCustoNo(UpdateCustomerInputDto updateCustomerInputDto); /// - /// 查询酒店盈利情况 + /// 查询酒店盈利情况(用于报表) /// /// List SelectAllMoney(); @@ -69,26 +68,26 @@ namespace EOM.TSHotelManagement.Application /// 查询所有客户信息 /// /// - OSelectAllDto SelectCustoAll(int? pageIndex, int? pageSize, bool onlyVip = false); + //ListOutputDto SelectCustoAll(int? pageIndex, int? pageSize, bool onlyVip = false); /// /// 查询所有客户信息 /// /// - OSelectAllDto SelectCustomers(Custo custo); + ListOutputDto SelectCustomers(ReadCustomerInputDto custo); /// /// 查询指定客户信息 /// /// - List SelectCustoByInfo(Custo custo); + SingleOutputDto SelectCustoByInfo(ReadCustomerInputDto custo); /// /// 根据客户编号查询客户信息 /// /// /// - Custo SelectCardInfoByCustoNo(string CustoNo); + //SingleOutputDto SelectCardInfoByCustoNo(string CustoNo); } } \ No newline at end of file diff --git a/EOM.TSHotelManagement.Application/Business/Hydroelectricity/HydroelectricityService.cs b/EOM.TSHotelManagement.Application/Business/EnergyManagement/EnergyManagementService.cs similarity index 32% rename from EOM.TSHotelManagement.Application/Business/Hydroelectricity/HydroelectricityService.cs rename to EOM.TSHotelManagement.Application/Business/EnergyManagement/EnergyManagementService.cs index 517f3a95f4384c176ab00c083209f38bff0e367a..bb4610c7939b21233fb29083bed7a5a424bfca28 100644 --- a/EOM.TSHotelManagement.Application/Business/Hydroelectricity/HydroelectricityService.cs +++ b/EOM.TSHotelManagement.Application/Business/EnergyManagement/EnergyManagementService.cs @@ -21,8 +21,11 @@ *SOFTWARE. * */ +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Util; using EOM.TSHotelManagement.EntityFramework; +using jvncorelib.EntityLib; using SqlSugar; using System.Linq.Expressions; @@ -31,106 +34,132 @@ namespace EOM.TSHotelManagement.Application /// /// 水电信息接口实现类 /// - public class HydroelectricityService : IHydroelectricityService + public class EnergyManagementService : IEnergyManagementService { /// /// 水电信息 /// - private readonly GenericRepository wtiRepository; + private readonly GenericRepository wtiRepository; /// /// /// /// - public HydroelectricityService(GenericRepository wtiRepository) + public EnergyManagementService(GenericRepository wtiRepository) { this.wtiRepository = wtiRepository; } - #region 查询水电费信息 - /// /// 根据条件查询水电费信息 /// - /// 房间号(可选) - /// 使用开始时间(可选) - /// 使用结束时间(可选) + /// Dto /// 符合条件的水电费信息列表 - public List SelectWtiInfo(string roomNo = null, DateTime? useDate = null, DateTime? endDate = null) + public ListOutputDto SelectEnergyManagementInfo(ReadEnergyManagementInputDto readEnergyManagementInputDto) { - var repository = wtiRepository; - - var where = Expressionable.Create(); + var where = Expressionable.Create(); - where = where.And(a => a.IsDelete != 1); + if (!string.IsNullOrEmpty(readEnergyManagementInputDto.RoomNo)) + { + where = where.And(a => a.RoomNumber.Equals(readEnergyManagementInputDto.RoomNo)); + } - if (!string.IsNullOrEmpty(roomNo)) + if (!readEnergyManagementInputDto.UseDate.IsNullOrEmpty()) { - where = where.And(a => a.RoomNo.Equals(roomNo)); + where = where.And(a => a.StartDate >= readEnergyManagementInputDto.UseDate.Value); } - if (useDate.HasValue) + if (!readEnergyManagementInputDto.EndDate.IsNullOrEmpty()) { - where = where.And(a => a.UseDate >= useDate.Value); + where = where.And(a => a.EndDate >= readEnergyManagementInputDto.EndDate.Value); } - if (endDate.HasValue) + if (!readEnergyManagementInputDto.IsDelete.IsNullOrEmpty()) { - where = where.And(a => a.EndDate >= endDate.Value); + where = where.And(a => a.IsDelete == readEnergyManagementInputDto.IsDelete); } - var listSource = repository.GetList(where.ToExpression()); + var count = 0; + + var listSource = wtiRepository.AsQueryable() + .Where(where.ToExpression()).ToPageList(readEnergyManagementInputDto.Page,readEnergyManagementInputDto.PageSize,ref count); - return listSource; + var readEnergies = EntityMapper.MapList(listSource); + + return new ListOutputDto { listSource = readEnergies, total = count }; } - #endregion - #region 添加水电费信息 /// /// 添加水电费信息 /// /// /// - public bool InsertWtiInfo(Hydroelectricity w) + public BaseOutputDto InsertEnergyManagementInfo(CreateEnergyManagementInputDto w) { - return wtiRepository.Insert(w); + try + { + var result = wtiRepository.Insert(EntityMapper.Map(w)); + } + catch (Exception ex) + { + LogHelper.LogError(LocalizationHelper.GetLocalizedString("Insert Energy Management Failed", "水电信息添加失败"), ex); + return new BaseOutputDto(StatusCodeConstants.InternalServerError, LocalizationHelper.GetLocalizedString("Insert Energy Management Failed", "水电信息添加失败")); + } + + return new BaseOutputDto(StatusCodeConstants.Success, LocalizationHelper.GetLocalizedString("Insert Energy Management Success", "水电信息添加成功")); } - #endregion - #region 修改水电费信息 /// /// 修改水电费信息 /// - /// 包含要修改的数据,以及WtiNo作为查询条件 + /// 包含要修改的数据,以及EnergyManagementNo作为查询条件 /// - public bool UpdateWtiInfo(Hydroelectricity w) + public BaseOutputDto UpdateEnergyManagementInfo(UpdateEnergyManagementInputDto w) { - return wtiRepository.Update(a => new Hydroelectricity() + try + { + var result = wtiRepository.Update(EntityMapper.Map(w)); + + if (result) + { + return new BaseOutputDto(StatusCodeConstants.Success, LocalizationHelper.GetLocalizedString("Update Energy Management Success", "水电费信息更新成功")); + } + else + { + return new BaseOutputDto(StatusCodeConstants.InternalServerError, LocalizationHelper.GetLocalizedString("Update Energy Management Failed", "水电费信息更新失败")); + } + } + catch (Exception ex) { - UseDate = w.UseDate, - EndDate = w.EndDate, - WaterUse = w.WaterUse, - PowerUse = w.PowerUse, - Record = w.Record, - CustoNo = w.CustoNo, - DataChgUsr = w.DataChgUsr, - RoomNo = w.RoomNo - }, a => a.WtiNo == w.WtiNo); + LogHelper.LogError(LocalizationHelper.GetLocalizedString("Update Energy Management Failed", "水电费信息更新失败"), ex); + return new BaseOutputDto(StatusCodeConstants.InternalServerError, LocalizationHelper.GetLocalizedString("Update Energy Management Failed", "水电费信息更新失败")); + } } - #endregion - #region 根据房间编号、使用时间删除水电费信息 /// /// 根据房间编号、使用时间删除水电费信息 /// /// - public bool DeleteWtiInfo(Hydroelectricity hydroelectricity) + public BaseOutputDto DeleteEnergyManagementInfo(DeleteEnergyManagementInputDto hydroelectricity) { - return wtiRepository.Update(a => new Hydroelectricity() + try + { + var result = wtiRepository.Update(EntityMapper.Map(hydroelectricity)); + + if (result) + { + return new BaseOutputDto(StatusCodeConstants.Success, LocalizationHelper.GetLocalizedString("Delete Energy Management Success", "水电费信息删除成功")); + } + else + { + return new BaseOutputDto(StatusCodeConstants.InternalServerError, LocalizationHelper.GetLocalizedString("Delete Energy Management Failed", "水电费信息删除失败")); + } + } + catch (Exception ex) { - IsDelete = 1 - }, a => a.WtiNo == hydroelectricity.WtiNo); + LogHelper.LogError(LocalizationHelper.GetLocalizedString("Delete Energy Management Failed", "水电费信息删除失败"), ex); + return new BaseOutputDto(StatusCodeConstants.InternalServerError, LocalizationHelper.GetLocalizedString("Delete Energy Management Failed", "水电费信息删除失败")); + } } - #endregion } } diff --git a/EOM.TSHotelManagement.Application/Business/Hydroelectricity/IHydroelectricityService.cs b/EOM.TSHotelManagement.Application/Business/EnergyManagement/IEnergyManagementService.cs similarity index 77% rename from EOM.TSHotelManagement.Application/Business/Hydroelectricity/IHydroelectricityService.cs rename to EOM.TSHotelManagement.Application/Business/EnergyManagement/IEnergyManagementService.cs index 5f6a89abeb62b924f54626dba7e6e41447625867..ba981f7778c52cd9b1a216e75924cf28c640d985 100644 --- a/EOM.TSHotelManagement.Application/Business/Hydroelectricity/IHydroelectricityService.cs +++ b/EOM.TSHotelManagement.Application/Business/EnergyManagement/IEnergyManagementService.cs @@ -21,22 +21,21 @@ *SOFTWARE. * */ +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; /// /// 水电信息接口 /// -public interface IHydroelectricityService +public interface IEnergyManagementService { /// /// 根据条件查询水电费信息 /// 替换了 SelectWtiInfoByRoomNo, SelectWtiInfoByRoomNoAndTime, ListWtiInfoByRoomNo, SelectWtiInfoAll /// - /// 房间号(可选) - /// 使用开始时间(可选) - /// 使用结束时间(可选) + /// Dto /// 符合条件的水电费信息列表 - List SelectWtiInfo(string roomNo = null, DateTime? useDate = null, DateTime? endDate = null); + ListOutputDto SelectEnergyManagementInfo(ReadEnergyManagementInputDto readEnergyManagementInputDto); /// /// 添加水电费信息 @@ -44,7 +43,7 @@ public interface IHydroelectricityService /// /// /// - bool InsertWtiInfo(Hydroelectricity w); + BaseOutputDto InsertEnergyManagementInfo(CreateEnergyManagementInputDto w); /// /// 修改水电费信息 @@ -52,13 +51,13 @@ public interface IHydroelectricityService /// /// 包含要修改的数据,以及WtiNo作为查询条件 /// - bool UpdateWtiInfo(Hydroelectricity w); + BaseOutputDto UpdateEnergyManagementInfo(UpdateEnergyManagementInputDto w); /// /// 根据房间编号、使用时间删除水电费信息 /// 替换了 DeleteWtiInfoByRoomNoAndDateTime /// - /// + /// /// - bool DeleteWtiInfo(Hydroelectricity hydroelectricity); + BaseOutputDto DeleteEnergyManagementInfo(DeleteEnergyManagementInputDto deleteEnergyManagementInputDto); } diff --git a/EOM.TSHotelManagement.Application/Business/Fonts/IFontsService.cs b/EOM.TSHotelManagement.Application/Business/PromotionContent/IPromotionContentService.cs similarity index 76% rename from EOM.TSHotelManagement.Application/Business/Fonts/IFontsService.cs rename to EOM.TSHotelManagement.Application/Business/PromotionContent/IPromotionContentService.cs index e6a2146eefc77118c1701db7778887fba1c1f6d6..fe52c39a86f1ce18fd0f59ce50d850efd45be7e0 100644 --- a/EOM.TSHotelManagement.Application/Business/Fonts/IFontsService.cs +++ b/EOM.TSHotelManagement.Application/Business/PromotionContent/IPromotionContentService.cs @@ -21,6 +21,7 @@ *SOFTWARE. * */ +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; namespace EOM.TSHotelManagement.Application @@ -28,12 +29,18 @@ namespace EOM.TSHotelManagement.Application /// /// 酒店宣传联动内容接口 /// - public interface IFontsService + public interface IPromotionContentService { + /// + /// 查询所有宣传联动内容 + /// + /// + ListOutputDto SelectPromotionContentAll(ReadPromotionContentInputDto readPromotionContentInputDto); + /// /// 查询所有宣传联动内容(跑马灯) /// /// - List SelectFontAll(); + ListOutputDto SelectPromotionContents(); } } \ No newline at end of file diff --git a/EOM.TSHotelManagement.Application/Business/Fonts/FontsService.cs b/EOM.TSHotelManagement.Application/Business/PromotionContent/PromotionContentService.cs similarity index 54% rename from EOM.TSHotelManagement.Application/Business/Fonts/FontsService.cs rename to EOM.TSHotelManagement.Application/Business/PromotionContent/PromotionContentService.cs index e872c9cb7d6367a54fd51e20b60f8707f787d0c4..82d4b402935c6d312c66e9d5369fc09ed16d74ab 100644 --- a/EOM.TSHotelManagement.Application/Business/Fonts/FontsService.cs +++ b/EOM.TSHotelManagement.Application/Business/PromotionContent/PromotionContentService.cs @@ -21,7 +21,9 @@ *SOFTWARE. * */ +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Util; using EOM.TSHotelManagement.EntityFramework; namespace EOM.TSHotelManagement.Application @@ -29,30 +31,47 @@ namespace EOM.TSHotelManagement.Application /// /// 酒店宣传联动内容接口实现类 /// - public class FontsService : IFontsService + public class PromotionContentService : IPromotionContentService { /// /// 跑马灯 /// - private readonly GenericRepository fontsRepository; + private readonly GenericRepository fontsRepository; /// /// /// /// - public FontsService(GenericRepository fontsRepository) + public PromotionContentService(GenericRepository fontsRepository) { this.fontsRepository = fontsRepository; } + /// + /// 查询所有宣传联动内容 + /// + /// + public ListOutputDto SelectPromotionContentAll(ReadPromotionContentInputDto readPromotionContentInputDto) + { + ListOutputDto fonts = new ListOutputDto(); + var count = 0; + + var listSource = fontsRepository.AsQueryable().ToPageList(readPromotionContentInputDto.Page, readPromotionContentInputDto.PageSize, ref count); + + fonts.listSource = EntityMapper.MapList(listSource); + fonts.total = count; + return fonts; + } + /// /// 查询所有宣传联动内容(跑马灯) /// /// - public List SelectFontAll() + public ListOutputDto SelectPromotionContents() { - List fonts = new List(); - fonts = fontsRepository.GetList(); + ListOutputDto fonts = new ListOutputDto(); + var listSource = fontsRepository.AsQueryable().ToList(); + fonts.listSource = EntityMapper.MapList(listSource); return fonts; } } diff --git a/EOM.TSHotelManagement.Application/Business/Reser/IReserService.cs b/EOM.TSHotelManagement.Application/Business/Reser/IReserService.cs index 0405446d05ad3d59fedd93dd0a4891e3ab689c4f..636e6134f7e073a539a536bc406751512a501025 100644 --- a/EOM.TSHotelManagement.Application/Business/Reser/IReserService.cs +++ b/EOM.TSHotelManagement.Application/Business/Reser/IReserService.cs @@ -21,6 +21,7 @@ *SOFTWARE. * */ +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; namespace EOM.TSHotelManagement.Application @@ -35,28 +36,35 @@ namespace EOM.TSHotelManagement.Application /// 获取所有预约信息 /// /// - List SelectReserAll(); + ListOutputDto SelectReserAll(ReadReserInputDto readReserInputDto); /// /// 根据房间编号获取预约信息 /// - /// + /// /// - Reser SelectReserInfoByRoomNo(string no); + SingleOutputDto SelectReserInfoByRoomNo(ReadReserInputDto readReserInputDto); /// /// 删除预约信息 /// /// /// - bool DeleteReserInfo(Reser reser); + BaseOutputDto DeleteReserInfo(DeleteReserInputDto reser); + + /// + /// 更新预约信息 + /// + /// + /// + BaseOutputDto UpdateReserInfo(UpdateReserInputDto reser); /// /// 添加预约信息 /// /// /// - bool InserReserInfo(Reser r); + BaseOutputDto InserReserInfo(CreateReserInputDto r); } } \ No newline at end of file diff --git a/EOM.TSHotelManagement.Application/Business/Reser/ReserService.cs b/EOM.TSHotelManagement.Application/Business/Reser/ReserService.cs index 3b7be81d682d9820f0f59862c340bcb51379b781..b083496517e201abb6ee0ebcefb6cb7ea8383070 100644 --- a/EOM.TSHotelManagement.Application/Business/Reser/ReserService.cs +++ b/EOM.TSHotelManagement.Application/Business/Reser/ReserService.cs @@ -21,9 +21,14 @@ *SOFTWARE. * */ +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Util; using EOM.TSHotelManagement.EntityFramework; +using EOM.TSHotelManagement.Shared; using jvncorelib.EncryptorLib; +using Microsoft.AspNetCore.DataProtection; +using SqlSugar; namespace EOM.TSHotelManagement.Application { @@ -38,51 +43,88 @@ namespace EOM.TSHotelManagement.Application private readonly GenericRepository reserRepository; /// - /// 加密 + /// 房间信息 /// - private readonly jvncorelib.EncryptorLib.EncryptLib encrypt; + private readonly GenericRepository roomRepository; + + /// + /// 数据保护 + /// + private readonly IDataProtector dataProtector; /// /// /// /// - /// - public ReserService(GenericRepository reserRepository, jvncorelib.EncryptorLib.EncryptLib encrypt) + /// + /// + public ReserService(GenericRepository reserRepository, GenericRepository roomRepository, IDataProtectionProvider dataProtectionProvider) { this.reserRepository = reserRepository; - this.encrypt = encrypt; + this.roomRepository = roomRepository; + this.dataProtector = dataProtectionProvider.CreateProtector("ReserInfoProtector"); } /// /// 获取所有预约信息 /// /// - public List SelectReserAll() + public ListOutputDto SelectReserAll(ReadReserInputDto readReserInputDto) { - List rss = new List(); - rss = reserRepository.GetList(a => a.IsDelete == 0); - rss.ForEach(source => + ListOutputDto rss = new ListOutputDto(); + + var where = Expressionable.Create(); + + where = where.And(a => a.IsDelete == readReserInputDto.IsDelete); + + var count = 0; + + var listSource = new List(); + + if (!readReserInputDto.IgnorePaging && readReserInputDto.Page != 0 && readReserInputDto.PageSize != 0) { - //解密联系方式 - var sourceTelStr = source.CustoTel.Contains("·") ? encrypt.Decryption(source.CustoTel) : source.CustoTel; - source.CustoTel = sourceTelStr; + listSource = reserRepository.AsQueryable().Where(where.ToExpression()).ToPageList(readReserInputDto.Page, readReserInputDto.PageSize, ref count); + } + else + { + listSource = reserRepository.AsQueryable().Where(where.ToExpression()).ToList(); + } + + listSource.ForEach(source => + { + try + { + //解密联系方式 + var sourceTelStr = dataProtector.Unprotect(source.ReservationPhoneNumber); + source.ReservationPhoneNumber = sourceTelStr; + } + catch (Exception) + { + source.ReservationPhoneNumber = source.ReservationPhoneNumber; + } }); + + rss.listSource = EntityMapper.MapList(listSource); + rss.total = count; return rss; } /// /// 根据房间编号获取预约信息 /// - /// + /// /// - public Reser SelectReserInfoByRoomNo(string no) + public SingleOutputDto SelectReserInfoByRoomNo(ReadReserInputDto readReserInputDt) { Reser res = null; - res = reserRepository.GetSingle(a => a.ReserRoom == no && a.IsDelete != 1); + res = reserRepository.GetSingle(a => a.ReservationRoomNumber == readReserInputDt.ReservationRoomNumber && a.IsDelete != 1); //解密联系方式 - var sourceTelStr = res.CustoTel.Contains("·") ? encrypt.Decryption(res.CustoTel) : res.CustoTel; - res.CustoTel = sourceTelStr; - return res; + var sourceTelStr = dataProtector.Unprotect(res.ReservationPhoneNumber); + res.ReservationPhoneNumber = sourceTelStr; + + var outputReser = EntityMapper.Map(res); + + return new SingleOutputDto { Source = outputReser}; } /// @@ -90,28 +132,87 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool DeleteReserInfo(Reser reser) + public BaseOutputDto DeleteReserInfo(DeleteReserInputDto reser) { - return reserRepository.Update(a => new Reser() + var result = reserRepository.Update(a => new Reser() { - IsDelete = 1, - DataChgUsr = string.Empty - }, a => a.ReserId == reser.ReserId); + IsDelete = reser.IsDelete, + DataChgUsr = reser.DataChgUsr, + DataChgDate = reser.DataChgDate + }, a => a.ReservationId == reser.ReservationId); + if (result) + { + return new BaseOutputDto(StatusCodeConstants.Success, LocalizationHelper.GetLocalizedString("Delete Reser Success", "预约信息删除成功")); + } + else + { + return new BaseOutputDto(StatusCodeConstants.InternalServerError, LocalizationHelper.GetLocalizedString("Delete Reser Failed", "预约信息删除失败")); + } } /// - /// 添加预约信息 + /// 更新预约信息 /// - /// + /// /// - public bool InserReserInfo(Reser r) + public BaseOutputDto UpdateReserInfo(UpdateReserInputDto reser) { - var cryStr = encrypt.Encryption(r.CustoTel, EncryptionLevel.Enhanced); - r.CustoTel = cryStr; - return reserRepository.Insert(r); + string NewTel = dataProtector.Protect(reser.ReservationPhoneNumber); + reser.ReservationPhoneNumber = NewTel; + try + { + var result = reserRepository.Update(EntityMapper.Map(reser)); + + if (result) + { + return new BaseOutputDto(StatusCodeConstants.Success, LocalizationHelper.GetLocalizedString("Update Customer Success", "预约信息更新成功")); + } + else + { + return new BaseOutputDto(StatusCodeConstants.InternalServerError, LocalizationHelper.GetLocalizedString("Update Customer Failed", "预约信息更新失败")); + } + } + catch (Exception ex) + { + LogHelper.LogError(LocalizationHelper.GetLocalizedString("Update Customer Failed", "预约信息添加失败"), ex); + return new BaseOutputDto(StatusCodeConstants.InternalServerError, LocalizationHelper.GetLocalizedString("Update Customer Failed", "预约信息更新失败")); + } } + /// + /// 添加预约信息 + /// + /// + /// + public BaseOutputDto InserReserInfo(CreateReserInputDto r) + { + string NewTel = dataProtector.Protect(r.ReservationPhoneNumber); + r.ReservationPhoneNumber = NewTel; + try + { + var result = reserRepository.Insert(EntityMapper.Map(r)); + if (result) + { + roomRepository.Update(a => new Room() + { + RoomStateId = new EnumHelper().GetEnumValue(RoomState.Reserved), + DataChgUsr = r.DataChgUsr, + DataChgDate = r.DataChgDate + }, a => a.RoomNumber == r.ReservationRoomNumber); + return new BaseOutputDto(StatusCodeConstants.Success, LocalizationHelper.GetLocalizedString("Add Customer Success", "预约信息添加成功")); + } + else + { + return new BaseOutputDto(StatusCodeConstants.InternalServerError, LocalizationHelper.GetLocalizedString("Add Customer Failed", "预约信息添加失败")); + } + } + catch (Exception ex) + { + LogHelper.LogError(LocalizationHelper.GetLocalizedString("Add Customer Failed", "预约信息添加失败"), ex); + return new BaseOutputDto(StatusCodeConstants.InternalServerError, LocalizationHelper.GetLocalizedString("Add Customer Failed", "预约信息添加失败")); + } + } } } diff --git a/EOM.TSHotelManagement.Application/Business/Room/IRoomService.cs b/EOM.TSHotelManagement.Application/Business/Room/IRoomService.cs index a326b9cbef6efbee5a1ec5d2446960d9b4b3881f..a0a4c2083781fd055e2aa7a8aa0b3a80c25e54fc 100644 --- a/EOM.TSHotelManagement.Application/Business/Room/IRoomService.cs +++ b/EOM.TSHotelManagement.Application/Business/Room/IRoomService.cs @@ -21,6 +21,7 @@ *SOFTWARE. * */ +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; namespace EOM.TSHotelManagement.Application @@ -34,9 +35,9 @@ namespace EOM.TSHotelManagement.Application /// /// 根据房间状态获取相应状态的房间信息 /// - /// + /// /// - List SelectRoomByRoomState(int stateid); + ListOutputDto SelectRoomByRoomState(ReadRoomInputDto readRoomInputDto); #endregion #region 根据房间状态来查询可使用的房间 @@ -44,7 +45,7 @@ namespace EOM.TSHotelManagement.Application /// 根据房间状态来查询可使用的房间 /// /// - List SelectCanUseRoomAll(); + ListOutputDto SelectCanUseRoomAll(); #endregion #region 获取所有房间信息 @@ -52,7 +53,7 @@ namespace EOM.TSHotelManagement.Application /// 获取所有房间信息 /// /// - List SelectRoomAll(); + ListOutputDto SelectRoomAll(ReadRoomInputDto readRoomInputDto); #endregion #region 获取房间分区的信息 @@ -60,34 +61,34 @@ namespace EOM.TSHotelManagement.Application /// 获取房间分区的信息 /// /// - List SelectRoomByTypeName(string TypeName); + ListOutputDto SelectRoomByTypeName(ReadRoomInputDto TypeName); #endregion #region 根据房间编号查询房间信息 /// /// 根据房间编号查询房间信息 /// - /// + /// /// - Room SelectRoomByRoomNo(string no); + SingleOutputDto SelectRoomByRoomNo(ReadRoomInputDto readRoomInputDto); #endregion #region 根据房间编号退房(退房) /// /// 根据房间编号退房(退房) /// - /// + /// /// - bool UpdateRoomByRoomNo(string room); + BaseOutputDto UpdateRoomByRoomNo(ReadRoomInputDto readRoomInputDto); #endregion #region 根据房间编号查询截止到今天住了多少天 /// /// 根据房间编号查询截止到今天住了多少天 /// - /// + /// /// - object DayByRoomNo(string roomno); + SingleOutputDto DayByRoomNo(ReadRoomInputDto readRoomInputDto); #endregion #region 根据房间编号修改房间信息(入住) @@ -96,7 +97,7 @@ namespace EOM.TSHotelManagement.Application /// /// /// - bool UpdateRoomInfo(Room r); + BaseOutputDto UpdateRoomInfo(UpdateRoomInputDto r); #endregion #region 根据房间编号修改房间信息(预约) @@ -105,7 +106,7 @@ namespace EOM.TSHotelManagement.Application /// /// /// - bool UpdateRoomInfoWithReser(Room r); + BaseOutputDto UpdateRoomInfoWithReser(UpdateRoomInputDto r); #endregion #region 查询可入住房间数量 @@ -113,7 +114,7 @@ namespace EOM.TSHotelManagement.Application /// 查询可入住房间数量 /// /// - object SelectCanUseRoomAllByRoomState(); + SingleOutputDto SelectCanUseRoomAllByRoomState(); #endregion #region 查询已入住房间数量 @@ -121,7 +122,7 @@ namespace EOM.TSHotelManagement.Application /// 查询已入住房间数量 /// /// - object SelectNotUseRoomAllByRoomState(); + SingleOutputDto SelectNotUseRoomAllByRoomState(); #endregion #region 根据房间编号查询房间价格 @@ -129,7 +130,7 @@ namespace EOM.TSHotelManagement.Application /// 根据房间编号查询房间价格 /// /// - object SelectRoomByRoomPrice(string r); + object SelectRoomByRoomPrice(ReadRoomInputDto readRoomInputDto); #endregion #region 查询脏房数量 @@ -137,7 +138,7 @@ namespace EOM.TSHotelManagement.Application /// 查询脏房数量 /// /// - object SelectNotClearRoomAllByRoomState(); + SingleOutputDto SelectNotClearRoomAllByRoomState(); #endregion #region 查询维修房数量 @@ -145,7 +146,7 @@ namespace EOM.TSHotelManagement.Application /// 查询维修房数量 /// /// - object SelectFixingRoomAllByRoomState(); + SingleOutputDto SelectFixingRoomAllByRoomState(); #endregion #region 查询预约房数量 @@ -153,17 +154,16 @@ namespace EOM.TSHotelManagement.Application /// 查询预约房数量 /// /// - object SelectReseredRoomAllByRoomState(); + SingleOutputDto SelectReservedRoomAllByRoomState(); #endregion #region 根据房间编号更改房间状态 /// /// 根据房间编号更改房间状态 /// - /// - /// + /// /// - bool UpdateRoomStateByRoomNo(string roomno, int stateid); + BaseOutputDto UpdateRoomStateByRoomNo(ReadRoomInputDto readRoomInputDto); #endregion #region 添加房间 @@ -172,7 +172,7 @@ namespace EOM.TSHotelManagement.Application /// /// /// - bool InsertRoom(Room rn); + BaseOutputDto InsertRoom(CreateRoomInputDto rn); #endregion #region 更新房间 @@ -181,7 +181,7 @@ namespace EOM.TSHotelManagement.Application /// /// /// - bool UpdateRoom(Room rn); + BaseOutputDto UpdateRoom(UpdateRoomInputDto rn); #endregion #region 删除房间 @@ -190,7 +190,7 @@ namespace EOM.TSHotelManagement.Application /// /// /// - bool DeleteRoom(Room rn); + BaseOutputDto DeleteRoom(DeleteRoomInputDto rn); #endregion #region 查询所有可消费(已住)房间 @@ -198,24 +198,16 @@ namespace EOM.TSHotelManagement.Application /// 查询所有可消费(已住)房间 /// /// - List SelectRoomByStateAll(); - #endregion - - #region 获取所有房间状态 - /// - /// 获取所有房间状态 - /// - /// - List SelectRoomStateAll(); + ListOutputDto SelectRoomByStateAll(); #endregion #region 根据房间编号查询房间状态编号 /// /// 根据房间编号查询房间状态编号 /// - /// + /// /// - object SelectRoomStateIdByRoomNo(string roomno); + object SelectRoomStateIdByRoomNo(ReadRoomInputDto readRoomInputDto); #endregion } } \ No newline at end of file diff --git a/EOM.TSHotelManagement.Application/Business/Room/IRoomTypeService.cs b/EOM.TSHotelManagement.Application/Business/Room/IRoomTypeService.cs index 73393b1560746f6ed197c32b80018d8d6e2d5761..173c0c7cb02cfc45cc91a590348a5356019af713 100644 --- a/EOM.TSHotelManagement.Application/Business/Room/IRoomTypeService.cs +++ b/EOM.TSHotelManagement.Application/Business/Room/IRoomTypeService.cs @@ -21,6 +21,7 @@ *SOFTWARE. * */ +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; namespace EOM.TSHotelManagement.Application @@ -34,41 +35,41 @@ namespace EOM.TSHotelManagement.Application /// 获取所有房间类型 /// /// - List SelectRoomTypesAll(int? isDelete); + ListOutputDto SelectRoomTypesAll(ReadRoomTypeInputDto readRoomTypeInputDto); /// /// 根据房间编号查询房间类型名称 /// - /// + /// /// - RoomType SelectRoomTypeByRoomNo(string no); + SingleOutputDto SelectRoomTypeByRoomNo(ReadRoomTypeInputDto readRoomTypeInputDto); /// /// 根据房间类型查询类型配置 /// - /// + /// /// - RoomType SelectRoomTypeByType(int roomTypeId); + ReadRoomTypeOutputDto SelectRoomTypeByType(ReadRoomTypeInputDto readRoomTypeInputDto); /// /// 添加房间状态 /// - /// + /// /// - bool InsertRoomType(RoomType roomType); + BaseOutputDto InsertRoomType(CreateRoomTypeInputDto readRoomTypeInputDto); /// /// 更新房间状态 /// /// /// - bool UpdateRoomType(RoomType roomType); + BaseOutputDto UpdateRoomType(UpdateRoomTypeInputDto roomType); /// /// 删除房间状态 /// /// /// - bool DeleteRoomType(RoomType roomType); + BaseOutputDto DeleteRoomType(DeleteRoomTypeInputDto roomType); } } \ No newline at end of file diff --git a/EOM.TSHotelManagement.Application/Business/Room/RoomService.cs b/EOM.TSHotelManagement.Application/Business/Room/RoomService.cs index fce77bcdb44060cbb81a5053054e6c82ba42053e..77bfdc77299cc1d760a733b465a07ddb987a160e 100644 --- a/EOM.TSHotelManagement.Application/Business/Room/RoomService.cs +++ b/EOM.TSHotelManagement.Application/Business/Room/RoomService.cs @@ -21,9 +21,13 @@ *SOFTWARE. * */ +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Util; using EOM.TSHotelManagement.EntityFramework; +using EOM.TSHotelManagement.Shared; using jvncorelib.EntityLib; +using SqlSugar; namespace EOM.TSHotelManagement.Application { @@ -37,11 +41,6 @@ namespace EOM.TSHotelManagement.Application /// private readonly GenericRepository roomRepository; - /// - /// 客房状态 - /// - private readonly GenericRepository roomStateRepository; - /// /// 客房类型 /// @@ -50,428 +49,574 @@ namespace EOM.TSHotelManagement.Application /// /// 客户信息 /// - private readonly GenericRepository custoRepository; + private readonly GenericRepository custoRepository; /// /// /// /// - /// /// /// - public RoomService(GenericRepository roomRepository, GenericRepository roomStateRepository, GenericRepository roomTypeRepository, GenericRepository custoRepository) + public RoomService(GenericRepository roomRepository, GenericRepository roomTypeRepository, GenericRepository custoRepository) { this.roomRepository = roomRepository; - this.roomStateRepository = roomStateRepository; this.roomTypeRepository = roomTypeRepository; this.custoRepository = custoRepository; } - #region 根据房间状态获取相应状态的房间信息 /// /// 根据房间状态获取相应状态的房间信息 /// - /// + /// /// - public List SelectRoomByRoomState(int stateid) + public ListOutputDto SelectRoomByRoomState(ReadRoomInputDto readRoomInputDto) { - List roomStates = new List(); - roomStates = roomStateRepository.GetList(a => a.IsDelete != 1); + List roomStates = new List(); + var helper = new EnumHelper(); + roomStates = Enum.GetValues(typeof(RoomState)) + .Cast() + .Select(e => new EnumDto + { + Id = (int)e, + Name = e.ToString(), + Description = helper.GetEnumDescription(e) + }) + .ToList(); List roomTypes = new List(); roomTypes = roomTypeRepository.GetList(a => a.IsDelete != 1); List rooms = new List(); - rooms = roomRepository.GetList(a => a.IsDelete != 1 && a.RoomStateId == stateid).OrderBy(a => a.RoomNo).ToList(); + rooms = roomRepository.GetList(a => a.IsDelete != 1 && a.RoomStateId == readRoomInputDto.RoomStateId).OrderBy(a => a.RoomNumber).ToList(); rooms.ForEach(source => { - var roomState = roomStates.FirstOrDefault(a => a.RoomStateId == source.RoomStateId); - source.RoomState = roomState.RoomStateName.IsNullOrEmpty() ? "" : roomState.RoomStateName; - var roomType = roomTypes.FirstOrDefault(a => a.Roomtype == source.RoomType); - source.RoomName = roomType.RoomName.IsNullOrEmpty() ? "" : roomType.RoomName; + var roomState = roomStates.FirstOrDefault(a => a.Id == source.RoomStateId); + source.RoomState = roomState.Description.IsNullOrEmpty() ? "" : roomState.Description; + var roomType = roomTypes.FirstOrDefault(a => a.RoomTypeId == source.RoomTypeId); + source.RoomName = roomType.RoomTypeName.IsNullOrEmpty() ? "" : roomType.RoomTypeName; }); - return rooms; + + var listSource = EntityMapper.MapList(rooms); + + return new ListOutputDto { listSource = listSource }; } - #endregion - #region 根据房间状态来查询可使用的房间 /// /// 根据房间状态来查询可使用的房间 /// /// - public List SelectCanUseRoomAll() + public ListOutputDto SelectCanUseRoomAll() { - List roomStates = new List(); - roomStates = roomStateRepository.GetList(); + List roomStates = new List(); + var helper = new EnumHelper(); + roomStates = Enum.GetValues(typeof(RoomState)) + .Cast() + .Select(e => new EnumDto + { + Id = (int)e, + Name = e.ToString(), + Description = helper.GetEnumDescription(e) + }) + .ToList(); List roomTypes = new List(); roomTypes = roomTypeRepository.GetList(); List rooms = new List(); - rooms = roomRepository.GetList(a => a.IsDelete != 1 && a.RoomStateId == 0).OrderBy(a => a.RoomNo).ToList(); + rooms = roomRepository.GetList(a => a.IsDelete != 1 && a.RoomStateId == 0).OrderBy(a => a.RoomNumber).ToList(); rooms.ForEach(source => { - var roomState = roomStates.FirstOrDefault(a => a.RoomStateId == source.RoomStateId); - source.RoomState = roomState.RoomStateName.IsNullOrEmpty() ? "" : roomState.RoomStateName; - var roomType = roomTypes.FirstOrDefault(a => a.Roomtype == source.RoomType); - source.RoomName = roomType.RoomName.IsNullOrEmpty() ? "" : roomType.RoomName; + var roomState = roomStates.FirstOrDefault(a => a.Id == source.RoomStateId); + source.RoomState = roomState.Description.IsNullOrEmpty() ? "" : roomState.Description; + var roomType = roomTypes.FirstOrDefault(a => a.RoomTypeId == source.RoomTypeId); + source.RoomName = roomType.RoomTypeName.IsNullOrEmpty() ? "" : roomType.RoomTypeName; }); - return rooms; + + var listSource = EntityMapper.MapList(rooms); + + return new ListOutputDto { listSource = listSource }; } - #endregion - #region 获取所有房间信息 /// /// 获取所有房间信息 /// /// - public List SelectRoomAll() + public ListOutputDto SelectRoomAll(ReadRoomInputDto readRoomInputDto) { - List roomStates = new List(); - roomStates = roomStateRepository.GetList(); + var where = Expressionable.Create(); + + where = where.And(a => a.IsDelete == readRoomInputDto.IsDelete); + + if (readRoomInputDto.RoomStateId > 0) + { + where = where.And(a => a.RoomStateId == readRoomInputDto.RoomStateId); + } + + List roomStates = new List(); + var helper = new EnumHelper(); + roomStates = Enum.GetValues(typeof(RoomState)) + .Cast() + .Select(e => new EnumDto + { + Id = (int)e, + Name = e.ToString(), + Description = helper.GetEnumDescription(e) + }) + .ToList(); List roomTypes = new List(); roomTypes = roomTypeRepository.GetList(); List rooms = new List(); - rooms = roomRepository.GetList(a => a.IsDelete != 1).OrderBy(a => a.RoomNo).ToList(); - var listCustoNo = rooms.Select(a => a.CustoNo).Distinct().ToList(); - List custos = new List(); - custos = custoRepository.GetList(a => listCustoNo.Contains(a.CustoNo)); + + var count = 0; + + if (!readRoomInputDto.IgnorePaging && readRoomInputDto.Page != 0 && readRoomInputDto.PageSize != 0) + { + rooms = roomRepository.AsQueryable().Where(where.ToExpression()).OrderBy(a => a.RoomNumber).ToPageList(readRoomInputDto.Page,readRoomInputDto.PageSize,ref count); + } + else + { + rooms = roomRepository.GetList(a => a.IsDelete != 1).OrderBy(a => a.RoomNumber).ToList(); + } + + var listCustoNo = rooms.Select(a => a.CustomerNumber).Distinct().ToList(); + List custos = new List(); + custos = custoRepository.GetList(a => listCustoNo.Contains(a.CustomerNumber)); + rooms.ForEach(source => { - var roomState = roomStates.FirstOrDefault(a => a.RoomStateId == source.RoomStateId); - source.RoomState = roomState.RoomStateName.IsNullOrEmpty() ? "" : roomState.RoomStateName; - var roomType = roomTypes.FirstOrDefault(a => a.Roomtype == source.RoomType); - source.RoomName = roomType.RoomName.IsNullOrEmpty() ? "" : roomType.RoomName; + var roomState = roomStates.FirstOrDefault(a => a.Id == source.RoomStateId); + source.RoomState = roomState.Description.IsNullOrEmpty() ? "" : roomState.Description; + var roomType = roomTypes.FirstOrDefault(a => a.RoomTypeId == source.RoomTypeId); + source.RoomName = roomType.RoomTypeName.IsNullOrEmpty() ? "" : roomType.RoomTypeName; - var custo = custos.FirstOrDefault(a => a.CustoNo.Equals(source.CustoNo)); - source.CustoName = custo.IsNullOrEmpty() ? "" : custo.CustoName; + var custo = custos.FirstOrDefault(a => a.CustomerNumber.Equals(source.CustomerNumber)); + source.CustomerName = custo.IsNullOrEmpty() ? "" : custo.CustomerName; //把入住时间格式化 - source.CheckTimeFormat = (source.CheckTime + "").IsNullOrEmpty() ? "" - : Convert.ToDateTime(source.CheckTime).ToString("yyyy-MM-dd HH:mm"); + source.LastCheckInTimeFormatted = (source.LastCheckInTime + "").IsNullOrEmpty() ? "" + : Convert.ToDateTime(source.LastCheckInTime).ToString("yyyy-MM-dd HH:mm"); }); - return rooms; + var listSource = EntityMapper.MapList(rooms); + + return new ListOutputDto { listSource = listSource,total = count }; } - #endregion - #region 获取房间分区的信息 /// /// 获取房间分区的信息 /// /// - public List SelectRoomByTypeName(string TypeName) + public ListOutputDto SelectRoomByTypeName(ReadRoomInputDto readRoomInputDto) { - List roomStates = new List(); - roomStates = roomStateRepository.GetList(a => a.IsDelete != 1); + List roomStates = new List(); + var helper = new EnumHelper(); + roomStates = Enum.GetValues(typeof(RoomState)) + .Cast() + .Select(e => new EnumDto + { + Id = (int)e, + Name = e.ToString(), + Description = helper.GetEnumDescription(e) + }) + .ToList(); List roomTypes = new List(); - roomTypes = roomTypeRepository.GetList(a => a.IsDelete != 1 && a.RoomName == TypeName); - var listTypes = roomTypes.Select(a => a.Roomtype).Distinct().ToList(); + roomTypes = roomTypeRepository.GetList(a => a.IsDelete != 1 && a.RoomTypeName == readRoomInputDto.RoomTypeName); + var listTypes = roomTypes.Select(a => a.RoomTypeId).Distinct().ToList(); List rooms = new List(); - rooms = roomRepository.GetList(a => a.IsDelete != 1 && listTypes.Contains(a.RoomType)).OrderBy(a => a.RoomNo).ToList(); - var listCustoNo = rooms.Select(a => a.CustoNo).Distinct().ToList(); - List custos = new List(); - custos = custoRepository.GetList(a => listCustoNo.Contains(a.CustoNo)); + rooms = roomRepository.GetList(a => a.IsDelete != 1 && listTypes.Contains(a.RoomTypeId)).OrderBy(a => a.RoomNumber).ToList(); + var listCustoNo = rooms.Select(a => a.CustomerNumber).Distinct().ToList(); + List custos = new List(); + custos = custoRepository.GetList(a => listCustoNo.Contains(a.CustomerNumber)); rooms.ForEach(source => { - var roomState = roomStates.FirstOrDefault(a => a.RoomStateId == source.RoomStateId); - source.RoomState = roomState.RoomStateName.IsNullOrEmpty() ? "" : roomState.RoomStateName; - var roomType = roomTypes.FirstOrDefault(a => a.Roomtype == source.RoomType); - source.RoomName = roomType.RoomName.IsNullOrEmpty() ? "" : roomType.RoomName; + var roomState = roomStates.FirstOrDefault(a => a.Id == source.RoomStateId); + source.RoomState = roomState.Description.IsNullOrEmpty() ? "" : roomState.Description; + var roomType = roomTypes.FirstOrDefault(a => a.RoomTypeId == source.RoomTypeId); + source.RoomName = roomType.RoomTypeName.IsNullOrEmpty() ? "" : roomType.RoomTypeName; - var custo = custos.FirstOrDefault(a => a.CustoNo.Equals(source.CustoNo)); - source.CustoName = custo.IsNullOrEmpty() ? "" : custo.CustoName; + var custo = custos.FirstOrDefault(a => a.CustomerNumber.Equals(source.CustomerNumber)); + source.CustomerName = custo.IsNullOrEmpty() ? "" : custo.CustomerName; }); - return rooms; + var listSource = EntityMapper.MapList(rooms); + + return new ListOutputDto { listSource = listSource }; } - #endregion - #region 根据房间编号查询房间信息 /// /// 根据房间编号查询房间信息 /// - /// + /// /// - public Room SelectRoomByRoomNo(string no) + public SingleOutputDto SelectRoomByRoomNo(ReadRoomInputDto readRoomInputDto) { - List roomStates = new List(); - roomStates = roomStateRepository.GetList(a => a.IsDelete != 1); + List roomStates = new List(); + var helper = new EnumHelper(); + roomStates = Enum.GetValues(typeof(RoomState)) + .Cast() + .Select(e => new EnumDto + { + Id = (int)e, + Name = e.ToString(), + Description = helper.GetEnumDescription(e) + }) + .ToList(); Room room = new Room(); - room = roomRepository.GetSingle(a => a.IsDelete != 1 && a.RoomNo == no); + room = roomRepository.GetSingle(a => a.IsDelete != 1 && a.RoomNumber == readRoomInputDto.RoomNumber); if (!room.IsNullOrEmpty()) { - var roomSate = roomStates.FirstOrDefault(a => a.RoomStateId == room.RoomStateId); - room.RoomState = roomSate.RoomStateName.IsNullOrEmpty() ? "" : roomSate.RoomStateName; - var roomType = roomTypeRepository.GetSingle(a => a.Roomtype == room.RoomType); - room.RoomName = roomType.RoomName.IsNullOrEmpty() ? "" : roomType.RoomName; + var roomSate = roomStates.FirstOrDefault(a => a.Id == room.RoomStateId); + room.RoomState = roomSate.Description.IsNullOrEmpty() ? "" : roomSate.Description; + var roomType = roomTypeRepository.GetSingle(a => a.RoomTypeId == room.RoomTypeId); + room.RoomName = roomType.RoomTypeName.IsNullOrEmpty() ? "" : roomType.RoomTypeName; } else { room = new Room(); } - return room; + var Source = EntityMapper.Map(room); + + return new SingleOutputDto() { Source = Source }; } - #endregion - #region 根据房间编号退房(退房) /// /// 根据房间编号退房(退房) /// /// /// - public bool UpdateRoomByRoomNo(string room) + public BaseOutputDto UpdateRoomByRoomNo(ReadRoomInputDto room) { - return roomRepository.Update(a => new Room() + try { - CustoNo = null, - CheckTime = null, - CheckOutTime = DateTime.Now, - RoomStateId = 3 - }, a => a.RoomNo == room); + roomRepository.Update(a => new Room() + { + CustomerNumber = null, + LastCheckInTime = null, + LastCheckOutTime = DateTime.Now, + RoomStateId = 3 + }, a => a.RoomNumber == room.RoomNumber); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } - #endregion - - #region 根据房间编号查询截止到今天住了多少天 /// /// 根据房间编号查询截止到今天住了多少天 /// - /// + /// /// - public object DayByRoomNo(string roomno) + public SingleOutputDto DayByRoomNo(ReadRoomInputDto roomInputDto) { - return Math.Abs(((TimeSpan)(roomRepository.GetSingle(a => a.RoomNo == roomno).CheckTime - DateTime.Now)).Days); + var days = Math.Abs(((TimeSpan)(roomRepository.GetSingle(a => a.RoomNumber == roomInputDto.RoomNumber).LastCheckInTime - DateTime.Now)).Days); + return new SingleOutputDto { Source = new ReadRoomOutputDto { StayDays = days } }; } - #endregion - #region 根据房间编号修改房间信息(入住) /// /// 根据房间编号修改房间信息(入住) /// /// /// - public bool UpdateRoomInfo(Room r) + public BaseOutputDto UpdateRoomInfo(UpdateRoomInputDto r) { - return roomRepository.Update(a => new Room() + try { - CheckTime = r.CheckTime, - RoomStateId = r.RoomStateId, - CustoNo = r.CustoNo - }, a => a.RoomNo == r.RoomNo); + roomRepository.Update(a => new Room() + { + LastCheckInTime = r.LastCheckInTime, + RoomStateId = r.RoomStateId, + CustomerNumber = r.CustomerNumber, + DataChgDate = r.DataChgDate, + DataChgUsr = r.DataChgUsr, + }, a => a.RoomNumber == r.RoomNumber); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } - #endregion - #region 根据房间编号修改房间信息(预约) /// /// 根据房间编号修改房间信息(预约) /// /// /// - public bool UpdateRoomInfoWithReser(Room r) + public BaseOutputDto UpdateRoomInfoWithReser(UpdateRoomInputDto r) { - return roomRepository.Update(a => new Room() + try + { + roomRepository.Update(a => new Room() + { + RoomStateId = r.RoomStateId, + DataChgUsr = r.DataChgUsr, + DataInsDate = r.DataInsDate, + }, a => a.RoomNumber == r.RoomNumber); + } + catch (Exception ex) { - RoomStateId = r.RoomStateId, - DataChgUsr = r.DataChgUsr - }, a => a.RoomNo == r.RoomNo); + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } - #endregion - #region 查询可入住房间数量 - /// - /// 查询可入住房间数量 - /// - /// - public object SelectCanUseRoomAllByRoomState() + /// + /// 查询可入住房间数量 + /// + /// + public SingleOutputDto SelectCanUseRoomAllByRoomState() { - return roomRepository.GetList(a => a.RoomStateId == 0 && a.IsDelete != 1).OrderBy(a => a.RoomNo).Count(); + try + { + var count = roomRepository.Count(a => a.RoomStateId == (int)RoomState.Vacant && a.IsDelete != 1); + return new SingleOutputDto + { + Source = new ReadRoomOutputDto { Vacant = count } + }; + } + catch (Exception ex) + { + return new SingleOutputDto + { + Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), + StatusCode = StatusCodeConstants.InternalServerError + }; + } } - #endregion - #region 查询已入住房间数量 /// /// 查询已入住房间数量 /// /// - public object SelectNotUseRoomAllByRoomState() + public SingleOutputDto SelectNotUseRoomAllByRoomState() { - return roomRepository.GetList(a => a.RoomStateId == 1 && a.IsDelete != 1).OrderBy(a => a.RoomNo).Count(); + try + { + var count = roomRepository.Count(a => a.RoomStateId == (int)RoomState.Occupied && a.IsDelete != 1); + return new SingleOutputDto + { + Source = new ReadRoomOutputDto { Occupied = count } + }; + } + catch (Exception ex) + { + return new SingleOutputDto + { + Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), + StatusCode = StatusCodeConstants.InternalServerError + }; + } } - #endregion - #region 根据房间编号查询房间价格 /// /// 根据房间编号查询房间价格 /// /// - public object SelectRoomByRoomPrice(string r) + public object SelectRoomByRoomPrice(ReadRoomInputDto r) { - return roomRepository.GetSingle(a => a.RoomNo == r).RoomMoney; + return roomRepository.GetSingle(a => a.RoomNumber == r.RoomNumber).RoomRent; } - #endregion - #region 查询脏房数量 /// /// 查询脏房数量 /// /// - public object SelectNotClearRoomAllByRoomState() + public SingleOutputDto SelectNotClearRoomAllByRoomState() { - return roomRepository.GetList(a => a.RoomStateId == 3 && a.IsDelete != 1).OrderBy(a => a.RoomNo).Count(); + try + { + var count = roomRepository.Count(a => a.RoomStateId == (int)RoomState.Dirty && a.IsDelete != 1); + return new SingleOutputDto + { + Source = new ReadRoomOutputDto { Dirty = count } + }; + } + catch (Exception ex) + { + return new SingleOutputDto + { + Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), + StatusCode = StatusCodeConstants.InternalServerError + }; + } } - #endregion - #region 查询维修房数量 /// /// 查询维修房数量 /// /// - public object SelectFixingRoomAllByRoomState() + public SingleOutputDto SelectFixingRoomAllByRoomState() { - return roomRepository.GetList(a => a.RoomStateId == 2 && a.IsDelete != 1).OrderBy(a => a.RoomNo).Count(); + try + { + var count = roomRepository.Count(a => a.RoomStateId == (int)RoomState.Maintenance && a.IsDelete != 1); + return new SingleOutputDto + { + Source = new ReadRoomOutputDto { Maintenance = count } + }; + } + catch (Exception ex) + { + return new SingleOutputDto + { + Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), + StatusCode = StatusCodeConstants.InternalServerError + }; + } } - #endregion - #region 查询预约房数量 /// /// 查询预约房数量 /// /// - public object SelectReseredRoomAllByRoomState() + public SingleOutputDto SelectReservedRoomAllByRoomState() { - return roomRepository.GetList(a => a.RoomStateId == 4 && a.IsDelete != 1).OrderBy(a => a.RoomNo).Count(); + try + { + var count = roomRepository.Count(a => a.RoomStateId == (int)RoomState.Reserved && a.IsDelete != 1); + return new SingleOutputDto + { + Source = new ReadRoomOutputDto { Reserved = count } + }; + } + catch (Exception ex) + { + return new SingleOutputDto + { + Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), + StatusCode = StatusCodeConstants.InternalServerError + }; + } } - #endregion - #region 根据房间编号更改房间状态 /// /// 根据房间编号更改房间状态 /// - /// - /// + /// /// - public bool UpdateRoomStateByRoomNo(string roomno, int stateid) + public BaseOutputDto UpdateRoomStateByRoomNo(ReadRoomInputDto readRoomInputDto) { - return roomRepository.Update(a => new Room() + try + { + roomRepository.Update(a => new Room() + { + RoomStateId = readRoomInputDto.RoomStateId + }, a => a.RoomNumber == readRoomInputDto.RoomNumber); + } + catch (Exception ex) { - RoomStateId = stateid - }, a => a.RoomNo == roomno); + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } - #endregion - #region 添加房间 /// /// 添加房间 /// /// /// - public bool InsertRoom(Room rn) + public BaseOutputDto InsertRoom(CreateRoomInputDto rn) { try { - var isExist = roomRepository.IsAny(a => a.RoomNo == rn.RoomNo); + var isExist = roomRepository.IsAny(a => a.RoomNumber == rn.RoomNumber); if (isExist) - return false; - return roomRepository.Insert(rn); + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString("This room already exists.", "房间已存在。"),StatusCode = StatusCodeConstants.InternalServerError}; + + roomRepository.Insert(EntityMapper.Map(rn)); } - catch (Exception) + catch (Exception ex) { - return false; + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; } + + return new BaseOutputDto(); } - #endregion - #region 更新房间 /// /// 更新房间 /// /// /// - public bool UpdateRoom(Room rn) + public BaseOutputDto UpdateRoom(UpdateRoomInputDto rn) { try { - var isExist = roomRepository.IsAny(a => a.RoomNo == rn.RoomNo); + var isExist = roomRepository.IsAny(a => a.RoomNumber == rn.RoomNumber); if (!isExist) - return false; - return roomRepository.Update(rn); + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString("This room does not exist.", "房间不存在。"), StatusCode = StatusCodeConstants.InternalServerError }; + roomRepository.Update(EntityMapper.Map(rn)); } - catch (Exception) + catch (Exception ex) { - return false; + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; } + + return new BaseOutputDto(); } - #endregion - #region 删除房间 /// /// 删除房间 /// /// /// - public bool DeleteRoom(Room rn) + public BaseOutputDto DeleteRoom(DeleteRoomInputDto rn) { try { - var isExist = roomRepository.IsAny(a => a.RoomNo == rn.RoomNo); + var isExist = roomRepository.IsAny(a => a.RoomNumber == rn.RoomNumber); if (!isExist) - return false; - rn.IsDelete = 1; - rn.DataChgUsr = rn.DataChgUsr; - rn.DataChgDate = rn.DataChgDate; - return roomRepository.Update(rn); + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString("This room does not exist.", "房间不存在。"), StatusCode = StatusCodeConstants.InternalServerError }; + roomRepository.Update(EntityMapper.Map(rn)); } - catch (Exception) + catch (Exception ex) { - return false; + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; } + + return new BaseOutputDto(); } - #endregion - #region 查询所有可消费(已住)房间 /// /// 查询所有可消费(已住)房间 /// /// - public List SelectRoomByStateAll() + public ListOutputDto SelectRoomByStateAll() { - List roomStates = new List(); - roomStates = roomStateRepository.GetList(a => a.IsDelete != 1); + List roomStates = new List(); + var helper = new EnumHelper(); + roomStates = Enum.GetValues(typeof(RoomState)) + .Cast() + .Select(e => new EnumDto + { + Id = (int)e, + Name = e.ToString(), + Description = helper.GetEnumDescription(e) + }) + .ToList(); List roomTypes = new List(); roomTypes = roomTypeRepository.GetList(a => a.IsDelete != 1); List rooms = new List(); - rooms = roomRepository.GetList(a => a.IsDelete != 1 && a.RoomStateId == 1).OrderBy(a => a.RoomNo).ToList(); + rooms = roomRepository.GetList(a => a.IsDelete != 1 && a.RoomStateId == 1).OrderBy(a => a.RoomNumber).ToList(); rooms.ForEach(source => { - var roomState = roomStates.FirstOrDefault(a => a.RoomStateId == source.RoomStateId); - source.RoomState = roomState.RoomStateName.IsNullOrEmpty() ? "" : roomState.RoomStateName; - var roomType = roomTypes.FirstOrDefault(a => a.Roomtype == source.RoomType); - source.RoomName = roomType.RoomName.IsNullOrEmpty() ? "" : roomType.RoomName; + var roomState = roomStates.FirstOrDefault(a => a.Id == source.RoomStateId); + source.RoomState = roomState.Description.IsNullOrEmpty() ? "" : roomState.Description; + var roomType = roomTypes.FirstOrDefault(a => a.RoomTypeId == source.RoomTypeId); + source.RoomName = roomType.RoomTypeName.IsNullOrEmpty() ? "" : roomType.RoomTypeName; }); - return rooms; - } - #endregion - #region 获取所有房间状态 - /// - /// 获取所有房间状态 - /// - /// - public List SelectRoomStateAll() - { - List rs = new List(); - rs = roomStateRepository.GetList(a => a.IsDelete != 1); - return rs; + var listSource = EntityMapper.MapList(rooms); + + return new ListOutputDto { listSource = listSource }; } - #endregion - #region 根据房间编号查询房间状态编号 /// /// 根据房间编号查询房间状态编号 /// - /// + /// /// - public object SelectRoomStateIdByRoomNo(string roomno) + public object SelectRoomStateIdByRoomNo(ReadRoomInputDto readRoomInputDto) { - return roomRepository.GetSingle(a => a.RoomNo == roomno).RoomStateId; + return roomRepository.GetSingle(a => a.RoomNumber == readRoomInputDto.RoomNumber).RoomStateId; } - #endregion } } diff --git a/EOM.TSHotelManagement.Application/Business/Room/RoomTypeService.cs b/EOM.TSHotelManagement.Application/Business/Room/RoomTypeService.cs index 4d8531abef3380a91de837fb5a83e5d98fe95f6d..289ce7ccfcc900ab2018e269a8044863b6c6ee7e 100644 --- a/EOM.TSHotelManagement.Application/Business/Room/RoomTypeService.cs +++ b/EOM.TSHotelManagement.Application/Business/Room/RoomTypeService.cs @@ -21,9 +21,12 @@ *SOFTWARE. * */ +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Util; using EOM.TSHotelManagement.EntityFramework; using jvncorelib.EntityLib; +using SqlSugar; namespace EOM.TSHotelManagement.Application { @@ -58,20 +61,43 @@ namespace EOM.TSHotelManagement.Application /// 获取所有房间类型 /// /// - public List SelectRoomTypesAll(int? isDelete) + public ListOutputDto SelectRoomTypesAll(ReadRoomTypeInputDto readRoomTypeInputDto) { + var where = Expressionable.Create(); + + where = where.And(a => a.IsDelete == 0); + List types = new List(); - if (!isDelete.IsNullOrEmpty()) + + if (!readRoomTypeInputDto.IsDelete.IsNullOrEmpty()) { - types = roomTypeRepository.GetList(a => a.IsDelete == isDelete); + where = where.And(a => a.IsDelete == readRoomTypeInputDto.IsDelete); } - types = roomTypeRepository.GetList(); + + var count = 0; + + if (!readRoomTypeInputDto.IgnorePaging && readRoomTypeInputDto.Page != 0 && readRoomTypeInputDto.PageSize != 0) + { + types = roomTypeRepository.AsQueryable().Where(where.ToExpression()).ToPageList(readRoomTypeInputDto.Page, readRoomTypeInputDto.PageSize, ref count); + } + else + { + types = roomTypeRepository.AsQueryable().Where(where.ToExpression()).ToList(); + } + types.ForEach(t => { - t.DeleteMkNm = t.IsDelete == 0 ? "否" : "是"; + t.DeleteMarkDescription = t.IsDelete == 0 ? "否" : "是"; }); - return types; + + var listSource = EntityMapper.MapList(types); + + return new ListOutputDto + { + listSource = listSource, + total = listSource.Count + }; } #endregion @@ -79,71 +105,101 @@ namespace EOM.TSHotelManagement.Application /// /// 根据房间编号查询房间类型名称 /// - /// + /// /// - public RoomType SelectRoomTypeByRoomNo(string no) + public SingleOutputDto SelectRoomTypeByRoomNo(ReadRoomTypeInputDto readRoomTypeInputDto) { RoomType roomtype = new RoomType(); Room room = new Room(); - room = roomRepository.GetSingle(a => a.RoomNo == no && a.IsDelete != 1); - roomtype.RoomName = roomTypeRepository.GetSingle(a => a.Roomtype == room.RoomType).RoomName; - return roomtype; + room = roomRepository.GetSingle(a => a.RoomNumber == readRoomTypeInputDto.RoomNumber && a.IsDelete != 1); + roomtype.RoomTypeName = roomTypeRepository.GetSingle(a => a.RoomTypeId == room.RoomTypeId).RoomTypeName; + + var source = EntityMapper.Map(roomtype); + + return new SingleOutputDto { Source = source}; } #endregion /// /// 根据房间类型查询类型配置 /// - /// + /// /// - public RoomType SelectRoomTypeByType(int roomTypeId) + public ReadRoomTypeOutputDto SelectRoomTypeByType(ReadRoomTypeInputDto readRoomTypeInputDto) { - var roomType = roomTypeRepository.GetSingle(a => a.Roomtype == roomTypeId); - return roomType; + var roomType = roomTypeRepository.GetSingle(a => a.RoomTypeId == readRoomTypeInputDto.RoomTypeId); + + var source = EntityMapper.Map(roomType); + + return source; } /// - /// 添加房间状态 + /// 添加房间类型 /// /// /// - public bool InsertRoomType(RoomType roomType) + public BaseOutputDto InsertRoomType(CreateRoomTypeInputDto roomType) { - var existRoomType = roomTypeRepository.IsAny(a => a.Roomtype == roomType.Roomtype); - if (existRoomType) - return false; - return roomTypeRepository.Insert(roomType); + try + { + var existRoomType = roomTypeRepository.IsAny(a => a.RoomTypeId == roomType.RoomTypeId); + if (existRoomType) + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString("This room type already exists.", "房间类型已存在。"), StatusCode = StatusCodeConstants.InternalServerError }; + roomTypeRepository.Insert(EntityMapper.Map(roomType)); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message,ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } /// - /// 更新房间状态 + /// 更新房间类型 /// /// /// - public bool UpdateRoomType(RoomType roomType) + public BaseOutputDto UpdateRoomType(UpdateRoomTypeInputDto roomType) { - return roomTypeRepository.Update(a => new RoomType + try { - RoomName = roomType.RoomName, - RoomRent = roomType.RoomRent, - RoomDeposit = roomType.RoomDeposit, - IsDelete = roomType.IsDelete, - DataChgUsr = roomType.DataChgUsr, - DataChgDate = roomType.DataChgDate - }, a => a.Roomtype == roomType.Roomtype); + roomTypeRepository.Update(a => new RoomType + { + RoomTypeName = roomType.RoomTypeName, + RoomRent = roomType.RoomRent, + RoomDeposit = roomType.RoomDeposit, + IsDelete = roomType.IsDelete, + DataChgUsr = roomType.DataChgUsr, + DataChgDate = roomType.DataChgDate + }, a => a.RoomTypeId == roomType.RoomTypeId); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } /// - /// 删除房间状态 + /// 删除房间类型 /// /// /// - public bool DeleteRoomType(RoomType roomType) + public BaseOutputDto DeleteRoomType(DeleteRoomTypeInputDto roomType) { - return roomTypeRepository.Update(a => new RoomType + try { - IsDelete = 1 - }, a => a.Roomtype == roomType.Roomtype); + roomTypeRepository.Update(a => new RoomType + { + IsDelete = 1 + }, a => a.RoomTypeId == roomType.RoomTypeId); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } } } diff --git a/EOM.TSHotelManagement.Application/Business/Sellthing/ISellService.cs b/EOM.TSHotelManagement.Application/Business/Sellthing/ISellService.cs index 4d9df18d74cfd7b223326b8173bf26a9f57c51c3..d2820a8f2632b08391e12ee8b6a506b8053b49f0 100644 --- a/EOM.TSHotelManagement.Application/Business/Sellthing/ISellService.cs +++ b/EOM.TSHotelManagement.Application/Business/Sellthing/ISellService.cs @@ -21,7 +21,7 @@ *SOFTWARE. * */ -using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Contract; namespace EOM.TSHotelManagement.Application { @@ -34,68 +34,62 @@ namespace EOM.TSHotelManagement.Application /// 查询所有商品 /// /// - List SelectSellThingAll(SellThing sellThing = null); + ListOutputDto SelectSellThingAll(ReadSellThingInputDto sellThing); /// /// 查询所有商品(包括库存为0/已删除) /// /// - List GetSellThings(SellThing sellThing = null); + ListOutputDto GetSellThings(ReadSellThingInputDto sellThing); /// /// 修改商品 /// - /// - /// + /// /// - bool UpdateSellThing(string stock, string sellNo); + BaseOutputDto UpdateSellThing(UpdateSellThingInputDto updateSellThingInputDto); /// /// 修改商品信息 /// /// /// - bool UpdateSellthingInfo(SellThing sellThing); + BaseOutputDto UpdateSellthingInfo(UpdateSellThingInputDto sellThing); /// /// 撤回客户消费信息 /// - /// - /// - /// + /// /// - bool DeleteSellThing(string roomNo, string custoNo, string sellName); + BaseOutputDto DeleteSellthing(DeleteSellThingInputDto deleteSellThingInputDto); /// /// 根据商品编号删除商品信息 /// - /// + /// /// - bool DeleteSellThingBySellNo(string sellNo); + BaseOutputDto DeleteSellThingBySellNo(DeleteSellThingInputDto deleteSellThingInputDto); /// /// 根据商品名称和价格查询商品编号 /// - /// - /// + /// /// - SellThing SelectSellThingByNameAndPrice(string name, string price); + SingleOutputDto SelectSellThingByNameAndPrice(ReadSellThingInputDto readSellThingInputDto); /// /// 根据商品编号查询商品信息 /// - /// + /// /// - SellThing SelectSellInfoBySellNo(string SellNo); + ReadSellThingOutputDto SelectSellInfoBySellNo(ReadSellThingInputDto readSellThingInputDto); - #region 添加商品 /// /// 添加商品 /// /// /// - bool InsertSellThing(SellThing st); - #endregion + BaseOutputDto InsertSellThing(CreateSellThingInputDto st); } } \ No newline at end of file diff --git a/EOM.TSHotelManagement.Application/Business/Sellthing/SellService.cs b/EOM.TSHotelManagement.Application/Business/Sellthing/SellService.cs index cb1038bf85aa6b8cf93a7ac4e36e457394468e13..9fa96392f238acf521b9cffecad7ac3918ac7dac 100644 --- a/EOM.TSHotelManagement.Application/Business/Sellthing/SellService.cs +++ b/EOM.TSHotelManagement.Application/Business/Sellthing/SellService.cs @@ -21,7 +21,9 @@ *SOFTWARE. * */ +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Util; using EOM.TSHotelManagement.EntityFramework; using EOM.TSHotelManagement.Shared; using jvncorelib.EntityLib; @@ -59,44 +61,61 @@ namespace EOM.TSHotelManagement.Application /// 查询所有商品 /// /// - public List SelectSellThingAll(SellThing sellThing = null) + public ListOutputDto SelectSellThingAll(ReadSellThingInputDto sellThing) { List sellThings = new List(); - var exp = Expressionable.Create().And(a => a.IsDelete == 0 && a.Stock > 0); - if (sellThing.IsNullOrEmpty()) + var exp = Expressionable.Create(); + + exp = exp.And(a => a.Stock > 0 && a.IsDelete == sellThing.IsDelete); + + //商品编号 + if (!sellThing.ProductNumber.IsNullOrEmpty()) { - sellThings = sellThingRepository.GetList(exp.ToExpression()); - sellThings.ForEach(_sellThing => - { - _sellThing.SellPriceStr = Decimal.Parse(_sellThing.SellPrice.ToString()).ToString("#,##0.00").ToString(); - }); + exp = exp.And(a => a.ProductNumber.Contains(sellThing.ProductNumber)); + } + + //商品名称 + if (!sellThing.ProductName.IsNullOrEmpty()) + { + exp = exp.Or(a => a.ProductName.Contains(sellThing.ProductName)); + } + + //商品规格 + if (!sellThing.Specification.IsNullOrEmpty()) + { + exp = exp.And(a => a.Specification.Contains(sellThing.Specification)); + } + + var count = 0; + + if (!sellThing.IgnorePaging && sellThing.Page != 0 && sellThing.PageSize != 0) + { + sellThings = sellThingRepository.AsQueryable().Where(exp.ToExpression()).ToPageList(sellThing.Page, sellThing.PageSize, ref count); } else { - //商品编号 - if (!sellThing.SellNo.IsNullOrEmpty()) - { - exp = exp.And(a => a.SellNo.Contains(sellThing.SellNo)); - } - //商品名称 - if (!sellThing.SellName.IsNullOrEmpty()) - { - exp = exp.Or(a => a.SellName.Contains(sellThing.SellName)); - } sellThings = sellThingRepository.GetList(exp.ToExpression()); - sellThings.ForEach(_sellThing => - { - _sellThing.SellPriceStr = Decimal.Parse(_sellThing.SellPrice.ToString()).ToString("#,##0.00").ToString(); - }); } - return sellThings; + + sellThings.ForEach(_sellThing => + { + _sellThing.ProductPriceFormatted = Decimal.Parse(_sellThing.ProductPrice.ToString()).ToString("#,##0.00").ToString(); + }); + + var listSource = EntityMapper.MapList(sellThings); + + return new ListOutputDto + { + listSource = listSource, + total = count + }; } /// /// 查询所有商品(包括库存为0/已删除) /// /// - public List GetSellThings(SellThing sellThing = null) + public ListOutputDto GetSellThings(ReadSellThingInputDto sellThing) { List sellThings = new List(); var exp = Expressionable.Create(); @@ -105,43 +124,57 @@ namespace EOM.TSHotelManagement.Application sellThings = sellThingRepository.GetList(exp.ToExpression()); sellThings.ForEach(_sellThing => { - _sellThing.SellPriceStr = Decimal.Parse(_sellThing.SellPrice.ToString()).ToString("#,##0.00").ToString(); + _sellThing.ProductPriceFormatted = Decimal.Parse(_sellThing.ProductPrice.ToString()).ToString("#,##0.00").ToString(); }); } else { //商品编号 - if (!sellThing.SellNo.IsNullOrEmpty()) + if (!sellThing.ProductNumber.IsNullOrEmpty()) { - exp = exp.And(a => a.SellNo.Contains(sellThing.SellNo)); + exp = exp.And(a => a.ProductNumber.Contains(sellThing.ProductNumber)); } //商品名称 - if (!sellThing.SellName.IsNullOrEmpty()) + if (!sellThing.ProductName.IsNullOrEmpty()) { - exp = exp.Or(a => a.SellName.Contains(sellThing.SellName)); + exp = exp.Or(a => a.ProductName.Contains(sellThing.ProductName)); } sellThings = sellThingRepository.GetList(exp.ToExpression()); sellThings.ForEach(_sellThing => { - _sellThing.SellPriceStr = Decimal.Parse(_sellThing.SellPrice.ToString()).ToString("#,##0.00").ToString(); + _sellThing.ProductPriceFormatted = Decimal.Parse(_sellThing.ProductPrice.ToString()).ToString("#,##0.00").ToString(); }); } - return sellThings; + + var listSource = EntityMapper.MapList(sellThings); + + return new ListOutputDto + { + listSource = listSource, + total = sellThings.Count + }; } /// /// 更新商品数量 /// - /// - /// + /// /// - public bool UpdateSellThing(string stock, string sellNo) + public BaseOutputDto UpdateSellThing(UpdateSellThingInputDto updateSellThingInputDto) { - return sellThingRepository.Update(a => new SellThing() + try + { + sellThingRepository.Update(a => new SellThing() + { + Stock = Convert.ToInt32(updateSellThingInputDto.Stock), + DataChgDate = DateTime.Now + }, a => a.ProductNumber == updateSellThingInputDto.ProductNumber); + } + catch (Exception ex) { - Stock = Convert.ToInt32(stock), - DataChgDate = DateTime.Now - }, a => a.SellNo == sellNo); + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } /// @@ -149,71 +182,97 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool UpdateSellthingInfo(SellThing sellThing) + public BaseOutputDto UpdateSellthingInfo(UpdateSellThingInputDto sellThing) { - return sellThingRepository.Update(a => new SellThing() + try + { + sellThingRepository.Update(a => new SellThing() + { + ProductName = sellThing.ProductName, + ProductPrice = sellThing.ProductPrice, + Stock = sellThing.Stock, + Specification = sellThing.Specification, + }, a => a.ProductNumber == sellThing.ProductNumber); + } + catch (Exception ex) { - SellName = sellThing.SellName, - SellPrice = sellThing.SellPrice, - Stock = sellThing.Stock, - format = sellThing.format, - }, a => a.SellNo == sellThing.SellNo); + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } /// - /// 撤回客户消费信息 + /// 删除商品信息 /// - /// - /// - /// + /// /// - public bool DeleteSellThing(string roomNo, string custoNo, string sellName) + public BaseOutputDto DeleteSellthing(DeleteSellThingInputDto deleteSellThingInputDto) { - return spendRepository.Update(a => new Spend() + try { - IsDelete = 1, - }, a => a.MoneyState.Equals(SpendConsts.UnSettle) && a.RoomNo == roomNo && a.CustoNo == custoNo - && a.SpendName == sellName); - + sellThingRepository.Update(a => new SellThing() + { + IsDelete = 1, + }, a => a.ProductNumber == deleteSellThingInputDto.ProductNumber); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } /// /// 根据商品编号删除商品信息 /// - /// + /// /// - public bool DeleteSellThingBySellNo(string sellNo) + public BaseOutputDto DeleteSellThingBySellNo(DeleteSellThingInputDto deleteSellThingInputDto) { - return sellThingRepository.Update(a => new SellThing() + try { - IsDelete = 1 - }, a => a.SellNo == sellNo); + sellThingRepository.Update(a => new SellThing() + { + IsDelete = 1 + }, a => a.ProductNumber == deleteSellThingInputDto.ProductNumber); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } /// /// 根据商品名称和价格查询商品编号 /// - /// - /// + /// /// - public SellThing SelectSellThingByNameAndPrice(string name, string price) + public SingleOutputDto SelectSellThingByNameAndPrice(ReadSellThingInputDto readSellThingInputDto) { SellThing sellThing = null; - sellThing = sellThingRepository.GetSingle(a => a.SellName == name && a.SellPrice == Convert.ToDecimal(price)); - return sellThing; + sellThing = sellThingRepository.GetSingle(a => a.ProductNumber == readSellThingInputDto.ProductNumber || (a.ProductName == readSellThingInputDto.ProductName + && a.ProductPrice == Convert.ToDecimal(readSellThingInputDto.ProductPrice))); + + var source = EntityMapper.Map(sellThing); + + return new SingleOutputDto() { Source = source }; } /// /// 根据商品编号查询商品信息 /// - /// + /// /// - public SellThing SelectSellInfoBySellNo(string SellNo) + public ReadSellThingOutputDto SelectSellInfoBySellNo(ReadSellThingInputDto readSellThingInputDto) { SellThing st = null; - st = sellThingRepository.GetSingle(a => a.SellNo == SellNo && a.IsDelete != 1); - return st; + st = sellThingRepository.GetSingle(a => a.ProductNumber == readSellThingInputDto.ProductNumber && a.IsDelete != 1); + + var source = EntityMapper.Map(st); + + return source; } #region 添加商品 @@ -222,9 +281,17 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool InsertSellThing(SellThing st) + public BaseOutputDto InsertSellThing(CreateSellThingInputDto st) { - return sellThingRepository.Insert(st); + try + { + sellThingRepository.Insert(EntityMapper.Map(st)); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } #endregion } diff --git a/EOM.TSHotelManagement.Application/Business/Spend/ISpendService.cs b/EOM.TSHotelManagement.Application/Business/Spend/ISpendService.cs index cd9f674342987fbf30166a5f3099f17713dcae74..d0faa2634bb9bc7af9bbf6588060d39bec0b2f42 100644 --- a/EOM.TSHotelManagement.Application/Business/Spend/ISpendService.cs +++ b/EOM.TSHotelManagement.Application/Business/Spend/ISpendService.cs @@ -21,6 +21,7 @@ *SOFTWARE. * */ +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; namespace EOM.TSHotelManagement.Application @@ -36,34 +37,34 @@ namespace EOM.TSHotelManagement.Application /// /// /// - bool InsertSpendInfo(Spend s); + BaseOutputDto InsertSpendInfo(CreateSpendInputDto s); #endregion #region 根据客户编号查询消费信息 /// /// 根据客户编号查询消费信息 /// - /// + /// /// - List SelectSpendByCustoNo(string No); + ListOutputDto SelectSpendByCustoNo(ReadSpendInputDto readSpendInputDto); #endregion #region 根据房间编号查询消费信息 /// /// 根据房间编号查询消费信息 /// - /// + /// /// - List SelectSpendByRoomNo(string No); + ListOutputDto SelectSpendByRoomNo(ReadSpendInputDto readSpendInputDto); #endregion #region 根据客户编号查询历史消费信息 /// /// 根据客户编号查询历史消费信息 /// - /// + /// /// - List SeletHistorySpendInfoAll(string custoNo); + ListOutputDto SeletHistorySpendInfoAll(ReadSpendInputDto readSpendInputDto); #endregion #region 查询消费的所有信息 @@ -71,7 +72,7 @@ namespace EOM.TSHotelManagement.Application /// 查询消费的所有信息 /// /// - List SelectSpendInfoAll(); + ListOutputDto SelectSpendInfoAll(ReadSpendInputDto readSpendInputDto); #endregion #region 根据房间号查询消费的所有信息 @@ -79,43 +80,48 @@ namespace EOM.TSHotelManagement.Application /// 根据房间号查询消费的所有信息 /// /// - List SelectSpendInfoRoomNo(string RoomNo); + ListOutputDto SelectSpendInfoRoomNo(ReadSpendInputDto readSpendInputDto); #endregion #region 根据房间编号、入住时间到当前时间查询消费总金额 /// /// 根据房间编号、入住时间到当前时间查询消费总金额 /// - /// - /// + /// /// - object SelectMoneyByRoomNoAndTime(string roomno, string custono); + SingleOutputDto SumConsumptionAmount(ReadSpendInputDto readSpendInputDto); #endregion #region 根据房间编号、入住时间和当前时间修改结算状态 /// /// 根据房间编号、入住时间和当前时间修改结算状态 /// - /// - /// + /// /// - bool UpdateMoneyState(string roomno, string checktime); + BaseOutputDto UpdateMoneyState(UpdateSpendInputDto updateSpendInputDto); #endregion #region 将转房前的未结算记录一同转移到新房间 /// /// 将转房前的未结算记录一同转移到新房间 /// - /// + /// /// - bool UpdateSpendInfoByRoomNo(Spend spend); + BaseOutputDto UpdateSpendInfoByRoomNo(UpdateSpendInputDto updateSpendInputDto); #endregion + /// + /// 撤回客户消费信息 + /// + /// + /// + BaseOutputDto UndoCustomerSpend(UpdateSpendInputDto updateSpendInputDto); + /// /// 更新消费信息 /// - /// + /// /// - bool UpdSpenInfo(Spend spend); + BaseOutputDto UpdSpenInfo(UpdateSpendInputDto updateSpendInputDto); } } \ No newline at end of file diff --git a/EOM.TSHotelManagement.Application/Business/Spend/SpendService.cs b/EOM.TSHotelManagement.Application/Business/Spend/SpendService.cs index 1b3f52a96516899b19a8103aa7f1e797cf1c7dba..2de96c5126d0a08480d8dab2af766192cdb58175 100644 --- a/EOM.TSHotelManagement.Application/Business/Spend/SpendService.cs +++ b/EOM.TSHotelManagement.Application/Business/Spend/SpendService.cs @@ -25,6 +25,9 @@ using EOM.TSHotelManagement.Common.Core; using EOM.TSHotelManagement.EntityFramework; using jvncorelib.EntityLib; using EOM.TSHotelManagement.Shared; +using EOM.TSHotelManagement.Common.Contract; +using EOM.TSHotelManagement.Common.Util; +using SqlSugar; namespace EOM.TSHotelManagement.Application { @@ -38,13 +41,20 @@ namespace EOM.TSHotelManagement.Application /// private readonly GenericRepository spendRepository; + /// + /// 商品 + /// + private readonly GenericRepository sellThingRepository; + /// /// /// /// - public SpendService(GenericRepository spendRepository) + /// + public SpendService(GenericRepository spendRepository, GenericRepository sellThingRepository) { this.spendRepository = spendRepository; + this.sellThingRepository = sellThingRepository; } #region 添加消费信息 @@ -53,9 +63,17 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool InsertSpendInfo(Spend s) + public BaseOutputDto InsertSpendInfo(CreateSpendInputDto s) { - return spendRepository.Insert(s); + try + { + spendRepository.Insert(EntityMapper.Map(s)); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } #endregion @@ -63,24 +81,27 @@ namespace EOM.TSHotelManagement.Application /// /// 根据客户编号查询消费信息 /// - /// + /// /// - public List SelectSpendByCustoNo(string No) + public ListOutputDto SelectSpendByCustoNo(ReadSpendInputDto readSpendInputDto) { List ls = new List(); - ls = spendRepository.GetList(a => a.CustoNo == No && a.MoneyState.Equals(SpendConsts.UnSettle) && a.IsDelete != 1); + ls = spendRepository.GetList(a => a.CustomerNumber == readSpendInputDto.CustomerNumber && a.SettlementStatus.Equals(SpendConsts.UnSettle) && a.IsDelete != 1); ls.ForEach(source => { - source.SpendStateNm = source.MoneyState.IsNullOrEmpty() ? "" - : source.MoneyState.Equals(SpendConsts.Settled) ? "已结算" : "未结算"; + source.SettlementStatusDescription = source.SettlementStatus.IsNullOrEmpty() ? "" + : source.SettlementStatus.Equals(SpendConsts.Settled) ? "已结算" : "未结算"; - source.SpendPriceStr = (source.SpendPrice + "").IsNullOrEmpty() ? "" - : Decimal.Parse(source.SpendPrice.ToString()).ToString("#,##0.00").ToString(); + source.ProductPriceFormatted = (source.ProductPrice + "").IsNullOrEmpty() ? "" + : Decimal.Parse(source.ProductPrice.ToString()).ToString("#,##0.00").ToString(); - source.SpendMoneyStr = (source.SpendMoney + "").IsNullOrEmpty() ? "" - : Decimal.Parse(source.SpendMoney.ToString()).ToString("#,##0.00").ToString(); + source.ConsumptionAmountFormatted = (source.ConsumptionAmount + "").IsNullOrEmpty() ? "" + : Decimal.Parse(source.ConsumptionAmount.ToString()).ToString("#,##0.00").ToString(); }); - return ls; + + var listSource = EntityMapper.MapList(ls); + + return new ListOutputDto { listSource = listSource }; } #endregion @@ -88,24 +109,27 @@ namespace EOM.TSHotelManagement.Application /// /// 根据客户编号查询历史消费信息 /// - /// + /// /// - public List SeletHistorySpendInfoAll(string custoNo) + public ListOutputDto SeletHistorySpendInfoAll(ReadSpendInputDto readSpendInputDto) { List ls = new List(); - ls = spendRepository.GetList(a => a.CustoNo == custoNo && a.MoneyState.Equals(SpendConsts.Settled) && a.IsDelete != 1); + ls = spendRepository.GetList(a => a.CustomerNumber == readSpendInputDto.CustomerNumber && a.SettlementStatus.Equals(SpendConsts.Settled) && a.IsDelete != 1); ls.ForEach(source => { - source.SpendStateNm = source.MoneyState.IsNullOrEmpty() ? "" - : source.MoneyState.Equals(SpendConsts.Settled) ? "已结算" : "未结算"; + source.SettlementStatusDescription = source.SettlementStatus.IsNullOrEmpty() ? "" + : source.SettlementStatus.Equals(SpendConsts.Settled) ? "已结算" : "未结算"; - source.SpendPriceStr = (source.SpendPrice + "").IsNullOrEmpty() ? "" - : Decimal.Parse(source.SpendPrice.ToString()).ToString("#,##0.00").ToString(); + source.ProductPriceFormatted = (source.ProductPrice + "").IsNullOrEmpty() ? "" + : Decimal.Parse(source.ProductPrice.ToString()).ToString("#,##0.00").ToString(); - source.SpendMoneyStr = (source.SpendMoney + "").IsNullOrEmpty() ? "" - : Decimal.Parse(source.SpendMoney.ToString()).ToString("#,##0.00").ToString(); + source.ConsumptionAmountFormatted = (source.ConsumptionAmount + "").IsNullOrEmpty() ? "" + : Decimal.Parse(source.ConsumptionAmount.ToString()).ToString("#,##0.00").ToString(); }); - return ls; + + var listSource = EntityMapper.MapList(ls); + + return new ListOutputDto { listSource = listSource }; } #endregion @@ -113,24 +137,38 @@ namespace EOM.TSHotelManagement.Application /// /// 根据房间编号查询消费信息 /// - /// + /// /// - public List SelectSpendByRoomNo(string No) + public ListOutputDto SelectSpendByRoomNo(ReadSpendInputDto readSpendInputDto) { List ls = new List(); - ls = spendRepository.GetList(a => a.RoomNo == No && a.MoneyState.Equals(SpendConsts.UnSettle) && a.IsDelete != 1); + ls = spendRepository.GetList(a => a.RoomNumber == readSpendInputDto.RoomNumber && a.SettlementStatus.Equals(SpendConsts.UnSettle) && a.IsDelete != 1); + var spendNames = ls.Select(a => a.ProductName).ToList(); + var spendInfos = sellThingRepository.AsQueryable().Where(a => spendNames.Contains(a.ProductName)).ToList(); ls.ForEach(source => { - source.SpendStateNm = source.MoneyState.IsNullOrEmpty() ? "" - : source.MoneyState.Equals(SpendConsts.Settled) ? "已结算" : "未结算"; + if (source.ProductNumber.IsNullOrEmpty()) + { + var spendInfo = spendInfos.FirstOrDefault(a => a.ProductName.Equals(source.ProductName)); + if (spendInfo != null) + { + source.ProductNumber = spendInfo.ProductNumber; + } + } + + source.SettlementStatusDescription = source.SettlementStatus.IsNullOrEmpty() ? "" + : source.SettlementStatus.Equals(SpendConsts.Settled) ? "已结算" : "未结算"; - source.SpendPriceStr = (source.SpendPrice + "").IsNullOrEmpty() ? "" - : Decimal.Parse(source.SpendPrice.ToString()).ToString("#,##0.00").ToString(); + source.ProductPriceFormatted = (source.ProductPrice + "").IsNullOrEmpty() ? "" + : Decimal.Parse(source.ProductPrice.ToString()).ToString("#,##0.00").ToString(); - source.SpendMoneyStr = (source.SpendMoney + "").IsNullOrEmpty() ? "" - : Decimal.Parse(source.SpendMoney.ToString()).ToString("#,##0.00").ToString(); + source.ConsumptionAmountFormatted = (source.ConsumptionAmount + "").IsNullOrEmpty() ? "" + : Decimal.Parse(source.ConsumptionAmount.ToString()).ToString("#,##0.00").ToString(); }); - return ls; + + var listSource = EntityMapper.MapList(ls); + + return new ListOutputDto { listSource = listSource }; } #endregion @@ -139,22 +177,43 @@ namespace EOM.TSHotelManagement.Application /// 查询消费的所有信息 /// /// - public List SelectSpendInfoAll() + public ListOutputDto SelectSpendInfoAll(ReadSpendInputDto readSpendInputDto) { + var where = Expressionable.Create(); + + if (!readSpendInputDto.IsDelete.IsNullOrEmpty()) + { + where = where.And(a => a.IsDelete == readSpendInputDto.IsDelete); + } + List ls = new List(); - ls = spendRepository.GetList(a => a.IsDelete != 1).OrderByDescending(a => a.SpendTime).ToList(); + + var count = 0; + + if (!readSpendInputDto.IgnorePaging && readSpendInputDto.Page != 0 && readSpendInputDto.PageSize != 0) + { + ls = spendRepository.AsQueryable().Where(where.ToExpression()).OrderByDescending(a => a.ConsumptionTime).ToPageList(readSpendInputDto.Page, readSpendInputDto.PageSize, ref count); + } + else + { + ls = spendRepository.AsQueryable().Where(where.ToExpression()).OrderByDescending(a => a.ConsumptionTime).ToList(); + } + ls.ForEach(source => { - source.SpendStateNm = source.MoneyState.IsNullOrEmpty() ? "" - : source.MoneyState.Equals(SpendConsts.Settled) ? "已结算" : "未结算"; + source.SettlementStatusDescription = source.SettlementStatus.IsNullOrEmpty() ? "" + : source.SettlementStatus.Equals(SpendConsts.Settled) ? "已结算" : "未结算"; - source.SpendPriceStr = (source.SpendPrice + "").IsNullOrEmpty() ? "" - : Decimal.Parse(source.SpendPrice.ToString()).ToString("#,##0.00").ToString(); + source.ProductPriceFormatted = (source.ProductPrice + "").IsNullOrEmpty() ? "" + : Decimal.Parse(source.ProductPrice.ToString()).ToString("#,##0.00").ToString(); - source.SpendMoneyStr = (source.SpendMoney + "").IsNullOrEmpty() ? "" - : Decimal.Parse(source.SpendMoney.ToString()).ToString("#,##0.00").ToString(); + source.ConsumptionAmountFormatted = (source.ConsumptionAmount + "").IsNullOrEmpty() ? "" + : Decimal.Parse(source.ConsumptionAmount.ToString()).ToString("#,##0.00").ToString(); }); - return ls; + + var listSource = EntityMapper.MapList(ls); + + return new ListOutputDto { listSource = listSource, total = count }; } #endregion @@ -163,22 +222,36 @@ namespace EOM.TSHotelManagement.Application /// 根据房间号查询消费的所有信息 /// /// - public List SelectSpendInfoRoomNo(string RoomNo) + public ListOutputDto SelectSpendInfoRoomNo(ReadSpendInputDto readSpendInputDto) { List ls = new List(); - ls = spendRepository.GetList(a => a.RoomNo == RoomNo && a.IsDelete != 1 && a.MoneyState.Equals(SpendConsts.UnSettle)); + ls = spendRepository.GetList(a => a.RoomNumber == readSpendInputDto.RoomNumber && a.IsDelete != 1 && a.SettlementStatus.Equals(SpendConsts.UnSettle)); + var spendNames = ls.Select(a => a.ProductName).ToList(); + var spendInfos = sellThingRepository.AsQueryable().Where(a => spendNames.Contains(a.ProductName)).ToList(); ls.ForEach(source => { - source.SpendStateNm = source.MoneyState.IsNullOrEmpty() ? "" - : source.MoneyState.Equals(SpendConsts.Settled) ? "已结算" : "未结算"; + if (source.ProductNumber.IsNullOrEmpty()) + { + var spendInfo = spendInfos.SingleOrDefault(a => a.ProductName.Equals(source.ProductName)); + if (spendInfo != null) + { + source.ProductNumber = spendInfo.ProductNumber; + } + } - source.SpendPriceStr = (source.SpendPrice + "").IsNullOrEmpty() ? "" - : Decimal.Parse(source.SpendPrice.ToString()).ToString("#,##0.00").ToString(); + source.SettlementStatusDescription = source.SettlementStatus.IsNullOrEmpty() ? "" + : source.SettlementStatus.Equals(SpendConsts.Settled) ? "已结算" : "未结算"; - source.SpendMoneyStr = (source.SpendMoney + "").IsNullOrEmpty() ? "" - : Decimal.Parse(source.SpendMoney.ToString()).ToString("#,##0.00").ToString(); + source.ProductPriceFormatted = (source.ProductPrice + "").IsNullOrEmpty() ? "" + : Decimal.Parse(source.ProductPrice.ToString()).ToString("#,##0.00").ToString(); + + source.ConsumptionAmountFormatted = (source.ConsumptionAmount + "").IsNullOrEmpty() ? "" + : Decimal.Parse(source.ConsumptionAmount.ToString()).ToString("#,##0.00").ToString(); }); - return ls; + + var listSource = EntityMapper.MapList(ls); + + return new ListOutputDto { listSource = listSource }; } #endregion @@ -186,12 +259,12 @@ namespace EOM.TSHotelManagement.Application /// /// 根据房间编号、入住时间到当前时间查询消费总金额 /// - /// - /// + /// /// - public object SelectMoneyByRoomNoAndTime(string roomno, string custono) + public SingleOutputDto SumConsumptionAmount(ReadSpendInputDto readSpendInputDto) { - return spendRepository.GetList(a => a.RoomNo == roomno && a.CustoNo == custono && a.MoneyState.Equals(SpendConsts.UnSettle)).Sum(a => a.SpendMoney); + var totalAmount = spendRepository.GetList(a => a.RoomNumber == readSpendInputDto.RoomNumber && a.CustomerNumber == readSpendInputDto.CustomerNumber && a.SettlementStatus.Equals(SpendConsts.UnSettle)).Sum(a => a.ConsumptionAmount); + return new SingleOutputDto { Source = new ReadSpendInputDto { ConsumptionAmount = totalAmount } }; } #endregion @@ -199,15 +272,22 @@ namespace EOM.TSHotelManagement.Application /// /// 根据房间编号、入住时间和当前时间修改结算状态 /// - /// - /// + /// /// - public bool UpdateMoneyState(string roomno, string checktime) + public BaseOutputDto UpdateMoneyState(UpdateSpendInputDto updateSpendInputDto) { - return spendRepository.Update(a => new Spend() + try + { + spendRepository.Update(a => new Spend() + { + SettlementStatus = SpendConsts.Settled + }, a => a.RoomNumber == updateSpendInputDto.RoomNumber && a.ConsumptionTime >= Convert.ToDateTime(updateSpendInputDto.ConsumptionTime) && a.ConsumptionTime <= Convert.ToDateTime(DateTime.Now)); + } + catch (Exception ex) { - MoneyState = SpendConsts.Settled - }, a => a.RoomNo == roomno && a.SpendTime >= Convert.ToDateTime(checktime) && a.SpendTime <= Convert.ToDateTime(DateTime.Now)); + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } #endregion @@ -217,40 +297,77 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool UpdateSpendInfoByRoomNo(Spend spend) + public BaseOutputDto UpdateSpendInfoByRoomNo(UpdateSpendInputDto spend) { //查询当前用户未结算的数据 - var listSpendId = spendRepository.GetList(a => a.CustoNo.Equals(spend.CustoNo) && a.MoneyState.Equals(SpendConsts.UnSettle)) - .Select(a => a.SpendName).ToList(); /*spends.Select(a => a.SpendName).Distinct().ToList();*/ + var listSpendId = spendRepository.GetList(a => a.CustomerNumber.Equals(spend.CustomerNumber) && a.SettlementStatus.Equals(SpendConsts.UnSettle)) + .Select(a => a.ProductName).ToList(); /*spends.Select(a => a.SpendName).Distinct().ToList();*/ - return spendRepository.Update(a => new Spend() + try { - RoomNo = spend.RoomNo, - DataChgUsr = spend.DataChgUsr - }, a => listSpendId.Contains(a.SpendName) && a.CustoNo.Equals(spend.CustoNo) && a.SpendTime >= Convert.ToDateTime(DateTime.Now) - && a.SpendTime <= Convert.ToDateTime(DateTime.Now)); - - + spendRepository.Update(a => new Spend() + { + RoomNumber = spend.RoomNumber, + DataChgUsr = spend.DataChgUsr + }, a => listSpendId.Contains(a.ProductName) && a.CustomerNumber.Equals(spend.CustomerNumber) && a.ConsumptionTime >= Convert.ToDateTime(DateTime.Now) + && a.ConsumptionTime <= Convert.ToDateTime(DateTime.Now)); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } #endregion + /// + /// 撤回客户消费信息 + /// + /// + /// + public BaseOutputDto UndoCustomerSpend(UpdateSpendInputDto updateSpendInputDto) + { + try + { + spendRepository.Update(a => new Spend() + { + IsDelete = 1, + DataChgDate = updateSpendInputDto.DataChgDate, + DataChgUsr = updateSpendInputDto.DataChgUsr + }, a => a.SpendNumber.Equals(updateSpendInputDto.SpendNumber)); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); + } + /// /// 更新消费信息 /// /// /// - public bool UpdSpenInfo(Spend spend) + public BaseOutputDto UpdSpenInfo(UpdateSpendInputDto spend) { - return spendRepository.Update(a => new Spend() + try + { + spendRepository.Update(a => new Spend() + { + ConsumptionQuantity = spend.ConsumptionQuantity, + ConsumptionAmount = spend.ConsumptionAmount, + DataChgDate = spend.DataChgDate, + DataChgUsr = spend.DataChgUsr + }, a => a.SettlementStatus.Equals(SpendConsts.UnSettle) + && a.RoomNumber.Equals(spend.RoomNumber) + && a.CustomerNumber.Equals(spend.CustomerNumber) + && a.ProductName.Equals(spend.ProductName)); + } + catch (Exception ex) { - SpendAmount = spend.SpendAmount, - SpendMoney = spend.SpendMoney, - DataChgDate = spend.DataChgDate, - DataChgUsr = spend.DataChgUsr - }, a => a.MoneyState.Equals(SpendConsts.UnSettle) - && a.RoomNo.Equals(spend.RoomNo) - && a.CustoNo.Equals(spend.CustoNo) - && a.SpendName.Equals(spend.SpendName)); + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } } diff --git a/EOM.TSHotelManagement.Application/EOM.TSHotelManagement.Application.csproj b/EOM.TSHotelManagement.Application/EOM.TSHotelManagement.Application.csproj index 3e57f0a62f4b70228318e77ce8f05f4179ccce5e..4172b799c021477eaca886777342c6c6c2d3c670 100644 --- a/EOM.TSHotelManagement.Application/EOM.TSHotelManagement.Application.csproj +++ b/EOM.TSHotelManagement.Application/EOM.TSHotelManagement.Application.csproj @@ -21,17 +21,14 @@ - - - - + - + diff --git a/EOM.TSHotelManagement.Application/Worker/Check/WorkerCheckService.cs b/EOM.TSHotelManagement.Application/Employee/Check/EmployeeCheckService.cs similarity index 36% rename from EOM.TSHotelManagement.Application/Worker/Check/WorkerCheckService.cs rename to EOM.TSHotelManagement.Application/Employee/Check/EmployeeCheckService.cs index 74777421061e98ada463014b92002ce2287872af..00a02a6a54380130cb8bff5929832bbf26ddef7e 100644 --- a/EOM.TSHotelManagement.Application/Worker/Check/WorkerCheckService.cs +++ b/EOM.TSHotelManagement.Application/Employee/Check/EmployeeCheckService.cs @@ -21,26 +21,30 @@ *SOFTWARE. * */ +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Util; using EOM.TSHotelManagement.EntityFramework; +using jvncorelib.EntityLib; +using SqlSugar; namespace EOM.TSHotelManagement.Application { /// /// 员工打卡接口实现类 /// - public class WorkerCheckService : IWorkerCheckService + public class EmployeeCheckService : IEmployeeCheckService { /// /// 员工打卡 /// - private readonly GenericRepository workerCheckRepository; + private readonly GenericRepository workerCheckRepository; /// /// /// /// - public WorkerCheckService(GenericRepository workerCheckRepository) + public EmployeeCheckService(GenericRepository workerCheckRepository) { this.workerCheckRepository = workerCheckRepository; } @@ -50,15 +54,48 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public List SelectCheckInfoByWorkerNo(string wid) + public ListOutputDto SelectCheckInfoByEmployeeId(ReadEmployeeCheckInputDto wid) { - List workerChecks = new List(); - workerChecks = workerCheckRepository.GetList(a => a.WorkerNo == wid && a.IsDelete != 1); + List workerChecks = new List(); + + var where = Expressionable.Create(); + + if (!wid.EmployeeId.IsNullOrEmpty()) + { + where = where.And(a => a.EmployeeId == wid.EmployeeId); + } + + if (!wid.IsDelete.IsNullOrEmpty()) + { + where = where.And(a => a.IsDelete == wid.IsDelete); + } + + var count = 0; + + if (wid.Page != 0 && wid.PageSize != 0) + { + workerChecks = workerCheckRepository.AsQueryable().Where(where.ToExpression()) + .OrderByDescending(a => a.CheckTime) + .ToPageList(wid.Page, wid.PageSize, ref count); + } + else + { + workerChecks = workerCheckRepository.AsQueryable().Where(where.ToExpression()) + .OrderByDescending(a => a.CheckTime) + .ToList(); + } + workerChecks.ForEach(source => { - source.CheckStateNm = source.CheckState == 0 ? "打卡成功" : "打卡失败"; + source.CheckStatusDescription = source.CheckStatus == 0 ? "打卡成功" : "打卡失败"; }); - return workerChecks; + var source = EntityMapper.MapList(workerChecks); + + return new ListOutputDto + { + listSource = source, + total = count + }; } @@ -67,9 +104,25 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public object SelectWorkerCheckDaySumByWorkerNo(string wkn) + public SingleOutputDto SelectWorkerCheckDaySumByEmployeeId(ReadEmployeeCheckInputDto wkn) { - return workerCheckRepository.GetList(a => a.WorkerNo == wkn && a.IsDelete != 1).Count; + var checkDay = 0; + try + { + checkDay = workerCheckRepository.AsQueryable().Count(a => a.EmployeeId == wkn.EmployeeId && a.IsDelete != 1); + } + catch (Exception) + { + return new SingleOutputDto { StatusCode = StatusCodeConstants.InternalServerError, Message = LocalizationHelper.GetLocalizedString("Query employee sign-in days failed", "查询员工签到天数失败") }; + } + + return new SingleOutputDto + { + Source = new ReadEmployeeCheckOutputDto + { + CheckDay = checkDay + } + }; } @@ -78,12 +131,22 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public object SelectToDayCheckInfoByWorkerNo(string wkn) + public SingleOutputDto SelectToDayCheckInfoByWorkerNo(ReadEmployeeCheckInputDto wkn) { - //string sql = "select Count(*) from WORKERCHECK where WorkerNo = '"+wkn+ "' and DATEDIFF(CURRENT_DATE(),workercheck.CheckTime)"; - var listCheckInfo = workerCheckRepository.GetList(a => a.WorkerNo == wkn && a.IsDelete != 1); - var count = listCheckInfo.Where(a => a.CheckTime.ToShortDateString() == Convert.ToDateTime(DateTime.Now).ToShortDateString()).Count() > 0 ? 1 : 0; - return count; + var isChecked = false; + try + { + var today = DateTime.Today; + isChecked = workerCheckRepository.AsQueryable() + .Any(a => a.EmployeeId == wkn.EmployeeId + && a.IsDelete != 1 + && a.CheckTime >= today && a.CheckTime < today.AddDays(1)); + } + catch (Exception ex) + { + return new SingleOutputDto { StatusCode = StatusCodeConstants.InternalServerError, Message = LocalizationHelper.GetLocalizedString($"Error:\n{ex.Message}", $"错误:\n{ex.Message}") }; + } + return new SingleOutputDto { Source = new ReadEmployeeCheckOutputDto { IsChecked = isChecked} }; } /// @@ -91,9 +154,17 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool AddCheckInfo(WorkerCheck workerCheck) + public BaseOutputDto AddCheckInfo(CreateEmployeeCheckInputDto workerCheck) { - return workerCheckRepository.Insert(workerCheck); + try + { + workerCheckRepository.Insert(EntityMapper.Map(workerCheck)); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } } } diff --git a/EOM.TSHotelManagement.Application/Worker/Check/IWorkerCheckService.cs b/EOM.TSHotelManagement.Application/Employee/Check/IEmployeeCheckService.cs similarity index 79% rename from EOM.TSHotelManagement.Application/Worker/Check/IWorkerCheckService.cs rename to EOM.TSHotelManagement.Application/Employee/Check/IEmployeeCheckService.cs index 836bd1f8839f046e9e08a1d3d0c9da859abbaa86..f030099be960cd297f265dc38d753782d854e15e 100644 --- a/EOM.TSHotelManagement.Application/Worker/Check/IWorkerCheckService.cs +++ b/EOM.TSHotelManagement.Application/Employee/Check/IEmployeeCheckService.cs @@ -21,6 +21,7 @@ *SOFTWARE. * */ +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; namespace EOM.TSHotelManagement.Application @@ -28,34 +29,34 @@ namespace EOM.TSHotelManagement.Application /// /// 员工打卡接口 /// - public interface IWorkerCheckService + public interface IEmployeeCheckService { /// /// 根据员工编号查询其所有的打卡记录 /// /// /// - List SelectCheckInfoByWorkerNo(string wid); + ListOutputDto SelectCheckInfoByEmployeeId(ReadEmployeeCheckInputDto wid); /// /// 查询员工签到天数 /// /// /// - object SelectWorkerCheckDaySumByWorkerNo(string wkn); + SingleOutputDto SelectWorkerCheckDaySumByEmployeeId(ReadEmployeeCheckInputDto wkn); /// /// 查询今天员工是否已签到 /// /// /// - object SelectToDayCheckInfoByWorkerNo(string wkn); + SingleOutputDto SelectToDayCheckInfoByWorkerNo(ReadEmployeeCheckInputDto wkn); /// /// 添加员工打卡数据 /// /// /// - bool AddCheckInfo(WorkerCheck workerCheck); + BaseOutputDto AddCheckInfo(CreateEmployeeCheckInputDto workerCheck); } } \ No newline at end of file diff --git a/EOM.TSHotelManagement.Application/Employee/EmployeeService.cs b/EOM.TSHotelManagement.Application/Employee/EmployeeService.cs new file mode 100644 index 0000000000000000000000000000000000000000..d9b389c2f9d52f0cd32d9cb94cb99019c3757139 --- /dev/null +++ b/EOM.TSHotelManagement.Application/Employee/EmployeeService.cs @@ -0,0 +1,523 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EOM.TSHotelManagement.Common; +using EOM.TSHotelManagement.Common.Contract; +using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Util; +using EOM.TSHotelManagement.EntityFramework; +using EOM.TSHotelManagement.Shared; +using jvncorelib.EncryptorLib; +using jvncorelib.EntityLib; +using jvncorelib.CodeLib; +using Microsoft.AspNetCore.DataProtection; +using Microsoft.IdentityModel.Tokens; +using SqlSugar; +using SqlSugar.DistributedSystem.Snowflake; +using System.ComponentModel; +using System.IdentityModel.Tokens.Jwt; +using System.Reflection; +using System.Security.Claims; +using System.Text; + +namespace EOM.TSHotelManagement.Application +{ + /// + /// 员工信息接口实现类 + /// + /// + /// 构造函数 + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public class EmployeeService(GenericRepository workerRepository, GenericRepository educationRepository, GenericRepository nationRepository, GenericRepository deptRepository, GenericRepository positionRepository, GenericRepository passportTypeRepository, IDataProtectionProvider dataProtectionProvider, JWTHelper jWTHelper,MailHelper mailHelper) : IEmployeeService + { + /// + /// 员工信息 + /// + private readonly GenericRepository workerRepository = workerRepository; + + /// + /// 学历类型 + /// + private readonly GenericRepository educationRepository = educationRepository; + + /// + /// 民族类型 + /// + private readonly GenericRepository nationRepository = nationRepository; + + /// + /// 部门 + /// + private readonly GenericRepository deptRepository = deptRepository; + + /// + /// 职务 + /// + private readonly GenericRepository positionRepository = positionRepository; + + /// + /// 职务 + /// + private readonly GenericRepository passportTypeRepository = passportTypeRepository; + + /// + /// 数据保护 + /// + private readonly IDataProtector dataProtector = dataProtectionProvider.CreateProtector("EmployeeInfoProtector"); + + /// + /// JWT加密 + /// + private readonly JWTHelper jWTHelper = jWTHelper; + + /// + /// 邮件助手 + /// + private readonly MailHelper mailHelper = mailHelper; + + /// + /// 修改员工信息 + /// + /// + /// + public BaseOutputDto UpdateEmployee(UpdateEmployeeInputDto updateEmployeeInputDto) + { + try + { + //加密联系方式 + var sourceTelStr = string.Empty; + if (!updateEmployeeInputDto.PhoneNumber.IsNullOrEmpty()) + { + sourceTelStr = dataProtector.Protect(updateEmployeeInputDto.PhoneNumber); + } + //加密身份证 + var sourceIdStr = string.Empty; + if (!updateEmployeeInputDto.IdCardNumber.IsNullOrEmpty()) + { + sourceIdStr = dataProtector.Protect(updateEmployeeInputDto.IdCardNumber); + } + updateEmployeeInputDto.PhoneNumber = sourceTelStr; + updateEmployeeInputDto.IdCardNumber = sourceIdStr; + + workerRepository.Update(EntityMapper.Map(updateEmployeeInputDto)); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); + + } + + /// + /// 员工账号禁/启用 + /// + /// + /// + public BaseOutputDto ManagerEmployeeAccount(UpdateEmployeeInputDto updateEmployeeInputDto) + { + try + { + workerRepository.Update(a => new Employee() + { + IsEnable = updateEmployeeInputDto.IsEnable, + }, a => a.EmployeeId == updateEmployeeInputDto.EmployeeId); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); + } + + /// + /// 更新员工职位和部门 + /// + /// + /// + + public BaseOutputDto UpdateEmployeePositionAndClub(UpdateEmployeeInputDto updateEmployeeInputDto) + { + try + { + workerRepository.Update(a => new Employee() + { + Department = updateEmployeeInputDto.Department, + Position = updateEmployeeInputDto.Position, + DataChgUsr = updateEmployeeInputDto.DataChgUsr, + DataChgDate = updateEmployeeInputDto.DataChgDate + }, a => a.EmployeeId == updateEmployeeInputDto.EmployeeId); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); + } + + /// + /// 添加员工信息 + /// + /// + /// + public BaseOutputDto AddEmployee(CreateEmployeeInputDto createEmployeeInputDto) + { + try + { + //加密联系方式 + var sourceTelStr = string.Empty; + if (!createEmployeeInputDto.PhoneNumber.IsNullOrEmpty()) + { + sourceTelStr = dataProtector.Protect(createEmployeeInputDto.PhoneNumber); + } + //加密身份证 + var sourceIdStr = string.Empty; + if (!createEmployeeInputDto.IdCardNumber.IsNullOrEmpty()) + { + sourceIdStr = dataProtector.Protect(createEmployeeInputDto.IdCardNumber); + } + createEmployeeInputDto.PhoneNumber = sourceTelStr; + createEmployeeInputDto.IdCardNumber = sourceIdStr; + + workerRepository.Insert(EntityMapper.Map(createEmployeeInputDto)); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); + } + + /// + /// 获取所有工作人员信息 + /// + /// + public ListOutputDto SelectEmployeeAll(ReadEmployeeInputDto readEmployeeInputDto) + { + var where = Expressionable.Create(); + + where = where.And(a => a.IsDelete != 1); + + //查询所有教育程度信息 + List educations = new List(); + educations = educationRepository.GetList(a => a.IsDelete != 1); + //查询所有性别类型信息 + var helper = new EnumHelper(); + var genders = Enum.GetValues(typeof(GenderType)) + .Cast() + .Select(e => new EnumDto + { + Id = (int)e, + Name = e.ToString(), + Description = helper.GetEnumDescription(e) + }) + .ToList(); + //查询所有民族类型信息 + List nations = new List(); + nations = nationRepository.GetList(a => a.IsDelete != 1); + //查询所有部门信息 + List depts = new List(); + depts = deptRepository.GetList(a => a.IsDelete != 1); + //查询所有职位信息 + List positions = new List(); + positions = positionRepository.GetList(a => a.IsDelete != 1); + //查询所有证件类型 + List passportTypes = new List(); + passportTypes = passportTypeRepository.GetList(a => a.IsDelete != 1); + //查询所有员工信息 + List employees = new List(); + + var count = 0; + + if (!readEmployeeInputDto.IgnorePaging && readEmployeeInputDto.Page != 0 && readEmployeeInputDto.PageSize != 0) + { + employees = workerRepository.AsQueryable().Where(where.ToExpression()) + .OrderBy(a => a.EmployeeId) + .ToPageList(readEmployeeInputDto.Page, readEmployeeInputDto.PageSize, ref count); + } + else + { + employees = workerRepository.AsQueryable().Where(where.ToExpression()) + .OrderBy(a => a.EmployeeId) + .ToList(); + } + + employees.ForEach(source => + { + try + { + //解密身份证号码 + var sourceStr = dataProtector.Unprotect(source.IdCardNumber); + source.IdCardNumber = sourceStr; + //解密联系方式 + var sourceTelStr = dataProtector.Unprotect(source.PhoneNumber); + source.PhoneNumber = sourceTelStr; + } + catch (Exception) + { + source.IdCardNumber = source.IdCardNumber; + source.PhoneNumber = source.PhoneNumber; + } + //性别类型 + var sexType = genders.FirstOrDefault(a => a.Id == source.Gender); + source.GenderName = sexType.IsNullOrEmpty() ? "" : sexType.Description; + //教育程度 + var eduction = educations.FirstOrDefault(a => a.EducationNumber == source.EducationLevel); + source.EducationLevelName = eduction.IsNullOrEmpty() ? "" : eduction.EducationName; + //民族类型 + var nation = nations.FirstOrDefault(a => a.NationNumber == source.Ethnicity); + source.EthnicityName = nation.IsNullOrEmpty() ? "" : nation.NationName; + //部门 + var dept = depts.FirstOrDefault(a => a.DepartmentNumber == source.Department); + source.DepartmentName = dept.IsNullOrEmpty() ? "" : dept.DepartmentName; + //职位 + var position = positions.FirstOrDefault(a => a.PositionNumber == source.Position); + source.PositionName = position.IsNullOrEmpty() ? "" : position.PositionName; + var passport = passportTypes.SingleOrDefault(a => a.PassportId == source.IdCardType); + source.IdCardTypeName = passport.IsNullOrEmpty() ? "" : passport.PassportName; + //面貌 + source.PoliticalAffiliationName = GetDescriptionByName(source.PoliticalAffiliation); + }); + + var listSource = EntityMapper.MapList(employees); + + return new ListOutputDto { listSource = listSource,total = count }; + } + + /// + /// 根据部门ID获取工作人员信息 + /// + /// + /// + public BaseOutputDto CheckEmployeeByDepartment(ReadEmployeeInputDto readEmployeeInputDto) + { + var workers = workerRepository.Count(a => a.Department.Equals(readEmployeeInputDto.Department)); + + return new BaseOutputDto { Message = workers > 0 ? true.ToString() : false.ToString(), StatusCode = StatusCodeConstants.Success }; + } + + /// + /// 根据登录名称查询员工信息 + /// + /// + /// + public SingleOutputDto SelectEmployeeInfoByEmployeeId(ReadEmployeeInputDto readEmployeeInputDto) + { + Employee w = new Employee(); + var helper = new EnumHelper(); + var genders = Enum.GetValues(typeof(GenderType)) + .Cast() + .Select(e => new EnumDto + { + Id = (int)e, + Name = e.ToString(), + Description = helper.GetEnumDescription(e) + }) + .ToList(); + w = workerRepository.GetSingle(a => a.EmployeeId == readEmployeeInputDto.EmployeeId); + //解密身份证号码 + var sourceStr = w.IdCardNumber.IsNullOrEmpty() ? "" : dataProtector.Unprotect(w.IdCardNumber); + w.IdCardNumber = sourceStr; + //解密联系方式 + var sourceTelStr = w.PhoneNumber.IsNullOrEmpty() ? "" : dataProtector.Unprotect(w.PhoneNumber); + w.PhoneNumber = sourceTelStr; + //性别类型 + var sexType = genders.SingleOrDefault(a => a.Id == w.Gender); + w.GenderName = sexType.Description.IsNullOrEmpty() ? "" : sexType.Description; + //教育程度 + var eduction = educationRepository.GetSingle(a => a.EducationNumber == w.EducationLevel); + w.EducationLevelName = eduction.EducationName.IsNullOrEmpty() ? "" : eduction.EducationName; + //民族类型 + var nation = nationRepository.GetSingle(a => a.NationNumber == w.Ethnicity); + w.EthnicityName = nation.NationName.IsNullOrEmpty() ? "" : nation.NationName; + //部门 + var dept = deptRepository.GetSingle(a => a.DepartmentNumber == w.Department); + w.DepartmentName = dept.DepartmentName.IsNullOrEmpty() ? "" : dept.DepartmentName; + //职位 + var position = positionRepository.GetSingle(a => a.PositionNumber == w.Position); + w.PositionName = position.PositionName.IsNullOrEmpty() ? "" : position.PositionName; + var passport = passportTypeRepository.GetSingle(a => a.PassportId == w.IdCardType); + w.IdCardTypeName = passport.IsNullOrEmpty() ? "" : passport.PassportName; + //面貌 + w.PoliticalAffiliationName = GetDescriptionByName(w.PoliticalAffiliation); + + var source = EntityMapper.Map(w); + + return new SingleOutputDto { Source = source}; + } + + /// + /// 根据登录名称、密码查询员工信息 + /// + /// + /// + public SingleOutputDto SelectEmployeeInfoByEmployeeIdAndEmployeePwd(ReadEmployeeInputDto readEmployeeInputDto) + { + Employee w = new Employee(); + var helper = new EnumHelper(); + var genders = Enum.GetValues(typeof(GenderType)) + .Cast() + .Select(e => new EnumDto + { + Id = (int)e, + Name = e.ToString(), + Description = helper.GetEnumDescription(e) + }) + .ToList(); + w = workerRepository.GetSingle(a => a.EmployeeId == readEmployeeInputDto.EmployeeId); + if (w == null) + { + w = null; + return new SingleOutputDto { Source = null }; + } + + var dbPwd = dataProtector.Unprotect(w.Password); + + if (dbPwd != readEmployeeInputDto.Password) + { + w = null; + return new SingleOutputDto { Source = EntityMapper.Map(w) }; + } + w.Password = ""; + //性别类型 + var sexType = genders.SingleOrDefault(a => a.Id == w.Gender); + w.GenderName = sexType.Description.IsNullOrEmpty() ? "" : sexType.Description; + //教育程度 + var eduction = educationRepository.GetSingle(a => a.EducationNumber == w.EducationLevel); + w.EducationLevelName = eduction.EducationName.IsNullOrEmpty() ? "" : eduction.EducationName; + //民族类型 + var nation = nationRepository.GetSingle(a => a.NationNumber == w.Ethnicity); + w.EthnicityName = nation.NationName.IsNullOrEmpty() ? "" : nation.NationName; + //部门 + var dept = deptRepository.GetSingle(a => a.DepartmentNumber == w.Department); + w.DepartmentName = dept.DepartmentName.IsNullOrEmpty() ? "" : dept.DepartmentName; + //职位 + var position = positionRepository.GetSingle(a => a.PositionNumber == w.Position); + w.PositionName = position.PositionName.IsNullOrEmpty() ? "" : position.PositionName; + + w.UserToken = jWTHelper.GenerateJWT(new ClaimsIdentity(new List { new Claim(ClaimTypes.Name, w.EmployeeName), new Claim(ClaimTypes.SerialNumber, w.EmployeeId) })); + + return new SingleOutputDto { Source = EntityMapper.Map(w) }; + } + + /// + /// 根据员工编号和密码修改密码 + /// + /// + /// + public BaseOutputDto UpdEmployeePwdByWorkNo(UpdateEmployeeInputDto updateEmployeeInputDto) + { + try + { + string NewPwd = dataProtector.Protect(updateEmployeeInputDto.Password); + + workerRepository.Update(a => new Employee() + { + Password = NewPwd, + DataChgUsr = updateEmployeeInputDto.DataChgUsr + }, a => a.EmployeeId == updateEmployeeInputDto.EmployeeId); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + + return new BaseOutputDto(); + } + + /// + /// 重置员工账号密码 + /// + /// + /// + public BaseOutputDto ResetEmployeeAccountPassword(UpdateEmployeeInputDto updateEmployeeInputDto) + { + try + { + var newPwd = new RandomStringGenerator().GenerateSecurePassword(); + string encrypted = dataProtector.Protect(newPwd); + + var employeeMailAddress = workerRepository.GetSingle(a => a.EmployeeId == updateEmployeeInputDto.EmployeeId).EmailAddress; + + if (employeeMailAddress.IsNullOrEmpty()) + { + return new BaseOutputDto() { Message = LocalizationHelper.GetLocalizedString("No bound email address was found for the employee. Password reset cannot be completed." + , "未找到员工绑定的电子邮箱,无法重置密码。"),StatusCode = StatusCodeConstants.InternalServerError}; + } + + var Subject = LocalizationHelper.GetLocalizedString("Reset Password Notice","重置密码通知"); + var Body = $@"

{LocalizationHelper.GetLocalizedString("Dear User,", "尊敬的用户:")}

+

{LocalizationHelper.GetLocalizedString( + $"Your password was reset at {DateTime.Now:yyyy/MM/dd}. New password:", + $"系统已于{DateTime.Now:yyyy/MM/dd}为你重置密码成功,新密码如下:")} +

+

{newPwd}

+

{LocalizationHelper.GetLocalizedString( + "Please keep your password secure and change it after login.", + "请妥善保管密码,并在成功登录后修改为你能记住的密码!")}

"; + + mailHelper.SendMail(new List { employeeMailAddress }, Subject, Body, new List { employeeMailAddress }); + workerRepository.Update(a => new Employee() + { + Password = encrypted, + DataChgUsr = updateEmployeeInputDto.DataChgUsr + }, a => a.EmployeeId == updateEmployeeInputDto.EmployeeId); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + + return new BaseOutputDto(); + } + + public static string GetDescriptionByName(string enumName) + { + Type enumType = typeof(PoliticalAffiliation); + + if (!Enum.IsDefined(enumType, enumName)) + { + return null; + } + + FieldInfo field = enumType.GetField(enumName); + DescriptionAttribute attribute = field? + .GetCustomAttributes(typeof(DescriptionAttribute), false) + .FirstOrDefault() as DescriptionAttribute; + + string description = attribute?.Description ?? enumName; + + return description; + } + + } +} diff --git a/EOM.TSHotelManagement.Application/Worker/History/WorkerHistoryService.cs b/EOM.TSHotelManagement.Application/Employee/History/EmployeeHistoryService.cs similarity index 60% rename from EOM.TSHotelManagement.Application/Worker/History/WorkerHistoryService.cs rename to EOM.TSHotelManagement.Application/Employee/History/EmployeeHistoryService.cs index 56024ac5498ab338a689b76610b6abe765eeee16..a6c7d0fdee2e78257131c4a5aa867d8c415b158c 100644 --- a/EOM.TSHotelManagement.Application/Worker/History/WorkerHistoryService.cs +++ b/EOM.TSHotelManagement.Application/Employee/History/EmployeeHistoryService.cs @@ -21,7 +21,9 @@ *SOFTWARE. * */ +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Util; using EOM.TSHotelManagement.EntityFramework; namespace EOM.TSHotelManagement.Application @@ -29,18 +31,18 @@ namespace EOM.TSHotelManagement.Application /// /// 员工履历接口实现类 /// - public class WorkerHistoryService : IWorkerHistoryService + public class EmployeeHistoryService : IEmployeeHistoryService { /// /// 员工履历 /// - private readonly GenericRepository workerHistoryRepository; + private readonly GenericRepository workerHistoryRepository; /// /// /// /// - public WorkerHistoryService(GenericRepository workerHistoryRepository) + public EmployeeHistoryService(GenericRepository workerHistoryRepository) { this.workerHistoryRepository = workerHistoryRepository; } @@ -50,9 +52,17 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool AddHistoryByWorkerId(WorkerHistory workerHistory) + public BaseOutputDto AddHistoryByEmployeeId(CreateEmployeeHistoryInputDto workerHistory) { - return workerHistoryRepository.Insert(workerHistory); + try + { + workerHistoryRepository.Insert(EntityMapper.Map(workerHistory)); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } /// @@ -60,11 +70,12 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public List SelectHistoryByWorkerId(string wid) + public ListOutputDto SelectHistoryByEmployeeId(ReadEmployeeHistoryInputDto wid) { - List why = new List(); - why = workerHistoryRepository.GetList(a => a.IsDelete != 1 && a.WorkerId == wid); - return why; + List why = new List(); + why = workerHistoryRepository.GetList(a => a.IsDelete != 1 && a.EmployeeId == wid.EmployeeId); + var source = EntityMapper.MapList(why); + return new ListOutputDto { listSource = source, total = source.Count }; } } } diff --git a/EOM.TSHotelManagement.Application/Worker/History/IWorkerHistoryService.cs b/EOM.TSHotelManagement.Application/Employee/History/IEmployeeHistoryService.cs similarity index 84% rename from EOM.TSHotelManagement.Application/Worker/History/IWorkerHistoryService.cs rename to EOM.TSHotelManagement.Application/Employee/History/IEmployeeHistoryService.cs index ebf19e39b9dc20b38482341fa634012c937f217d..380a8b53dfb78d9fe026b6a838aa13acd6844101 100644 --- a/EOM.TSHotelManagement.Application/Worker/History/IWorkerHistoryService.cs +++ b/EOM.TSHotelManagement.Application/Employee/History/IEmployeeHistoryService.cs @@ -21,27 +21,27 @@ *SOFTWARE. * */ -using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Contract; namespace EOM.TSHotelManagement.Application { /// /// 员工履历信息接口 /// - public interface IWorkerHistoryService + public interface IEmployeeHistoryService { /// /// 根据工号添加员工履历 /// /// /// - bool AddHistoryByWorkerId(WorkerHistory workerHistory); + BaseOutputDto AddHistoryByEmployeeId(CreateEmployeeHistoryInputDto workerHistory); /// /// 根据工号查询履历信息 /// /// /// - List SelectHistoryByWorkerId(string wid); + ListOutputDto SelectHistoryByEmployeeId(ReadEmployeeHistoryInputDto wid); } } \ No newline at end of file diff --git a/EOM.TSHotelManagement.Application/Worker/IWorkerService.cs b/EOM.TSHotelManagement.Application/Employee/IEmployeeService.cs similarity index 58% rename from EOM.TSHotelManagement.Application/Worker/IWorkerService.cs rename to EOM.TSHotelManagement.Application/Employee/IEmployeeService.cs index 4f05fe1952e96f0b85e364a6f27107f0e1cf122a..5b6c797409e945eb78f91836931b36a5a8c4e432 100644 --- a/EOM.TSHotelManagement.Application/Worker/IWorkerService.cs +++ b/EOM.TSHotelManagement.Application/Employee/IEmployeeService.cs @@ -21,6 +21,7 @@ *SOFTWARE. * */ +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; namespace EOM.TSHotelManagement.Application @@ -28,80 +29,76 @@ namespace EOM.TSHotelManagement.Application /// /// 员工信息接口 /// - public interface IWorkerService + public interface IEmployeeService { - #region 修改员工信息 /// /// 修改员工信息 /// - /// + /// /// - bool UpdateWorker(Worker worker); - #endregion + BaseOutputDto UpdateEmployee(UpdateEmployeeInputDto updateEmployeeInputDto); /// /// 员工账号禁/启用 /// - /// + /// /// - bool ManagerWorkerAccount(Worker worker); + BaseOutputDto ManagerEmployeeAccount(UpdateEmployeeInputDto updateEmployeeInputDto); /// /// 更新员工职位和部门 /// - /// + /// /// - bool UpdateWorkerPositionAndClub(Worker worker); + BaseOutputDto UpdateEmployeePositionAndClub(UpdateEmployeeInputDto updateEmployeeInputDto); - #region 添加员工信息 /// /// 添加员工信息 /// - /// + /// /// - bool AddWorker(Worker worker); - #endregion + BaseOutputDto AddEmployee(CreateEmployeeInputDto createEmployeeInputDto); - #region 获取所有工作人员信息 /// /// 获取所有工作人员信息 /// /// - List SelectWorkerAll(); + ListOutputDto SelectEmployeeAll(ReadEmployeeInputDto readEmployeeInputDto); /// /// 检查指定部门下是否存在工作人员 /// - /// + /// /// - bool CheckWorkerBydepartment(string deptNo); - #endregion + BaseOutputDto CheckEmployeeByDepartment(ReadEmployeeInputDto readEmployeeInputDto); - #region 根据登录名称查询员工信息 /// /// 根据登录名称查询员工信息 /// - /// + /// /// - Worker SelectWorkerInfoByWorkerId(string workerId); - #endregion + SingleOutputDto SelectEmployeeInfoByEmployeeId(ReadEmployeeInputDto readEmployeeInputDto); - #region 根据登录名称、密码查询员工信息 /// /// 根据登录名称、密码查询员工信息 /// - /// + /// /// - Worker SelectWorkerInfoByWorkerIdAndWorkerPwd(Worker worker); - #endregion - + SingleOutputDto SelectEmployeeInfoByEmployeeIdAndEmployeePwd(ReadEmployeeInputDto readEmployeeInputDto); /// /// 根据员工编号和密码修改密码 /// - /// + /// + /// + BaseOutputDto UpdEmployeePwdByWorkNo(UpdateEmployeeInputDto updateEmployeeInputDto); + + /// + /// 重置员工账号密码 + /// + /// /// - bool UpdWorkerPwdByWorkNo(Worker worker); + BaseOutputDto ResetEmployeeAccountPassword(UpdateEmployeeInputDto updateEmployeeInputDto); } } \ No newline at end of file diff --git a/EOM.TSHotelManagement.Application/Employee/Photo/EmployeePhotoService.cs b/EOM.TSHotelManagement.Application/Employee/Photo/EmployeePhotoService.cs new file mode 100644 index 0000000000000000000000000000000000000000..63f15a3ddc919bef7a9385137dfb50c296fb8ea5 --- /dev/null +++ b/EOM.TSHotelManagement.Application/Employee/Photo/EmployeePhotoService.cs @@ -0,0 +1,190 @@ +using EOM.TSHotelManagement.Common.Contract; +using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Util; +using EOM.TSHotelManagement.EntityFramework; +using jvncorelib.EncryptorLib; +using jvncorelib.EntityLib; +using Microsoft.AspNetCore.Http; +using System.Drawing; + +namespace EOM.TSHotelManagement.Application +{ + /// + /// 员工照片接口实现类 + /// + public class EmployeePhotoService : IEmployeePhotoService + { + /// + /// 员工照片 + /// + private readonly GenericRepository workerPicRepository; + + /// + /// 兰空图床帮助类 + /// + private readonly LskyHelper lskyHelper; + + /// + /// + /// + /// + /// + public EmployeePhotoService(GenericRepository workerPicRepository, LskyHelper lskyHelper) + { + this.workerPicRepository = workerPicRepository; + this.lskyHelper = lskyHelper; + } + + /// + /// 查询员工照片 + /// + /// + /// + public SingleOutputDto EmployeePhoto(ReadEmployeePhotoInputDto readEmployeePhotoInputDto) + { + var workerPicSource = new EmployeePhoto(); + + workerPicSource = workerPicRepository.GetSingle(a => a.EmployeeId.Equals(readEmployeePhotoInputDto.EmployeeId)); + + if (workerPicSource.IsNullOrEmpty()) + { + return new SingleOutputDto + { + Source = new ReadEmployeePhotoOutputDto + { + PhotoId = 0, + PhotoPath = "", + EmployeeId = readEmployeePhotoInputDto.EmployeeId + } + }; + } + + return new SingleOutputDto + { + Source = EntityMapper.Map(workerPicSource) + }; + } + /// + /// 添加员工照片 + /// + /// + /// + /// + public SingleOutputDto InsertWorkerPhoto(CreateEmployeePhotoInputDto createEmployeePhotoInputDto, IFormFile file) + { + try + { + if (file == null || file.Length == 0) + { + return new SingleOutputDto { Message = LocalizationHelper.GetLocalizedString("File cannot null","文件不能为空"), StatusCode = StatusCodeConstants.BadRequest }; + } + + if (file.Length > 1048576) + { + return new SingleOutputDto + { + Message = LocalizationHelper.GetLocalizedString("Image size exceeds 1MB limit", "图片大小不能超过1MB"), + StatusCode = StatusCodeConstants.BadRequest + }; + } + if (file.ContentType != "image/jpeg" && file.ContentType != "image/png") + { + return new SingleOutputDto + { + Message = LocalizationHelper.GetLocalizedString("Invalid image format", "图片格式不正确"), + StatusCode = StatusCodeConstants.BadRequest + }; + } + + var token = lskyHelper.GetImageStorageTokenAsync().Result; + if (string.IsNullOrEmpty(token)) + { + return new SingleOutputDto { Message = LocalizationHelper.GetLocalizedString("Get Token Fail", "获取Token失败"), StatusCode = StatusCodeConstants.InternalServerError }; + } + + using var stream = file.OpenReadStream(); + stream.Seek(0, SeekOrigin.Begin); + string imageUrl = lskyHelper.UploadImageAsync( + fileStream: stream, + fileName: file.FileName, + contentType: file.ContentType, + token: token + ).Result; + if (string.IsNullOrEmpty(imageUrl)) + { + return new SingleOutputDto { Message = "图片上传失败", StatusCode = StatusCodeConstants.InternalServerError }; + } + + var workerPicSource = workerPicRepository.GetSingle(a => a.EmployeeId.Equals(createEmployeePhotoInputDto.EmployeeId)); + if (workerPicSource.IsNullOrEmpty()) + { + workerPicRepository.Insert(new EmployeePhoto + { + EmployeeId = createEmployeePhotoInputDto.EmployeeId, + PhotoPath = imageUrl + }); + } + else + { + workerPicRepository.Update(a => new EmployeePhoto + { + PhotoPath = imageUrl + }, a => a.EmployeeId.Equals(createEmployeePhotoInputDto.EmployeeId)); + } + + return new SingleOutputDto + { + Source = new ReadEmployeePhotoOutputDto + { + PhotoId = 0, + PhotoPath = imageUrl, + EmployeeId = createEmployeePhotoInputDto.EmployeeId + } + }; + } + catch (Exception ex) + { + return new SingleOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + } + + /// + /// 删除员工照片 + /// + /// + /// + public BaseOutputDto DeleteWorkerPhoto(DeleteEmployeePhotoInputDto deleteEmployeePhotoInputDto) + { + try + { + workerPicRepository.Delete(a => a.EmployeeId.Equals(deleteEmployeePhotoInputDto.EmployeeId)); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); + } + + /// + /// 更新员工照片 + /// + /// + /// + public BaseOutputDto UpdateWorkerPhoto(UpdateEmployeePhotoInputDto updateEmployeePhotoInputDto) + { + try + { + workerPicRepository.Update(a => new EmployeePhoto + { + PhotoPath = updateEmployeePhotoInputDto.PhotoUrl + }, a => a.EmployeeId.Equals(updateEmployeePhotoInputDto.EmployeeId)); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); + } + } +} diff --git a/EOM.TSHotelManagement.Application/Worker/Picture/IWorkerPicService.cs b/EOM.TSHotelManagement.Application/Employee/Photo/IEmployeePhotoService.cs similarity index 37% rename from EOM.TSHotelManagement.Application/Worker/Picture/IWorkerPicService.cs rename to EOM.TSHotelManagement.Application/Employee/Photo/IEmployeePhotoService.cs index 1119d5de30107eb10174ded1f0f75eccc71852f8..c6dc8b0f8afe4791969c93030882200dff15e491 100644 --- a/EOM.TSHotelManagement.Application/Worker/Picture/IWorkerPicService.cs +++ b/EOM.TSHotelManagement.Application/Employee/Photo/IEmployeePhotoService.cs @@ -1,35 +1,38 @@ -using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Contract; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http.Internal; namespace EOM.TSHotelManagement.Application { /// /// 员工照片模块接口 /// - public interface IWorkerPicService + public interface IEmployeePhotoService { /// /// 查询员工照片 /// - /// + /// /// - WorkerPic WorkerPic(WorkerPic workerPic); + SingleOutputDto EmployeePhoto(ReadEmployeePhotoInputDto readEmployeePhotoInputDto); /// /// 添加员工照片 /// - /// + /// + /// /// - bool InsertWorkerPic(WorkerPic workerPic); + SingleOutputDto InsertWorkerPhoto(CreateEmployeePhotoInputDto createEmployeePhotoInputDto,IFormFile formFile); /// /// 删除员工照片 /// - /// + /// /// - bool DeleteWorkerPic(WorkerPic workerPic); + BaseOutputDto DeleteWorkerPhoto(DeleteEmployeePhotoInputDto deleteEmployeePhotoInputDto); /// /// 更新员工照片 /// - /// + /// /// - bool UpdateWorkerPic(WorkerPic workerPic); + BaseOutputDto UpdateWorkerPhoto(UpdateEmployeePhotoInputDto updateEmployeePhotoInputDto); } } diff --git a/EOM.TSHotelManagement.Application/Worker/GoodBad/IWorkerGoodBadService.cs b/EOM.TSHotelManagement.Application/Employee/RewardPunishment/IRewardPunishmentService.cs similarity index 83% rename from EOM.TSHotelManagement.Application/Worker/GoodBad/IWorkerGoodBadService.cs rename to EOM.TSHotelManagement.Application/Employee/RewardPunishment/IRewardPunishmentService.cs index bdb06742511262b494b5be101e3314de9c0e4982..8ab8a000d8de38c43845a6f007fca2a690289a89 100644 --- a/EOM.TSHotelManagement.Application/Worker/GoodBad/IWorkerGoodBadService.cs +++ b/EOM.TSHotelManagement.Application/Employee/RewardPunishment/IRewardPunishmentService.cs @@ -21,27 +21,27 @@ *SOFTWARE. * */ -using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Contract; namespace EOM.TSHotelManagement.Application { /// /// 员工奖惩信息接口 /// - public interface IWorkerGoodBadService + public interface IRewardPunishmentService { /// /// 添加员工奖惩记录 /// /// /// - bool AddGoodBad(WorkerGoodBad goodBad); + BaseOutputDto AddRewardPunishment(CreateEmployeeRewardPunishmentInputDto goodBad); /// /// 根据工号查找所有的奖惩记录信息 /// /// /// - List SelectAllGoodBadByWorkNo(string wn); + ListOutputDto SelectAllRewardPunishmentByEmployeeId(ReadEmployeeRewardPunishmentInputDto wn); } } \ No newline at end of file diff --git a/EOM.TSHotelManagement.Application/Worker/GoodBad/WorkerGoodBadService.cs b/EOM.TSHotelManagement.Application/Employee/RewardPunishment/RewardPunishmentService.cs similarity index 43% rename from EOM.TSHotelManagement.Application/Worker/GoodBad/WorkerGoodBadService.cs rename to EOM.TSHotelManagement.Application/Employee/RewardPunishment/RewardPunishmentService.cs index 66a9886a415ef2cf17ebd300b0062b80f37e1ec3..5cd6352ee60c8daebb2ff5436c099905f50a3f7a 100644 --- a/EOM.TSHotelManagement.Application/Worker/GoodBad/WorkerGoodBadService.cs +++ b/EOM.TSHotelManagement.Application/Employee/RewardPunishment/RewardPunishmentService.cs @@ -21,41 +21,44 @@ *SOFTWARE. * */ +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Util; using EOM.TSHotelManagement.EntityFramework; using jvncorelib.EntityLib; +using SqlSugar; namespace EOM.TSHotelManagement.Application { /// /// 员工奖惩记录接口实现类 /// - public class WorkerGoodBadService : IWorkerGoodBadService + public class RewardPunishmentService : IRewardPunishmentService { /// /// 员工奖惩记录 /// - private readonly GenericRepository workerGoogBadRepository; + private readonly GenericRepository rewardPunishmentRepository; /// /// 管理员记录 /// - private readonly GenericRepository adminRepository; + private readonly GenericRepository adminRepository; /// /// 奖惩类型 /// - private readonly GenericRepository goodbadTypeRepository; + private readonly GenericRepository goodbadTypeRepository; /// /// /// - /// + /// /// /// - public WorkerGoodBadService(GenericRepository workerGoogBadRepository, GenericRepository adminRepository, GenericRepository goodbadTypeRepository) + public RewardPunishmentService(GenericRepository rewardPunishmentRepository, GenericRepository adminRepository, GenericRepository goodbadTypeRepository) { - this.workerGoogBadRepository = workerGoogBadRepository; + this.rewardPunishmentRepository = rewardPunishmentRepository; this.adminRepository = adminRepository; this.goodbadTypeRepository = goodbadTypeRepository; } @@ -65,9 +68,17 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool AddGoodBad(WorkerGoodBad goodBad) + public BaseOutputDto AddRewardPunishment(CreateEmployeeRewardPunishmentInputDto goodBad) { - return workerGoogBadRepository.Insert(goodBad); + try + { + rewardPunishmentRepository.Insert(EntityMapper.Map(goodBad)); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } /// @@ -75,26 +86,58 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public List SelectAllGoodBadByWorkNo(string wn) + public ListOutputDto SelectAllRewardPunishmentByEmployeeId(ReadEmployeeRewardPunishmentInputDto wn) { + var where = Expressionable.Create(); + + if (!wn.EmployeeId.IsNullOrEmpty()) + { + where = where.And(a => a.EmployeeId == wn.EmployeeId); + } + + if (!wn.IsDelete.IsNullOrEmpty()) + { + where = where.And(a => a.IsDelete == wn.IsDelete); + } + //查询所有超级管理员 - List admins = new List(); + List admins = new List(); admins = adminRepository.GetList(a => a.IsDelete != 1); - List gBTypes = new List(); + List gBTypes = new List(); gBTypes = goodbadTypeRepository.GetList(a => a.IsDelete != 1); - List gb = new List(); - gb = workerGoogBadRepository.GetList(a => a.WorkNo == wn); + List gb = new List(); + + var count = 0; + + if (wn.Page != 0 && wn.PageSize != 0) + { + gb = rewardPunishmentRepository.AsQueryable().Where(where.ToExpression()) + .OrderByDescending(a => a.RewardPunishmentTime) + .ToPageList(wn.Page, wn.PageSize, ref count); + } + else + { + gb = rewardPunishmentRepository.AsQueryable().Where(where.ToExpression()) + .OrderByDescending(a => a.RewardPunishmentTime) + .ToList(); + } + gb.ForEach(source => { //奖惩类型 - var gbType = gBTypes.FirstOrDefault(a => a.GBTypeId == source.GBType); - source.TypeName = gbType.GBName.IsNullOrEmpty() ? "" : gbType.GBName; + var gbType = gBTypes.FirstOrDefault(a => a.RewardPunishmentTypeId == source.RewardPunishmentType); + source.RewardPunishmentTypeName = gbType.RewardPunishmentTypeName.IsNullOrEmpty() ? "" : gbType.RewardPunishmentTypeName; //操作人 - var admin = admins.FirstOrDefault(a => a.AdminAccount == source.GBOperation); - source.OperationName = admin.AdminName.IsNullOrEmpty() ? "" : admin.AdminName; + var admin = admins.FirstOrDefault(a => a.Account == source.RewardPunishmentOperator); + source.OperatorName = admin.Name.IsNullOrEmpty() ? "" : admin.Name; }); - return gb; + + return new ListOutputDto + { + listSource = EntityMapper.MapList(gb), + total = count + }; } } } diff --git a/EOM.TSHotelManagement.Application/Sys/NavBar/INavBarService.cs b/EOM.TSHotelManagement.Application/Sys/NavBar/INavBarService.cs index 45eaa38a621c04a705022f730ba095384bcecb90..f3c95efae8e37257abcc5fed4ffc7dadffaed4b5 100644 --- a/EOM.TSHotelManagement.Application/Sys/NavBar/INavBarService.cs +++ b/EOM.TSHotelManagement.Application/Sys/NavBar/INavBarService.cs @@ -1,4 +1,5 @@ -using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Contract; +using EOM.TSHotelManagement.Common.Core; namespace EOM.TSHotelManagement.Application { @@ -11,6 +12,6 @@ namespace EOM.TSHotelManagement.Application /// 导航控件列表 /// /// - List NavBarList(); + ListOutputDto NavBarList(); } } \ No newline at end of file diff --git a/EOM.TSHotelManagement.Application/Sys/NavBar/NavBarService.cs b/EOM.TSHotelManagement.Application/Sys/NavBar/NavBarService.cs index 02039d82e7ad48590e43138a8e2dba0bd4f4befc..e541887a92a1619512005eac4795a6c65b495566 100644 --- a/EOM.TSHotelManagement.Application/Sys/NavBar/NavBarService.cs +++ b/EOM.TSHotelManagement.Application/Sys/NavBar/NavBarService.cs @@ -1,4 +1,6 @@ -using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Contract; +using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Util; using EOM.TSHotelManagement.EntityFramework; namespace EOM.TSHotelManagement.Application @@ -26,11 +28,17 @@ namespace EOM.TSHotelManagement.Application /// 导航控件列表 /// /// - public List NavBarList() + public ListOutputDto NavBarList() { var navBarList = navBarRepository.GetList(a => a.IsDelete != 1); - return navBarList; + var listSource = EntityMapper.MapList(navBarList); + + return new ListOutputDto + { + listSource = listSource, + total = listSource.Count + }; } } } diff --git a/EOM.TSHotelManagement.Application/SystemManagement/Administrator/AdminService.cs b/EOM.TSHotelManagement.Application/SystemManagement/Administrator/AdminService.cs new file mode 100644 index 0000000000000000000000000000000000000000..7521d1c346e3c342c9b0a4d3939f742c17f1d7f0 --- /dev/null +++ b/EOM.TSHotelManagement.Application/SystemManagement/Administrator/AdminService.cs @@ -0,0 +1,463 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EOM.TSHotelManagement.Common.Contract; +using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Util; +using EOM.TSHotelManagement.EntityFramework; +using EOM.TSHotelManagement.Shared; +using jvncorelib.EncryptorLib; +using jvncorelib.EntityLib; +using Microsoft.AspNetCore.DataProtection; +using Microsoft.IdentityModel.Tokens; +using SqlSugar; +using System.ComponentModel; +using System.IdentityModel.Tokens.Jwt; +using System.Security.Claims; +using System.Text; + +namespace EOM.TSHotelManagement.Application +{ + /// + /// 管理员数据访问层 + /// + public class AdminService : IAdminService + { + /// + /// 管理员 + /// + private readonly GenericRepository adminRepository; + + /// + /// 管理员类型 + /// + private readonly GenericRepository adminTypeRepository; + + /// + /// 数据保护 + /// + private readonly IDataProtector dataProtector; + + /// + /// 加密 + /// + private readonly EncryptLib encrypt; + + /// + /// JWT加密 + /// + private readonly JWTHelper jWTHelper; + + /// + /// + /// + /// + /// + /// + /// + /// + public AdminService(GenericRepository adminRepository, GenericRepository adminTypeRepository, IDataProtectionProvider dataProtectionProvider, EncryptLib encrypt, JWTHelper jWTHelper) + { + this.adminRepository = adminRepository; + this.adminTypeRepository = adminTypeRepository; + this.dataProtector = dataProtectionProvider.CreateProtector("AdminInfoProtector"); + this.encrypt = encrypt; + this.jWTHelper = jWTHelper; + } + + /// + /// 根据超管密码查询员工类型和权限 + /// + /// + /// + public SingleOutputDto SelectManagerByPass(ReadAdministratorInputDto readAdministratorInputDto) + { + if (readAdministratorInputDto == null) + { + throw new ArgumentNullException(nameof(readAdministratorInputDto)); + } + + var existingAdmin = adminRepository.GetSingle(a => a.Account == readAdministratorInputDto.Account); + + if (existingAdmin == null) + { + return null; + } + + string existingAdminPassword = existingAdmin.Password; + + if (existingAdminPassword.Contains("·")) + { + if (!encrypt.Compare(readAdministratorInputDto.Password, existingAdminPassword)) + { + return null; + } + } + else if (!readAdministratorInputDto.Password.Equals(existingAdminPassword)) + { + return null; + } + + if (readAdministratorInputDto.IsDelete == 1) + { + return null; + } + + existingAdmin.Password = string.Empty; + + existingAdmin.UserToken = jWTHelper.GenerateJWT(new ClaimsIdentity(new Claim[] + { + new Claim(ClaimTypes.Name, existingAdmin.Name), + new Claim(ClaimTypes.SerialNumber, existingAdmin.Number) + })); + + var source = EntityMapper.Map(existingAdmin); + + return new SingleOutputDto + { + Source = source + }; + } + + /// + /// 后台系统登录 + /// + /// + /// + public SingleOutputDto Login(ReadAdministratorInputDto readAdministratorInputDto) + { + if (readAdministratorInputDto == null) + { + throw new ArgumentNullException(nameof(readAdministratorInputDto)); + } + + var existingAdmin = adminRepository.GetSingle(a => a.Account == readAdministratorInputDto.Account); + + if (existingAdmin == null) + { + return null; + } + + if (existingAdmin.IsDelete == 1) + { + return null; + } + + + var encrtptPwd = string.Empty; + try + { + encrtptPwd = encrypt.Encryption(readAdministratorInputDto.Password, EncryptionLevel.Enhanced); + var passed = encrypt.Compare(encrtptPwd, existingAdmin.Password); + if (!passed) + { + return null; + } + } + catch (Exception) + { + var originalPwd = dataProtector.Unprotect(existingAdmin.Password); + var passed = originalPwd == existingAdmin.Password; + if (!passed) + { + return null; + } + } + + if (encrtptPwd.IsNullOrEmpty() || existingAdmin.Password.IsNullOrEmpty()) + { + return null; + } + + existingAdmin.Password = string.Empty; + existingAdmin.UserToken = jWTHelper.GenerateJWT(new ClaimsIdentity(new Claim[] + { + new Claim(ClaimTypes.Name, existingAdmin.Name), + new Claim(ClaimTypes.SerialNumber, existingAdmin.Account) + })); + + var source = EntityMapper.Map(existingAdmin); + + return new SingleOutputDto + { + Source = source + }; + } + + /// + /// 根据超管账号查询对应的密码 + /// + /// + /// + public SingleOutputDto SelectAdminPwdByAccount(ReadAdministratorInputDto readAdministratorInputDto) + { + Administrator admin = new Administrator(); + admin = adminRepository.GetSingle(a => a.Account == readAdministratorInputDto.Account); + + var source = EntityMapper.Map(admin); + + return new SingleOutputDto + { + Source = source + }; + } + + /// + /// 获取所有管理员列表 + /// + /// + public ListOutputDto GetAllAdminList(ReadAdministratorInputDto readAdministratorInputDto) + { + var where = Expressionable.Create(); + + if (!readAdministratorInputDto.IsDelete.IsNullOrEmpty()) + { + where = where.And(a => a.IsDelete == readAdministratorInputDto.IsDelete); + } + var count = 0; + var listAdmins = new List(); + var listAdminType = adminTypeRepository.GetList(a => a.IsDelete != 1); + + if (!readAdministratorInputDto.IgnorePaging && readAdministratorInputDto.Page != 0 && readAdministratorInputDto.PageSize != 0) + { + listAdmins = adminRepository.AsQueryable().Where(where.ToExpression()).ToPageList(readAdministratorInputDto.Page, readAdministratorInputDto.PageSize, ref count); + } + else + { + listAdmins = adminRepository.AsQueryable().Where(where.ToExpression()).ToList(); + } + + listAdmins.ForEach(admins => + { + var isAdminType = admins.IsSuperAdmin == 1 ? "是" : "否"; + admins.IsSuperAdminDescription = isAdminType; + + var adminType = listAdminType.FirstOrDefault(a => a.TypeId.Equals(admins.Type)); + admins.TypeName = adminType == null ? "" : adminType.TypeName; + + var adminDelete = admins.IsDelete == 1 ? "是" : "否"; + admins.DeleteDescription = adminDelete; + + }); + + var listSouce = EntityMapper.MapList(listAdmins); + + return new ListOutputDto + { + listSource = listSouce, + total = count + }; + } + + /// + /// 修改密码 + /// + /// + /// + public BaseOutputDto UpdateNewPwdByOldPwd(UpdateAdministratorInputDto updateAdministratorInputDto) + { + try + { + updateAdministratorInputDto.Password = encrypt.Encryption(updateAdministratorInputDto.Password, EncryptionLevel.Enhanced); + + adminRepository.Update(a => new Administrator() + { + Password = updateAdministratorInputDto.Password + }, a => a.Account == updateAdministratorInputDto.Account); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); + } + + /// + /// 添加管理员 + /// + /// + /// + public BaseOutputDto AddAdmin(CreateAdministratorInputDto createAdministratorInputDto) + { + try + { + createAdministratorInputDto.Password = dataProtector.Protect(createAdministratorInputDto.Password); + adminRepository.Insert(EntityMapper.Map(createAdministratorInputDto)); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); + } + + /// + /// 更新管理员 + /// + /// + /// + public BaseOutputDto UpdAdmin(UpdateAdministratorInputDto updateAdministratorInputDto) + { + try + { + updateAdministratorInputDto.Password = dataProtector.Protect(updateAdministratorInputDto.Password); + adminRepository.Insert(EntityMapper.Map(updateAdministratorInputDto)); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); + } + + /// + /// 删除管理员 + /// + /// + /// + public BaseOutputDto DelAdmin(DeleteAdministratorInputDto deleteAdministratorInputDto) + { + try + { + adminRepository.Delete(EntityMapper.Map(deleteAdministratorInputDto)); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); + } + + /// + /// 获取管理员信息 + /// + /// + /// + public SingleOutputDto GetAdminInfoByAdminAccount(ReadAdministratorInputDto readAdministratorInputDto) + { + var adminInfo = adminRepository.GetSingle(a => a.Account.Equals(readAdministratorInputDto.Account)); + if (adminInfo != null) + { + var adminType = adminTypeRepository.GetSingle(a => a.TypeId.Equals(adminInfo.Type)); + adminInfo.TypeName = adminType.TypeName; + } + + var source = EntityMapper.Map(adminInfo); + + return new SingleOutputDto { Source = source }; + } + + /// + /// 获取所有管理员类型 + /// + /// + public ListOutputDto GetAllAdminTypes(ReadAdministratorTypeInputDto readAdministratorTypeInputDto) + { + var listAdminTypes = adminTypeRepository.GetList(a => a.IsDelete != 1); + + var listSouce = EntityMapper.MapList(listAdminTypes); + + return new ListOutputDto + { + listSource = listSouce + }; + } + + /// + /// 添加管理员类型 + /// + /// + /// + public BaseOutputDto AddAdminType(CreateAdministratorTypeInputDto createAdministratorTypeInputDto) + { + try + { + adminTypeRepository.Insert(EntityMapper.Map(createAdministratorTypeInputDto)); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); + } + + /// + /// 更新管理员类型 + /// + /// + /// + public BaseOutputDto UpdAdminType(UpdateAdministratorTypeInputDto updateAdministratorTypeInputDto) + { + try + { + adminTypeRepository.Insert(EntityMapper.Map(updateAdministratorTypeInputDto)); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); + } + + /// + /// 删除管理员类型 + /// + /// + /// + public BaseOutputDto DelAdminType(DeleteAdministratorTypeInputDto deleteAdministratorTypeInputDto) + { + try + { + adminTypeRepository.Delete(EntityMapper.Map(deleteAdministratorTypeInputDto)); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); + } + + /// + /// 更新管理员账户 + /// + /// + /// + public BaseOutputDto UpdAccount(UpdateAdministratorInputDto updateAdministratorInputDto) + { + try + { + updateAdministratorInputDto.IsDelete = updateAdministratorInputDto.IsDelete == 0 ? 1 : 0; + adminRepository.Update(a => new Administrator() + { + IsDelete = updateAdministratorInputDto.IsDelete, + DataChgDate = updateAdministratorInputDto.DataChgDate + }, a => a.Id == updateAdministratorInputDto.Id); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); + } + } +} diff --git a/EOM.TSHotelManagement.Application/Zero/Admin/IAdminService.cs b/EOM.TSHotelManagement.Application/SystemManagement/Administrator/IAdminService.cs similarity index 46% rename from EOM.TSHotelManagement.Application/Zero/Admin/IAdminService.cs rename to EOM.TSHotelManagement.Application/SystemManagement/Administrator/IAdminService.cs index c82b090df037fbdd96bf1e9190900359e07e8d29..1daf47876782108957c57fdebf5c9d660151ce26 100644 --- a/EOM.TSHotelManagement.Application/Zero/Admin/IAdminService.cs +++ b/EOM.TSHotelManagement.Application/SystemManagement/Administrator/IAdminService.cs @@ -21,7 +21,7 @@ *SOFTWARE. * */ -using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Contract; namespace EOM.TSHotelManagement.Application { @@ -31,75 +31,100 @@ namespace EOM.TSHotelManagement.Application public interface IAdminService { - #region 根据超管密码查询员工类型和权限 /// /// 根据超管密码查询员工类型和权限 /// - /// + /// /// - Admin SelectManagerByPass(Admin admin); + SingleOutputDto SelectManagerByPass(ReadAdministratorInputDto readAdministratorInputDto); /// /// 后台系统登录 /// - /// + /// /// - Admin Login(Admin admin); - #endregion + SingleOutputDto Login(ReadAdministratorInputDto readAdministratorInputDto); - #region 根据超管账号查询对应的密码 /// /// 根据超管账号查询对应的密码 /// - /// + /// /// - Admin SelectAdminPwdByAccount(string account); - #endregion + SingleOutputDto SelectAdminPwdByAccount(ReadAdministratorInputDto readAdministratorInputDto); /// /// 获取所有管理员列表 /// /// - List GetAllAdminList(); + ListOutputDto GetAllAdminList(ReadAdministratorInputDto readAdministratorInputDto); /// /// 修改密码 /// - /// + /// /// - bool UpdateNewPwdByOldPwd(Admin admin); + BaseOutputDto UpdateNewPwdByOldPwd(UpdateAdministratorInputDto updateAdministratorInputDto); /// - /// 获取管理员列表 + /// 添加管理员 /// + /// /// - List GetAllAdmin(); + BaseOutputDto AddAdmin(CreateAdministratorInputDto createAdministratorInputDto); /// - /// 添加管理员 + /// 更新管理员 /// - /// + /// /// - bool AddAdmin(Admin admin); + BaseOutputDto UpdAdmin(UpdateAdministratorInputDto updateAdministratorInputDto); + + /// + /// 删除管理员 + /// + /// + /// + BaseOutputDto DelAdmin(DeleteAdministratorInputDto deleteAdministratorInputDto); /// /// 获取管理员信息 /// - /// + /// /// - Admin GetAdminInfoByAdminAccount(Admin admin); + SingleOutputDto GetAdminInfoByAdminAccount(ReadAdministratorInputDto readAdministratorInputDto); /// /// 获取所有管理员类型 /// /// - List GetAllAdminTypes(); + ListOutputDto GetAllAdminTypes(ReadAdministratorTypeInputDto readAdministratorTypeInputDto); + + /// + /// 添加管理员类型 + /// + /// + /// + BaseOutputDto AddAdminType(CreateAdministratorTypeInputDto createAdministratorTypeInputDto); + + /// + /// 更新管理员类型 + /// + /// + /// + BaseOutputDto UpdAdminType(UpdateAdministratorTypeInputDto updateAdministratorTypeInputDto); + + /// + /// 删除管理员类型 + /// + /// + /// + BaseOutputDto DelAdminType(DeleteAdministratorTypeInputDto deleteAdministratorTypeInputDto); /// /// 批量更新管理员账户 /// - /// + /// /// - bool UpdAccount(Admin admins); + BaseOutputDto UpdAccount(UpdateAdministratorInputDto updateAdministratorInputDto); } } \ No newline at end of file diff --git a/EOM.TSHotelManagement.Application/Zero/Base/BaseService.cs b/EOM.TSHotelManagement.Application/SystemManagement/Base/BaseService.cs similarity index 31% rename from EOM.TSHotelManagement.Application/Zero/Base/BaseService.cs rename to EOM.TSHotelManagement.Application/SystemManagement/Base/BaseService.cs index 29b3b173a2ca2869003c1a0e66bd100f30341221..ddec7a09fb1d5f95782e8a6da52340c424a355f1 100644 --- a/EOM.TSHotelManagement.Application/Zero/Base/BaseService.cs +++ b/EOM.TSHotelManagement.Application/SystemManagement/Base/BaseService.cs @@ -21,11 +21,18 @@ *SOFTWARE. * */ +using EOM.TSHotelManagement.Common; +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Util; using EOM.TSHotelManagement.EntityFramework; +using EOM.TSHotelManagement.Shared; using jvncorelib.EntityLib; +using Microsoft.Extensions.Options; using SqlSugar; using System; +using System.ComponentModel; +using System.Reflection; namespace EOM.TSHotelManagement.Application { @@ -37,12 +44,7 @@ namespace EOM.TSHotelManagement.Application /// /// 员工信息 /// - private readonly GenericRepository workerRepository; - - /// - /// 性别类型 - /// - private readonly GenericRepository sexTypeRepository; + private readonly GenericRepository workerRepository; /// /// 学历类型 @@ -57,7 +59,7 @@ namespace EOM.TSHotelManagement.Application /// /// 部门 /// - private readonly GenericRepository deptRepository; + private readonly GenericRepository deptRepository; /// /// 职务 @@ -67,7 +69,7 @@ namespace EOM.TSHotelManagement.Application /// /// 证件类型 /// - private readonly GenericRepository passPortTypeRepository; + private readonly GenericRepository passPortTypeRepository; /// /// 客户类型 @@ -77,18 +79,17 @@ namespace EOM.TSHotelManagement.Application /// /// 奖惩类型 /// - private readonly GenericRepository goodbadTypeRepository; + private readonly GenericRepository goodbadTypeRepository; /// /// 基础URL /// - private readonly GenericRepository baseRepository; + private readonly GenericRepository baseRepository; /// /// /// /// - /// /// /// /// @@ -97,10 +98,9 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public BaseService(GenericRepository workerRepository, GenericRepository sexTypeRepository, GenericRepository educationRepository, GenericRepository nationRepository, GenericRepository deptRepository, GenericRepository positionRepository, GenericRepository passPortTypeRepository, GenericRepository custoTypeRepository, GenericRepository goodbadTypeRepository, GenericRepository baseRepository) + public BaseService(GenericRepository workerRepository, GenericRepository educationRepository, GenericRepository nationRepository, GenericRepository deptRepository, GenericRepository positionRepository, GenericRepository passPortTypeRepository, GenericRepository custoTypeRepository, GenericRepository goodbadTypeRepository, GenericRepository baseRepository) { this.workerRepository = workerRepository; - this.sexTypeRepository = sexTypeRepository; this.educationRepository = educationRepository; this.nationRepository = nationRepository; this.deptRepository = deptRepository; @@ -117,71 +117,80 @@ namespace EOM.TSHotelManagement.Application /// 查询所有性别类型 /// /// - public List SelectSexTypeAll(SexType sexType = null) + public ListOutputDto SelectGenderTypeAll() { - var where = Expressionable.Create(); + var helper = new EnumHelper(); + var enumList = Enum.GetValues(typeof(GenderType)) + .Cast() + .Select(e => new EnumDto + { + Id = (int)e, + Name = e.ToString(), + Description = helper.GetEnumDescription(e) + }) + .ToList(); - if (sexType != null && !sexType.IsDelete.IsNullOrEmpty()) - { - where = where.And(a => a.IsDelete == sexType.IsDelete); - } - if (sexType != null && !sexType.sexName.IsNullOrEmpty()) + return new ListOutputDto { - where = where.And(a => a.sexName.Contains(sexType.sexName)); - } - return sexTypeRepository.GetList(where.ToExpression()); + listSource = enumList, + total = enumList.Count + }; } - /// - /// 查询性别类型 - /// - /// - public SexType SelectSexType(SexType sexType) - { - SexType sexTypes = new SexType(); - sexTypes = sexTypeRepository.GetSingle(a => a.sexId == sexType.sexId); - return sexTypes; - } + #endregion - /// - /// 添加性别类型 - /// - /// - /// - public bool AddSexType(SexType sexType) - { - return sexTypeRepository.Insert(sexType); - } + #region 面貌模块 /// - /// 删除性别类型 + /// 查询所有面貌类型 /// - /// /// - public bool DelSexType(SexType sexType) + public ListOutputDto SelectWorkerFeatureAll() { - return sexTypeRepository.Update(a => new SexType() + var helper = new EnumHelper(); + var enumList = Enum.GetValues(typeof(PoliticalAffiliation)) + .Cast() + .Select(e => new EnumDto + { + Id = (int)e, + Name = e.ToString(), + Description = helper.GetEnumDescription(e) + }) + .ToList(); + + return new ListOutputDto { - IsDelete = sexType.IsDelete, - DataChgUsr = sexType.DataChgUsr - }, a => a.sexId == sexType.sexId); + listSource = enumList, + total = enumList.Count + }; } - /// - /// 更新性别类型 - /// - /// - /// - public bool UpdSexType(SexType sexType) - { - return sexTypeRepository.Update(a => new SexType() + #endregion + + #region 房间状态模块 + /// + /// 获取所有房间状态 + /// + /// + public ListOutputDto SelectRoomStateAll() + { + var helper = new EnumHelper(); + var enumList = Enum.GetValues(typeof(RoomState)) + .Cast() + .Select(e => new EnumDto + { + Id = (int)e, + Name = e.ToString(), + Description = helper.GetEnumDescription(e) + }) + .ToList(); + + return new ListOutputDto { - sexName = sexType.sexName, - DataChgUsr = sexType.DataChgUsr, - DataChgDate = sexType.DataChgDate - }, a => a.sexId == sexType.sexId); + listSource = enumList, + total = enumList.Count + }; } - #endregion #region 职位模块 @@ -190,70 +199,87 @@ namespace EOM.TSHotelManagement.Application /// 查询所有职位类型 /// /// - public List SelectPositionAll(Position position = null) + public ListOutputDto SelectPositionAll(ReadPositionInputDto positionInputDto = null) { var where = Expressionable.Create(); - if (position != null && !position.IsDelete.IsNullOrEmpty()) + if (positionInputDto != null && !positionInputDto.IsDelete.IsNullOrEmpty()) + { + where = where.And(a => a.IsDelete == positionInputDto.IsDelete); + } + if (positionInputDto != null && !positionInputDto.PositionName.IsNullOrEmpty()) + { + where = where.And(a => a.PositionName.Contains(positionInputDto.PositionName)); + } + var count = 0; + var positions = new List(); + + if (!positionInputDto.IgnorePaging && positionInputDto.Page != 0 && positionInputDto.PageSize != 0) { - where = where.And(a => a.IsDelete == position.IsDelete); + positions = positionRepository.AsQueryable().Where(where.ToExpression()).ToPageList(positionInputDto.Page, positionInputDto.PageSize, ref count); } - if (position != null && !position.position_name.IsNullOrEmpty()) + else { - where = where.And(a => a.position_name.Contains(position.position_name)); + positions = positionRepository.AsQueryable().Where(where.ToExpression()).ToList(); } - return positionRepository.GetList(where.ToExpression()); + + var result = EntityMapper.MapList(positions); + return new ListOutputDto { listSource = result, total = count }; } /// /// 查询职位类型 /// /// - public Position SelectPosition(Position position) + public SingleOutputDto SelectPosition(ReadPositionInputDto positionInputDto) { - Position position1 = new Position(); - position1 = positionRepository.GetSingle(a => a.position_no == position.position_no); - return position1; + var position = positionRepository.GetSingle(a => a.Id == positionInputDto.PositionId); + var result = EntityMapper.Map(position); + return new SingleOutputDto { Source = result }; } /// /// 添加职位类型 /// - /// + /// /// - public bool AddPosition(Position position) + public BaseOutputDto AddPosition(CreatePositionInputDto createPositionInputDto) { - return positionRepository.Insert(position); + var position = EntityMapper.Map(createPositionInputDto); + var result = positionRepository.Insert(position); + return new BaseOutputDto { StatusCode = result ? StatusCodeConstants.Success : StatusCodeConstants.InternalServerError }; } /// /// 删除职位类型 /// - /// + /// /// - public bool DelPosition(Position position) + public BaseOutputDto DelPosition(DeletePositionInputDto deletePositionInputDto) { - return positionRepository.Update(a => new Position() + var result = positionRepository.Update(a => new Position() { - IsDelete = position.IsDelete, - DataChgUsr = position.DataChgUsr, - DataChgDate = position.DataChgDate - }, a => a.position_no == position.position_no); + IsDelete = deletePositionInputDto.IsDelete, + DataChgUsr = deletePositionInputDto.DataChgUsr, + DataChgDate = deletePositionInputDto.DataChgDate + }, a => a.PositionNumber == deletePositionInputDto.PositionNumber); + return new BaseOutputDto { StatusCode = result ? StatusCodeConstants.Success : StatusCodeConstants.InternalServerError }; } /// /// 更新职位类型 /// - /// + /// /// - public bool UpdPosition(Position position) + public BaseOutputDto UpdPosition(UpdatePositionInputDto updatePositionInputDto) { - return positionRepository.Update(a => new Position() + var result = positionRepository.Update(a => new Position() { - position_name = position.position_name, - DataChgUsr = position.DataChgUsr, - DataChgDate = position.DataChgDate - }, a => a.position_no == position.position_no); + PositionName = updatePositionInputDto.PositionName, + DataChgUsr = updatePositionInputDto.DataChgUsr, + DataChgDate = updatePositionInputDto.DataChgDate + }, a => a.PositionNumber == updatePositionInputDto.PositionNumber); + return new BaseOutputDto { StatusCode = result ? StatusCodeConstants.Success : StatusCodeConstants.InternalServerError }; } #endregion @@ -264,69 +290,84 @@ namespace EOM.TSHotelManagement.Application /// 查询所有民族类型 /// /// - public List SelectNationAll(Nation nation = null) + public ListOutputDto SelectNationAll(ReadNationInputDto nationInputDto) { + var nations = new List(); + var where = Expressionable.Create(); - where = where.And(a => a.IsDelete == nation.IsDelete); + if (nationInputDto != null && !nationInputDto.IsDelete.IsNullOrEmpty()) + { + where = where.And(a => a.IsDelete == nationInputDto.IsDelete); + } + var count = 0; - if (nation != null && !nation.nation_name.IsNullOrEmpty()) + if (!nationInputDto.IgnorePaging && nationInputDto.Page != 0 && nationInputDto.PageSize != 0) + { + nations = nationRepository.AsQueryable().Where(where.ToExpression()).ToPageList(nationInputDto.Page, nationInputDto.PageSize, ref count); + } + else { - where = where.And(a => a.nation_name.Contains(nation.nation_name)); + nations = nationRepository.AsQueryable().Where(where.ToExpression()).ToList(); } - return nationRepository.GetList(where.ToExpression()); + + var result = EntityMapper.MapList(nations); + return new ListOutputDto { listSource = result, total = count }; } /// /// 查询民族类型 /// /// - public Nation SelectNation(Nation nation) + public SingleOutputDto SelectNation(ReadNationInputDto nationInputDto) { - Nation nation1 = new Nation(); - nation1 = nationRepository.GetSingle(a => a.nation_no.Equals(nation.nation_no)); - return nation1; + var nation = nationRepository.GetSingle(a => a.Id == nationInputDto.NationId); + var result = EntityMapper.Map(nation); + return new SingleOutputDto { Source = result }; } /// /// 添加民族类型 /// - /// + /// /// - public bool AddNation(Nation nation) + public BaseOutputDto AddNation(CreateNationInputDto createNationInputDto) { - return nationRepository.Insert(nation); + var nation = EntityMapper.Map(createNationInputDto); + var result = nationRepository.Insert(nation); + return new BaseOutputDto { StatusCode = result ? StatusCodeConstants.Success : StatusCodeConstants.InternalServerError }; } /// /// 删除民族类型 /// - /// + /// /// - public bool DelNation(Nation nation) + public BaseOutputDto DelNation(DeleteNationInputDto deleteNationInputDto) { - return nationRepository.Update(a => new Nation() + var result = nationRepository.Update(a => new Nation() { - IsDelete = nation.IsDelete ?? 1, - DataChgUsr = nation.DataChgUsr, - DataChgDate = nation.DataChgDate - }, a => a.nation_no.Equals(nation.nation_no)); - + IsDelete = deleteNationInputDto.IsDelete, + DataChgUsr = deleteNationInputDto.DataChgUsr, + DataChgDate = deleteNationInputDto.DataChgDate + }, a => a.NationNumber == deleteNationInputDto.NationNumber); + return new BaseOutputDto { StatusCode = result ? StatusCodeConstants.Success : StatusCodeConstants.InternalServerError }; } /// /// 更新民族类型 /// - /// + /// /// - public bool UpdNation(Nation nation) + public BaseOutputDto UpdNation(UpdateNationInputDto updateNationInputDto) { - return nationRepository.Update(a => new Nation() + var result = nationRepository.Update(a => new Nation() { - nation_name = nation.nation_name, - DataChgUsr = nation.DataChgUsr, - DataChgDate = nation.DataChgDate - }, a => a.nation_no.Equals(nation.nation_no)); + NationName = updateNationInputDto.NationName, + DataChgUsr = updateNationInputDto.DataChgUsr, + DataChgDate = updateNationInputDto.DataChgDate + }, a => a.NationNumber == updateNationInputDto.NationNumber); + return new BaseOutputDto { StatusCode = result ? StatusCodeConstants.Success : StatusCodeConstants.InternalServerError }; } #endregion @@ -337,55 +378,67 @@ namespace EOM.TSHotelManagement.Application /// 查询所有学历类型 /// /// - public List SelectEducationAll(Education education = null) + public ListOutputDto SelectEducationAll(ReadEducationInputDto educationInputDto = null) { var where = Expressionable.Create(); - if (education != null && !education.IsDelete.IsNullOrEmpty()) + if (!educationInputDto.IsDelete.IsNullOrEmpty()) { - where = where.And(a => a.IsDelete == education.IsDelete); + where = where.And(a => a.IsDelete == educationInputDto.IsDelete); } - if (education != null && !education.education_name.IsNullOrEmpty()) + var count = 0; + var educations = new List(); + + if (!educationInputDto.IgnorePaging && educationInputDto.Page != 0 && educationInputDto.PageSize != 0) + { + educations = educationRepository.AsQueryable().Where(where.ToExpression()).ToPageList(educationInputDto.Page, educationInputDto.PageSize, ref count); + } + else { - where = where.And(a => a.education_name.Contains(education.education_name)); + educations = educationRepository.AsQueryable().Where(where.ToExpression()).ToList(); } - return educationRepository.GetList(where.ToExpression()); + + var result = EntityMapper.MapList(educations); + return new ListOutputDto { listSource = result, total = count }; } /// /// 查询学历类型 /// /// - public Education SelectEducation(Education education) + public SingleOutputDto SelectEducation(ReadEducationInputDto educationInputDto) { - Education education1 = new Education(); - education1 = educationRepository.GetSingle(a => a.education_no == education.education_no); - return education1; + var education = educationRepository.GetSingle(a => a.EducationNumber == educationInputDto.EducationNumber); + var result = EntityMapper.Map(education); + return new SingleOutputDto { Source = result }; } /// /// 添加学历类型 /// - /// + /// /// - public bool AddEducation(Education education) + public BaseOutputDto AddEducation(CreateEducationInputDto createEducationInputDto) { - return educationRepository.Insert(education); + var education = EntityMapper.Map(createEducationInputDto); + var result = educationRepository.Insert(education); + return new BaseOutputDto { StatusCode = result ? StatusCodeConstants.Success : StatusCodeConstants.InternalServerError }; } /// /// 删除学历类型 /// - /// + /// /// - public bool DelEducation(Education education) + public BaseOutputDto DelEducation(DeleteEducationInputDto deleteEducationInputDto) { - return educationRepository.Update(a => new Education() + var result = educationRepository.Update(a => new Education() { - IsDelete = education.IsDelete ?? 1, - DataChgUsr = education.DataChgUsr, - DataChgDate = education.DataChgDate - }, a => a.education_no == education.education_no); + IsDelete = deleteEducationInputDto.IsDelete, + DataChgUsr = deleteEducationInputDto.DataChgUsr, + DataChgDate = deleteEducationInputDto.DataChgDate + }, a => a.EducationNumber == deleteEducationInputDto.EducationNumber); + return new BaseOutputDto { StatusCode = result ? StatusCodeConstants.Success : StatusCodeConstants.InternalServerError }; } /// @@ -393,14 +446,15 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool UpdEducation(Education education) + public BaseOutputDto UpdEducation(UpdateEducationInputDto education) { - return educationRepository.Update(a => new Education() + var result = educationRepository.Update(a => new Education() { - education_name = education.education_name, + EducationName = education.EducationName, DataChgUsr = education.DataChgUsr, DataChgDate = education.DataChgDate - }, a => a.education_no == education.education_no); + }, a => a.EducationNumber == education.EducationNumber); + return new BaseOutputDto { StatusCode = result ? StatusCodeConstants.Success : StatusCodeConstants.InternalServerError }; } #endregion @@ -411,58 +465,62 @@ namespace EOM.TSHotelManagement.Application /// 查询所有部门类型(可用) /// /// - public List SelectDeptAllCanUse() + public ListOutputDto SelectDeptAllCanUse() { - List workers = new List(); - workers = workerRepository.GetList(a => a.IsDelete != 1); - List depts = new List(); - depts = deptRepository.GetList(a => a.IsDelete != 1); - depts.ForEach(source => - { - if (!source.dept_parent.IsNullOrEmpty()) - { - var dept = depts.FirstOrDefault(a => a.dept_no == source.dept_parent); - source.parent_name = dept == null || dept.dept_name.IsNullOrEmpty() ? "无" : dept.dept_name; - } - if (!source.dept_leader.IsNullOrEmpty()) - { - var leader = workers.FirstOrDefault(a => a.WorkerId == source.dept_leader); - source.leader_name = leader == null || leader.WorkerName.IsNullOrEmpty() ? "无" : leader.WorkerName; - } - - }); - return depts; + var depts = deptRepository.GetList(a => a.IsDelete != 1); + var result = EntityMapper.MapList(depts); + return new ListOutputDto { listSource = result, total = result.Count }; } /// /// 查询所有部门类型 /// /// - public List SelectDeptAll() + public ListOutputDto SelectDeptAll(ReadDepartmentInputDto readDepartmentInputDto) { - List workers = new List(); - workers = workerRepository.GetList(a => a.IsDelete != 1); - List depts = new List(); - depts = deptRepository.GetList(a => a.IsDelete != 1); + var where = Expressionable.Create(); + if (!readDepartmentInputDto.IsDelete.IsNullOrEmpty()) + { + where = where.And(a => a.IsDelete == readDepartmentInputDto.IsDelete); + } + var count = 0; + var depts = new List(); + + if (!readDepartmentInputDto.IgnorePaging && readDepartmentInputDto.Page != 0 && readDepartmentInputDto.PageSize != 0) + { + depts = deptRepository.AsQueryable().Where(where.ToExpression()).ToPageList(readDepartmentInputDto.Page, readDepartmentInputDto.PageSize, ref count); + } + else + { + depts = deptRepository.AsQueryable().Where(where.ToExpression()).ToList(); + } + + var parentDepartmentNumbers = depts.Where(a => !a.ParentDepartmentNumber.IsNullOrEmpty()).Select(a => a.ParentDepartmentNumber).ToList(); + var parentDepartments = deptRepository.GetList(a => parentDepartmentNumbers.Contains(a.DepartmentNumber)); + var departmentLeaderNumbers = depts.Where(a => !a.DepartmentLeader.IsNullOrEmpty()).Select(a => a.DepartmentLeader).ToList(); + var departmentLeaders = workerRepository.GetList(a => departmentLeaderNumbers.Contains(a.EmployeeId)); + depts.ForEach(source => { - var dept = depts.FirstOrDefault(a => a.dept_no == source.dept_parent); - source.parent_name = dept == null ? "" : dept.dept_name; - var leader = workers.FirstOrDefault(a => source.dept_leader != null && a.WorkerId == source.dept_leader); - source.leader_name = leader == null ? "" : leader.WorkerName; + var parentDepartment = parentDepartments.SingleOrDefault(a => a.DepartmentNumber.Equals(source.ParentDepartmentNumber)); + source.ParentDepartmentName = parentDepartment.IsNullOrEmpty() ? "" : parentDepartment.DepartmentName; + + var departmentLeader = departmentLeaders.SingleOrDefault(a => a.EmployeeId.Equals(source.DepartmentLeader)); + source.LeaderName = departmentLeader.IsNullOrEmpty() ? "" : departmentLeader.EmployeeName; }); - return depts; + var result = EntityMapper.MapList(depts); + return new ListOutputDto { listSource = result, total = count }; } /// /// 查询部门类型 /// /// - public Dept SelectDept(Dept dept) + public SingleOutputDto SelectDept(ReadDepartmentInputDto dept) { - Dept dept1 = new Dept(); - dept1 = deptRepository.GetSingle(a => a.dept_no.Equals(dept.dept_no)); - return dept1; + var department = deptRepository.GetSingle(a => a.Id == dept.Id); + var result = EntityMapper.Map(department); + return new SingleOutputDto { Source = result }; } /// @@ -470,9 +528,11 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool AddDept(Dept dept) + public BaseOutputDto AddDept(CreateDepartmentInputDto dept) { - return deptRepository.Insert(dept); + var department = EntityMapper.Map(dept); + var result = deptRepository.Insert(department); + return new BaseOutputDto { StatusCode = result ? StatusCodeConstants.Success : StatusCodeConstants.InternalServerError }; } /// @@ -480,18 +540,15 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool DelDept(Dept dept) + public BaseOutputDto DelDept(DeleteDepartmentInputDto dept) { - if (dept.IsNullOrEmpty()) - { - return false; - } - return deptRepository.Update(a => new Dept() + var result = deptRepository.Update(a => new Department() { IsDelete = dept.IsDelete, DataChgUsr = dept.DataChgUsr, DataChgDate = dept.DataChgDate - }, a => a.dept_no == dept.dept_no); + }, a => a.Id == dept.Id); + return new BaseOutputDto { StatusCode = result ? StatusCodeConstants.Success : StatusCodeConstants.InternalServerError }; } /// @@ -499,17 +556,19 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool UpdDept(Dept dept) + public BaseOutputDto UpdDept(UpdateDepartmentInputDto dept) { - return deptRepository.Update(a => new Dept() + var result = deptRepository.Update(a => new Department() { - dept_name = dept.dept_name, - dept_desc = dept.dept_desc, - dept_leader = dept.dept_leader, - dept_parent = dept.dept_parent, + DepartmentName = dept.DepartmentName, + DepartmentDescription = dept.DepartmentDescription, + DepartmentLeader = dept.DepartmentLeader, + ParentDepartmentNumber = dept.ParentDepartmentNumber, + DepartmentCreationDate = dept.DepartmentCreationDate, DataChgUsr = dept.DataChgUsr, DataChgDate = dept.DataChgDate - }, a => a.dept_no == dept.dept_no); + }, a => a.DepartmentNumber == dept.DepartmentNumber); + return new BaseOutputDto { StatusCode = result ? StatusCodeConstants.Success : StatusCodeConstants.InternalServerError }; } #endregion @@ -520,22 +579,38 @@ namespace EOM.TSHotelManagement.Application /// 查询所有客户类型(可用) /// /// - public List SelectCustoTypeAllCanUse() + public ListOutputDto SelectCustoTypeAllCanUse() { - List custoTypes = new List(); - custoTypes = custoTypeRepository.GetList(a => a.IsDelete != 1); - return custoTypes; + var custoTypes = custoTypeRepository.GetList(a => a.IsDelete != 1); + var result = EntityMapper.MapList(custoTypes); + return new ListOutputDto { listSource = result, total = result.Count }; } /// /// 查询所有客户类型 /// /// - public List SelectCustoTypeAll() + public ListOutputDto SelectCustoTypeAll(ReadCustoTypeInputDto readCustoTypeInputDto) { - List custoTypes = new List(); - custoTypes = custoTypeRepository.GetList(); - return custoTypes; + var where = Expressionable.Create(); + if (!readCustoTypeInputDto.IsDelete.IsNullOrEmpty()) + { + where = where.And(a => a.IsDelete == readCustoTypeInputDto.IsDelete); + } + var count = 0; + var custoTypes = new List(); + + if (!readCustoTypeInputDto.IgnorePaging && readCustoTypeInputDto.Page != 0 && readCustoTypeInputDto.PageSize != 0) + { + custoTypes = custoTypeRepository.AsQueryable().Where(where.ToExpression()).ToPageList(readCustoTypeInputDto.Page, readCustoTypeInputDto.PageSize, ref count); + } + else + { + custoTypes = custoTypeRepository.AsQueryable().Where(where.ToExpression()).ToList(); + } + + var result = EntityMapper.MapList(custoTypes); + return new ListOutputDto { listSource = result, total = count }; } /// @@ -543,11 +618,11 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public CustoType SelectCustoTypeByTypeId(CustoType custoType) + public SingleOutputDto SelectCustoTypeByTypeId(ReadCustoTypeInputDto custoType) { - CustoType custoTypes = new CustoType(); - custoType = custoTypeRepository.GetSingle(a => a.UserType == custoType.UserType && a.IsDelete != 1); - return custoTypes; + var custoTypeEntity = custoTypeRepository.GetSingle(a => a.CustomerType == custoType.CustomerType && a.IsDelete != 1); + var result = EntityMapper.Map(custoTypeEntity); + return new SingleOutputDto { Source = result }; } /// @@ -555,9 +630,11 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool InsertCustoType(CustoType custoType) + public BaseOutputDto InsertCustoType(CreateCustoTypeInputDto custoType) { - return custoTypeRepository.Insert(custoType); + var custoTypeEntity = EntityMapper.Map(custoType); + var result = custoTypeRepository.Insert(custoTypeEntity); + return new BaseOutputDto { StatusCode = result ? StatusCodeConstants.Success : StatusCodeConstants.InternalServerError }; } /// @@ -565,13 +642,14 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool DeleteCustoType(CustoType custoType) + public BaseOutputDto DeleteCustoType(DeleteCustoTypeInputDto custoType) { - return custoTypeRepository.Update(a => new CustoType() + var result = custoTypeRepository.Update(a => new CustoType() { IsDelete = 1, DataChgUsr = custoType.DataChgUsr - }, a => a.UserType == custoType.UserType); + }, a => a.CustomerType == custoType.CustomerType); + return new BaseOutputDto { StatusCode = result ? StatusCodeConstants.Success : StatusCodeConstants.InternalServerError }; } /// @@ -579,14 +657,15 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool UpdateCustoType(CustoType custoType) + public BaseOutputDto UpdateCustoType(UpdateCustoTypeInputDto custoType) { - return custoTypeRepository.Update(a => new CustoType() + var result = custoTypeRepository.Update(a => new CustoType() { - TypeName = custoType.TypeName, + CustomerTypeName = custoType.CustomerTypeName, DataChgUsr = custoType.DataChgUsr, DataChgDate = custoType.DataChgDate - }, a => a.UserType == custoType.UserType); + }, a => a.CustomerType == custoType.CustomerType); + return new BaseOutputDto { StatusCode = result ? StatusCodeConstants.Success : StatusCodeConstants.InternalServerError }; } #endregion @@ -597,22 +676,38 @@ namespace EOM.TSHotelManagement.Application /// 查询所有证件类型(可用) /// /// - public List SelectPassPortTypeAllCanUse() + public ListOutputDto SelectPassPortTypeAllCanUse() { - List passPortTypes = new List(); - passPortTypes = passPortTypeRepository.GetList(a => a.IsDelete != 1); - return passPortTypes; + var passPortTypes = passPortTypeRepository.GetList(a => a.IsDelete != 1); + var result = EntityMapper.MapList(passPortTypes); + return new ListOutputDto { listSource = result, total = result.Count }; } /// /// 查询所有证件类型 /// /// - public List SelectPassPortTypeAll() + public ListOutputDto SelectPassPortTypeAll(ReadPassportTypeInputDto readPassportTypeInputDto) { - List passPortTypes = new List(); - passPortTypes = passPortTypeRepository.GetList(); - return passPortTypes; + var where = Expressionable.Create(); + if (!readPassportTypeInputDto.IsDelete.IsNullOrEmpty()) + { + where = where.And(a => a.IsDelete == readPassportTypeInputDto.IsDelete); + } + var count = 0; + var passPortTypes = new List(); + + if (!readPassportTypeInputDto.IgnorePaging && readPassportTypeInputDto.Page != 0 && readPassportTypeInputDto.PageSize != 0) + { + passPortTypes = passPortTypeRepository.AsQueryable().Where(where.ToExpression()).ToPageList(readPassportTypeInputDto.Page, readPassportTypeInputDto.PageSize, ref count); + } + else + { + passPortTypes = passPortTypeRepository.AsQueryable().Where(where.ToExpression()).ToList(); + } + + var result = EntityMapper.MapList(passPortTypes); + return new ListOutputDto { listSource = result, total = count }; } /// @@ -620,11 +715,11 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public PassPortType SelectPassPortTypeByTypeId(PassPortType passPortType) + public SingleOutputDto SelectPassPortTypeByTypeId(ReadPassportTypeInputDto passPortType) { - PassPortType passPortType1 = new PassPortType(); - passPortType1 = passPortTypeRepository.GetSingle(a => a.PassportId == passPortType.PassportId && a.IsDelete != 1); - return passPortType1; + var passPortTypeEntity = passPortTypeRepository.GetSingle(a => a.PassportId == passPortType.PassportId && a.IsDelete != 1); + var result = EntityMapper.Map(passPortTypeEntity); + return new SingleOutputDto { Source = result }; } /// @@ -632,9 +727,11 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool InsertPassPortType(PassPortType passPortType) + public BaseOutputDto InsertPassPortType(CreatePassportTypeInputDto passPortType) { - return passPortTypeRepository.Insert(passPortType); + var passPortTypeEntity = EntityMapper.Map(passPortType); + var result = passPortTypeRepository.Insert(passPortTypeEntity); + return new BaseOutputDto { StatusCode = result ? StatusCodeConstants.Success : StatusCodeConstants.InternalServerError }; } /// @@ -642,13 +739,14 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool DeletePassPortType(PassPortType portType) + public BaseOutputDto DeletePassPortType(DeletePassportTypeInputDto portType) { - return passPortTypeRepository.Update(a => new PassPortType() + var result = passPortTypeRepository.Update(a => new PassportType() { IsDelete = 1, DataChgUsr = portType.DataChgUsr, }, a => a.PassportId == portType.PassportId); + return new BaseOutputDto { StatusCode = result ? StatusCodeConstants.Success : StatusCodeConstants.InternalServerError }; } /// @@ -656,14 +754,15 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool UpdatePassPortType(PassPortType portType) + public BaseOutputDto UpdatePassPortType(UpdatePassportTypeInputDto portType) { - return passPortTypeRepository.Update(a => new PassPortType() + var result = passPortTypeRepository.Update(a => new PassportType() { PassportName = portType.PassportName, DataChgUsr = portType.DataChgUsr, DataChgDate = portType.DataChgDate }, a => a.PassportId == portType.PassportId); + return new BaseOutputDto { StatusCode = result ? StatusCodeConstants.Success : StatusCodeConstants.InternalServerError }; } #endregion @@ -674,22 +773,38 @@ namespace EOM.TSHotelManagement.Application /// 查询所有奖惩类型(可用) /// /// - public List SelectGBTypeAllCanUse() + public ListOutputDto SelectRewardPunishmentTypeAllCanUse() { - List gBTypes = new List(); - gBTypes = goodbadTypeRepository.GetList(a => a.IsDelete != 1); - return gBTypes; + var gBTypes = goodbadTypeRepository.GetList(a => a.IsDelete != 1); + var result = EntityMapper.MapList(gBTypes); + return new ListOutputDto { listSource = result, total = result.Count }; } /// /// 查询所有奖惩类型 /// /// - public List SelectGBTypeAll() + public ListOutputDto SelectRewardPunishmentTypeAll(ReadRewardPunishmentTypeInputDto readRewardPunishmentTypeInputDto) { - List gBTypes = new List(); - gBTypes = goodbadTypeRepository.GetList(); - return gBTypes; + var where = Expressionable.Create(); + if (!readRewardPunishmentTypeInputDto.IsDelete.IsNullOrEmpty()) + { + where = where.And(a => a.IsDelete == readRewardPunishmentTypeInputDto.IsDelete); + } + var count = 0; + var gBTypes = new List(); + + if (!readRewardPunishmentTypeInputDto.IgnorePaging && readRewardPunishmentTypeInputDto.Page != 0 && readRewardPunishmentTypeInputDto.PageSize != 0) + { + gBTypes = goodbadTypeRepository.AsQueryable().Where(where.ToExpression()).ToPageList(readRewardPunishmentTypeInputDto.Page, readRewardPunishmentTypeInputDto.PageSize, ref count); + } + else + { + gBTypes = goodbadTypeRepository.AsQueryable().Where(where.ToExpression()).ToList(); + } + + var result = EntityMapper.MapList(gBTypes); + return new ListOutputDto { listSource = result, total = count }; } /// @@ -697,11 +812,11 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public GBType SelectGBTypeByTypeId(GBType gBType) + public SingleOutputDto SelectRewardPunishmentTypeByTypeId(ReadRewardPunishmentTypeInputDto gBType) { - GBType gBType1 = new GBType(); - gBType1 = goodbadTypeRepository.GetSingle(a => a.GBTypeId == gBType.GBTypeId && a.IsDelete != 1); - return gBType1; + var gBTypeEntity = goodbadTypeRepository.GetSingle(a => a.RewardPunishmentTypeId == gBType.RewardPunishmentTypeId && a.IsDelete != 1); + var result = EntityMapper.Map(gBTypeEntity); + return new SingleOutputDto { Source = result }; } /// @@ -709,9 +824,11 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool InsertGBType(GBType gBType) + public BaseOutputDto InsertRewardPunishmentType(CreateRewardPunishmentTypeInputDto gBType) { - return goodbadTypeRepository.Insert(gBType); + var gBTypeEntity = EntityMapper.Map(gBType); + var result = goodbadTypeRepository.Insert(gBTypeEntity); + return new BaseOutputDto { StatusCode = result ? StatusCodeConstants.Success : StatusCodeConstants.InternalServerError }; } /// @@ -719,13 +836,14 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool DeleteGBType(GBType gBType) + public BaseOutputDto DeleteRewardPunishmentType(DeleteRewardPunishmentTypeInputDto gBType) { - return goodbadTypeRepository.Update(a => new GBType() + var result = goodbadTypeRepository.Update(a => new RewardPunishmentType() { IsDelete = 1, DataChgUsr = gBType.DataChgUsr, - }, a => a.GBTypeId == gBType.GBTypeId); + }, a => a.RewardPunishmentTypeId == gBType.RewardPunishmentTypeId); + return new BaseOutputDto { StatusCode = result ? StatusCodeConstants.Success : StatusCodeConstants.InternalServerError }; } /// @@ -733,31 +851,32 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool UpdateGBType(GBType gBType) + public BaseOutputDto UpdateRewardPunishmentType(UpdateRewardPunishmentTypeInputDto gBType) { - return goodbadTypeRepository.Update(a => new GBType() + var result = goodbadTypeRepository.Update(a => new RewardPunishmentType() { - GBName = gBType.GBName, + RewardPunishmentTypeName = gBType.RewardPunishmentTypeName, DataChgUsr = gBType.DataChgUsr, DataChgDate = gBType.DataChgDate - }, a => a.GBTypeId == gBType.GBTypeId); + }, a => a.RewardPunishmentTypeId == gBType.RewardPunishmentTypeId); + return new BaseOutputDto { StatusCode = result ? StatusCodeConstants.Success : StatusCodeConstants.InternalServerError }; } #endregion #region URL模块 + /// /// 基础URL /// /// - public Base GetBase() + public SingleOutputDto GetBase() { - var baseTemp = new Base(); - - baseTemp = baseRepository.GetSingle(a => a.url_no == 1); - - return baseTemp; + var baseTemp = baseRepository.GetSingle(a => a.UrlNumber == 1); + var result = EntityMapper.Map(baseTemp); + return new SingleOutputDto { Source = result }; } + #endregion } } diff --git a/EOM.TSHotelManagement.Application/Zero/Base/IBaseService.cs b/EOM.TSHotelManagement.Application/SystemManagement/Base/IBaseService.cs similarity index 66% rename from EOM.TSHotelManagement.Application/Zero/Base/IBaseService.cs rename to EOM.TSHotelManagement.Application/SystemManagement/Base/IBaseService.cs index 5ef87da0f7a224579daa32ad126eae537064791e..6067d9633a93955068914deb249f917c4cb0c237 100644 --- a/EOM.TSHotelManagement.Application/Zero/Base/IBaseService.cs +++ b/EOM.TSHotelManagement.Application/SystemManagement/Base/IBaseService.cs @@ -21,6 +21,8 @@ *SOFTWARE. * */ +using EOM.TSHotelManagement.Common; +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; namespace EOM.TSHotelManagement.Application @@ -36,35 +38,25 @@ namespace EOM.TSHotelManagement.Application /// 查询所有性别类型 /// /// - List SelectSexTypeAll(SexType sexType = null); + ListOutputDto SelectGenderTypeAll(); - /// - /// 查询性别类型 - /// - /// - SexType SelectSexType(SexType sexType); + #endregion - /// - /// 添加性别类型 - /// - /// - /// - bool AddSexType(SexType sexType); + #region 面貌模块 /// - /// 删除性别类型 + /// 查询所有面貌类型 /// - /// /// - bool DelSexType(SexType sexType); + ListOutputDto SelectWorkerFeatureAll(); + #endregion + #region 房间状态模块 /// - /// 更新性别类型 + /// 获取所有房间状态 /// - /// /// - bool UpdSexType(SexType sexType); - + ListOutputDto SelectRoomStateAll(); #endregion #region 职位模块 @@ -73,34 +65,34 @@ namespace EOM.TSHotelManagement.Application /// 查询所有职位类型 /// /// - List SelectPositionAll(Position position = null); + ListOutputDto SelectPositionAll(ReadPositionInputDto position = null); /// /// 查询职位类型 /// /// - Position SelectPosition(Position position); + SingleOutputDto SelectPosition(ReadPositionInputDto position); /// /// 添加职位类型 /// /// /// - bool AddPosition(Position position); + BaseOutputDto AddPosition(CreatePositionInputDto position); /// /// 删除职位类型 /// /// /// - bool DelPosition(Position position); + BaseOutputDto DelPosition(DeletePositionInputDto position); /// /// 更新职位类型 /// /// /// - bool UpdPosition(Position position); + BaseOutputDto UpdPosition(UpdatePositionInputDto position); #endregion @@ -110,34 +102,34 @@ namespace EOM.TSHotelManagement.Application /// 查询所有民族类型 /// /// - List SelectNationAll(Nation nation = null); + ListOutputDto SelectNationAll(ReadNationInputDto nation = null); /// /// 查询民族类型 /// /// - Nation SelectNation(Nation nation); + SingleOutputDto SelectNation(ReadNationInputDto nation); /// /// 添加民族类型 /// /// /// - bool AddNation(Nation nation); + BaseOutputDto AddNation(CreateNationInputDto nation); /// /// 删除民族类型 /// /// /// - bool DelNation(Nation nation); + BaseOutputDto DelNation(DeleteNationInputDto nation); /// /// 更新民族类型 /// /// /// - bool UpdNation(Nation nation); + BaseOutputDto UpdNation(UpdateNationInputDto nation); #endregion @@ -147,34 +139,34 @@ namespace EOM.TSHotelManagement.Application /// 查询所有学历类型 /// /// - List SelectEducationAll(Education education = null); + ListOutputDto SelectEducationAll(ReadEducationInputDto education = null); /// /// 查询学历类型 /// /// - Education SelectEducation(Education education); + SingleOutputDto SelectEducation(ReadEducationInputDto education); /// /// 添加学历类型 /// /// /// - bool AddEducation(Education education); + BaseOutputDto AddEducation(CreateEducationInputDto education); /// /// 删除学历类型 /// /// /// - bool DelEducation(Education education); + BaseOutputDto DelEducation(DeleteEducationInputDto education); /// /// 更新学历类型 /// /// /// - bool UpdEducation(Education education); + BaseOutputDto UpdEducation(UpdateEducationInputDto education); #endregion @@ -184,40 +176,40 @@ namespace EOM.TSHotelManagement.Application /// 查询所有部门类型(可用) /// /// - List SelectDeptAllCanUse(); + ListOutputDto SelectDeptAllCanUse(); /// /// 查询所有部门类型 /// /// - List SelectDeptAll(); + ListOutputDto SelectDeptAll(ReadDepartmentInputDto readDepartmentInputDto); /// /// 查询部门类型 /// /// - Dept SelectDept(Dept dept); + SingleOutputDto SelectDept(ReadDepartmentInputDto dept); /// /// 添加部门类型 /// /// /// - bool AddDept(Dept dept); + BaseOutputDto AddDept(CreateDepartmentInputDto dept); /// /// 删除部门类型 /// /// /// - bool DelDept(Dept dept); + BaseOutputDto DelDept(DeleteDepartmentInputDto dept); /// /// 更新部门类型 /// /// /// - bool UpdDept(Dept dept); + BaseOutputDto UpdDept(UpdateDepartmentInputDto dept); #endregion @@ -227,41 +219,41 @@ namespace EOM.TSHotelManagement.Application /// 查询所有客户类型(可用) /// /// - List SelectCustoTypeAllCanUse(); + ListOutputDto SelectCustoTypeAllCanUse(); /// /// 查询所有客户类型 /// /// - List SelectCustoTypeAll(); + ListOutputDto SelectCustoTypeAll(ReadCustoTypeInputDto readCustoTypeInputDto); /// /// 根据客户类型ID查询类型名称 /// /// /// - CustoType SelectCustoTypeByTypeId(CustoType custoType); + SingleOutputDto SelectCustoTypeByTypeId(ReadCustoTypeInputDto custoType); /// /// 添加客户类型 /// /// /// - bool InsertCustoType(CustoType custoType); + BaseOutputDto InsertCustoType(CreateCustoTypeInputDto custoType); /// /// 删除客户类型 /// /// /// - bool DeleteCustoType(CustoType custoType); + BaseOutputDto DeleteCustoType(DeleteCustoTypeInputDto custoType); /// /// 更新客户类型 /// /// /// - bool UpdateCustoType(CustoType custoType); + BaseOutputDto UpdateCustoType(UpdateCustoTypeInputDto custoType); #endregion @@ -271,41 +263,41 @@ namespace EOM.TSHotelManagement.Application /// 查询所有证件类型(可用) /// /// - List SelectPassPortTypeAllCanUse(); + ListOutputDto SelectPassPortTypeAllCanUse(); /// /// 查询所有证件类型 /// /// - List SelectPassPortTypeAll(); + ListOutputDto SelectPassPortTypeAll(ReadPassportTypeInputDto readPassportTypeInputDto); /// /// 根据证件类型ID查询类型名称 /// /// /// - PassPortType SelectPassPortTypeByTypeId(PassPortType passPortType); + SingleOutputDto SelectPassPortTypeByTypeId(ReadPassportTypeInputDto passPortType); /// /// 添加证件类型 /// /// /// - bool InsertPassPortType(PassPortType passPortType); + BaseOutputDto InsertPassPortType(CreatePassportTypeInputDto passPortType); /// /// 删除证件类型 /// /// /// - bool DeletePassPortType(PassPortType portType); + BaseOutputDto DeletePassPortType(DeletePassportTypeInputDto portType); /// /// 更新证件类型 /// /// /// - bool UpdatePassPortType(PassPortType portType); + BaseOutputDto UpdatePassPortType(UpdatePassportTypeInputDto portType); #endregion @@ -315,41 +307,41 @@ namespace EOM.TSHotelManagement.Application /// 查询所有证件类型(可用) /// /// - List SelectGBTypeAllCanUse(); + ListOutputDto SelectRewardPunishmentTypeAllCanUse(); /// /// 查询所有奖惩类型 /// /// - List SelectGBTypeAll(); + ListOutputDto SelectRewardPunishmentTypeAll(ReadRewardPunishmentTypeInputDto readRewardPunishmentTypeInputDto); /// /// 根据奖惩类型ID查询类型名称 /// /// /// - GBType SelectGBTypeByTypeId(GBType gBType); + SingleOutputDto SelectRewardPunishmentTypeByTypeId(ReadRewardPunishmentTypeInputDto gBType); /// /// 添加奖惩类型 /// /// /// - bool InsertGBType(GBType gBType); + BaseOutputDto InsertRewardPunishmentType(CreateRewardPunishmentTypeInputDto gBType); /// /// 删除奖惩类型 /// /// /// - bool DeleteGBType(GBType gBType); + BaseOutputDto DeleteRewardPunishmentType(DeleteRewardPunishmentTypeInputDto gBType); /// /// 更新奖惩类型 /// /// /// - bool UpdateGBType(GBType gBType); + BaseOutputDto UpdateRewardPunishmentType(UpdateRewardPunishmentTypeInputDto gBType); #endregion @@ -358,7 +350,7 @@ namespace EOM.TSHotelManagement.Application /// 基础URL /// /// - Base GetBase(); + SingleOutputDto GetBase(); #endregion } } diff --git a/EOM.TSHotelManagement.Application/Zero/Menu/IMenuService.cs b/EOM.TSHotelManagement.Application/SystemManagement/Menu/IMenuService.cs similarity index 83% rename from EOM.TSHotelManagement.Application/Zero/Menu/IMenuService.cs rename to EOM.TSHotelManagement.Application/SystemManagement/Menu/IMenuService.cs index 20b2d671f02e8077a8a38a6bbc0105fb57c0809d..fb0b88d02b309051b45d770bb4b1dd43c750f36f 100644 --- a/EOM.TSHotelManagement.Application/Zero/Menu/IMenuService.cs +++ b/EOM.TSHotelManagement.Application/SystemManagement/Menu/IMenuService.cs @@ -21,6 +21,7 @@ *SOFTWARE. * */ +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; namespace EOM.TSHotelManagement.Application @@ -34,33 +35,33 @@ namespace EOM.TSHotelManagement.Application /// 查询所有菜单信息 /// /// - List SelectMenuAll(); + ListOutputDto SelectMenuAll(ReadMenuInputDto readMenuInputDto); /// /// 构建菜单树 /// /// - List BuildMenuAll(); + List BuildMenuAll(BaseInputDto baseInputDto); /// /// 插入菜单 /// /// /// - bool InsertMenu(Menu menu); + BaseOutputDto InsertMenu(CreateMenuInputDto menu); /// /// 更新菜单 /// /// /// - bool UpdateMenu(Menu menu); + BaseOutputDto UpdateMenu(UpdateMenuInputDto menu); /// /// 删除菜单 /// /// /// - bool DeleteMenu(Menu menu); + BaseOutputDto DeleteMenu(DeleteMenuInputDto menu); } } \ No newline at end of file diff --git a/EOM.TSHotelManagement.Application/Zero/Menu/MenuService.cs b/EOM.TSHotelManagement.Application/SystemManagement/Menu/MenuService.cs similarity index 47% rename from EOM.TSHotelManagement.Application/Zero/Menu/MenuService.cs rename to EOM.TSHotelManagement.Application/SystemManagement/Menu/MenuService.cs index cfb296007c18ce0f618caa5681850c746daa515c..9cbeaf4159d82a0e923b1dfff807b1d7322c102f 100644 --- a/EOM.TSHotelManagement.Application/Zero/Menu/MenuService.cs +++ b/EOM.TSHotelManagement.Application/SystemManagement/Menu/MenuService.cs @@ -21,9 +21,12 @@ *SOFTWARE. * */ +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Util; using EOM.TSHotelManagement.EntityFramework; using jvncorelib.EntityLib; +using SqlSugar; namespace EOM.TSHotelManagement.Application { @@ -37,21 +40,32 @@ namespace EOM.TSHotelManagement.Application /// private readonly GenericRepository menuRepository; + /// + /// JWT助手 + /// + private readonly JWTHelper jWTHelper; + /// /// /// /// - public MenuService(GenericRepository menuRepository) + /// + public MenuService(GenericRepository menuRepository, JWTHelper jWTHelper) { this.menuRepository = menuRepository; + this.jWTHelper = jWTHelper; } /// /// 构建菜单树 /// /// - public List BuildMenuAll() + public List BuildMenuAll(BaseInputDto baseInputDto) { + var token = baseInputDto.UserToken; + + var number = jWTHelper.GetSerialNumber(token); + List allMenus = menuRepository.GetList(a => a.IsDelete != 1).OrderBy(a => a.Id).ToList(); List result = BuildMenuTree(allMenus, null); @@ -63,11 +77,38 @@ namespace EOM.TSHotelManagement.Application /// 查询所有菜单信息 /// /// - public List SelectMenuAll() + public ListOutputDto SelectMenuAll(ReadMenuInputDto readMenuInputDto) { - List allMenus = menuRepository.GetList().ToList(); + var where = Expressionable.Create(); + + if (!readMenuInputDto.IsDelete.IsNullOrEmpty()) + { + where = where.And(a => a.IsDelete == readMenuInputDto.IsDelete); + } + if (readMenuInputDto.SearchParent) + { + where = where.And(a => !a.Parent.HasValue); + } + + var count = 0; + List allMenus = new List(); + + if (!readMenuInputDto.IgnorePaging && readMenuInputDto.Page != 0 && readMenuInputDto.PageSize != 0) + { + allMenus = menuRepository.AsQueryable().Where(where.ToExpression()).ToPageList(readMenuInputDto.Page, readMenuInputDto.PageSize, ref count); + } + else + { + allMenus = menuRepository.AsQueryable().Where(where.ToExpression()).ToList(); + } + + List result = EntityMapper.MapList(allMenus); - return allMenus; + return new ListOutputDto + { + listSource = result, + total = count + }; } /// @@ -75,9 +116,22 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool InsertMenu(Menu menu) + public BaseOutputDto InsertMenu(CreateMenuInputDto menu) { - return menuRepository.Insert(menu); + try + { + if (menuRepository.IsAny(a => a.Key == menu.Key && a.IsDelete == 0)) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString("This menu already exists.", "菜单已存在。"), StatusCode = StatusCodeConstants.InternalServerError }; + } + + menuRepository.Insert(EntityMapper.Map(menu)); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } /// @@ -85,9 +139,17 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool UpdateMenu(Menu menu) + public BaseOutputDto UpdateMenu(UpdateMenuInputDto menu) { - return menuRepository.Update(menu); + try + { + menuRepository.Update(EntityMapper.Map(menu)); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } /// @@ -95,9 +157,17 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool DeleteMenu(Menu menu) + public BaseOutputDto DeleteMenu(DeleteMenuInputDto menu) { - return menuRepository.Delete(menu); + try + { + menuRepository.Update(EntityMapper.Map(menu)); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } /// @@ -116,14 +186,15 @@ namespace EOM.TSHotelManagement.Application { MenuViewModel viewModel = new MenuViewModel { - key = menu.Key, - title = menu.Title, - path = menu.Path, - children = BuildMenuTree(menus, menu.Id) + Key = menu.Key, + Title = menu.Title, + Path = menu.Path, + Icon = menu.Icon, + Children = BuildMenuTree(menus, menu.Id) }; - if (viewModel.children.Count == 0) + if (viewModel.Children.Count == 0) { - viewModel.children = null; + viewModel.Children = null; } result.Add(viewModel); } diff --git a/EOM.TSHotelManagement.Application/Zero/Notice/INoticeService.cs b/EOM.TSHotelManagement.Application/SystemManagement/Notice/INoticeService.cs similarity index 76% rename from EOM.TSHotelManagement.Application/Zero/Notice/INoticeService.cs rename to EOM.TSHotelManagement.Application/SystemManagement/Notice/INoticeService.cs index 235d71110802d04e16931025793063ea7deb622e..c38abc0db490ea43fafb764eed2c319771582cca 100644 --- a/EOM.TSHotelManagement.Application/Zero/Notice/INoticeService.cs +++ b/EOM.TSHotelManagement.Application/SystemManagement/Notice/INoticeService.cs @@ -21,6 +21,7 @@ *SOFTWARE. * */ +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; namespace EOM.TSHotelManagement.Application @@ -35,23 +36,23 @@ namespace EOM.TSHotelManagement.Application /// 获取所有公告信息 /// /// - List SelectNoticeAll(); + ListOutputDto SelectNoticeAll(ReadAppointmentNoticeInputDto readAppointmentNoticeInputDto); #endregion /// /// 查询公告 /// - /// + /// /// - Notice SelectNoticeByNoticeNo(string noticeId); + ReadAppointmentNoticeOutputDto SelectNoticeByNoticeNo(ReadAppointmentNoticeInputDto readAppointmentNoticeInputDto); #region 上传公告信息 /// /// 上传公告信息 /// - /// + /// /// - bool InsertNotice(Notice notice); + BaseOutputDto InsertNotice(CreateAppointmentNoticeInputDto createAppointmentNoticeInputDto); #endregion } diff --git a/EOM.TSHotelManagement.Application/Zero/Notice/NoticeService.cs b/EOM.TSHotelManagement.Application/SystemManagement/Notice/NoticeService.cs similarity index 47% rename from EOM.TSHotelManagement.Application/Zero/Notice/NoticeService.cs rename to EOM.TSHotelManagement.Application/SystemManagement/Notice/NoticeService.cs index d8df1073a3da48934da83948cd35600f80fecfa4..9404dbb47e4bdd4057dd368e6ae63ca7dee5f87f 100644 --- a/EOM.TSHotelManagement.Application/Zero/Notice/NoticeService.cs +++ b/EOM.TSHotelManagement.Application/SystemManagement/Notice/NoticeService.cs @@ -21,8 +21,12 @@ *SOFTWARE. * */ +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Util; using EOM.TSHotelManagement.EntityFramework; +using jvncorelib.EntityLib; +using SqlSugar; namespace EOM.TSHotelManagement.Application { @@ -34,13 +38,13 @@ namespace EOM.TSHotelManagement.Application /// /// 公告 /// - private readonly GenericRepository noticeRepository; + private readonly GenericRepository noticeRepository; /// /// /// /// - public NoticeService(GenericRepository noticeRepository) + public NoticeService(GenericRepository noticeRepository) { this.noticeRepository = noticeRepository; } @@ -50,45 +54,68 @@ namespace EOM.TSHotelManagement.Application /// 获取所有公告信息 /// /// - public List SelectNoticeAll() + public ListOutputDto SelectNoticeAll(ReadAppointmentNoticeInputDto readAppointmentNoticeInputDto) { - List ntc = new List(); - ntc = noticeRepository.GetList(a => a.IsDelete != 1); + List ntc = new List(); + var where = Expressionable.Create(); + if (!string.IsNullOrEmpty(readAppointmentNoticeInputDto.NoticeTheme)) + { + where = where.And(a => a.NoticeTheme.Contains(readAppointmentNoticeInputDto.NoticeTheme)); + } + if (!string.IsNullOrEmpty(readAppointmentNoticeInputDto.NoticeType)) + { + where = where.And(a => a.NoticeType == readAppointmentNoticeInputDto.NoticeType); + } + if (!readAppointmentNoticeInputDto.IsDelete.IsNullOrEmpty()) + { + where = where.And(a => a.IsDelete == readAppointmentNoticeInputDto.IsDelete); + } + var count = 0; + ntc = noticeRepository.AsQueryable().Where(where.ToExpression()).ToPageList(readAppointmentNoticeInputDto.Page, readAppointmentNoticeInputDto.PageSize, ref count); ntc.ForEach(source => { switch (source.NoticeType) { case "PersonnelChanges": - source.NoticeTypeName = "人事变动"; + source.NoticeTypeDescription = "人事变动"; break; case "GeneralNotice": - source.NoticeTypeName = "普通公告"; + source.NoticeTypeDescription = "普通公告"; break; } }); - return ntc; + + var listSource = EntityMapper.MapList(ntc); + + return new ListOutputDto + { + listSource = listSource, + total = listSource.Count + }; } #endregion /// /// 根据公告编号查找公告信息 /// - /// + /// /// - public Notice SelectNoticeByNoticeNo(string noticeId) + public ReadAppointmentNoticeOutputDto SelectNoticeByNoticeNo(ReadAppointmentNoticeInputDto readAppointmentNoticeInputDto) { - Notice notice = new Notice(); - notice = noticeRepository.GetSingle(a => a.NoticeNo == noticeId); + AppointmentNotice notice = new AppointmentNotice(); + notice = noticeRepository.GetSingle(a => a.NoticeNumber == readAppointmentNoticeInputDto.NoticeId); switch (notice.NoticeType) { case "PersonnelChanges": - notice.NoticeTypeName = "人事变动"; + notice.NoticeTypeDescription = "人事变动"; break; case "GeneralNotice": - notice.NoticeTypeName = "普通公告"; + notice.NoticeTypeDescription = "普通公告"; break; } - return notice; + var source = EntityMapper.Map(notice); + + return source; } #region 上传公告信息 @@ -97,9 +124,17 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool InsertNotice(Notice notice) + public BaseOutputDto InsertNotice(CreateAppointmentNoticeInputDto notice) { - return noticeRepository.Insert(notice); + try + { + noticeRepository.Insert(EntityMapper.Map(notice)); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } #endregion diff --git a/EOM.TSHotelManagement.Application/Zero/Module/IAdminModuleZeroService.cs b/EOM.TSHotelManagement.Application/SystemManagement/Role/IRoleAppService.cs similarity index 32% rename from EOM.TSHotelManagement.Application/Zero/Module/IAdminModuleZeroService.cs rename to EOM.TSHotelManagement.Application/SystemManagement/Role/IRoleAppService.cs index c92cf362dfff529258dfcd5a65ff1ef7507dbe64..57c84b22f85e70c13dfa916f0cab250e8113b6bf 100644 --- a/EOM.TSHotelManagement.Application/Zero/Module/IAdminModuleZeroService.cs +++ b/EOM.TSHotelManagement.Application/SystemManagement/Role/IRoleAppService.cs @@ -1,38 +1,40 @@ -using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Contract; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; namespace EOM.TSHotelManagement.Application { /// - /// 管理员模块权限管理接口 + /// 角色服务接口 /// - public interface IAdminModuleZeroService + public interface IRoleAppService { /// - /// 获取所有模块 + /// 查询角色列表 /// + /// /// - List GetAllModule(); - + ListOutputDto SelectRoleList(ReadRoleInputDto readRoleInputDto); /// - /// 根据账号获取对应模块 + /// 添加角色 /// - /// + /// /// - List GetAllModuleByAdmin(Admin admin); - + BaseOutputDto InsertRole(CreateRoleInputDto createRoleInputDto); /// - /// 批量添加模块 + /// 更新角色 /// - /// + /// /// - bool AddModuleZeroList(List moduleZeros); - + BaseOutputDto UpdateRole(UpdateRoleInputDto updateRoleInputDto); /// - /// 批量删除模块 + /// 删除角色 /// - /// + /// /// - bool DelModuleZeroList(ModuleZero moduleZero); - + BaseOutputDto DeleteRole(DeleteRoleInputDto deleteRoleInputDto); } } diff --git a/EOM.TSHotelManagement.Application/SystemManagement/Role/RoleAppService.cs b/EOM.TSHotelManagement.Application/SystemManagement/Role/RoleAppService.cs new file mode 100644 index 0000000000000000000000000000000000000000..a1d88876ac001732bdfbb908b4056b5825284e50 --- /dev/null +++ b/EOM.TSHotelManagement.Application/SystemManagement/Role/RoleAppService.cs @@ -0,0 +1,142 @@ +using EOM.TSHotelManagement.Common.Contract; +using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Util; +using EOM.TSHotelManagement.EntityFramework; +using jvncorelib.EntityLib; +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EOM.TSHotelManagement.Application +{ + /// + /// 角色服务接口 + /// + public class RoleAppService : IRoleAppService + { + /// + /// 角色仓储 + /// + private readonly GenericRepository roleRepository; + + /// + /// + /// + /// + public RoleAppService(GenericRepository roleRepository) + { + this.roleRepository = roleRepository; + } + + /// + /// 删除角色 + /// + /// + /// + /// + public BaseOutputDto DeleteRole(DeleteRoleInputDto deleteRoleInputDto) + { + try + { + roleRepository.Delete(EntityMapper.Map(deleteRoleInputDto)); + } + catch (Exception) + { + return new BaseOutputDto(StatusCodeConstants.InternalServerError, LocalizationHelper.GetLocalizedString("Delete Role Error", "删除角色失败")); + } + return new BaseOutputDto(StatusCodeConstants.Success, LocalizationHelper.GetLocalizedString("Delete Role Success", "删除角色成功")); + } + + /// + /// 查询角色列表 + /// + /// + /// + /// + public ListOutputDto SelectRoleList(ReadRoleInputDto readRoleInputDto) + { + var where = Expressionable.Create(); + + if (!readRoleInputDto.RoleNumber.IsNullOrEmpty()) + { + where = where.And(x => x.RoleNumber.Contains(readRoleInputDto.RoleNumber)); + } + if (!readRoleInputDto.RoleName.IsNullOrEmpty()) + { + where = where.And(x => x.RoleName.Contains(readRoleInputDto.RoleName)); + } + if (!readRoleInputDto.RoleDescription.IsNullOrEmpty()) + { + where = where.And(x => x.RoleDescription.Contains(readRoleInputDto.RoleDescription)); + } + if (!readRoleInputDto.IsDelete.IsNullOrEmpty()) + { + where = where.And(x => x.IsDelete == readRoleInputDto.IsDelete); + } + + var roles = new List(); + + var count = 0; + + if (!readRoleInputDto.IgnorePaging && readRoleInputDto.Page != 0 && readRoleInputDto.PageSize != 0) + { + roles = roleRepository.AsQueryable().Where(where.ToExpression()).ToPageList(readRoleInputDto.Page, readRoleInputDto.PageSize, ref count); + } + else + { + roles = roleRepository.AsQueryable().Where(where.ToExpression()).ToList(); + } + + var roleList = EntityMapper.MapList(roles); + + var listOutputDto = new ListOutputDto + { + total = count, + listSource = roleList + }; + + return listOutputDto; + } + + /// + /// 添加角色 + /// + /// + /// + /// + public BaseOutputDto InsertRole(CreateRoleInputDto createRoleInputDto) + { + try + { + roleRepository.Insert(EntityMapper.Map(createRoleInputDto)); + } + catch (Exception) + { + return new BaseOutputDto(StatusCodeConstants.InternalServerError, LocalizationHelper.GetLocalizedString("Create Role Error", "创建角色失败")); + } + return new BaseOutputDto(StatusCodeConstants.Success, LocalizationHelper.GetLocalizedString("Create Role Success", "创建角色成功")); + } + + /// + /// 更新角色 + /// + /// + /// + /// + public BaseOutputDto UpdateRole(UpdateRoleInputDto updateRoleInputDto) + { + try + { + roleRepository.Update(EntityMapper.Map(updateRoleInputDto)); + } + catch (Exception) + { + return new BaseOutputDto(StatusCodeConstants.InternalServerError, LocalizationHelper.GetLocalizedString("Update Role Error", "更新角色失败")); + } + return new BaseOutputDto(StatusCodeConstants.Success, LocalizationHelper.GetLocalizedString("Update Role Success", "更新角色成功")); + } + } +} diff --git a/EOM.TSHotelManagement.Application/Zero/CheckInfo/ICheckInfoService.cs b/EOM.TSHotelManagement.Application/SystemManagement/SupervisionStatistics/ISupervisionStatisticsService.cs similarity index 77% rename from EOM.TSHotelManagement.Application/Zero/CheckInfo/ICheckInfoService.cs rename to EOM.TSHotelManagement.Application/SystemManagement/SupervisionStatistics/ISupervisionStatisticsService.cs index b23627090640593270c0c966b70a6665eef7e8c0..1b8c02ffd551b5e12af576a709236438a9996235 100644 --- a/EOM.TSHotelManagement.Application/Zero/CheckInfo/ICheckInfoService.cs +++ b/EOM.TSHotelManagement.Application/SystemManagement/SupervisionStatistics/ISupervisionStatisticsService.cs @@ -21,6 +21,7 @@ *SOFTWARE. * */ +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; namespace EOM.TSHotelManagement.Application @@ -28,33 +29,33 @@ namespace EOM.TSHotelManagement.Application /// /// 监管统计接口 /// - public interface ICheckInfoService + public interface ISupervisionStatisticsService { /// /// 查询所有监管统计信息 /// /// - List SelectCheckInfoAll(); + ListOutputDto SelectSupervisionStatisticsAll(ReadSupervisionStatisticsInputDto readSupervisionStatisticsInputDto); /// /// 插入监管统计信息 /// /// /// - bool InsertCheckInfo(CheckInfo checkInfo); + BaseOutputDto InsertSupervisionStatistics(CreateSupervisionStatisticsInputDto checkInfo); /// /// 更新监管统计信息 /// /// /// - bool UpdateCheckInfo(CheckInfo checkInfo); + BaseOutputDto UpdateSupervisionStatistics(UpdateSupervisionStatisticsInputDto checkInfo); /// /// 删除监管统计信息 /// /// /// - bool DeleteCheckInfo(CheckInfo checkInfo); + BaseOutputDto DeleteSupervisionStatistics(DeleteSupervisionStatisticsInputDto checkInfo); } } \ No newline at end of file diff --git a/EOM.TSHotelManagement.Application/Zero/CheckInfo/CheckInfoService.cs b/EOM.TSHotelManagement.Application/SystemManagement/SupervisionStatistics/SupervisionStatisticsService.cs similarity index 36% rename from EOM.TSHotelManagement.Application/Zero/CheckInfo/CheckInfoService.cs rename to EOM.TSHotelManagement.Application/SystemManagement/SupervisionStatistics/SupervisionStatisticsService.cs index 4a46bab0755cf7365e6c374e8ba9ddb5826cc082..42344a6ae6cbd6edcb13247da81782706832fc90 100644 --- a/EOM.TSHotelManagement.Application/Zero/CheckInfo/CheckInfoService.cs +++ b/EOM.TSHotelManagement.Application/SystemManagement/SupervisionStatistics/SupervisionStatisticsService.cs @@ -21,27 +21,30 @@ *SOFTWARE. * */ +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Util; using EOM.TSHotelManagement.EntityFramework; using jvncorelib.EntityLib; +using SqlSugar; namespace EOM.TSHotelManagement.Application { /// /// 监管统计接口实现类 /// - public class CheckInfoService : ICheckInfoService + public class SupervisionStatisticsService : ISupervisionStatisticsService { /// /// 监管统计 /// - private readonly GenericRepository checkInfoRepository; + private readonly GenericRepository checkInfoRepository; /// /// /// /// - public CheckInfoService(GenericRepository checkInfoRepository) + public SupervisionStatisticsService(GenericRepository checkInfoRepository) { this.checkInfoRepository = checkInfoRepository; } @@ -50,18 +53,30 @@ namespace EOM.TSHotelManagement.Application /// 查询所有监管统计信息 /// /// - public List SelectCheckInfoAll() + public ListOutputDto SelectSupervisionStatisticsAll(ReadSupervisionStatisticsInputDto readSupervisionStatisticsInputDto) { - List cif = new List(); - cif = checkInfoRepository.GetList(a => a.IsDelete != 1); - var deptId = cif.Select(a => a.CheckClub).ToList(); - var depts = checkInfoRepository.Change().GetList(a => deptId.Contains(a.dept_no)); + List cif = new List(); + + var where = Expressionable.Create(); + + where = where.And(a => a.IsDelete == readSupervisionStatisticsInputDto.IsDelete); + var count = 0; + cif = checkInfoRepository.AsQueryable().Where(where.ToExpression()).ToPageList(readSupervisionStatisticsInputDto.Page, readSupervisionStatisticsInputDto.PageSize, ref count); + var deptId = cif.Select(a => a.SupervisingDepartment).ToList(); + var depts = checkInfoRepository.Change().GetList(a => deptId.Contains(a.DepartmentNumber)); cif.ForEach(c => { - var dept = depts.SingleOrDefault(a => a.dept_no == c.CheckClub); - c.CheckClubName = !dept.IsNullOrEmpty() ? dept.dept_name : string.Empty; + var dept = depts.SingleOrDefault(a => a.DepartmentNumber == c.SupervisingDepartment); + c.SupervisingDepartmentName = !dept.IsNullOrEmpty() ? dept.DepartmentName : string.Empty; }); - return cif; + + var listSource = EntityMapper.MapList(cif); + + return new ListOutputDto + { + listSource = listSource, + total = listSource.Count + }; } /// @@ -69,9 +84,17 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool InsertCheckInfo(CheckInfo checkInfo) + public BaseOutputDto InsertSupervisionStatistics(CreateSupervisionStatisticsInputDto checkInfo) { - return checkInfoRepository.Insert(checkInfo); + try + { + checkInfoRepository.Insert(EntityMapper.Map(checkInfo)); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } /// @@ -79,20 +102,28 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool UpdateCheckInfo(CheckInfo checkInfo) + public BaseOutputDto UpdateSupervisionStatistics(UpdateSupervisionStatisticsInputDto checkInfo) { - return checkInfoRepository.Update(a => new CheckInfo + try { - CheckClub = checkInfo.CheckClub, - CheckCash = checkInfo.CheckCash, - CheckScore = checkInfo.CheckScore, - CheckAdvice = checkInfo.CheckAdvice, - CheckPerson = checkInfo.CheckPerson, - CheckProgres = checkInfo.CheckProgres, - IsDelete = 0, - DataChgUsr = checkInfo.DataChgUsr, - DataChgDate = checkInfo.DataChgDate - },a => a.CheckNo == checkInfo.CheckNo); + checkInfoRepository.Update(a => new SupervisionStatistics + { + SupervisingDepartment = checkInfo.SupervisingDepartment, + SupervisionLoss = checkInfo.SupervisionLoss, + SupervisionScore = checkInfo.SupervisionScore, + SupervisionAdvice = checkInfo.SupervisionAdvice, + SupervisionStatistician = checkInfo.SupervisionStatistician, + SupervisionProgress = checkInfo.SupervisionProgress, + IsDelete = 0, + DataChgUsr = checkInfo.DataChgUsr, + DataChgDate = checkInfo.DataChgDate + }, a => a.StatisticsNumber == checkInfo.StatisticsNumber); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } /// @@ -100,14 +131,22 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool DeleteCheckInfo(CheckInfo checkInfo) + public BaseOutputDto DeleteSupervisionStatistics(DeleteSupervisionStatisticsInputDto checkInfo) { - return checkInfoRepository.Update(a => new CheckInfo + try + { + checkInfoRepository.Update(a => new SupervisionStatistics + { + IsDelete = 1, + DataChgUsr = checkInfo.DataChgUsr, + DataChgDate = checkInfo.DataChgDate + }, a => a.StatisticsNumber == checkInfo.StatisticsNumber); + } + catch (Exception ex) { - IsDelete = 1, - DataChgUsr = checkInfo.DataChgUsr, - DataChgDate = checkInfo.DataChgDate - }, a => a.CheckNo == checkInfo.CheckNo); + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } } } diff --git a/EOM.TSHotelManagement.Application/Zero/VipRule/IVipRuleAppService.cs b/EOM.TSHotelManagement.Application/SystemManagement/VipRule/IVipRuleAppService.cs similarity index 81% rename from EOM.TSHotelManagement.Application/Zero/VipRule/IVipRuleAppService.cs rename to EOM.TSHotelManagement.Application/SystemManagement/VipRule/IVipRuleAppService.cs index 62c5e2172a93a98343c548b1eb7936553c0f9c4e..96deb6142ed70319b6c8fd3cafbc5656f0cd2b1a 100644 --- a/EOM.TSHotelManagement.Application/Zero/VipRule/IVipRuleAppService.cs +++ b/EOM.TSHotelManagement.Application/SystemManagement/VipRule/IVipRuleAppService.cs @@ -22,6 +22,7 @@ * *模块说明:会员等级规则功能模块接口 */ +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; namespace EOM.TSHotelManagement.Application @@ -35,34 +36,34 @@ namespace EOM.TSHotelManagement.Application /// 查询会员等级规则列表 /// /// - List SelectVipRuleList(); + ListOutputDto SelectVipRuleList(ReadVipLevelRuleInputDto readVipLevelRuleInputDto); /// /// 查询会员等级规则 /// /// /// - VipRule SelectVipRule(VipRule vipRule); + SingleOutputDto SelectVipRule(ReadVipLevelRuleInputDto vipRule); /// /// 添加会员等级规则 /// /// /// - bool AddVipRule(VipRule vipRule); + BaseOutputDto AddVipRule(CreateVipLevelRuleInputDto vipRule); /// /// 删除会员等级规则 /// /// /// - bool DelVipRule(VipRule vipRule); + BaseOutputDto DelVipRule(DeleteVipLevelRuleInputDto vipRule); /// /// 更新会员等级规则 /// /// /// - bool UpdVipRule(VipRule vipRule); + BaseOutputDto UpdVipRule(UpdateVipLevelRuleInputDto vipRule); } } diff --git a/EOM.TSHotelManagement.Application/Zero/VipRule/VipRuleAppService.cs b/EOM.TSHotelManagement.Application/SystemManagement/VipRule/VipRuleAppService.cs similarity index 43% rename from EOM.TSHotelManagement.Application/Zero/VipRule/VipRuleAppService.cs rename to EOM.TSHotelManagement.Application/SystemManagement/VipRule/VipRuleAppService.cs index 256dcca7ced16c40bab6b56b24f886da5cf503f8..edb992387674b5b07cf0a78e28dd357f7be0d65d 100644 --- a/EOM.TSHotelManagement.Application/Zero/VipRule/VipRuleAppService.cs +++ b/EOM.TSHotelManagement.Application/SystemManagement/VipRule/VipRuleAppService.cs @@ -21,8 +21,12 @@ *SOFTWARE. * */ +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Util; using EOM.TSHotelManagement.EntityFramework; +using jvncorelib.EntityLib; +using SqlSugar; namespace EOM.TSHotelManagement.Application { @@ -34,7 +38,7 @@ namespace EOM.TSHotelManagement.Application /// /// 会员等级规则 /// - private readonly GenericRepository vipRuleRepository; + private readonly GenericRepository vipRuleRepository; /// /// 客户类型 @@ -46,7 +50,7 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public VipRuleAppService(GenericRepository vipRuleRepository, GenericRepository custoTypeRepository) + public VipRuleAppService(GenericRepository vipRuleRepository, GenericRepository custoTypeRepository) { this.vipRuleRepository = vipRuleRepository; this.custoTypeRepository = custoTypeRepository; @@ -56,23 +60,32 @@ namespace EOM.TSHotelManagement.Application /// 查询会员等级规则列表 /// /// - public List SelectVipRuleList() + public ListOutputDto SelectVipRuleList(ReadVipLevelRuleInputDto readVipLevelRuleInputDto) { - List vipRules = new List(); - - var listSource = vipRuleRepository.GetList(a => a.IsDelete != 1); + List vipRules = new List(); + var where = Expressionable.Create(); + if (!readVipLevelRuleInputDto.IsDelete.IsNullOrEmpty()) + { + where = where.And(a => a.IsDelete == readVipLevelRuleInputDto.IsDelete); + } + var count = 0; + var listSource = vipRuleRepository.AsQueryable().Where(where.ToExpression()).ToPageList(readVipLevelRuleInputDto.Page, readVipLevelRuleInputDto.PageSize, ref count); var listUserType = custoTypeRepository.GetList(a => a.IsDelete != 1); listSource.ForEach(source => { - var userType = listUserType.FirstOrDefault(a => a.UserType == source.TypeId); - source.TypeName = userType == null ? "" : userType.TypeName; + var userType = listUserType.FirstOrDefault(a => a.CustomerType == source.VipLevelId); + source.VipLevelName = userType == null ? "" : userType.CustomerTypeName; }); - vipRules = listSource; + var viprules = EntityMapper.MapList(listSource); - return vipRules; + return new ListOutputDto + { + listSource = viprules, + total = count + }; } /// @@ -80,18 +93,21 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public VipRule SelectVipRule(VipRule vipRule) + public SingleOutputDto SelectVipRule(ReadVipLevelRuleInputDto vipRule) { - VipRule vipRule1 = new VipRule(); + VipLevelRule vipRule1 = new VipLevelRule(); - var source = vipRuleRepository.GetSingle(a => a.RuleId.Equals(vipRule.RuleId)); + var source = vipRuleRepository.GetSingle(a => a.RuleSerialNumber.Equals(vipRule.RuleSerialNumber)); - var userType = custoTypeRepository.GetSingle(a => a.UserType == source.TypeId); - source.TypeName = userType == null ? "" : userType.TypeName; + var userType = custoTypeRepository.GetSingle(a => a.CustomerType == source.VipLevelId); + source.VipLevelName = userType == null ? "" : userType.CustomerTypeName; - vipRule1 = source; + var vipLevel = EntityMapper.Map(source); - return vipRule1; + return new SingleOutputDto + { + Source = vipLevel + }; } /// @@ -99,17 +115,25 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool AddVipRule(VipRule vipRule) + public BaseOutputDto AddVipRule(CreateVipLevelRuleInputDto vipRule) { - return vipRuleRepository.Insert(new VipRule() + try { - RuleId = vipRule.RuleId, - RuleName = vipRule.RuleName, - RuleValue = vipRule.RuleValue, - TypeId = vipRule.TypeId, - IsDelete = 0, - DataInsUsr = vipRule.DataInsUsr, - }); + vipRuleRepository.Insert(new VipLevelRule() + { + RuleSerialNumber = vipRule.RuleSerialNumber, + RuleName = vipRule.RuleName, + RuleValue = vipRule.RuleValue, + VipLevelId = vipRule.VipLevelId, + IsDelete = 0, + DataInsUsr = vipRule.DataInsUsr, + }); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } /// @@ -117,13 +141,21 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool DelVipRule(VipRule vipRule) + public BaseOutputDto DelVipRule(DeleteVipLevelRuleInputDto vipRule) { - return vipRuleRepository.Update(a => new VipRule + try { - IsDelete = 1, - DataChgUsr = vipRule.DataChgUsr, - }, a => a.RuleId == vipRule.RuleId); + vipRuleRepository.Update(a => new VipLevelRule + { + IsDelete = 1, + DataChgUsr = vipRule.DataChgUsr, + }, a => a.RuleSerialNumber == vipRule.RuleSerialNumber); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } /// @@ -131,16 +163,24 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool UpdVipRule(VipRule vipRule) + public BaseOutputDto UpdVipRule(UpdateVipLevelRuleInputDto vipRule) { - return vipRuleRepository.Update(a => new VipRule + try + { + vipRuleRepository.Update(a => new VipLevelRule + { + RuleName = vipRule.RuleName, + RuleValue = vipRule.RuleValue, + IsDelete = vipRule.IsDelete, + DataChgUsr = vipRule.DataChgUsr, + DataChgDate = vipRule.DataChgDate + }, a => a.RuleSerialNumber == vipRule.RuleSerialNumber); + } + catch (Exception ex) { - RuleName = vipRule.RuleName, - RuleValue = vipRule.RuleValue, - IsDelete = vipRule.IsDelete, - DataChgUsr = vipRule.DataChgUsr, - DataChgDate = vipRule.DataChgDate - }, a => a.RuleId == vipRule.RuleId); + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } } } diff --git a/EOM.TSHotelManagement.Application/Util/IUtilService.cs b/EOM.TSHotelManagement.Application/Util/IUtilService.cs index b9fbaf7835a572272c57cc3a81003a297fed3635..c6e79a76a791a02406ebd4967a93d1fe472af726 100644 --- a/EOM.TSHotelManagement.Application/Util/IUtilService.cs +++ b/EOM.TSHotelManagement.Application/Util/IUtilService.cs @@ -1,4 +1,5 @@ -using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Contract; +using EOM.TSHotelManagement.Common.Core; namespace EOM.TSHotelManagement.Application { @@ -10,27 +11,39 @@ namespace EOM.TSHotelManagement.Application /// /// 查询身份证号码 /// - /// + /// /// - string SelectCardCode(string identityCard); + SingleOutputDto SelectCardCode(ReadCardCodeInputDto readCardCodeInputDto); /// /// 检测版本号 /// /// - Applicationversion CheckBaseVersion(); + ReadApplicationVersionOutputDto CheckBaseVersion(); /// /// 添加操作日志 /// /// /// - bool AddLog(OperationLog opr); + BaseOutputDto AddLog(CreateOperationLogInputDto opr); /// /// 查询所有操作日志 /// /// - OSelectAllDto SelectOperationlogAll(int? pageIndex, int? pageSize); + ListOutputDto SelectOperationlogAll(ReadOperationLogInputDto readOperationLogInputDto); + + /// + /// 删除指定时间范围的操作日志 + /// + /// + BaseOutputDto DeleteOperationlogByRange(ReadOperationLogInputDto readOperationLogInputDto); + + /// + /// 删除操作日志 + /// + /// + BaseOutputDto DeleteOperationlog(DeleteOperationLogInputDto deleteOperationLogInputDto); } } diff --git a/EOM.TSHotelManagement.Application/Util/UtilService.cs b/EOM.TSHotelManagement.Application/Util/UtilService.cs index 78e373ae61745cbbd446c8ac7c576bd47c9f1c20..522a2c5f8208f6c9dbc39962f0cbda4d66c1b52d 100644 --- a/EOM.TSHotelManagement.Application/Util/UtilService.cs +++ b/EOM.TSHotelManagement.Application/Util/UtilService.cs @@ -1,5 +1,9 @@ -using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Contract; +using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Util; using EOM.TSHotelManagement.EntityFramework; +using jvncorelib.EntityLib; +using SqlSugar; namespace EOM.TSHotelManagement.Application { @@ -11,12 +15,12 @@ namespace EOM.TSHotelManagement.Application /// /// 卡片代码 /// - private readonly GenericRepository cardCodesRepository; + private readonly GenericRepository cardCodesRepository; /// /// 应用检测 /// - private readonly GenericRepository applicationRepository; + private readonly GenericRepository applicationRepository; /// /// 操作日志 @@ -29,7 +33,7 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public UtilService(GenericRepository cardCodesRepository, GenericRepository applicationRepository, GenericRepository operationLogRepository) + public UtilService(GenericRepository cardCodesRepository, GenericRepository applicationRepository, GenericRepository operationLogRepository) { this.cardCodesRepository = cardCodesRepository; this.applicationRepository = applicationRepository; @@ -39,24 +43,29 @@ namespace EOM.TSHotelManagement.Application /// /// 查询身份证号码 /// - /// + /// /// - public string SelectCardCode(string identityCard) + public SingleOutputDto SelectCardCode(ReadCardCodeInputDto readCardCodeInputDto) { - var cardid = identityCard.Substring(0, 6).ToString(); - var pcd = string.Empty; - var cardcodes = cardCodesRepository.GetSingle(a => a.bm == cardid); - pcd = cardcodes == null ? "" : string.Join(",", cardcodes.Province + cardcodes.City + cardcodes.District); - return pcd; + if (!readCardCodeInputDto.IdentityCardNumber.IsNullOrEmpty()) + { + var cardid = readCardCodeInputDto.IdentityCardNumber.Substring(0, 6).ToString(); + var cardcodes = cardCodesRepository.GetSingle(a => a.AreaCode == cardid); + var source = EntityMapper.Map(cardcodes); + return new SingleOutputDto() { Source = source }; + } + return new SingleOutputDto(); } /// /// 检测版本号 /// /// - public Applicationversion CheckBaseVersion() + public ReadApplicationVersionOutputDto CheckBaseVersion() { - return applicationRepository.GetSingle(a => a.base_versionId == 1); + var source = EntityMapper.Map(applicationRepository.GetSingle(a => a.ApplicationVersionId == 1)); + + return source; } /// @@ -64,35 +73,106 @@ namespace EOM.TSHotelManagement.Application /// /// /// - public bool AddLog(OperationLog opr) + public BaseOutputDto AddLog(CreateOperationLogInputDto opr) { - return operationLogRepository.Insert(opr); + try + { + operationLogRepository.Insert(EntityMapper.Map(opr)); + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); } /// /// 查询所有操作日志 /// /// - public OSelectAllDto SelectOperationlogAll(int? pageIndex, int? pageSize) + public ListOutputDto SelectOperationlogAll(ReadOperationLogInputDto readOperationLogInputDto) { - OSelectAllDto operationLogs = new OSelectAllDto(); + List operationLogs = new List(); + + var where = Expressionable.Create(); + + if (!readOperationLogInputDto.IsDelete.IsNullOrEmpty()) + { + where = where.And(a => a.IsDelete == readOperationLogInputDto.IsDelete); + } + if (!readOperationLogInputDto.LogLevel.IsNullOrEmpty()) + { + if (readOperationLogInputDto.LogLevel.HasValue) + { + where = where.And(a => a.LogLevel == (LogLevel)readOperationLogInputDto.LogLevel.Value); + } + } + var count = 0; - if (pageIndex != 0 && pageSize != 0) + if (readOperationLogInputDto.Page != 0 && readOperationLogInputDto.PageSize != 0) { - operationLogs.listSource = operationLogRepository.AsQueryable().OrderByDescending(a => a.OperationTime).ToPageList((int)pageIndex, (int)pageSize, ref count); + operationLogs = operationLogRepository.AsQueryable().Where(where.ToExpression()).OrderByDescending(a => a.OperationTime).ToPageList(readOperationLogInputDto.Page, readOperationLogInputDto.PageSize, ref count); } else { - operationLogs.listSource = operationLogRepository.AsQueryable().OrderByDescending(a => a.OperationTime).ToList(); + operationLogs = operationLogRepository.AsQueryable().Where(where.ToExpression()).OrderByDescending(a => a.OperationTime).ToList(); } - operationLogs.listSource.ForEach(source => + operationLogs.ForEach(source => { - source.OperationLevelNm = source.OperationLevel == RecordLevel.Normal ? "常规操作" : source.OperationLevel == RecordLevel.Warning ? "敏感操作" : "严重操作"; + source.LogLevelName = source.LogLevel == LogLevel.Normal ? LocalizationHelper.GetLocalizedString("INFO","常规操作") : source.LogLevel == LogLevel.Warning ? LocalizationHelper.GetLocalizedString("WARNING","敏感操作") : LocalizationHelper.GetLocalizedString("ERROR","严重操作"); }); - operationLogs.total = count; - return operationLogs; + var listSource = EntityMapper.MapList(operationLogs); + + return new ListOutputDto { listSource = listSource, total = count }; + } + + /// + /// 删除指定时间范围的操作日志 + /// + /// + public BaseOutputDto DeleteOperationlogByRange(ReadOperationLogInputDto readOperationLogInputDto) + { + try + { + var where = Expressionable.Create(); + + if (readOperationLogInputDto.StartTime != DateTime.MinValue && readOperationLogInputDto.EndTime != DateTime.MinValue) + { + where = where.And(a => a.OperationTime >= readOperationLogInputDto.StartTime && a.OperationTime <= readOperationLogInputDto.EndTime); + } + + var logsToDelete = operationLogRepository.AsQueryable().Where(where.ToExpression()).ToList(); + + if (logsToDelete.Any()) + { + operationLogRepository.Delete(logsToDelete); + } + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto { Message = "操作日志删除成功", StatusCode = StatusCodeConstants.Success }; + } + + /// + /// 删除操作日志 + /// + /// + public BaseOutputDto DeleteOperationlog(DeleteOperationLogInputDto deleteOperationLogInputDto) + { + var result = operationLogRepository.Delete(a => a.OperationId == deleteOperationLogInputDto.OperationId); + + if (result) + { + return new BaseOutputDto(StatusCodeConstants.Success, LocalizationHelper.GetLocalizedString("Delete Operation Log Success", "操作日志删除成功")); + } + else + { + return new BaseOutputDto(StatusCodeConstants.InternalServerError, LocalizationHelper.GetLocalizedString("Delete Operation Log Failed", "操作日志删除失败")); + } } } diff --git a/EOM.TSHotelManagement.Application/Worker/Picture/WorkerPicService.cs b/EOM.TSHotelManagement.Application/Worker/Picture/WorkerPicService.cs deleted file mode 100644 index 2190f3c27929d1c5641fa4254a716f05f858d2eb..0000000000000000000000000000000000000000 --- a/EOM.TSHotelManagement.Application/Worker/Picture/WorkerPicService.cs +++ /dev/null @@ -1,88 +0,0 @@ -using EOM.TSHotelManagement.Common.Core; -using EOM.TSHotelManagement.EntityFramework; -using jvncorelib.EntityLib; - -namespace EOM.TSHotelManagement.Application -{ - /// - /// 员工照片接口实现类 - /// - public class WorkerPicService : IWorkerPicService - { - /// - /// 员工照片 - /// - private readonly GenericRepository workerPicRepository; - - /// - /// 加密 - /// - private readonly jvncorelib.EncryptorLib.EncryptLib encrypt; - - /// - /// - /// - /// - /// - public WorkerPicService(GenericRepository workerPicRepository, jvncorelib.EncryptorLib.EncryptLib encrypt) - { - this.workerPicRepository = workerPicRepository; - this.encrypt = encrypt; - } - - /// - /// 查询员工照片 - /// - /// - /// - public WorkerPic WorkerPic(WorkerPic workerPic) - { - var workerPicSource = new WorkerPic(); - - workerPicSource = workerPicRepository.GetSingle(a => a.WorkerId.Equals(workerPic.WorkerId)); - - if (workerPicSource.IsNullOrEmpty()) - { - return new WorkerPic { Id = 0, Pic = "", WorkerId = workerPic.WorkerId }; - } - - return workerPicSource; - } - /// - /// 添加员工照片 - /// - /// - /// - public bool InsertWorkerPic(WorkerPic workerPic) - { - return workerPicRepository.Insert(new WorkerPic - { - WorkerId = workerPic.WorkerId, - Pic = workerPic.Pic - }); - } - - /// - /// 删除员工照片 - /// - /// - /// - public bool DeleteWorkerPic(WorkerPic workerPic) - { - return workerPicRepository.Delete(a => a.WorkerId.Equals(workerPic.WorkerId)); - } - - /// - /// 更新员工照片 - /// - /// - /// - public bool UpdateWorkerPic(WorkerPic workerPic) - { - return workerPicRepository.Update(a => new WorkerPic - { - Pic = workerPic.Pic - }, a => a.WorkerId.Equals(workerPic.WorkerId)); - } - } -} diff --git a/EOM.TSHotelManagement.Application/Worker/WorkerService.cs b/EOM.TSHotelManagement.Application/Worker/WorkerService.cs deleted file mode 100644 index a4baee611f70e99cca65b16108e9783f65744d06..0000000000000000000000000000000000000000 --- a/EOM.TSHotelManagement.Application/Worker/WorkerService.cs +++ /dev/null @@ -1,364 +0,0 @@ -/* - * MIT License - *Copyright (c) 2021 易开元(Easy-Open-Meta) - - *Permission is hereby granted, free of charge, to any person obtaining a copy - *of this software and associated documentation files (the "Software"), to deal - *in the Software without restriction, including without limitation the rights - *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - *copies of the Software, and to permit persons to whom the Software is - *furnished to do so, subject to the following conditions: - - *The above copyright notice and this permission notice shall be included in all - *copies or substantial portions of the Software. - - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - *SOFTWARE. - * - */ -using EOM.TSHotelManagement.Common.Core; -using EOM.TSHotelManagement.EntityFramework; -using EOM.TSHotelManagement.Shared; -using jvncorelib.EncryptorLib; -using jvncorelib.EntityLib; -using Microsoft.IdentityModel.Tokens; -using SqlSugar; -using System.IdentityModel.Tokens.Jwt; -using System.Security.Claims; -using System.Text; - -namespace EOM.TSHotelManagement.Application -{ - /// - /// 员工信息接口实现类 - /// - /// - /// 构造函数 - /// - /// - /// - /// - /// - /// - /// - /// - /// - public class WorkerService(GenericRepository workerRepository, GenericRepository sexTypeRepository, GenericRepository educationRepository, GenericRepository nationRepository, GenericRepository deptRepository, GenericRepository positionRepository, EncryptLib encrypt, IJwtConfigFactory jwtConfigFactory) : IWorkerService - { - /// - /// 员工信息 - /// - private readonly GenericRepository workerRepository = workerRepository; - - /// - /// 性别类型 - /// - private readonly GenericRepository sexTypeRepository = sexTypeRepository; - - /// - /// 学历类型 - /// - private readonly GenericRepository educationRepository = educationRepository; - - /// - /// 民族类型 - /// - private readonly GenericRepository nationRepository = nationRepository; - - /// - /// 部门 - /// - private readonly GenericRepository deptRepository = deptRepository; - - /// - /// 职务 - /// - private readonly GenericRepository positionRepository = positionRepository; - - /// - /// 加密 - /// - private readonly jvncorelib.EncryptorLib.EncryptLib encrypt = encrypt; - - /// - /// JWT加密 - /// - private readonly IJwtConfigFactory _jwtConfigFactory = jwtConfigFactory; - - #region 修改员工信息 - /// - /// 修改员工信息 - /// - /// - /// - public bool UpdateWorker(Worker worker) - { - //加密联系方式 - var sourceTelStr = string.Empty; - if (!worker.WorkerTel.IsNullOrEmpty()) - { - sourceTelStr = encrypt.Encryption(worker.WorkerTel, EncryptionLevel.Enhanced); - } - //加密身份证 - var sourceIdStr = string.Empty; - if (!worker.CardId.IsNullOrEmpty()) - { - sourceIdStr = encrypt.Encryption(worker.CardId, EncryptionLevel.Enhanced); - } - worker.WorkerTel = sourceTelStr; - worker.CardId = sourceIdStr; - return workerRepository.Update(a => new Worker() - { - WorkerName = worker.WorkerName, - WorkerTel = worker.WorkerTel, - WorkerAddress = worker.WorkerAddress, - WorkerFace = worker.WorkerFace, - WorkerEducation = worker.WorkerEducation, - WorkerNation = worker.WorkerNation, - CardId = worker.CardId, - WorkerSex = worker.WorkerSex, - WorkerBirthday = worker.WorkerBirthday, - DataChgUsr = worker.DataChgUsr - }, a => a.WorkerId.Equals(worker.WorkerId)); - - } - #endregion - - /// - /// 员工账号禁/启用 - /// - /// - /// - public bool ManagerWorkerAccount(Worker worker) - { - return workerRepository.Update(a => new Worker() - { - IsDelete = worker.IsDelete - }, a => a.WorkerId == worker.WorkerId); - } - - /// - /// 更新员工职位和部门 - /// - /// - /// - - public bool UpdateWorkerPositionAndClub(Worker worker) - { - return workerRepository.Update(a => new Worker() - { - WorkerClub = worker.WorkerClub, - WorkerPosition = worker.WorkerPosition, - DataChgUsr = worker.DataChgUsr, - DataChgDate = worker.DataChgDate - }, a => a.WorkerId == worker.WorkerId); - } - - #region 添加员工信息 - /// - /// 添加员工信息 - /// - /// - /// - public bool AddWorker(Worker worker) - { - string NewID = encrypt.Encryption(worker.CardId); - string NewTel = encrypt.Encryption(worker.WorkerTel); - worker.CardId = NewID; - worker.WorkerTel = NewTel; - return workerRepository.Insert(worker); - } - #endregion - - #region 获取所有工作人员信息 - /// - /// 获取所有工作人员信息 - /// - /// - public List SelectWorkerAll() - { - var where = Expressionable.Create(); - - where = where.And(a => a.IsDelete != 1); - - //查询所有教育程度信息 - List educations = new List(); - educations = educationRepository.GetList(a => a.IsDelete != 1); - //查询所有性别类型信息 - List sexTypes = new List(); - sexTypes = sexTypeRepository.GetList(a => a.IsDelete != 1); - //查询所有民族类型信息 - List nations = new List(); - nations = nationRepository.GetList(a => a.IsDelete != 1); - //查询所有部门信息 - List depts = new List(); - depts = deptRepository.GetList(a => a.IsDelete != 1); - //查询所有职位信息 - List positions = new List(); - positions = positionRepository.GetList(a => a.IsDelete != 1); - //查询所有员工信息 - List workers = new List(); - - workers = workerRepository.GetList(where.ToExpression()); - workers.ForEach(source => - { - //解密身份证号码 - var sourceStr = source.CardId.Contains("·") ? encrypt.Decryption(source.CardId) : source.CardId; - source.CardId = sourceStr; - //解密联系方式 - var sourceTelStr = source.WorkerTel.Contains("·") ? encrypt.Decryption(source.WorkerTel) : source.WorkerTel; - source.WorkerTel = sourceTelStr; - //性别类型 - var sexType = sexTypes.FirstOrDefault(a => a.sexId == source.WorkerSex); - source.WorkerSexName = sexType.IsNullOrEmpty() ? "" : sexType.sexName; - //教育程度 - var eduction = educations.FirstOrDefault(a => a.education_no == source.WorkerEducation); - source.EducationName = eduction.IsNullOrEmpty() ? "" : eduction.education_name; - //民族类型 - var nation = nations.FirstOrDefault(a => a.nation_no == source.WorkerNation); - source.NationName = nation.IsNullOrEmpty() ? "" : nation.nation_name; - //部门 - var dept = depts.FirstOrDefault(a => a.dept_no == source.WorkerClub); - source.ClubName = dept.IsNullOrEmpty() ? "" : dept.dept_name; - //职位 - var position = positions.FirstOrDefault(a => a.position_no == source.WorkerPosition); - source.PositionName = position.IsNullOrEmpty() ? "" : position.position_name; - }); - - return workers; - } - - /// - /// 根据部门ID获取工作人员信息 - /// - /// - /// - public bool CheckWorkerBydepartment(string deptNo) - { - var workers = workerRepository.Count(a => a.WorkerClub.Equals(deptNo)); - - return workers > 0 ? true : false; - } - #endregion - - #region 根据登录名称查询员工信息 - /// - /// 根据登录名称查询员工信息 - /// - /// - /// - public Worker SelectWorkerInfoByWorkerId(string workerId) - { - Worker w = new Worker(); - w = workerRepository.GetSingle(a => a.WorkerId == workerId); - //解密身份证号码 - var sourceStr = w.CardId.Contains("·") ? encrypt.Decryption(w.CardId) : w.CardId; - w.CardId = sourceStr; - //解密联系方式 - var sourceTelStr = w.WorkerTel.Contains("·") ? encrypt.Decryption(w.WorkerTel) : w.WorkerTel; - w.WorkerTel = sourceTelStr; - //性别类型 - var sexType = sexTypeRepository.GetSingle(a => a.sexId == w.WorkerSex); - w.WorkerSexName = sexType.sexName.IsNullOrEmpty() ? "" : sexType.sexName; - //教育程度 - var eduction = educationRepository.GetSingle(a => a.education_no == w.WorkerEducation); - w.EducationName = eduction.education_name.IsNullOrEmpty() ? "" : eduction.education_name; - //民族类型 - var nation = nationRepository.GetSingle(a => a.nation_no == w.WorkerNation); - w.NationName = nation.nation_name.IsNullOrEmpty() ? "" : nation.nation_name; - //部门 - var dept = deptRepository.GetSingle(a => a.dept_no == w.WorkerClub); - w.ClubName = dept.dept_name.IsNullOrEmpty() ? "" : dept.dept_name; - //职位 - var position = positionRepository.GetSingle(a => a.position_no == w.WorkerPosition); - w.PositionName = position.position_name.IsNullOrEmpty() ? "" : position.position_name; - return w; - } - #endregion - - #region 根据登录名称、密码查询员工信息 - /// - /// 根据登录名称、密码查询员工信息 - /// - /// - /// - public Worker SelectWorkerInfoByWorkerIdAndWorkerPwd(Worker worker) - { - Worker w = new Worker(); - w = workerRepository.GetSingle(a => a.WorkerId == worker.WorkerId); - if (w == null) - { - w = null; - return w; - } - - var frontEncryed = encrypt.Encryption(w.WorkerPwd, EncryptionLevel.Enhanced); - var backEncryed = encrypt.Encryption(worker.WorkerPwd, EncryptionLevel.Enhanced); - - if (!encrypt.Compare(frontEncryed, backEncryed)) - { - w = null; - return w; - } - w.WorkerPwd = ""; - //性别类型 - var sexType = sexTypeRepository.GetSingle(a => a.sexId == w.WorkerSex); - w.WorkerSexName = sexType.sexName.IsNullOrEmpty() ? "" : sexType.sexName; - //教育程度 - var eduction = educationRepository.GetSingle(a => a.education_no == w.WorkerEducation); - w.EducationName = eduction.education_name.IsNullOrEmpty() ? "" : eduction.education_name; - //民族类型 - var nation = nationRepository.GetSingle(a => a.nation_no == w.WorkerNation); - w.NationName = nation.nation_name.IsNullOrEmpty() ? "" : nation.nation_name; - //部门 - var dept = deptRepository.GetSingle(a => a.dept_no == w.WorkerClub); - w.ClubName = dept.dept_name.IsNullOrEmpty() ? "" : dept.dept_name; - //职位 - var position = positionRepository.GetSingle(a => a.position_no == w.WorkerPosition); - w.PositionName = position.position_name.IsNullOrEmpty() ? "" : position.position_name; - - //附带Token - var jwtConfig = _jwtConfigFactory.GetJwtConfig(); - var tokenHandler = new JwtSecurityTokenHandler(); - var key = Encoding.UTF8.GetBytes(jwtConfig.Key); - var tokenDescriptor = new SecurityTokenDescriptor - { - Subject = new ClaimsIdentity(new Claim[] - { - new Claim(ClaimTypes.Name, w.WorkerId) - }), - Expires = DateTime.Now.AddMinutes(jwtConfig.ExpiryMinutes), - SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(key), SecurityAlgorithms.HmacSha256Signature), - Audience = jwtConfig.Audience, - Issuer = jwtConfig.Issuer - }; - - var token = tokenHandler.CreateToken(tokenDescriptor); - w.UserToken = tokenHandler.WriteToken(token); - - return w; - } - #endregion - - /// - /// 根据员工编号和密码修改密码 - /// - /// - /// - public bool UpdWorkerPwdByWorkNo(Worker worker) - { - string NewPwd = encrypt.Decryption(worker.WorkerPwd); - return workerRepository.Update(a => new Worker() - { - WorkerPwd = NewPwd, - DataChgUsr = worker.DataChgUsr - }, a => a.WorkerId == worker.WorkerId); - } - - } -} diff --git a/EOM.TSHotelManagement.Application/Zero/Admin/AdminService.cs b/EOM.TSHotelManagement.Application/Zero/Admin/AdminService.cs deleted file mode 100644 index 5537151003a82f716d3fe0c0091fedbc98f6b818..0000000000000000000000000000000000000000 --- a/EOM.TSHotelManagement.Application/Zero/Admin/AdminService.cs +++ /dev/null @@ -1,293 +0,0 @@ -/* - * MIT License - *Copyright (c) 2021 易开元(Easy-Open-Meta) - - *Permission is hereby granted, free of charge, to any person obtaining a copy - *of this software and associated documentation files (the "Software"), to deal - *in the Software without restriction, including without limitation the rights - *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - *copies of the Software, and to permit persons to whom the Software is - *furnished to do so, subject to the following conditions: - - *The above copyright notice and this permission notice shall be included in all - *copies or substantial portions of the Software. - - *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - *SOFTWARE. - * - */ -using EOM.TSHotelManagement.Common.Core; -using EOM.TSHotelManagement.Common.Util; -using EOM.TSHotelManagement.EntityFramework; -using EOM.TSHotelManagement.Shared; -using jvncorelib.EncryptorLib; -using jvncorelib.EntityLib; -using Microsoft.IdentityModel.Tokens; -using System.IdentityModel.Tokens.Jwt; -using System.Security.Claims; -using System.Text; - -namespace EOM.TSHotelManagement.Application -{ - /// - /// 管理员数据访问层 - /// - public class AdminService : IAdminService - { - /// - /// 管理员 - /// - private readonly GenericRepository adminRepository; - - /// - /// 管理员类型 - /// - private readonly GenericRepository adminTypeRepository; - - /// - /// 加密 - /// - private readonly jvncorelib.EncryptorLib.EncryptLib encrypt; - - /// - /// JWT加密 - /// - private readonly JWTHelper jWTHelper; - - /// - /// 构造函数 - /// - /// - /// - /// - /// - public AdminService(GenericRepository adminRepository, GenericRepository adminTypeRepository, EncryptLib encrypt, JWTHelper jWTHelper) - { - this.adminRepository = adminRepository; - this.adminTypeRepository = adminTypeRepository; - this.encrypt = encrypt; - this.jWTHelper = jWTHelper; - } - - #region 根据超管密码查询员工类型和权限 - /// - /// 根据超管密码查询员工类型和权限 - /// - /// - /// - public Admin SelectManagerByPass(Admin admin) - { - if (admin == null) - { - throw new ArgumentNullException(nameof(admin)); - } - - var existingAdmin = adminRepository.GetSingle(a => a.AdminAccount == admin.AdminAccount); - - if (existingAdmin == null) - { - return null; - } - - string existingAdminPassword = existingAdmin.AdminPassword; - - if (existingAdminPassword.Contains("·")) - { - if (!encrypt.Compare(admin.AdminPassword, existingAdminPassword)) - { - return null; - } - } - else if (!admin.AdminPassword.Equals(existingAdminPassword)) - { - return null; - } - - if (admin.IsDelete == 1) - { - return null; - } - - existingAdmin.AdminPassword = string.Empty; - - existingAdmin.UserToken = jWTHelper.GenerateJWT(admin.AdminName); - - return existingAdmin; - } - - /// - /// 后台系统登录 - /// - /// - /// - public Admin Login(Admin admin) - { - if (admin == null) - { - throw new ArgumentNullException(nameof(admin)); - } - - var existingAdmin = adminRepository.GetSingle(a => a.AdminAccount == admin.AdminAccount); - - if (existingAdmin == null) - { - return null; - } - - if (existingAdmin.IsDelete == 1) - { - return null; - } - - var encrtptPwd = encrypt.Encryption(admin.AdminPassword, EncryptionLevel.Enhanced); - - if (encrtptPwd.IsNullOrEmpty() || existingAdmin.AdminPassword.IsNullOrEmpty()) - { - return null; - } - - var passed = encrypt.Compare(encrtptPwd, existingAdmin.AdminPassword); - if (!passed) - { - return null; - } - - existingAdmin.AdminPassword = string.Empty; - existingAdmin.UserToken = jWTHelper.GenerateJWT(admin.AdminAccount); - - return existingAdmin; - } - #endregion - - #region 根据超管账号查询对应的密码 - /// - /// 根据超管账号查询对应的密码 - /// - /// - /// - public Admin SelectAdminPwdByAccount(string account) - { - Admin admin = new Admin(); - admin = adminRepository.GetSingle(a => a.AdminAccount == account); - return admin; - } - #endregion - - /// - /// 获取所有管理员列表 - /// - /// - public List GetAllAdminList() - { - var listAdmins = adminRepository.GetList(); - var listAdminType = adminTypeRepository.GetList(a => a.IsDelete != 1); - listAdmins.ForEach(admins => - { - var isAdminType = admins.IsAdmin == 1 ? "是" : "否"; - admins.IsAdminNm = isAdminType; - - var adminType = listAdminType.FirstOrDefault(a => a.type_id.Equals(admins.AdminType)); - admins.TypeName = adminType == null ? "" : adminType.type_name; - - var adminDelete = admins.IsDelete == 1 ? "是" : "否"; - admins.DeleteNm = adminDelete; - - }); - - return listAdmins; - } - - /// - /// 修改密码 - /// - /// - /// - public bool UpdateNewPwdByOldPwd(Admin admin) - { - admin.AdminPassword = encrypt.Encryption(admin.AdminPassword, EncryptionLevel.Enhanced); - return adminRepository.Update(a => new Admin() - { - AdminPassword = admin.AdminPassword - }, a => a.AdminAccount == admin.AdminAccount); - } - - /// - /// 获取管理员列表(已启用) - /// - /// - public List GetAllAdmin() - { - var listAdmin = adminRepository.GetList(a => a.IsDelete != 1); - var listAdminType = adminTypeRepository.GetList(a => a.IsDelete != 1); - listAdmin.ForEach(admin => - { - var isAdminType = admin.IsAdmin == 1 ? "是" : "否"; - admin.IsAdminNm = isAdminType; - - var adminType = listAdminType.FirstOrDefault(a => a.type_id.Equals(admin.AdminType)); - admin.TypeName = adminType == null ? "" : adminType.type_name; - }); - return listAdmin; - } - - /// - /// 添加管理员 - /// - /// - /// - public bool AddAdmin(Admin admin) - { - admin.AdminPassword = encrypt.Encryption(admin.AdminPassword, EncryptionLevel.Enhanced); - bool result = adminRepository.Insert(admin); - return result; - } - - /// - /// 获取管理员信息 - /// - /// - /// - public Admin GetAdminInfoByAdminAccount(Admin admin) - { - var adminInfo = adminRepository.GetSingle(a => a.AdminAccount.Equals(admin.AdminAccount)); - if (adminInfo != null) - { - var adminType = adminTypeRepository.GetSingle(a => a.type_id.Equals(adminInfo.AdminType)); - adminInfo.TypeName = adminType.type_name; - } - return adminInfo; - } - - /// - /// 获取所有管理员类型 - /// - /// - public List GetAllAdminTypes() - { - var listAdminTypes = adminTypeRepository.GetList(a => a.IsDelete != 1); - return listAdminTypes; - } - - /// - /// 更新管理员账户 - /// - /// - /// - public bool UpdAccount(Admin admins) - { - admins.IsDelete = admins.IsDelete == 0 ? 1 : 0; - return adminRepository.Update(a => new Admin() - { - IsDelete = admins.IsDelete, - DataChgDate = admins.DataChgDate - }, a => a.Id == admins.Id); - } - - - } -} diff --git a/EOM.TSHotelManagement.Application/Zero/Module/AdminModuleZeroService.cs b/EOM.TSHotelManagement.Application/Zero/Module/AdminModuleZeroService.cs deleted file mode 100644 index 5a00816430e4b5a6ed7c1719449d271f173d55cf..0000000000000000000000000000000000000000 --- a/EOM.TSHotelManagement.Application/Zero/Module/AdminModuleZeroService.cs +++ /dev/null @@ -1,147 +0,0 @@ -using EOM.TSHotelManagement.Common.Core; -using EOM.TSHotelManagement.EntityFramework; - -namespace EOM.TSHotelManagement.Application -{ - /// - /// 管理员模块权限管理接口实现类 - /// - public class AdminModuleZeroService : IAdminModuleZeroService - { - /// - /// 模块权限 - /// - private readonly GenericRepository moduleZeroRepository; - - /// - /// - /// - /// - public AdminModuleZeroService(GenericRepository moduleZeroRepository) - { - this.moduleZeroRepository = moduleZeroRepository; - } - - /// - /// 获取所有模块 - /// - /// - public List GetAllModule() - { - List modules = moduleZeroRepository.Change().GetList(); - modules.ForEach(source => - { - switch (source.module_name) - { - case ModuleConsts.BaseInfo: - source.module_name = ModuleConsts.BaseInfo + "||" + "基础信息"; - break; - case ModuleConsts.CashInfo: - source.module_name = ModuleConsts.CashInfo + "||" + "财务信息"; - break; - case ModuleConsts.WtiInfo: - source.module_name = ModuleConsts.WtiInfo + "||" + "水电管理"; - break; - case ModuleConsts.CheckInfo: - source.module_name = ModuleConsts.CheckInfo + "||" + "监管统计"; - break; - case ModuleConsts.RoomManager: - source.module_name = ModuleConsts.RoomManager + "||" + "客房管理"; - break; - case ModuleConsts.CustomerManager: - source.module_name = ModuleConsts.CustomerManager + "||" + "客户管理"; - break; - case ModuleConsts.HumanResourcesManager: - source.module_name = ModuleConsts.HumanResourcesManager + "||" + "人事管理"; - break; - case ModuleConsts.MaterialManager: - source.module_name = ModuleConsts.MaterialManager + "||" + "物资管理"; - break; - case ModuleConsts.OperationLogManager: - source.module_name = ModuleConsts.OperationLogManager + "||" + "员工操作日志"; - break; - case ModuleConsts.AdminManager: - source.module_name = ModuleConsts.AdminManager + "||" + "系统管理"; - break; - } - }); - return modules; - } - - /// - /// 根据账号获取对应模块 - /// - /// - /// - public List GetAllModuleByAdmin(Admin admin) - { - List moduleZeros = moduleZeroRepository.GetList(a => a.admin_account.Equals(admin.AdminAccount) - && a.module_enable == 1); - moduleZeros.ForEach(source => - { - switch (source.module_name) - { - case ModuleConsts.BaseInfo: - source.module_name = ModuleConsts.BaseInfo + "||" + "基础信息"; - break; - case ModuleConsts.CashInfo: - source.module_name = ModuleConsts.CashInfo + "||" + "财务信息"; - break; - case ModuleConsts.WtiInfo: - source.module_name = ModuleConsts.WtiInfo + "||" + "水电管理"; - break; - case ModuleConsts.CheckInfo: - source.module_name = ModuleConsts.CheckInfo + "||" + "监管统计"; - break; - case ModuleConsts.RoomManager: - source.module_name = ModuleConsts.RoomManager + "||" + "客房管理"; - break; - case ModuleConsts.CustomerManager: - source.module_name = ModuleConsts.CustomerManager + "||" + "客户管理"; - break; - case ModuleConsts.HumanResourcesManager: - source.module_name = ModuleConsts.HumanResourcesManager + "||" + "人事管理"; - break; - case ModuleConsts.MaterialManager: - source.module_name = ModuleConsts.MaterialManager + "||" + "物资管理"; - break; - case ModuleConsts.OperationLogManager: - source.module_name = ModuleConsts.OperationLogManager + "||" + "员工操作日志"; - break; - case ModuleConsts.AdminManager: - source.module_name = ModuleConsts.AdminManager + "||" + "系统管理"; - break; - } - }); - return moduleZeros; - } - - /// - /// 批量添加模块 - /// - /// - /// - public bool AddModuleZeroList(List moduleZeros) - { - moduleZeros.ForEach(moduleZero => - { - moduleZero.module_name = moduleZero.module_name.Split('|', '|').FirstOrDefault().ToString(); - }); - var result = moduleZeroRepository.InsertRange(moduleZeros); - return result; - } - - /// - /// 批量删除模块 - /// - /// - /// - public bool DelModuleZeroList(ModuleZero moduleZero) - { - var result = moduleZeroRepository.Delete(a => a.admin_account.Equals(moduleZero.admin_account)); - return result; - } - - - } -} diff --git a/EOM.TSHotelManagement.Common.Contract/BaseDto/BaseDto.cs b/EOM.TSHotelManagement.Common.Contract/BaseDto/BaseDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..d1afb156ca61800d8d83bb7cdf839c9ca6095713 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/BaseDto/BaseDto.cs @@ -0,0 +1,12 @@ +using System; + +namespace EOM.TSHotelManagement.Common.Contract +{ + public class BaseDto + { + /// + /// Token + /// + public string UserToken { get; set; } + } +} diff --git a/EOM.TSHotelManagement.Common.Contract/BaseDto/BaseInputDto.cs b/EOM.TSHotelManagement.Common.Contract/BaseDto/BaseInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..ff04582dc80743b61badad5d4779c3afebd16437 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/BaseDto/BaseInputDto.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EOM.TSHotelManagement.Common.Contract +{ + public class BaseInputDto: BaseDto + { + public int Id { get; set; } + /// + /// 删除标识 + /// + public int? IsDelete { get; set; } = 0; + /// + /// 资料创建人 + /// + public string DataInsUsr { get; set; } + /// + /// 资料创建时间 + /// + public DateTime? DataInsDate { get; set; } + /// + /// 资料更新人 + /// + public string DataChgUsr { get; set; } + /// + /// 资料更新时间 + /// + public DateTime? DataChgDate { get; set; } + } +} diff --git a/EOM.TSHotelManagement.Common.Contract/BaseDto/BaseOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/BaseDto/BaseOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..7d1a38003c9fbcb021b4a6caad5fd47ef4b2e33b --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/BaseDto/BaseOutputDto.cs @@ -0,0 +1,42 @@ +using EOM.TSHotelManagement.Common.Util; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EOM.TSHotelManagement.Common.Contract +{ + public class BaseOutputDto + { + /// + /// 状态码,例如 200 表示成功,500 表示服务器错误,400 表示客户端错误等 + /// + public int StatusCode { get; set; } = StatusCodeConstants.Success; + + /// + /// 返回消息,用于描述请求结果 + /// + public string Message { get; set; } = LocalizationHelper.GetLocalizedString("Success","成功"); + + /// + /// + /// + public BaseOutputDto() + { + StatusCode = 200; + Message = LocalizationHelper.GetLocalizedString("Success", "成功"); + } + + /// + /// 带状态码和消息的构造函数 + /// + /// 状态码 + /// 消息 + public BaseOutputDto(int statusCode, string message) + { + StatusCode = statusCode; + Message = message; + } + } +} diff --git a/EOM.TSHotelManagement.Common.Contract/BaseDto/ListInputDto.cs b/EOM.TSHotelManagement.Common.Contract/BaseDto/ListInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..7fb4d65b72471f9688a12cd7d8298a57925980ff --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/BaseDto/ListInputDto.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ListInputDto:BaseInputDto + { + /// + /// 页数 + /// + public int Page { get; set; } = 0; + /// + /// 总数 + /// + public int PageSize { get; set; } = 10; + /// + /// 忽略分页 + /// + public bool IgnorePaging { get; set; } = false; + } +} diff --git a/EOM.TSHotelManagement.Common.Core/OSelectAllDto.cs b/EOM.TSHotelManagement.Common.Contract/BaseDto/ListOutputDto.cs similarity index 88% rename from EOM.TSHotelManagement.Common.Core/OSelectAllDto.cs rename to EOM.TSHotelManagement.Common.Contract/BaseDto/ListOutputDto.cs index 77a1d0f72e20b9fab7d6bb0992259a3b2f0328dd..28f017bdd773f5d88d3905f2da452bd7403e3f1c 100644 --- a/EOM.TSHotelManagement.Common.Core/OSelectAllDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/BaseDto/ListOutputDto.cs @@ -23,13 +23,12 @@ */ using System.Collections.Generic; -namespace EOM.TSHotelManagement.Common.Core +namespace EOM.TSHotelManagement.Common.Contract { /// - /// 查询所有客户信息 - /// 输出DTO + /// 带总数的列表输出Dto /// - public class OSelectAllDto + public class ListOutputDto : BaseOutputDto { /// /// 数据源 @@ -39,6 +38,6 @@ namespace EOM.TSHotelManagement.Common.Core /// /// 总数 /// - public int total { get; set; } + public int total { get; set; } = 0; } } \ No newline at end of file diff --git a/EOM.TSHotelManagement.Common.Contract/BaseDto/SingleOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/BaseDto/SingleOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..fa49ea7401585346428f865872aaa76ba496d3f5 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/BaseDto/SingleOutputDto.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EOM.TSHotelManagement.Common.Contract +{ + public class SingleOutputDto : BaseOutputDto + { + /// + /// 数据源 + /// + public T Source { get; set; } + } +} diff --git a/EOM.TSHotelManagement.Common.Contract/BaseDto/StatusCodeConstants.cs b/EOM.TSHotelManagement.Common.Contract/BaseDto/StatusCodeConstants.cs new file mode 100644 index 0000000000000000000000000000000000000000..0310ee877409f679028fd4ea2f15393dbd3d5179 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/BaseDto/StatusCodeConstants.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EOM.TSHotelManagement.Common.Contract +{ + public static class StatusCodeConstants + { + public const int Success = 200; + public const int Created = 201; + public const int BadRequest = 400; + public const int Unauthorized = 401; + public const int Forbidden = 403; + public const int NotFound = 404; + public const int InternalServerError = 500; + } + +} diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Asset/Dto/Asset/CreateAssetInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Asset/Dto/Asset/CreateAssetInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..18ad7f10cfb5b9ea1c63827bd593840669dfea6b --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Asset/Dto/Asset/CreateAssetInputDto.cs @@ -0,0 +1,14 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateAssetInputDto:BaseInputDto + { + public string AssetNumber { get; set; } + public string AssetName { get; set; } + public decimal AssetValue { get; set; } + public string DepartmentCode { get; set; } + public DateTime AcquisitionDate { get; set; } + public string AssetSource { get; set; } + public string AcquiredByEmployeeId { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Asset/Dto/Asset/DeleteAssetInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Asset/Dto/Asset/DeleteAssetInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..9bd786ceb24630d06528dbf8d12ab82b32255877 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Asset/Dto/Asset/DeleteAssetInputDto.cs @@ -0,0 +1,8 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteAssetInputDto: BaseInputDto + { + public string AssetNumber { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Asset/Dto/Asset/ReadAssetInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Asset/Dto/Asset/ReadAssetInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..cf8ffc96dcd55c6776989fe3aa517608b8578383 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Asset/Dto/Asset/ReadAssetInputDto.cs @@ -0,0 +1,8 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadAssetInputDto: ListInputDto + { + public string AssetNumber { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Asset/Dto/Asset/ReadAssetOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Asset/Dto/Asset/ReadAssetOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..9e5f8dd01970e26837ee60c4a982713361c007f2 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Asset/Dto/Asset/ReadAssetOutputDto.cs @@ -0,0 +1,17 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadAssetOutputDto + { + public string AssetNumber { get; set; } + public string AssetName { get; set; } + public decimal AssetValue { get; set; } + public string AssetValueFormatted { get; set; } + public string DepartmentCode { get; set; } + public string DepartmentName { get; set; } + public DateTime AcquisitionDate { get; set; } + public string AssetSource { get; set; } + public string AcquiredByEmployeeId { get; set; } + public string AcquiredByEmployeeName { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Asset/Dto/Asset/UpdateAssetInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Asset/Dto/Asset/UpdateAssetInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..55b8f9df66fdd40f9915659baf8faabfd9fc2d8f --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Asset/Dto/Asset/UpdateAssetInputDto.cs @@ -0,0 +1,14 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateAssetInputDto: BaseInputDto + { + public string AssetNumber { get; set; } + public string AssetName { get; set; } + public decimal AssetValue { get; set; } + public string DepartmentCode { get; set; } + public DateTime AcquisitionDate { get; set; } + public string AssetSource { get; set; } + public string AcquiredByEmployeeId { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/CustoType/CreateCustoTypeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/CustoType/CreateCustoTypeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..18d3b313b25fbd16afeea43e8d67d3965b3574d0 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/CustoType/CreateCustoTypeInputDto.cs @@ -0,0 +1,16 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateCustoTypeInputDto: BaseInputDto + { + /// + /// ͻ (Customer Type) + /// + public string CustomerType { get; set; } + + /// + /// ͻ (Customer Type Name) + /// + public string CustomerTypeName { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/CustoType/DeleteCustoTypeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/CustoType/DeleteCustoTypeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..3eed652367783084829b0675bbdc594ae1bd47e0 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/CustoType/DeleteCustoTypeInputDto.cs @@ -0,0 +1,8 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteCustoTypeInputDto: BaseInputDto + { + public int CustomerType { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/CustoType/ReadCustoTypeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/CustoType/ReadCustoTypeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..a51fad3387e5700594e10328864f585347534666 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/CustoType/ReadCustoTypeInputDto.cs @@ -0,0 +1,8 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadCustoTypeInputDto:ListInputDto + { + public int CustomerType { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/CustoType/ReadCustoTypeOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/CustoType/ReadCustoTypeOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..1c88010de47d0eec3a216e492ce35afc1f7709e0 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/CustoType/ReadCustoTypeOutputDto.cs @@ -0,0 +1,9 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadCustoTypeOutputDto + { + public int CustomerType { get; set; } + public string CustomerTypeName { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/CustoType/UpdateCustoTypeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/CustoType/UpdateCustoTypeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..41caac015d5b03736e1dbb063f8103d761a87eeb --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/CustoType/UpdateCustoTypeInputDto.cs @@ -0,0 +1,9 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateCustoTypeInputDto: BaseInputDto + { + public int CustomerType { get; set; } + public string CustomerTypeName { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/Customer/CreateCustomerInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/Customer/CreateCustomerInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..ca56c28b41dbc7799c6208fbcfb3a8f601aacf8f --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/Customer/CreateCustomerInputDto.cs @@ -0,0 +1,16 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateCustomerInputDto:BaseInputDto + { + public string CustomerNumber { get; set; } + public string CustomerName { get; set; } + public int? CustomerGender { get; set; } + public int PassportId { get; set; } + public string CustomerPhoneNumber { get; set; } + public DateTime DateOfBirth { get; set; } + public string IdCardNumber { get; set; } + public string CustomerAddress { get; set; } + public int CustomerType { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/Customer/DeleteCustomerInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/Customer/DeleteCustomerInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..c78cf70a1ea27fd15f343d3abea81e0e94918121 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/Customer/DeleteCustomerInputDto.cs @@ -0,0 +1,8 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteCustomerInputDto:BaseInputDto + { + public string CustomerNumber { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/Customer/ReadCustomerInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/Customer/ReadCustomerInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..b22fe5643ff5f7c37c2fcc6425ab60d3b7a38470 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/Customer/ReadCustomerInputDto.cs @@ -0,0 +1,11 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadCustomerInputDto:ListInputDto + { + public string CustomerName { get; set; } + public string CustomerNumber { get; set; } + public string CustomerPhoneNumber { get; set; } + public string IdCardNumber { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/Customer/ReadCustomerOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/Customer/ReadCustomerOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..a937094844462c3fa9a463c8a98bfc5150a8faff --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/Customer/ReadCustomerOutputDto.cs @@ -0,0 +1,34 @@ + +using EOM.TSHotelManagement.Common.Util; + +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadCustomerOutputDto + { + [UIDisplay("ͻ")] + public string CustomerNumber { get; set; } + [UIDisplay("ͻ")] + public string CustomerName { get; set; } + [UIDisplay("Ա", true, false)] + public int? CustomerGender { get; set; } + [UIDisplay("֤", true, false)] + public int PassportId { get; set; } + [UIDisplay("Ա", false, true)] + public string GenderName { get; set; } + [UIDisplay("ϵʽ")] + public string CustomerPhoneNumber { get; set; } + [UIDisplay("")] + public DateTime DateOfBirth { get; set; } + [UIDisplay("ͻ", true, false)] + public int CustomerType { get; set; } + [UIDisplay("ͻ", false, true)] + public string CustomerTypeName { get; set; } + [UIDisplay("֤", false, true)] + public string PassportName { get; set; } + [UIDisplay("֤")] + public string IdCardNumber { get; set; } + [UIDisplay("ͻַ")] + public string CustomerAddress { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/Customer/UpdateCustomerInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/Customer/UpdateCustomerInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..c87a5da782aeb5f0e2543366acb855c279ac7bca --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/Customer/UpdateCustomerInputDto.cs @@ -0,0 +1,16 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateCustomerInputDto: BaseInputDto + { + public string CustomerNumber { get; set; } + public string CustomerName { get; set; } + public int? CustomerGender { get; set; } + public int PassportId { get; set; } + public string CustomerPhoneNumber { get; set; } + public DateTime DateOfBirth { get; set; } + public string IdCardNumber { get; set; } + public string CustomerAddress { get; set; } + public int CustomerType { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/GenderType/CreateGenderTypeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/GenderType/CreateGenderTypeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..9315a2ae866a04e9a9704427b27bafa76ce10d9e --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/GenderType/CreateGenderTypeInputDto.cs @@ -0,0 +1,8 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateGenderTypeInputDto: BaseInputDto + { + public string GenderName { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/GenderType/DeleteGenderTypeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/GenderType/DeleteGenderTypeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..1805d1cd1247145dd4cc011e4bb07b40c07d2c9f --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/GenderType/DeleteGenderTypeInputDto.cs @@ -0,0 +1,8 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteGenderTypeInputDto: BaseInputDto + { + public int GenderId { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/GenderType/ReadGenderTypeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/GenderType/ReadGenderTypeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..ad8dfb5c3559999da45ab9218680985ec155f862 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/GenderType/ReadGenderTypeInputDto.cs @@ -0,0 +1,9 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadGenderTypeInputDto:ListInputDto + { + public int GenderId { get; set; } + public string GenderName { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/GenderType/ReadGenderTypeOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/GenderType/ReadGenderTypeOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..3c5c99b52479a41ea7a5481b57581ad5e8f2d561 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/GenderType/ReadGenderTypeOutputDto.cs @@ -0,0 +1,9 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadGenderTypeOutputDto + { + public int GenderId { get; set; } + public string GenderName { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/GenderType/UpdateGenderTypeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/GenderType/UpdateGenderTypeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..eb173c97b07b048ce48046a6550c6d5f9d9c7894 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/GenderType/UpdateGenderTypeInputDto.cs @@ -0,0 +1,9 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateGenderTypeInputDto: BaseInputDto + { + public int GenderId { get; set; } + public string GenderName { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/PassportType/CreatePassportTypeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/PassportType/CreatePassportTypeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..df95dd1bbc3056ece74251cb9d9c2e776a9b826c --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/PassportType/CreatePassportTypeInputDto.cs @@ -0,0 +1,9 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreatePassportTypeInputDto: BaseInputDto + { + public int PassportId { get; set; } + public string PassportName { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/PassportType/DeletePassportTypeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/PassportType/DeletePassportTypeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..f62c6fd32371138a74ac0049bf1d014abda20993 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/PassportType/DeletePassportTypeInputDto.cs @@ -0,0 +1,8 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeletePassportTypeInputDto: BaseInputDto + { + public int PassportId { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/PassportType/ReadPassportTypeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/PassportType/ReadPassportTypeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..f10f8fd25187ecb4fe1fcfc7a7b7e756892244af --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/PassportType/ReadPassportTypeInputDto.cs @@ -0,0 +1,8 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadPassportTypeInputDto:ListInputDto + { + public int PassportId { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/PassportType/ReadPassportTypeOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/PassportType/ReadPassportTypeOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..8d6c070d332754d208661bb0204de6a8bf355b2f --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/PassportType/ReadPassportTypeOutputDto.cs @@ -0,0 +1,9 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadPassportTypeOutputDto + { + public int PassportId { get; set; } + public string PassportName { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/PassportType/UpdatePassportTypeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/PassportType/UpdatePassportTypeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..b027d5dd07bf81e03f569ad62f4d987080c1ea71 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/PassportType/UpdatePassportTypeInputDto.cs @@ -0,0 +1,9 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdatePassportTypeInputDto: BaseInputDto + { + public int PassportId { get; set; } + public string PassportName { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/EnergyManagement/Dto/CreateEnergyManagementInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/EnergyManagement/Dto/CreateEnergyManagementInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..5ead7fd5a171f25b3bdc47a96fd0e9299d0677c7 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/EnergyManagement/Dto/CreateEnergyManagementInputDto.cs @@ -0,0 +1,15 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateEnergyManagementInputDto : BaseInputDto + { + public string InformationNumber { get; set; } + public string RoomNumber { get; set; } + public string CustomerNumber { get; set; } + public DateTime StartDate { get; set; } + public DateTime EndDate { get; set; } + public decimal PowerUsage { get; set; } + public decimal WaterUsage { get; set; } + public string Recorder { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/EnergyManagement/Dto/DeleteEnergyManagementInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/EnergyManagement/Dto/DeleteEnergyManagementInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..85c2de8a499330ef873a4e3da214592764e3bd46 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/EnergyManagement/Dto/DeleteEnergyManagementInputDto.cs @@ -0,0 +1,8 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteEnergyManagementInputDto: BaseInputDto + { + public int InformationId { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/EnergyManagement/Dto/ReadEnergyManagementInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/EnergyManagement/Dto/ReadEnergyManagementInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..025458784ee87b54e9dea63ebbd088e78e1bf6a3 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/EnergyManagement/Dto/ReadEnergyManagementInputDto.cs @@ -0,0 +1,11 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadEnergyManagementInputDto:ListInputDto + { + public int InformationId { get; set; } + public string RoomNo { get; set; } + public DateTime? UseDate { get; set; } + public DateTime? EndDate { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/EnergyManagement/Dto/ReadEnergyManagementOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/EnergyManagement/Dto/ReadEnergyManagementOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..9c526a211d4b26d22c55ef12c8cc975677c3be9e --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/EnergyManagement/Dto/ReadEnergyManagementOutputDto.cs @@ -0,0 +1,15 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadEnergyManagementOutputDto + { + public int InformationId { get; set; } + public string RoomNumber { get; set; } + public string CustomerNumber { get; set; } + public DateTime StartDate { get; set; } + public DateTime EndDate { get; set; } + public decimal PowerUsage { get; set; } + public decimal WaterUsage { get; set; } + public string Recorder { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/EnergyManagement/Dto/UpdateEnergyManagementInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/EnergyManagement/Dto/UpdateEnergyManagementInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..171add6849e1347a66b6cb486e9343af116326b8 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/EnergyManagement/Dto/UpdateEnergyManagementInputDto.cs @@ -0,0 +1,15 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateEnergyManagementInputDto: BaseInputDto + { + public int InformationId { get; set; } + public string RoomNumber { get; set; } + public string CustomerNumber { get; set; } + public DateTime StartDate { get; set; } + public DateTime EndDate { get; set; } + public decimal PowerUsage { get; set; } + public decimal WaterUsage { get; set; } + public string Recorder { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/PromotionContent/Dto/CreatePromotionContentInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/PromotionContent/Dto/CreatePromotionContentInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..f911e22b73f369b2d81a6685b3d660f7af118ece --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/PromotionContent/Dto/CreatePromotionContentInputDto.cs @@ -0,0 +1,11 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreatePromotionContentInputDto: BaseInputDto + { + public string PromotionTitle { get; set; } + public string PromotionContent { get; set; } + public DateTime StartDate { get; set; } + public DateTime EndDate { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/PromotionContent/Dto/DeletePromotionContentInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/PromotionContent/Dto/DeletePromotionContentInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..2a9125910938ae1772a2e0a7733a7c6312624476 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/PromotionContent/Dto/DeletePromotionContentInputDto.cs @@ -0,0 +1,8 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeletePromotionContentInputDto: BaseInputDto + { + public int PromotionId { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/PromotionContent/Dto/ReadPromotionContentInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/PromotionContent/Dto/ReadPromotionContentInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..8d89226fa1d95e544dde2e35c5bebae6abebecfa --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/PromotionContent/Dto/ReadPromotionContentInputDto.cs @@ -0,0 +1,8 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadPromotionContentInputDto:ListInputDto + { + public int PromotionId { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/PromotionContent/Dto/ReadPromotionContentOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/PromotionContent/Dto/ReadPromotionContentOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..9c67d71ad1f91f435d13c4aa0e162a5b52214b08 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/PromotionContent/Dto/ReadPromotionContentOutputDto.cs @@ -0,0 +1,9 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadPromotionContentOutputDto + { + public int PromotionContentId { get; set; } + public string PromotionContentMessage { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/PromotionContent/Dto/UpdatePromotionContentInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/PromotionContent/Dto/UpdatePromotionContentInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..327a636d47a40f31fe3a5ccdde98643b4824d676 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/PromotionContent/Dto/UpdatePromotionContentInputDto.cs @@ -0,0 +1,12 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdatePromotionContentInputDto: BaseInputDto + { + public int PromotionId { get; set; } + public string PromotionTitle { get; set; } + public string PromotionContent { get; set; } + public DateTime StartDate { get; set; } + public DateTime EndDate { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Reser/Dto/CreateReserInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Reser/Dto/CreateReserInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..9a78cbd3fe1dbe836a35d42267f88d1408364080 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Reser/Dto/CreateReserInputDto.cs @@ -0,0 +1,14 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateReserInputDto: BaseInputDto + { + public string ReservationId { get; set; } + public string CustomerName { get; set; } + public string ReservationPhoneNumber { get; set; } + public string ReservationRoomNumber { get; set; } + public string ReservationChannel { get; set; } + public DateTime ReservationStartDate { get; set; } + public DateTime ReservationEndDate { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Reser/Dto/DeleteReserInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Reser/Dto/DeleteReserInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..9e01050bfc552ba6b198429de22bfeeeb8761ce6 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Reser/Dto/DeleteReserInputDto.cs @@ -0,0 +1,8 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteReserInputDto:BaseInputDto + { + public string ReservationId { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Reser/Dto/ReadReserInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Reser/Dto/ReadReserInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..aed513fcb48631f4f99b17eb5021b26b2ab8da42 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Reser/Dto/ReadReserInputDto.cs @@ -0,0 +1,14 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadReserInputDto:ListInputDto + { + public string ReservationId { get; set; } + public string CustomerName { get; set; } + public string ReservationPhoneNumber { get; set; } + public string ReservationRoomNumber { get; set; } + public string ReservationChannel { get; set; } + public DateTime ReservationStartDate { get; set; } + public DateTime ReservationEndDate { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Reser/Dto/ReadReserOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Reser/Dto/ReadReserOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..8322907cb9e118159c934780b76e6d3d1071b221 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Reser/Dto/ReadReserOutputDto.cs @@ -0,0 +1,23 @@ +using EOM.TSHotelManagement.Common.Util; + +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadReserOutputDto + { + [UIDisplay("ԤԼ")] + public string ReservationId { get; set; } + [UIDisplay("ͻ")] + public string CustomerName { get; set; } + [UIDisplay("ϵʽ")] + public string ReservationPhoneNumber { get; set; } + [UIDisplay("")] + public string ReservationRoomNumber { get; set; } + [UIDisplay("ԤԼ")] + public string ReservationChannel { get; set; } + [UIDisplay("ԤԼʼ")] + public DateTime ReservationStartDate { get; set; } + [UIDisplay("ԤԼֹ")] + public DateTime ReservationEndDate { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Reser/Dto/UpdateReserInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Reser/Dto/UpdateReserInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..92a2d7e9df4ee01813e34130c820bc01797db179 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Reser/Dto/UpdateReserInputDto.cs @@ -0,0 +1,14 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateReserInputDto: BaseInputDto + { + public string ReservationId { get; set; } + public string CustomerName { get; set; } + public string ReservationPhoneNumber { get; set; } + public string ReservationRoomNumber { get; set; } + public string ReservationChannel { get; set; } + public DateTime ReservationStartDate { get; set; } + public DateTime ReservationEndDate { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/Room/CreateRoomInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/Room/CreateRoomInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..908b9c6836d3be036c4b2ccfd301905970abd1d0 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/Room/CreateRoomInputDto.cs @@ -0,0 +1,16 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateRoomInputDto : BaseInputDto + { + public string RoomNumber { get; set; } + public string RoomType { get; set; } + public string CustomerNumber { get; set; } + public DateTime? LastCheckInTime { get; set; } + public DateTime? LastCheckOutTime { get; set; } + public int RoomStateId { get; set; } + public decimal RoomRent { get; set; } + public decimal RoomDeposit { get; set; } + public string RoomLocation { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/Room/DeleteRoomInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/Room/DeleteRoomInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..8fd0dea50a9aa5373c9f5e923c3e510baefe4684 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/Room/DeleteRoomInputDto.cs @@ -0,0 +1,9 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteRoomInputDto : BaseInputDto + { + public string RoomNumber { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/Room/ReadRoomInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/Room/ReadRoomInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..d5a5277f4619d19f631a6e5b39302ad10b6cca50 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/Room/ReadRoomInputDto.cs @@ -0,0 +1,12 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadRoomInputDto : ListInputDto + { + public string RoomNumber { get; set; } + public int RoomStateId { get; set; } + public string RoomTypeName { get; set; } + public DateTime LastCheckInTime { get; set; } + public string CustomerNumber { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/Room/ReadRoomOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/Room/ReadRoomOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..c8544fd69b6d49a7ce17560b3f0c23dcb9503f02 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/Room/ReadRoomOutputDto.cs @@ -0,0 +1,26 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadRoomOutputDto + { + public string RoomNumber { get; set; } + public string RoomName { get; set; } + public int RoomTypeId { get; set; } + public string CustomerNumber { get; set; } + public string CustomerName { get; set; } + public DateTime? LastCheckInTime { get; set; } + public DateTime? LastCheckOutTime { get; set; } + public int RoomStateId { get; set; } + public string RoomState { get; set; } + public decimal RoomRent { get; set; } + public decimal RoomDeposit { get; set; } + public string RoomLocation { get; set; } + + public int StayDays { get; set; } + public int Vacant { get; set; } + public int Occupied { get; set; } + public int Maintenance { get; set; } + public int Dirty { get; set; } + public int Reserved { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/Room/UpdateRoomInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/Room/UpdateRoomInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..e47369fef108da6965c9fc6722c1069e8e3c8ca5 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/Room/UpdateRoomInputDto.cs @@ -0,0 +1,17 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateRoomInputDto : BaseInputDto + { + public string RoomNumber { get; set; } + public string RoomType { get; set; } + public string CustomerNumber { get; set; } + public DateTime? LastCheckInTime { get; set; } + public DateTime? LastCheckOutTime { get; set; } + public int RoomStateId { get; set; } + public decimal RoomRent { get; set; } + public decimal RoomDeposit { get; set; } + public string RoomLocation { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomState/CreateRoomStateInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomState/CreateRoomStateInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..67b3ef0bc8db5bf3a7516e8baa23b0ef6b1a21c9 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomState/CreateRoomStateInputDto.cs @@ -0,0 +1,9 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateRoomStateInputDto: BaseInputDto + { + public string RoomStateName { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomState/DeleteRoomStateInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomState/DeleteRoomStateInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..5d0d46f10f4f11070ceadcf87a07fb59596d2802 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomState/DeleteRoomStateInputDto.cs @@ -0,0 +1,9 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteRoomStateInputDto: BaseInputDto + { + public int RoomStateId { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomState/ReadRoomStateInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomState/ReadRoomStateInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..0c192f5b652db52b4cad83b2e42e391daf4769c7 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomState/ReadRoomStateInputDto.cs @@ -0,0 +1,9 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadRoomStateInputDto:ListInputDto + { + public int RoomStateId { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomState/ReadRoomStateOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomState/ReadRoomStateOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..d9d96daaa6967e64e2a8c79318429ef522894819 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomState/ReadRoomStateOutputDto.cs @@ -0,0 +1,10 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadRoomStateOutputDto + { + public int RoomStateId { get; set; } + public string RoomStateName { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomState/UpdateRoomStateInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomState/UpdateRoomStateInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..a48eea38cf71f9a1a2da283e0e00a3edcd9456ed --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomState/UpdateRoomStateInputDto.cs @@ -0,0 +1,10 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateRoomStateInputDto: BaseInputDto + { + public int RoomStateId { get; set; } + public string RoomStateName { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomType/CreateRoomTypeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomType/CreateRoomTypeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..52d67833101d74f9ee3d9a9de19e7b0a84875b44 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomType/CreateRoomTypeInputDto.cs @@ -0,0 +1,12 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateRoomTypeInputDto: BaseInputDto + { + public int RoomTypeId { get; set; } + public string RoomTypeName { get; set; } + public decimal RoomRent { get; set; } + public decimal RoomDeposit { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomType/DeleteRoomTypeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomType/DeleteRoomTypeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..046819cc73bc3d1364d14d67142e0f2b70980de6 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomType/DeleteRoomTypeInputDto.cs @@ -0,0 +1,9 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteRoomTypeInputDto: BaseInputDto + { + public int RoomTypeId { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomType/ReadRoomTypeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomType/ReadRoomTypeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..e7fc121938449f90d44b7cf88fd920817d7d0ed4 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomType/ReadRoomTypeInputDto.cs @@ -0,0 +1,13 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadRoomTypeInputDto:ListInputDto + { + public string RoomNumber { get; set; } + public int RoomTypeId { get; set; } + public string RoomTypeName { get; set; } + public decimal RoomRent { get; set; } + public decimal RoomDeposit { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomType/ReadRoomTypeOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomType/ReadRoomTypeOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..272b672071089d9bc238d64e49cc307ab24bdd33 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomType/ReadRoomTypeOutputDto.cs @@ -0,0 +1,12 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadRoomTypeOutputDto + { + public int RoomTypeId { get; set; } + public string RoomTypeName { get; set; } + public decimal RoomRent { get; set; } + public decimal RoomDeposit { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomType/UpdateRoomTypeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomType/UpdateRoomTypeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..96165ceca611a18fbed1d5309dd30ca2d67665ac --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomType/UpdateRoomTypeInputDto.cs @@ -0,0 +1,15 @@ +using EOM.TSHotelManagement.Common.Util; +using SqlSugar; + +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateRoomTypeInputDto: BaseInputDto + { + public int RoomTypeId { get; set; } + public string RoomTypeName { get; set; } + public decimal RoomRent { get; set; } + public decimal RoomDeposit { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Sellthing/Dto/CreateSellThingInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Sellthing/Dto/CreateSellThingInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..6ee8f743511a4dfb4f526b2557a6a746d4938c73 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Sellthing/Dto/CreateSellThingInputDto.cs @@ -0,0 +1,13 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateSellThingInputDto: BaseInputDto + { + public string ProductNumber { get; set; } + public string ProductName { get; set; } + public decimal ProductPrice { get; set; } + public string Specification { get; set; } + public decimal Stock { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Sellthing/Dto/DeleteSellThingInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Sellthing/Dto/DeleteSellThingInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..dc47ed7f016d60055061336a9799d737ce64877e --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Sellthing/Dto/DeleteSellThingInputDto.cs @@ -0,0 +1,15 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteSellThingInputDto: BaseInputDto + { + public string RoomNumber { get; set; } + public string CustomerNumber { get; set; } + public string ProductNumber { get; set; } + public string ProductName { get; set; } + public decimal ProductPrice { get; set; } + public string Specification { get; set; } + public decimal Stock { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Sellthing/Dto/ReadSellThingInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Sellthing/Dto/ReadSellThingInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..4d58b83247a5aac972001eb4973dda01b23481a5 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Sellthing/Dto/ReadSellThingInputDto.cs @@ -0,0 +1,13 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadSellThingInputDto:ListInputDto + { + public string ProductNumber { get; set; } + public string ProductName { get; set; } + public decimal ProductPrice { get; set; } + public string Specification { get; set; } + public decimal Stock { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Sellthing/Dto/ReadSellThingOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Sellthing/Dto/ReadSellThingOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..75219d11a0e8e4f7a1e56c1de37054e062f5ca84 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Sellthing/Dto/ReadSellThingOutputDto.cs @@ -0,0 +1,20 @@ +using EOM.TSHotelManagement.Common.Util; + +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadSellThingOutputDto + { + [UIDisplay("Ʒ")] + public string ProductNumber { get; set; } + [UIDisplay("Ʒ")] + public string ProductName { get; set; } + [UIDisplay("Ʒ۸")] + public decimal ProductPrice { get; set; } + [UIDisplay("ͺ")] + public string Specification { get; set; } + [UIDisplay("")] + public decimal Stock { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Sellthing/Dto/UpdateSellThingInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Sellthing/Dto/UpdateSellThingInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..6d824dddcb0d490879a824d14a635ee5cf54798b --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Sellthing/Dto/UpdateSellThingInputDto.cs @@ -0,0 +1,13 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateSellThingInputDto: BaseInputDto + { + public string ProductNumber { get; set; } + public string ProductName { get; set; } + public decimal ProductPrice { get; set; } + public string Specification { get; set; } + public decimal Stock { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Spend/Dto/Spend/CreateSpendInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Spend/Dto/Spend/CreateSpendInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..66a6913b73c4f28c6ee509538bbe495982c85d8f --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Spend/Dto/Spend/CreateSpendInputDto.cs @@ -0,0 +1,16 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateSpendInputDto: BaseInputDto + { + public string SpendNumber { get; set; } + public string RoomNumber { get; set; } + public string CustomerNumber { get; set; } + public string ProductName { get; set; } + public int ConsumptionQuantity { get; set; } + public decimal ProductPrice { get; set; } + public decimal ConsumptionAmount { get; set; } + public DateTime ConsumptionTime { get; set; } + public string SettlementStatus { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Spend/Dto/Spend/DeleteSpendInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Spend/Dto/Spend/DeleteSpendInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..adcf7269bd74e7fe7319da23d9709b8ae1010b26 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Spend/Dto/Spend/DeleteSpendInputDto.cs @@ -0,0 +1,9 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteSpendInputDto: BaseInputDto + { + public string RoomNumber { get; set; } + public string CustomerNumber { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Spend/Dto/Spend/ReadSpendInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Spend/Dto/Spend/ReadSpendInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..cf392ea201ddd8a1df8e371e2d04aa6790a441cd --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Spend/Dto/Spend/ReadSpendInputDto.cs @@ -0,0 +1,16 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadSpendInputDto:ListInputDto + { + public string SpendNumber { get; set; } + public string RoomNumber { get; set; } + public string CustomerNumber { get; set; } + public string ProductName { get; set; } + public int ConsumptionQuantity { get; set; } + public decimal ProductPrice { get; set; } + public decimal ConsumptionAmount { get; set; } + public string SettlementStatus { get; set; } + public DateTime ConsumptionTime { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Spend/Dto/Spend/ReadSpendOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Spend/Dto/Spend/ReadSpendOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..59f64f982656acaeddd7901c9c755d5e05491c80 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Spend/Dto/Spend/ReadSpendOutputDto.cs @@ -0,0 +1,32 @@ +using EOM.TSHotelManagement.Common.Util; + +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadSpendOutputDto + { + [UIDisplay("ѱ", false, false)] + public string SpendNumber { get; set; } + [UIDisplay("")] + public string RoomNumber { get; set; } + [UIDisplay("ͻ")] + public string CustomerNumber { get; set; } + [UIDisplay("Ʒ",false,false)] + public string ProductNumber { get; set; } + [UIDisplay("Ʒ")] + public string ProductName { get; set; } + [UIDisplay("", true)] + public int ConsumptionQuantity { get; set; } + [UIDisplay("Ʒ")] + public decimal ProductPrice { get; set; } + public string ProductPriceFormatted { get; set; } + [UIDisplay("ѽ")] + public decimal ConsumptionAmount { get; set; } + public string ConsumptionAmountFormatted { get; set; } + [UIDisplay("ʱ")] + public DateTime ConsumptionTime { get; set; } + public string SettlementStatus { get; set; } + [UIDisplay("״̬")] + public string SettlementStatusDescription { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Spend/Dto/Spend/UpdateSpendInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Spend/Dto/Spend/UpdateSpendInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..a43b9ab34e04ae2b2da2f6d231dc0e58926afafa --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Spend/Dto/Spend/UpdateSpendInputDto.cs @@ -0,0 +1,16 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateSpendInputDto: BaseInputDto + { + public string SpendNumber { get; set; } + public string RoomNumber { get; set; } + public string CustomerNumber { get; set; } + public string ProductName { get; set; } + public int ConsumptionQuantity { get; set; } + public decimal ProductPrice { get; set; } + public decimal ConsumptionAmount { get; set; } + public DateTime ConsumptionTime { get; set; } + public string SettlementStatus { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/EOM.TSHotelManagement.Common.Contract.csproj b/EOM.TSHotelManagement.Common.Contract/EOM.TSHotelManagement.Common.Contract.csproj new file mode 100644 index 0000000000000000000000000000000000000000..25be56518ede5967a70228c00c032b5dcacec2e8 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/EOM.TSHotelManagement.Common.Contract.csproj @@ -0,0 +1,27 @@ + + + + net8.0 + enable + enable + True + + + + + + + + + + + + + + + + + + + + diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/Employee/CreateEmployeeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/Employee/CreateEmployeeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..45a3ff3c93003d4d13790aa61212478fb19f16a0 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/Employee/CreateEmployeeInputDto.cs @@ -0,0 +1,22 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateEmployeeInputDto: BaseInputDto + { + public string EmployeeId { get; set; } + public string EmployeeName { get; set; } + public int Gender { get; set; } + public DateTime DateOfBirth { get; set; } + public string Ethnicity { get; set; } + public string PhoneNumber { get; set; } + public string Department { get; set; } + public string Address { get; set; } + public string Position { get; set; } + public int IdCardType { get; set; } + public string IdCardNumber { get; set; } + public DateTime HireDate { get; set; } + public string PoliticalAffiliation { get; set; } + public string EducationLevel { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/Employee/DeleteEmployeeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/Employee/DeleteEmployeeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..8e55f709b6899e3b14f6c0a4b73ebe3316db3a0f --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/Employee/DeleteEmployeeInputDto.cs @@ -0,0 +1,9 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteEmployeeInputDto: BaseInputDto + { + public string EmployeeId { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/Employee/ReadEmployeeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/Employee/ReadEmployeeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..bc630024a0518e27dbf8e0d9da45cfd57ebab9ed --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/Employee/ReadEmployeeInputDto.cs @@ -0,0 +1,22 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadEmployeeInputDto:ListInputDto + { + public string EmployeeId { get; set; } + public string EmployeeName { get; set; } + public string Gender { get; set; } + public DateTime DateOfBirth { get; set; } + public string Ethnicity { get; set; } + public string PhoneNumber { get; set; } + public string Department { get; set; } + public string Address { get; set; } + public string Position { get; set; } + public string IdCardNumber { get; set; } + public DateTime HireDate { get; set; } + public string PoliticalAffiliation { get; set; } + public string EducationLevel { get; set; } + public string Password { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/Employee/ReadEmployeeOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/Employee/ReadEmployeeOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..fcf106276ca49e1b2e7fc4965f2832f782553c3d --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/Employee/ReadEmployeeOutputDto.cs @@ -0,0 +1,31 @@ + +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadEmployeeOutputDto:BaseDto + { + public string EmployeeId { get; set; } + public string EmployeeName { get; set; } + public int Gender { get; set; } + public string GenderName { get; set; } + public DateTime DateOfBirth { get; set; } + public string Ethnicity { get; set; } + public string EthnicityName { get; set; } + public string PhoneNumber { get; set; } + public string Department { get; set; } + public string DepartmentName { get; set; } + public string Address { get; set; } + public string Position { get; set; } + public string PositionName { get; set; } + public int IdCardType { get; set; } + public string IdCardTypeName { get; set; } + public string IdCardNumber { get; set; } + public DateTime HireDate { get; set; } + public string PoliticalAffiliation { get; set; } + public string PoliticalAffiliationName { get; set; } + public string EducationLevel { get; set; } + public string EducationLevelName { get; set; } + public int IsEnable { get; set; } + public string Password { get; set; } + public string EmailAddress { get; set; } + } +} diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/Employee/UpdateEmployeeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/Employee/UpdateEmployeeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..7c5bc98e7733b5dd349bb3feb38bb4d551706774 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/Employee/UpdateEmployeeInputDto.cs @@ -0,0 +1,25 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateEmployeeInputDto: BaseInputDto + { + public string EmployeeId { get; set; } + public string EmployeeName { get; set; } + public int Gender { get; set; } + public DateTime DateOfBirth { get; set; } + public string Ethnicity { get; set; } + public string PhoneNumber { get; set; } + public string Department { get; set; } + public string Address { get; set; } + public string Position { get; set; } + public int IdCardType { get; set; } + public string IdCardNumber { get; set; } + public DateTime HireDate { get; set; } + public string PoliticalAffiliation { get; set; } + public string EducationLevel { get; set; } + public string Password { get; set; } + public int IsEnable { get; set; } + public string EmailAddress { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeCheck/CreateEmployeeCheckInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeCheck/CreateEmployeeCheckInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..edb42b05f46b6f7950b22b98ad868f657788be63 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeCheck/CreateEmployeeCheckInputDto.cs @@ -0,0 +1,31 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateEmployeeCheckInputDto: BaseInputDto + { + /// + /// 򿨱 (Check-in/Check-out Number) + /// + public string CheckNumber { get; set; } + /// + /// Ա (Employee ID) + /// + public string EmployeeId { get; set; } + + /// + /// ʱ (Check-in/Check-out Time) + /// + public DateTime CheckTime { get; set; } + + /// + /// 򿨷ʽ (Check-in/Check-out Method) + /// + public string CheckMethod { get; set; } + + /// + /// ״̬ (Check-in/Check-out Status) + /// + public int CheckStatus { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeCheck/DeleteEmployeeCheckInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeCheck/DeleteEmployeeCheckInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..86924e651279340185947184ad297b76df87b567 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeCheck/DeleteEmployeeCheckInputDto.cs @@ -0,0 +1,9 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteEmployeeCheckInputDto: BaseInputDto + { + public int CheckId { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeCheck/ReadEmployeeCheckInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeCheck/ReadEmployeeCheckInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..ac32f7eb22c232714f278bd8a019104ed1b75495 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeCheck/ReadEmployeeCheckInputDto.cs @@ -0,0 +1,10 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadEmployeeCheckInputDto:ListInputDto + { + public int CheckId { get; set; } + public string EmployeeId { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeCheck/ReadEmployeeCheckOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeCheck/ReadEmployeeCheckOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..5230b06f4b7cdb3a9c2b95864435e203e5439dbc --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeCheck/ReadEmployeeCheckOutputDto.cs @@ -0,0 +1,16 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadEmployeeCheckOutputDto + { + public int Id { get; set; } + public string EmployeeId { get; set; } + public DateTime CheckTime { get; set; } + public string CheckStatus { get; set; } + public string CheckMethod { get; set; } + + public bool IsChecked { get; set; } + public int CheckDay { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeCheck/UpdateEmployeeCheckInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeCheck/UpdateEmployeeCheckInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..2ffb398a84a9c7348ffdc24c42d93f2ae94be5c9 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeCheck/UpdateEmployeeCheckInputDto.cs @@ -0,0 +1,12 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateEmployeeCheckInputDto: BaseInputDto + { + public int CheckId { get; set; } + public string EmployeeId { get; set; } + public DateTime CheckDate { get; set; } + public string CheckStatus { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeHistory/CreateEmployeeHistoryInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeHistory/CreateEmployeeHistoryInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..d3e2aa68784b34c1b96789ba948f401f3ba377d2 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeHistory/CreateEmployeeHistoryInputDto.cs @@ -0,0 +1,12 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateEmployeeHistoryInputDto: BaseInputDto + { + public string EmployeeId { get; set; } + public DateTime ChangeDate { get; set; } + public string ChangeType { get; set; } + public string ChangeDescription { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeHistory/DeleteEmployeeHistoryInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeHistory/DeleteEmployeeHistoryInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..efe91708704d5e70fdce1b90fcde6541fd049dac --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeHistory/DeleteEmployeeHistoryInputDto.cs @@ -0,0 +1,9 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteEmployeeHistoryInputDto: BaseInputDto + { + public int HistoryId { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeHistory/ReadEmployeeHistoryInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeHistory/ReadEmployeeHistoryInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..85fb3d9e40e954c51a8659a9dda6a26d950d6908 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeHistory/ReadEmployeeHistoryInputDto.cs @@ -0,0 +1,10 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadEmployeeHistoryInputDto:ListInputDto + { + public int HistoryId { get; set; } + public string EmployeeId { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeHistory/ReadEmployeeHistoryOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeHistory/ReadEmployeeHistoryOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..df39b386bb5be29035aac78c4a47a3668cbe049f --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeHistory/ReadEmployeeHistoryOutputDto.cs @@ -0,0 +1,14 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadEmployeeHistoryOutputDto + { + public int Id { get; set; } + public string EmployeeId { get; set; } + public DateTime StartDate { get; set; } + public DateTime EndDate { get; set; } + public string Position { get; set; } + public string Company { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeHistory/UpdateEmployeeHistoryInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeHistory/UpdateEmployeeHistoryInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..b8fb583b1a60e659fbc3b4a0dfea765809b1693c --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeHistory/UpdateEmployeeHistoryInputDto.cs @@ -0,0 +1,13 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateEmployeeHistoryInputDto: BaseInputDto + { + public int HistoryId { get; set; } + public string EmployeeId { get; set; } + public DateTime ChangeDate { get; set; } + public string ChangeType { get; set; } + public string ChangeDescription { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeePhoto/CreateEmployeePhotoInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeePhoto/CreateEmployeePhotoInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..c92e2b04c7d1231e659974646b72ebeaf87fdc79 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeePhoto/CreateEmployeePhotoInputDto.cs @@ -0,0 +1,10 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateEmployeePhotoInputDto: BaseInputDto + { + public string EmployeeId { get; set; } + public string PhotoUrl { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeePhoto/DeleteEmployeePhotoInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeePhoto/DeleteEmployeePhotoInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..37c254578933fc6bb3e4138a3ae4ed847708444e --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeePhoto/DeleteEmployeePhotoInputDto.cs @@ -0,0 +1,10 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteEmployeePhotoInputDto:ListInputDto + { + public int PhotoId { get; set; } + public string EmployeeId { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeePhoto/ReadEmployeePhotoInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeePhoto/ReadEmployeePhotoInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..d8a382381dafe4c511cc72c857e02845580076b6 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeePhoto/ReadEmployeePhotoInputDto.cs @@ -0,0 +1,10 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadEmployeePhotoInputDto:ListInputDto + { + public int PhotoId { get; set; } + public string EmployeeId { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeePhoto/ReadEmployeePhotoOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeePhoto/ReadEmployeePhotoOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..a732611a99c6962ab7433cf434383ed342e22987 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeePhoto/ReadEmployeePhotoOutputDto.cs @@ -0,0 +1,11 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadEmployeePhotoOutputDto + { + public int PhotoId { get; set; } + public string EmployeeId { get; set; } + public string PhotoPath { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeePhoto/UpdateEmployeePhotoInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeePhoto/UpdateEmployeePhotoInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..63674ecc54d3de5734162e811bfad5d65f3b987d --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeePhoto/UpdateEmployeePhotoInputDto.cs @@ -0,0 +1,11 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateEmployeePhotoInputDto: BaseInputDto + { + public int PhotoId { get; set; } + public string EmployeeId { get; set; } + public string PhotoUrl { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeRewardPunishment/CreateEmployeeRewardPunishmentInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeRewardPunishment/CreateEmployeeRewardPunishmentInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..f6142c2e654e6b1b65a5764050b84d4fbe3f695f --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeRewardPunishment/CreateEmployeeRewardPunishmentInputDto.cs @@ -0,0 +1,12 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateEmployeeRewardPunishmentInputDto: BaseInputDto + { + public string EmployeeId { get; set; } + public DateTime RewardPunishmentDate { get; set; } + public string RewardPunishmentType { get; set; } + public string RewardPunishmentDescription { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeRewardPunishment/DeleteEmployeeRewardPunishmentInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeRewardPunishment/DeleteEmployeeRewardPunishmentInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..3c2c937861d7ae2bf3d07d3743d6bfdf5ad81aba --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeRewardPunishment/DeleteEmployeeRewardPunishmentInputDto.cs @@ -0,0 +1,9 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteEmployeeRewardPunishmentInputDto: BaseInputDto + { + public int RewardPunishmentId { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeRewardPunishment/ReadEmployeeRewardPunishmentInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeRewardPunishment/ReadEmployeeRewardPunishmentInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..9a58abc4f2f2093ac06a29ab36a2886e02588186 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeRewardPunishment/ReadEmployeeRewardPunishmentInputDto.cs @@ -0,0 +1,10 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadEmployeeRewardPunishmentInputDto:ListInputDto + { + public int RewardPunishmentId { get; set; } + public string EmployeeId { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeRewardPunishment/ReadEmployeeRewardPunishmentOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeRewardPunishment/ReadEmployeeRewardPunishmentOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..6a81a3b6897f5eba8ff96d8cd69fabb527f4c19e --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeRewardPunishment/ReadEmployeeRewardPunishmentOutputDto.cs @@ -0,0 +1,16 @@ + +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadEmployeeRewardPunishmentOutputDto + { + public string EmployeeId { get; set; } + public DateTime RewardPunishmentTime { get; set; } + public int RewardPunishmentType { get; set; } + public string RewardPunishmentTypeName { get; set; } + public string RewardPunishmentInformation { get; set; } + public string RewardPunishmentOperator { get; set; } + public string OperatorName { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeRewardPunishment/UpdateEmployeeRewardPunishmentInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeRewardPunishment/UpdateEmployeeRewardPunishmentInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..6300a4f87985904625877f26f7109004a22608bd --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeRewardPunishment/UpdateEmployeeRewardPunishmentInputDto.cs @@ -0,0 +1,13 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateEmployeeRewardPunishmentInputDto: BaseInputDto + { + public int RewardPunishmentId { get; set; } + public string EmployeeId { get; set; } + public DateTime RewardPunishmentDate { get; set; } + public string RewardPunishmentType { get; set; } + public string RewardPunishmentDescription { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/RewardPunishmentType/CreateRewardPunishmentTypeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/RewardPunishmentType/CreateRewardPunishmentTypeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..d94e6e04e2c949fc7f94bf1c385949c1624fe8c9 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/RewardPunishmentType/CreateRewardPunishmentTypeInputDto.cs @@ -0,0 +1,9 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateRewardPunishmentTypeInputDto : BaseInputDto + { + public string GBTypeName { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/RewardPunishmentType/DeleteRewardPunishmentTypeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/RewardPunishmentType/DeleteRewardPunishmentTypeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..7731a1fcb52dff09dca7837f3656124b0fd4a781 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/RewardPunishmentType/DeleteRewardPunishmentTypeInputDto.cs @@ -0,0 +1,9 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteRewardPunishmentTypeInputDto : BaseInputDto + { + public string RewardPunishmentTypeId { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/RewardPunishmentType/ReadRewardPunishmentTypeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/RewardPunishmentType/ReadRewardPunishmentTypeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..65b41a834e6cd9b87ed45e2f0882588f3795a081 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/RewardPunishmentType/ReadRewardPunishmentTypeInputDto.cs @@ -0,0 +1,9 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadRewardPunishmentTypeInputDto : ListInputDto + { + public string RewardPunishmentTypeId { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/RewardPunishmentType/ReadRewardPunishmentTypeOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/RewardPunishmentType/ReadRewardPunishmentTypeOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..ca248f8e5d834d033095142ee654a2d7431df93b --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/RewardPunishmentType/ReadRewardPunishmentTypeOutputDto.cs @@ -0,0 +1,10 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadRewardPunishmentTypeOutputDto + { + public int GBTypeId { get; set; } + public string GBTypeName { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/RewardPunishmentType/UpdateRewardPunishmentTypeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/RewardPunishmentType/UpdateRewardPunishmentTypeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..cd65c6e0add445729f457976b96841966469ad87 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/RewardPunishmentType/UpdateRewardPunishmentTypeInputDto.cs @@ -0,0 +1,10 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateRewardPunishmentTypeInputDto : BaseInputDto + { + public string RewardPunishmentTypeId { get; set; } + public string RewardPunishmentTypeName { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/Sys/NavBar/Dto/CreateNavBarInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Sys/NavBar/Dto/CreateNavBarInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..ddf66dbe3f94c3b231c58283616b50b9dea2f9d0 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Sys/NavBar/Dto/CreateNavBarInputDto.cs @@ -0,0 +1,12 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateNavBarInputDto: BaseInputDto + { + public string NavigationBarName { get; set; } + public int NavigationBarOrder { get; set; } + public string NavigationBarImage { get; set; } + public string NavigationBarEvent { get; set; } + public int MarginLeft { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Sys/NavBar/Dto/DeleteNavBarInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Sys/NavBar/Dto/DeleteNavBarInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..d3fd5f9fdd6ce9a231b8d1b395120fc094c80ad1 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Sys/NavBar/Dto/DeleteNavBarInputDto.cs @@ -0,0 +1,8 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteNavBarInputDto: BaseInputDto + { + public int NavigationBarId { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Sys/NavBar/Dto/ReadNavBarInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Sys/NavBar/Dto/ReadNavBarInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..2188ae55a72c81370a82a9ab58c482c15ab67bcf --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Sys/NavBar/Dto/ReadNavBarInputDto.cs @@ -0,0 +1,8 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadNavBarInputDto:ListInputDto + { + public int NavigationBarId { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Sys/NavBar/Dto/ReadNavBarOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Sys/NavBar/Dto/ReadNavBarOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..652c232e5d57c26a7e99414b7e3c5acd473d1024 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Sys/NavBar/Dto/ReadNavBarOutputDto.cs @@ -0,0 +1,13 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadNavBarOutputDto + { + public int NavigationBarId { get; set; } + public string NavigationBarName { get; set; } + public int NavigationBarOrder { get; set; } + public string NavigationBarImage { get; set; } + public string NavigationBarEvent { get; set; } + public int MarginLeft { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Sys/NavBar/Dto/UpdateNavBarInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Sys/NavBar/Dto/UpdateNavBarInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..94ebad3ec9713d6e2a2a0a59552be6a8eb12ca68 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Sys/NavBar/Dto/UpdateNavBarInputDto.cs @@ -0,0 +1,13 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateNavBarInputDto: BaseInputDto + { + public int NavigationBarId { get; set; } + public string NavigationBarName { get; set; } + public int NavigationBarOrder { get; set; } + public string NavigationBarImage { get; set; } + public string NavigationBarEvent { get; set; } + public int MarginLeft { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Administrator/CreateAdministratorInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Administrator/CreateAdministratorInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..32821e211a500066ed5a37bc60c2c15aebd40751 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Administrator/CreateAdministratorInputDto.cs @@ -0,0 +1,14 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateAdministratorInputDto: BaseInputDto + { + public string Number { get; set; } + public string Account { get; set; } + public string Password { get; set; } + public string Type { get; set; } + public string Name { get; set; } + public int IsSuperAdmin { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Administrator/DeleteAdministratorInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Administrator/DeleteAdministratorInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..c95c66ef1ea6ee00b45b9fd650cafaba9271f112 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Administrator/DeleteAdministratorInputDto.cs @@ -0,0 +1,9 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteAdministratorInputDto: BaseInputDto + { + public string Number { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Administrator/ReadAdministratorInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Administrator/ReadAdministratorInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..99482d869d570fe8bf1f1e6f091dce7a71f6cfe8 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Administrator/ReadAdministratorInputDto.cs @@ -0,0 +1,14 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadAdministratorInputDto:ListInputDto + { + public int Id { get; set; } + public string Account { get; set; } + public string Password { get; set; } + public string Type { get; set; } + public string Name { get; set; } + public int IsSuperAdmin { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Administrator/ReadAdministratorOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Administrator/ReadAdministratorOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..4125a458274511b21abb59d27417838f17fe08cf --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Administrator/ReadAdministratorOutputDto.cs @@ -0,0 +1,26 @@ +using SqlSugar; + +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadAdministratorOutputDto:BaseDto + { + public string Number { get; set; } + public string Account { get; set; } + public string Password { get; set; } + public string Type { get; set; } + public string Name { get; set; } + public int IsSuperAdmin { get; set; } + + /// + /// ǷΪԱ (Is Super Administrator Description) + /// + public string IsSuperAdminDescription { get; set; } + + /// + /// Ա (Administrator Type Name) + /// + public string TypeName { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Administrator/UpdateAdministratorInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Administrator/UpdateAdministratorInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..dad9a56a8cd06ae0367fe4524501feeab680de23 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Administrator/UpdateAdministratorInputDto.cs @@ -0,0 +1,14 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateAdministratorInputDto: BaseInputDto + { + public string Number { get; set; } + public string Account { get; set; } + public string Password { get; set; } + public string Type { get; set; } + public string Name { get; set; } + public int IsSuperAdmin { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AdministratorType/CreateAdministratorTypeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AdministratorType/CreateAdministratorTypeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..7721184662254b9c79d9f657575c4098e8547793 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AdministratorType/CreateAdministratorTypeInputDto.cs @@ -0,0 +1,9 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateAdministratorTypeInputDto: BaseInputDto + { + public string TypeId { get; set; } + public string TypeName { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AdministratorType/DeleteAdministratorTypeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AdministratorType/DeleteAdministratorTypeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..8242519007b41f0e857917cc1b9bc1794bbd4cbb --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AdministratorType/DeleteAdministratorTypeInputDto.cs @@ -0,0 +1,8 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteAdministratorTypeInputDto: BaseInputDto + { + public int Id { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AdministratorType/ReadAdministratorTypeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AdministratorType/ReadAdministratorTypeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..28dd5e6d86160120f58be5a639605e12f6e05e1b --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AdministratorType/ReadAdministratorTypeInputDto.cs @@ -0,0 +1,8 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadAdministratorTypeInputDto:ListInputDto + { + public int Id { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AdministratorType/ReadAdministratorTypeOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AdministratorType/ReadAdministratorTypeOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..f810717e64f7eda95e4ad8f9e0eb3b3c1bf94c6c --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AdministratorType/ReadAdministratorTypeOutputDto.cs @@ -0,0 +1,10 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadAdministratorTypeOutputDto + { + public int Id { get; set; } + public string TypeId { get; set; } + public string TypeName { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AdministratorType/UpdateAdministratorTypeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AdministratorType/UpdateAdministratorTypeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..0714a4d3031434d4eac6504059d5003c77c562e9 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AdministratorType/UpdateAdministratorTypeInputDto.cs @@ -0,0 +1,10 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateAdministratorTypeInputDto: BaseInputDto + { + public int Id { get; set; } + public string TypeId { get; set; } + public string TypeName { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AppointmentNotice/CreateAppointmentNoticeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AppointmentNotice/CreateAppointmentNoticeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..fcfc952495f9f4ab224ebacf88665cf7f58cbdbb --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AppointmentNotice/CreateAppointmentNoticeInputDto.cs @@ -0,0 +1,14 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateAppointmentNoticeInputDto: BaseInputDto + { + public string NoticeId { get; set; } + public string NoticeTheme { get; set; } + public string NoticeType { get; set; } + public DateTime NoticeTime { get; set; } + public string NoticeContent { get; set; } + public string IssuingDepartment { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AppointmentNotice/DeleteAppointmentNoticeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AppointmentNotice/DeleteAppointmentNoticeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..5eaafae6a9b01080d668938b1ad24d292c057223 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AppointmentNotice/DeleteAppointmentNoticeInputDto.cs @@ -0,0 +1,9 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteAppointmentNoticeInputDto: BaseInputDto + { + public string NoticeId { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AppointmentNotice/ReadAppointmentNoticeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AppointmentNotice/ReadAppointmentNoticeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..90c995b1a069401dc57f566d96e04abda7ded7e8 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AppointmentNotice/ReadAppointmentNoticeInputDto.cs @@ -0,0 +1,14 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadAppointmentNoticeInputDto:ListInputDto + { + public string NoticeId { get; set; } + public string NoticeTheme { get; set; } + public string NoticeType { get; set; } + public DateTime NoticeTime { get; set; } + public string NoticeContent { get; set; } + public string IssuingDepartment { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AppointmentNotice/ReadAppointmentNoticeOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AppointmentNotice/ReadAppointmentNoticeOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..efeae8b6bca1deb5b06fa5cd02c41fe4c2987902 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AppointmentNotice/ReadAppointmentNoticeOutputDto.cs @@ -0,0 +1,14 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadAppointmentNoticeOutputDto + { + public string NoticeId { get; set; } + public string NoticeTheme { get; set; } + public string NoticeType { get; set; } + public DateTime NoticeTime { get; set; } + public string NoticeContent { get; set; } + public string IssuingDepartment { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AppointmentNotice/UpdateAppointmentNoticeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AppointmentNotice/UpdateAppointmentNoticeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..930e1214bd6bce71b6c14a8cbddbb4abe2a787f9 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AppointmentNotice/UpdateAppointmentNoticeInputDto.cs @@ -0,0 +1,12 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateAppointmentNoticeInputDto: BaseInputDto + { + public string NoticeId { get; set; } + public string NoticeTitle { get; set; } + public string NoticeContent { get; set; } + public DateTime NoticeDate { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Department/CreateDepartmentInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Department/CreateDepartmentInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..e3faadf9ce423b82e57fae4116598368988a4955 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Department/CreateDepartmentInputDto.cs @@ -0,0 +1,17 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateDepartmentInputDto: BaseInputDto + { + public int Id { get; set; } + public string DepartmentNumber { get; set; } + public string DepartmentName { get; set; } + public string DepartmentDescription { get; set; } + public DateTime DepartmentCreationDate { get; set; } + public string DepartmentLeader { get; set; } + public string LeaderName { get; set; } + public string ParentDepartmentNumber { get; set; } + public string ParentDepartmentName { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Department/DeleteDepartmentInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Department/DeleteDepartmentInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..8be620d9d186518bb6f48aaf0728eed140e7a4e8 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Department/DeleteDepartmentInputDto.cs @@ -0,0 +1,17 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteDepartmentInputDto: BaseInputDto + { + public int Id { get; set; } + public string DepartmentNumber { get; set; } + public string DepartmentName { get; set; } + public string DepartmentDescription { get; set; } + public DateTime DepartmentCreationDate { get; set; } + public string DepartmentLeader { get; set; } + public string LeaderName { get; set; } + public string ParentDepartmentNumber { get; set; } + public string ParentDepartmentName { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Department/ReadDepartmentInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Department/ReadDepartmentInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..5d773b325a83cc853c8e1914fdbfa5d040b5052c --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Department/ReadDepartmentInputDto.cs @@ -0,0 +1,17 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadDepartmentInputDto:ListInputDto + { + public int Id { get; set; } + public string DepartmentNumber { get; set; } + public string DepartmentName { get; set; } + public string DepartmentDescription { get; set; } + public DateTime DepartmentCreationDate { get; set; } + public string DepartmentLeader { get; set; } + public string LeaderName { get; set; } + public string ParentDepartmentNumber { get; set; } + public string ParentDepartmentName { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Department/ReadDepartmentOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Department/ReadDepartmentOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..a46119c2c02c19a86fa9674ea69f61bf759aee06 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Department/ReadDepartmentOutputDto.cs @@ -0,0 +1,17 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadDepartmentOutputDto + { + public int Id { get; set; } + public string DepartmentNumber { get; set; } + public string DepartmentName { get; set; } + public string DepartmentDescription { get; set; } + public DateTime DepartmentCreationDate { get; set; } + public string DepartmentLeader { get; set; } + public string LeaderName { get; set; } + public string ParentDepartmentNumber { get; set; } + public string ParentDepartmentName { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Department/UpdateDepartmentInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Department/UpdateDepartmentInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..26d6f1e8bc275f04c3fbb765af7a02d516359038 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Department/UpdateDepartmentInputDto.cs @@ -0,0 +1,17 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateDepartmentInputDto: BaseInputDto + { + public int Id { get; set; } + public string DepartmentNumber { get; set; } + public string DepartmentName { get; set; } + public string DepartmentDescription { get; set; } + public DateTime DepartmentCreationDate { get; set; } + public string DepartmentLeader { get; set; } + public string LeaderName { get; set; } + public string ParentDepartmentNumber { get; set; } + public string ParentDepartmentName { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/EnumDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/EnumDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..d40158b8cdeb6db0c3f079e09386898eaa6f7392 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/EnumDto.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EOM.TSHotelManagement.Common.Contract +{ + public class EnumDto + { + public int Id { get; set; } + public string Name { get; set; } + public string Description { get; set; } + } +} diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Menu/CreateMenuInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Menu/CreateMenuInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..98fdefa4c18814b52897fe24ef94942d3f869dc4 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Menu/CreateMenuInputDto.cs @@ -0,0 +1,13 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateMenuInputDto: BaseInputDto + { + public string Key { get; set; } + public string Title { get; set; } + public string Path { get; set; } + public int? Parent { get; set; } + public string Icon { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Menu/DeleteMenuInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Menu/DeleteMenuInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..cd22ae2465d7f7e4acde27b854132b4127bf219d --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Menu/DeleteMenuInputDto.cs @@ -0,0 +1,13 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteMenuInputDto: BaseInputDto + { + public string Key { get; set; } + public string Title { get; set; } + public string Path { get; set; } + public int? Parent { get; set; } + public string Icon { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Core/Zero/MenuViewModel.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Menu/MenuViewModel.cs similarity index 45% rename from EOM.TSHotelManagement.Common.Core/Zero/MenuViewModel.cs rename to EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Menu/MenuViewModel.cs index a5021e5f24806650319ec9dc3488f48eeb3e2506..d5c5bb9b24bbbc84472af3838a86843505ea7011 100644 --- a/EOM.TSHotelManagement.Common.Core/Zero/MenuViewModel.cs +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Menu/MenuViewModel.cs @@ -4,28 +4,31 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace EOM.TSHotelManagement.Common.Core +namespace EOM.TSHotelManagement.Common.Contract.Menu { /// - /// 菜单视图模型 + /// 菜单视图模型 (Menu View Model) /// public class MenuViewModel { /// - /// 菜单主键 + /// 菜单主键 (Menu Key) /// - public string key { get; set; } + public string Key { get; set; } + /// - /// 菜单标题 + /// 菜单标题 (Menu Title) /// - public string title { get; set; } + public string Title { get; set; } + /// - /// 菜单路径 + /// 菜单路径 (Menu Path) /// - public string path { get; set; } + public string Path { get; set; } + /// - /// 子菜单 + /// 子菜单 (Child Menus) /// - public List children { get; set; } + public List Children { get; set; } = new List(); } } diff --git a/EOM.TSHotelManagement.Common.Core/Zero/ModuleConsts.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Menu/ModuleConsts.cs similarity index 95% rename from EOM.TSHotelManagement.Common.Core/Zero/ModuleConsts.cs rename to EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Menu/ModuleConsts.cs index a36d5c05c964a91929ae1ed76ab7580d2a56abdc..11a2df13ec24856a5b4205e11a973b8a711ac93e 100644 --- a/EOM.TSHotelManagement.Common.Core/Zero/ModuleConsts.cs +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Menu/ModuleConsts.cs @@ -22,7 +22,7 @@ * *模块说明:系统模块常量类 */ -namespace EOM.TSHotelManagement.Common.Core +namespace EOM.TSHotelManagement.Common.Contract.Menu { /// /// 系统模块常量类 @@ -44,7 +44,7 @@ namespace EOM.TSHotelManagement.Common.Core /// /// 监管统计 /// - public const string CheckInfo = "CheckInfo"; + public const string SupervisionStatistics = "SupervisionStatistics"; /// /// 客房管理 /// diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Menu/ReadMenuInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Menu/ReadMenuInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..8b37af2484bbe2740707f4262f5bd992a5be2aa2 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Menu/ReadMenuInputDto.cs @@ -0,0 +1,11 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadMenuInputDto:ListInputDto + { + public int Id { get; set; } + + public bool SearchParent { get; set; } = false; + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Menu/ReadMenuOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Menu/ReadMenuOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..d1c0ac666416700e486c7c01c166f5936501cc86 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Menu/ReadMenuOutputDto.cs @@ -0,0 +1,14 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadMenuOutputDto + { + public int Id { get; set; } + public string Key { get; set; } + public string Title { get; set; } + public string Path { get; set; } + public int? Parent { get; set; } + public string Icon { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Menu/UpdateMenuInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Menu/UpdateMenuInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..839950efc5d0ac7007d8d9ef07a2ec285ff01984 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Menu/UpdateMenuInputDto.cs @@ -0,0 +1,13 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateMenuInputDto: BaseInputDto + { + public string Key { get; set; } + public string Title { get; set; } + public string Path { get; set; } + public int? Parent { get; set; } + public string Icon { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Module/CreateModuleInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Module/CreateModuleInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..634950e979832274c0680e890d89605a59744e4a --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Module/CreateModuleInputDto.cs @@ -0,0 +1,10 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateModuleInputDto: BaseInputDto + { + public string ModuleName { get; set; } + public string ModuleDescription { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Module/DeleteModuleInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Module/DeleteModuleInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..a3e338178965307f7bf83a4cac0c1a1eac99212f --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Module/DeleteModuleInputDto.cs @@ -0,0 +1,10 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteModuleInputDto: BaseInputDto + { + public int ModuleId { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Module/ReadModuleInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Module/ReadModuleInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..f96c6968051cb7257646330c78018107fae8b68c --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Module/ReadModuleInputDto.cs @@ -0,0 +1,9 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadModuleInputDto:ListInputDto + { + public int ModuleId { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Module/ReadModuleOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Module/ReadModuleOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..1043e83df50f0ea06cdf262f36a573bea65ff8e8 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Module/ReadModuleOutputDto.cs @@ -0,0 +1,11 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadModuleOutputDto + { + public int ModuleId { get; set; } + public string ModuleName { get; set; } + public string ModuleDescription { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Module/UpdateModuleInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Module/UpdateModuleInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..1e69b296dc5f181f0994911ac4a5d0df59744177 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Module/UpdateModuleInputDto.cs @@ -0,0 +1,12 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateModuleInputDto: BaseInputDto + { + public int ModuleId { get; set; } + public string ModuleName { get; set; } + public string ModuleDescription { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/ModulePermission/CreateModulePermissionInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/ModulePermission/CreateModulePermissionInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..6798706eaf336e92ffd8714c3b4672a8ee1b6cb8 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/ModulePermission/CreateModulePermissionInputDto.cs @@ -0,0 +1,12 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateModulePermissionInputDto: BaseInputDto + { + public int ModuleId { get; set; } + public string PermissionName { get; set; } + public string PermissionDescription { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/ModulePermission/DeleteModulePermissionInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/ModulePermission/DeleteModulePermissionInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..188e2201605093daa323c5c95d8699debda755cd --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/ModulePermission/DeleteModulePermissionInputDto.cs @@ -0,0 +1,11 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteModulePermissionInputDto: BaseInputDto + { + public int PermissionId { get; set; } + public string AdministratorAccount { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/ModulePermission/ReadModulePermissionInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/ModulePermission/ReadModulePermissionInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..307498956af2e751c8d4c06ef91bdd58ee3adff9 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/ModulePermission/ReadModulePermissionInputDto.cs @@ -0,0 +1,11 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadModulePermissionInputDto:ListInputDto + { + public int PermissionId { get; set; } + public string Account { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/ModulePermission/ReadModulePermissionOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/ModulePermission/ReadModulePermissionOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..4e97fcce792ad8b491dd10a0fc9345f599eb4d40 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/ModulePermission/ReadModulePermissionOutputDto.cs @@ -0,0 +1,30 @@ +using SqlSugar; + +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadModulePermissionOutputDto + { + /// + /// ģID (Module ID) + /// + public int ModuleId { get; set; } + + /// + /// Ա˺ (Administrator Account) + /// + public string AdministratorAccount { get; set; } + + /// + /// ģ (Module Name) + /// + public string ModuleName { get; set; } + + /// + /// Ƿ (Is Enabled) + /// + public int ModuleEnabled { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/ModulePermission/UpdateModulePermissionInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/ModulePermission/UpdateModulePermissionInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..c306b90ed246df0f33a6a8f20294f4adbe03661e --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/ModulePermission/UpdateModulePermissionInputDto.cs @@ -0,0 +1,13 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateModulePermissionInputDto: BaseInputDto + { + public int PermissionId { get; set; } + public int ModuleId { get; set; } + public string PermissionName { get; set; } + public string PermissionDescription { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Nation/CreateNationInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Nation/CreateNationInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..1ff8441a667c638196175a4f7ca33cc26933cef1 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Nation/CreateNationInputDto.cs @@ -0,0 +1,11 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateNationInputDto: BaseInputDto + { + public string NationNumber { get; set; } + public string NationName { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Nation/DeleteNationInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Nation/DeleteNationInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..7063535bab8237f316f7d80f3b9a6bab96c6178a --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Nation/DeleteNationInputDto.cs @@ -0,0 +1,11 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteNationInputDto: BaseInputDto + { + public int NationId { get; set; } + public string NationNumber { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Nation/ReadNationInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Nation/ReadNationInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..61e0b14a53a864b3e41804dcced7a75ca5d58f4d --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Nation/ReadNationInputDto.cs @@ -0,0 +1,10 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadNationInputDto:ListInputDto + { + public int NationId { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Nation/ReadNationOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Nation/ReadNationOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..9b6b61b30cda83c8fcd411a7326572f9698afa04 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Nation/ReadNationOutputDto.cs @@ -0,0 +1,11 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadNationOutputDto + { + public string NationNumber { get; set; } + public string NationName { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Nation/UpdateNationInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Nation/UpdateNationInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..3d194d57ceda0176a7a69299dab7610fa094f811 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Nation/UpdateNationInputDto.cs @@ -0,0 +1,11 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateNationInputDto: BaseInputDto + { + public string NationNumber { get; set; } + public string NationName { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Position/CreatePositionInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Position/CreatePositionInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..c2703091238f82725bf4643d3511e5fecf5852a4 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Position/CreatePositionInputDto.cs @@ -0,0 +1,12 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreatePositionInputDto: BaseInputDto + { + public string PositionNumber { get; set; } + public string PositionName { get; set; } + public string PositionDescription { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Position/DeletePositionInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Position/DeletePositionInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..c8052679f7b52f15937509261fcad45ecf7082a6 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Position/DeletePositionInputDto.cs @@ -0,0 +1,10 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeletePositionInputDto: BaseInputDto + { + public string PositionNumber { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Position/ReadPositionInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Position/ReadPositionInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..938b699bf07881f4654d2a3ca53b681a1f2b6e97 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Position/ReadPositionInputDto.cs @@ -0,0 +1,12 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadPositionInputDto:ListInputDto + { + public int PositionId { get; set; } + public string PositionName { get; set; } + public string PositionDescription { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Position/ReadPositionOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Position/ReadPositionOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..dc7f24b94aa8053d2756bcc8f07cc3c9b0a87834 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Position/ReadPositionOutputDto.cs @@ -0,0 +1,12 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadPositionOutputDto + { + public int Id { get; set; } + public string PositionNumber { get; set; } + public string PositionName { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Position/UpdatePositionInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Position/UpdatePositionInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..c8c9f05d8fadb19745e67e3bbbfd3db1fee6b539 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Position/UpdatePositionInputDto.cs @@ -0,0 +1,13 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdatePositionInputDto: BaseInputDto + { + public int PositionId { get; set; } + public string PositionNumber { get; set; } + public string PositionName { get; set; } + public string PositionDescription { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Qualification/CreateEducationInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Qualification/CreateEducationInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..e63d249b1c05d79f914f8f2553c346fdac8c5d39 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Qualification/CreateEducationInputDto.cs @@ -0,0 +1,10 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateEducationInputDto: BaseInputDto + { + public string EducationNumber { get; set; } + public string EducationName { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Qualification/DeleteEducationInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Qualification/DeleteEducationInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..f04a770bcba5b993034825ba9272da0f9b180f2a --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Qualification/DeleteEducationInputDto.cs @@ -0,0 +1,9 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteEducationInputDto: BaseInputDto + { + public string EducationNumber { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Qualification/ReadEducationInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Qualification/ReadEducationInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..9341c90b084cacce46ed57030d95ed02ae2ca6ca --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Qualification/ReadEducationInputDto.cs @@ -0,0 +1,9 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadEducationInputDto:ListInputDto + { + public string EducationNumber { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Qualification/ReadEducationOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Qualification/ReadEducationOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..48bcc9c0744ef195bb313fd1cdb5ca51dba8b8d5 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Qualification/ReadEducationOutputDto.cs @@ -0,0 +1,10 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadEducationOutputDto + { + public string EducationNumber { get; set; } + public string EducationName { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Qualification/UpdateEducationInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Qualification/UpdateEducationInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..c25e95230abec0454ad88fc3c98e1450598e29b4 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Qualification/UpdateEducationInputDto.cs @@ -0,0 +1,10 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateEducationInputDto: BaseInputDto + { + public string EducationNumber { get; set; } + public string EducationName { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Role/CreateRoleInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Role/CreateRoleInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..413ebf58eeb17293078778c139894be7ddf27db2 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Role/CreateRoleInputDto.cs @@ -0,0 +1,25 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateRoleInputDto: BaseInputDto + { + /// + /// ע:ɫ + /// Ĭֵ: + /// + public string RoleNumber { get; set; } = null!; + + /// + /// ע:ɫ + /// Ĭֵ: + /// + public string RoleName { get; set; } = null!; + + /// + /// ע:ɫ + /// Ĭֵ: + /// + public string? RoleDescription { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Role/DeleteRoleInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Role/DeleteRoleInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..7193760281344f5be1bedd4fa61d0557b2ffd041 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Role/DeleteRoleInputDto.cs @@ -0,0 +1,13 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteRoleInputDto: BaseInputDto + { + /// + /// ע:ɫ + /// Ĭֵ: + /// + public string RoleNumber { get; set; } = null!; + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Role/ReadRoleInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Role/ReadRoleInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..b697ab34f6f5f4828a771ac17ebf46b285260f32 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Role/ReadRoleInputDto.cs @@ -0,0 +1,25 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadRoleInputDto:ListInputDto + { + /// + /// ע:ɫ + /// Ĭֵ: + /// + public string RoleNumber { get; set; } = null!; + + /// + /// ע:ɫ + /// Ĭֵ: + /// + public string RoleName { get; set; } = null!; + + /// + /// ע:ɫ + /// Ĭֵ: + /// + public string? RoleDescription { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Role/ReadRoleOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Role/ReadRoleOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..6e3132e0fa7ef8b1725537dc211a0d9bd3a6c10f --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Role/ReadRoleOutputDto.cs @@ -0,0 +1,25 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadRoleOutputDto + { + /// + /// ע:ɫ + /// Ĭֵ: + /// + public string RoleNumber { get; set; } = null!; + + /// + /// ע:ɫ + /// Ĭֵ: + /// + public string RoleName { get; set; } = null!; + + /// + /// ע:ɫ + /// Ĭֵ: + /// + public string? RoleDescription { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Role/UpdateRoleInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Role/UpdateRoleInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..2666f637f56c324503009332abb6b97650d5c443 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Role/UpdateRoleInputDto.cs @@ -0,0 +1,25 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateRoleInputDto: BaseInputDto + { + /// + /// ע:ɫ + /// Ĭֵ: + /// + public string RoleNumber { get; set; } = null!; + + /// + /// ע:ɫ + /// Ĭֵ: + /// + public string RoleName { get; set; } = null!; + + /// + /// ע:ɫ + /// Ĭֵ: + /// + public string? RoleDescription { get; set; } + } +} + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SupervisionStatistics/CreateSupervisionStatisticsInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SupervisionStatistics/CreateSupervisionStatisticsInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..e002b46e76dc6b56b1682a93e63a74771aaac910 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SupervisionStatistics/CreateSupervisionStatisticsInputDto.cs @@ -0,0 +1,17 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateSupervisionStatisticsInputDto: BaseInputDto + { + public string StatisticsNumber { get; set; } + public string SupervisingDepartment { get; set; } + public string SupervisingDepartmentName { get; set; } + public string SupervisionProgress { get; set; } + public string SupervisionLoss { get; set; } + public int SupervisionScore { get; set; } + public string SupervisionStatistician { get; set; } + public string SupervisionAdvice { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SupervisionStatistics/DeleteSupervisionStatisticsInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SupervisionStatistics/DeleteSupervisionStatisticsInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..1a3cad421d5643622020f87b1703dcb4852b9b7f --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SupervisionStatistics/DeleteSupervisionStatisticsInputDto.cs @@ -0,0 +1,17 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteSupervisionStatisticsInputDto: BaseInputDto + { + public string StatisticsNumber { get; set; } + public string SupervisingDepartment { get; set; } + public string SupervisingDepartmentName { get; set; } + public string SupervisionProgress { get; set; } + public string SupervisionLoss { get; set; } + public int SupervisionScore { get; set; } + public string SupervisionStatistician { get; set; } + public string SupervisionAdvice { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SupervisionStatistics/ReadSupervisionStatisticsInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SupervisionStatistics/ReadSupervisionStatisticsInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..2879ef8f870365a4a40b46a89f88f7027d46f1cd --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SupervisionStatistics/ReadSupervisionStatisticsInputDto.cs @@ -0,0 +1,17 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadSupervisionStatisticsInputDto:ListInputDto + { + public string StatisticsNumber { get; set; } + public string SupervisingDepartment { get; set; } + public string SupervisingDepartmentName { get; set; } + public string SupervisionProgress { get; set; } + public string SupervisionLoss { get; set; } + public int SupervisionScore { get; set; } + public string SupervisionStatistician { get; set; } + public string SupervisionAdvice { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SupervisionStatistics/ReadSupervisionStatisticsOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SupervisionStatistics/ReadSupervisionStatisticsOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..fe8b53156739b8fb4a5049325f22b90ff4c19b5c --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SupervisionStatistics/ReadSupervisionStatisticsOutputDto.cs @@ -0,0 +1,17 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadSupervisionStatisticsOutputDto + { + public string StatisticsNumber { get; set; } + public string SupervisingDepartment { get; set; } + public string SupervisingDepartmentName { get; set; } + public string SupervisionProgress { get; set; } + public string SupervisionLoss { get; set; } + public int SupervisionScore { get; set; } + public string SupervisionStatistician { get; set; } + public string SupervisionAdvice { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SupervisionStatistics/UpdateSupervisionStatisticsInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SupervisionStatistics/UpdateSupervisionStatisticsInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..5edc406ec2a8e2eb35803033a2fa7df1da372a67 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SupervisionStatistics/UpdateSupervisionStatisticsInputDto.cs @@ -0,0 +1,17 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateSupervisionStatisticsInputDto: BaseInputDto + { + public string StatisticsNumber { get; set; } + public string SupervisingDepartment { get; set; } + public string SupervisingDepartmentName { get; set; } + public string SupervisionProgress { get; set; } + public string SupervisionLoss { get; set; } + public int SupervisionScore { get; set; } + public string SupervisionStatistician { get; set; } + public string SupervisionAdvice { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SystemInformation/CreateSystemInformationInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SystemInformation/CreateSystemInformationInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..9cbc093f80876c06df9b54bf07be8173ebffc3bf --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SystemInformation/CreateSystemInformationInputDto.cs @@ -0,0 +1,12 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateSystemInformationInputDto: BaseInputDto + { + public string InformationTitle { get; set; } + public string InformationContent { get; set; } + public DateTime InformationDate { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SystemInformation/DeleteSystemInformationInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SystemInformation/DeleteSystemInformationInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..41f466b16c844abe4af41f9162613f85e4390299 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SystemInformation/DeleteSystemInformationInputDto.cs @@ -0,0 +1,10 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteSystemInformationInputDto: BaseInputDto + { + public int InformationId { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SystemInformation/ReadSystemInformationInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SystemInformation/ReadSystemInformationInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..59c9316d0df57cee0424115c5f0aaf1c526d5919 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SystemInformation/ReadSystemInformationInputDto.cs @@ -0,0 +1,10 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadSystemInformationInputDto:ListInputDto + { + public int InformationId { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SystemInformation/ReadSystemInformationOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SystemInformation/ReadSystemInformationOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..3e671dfe399e7233d3d6d23d13994b1ab8bf964f --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SystemInformation/ReadSystemInformationOutputDto.cs @@ -0,0 +1,11 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadSystemInformationOutputDto + { + public int UrlNumber { get; set; } + public string UrlAddress { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SystemInformation/UpdateSystemInformationInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SystemInformation/UpdateSystemInformationInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..2c981045110114e6de302fe66e12b8a0d4efdb63 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SystemInformation/UpdateSystemInformationInputDto.cs @@ -0,0 +1,13 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateSystemInformationInputDto: BaseInputDto + { + public int InformationId { get; set; } + public string InformationTitle { get; set; } + public string InformationContent { get; set; } + public DateTime InformationDate { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/VipLevelRule/CreateVipLevelRuleInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/VipLevelRule/CreateVipLevelRuleInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..8d747403c0a7e3c6e99fa6cf383029724427bd9a --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/VipLevelRule/CreateVipLevelRuleInputDto.cs @@ -0,0 +1,20 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateVipLevelRuleInputDto: BaseInputDto + { + public int Id { get; set; } + + public string RuleSerialNumber { get; set; } + + public string RuleName { get; set; } + + public decimal RuleValue { get; set; } + + public int VipLevelId { get; set; } + + public string VipLevelName { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/VipLevelRule/DeleteVipLevelRuleInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/VipLevelRule/DeleteVipLevelRuleInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..690ff800326030224049a1e388b837cf43f07658 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/VipLevelRule/DeleteVipLevelRuleInputDto.cs @@ -0,0 +1,20 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteVipLevelRuleInputDto: BaseInputDto + { + public int Id { get; set; } + + public string RuleSerialNumber { get; set; } + + public string RuleName { get; set; } + + public decimal RuleValue { get; set; } + + public int VipLevelId { get; set; } + + public string VipLevelName { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/VipLevelRule/ReadVipLevelRuleInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/VipLevelRule/ReadVipLevelRuleInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..f1b4556012f272198ec9ef3b3281dff35b2cdd38 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/VipLevelRule/ReadVipLevelRuleInputDto.cs @@ -0,0 +1,11 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadVipLevelRuleInputDto:ListInputDto + { + public int RuleId { get; set; } + public string RuleSerialNumber { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/VipLevelRule/ReadVipLevelRuleOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/VipLevelRule/ReadVipLevelRuleOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..71e98a1921754eff632a586cfdc501cd3d0ecd6e --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/VipLevelRule/ReadVipLevelRuleOutputDto.cs @@ -0,0 +1,22 @@ +using SqlSugar; + +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadVipLevelRuleOutputDto:BaseOutputDto + { + public int Id { get; set; } + + public string RuleSerialNumber { get; set; } + + public string RuleName { get; set; } + + public decimal RuleValue { get; set; } + + public int VipLevelId { get; set; } + + public string VipLevelName { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/VipLevelRule/UpdateVipLevelRuleInputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/VipLevelRule/UpdateVipLevelRuleInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..88f0164e8cbc6d222b1b306f9acb275e00215edf --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/VipLevelRule/UpdateVipLevelRuleInputDto.cs @@ -0,0 +1,20 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateVipLevelRuleInputDto: BaseInputDto + { + public int Id { get; set; } + + public string RuleSerialNumber { get; set; } + + public string RuleName { get; set; } + + public decimal RuleValue { get; set; } + + public int VipLevelId { get; set; } + + public string VipLevelName { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/Util/Dto/ApplicationVersion/CreateApplicationVersionInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Util/Dto/ApplicationVersion/CreateApplicationVersionInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..fadba28bccf7e0cbd62f3ffab1f746630ce8a12a --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Util/Dto/ApplicationVersion/CreateApplicationVersionInputDto.cs @@ -0,0 +1,12 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateApplicationVersionInputDto: BaseInputDto + { + public string VersionNumber { get; set; } + public string VersionDescription { get; set; } + public DateTime ReleaseDate { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/Util/Dto/ApplicationVersion/DeleteApplicationVersionInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Util/Dto/ApplicationVersion/DeleteApplicationVersionInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..123f57a7a1700b38e1c8979b3abd66fcbe8df67a --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Util/Dto/ApplicationVersion/DeleteApplicationVersionInputDto.cs @@ -0,0 +1,10 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteApplicationVersionInputDto: BaseInputDto + { + public int VersionId { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/Util/Dto/ApplicationVersion/ReadApplicationVersionInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Util/Dto/ApplicationVersion/ReadApplicationVersionInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..50812a3c1619f7ce89e927e5188f71baf62ae303 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Util/Dto/ApplicationVersion/ReadApplicationVersionInputDto.cs @@ -0,0 +1,10 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadApplicationVersionInputDto:ListInputDto + { + public int VersionId { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/Util/Dto/ApplicationVersion/ReadApplicationVersionOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Util/Dto/ApplicationVersion/ReadApplicationVersionOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..33cad54e6e330b03a0b81c9ff5de091c96d1c8bc --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Util/Dto/ApplicationVersion/ReadApplicationVersionOutputDto.cs @@ -0,0 +1,13 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadApplicationVersionOutputDto + { + public int ApplicationVersionId { get; set; } + public string VersionNumber { get; set; } + public string VersionDescription { get; set; } + public DateTime ReleaseDate { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/Util/Dto/ApplicationVersion/UpdateApplicationVersionInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Util/Dto/ApplicationVersion/UpdateApplicationVersionInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..d3c7ce99253595ed2c3eb51581dea175e507205f --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Util/Dto/ApplicationVersion/UpdateApplicationVersionInputDto.cs @@ -0,0 +1,13 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateApplicationVersionInputDto: BaseInputDto + { + public int VersionId { get; set; } + public string VersionNumber { get; set; } + public string VersionDescription { get; set; } + public DateTime ReleaseDate { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/Util/Dto/CardCode/CreateCardCodeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Util/Dto/CardCode/CreateCardCodeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..ac5a8cc12b59738120c36f64007e6f860d9de162 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Util/Dto/CardCode/CreateCardCodeInputDto.cs @@ -0,0 +1,18 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateCardCodeInputDto:BaseInputDto + { + public long Id { get; set; } + + public string Province { get; set; } + + public string City { get; set; } + + public string District { get; set; } + + public string AreaCode { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/Util/Dto/CardCode/DeleteCardCodeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Util/Dto/CardCode/DeleteCardCodeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..e134e6286c2625c007d19a71218e59cac0e2fcc8 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Util/Dto/CardCode/DeleteCardCodeInputDto.cs @@ -0,0 +1,18 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteCardCodeInputDto: BaseInputDto + { + public long Id { get; set; } + + public string Province { get; set; } + + public string City { get; set; } + + public string District { get; set; } + + public string AreaCode { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/Util/Dto/CardCode/ReadCardCodeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Util/Dto/CardCode/ReadCardCodeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..987a745879b20a47c4fa4a586b151cfb64008034 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Util/Dto/CardCode/ReadCardCodeInputDto.cs @@ -0,0 +1,20 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadCardCodeInputDto:ListInputDto + { + public long Id { get; set; } + + public string Province { get; set; } + + public string City { get; set; } + + public string District { get; set; } + + public string AreaCode { get; set; } + + public string IdentityCardNumber { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/Util/Dto/CardCode/ReadCardCodeOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Util/Dto/CardCode/ReadCardCodeOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..d7e18deae4396d26d42a1b0cfd08fdefa4328502 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Util/Dto/CardCode/ReadCardCodeOutputDto.cs @@ -0,0 +1,18 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadCardCodeOutputDto + { + public long Id { get; set; } + + public string Province { get; set; } + + public string City { get; set; } + + public string District { get; set; } + + public string AreaCode { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/Util/Dto/CardCode/UpdateCardCodeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Util/Dto/CardCode/UpdateCardCodeInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..8959e9c8a24f591a44650e650f6ebab817129f41 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Util/Dto/CardCode/UpdateCardCodeInputDto.cs @@ -0,0 +1,18 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateCardCodeInputDto: BaseInputDto + { + public long Id { get; set; } + + public string Province { get; set; } + + public string City { get; set; } + + public string District { get; set; } + + public string AreaCode { get; set; } + } +} + + + diff --git a/EOM.TSHotelManagement.Common.Contract/Util/Dto/OperationLog/CreateOperationLogInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Util/Dto/OperationLog/CreateOperationLogInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..e97dcaff9b2b9b05b16c49be6031ce3daa68385f --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Util/Dto/OperationLog/CreateOperationLogInputDto.cs @@ -0,0 +1,15 @@ +using EOM.TSHotelManagement.Common.Core; + +namespace EOM.TSHotelManagement.Common.Contract +{ + public class CreateOperationLogInputDto: BaseInputDto + { + public DateTime OperationTime { get; set; } + public string LogContent { get; set; } + public string OperationAccount { get; set; } + public LogLevel LogLevel { get; set; } + public string SoftwareVersion { get; set; } + public string LoginIpAddress { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Util/Dto/OperationLog/DeleteOperationLogInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Util/Dto/OperationLog/DeleteOperationLogInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..b84346e3852bbeb0c87aa90e5905aa1e06a8d378 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Util/Dto/OperationLog/DeleteOperationLogInputDto.cs @@ -0,0 +1,8 @@ +namespace EOM.TSHotelManagement.Common.Contract +{ + public class DeleteOperationLogInputDto: BaseInputDto + { + public string OperationId { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Util/Dto/OperationLog/ReadOperationLogInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Util/Dto/OperationLog/ReadOperationLogInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..ff3a926cfccd1666c76461477f43b442fbe36fe6 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Util/Dto/OperationLog/ReadOperationLogInputDto.cs @@ -0,0 +1,13 @@ + +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadOperationLogInputDto:ListInputDto + { + public string OperationId { get; set; } + public int? LogLevel { get; set; } + + public DateTime StartTime { get; set; } + public DateTime EndTime { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Util/Dto/OperationLog/ReadOperationLogOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Util/Dto/OperationLog/ReadOperationLogOutputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..9118475808d03b2af36c98a2e1627d98825ebd0d --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Util/Dto/OperationLog/ReadOperationLogOutputDto.cs @@ -0,0 +1,42 @@ +using EOM.TSHotelManagement.Common.Core; +using SqlSugar; + +namespace EOM.TSHotelManagement.Common.Contract +{ + public class ReadOperationLogOutputDto + { + public string OperationId { get; set; } + public DateTime OperationTime { get; set; } + public string LogContent { get; set; } + public string OperationAccount { get; set; } + public LogLevel LogLevel { get; set; } + public string SoftwareVersion { get; set; } + public string LoginIpAddress { get; set; } + public string LogLevelName { get; set; } + /// + /// · (Request Path) + /// + public string RequestPath { get; set; } + /// + /// Ӧʱ (Elapsed Time) + /// + public long ElapsedTime { get; set; } + /// + /// 󷽷 (Http Method) + /// + public string HttpMethod { get; set; } + /// + /// ״̬ (Status Code) + /// + public int StatusCode { get; set; } + /// + /// 쳣Ϣ (Exception Message) + /// + public string ExceptionMessage { get; set; } + /// + /// 쳣ջ (Exception Stack Trace) + /// + public string ExceptionStackTrace { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Contract/Util/Dto/OperationLog/UpdateOperationLogInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Util/Dto/OperationLog/UpdateOperationLogInputDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..29e0fff18683777faf171f980413689b8ea63abb --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Util/Dto/OperationLog/UpdateOperationLogInputDto.cs @@ -0,0 +1,16 @@ +using EOM.TSHotelManagement.Common.Core; + +namespace EOM.TSHotelManagement.Common.Contract +{ + public class UpdateOperationLogInputDto: BaseInputDto + { + public int OperationId { get; set; } + public DateTime OperationTime { get; set; } + public string LogContent { get; set; } + public string OperationAccount { get; set; } + public LogLevel LogLevel { get; set; } + public string SoftwareVersion { get; set; } + public string LoginIpAddress { get; set; } + } +} + diff --git a/EOM.TSHotelManagement.Common.Core/BaseDTO.cs b/EOM.TSHotelManagement.Common.Core/BaseEntity.cs similarity index 77% rename from EOM.TSHotelManagement.Common.Core/BaseDTO.cs rename to EOM.TSHotelManagement.Common.Core/BaseEntity.cs index bd408d14d023bae275e6fa50dd8bdd335f21962d..1e7c46ba2c563191b527704ae1051488d1d341c6 100644 --- a/EOM.TSHotelManagement.Common.Core/BaseDTO.cs +++ b/EOM.TSHotelManagement.Common.Core/BaseEntity.cs @@ -1,15 +1,20 @@ -using System; +using SqlSugar; +using System; namespace EOM.TSHotelManagement.Common.Core { - public class BaseDTO + public class BaseEntity { - + /// + /// 编号 (ID) + /// + [SugarColumn(ColumnName = "id", IsIdentity = true)] + public int Id { get; set; } /// /// 删除标识 /// [SqlSugar.SugarColumn(ColumnName = "delete_mk")] - public int? IsDelete { get; set; } + public int? IsDelete { get; set; } = 0; /// /// 资料创建人 /// @@ -35,16 +40,5 @@ namespace EOM.TSHotelManagement.Common.Core /// [SqlSugar.SugarColumn(IsIgnore = true)] public string UserToken { get; set; } - - /// - /// 页数 - /// - [SqlSugar.SugarColumn(IsIgnore = true)] - public int Page { get; set; } = 0; - /// - /// 总数 - /// - [SqlSugar.SugarColumn(IsIgnore = true)] - public int PageSize { get; set; } = 10; } } diff --git a/EOM.TSHotelManagement.Common.Core/Business/Cash/Cash.cs b/EOM.TSHotelManagement.Common.Core/Business/Asset/Asset.cs similarity index 56% rename from EOM.TSHotelManagement.Common.Core/Business/Cash/Cash.cs rename to EOM.TSHotelManagement.Common.Core/Business/Asset/Asset.cs index 370a0cd721e44f3b86fd389d20bd6994d960967b..a390af386ca94854adcff4f9231ee90335cb7c53 100644 --- a/EOM.TSHotelManagement.Common.Core/Business/Cash/Cash.cs +++ b/EOM.TSHotelManagement.Common.Core/Business/Asset/Asset.cs @@ -29,60 +29,77 @@ namespace EOM.TSHotelManagement.Common.Core /// /// 资产管理 /// - [SqlSugar.SugarTable("cashinfo")] - public class Cash : BaseDTO + [SqlSugar.SugarTable("asset")] + public class Asset : BaseEntity { /// - /// 资产编号 + /// 资产编号 (Asset Number) /// + [SqlSugar.SugarColumn(ColumnName = "asset_number",IsPrimaryKey = true)] [NeedValid] - public string CashNo { get; set; } + public string AssetNumber { get; set; } + /// - /// 资产名称 + /// 资产名称 (Asset Name) /// + [SqlSugar.SugarColumn(ColumnName = "asset_name")] [NeedValid] - public string CashName { get; set; } + public string AssetName { get; set; } + /// - /// 资产总值 + /// 资产总值 (Asset Value) /// + [SqlSugar.SugarColumn(ColumnName = "asset_value")] [NeedValid] - public decimal CashPrice { get; set; } + public decimal AssetValue { get; set; } + /// - /// 资产总值描述 + /// 资产总值描述 (格式化后的字符串) (Asset Value Description - Formatted) /// [SqlSugar.SugarColumn(IsIgnore = true)] [NeedValid] - public string CashPriceStr { get; set; } + public string AssetValueFormatted { get; set; } + /// - /// 所属部门 + /// 所属部门代码 (Department Code) /// + [SqlSugar.SugarColumn(ColumnName = "department_code")] [NeedValid] - public string CashClub { get; set; } + public string DepartmentCode { get; set; } + /// - /// 所属部门描述 + /// 所属部门名称 (Department Name) /// [SqlSugar.SugarColumn(IsIgnore = true)] - public string DeptName { get; set; } + public string DepartmentName { get; set; } + /// - /// 入库时间 + /// 入库时间 (购置日期) (Acquisition Date) /// + [SqlSugar.SugarColumn(ColumnName = "acquisition_date")] [NeedValid] - public DateTime CashTime { get; set; } + public DateTime AcquisitionDate { get; set; } + /// - /// 资产来源 + /// 资产来源 (Asset Source) /// + [SqlSugar.SugarColumn(ColumnName = "asset_source")] [NeedValid] - public string CashSource { get; set; } + public string AssetSource { get; set; } + /// - /// 资产经办人 + /// 资产经办人 (员工ID) (Acquired By - Employee ID) /// + [SqlSugar.SugarColumn(ColumnName = "acquired_by_employee")] [NeedValid] - public string CashPerson { get; set; } + public string AcquiredByEmployeeId { get; set; } + /// - /// 资产经办人 + /// 资产经办人姓名 (Acquired By - Employee Name) /// [SqlSugar.SugarColumn(IsIgnore = true)] - public string PersonName { get; set; } + public string AcquiredByEmployeeName { get; set; } + } } diff --git a/EOM.TSHotelManagement.Common.Core/Business/Customer/CustoType.cs b/EOM.TSHotelManagement.Common.Core/Business/Customer/CustoType.cs index eb754d11c4149b8dcbefd623a535c686fee9105d..500852331237a17447a17afb8c4cd1687ae4f3e1 100644 --- a/EOM.TSHotelManagement.Common.Core/Business/Customer/CustoType.cs +++ b/EOM.TSHotelManagement.Common.Core/Business/Customer/CustoType.cs @@ -27,16 +27,20 @@ namespace EOM.TSHotelManagement.Common.Core /// /// 客户类型 /// - [SqlSugar.SugarTable("usertype")] - public class CustoType : BaseDTO + [SqlSugar.SugarTable("custo_type")] + public class CustoType : BaseEntity { /// - /// 客户类型 + /// 客户类型 (Customer Type) /// - public int UserType { get; set; } + [SqlSugar.SugarColumn(ColumnName = "custo_type", IsPrimaryKey = true)] + public int CustomerType { get; set; } + /// - /// 类型名字 + /// 客户类型名称 (Customer Type Name) /// - public string TypeName { get; set; } + [SqlSugar.SugarColumn(ColumnName = "type_name")] + public string CustomerTypeName { get; set; } + } } diff --git a/EOM.TSHotelManagement.Common.Core/Business/Customer/Custo.cs b/EOM.TSHotelManagement.Common.Core/Business/Customer/Customer.cs similarity index 64% rename from EOM.TSHotelManagement.Common.Core/Business/Customer/Custo.cs rename to EOM.TSHotelManagement.Common.Core/Business/Customer/Customer.cs index ba14baae429a4cc421c5b37b70ddc88fc195423c..33ff9cb1b2c55ff67e84f305d36025b006d8e76b 100644 --- a/EOM.TSHotelManagement.Common.Core/Business/Customer/Custo.cs +++ b/EOM.TSHotelManagement.Common.Core/Business/Customer/Customer.cs @@ -22,7 +22,6 @@ * *模块说明:客户信息类 */ -using EOM.TSHotelManagement.Common.Util; using System; namespace EOM.TSHotelManagement.Common.Core @@ -31,82 +30,78 @@ namespace EOM.TSHotelManagement.Common.Core /// 客户信息 /// [SqlSugar.SugarTable("customer")] - public class Custo : BaseDTO + public class Customer : BaseEntity { /// - /// 自增ID + /// 客户编号 (Customer Number) /// - //[SqlSugar.SugarColumn(ColumnName = "id", IsPrimaryKey = true,IsIdentity = true)] - //public int Id { get; set; } - /// - /// 客户编号 - /// - [UIDisplay("客户编号")] [SqlSugar.SugarColumn(ColumnName = "custo_no", IsPrimaryKey = true)] - public string CustoNo { get; set; } + public string CustomerNumber { get; set; } + /// - /// 客户名称 + /// 客户名称 (Customer Name) /// - [UIDisplay("客户名称")] [SqlSugar.SugarColumn(ColumnName = "custo_name", IsNullable = false)] - public string CustoName { get; set; } + public string CustomerName { get; set; } + /// - /// 客户性别 + /// 客户性别 (Customer Gender) /// - [SqlSugar.SugarColumn(ColumnName = "custo_sex", IsNullable = true)] - public int? CustoSex { get; set; } + [SqlSugar.SugarColumn(ColumnName = "custo_gender", IsNullable = true)] + public int? CustomerGender { get; set; } + /// - /// 证件类型 + /// 证件类型 (Passport Type) /// [SqlSugar.SugarColumn(ColumnName = "passport_type", IsNullable = false)] - public int PassportType { get; set; } + public int PassportId { get; set; } + /// - /// 性别 + /// 性别 (Gender) /// - [UIDisplay("性别")] [SqlSugar.SugarColumn(IsIgnore = true)] - public string SexName { get; set; } + public string GenderName { get; set; } + /// - /// 客户电话 + /// 客户电话 (Customer Phone Number) /// - [UIDisplay("联系方式")] [SqlSugar.SugarColumn(ColumnName = "custo_tel", IsNullable = false)] - public string CustoTel { get; set; } + public string CustomerPhoneNumber { get; set; } + /// - /// 出生日期 + /// 出生日期 (Date of Birth) /// - [UIDisplay("出生日期")] [SqlSugar.SugarColumn(ColumnName = "custo_birth", IsNullable = true)] - public DateTime CustoBirth { get; set; } + public DateTime DateOfBirth { get; set; } + /// - /// 客户类型 + /// 客户类型名称 (Customer Type Name) /// - [UIDisplay("客户类型")] [SqlSugar.SugarColumn(IsIgnore = true)] - public string typeName { get; set; } + public string CustomerTypeName { get; set; } + /// - /// 证件类型 + /// 证件类型名称 (Passport Type Name) /// - [UIDisplay("证件类型")] [SqlSugar.SugarColumn(IsIgnore = true)] public string PassportName { get; set; } + /// - /// 证件号码 + /// 证件号码 (Passport ID) /// - [UIDisplay("证件号码")] [SqlSugar.SugarColumn(ColumnName = "passport_id", IsNullable = false)] - public string CustoID { get; set; } + public string IdCardNumber { get; set; } + /// - /// 居住地址 + /// 居住地址 (Customer Address) /// - [UIDisplay("客户地址")] [SqlSugar.SugarColumn(ColumnName = "custo_address", IsNullable = true)] - public string CustoAddress { get; set; } + public string CustomerAddress { get; set; } + /// - /// 客户类型 + /// 客户类型 (Customer Type) /// [SqlSugar.SugarColumn(ColumnName = "custo_type", IsNullable = false)] - public int CustoType { get; set; } - + public int CustomerType { get; set; } } } diff --git a/EOM.TSHotelManagement.Common.Core/Business/Customer/SexType.cs b/EOM.TSHotelManagement.Common.Core/Business/Customer/GenderType.cs similarity index 81% rename from EOM.TSHotelManagement.Common.Core/Business/Customer/SexType.cs rename to EOM.TSHotelManagement.Common.Core/Business/Customer/GenderType.cs index d91518511075d44f10b5ab83cbb30c4be6031440..bdaa724815724676d129b9105950f7f6c754b53c 100644 --- a/EOM.TSHotelManagement.Common.Core/Business/Customer/SexType.cs +++ b/EOM.TSHotelManagement.Common.Core/Business/Customer/GenderType.cs @@ -22,22 +22,20 @@ * *模块说明:性别类 */ +using System.ComponentModel; + namespace EOM.TSHotelManagement.Common.Core { /// /// 性别 /// - [SqlSugar.SugarTable("sextype")] - public class SexType : BaseDTO + public enum GenderType { - /// - /// 性别ID - /// - public int sexId { get; set; } - /// - /// 性别名称 - /// - public string sexName { get; set; } + [Description("女")] + Female = 0, + + [Description("男")] + Male = 1, } } diff --git a/EOM.TSHotelManagement.Common.Core/Business/Customer/PassPortType.cs b/EOM.TSHotelManagement.Common.Core/Business/Customer/PassPortType.cs index 5c50029a3deba09c53071d56cb2a7024536dea37..dd92736dbe7bba6ece78eeedbfcbb1208b517e91 100644 --- a/EOM.TSHotelManagement.Common.Core/Business/Customer/PassPortType.cs +++ b/EOM.TSHotelManagement.Common.Core/Business/Customer/PassPortType.cs @@ -27,17 +27,19 @@ namespace EOM.TSHotelManagement.Common.Core /// /// 证件类型 /// - [SqlSugar.SugarTable("passporttype")] - public class PassPortType : BaseDTO + [SqlSugar.SugarTable("passport_type")] + public class PassportType : BaseEntity { /// /// 证件类型 /// + [SqlSugar.SugarColumn(ColumnName = "passport_number", IsPrimaryKey = true)] public int PassportId { get; set; } /// /// 证件名称 /// + [SqlSugar.SugarColumn(ColumnName = "passport_name")] public string PassportName { get; set; } } } diff --git a/EOM.TSHotelManagement.Common.Core/Business/Hydroelectricity/Hydroelectricity.cs b/EOM.TSHotelManagement.Common.Core/Business/EnergyManagement/EnergyManagement.cs similarity index 57% rename from EOM.TSHotelManagement.Common.Core/Business/Hydroelectricity/Hydroelectricity.cs rename to EOM.TSHotelManagement.Common.Core/Business/EnergyManagement/EnergyManagement.cs index 395ae3c87d5341513ab04acfe2fb9e8c7e33ee50..2c6193980e5a460bbd83fdd447af623dc9eff93d 100644 --- a/EOM.TSHotelManagement.Common.Core/Business/Hydroelectricity/Hydroelectricity.cs +++ b/EOM.TSHotelManagement.Common.Core/Business/EnergyManagement/EnergyManagement.cs @@ -29,50 +29,55 @@ namespace EOM.TSHotelManagement.Common.Core /// /// 水电信息 /// - [SqlSugar.SugarTable("wtinfo")] - public class Hydroelectricity : BaseDTO + [SqlSugar.SugarTable("energy_management")] + public class EnergyManagement : BaseEntity { /// - /// 信息编号 + /// 信息编号 (Information ID) /// - [SqlSugar.SugarColumn(ColumnName = "WtiNo", IsIdentity = true, IsPrimaryKey = true)] - public int WtiNo { get; set; } + [SqlSugar.SugarColumn(ColumnName = "information_number", IsPrimaryKey = true)] + public string InformationId { get; set; } + /// - /// 房间编号 + /// 房间编号 (Room Number) /// - [SqlSugar.SugarColumn(ColumnName = "RoomNo")] - public string RoomNo { get; set; } + [SqlSugar.SugarColumn(ColumnName = "room_no")] + public string RoomNumber { get; set; } + /// - /// 开始使用时间 + /// 开始使用时间 (Start Date) /// - [SqlSugar.SugarColumn(ColumnName = "UseDate")] - public DateTime UseDate { get; set; } + [SqlSugar.SugarColumn(ColumnName = "use_date")] + public DateTime StartDate { get; set; } + /// - /// 结束使用时间 + /// 结束使用时间 (End Date) /// - [SqlSugar.SugarColumn(ColumnName = "EndDate")] + [SqlSugar.SugarColumn(ColumnName = "end_date")] public DateTime EndDate { get; set; } + /// - /// 水费 + /// 水费 (Water Usage) /// - [SqlSugar.SugarColumn(ColumnName = "WaterUse")] - public decimal WaterUse { get; set; } + [SqlSugar.SugarColumn(ColumnName = "water_use")] + public decimal WaterUsage { get; set; } + /// - /// 电费 + /// 电费 (Power Usage) /// - [SqlSugar.SugarColumn(ColumnName = "PowerUse")] - public decimal PowerUse { get; set; } + [SqlSugar.SugarColumn(ColumnName = "power_use")] + public decimal PowerUsage { get; set; } + /// - /// 记录员 + /// 记录员 (Recorder) /// - [SqlSugar.SugarColumn(ColumnName = "Record", DefaultValue = "Admin")] - public string Record { get; set; } + [SqlSugar.SugarColumn(ColumnName = "recorder", DefaultValue = "Administrator")] + public string Recorder { get; set; } + /// - /// 客户编号 + /// 客户编号 (Customer Number) /// - [SqlSugar.SugarColumn(ColumnName = "CustoNo")] - public string CustoNo { get; set; } - - + [SqlSugar.SugarColumn(ColumnName = "custo_no")] + public string CustomerNumber { get; set; } } } diff --git a/EOM.TSHotelManagement.Common.Core/Business/Fonts/Fonts.cs b/EOM.TSHotelManagement.Common.Core/Business/PromotionContent/PromotionContent.cs similarity index 75% rename from EOM.TSHotelManagement.Common.Core/Business/Fonts/Fonts.cs rename to EOM.TSHotelManagement.Common.Core/Business/PromotionContent/PromotionContent.cs index ca5a7b883ed565c2dd4f375beb77f5123bf34c0d..456dd7f3d31f35bba8355c35261ad516137539c8 100644 --- a/EOM.TSHotelManagement.Common.Core/Business/Fonts/Fonts.cs +++ b/EOM.TSHotelManagement.Common.Core/Business/PromotionContent/PromotionContent.cs @@ -27,17 +27,20 @@ namespace EOM.TSHotelManagement.Common.Core /// /// 酒店宣传联动内容 /// - [SqlSugar.SugarTable("fonts")] - public class Fonts + [SqlSugar.SugarTable("app_banner")] + public class PromotionContent { /// - /// 宣传内容编号 + /// 宣传内容编号 (Promotion Content ID) /// - public int FontsId { get; set; } + [SqlSugar.SugarColumn(ColumnName = "banner_number", IsPrimaryKey = true)] + public int PromotionContentId { get; set; } /// - /// 宣传内容 + /// 宣传内容 (Promotion Content Message) /// - public string FontsMess { get; set; } + [SqlSugar.SugarColumn(ColumnName = "banner_content")] + public string PromotionContentMessage { get; set; } + } } diff --git a/EOM.TSHotelManagement.Common.Core/Business/Reser/Reser.cs b/EOM.TSHotelManagement.Common.Core/Business/Reser/Reser.cs index e54371a592ceb0edfd3e8b1503a220c58d35ffac..ffc47f6bcad3c68986fafe177e8e94edb9c3f619 100644 --- a/EOM.TSHotelManagement.Common.Core/Business/Reser/Reser.cs +++ b/EOM.TSHotelManagement.Common.Core/Business/Reser/Reser.cs @@ -30,36 +30,48 @@ namespace EOM.TSHotelManagement.Common.Core /// 预约列表 /// [SqlSugar.SugarTable("reser")] - public class Reser : BaseDTO + public class Reser : BaseEntity { /// - /// 预约编号 + /// 预约编号 (Reservation ID) /// - public string ReserId { get; set; } + [SqlSugar.SugarColumn(ColumnName = "reser_number", IsPrimaryKey = true)] + public string ReservationId { get; set; } + /// - /// 客户名称 + /// 客户名称 (Customer Name) /// - public string CustoName { get; set; } + [SqlSugar.SugarColumn(ColumnName = "custo_name")] + public string CustomerName { get; set; } + /// - /// 预约电话 + /// 预约电话 (Reservation Phone Number) /// - public string CustoTel { get; set; } + [SqlSugar.SugarColumn(ColumnName = "custo_tel")] + public string ReservationPhoneNumber { get; set; } + /// - /// 预约渠道 + /// 预约渠道 (Reservation Channel) /// - public string ReserWay { get; set; } + [SqlSugar.SugarColumn(ColumnName = "reser_way")] + public string ReservationChannel { get; set; } + /// - /// 预约房号 + /// 预约房号 (Reservation Room Number) /// - public string ReserRoom { get; set; } + [SqlSugar.SugarColumn(ColumnName = "reser_room")] + public string ReservationRoomNumber { get; set; } + /// - /// 预约起始 + /// 预约起始日期 (Reservation Start Date) /// - public DateTime ReserDate { get; set; } + [SqlSugar.SugarColumn(ColumnName = "reser_date")] + public DateTime ReservationStartDate { get; set; } + /// - /// 预约止日 + /// 预约结束日期 (Reservation End Date) /// - public DateTime ReserEndDay { get; set; } - + [SqlSugar.SugarColumn(ColumnName = "reser_end_date")] + public DateTime ReservationEndDate { get; set; } } } diff --git a/EOM.TSHotelManagement.Common.Core/Business/Room/Room.cs b/EOM.TSHotelManagement.Common.Core/Business/Room/Room.cs index dd93a7c49c47047779cdc6df4e3a36f4b9c4c777..f595f8a94f460d375f4302bf7eef15bc5b940979 100644 --- a/EOM.TSHotelManagement.Common.Core/Business/Room/Room.cs +++ b/EOM.TSHotelManagement.Common.Core/Business/Room/Room.cs @@ -23,93 +23,106 @@ *模块说明:房间类 */ using EOM.TSHotelManagement.Common.Util; +using SqlSugar; using System; -//using System.ComponentModel.DataAnnotations.Schema; namespace EOM.TSHotelManagement.Common.Core { /// - /// 房间实体类 + /// 房间实体类 (Room Entity) /// - [SqlSugar.SugarTable("room")] - public class Room : BaseDTO + [SugarTable("room")] + public class Room : BaseEntity { /// - /// 房间编号 + /// 房间编号 (Room Number) /// - [SqlSugar.SugarColumn(ColumnName = "room_no", IsPrimaryKey = true)] + [SugarColumn(ColumnName = "room_no", IsPrimaryKey = true)] [NeedValid] - public string RoomNo { get; set; } + public string RoomNumber { get; set; } + /// - /// 房间类型 + /// 房间类型 (Room Type) /// - [SqlSugar.SugarColumn(ColumnName = "room_type")] + [SugarColumn(ColumnName = "room_type")] [NeedValid] - public int RoomType { get; set; } + public int RoomTypeId { get; set; } + /// - /// 客户编号 + /// 客户编号 (Customer Number) /// - [SqlSugar.SugarColumn(ColumnName = "custo_no")] - public string CustoNo { get; set; } + [SugarColumn(ColumnName = "custo_no")] + public string CustomerNumber { get; set; } + /// - /// 客户姓名 + /// 客户姓名 (Customer Name) /// - [SqlSugar.SugarColumn(IsIgnore = true)] - public string CustoName { get; set; } + [SugarColumn(IsIgnore = true)] + public string CustomerName { get; set; } + /// - /// 最后一次入住时间 + /// 最后一次入住时间 (Last Check-In Time) /// - [SqlSugar.SugarColumn(ColumnName = "check_in_time")] - public DateTime? CheckTime { get; set; } + [SugarColumn(ColumnName = "check_in_time")] + public DateTime? LastCheckInTime { get; set; } + /// - /// 最后一次退房时间 + /// 最后一次退房时间 (Last Check-Out Time) /// - [SqlSugar.SugarColumn(ColumnName = "check_out_time")] - public DateTime? CheckOutTime { get; set; } + [SugarColumn(ColumnName = "check_out_time")] + public DateTime? LastCheckOutTime { get; set; } + /// - /// 房间状态ID + /// 房间状态ID (Room State ID) /// - [SqlSugar.SugarColumn(ColumnName = "room_state_id")] + [SugarColumn(ColumnName = "room_state_id")] [NeedValid] public int RoomStateId { get; set; } + /// - /// 房间状态 + /// 房间状态 (Room State) /// - [SqlSugar.SugarColumn(IsIgnore = true)] + [SugarColumn(IsIgnore = true)] public string RoomState { get; set; } + /// - /// 房间单价 + /// 房间单价 (Room Rent) /// - [SqlSugar.SugarColumn(ColumnName = "room_rent")] + [SugarColumn(ColumnName = "room_rent")] [NeedValid] - public decimal RoomMoney { get; set; } + public decimal RoomRent { get; set; } + /// - /// 房间押金 + /// 房间押金 (Room Deposit) /// - [SqlSugar.SugarColumn(ColumnName = "room_deposit")] + [SugarColumn(ColumnName = "room_deposit")] [NeedValid] public decimal RoomDeposit { get; set; } + /// - /// 房间位置 + /// 房间位置 (Room Location) /// - [SqlSugar.SugarColumn(ColumnName = "room_position")] + [SugarColumn(ColumnName = "room_position")] [NeedValid] - public string RoomPosition { get; set; } + public string RoomLocation { get; set; } + /// - /// 客户类型名称 + /// 客户类型名称 (Customer Type Name) /// - [SqlSugar.SugarColumn(IsIgnore = true)] - public string typeName { get; set; } + [SugarColumn(IsIgnore = true)] + public string CustomerTypeName { get; set; } + /// - /// 房间名称 + /// 房间名称 (Room Name) /// - [SqlSugar.SugarColumn(IsIgnore = true)] + [SugarColumn(IsIgnore = true)] public string RoomName { get; set; } + /// - /// 最后一次入住时间 + /// 最后一次入住时间 (格式化后的字符串) (Last Check-In Time Formatted) /// - [SqlSugar.SugarColumn(IsIgnore = true)] - public string CheckTimeFormat { get; set; } - + [SugarColumn(IsIgnore = true)] + public string LastCheckInTimeFormatted { get; set; } } + } diff --git a/EOM.TSHotelManagement.Common.Core/Business/Room/RoomState.cs b/EOM.TSHotelManagement.Common.Core/Business/Room/RoomState.cs index e7a8b256fd3fbc39464e0b6e50605b2f013796c6..1e727c32650ced6558f08e9ea0f2038e2334a0e4 100644 --- a/EOM.TSHotelManagement.Common.Core/Business/Room/RoomState.cs +++ b/EOM.TSHotelManagement.Common.Core/Business/Room/RoomState.cs @@ -22,22 +22,29 @@ * *模块说明:房间状态类 */ +using SqlSugar; +using System.ComponentModel; + namespace EOM.TSHotelManagement.Common.Core { /// - /// 房间状态 + /// 房间状态 (Room State) /// - [SqlSugar.SugarTable("roomstate")] - public class RoomState : BaseDTO + public enum RoomState { - /// - /// 房间状态编号 - /// - public int RoomStateId { get; set; } - /// - /// 房间状态 - /// - [SqlSugar.SugarColumn(ColumnName = "RoomState")] - public string RoomStateName { get; set; } + [Description("空房")] + Vacant = 1, + + [Description("已住")] + Occupied = 2, + + [Description("维修")] + Maintenance = 3, + + [Description("脏房")] + Dirty = 4, + + [Description("预约")] + Reserved = 5, } } diff --git a/EOM.TSHotelManagement.Common.Core/Business/Room/RoomType.cs b/EOM.TSHotelManagement.Common.Core/Business/Room/RoomType.cs index baa60a4d9b80d60e1ac823d70157e81311ceb265..d314070c41734bf946f194da3584157db232abab 100644 --- a/EOM.TSHotelManagement.Common.Core/Business/Room/RoomType.cs +++ b/EOM.TSHotelManagement.Common.Core/Business/Room/RoomType.cs @@ -23,45 +23,49 @@ *模块说明:房间类型类 */ using EOM.TSHotelManagement.Common.Util; +using SqlSugar; namespace EOM.TSHotelManagement.Common.Core { /// - /// 房间类型 + /// 房间类型 (Room Type) /// - [SqlSugar.SugarTable("roomtype")] - public class RoomType : BaseDTO + [SugarTable("room_type")] + public class RoomType : BaseEntity { /// - /// 类型编号 + /// 类型编号 (Room Type ID) /// - [SqlSugar.SugarColumn(ColumnName = "RoomType")] + [SugarColumn(ColumnName = "room_type", IsPrimaryKey = true)] [NeedValid] - public int Roomtype { get; set; } + public int RoomTypeId { get; set; } + /// - /// 房间类型 + /// 房间类型名称 (Room Type Name) /// + [SugarColumn(ColumnName = "room_name")] [NeedValid] - public string RoomName { get; set; } + public string RoomTypeName { get; set; } /// - /// 房间租金 + /// 房间租金 (Room Rent) /// - [SqlSugar.SugarColumn(ColumnName = "room_rent", ColumnDataType = "decimal")] + [SugarColumn(ColumnName = "room_rent", ColumnDataType = "decimal")] [NeedValid] public decimal RoomRent { get; set; } /// - /// 房间押金 + /// 房间押金 (Room Deposit) /// - [SqlSugar.SugarColumn(ColumnName = "room_deposit")] + [SugarColumn(ColumnName = "room_deposit")] [NeedValid] public decimal RoomDeposit { get; set; } /// - /// 删除标记描述 + /// 删除标记描述 (Delete Mark Description) /// - [SqlSugar.SugarColumn(IsIgnore = true)] - public string DeleteMkNm { get; set; } + [SugarColumn(IsIgnore = true)] + public string DeleteMarkDescription { get; set; } } + } diff --git a/EOM.TSHotelManagement.Common.Core/Business/Sellthing/SellThing.cs b/EOM.TSHotelManagement.Common.Core/Business/Sellthing/SellThing.cs index b99a2980cd389f84d59c90f7342c94f21d692d2c..d3718a9d346635421c5f54364efa003e9d00d0e0 100644 --- a/EOM.TSHotelManagement.Common.Core/Business/Sellthing/SellThing.cs +++ b/EOM.TSHotelManagement.Common.Core/Business/Sellthing/SellThing.cs @@ -25,44 +25,51 @@ //using System.ComponentModel.DataAnnotations.Schema; using EOM.TSHotelManagement.Common.Util; +using SqlSugar; namespace EOM.TSHotelManagement.Common.Core { /// - /// 商品信息 + /// 商品信息 (Product Information) /// - [SqlSugar.SugarTable("sellthing")] - public class SellThing : BaseDTO + [SugarTable("sellthing")] + public class SellThing : BaseEntity { /// - /// 商品编号 + /// 商品编号 (Product Number) /// - [UIDisplay("商品编号")] - public string SellNo { get; set; } + [SugarColumn(ColumnName = "sell_no", IsPrimaryKey = true)] + public string ProductNumber { get; set; } + /// - /// 商品名称 + /// 商品名称 (Product Name) /// - [UIDisplay("商品名称")] - public string SellName { get; set; } + [SugarColumn(ColumnName = "sell_name")] + public string ProductName { get; set; } + /// - /// 商品价格 + /// 商品价格 (Product Price) /// - [UIDisplay("商品价格")] - public decimal SellPrice { get; set; } + [SugarColumn(ColumnName = "sell_price")] + public decimal ProductPrice { get; set; } + /// - /// 商品价格描述 + /// 商品价格描述 (Product Price Description - Formatted) /// - [SqlSugar.SugarColumn(IsIgnore = true)] - public string SellPriceStr { get; set; } + [SugarColumn(IsIgnore = true)] + public string ProductPriceFormatted { get; set; } + /// - /// 规格型号 + /// 规格型号 (Specification) /// - [UIDisplay("规格型号")] - public string format { get; set; } + [SugarColumn(ColumnName = "specification")] + public string Specification { get; set; } + /// - /// 库存 + /// 库存 (Stock) /// - [UIDisplay("库存")] + [SugarColumn(ColumnName = "stock")] public decimal Stock { get; set; } } + } diff --git a/EOM.TSHotelManagement.Common.Core/Business/Spend/Spend.cs b/EOM.TSHotelManagement.Common.Core/Business/Spend/Spend.cs index 0867210238e57d92e2075255ab3c1fec902ee9ab..13bdb35bf1f1e356c907d3830d1de10a8025d274 100644 --- a/EOM.TSHotelManagement.Common.Core/Business/Spend/Spend.cs +++ b/EOM.TSHotelManagement.Common.Core/Business/Spend/Spend.cs @@ -24,68 +24,92 @@ */ using EOM.TSHotelManagement.Common.Util; using System; +using SqlSugar; namespace EOM.TSHotelManagement.Common.Core { /// - /// 消费信息 + /// 消费信息 (Consumption Information) /// - [SqlSugar.SugarTable("custospend")] - public class Spend : BaseDTO + [SugarTable("customer_spend")] + public class Spend : BaseEntity { /// - /// 房间编号 + /// 消费编号 (Consumption Number) /// - [UIDisplay("房间号")] - public string RoomNo { get; set; } + [SugarColumn(ColumnName = "spend_number", IsPrimaryKey = true)] + public string SpendNumber { get; set; } /// - /// 客户编号 + /// 房间编号 (Room Number) /// - [UIDisplay("客户编号")] - public string CustoNo { get; set; } + [SugarColumn(ColumnName = "room_no")] + public string RoomNumber { get; set; } + + /// + /// 客户编号 (Customer Number) + /// + [SugarColumn(ColumnName = "custo_no")] + public string CustomerNumber { get; set; } + /// - /// 商品名称 + /// 商品编号 (Product Number) /// - [UIDisplay("商品名称")] - public string SpendName { get; set; } + [SugarColumn(ColumnName = "product_number")] + public string ProductNumber { get; set; } + + /// + /// 商品名称 (Product Name) + /// + [SugarColumn(ColumnName = "spend_name")] + public string ProductName { get; set; } + /// - /// 消费数量 + /// 消费数量 (Consumption Quantity) /// - [UIDisplay("消费数量",true)] - public int SpendAmount { get; set; } + [SugarColumn(ColumnName = "apend_quantity")] + public int ConsumptionQuantity { get; set; } + /// - /// 商品单价 + /// 商品单价 (Product Price) /// - [UIDisplay("商品单价")] - public decimal SpendPrice { get; set; } + [SugarColumn(ColumnName = "spend_price")] + public decimal ProductPrice { get; set; } + /// - /// 商品单价描述 + /// 商品单价描述 (Product Price Description - Formatted) /// - [SqlSugar.SugarColumn(IsIgnore = true)] - public string SpendPriceStr { get; set; } + [SugarColumn(IsIgnore = true)] + public string ProductPriceFormatted { get; set; } + /// - /// 消费金额 + /// 消费金额 (Consumption Amount) /// - [UIDisplay("消费金额")] - public decimal SpendMoney { get; set; } + [SugarColumn(ColumnName = "spend_amount")] + public decimal ConsumptionAmount { get; set; } + /// - /// 消费金额描述 + /// 消费金额描述 (Consumption Amount Description - Formatted) /// - [SqlSugar.SugarColumn(IsIgnore = true)] - public string SpendMoneyStr { get; set; } + [SugarColumn(IsIgnore = true)] + public string ConsumptionAmountFormatted { get; set; } + /// - /// 消费时间 + /// 消费时间 (Consumption Time) /// - [UIDisplay("消费时间")] - public DateTime SpendTime { get; set; } + [SugarColumn(ColumnName = "spend_time")] + public DateTime ConsumptionTime { get; set; } + /// - /// 结算状态 + /// 结算状态 (Settlement Status) /// - public string MoneyState { get; set; } + [SugarColumn(ColumnName = "settlement_status")] + public string SettlementStatus { get; set; } + /// - /// 结算状态描述 + /// 结算状态描述 (Settlement Status Description) /// - [SqlSugar.SugarColumn(IsIgnore = true)] - public string SpendStateNm { get; set; } + [SugarColumn(IsIgnore = true)] + public string SettlementStatusDescription { get; set; } } + } diff --git a/EOM.TSHotelManagement.Common.Core/Worker/Worker.cs b/EOM.TSHotelManagement.Common.Core/Employee/Employee.cs similarity index 38% rename from EOM.TSHotelManagement.Common.Core/Worker/Worker.cs rename to EOM.TSHotelManagement.Common.Core/Employee/Employee.cs index 94da923cc935b9f08b508eb75a12dd5d23a57d06..32c5f32fe366a926dea29ea4cd72337f6cbe99b1 100644 --- a/EOM.TSHotelManagement.Common.Core/Worker/Worker.cs +++ b/EOM.TSHotelManagement.Common.Core/Employee/Employee.cs @@ -22,117 +22,159 @@ * *模块说明:员工信息类 */ +using SqlSugar; using System; namespace EOM.TSHotelManagement.Common.Core { /// - /// 员工信息 + /// 员工信息 (Employee Information) /// - [SqlSugar.SugarTable("worker")] - public class Worker : BaseDTO + [SugarTable("employee")] + public class Employee : BaseEntity { /// - /// 索引ID + /// 员工账号/工号 (Employee Account/ID) /// - [SqlSugar.SugarColumn(ColumnName = "Id",IsPrimaryKey = true,IsIdentity = true)] - public int Id { get; set; } + [SugarColumn(ColumnName = "employee_number", IsPrimaryKey = true)] + public string EmployeeId { get; set; } + /// - /// 员工账号/工号 + /// 员工姓名 (Employee Name) /// - [SqlSugar.SugarColumn(ColumnName = "WorkerId", IsPrimaryKey = true)] - public string WorkerId { get; set; } + [SugarColumn(ColumnName = "employee_name")] + public string EmployeeName { get; set; } + /// - /// 员工姓名 + /// 出生日期 (Date of Birth) /// - [SqlSugar.SugarColumn(ColumnName = "WorkerName")] - public string WorkerName { get; set; } + [SugarColumn(ColumnName = "employee_date_of_birth")] + public DateTime DateOfBirth { get; set; } + /// - /// 出生日期 + /// 员工性别 (Employee Gender) /// - [SqlSugar.SugarColumn(ColumnName = "WorkerBirthday")] - public DateTime WorkerBirthday { get; set; } + [SugarColumn(ColumnName = "employee_gender")] + public int Gender { get; set; } + /// - /// 员工性别 + /// 员工性别(名称描述) (Employee Gender (Name Description)) /// - [SqlSugar.SugarColumn(ColumnName = "WorkerSex")] - public int WorkerSex { get; set; } + [SugarColumn(IsIgnore = true)] + public string GenderName { get; set; } + /// - /// 员工性别(名称描述) + /// 民族类型 (Ethnicity) /// - [SqlSugar.SugarColumn(IsIgnore = true)] - public string WorkerSexName { get; set; } + [SugarColumn(ColumnName = "employee_nation")] + public string Ethnicity { get; set; } + /// - /// 民族类型 + /// 民族名称 (Ethnicity Name) /// - [SqlSugar.SugarColumn(ColumnName = "WorkerNation")] - public string WorkerNation { get; set; } + [SugarColumn(IsIgnore = true)] + public string EthnicityName { get; set; } + /// - /// 民族名称 + /// 员工电话 (Employee Phone Number) /// - [SqlSugar.SugarColumn(IsIgnore = true)] - public string NationName { get; set; } + [SugarColumn(ColumnName = "employee_tel")] + public string PhoneNumber { get; set; } + /// - /// 员工电话 + /// 所属部门 (Department) /// - [SqlSugar.SugarColumn(ColumnName = "WorkerTel")] - public string WorkerTel { get; set; } + [SugarColumn(ColumnName = "employee_department")] + public string Department { get; set; } + /// - /// 所属部门 + /// 部门名称 (Department Name) /// - [SqlSugar.SugarColumn(ColumnName = "WorkerClub")] - public string WorkerClub { get; set; } + [SugarColumn(IsIgnore = true)] + public string DepartmentName { get; set; } + /// - /// 部门名称 + /// 居住地址 (Residential Address) /// - [SqlSugar.SugarColumn(IsIgnore = true)] - public string ClubName { get; set; } + [SugarColumn(ColumnName = "employee_address")] + public string Address { get; set; } + /// - /// 居住地址 + /// 员工职位 (Employee Position) /// - [SqlSugar.SugarColumn(ColumnName = "WorkerAddress")] - public string WorkerAddress { get; set; } + [SugarColumn(ColumnName = "employee_postion")] + public string Position { get; set; } + /// - /// 员工职位 + /// 职位名称 (Position Name) /// - [SqlSugar.SugarColumn(ColumnName = "WorkerPosition")] - public string WorkerPosition { get; set; } + [SugarColumn(IsIgnore = true)] + public string PositionName { get; set; } + /// - /// 职位名称 + /// 证件类型 (ID Card Type) /// - [SqlSugar.SugarColumn(IsIgnore = true)] - public string PositionName { get; set; } + [SugarColumn(ColumnName = "card_type")] + public int IdCardType { get; set; } + /// - /// 证件号码 + /// 证件号码 (ID Card Number) /// - [SqlSugar.SugarColumn(ColumnName = "CardID")] - public string CardId { get; set; } + [SugarColumn(ColumnName = "card_number")] + public string IdCardNumber { get; set; } + + /// + /// 员工密码 (Employee Password) + /// + [SugarColumn(ColumnName = "employee_password")] + public string Password { get; set; } + /// - /// 员工密码 + /// 员工入职时间 (Hire Date) /// - [SqlSugar.SugarColumn(IsOnlyIgnoreInsert = true)] - public string WorkerPwd { get; set; } + [SugarColumn(ColumnName = "hire_time")] + public DateTime HireDate { get; set; } + /// - /// 员工入职时间 + /// 员工面貌 (Political Affiliation) /// - public DateTime WorkerTime { get; set; } + [SugarColumn(ColumnName = "employee_political")] + public string PoliticalAffiliation { get; set; } + /// - /// 员工面貌 + /// 群众面貌描述 (Political Affiliation Description) /// - public string WorkerFace { get; set; } + [SugarColumn(IsIgnore = true)] + public string PoliticalAffiliationName { get; set; } + /// - /// 群众面貌描述 + /// 证件类型 (ID Card Type) /// - [SqlSugar.SugarColumn(IsIgnore = true)] - public string FaceName { get; set; } + [SugarColumn(IsIgnore = true)] + public string IdCardTypeName { get; set; } + /// - /// 教育程度 + /// 教育程度 (Education Level) /// - public string WorkerEducation { get; set; } + [SugarColumn(ColumnName = "employee_quality")] + public string EducationLevel { get; set; } + + /// + /// 教育程度名称 (Education Level Name) + /// + [SugarColumn(IsIgnore = true)] + public string EducationLevelName { get; set; } + + /// + /// 禁用标记 + /// + [SugarColumn(ColumnName = "enable_mk")] + public int IsEnable { get; set; } + /// - /// 教育程度名称 + /// 邮箱地址 /// - [SqlSugar.SugarColumn(IsIgnore = true)] - public string EducationName { get; set; } + [SugarColumn(ColumnName = "email_address")] + public string EmailAddress { get; set; } } } diff --git a/EOM.TSHotelManagement.Common.Core/Worker/WorkerCheck.cs b/EOM.TSHotelManagement.Common.Core/Employee/EmployeeCheck.cs similarity index 61% rename from EOM.TSHotelManagement.Common.Core/Worker/WorkerCheck.cs rename to EOM.TSHotelManagement.Common.Core/Employee/EmployeeCheck.cs index d0b5c526e2e616cffe5573203178423375d95e5b..99c76a93c29e7132c6add5d28dc0568ebc45b631 100644 --- a/EOM.TSHotelManagement.Common.Core/Worker/WorkerCheck.cs +++ b/EOM.TSHotelManagement.Common.Core/Employee/EmployeeCheck.cs @@ -22,43 +22,50 @@ * *模块说明:打卡考勤类 */ +using SqlSugar; using System; namespace EOM.TSHotelManagement.Common.Core { /// - /// 员工打卡考勤 + /// 员工打卡考勤 (Employee Check-in/Check-out Record) /// - [SqlSugar.SugarTable("workercheck")] - public class WorkerCheck : BaseDTO + [SugarTable("employee_check")] + public class EmployeeCheck : BaseEntity { /// - /// 编号 + /// 打卡编号 /// - [SqlSugar.SugarColumn(IsOnlyIgnoreInsert = true, IsOnlyIgnoreUpdate = true)] - public int Id { get; set; } + [SugarColumn(ColumnName = "check_number")] + public string CheckNumber { get; set; } /// - /// 工号 + /// 员工工号 (Employee ID) /// - public string WorkerNo { get; set; } + [SugarColumn(ColumnName = "employee_number")] + public string EmployeeId { get; set; } + /// - /// 打卡时间 + /// 打卡时间 (Check-in/Check-out Time) /// + [SugarColumn(ColumnName = "check_time")] public DateTime CheckTime { get; set; } + /// - /// 打卡方式 + /// 打卡方式 (Check-in/Check-out Method) /// - public string CheckWay { get; set; } + [SugarColumn(ColumnName = "check_way")] + public string CheckMethod { get; set; } + /// - /// 打卡状态 + /// 打卡状态 (Check-in/Check-out Status) /// - public int CheckState { get; set; } + [SugarColumn(ColumnName = "check_state")] + public int CheckStatus { get; set; } /// - /// 打卡状态 + /// 打卡状态描述 (Check-in/Check-out Status Description) /// - [SqlSugar.SugarColumn(IsIgnore = true)] - public string CheckStateNm { get; set; } - + [SugarColumn(IsIgnore = true)] + public string CheckStatusDescription { get; set; } } } diff --git a/EOM.TSHotelManagement.Common.Core/Worker/WorkerHistory.cs b/EOM.TSHotelManagement.Common.Core/Employee/EmployeeHistory.cs similarity index 70% rename from EOM.TSHotelManagement.Common.Core/Worker/WorkerHistory.cs rename to EOM.TSHotelManagement.Common.Core/Employee/EmployeeHistory.cs index 418850f30f3e434f4d92a22d0002f389768a1828..93c49c4d54d970740f338f88f4484e87743afb48 100644 --- a/EOM.TSHotelManagement.Common.Core/Worker/WorkerHistory.cs +++ b/EOM.TSHotelManagement.Common.Core/Employee/EmployeeHistory.cs @@ -22,40 +22,50 @@ * *模块说明:履历类 */ +using SqlSugar; using System; namespace EOM.TSHotelManagement.Common.Core { /// - /// 员工履历 + /// 员工履历 (Employee History) /// - [SqlSugar.SugarTable("workerhistory")] - public class WorkerHistory : BaseDTO + [SugarTable("employee_history")] + public class EmployeeHistory : BaseEntity { /// - /// 编号 + /// 履历编号 /// - [SqlSugar.SugarColumn(IsOnlyIgnoreInsert = true, IsOnlyIgnoreUpdate = true)] - public int Id { get; set; } + [SugarColumn(ColumnName = "history_number")] + public string HistoryNumber { get; set; } /// - /// 工号 + /// 员工工号 (Employee ID) /// - public string WorkerId { get; set; } + [SugarColumn(ColumnName = "employee_number")] + public string EmployeeId { get; set; } + /// - /// 开始时间 + /// 开始时间 (Start Date) /// + [SugarColumn(ColumnName = "start_date")] public DateTime StartDate { get; set; } + /// - /// 结束时间 + /// 结束时间 (End Date) /// + [SugarColumn(ColumnName = "end_date")] public DateTime EndDate { get; set; } + /// - /// 职位 + /// 职位 (Position) /// + [SugarColumn(ColumnName = "position")] public string Position { get; set; } + /// - /// 公司 + /// 公司 (Company) /// + [SugarColumn(ColumnName = "company")] public string Company { get; set; } } } diff --git a/EOM.TSHotelManagement.Common.Core/Employee/EmployeePhoto.cs b/EOM.TSHotelManagement.Common.Core/Employee/EmployeePhoto.cs new file mode 100644 index 0000000000000000000000000000000000000000..d5fb7464397d2f1fec8bb8a26e34326adf1815b9 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Core/Employee/EmployeePhoto.cs @@ -0,0 +1,23 @@ +using SqlSugar; + +namespace EOM.TSHotelManagement.Common.Core +{ + /// + /// 员工照片 (Employee Photo) + /// + [SugarTable("employee_pic")] + public class EmployeePhoto + { + /// + /// 员工工号 (Employee ID) + /// + [SugarColumn(ColumnName = "employee_number")] + public string EmployeeId { get; set; } + + /// + /// 照片路径 (Photo Path) + /// + [SugarColumn(ColumnName = "pic_url")] + public string PhotoPath { get; set; } + } +} diff --git a/EOM.TSHotelManagement.Common.Core/Worker/WorkerGoodBad.cs b/EOM.TSHotelManagement.Common.Core/Employee/EmployeeRewardPunishment.cs similarity index 55% rename from EOM.TSHotelManagement.Common.Core/Worker/WorkerGoodBad.cs rename to EOM.TSHotelManagement.Common.Core/Employee/EmployeeRewardPunishment.cs index aa8143b11e6d8f4a4bf7341583380aeb19599a39..8b9f5b64b55cce91a75cfd663f9c77bc6b286059 100644 --- a/EOM.TSHotelManagement.Common.Core/Worker/WorkerGoodBad.cs +++ b/EOM.TSHotelManagement.Common.Core/Employee/EmployeeRewardPunishment.cs @@ -22,50 +22,57 @@ * *模块说明:员工奖惩类 */ +using SqlSugar; using System; namespace EOM.TSHotelManagement.Common.Core { /// - /// 员工奖罚 + /// 员工奖惩 (Employee Rewards/Punishments) /// - [SqlSugar.SugarTable("workergoodbad")] - public class WorkerGoodBad : BaseDTO + [SugarTable("reward_punishment")] + public class EmployeeRewardPunishment : BaseEntity { /// - /// 编号 + /// 员工工号 (Employee ID) /// - [SqlSugar.SugarColumn(IsOnlyIgnoreInsert = true, IsOnlyIgnoreUpdate = true)] - public int Id { get; set; } - /// - /// 工号 - /// - public string WorkNo { get; set; } + [SugarColumn(ColumnName = "employee_number")] + public string EmployeeId { get; set; } + /// - /// 奖惩信息 + /// 奖惩信息 (Reward/Punishment Information) /// - public string GBInfo { get; set; } + [SugarColumn(ColumnName = "reward_punishment_information")] + public string RewardPunishmentInformation { get; set; } + /// - /// 奖惩类型 + /// 奖惩类型 (Reward/Punishment Type) /// - public int GBType { get; set; } + [SugarColumn(ColumnName = "reward_punishment_type")] + public string RewardPunishmentType { get; set; } + /// - /// 奖惩操作人 + /// 奖惩操作人 (Reward/Punishment Operator) /// - public string GBOperation { get; set; } + [SugarColumn(ColumnName = "reward_punishment_operator")] + public string RewardPunishmentOperator { get; set; } + /// - /// 奖惩操作人 + /// 操作人姓名 (Operator Name) /// - [SqlSugar.SugarColumn(IsIgnore = true)] - public string OperationName { get; set; } + [SugarColumn(IsIgnore = true)] + public string OperatorName { get; set; } + /// - /// 奖惩时间 + /// 奖惩时间 (Reward/Punishment Time) /// - public DateTime GBTime { get; set; } + [SugarColumn(ColumnName = "reward_punishment_time")] + public DateTime RewardPunishmentTime { get; set; } + /// - /// 类型名称 + /// 类型名称 (Type Name) /// - [SqlSugar.SugarColumn(IsIgnore = true)] - public string TypeName { get; set; } + [SugarColumn(IsIgnore = true)] + public string RewardPunishmentTypeName { get; set; } } } diff --git a/EOM.TSHotelManagement.Common.Core/Worker/GBType.cs b/EOM.TSHotelManagement.Common.Core/Employee/RewardPunishmentType.cs similarity index 70% rename from EOM.TSHotelManagement.Common.Core/Worker/GBType.cs rename to EOM.TSHotelManagement.Common.Core/Employee/RewardPunishmentType.cs index 5553d566fc6a0d06229dca86ea5f9a25ed8b436a..b47b5b5cd23ce333c9d556b12b780b4b73130d62 100644 --- a/EOM.TSHotelManagement.Common.Core/Worker/GBType.cs +++ b/EOM.TSHotelManagement.Common.Core/Employee/RewardPunishmentType.cs @@ -22,23 +22,27 @@ * *模块说明:奖惩类型类 */ -//using EOM.TSHotelManagement.Common.Core; + +using SqlSugar; + namespace EOM.TSHotelManagement.Common.Core { /// - /// 奖惩类型实体类 + /// 奖惩类型实体类 (Reward/Punishment Type Entity) /// - [SqlSugar.SugarTable("gbtype")] - public class GBType : BaseDTO + [SugarTable("reward_punishment_type")] + public class RewardPunishmentType : BaseEntity { /// - /// 奖惩编号 + /// 奖惩类型编号 (Reward/Punishment Type ID) /// - public int GBTypeId { get; set; } + [SugarColumn(ColumnName = "reward_punishment_type_number", IsPrimaryKey = true)] + public string RewardPunishmentTypeId { get; set; } /// - /// 奖惩名称 + /// 奖惩类型名称 (Reward/Punishment Type Name) /// - public string GBName { get; set; } + [SugarColumn(ColumnName = "reward_punishment_type_name")] + public string RewardPunishmentTypeName { get; set; } } } \ No newline at end of file diff --git a/EOM.TSHotelManagement.Common.Core/Sys/NavBar/NavBar.cs b/EOM.TSHotelManagement.Common.Core/Sys/NavBar/NavBar.cs index c6bac1aeb0acbb4444eebd58b1f064e467c838a1..c84b61c839a7728ea28639dee5bdacc0b6bed535 100644 --- a/EOM.TSHotelManagement.Common.Core/Sys/NavBar/NavBar.cs +++ b/EOM.TSHotelManagement.Common.Core/Sys/NavBar/NavBar.cs @@ -1,35 +1,47 @@ -namespace EOM.TSHotelManagement.Common.Core +using SqlSugar; + +namespace EOM.TSHotelManagement.Common.Core { /// - /// 导航控件实体类 + /// 导航控件实体类 (Navigation Bar Entity) /// - [SqlSugar.SugarTable("nav_bar")] - public class NavBar : BaseDTO + [SugarTable("nav_bar")] + public class NavBar : BaseEntity { /// - /// 导航控件ID + /// 导航控件ID (Navigation Bar ID) /// - [SqlSugar.SugarColumn(IsIdentity = true)] - public int nav_id { get; set; } + [SugarColumn(IsIdentity = true, ColumnName = "nav_id", IsPrimaryKey = true)] + public int NavigationBarId { get; set; } + /// - /// 导航控件名称 + /// 导航控件名称 (Navigation Bar Name) /// - public string nav_name { get; set; } + [SugarColumn(ColumnName = "nav_name")] + public string NavigationBarName { get; set; } + /// - /// 导航控件排序 + /// 导航控件排序 (Navigation Bar Order) /// - public int nav_or { get; set; } + [SugarColumn(ColumnName = "nav_or")] + public int NavigationBarOrder { get; set; } + /// - /// 导航控件图片 + /// 导航控件图片 (Navigation Bar Image) /// - public string nav_pic { get; set; } + [SugarColumn(ColumnName = "nav_pic")] + public string NavigationBarImage { get; set; } + /// - /// 导航控件事件 + /// 导航控件事件 (Navigation Bar Event) /// - public string nav_event { get; set; } + [SugarColumn(ColumnName = "nav_event")] + public string NavigationBarEvent { get; set; } + /// - /// 导航控件事件 + /// 导航控件左边距 (Navigation Bar Margin Left) /// - public int margin_left { get; set; } + [SugarColumn(ColumnName = "margin_left")] + public int MarginLeft { get; set; } } } diff --git a/EOM.TSHotelManagement.Common.Core/Zero/Admin.cs b/EOM.TSHotelManagement.Common.Core/SystemManagement/Administrator.cs similarity index 55% rename from EOM.TSHotelManagement.Common.Core/Zero/Admin.cs rename to EOM.TSHotelManagement.Common.Core/SystemManagement/Administrator.cs index 6b9358a9678db63a7a15e1ac9cb832891e47278f..34de4286de7b4dcc687d8178529cd708b47ad7b1 100644 --- a/EOM.TSHotelManagement.Common.Core/Zero/Admin.cs +++ b/EOM.TSHotelManagement.Common.Core/SystemManagement/Administrator.cs @@ -23,84 +23,84 @@ *模块说明:管理员实体类 */ using EOM.TSHotelManagement.Common.Util; +using SqlSugar; namespace EOM.TSHotelManagement.Common.Core { /// - /// 管理员实体类 + /// 管理员实体类 (Administrator Entity) /// - [SqlSugar.SugarTable("admininfo")] - public class Admin : BaseDTO + [SugarTable("administrator")] + public class Administrator : BaseEntity { /// - /// 构造函数 + /// 构造函数 (Constructor) /// - public Admin() + public Administrator() { } /// - /// 编号 + /// 管理员账号 (Administrator Account) /// - [SqlSugar.SugarColumn(IsPrimaryKey = true, IsIdentity = true)] - public int Id { get; set; } + [UIDisplay("管理员账号")] + [SugarColumn(ColumnName = "admin_number", IsNullable = false)] + [NeedValid] + public string Number { get; set; } - private string _AdminAccount; /// - /// 管理员账号 + /// 管理员账号 (Administrator Account) /// [UIDisplay("管理员账号")] - [SqlSugar.SugarColumn(IsPrimaryKey = true)] + [SugarColumn(ColumnName = "admin_account", IsNullable = false)] [NeedValid] - public string AdminAccount { get { return this._AdminAccount; } set { this._AdminAccount = value; } } + public string Account { get; set; } - private string _AdminPassword; /// - /// 管理员密码 + /// 管理员密码 (Administrator Password) /// + [SugarColumn(ColumnName = "admin_password", IsNullable = false)] [NeedValid] - public string AdminPassword { get { return this._AdminPassword; } set { this._AdminPassword = value; } } + public string Password { get; set; } - private string _AdminType; /// - /// 管理员类型 + /// 管理员类型 (Administrator Type) /// + [SugarColumn(ColumnName = "admin_type", IsNullable = false)] [NeedValid] - public string AdminType { get { return this._AdminType; } set { this._AdminType = value; } } + public string Type { get; set; } - private string _AdminName; /// - /// 管理员名称 + /// 管理员名称 (Administrator Name) /// [UIDisplay("管理员名称")] + [SugarColumn(ColumnName = "admin_name", IsNullable = false)] [NeedValid] - public string AdminName { get { return this._AdminName; } set { this._AdminName = value; } } + public string Name { get; set; } - private System.Int32 _IsAdmin; /// - /// 是否为超级管理员 + /// 是否为超级管理员 (Is Super Administrator) /// [UIDisplay("超级管理员?")] - [NeedValid] - public System.Int32 IsAdmin { get { return this._IsAdmin; } set { this._IsAdmin = value; } } + [SugarColumn(ColumnName = "is_admin")] + public int IsSuperAdmin { get; set; } /// - /// 管理员类型描述 + /// 是否为超级管理员描述 (Is Super Administrator Description) /// - [SqlSugar.SugarColumn(IsIgnore = true)] - public string IsAdminNm { get; set; } + [SugarColumn(IsIgnore = true)] + public string IsSuperAdminDescription { get; set; } /// - /// 管理员类型 + /// 管理员类型名称 (Administrator Type Name) /// - [SqlSugar.SugarColumn(IsIgnore = true)] + [SugarColumn(IsIgnore = true)] public string TypeName { get; set; } /// - /// 删除标记描述 + /// 删除标记描述 (Delete Flag Description) /// - [SqlSugar.SugarColumn(IsIgnore = true)] - public string DeleteNm { get; set; } - + [SugarColumn(IsIgnore = true)] + public string DeleteDescription { get; set; } } } diff --git a/EOM.TSHotelManagement.Common.Core/Zero/AdminType.cs b/EOM.TSHotelManagement.Common.Core/SystemManagement/AdministratorType.cs similarity index 77% rename from EOM.TSHotelManagement.Common.Core/Zero/AdminType.cs rename to EOM.TSHotelManagement.Common.Core/SystemManagement/AdministratorType.cs index 6762443778475ebb307cab67d58efddc363fa209..6034ee6f926e53e044a4a07440d1b847581eaf47 100644 --- a/EOM.TSHotelManagement.Common.Core/Zero/AdminType.cs +++ b/EOM.TSHotelManagement.Common.Core/SystemManagement/AdministratorType.cs @@ -22,28 +22,26 @@ * *模块说明:管理员类型 */ +using SqlSugar; + namespace EOM.TSHotelManagement.Common.Core { /// - /// 管理员类型 + /// 管理员类型 (Administrator Type) /// - [SqlSugar.SugarTable("admintype")] - public class AdminType : BaseDTO + [SugarTable("administrator_type")] + public class AdministratorType : BaseEntity { /// - /// 编号 + /// 类型编号 (Type ID) /// - public int Id { get; set; } + [SugarColumn(ColumnName = "type_id")] + public string TypeId { get; set; } /// - /// 管理员类型 + /// 类型名称 (Type Name) /// - public string type_id { get; set; } - - /// - /// 类型名称 - /// - public string type_name { get; set; } - + [SugarColumn(ColumnName = "type_name")] + public string TypeName { get; set; } } } diff --git a/EOM.TSHotelManagement.Common.Core/Zero/Notice.cs b/EOM.TSHotelManagement.Common.Core/SystemManagement/AppointmentNotice.cs similarity index 60% rename from EOM.TSHotelManagement.Common.Core/Zero/Notice.cs rename to EOM.TSHotelManagement.Common.Core/SystemManagement/AppointmentNotice.cs index 9d453306e1c51ccf058ab9a9ecd7172d18698ee8..096b6a6d76d801142121d54160a9c6d584f49a84 100644 --- a/EOM.TSHotelManagement.Common.Core/Zero/Notice.cs +++ b/EOM.TSHotelManagement.Common.Core/SystemManagement/AppointmentNotice.cs @@ -22,51 +22,57 @@ * *模块说明:任命公告类 */ +using SqlSugar; using System; namespace EOM.TSHotelManagement.Common.Core { /// - /// 任命公告 + /// 任命公告 (Appointment AppointmentNotice) /// - [SqlSugar.SugarTable("uploadinfo")] - public class Notice : BaseDTO + [SugarTable("appointment_notice")] + public class AppointmentNotice : BaseEntity { /// - /// 公告编号 + /// 公告编号 (AppointmentNotice Number) /// - [SqlSugar.SugarColumn(ColumnName = "NoticeNo")] - public string NoticeNo { get; set; } + [SugarColumn(ColumnName = "notice_no", IsPrimaryKey = true)] + public string NoticeNumber { get; set; } + /// - /// 公告主题 + /// 公告主题 (AppointmentNotice Theme) /// - [SqlSugar.SugarColumn(ColumnName = "Noticetheme")] - public string Noticetheme { get; set; } + [SugarColumn(ColumnName = "notice_theme")] + public string NoticeTheme { get; set; } + /// - /// 公告类型 + /// 公告类型 (AppointmentNotice Type) /// - [SqlSugar.SugarColumn(ColumnName = "NoticeType")] + [SugarColumn(ColumnName = "notice_type")] public string NoticeType { get; set; } + /// - /// 公告类型(描述) + /// 公告类型(描述) (AppointmentNotice Type Description) /// - [SqlSugar.SugarColumn(IsIgnore = true)] - public string NoticeTypeName { get; set; } + [SugarColumn(IsIgnore = true)] + public string NoticeTypeDescription { get; set; } + /// - /// 公告时间 + /// 公告时间 (AppointmentNotice Time) /// - [SqlSugar.SugarColumn(ColumnName = "NoticeTime")] + [SugarColumn(ColumnName = "notice_time")] public DateTime NoticeTime { get; set; } + /// - /// 公告正文 + /// 公告正文 (AppointmentNotice Content) /// - [SqlSugar.SugarColumn(ColumnName = "NoticeContent")] + [SugarColumn(ColumnName = "notice_content")] public string NoticeContent { get; set; } + /// - /// 发文部门 + /// 发文部门 (Issuing Department) /// - [SqlSugar.SugarColumn(ColumnName = "NoticeClub")] - public string NoticeClub { get; set; } - + [SugarColumn(ColumnName = "notice_department")] + public string IssuingDepartment { get; set; } } } diff --git a/EOM.TSHotelManagement.Common.Core/Zero/Dept.cs b/EOM.TSHotelManagement.Common.Core/SystemManagement/Department.cs similarity index 54% rename from EOM.TSHotelManagement.Common.Core/Zero/Dept.cs rename to EOM.TSHotelManagement.Common.Core/SystemManagement/Department.cs index bf1bd07ca1f874aeed48144045859edd4f6cbc10..366325dc411c226291dfb0f75a585ae20d8087ee 100644 --- a/EOM.TSHotelManagement.Common.Core/Zero/Dept.cs +++ b/EOM.TSHotelManagement.Common.Core/SystemManagement/Department.cs @@ -22,61 +22,63 @@ * *模块说明:部门实体类 */ +using SqlSugar; using System; namespace EOM.TSHotelManagement.Common.Core { /// - /// 部门表 + /// 部门表 (Department Table) /// - [SqlSugar.SugarTable("dept")] - public class Dept : BaseDTO + [SugarTable("department")] + public class Department : BaseEntity { /// - /// 索引ID + /// 部门编号 (Department Number) /// - [SqlSugar.SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)] - public int Id { get; set; } - /// - /// 部门编号 - /// - [SqlSugar.SugarColumn(ColumnName = "dept_no")] - public string dept_no { get; set; } + [SugarColumn(ColumnName = "dept_no")] + public string DepartmentNumber { get; set; } + /// - /// 部门名称 + /// 部门名称 (Department Name) /// - [SqlSugar.SugarColumn(ColumnName = "dept_name")] - public string dept_name { get; set; } + [SugarColumn(ColumnName = "dept_name")] + public string DepartmentName { get; set; } + /// - /// 部门描述 + /// 部门描述 (Department Description) /// - [SqlSugar.SugarColumn(ColumnName = "dept_desc")] - public string dept_desc { get; set; } + [SugarColumn(ColumnName = "dept_desc")] + public string DepartmentDescription { get; set; } + /// - /// 创建时间(部门) + /// 创建时间(部门) (Department Creation Date) /// - [SqlSugar.SugarColumn(ColumnName = "dept_date")] - public DateTime dept_date { get; set; } + [SugarColumn(ColumnName = "dept_date")] + public DateTime DepartmentCreationDate { get; set; } + /// - /// 部门主管 + /// 部门主管 (Department Leader) /// - [SqlSugar.SugarColumn(ColumnName = "dept_leader")] - public string dept_leader { get; set; } + [SugarColumn(ColumnName = "dept_leader")] + public string DepartmentLeader { get; set; } + /// - /// 部门主管 + /// 部门主管姓名 (Department Leader Name) /// - [SqlSugar.SugarColumn(IsIgnore = true)] - public string leader_name { get; set; } + [SugarColumn(IsIgnore = true)] + public string LeaderName { get; set; } + /// - /// 上级部门 + /// 上级部门编号 (Parent Department Number) /// - [SqlSugar.SugarColumn(ColumnName = "dept_parent")] - public string dept_parent { get; set; } + [SugarColumn(ColumnName = "dept_parent")] + public string ParentDepartmentNumber { get; set; } + /// - /// 上级部门 + /// 上级部门名称 (Parent Department Name) /// - [SqlSugar.SugarColumn(IsIgnore = true)] - public string parent_name { get; set; } - + [SugarColumn(IsIgnore = true)] + public string ParentDepartmentName { get; set; } } } diff --git a/EOM.TSHotelManagement.Common.Core/Zero/Education.cs b/EOM.TSHotelManagement.Common.Core/SystemManagement/Education.cs similarity index 75% rename from EOM.TSHotelManagement.Common.Core/Zero/Education.cs rename to EOM.TSHotelManagement.Common.Core/SystemManagement/Education.cs index ac66ca6dcbdec16afacc3934d1351eea1b835b2d..fbea359e3f2616f5c21b1a7e7ea49dbaf2b8763d 100644 --- a/EOM.TSHotelManagement.Common.Core/Zero/Education.cs +++ b/EOM.TSHotelManagement.Common.Core/SystemManagement/Education.cs @@ -22,27 +22,26 @@ * *模块说明:学历类 */ +using SqlSugar; + namespace EOM.TSHotelManagement.Common.Core { /// - /// 学历 + /// 学历 (Education) /// - [SqlSugar.SugarTable("education")] - public class Education : BaseDTO + [SugarTable("qualification")] + public class Education : BaseEntity { /// - /// 索引ID - /// - [SqlSugar.SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)] - public int Id { get; set; } - /// - /// 学历编号 + /// 学历编号 (Education Number) /// - public string education_no { get; set; } + [SugarColumn(ColumnName = "education_no")] + public string EducationNumber { get; set; } + /// - /// 学历名称 + /// 学历名称 (Education Name) /// - public string education_name { get; set; } - + [SugarColumn(ColumnName = "education_name")] + public string EducationName { get; set; } } } diff --git a/EOM.TSHotelManagement.Common.Core/Zero/Menu.cs b/EOM.TSHotelManagement.Common.Core/SystemManagement/Menu.cs similarity index 61% rename from EOM.TSHotelManagement.Common.Core/Zero/Menu.cs rename to EOM.TSHotelManagement.Common.Core/SystemManagement/Menu.cs index b8995b5fc82b7dc635a312e37628220d8aa711cb..9b95319326e243ec7da114eb9abc6f7c03d0737a 100644 --- a/EOM.TSHotelManagement.Common.Core/Zero/Menu.cs +++ b/EOM.TSHotelManagement.Common.Core/SystemManagement/Menu.cs @@ -29,47 +29,46 @@ using SqlSugar; namespace EOM.TSHotelManagement.Common.Core { /// - /// 菜单表 - /// + /// 菜单表 (Menu Table) + /// [SugarTable("menu")] - public class Menu: BaseDTO + public class Menu : BaseEntity { + [SugarColumn(ColumnName = "id",IsPrimaryKey = true,IsIdentity = true)] + public new int Id { get; set; } /// - /// 备 注:自增长ID + /// 备 注:菜单键 (Menu Key) /// 默认值: - /// - [SugarColumn(ColumnName="id" ,IsPrimaryKey = true) ] - public int Id { get; set; } - - /// - /// 备 注:菜单键 - /// 默认值: - /// - [SugarColumn(ColumnName="key" ) ] - public string? Key { get; set; } - + /// + [SugarColumn(ColumnName = "key")] + public string? Key { get; set; } + /// - /// 备 注:菜单标题 + /// 备 注:菜单标题 (Menu Title) /// 默认值: - /// - [SugarColumn(ColumnName="title" ) ] - public string Title { get; set; } = null!; - + /// + [SugarColumn(ColumnName = "title")] + public string Title { get; set; } = null!; + /// - /// 备 注:菜单路径 + /// 备 注:菜单路径 (Menu Path) /// 默认值: - /// - [SugarColumn(ColumnName="path" ) ] - public string? Path { get; set; } - + /// + [SugarColumn(ColumnName = "path")] + public string? Path { get; set; } + /// - /// 备 注:父级ID + /// 备 注:父级ID (Parent ID) /// 默认值: - /// - [SugarColumn(ColumnName="parent" ) ] - public int? Parent { get; set; } - + /// + [SugarColumn(ColumnName = "parent")] + public int? Parent { get; set; } + /// + /// 图标 + /// + [SugarColumn(ColumnName = "icon")] + public string Icon { get; set; } } - + } \ No newline at end of file diff --git a/EOM.TSHotelManagement.Common.Core/SystemManagement/MenuViewModel.cs b/EOM.TSHotelManagement.Common.Core/SystemManagement/MenuViewModel.cs new file mode 100644 index 0000000000000000000000000000000000000000..dee1fd889f2134e19193a4e708444db159904ad5 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Core/SystemManagement/MenuViewModel.cs @@ -0,0 +1,39 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EOM.TSHotelManagement.Common.Core +{ + /// + /// 菜单视图模型 (Menu View Model) + /// + public class MenuViewModel + { + /// + /// 菜单主键 (Menu Key) + /// + public string Key { get; set; } + + /// + /// 菜单标题 (Menu Title) + /// + public string Title { get; set; } + + /// + /// 菜单路径 (Menu Path) + /// + public string Path { get; set; } + + /// + /// 图标 + /// + public string Icon { get; set; } + + /// + /// 子菜单 (Child Menus) + /// + public List Children { get; set; } = new List(); + } +} diff --git a/EOM.TSHotelManagement.Common.Core/Zero/Nation.cs b/EOM.TSHotelManagement.Common.Core/SystemManagement/Nation.cs similarity index 76% rename from EOM.TSHotelManagement.Common.Core/Zero/Nation.cs rename to EOM.TSHotelManagement.Common.Core/SystemManagement/Nation.cs index cfbdbc8ee026ca32ea2dd16d7950ea6e40067cf3..42a7261335630132766551f8fb1486172d4bbeb4 100644 --- a/EOM.TSHotelManagement.Common.Core/Zero/Nation.cs +++ b/EOM.TSHotelManagement.Common.Core/SystemManagement/Nation.cs @@ -22,27 +22,26 @@ * *模块说明:民族类 */ +using SqlSugar; + namespace EOM.TSHotelManagement.Common.Core { /// - /// 民族 + /// 民族 (Nation) /// - [SqlSugar.SugarTable("nation")] - public class Nation : BaseDTO + [SugarTable("nation")] + public class Nation : BaseEntity { /// - /// 索引ID - /// - [SqlSugar.SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)] - public int Id { get; set; } - /// - /// 民族编号 + /// 民族编号 (Nation Number) /// - public string nation_no { get; set; } + [SugarColumn(ColumnName = "nation_no")] + public string NationNumber { get; set; } + /// - /// 民族名称 + /// 民族名称 (Nation Name) /// - public string nation_name { get; set; } - + [SugarColumn(ColumnName = "nation_name")] + public string NationName { get; set; } } } diff --git a/EOM.TSHotelManagement.Common.Core/SystemManagement/PoliticalAffiliation.cs b/EOM.TSHotelManagement.Common.Core/SystemManagement/PoliticalAffiliation.cs new file mode 100644 index 0000000000000000000000000000000000000000..290cc0d9b623a0bc451d7a3f278c3b93df44aa22 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Core/SystemManagement/PoliticalAffiliation.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EOM.TSHotelManagement.Common.Core +{ + public enum PoliticalAffiliation + { + [Description("党员")] + PoliticalPartyMember = 1, + + [Description("团员")] + GroupMember = 2, + + [Description("群众")] + TheMasses = 3, + + [Description("民主党派")] + DemocraticParty = 4, + + [Description("无党派人士")] + NonParty = 5, + + [Description("预备党员")] + PoliticalPartyReserveMember = 6 + } +} diff --git a/EOM.TSHotelManagement.Common.Core/Zero/position.cs b/EOM.TSHotelManagement.Common.Core/SystemManagement/Position.cs similarity index 75% rename from EOM.TSHotelManagement.Common.Core/Zero/position.cs rename to EOM.TSHotelManagement.Common.Core/SystemManagement/Position.cs index e1780ebc1dc5c4d07351a51450bc39bb466ca64b..ac6c1f5dc2c0a8264c17330acb0aea0a98f96cae 100644 --- a/EOM.TSHotelManagement.Common.Core/Zero/position.cs +++ b/EOM.TSHotelManagement.Common.Core/SystemManagement/Position.cs @@ -22,27 +22,26 @@ * *模块说明:职务类 */ +using SqlSugar; + namespace EOM.TSHotelManagement.Common.Core { /// - /// 职位 + /// 职位 (Position) /// - [SqlSugar.SugarTable("position")] - public class Position : BaseDTO + [SugarTable("position")] + public class Position : BaseEntity { /// - /// 索引ID - /// - [SqlSugar.SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)] - public int Id { get; set; } - /// - /// 职位编号 + /// 职位编号 (Position Number) /// - public string position_no { get; set; } + [SugarColumn(ColumnName = "position_no")] + public string PositionNumber { get; set; } + /// - /// 职位名称 + /// 职位名称 (Position Name) /// - public string position_name { get; set; } - + [SugarColumn(ColumnName = "position_name")] + public string PositionName { get; set; } } } diff --git a/EOM.TSHotelManagement.Common.Core/SystemManagement/Role.cs b/EOM.TSHotelManagement.Common.Core/SystemManagement/Role.cs new file mode 100644 index 0000000000000000000000000000000000000000..ea7c0cbfe1bd1140ad8aecbb0f46fb3671888047 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Core/SystemManagement/Role.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +namespace EOM.TSHotelManagement.Common.Core +{ + /// + /// 角色 + /// + [SugarTable("role")] + public class Role : BaseEntity + { + /// + /// 备 注:角色编码 + /// 默认值: + /// + [SugarColumn(ColumnName = "role_number", IsPrimaryKey = true)] + public string RoleNumber { get; set; } = null!; + + /// + /// 备 注:角色名字 + /// 默认值: + /// + [SugarColumn(ColumnName = "role_name")] + public string RoleName { get; set; } = null!; + + /// + /// 备 注:角色描述 + /// 默认值: + /// + [SugarColumn(ColumnName = "role_description")] + public string? RoleDescription { get; set; } + } + +} \ No newline at end of file diff --git a/EOM.TSHotelManagement.Common.Core/SystemManagement/RolePermission.cs b/EOM.TSHotelManagement.Common.Core/SystemManagement/RolePermission.cs new file mode 100644 index 0000000000000000000000000000000000000000..e7812561a8601d0e0b5217d2a7d11e8a74b62672 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Core/SystemManagement/RolePermission.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +namespace EOM.TSHotelManagement.Common.Core +{ + /// + /// 角色权限关联表 + /// + [SugarTable("role_permission")] + public class RolePermission : BaseEntity + { + /// + /// 备 注:角色编码 + /// 默认值: + /// + [SugarColumn(ColumnName = "role_number")] + public string RoleNumber { get; set; } = null!; + + /// + /// 备 注:权限编码 + /// 默认值: + /// + [SugarColumn(ColumnName = "permission_number")] + public string PermissionNumber { get; set; } = null!; + } + +} \ No newline at end of file diff --git a/EOM.TSHotelManagement.Common.Core/Zero/CheckInfo.cs b/EOM.TSHotelManagement.Common.Core/SystemManagement/SupervisionStatistics.cs similarity index 51% rename from EOM.TSHotelManagement.Common.Core/Zero/CheckInfo.cs rename to EOM.TSHotelManagement.Common.Core/SystemManagement/SupervisionStatistics.cs index 495dafc2e591d55438db527a4eb7005c4eef2ab5..6f0355f562fc5b6f43e45343b2403d9303fb7053 100644 --- a/EOM.TSHotelManagement.Common.Core/Zero/CheckInfo.cs +++ b/EOM.TSHotelManagement.Common.Core/SystemManagement/SupervisionStatistics.cs @@ -22,46 +22,62 @@ * *模块说明:监管统计类 */ +using SqlSugar; + namespace EOM.TSHotelManagement.Common.Core { /// - /// 监管统计 + /// 监管统计 (Supervision Statistics) /// - [SqlSugar.SugarTable("checkinfo")] - public class CheckInfo : BaseDTO + [SugarTable("supervision_statistics")] + public class SupervisionStatistics : BaseEntity { /// - /// 监管统计编号 + /// 监管统计编号 (Supervision Statistics Number) /// - public string CheckNo { get; set; } + [SugarColumn(ColumnName = "statistics_number", IsPrimaryKey = true)] + public string StatisticsNumber { get; set; } + /// - /// 本次监管部门 + /// 本次监管部门 (Supervising Department) /// - public string CheckClub { get; set; } + [SugarColumn(ColumnName = "supervising_department")] + public string SupervisingDepartment { get; set; } + /// - /// 本次监管部门名称 + /// 本次监管部门名称 (Supervising Department Name) /// - [SqlSugar.SugarColumn(IsIgnore = true)] - public string CheckClubName { get; set; } + [SugarColumn(IsIgnore = true)] + public string SupervisingDepartmentName { get; set; } + /// - /// 本次监管进度 + /// 本次监管进度 (Supervision Progress) /// - public string CheckProgres { get; set; } + [SugarColumn(ColumnName = "supervision_progress")] + public string SupervisionProgress { get; set; } + /// - /// 本次监管损失 + /// 本次监管损失 (Supervision Loss) /// - public string CheckCash { get; set; } + [SugarColumn(ColumnName = "supervision_loss")] + public string SupervisionLoss { get; set; } + /// - /// 本次评分 + /// 本次评分 (Supervision Score) /// - public int CheckScore { get; set; } + [SugarColumn(ColumnName = "supervision_score")] + public int SupervisionScore { get; set; } + /// - /// 监管统计人 + /// 监管统计人 (Supervision Statistician) /// - public string CheckPerson { get; set; } + [SugarColumn(ColumnName = "supervision_statistician")] + public string SupervisionStatistician { get; set; } + /// - /// 本次监管建议 + /// 本次监管建议 (Supervision Advice) /// - public string CheckAdvice { get; set; } + [SugarColumn(ColumnName = "supervision_advice")] + public string SupervisionAdvice { get; set; } } } diff --git a/EOM.TSHotelManagement.Common.Core/Zero/Base.cs b/EOM.TSHotelManagement.Common.Core/SystemManagement/SystemInformation.cs similarity index 77% rename from EOM.TSHotelManagement.Common.Core/Zero/Base.cs rename to EOM.TSHotelManagement.Common.Core/SystemManagement/SystemInformation.cs index edd005917c4033169bb7b805973fbb60f282ef22..97e48a33fbb58a75e5bb9fc688edddd35bf9521e 100644 --- a/EOM.TSHotelManagement.Common.Core/Zero/Base.cs +++ b/EOM.TSHotelManagement.Common.Core/SystemManagement/SystemInformation.cs @@ -22,22 +22,26 @@ * *模块说明:系统信息静态类 */ +using SqlSugar; + namespace EOM.TSHotelManagement.Common.Core { /// - /// 系统信息 + /// 系统信息 (System Information) /// - [SqlSugar.SugarTable("base")] - public class Base + [SugarTable("app_config_base")] + public class SystemInformation { /// - /// 地址编号 + /// 地址编号 (URL Number) /// - public int url_no { get; set; } + [SugarColumn(ColumnName = "url_no", IsPrimaryKey = true)] + public int UrlNumber { get; set; } /// - /// 地址 + /// 地址 (URL Address) /// - public string url_addr { get; set; } + [SugarColumn(ColumnName = "url_addr")] + public string UrlAddress { get; set; } } } diff --git a/EOM.TSHotelManagement.Common.Core/SystemManagement/UserRole.cs b/EOM.TSHotelManagement.Common.Core/SystemManagement/UserRole.cs new file mode 100644 index 0000000000000000000000000000000000000000..728a0687eafc34a8f7119757995675f8135b2cad --- /dev/null +++ b/EOM.TSHotelManagement.Common.Core/SystemManagement/UserRole.cs @@ -0,0 +1,28 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using SqlSugar; +namespace EOM.TSHotelManagement.Common.Core +{ + /// + /// 用户角色关联表 + /// + [SugarTable("user_role")] + public class UserRole:BaseEntity + { + /// + /// 备 注:角色编码 + /// 默认值: + /// + [SugarColumn(ColumnName="role_number" ) ] + public string RoleNumber { get; set; } = null!; + + /// + /// 备 注:用户编码 + /// 默认值: + /// + [SugarColumn(ColumnName="user_number" ) ] + public string UserNumber { get; set; } = null!; + } + +} \ No newline at end of file diff --git a/EOM.TSHotelManagement.Common.Core/Zero/VipRule.cs b/EOM.TSHotelManagement.Common.Core/SystemManagement/VipLevelRule.cs similarity index 64% rename from EOM.TSHotelManagement.Common.Core/Zero/VipRule.cs rename to EOM.TSHotelManagement.Common.Core/SystemManagement/VipLevelRule.cs index 5e4536b5d095f19018fe11d84e76ca14a63e5e42..c549dc69e4da41d5de9632a471bd166dea25d670 100644 --- a/EOM.TSHotelManagement.Common.Core/Zero/VipRule.cs +++ b/EOM.TSHotelManagement.Common.Core/SystemManagement/VipLevelRule.cs @@ -22,48 +22,50 @@ * *模块说明:会员等级规则类 */ +using SqlSugar; + namespace EOM.TSHotelManagement.Common.Core { /// - /// 会员等级规则类 + /// 会员等级规则类 (VIP Level Rule Class) /// - [SqlSugar.SugarTable("vip_rule")] - public class VipRule : BaseDTO + [SugarTable("vip_rule")] + public class VipLevelRule : BaseEntity { /// - /// 索引ID + /// 索引ID (Index ID) /// - [SqlSugar.SugarColumn(ColumnName = "id",IsIdentity = true,IsPrimaryKey = true)] + [SugarColumn(ColumnName = "id", IsIdentity = true)] public int Id { get; set; } /// - /// 会员规则流水号 + /// 会员规则流水号 (VIP Rule Serial Number) /// - [SqlSugar.SugarColumn(ColumnName = "rule_id", IsPrimaryKey = true)] - public string RuleId { get; set; } + [SugarColumn(ColumnName = "rule_id", IsPrimaryKey = true)] + public string RuleSerialNumber { get; set; } /// - /// 会员规则名称 + /// 会员规则名称 (VIP Rule Name) /// - [SqlSugar.SugarColumn(ColumnName = "rule_name")] + [SugarColumn(ColumnName = "rule_name")] public string RuleName { get; set; } /// - /// 预设数值(历史消费总额) + /// 预设数值(历史消费总额) (Preset Value - Total Historical Spending) /// - [SqlSugar.SugarColumn(ColumnName = "rule_value")] + [SugarColumn(ColumnName = "rule_value")] public decimal RuleValue { get; set; } /// - /// 会员等级 + /// 会员等级 (VIP Level) /// - [SqlSugar.SugarColumn(ColumnName = "type_id")] - public int TypeId { get; set; } + [SugarColumn(ColumnName = "type_id")] + public int VipLevelId { get; set; } /// - /// 会员等级描述 + /// 会员等级描述 (VIP Level Description) /// - [SqlSugar.SugarColumn(IsIgnore = true)] - public string TypeName { get; set; } + [SugarColumn(IsIgnore = true)] + public string VipLevelName { get; set; } } } diff --git a/EOM.TSHotelManagement.Common.Core/Util/ApplicationVersion.cs b/EOM.TSHotelManagement.Common.Core/Util/ApplicationVersion.cs index 0640e23f946417f22e025e28973fea8ab689626f..4007b72721e7089ebe1d5812ed8b135af354d514 100644 --- a/EOM.TSHotelManagement.Common.Core/Util/ApplicationVersion.cs +++ b/EOM.TSHotelManagement.Common.Core/Util/ApplicationVersion.cs @@ -3,21 +3,21 @@ namespace EOM.TSHotelManagement.Common.Core { /// - /// 应用版本 + /// 应用版本 (Application Version) /// - [SqlSugar.SugarTable("applicationversion")] - public class Applicationversion + [SugarTable("app_version")] + public class ApplicationVersion { /// - /// 流水号 + /// 流水号 (Sequence Number) /// - [SugarColumn(ColumnName = "base_versionId")]//数据库是自增才配自增 - public int base_versionId { get; set; } + [SugarColumn(ColumnName = "base_versionId", IsIdentity = true, IsPrimaryKey = true)] + public int ApplicationVersionId { get; set; } /// - /// 版本号 + /// 版本号 (Version Number) /// - [SugarColumn(ColumnName = "base_version")]//数据库是自增才配自增 - public string base_version { get; set; } + [SugarColumn(ColumnName = "base_version")] + public string VersionNumber { get; set; } } } diff --git a/EOM.TSHotelManagement.Common.Core/Util/CardCode.cs b/EOM.TSHotelManagement.Common.Core/Util/CardCode.cs new file mode 100644 index 0000000000000000000000000000000000000000..a0ac63024f3796c3dcf77659b275cffaedad375c --- /dev/null +++ b/EOM.TSHotelManagement.Common.Core/Util/CardCode.cs @@ -0,0 +1,48 @@ +using SqlSugar; + +namespace EOM.TSHotelManagement.Common.Core +{ + /// + /// 卡片代码 (Card Codes) + /// + [SugarTable("card_code")] + public class CardCode + { + /// + /// 卡片代码 (Card Code) + /// + public CardCode() + { + } + + /// + /// 编号 (ID) + /// + [SugarColumn(ColumnName = "id", IsPrimaryKey = true, IsIdentity = true)] + public long Id { get; set; } + + /// + /// 省份 (Province) + /// + [SugarColumn(ColumnName = "province")] + public string Province { get; set; } + + /// + /// 城市 (City) + /// + [SugarColumn(ColumnName = "city")] + public string City { get; set; } + + /// + /// 地区 (District) + /// + [SugarColumn(ColumnName = "district")] + public string District { get; set; } + + /// + /// 地区识别码 (Area Code) + /// + [SugarColumn(ColumnName = "district_code")] + public string AreaCode { get; set; } + } +} diff --git a/EOM.TSHotelManagement.Common.Core/Util/Cardcodes.cs b/EOM.TSHotelManagement.Common.Core/Util/Cardcodes.cs deleted file mode 100644 index 782a2e9d0eb31755963afdafd6b333ce8a4d3a62..0000000000000000000000000000000000000000 --- a/EOM.TSHotelManagement.Common.Core/Util/Cardcodes.cs +++ /dev/null @@ -1,46 +0,0 @@ -namespace EOM.TSHotelManagement.Common.Core -{ - /// - /// 卡片代码 - /// - [SqlSugar.SugarTable("cardcodes")] - public class Cardcodes - { - /// - /// 卡片代码 - /// - public Cardcodes() - { - } - - private System.Int64 _id; - /// - /// 编号 - /// - public System.Int64 id { get { return this._id; } set { this._id = value; } } - - private System.String _Province; - /// - /// 省份 - /// - public System.String Province { get { return this._Province; } set { this._Province = value; } } - - private System.String _City; - /// - /// 城市 - /// - public System.String City { get { return this._City; } set { this._City = value; } } - - private System.String _District; - /// - /// 地区 - /// - public System.String District { get { return this._District; } set { this._District = value; } } - - private System.String _bm; - /// - /// 地区识别码 - /// - public System.String bm { get { return this._bm; } set { this._bm = value; } } - } -} diff --git a/EOM.TSHotelManagement.Common.Core/Util/OperationLog.cs b/EOM.TSHotelManagement.Common.Core/Util/OperationLog.cs index 32c88574aced80937e85a566d91583eeaa73b710..9b75877a875283befba4272e981e3186e11f251b 100644 --- a/EOM.TSHotelManagement.Common.Core/Util/OperationLog.cs +++ b/EOM.TSHotelManagement.Common.Core/Util/OperationLog.cs @@ -22,76 +22,121 @@ * *模块说明:操作日志类 */ +using SqlSugar; using System; namespace EOM.TSHotelManagement.Common.Core { /// - /// 日志等级 + /// 日志等级 (Log Level) /// - public enum RecordLevel + public enum LogLevel { /// - /// 普通警告 + /// 普通警告 (Normal Warning) /// Normal = 100, + /// - /// 严重警告 + /// 严重警告 (Serious Warning) /// Warning = 200, + /// - /// 危险警告 + /// 危险警告 (Critical Warning) /// - Danger = 300, + Critical = 300 } /// - /// 操作日志 + /// 操作日志 (Operation Log) /// - [SqlSugar.SugarTable("operationlog")] - public class OperationLog : BaseDTO + [SugarTable("operation_log")] + public class OperationLog : BaseEntity { /// - /// 日志ID + /// 日志ID (Log ID) /// - [SqlSugar.SugarColumn(ColumnName = "OperationId", IsIdentity = true, IsPrimaryKey = true)] - public int OperationId { get; set; } + [SugarColumn(ColumnName = "operation_number",IsPrimaryKey = true)] + public string OperationId { get; set; } + /// - /// 操作时间 + /// 操作时间 (Operation Time) /// - [SqlSugar.SugarColumn(ColumnName = "OperationTime")] + [SugarColumn(ColumnName = "operation_time")] public DateTime OperationTime { get; set; } + /// - /// 操作信息 + /// 操作信息 (Log Content) /// - [SqlSugar.SugarColumn(ColumnName = "LogContent")] + [SugarColumn(ColumnName = "log_content")] public string LogContent { get; set; } + /// - /// 操作账号 + /// 操作账号 (Operation Account) /// - [SqlSugar.SugarColumn(ColumnName = "OperationAccount")] + [SugarColumn(ColumnName = "operation_account")] public string OperationAccount { get; set; } + /// - /// 日志等级 + /// 日志等级 (Log Level) /// - [SqlSugar.SugarColumn(ColumnName = "OperationLevel")] - public RecordLevel OperationLevel { get; set; } + [SugarColumn(ColumnName = "operation_level")] + public LogLevel LogLevel { get; set; } + /// - /// 软件版本 + /// 软件版本 (Software Version) /// - [SqlSugar.SugarColumn(ColumnName = "SoftwareVersion")] + [SugarColumn(ColumnName = "software_version")] public string SoftwareVersion { get; set; } + /// - /// 登录IP + /// 登录IP (Login IP Address) /// - [SqlSugar.SugarColumn(ColumnName = "login_ip")] - public string login_ip { get; set; } + [SugarColumn(ColumnName = "login_ip")] + public string LoginIpAddress { get; set; } /// - /// 日志等级 + /// 日志等级名称 (Log Level Name) /// - [SqlSugar.SugarColumn(IsIgnore = true)] - public string OperationLevelNm { get; set; } + [SugarColumn(IsIgnore = true)] + public string LogLevelName { get; set; } + + /// + /// 请求路径 (Request Path) + /// + [SugarColumn(ColumnName = "request_path")] + public string RequestPath { get; set; } + /// + /// 查询字符串 (Query String) + /// + [SugarColumn(ColumnName = "query_string")] + public string QueryString { get; set; } + /// + /// 响应时间 (Elapsed Time) + /// + [SugarColumn(ColumnName = "elapsed_time")] + public long ElapsedTime { get; set; } + /// + /// 请求方法 (Http Method) + /// + [SugarColumn(ColumnName = "http_method")] + public string HttpMethod { get; set; } + /// + /// 状态码 (Status Code) + /// + [SugarColumn(ColumnName = "status_code")] + public int StatusCode { get; set; } + /// + /// 异常消息 (Exception Message) + /// + [SugarColumn(ColumnName = "exception_message")] + public string ExceptionMessage { get; set; } + /// + /// 异常堆栈 (Exception Stack Trace) + /// + [SugarColumn(ColumnName = "exception_stacktrace")] + public string ExceptionStackTrace { get; set; } } } diff --git a/EOM.TSHotelManagement.Common.Core/Worker/WorkerPic.cs b/EOM.TSHotelManagement.Common.Core/Worker/WorkerPic.cs deleted file mode 100644 index 2fe0619e916044cd252a74b7f6f731628bbe17c6..0000000000000000000000000000000000000000 --- a/EOM.TSHotelManagement.Common.Core/Worker/WorkerPic.cs +++ /dev/null @@ -1,27 +0,0 @@ -//using System.ComponentModel.DataAnnotations.Schema; -namespace EOM.TSHotelManagement.Common.Core -{ - /// - /// 员工照片 - /// - [SqlSugar.SugarTable("workerpic")] - public class WorkerPic - { - /// - /// 自增长流水号 - /// - [SqlSugar.SugarColumn(IsIdentity = true, ColumnName = "Id", IsPrimaryKey = true)] - public int Id { get; set; } - /// - /// 工号 - /// - [SqlSugar.SugarColumn(ColumnName = "WorkerId")] - public string WorkerId { get; set; } - - /// - /// 照片路径 - /// - [SqlSugar.SugarColumn(ColumnName = "Pic")] - public string Pic { get; set; } - } -} diff --git a/EOM.TSHotelManagement.Common.Core/Zero/Module.cs b/EOM.TSHotelManagement.Common.Core/Zero/Module.cs deleted file mode 100644 index c33ab5e29da0f889375be1cabd543d32e0d395c5..0000000000000000000000000000000000000000 --- a/EOM.TSHotelManagement.Common.Core/Zero/Module.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace EOM.TSHotelManagement.Common.Core -{ - /// - /// 模块实体 - /// - [SqlSugar.SugarTable("module")] - public class Module : BaseDTO - { - /// - /// 模块ID - /// - public int module_id { get; set; } - - /// - /// 模块名称 - /// - public string module_name { get; set; } - - /// - /// 模块描述 - /// - public string module_desc { get; set; } - } -} diff --git a/EOM.TSHotelManagement.Common.Core/Zero/ModuleZero.cs b/EOM.TSHotelManagement.Common.Core/Zero/ModuleZero.cs deleted file mode 100644 index 89d71ae56e2a4b674a4bfa20c5fb07c9de90cb9a..0000000000000000000000000000000000000000 --- a/EOM.TSHotelManagement.Common.Core/Zero/ModuleZero.cs +++ /dev/null @@ -1,31 +0,0 @@ -namespace EOM.TSHotelManagement.Common.Core -{ - - /// - /// 模块权限表 - /// - [SqlSugar.SugarTable("module_zero")] - public class ModuleZero - { - /// - /// 模块ID - /// - [SqlSugar.SugarColumn(IsIdentity = true, ColumnName = "module_id")] - public int module_id { get; set; } - /// - /// 管理员账号 - /// - [SqlSugar.SugarColumn(ColumnName = "admin_account")] - public string admin_account { get; set; } - /// - /// 模块名称 - /// - [SqlSugar.SugarColumn(ColumnName = "module_name")] - public string module_name { get; set; } - /// - /// 是否开启 - /// - [SqlSugar.SugarColumn(ColumnName = "module_enable")] - public int module_enable { get; set; } - } -} diff --git a/EOM.TSHotelManagement.Common.Util/EOM.TSHotelManagement.Common.Util.csproj b/EOM.TSHotelManagement.Common.Util/EOM.TSHotelManagement.Common.Util.csproj index 6468ceeb65b877771650745ea65db1c03ec5ad6a..d969c084f65b4ebf89e51a42de618975fc79f97f 100644 --- a/EOM.TSHotelManagement.Common.Util/EOM.TSHotelManagement.Common.Util.csproj +++ b/EOM.TSHotelManagement.Common.Util/EOM.TSHotelManagement.Common.Util.csproj @@ -8,4 +8,10 @@ + + + + + + diff --git a/EOM.TSHotelManagement.Common.Util/GenerateJWT/JWTHelper.cs b/EOM.TSHotelManagement.Common.Util/GenerateJWT/JWTHelper.cs index 68f15fdbe151541525d817cc1e2167bd0db20d4b..2b8c10a5ccc0d7adffd88589fc4ef1b795f6b303 100644 --- a/EOM.TSHotelManagement.Common.Util/GenerateJWT/JWTHelper.cs +++ b/EOM.TSHotelManagement.Common.Util/GenerateJWT/JWTHelper.cs @@ -12,9 +12,6 @@ namespace EOM.TSHotelManagement.Common.Util { public class JWTHelper { - /// - /// JWT加密 - /// private readonly IJwtConfigFactory _jwtConfigFactory; public JWTHelper(IJwtConfigFactory jwtConfigFactory) @@ -22,24 +19,114 @@ namespace EOM.TSHotelManagement.Common.Util _jwtConfigFactory = jwtConfigFactory; } - public string GenerateJWT(string account) + public Dictionary ClaimTypeMappings { get; set; } = new() { - var jwtConfig = _jwtConfigFactory.GetJwtConfig(); + { "serialnumber", ClaimTypes.SerialNumber }, + { "unique_name", ClaimTypes.Name } + }; + + private JwtConfig GetJwtConfig() => _jwtConfigFactory.GetJwtConfig(); + + /// + /// JWT 加密生成 + /// + public string GenerateJWT(ClaimsIdentity claimsIdentity) + { + var jwtConfig = GetJwtConfig(); var tokenHandler = new JwtSecurityTokenHandler(); var key = Encoding.UTF8.GetBytes(jwtConfig.Key); + var tokenDescriptor = new SecurityTokenDescriptor { - Subject = new ClaimsIdentity(new Claim[] - { - new Claim(ClaimTypes.Name, account) - }), + Subject = claimsIdentity, Expires = DateTime.Now.AddMinutes(jwtConfig.ExpiryMinutes), - SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(key), SecurityAlgorithms.HmacSha256Signature), + SigningCredentials = new SigningCredentials( + new SymmetricSecurityKey(key), + SecurityAlgorithms.HmacSha256Signature), Audience = jwtConfig.Audience, Issuer = jwtConfig.Issuer }; + var token = tokenHandler.CreateToken(tokenDescriptor); return tokenHandler.WriteToken(token); } + + /// + /// JWT 解密验证(返回 Claims 主体) + /// + public ClaimsPrincipal ValidateAndDecryptToken(string token) + { + var jwtConfig = GetJwtConfig(); + var tokenHandler = new JwtSecurityTokenHandler(); + + var validationParameters = new TokenValidationParameters + { + ValidateIssuer = true, + ValidIssuer = jwtConfig.Issuer, + ValidateAudience = true, + ValidAudience = jwtConfig.Audience, + ValidateLifetime = true, + IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(jwtConfig.Key)), + ValidateIssuerSigningKey = true, + NameClaimType = ClaimTypes.Name, + RoleClaimType = ClaimTypes.Role, + ClockSkew = TimeSpan.Zero + }; + + try + { + return tokenHandler.ValidateToken(token, validationParameters, out _); + } + catch (SecurityTokenExpiredException) + { + throw new ApplicationException("Token 已过期"); + } + catch (SecurityTokenInvalidSignatureException) + { + throw new ApplicationException("无效的签名"); + } + catch (Exception ex) + { + throw new ApplicationException($"Token 验证失败: {ex.Message}"); + } + } + + /// + /// 获取唯一序列号 + /// + /// + /// + /// + /// + public string GetSerialNumber(string token) + { + if (string.IsNullOrWhiteSpace(token)) + throw new ArgumentNullException(nameof(token)); + + var claimsPrincipal = ValidateAndDecryptToken(token); + + var serialClaim = claimsPrincipal.FindFirst(ClaimTypes.SerialNumber) + ?? claimsPrincipal.FindFirst("serialnumber"); + + return serialClaim?.Value ?? throw new SecurityTokenException("无法找到序列号声明"); + } + + /// + /// 获取所有声明信息 + /// + public IEnumerable GetClaims(string token) + { + var principal = ValidateAndDecryptToken(token); + return principal.Claims; + } + + /// + /// 获取 Token 过期时间 + /// + public DateTime GetExpirationTime(string token) + { + var jwtToken = new JwtSecurityTokenHandler().ReadJwtToken(token); + return jwtToken.ValidTo.ToLocalTime(); + } } -} +} \ No newline at end of file diff --git a/EOM.TSHotelManagement.Common.Util/Helper/EntityMapper.cs b/EOM.TSHotelManagement.Common.Util/Helper/EntityMapper.cs new file mode 100644 index 0000000000000000000000000000000000000000..ef2c0ae2543ec26c816ad35c70dab13dfd44af82 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Util/Helper/EntityMapper.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace EOM.TSHotelManagement.Common.Util +{ + public static class EntityMapper + { + /// + /// ӳ䵥ʵ + /// + /// Դ + /// Ŀ + /// Դ + /// Ŀ + public static TDestination Map(TSource source) + where TDestination : new() + { + if (source == null) + { + return default; + } + + var destination = new TDestination(); + var sourceProperties = typeof(TSource).GetProperties(); + var destinationProperties = typeof(TDestination).GetProperties(); + + foreach (var sourceProperty in sourceProperties) + { + var destinationProperty = destinationProperties.SingleOrDefault(p => string.Equals(p.Name, sourceProperty.Name, StringComparison.OrdinalIgnoreCase)); + if (destinationProperty != null && destinationProperty.CanWrite) + { + var sourceValue = sourceProperty.GetValue(source); + if (sourceValue != null && destinationProperty.PropertyType != sourceProperty.PropertyType) + { + sourceValue = Convert.ChangeType(sourceValue, Nullable.GetUnderlyingType(destinationProperty.PropertyType) ?? destinationProperty.PropertyType); + } + destinationProperty.SetValue(destination, sourceValue); + } + } + + return destination; + } + + /// + /// ӳʵб + /// + /// Դ + /// Ŀ + /// Դб + /// Ŀб + public static List MapList(List sourceList) + where TDestination : new() + { + if (sourceList == null) + { + return null; + } + + return sourceList.Select(Map).ToList(); + } + } +} diff --git a/EOM.TSHotelManagement.Common.Util/Helper/LocalizationHelper.cs b/EOM.TSHotelManagement.Common.Util/Helper/LocalizationHelper.cs new file mode 100644 index 0000000000000000000000000000000000000000..8dba168f11c572d2ad6c7378ac06b93a7580463f --- /dev/null +++ b/EOM.TSHotelManagement.Common.Util/Helper/LocalizationHelper.cs @@ -0,0 +1,30 @@ +using System; +using System.Globalization; + +namespace EOM.TSHotelManagement.Common.Util +{ + public static class LocalizationHelper + { + /// + /// ȡػַ + /// + /// Ӣı + /// ı + /// ݵǰĻӦı + public static string GetLocalizedString(string englishText, string chineseText) + { + var culture = CultureInfo.CurrentCulture.Name; + return culture.StartsWith("zh", StringComparison.OrdinalIgnoreCase) ? chineseText : englishText; + } + + /// + /// õǰĻ + /// + /// Ļ + public static void SetCulture(string culture) + { + CultureInfo.CurrentCulture = new CultureInfo(culture); + CultureInfo.CurrentUICulture = new CultureInfo(culture); + } + } +} diff --git a/EOM.TSHotelManagement.Common.Util/Helper/LogHelper.cs b/EOM.TSHotelManagement.Common.Util/Helper/LogHelper.cs new file mode 100644 index 0000000000000000000000000000000000000000..6f2793f3af6b3c0a53719b38f8050e7cc9fb6b69 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Util/Helper/LogHelper.cs @@ -0,0 +1,44 @@ +using System; +using System.IO; + +namespace EOM.TSHotelManagement.Common.Util +{ + public static class LogHelper + { + private static readonly string logFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Logs", "ErrorLog.txt"); + + static LogHelper() + { + var logDirectory = Path.GetDirectoryName(logFilePath); + if (!Directory.Exists(logDirectory)) + { + Directory.CreateDirectory(logDirectory); + } + } + + /// + /// ¼CRUD־ + /// + /// Ϣ + /// 쳣 + public static void LogError(string message, Exception exception) + { + try + { + using (StreamWriter writer = new StreamWriter(logFilePath, true)) + { + writer.WriteLine("--------------------------------------------------"); + writer.WriteLine($"ʱ: {DateTime.Now}"); + writer.WriteLine($"Ϣ: {message}"); + writer.WriteLine($"쳣: {exception}"); + writer.WriteLine("--------------------------------------------------"); + writer.WriteLine(); + } + } + catch (Exception ex) + { + Console.WriteLine($"¼־ʱ쳣: {ex}"); + } + } + } +} diff --git a/EOM.TSHotelManagement.Common.Util/Helper/LskyHelper.cs b/EOM.TSHotelManagement.Common.Util/Helper/LskyHelper.cs new file mode 100644 index 0000000000000000000000000000000000000000..3bba4f03193406be3f23a720aa0b0855ce2e74b0 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Util/Helper/LskyHelper.cs @@ -0,0 +1,124 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http.Headers; +using System.Net.Http; +using System.Text; +using System.Threading.Tasks; +using System.Net.Http.Json; +using EOM.TSHotelManagement.Shared; +using System.IO; + +namespace EOM.TSHotelManagement.Common.Util +{ + public class LskyHelper + { + private readonly ILskyConfigFactory lskyConfigFactory; + + public LskyHelper(ILskyConfigFactory lskyConfigFactory) + { + this.lskyConfigFactory = lskyConfigFactory; + } + + public async Task GetImageStorageTokenAsync() + { + var lskConfig = lskyConfigFactory.GetLskyConfig(); + using var httpClient = new HttpClient(); + var tokenRequest = new + { + email = lskConfig.Email, + password = lskConfig.Password + }; + + var response = await httpClient.PostAsJsonAsync($"{lskConfig.BaseAddress}{lskConfig.GetTokenApi}", tokenRequest); + if (!response.IsSuccessStatusCode) return null; + + var result = await response.Content.ReadFromJsonAsync(); + return result?.Status == true ? result.Data.Token : null; + } + + public async Task UploadImageAsync( + Stream fileStream, + string fileName, + string contentType, + string token, + int? strategyId = null) + { + try + { + if (fileStream == null || fileStream.Length == 0) + throw new ArgumentException(LocalizationHelper.GetLocalizedString("File stream cannot be empty","文件流不能为空")); + + if (string.IsNullOrWhiteSpace(fileName)) + throw new ArgumentException(LocalizationHelper.GetLocalizedString("File name cannot be empty", "文件名不能为空")); + + if (string.IsNullOrWhiteSpace(contentType)) + throw new ArgumentException(LocalizationHelper.GetLocalizedString("Content type cannot be empty", "内容类型不能为空")); + + var lskConfig = lskyConfigFactory.GetLskyConfig(); + if (string.IsNullOrEmpty(lskConfig?.BaseAddress)) + throw new InvalidOperationException(LocalizationHelper.GetLocalizedString("The base URL for the Lsky service is not configured.", "兰空图床基础地址未配置")); + + using var httpClient = new HttpClient(); + using var content = new MultipartFormDataContent(); + + var fileContent = new StreamContent(fileStream); + fileContent.Headers.ContentType = MediaTypeHeaderValue.Parse(contentType); + content.Add(fileContent, "file", fileName); + + if (strategyId.HasValue) + { + content.Add(new StringContent(strategyId.Value.ToString()), "strategy_id"); + } + + httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); + httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json")); + + var response = await httpClient.PostAsync( + $"{lskConfig.BaseAddress}{lskConfig.UploadApi}", + content + ); + + if (!response.IsSuccessStatusCode) + { + var errorContent = await response.Content.ReadAsStringAsync(); + throw new HttpRequestException($"上传失败: {response.StatusCode} - {errorContent}"); + } + + var result = await response.Content.ReadFromJsonAsync(); + return result?.Data?.Links?.Url ?? throw new Exception("响应中未包含有效URL"); + } + catch (Exception ex) + { + throw; + } + } + + public class TokenResponse + { + public bool Status { get; set; } + public TokenData Data { get; set; } + } + + public class TokenData + { + public string Token { get; set; } + } + + public class UploadResponse + { + public UploadData Data { get; set; } + } + + public class UploadData + { + public UploadLinks Links { get; set; } + } + + public class UploadLinks + { + public string Url { get; set; } + } + + } +} diff --git a/EOM.TSHotelManagement.Common.Util/Helper/MailHelper.cs b/EOM.TSHotelManagement.Common.Util/Helper/MailHelper.cs new file mode 100644 index 0000000000000000000000000000000000000000..be10022b55143b83138bbace114e6a2b3253c155 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Util/Helper/MailHelper.cs @@ -0,0 +1,123 @@ +using MimeKit; +using MailKit.Net.Smtp; +using MailKit.Security; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using EOM.TSHotelManagement.Shared; +using System.Net.Mime; + +namespace EOM.TSHotelManagement.Common.Util +{ + public class MailHelper + { + private readonly IMailConfigFactory mailConfigFactory; + + public MailHelper(IMailConfigFactory mailConfigFactory) + { + this.mailConfigFactory = mailConfigFactory; + } + + public void SendMail( + List toEmails, + string subject, + string body, + List ccEmails = null, + List bccEmails = null, + List attachments = null, + bool isBodyHtml = true) + { + var mailConfig = mailConfigFactory.GetMailConfig(); + + var message = new MimeMessage(); + + message.From.Add(new MailboxAddress(mailConfig.DisplayName, mailConfig.UserName)); + + AddRecipients(message.To, toEmails); + + AddRecipients(message.Cc, ccEmails); + + AddRecipients(message.Bcc, bccEmails); + + var bodyBuilder = new BodyBuilder + { + HtmlBody = isBodyHtml ? body : null, + TextBody = isBodyHtml ? null : body + }; + + AddAttachments(bodyBuilder, attachments); + + message.Subject = subject; + message.Body = bodyBuilder.ToMessageBody(); + + using var client = new SmtpClient(); + try + { + client.Connect( + mailConfig.Host, + mailConfig.Port, + GetSecureSocketOptions() + ); + + client.Authenticate(mailConfig.UserName, mailConfig.Password); + + client.Send(message); + } + catch (AuthenticationException ex) + { + throw new ApplicationException(LocalizationHelper.GetLocalizedString($"Email verification failed: {ex.Message}", $"邮件认证失败: {ex.Message}"), ex); + } + catch (SmtpCommandException ex) + { + throw new ApplicationException(LocalizationHelper.GetLocalizedString($"SMTP command error ({ex.StatusCode}): {ex.Message}", $"SMTP命令错误 ({ex.StatusCode}): {ex.Message}"), ex); + } + catch (SmtpProtocolException ex) + { + throw new ApplicationException(LocalizationHelper.GetLocalizedString($"SMTP protocol error: {ex.Message}", $"SMTP协议错误: {ex.Message}"), ex); + } + finally + { + client.Disconnect(true); + } + } + + #region Private Methods + + private void AddRecipients(InternetAddressList list, List emails) + { + emails?.Where(email => !string.IsNullOrWhiteSpace(email)) + .ToList() + .ForEach(email => list.Add(MailboxAddress.Parse(email))); + } + + private void AddAttachments(BodyBuilder builder, List attachments) + { + attachments?.Where(File.Exists) + .ToList() + .ForEach(filePath => + { + using var stream = File.OpenRead(filePath); + builder.Attachments.Add( + Path.GetFileName(filePath), + stream, + MimeKit.ContentType.Parse(MediaTypeNames.Application.Octet) + ); + }); + } + + private SecureSocketOptions GetSecureSocketOptions() + { + var mailConfig = mailConfigFactory.GetMailConfig(); + return mailConfig.EnableSsl switch + { + true when mailConfig.Port == 465 => SecureSocketOptions.SslOnConnect, + true when mailConfig.Port == 587 => SecureSocketOptions.StartTls, + true => SecureSocketOptions.Auto, + false => SecureSocketOptions.None + }; + } + + #endregion + } +} \ No newline at end of file diff --git a/EOM.TSHotelManagement.Common.Util/Helper/RandomStringGenerator.cs b/EOM.TSHotelManagement.Common.Util/Helper/RandomStringGenerator.cs new file mode 100644 index 0000000000000000000000000000000000000000..e0ab59f109c3f544abdf69c596d49dc00013dd8e --- /dev/null +++ b/EOM.TSHotelManagement.Common.Util/Helper/RandomStringGenerator.cs @@ -0,0 +1,53 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Security.Cryptography; +using System.Text; +using System.Threading.Tasks; + +namespace EOM.TSHotelManagement.Common.Util +{ + public class RandomStringGenerator + { + public string GenerateSecurePassword() + { + const string numbers = "0123456789"; + const string lowerLetters = "abcdefghijklmnopqrstuvwxyz"; + const string upperLetters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + const string specialChars = "!@#$%^&*()_+-=[]{}|;:,.<>?"; + + var allChars = numbers + lowerLetters + upperLetters + specialChars; + + var chars = new char[12]; + + chars[0] = GetRandomChar(numbers); + chars[1] = GetRandomChar(lowerLetters); + chars[2] = GetRandomChar(upperLetters); + chars[3] = GetRandomChar(specialChars); + + for (int i = 4; i < 12; i++) + { + chars[i] = GetRandomChar(allChars); + } + + for (int i = chars.Length - 1; i > 0; i--) + { + int swapIndex = GetRandomInt(i + 1); + (chars[i], chars[swapIndex]) = (chars[swapIndex], chars[i]); + } + + return new string(chars); + } + + private static char GetRandomChar(string charSet) + { + var randomNumber = RandomNumberGenerator.GetInt32(charSet.Length); + return charSet[randomNumber]; + } + + private static int GetRandomInt(int maxValue) + { + return RandomNumberGenerator.GetInt32(maxValue); + } + } +} diff --git a/EOM.TSHotelManagement.Common.Util/Validator/UIDisplayAttribute.cs b/EOM.TSHotelManagement.Common.Util/Validator/UIDisplayAttribute.cs index e16b97ed329d40cab32375ebcd6328c227d159ae..093a64826a68e696492bf30aacccdf747cbdd294 100644 --- a/EOM.TSHotelManagement.Common.Util/Validator/UIDisplayAttribute.cs +++ b/EOM.TSHotelManagement.Common.Util/Validator/UIDisplayAttribute.cs @@ -9,10 +9,13 @@ namespace EOM.TSHotelManagement.Common.Util public bool IsNumber { get; set; } = false; - public UIDisplayAttribute(string displayName,bool isNumber = false) + public bool IsVisible { get; set; } = true; + + public UIDisplayAttribute(string displayName,bool isNumber = false,bool isVisible = true) { DisplayName = displayName; IsNumber = isNumber; + IsVisible = isVisible; } } } diff --git a/EOM.TSHotelManagement.EntityFramework/Repository/GenericRepository.cs b/EOM.TSHotelManagement.EntityFramework/Repository/GenericRepository.cs index e6e83313b53527f55302b28de695ec7acfe2c784..58c92477cdf9e7f7bfdaea0feb5353bc0d0e3adb 100644 --- a/EOM.TSHotelManagement.EntityFramework/Repository/GenericRepository.cs +++ b/EOM.TSHotelManagement.EntityFramework/Repository/GenericRepository.cs @@ -6,8 +6,7 @@ namespace EOM.TSHotelManagement.EntityFramework { public GenericRepository(ISqlSugarClient client) : base(client) { - // 初始化数据库上下文,设置必要的配置(例如错误处理) - base.Context.Aop.OnError = (ex) => { /* 处理错误 */ }; + base.Context.Aop.OnError = (ex) => {}; } } } diff --git a/EOM.TSHotelManagement.Shared/BrotliHelper.cs b/EOM.TSHotelManagement.Shared/BrotliHelper.cs new file mode 100644 index 0000000000000000000000000000000000000000..6bf31d811ac4c175f8531b54abb799be884ff0b8 --- /dev/null +++ b/EOM.TSHotelManagement.Shared/BrotliHelper.cs @@ -0,0 +1,46 @@ +using System; +using System.Buffers; +using System.Collections.Generic; +using System.IO.Compression; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EOM.TSHotelManagement.Shared +{ + public static class BrotliHelper + { + public static string CompressString(string input) + { + byte[] inputBytes = Encoding.UTF8.GetBytes(input); + + using var outputStream = new MemoryStream(); + using (var brotliStream = new BrotliStream(outputStream, CompressionLevel.Optimal)) + { + int bufferSize = 81920; + for (int i = 0; i < inputBytes.Length; i += bufferSize) + { + int chunkSize = Math.Min(bufferSize, inputBytes.Length - i); + brotliStream.Write(inputBytes, i, chunkSize); + } + } + + return Convert.ToBase64String(outputStream.ToArray()); + } + + + public static string DecompressString(string input) + { + var compressedData = Convert.FromBase64String(input); + + using var inputStream = new MemoryStream(compressedData); + using var outputStream = new MemoryStream(); + using (var brotliStream = new BrotliStream(inputStream, CompressionMode.Decompress)) + { + brotliStream.CopyTo(outputStream); + } + + return Encoding.UTF8.GetString(outputStream.ToArray()); + } + } +} diff --git a/EOM.TSHotelManagement.Shared/EnumHelper.cs b/EOM.TSHotelManagement.Shared/EnumHelper.cs new file mode 100644 index 0000000000000000000000000000000000000000..aee8ccfa86e4919ce94011f962d7580cb677c178 --- /dev/null +++ b/EOM.TSHotelManagement.Shared/EnumHelper.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace EOM.TSHotelManagement.Shared +{ + public class EnumHelper + { + public string GetEnumDescription(Enum value) + { + FieldInfo field = value.GetType().GetField(value.ToString()); + DescriptionAttribute attribute = field? + .GetCustomAttributes(typeof(DescriptionAttribute), false) + .FirstOrDefault() as DescriptionAttribute; + + return attribute?.Description ?? value.ToString(); + } + + public int GetEnumValue(Enum value) + { + if (value == null) + throw new ArgumentNullException(nameof(value)); + + return Convert.ToInt32(value); + } + + public int GetEnumValue(int value) + { + if (value == null) + throw new ArgumentNullException(nameof(value)); + return Convert.ToInt32(value); + } + } +} diff --git a/EOM.TSHotelManagement.Shared/Interfaces/ILskyConfigFactory.cs b/EOM.TSHotelManagement.Shared/Interfaces/ILskyConfigFactory.cs new file mode 100644 index 0000000000000000000000000000000000000000..86a5210a2b146672371a543d4f46422cec6c7c19 --- /dev/null +++ b/EOM.TSHotelManagement.Shared/Interfaces/ILskyConfigFactory.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EOM.TSHotelManagement.Shared +{ + public interface ILskyConfigFactory + { + LskyConfig GetLskyConfig(); + } +} diff --git a/EOM.TSHotelManagement.Shared/Interfaces/IMailConfigFactory.cs b/EOM.TSHotelManagement.Shared/Interfaces/IMailConfigFactory.cs new file mode 100644 index 0000000000000000000000000000000000000000..35af71daa6a8f59dacbe7105a5d6dcb21bfa58ff --- /dev/null +++ b/EOM.TSHotelManagement.Shared/Interfaces/IMailConfigFactory.cs @@ -0,0 +1,13 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EOM.TSHotelManagement.Shared +{ + public interface IMailConfigFactory + { + MailConfig GetMailConfig(); + } +} diff --git a/EOM.TSHotelManagement.Shared/Interfaces/LskyConfig.cs b/EOM.TSHotelManagement.Shared/Interfaces/LskyConfig.cs new file mode 100644 index 0000000000000000000000000000000000000000..219396c4d7f7067127fff6f6a2ed7a00a4eada17 --- /dev/null +++ b/EOM.TSHotelManagement.Shared/Interfaces/LskyConfig.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EOM.TSHotelManagement.Shared +{ + public class LskyConfig + { + public string BaseAddress { get; set; } + public string Email { get; set; } + public string Password { get; set; } + public string UploadApi { get; set; } + public string GetTokenApi { get; set; } + } +} diff --git a/EOM.TSHotelManagement.Shared/JwtConfig.cs b/EOM.TSHotelManagement.Shared/JwtConfig.cs index 341bed2da5646d477682685045ac5eb5c8cc14f4..18935b78047ebaec7df9417dd3c579fcf244bcc1 100644 --- a/EOM.TSHotelManagement.Shared/JwtConfig.cs +++ b/EOM.TSHotelManagement.Shared/JwtConfig.cs @@ -2,9 +2,9 @@ { public class JwtConfig { - public string Key { get; set; } // 对应配置中的 Jwt:Key - public string Issuer { get; set; } // 对应配置中的 Jwt:Issuer - public string Audience { get; set; } // 对应配置中的 Jwt:Audience - public int ExpiryMinutes { get; set; } // 对应配置中的 Jwt:ExpiryMinutes + public string Key { get; set; } + public string Issuer { get; set; } + public string Audience { get; set; } + public int ExpiryMinutes { get; set; } } } diff --git a/EOM.TSHotelManagement.Shared/MailConfig.cs b/EOM.TSHotelManagement.Shared/MailConfig.cs new file mode 100644 index 0000000000000000000000000000000000000000..4fa7523cbe9b5b278cd321422df3c74243d3b102 --- /dev/null +++ b/EOM.TSHotelManagement.Shared/MailConfig.cs @@ -0,0 +1,41 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EOM.TSHotelManagement.Shared +{ + public class MailConfig + { + /// + /// SMTP服务器地址 + /// + public string Host { get; set; } + + /// + /// SMTP端口 + /// + public int Port { get; set; } + + /// + /// 发件邮箱账号 + /// + public string UserName { get; set; } + + /// + /// 发件邮箱密码/应用专用密码 + /// + public string Password { get; set; } + + /// + /// 是否启用SSL + /// + public bool EnableSsl { get; set; } + + /// + /// 发件人显示名称 + /// + public string DisplayName { get; set; } + } +} diff --git a/EOM.TSHotelManagement.WebApi/Controllers/Business/Cash/CashController.cs b/EOM.TSHotelManagement.WebApi/Controllers/Business/Asset/AssetController.cs similarity index 51% rename from EOM.TSHotelManagement.WebApi/Controllers/Business/Cash/CashController.cs rename to EOM.TSHotelManagement.WebApi/Controllers/Business/Asset/AssetController.cs index fbb6c38fc8868ac32dec71d7116ce31318ec452f..09f059f74ef87a467dc36040d8a8dcc7406e47b8 100644 --- a/EOM.TSHotelManagement.WebApi/Controllers/Business/Cash/CashController.cs +++ b/EOM.TSHotelManagement.WebApi/Controllers/Business/Asset/AssetController.cs @@ -1,4 +1,5 @@ using EOM.TSHotelManagement.Application; +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; @@ -8,31 +9,31 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// 资产信息控制器 /// - public class CashController : ControllerBase + public class AssetController : ControllerBase { /// /// 资产信息 /// - private readonly ICashService cashService; + private readonly IAssetService assetService; /// /// /// - /// - public CashController(ICashService cashService) + /// + public AssetController(IAssetService assetService) { - this.cashService = cashService; + this.assetService = assetService; } /// /// 添加资产信息 /// - /// + /// /// [HttpPost] - public bool AddCashInfo([FromBody] Cash cash) + public BaseOutputDto AddAssetInfo([FromBody] CreateAssetInputDto asset) { - return cashService.AddCashInfo(cash); + return assetService.AddAssetInfo(asset); } /// @@ -40,31 +41,31 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpGet] - public List SelectCashInfoAll() + public ListOutputDto SelectAssetInfoAll([FromQuery] ReadAssetInputDto asset) { - return cashService.SelectCashInfoAll(); + return assetService.SelectAssetInfoAll(asset); } /// /// 更新资产信息 /// - /// + /// /// [HttpPost] - public bool UpdCashInfo([FromBody]Cash cash) + public BaseOutputDto UpdAssetInfo([FromBody]UpdateAssetInputDto asset) { - return cashService.UpdCashInfo(cash); + return assetService.UpdAssetInfo(asset); } /// /// 删除资产信息 /// - /// + /// /// [HttpPost] - public bool DelCashInfo([FromBody]Cash cash) + public BaseOutputDto DelAssetInfo([FromBody]DeleteAssetInputDto asset) { - return cashService.DelCashInfo(cash); + return assetService.DelAssetInfo(asset); } } diff --git a/EOM.TSHotelManagement.WebApi/Controllers/Business/Customer/CustoController.cs b/EOM.TSHotelManagement.WebApi/Controllers/Business/Customer/CustomerController.cs similarity index 62% rename from EOM.TSHotelManagement.WebApi/Controllers/Business/Customer/CustoController.cs rename to EOM.TSHotelManagement.WebApi/Controllers/Business/Customer/CustomerController.cs index 629e2f215fa028b87f3ec4001f690f3e0a7c76e0..e89d6eec2774b216d78e1ff07eeb6b7047329b66 100644 --- a/EOM.TSHotelManagement.WebApi/Controllers/Business/Customer/CustoController.cs +++ b/EOM.TSHotelManagement.WebApi/Controllers/Business/Customer/CustomerController.cs @@ -1,4 +1,5 @@ using EOM.TSHotelManagement.Application; +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; @@ -8,18 +9,18 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// 用户信息控制器 /// - public class CustoController : ControllerBase + public class CustomerController : ControllerBase { /// /// 用户信息 /// - private readonly ICustoService customerService; + private readonly ICustomerService customerService; /// /// /// /// - public CustoController(ICustoService customerService) + public CustomerController(ICustomerService customerService) { this.customerService = customerService; } @@ -30,7 +31,7 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpPost] - public bool InsertCustomerInfo([FromBody] Custo custo) + public BaseOutputDto InsertCustomerInfo([FromBody] CreateCustomerInputDto custo) { return customerService.InsertCustomerInfo(custo); } @@ -41,7 +42,7 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpPost] - public bool UpdCustomerInfo([FromBody] Custo custo) + public BaseOutputDto UpdCustomerInfo([FromBody] UpdateCustomerInputDto custo) { return customerService.UpdCustomerInfo(custo); } @@ -52,7 +53,7 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpPost] - public bool DelCustomerInfo([FromBody] Custo custo) + public BaseOutputDto DelCustomerInfo([FromBody] DeleteCustomerInputDto custo) { return customerService.DelCustomerInfo(custo); } @@ -60,17 +61,16 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// 更新客户类型(即会员等级) /// - /// - /// + /// /// - [HttpGet] - public bool UpdCustomerTypeByCustoNo([FromQuery] string custoNo, int userType) + [HttpPost] + public BaseOutputDto UpdCustomerTypeByCustoNo([FromBody]UpdateCustomerInputDto updateCustomerInputDto) { - return customerService.UpdCustomerTypeByCustoNo(custoNo, userType); + return customerService.UpdCustomerTypeByCustoNo(updateCustomerInputDto); } /// - /// 查询酒店盈利情况 + /// 查询酒店盈利情况(用于报表) /// /// [HttpGet] @@ -83,18 +83,18 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// 查询所有客户信息 /// /// - [HttpGet] - public OSelectAllDto SelectCustoAll([FromQuery] int pageIndex, int pageSize, bool onlyVip = false) - { - return customerService.SelectCustoAll(pageIndex, pageSize, onlyVip); - } + //[HttpGet] + //public ListOutputDto SelectCustoAll([FromQuery] int pageIndex, int pageSize, bool onlyVip = false) + //{ + // return customerService.SelectCustoAll(pageIndex, pageSize, onlyVip); + //} /// /// 查询所有客户信息 /// /// [HttpGet] - public OSelectAllDto SelectCustomers(Custo custo) + public ListOutputDto SelectCustomers(ReadCustomerInputDto custo) { return customerService.SelectCustomers(custo); } @@ -103,8 +103,8 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// 查询指定客户信息 /// /// - [HttpPost] - public List SelectCustoByInfo([FromBody] Custo custo) + [HttpGet] + public SingleOutputDto SelectCustoByInfo([FromQuery] ReadCustomerInputDto custo) { return customerService.SelectCustoByInfo(custo); } @@ -114,11 +114,11 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// /// - [HttpGet] - public Custo SelectCardInfoByCustoNo([FromQuery] string CustoNo) - { - return customerService.SelectCardInfoByCustoNo(CustoNo); - } + //[HttpGet] + //public Customer SelectCardInfoByCustoNo([FromQuery] string CustoNo) + //{ + // return customerService.SelectCardInfoByCustoNo(CustoNo); + //} } } diff --git a/EOM.TSHotelManagement.WebApi/Controllers/Business/Hydroelectricity/HydroelectricityController.cs b/EOM.TSHotelManagement.WebApi/Controllers/Business/EnergyManagement/EnergyManagementController.cs similarity index 58% rename from EOM.TSHotelManagement.WebApi/Controllers/Business/Hydroelectricity/HydroelectricityController.cs rename to EOM.TSHotelManagement.WebApi/Controllers/Business/EnergyManagement/EnergyManagementController.cs index 905def7640355b84016e5b73e2e577366454b2f5..e92dd002c37d119a6c882636db8eee244b478eef 100644 --- a/EOM.TSHotelManagement.WebApi/Controllers/Business/Hydroelectricity/HydroelectricityController.cs +++ b/EOM.TSHotelManagement.WebApi/Controllers/Business/EnergyManagement/EnergyManagementController.cs @@ -1,4 +1,5 @@ using EOM.TSHotelManagement.Application; +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; using Microsoft.AspNetCore.Mvc; using System; @@ -9,18 +10,18 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// 水电信息控制器 /// - public class HydroelectricityController : ControllerBase + public class EnergyManagementController : ControllerBase { /// /// 水电信息服务 /// - private readonly IHydroelectricityService hydroelectricPowerService; + private readonly IEnergyManagementService hydroelectricPowerService; /// /// 构造函数 /// /// - public HydroelectricityController(IHydroelectricityService hydroelectricPowerService) + public EnergyManagementController(IEnergyManagementService hydroelectricPowerService) { this.hydroelectricPowerService = hydroelectricPowerService; } @@ -29,14 +30,12 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// 根据条件查询水电费信息 /// 替换了 SelectWtiInfoByRoomNo, SelectWtiInfoByRoomNoAndTime, ListWtiInfoByRoomNo, SelectWtiInfoAll /// - /// 房间号(可选) - /// 使用开始时间(可选) - /// 使用结束时间(可选) + /// Dto /// 符合条件的水电费信息列表 [HttpGet] - public List SelectWtiInfo([FromQuery] string roomNo, [FromQuery] DateTime? useDate, [FromQuery] DateTime? endDate) + public ListOutputDto SelectEnergyManagementInfo([FromQuery]ReadEnergyManagementInputDto readEnergyManagementInputDto) { - return this.hydroelectricPowerService.SelectWtiInfo(roomNo, useDate, endDate); + return this.hydroelectricPowerService.SelectEnergyManagementInfo(readEnergyManagementInputDto); } /// @@ -46,9 +45,9 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpPost] - public bool InsertWtiInfo([FromBody] Hydroelectricity w) + public BaseOutputDto InsertEnergyManagementInfo([FromBody] CreateEnergyManagementInputDto w) { - return this.hydroelectricPowerService.InsertWtiInfo(w); + return this.hydroelectricPowerService.InsertEnergyManagementInfo(w); } /// @@ -58,9 +57,9 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// 包含要修改的数据,以及WtiNo作为查询条件 /// [HttpPost] - public bool UpdateWtiInfo([FromBody] Hydroelectricity w) + public BaseOutputDto UpdateEnergyManagementInfo([FromBody] UpdateEnergyManagementInputDto w) { - return this.hydroelectricPowerService.UpdateWtiInfo(w); + return this.hydroelectricPowerService.UpdateEnergyManagementInfo(w); } @@ -68,14 +67,12 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// 根据房间编号、使用时间删除水电费信息 /// 替换了 DeleteWtiInfoByRoomNoAndDateTime /// - /// - /// - /// + /// /// [HttpPost] - public bool DeleteWtiInfo([FromBody] Hydroelectricity hydroelectricity) + public BaseOutputDto DeleteEnergyManagementInfo([FromBody] DeleteEnergyManagementInputDto deleteEnergyManagementInputDto) { - return this.hydroelectricPowerService.DeleteWtiInfo(hydroelectricity); + return this.hydroelectricPowerService.DeleteEnergyManagementInfo(deleteEnergyManagementInputDto); } } } diff --git a/EOM.TSHotelManagement.WebApi/Controllers/Business/Fonts/FontsController.cs b/EOM.TSHotelManagement.WebApi/Controllers/Business/PromotionContent/FontsController.cs similarity index 50% rename from EOM.TSHotelManagement.WebApi/Controllers/Business/Fonts/FontsController.cs rename to EOM.TSHotelManagement.WebApi/Controllers/Business/PromotionContent/FontsController.cs index df24ba34ad9a2f6f1b079d23b0bfef6882513416..f1bfc6b92b58e86c983afed4a3665f9acdbae1d9 100644 --- a/EOM.TSHotelManagement.WebApi/Controllers/Business/Fonts/FontsController.cs +++ b/EOM.TSHotelManagement.WebApi/Controllers/Business/PromotionContent/FontsController.cs @@ -1,5 +1,7 @@ using EOM.TSHotelManagement.Application; +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Util; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; @@ -13,25 +15,35 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// 酒店宣传联动内容 /// - private readonly IFontsService fontsService; + private readonly IPromotionContentService fontsService; /// /// /// /// - public FontsController(IFontsService fontsService) + public FontsController(IPromotionContentService fontsService) { this.fontsService = fontsService; } + /// + /// 查询所有宣传联动内容 + /// + /// + [HttpGet] + public ListOutputDto SelectPromotionContentAll([FromQuery]ReadPromotionContentInputDto readPromotionContentInputDto) + { + return fontsService.SelectPromotionContentAll(readPromotionContentInputDto); + } + /// /// 查询所有宣传联动内容(跑马灯) /// /// [HttpGet] - public List SelectFontAll() + public ListOutputDto SelectPromotionContents() { - return fontsService.SelectFontAll(); + return fontsService.SelectPromotionContents(); } } } diff --git a/EOM.TSHotelManagement.WebApi/Controllers/Business/Reser/ReserController.cs b/EOM.TSHotelManagement.WebApi/Controllers/Business/Reser/ReserController.cs index e3b451ad280125b112e10a9760a85a544c06fdbe..59cb87fe3c1daa9db0a7478c287b94f2c9fc9905 100644 --- a/EOM.TSHotelManagement.WebApi/Controllers/Business/Reser/ReserController.cs +++ b/EOM.TSHotelManagement.WebApi/Controllers/Business/Reser/ReserController.cs @@ -1,4 +1,5 @@ using EOM.TSHotelManagement.Application; +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; @@ -29,9 +30,9 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpGet] - public List SelectReserAll() + public ListOutputDto SelectReserAll(ReadReserInputDto readReserInputDto) { - return reserService.SelectReserAll(); + return reserService.SelectReserAll(readReserInputDto); } /// @@ -40,9 +41,9 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpGet] - public Reser SelectReserInfoByRoomNo([FromQuery] string no) + public SingleOutputDto SelectReserInfoByRoomNo([FromQuery] ReadReserInputDto readReserInputDto) { - return reserService.SelectReserInfoByRoomNo(no); + return reserService.SelectReserInfoByRoomNo(readReserInputDto); } /// @@ -51,18 +52,29 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpPost] - public bool DeleteReserInfo([FromBody] Reser reser) + public BaseOutputDto DeleteReserInfo([FromBody] DeleteReserInputDto reser) { return reserService.DeleteReserInfo(reser); } + /// + /// 更新预约信息 + /// + /// + /// + [HttpPost] + public BaseOutputDto UpdateReserInfo([FromBody] UpdateReserInputDto r) + { + return reserService.UpdateReserInfo(r); + } + /// /// 添加预约信息 /// /// /// [HttpPost] - public bool InserReserInfo([FromBody] Reser r) + public BaseOutputDto InserReserInfo([FromBody] CreateReserInputDto r) { return reserService.InserReserInfo(r); } diff --git a/EOM.TSHotelManagement.WebApi/Controllers/Business/Room/RoomController.cs b/EOM.TSHotelManagement.WebApi/Controllers/Business/Room/RoomController.cs index 90cf64f94fe17168d82a674f30f71fdb9a684f92..740f78bb04b6b0ce04ccf78b2d56a5d81d6196d7 100644 --- a/EOM.TSHotelManagement.WebApi/Controllers/Business/Room/RoomController.cs +++ b/EOM.TSHotelManagement.WebApi/Controllers/Business/Room/RoomController.cs @@ -1,5 +1,6 @@ using EOM.TSHotelManagement.Application; using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Contract; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; @@ -10,15 +11,8 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// public class RoomController : ControllerBase { - /// - /// 房间信息 - /// private readonly IRoomService roomService; - /// - /// - /// - /// public RoomController(IRoomService roomService) { this.roomService = roomService; @@ -27,12 +21,12 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// 根据房间状态获取相应状态的房间信息 /// - /// + /// /// [HttpGet] - public List SelectRoomByRoomState([FromQuery] int stateid) + public ListOutputDto SelectRoomByRoomState([FromQuery] ReadRoomInputDto inputDto) { - return roomService.SelectRoomByRoomState(stateid); + return roomService.SelectRoomByRoomState(inputDto); } /// @@ -40,7 +34,7 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpGet] - public List SelectCanUseRoomAll() + public ListOutputDto SelectCanUseRoomAll() { return roomService.SelectCanUseRoomAll(); } @@ -50,74 +44,75 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpGet] - public List SelectRoomAll() + public ListOutputDto SelectRoomAll([FromQuery]ReadRoomInputDto readRoomInputDto) { - return roomService.SelectRoomAll(); + return roomService.SelectRoomAll(readRoomInputDto); } /// /// 获取房间分区的信息 /// + /// /// [HttpGet] - public List SelectRoomByTypeName([FromQuery] string TypeName) + public ListOutputDto SelectRoomByTypeName([FromQuery] ReadRoomInputDto inputDto) { - return roomService.SelectRoomByTypeName(TypeName); + return roomService.SelectRoomByTypeName(inputDto); } /// /// 根据房间编号查询房间信息 /// - /// + /// /// [HttpGet] - public Room SelectRoomByRoomNo([FromQuery] string no) + public SingleOutputDto SelectRoomByRoomNo([FromQuery] ReadRoomInputDto inputDto) { - return roomService.SelectRoomByRoomNo(no); + return roomService.SelectRoomByRoomNo(inputDto); } /// /// 根据房间编号退房(退房) /// - /// + /// /// - [HttpGet] - public bool UpdateRoomByRoomNo([FromQuery] string room) + [HttpPost] + public BaseOutputDto UpdateRoomByRoomNo([FromQuery] ReadRoomInputDto inputDto) { - return roomService.UpdateRoomByRoomNo(room); + return roomService.UpdateRoomByRoomNo(inputDto); } /// /// 根据房间编号查询截止到今天住了多少天 /// - /// + /// /// [HttpGet] - public object DayByRoomNo([FromQuery] string roomno) + public SingleOutputDto DayByRoomNo([FromQuery] ReadRoomInputDto inputDto) { - return roomService.DayByRoomNo(roomno); + return roomService.DayByRoomNo(inputDto); } /// /// 根据房间编号修改房间信息(入住) /// - /// + /// /// [HttpPost] - public bool UpdateRoomInfo([FromBody] Room r) + public BaseOutputDto UpdateRoomInfo([FromBody] UpdateRoomInputDto inputDto) { - return roomService.UpdateRoomInfo(r); + return roomService.UpdateRoomInfo(inputDto); } /// /// 根据房间编号修改房间信息(预约) /// - /// + /// /// [HttpPost] - public bool UpdateRoomInfoWithReser([FromBody] Room r) + public BaseOutputDto UpdateRoomInfoWithReser([FromBody] UpdateRoomInputDto inputDto) { - return roomService.UpdateRoomInfoWithReser(r); + return roomService.UpdateRoomInfoWithReser(inputDto); } /// @@ -125,7 +120,7 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpGet] - public object SelectCanUseRoomAllByRoomState() + public SingleOutputDto SelectCanUseRoomAllByRoomState() { return roomService.SelectCanUseRoomAllByRoomState(); } @@ -135,7 +130,7 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpGet] - public object SelectNotUseRoomAllByRoomState() + public SingleOutputDto SelectNotUseRoomAllByRoomState() { return roomService.SelectNotUseRoomAllByRoomState(); } @@ -143,11 +138,12 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// 根据房间编号查询房间价格 /// + /// /// [HttpGet] - public object SelectRoomByRoomPrice([FromQuery] string r) + public object SelectRoomByRoomPrice([FromQuery] ReadRoomInputDto inputDto) { - return roomService.SelectRoomByRoomPrice(r); + return roomService.SelectRoomByRoomPrice(inputDto); } /// @@ -155,7 +151,7 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpGet] - public object SelectNotClearRoomAllByRoomState() + public SingleOutputDto SelectNotClearRoomAllByRoomState() { return roomService.SelectNotClearRoomAllByRoomState(); } @@ -165,7 +161,7 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpGet] - public object SelectFixingRoomAllByRoomState() + public SingleOutputDto SelectFixingRoomAllByRoomState() { return roomService.SelectFixingRoomAllByRoomState(); } @@ -175,54 +171,53 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpGet] - public object SelectReseredRoomAllByRoomState() + public SingleOutputDto SelectReservedRoomAllByRoomState() { - return roomService.SelectReseredRoomAllByRoomState(); + return roomService.SelectReservedRoomAllByRoomState(); } /// /// 根据房间编号更改房间状态 /// - /// - /// + /// /// - [HttpGet] - public bool UpdateRoomStateByRoomNo([FromQuery] string roomno, int stateid) + [HttpPost] + public BaseOutputDto UpdateRoomStateByRoomNo([FromQuery] ReadRoomInputDto inputDto) { - return roomService.UpdateRoomStateByRoomNo(roomno, stateid); + return roomService.UpdateRoomStateByRoomNo(inputDto); } /// /// 添加房间 /// - /// + /// /// [HttpPost] - public bool InsertRoom([FromBody] Room rn) + public BaseOutputDto InsertRoom([FromBody] CreateRoomInputDto inputDto) { - return roomService.InsertRoom(rn); + return roomService.InsertRoom(inputDto); } /// /// 更新房间 /// - /// + /// /// [HttpPost] - public bool UpdateRoom([FromBody] Room rn) + public BaseOutputDto UpdateRoom([FromBody] UpdateRoomInputDto inputDto) { - return roomService.UpdateRoom(rn); + return roomService.UpdateRoom(inputDto); } /// /// 删除房间 /// - /// + /// /// [HttpPost] - public bool DeleteRoom([FromBody] Room rn) + public BaseOutputDto DeleteRoom([FromBody] DeleteRoomInputDto inputDto) { - return roomService.DeleteRoom(rn); + return roomService.DeleteRoom(inputDto); } /// @@ -230,31 +225,20 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpGet] - public List SelectRoomByStateAll() + public ListOutputDto SelectRoomByStateAll() { return roomService.SelectRoomByStateAll(); } - /// - /// 获取所有房间状态 - /// - /// - [HttpGet] - public List SelectRoomStateAll() - { - return roomService.SelectRoomStateAll(); - } - /// /// 根据房间编号查询房间状态编号 /// - /// + /// /// [HttpGet] - public object SelectRoomStateIdByRoomNo([FromQuery] string roomno) + public object SelectRoomStateIdByRoomNo([FromQuery] ReadRoomInputDto inputDto) { - return roomService.SelectRoomStateIdByRoomNo(roomno); + return roomService.SelectRoomStateIdByRoomNo(inputDto); } - } } diff --git a/EOM.TSHotelManagement.WebApi/Controllers/Business/Room/RoomTypeController.cs b/EOM.TSHotelManagement.WebApi/Controllers/Business/Room/RoomTypeController.cs index c5e1fa7928ae34f343cc59952110dbb03073d953..bbb3283c861a12f6c4e3d70afbc02f5430aaa2d3 100644 --- a/EOM.TSHotelManagement.WebApi/Controllers/Business/Room/RoomTypeController.cs +++ b/EOM.TSHotelManagement.WebApi/Controllers/Business/Room/RoomTypeController.cs @@ -1,5 +1,6 @@ using EOM.TSHotelManagement.Application; using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Contract; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; @@ -10,15 +11,8 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// public class RoomTypeController : ControllerBase { - /// - /// 房间类型 - /// private readonly IRoomTypeService roomTypeService; - /// - /// - /// - /// public RoomTypeController(IRoomTypeService roomTypeService) { this.roomTypeService = roomTypeService; @@ -27,66 +21,67 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// 获取所有房间类型 /// + /// /// [HttpGet] - public List SelectRoomTypesAll([FromQuery] int? isDelete) + public ListOutputDto SelectRoomTypesAll([FromQuery] ReadRoomTypeInputDto inputDto) { - return roomTypeService.SelectRoomTypesAll(isDelete); + return roomTypeService.SelectRoomTypesAll(inputDto); } /// /// 根据房间编号查询房间类型名称 /// - /// + /// /// [HttpGet] - public RoomType SelectRoomTypeByRoomNo([FromQuery] string no) + public SingleOutputDto SelectRoomTypeByRoomNo([FromQuery] ReadRoomTypeInputDto inputDto) { - return roomTypeService.SelectRoomTypeByRoomNo(no); + return roomTypeService.SelectRoomTypeByRoomNo(inputDto); } /// /// 根据房间类型查询类型配置 /// - /// + /// /// [HttpGet] - public RoomType SelectRoomTypeByType([FromQuery] int roomTypeId) + public ReadRoomTypeOutputDto SelectRoomTypeByType([FromQuery] ReadRoomTypeInputDto inputDto) { - return roomTypeService.SelectRoomTypeByType(roomTypeId); + return roomTypeService.SelectRoomTypeByType(inputDto); } /// /// 添加房间状态 /// - /// + /// /// [HttpPost] - public bool InsertRoomType([FromBody] RoomType roomType) + public BaseOutputDto InsertRoomType([FromBody] CreateRoomTypeInputDto inputDto) { - return roomTypeService.InsertRoomType(roomType); + return roomTypeService.InsertRoomType(inputDto); } /// /// 更新房间状态 /// - /// + /// /// [HttpPost] - public bool UpdateRoomType([FromBody] RoomType roomType) + public BaseOutputDto UpdateRoomType([FromBody] UpdateRoomTypeInputDto inputDto) { - return roomTypeService.UpdateRoomType(roomType); + return roomTypeService.UpdateRoomType(inputDto); } /// /// 删除房间状态 /// - /// + /// /// [HttpPost] - public bool DeleteRoomType([FromBody] RoomType roomType) + public BaseOutputDto DeleteRoomType([FromBody] DeleteRoomTypeInputDto inputDto) { - return roomTypeService.DeleteRoomType(roomType); + return roomTypeService.DeleteRoomType(inputDto); } } -} +} \ No newline at end of file diff --git a/EOM.TSHotelManagement.WebApi/Controllers/Business/Sellthing/SellthingController.cs b/EOM.TSHotelManagement.WebApi/Controllers/Business/Sellthing/SellthingController.cs index 6f8da2a90449b9e1ca92a3e93c7e2531aecce823..f5652b0826ef357da816a078e32514f2db8d9693 100644 --- a/EOM.TSHotelManagement.WebApi/Controllers/Business/Sellthing/SellthingController.cs +++ b/EOM.TSHotelManagement.WebApi/Controllers/Business/Sellthing/SellthingController.cs @@ -1,5 +1,6 @@ using EOM.TSHotelManagement.Application; using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Contract; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; @@ -10,15 +11,8 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// public class SellthingController : ControllerBase { - /// - /// 商品消费 - /// private readonly ISellService sellService; - /// - /// - /// - /// public SellthingController(ISellService sellService) { this.sellService = sellService; @@ -27,9 +21,10 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// 查询所有商品 /// + /// /// [HttpGet] - public List SelectSellThingAll([FromQuery] SellThing sellThing = null) + public ListOutputDto SelectSellThingAll([FromQuery] ReadSellThingInputDto sellThing = null) { return sellService.SelectSellThingAll(sellThing); } @@ -37,9 +32,10 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// 查询所有商品(包括库存为0/已删除) /// + /// /// [HttpGet] - public List GetSellThings(SellThing sellThing = null) + public ListOutputDto GetSellThings([FromQuery] ReadSellThingInputDto sellThing = null) { return sellService.GetSellThings(sellThing); } @@ -47,13 +43,12 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// 修改商品 /// - /// - /// + /// /// [HttpPost] - public bool UpdateSellThing([FromBody] string stock, string sellNo) + public BaseOutputDto UpdateSellThing([FromBody] UpdateSellThingInputDto updateSellThingInputDto) { - return sellService.UpdateSellThing(stock, sellNo); + return sellService.UpdateSellThing(updateSellThingInputDto); } /// @@ -62,7 +57,7 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpPost] - public bool UpdateSellthingInfo([FromBody] SellThing sellThing) + public BaseOutputDto UpdateSellthingInfo([FromBody] UpdateSellThingInputDto sellThing) { return sellService.UpdateSellthingInfo(sellThing); } @@ -70,49 +65,45 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// 撤回客户消费信息 /// - /// - /// - /// + /// /// - [HttpGet] - public bool DeleteSellThing([FromQuery] string roomNo, string custoNo, string sellName) + [HttpPost] + public BaseOutputDto DeleteSellthing([FromQuery] DeleteSellThingInputDto deleteSellThingInputDto) { - return sellService.DeleteSellThing(roomNo, custoNo, sellName); + return sellService.DeleteSellthing(deleteSellThingInputDto); } /// /// 根据商品编号删除商品信息 /// - /// + /// /// - [HttpGet] - public bool DeleteSellThingBySellNo([FromQuery] string sellNo) + [HttpPost] + public BaseOutputDto DeleteSellThingBySellNo([FromQuery] DeleteSellThingInputDto deleteSellThingInputDto) { - return sellService.DeleteSellThingBySellNo(sellNo); + return sellService.DeleteSellThingBySellNo(deleteSellThingInputDto); } /// /// 根据商品名称和价格查询商品编号 /// - /// - /// + /// /// [HttpGet] - public SellThing SelectSellThingByNameAndPrice([FromQuery] string name, string price) + public SingleOutputDto SelectSellThingByNameAndPrice([FromQuery] ReadSellThingInputDto readSellThingInputDto) { - return sellService.SelectSellThingByNameAndPrice(name, price); + return sellService.SelectSellThingByNameAndPrice(readSellThingInputDto); } - /// /// 根据商品编号查询商品信息 /// - /// + /// /// [HttpGet] - public SellThing SelectSellInfoBySellNo([FromQuery] string SellNo) + public ReadSellThingOutputDto SelectSellInfoBySellNo([FromQuery] ReadSellThingInputDto readSellThingInputDto) { - return sellService.SelectSellInfoBySellNo(SellNo); + return sellService.SelectSellInfoBySellNo(readSellThingInputDto); } /// @@ -121,9 +112,11 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpPost] - public bool InsertSellThing([FromBody] SellThing st) + public BaseOutputDto InsertSellThing([FromBody] CreateSellThingInputDto st) { return sellService.InsertSellThing(st); } } } + + diff --git a/EOM.TSHotelManagement.WebApi/Controllers/Business/Spend/SpendController.cs b/EOM.TSHotelManagement.WebApi/Controllers/Business/Spend/SpendController.cs index 23c0bff79624d4861922c30d9e933afcf3ba106f..f7c4ced04a78c2b337376fd2599017be89f749d1 100644 --- a/EOM.TSHotelManagement.WebApi/Controllers/Business/Spend/SpendController.cs +++ b/EOM.TSHotelManagement.WebApi/Controllers/Business/Spend/SpendController.cs @@ -1,7 +1,11 @@ using EOM.TSHotelManagement.Application; using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Contract; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; +using System; +using EOM.TSHotelManagement.Common.Util; +using Microsoft.AspNetCore.Components.Forms; namespace EOM.TSHotelManagement.WebApi.Controllers { @@ -10,15 +14,8 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// public class SpendController : ControllerBase { - /// - /// 消费信息 - /// private readonly ISpendService spendService; - /// - /// - /// - /// public SpendController(ISpendService spendService) { this.spendService = spendService; @@ -30,7 +27,7 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpPost] - public bool InsertSpendInfo([FromBody] Spend s) + public BaseOutputDto InsertSpendInfo([FromBody] CreateSpendInputDto s) { return spendService.InsertSpendInfo(s); } @@ -38,34 +35,34 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// 根据客户编号查询消费信息 /// - /// + /// /// [HttpGet] - public List SelectSpendByCustoNo([FromQuery] string No) + public ListOutputDto SelectSpendByCustoNo([FromQuery] ReadSpendInputDto inputDto) { - return spendService.SelectSpendByCustoNo(No); + return spendService.SelectSpendByCustoNo(inputDto); } /// /// 根据房间编号查询消费信息 /// - /// + /// /// [HttpGet] - public List SelectSpendByRoomNo([FromQuery] string No) + public ListOutputDto SelectSpendByRoomNo([FromQuery] ReadSpendInputDto inputDto) { - return spendService.SelectSpendByRoomNo(No); + return spendService.SelectSpendByRoomNo(inputDto); } /// /// 根据客户编号查询历史消费信息 /// - /// + /// /// [HttpGet] - public List SeletHistorySpendInfoAll([FromQuery] string custoNo) + public ListOutputDto SeletHistorySpendInfoAll([FromQuery] ReadSpendInputDto inputDto) { - return spendService.SeletHistorySpendInfoAll(custoNo); + return spendService.SeletHistorySpendInfoAll(inputDto); } /// @@ -73,66 +70,75 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpGet] - public List SelectSpendInfoAll() + public ListOutputDto SelectSpendInfoAll([FromQuery]ReadSpendInputDto readSpendInputDto) { - return spendService.SelectSpendInfoAll(); + return spendService.SelectSpendInfoAll(readSpendInputDto); } /// /// 根据房间号查询消费的所有信息 /// + /// /// [HttpGet] - public List SelectSpendInfoRoomNo([FromQuery] string RoomNo) + public ListOutputDto SelectSpendInfoRoomNo([FromQuery] ReadSpendInputDto inputDto) { - return spendService.SelectSpendInfoRoomNo(RoomNo); + return spendService.SelectSpendInfoRoomNo(inputDto); } /// /// 根据房间编号、入住时间到当前时间查询消费总金额 /// - /// - /// + /// /// [HttpGet] - public object SelectMoneyByRoomNoAndTime([FromQuery] string roomno, string custono) + public SingleOutputDto SumConsumptionAmount([FromQuery] ReadSpendInputDto inputDto) { - return spendService.SelectMoneyByRoomNoAndTime(roomno, custono); + return spendService.SumConsumptionAmount(inputDto); } /// /// 根据房间编号、入住时间和当前时间修改结算状态 /// - /// - /// + /// /// - [HttpGet] - public bool UpdateMoneyState([FromQuery] string roomno, string checktime) + [HttpPost] + public BaseOutputDto UpdateMoneyState([FromQuery] UpdateSpendInputDto inputDto) { - return spendService.UpdateMoneyState(roomno, checktime); + return spendService.UpdateMoneyState(inputDto); } /// /// 将转房前的未结算记录一同转移到新房间 /// - /// + /// /// [HttpPost] - public bool UpdateSpendInfoByRoomNo([FromQuery] Spend spend) + public BaseOutputDto UpdateSpendInfoByRoomNo([FromBody] UpdateSpendInputDto inputDto) { - return spendService.UpdateSpendInfoByRoomNo(spend); + return spendService.UpdateSpendInfoByRoomNo(inputDto); } /// - /// 更新消费信息 + /// 撤回客户消费信息 /// - /// + /// /// [HttpPost] - public bool UpdSpenInfo([FromBody] Spend spend) + public BaseOutputDto UndoCustomerSpend([FromBody] UpdateSpendInputDto updateSpendInputDto) { - return spendService.UpdSpenInfo(spend); + return spendService.UndoCustomerSpend(updateSpendInputDto); } + /// + /// 更新消费信息 + /// + /// + /// + [HttpPost] + public BaseOutputDto UpdSpenInfo([FromBody] UpdateSpendInputDto inputDto) + { + return spendService.UpdSpenInfo(inputDto); + } } } diff --git a/EOM.TSHotelManagement.WebApi/Controllers/Worker/Check/WorkerCheckController.cs b/EOM.TSHotelManagement.WebApi/Controllers/Employee/Check/EmployeeCheckController.cs similarity index 52% rename from EOM.TSHotelManagement.WebApi/Controllers/Worker/Check/WorkerCheckController.cs rename to EOM.TSHotelManagement.WebApi/Controllers/Employee/Check/EmployeeCheckController.cs index fb475a2e28ec62393e961118c273ac926ce9826f..97c491d0f1d67d39b91242dc05d5719751c7c2cb 100644 --- a/EOM.TSHotelManagement.WebApi/Controllers/Worker/Check/WorkerCheckController.cs +++ b/EOM.TSHotelManagement.WebApi/Controllers/Employee/Check/EmployeeCheckController.cs @@ -1,5 +1,6 @@ using EOM.TSHotelManagement.Application; using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Contract; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; @@ -8,18 +9,11 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// 员工打卡控制器 /// - public class WorkerCheckController : ControllerBase + public class EmployeeCheckController : ControllerBase { - /// - /// 员工打卡 - /// - private readonly IWorkerCheckService workerCheckService; + private readonly IEmployeeCheckService workerCheckService; - /// - /// - /// - /// - public WorkerCheckController(IWorkerCheckService workerCheckService) + public EmployeeCheckController(IEmployeeCheckService workerCheckService) { this.workerCheckService = workerCheckService; } @@ -27,34 +21,34 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// 根据员工编号查询其所有的打卡记录 /// - /// + /// /// [HttpGet] - public List SelectCheckInfoByWorkerNo([FromQuery] string wid) + public ListOutputDto SelectCheckInfoByEmployeeId([FromQuery] ReadEmployeeCheckInputDto inputDto) { - return workerCheckService.SelectCheckInfoByWorkerNo(wid); + return workerCheckService.SelectCheckInfoByEmployeeId(inputDto); } /// /// 查询员工签到天数 /// - /// + /// /// [HttpGet] - public object SelectWorkerCheckDaySumByWorkerNo([FromQuery] string wkn) + public SingleOutputDto SelectWorkerCheckDaySumByEmployeeId([FromQuery] ReadEmployeeCheckInputDto inputDto) { - return workerCheckService.SelectWorkerCheckDaySumByWorkerNo(wkn); + return workerCheckService.SelectWorkerCheckDaySumByEmployeeId(inputDto); } /// /// 查询今天员工是否已签到 /// - /// + /// /// [HttpGet] - public object SelectToDayCheckInfoByWorkerNo([FromQuery] string wkn) + public SingleOutputDto SelectToDayCheckInfoByWorkerNo([FromQuery] ReadEmployeeCheckInputDto inputDto) { - return workerCheckService.SelectToDayCheckInfoByWorkerNo(wkn); + return workerCheckService.SelectToDayCheckInfoByWorkerNo(inputDto); } /// @@ -63,9 +57,12 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpPost] - public bool AddCheckInfo([FromBody] WorkerCheck workerCheck) + public BaseOutputDto AddCheckInfo([FromBody] CreateEmployeeCheckInputDto workerCheck) { return workerCheckService.AddCheckInfo(workerCheck); } } } + + + diff --git a/EOM.TSHotelManagement.WebApi/Controllers/Worker/WorkerController.cs b/EOM.TSHotelManagement.WebApi/Controllers/Employee/EmployeeController.cs similarity index 47% rename from EOM.TSHotelManagement.WebApi/Controllers/Worker/WorkerController.cs rename to EOM.TSHotelManagement.WebApi/Controllers/Employee/EmployeeController.cs index a82c6ad623093a1b5d4881ccf0d7a723dd95075c..4bbeb0adee5a91d4b1e1d0195cf08f91e8f4f11d 100644 --- a/EOM.TSHotelManagement.WebApi/Controllers/Worker/WorkerController.cs +++ b/EOM.TSHotelManagement.WebApi/Controllers/Employee/EmployeeController.cs @@ -1,26 +1,21 @@ using EOM.TSHotelManagement.Application; using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Contract; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; +using SqlSugar.DistributedSystem.Snowflake; namespace EOM.TSHotelManagement.WebApi.Controllers { /// /// 员工信息控制器 /// - public class WorkerController : ControllerBase + public class EmployeeController : ControllerBase { - /// - /// 员工信息 - /// - private readonly IWorkerService workerService; + private readonly IEmployeeService workerService; - /// - /// - /// - /// - public WorkerController(IWorkerService workerService) + public EmployeeController(IEmployeeService workerService) { this.workerService = workerService; } @@ -31,9 +26,9 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpPost] - public bool UpdateWorker([FromBody] Worker worker) + public BaseOutputDto UpdateEmployee([FromBody] UpdateEmployeeInputDto worker) { - return workerService.UpdateWorker(worker); + return workerService.UpdateEmployee(worker); } /// @@ -42,9 +37,9 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpPost] - public bool ManagerWorkerAccount([FromBody] Worker worker) + public BaseOutputDto ManagerEmployeeAccount([FromBody] UpdateEmployeeInputDto worker) { - return workerService.ManagerWorkerAccount(worker); + return workerService.ManagerEmployeeAccount(worker); } /// @@ -53,10 +48,9 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpPost] - - public bool UpdateWorkerPositionAndClub([FromBody] Worker worker) + public BaseOutputDto UpdateEmployeePositionAndClub([FromBody] UpdateEmployeeInputDto worker) { - return workerService.UpdateWorkerPositionAndClub(worker); + return workerService.UpdateEmployeePositionAndClub(worker); } /// @@ -65,53 +59,54 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpPost] - public bool AddWorker([FromBody] Worker worker) + public BaseOutputDto AddEmployee([FromBody] CreateEmployeeInputDto worker) { - return workerService.AddWorker(worker); + return workerService.AddEmployee(worker); } /// /// 获取所有工作人员信息 /// + /// /// [HttpGet] - public List SelectWorkerAll() + public ListOutputDto SelectEmployeeAll([FromQuery] ReadEmployeeInputDto inputDto) { - return workerService.SelectWorkerAll(); + return workerService.SelectEmployeeAll(inputDto); } /// /// 检查指定部门下是否存在工作人员 /// - /// + /// /// [HttpGet] - public bool CheckWorkerBydepartment(string deptNo) + public BaseOutputDto CheckEmployeeByDepartment([FromQuery] ReadEmployeeInputDto inputDto) { - return workerService.CheckWorkerBydepartment(deptNo); + return workerService.CheckEmployeeByDepartment(inputDto); } /// /// 根据登录名称查询员工信息 /// - /// + /// /// [HttpGet] - public Worker SelectWorkerInfoByWorkerId([FromQuery] string workerId) + public SingleOutputDto SelectEmployeeInfoByEmployeeId([FromQuery] ReadEmployeeInputDto inputDto) { - return workerService.SelectWorkerInfoByWorkerId(workerId); + return workerService.SelectEmployeeInfoByEmployeeId(inputDto); } /// /// 根据登录名称、密码查询员工信息 /// - /// + /// /// [HttpPost] [AllowAnonymous] - public Worker SelectWorkerInfoByWorkerIdAndWorkerPwd([FromBody] Worker worker) + public SingleOutputDto SelectEmployeeInfoByEmployeeIdAndEmployeePwd([FromBody] ReadEmployeeInputDto inputDto) { - return workerService.SelectWorkerInfoByWorkerIdAndWorkerPwd(worker); + return workerService.SelectEmployeeInfoByEmployeeIdAndEmployeePwd(inputDto); } /// @@ -120,9 +115,20 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpPost] - public bool UpdWorkerPwdByWorkNo([FromBody] Worker worker) + public BaseOutputDto UpdEmployeePwdByWorkNo([FromBody] UpdateEmployeeInputDto worker) + { + return workerService.UpdEmployeePwdByWorkNo(worker); + } + + /// + /// 重置员工账号密码 + /// + /// + /// + [HttpPost] + public BaseOutputDto ResetEmployeeAccountPassword([FromBody] UpdateEmployeeInputDto updateEmployeeInputDto) { - return workerService.UpdWorkerPwdByWorkNo(worker); + return workerService.ResetEmployeeAccountPassword(updateEmployeeInputDto); } } -} +} \ No newline at end of file diff --git a/EOM.TSHotelManagement.WebApi/Controllers/Worker/History/WorkerHistoryController.cs b/EOM.TSHotelManagement.WebApi/Controllers/Employee/History/EmployeeHistoryController.cs similarity index 49% rename from EOM.TSHotelManagement.WebApi/Controllers/Worker/History/WorkerHistoryController.cs rename to EOM.TSHotelManagement.WebApi/Controllers/Employee/History/EmployeeHistoryController.cs index 258aa987403b632caf322100e6392357098a9075..1278dba05e0230a457f97cdf1ff8ad378fbc6d4d 100644 --- a/EOM.TSHotelManagement.WebApi/Controllers/Worker/History/WorkerHistoryController.cs +++ b/EOM.TSHotelManagement.WebApi/Controllers/Employee/History/EmployeeHistoryController.cs @@ -1,5 +1,6 @@ using EOM.TSHotelManagement.Application; using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Contract; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; @@ -8,18 +9,11 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// 员工履历控制器 /// - public class WorkerHistoryController : ControllerBase + public class EmployeeHistoryController : ControllerBase { - /// - /// 员工履历 - /// - private readonly IWorkerHistoryService workerHistoryService; + private readonly IEmployeeHistoryService workerHistoryService; - /// - /// - /// - /// - public WorkerHistoryController(IWorkerHistoryService workerHistoryService) + public EmployeeHistoryController(IEmployeeHistoryService workerHistoryService) { this.workerHistoryService = workerHistoryService; } @@ -30,20 +24,22 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpPost] - public bool AddHistoryByWorkerId([FromBody] WorkerHistory workerHistory) + public BaseOutputDto AddHistoryByEmployeeId([FromBody] CreateEmployeeHistoryInputDto workerHistory) { - return workerHistoryService.AddHistoryByWorkerId(workerHistory); + return workerHistoryService.AddHistoryByEmployeeId(workerHistory); } /// /// 根据工号查询履历信息 /// - /// + /// /// [HttpGet] - public List SelectHistoryByWorkerId([FromQuery] string wid) + public ListOutputDto SelectHistoryByEmployeeId([FromQuery] ReadEmployeeHistoryInputDto inputDto) { - return workerHistoryService.SelectHistoryByWorkerId(wid); + return workerHistoryService.SelectHistoryByEmployeeId(inputDto); } } } + + diff --git a/EOM.TSHotelManagement.WebApi/Controllers/Worker/Picture/WorkerPictureController.cs b/EOM.TSHotelManagement.WebApi/Controllers/Employee/Photo/EmployeePhotoController.cs similarity index 43% rename from EOM.TSHotelManagement.WebApi/Controllers/Worker/Picture/WorkerPictureController.cs rename to EOM.TSHotelManagement.WebApi/Controllers/Employee/Photo/EmployeePhotoController.cs index c7e1ac84872083c7d34bafa465dafad711172e30..c5ac2808d6d7ab77bc319598db459482c5246ecf 100644 --- a/EOM.TSHotelManagement.WebApi/Controllers/Worker/Picture/WorkerPictureController.cs +++ b/EOM.TSHotelManagement.WebApi/Controllers/Employee/Photo/EmployeePhotoController.cs @@ -1,24 +1,19 @@ using EOM.TSHotelManagement.Application; using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Contract; using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Http; namespace EOM.TSHotelManagement.WebApi.Controllers { /// /// 照片控制器 /// - public class WorkerPictureController : ControllerBase + public class EmployeePhotoController : ControllerBase { - /// - /// 照片 - /// - private readonly IWorkerPicService workerPicService; + private readonly IEmployeePhotoService workerPicService; - /// - /// - /// - /// - public WorkerPictureController(IWorkerPicService workerPicService) + public EmployeePhotoController(IEmployeePhotoService workerPicService) { this.workerPicService = workerPicService; } @@ -26,47 +21,47 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// 查询员工照片 /// - /// + /// /// [HttpGet] - public WorkerPic WorkerPic([FromQuery] WorkerPic workerPic) + public SingleOutputDto EmployeePhoto([FromQuery] ReadEmployeePhotoInputDto inputDto) { - return workerPicService.WorkerPic(workerPic); + return workerPicService.EmployeePhoto(inputDto); } /// /// 添加员工照片 /// - /// + /// + /// /// [HttpPost] - public bool InsertWorkerPic([FromBody] WorkerPic workerPic) + public SingleOutputDto InsertWorkerPhoto([FromForm] CreateEmployeePhotoInputDto inputDto, IFormFile file) { - return workerPicService.InsertWorkerPic(workerPic); + return workerPicService.InsertWorkerPhoto(inputDto,file); } /// /// 删除员工照片 /// - /// + /// /// [HttpPost] - public bool DeleteWorkerPic([FromBody] WorkerPic workerPic) + public BaseOutputDto DeleteWorkerPhoto([FromBody] DeleteEmployeePhotoInputDto inputDto) { - return workerPicService.DeleteWorkerPic(workerPic); + return workerPicService.DeleteWorkerPhoto(inputDto); } /// /// 更新员工照片 /// - /// + /// /// [HttpPost] - public bool UpdateWorkerPic([FromBody] WorkerPic workerPic) + public BaseOutputDto UpdateWorkerPhoto([FromBody] UpdateEmployeePhotoInputDto inputDto) { - return workerPicService.UpdateWorkerPic(workerPic); + return workerPicService.UpdateWorkerPhoto(inputDto); } - } - } + diff --git a/EOM.TSHotelManagement.WebApi/Controllers/Worker/GoodBad/WorkerGoodBadController.cs b/EOM.TSHotelManagement.WebApi/Controllers/Employee/RewardPunishment/RewardPunishmentController.cs similarity index 58% rename from EOM.TSHotelManagement.WebApi/Controllers/Worker/GoodBad/WorkerGoodBadController.cs rename to EOM.TSHotelManagement.WebApi/Controllers/Employee/RewardPunishment/RewardPunishmentController.cs index 8d0dc26d58c535dd6ba5126fed38737b9411397c..b5810ab8827a5b7d219dbd3194a0ce6f7f3694ec 100644 --- a/EOM.TSHotelManagement.WebApi/Controllers/Worker/GoodBad/WorkerGoodBadController.cs +++ b/EOM.TSHotelManagement.WebApi/Controllers/Employee/RewardPunishment/RewardPunishmentController.cs @@ -1,4 +1,5 @@ using EOM.TSHotelManagement.Application; +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; @@ -8,18 +9,18 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// 奖惩信息控制器 /// - public class WorkerGoodBadController : ControllerBase + public class RewardPunishmentController : ControllerBase { /// /// 奖惩信息 /// - private readonly IWorkerGoodBadService workerGoodBadService; + private readonly IRewardPunishmentService workerGoodBadService; /// /// /// /// - public WorkerGoodBadController(IWorkerGoodBadService workerGoodBadService) + public RewardPunishmentController(IRewardPunishmentService workerGoodBadService) { this.workerGoodBadService = workerGoodBadService; } @@ -30,9 +31,9 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpPost] - public bool AddGoodBad([FromBody] WorkerGoodBad goodBad) + public BaseOutputDto AddRewardPunishment([FromBody] CreateEmployeeRewardPunishmentInputDto goodBad) { - return workerGoodBadService.AddGoodBad(goodBad); + return workerGoodBadService.AddRewardPunishment(goodBad); } /// @@ -41,9 +42,9 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpGet] - public List SelectAllGoodBadByWorkNo([FromQuery] string wn) + public ListOutputDto SelectAllRewardPunishmentByEmployeeId([FromQuery] ReadEmployeeRewardPunishmentInputDto wn) { - return workerGoodBadService.SelectAllGoodBadByWorkNo(wn); + return workerGoodBadService.SelectAllRewardPunishmentByEmployeeId(wn); } } } diff --git a/EOM.TSHotelManagement.WebApi/Controllers/Sys/NavBar/NavBarController.cs b/EOM.TSHotelManagement.WebApi/Controllers/Sys/NavBar/NavBarController.cs index 7fed6f0e2ce2d28993049d3986445093d00e3026..613d7fa89d141e457be81c7364cb06c625969476 100644 --- a/EOM.TSHotelManagement.WebApi/Controllers/Sys/NavBar/NavBarController.cs +++ b/EOM.TSHotelManagement.WebApi/Controllers/Sys/NavBar/NavBarController.cs @@ -1,4 +1,5 @@ using EOM.TSHotelManagement.Application; +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; @@ -29,7 +30,7 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpGet] - public List NavBarList() + public ListOutputDto NavBarList() { return navBarService.NavBarList(); } diff --git a/EOM.TSHotelManagement.WebApi/Controllers/Zero/Admin/AdminController.cs b/EOM.TSHotelManagement.WebApi/Controllers/SystemManagement/Administrator/AdminController.cs similarity index 48% rename from EOM.TSHotelManagement.WebApi/Controllers/Zero/Admin/AdminController.cs rename to EOM.TSHotelManagement.WebApi/Controllers/SystemManagement/Administrator/AdminController.cs index f58b5bded83dd3322275455d8e20b66a82254413..aa4e9fc86eb1471fe44c1374f3dc2647404d7cd6 100644 --- a/EOM.TSHotelManagement.WebApi/Controllers/Zero/Admin/AdminController.cs +++ b/EOM.TSHotelManagement.WebApi/Controllers/SystemManagement/Administrator/AdminController.cs @@ -1,7 +1,10 @@ using EOM.TSHotelManagement.Application; +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Util; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using System; using System.Collections.Generic; namespace EOM.TSHotelManagement.WebApi.Controllers @@ -32,7 +35,7 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// [HttpPost] [AllowAnonymous] - public Admin SelectManagerByPass([FromBody] Admin admin) + public SingleOutputDto SelectManagerByPass([FromBody] ReadAdministratorInputDto admin) { return adminService.SelectManagerByPass(admin); } @@ -44,7 +47,7 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// [HttpPost] [AllowAnonymous] - public Admin Login([FromBody] Admin admin) + public SingleOutputDto Login([FromBody] ReadAdministratorInputDto admin) { return adminService.Login(admin); } @@ -55,7 +58,7 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpGet] - public Admin SelectAdminPwdByAccount([FromQuery] string account) + public SingleOutputDto SelectAdminPwdByAccount([FromQuery] ReadAdministratorInputDto account) { return adminService.SelectAdminPwdByAccount(account); } @@ -65,9 +68,9 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpGet] - public List GetAllAdminList() + public ListOutputDto GetAllAdminList(ReadAdministratorInputDto readAdministratorInputDto) { - return adminService.GetAllAdminList(); + return adminService.GetAllAdminList(readAdministratorInputDto); } /// @@ -76,30 +79,42 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpPost] - public bool UpdateNewPwdByOldPwd([FromBody] Admin admin) + public BaseOutputDto UpdateNewPwdByOldPwd([FromBody] UpdateAdministratorInputDto admin) { return adminService.UpdateNewPwdByOldPwd(admin); } /// - /// 获取管理员列表 + /// 添加管理员 /// + /// /// - [HttpGet] - public List GetAllAdmin() + [HttpPost] + public BaseOutputDto AddAdmin([FromBody] CreateAdministratorInputDto admin) { - return adminService.GetAllAdmin(); + return adminService.AddAdmin(admin); } /// - /// 添加管理员 + /// 更新管理员 /// - /// + /// /// [HttpPost] - public bool AddAdmin([FromBody] Admin admin) + public BaseOutputDto UpdAdmin([FromBody] UpdateAdministratorInputDto updateAdministratorInputDto) { - return adminService.AddAdmin(admin); + return adminService.UpdAdmin(updateAdministratorInputDto); + } + + /// + /// 删除管理员 + /// + /// + /// + [HttpPost] + public BaseOutputDto DelAdmin([FromBody] DeleteAdministratorInputDto deleteAdministratorInputDto) + { + return adminService.DelAdmin(deleteAdministratorInputDto); } /// @@ -108,7 +123,7 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpGet] - public Admin GetAdminInfoByAdminAccount([FromQuery] Admin admin) + public SingleOutputDto GetAdminInfoByAdminAccount([FromQuery] ReadAdministratorInputDto admin) { return adminService.GetAdminInfoByAdminAccount(admin); } @@ -118,9 +133,42 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpGet] - public List GetAllAdminTypes() + public ListOutputDto GetAllAdminTypes(ReadAdministratorTypeInputDto readAdministratorTypeInputDto) + { + return adminService.GetAllAdminTypes(readAdministratorTypeInputDto); + } + + /// + /// 添加管理员类型 + /// + /// + /// + [HttpPost] + public BaseOutputDto AddAdminType([FromBody]CreateAdministratorTypeInputDto createAdministratorTypeInputDto) + { + return adminService.AddAdminType(createAdministratorTypeInputDto); + } + + /// + /// 更新管理员类型 + /// + /// + /// + [HttpPost] + public BaseOutputDto UpdAdminType([FromBody] UpdateAdministratorTypeInputDto updateAdministratorTypeInputDto) + { + return adminService.UpdAdminType(updateAdministratorTypeInputDto); + } + + /// + /// 删除管理员类型 + /// + /// + /// + [HttpPost] + public BaseOutputDto DelAdminType([FromBody] DeleteAdministratorTypeInputDto deleteAdministratorTypeInputDto) { - return adminService.GetAllAdminTypes(); + return adminService.DelAdminType(deleteAdministratorTypeInputDto); } /// @@ -129,7 +177,7 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpPost] - public bool UpdAccount([FromBody] Admin admins) + public BaseOutputDto UpdAccount([FromBody] UpdateAdministratorInputDto admins) { return adminService.UpdAccount(admins); } diff --git a/EOM.TSHotelManagement.WebApi/Controllers/Zero/Base/BaseController.cs b/EOM.TSHotelManagement.WebApi/Controllers/SystemManagement/Base/BaseController.cs similarity index 31% rename from EOM.TSHotelManagement.WebApi/Controllers/Zero/Base/BaseController.cs rename to EOM.TSHotelManagement.WebApi/Controllers/SystemManagement/Base/BaseController.cs index ded18fe181efdbb0d1df17676498f1565a8134d0..392869afa3f57334e3dba85971dd06841cad36cd 100644 --- a/EOM.TSHotelManagement.WebApi/Controllers/Zero/Base/BaseController.cs +++ b/EOM.TSHotelManagement.WebApi/Controllers/SystemManagement/Base/BaseController.cs @@ -1,7 +1,11 @@ using EOM.TSHotelManagement.Application; +using EOM.TSHotelManagement.Common; +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; using Microsoft.AspNetCore.Mvc; +using System; using System.Collections.Generic; +using System.Linq; namespace EOM.TSHotelManagement.WebApi.Controllers { @@ -10,15 +14,8 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// public class BaseController : ControllerBase { - /// - /// 基础信息 - /// private readonly IBaseService baseService; - /// - /// - /// - /// public BaseController(IBaseService baseService) { this.baseService = baseService; @@ -27,111 +24,66 @@ namespace EOM.TSHotelManagement.WebApi.Controllers #region 性别模块 /// - /// 查询所有性别类型 + /// /// /// [HttpGet] - public List SelectSexTypeAll([FromQuery] SexType sexType = null) + public ListOutputDto SelectGenderTypeAll() { - return baseService.SelectSexTypeAll(sexType); + return baseService.SelectGenderTypeAll(); } + #endregion - /// - /// 查询性别类型 - /// - /// - [HttpGet] - public SexType SelectSexType([FromQuery] SexType sexType) - { - return baseService.SelectSexType(sexType); - } + #region 面貌模块 - /// - /// 添加性别类型 - /// - /// - /// - [HttpPost] - public bool AddSexType([FromBody] SexType sexType) + [HttpGet] + public ListOutputDto SelectWorkerFeatureAll() { - return baseService.AddSexType(sexType); + return baseService.SelectWorkerFeatureAll(); } - /// - /// 删除性别类型 - /// - /// - /// - [HttpPost] - public bool DelSexType([FromBody] SexType sexType) - { - return baseService.DelSexType(sexType); - } + #endregion + #region 房间状态模块 /// - /// 更新性别类型 + /// 获取所有房间状态 /// - /// /// - [HttpPost] - public bool UpdSexType([FromBody] SexType sexType) + [HttpGet] + public ListOutputDto SelectRoomStateAll() { - return baseService.UpdSexType(sexType); + return baseService.SelectRoomStateAll(); } - #endregion #region 职位模块 - /// - /// 查询所有职位类型 - /// - /// [HttpGet] - public List SelectPositionAll([FromQuery] Position position = null) + public ListOutputDto SelectPositionAll([FromQuery] ReadPositionInputDto position = null) { return baseService.SelectPositionAll(position); } - /// - /// 查询职位类型 - /// - /// [HttpGet] - public Position SelectPosition([FromQuery] Position position) + public SingleOutputDto SelectPosition([FromQuery] ReadPositionInputDto position) { return baseService.SelectPosition(position); } - /// - /// 添加职位类型 - /// - /// - /// [HttpPost] - public bool AddPosition([FromBody] Position position) + public BaseOutputDto AddPosition([FromBody] CreatePositionInputDto position) { return baseService.AddPosition(position); } - /// - /// 删除职位类型 - /// - /// - /// [HttpPost] - public bool DelPosition([FromBody] Position position) + public BaseOutputDto DelPosition([FromBody] DeletePositionInputDto position) { return baseService.DelPosition(position); } - /// - /// 更新职位类型 - /// - /// - /// [HttpPost] - public bool UpdPosition([FromBody] Position position) + public BaseOutputDto UpdPosition([FromBody] UpdatePositionInputDto position) { return baseService.UpdPosition(position); } @@ -140,55 +92,32 @@ namespace EOM.TSHotelManagement.WebApi.Controllers #region 民族模块 - /// - /// 查询所有民族类型 - /// - /// [HttpGet] - public List SelectNationAll([FromQuery] Nation nation = null) + public ListOutputDto SelectNationAll([FromQuery] ReadNationInputDto nation = null) { return baseService.SelectNationAll(nation); } - /// - /// 查询民族类型 - /// - /// [HttpGet] - public Nation SelectNation([FromQuery] Nation nation) + public SingleOutputDto SelectNation([FromQuery] ReadNationInputDto nation) { return baseService.SelectNation(nation); } - /// - /// 添加民族类型 - /// - /// - /// [HttpPost] - public bool AddNation([FromBody] Nation nation) + public BaseOutputDto AddNation([FromBody] CreateNationInputDto nation) { return baseService.AddNation(nation); } - /// - /// 删除民族类型 - /// - /// - /// [HttpPost] - public bool DelNation([FromBody] Nation nation) + public BaseOutputDto DelNation([FromBody] DeleteNationInputDto nation) { return baseService.DelNation(nation); } - /// - /// 更新民族类型 - /// - /// - /// [HttpPost] - public bool UpdNation([FromBody] Nation nation) + public BaseOutputDto UpdNation([FromBody] UpdateNationInputDto nation) { return baseService.UpdNation(nation); } @@ -197,55 +126,32 @@ namespace EOM.TSHotelManagement.WebApi.Controllers #region 学历模块 - /// - /// 查询所有学历类型 - /// - /// [HttpGet] - public List SelectEducationAll([FromQuery] Education education = null) + public ListOutputDto SelectEducationAll([FromQuery] ReadEducationInputDto education = null) { return baseService.SelectEducationAll(education); } - /// - /// 查询学历类型 - /// - /// [HttpGet] - public Education SelectEducation([FromQuery] Education education) + public SingleOutputDto SelectEducation([FromQuery] ReadEducationInputDto education) { return baseService.SelectEducation(education); } - /// - /// 添加学历类型 - /// - /// - /// [HttpPost] - public bool AddEducation([FromBody] Education education) + public BaseOutputDto AddEducation([FromBody] CreateEducationInputDto education) { return baseService.AddEducation(education); } - /// - /// 删除学历类型 - /// - /// - /// [HttpPost] - public bool DelEducation([FromBody] Education education) + public BaseOutputDto DelEducation([FromBody] DeleteEducationInputDto education) { return baseService.DelEducation(education); } - /// - /// 更新学历类型 - /// - /// - /// [HttpPost] - public bool UpdEducation([FromBody] Education education) + public BaseOutputDto UpdEducation([FromBody] UpdateEducationInputDto education) { return baseService.UpdEducation(education); } @@ -254,65 +160,38 @@ namespace EOM.TSHotelManagement.WebApi.Controllers #region 部门模块 - /// - /// 查询所有部门类型(可用) - /// - /// [HttpGet] - public List SelectDeptAllCanUse() + public ListOutputDto SelectDeptAllCanUse() { return baseService.SelectDeptAllCanUse(); } - /// - /// 查询所有部门类型 - /// - /// [HttpGet] - public List SelectDeptAll() + public ListOutputDto SelectDeptAll([FromQuery]ReadDepartmentInputDto readDepartmentInputDto) { - return baseService.SelectDeptAll(); + return baseService.SelectDeptAll(readDepartmentInputDto); } - /// - /// 查询部门类型 - /// - /// [HttpGet] - public Dept SelectDept([FromQuery] Dept dept) + public SingleOutputDto SelectDept([FromQuery] ReadDepartmentInputDto dept) { return baseService.SelectDept(dept); } - /// - /// 添加部门类型 - /// - /// - /// [HttpPost] - public bool AddDept([FromBody] Dept dept) + public BaseOutputDto AddDept([FromBody] CreateDepartmentInputDto dept) { return baseService.AddDept(dept); } - /// - /// 删除部门类型 - /// - /// - /// [HttpPost] - public bool DelDept([FromBody] Dept dept) + public BaseOutputDto DelDept([FromBody] DeleteDepartmentInputDto dept) { return baseService.DelDept(dept); } - /// - /// 更新部门类型 - /// - /// - /// [HttpPost] - public bool UpdDept([FromBody] Dept dept) + public BaseOutputDto UpdDept([FromBody] UpdateDepartmentInputDto dept) { return baseService.UpdDept(dept); } @@ -321,66 +200,38 @@ namespace EOM.TSHotelManagement.WebApi.Controllers #region 客户类型模块 - /// - /// 查询所有客户类型(可用) - /// - /// [HttpGet] - public List SelectCustoTypeAllCanUse() + public ListOutputDto SelectCustoTypeAllCanUse() { return baseService.SelectCustoTypeAllCanUse(); } - /// - /// 查询所有客户类型 - /// - /// [HttpGet] - public List SelectCustoTypeAll() + public ListOutputDto SelectCustoTypeAll([FromQuery]ReadCustoTypeInputDto readCustoTypeInputDto) { - return baseService.SelectCustoTypeAll(); + return baseService.SelectCustoTypeAll(readCustoTypeInputDto); } - /// - /// 根据客户类型ID查询类型名称 - /// - /// - /// [HttpGet] - public CustoType SelectCustoTypeByTypeId([FromQuery] CustoType custoType) + public SingleOutputDto SelectCustoTypeByTypeId([FromQuery] ReadCustoTypeInputDto custoType) { return baseService.SelectCustoTypeByTypeId(custoType); } - /// - /// 添加客户类型 - /// - /// - /// [HttpPost] - public bool InsertCustoType([FromBody] CustoType custoType) + public BaseOutputDto InsertCustoType([FromBody] CreateCustoTypeInputDto custoType) { return baseService.InsertCustoType(custoType); } - /// - /// 删除客户类型 - /// - /// - /// [HttpPost] - public bool DeleteCustoType([FromBody] CustoType custoType) + public BaseOutputDto DeleteCustoType([FromBody] DeleteCustoTypeInputDto custoType) { return baseService.DeleteCustoType(custoType); } - /// - /// 更新客户类型 - /// - /// - /// [HttpPost] - public bool UpdateCustoType([FromBody] CustoType custoType) + public BaseOutputDto UpdateCustoType([FromBody] UpdateCustoTypeInputDto custoType) { return baseService.UpdateCustoType(custoType); } @@ -389,66 +240,38 @@ namespace EOM.TSHotelManagement.WebApi.Controllers #region 证件类型模块 - /// - /// 查询所有证件类型(可用) - /// - /// [HttpGet] - public List SelectPassPortTypeAllCanUse() + public ListOutputDto SelectPassPortTypeAllCanUse() { return baseService.SelectPassPortTypeAllCanUse(); } - /// - /// 查询所有证件类型 - /// - /// [HttpGet] - public List SelectPassPortTypeAll() + public ListOutputDto SelectPassPortTypeAll([FromQuery]ReadPassportTypeInputDto readPassportTypeInputDto) { - return baseService.SelectPassPortTypeAll(); + return baseService.SelectPassPortTypeAll(readPassportTypeInputDto); } - /// - /// 根据证件类型ID查询类型名称 - /// - /// - /// [HttpGet] - public PassPortType SelectPassPortTypeByTypeId([FromQuery] PassPortType passPortType) + public SingleOutputDto SelectPassPortTypeByTypeId([FromQuery] ReadPassportTypeInputDto passPortType) { return baseService.SelectPassPortTypeByTypeId(passPortType); } - /// - /// 添加证件类型 - /// - /// - /// [HttpPost] - public bool InsertPassPortType([FromBody] PassPortType passPortType) + public BaseOutputDto InsertPassPortType([FromBody] CreatePassportTypeInputDto passPortType) { return baseService.InsertPassPortType(passPortType); } - /// - /// 删除证件类型 - /// - /// - /// [HttpPost] - public bool DeletePassPortType([FromBody] PassPortType portType) + public BaseOutputDto DeletePassPortType([FromBody] DeletePassportTypeInputDto portType) { return baseService.DeletePassPortType(portType); } - /// - /// 更新证件类型 - /// - /// - /// [HttpPost] - public bool UpdatePassPortType([FromBody] PassPortType portType) + public BaseOutputDto UpdatePassPortType([FromBody] UpdatePassportTypeInputDto portType) { return baseService.UpdatePassPortType(portType); } @@ -457,82 +280,52 @@ namespace EOM.TSHotelManagement.WebApi.Controllers #region 奖惩类型模块 - /// - /// 查询所有奖惩类型(可用) - /// - /// [HttpGet] - public List SelectGBTypeAllCanUse() + public ListOutputDto SelectRewardPunishmentTypeAllCanUse() { - return baseService.SelectGBTypeAllCanUse(); + return baseService.SelectRewardPunishmentTypeAllCanUse(); } - /// - /// 查询所有奖惩类型 - /// - /// [HttpGet] - public List SelectGBTypeAll() + public ListOutputDto SelectRewardPunishmentTypeAll([FromQuery]ReadRewardPunishmentTypeInputDto readRewardPunishmentTypeInputDto) { - return baseService.SelectGBTypeAll(); + return baseService.SelectRewardPunishmentTypeAll(readRewardPunishmentTypeInputDto); } - /// - /// 根据奖惩类型ID查询类型名称 - /// - /// - /// [HttpGet] - public GBType SelectGBTypeByTypeId([FromQuery] GBType gBType) + public SingleOutputDto SelectRewardPunishmentTypeByTypeId([FromQuery] ReadRewardPunishmentTypeInputDto readRewardPunishmentTypeInputDto) { - return baseService.SelectGBTypeByTypeId(gBType); + return baseService.SelectRewardPunishmentTypeByTypeId(readRewardPunishmentTypeInputDto); } - /// - /// 添加奖惩类型 - /// - /// - /// [HttpPost] - public bool InsertGBType([FromBody] GBType gBType) + public BaseOutputDto InsertRewardPunishmentType([FromBody] CreateRewardPunishmentTypeInputDto createRewardPunishmentTypeInputDto) { - return baseService.InsertGBType(gBType); + return baseService.InsertRewardPunishmentType(createRewardPunishmentTypeInputDto); } - /// - /// 删除奖惩类型 - /// - /// - /// [HttpPost] - public bool DeleteGBType([FromBody] GBType gBType) + public BaseOutputDto DeleteRewardPunishmentType([FromBody] DeleteRewardPunishmentTypeInputDto deleteRewardPunishmentTypeInputDto) { - return baseService.DeleteGBType(gBType); + return baseService.DeleteRewardPunishmentType(deleteRewardPunishmentTypeInputDto); } - /// - /// 更新奖惩类型 - /// - /// - /// [HttpPost] - public bool UpdateGBType([FromBody] GBType gBType) + public BaseOutputDto UpdateRewardPunishmentType([FromBody] UpdateRewardPunishmentTypeInputDto updateRewardPunishmentTypeInputDto) { - return baseService.UpdateGBType(gBType); + return baseService.UpdateRewardPunishmentType(updateRewardPunishmentTypeInputDto); } #endregion #region URL模块 - /// - /// 基础URL - /// - /// + [HttpGet] - public Base GetBase() + public SingleOutputDto GetBase() { return baseService.GetBase(); } + #endregion } } diff --git a/EOM.TSHotelManagement.WebApi/Controllers/Zero/Menu/MenuController.cs b/EOM.TSHotelManagement.WebApi/Controllers/SystemManagement/Menu/MenuController.cs similarity index 72% rename from EOM.TSHotelManagement.WebApi/Controllers/Zero/Menu/MenuController.cs rename to EOM.TSHotelManagement.WebApi/Controllers/SystemManagement/Menu/MenuController.cs index eacb2d8e98903cb63d7aa2a0ce9189cdcad44ef5..15f87912dc23c8cf6a70f4c3f7781a3290a96ceb 100644 --- a/EOM.TSHotelManagement.WebApi/Controllers/Zero/Menu/MenuController.cs +++ b/EOM.TSHotelManagement.WebApi/Controllers/SystemManagement/Menu/MenuController.cs @@ -1,4 +1,5 @@ using EOM.TSHotelManagement.Application; +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; @@ -24,20 +25,19 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpGet] - public List SelectMenuAll() + public ListOutputDto SelectMenuAll(ReadMenuInputDto readMenuInputDto) { - return menuService.SelectMenuAll(); + return menuService.SelectMenuAll(readMenuInputDto); } /// /// 构建菜单树 /// /// - [HttpGet] - [AllowAnonymous] - public List BuildMenuAll() + [HttpPost] + public List BuildMenuAll([FromBody]BaseInputDto baseInputDto) { - return menuService.BuildMenuAll(); + return menuService.BuildMenuAll(baseInputDto); } /// @@ -46,7 +46,7 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpPost] - public bool InsertMenu([FromBody]Menu menu) + public BaseOutputDto InsertMenu([FromBody]CreateMenuInputDto menu) { return menuService.InsertMenu(menu); } @@ -57,7 +57,7 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpPost] - public bool UpdateMenu([FromBody] Menu menu) + public BaseOutputDto UpdateMenu([FromBody] UpdateMenuInputDto menu) { return menuService.UpdateMenu(menu); } @@ -68,7 +68,7 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpPost] - public bool DeleteMenu([FromBody] Menu menu) + public BaseOutputDto DeleteMenu([FromBody] DeleteMenuInputDto menu) { return menuService.DeleteMenu(menu); } diff --git a/EOM.TSHotelManagement.WebApi/Controllers/Zero/Notice/NoticeController.cs b/EOM.TSHotelManagement.WebApi/Controllers/SystemManagement/Notice/NoticeController.cs similarity index 55% rename from EOM.TSHotelManagement.WebApi/Controllers/Zero/Notice/NoticeController.cs rename to EOM.TSHotelManagement.WebApi/Controllers/SystemManagement/Notice/NoticeController.cs index f817a398ee030526be1d4e7acda441fa8dabc342..6f2711d43f1168fa437bd35ec80f3c459a544882 100644 --- a/EOM.TSHotelManagement.WebApi/Controllers/Zero/Notice/NoticeController.cs +++ b/EOM.TSHotelManagement.WebApi/Controllers/SystemManagement/Notice/NoticeController.cs @@ -1,7 +1,8 @@ -using EOM.TSHotelManagement.Application; -using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Contract; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; +using EOM.TSHotelManagement.Application; namespace EOM.TSHotelManagement.WebApi.Controllers { @@ -10,15 +11,8 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// public class NoticeController : ControllerBase { - /// - /// 公告 - /// private readonly INoticeService noticeService; - /// - /// - /// - /// public NoticeController(INoticeService noticeService) { this.noticeService = noticeService; @@ -28,38 +22,37 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// 获取所有公告信息 /// + /// /// [HttpGet] - public List SelectNoticeAll() + public ListOutputDto SelectNoticeAll([FromQuery] ReadAppointmentNoticeInputDto inputDto) { - return noticeService.SelectNoticeAll(); + return noticeService.SelectNoticeAll(inputDto); } #endregion /// /// 查询公告 /// - /// + /// /// [HttpGet] - public Notice SelectNoticeByNoticeNo([FromQuery] string noticeId) + public ReadAppointmentNoticeOutputDto SelectNoticeByNoticeNo([FromQuery] ReadAppointmentNoticeInputDto inputDto) { - return noticeService.SelectNoticeByNoticeNo(noticeId); + return noticeService.SelectNoticeByNoticeNo(inputDto); } #region 上传公告信息 /// /// 上传公告信息 /// - /// + /// /// [HttpPost] - public bool InsertNotice([FromBody] Notice notice) + public BaseOutputDto InsertNotice([FromBody] CreateAppointmentNoticeInputDto inputDto) { - return noticeService.InsertNotice(notice); + return noticeService.InsertNotice(inputDto); } - #endregion - } -} +} \ No newline at end of file diff --git a/EOM.TSHotelManagement.WebApi/Controllers/SystemManagement/Role/RoleController.cs b/EOM.TSHotelManagement.WebApi/Controllers/SystemManagement/Role/RoleController.cs new file mode 100644 index 0000000000000000000000000000000000000000..c1562f6d7f8290df7c88921c9a3879bca11f9a20 --- /dev/null +++ b/EOM.TSHotelManagement.WebApi/Controllers/SystemManagement/Role/RoleController.cs @@ -0,0 +1,61 @@ +using EOM.TSHotelManagement.Application; +using EOM.TSHotelManagement.Common.Contract; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; + +namespace EOM.TSHotelManagement.WebApi.Controllers +{ + public class RoleController : ControllerBase + { + private readonly IRoleAppService _roleAppService; + + public RoleController(IRoleAppService roleAppService) + { + _roleAppService = roleAppService; + } + + /// + /// 查询角色列表 + /// + /// + /// + [HttpGet] + public ListOutputDto SelectRoleList([FromQuery]ReadRoleInputDto readRoleInputDto) + { + return _roleAppService.SelectRoleList(readRoleInputDto); + } + + /// + /// 添加角色 + /// + /// + /// + [HttpPost] + public BaseOutputDto InsertRole([FromBody]CreateRoleInputDto createRoleInputDto) + { + return _roleAppService.InsertRole(createRoleInputDto); + } + + /// + /// 更新角色 + /// + /// + /// + [HttpPost] + public BaseOutputDto UpdateRole([FromBody] UpdateRoleInputDto updateRoleInputDto) + { + return _roleAppService.UpdateRole(updateRoleInputDto); + } + + /// + /// 删除角色 + /// + /// + /// + [HttpPost] + public BaseOutputDto DeleteRole([FromBody] DeleteRoleInputDto deleteRoleInputDto) + { + return _roleAppService.DeleteRole(deleteRoleInputDto); + } + } +} diff --git a/EOM.TSHotelManagement.WebApi/Controllers/Zero/CheckInfo/CheckInfoController.cs b/EOM.TSHotelManagement.WebApi/Controllers/SystemManagement/SupervisionStatistics/SupervisionStatisticsController.cs similarity index 40% rename from EOM.TSHotelManagement.WebApi/Controllers/Zero/CheckInfo/CheckInfoController.cs rename to EOM.TSHotelManagement.WebApi/Controllers/SystemManagement/SupervisionStatistics/SupervisionStatisticsController.cs index 5287a072f3e20252b42556a437668c5016e361d9..19db8ca30be50b69031f08139019ef81311946a8 100644 --- a/EOM.TSHotelManagement.WebApi/Controllers/Zero/CheckInfo/CheckInfoController.cs +++ b/EOM.TSHotelManagement.WebApi/Controllers/SystemManagement/SupervisionStatistics/SupervisionStatisticsController.cs @@ -1,25 +1,19 @@ -using EOM.TSHotelManagement.Application; -using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Contract; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; +using EOM.TSHotelManagement.Application; namespace EOM.TSHotelManagement.WebApi.Controllers { /// /// 监管统计控制器 /// - public class CheckInfoController : ControllerBase + public class SupervisionStatisticsController : ControllerBase { - /// - /// 监管统计 - /// - private readonly ICheckInfoService checkInfoService; + private readonly ISupervisionStatisticsService checkInfoService; - /// - /// - /// - /// - public CheckInfoController(ICheckInfoService checkInfoService) + public SupervisionStatisticsController(ISupervisionStatisticsService checkInfoService) { this.checkInfoService = checkInfoService; } @@ -27,44 +21,45 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// 查询所有监管统计信息 /// + /// /// [HttpGet] - public List SelectCheckInfoAll() + public ListOutputDto SelectSupervisionStatisticsAll([FromQuery] ReadSupervisionStatisticsInputDto inputDto) { - return checkInfoService.SelectCheckInfoAll(); + return checkInfoService.SelectSupervisionStatisticsAll(inputDto); } /// /// 插入监管统计信息 /// - /// + /// /// [HttpPost] - public bool InsertCheckInfo([FromBody]CheckInfo checkInfo) + public BaseOutputDto InsertSupervisionStatistics([FromBody] CreateSupervisionStatisticsInputDto inputDto) { - return checkInfoService.InsertCheckInfo(checkInfo); + return checkInfoService.InsertSupervisionStatistics(inputDto); } /// /// 更新监管统计信息 /// - /// + /// /// [HttpPost] - public bool UpdateCheckInfo([FromBody]CheckInfo checkInfo) + public BaseOutputDto UpdateSupervisionStatistics([FromBody] UpdateSupervisionStatisticsInputDto inputDto) { - return checkInfoService.UpdateCheckInfo(checkInfo); + return checkInfoService.UpdateSupervisionStatistics(inputDto); } /// /// 删除监管统计信息 /// - /// + /// /// [HttpPost] - public bool DeleteCheckInfo([FromBody] CheckInfo checkInfo) + public BaseOutputDto DeleteSupervisionStatistics([FromBody] DeleteSupervisionStatisticsInputDto inputDto) { - return checkInfoService.DeleteCheckInfo(checkInfo); + return checkInfoService.DeleteSupervisionStatistics(inputDto); } } -} +} \ No newline at end of file diff --git a/EOM.TSHotelManagement.WebApi/Controllers/Zero/VipRule/VipRuleController.cs b/EOM.TSHotelManagement.WebApi/Controllers/SystemManagement/VipRule/VipRuleController.cs similarity index 51% rename from EOM.TSHotelManagement.WebApi/Controllers/Zero/VipRule/VipRuleController.cs rename to EOM.TSHotelManagement.WebApi/Controllers/SystemManagement/VipRule/VipRuleController.cs index 4dfe0fafb4eb88590d00474c2a698774762908e2..31ce6f68381748469097cd3c35d03f727da66e4f 100644 --- a/EOM.TSHotelManagement.WebApi/Controllers/Zero/VipRule/VipRuleController.cs +++ b/EOM.TSHotelManagement.WebApi/Controllers/SystemManagement/VipRule/VipRuleController.cs @@ -1,7 +1,8 @@ -using EOM.TSHotelManagement.Application; -using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.Common.Contract; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; +using EOM.TSHotelManagement.Application; namespace EOM.TSHotelManagement.WebApi.Controllers { @@ -10,15 +11,8 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// public class VipRuleController : ControllerBase { - /// - /// 会员规则 - /// private readonly IVipRuleAppService vipRuleAppService; - /// - /// - /// - /// public VipRuleController(IVipRuleAppService vipRuleAppService) { this.vipRuleAppService = vipRuleAppService; @@ -27,55 +21,58 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// 查询会员等级规则列表 /// + /// /// [HttpGet] - public List SelectVipRuleList() + public ListOutputDto SelectVipRuleList([FromQuery] ReadVipLevelRuleInputDto inputDto) { - return vipRuleAppService.SelectVipRuleList(); + return vipRuleAppService.SelectVipRuleList(inputDto); } /// /// 查询会员等级规则 /// - /// + /// /// [HttpGet] - public VipRule SelectVipRule([FromQuery] VipRule vipRule) + public SingleOutputDto SelectVipRule([FromQuery] ReadVipLevelRuleInputDto inputDto) { - return vipRuleAppService.SelectVipRule(vipRule); + return vipRuleAppService.SelectVipRule(inputDto); } /// /// 添加会员等级规则 /// - /// + /// /// [HttpPost] - public bool AddVipRule([FromBody] VipRule vipRule) + public BaseOutputDto AddVipRule([FromBody] CreateVipLevelRuleInputDto inputDto) { - return vipRuleAppService.AddVipRule(vipRule); + return vipRuleAppService.AddVipRule(inputDto); } /// /// 删除会员等级规则 /// - /// + /// /// [HttpPost] - public bool DelVipRule([FromBody] VipRule vipRule) + public BaseOutputDto DelVipRule([FromBody] DeleteVipLevelRuleInputDto inputDto) { - return vipRuleAppService.DelVipRule(vipRule); + return vipRuleAppService.DelVipRule(inputDto); } /// /// 更新会员等级规则 /// - /// + /// /// [HttpPost] - public bool UpdVipRule([FromBody] VipRule vipRule) + public BaseOutputDto UpdVipRule([FromBody] UpdateVipLevelRuleInputDto inputDto) { - return vipRuleAppService.UpdVipRule(vipRule); + return vipRuleAppService.UpdVipRule(inputDto); } } } + + diff --git a/EOM.TSHotelManagement.WebApi/Controllers/Util/AppController.cs b/EOM.TSHotelManagement.WebApi/Controllers/Util/UtilityController.cs similarity index 44% rename from EOM.TSHotelManagement.WebApi/Controllers/Util/AppController.cs rename to EOM.TSHotelManagement.WebApi/Controllers/Util/UtilityController.cs index 8790bf9b9a0700bd72c511126642c40dbe2ec2cd..181e58ab2f226a866cdb57959d1d674295772f41 100644 --- a/EOM.TSHotelManagement.WebApi/Controllers/Util/AppController.cs +++ b/EOM.TSHotelManagement.WebApi/Controllers/Util/UtilityController.cs @@ -1,4 +1,5 @@ using EOM.TSHotelManagement.Application; +using EOM.TSHotelManagement.Common.Contract; using EOM.TSHotelManagement.Common.Core; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; @@ -8,18 +9,11 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// 工具类控制器 /// - public class AppController : ControllerBase + public class UtilityController : ControllerBase { - /// - /// 工具 - /// private readonly IUtilService utilService; - /// - /// - /// - /// - public AppController(IUtilService utilService) + public UtilityController(IUtilService utilService) { this.utilService = utilService; } @@ -27,12 +21,12 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// 查询身份证号码 /// - /// + /// /// - [HttpGet] - public string SelectCardCode([FromQuery] string identityCard) + [HttpPost] + public SingleOutputDto SelectCardCode([FromBody] ReadCardCodeInputDto readCardCodeInputDto) { - return utilService.SelectCardCode(identityCard); + return utilService.SelectCardCode(readCardCodeInputDto); } /// @@ -41,7 +35,7 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// [HttpGet] [AllowAnonymous] - public Applicationversion CheckBaseVersion() + public ReadApplicationVersionOutputDto CheckBaseVersion() { return utilService.CheckBaseVersion(); } @@ -52,7 +46,7 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpPost] - public bool AddLog([FromBody] OperationLog opr) + public BaseOutputDto AddLog([FromBody] CreateOperationLogInputDto opr) { return utilService.AddLog(opr); } @@ -62,9 +56,31 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpGet] - public OSelectAllDto SelectOperationlogAll([FromQuery] int? pageIndex, int? pageSize) + public ListOutputDto SelectOperationlogAll([FromQuery] ReadOperationLogInputDto readOperationLogInputDto) + { + return utilService.SelectOperationlogAll(readOperationLogInputDto); + } + + /// + /// 删除时间范围的操作日志 + /// + /// + /// + [HttpPost] + public BaseOutputDto DeleteOperationlogByRange([FromBody]ReadOperationLogInputDto readOperationLogInputDto) + { + return utilService.DeleteOperationlogByRange(readOperationLogInputDto); + } + + /// + /// 删除操作日志 + /// + /// + /// + [HttpPost] + public BaseOutputDto DeleteOperationlog([FromBody] DeleteOperationLogInputDto deleteOperationLogInputDto) { - return utilService.SelectOperationlogAll(pageIndex, pageSize); + return utilService.DeleteOperationlog(deleteOperationLogInputDto); } } } diff --git a/EOM.TSHotelManagement.WebApi/Controllers/Zero/Module/ModuleController.cs b/EOM.TSHotelManagement.WebApi/Controllers/Zero/Module/ModuleController.cs deleted file mode 100644 index 836a7b50fa95e4097b3c33fe1dd2c96443a7adee..0000000000000000000000000000000000000000 --- a/EOM.TSHotelManagement.WebApi/Controllers/Zero/Module/ModuleController.cs +++ /dev/null @@ -1,71 +0,0 @@ -using EOM.TSHotelManagement.Application; -using EOM.TSHotelManagement.Common.Core; -using Microsoft.AspNetCore.Mvc; -using System.Collections.Generic; - -namespace EOM.TSHotelManagement.WebApi.Controllers -{ - /// - /// 系统模块控制器 - /// - public class ModuleController : ControllerBase - { - /// - /// 系统模块 - /// - private readonly IAdminModuleZeroService adminModuleZeroService; - - /// - /// - /// - /// - public ModuleController(IAdminModuleZeroService adminModuleZeroService) - { - this.adminModuleZeroService = adminModuleZeroService; - } - - /// - /// 获取所有模块 - /// - /// - [HttpGet] - public List GetAllModule() - { - return adminModuleZeroService.GetAllModule(); - } - - /// - /// 根据账号获取对应模块 - /// - /// - /// - [HttpPost] - public List GetAllModuleByAdmin([FromBody] Admin admin) - { - return adminModuleZeroService.GetAllModuleByAdmin(admin); - } - - /// - /// 批量添加模块 - /// - /// - /// - [HttpPost] - public bool AddModuleZeroList([FromBody] List moduleZeros) - { - return adminModuleZeroService.AddModuleZeroList(moduleZeros); - } - - /// - /// 批量删除模块 - /// - /// - /// - [HttpPost] - public bool DelModuleZeroList([FromBody] ModuleZero moduleZero) - { - return adminModuleZeroService.DelModuleZeroList(moduleZero); - } - - } -} diff --git a/EOM.TSHotelManagement.WebApi/EOM.TSHotelManagement.WebApi.csproj b/EOM.TSHotelManagement.WebApi/EOM.TSHotelManagement.WebApi.csproj index ccf002ba53f8ad05903a2d1f631e42c3a6e8c5e5..8f65b1e234df3675440b45d4877b2b98677b9274 100644 --- a/EOM.TSHotelManagement.WebApi/EOM.TSHotelManagement.WebApi.csproj +++ b/EOM.TSHotelManagement.WebApi/EOM.TSHotelManagement.WebApi.csproj @@ -26,7 +26,7 @@ - + diff --git a/EOM.TSHotelManagement.WebApi/Extension/MiddlewareExtensions.cs b/EOM.TSHotelManagement.WebApi/Extension/MiddlewareExtensions.cs new file mode 100644 index 0000000000000000000000000000000000000000..7e7f5d4774e745563d235ed5a2af40704b8f6153 --- /dev/null +++ b/EOM.TSHotelManagement.WebApi/Extension/MiddlewareExtensions.cs @@ -0,0 +1,13 @@ +using Microsoft.AspNetCore.Builder; + +namespace EOM.TSHotelManagement.WebApi +{ + public static class MiddlewareExtensions + { + public static IApplicationBuilder UseRequestLogging( + this IApplicationBuilder builder) + { + return builder.UseMiddleware(); + } + } +} diff --git a/EOM.TSHotelManagement.WebApi/Router_Extension/MvcOptionsExtensions.cs b/EOM.TSHotelManagement.WebApi/Extension/MvcOptionsExtensions.cs similarity index 100% rename from EOM.TSHotelManagement.WebApi/Router_Extension/MvcOptionsExtensions.cs rename to EOM.TSHotelManagement.WebApi/Extension/MvcOptionsExtensions.cs diff --git a/EOM.TSHotelManagement.WebApi/Router_Extension/RouteConvention.cs b/EOM.TSHotelManagement.WebApi/Extension/RouteConvention.cs similarity index 100% rename from EOM.TSHotelManagement.WebApi/Router_Extension/RouteConvention.cs rename to EOM.TSHotelManagement.WebApi/Extension/RouteConvention.cs diff --git a/EOM.TSHotelManagement.WebApi/Factory/LskyConfigFactory.cs b/EOM.TSHotelManagement.WebApi/Factory/LskyConfigFactory.cs new file mode 100644 index 0000000000000000000000000000000000000000..fed78747caeb88d90ceb6230e436f67b4409b6a8 --- /dev/null +++ b/EOM.TSHotelManagement.WebApi/Factory/LskyConfigFactory.cs @@ -0,0 +1,28 @@ +using EOM.TSHotelManagement.Shared; +using Microsoft.Extensions.Configuration; + +namespace EOM.TSHotelManagement.WebApi +{ + public class LskyConfigFactory:ILskyConfigFactory + { + private readonly IConfiguration _configuration; + + public LskyConfigFactory(IConfiguration configuration) + { + _configuration = configuration; + } + + public LskyConfig GetLskyConfig() + { + var lskyConfig = new LskyConfig + { + BaseAddress = _configuration.GetSection("Lsky").GetValue("BaseAddress"), + Email = _configuration.GetSection("Lsky").GetValue("Email"), + Password = _configuration.GetSection("Lsky").GetValue("Password"), + UploadApi = _configuration.GetSection("Lsky").GetValue("UploadApi"), + GetTokenApi = _configuration.GetSection("Lsky").GetValue("GetTokenApi") + }; + return lskyConfig; + } + } +} diff --git a/EOM.TSHotelManagement.WebApi/Factory/MailConfigFactory.cs b/EOM.TSHotelManagement.WebApi/Factory/MailConfigFactory.cs new file mode 100644 index 0000000000000000000000000000000000000000..74fd220f8bd34616877da2eb440ab57836fb757c --- /dev/null +++ b/EOM.TSHotelManagement.WebApi/Factory/MailConfigFactory.cs @@ -0,0 +1,29 @@ +using EOM.TSHotelManagement.Shared; +using Microsoft.Extensions.Configuration; + +namespace EOM.TSHotelManagement.WebApi +{ + public class MailConfigFactory : IMailConfigFactory + { + private readonly IConfiguration _configuration; + + public MailConfigFactory(IConfiguration configuration) + { + _configuration = configuration; + } + + public MailConfig GetMailConfig() + { + var mailConfig = new MailConfig + { + Host = _configuration.GetSection("Mail").GetValue("Host"), + Port = _configuration.GetSection("Mail").GetValue("Port"), + UserName = _configuration.GetSection("Mail").GetValue("UserName"), + Password = _configuration.GetSection("Mail").GetValue("Password"), + EnableSsl = _configuration.GetSection("Mail").GetValue("EnableSsl"), + DisplayName = _configuration.GetSection("Mail").GetValue("DisplayName") + }; + return mailConfig; + } + } +} diff --git a/EOM.TSHotelManagement.WebApi/Filter/RequestLoggingMiddleware.cs b/EOM.TSHotelManagement.WebApi/Filter/RequestLoggingMiddleware.cs new file mode 100644 index 0000000000000000000000000000000000000000..352e7651a274a6ada798bec31f256d0fae0e34d1 --- /dev/null +++ b/EOM.TSHotelManagement.WebApi/Filter/RequestLoggingMiddleware.cs @@ -0,0 +1,120 @@ +using System; +using System.Diagnostics; +using System.IO; +using System.Text; +using System.Threading.Tasks; +using EOM.TSHotelManagement.Common.Core; +using EOM.TSHotelManagement.EntityFramework; +using EOM.TSHotelManagement.Shared; +using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using SqlSugar; + +public class RequestLoggingMiddleware +{ + private readonly RequestDelegate _next; + private readonly string _softwareVersion; + + public RequestLoggingMiddleware( + RequestDelegate next, + IConfiguration config) + { + _next = next; + _softwareVersion = config["SoftwareVersion"] ?? GetDefaultVersion(); + } + + public async Task InvokeAsync(HttpContext context) + { + var repository = context.RequestServices + .GetRequiredService>(); + + var startTime = Stopwatch.GetTimestamp(); + var log = new OperationLog + { + OperationId = Guid.NewGuid().ToString("N"), + OperationTime = DateTime.Now, + RequestPath = context.Request.Path, + HttpMethod = context.Request.Method, + LoginIpAddress = context.Connection.RemoteIpAddress?.ToString(), + QueryString = context.Request.QueryString.Value, + SoftwareVersion = _softwareVersion, + OperationAccount = context.User.Identity?.Name ?? "Anonymous", + LogContent = $"{context.Request.Method} {context.Request.Path}", + DataInsUsr = context.User.Identity?.Name ?? "Anonymous", + DataInsDate = DateTime.Now, + }; + + context.Request.EnableBuffering(); + + var originalBodyStream = context.Response.Body; + using var responseBodyStream = new MemoryStream(); + context.Response.Body = responseBodyStream; + + Exception exception = null; + try + { + await _next(context); + } + catch (Exception ex) + { + exception = ex; + log.StatusCode = StatusCodes.Status500InternalServerError; + context.Response.StatusCode = log.StatusCode; + await HandleExceptionAsync(context, ex); + } + finally + { + log.ElapsedTime = GetElapsedMilliseconds(startTime, Stopwatch.GetTimestamp()); + log.StatusCode = context.Response.StatusCode; + + // 读取响应体 + responseBodyStream.Seek(0, SeekOrigin.Begin); + await responseBodyStream.CopyToAsync(originalBodyStream); + + // 异常处理 + if (exception != null) + { + log.ExceptionMessage = exception.Message; + log.ExceptionStackTrace = exception.StackTrace; + log.LogLevel = EOM.TSHotelManagement.Common.Core.LogLevel.Critical; + } + else + { + log.LogLevel = context.Response.StatusCode >= 400 + ? EOM.TSHotelManagement.Common.Core.LogLevel.Warning + : EOM.TSHotelManagement.Common.Core.LogLevel.Normal; + } + + log.LogLevelName = log.LogLevel.ToString(); + try + { + await repository.InsertAsync(log); + } + catch (Exception ex) + { + var logger = context.RequestServices + .GetRequiredService>(); + logger.LogError(ex, "日志记录失败"); + } + } + } + + private async Task HandleExceptionAsync(HttpContext context, Exception exception) + { + context.Response.ContentType = "application/json"; + var errorResponse = new { error = exception.Message }; + await context.Response.WriteAsJsonAsync(errorResponse); + } + + private static long GetElapsedMilliseconds(long start, long stop) + { + return (long)((stop - start) * 1000 / (double)Stopwatch.Frequency); + } + + private string GetDefaultVersion() + { + return GetType().Assembly.GetName().Version.ToString(3); + } +} \ No newline at end of file diff --git a/EOM.TSHotelManagement.WebApi/Startup.cs b/EOM.TSHotelManagement.WebApi/Startup.cs index bf545abb8f292aa555d0c79f372895265ce4da49..43d43f1ab35da79f86d0a8d20a40d51fecf83288 100644 --- a/EOM.TSHotelManagement.WebApi/Startup.cs +++ b/EOM.TSHotelManagement.WebApi/Startup.cs @@ -6,6 +6,7 @@ using EOM.TSHotelManagement.WebApi.Filter; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.HttpOverrides; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; @@ -33,23 +34,12 @@ namespace EOM.TSHotelManagement.WebApi // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { - // ע SqlSugarClientFactory - services.AddSingleton(); - - // ISqlSugarClient - services.AddScoped(sp => - { - var factory = sp.GetRequiredService(); - return factory.CreateClient(); - }); - // DataProtection services.AddDataProtection(); - // ע᷺Ͳֿ - services.AddScoped(typeof(GenericRepository<>)); - services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); services.AddAuthentication(options => { @@ -64,7 +54,7 @@ namespace EOM.TSHotelManagement.WebApi ValidateLifetime = true, ValidateIssuerSigningKey = true, ValidIssuer = _configuration["Jwt:Issuer"], - ValidAudience = _configuration["Jwt:Audience"], // Чaudienceֵ + ValidAudience = _configuration["Jwt:Audience"], IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_configuration["Jwt:Key"])) }; }); @@ -90,7 +80,7 @@ namespace EOM.TSHotelManagement.WebApi }).AddNewtonsoftJson(opt => { //ʱʽӦ - opt.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss"; + //opt.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss"; opt.SerializerSettings.ContractResolver = new DefaultContractResolver(); }); @@ -161,6 +151,11 @@ namespace EOM.TSHotelManagement.WebApi app.UseDeveloperExceptionPage(); } + app.UseForwardedHeaders(new ForwardedHeadersOptions + { + ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto + }); + app.UseCors("MyCorsPolicy"); app.UseRouting(); @@ -169,6 +164,8 @@ namespace EOM.TSHotelManagement.WebApi app.UseAuthorization(); + app.UseRequestLogging(); + app.UseEndpoints(endpoints => { endpoints.MapControllers(); @@ -193,16 +190,24 @@ namespace EOM.TSHotelManagement.WebApi #region AutoFac IOC,ʵע try { - builder.RegisterType().As().SingleInstance(); + builder.RegisterType() + .As() + .SingleInstance(); - builder.Register(c => - { - var factory = c.Resolve(); - return factory.CreateClient(); - }).As().InstancePerLifetimeScope(); + builder.Register(c => c.Resolve().CreateClient()) + .As() + .InstancePerLifetimeScope(); + + builder.RegisterGeneric(typeof(GenericRepository<>)) + .AsSelf() + .InstancePerLifetimeScope(); + + builder.RegisterType() + .InstancePerDependency(); - builder.RegisterGeneric(typeof(GenericRepository<>)).InstancePerLifetimeScope(); builder.RegisterType().AsSelf().InstancePerLifetimeScope(); + builder.RegisterType().AsSelf().InstancePerLifetimeScope(); + builder.RegisterType().AsSelf().InstancePerLifetimeScope(); //ע var assemblyService = Assembly.LoadFrom(Path.Combine(AppContext.BaseDirectory, "EOM.TSHotelManagement.Application.dll")); diff --git a/EOM.TSHotelManagement.WebApi/appsettings.json b/EOM.TSHotelManagement.WebApi/appsettings.json index 5be2f0a7ae2ab5ac4bf9769e7d5c4ba0290420c3..790481d8221df01370d51b11de517d2318972065 100644 --- a/EOM.TSHotelManagement.WebApi/appsettings.json +++ b/EOM.TSHotelManagement.WebApi/appsettings.json @@ -6,10 +6,11 @@ "Microsoft.Hosting.Lifetime": "Information" } }, - "DefaultDatabase": "PgSql", + "DefaultDatabase": "MariaDB", "ConnectionStrings": { "PgSqlConnectStr": "Host=my_pgsql_host;Port=5432;Username=my_pgsql_user;Password=my_pgsql_password;Database=tshoteldb;", "MySqlConnectStr": "Server=my_mysql_host;Database=tshoteldb;User=my_mysql_user;Password=my_mysql_password;", + "MariaDBConnectStr": "Server=localhost;Database=tshoteldb;User=my_mariadb_user;Password=my_mariadb_password;", "SqlServerConnectStr": "Server=my_sqlserver_host;Database=tshoteldb;User Id=my_sqlserver_user;Password=my_sqlserver_password;", "OracleConnectStr": "User Id=my_oracle_user;Password=my_oracle_password;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=my_oracle_host)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=my_oracle_service_name)));" }, @@ -19,5 +20,22 @@ "Issuer": "", "Audience": "", "ExpiryMinutes": 20 + }, + "Mail": { + "Host": "...", + "Port": 465, + "UserName": "", + "Password": "", + "EnableSsl": true, + "DisplayName": "" + }, + "SoftwareVersion": "1.0.0", + //兰空图床配置 + "Lsky": { + "BaseAddress": "", + "Email": "", + "Password": "", + "UploadApi": "", + "GetTokenApi": "" } } diff --git a/README.en.md b/README.en.md index f0f56def78c3fe8e30f9a1dd58297a963a2bbeea..13a047c65ceed4ff8b3786e14c683d06acd5d31b 100644 --- a/README.en.md +++ b/README.en.md @@ -120,8 +120,8 @@ EOM.TSHotelManager.Web ### :inbox_tray: Database deployment (local): -**The author and development team strongly recommend using PostgreSQL database. Install the PostgreSQL database and start the service. Use a visualization management tool to create the database. You can quickly establish data tables and import data by opening the .sql suffix format files in the database script folder. Execution steps (taking PostgreSQL database as an example):** +**The author and development team strongly recommend using MariaDB database. Install the MariaDB database and start the service. Use a visualization management tool to create the database. You can quickly establish data tables and import data by opening the .sql suffix format files in the database script folder. Execution steps (taking MariaDB database as an example):** -**1. Use a visualization management tool to open the Table.sql file to create data tables.** +**1. Use a visualization management tool to open the 数据库脚本/latest_MariaDB版本/tshotel-backstage-dbscript-table.sql file to create data tables.** -**2. Then open the Data.sql file to import data.** +**2. Then open the 数据库脚本/latest_MariaDB版本/tshotel-backstage-dbscript-data.sql file to import data.** diff --git a/README.md b/README.md index e62f6e924028fe1b7e9b7b2233838cb6a3af49db..65e2c05534eeae4297ef427fc6545b0e1f808168 100644 --- a/README.md +++ b/README.md @@ -118,10 +118,10 @@ EOM.TSHotelManagement.Web ### :inbox_tray: 数据库运行部署(本地): -**作者及开发团队强烈建议使用PostgreSQL数据库,安装PostgreSQL数据库并开启服务,通过可视化管理工具对数据库进行建立,可通过打开执行数据库脚本文件夹内的.sql后缀格式文件进行快速建立数据表和导入数据,执行步骤(以PostgreSQL数据库为例):** +**作者及开发团队强烈建议使用MariaDB数据库,安装MariaDB数据库并开启服务,通过可视化管理工具对数据库进行建立,可通过打开执行数据库脚本文件夹内的.sql后缀格式文件进行快速建立数据表和导入数据,执行步骤(以MariaDB数据库为例):** -**1、通过可视化管理工具打开Table.sql文件进行数据表建立。** +**1、通过可视化管理工具打开/数据库脚本/latest_MariaDB版本,依次执行tshotel-backstage-dbscript-table.sql文件进行数据库与数据表建立。** -**2、随后打开Data.sql文件进行数据导入。** +**2、随后打开tshotel-backstage-dbscript-data.sql文件进行数据导入。** ​ [![咖啡与网络/TopskyHotelManagementSystem-WebApi](https://gitee.com/java-and-net/topsky-hotel-management-system-web-api/widgets/widget_card.svg?colors=4183c4,ffffff,ffffff,e3e9ed,666666,9b9b9b)](https://gitee.com/java-and-net/topsky-hotel-manager-system-web-api) diff --git "a/\346\225\260\346\215\256\345\272\223\350\204\232\346\234\254/latest_MariaDB\347\211\210\346\234\254/tshotel-backstage-dbscript-data.sql" "b/\346\225\260\346\215\256\345\272\223\350\204\232\346\234\254/latest_MariaDB\347\211\210\346\234\254/tshotel-backstage-dbscript-data.sql" new file mode 100644 index 0000000000000000000000000000000000000000..3fe8f8fba893bd84690934c760eb4762fabdfb11 --- /dev/null +++ "b/\346\225\260\346\215\256\345\272\223\350\204\232\346\234\254/latest_MariaDB\347\211\210\346\234\254/tshotel-backstage-dbscript-data.sql" @@ -0,0 +1,4529 @@ +INSERT INTO `administrator` (`id`, `admin_number`, `admin_account`, `admin_password`, `admin_type`, `admin_name`, `is_admin`, `delete_mk`, `datains_usr`, `datains_date`, `datachg_usr`, `datachg_date`) VALUES (1, '1263785187301658678', 'admin', 'clUKFMeIUWp6YflZweR0Cw==·#c0fbb?;*$>#;^b%$?>#%%