From ca9fe55c27b1d4999e301136a0ce452c07620331 Mon Sep 17 00:00:00 2001 From: Chunkit Yeung Date: Sun, 24 Mar 2024 15:46:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D-=E5=8E=86=E5=8F=B2=E5=85=AC?= =?UTF-8?q?=E5=91=8A=E6=9F=A5=E7=9C=8Bbug=EF=BC=9B=20=E4=BF=AE=E5=A4=8D-?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=85=AC=E5=91=8A=E6=97=A5=E5=BF=97=E5=90=8E?= =?UTF-8?q?=E4=B8=8D=E4=BC=9A=E8=87=AA=E5=8A=A8=E6=B8=85=E9=99=A4=E5=B7=B2?= =?UTF-8?q?=E5=A1=AB=E5=86=99=E7=9A=84=E5=86=85=E5=AE=B9=EF=BC=9B=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D-=E5=91=98=E5=B7=A5=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E7=95=8C=E9=9D=A2=E7=82=B9=E5=87=BB=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E4=BF=A1=E6=81=AF=E6=8C=89=E9=92=AE=E6=97=B6=E6=8F=90?= =?UTF-8?q?=E7=A4=BAWorkPic=E6=8E=A5=E5=8F=A3=E5=BC=82=E5=B8=B8=EF=BC=9B?= =?UTF-8?q?=20=E4=BC=98=E5=8C=96-=E5=91=98=E5=B7=A5=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E9=9C=80=E8=A6=81=E6=96=B0=E5=A2=9E=E5=88=86?= =?UTF-8?q?=E9=A1=B5=E6=9F=A5=E8=AF=A2=EF=BC=9B=20=E4=BF=AE=E5=A4=8D-?= =?UTF-8?q?=E6=9D=83=E9=99=90=E5=88=86=E9=85=8D=E7=95=8C=E9=9D=A2=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E6=9F=A5=E8=AF=A2=E8=B4=A6=E5=8F=B7=E6=9D=83=E9=99=90?= =?UTF-8?q?=E6=97=B6=E6=8F=90=E7=A4=BA500=E5=86=85=E9=83=A8=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=99=A8=E9=94=99=E8=AF=AF=E3=80=82=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D-=E6=96=B0=E5=A2=9E=E5=AE=A2=E6=88=BF=E6=97=B6?= =?UTF-8?q?=E6=88=BF=E5=8F=B7=E5=A4=B1=E5=8E=BB=E7=84=A6=E7=82=B9=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E6=8F=90=E7=A4=BA500=E5=86=85=E9=83=A8=E6=9C=8D?= =?UTF-8?q?=E5=8A=A1=E5=99=A8=E9=94=99=E8=AF=AF=E3=80=82=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96-=E5=90=8E=E5=8F=B0=E5=AE=89=E5=85=A8=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E7=9A=84=E9=94=81=E5=B1=8F=E5=9B=BE=E6=A0=87=E4=B8=8E?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=E4=B8=8D=E4=B8=80=E8=87=B4=EF=BC=8C=E9=9C=80?= =?UTF-8?q?=E6=9B=B4=E6=8D=A2=E4=B8=BA=E7=99=BD=E8=89=B2=E9=94=81=E5=B1=8F?= =?UTF-8?q?=E5=9B=BE=E6=A0=87=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Business/Customer/CustoService.cs | 4 +- .../Business/Customer/ICustoService.cs | 2 +- .../Business/Customer/SelectCustoAll.cs | 41 ------------ .../Business/Room/IRoomTypeService.cs | 30 ++++++++- .../Business/Room/RoomService.cs | 26 +++++--- .../Business/Room/RoomTypeService.cs | 66 ++++++++++++++++++- .../Util/IUtilService.cs | 2 +- .../Util/UtilService.cs | 19 ++++-- .../Worker/Picture/WorkerPicService.cs | 8 ++- .../Business/Room/RoomType.cs | 14 +++- .../EOM.TSHotelManager.Common.Core.csproj | 4 ++ ...OSelectCustoAllDto.cs => OSelectAllDto.cs} | 4 +- .../Util/OperationLog.cs | 5 ++ .../Repository/PgRepository.cs | 45 ++++++------- .../Business/Customer/CustoController.cs | 2 +- .../Business/Room/RoomTypeController.cs | 47 ++++++++++++- .../Controllers/Util/AppController.cs | 4 +- 17 files changed, 230 insertions(+), 93 deletions(-) delete mode 100644 EOM.TSHotelManager.Application/Business/Customer/SelectCustoAll.cs rename EOM.TSHotelManager.Common.Core/{OSelectCustoAllDto.cs => OSelectAllDto.cs} (94%) diff --git a/EOM.TSHotelManager.Application/Business/Customer/CustoService.cs b/EOM.TSHotelManager.Application/Business/Customer/CustoService.cs index 7865833..816603d 100644 --- a/EOM.TSHotelManager.Application/Business/Customer/CustoService.cs +++ b/EOM.TSHotelManager.Application/Business/Customer/CustoService.cs @@ -170,9 +170,9 @@ namespace EOM.TSHotelManager.Application /// 查询所有客户信息 /// /// - public OSelectCustoAllDto SelectCustoAll(int? pageIndex, int? pageSize, bool onlyVip = false) + public OSelectAllDto SelectCustoAll(int? pageIndex, int? pageSize, bool onlyVip = false) { - OSelectCustoAllDto oSelectCustoAllDto = new OSelectCustoAllDto(); + OSelectAllDto oSelectCustoAllDto = new OSelectAllDto(); //查询出所有性别类型 List sexTypes = new List(); diff --git a/EOM.TSHotelManager.Application/Business/Customer/ICustoService.cs b/EOM.TSHotelManager.Application/Business/Customer/ICustoService.cs index cc83e3a..154d2fe 100644 --- a/EOM.TSHotelManager.Application/Business/Customer/ICustoService.cs +++ b/EOM.TSHotelManager.Application/Business/Customer/ICustoService.cs @@ -62,7 +62,7 @@ namespace EOM.TSHotelManager.Application /// 查询所有客户信息 /// /// - OSelectCustoAllDto SelectCustoAll(int? pageIndex, int? pageSize, bool onlyVip = false); + OSelectAllDto SelectCustoAll(int? pageIndex, int? pageSize, bool onlyVip = false); /// /// 查询指定客户信息 diff --git a/EOM.TSHotelManager.Application/Business/Customer/SelectCustoAll.cs b/EOM.TSHotelManager.Application/Business/Customer/SelectCustoAll.cs deleted file mode 100644 index d5ec9e6..0000000 --- a/EOM.TSHotelManager.Application/Business/Customer/SelectCustoAll.cs +++ /dev/null @@ -1,41 +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. - * - */ -namespace EOM.TSHotelManager.Application -{ - /// - /// 查询所有客户信息 - /// 输入DTO - /// - public class SelectCustoAll - { - /// - /// 当前页数 - /// - public int pageIndex { get; set; } - /// - /// 当前页总数 - /// - public int pageSize { get; set; } - } -} \ No newline at end of file diff --git a/EOM.TSHotelManager.Application/Business/Room/IRoomTypeService.cs b/EOM.TSHotelManager.Application/Business/Room/IRoomTypeService.cs index a68444c..4725db5 100644 --- a/EOM.TSHotelManager.Application/Business/Room/IRoomTypeService.cs +++ b/EOM.TSHotelManager.Application/Business/Room/IRoomTypeService.cs @@ -34,7 +34,7 @@ namespace EOM.TSHotelManager.Application /// 获取所有房间类型 /// /// - List SelectRoomTypesAll(); + List SelectRoomTypesAll(int? isDelete); /// /// 根据房间编号查询房间类型名称 @@ -42,5 +42,33 @@ namespace EOM.TSHotelManager.Application /// /// RoomType SelectRoomTypeByRoomNo(string no); + + /// + /// 根据房间类型查询类型配置 + /// + /// + /// + RoomType SelectRoomTypeByType(int roomTypeId); + + /// + /// 添加房间状态 + /// + /// + /// + bool InsertRoomType(RoomType roomType); + + /// + /// 更新房间状态 + /// + /// + /// + bool UpdateRoomType(RoomType roomType); + + /// + /// 删除房间状态 + /// + /// + /// + bool DeleteRoomType(RoomType roomType); } } \ No newline at end of file diff --git a/EOM.TSHotelManager.Application/Business/Room/RoomService.cs b/EOM.TSHotelManager.Application/Business/Room/RoomService.cs index 6dc7d3d..a400f39 100644 --- a/EOM.TSHotelManager.Application/Business/Room/RoomService.cs +++ b/EOM.TSHotelManager.Application/Business/Room/RoomService.cs @@ -100,9 +100,9 @@ namespace EOM.TSHotelManager.Application public List SelectCanUseRoomAll() { List roomStates = new List(); - roomStates = roomStateRepository.GetList(a => a.delete_mk != 1); + roomStates = roomStateRepository.GetList(); List roomTypes = new List(); - roomTypes = roomTypeRepository.GetList(a => a.delete_mk != 1); + roomTypes = roomTypeRepository.GetList(); List rooms = new List(); rooms = roomRepository.GetList(a => a.delete_mk != 1 && a.RoomStateId == 0).OrderBy(a => a.RoomNo).ToList(); rooms.ForEach(source => @@ -124,11 +124,11 @@ namespace EOM.TSHotelManager.Application public List SelectRoomAll() { List roomStates = new List(); - roomStates = roomStateRepository.GetList(a => a.delete_mk != 1); + roomStates = roomStateRepository.GetList(); List roomTypes = new List(); - roomTypes = roomTypeRepository.GetList(a => a.delete_mk != 1); + roomTypes = roomTypeRepository.GetList(); List rooms = new List(); - rooms = roomRepository.GetList(a => a.delete_mk != 1).OrderBy(a => a.RoomNo).ToList(); + rooms = roomRepository.GetList().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)); @@ -195,10 +195,18 @@ namespace EOM.TSHotelManager.Application roomStates = roomStateRepository.GetList(a => a.delete_mk != 1); Room room = new Room(); room = roomRepository.GetSingle(a => a.delete_mk != 1 && a.RoomNo == no); - var roomSate = roomStates.FirstOrDefault(a => a.RoomStateId == room.RoomStateId); - room.RoomState = string.IsNullOrEmpty(roomSate.RoomStateName) ? "" : roomSate.RoomStateName; - var roomType = roomTypeRepository.GetSingle(a => a.Roomtype == room.RoomType); - room.RoomName = string.IsNullOrEmpty(roomType.RoomName) ? "" : roomType.RoomName; + if (!room.IsNullOrEmpty()) + { + var roomSate = roomStates.FirstOrDefault(a => a.RoomStateId == room.RoomStateId); + room.RoomState = string.IsNullOrEmpty(roomSate.RoomStateName) ? "" : roomSate.RoomStateName; + var roomType = roomTypeRepository.GetSingle(a => a.Roomtype == room.RoomType); + room.RoomName = string.IsNullOrEmpty(roomType.RoomName) ? "" : roomType.RoomName; + } + else + { + room = new Room(); + } + return room; } #endregion diff --git a/EOM.TSHotelManager.Application/Business/Room/RoomTypeService.cs b/EOM.TSHotelManager.Application/Business/Room/RoomTypeService.cs index 5a55208..d57afc0 100644 --- a/EOM.TSHotelManager.Application/Business/Room/RoomTypeService.cs +++ b/EOM.TSHotelManager.Application/Business/Room/RoomTypeService.cs @@ -21,6 +21,7 @@ *SOFTWARE. * */ +using CK.Common; using EOM.TSHotelManager.Common.Core; using EOM.TSHotelManager.EntityFramework; @@ -57,10 +58,19 @@ namespace EOM.TSHotelManager.Application /// 获取所有房间类型 /// /// - public List SelectRoomTypesAll() + public List SelectRoomTypesAll(int? isDelete) { List types = new List(); - types = roomTypeRepository.GetList(a => a.delete_mk != 1); + if (!isDelete.IsNullOrEmpty()) + { + types = roomTypeRepository.GetList(a => a.delete_mk == isDelete); + + } + types = roomTypeRepository.GetList(); + types.ForEach(t => + { + t.DeleteMkNm = t.delete_mk == 0 ? "否" : "是"; + }); return types; } #endregion @@ -80,5 +90,57 @@ namespace EOM.TSHotelManager.Application return roomtype; } #endregion + + /// + /// 根据房间类型查询类型配置 + /// + /// + /// + public RoomType SelectRoomTypeByType(int roomTypeId) + { + var roomType = roomTypeRepository.GetSingle(a => a.Roomtype == roomTypeId); + return roomType; + } + + /// + /// 添加房间状态 + /// + /// + /// + public bool InsertRoomType(RoomType roomType) + { + return roomTypeRepository.Insert(roomType); + } + + /// + /// 更新房间状态 + /// + /// + /// + public bool UpdateRoomType(RoomType roomType) + { + return roomTypeRepository.Update(a => new RoomType + { + RoomName = roomType.RoomName, + RoomRent = roomType.RoomRent, + RoomDeposit = roomType.RoomDeposit, + delete_mk = roomType.delete_mk, + datachg_usr = roomType.datachg_usr, + datachg_date = DateTime.Now + }, a => a.Roomtype == roomType.Roomtype) ; + } + + /// + /// 删除房间状态 + /// + /// + /// + public bool DeleteRoomType(RoomType roomType) + { + return roomTypeRepository.Update(a => new RoomType + { + delete_mk = 1 + }, a => a.Roomtype == roomType.Roomtype); + } } } diff --git a/EOM.TSHotelManager.Application/Util/IUtilService.cs b/EOM.TSHotelManager.Application/Util/IUtilService.cs index ad793a7..7e3e8e0 100644 --- a/EOM.TSHotelManager.Application/Util/IUtilService.cs +++ b/EOM.TSHotelManager.Application/Util/IUtilService.cs @@ -31,6 +31,6 @@ namespace EOM.TSHotelManager.Application /// 查询所有操作日志 /// /// - List SelectOperationlogAll(); + OSelectAllDto SelectOperationlogAll(int? pageIndex, int? pageSize); } } diff --git a/EOM.TSHotelManager.Application/Util/UtilService.cs b/EOM.TSHotelManager.Application/Util/UtilService.cs index ff4a6af..2b1996e 100644 --- a/EOM.TSHotelManager.Application/Util/UtilService.cs +++ b/EOM.TSHotelManager.Application/Util/UtilService.cs @@ -73,14 +73,25 @@ namespace EOM.TSHotelManager.Application /// 查询所有操作日志 /// /// - public List SelectOperationlogAll() + public OSelectAllDto SelectOperationlogAll(int? pageIndex, int? pageSize) { - List operationLogs = new List(); - operationLogs = operationLogRepository.GetList(a => a.delete_mk != 1).OrderByDescending(a => a.OperationTime).ToList(); - operationLogs.ForEach(source => + OSelectAllDto operationLogs = new OSelectAllDto(); + var count = 0; + if (pageIndex != 0 && pageSize != 0) + { + operationLogs.listSource = operationLogRepository.AsQueryable().OrderByDescending(a => a.OperationTime).ToPageList((int)pageIndex, (int)pageSize, ref count); + } + else + { + operationLogs.listSource = operationLogRepository.AsQueryable().OrderByDescending(a => a.OperationTime).ToList(); + } + + operationLogs.listSource.ForEach(source => { source.OperationLevelNm = source.OperationLevel == RecordLevel.Normal ? "常规操作" : source.OperationLevel == RecordLevel.Warning ? "敏感操作" : "严重操作"; }); + operationLogs.total = count; + return operationLogs; } diff --git a/EOM.TSHotelManager.Application/Worker/Picture/WorkerPicService.cs b/EOM.TSHotelManager.Application/Worker/Picture/WorkerPicService.cs index fbef80b..ef0ba75 100644 --- a/EOM.TSHotelManager.Application/Worker/Picture/WorkerPicService.cs +++ b/EOM.TSHotelManager.Application/Worker/Picture/WorkerPicService.cs @@ -1,4 +1,5 @@ -using EOM.TSHotelManager.Common.Core; +using CK.Common; +using EOM.TSHotelManager.Common.Core; using EOM.TSHotelManager.EntityFramework; namespace EOM.TSHotelManager.Application @@ -40,7 +41,10 @@ namespace EOM.TSHotelManager.Application workerPicSource = workerPicRepository.GetSingle(a => a.WorkerId.Equals(workerPic.WorkerId)); - //workerPicSource.Pic = workerPicSource == null || string.IsNullOrEmpty(workerPicSource.Pic) "" : workerPicSource.Pic; + if (workerPicSource.IsNullOrEmpty()) + { + return new WorkerPic { Id = 0, Pic = "", WorkerId = workerPic.WorkerId }; + } return workerPicSource; } diff --git a/EOM.TSHotelManager.Common.Core/Business/Room/RoomType.cs b/EOM.TSHotelManager.Common.Core/Business/Room/RoomType.cs index 171a6b0..f9f6310 100644 --- a/EOM.TSHotelManager.Common.Core/Business/Room/RoomType.cs +++ b/EOM.TSHotelManager.Common.Core/Business/Room/RoomType.cs @@ -22,6 +22,8 @@ * *模块说明:房间类型类 */ +using EOM.TSHotelManager.Common.Util; + namespace EOM.TSHotelManager.Common.Core { /// @@ -34,27 +36,37 @@ namespace EOM.TSHotelManager.Common.Core /// 类型编号 /// [SqlSugar.SugarColumn(ColumnName = "RoomType")] + [NeedValid] public int Roomtype { get; set; } /// /// 房间类型 /// + [NeedValid] public string RoomName { get; set; } /// /// 房间租金 /// [SqlSugar.SugarColumn(ColumnName = "room_rent", ColumnDataType = "decimal")] + [NeedValid] public decimal RoomRent { get; set; } /// /// 房间押金 /// [SqlSugar.SugarColumn(ColumnName = "room_deposit")] + [NeedValid] public decimal RoomDeposit { get; set; } /// /// 删除标记 /// - public int delete_mk { get; set; } + public int delete_mk { get; set; } = 0; + + /// + /// 删除标记描述 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string DeleteMkNm { get; set; } } } diff --git a/EOM.TSHotelManager.Common.Core/EOM.TSHotelManager.Common.Core.csproj b/EOM.TSHotelManager.Common.Core/EOM.TSHotelManager.Common.Core.csproj index 2d59fdb..af07239 100644 --- a/EOM.TSHotelManager.Common.Core/EOM.TSHotelManager.Common.Core.csproj +++ b/EOM.TSHotelManager.Common.Core/EOM.TSHotelManager.Common.Core.csproj @@ -9,4 +9,8 @@ + + + + diff --git a/EOM.TSHotelManager.Common.Core/OSelectCustoAllDto.cs b/EOM.TSHotelManager.Common.Core/OSelectAllDto.cs similarity index 94% rename from EOM.TSHotelManager.Common.Core/OSelectCustoAllDto.cs rename to EOM.TSHotelManager.Common.Core/OSelectAllDto.cs index 456e374..d7fca7e 100644 --- a/EOM.TSHotelManager.Common.Core/OSelectCustoAllDto.cs +++ b/EOM.TSHotelManager.Common.Core/OSelectAllDto.cs @@ -29,12 +29,12 @@ namespace EOM.TSHotelManager.Common.Core /// 查询所有客户信息 /// 输出DTO /// - public class OSelectCustoAllDto + public class OSelectAllDto { /// /// 数据源 /// - public List listSource { get; set; } + public List listSource { get; set; } /// /// 总数 diff --git a/EOM.TSHotelManager.Common.Core/Util/OperationLog.cs b/EOM.TSHotelManager.Common.Core/Util/OperationLog.cs index a0ec77e..33af193 100644 --- a/EOM.TSHotelManager.Common.Core/Util/OperationLog.cs +++ b/EOM.TSHotelManager.Common.Core/Util/OperationLog.cs @@ -51,6 +51,11 @@ namespace EOM.TSHotelManager.Common.Core [SqlSugar.SugarTable("operationlog")] public class OperationLog : BaseDTO { + /// + /// 日志ID + /// + [SqlSugar.SugarColumn(ColumnName = "OperationId",IsIdentity = true,IsPrimaryKey = true)] + public int OperationId { get; set; } /// /// 操作时间 /// diff --git a/EOM.TSHotelManager.EntityFramework/Repository/PgRepository.cs b/EOM.TSHotelManager.EntityFramework/Repository/PgRepository.cs index d35d4a8..8ef65c1 100644 --- a/EOM.TSHotelManager.EntityFramework/Repository/PgRepository.cs +++ b/EOM.TSHotelManager.EntityFramework/Repository/PgRepository.cs @@ -1,5 +1,6 @@ using Microsoft.Extensions.Configuration; using SqlSugar; +using System.Transactions; namespace EOM.TSHotelManager.EntityFramework { @@ -7,31 +8,31 @@ namespace EOM.TSHotelManager.EntityFramework { public PgRepository(ISqlSugarClient context = null) : base(context)//注意这里要有默认值等于null { - if (context == null) - { - base.Context = new SqlSugarClient(new ConnectionConfig() + if (context == null) { - DbType = SqlSugar.DbType.PostgreSQL,//此处为设置数据库,支持各大主流数据库 - InitKeyType = InitKeyType.Attribute,//此处为初始化配置类型,有按特性进行初始化,也有其他的进行初始化 - IsAutoCloseConnection = true,//此处为是否自动关闭数据库连接,可以理解为是DBHelper里的Close()方法 - MoreSettings = new ConnMoreSettings() + base.Context = new SqlSugarClient(new ConnectionConfig() { - PgSqlIsAutoToLower = false, //数据库存在大写字段的 - //,需要把这个设为false ,并且实体和字段名称要一样 - //如果数据库里的数据表本身就为小写,则改成true - //详细可以参考官网https://www.donet5.com/Home/Doc - DisableMillisecond = true, - }, - ConnectionString = AppSettingsJson.GetAppSettings().GetConnectionString("PgSqlConnectStr") - }); + DbType = SqlSugar.DbType.PostgreSQL,//此处为设置数据库,支持各大主流数据库 + InitKeyType = InitKeyType.Attribute,//此处为初始化配置类型,有按特性进行初始化,也有其他的进行初始化 + IsAutoCloseConnection = true,//此处为是否自动关闭数据库连接,可以理解为是DBHelper里的Close()方法 + MoreSettings = new ConnMoreSettings() + { + PgSqlIsAutoToLower = false, //数据库存在大写字段的 + //,需要把这个设为false ,并且实体和字段名称要一样 + //如果数据库里的数据表本身就为小写,则改成true + //详细可以参考官网https://www.donet5.com/Home/Doc + DisableMillisecond = true + }, + LanguageType = LanguageType.Chinese, + ConnectionString = AppSettingsJson.GetAppSettings().GetConnectionString("PgSqlConnectStr") + }); - base.Context.Aop.OnError = (ex) => - { - //此处为AOP切面编程代码块,常用于数据库连接日志记录 - //或者查看详细的报错信息,打印ex的内容即可 - }; - } + base.Context.Aop.OnError = (ex) => + { + //此处为AOP切面编程代码块,常用于数据库连接日志记录 + //或者查看详细的报错信息,打印ex的内容即可 + }; + } } - } } diff --git a/EOM.TSHotelManager.WebApi/Controllers/Business/Customer/CustoController.cs b/EOM.TSHotelManager.WebApi/Controllers/Business/Customer/CustoController.cs index 6310c7d..c9ffe4f 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Business/Customer/CustoController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Business/Customer/CustoController.cs @@ -73,7 +73,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public OSelectCustoAllDto SelectCustoAll([FromQuery] int pageIndex, int pageSize, bool onlyVip = false) + public OSelectAllDto SelectCustoAll([FromQuery] int pageIndex, int pageSize, bool onlyVip = false) { return customerService.SelectCustoAll(pageIndex, pageSize, onlyVip); } diff --git a/EOM.TSHotelManager.WebApi/Controllers/Business/Room/RoomTypeController.cs b/EOM.TSHotelManager.WebApi/Controllers/Business/Room/RoomTypeController.cs index d9d5fac..dc5d5d5 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Business/Room/RoomTypeController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Business/Room/RoomTypeController.cs @@ -29,9 +29,9 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public List SelectRoomTypesAll() + public List SelectRoomTypesAll([FromQuery]int? isDelete) { - return roomTypeService.SelectRoomTypesAll(); + return roomTypeService.SelectRoomTypesAll(isDelete); } /// @@ -45,5 +45,48 @@ namespace EOM.TSHotelManager.WebApi.Controllers return roomTypeService.SelectRoomTypeByRoomNo(no); } + /// + /// 根据房间类型查询类型配置 + /// + /// + /// + [HttpGet] + public RoomType SelectRoomTypeByType([FromQuery]int roomTypeId) + { + return roomTypeService.SelectRoomTypeByType(roomTypeId); + } + + /// + /// 添加房间状态 + /// + /// + /// + [HttpPost] + public bool InsertRoomType([FromBody] RoomType roomType) + { + return roomTypeService.InsertRoomType(roomType); + } + + /// + /// 更新房间状态 + /// + /// + /// + [HttpPost] + public bool UpdateRoomType([FromBody] RoomType roomType) + { + return roomTypeService.UpdateRoomType(roomType); + } + + /// + /// 删除房间状态 + /// + /// + /// + [HttpPost] + public bool DeleteRoomType([FromBody]RoomType roomType) + { + return roomTypeService.DeleteRoomType(roomType); + } } } diff --git a/EOM.TSHotelManager.WebApi/Controllers/Util/AppController.cs b/EOM.TSHotelManager.WebApi/Controllers/Util/AppController.cs index 9dc8a97..f440dd0 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Util/AppController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Util/AppController.cs @@ -63,9 +63,9 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public List SelectOperationlogAll() + public OSelectAllDto SelectOperationlogAll([FromQuery]int? pageIndex, int? pageSize) { - return utilService.SelectOperationlogAll(); + return utilService.SelectOperationlogAll(pageIndex, pageSize); } } } -- Gitee