diff --git a/EOM.TSHotelManagement.Application/Business/Asset/AssetService.cs b/EOM.TSHotelManagement.Application/Business/Asset/AssetService.cs index 65974821b1bc84e48f327eb6fea82ba3deb48acd..cfcc1f272f65d45395005555416246afc6b8d77f 100644 --- a/EOM.TSHotelManagement.Application/Business/Asset/AssetService.cs +++ b/EOM.TSHotelManagement.Application/Business/Asset/AssetService.cs @@ -101,6 +101,8 @@ namespace EOM.TSHotelManagement.Application var where = Expressionable.Create(); + where = where.And(a => a.IsDelete == asset.IsDelete); + int totalCount = 0; if (asset.Page != 0 && asset.PageSize != 0) { @@ -158,7 +160,7 @@ namespace EOM.TSHotelManagement.Application { return new BaseOutputDto() { Message = LocalizationHelper.GetLocalizedString("asset number does not exist.", "资产编号不存在"), StatusCode = StatusCodeConstants.InternalServerError }; } - assetRepository.Update(EntityMapper.Map(asset)); + assetRepository.Update(a=>new Asset { IsDelete = asset.IsDelete},a=> a.AssetNumber == asset.AssetNumber); } catch (Exception ex) { diff --git a/EOM.TSHotelManagement.Application/Business/Customer/CustomerService.cs b/EOM.TSHotelManagement.Application/Business/Customer/CustomerService.cs index 3c747860e6d255fe004ce03a128b783ebbb9b3b9..cb9976bf052f195d18d4a141aa5a83a888cf5f23 100644 --- a/EOM.TSHotelManagement.Application/Business/Customer/CustomerService.cs +++ b/EOM.TSHotelManagement.Application/Business/Customer/CustomerService.cs @@ -191,7 +191,7 @@ namespace EOM.TSHotelManagement.Application { return new BaseOutputDto() { Message = LocalizationHelper.GetLocalizedString("customer number does not exist.", "客户编号不存在"), StatusCode = StatusCodeConstants.InternalServerError }; } - var result = custoRepository.Update(EntityMapper.Map(updateCustomerInputDto)); + var result = custoRepository.Update(a=>new Customer { CustomerType = updateCustomerInputDto.CustomerType },a => a.CustomerNumber == updateCustomerInputDto.CustomerNumber); if (result) { @@ -375,6 +375,11 @@ namespace EOM.TSHotelManagement.Application var customer = custoRepository.AsQueryable().Where(where.ToExpression()).Single(); + if (customer.IsNullOrEmpty()) + { + return new SingleOutputDto { StatusCode = StatusCodeConstants.InternalServerError, Message = "该用户不存在" }; + } + try { //解密身份证号码 diff --git a/EOM.TSHotelManagement.Application/Business/Reser/ReserService.cs b/EOM.TSHotelManagement.Application/Business/Reser/ReserService.cs index b8a04447ac60bbaa04d8b30d1e13f7ab4b90ecee..cf7b27d5a85f90623573b806245555385ed8757f 100644 --- a/EOM.TSHotelManagement.Application/Business/Reser/ReserService.cs +++ b/EOM.TSHotelManagement.Application/Business/Reser/ReserService.cs @@ -133,6 +133,7 @@ namespace EOM.TSHotelManagement.Application /// public BaseOutputDto DeleteReserInfo(DeleteReserInputDto reser) { + var reserInfo = reserRepository.GetSingle(a => a.ReservationId == reser.ReservationId); var result = reserRepository.Update(a => new Reser() { IsDelete = reser.IsDelete, @@ -142,6 +143,7 @@ namespace EOM.TSHotelManagement.Application if (result) { + roomRepository.Update(a => new Room { RoomStateId = (int)RoomState.Vacant }, a => a.RoomNumber.Equals(reserInfo.ReservationRoomNumber)); return new BaseOutputDto(StatusCodeConstants.Success, LocalizationHelper.GetLocalizedString("Delete Reser Success", "预约信息删除成功")); } else diff --git a/EOM.TSHotelManagement.Application/Business/Room/IRoomService.cs b/EOM.TSHotelManagement.Application/Business/Room/IRoomService.cs index 19be8480e018560e6bacff93e20b9e532baf625d..e4a7889850d2372dc10740b6a210835ae6fcf0b3 100644 --- a/EOM.TSHotelManagement.Application/Business/Room/IRoomService.cs +++ b/EOM.TSHotelManagement.Application/Business/Room/IRoomService.cs @@ -72,15 +72,6 @@ namespace EOM.TSHotelManagement.Application SingleOutputDto SelectRoomByRoomNo(ReadRoomInputDto readRoomInputDto); #endregion - #region 根据房间编号退房(退房) - /// - /// 根据房间编号退房(退房) - /// - /// - /// - BaseOutputDto UpdateRoomByRoomNo(ReadRoomInputDto readRoomInputDto); - #endregion - #region 根据房间编号查询截止到今天住了多少天 /// /// 根据房间编号查询截止到今天住了多少天 @@ -162,9 +153,23 @@ namespace EOM.TSHotelManagement.Application /// /// /// - BaseOutputDto UpdateRoomStateByRoomNo(ReadRoomInputDto readRoomInputDto); + BaseOutputDto UpdateRoomStateByRoomNo(UpdateRoomInputDto readRoomInputDto); #endregion + /// + /// 转房操作 + /// + /// + /// + BaseOutputDto TransferRoom(TransferRoomDto transferRoomDto); + + /// + /// 退房操作 + /// + /// + /// + BaseOutputDto CheckoutRoom(CheckoutRoomDto checkoutRoomDto); + #region 添加房间 /// /// 添加房间 diff --git a/EOM.TSHotelManagement.Application/Business/Room/RoomService.cs b/EOM.TSHotelManagement.Application/Business/Room/RoomService.cs index 72f42f208d3ef4e93e4244cbe1a579c9d7a3cc95..e58c0f3088e8842f7a606f392cd3ef6c322fcbc2 100644 --- a/EOM.TSHotelManagement.Application/Business/Room/RoomService.cs +++ b/EOM.TSHotelManagement.Application/Business/Room/RoomService.cs @@ -26,8 +26,12 @@ using EOM.TSHotelManagement.Common.Core; using EOM.TSHotelManagement.Common.Util; using EOM.TSHotelManagement.EntityFramework; using EOM.TSHotelManagement.Shared; +using jvncorelib.CodeLib; using jvncorelib.EntityLib; using SqlSugar; +using System; +using System.Transactions; +using static System.Runtime.InteropServices.JavaScript.JSType; namespace EOM.TSHotelManagement.Application { @@ -41,27 +45,48 @@ namespace EOM.TSHotelManagement.Application /// private readonly GenericRepository roomRepository; + /// + /// 消费记录 + /// + private readonly GenericRepository spendRepository; + /// /// 客房类型 /// private readonly GenericRepository roomTypeRepository; + /// + /// 能耗管理 + /// + private readonly GenericRepository energyRepository; + /// /// 客户信息 /// private readonly GenericRepository custoRepository; + /// + /// 唯一编码 + /// + private readonly UniqueCode uniqueCode; + /// /// /// /// + /// /// + /// /// - public RoomService(GenericRepository roomRepository, GenericRepository roomTypeRepository, GenericRepository custoRepository) + /// + public RoomService(GenericRepository roomRepository, GenericRepository spendRepository, GenericRepository roomTypeRepository, GenericRepository energyRepository, GenericRepository custoRepository, UniqueCode uniqueCode) { this.roomRepository = roomRepository; + this.spendRepository = spendRepository; this.roomTypeRepository = roomTypeRepository; + this.energyRepository = energyRepository; this.custoRepository = custoRepository; + this.uniqueCode = uniqueCode; } /// @@ -119,7 +144,7 @@ namespace EOM.TSHotelManagement.Application List roomTypes = new List(); roomTypes = roomTypeRepository.GetList(); List rooms = new List(); - rooms = roomRepository.GetList(a => a.IsDelete != 1 && a.RoomStateId == 0).OrderBy(a => a.RoomNumber).ToList(); + rooms = roomRepository.GetList(a => a.IsDelete != 1 && a.RoomStateId == (int)RoomState.Vacant).OrderBy(a => a.RoomNumber).ToList(); rooms.ForEach(source => { var roomState = roomStates.SingleOrDefault(a => a.Id == source.RoomStateId); @@ -276,29 +301,6 @@ namespace EOM.TSHotelManagement.Application return new SingleOutputDto() { Source = Source }; } - /// - /// 根据房间编号退房(退房) - /// - /// - /// - public BaseOutputDto UpdateRoomByRoomNo(ReadRoomInputDto room) - { - try - { - 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(); - } /// /// 根据房间编号查询截止到今天住了多少天 /// @@ -490,16 +492,16 @@ namespace EOM.TSHotelManagement.Application /// /// 根据房间编号更改房间状态 /// - /// + /// /// - public BaseOutputDto UpdateRoomStateByRoomNo(ReadRoomInputDto readRoomInputDto) + public BaseOutputDto UpdateRoomStateByRoomNo(UpdateRoomInputDto updateRoomInputDto) { try { roomRepository.Update(a => new Room() { - RoomStateId = readRoomInputDto.RoomStateId - }, a => a.RoomNumber == readRoomInputDto.RoomNumber); + RoomStateId = updateRoomInputDto.RoomStateId + }, a => a.RoomNumber == updateRoomInputDto.RoomNumber); } catch (Exception ex) { @@ -575,6 +577,152 @@ namespace EOM.TSHotelManagement.Application return new BaseOutputDto(); } + /// + /// 转房操作 + /// + /// + /// + public BaseOutputDto TransferRoom(TransferRoomDto transferRoomDto) + { + try + { + using (TransactionScope scope = new TransactionScope()) + { + var originalRoom = roomRepository.GetSingle(a => a.RoomNumber == transferRoomDto.OriginalRoomNumber); + var targetRoom = roomRepository.GetSingle(a => a.RoomNumber == transferRoomDto.TargetRoomNumber); + var stayDays = Math.Abs(((TimeSpan)(originalRoom.LastCheckInTime - DateTime.Now)).Days); + var originalRoomBill = originalRoom.RoomRent * stayDays; + + //更新原房间状态 + roomRepository.Update(a => new Room + { + CustomerNumber = null, + LastCheckInTime = null, + LastCheckOutTime = DateTime.Now, + RoomStateId = (int)RoomState.Dirty, + DataChgDate = transferRoomDto.DataChgDate, + DataChgUsr = transferRoomDto.DataChgUsr + }, a => a.RoomNumber == originalRoom.RoomNumber); + + //更新目标房间状态 + roomRepository.Update(a => new Room + { + CustomerNumber = originalRoom.CustomerNumber, + LastCheckInTime = originalRoom.LastCheckInTime, + RoomStateId = (int)RoomState.Occupied, + DataChgDate = transferRoomDto.DataChgDate, + DataChgUsr = transferRoomDto.DataChgUsr + }, a => a.RoomNumber == targetRoom.RoomNumber); + + //转移原房间消费记录 + var originalSpendNumbers = spendRepository.GetList(a => a.RoomNumber == transferRoomDto.OriginalRoomNumber + && a.CustomerNumber.Equals(transferRoomDto.CustomerNumber) && a.SettlementStatus.Equals(SpendConsts.UnSettle) + && a.IsDelete == 0).Select(a => a.SpendNumber).ToList(); + + if (originalSpendNumbers.Count > 0) + { + spendRepository.Update(a => new Spend + { + RoomNumber = transferRoomDto.TargetRoomNumber, + DataChgUsr = transferRoomDto.DataChgUsr, + DataChgDate = transferRoomDto.DataChgDate, + }, a => originalSpendNumbers.Contains(a.SpendNumber)); + } + + //添加旧房间消费记录 + var originalSpend = new Spend + { + CustomerNumber = originalRoom.CustomerNumber, + RoomNumber = transferRoomDto.OriginalRoomNumber, + SpendNumber = uniqueCode.GetNewId("SP-"), + ProductNumber = transferRoomDto.OriginalRoomNumber, + ProductName = "居住" + transferRoomDto.OriginalRoomNumber + "共" + stayDays + "天", + ProductPrice = originalRoom.RoomRent, + ConsumptionTime = DateTime.Now, + SettlementStatus = SpendConsts.UnSettle, + ConsumptionQuantity = stayDays, + ConsumptionAmount = originalRoomBill, + IsDelete = 0, + DataInsDate = transferRoomDto.DataChgDate, + DataInsUsr = transferRoomDto.DataChgUsr + }; + spendRepository.Insert(originalSpend); + + scope.Complete(); + + } + } + catch (Exception ex) + { + return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; + } + return new BaseOutputDto(); + } + + /// + /// 退房操作 + /// + /// + /// + public BaseOutputDto CheckoutRoom(CheckoutRoomDto checkoutRoomDto) + { + try + { + using (TransactionScope scope = new TransactionScope()) + { + var room = roomRepository.GetSingle(a => a.RoomNumber == checkoutRoomDto.RoomNumber); + //更新房间状态 + roomRepository.Update(a => new Room + { + CustomerNumber = null, + LastCheckInTime = null, + LastCheckOutTime = DateTime.Now, + RoomStateId = (int)RoomState.Dirty, + DataChgDate = checkoutRoomDto.DataChgDate, + DataChgUsr = checkoutRoomDto.DataChgUsr + }, a => a.RoomNumber == room.RoomNumber); + + //添加能源使用记录 + var energy = new EnergyManagement + { + InformationId = uniqueCode.GetNewId("EM-"), + StartDate = (DateTime)room.LastCheckInTime, + EndDate = (DateTime)checkoutRoomDto.DataChgDate, + WaterUsage = checkoutRoomDto.WaterUsage, + PowerUsage = checkoutRoomDto.ElectricityUsage, + Recorder = checkoutRoomDto.DataChgUsr, + CustomerNumber = room.CustomerNumber, + RoomNumber = checkoutRoomDto.RoomNumber, + IsDelete = 0, + DataInsDate = checkoutRoomDto.DataChgDate, + DataInsUsr = checkoutRoomDto.DataChgUsr + }; + energyRepository.Insert(energy); + + //结算消费记录 + var spendNumbers = spendRepository.GetList(a => a.RoomNumber == checkoutRoomDto.RoomNumber + && a.CustomerNumber.Equals(checkoutRoomDto.CustomerNumber) && a.SettlementStatus.Equals(SpendConsts.UnSettle) + && a.IsDelete == 0).Select(a => a.SpendNumber).ToList(); + if (spendNumbers.Count > 0 ) + { + spendRepository.Update(a => new Spend + { + SettlementStatus = SpendConsts.Settled, + DataChgDate = checkoutRoomDto.DataChgDate, + DataChgUsr = checkoutRoomDto.DataChgUsr + }, a => spendNumbers.Contains(a.SpendNumber)); + } + + scope.Complete(); + } + } + 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/Spend/ISpendService.cs b/EOM.TSHotelManagement.Application/Business/Spend/ISpendService.cs index 3f4388d718bc8c0aa477881e86e024f7c593d41a..94711b8cac06847bf5bbef04535cde67ddc918a9 100644 --- a/EOM.TSHotelManagement.Application/Business/Spend/ISpendService.cs +++ b/EOM.TSHotelManagement.Application/Business/Spend/ISpendService.cs @@ -91,24 +91,6 @@ namespace EOM.TSHotelManagement.Application SingleOutputDto SumConsumptionAmount(ReadSpendInputDto readSpendInputDto); #endregion - #region 根据房间编号、入住时间和当前时间修改结算状态 - /// - /// 根据房间编号、入住时间和当前时间修改结算状态 - /// - /// - /// - BaseOutputDto UpdateMoneyState(UpdateSpendInputDto updateSpendInputDto); - #endregion - - #region 将转房前的未结算记录一同转移到新房间 - /// - /// 将转房前的未结算记录一同转移到新房间 - /// - /// - /// - BaseOutputDto UpdateSpendInfoByRoomNo(UpdateSpendInputDto updateSpendInputDto); - #endregion - /// /// 撤回客户消费信息 /// diff --git a/EOM.TSHotelManagement.Application/Business/Spend/SpendService.cs b/EOM.TSHotelManagement.Application/Business/Spend/SpendService.cs index 07654e9075f7ccbec94831be8101d9376fc91a9d..60ea05ba30a7fff0e912f6e0594d636b2ee9a1d7 100644 --- a/EOM.TSHotelManagement.Application/Business/Spend/SpendService.cs +++ b/EOM.TSHotelManagement.Application/Business/Spend/SpendService.cs @@ -268,58 +268,6 @@ namespace EOM.TSHotelManagement.Application } #endregion - #region 根据房间编号、入住时间和当前时间修改结算状态 - /// - /// 根据房间编号、入住时间和当前时间修改结算状态 - /// - /// - /// - public BaseOutputDto UpdateMoneyState(UpdateSpendInputDto updateSpendInputDto) - { - 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) - { - return new BaseOutputDto { Message = LocalizationHelper.GetLocalizedString(ex.Message, ex.Message), StatusCode = StatusCodeConstants.InternalServerError }; - } - return new BaseOutputDto(); - } - #endregion - - #region 将转房前的未结算记录一同转移到新房间 - /// - /// 将转房前的未结算记录一同转移到新房间 - /// - /// - /// - public BaseOutputDto UpdateSpendInfoByRoomNo(UpdateSpendInputDto spend) - { - //查询当前用户未结算的数据 - 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();*/ - - try - { - 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 - /// /// 撤回客户消费信息 /// diff --git a/EOM.TSHotelManagement.Application/Employee/EmployeeService.cs b/EOM.TSHotelManagement.Application/Employee/EmployeeService.cs index 80aab99506e8c78028814c425b57bf503d54845b..030b599339f725b88c2ed9e66ae67d83ae762994 100644 --- a/EOM.TSHotelManagement.Application/Employee/EmployeeService.cs +++ b/EOM.TSHotelManagement.Application/Employee/EmployeeService.cs @@ -198,10 +198,30 @@ namespace EOM.TSHotelManagement.Application { sourceIdStr = dataProtector.Protect(createEmployeeInputDto.IdCardNumber); } + // 加密密码 + var sourcePwdStr = string.Empty; + var newPassword = new RandomStringGenerator().GenerateSecurePassword(); + sourcePwdStr = dataProtector.Protect(newPassword); + createEmployeeInputDto.PhoneNumber = sourceTelStr; createEmployeeInputDto.IdCardNumber = sourceIdStr; + createEmployeeInputDto.Password = sourcePwdStr; workerRepository.Insert(EntityMapper.Map(createEmployeeInputDto)); + + var Subject = LocalizationHelper.GetLocalizedString("New Registration Notification", "​新注册通知"); + var Body = $@"

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

+

{LocalizationHelper.GetLocalizedString( + $"You have successfully registered to the system on {DateTime.Now:yyyy/MM/dd}. Your account credentials are as follows:​", + $"您已于{DateTime.Now:yyyy/MM/dd}新注册系统成功,账号密码如下:")} +

+

{newPassword}

+

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

"; + + mailHelper.SendMail(new List { createEmployeeInputDto.EmailAddress }, Subject, Body, new List { createEmployeeInputDto.EmailAddress }); + } catch (Exception ex) { diff --git a/EOM.TSHotelManagement.Application/SystemManagement/Administrator/AdminService.cs b/EOM.TSHotelManagement.Application/SystemManagement/Administrator/AdminService.cs index ebbff17c9961f4ed6baa016b8f3eb440f5538205..445e2345b8c71718a1f3188d9f321099ea4e7503 100644 --- a/EOM.TSHotelManagement.Application/SystemManagement/Administrator/AdminService.cs +++ b/EOM.TSHotelManagement.Application/SystemManagement/Administrator/AdminService.cs @@ -446,7 +446,7 @@ namespace EOM.TSHotelManagement.Application { IsDelete = updateAdministratorInputDto.IsDelete, DataChgDate = updateAdministratorInputDto.DataChgDate - }, a => a.Id == updateAdministratorInputDto.Id); + }, a => a.Account == updateAdministratorInputDto.Account); } catch (Exception ex) { diff --git a/EOM.TSHotelManagement.Application/SystemManagement/Base/BaseService.cs b/EOM.TSHotelManagement.Application/SystemManagement/Base/BaseService.cs index c97c287b8147432db55dc9b0f23ec39e461ccce5..45bee2abb6b5b6c4e154b8737c94065b2149f3bf 100644 --- a/EOM.TSHotelManagement.Application/SystemManagement/Base/BaseService.cs +++ b/EOM.TSHotelManagement.Application/SystemManagement/Base/BaseService.cs @@ -664,6 +664,7 @@ namespace EOM.TSHotelManagement.Application var result = custoTypeRepository.Update(a => new CustoType() { CustomerTypeName = custoType.CustomerTypeName, + Discount = custoType.Discount, DataChgUsr = custoType.DataChgUsr, DataChgDate = custoType.DataChgDate }, a => a.CustomerType == custoType.CustomerType); diff --git a/EOM.TSHotelManagement.Application/Util/UtilService.cs b/EOM.TSHotelManagement.Application/Util/UtilService.cs index 2a393ea3a4ca21076fa79615dfcf209be2b87818..3acfd9e6ba83d96a202353f66042e6c393eb3b20 100644 --- a/EOM.TSHotelManagement.Application/Util/UtilService.cs +++ b/EOM.TSHotelManagement.Application/Util/UtilService.cs @@ -63,7 +63,7 @@ namespace EOM.TSHotelManagement.Application /// public ReadApplicationVersionOutputDto CheckBaseVersion() { - var source = EntityMapper.Map(applicationRepository.GetSingle(a => a.ApplicationVersionId == 1)); + var source = EntityMapper.Map(applicationRepository.GetSingle(a => a.Id == 1)); return source; } diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Asset/Dto/Asset/ReadAssetOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Asset/Dto/Asset/ReadAssetOutputDto.cs index 9e5f8dd01970e26837ee60c4a982713361c007f2..f46b34b20e47966701b347df5e95acfc4b9067d8 100644 --- a/EOM.TSHotelManagement.Common.Contract/Business/Asset/Dto/Asset/ReadAssetOutputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/Business/Asset/Dto/Asset/ReadAssetOutputDto.cs @@ -2,6 +2,7 @@ namespace EOM.TSHotelManagement.Common.Contract { public class ReadAssetOutputDto { + public int Id { get; set; } public string AssetNumber { get; set; } public string AssetName { get; set; } public decimal AssetValue { 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 index 49ca22cc130be24557b89504f78deb9ed3613219..64e7ef968f8f560eac17fe9a4db1989df55c9f61 100644 --- a/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/CustoType/CreateCustoTypeInputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/CustoType/CreateCustoTypeInputDto.cs @@ -11,6 +11,7 @@ namespace EOM.TSHotelManagement.Common.Contract /// ͻ (Customer Type Name) ///
public string CustomerTypeName { get; set; } + public decimal Discount { 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 index 1c88010de47d0eec3a216e492ce35afc1f7709e0..40b03324fad126eeda5241dfb677cfa63c58ff42 100644 --- a/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/CustoType/ReadCustoTypeOutputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/CustoType/ReadCustoTypeOutputDto.cs @@ -2,8 +2,10 @@ namespace EOM.TSHotelManagement.Common.Contract { public class ReadCustoTypeOutputDto { + public int Id { get; set; } public int CustomerType { get; set; } public string CustomerTypeName { get; set; } + public decimal Discount { 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 index 4420fec30019e21b8eb17f11537273f875d2b0f7..c64d740c8cf04e5e6b9ffacdec55ffe5541d67fa 100644 --- a/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/CustoType/UpdateCustoTypeInputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/CustoType/UpdateCustoTypeInputDto.cs @@ -4,6 +4,7 @@ namespace EOM.TSHotelManagement.Common.Contract { public int CustomerType { get; set; } public string CustomerTypeName { get; set; } + public decimal Discount { 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 index a937094844462c3fa9a463c8a98bfc5150a8faff..f0ba33c5a7dfcbbfa3e92bcec177bef90a642967 100644 --- a/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/Customer/ReadCustomerOutputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/Customer/ReadCustomerOutputDto.cs @@ -5,6 +5,7 @@ namespace EOM.TSHotelManagement.Common.Contract { public class ReadCustomerOutputDto { + public int Id { get; set; } [UIDisplay("ͻ")] public string CustomerNumber { get; set; } [UIDisplay("ͻ")] diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/GenderType/ReadGenderTypeOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/GenderType/ReadGenderTypeOutputDto.cs index 3c5c99b52479a41ea7a5481b57581ad5e8f2d561..4db59c8960bea24a5483fa82cdb5565d371ae4d4 100644 --- a/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/GenderType/ReadGenderTypeOutputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/GenderType/ReadGenderTypeOutputDto.cs @@ -2,8 +2,9 @@ namespace EOM.TSHotelManagement.Common.Contract { public class ReadGenderTypeOutputDto { - public int GenderId { get; set; } - public string GenderName { get; set; } + public int Id { get; set; } + public string Name { get; set; } + public string Description { 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 index 8d6c070d332754d208661bb0204de6a8bf355b2f..cbb29c2d6ded5b1218c365591130a755643a5faf 100644 --- a/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/PassportType/ReadPassportTypeOutputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/Business/Customer/Dto/PassportType/ReadPassportTypeOutputDto.cs @@ -2,6 +2,7 @@ namespace EOM.TSHotelManagement.Common.Contract { public class ReadPassportTypeOutputDto { + public int Id { get; set; } public int PassportId { get; set; } public string PassportName { get; set; } } diff --git a/EOM.TSHotelManagement.Common.Contract/Business/EnergyManagement/Dto/ReadEnergyManagementInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/EnergyManagement/Dto/ReadEnergyManagementInputDto.cs index fd4c952fd1df1caee6325d3038d947dd6ca6d920..1d5bf92fa32e5df1c01e8ee40ee9bb2244e7ddf1 100644 --- a/EOM.TSHotelManagement.Common.Contract/Business/EnergyManagement/Dto/ReadEnergyManagementInputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/Business/EnergyManagement/Dto/ReadEnergyManagementInputDto.cs @@ -2,7 +2,8 @@ namespace EOM.TSHotelManagement.Common.Contract { public class ReadEnergyManagementInputDto : ListInputDto { - public int InformationId { get; set; } + public int Id { get; set; } + public string 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 index 9c526a211d4b26d22c55ef12c8cc975677c3be9e..d39719f6e2b7c6f3007c428efd03360f3968d2ae 100644 --- a/EOM.TSHotelManagement.Common.Contract/Business/EnergyManagement/Dto/ReadEnergyManagementOutputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/Business/EnergyManagement/Dto/ReadEnergyManagementOutputDto.cs @@ -1,14 +1,24 @@ +using EOM.TSHotelManagement.Common.Util; + namespace EOM.TSHotelManagement.Common.Contract { public class ReadEnergyManagementOutputDto { - public int InformationId { get; set; } + public int Id { get; set; } + public string InformationId { get; set; } + [UIDisplay("")] public string RoomNumber { get; set; } + [UIDisplay("ͻ")] public string CustomerNumber { get; set; } + [UIDisplay("ʼ")] public DateTime StartDate { get; set; } + [UIDisplay("")] public DateTime EndDate { get; set; } + [UIDisplay("")] public decimal PowerUsage { get; set; } + [UIDisplay("ˮ")] public decimal WaterUsage { get; set; } + [UIDisplay("¼Ա")] public string Recorder { get; set; } } } diff --git a/EOM.TSHotelManagement.Common.Contract/Business/PromotionContent/Dto/ReadPromotionContentOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/PromotionContent/Dto/ReadPromotionContentOutputDto.cs index 9c67d71ad1f91f435d13c4aa0e162a5b52214b08..71d65e24dc1a3187a2e78360496accd8bbbec75f 100644 --- a/EOM.TSHotelManagement.Common.Contract/Business/PromotionContent/Dto/ReadPromotionContentOutputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/Business/PromotionContent/Dto/ReadPromotionContentOutputDto.cs @@ -2,6 +2,7 @@ namespace EOM.TSHotelManagement.Common.Contract { public class ReadPromotionContentOutputDto { + public int Id { get; set; } public int PromotionContentId { get; set; } public string PromotionContentMessage { get; set; } } diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Reser/Dto/ReadReserOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Reser/Dto/ReadReserOutputDto.cs index 8322907cb9e118159c934780b76e6d3d1071b221..d3f7f373d46438cc736b696cfb26ec3f24d6593a 100644 --- a/EOM.TSHotelManagement.Common.Contract/Business/Reser/Dto/ReadReserOutputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/Business/Reser/Dto/ReadReserOutputDto.cs @@ -4,6 +4,7 @@ namespace EOM.TSHotelManagement.Common.Contract { public class ReadReserOutputDto { + public int Id { get; set; } [UIDisplay("ԤԼ")] public string ReservationId { get; set; } [UIDisplay("ͻ")] diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/CheckoutRoomDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/CheckoutRoomDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..548949ecc50dc26127331fb032cf6d07df8ddd8d --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/CheckoutRoomDto.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 CheckoutRoomDto:BaseInputDto + { + public string RoomNumber { get; set; } + public string CustomerNumber { get; set; } + public decimal WaterUsage { get; set; } + public decimal ElectricityUsage { 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 index 908b9c6836d3be036c4b2ccfd301905970abd1d0..3d4f1f46e96e1c9a30c30b3eaae6ea3cb66aec38 100644 --- a/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/Room/CreateRoomInputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/Room/CreateRoomInputDto.cs @@ -3,7 +3,7 @@ namespace EOM.TSHotelManagement.Common.Contract public class CreateRoomInputDto : BaseInputDto { public string RoomNumber { get; set; } - public string RoomType { get; set; } + public int RoomTypeId { get; set; } public string CustomerNumber { get; set; } public DateTime? LastCheckInTime { get; set; } public DateTime? LastCheckOutTime { 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 index c8544fd69b6d49a7ce17560b3f0c23dcb9503f02..6c6b49ef4e4b6ca1b2aa9dc2a47a61522d4898b4 100644 --- a/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/Room/ReadRoomOutputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/Room/ReadRoomOutputDto.cs @@ -2,6 +2,7 @@ namespace EOM.TSHotelManagement.Common.Contract { public class ReadRoomOutputDto { + public int Id { get; set; } public string RoomNumber { get; set; } public string RoomName { get; set; } public int RoomTypeId { 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 index e47369fef108da6965c9fc6722c1069e8e3c8ca5..add4dc25e072f35ab027e3b80465f7d05bf17cea 100644 --- a/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/Room/UpdateRoomInputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/Room/UpdateRoomInputDto.cs @@ -3,7 +3,7 @@ namespace EOM.TSHotelManagement.Common.Contract public class UpdateRoomInputDto : BaseInputDto { public string RoomNumber { get; set; } - public string RoomType { get; set; } + public int RoomTypeId { get; set; } public string CustomerNumber { get; set; } public DateTime? LastCheckInTime { get; set; } public DateTime? LastCheckOutTime { 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 index 272b672071089d9bc238d64e49cc307ab24bdd33..7d19e71510daaa7d0e3759f7c945ee9dd7c38fc6 100644 --- a/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomType/ReadRoomTypeOutputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/RoomType/ReadRoomTypeOutputDto.cs @@ -2,6 +2,7 @@ namespace EOM.TSHotelManagement.Common.Contract { public class ReadRoomTypeOutputDto { + public int Id { get; set; } public int RoomTypeId { get; set; } public string RoomTypeName { get; set; } public decimal RoomRent { get; set; } diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/TransferRoomDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/TransferRoomDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..17ee8f1281485e9a969436dd16075d5649b24e88 --- /dev/null +++ b/EOM.TSHotelManagement.Common.Contract/Business/Room/Dto/TransferRoomDto.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EOM.TSHotelManagement.Common.Contract +{ + public class TransferRoomDto:BaseInputDto + { + public string OriginalRoomNumber { get; set; } + + public string TargetRoomNumber { get; set; } + + public string CustomerNumber { get; set; } + } +} diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Sellthing/Dto/ReadSellThingOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Sellthing/Dto/ReadSellThingOutputDto.cs index 75219d11a0e8e4f7a1e56c1de37054e062f5ca84..0b8a1c58eb6b919f997ed6e3c2057ad0a3be2068 100644 --- a/EOM.TSHotelManagement.Common.Contract/Business/Sellthing/Dto/ReadSellThingOutputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/Business/Sellthing/Dto/ReadSellThingOutputDto.cs @@ -4,6 +4,7 @@ namespace EOM.TSHotelManagement.Common.Contract { public class ReadSellThingOutputDto { + public int Id { get; set; } [UIDisplay("Ʒ")] public string ProductNumber { get; set; } [UIDisplay("Ʒ")] diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Spend/Dto/Spend/CreateSpendInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Spend/Dto/Spend/CreateSpendInputDto.cs index ecaed44b3e33713d32d8e60e9b9975c62c3d04b5..9a98cfeead256670dcc90f0ee6238508cfc89f69 100644 --- a/EOM.TSHotelManagement.Common.Contract/Business/Spend/Dto/Spend/CreateSpendInputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/Business/Spend/Dto/Spend/CreateSpendInputDto.cs @@ -2,6 +2,7 @@ namespace EOM.TSHotelManagement.Common.Contract { public class CreateSpendInputDto : BaseInputDto { + public string ProductNumber { get; set; } public string SpendNumber { get; set; } public string RoomNumber { get; set; } public string CustomerNumber { 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 index 280038c4ff5bff420b90bfada4b5b74400b8aaa5..7688140a6897edb916b2b1ad7219a9de1833c036 100644 --- a/EOM.TSHotelManagement.Common.Contract/Business/Spend/Dto/Spend/ReadSpendOutputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/Business/Spend/Dto/Spend/ReadSpendOutputDto.cs @@ -4,6 +4,7 @@ namespace EOM.TSHotelManagement.Common.Contract { public class ReadSpendOutputDto { + public int Id { get; set; } [UIDisplay("ѱ", false, false)] public string SpendNumber { get; set; } [UIDisplay("")] diff --git a/EOM.TSHotelManagement.Common.Contract/Business/Spend/Dto/Spend/UpdateSpendInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Business/Spend/Dto/Spend/UpdateSpendInputDto.cs index d8c6b404c0d48a79eed35b392ef78429051633c9..ce87df3aefd93f02fce0d6e162fbf39ec507c9a6 100644 --- a/EOM.TSHotelManagement.Common.Contract/Business/Spend/Dto/Spend/UpdateSpendInputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/Business/Spend/Dto/Spend/UpdateSpendInputDto.cs @@ -4,6 +4,7 @@ namespace EOM.TSHotelManagement.Common.Contract { public string SpendNumber { get; set; } public string RoomNumber { get; set; } + public string OriginalRoomNumber { get; set; } public string CustomerNumber { get; set; } public string ProductName { get; set; } public int ConsumptionQuantity { get; set; } diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/Employee/CreateEmployeeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/Employee/CreateEmployeeInputDto.cs index 629e964311722d699e5430e6556c3431622e7ab6..5613b7d7324d6516800b1bcf64caf6e85355f947 100644 --- a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/Employee/CreateEmployeeInputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/Employee/CreateEmployeeInputDto.cs @@ -13,9 +13,11 @@ namespace EOM.TSHotelManagement.Common.Contract public string Position { get; set; } public int IdCardType { get; set; } public string IdCardNumber { get; set; } + public string Password { get; set; } public DateTime HireDate { get; set; } public string PoliticalAffiliation { get; set; } public string EducationLevel { get; set; } + public string EmailAddress { get; set; } } } diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/Employee/ReadEmployeeInputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/Employee/ReadEmployeeInputDto.cs index bc10e79efa3afe24847d4d38a569a1c010e56972..ea5a02fd4d6dcd24f39b143ecf14eb3d3e8e6d7d 100644 --- a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/Employee/ReadEmployeeInputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/Employee/ReadEmployeeInputDto.cs @@ -5,14 +5,14 @@ namespace EOM.TSHotelManagement.Common.Contract public string EmployeeId { get; set; } public string EmployeeName { get; set; } public string Gender { get; set; } - public DateTime DateOfBirth { get; set; } + public DateOnly 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 DateOnly 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 index 1b7972b826dfead43aa7ffc66ea4a98df2a198fa..c7e60b4008b3c47b570515c1c9b7585e8091bca3 100644 --- a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/Employee/ReadEmployeeOutputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/Employee/ReadEmployeeOutputDto.cs @@ -3,6 +3,7 @@ namespace EOM.TSHotelManagement.Common.Contract { public class ReadEmployeeOutputDto : BaseDto { + public int Id { get; set; } public string EmployeeId { get; set; } public string EmployeeName { get; set; } public int Gender { get; set; } diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeePhoto/ReadEmployeePhotoOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeePhoto/ReadEmployeePhotoOutputDto.cs index a732611a99c6962ab7433cf434383ed342e22987..082123022ab7cd3731492f8f4a45d83f40194ad2 100644 --- a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeePhoto/ReadEmployeePhotoOutputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeePhoto/ReadEmployeePhotoOutputDto.cs @@ -2,6 +2,7 @@ namespace EOM.TSHotelManagement.Common.Contract { public class ReadEmployeePhotoOutputDto { + public int Id { get; set; } public int PhotoId { get; set; } public string EmployeeId { get; set; } public string PhotoPath { get; set; } diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeRewardPunishment/ReadEmployeeRewardPunishmentOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeRewardPunishment/ReadEmployeeRewardPunishmentOutputDto.cs index 6a81a3b6897f5eba8ff96d8cd69fabb527f4c19e..0c669f50591684e1c961a9d057067565cbb698f4 100644 --- a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeRewardPunishment/ReadEmployeeRewardPunishmentOutputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/EmployeeRewardPunishment/ReadEmployeeRewardPunishmentOutputDto.cs @@ -3,6 +3,7 @@ namespace EOM.TSHotelManagement.Common.Contract { public class ReadEmployeeRewardPunishmentOutputDto { + public int Id { get; set; } public string EmployeeId { get; set; } public DateTime RewardPunishmentTime { get; set; } public int RewardPunishmentType { get; set; } diff --git a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/RewardPunishmentType/ReadRewardPunishmentTypeOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/RewardPunishmentType/ReadRewardPunishmentTypeOutputDto.cs index ca248f8e5d834d033095142ee654a2d7431df93b..bc3bf0b95ec09e7d768cc665b5804193cfd41a00 100644 --- a/EOM.TSHotelManagement.Common.Contract/Employee/Dto/RewardPunishmentType/ReadRewardPunishmentTypeOutputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/Employee/Dto/RewardPunishmentType/ReadRewardPunishmentTypeOutputDto.cs @@ -2,6 +2,7 @@ namespace EOM.TSHotelManagement.Common.Contract { public class ReadRewardPunishmentTypeOutputDto { + public int Id { get; set; } public int GBTypeId { get; set; } public string GBTypeName { get; set; } } diff --git a/EOM.TSHotelManagement.Common.Contract/Sys/NavBar/Dto/ReadNavBarOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Sys/NavBar/Dto/ReadNavBarOutputDto.cs index 652c232e5d57c26a7e99414b7e3c5acd473d1024..31a23b662f7de7b63d3359ff0ceb602ae30ce216 100644 --- a/EOM.TSHotelManagement.Common.Contract/Sys/NavBar/Dto/ReadNavBarOutputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/Sys/NavBar/Dto/ReadNavBarOutputDto.cs @@ -2,6 +2,7 @@ namespace EOM.TSHotelManagement.Common.Contract { public class ReadNavBarOutputDto { + public int Id { get; set; } public int NavigationBarId { get; set; } public string NavigationBarName { get; set; } public int NavigationBarOrder { get; set; } diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Administrator/ReadAdministratorOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Administrator/ReadAdministratorOutputDto.cs index e85cf4c157aafc4a2121a0df19140b3fc0362441..dd33d406d671e84c279338313e0a375695b7f399 100644 --- a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Administrator/ReadAdministratorOutputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Administrator/ReadAdministratorOutputDto.cs @@ -2,6 +2,7 @@ namespace EOM.TSHotelManagement.Common.Contract { public class ReadAdministratorOutputDto : BaseDto { + public int Id { get; set; } public string Number { get; set; } public string Account { get; set; } public string Password { get; set; } diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AppointmentNotice/ReadAppointmentNoticeOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AppointmentNotice/ReadAppointmentNoticeOutputDto.cs index efeae8b6bca1deb5b06fa5cd02c41fe4c2987902..64aae89d182fffdf70c9f9092e2cbaac9545c6b6 100644 --- a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AppointmentNotice/ReadAppointmentNoticeOutputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/AppointmentNotice/ReadAppointmentNoticeOutputDto.cs @@ -2,6 +2,7 @@ namespace EOM.TSHotelManagement.Common.Contract { public class ReadAppointmentNoticeOutputDto { + public int Id { get; set; } public string NoticeId { get; set; } public string NoticeTheme { get; set; } public string NoticeType { get; set; } diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Module/ReadModuleOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Module/ReadModuleOutputDto.cs index 1043e83df50f0ea06cdf262f36a573bea65ff8e8..f416f6438a8a0248a95dacf0725e0a9ba9fec73e 100644 --- a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Module/ReadModuleOutputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Module/ReadModuleOutputDto.cs @@ -2,6 +2,7 @@ namespace EOM.TSHotelManagement.Common.Contract { public class ReadModuleOutputDto { + public int Id { get; set; } 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/ReadModulePermissionOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/ModulePermission/ReadModulePermissionOutputDto.cs index 99ea8ae5d3cd1af892562b7c2f0b9eca3d3620eb..5f819b1f5a8abf27eddbc205c32f2b6cb01abaf5 100644 --- a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/ModulePermission/ReadModulePermissionOutputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/ModulePermission/ReadModulePermissionOutputDto.cs @@ -2,6 +2,7 @@ namespace EOM.TSHotelManagement.Common.Contract { public class ReadModulePermissionOutputDto { + public int Id { get; set; } /// /// ģID (Module ID) /// diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Nation/ReadNationOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Nation/ReadNationOutputDto.cs index 9b6b61b30cda83c8fcd411a7326572f9698afa04..0e0d788e15c1de406db4950d058ac3e0ae95a72b 100644 --- a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Nation/ReadNationOutputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Nation/ReadNationOutputDto.cs @@ -2,6 +2,7 @@ namespace EOM.TSHotelManagement.Common.Contract { public class ReadNationOutputDto { + public int Id { get; set; } public string NationNumber { get; set; } public string NationName { get; set; } } diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Qualification/ReadEducationOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Qualification/ReadEducationOutputDto.cs index 48bcc9c0744ef195bb313fd1cdb5ca51dba8b8d5..7fb20b5dbd264f5e5f23b501e91399d62dc2775c 100644 --- a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Qualification/ReadEducationOutputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Qualification/ReadEducationOutputDto.cs @@ -2,6 +2,7 @@ namespace EOM.TSHotelManagement.Common.Contract { public class ReadEducationOutputDto { + public int Id { get; set; } public string EducationNumber { get; set; } public string EducationName { get; set; } } diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Role/ReadRoleOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Role/ReadRoleOutputDto.cs index 6e3132e0fa7ef8b1725537dc211a0d9bd3a6c10f..a641af763b7f52235441c9c5c0f4eb78bfc29d4d 100644 --- a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Role/ReadRoleOutputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/Role/ReadRoleOutputDto.cs @@ -2,6 +2,7 @@ namespace EOM.TSHotelManagement.Common.Contract { public class ReadRoleOutputDto { + public int Id { get; set; } /// /// ע:ɫ /// Ĭֵ: diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SupervisionStatistics/ReadSupervisionStatisticsOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SupervisionStatistics/ReadSupervisionStatisticsOutputDto.cs index fe8b53156739b8fb4a5049325f22b90ff4c19b5c..36018456529d4b5bea317228c1d347f5281c7978 100644 --- a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SupervisionStatistics/ReadSupervisionStatisticsOutputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SupervisionStatistics/ReadSupervisionStatisticsOutputDto.cs @@ -2,6 +2,7 @@ namespace EOM.TSHotelManagement.Common.Contract { public class ReadSupervisionStatisticsOutputDto { + public int Id { get; set; } public string StatisticsNumber { get; set; } public string SupervisingDepartment { get; set; } public string SupervisingDepartmentName { get; set; } diff --git a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SystemInformation/ReadSystemInformationOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SystemInformation/ReadSystemInformationOutputDto.cs index 3e671dfe399e7233d3d6d23d13994b1ab8bf964f..3afb115ad7f4ff6432d4f683039b9fad6d43f262 100644 --- a/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SystemInformation/ReadSystemInformationOutputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/SystemManagement/Dto/SystemInformation/ReadSystemInformationOutputDto.cs @@ -2,6 +2,7 @@ namespace EOM.TSHotelManagement.Common.Contract { public class ReadSystemInformationOutputDto { + public int Id { get; set; } public int UrlNumber { get; set; } public string UrlAddress { get; set; } } diff --git a/EOM.TSHotelManagement.Common.Contract/Util/Dto/ApplicationVersion/ReadApplicationVersionOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Util/Dto/ApplicationVersion/ReadApplicationVersionOutputDto.cs index 33cad54e6e330b03a0b81c9ff5de091c96d1c8bc..6e518dfe8bcfbf2e4cd49f2de65e24e8d53b1630 100644 --- a/EOM.TSHotelManagement.Common.Contract/Util/Dto/ApplicationVersion/ReadApplicationVersionOutputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/Util/Dto/ApplicationVersion/ReadApplicationVersionOutputDto.cs @@ -2,6 +2,7 @@ namespace EOM.TSHotelManagement.Common.Contract { public class ReadApplicationVersionOutputDto { + public int Id { get; set; } public int ApplicationVersionId { get; set; } public string VersionNumber { get; set; } public string VersionDescription { get; set; } diff --git a/EOM.TSHotelManagement.Common.Contract/Util/Dto/OperationLog/ReadOperationLogOutputDto.cs b/EOM.TSHotelManagement.Common.Contract/Util/Dto/OperationLog/ReadOperationLogOutputDto.cs index d10db6a1f68f8ee5363b29f31cb89bd6c5d60b69..eb5cbbb29f71b4b5b5cbb30f22d2b51a0a6b9a4e 100644 --- a/EOM.TSHotelManagement.Common.Contract/Util/Dto/OperationLog/ReadOperationLogOutputDto.cs +++ b/EOM.TSHotelManagement.Common.Contract/Util/Dto/OperationLog/ReadOperationLogOutputDto.cs @@ -4,6 +4,7 @@ namespace EOM.TSHotelManagement.Common.Contract { public class ReadOperationLogOutputDto { + public int Id { get; set; } public string OperationId { get; set; } public DateTime OperationTime { get; set; } public string LogContent { get; set; } diff --git a/EOM.TSHotelManagement.Common.Core/Business/Customer/CustoType.cs b/EOM.TSHotelManagement.Common.Core/Business/Customer/CustoType.cs index d3d498981aa60ca876993c329c56a3e2f8779f77..436517b5d42e9ee77332f1c7a87f4aaaea91fd98 100644 --- a/EOM.TSHotelManagement.Common.Core/Business/Customer/CustoType.cs +++ b/EOM.TSHotelManagement.Common.Core/Business/Customer/CustoType.cs @@ -50,5 +50,11 @@ namespace EOM.TSHotelManagement.Common.Core [SqlSugar.SugarColumn(ColumnName = "type_name",IsNullable = false, Length = 256, ColumnDescription = "客户类型名称 (Customer Type Name)")] public string CustomerTypeName { get; set; } + /// + /// 优惠折扣 (Discount) + /// + [SqlSugar.SugarColumn(ColumnName = "discount", IsNullable = false, Length = 18, DecimalDigits = 2, ColumnDescription = "优惠折扣 (Discount)")] + public decimal Discount { get; set; } = 0M; + } } diff --git a/EOM.TSHotelManagement.Common.Core/Business/Customer/PassPortType.cs b/EOM.TSHotelManagement.Common.Core/Business/Customer/PassPortType.cs index dd92736dbe7bba6ece78eeedbfcbb1208b517e91..a50081efdd3e4f84ad0e6b27e3e9fa9f34d46169 100644 --- a/EOM.TSHotelManagement.Common.Core/Business/Customer/PassPortType.cs +++ b/EOM.TSHotelManagement.Common.Core/Business/Customer/PassPortType.cs @@ -22,6 +22,8 @@ * *模块说明:证件类型类 */ +using SqlSugar; + namespace EOM.TSHotelManagement.Common.Core { /// @@ -30,6 +32,8 @@ namespace EOM.TSHotelManagement.Common.Core [SqlSugar.SugarTable("passport_type")] public class PassportType : BaseEntity { + [SugarColumn(ColumnName = "id", IsIdentity = true, IsPrimaryKey = true, IsNullable = false, ColumnDescription = "编号 (ID)")] + public int Id { get; set; } /// /// 证件类型 /// diff --git a/EOM.TSHotelManagement.Common.Core/Business/EnergyManagement/EnergyManagement.cs b/EOM.TSHotelManagement.Common.Core/Business/EnergyManagement/EnergyManagement.cs index f4b263a927913fa3b21c4c3f4bee95a5f49d9472..b82c2502eccbed86fed9ff1e50065f54097477f8 100644 --- a/EOM.TSHotelManagement.Common.Core/Business/EnergyManagement/EnergyManagement.cs +++ b/EOM.TSHotelManagement.Common.Core/Business/EnergyManagement/EnergyManagement.cs @@ -42,7 +42,7 @@ namespace EOM.TSHotelManagement.Common.Core /// /// 信息编号 (Information ID) /// - [SqlSugar.SugarColumn(ColumnName = "information_number", IsPrimaryKey = true)] + [SqlSugar.SugarColumn(ColumnName = "information_number", IsPrimaryKey = true, ColumnDescription = "信息编号")] public string InformationId { get; set; } /// diff --git a/EOM.TSHotelManagement.Common.Core/Business/Reser/Reser.cs b/EOM.TSHotelManagement.Common.Core/Business/Reser/Reser.cs index a0c04a77b10d9ae33a68312d964dadcd594801c5..e192d1d49fc84378da1864230da69f28276ee8c7 100644 --- a/EOM.TSHotelManagement.Common.Core/Business/Reser/Reser.cs +++ b/EOM.TSHotelManagement.Common.Core/Business/Reser/Reser.cs @@ -69,7 +69,7 @@ namespace EOM.TSHotelManagement.Common.Core ColumnName = "custo_tel", ColumnDescription = "客户联系电话 (Contact Phone Number)", IsNullable = false, - Length = 20 + Length = 256 )] public string ReservationPhoneNumber { get; set; } diff --git a/EOM.TSHotelManagement.Common.Core/Business/Spend/Spend.cs b/EOM.TSHotelManagement.Common.Core/Business/Spend/Spend.cs index c200fd2ab79a4f9a70ec9985079811707fae2a34..e1ef227d51cc77792135fe0bf627e88860c307c5 100644 --- a/EOM.TSHotelManagement.Common.Core/Business/Spend/Spend.cs +++ b/EOM.TSHotelManagement.Common.Core/Business/Spend/Spend.cs @@ -33,45 +33,47 @@ namespace EOM.TSHotelManagement.Common.Core [SugarTable("customer_spend")] public class Spend : BaseEntity { + [SugarColumn(ColumnName = "id", IsIdentity = true, IsPrimaryKey = true, IsNullable = false, ColumnDescription = "编号 (ID)")] + public int Id { get; set; } /// /// 消费编号 (Consumption Number) /// - [SugarColumn(ColumnName = "spend_number", IsPrimaryKey = true)] + [SugarColumn(ColumnName = "spend_number", IsPrimaryKey = true,ColumnDescription = "消费编号")] public string SpendNumber { get; set; } /// /// 房间编号 (Room Number) /// - [SugarColumn(ColumnName = "room_no")] + [SugarColumn(ColumnName = "room_no",ColumnDescription = "房间编号")] public string RoomNumber { get; set; } /// /// 客户编号 (Customer Number) /// - [SugarColumn(ColumnName = "custo_no")] + [SugarColumn(ColumnName = "custo_no",ColumnDescription = "客户编号")] public string CustomerNumber { get; set; } /// /// 商品编号 (Product Number) /// - [SugarColumn(ColumnName = "product_number")] + [SugarColumn(ColumnName = "product_number",ColumnDescription = "商品编号")] public string ProductNumber { get; set; } /// /// 商品名称 (Product Name) /// - [SugarColumn(ColumnName = "spend_name")] + [SugarColumn(ColumnName = "spend_name",ColumnDescription = "商品名称")] public string ProductName { get; set; } /// /// 消费数量 (Consumption Quantity) /// - [SugarColumn(ColumnName = "apend_quantity")] + [SugarColumn(ColumnName = "apend_quantity",ColumnDescription = "消费数量")] public int ConsumptionQuantity { get; set; } /// /// 商品单价 (Product Price) /// - [SugarColumn(ColumnName = "spend_price")] + [SugarColumn(ColumnName = "spend_price", ColumnDescription = "商品单价")] public decimal ProductPrice { get; set; } /// @@ -83,7 +85,7 @@ namespace EOM.TSHotelManagement.Common.Core /// /// 消费金额 (Consumption Amount) /// - [SugarColumn(ColumnName = "spend_amount")] + [SugarColumn(ColumnName = "spend_amount", ColumnDescription = "消费金额")] public decimal ConsumptionAmount { get; set; } /// @@ -95,13 +97,13 @@ namespace EOM.TSHotelManagement.Common.Core /// /// 消费时间 (Consumption Time) /// - [SugarColumn(ColumnName = "spend_time")] + [SugarColumn(ColumnName = "spend_time", ColumnDescription = "消费时间")] public DateTime ConsumptionTime { get; set; } /// /// 结算状态 (Settlement Status) /// - [SugarColumn(ColumnName = "settlement_status")] + [SugarColumn(ColumnName = "settlement_status", ColumnDescription = "结算状态")] public string SettlementStatus { get; set; } /// diff --git a/EOM.TSHotelManagement.Common.Core/Employee/Employee.cs b/EOM.TSHotelManagement.Common.Core/Employee/Employee.cs index 012d8143daf39e9bd932f8b25f5456514175e2f5..53a5a2e644b9437d3fe3354fc90a72ae7461daed 100644 --- a/EOM.TSHotelManagement.Common.Core/Employee/Employee.cs +++ b/EOM.TSHotelManagement.Common.Core/Employee/Employee.cs @@ -175,7 +175,7 @@ namespace EOM.TSHotelManagement.Common.Core /// 禁用标记 /// [SugarColumn(ColumnName = "enable_mk", IsNullable = false, ColumnDescription = "禁用标记")] - public int IsEnable { get; set; } = 0; + public int IsEnable { get; set; } = 1; /// /// 邮箱地址 diff --git a/EOM.TSHotelManagement.Common.Core/Util/ApplicationVersion.cs b/EOM.TSHotelManagement.Common.Core/Util/ApplicationVersion.cs index a408f825c30cbbba6d613ee6827f86f5170048fc..3befb0fd9e68494f34fe0f442ffb1c0d0d89c7ea 100644 --- a/EOM.TSHotelManagement.Common.Core/Util/ApplicationVersion.cs +++ b/EOM.TSHotelManagement.Common.Core/Util/ApplicationVersion.cs @@ -12,7 +12,7 @@ namespace EOM.TSHotelManagement.Common.Core /// 流水号 (Sequence Number) /// [SugarColumn(ColumnName = "base_versionId", IsIdentity = true, IsPrimaryKey = true, ColumnDescription = "流水号 (Sequence Number)")] - public int ApplicationVersionId { get; set; } + public int Id { get; set; } /// /// 版本号 (Version Number) diff --git a/EOM.TSHotelManagement.Common.Core/Util/OperationLog.cs b/EOM.TSHotelManagement.Common.Core/Util/OperationLog.cs index c31ebd42c01ab250c282ed7d281b8d8d9630e8c8..7d18737e238802344a927ef0bf30959364471cd4 100644 --- a/EOM.TSHotelManagement.Common.Core/Util/OperationLog.cs +++ b/EOM.TSHotelManagement.Common.Core/Util/OperationLog.cs @@ -48,7 +48,7 @@ namespace EOM.TSHotelManagement.Common.Core Critical = 300 } - // + /// /// 操作日志表 (Operation Log) /// [SugarTable("operation_log", "操作日志表 (Operation Log)")] diff --git a/EOM.TSHotelManagement.Common.Util/Helper/EntityMapper.cs b/EOM.TSHotelManagement.Common.Util/Helper/EntityMapper.cs index ef2c0ae2543ec26c816ad35c70dab13dfd44af82..ad9dc0bd0e18a8614d48395400eacd692a2d72db 100644 --- a/EOM.TSHotelManagement.Common.Util/Helper/EntityMapper.cs +++ b/EOM.TSHotelManagement.Common.Util/Helper/EntityMapper.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Reflection; namespace EOM.TSHotelManagement.Common.Util { @@ -16,32 +17,88 @@ namespace EOM.TSHotelManagement.Common.Util public static TDestination Map(TSource source) where TDestination : new() { - if (source == null) - { - return default; - } + if (source == null) return default; var destination = new TDestination(); - var sourceProperties = typeof(TSource).GetProperties(); - var destinationProperties = typeof(TDestination).GetProperties(); + + var sourceProperties = typeof(TSource).GetProperties( + BindingFlags.Public | BindingFlags.Instance); + var destinationProperties = typeof(TDestination).GetProperties( + BindingFlags.Public | BindingFlags.Instance); foreach (var sourceProperty in sourceProperties) { - var destinationProperty = destinationProperties.SingleOrDefault(p => string.Equals(p.Name, sourceProperty.Name, StringComparison.OrdinalIgnoreCase)); - if (destinationProperty != null && destinationProperty.CanWrite) + var destinationProperty = destinationProperties + .SingleOrDefault(p => p.Name.Equals( + sourceProperty.Name, + StringComparison.OrdinalIgnoreCase + )); + + if (destinationProperty == null || !destinationProperty.CanWrite) continue; + + var sourceValue = sourceProperty.GetValue(source); + if (sourceValue == null) continue; + + if (NeedConversion(sourceProperty.PropertyType, destinationProperty.PropertyType)) { - 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); + sourceValue = SmartConvert(sourceValue, destinationProperty.PropertyType); } + + destinationProperty.SetValue(destination, sourceValue); } return destination; } + /// + /// Զת + /// + /// + /// + /// + /// + private static object SmartConvert(object value, Type targetType) + { + var underlyingTargetType = Nullable.GetUnderlyingType(targetType) ?? targetType; + + if (underlyingTargetType == typeof(string)) + { + return value.ToString(); + } + + if (value is DateOnly dateOnly && underlyingTargetType == typeof(DateTime)) + { + return dateOnly.ToDateTime(TimeOnly.MinValue); + } + if (value is DateTime dateTime && underlyingTargetType == typeof(DateOnly)) + { + return DateOnly.FromDateTime(dateTime); + } + + try + { + return Convert.ChangeType(value, underlyingTargetType); + } + catch (InvalidCastException) + { + throw new InvalidOperationException( + $"Cannot convert {value.GetType()} to {targetType}"); + } + } + + /// + /// ת + /// + /// + /// + /// + private static bool NeedConversion(Type sourceType, Type targetType) + { + var underlyingSource = Nullable.GetUnderlyingType(sourceType) ?? sourceType; + var underlyingTarget = Nullable.GetUnderlyingType(targetType) ?? targetType; + return underlyingSource != underlyingTarget; + } + /// /// ӳʵб /// @@ -52,12 +109,7 @@ namespace EOM.TSHotelManagement.Common.Util public static List MapList(List sourceList) where TDestination : new() { - if (sourceList == null) - { - return null; - } - - return sourceList.Select(Map).ToList(); + return sourceList?.Select(Map).ToList(); } } } diff --git a/EOM.TSHotelManagement.Migration/EntityBuilder.cs b/EOM.TSHotelManagement.Migration/EntityBuilder.cs index 05486594007860c414215d25315481a7a3251741..44ef3d74849e09f80c4f5993853e4628fec07258 100644 --- a/EOM.TSHotelManagement.Migration/EntityBuilder.cs +++ b/EOM.TSHotelManagement.Migration/EntityBuilder.cs @@ -534,6 +534,7 @@ namespace EOM.TSHotelManagement.Migration DataInsUsr = "System", DataInsDate = DateTime.Now, } + }; public Type[] EntityTypes => entityTypes; diff --git a/EOM.TSHotelManagement.WebApi/Controllers/Business/Room/RoomController.cs b/EOM.TSHotelManagement.WebApi/Controllers/Business/Room/RoomController.cs index 3ceba7ba29a5054a57a4c55d04afefc92c2e5072..4cd410f26c03d9650589dd0f97bcf1c36ec07658 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.Contract; +using Microsoft.AspNetCore.Components.Forms; using Microsoft.AspNetCore.Mvc; namespace EOM.TSHotelManagement.WebApi.Controllers @@ -69,17 +70,6 @@ namespace EOM.TSHotelManagement.WebApi.Controllers return roomService.SelectRoomByRoomNo(inputDto); } - /// - /// 根据房间编号退房(退房) - /// - /// - /// - [HttpPost] - public BaseOutputDto UpdateRoomByRoomNo([FromQuery] ReadRoomInputDto inputDto) - { - return roomService.UpdateRoomByRoomNo(inputDto); - } - /// /// 根据房间编号查询截止到今天住了多少天 /// @@ -180,7 +170,7 @@ namespace EOM.TSHotelManagement.WebApi.Controllers /// /// [HttpPost] - public BaseOutputDto UpdateRoomStateByRoomNo([FromQuery] ReadRoomInputDto inputDto) + public BaseOutputDto UpdateRoomStateByRoomNo([FromBody] UpdateRoomInputDto inputDto) { return roomService.UpdateRoomStateByRoomNo(inputDto); } @@ -218,6 +208,28 @@ namespace EOM.TSHotelManagement.WebApi.Controllers return roomService.DeleteRoom(inputDto); } + /// + /// 转房操作 + /// + /// + /// + [HttpPost] + public BaseOutputDto TransferRoom([FromBody] TransferRoomDto transferRoomDto) + { + return roomService.TransferRoom(transferRoomDto); + } + + /// + /// 退房操作 + /// + /// + /// + [HttpPost] + public BaseOutputDto CheckoutRoom([FromBody]CheckoutRoomDto checkoutRoomDto) + { + return roomService.CheckoutRoom(checkoutRoomDto); + } + /// /// 查询所有可消费(已住)房间 /// diff --git a/EOM.TSHotelManagement.WebApi/Controllers/Business/Spend/SpendController.cs b/EOM.TSHotelManagement.WebApi/Controllers/Business/Spend/SpendController.cs index a68c3220dad3c24467c807acbf7d9127b1d14db5..e434b307c6ee85df7cdde426fb221f2e20c1a26f 100644 --- a/EOM.TSHotelManagement.WebApi/Controllers/Business/Spend/SpendController.cs +++ b/EOM.TSHotelManagement.WebApi/Controllers/Business/Spend/SpendController.cs @@ -92,28 +92,6 @@ namespace EOM.TSHotelManagement.WebApi.Controllers return spendService.SumConsumptionAmount(inputDto); } - /// - /// 根据房间编号、入住时间和当前时间修改结算状态 - /// - /// - /// - [HttpPost] - public BaseOutputDto UpdateMoneyState([FromQuery] UpdateSpendInputDto inputDto) - { - return spendService.UpdateMoneyState(inputDto); - } - - /// - /// 将转房前的未结算记录一同转移到新房间 - /// - /// - /// - [HttpPost] - public BaseOutputDto UpdateSpendInfoByRoomNo([FromBody] UpdateSpendInputDto inputDto) - { - return spendService.UpdateSpendInfoByRoomNo(inputDto); - } - /// /// 撤回客户消费信息 /// diff --git a/EOM.TSHotelManagement.WebApi/Startup.cs b/EOM.TSHotelManagement.WebApi/Startup.cs index 13700fa1e2ebc5f61387b5a37ad6fcb26ffa285d..399a1f5ecda9508a2e1b3073d1cfcaf8c2bde493 100644 --- a/EOM.TSHotelManagement.WebApi/Startup.cs +++ b/EOM.TSHotelManagement.WebApi/Startup.cs @@ -137,6 +137,7 @@ namespace EOM.TSHotelManagement.WebApi { policy.WithOrigins(new string[] { "http://localhost:5173", + "http://localhost:5174", "https://tshotel.oscode.top" }) .AllowAnyMethod() @@ -149,7 +150,17 @@ namespace EOM.TSHotelManagement.WebApi // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { - new InitializeConfig(_configuration).InitializeDatabase(app); + try + { + new InitializeConfig(_configuration).InitializeDatabase(app); + } + catch (Exception ex) + { + Console.WriteLine(LocalizationHelper.GetLocalizedString($"Database initialization failed: {ex.Message}. " + + "Please manually initialize the database or fix the error and retry.",$"ݿʼʧܣ{ex.Message}ִֶгʼ޸ԡ ")); + throw new Exception(LocalizationHelper.GetLocalizedString($"Database initialization failed: {ex.Message}. " + + "Please manually initialize the database or fix the error and retry.", $"ݿʼʧܣ{ex.Message}ִֶгʼ޸ԡ ")); + } if (env.IsDevelopment()) {