From 04d20143e24c591bad544b64144e6365db434151 Mon Sep 17 00:00:00 2001 From: Chunkit Yeung Date: Sun, 8 Jan 2023 19:20:37 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=EF=BC=9B=E7=A7=BB=E9=99=A4=E5=A4=9A=E4=BD=99=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Business/Reser/ReserService.cs | 3 +- .../Business/Room/IRoomTypeService.cs | 4 - .../Business/Room/RoomService.cs | 5 +- .../Business/Room/RoomTypeService.cs | 1 - .../Business/Sellthing/SellService.cs | 7 +- .../Business/Spend/SpendService.cs | 5 +- .../Business/Wti/WtiService.cs | 7 +- .../EOM.TSHotelManager.Application.csproj | 1 - .../Util/IUtilService.cs | 41 +++++++ .../Util/UtilService.cs | 76 +++++++------ .../Worker/IWorkerService.cs | 5 +- .../Worker/Picture/WorkerPicService.cs | 3 +- .../Worker/WorkerService.cs | 16 ++- .../Zero/Admin/AdminService.cs | 4 +- .../Zero/Base/BaseService.cs | 33 +++--- .../Zero/VipRule/VipRuleAppService.cs | 7 +- .../EOM.TSHotelManager.Common.csproj | 17 --- EOM.TSHotelManager.Common/HttpHelper.cs | 48 --------- .../RecordHelper/AdminInfo.cs | 66 ------------ .../RecordHelper/IOperationlogService.cs | 46 -------- .../RecordHelper/LoginInfo.cs | 57 ---------- .../RecordHelper/RecordHelper.cs | 44 -------- .../Util/ApplicationVersionUtil.cs | 82 -------------- .../Util/IDGenerationUtil.cs | 80 -------------- .../Util/ApplicationVersion.cs | 28 +++++ .../Util/Cardcodes.cs | 76 ++----------- .../Util}/OperationLog.cs | 2 +- .../AppSettingsJson.cs | 2 +- .../EOM.TSHotelManager.EntityFramework.csproj | 10 -- .../dbsettings.json | 5 - EOM.TSHotelManager.Web.sln | 6 -- .../Business/Customer/CustoController.cs | 4 +- .../Business/Room/RoomTypeController.cs | 50 +++++++++ .../Controllers/Util/UtilController.cs | 70 ++++++++++++ .../Controllers/Worker/WorkerController.cs | 9 +- .../Controllers/Zero/Admin/AdminController.cs | 2 + .../EOM.TSHotelManager.WebApi.xml | 100 +++++++++++++++++- .../Filter/ActionFilter.cs | 59 +++++++++++ EOM.TSHotelManager.WebApi/Startup.cs | 9 +- EOM.TSHotelManager.WebApi/appsettings.json | 3 + 40 files changed, 457 insertions(+), 636 deletions(-) create mode 100644 EOM.TSHotelManager.Application/Util/IUtilService.cs rename EOM.TSHotelManager.Common/RecordHelper/OperationlogService.cs => EOM.TSHotelManager.Application/Util/UtilService.cs (46%) delete mode 100644 EOM.TSHotelManager.Common/EOM.TSHotelManager.Common.csproj delete mode 100644 EOM.TSHotelManager.Common/HttpHelper.cs delete mode 100644 EOM.TSHotelManager.Common/RecordHelper/AdminInfo.cs delete mode 100644 EOM.TSHotelManager.Common/RecordHelper/IOperationlogService.cs delete mode 100644 EOM.TSHotelManager.Common/RecordHelper/LoginInfo.cs delete mode 100644 EOM.TSHotelManager.Common/RecordHelper/RecordHelper.cs delete mode 100644 EOM.TSHotelManager.Common/Util/ApplicationVersionUtil.cs delete mode 100644 EOM.TSHotelManager.Common/Util/IDGenerationUtil.cs create mode 100644 EOM.TSHotelManager.Core/Util/ApplicationVersion.cs rename EOM.TSHotelManager.Common/Util/IDCardUtil.cs => EOM.TSHotelManager.Core/Util/Cardcodes.cs (33%) rename {EOM.TSHotelManager.Common/RecordHelper => EOM.TSHotelManager.Core/Util}/OperationLog.cs (99%) delete mode 100644 EOM.TSHotelManager.EntityFramework/dbsettings.json create mode 100644 EOM.TSHotelManager.WebApi/Controllers/Business/Room/RoomTypeController.cs create mode 100644 EOM.TSHotelManager.WebApi/Controllers/Util/UtilController.cs create mode 100644 EOM.TSHotelManager.WebApi/Filter/ActionFilter.cs diff --git a/EOM.TSHotelManager.Application/Business/Reser/ReserService.cs b/EOM.TSHotelManager.Application/Business/Reser/ReserService.cs index 58716aa..1870d2d 100644 --- a/EOM.TSHotelManager.Application/Business/Reser/ReserService.cs +++ b/EOM.TSHotelManager.Application/Business/Reser/ReserService.cs @@ -22,7 +22,6 @@ * */ using EOM.Encrypt; -using EOM.TSHotelManager.Common; using EOM.TSHotelManager.Core; using EOM.TSHotelManager.EntityFramework; using System; @@ -98,7 +97,7 @@ namespace EOM.TSHotelManager.Application return reserRepository.Update(a => new Reser() { delete_mk = 1, - datachg_usr = LoginInfo.WorkerNo, + datachg_usr = string.Empty, datachg_date = DateTime.Now },a => a.ReserId == rid); diff --git a/EOM.TSHotelManager.Application/Business/Room/IRoomTypeService.cs b/EOM.TSHotelManager.Application/Business/Room/IRoomTypeService.cs index 7e8cba7..2a446bc 100644 --- a/EOM.TSHotelManager.Application/Business/Room/IRoomTypeService.cs +++ b/EOM.TSHotelManager.Application/Business/Room/IRoomTypeService.cs @@ -31,21 +31,17 @@ namespace EOM.TSHotelManager.Application /// public interface IRoomTypeService { - #region 获取所有房间类型 /// /// 获取所有房间类型 /// /// List SelectRoomTypesAll(); - #endregion - #region 根据房间编号查询房间类型名称 /// /// 根据房间编号查询房间类型名称 /// /// /// RoomType SelectRoomTypeByRoomNo(string? no); - #endregion } } \ 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 399a73b..d9965f4 100644 --- a/EOM.TSHotelManager.Application/Business/Room/RoomService.cs +++ b/EOM.TSHotelManager.Application/Business/Room/RoomService.cs @@ -22,7 +22,6 @@ * */ using CK.Common; -using EOM.TSHotelManager.Common; using EOM.TSHotelManager.Core; using EOM.TSHotelManager.EntityFramework; using System; @@ -263,7 +262,7 @@ namespace EOM.TSHotelManager.Application return roomRepository.Update(a => new Room() { RoomStateId = r.RoomStateId, - datachg_usr = LoginInfo.WorkerNo, + datachg_usr = string.Empty, datachg_date = DateTime.Now }, a => a.RoomNo == r.RoomNo); } @@ -347,7 +346,7 @@ namespace EOM.TSHotelManager.Application return roomRepository.Update(a => new Room() { RoomStateId = stateid, - datains_usr = LoginInfo.WorkerNo, + datains_usr = string.Empty, datachg_date = DateTime.Now },a => a.RoomNo == roomno); } diff --git a/EOM.TSHotelManager.Application/Business/Room/RoomTypeService.cs b/EOM.TSHotelManager.Application/Business/Room/RoomTypeService.cs index 3f52efd..a250587 100644 --- a/EOM.TSHotelManager.Application/Business/Room/RoomTypeService.cs +++ b/EOM.TSHotelManager.Application/Business/Room/RoomTypeService.cs @@ -32,7 +32,6 @@ namespace EOM.TSHotelManager.Application /// public class RoomTypeService:IRoomTypeService { - /// /// 客房类型 /// diff --git a/EOM.TSHotelManager.Application/Business/Sellthing/SellService.cs b/EOM.TSHotelManager.Application/Business/Sellthing/SellService.cs index dd6664c..39fc493 100644 --- a/EOM.TSHotelManager.Application/Business/Sellthing/SellService.cs +++ b/EOM.TSHotelManager.Application/Business/Sellthing/SellService.cs @@ -24,7 +24,6 @@ using System; using System.Collections.Generic; using CK.Common; -using EOM.TSHotelManager.Common; using EOM.TSHotelManager.Core; using EOM.TSHotelManager.EntityFramework; using SqlSugar; @@ -105,7 +104,7 @@ namespace EOM.TSHotelManager.Application return sellThingRepository.Update(a => new SellThing() { Stock = Convert.ToInt32(stock), - datachg_usr = LoginInfo.WorkerNo, + datachg_usr = string.Empty, datachg_date = DateTime.Now },a => a.SellNo == sellNo); } @@ -138,7 +137,7 @@ namespace EOM.TSHotelManager.Application return spendRepository.Update(a => new Spend() { delete_mk = 1, - datachg_usr = LoginInfo.WorkerNo, + datachg_usr = string.Empty, datachg_date = DateTime.Now },a => a.MoneyState.Equals(SpendConsts.UnSettle) && a.RoomNo == roomNo && a.CustoNo == custoNo && a.SpendName == sellName); @@ -155,7 +154,7 @@ namespace EOM.TSHotelManager.Application return sellThingRepository.Update(a => new SellThing() { delete_mk = 1, - datachg_usr = AdminInfo.Account, + datachg_usr = string.Empty, datachg_date = DateTime.Now }, a => a.SellNo == sellNo); } diff --git a/EOM.TSHotelManager.Application/Business/Spend/SpendService.cs b/EOM.TSHotelManager.Application/Business/Spend/SpendService.cs index e47e665..87c8289 100644 --- a/EOM.TSHotelManager.Application/Business/Spend/SpendService.cs +++ b/EOM.TSHotelManager.Application/Business/Spend/SpendService.cs @@ -24,7 +24,6 @@ using System; using System.Collections.Generic; using System.Linq; -using EOM.TSHotelManager.Common; using EOM.TSHotelManager.Core; using EOM.TSHotelManager.EntityFramework; @@ -209,7 +208,7 @@ namespace EOM.TSHotelManager.Application return spendRepository.Update(a => new Spend() { MoneyState = SpendConsts.Settled, - datachg_usr = LoginInfo.WorkerNo, + datachg_usr = string.Empty, datachg_date = DateTime.Now },a => a.RoomNo == roomno && a.SpendTime >= Convert.ToDateTime(checktime) && a.SpendTime <= DateTime.Now); } @@ -230,7 +229,7 @@ namespace EOM.TSHotelManager.Application return spendRepository.Update(a => new Spend() { RoomNo = newRoom, - datachg_usr = LoginInfo.WorkerNo, + datachg_usr = string.Empty, datachg_date = DateTime.Now }, a => listSpendId.Contains(a.RoomNo) && a.CustoNo == custoNo && a.MoneyState.Equals(SpendConsts.UnSettle) && a.SpendTime >= DateTime.Now && a.SpendTime <= DateTime.Now); diff --git a/EOM.TSHotelManager.Application/Business/Wti/WtiService.cs b/EOM.TSHotelManager.Application/Business/Wti/WtiService.cs index 83b7681..0e4d626 100644 --- a/EOM.TSHotelManager.Application/Business/Wti/WtiService.cs +++ b/EOM.TSHotelManager.Application/Business/Wti/WtiService.cs @@ -23,7 +23,6 @@ */ using System; using System.Collections.Generic; -using EOM.TSHotelManager.Common; using EOM.TSHotelManager.Core; using EOM.TSHotelManager.EntityFramework; @@ -152,7 +151,7 @@ namespace EOM.TSHotelManager.Application { WaterUse = w.WaterUse, PowerUse = w.PowerUse, - datachg_usr = LoginInfo.WorkerNo, + datachg_usr = string.Empty, datachg_date = DateTime.Now, },a => a.RoomNo == w.RoomNo && a.UseDate >= w.UseDate && a.EndDate >= w.EndDate); } @@ -169,7 +168,7 @@ namespace EOM.TSHotelManager.Application // return base.Update(a => new Wti() // { // delete_mk = 1, - // datachg_usr = LoginInfo.WorkerNo, + // datachg_usr = string.Empty, // datachg_date = DateTime.Now // }, a => a.WtiNo == roomno); //} @@ -190,7 +189,7 @@ namespace EOM.TSHotelManager.Application return wtiRepository.Update(a => new Wti() { delete_mk = 1, - datachg_usr = LoginInfo.WorkerNo, + datachg_usr = string.Empty, datachg_date = DateTime.Now },a => a.RoomNo == roomno && a.UseDate >= Convert.ToDateTime(usedate) && a.EndDate >= Convert.ToDateTime(enddate)); } diff --git a/EOM.TSHotelManager.Application/EOM.TSHotelManager.Application.csproj b/EOM.TSHotelManager.Application/EOM.TSHotelManager.Application.csproj index e2a2d10..8449846 100644 --- a/EOM.TSHotelManager.Application/EOM.TSHotelManager.Application.csproj +++ b/EOM.TSHotelManager.Application/EOM.TSHotelManager.Application.csproj @@ -16,7 +16,6 @@ - diff --git a/EOM.TSHotelManager.Application/Util/IUtilService.cs b/EOM.TSHotelManager.Application/Util/IUtilService.cs new file mode 100644 index 0000000..d830e4d --- /dev/null +++ b/EOM.TSHotelManager.Application/Util/IUtilService.cs @@ -0,0 +1,41 @@ +using EOM.TSHotelManager.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 工具类接口 + /// + public interface IUtilService + { + /// + /// 查询身份证号码 + /// + /// + /// + string SelectCardCode(string identityCard); + + /// + /// 检测版本号 + /// + /// + Applicationversion CheckBaseVersion(); + + /// + /// 添加操作日志 + /// + /// + /// + bool InsertOperationLog(OperationLog opr); + + /// + /// 查询所有操作日志 + /// + /// + List SelectOperationlogAll(); + } +} diff --git a/EOM.TSHotelManager.Common/RecordHelper/OperationlogService.cs b/EOM.TSHotelManager.Application/Util/UtilService.cs similarity index 46% rename from EOM.TSHotelManager.Common/RecordHelper/OperationlogService.cs rename to EOM.TSHotelManager.Application/Util/UtilService.cs index a485760..97be8dc 100644 --- a/EOM.TSHotelManager.Common/RecordHelper/OperationlogService.cs +++ b/EOM.TSHotelManager.Application/Util/UtilService.cs @@ -1,40 +1,28 @@ -/* - * 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.TSHotelManager.Core; +using EOM.TSHotelManager.EntityFramework; using System; using System.Collections.Generic; -using System.Data; using System.Linq; -using System.Net; -using EOM.TSHotelManager.EntityFramework; +using System.Text; +using System.Threading.Tasks; -namespace EOM.TSHotelManager.Common +namespace EOM.TSHotelManager.Application { /// - /// 操作日志数据访问层 + /// 工具接口实现类 /// - public class OperationlogService:IOperationlogService + public class UtilService: IUtilService { + /// + /// 卡片代码 + /// + private readonly PgRepository cardCodesRepository; + + /// + /// 应用检测 + /// + private readonly PgRepository applicationRepository; + /// /// 操作日志 /// @@ -43,12 +31,39 @@ namespace EOM.TSHotelManager.Common /// /// /// + /// + /// /// - public OperationlogService(PgRepository operationLogRepository) + public UtilService(PgRepository cardCodesRepository, PgRepository applicationRepository, PgRepository operationLogRepository) { + this.cardCodesRepository = cardCodesRepository; + this.applicationRepository = applicationRepository; this.operationLogRepository = operationLogRepository; } + /// + /// 查询身份证号码 + /// + /// + /// + public string SelectCardCode(string identityCard) + { + 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; + } + + /// + /// 检测版本号 + /// + /// + public Applicationversion CheckBaseVersion() + { + return applicationRepository.GetSingle(a => a.base_versionId == 1); + } + /// /// 添加操作日志 /// @@ -74,6 +89,5 @@ namespace EOM.TSHotelManager.Common return operationLogs; } - } } diff --git a/EOM.TSHotelManager.Application/Worker/IWorkerService.cs b/EOM.TSHotelManager.Application/Worker/IWorkerService.cs index e0762ad..8c005d7 100644 --- a/EOM.TSHotelManager.Application/Worker/IWorkerService.cs +++ b/EOM.TSHotelManager.Application/Worker/IWorkerService.cs @@ -94,9 +94,8 @@ namespace EOM.TSHotelManager.Application /// /// 根据员工编号和密码修改密码 /// - /// - /// + /// /// - bool UpdWorkerPwdByWorkNo(string? workId, string? workPwd); + bool UpdWorkerPwdByWorkNo(Worker worker); } } \ No newline at end of file diff --git a/EOM.TSHotelManager.Application/Worker/Picture/WorkerPicService.cs b/EOM.TSHotelManager.Application/Worker/Picture/WorkerPicService.cs index 4919447..0d9d3ea 100644 --- a/EOM.TSHotelManager.Application/Worker/Picture/WorkerPicService.cs +++ b/EOM.TSHotelManager.Application/Worker/Picture/WorkerPicService.cs @@ -1,5 +1,4 @@ using EOM.Encrypt; -using EOM.TSHotelManager.Common; using EOM.TSHotelManager.Core; using EOM.TSHotelManager.EntityFramework; using System; @@ -50,7 +49,7 @@ namespace EOM.TSHotelManager.Application if (workerPicSource != null) { - workerPicSource.Pic = workerPicSource == null || string.IsNullOrEmpty(workerPicSource.Pic) ? "" : encrypt.Decryption(HttpHelper.baseUrl) + workerPicSource.Pic; + workerPicSource.Pic = workerPicSource == null || string.IsNullOrEmpty(workerPicSource.Pic) ? "" : workerPicSource.Pic; } return workerPicSource; diff --git a/EOM.TSHotelManager.Application/Worker/WorkerService.cs b/EOM.TSHotelManager.Application/Worker/WorkerService.cs index 36354df..bb9d724 100644 --- a/EOM.TSHotelManager.Application/Worker/WorkerService.cs +++ b/EOM.TSHotelManager.Application/Worker/WorkerService.cs @@ -22,7 +22,6 @@ * */ using EOM.Encrypt; -using EOM.TSHotelManager.Common; using EOM.TSHotelManager.Core; using EOM.TSHotelManager.EntityFramework; using System; @@ -125,7 +124,7 @@ namespace EOM.TSHotelManager.Application CardId= worker.CardId, WorkerSex = worker.WorkerSex, WorkerBirthday = worker.WorkerBirthday, - datachg_usr = AdminInfo.Account, + datachg_usr = string.Empty, datachg_date = DateTime.Now },a => a.WorkerId.Equals(worker.WorkerId)); @@ -157,7 +156,7 @@ namespace EOM.TSHotelManager.Application { WorkerClub = worker.WorkerClub, WorkerPosition = worker.WorkerPosition, - datachg_usr = AdminInfo.Account, + datachg_usr = string.Empty, datachg_date = DateTime.Now }, a => a.WorkerId == worker.WorkerId); } @@ -314,18 +313,17 @@ namespace EOM.TSHotelManager.Application /// /// 根据员工编号和密码修改密码 /// - /// - /// + /// /// - public bool UpdWorkerPwdByWorkNo(string? workId,string? workPwd) + public bool UpdWorkerPwdByWorkNo(Worker worker) { - string? NewPwd = encrypt.Decryption(workPwd); + string? NewPwd = encrypt.Decryption(worker.WorkerPwd); return workerRepository.Update(a => new Worker() { WorkerPwd = NewPwd, - datachg_usr = LoginInfo.WorkerNo, + datachg_usr = string.Empty, datachg_date = DateTime.Now - },a => a.WorkerId == workId); + },a => a.WorkerId == worker.WorkerId); } } diff --git a/EOM.TSHotelManager.Application/Zero/Admin/AdminService.cs b/EOM.TSHotelManager.Application/Zero/Admin/AdminService.cs index d413ab1..b3df4ec 100644 --- a/EOM.TSHotelManager.Application/Zero/Admin/AdminService.cs +++ b/EOM.TSHotelManager.Application/Zero/Admin/AdminService.cs @@ -23,7 +23,6 @@ */ using CK.Common; using EOM.Encrypt; -using EOM.TSHotelManager.Common; using EOM.TSHotelManager.Core; using EOM.TSHotelManager.EntityFramework; using SqlSugar.DistributedSystem.Snowflake; @@ -94,6 +93,7 @@ namespace EOM.TSHotelManager.Application admins = null; return admins; } + admins.AdminPassword = ""; return admins; } @@ -149,7 +149,7 @@ namespace EOM.TSHotelManager.Application return adminRepository.Update(a => new Admin() { AdminPassword = admin.AdminPassword, - datachg_usr = AdminInfo.Account, + datachg_usr = string.Empty, datachg_time = DateTime.Now }, a => a.AdminAccount == admin.AdminAccount); } diff --git a/EOM.TSHotelManager.Application/Zero/Base/BaseService.cs b/EOM.TSHotelManager.Application/Zero/Base/BaseService.cs index 035edfe..d80e129 100644 --- a/EOM.TSHotelManager.Application/Zero/Base/BaseService.cs +++ b/EOM.TSHotelManager.Application/Zero/Base/BaseService.cs @@ -22,7 +22,6 @@ * */ using CK.Common; -using EOM.TSHotelManager.Common; using EOM.TSHotelManager.Core; using EOM.TSHotelManager.EntityFramework; using SqlSugar; @@ -168,7 +167,7 @@ namespace EOM.TSHotelManager.Application return sexTypeRepository.Update(a => new SexType() { delete_mk = sexType.delete_mk, - datachg_usr = LoginInfo.WorkerNo, + datachg_usr = string.Empty, datachg_date = DateTime.Now }, a => a.sexId == sexType.sexId); } @@ -183,7 +182,7 @@ namespace EOM.TSHotelManager.Application return sexTypeRepository.Update(a => new SexType() { sexName = sexType.sexName, - datachg_usr = LoginInfo.WorkerNo, + datachg_usr = string.Empty, datachg_date = DateTime.Now }, a => a.sexId == sexType.sexId); } @@ -241,7 +240,7 @@ namespace EOM.TSHotelManager.Application return positionRepository.Update(a => new Position() { delete_mk = position.delete_mk, - datachg_usr = LoginInfo.WorkerNo, + datachg_usr = string.Empty, datachg_date = DateTime.Now }, a => a.position_no == position.position_no); } @@ -256,7 +255,7 @@ namespace EOM.TSHotelManager.Application return positionRepository.Update(a => new Position() { position_name = position.position_name, - datachg_usr = LoginInfo.WorkerNo, + datachg_usr = string.Empty, datachg_date = DateTime.Now }, a => a.position_no == position.position_no); } @@ -314,7 +313,7 @@ namespace EOM.TSHotelManager.Application return nationRepository.Update(a => new Nation() { delete_mk = nation.delete_mk, - datachg_usr = LoginInfo.WorkerNo, + datachg_usr = string.Empty, datachg_date = DateTime.Now }, a => a.nation_no.Equals(nation.nation_no)); @@ -330,7 +329,7 @@ namespace EOM.TSHotelManager.Application return nationRepository.Update(a => new Nation() { nation_name = nation.nation_name, - datachg_usr = LoginInfo.WorkerNo, + datachg_usr = string.Empty, datachg_date = DateTime.Now }, a => a.nation_no.Equals(nation.nation_no)); } @@ -388,7 +387,7 @@ namespace EOM.TSHotelManager.Application return educationRepository.Update(a => new Education() { delete_mk = education.delete_mk, - datachg_usr = LoginInfo.WorkerNo, + datachg_usr = string.Empty, datachg_date = DateTime.Now }, a => a.education_no == education.education_no); } @@ -403,7 +402,7 @@ namespace EOM.TSHotelManager.Application return educationRepository.Update(a => new Education() { education_name = education.education_name, - datachg_usr = LoginInfo.WorkerNo, + datachg_usr = string.Empty, datachg_date = DateTime.Now }, a => a.education_no == education.education_no); } @@ -484,7 +483,7 @@ namespace EOM.TSHotelManager.Application return deptRepository.Update(a => new Dept() { delete_mk = 1, - datachg_usr = LoginInfo.WorkerNo, + datachg_usr = string.Empty, datachg_date = DateTime.Now }, a => a.dept_no == dept.dept_no); } @@ -502,7 +501,7 @@ namespace EOM.TSHotelManager.Application dept_desc = dept.dept_desc, dept_leader = dept.dept_leader, dept_parent = dept.dept_parent, - datachg_usr = LoginInfo.WorkerNo, + datachg_usr = string.Empty, datachg_date = DateTime.Now }, a => a.dept_no == dept.dept_no); } @@ -565,7 +564,7 @@ namespace EOM.TSHotelManager.Application return custoTypeRepository.Update(a => new CustoType() { delete_mk = 1, - datachg_usr = AdminInfo.Account, + datachg_usr = string.Empty, datachg_date = DateTime.Now }, a => a.UserType == custoType.UserType); } @@ -580,7 +579,7 @@ namespace EOM.TSHotelManager.Application return custoTypeRepository.Update(a => new CustoType() { TypeName = custoType.TypeName, - datachg_usr = AdminInfo.Account, + datachg_usr = string.Empty, datachg_date = DateTime.Now }, a => a.UserType == custoType.UserType); } @@ -643,7 +642,7 @@ namespace EOM.TSHotelManager.Application return passPortTypeRepository.Update(a => new PassPortType() { delete_mk = 1, - datachg_usr = AdminInfo.Account, + datachg_usr = string.Empty, datachg_date = DateTime.Now }, a => a.PassportId == portType.PassportId); } @@ -658,7 +657,7 @@ namespace EOM.TSHotelManager.Application return passPortTypeRepository.Update(a => new PassPortType() { PassportName = portType.PassportName, - datachg_usr = AdminInfo.Account, + datachg_usr = string.Empty, datachg_date = DateTime.Now }, a => a.PassportId == portType.PassportId); } @@ -721,7 +720,7 @@ namespace EOM.TSHotelManager.Application return goodbadTypeRepository.Update(a => new GBType() { delete_mk = 1, - datachg_usr = AdminInfo.Account, + datachg_usr = string.Empty, datachg_date = DateTime.Now }, a => a.GBTypeId == gBType.GBTypeId); } @@ -736,7 +735,7 @@ namespace EOM.TSHotelManager.Application return goodbadTypeRepository.Update(a => new GBType() { GBName = gBType.GBName, - datachg_usr = AdminInfo.Account, + datachg_usr = string.Empty, datachg_date = DateTime.Now }, a => a.GBTypeId == gBType.GBTypeId); } diff --git a/EOM.TSHotelManager.Application/Zero/VipRule/VipRuleAppService.cs b/EOM.TSHotelManager.Application/Zero/VipRule/VipRuleAppService.cs index 447df48..52ece9d 100644 --- a/EOM.TSHotelManager.Application/Zero/VipRule/VipRuleAppService.cs +++ b/EOM.TSHotelManager.Application/Zero/VipRule/VipRuleAppService.cs @@ -21,7 +21,6 @@ *SOFTWARE. * */ -using EOM.TSHotelManager.Common; using EOM.TSHotelManager.Core; using EOM.TSHotelManager.EntityFramework; using System; @@ -114,7 +113,7 @@ namespace EOM.TSHotelManager.Application rule_value = vipRule.rule_value, type_id = vipRule.type_id, delete_mk = 0, - datains_usr = AdminInfo.Account, + datains_usr = string.Empty, datains_date = DateTime.Now }); } @@ -129,7 +128,7 @@ namespace EOM.TSHotelManager.Application return vipRuleRepository.Update(a => new VipRule { delete_mk = 1, - datachg_usr = AdminInfo.Account, + datachg_usr = string.Empty, datachg_date = DateTime.Now },a => a.rule_id == vipRule.rule_id); } @@ -146,7 +145,7 @@ namespace EOM.TSHotelManager.Application rule_name = vipRule.rule_name, rule_value = vipRule.rule_value, delete_mk = vipRule.delete_mk, - datachg_usr = AdminInfo.Account, + datachg_usr = string.Empty, datachg_date = DateTime.Now }, a => a.rule_id == vipRule.rule_id); } diff --git a/EOM.TSHotelManager.Common/EOM.TSHotelManager.Common.csproj b/EOM.TSHotelManager.Common/EOM.TSHotelManager.Common.csproj deleted file mode 100644 index 93cb6cb..0000000 --- a/EOM.TSHotelManager.Common/EOM.TSHotelManager.Common.csproj +++ /dev/null @@ -1,17 +0,0 @@ - - - - net6.0 - enable - enable - - - - - - - - - - - diff --git a/EOM.TSHotelManager.Common/HttpHelper.cs b/EOM.TSHotelManager.Common/HttpHelper.cs deleted file mode 100644 index 9eb3d13..0000000 --- a/EOM.TSHotelManager.Common/HttpHelper.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Text; -using System.Threading.Tasks; - -namespace EOM.TSHotelManager.Common -{ - /// - /// 文件上传帮助类 - /// - public class HttpHelper - { - #region 受限于打包插件的限制才放在这,个人开发时建议统一在App.Config进行配置 - - /// - /// 数据库配置连接 - /// - public const string? mysqlString = "server = localhost; user id = softuser; password = .; database = tshoteldb;"; - public const string? pgsqlString = ""; - /// - /// 照片文件配置URL - /// - public const string? baseUrl = ""; - /// - /// 上传照片URL - /// - public const string? postUrl = ""; - - #endregion - - /// - /// WebClient上传文件至服务器 - /// - /// 文件名,全路径格式 - /// 服务器文件夹路径 - public static string? UpLoadFile(string? fileNamePath, string? uriString) - { - // 创建WebClient实例 - WebClient myWebClient = new WebClient(); - byte[] responseData = myWebClient.UploadFile(uriString, "POST", fileNamePath);//得到返回的内容 - String str = Encoding.UTF8.GetString(responseData);//得到的目的字符串 - - return str.Replace('\"', ' '); - } - } -} diff --git a/EOM.TSHotelManager.Common/RecordHelper/AdminInfo.cs b/EOM.TSHotelManager.Common/RecordHelper/AdminInfo.cs deleted file mode 100644 index f1f5c23..0000000 --- a/EOM.TSHotelManager.Common/RecordHelper/AdminInfo.cs +++ /dev/null @@ -1,66 +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 System.Linq; -using System.Net; - -namespace EOM.TSHotelManager.Common -{ - /// - /// 管理员信息静态类 - /// - public class AdminInfo - { - /// - /// 存储当前超管账号 - /// - public static string? Account = ""; - - /// - /// 存储当前超管类型 - /// - public static string? Type = ""; - - /// - /// 存储当前超管用户组 - /// - public static string? Group = ""; - - /// - /// 存储当前超管名称 - /// - public static string? Name = ""; - - /// - /// 是否为超管 - /// - public static bool isAdmin; - - /// - /// 存储当前软件版本 - /// - public static string? SoftwareVersion = ""; - - } -} diff --git a/EOM.TSHotelManager.Common/RecordHelper/IOperationlogService.cs b/EOM.TSHotelManager.Common/RecordHelper/IOperationlogService.cs deleted file mode 100644 index 439d3da..0000000 --- a/EOM.TSHotelManager.Common/RecordHelper/IOperationlogService.cs +++ /dev/null @@ -1,46 +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 System.Collections.Generic; - -namespace EOM.TSHotelManager.Common -{ - /// - /// 操作日志数据访问层 - /// - public interface IOperationlogService - { - /// - /// 添加操作日志 - /// - /// - /// - bool InsertOperationLog(OperationLog opr); - - /// - /// 查询所有操作日志 - /// - /// - List SelectOperationlogAll(); - } -} \ No newline at end of file diff --git a/EOM.TSHotelManager.Common/RecordHelper/LoginInfo.cs b/EOM.TSHotelManager.Common/RecordHelper/LoginInfo.cs deleted file mode 100644 index 9f7814e..0000000 --- a/EOM.TSHotelManager.Common/RecordHelper/LoginInfo.cs +++ /dev/null @@ -1,57 +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 System.Linq; -using System.Net; - -namespace EOM.TSHotelManager.Common -{ - public static class LoginInfo - { - /// - /// 存储当前员工编号 - /// - public static string? WorkerNo = ""; - - /// - /// 存储当前员工姓名 - /// - public static string? WorkerName = ""; - - /// - /// 存储当前员工职位 - /// - public static string? WorkerPosition = ""; - - /// - /// 存储当前员工部门 - /// - public static string? WorkerClub = ""; - - /// - /// 存储当前软件版本 - /// - public static string? SoftwareVersion = ""; - } -} diff --git a/EOM.TSHotelManager.Common/RecordHelper/RecordHelper.cs b/EOM.TSHotelManager.Common/RecordHelper/RecordHelper.cs deleted file mode 100644 index d82852b..0000000 --- a/EOM.TSHotelManager.Common/RecordHelper/RecordHelper.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Net; - -namespace EOM.TSHotelManager.Common -{ - /// - /// 日志记录助手 - /// - public class RecordHelper - { - private readonly IOperationlogService operationlogService; - - public RecordHelper(IOperationlogService operationlogService) - { - this.operationlogService = operationlogService; - } - - /// - /// 记录信息集合 - /// - /// - /// - public void Record(string? OperationLog, int level) - { - var logDetail = new OperationLog - { - OperationTime = DateTime.Now, - LogContent = OperationLog, - OperationAccount = LoginInfo.WorkerNo + AdminInfo.Account, - OperationLevel = level == 1 ? RecordLevel.Normal : level == 2 ? RecordLevel.Warning : RecordLevel.Danger, - SoftwareVersion = AdminInfo.SoftwareVersion + LoginInfo.SoftwareVersion, - delete_mk = 0, - datains_usr = AdminInfo.Account + LoginInfo.WorkerNo, - datains_date = DateTime.Now - }; - operationlogService.InsertOperationLog(logDetail); - } - - } -} diff --git a/EOM.TSHotelManager.Common/Util/ApplicationVersionUtil.cs b/EOM.TSHotelManager.Common/Util/ApplicationVersionUtil.cs deleted file mode 100644 index 0e1ed91..0000000 --- a/EOM.TSHotelManager.Common/Util/ApplicationVersionUtil.cs +++ /dev/null @@ -1,82 +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.TSHotelManager.EntityFramework; -using SqlSugar; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace EOM.TSHotelManager.Common -{ - /// - /// 程序版本号检测 - /// - public class ApplicationVersionUtil - { - /// - /// 应用检测 - /// - private readonly PgRepository applicationRepository; - - /// - /// - /// - /// - public ApplicationVersionUtil(PgRepository applicationRepository) - { - this.applicationRepository = applicationRepository; - } - - /// - /// 检测版本号 - /// - /// - public applicationversion CheckBaseVersion() - { - return applicationRepository.GetSingle(a => a.base_versionId == 1); - } - } - - /// - /// - /// - [SqlSugar.SugarTable("applicationversion")] - public class applicationversion - { - /// - /// 流水号 - /// - [SugarColumn(ColumnName = "base_versionId")]//数据库是自增才配自增 - public int base_versionId { get; set; } - - /// - /// 版本号 - /// - [SugarColumn(ColumnName = "base_version")]//数据库是自增才配自增 - public string? base_version { get; set; } - } -} diff --git a/EOM.TSHotelManager.Common/Util/IDGenerationUtil.cs b/EOM.TSHotelManager.Common/Util/IDGenerationUtil.cs deleted file mode 100644 index c57d996..0000000 --- a/EOM.TSHotelManager.Common/Util/IDGenerationUtil.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace EOM.TSHotelManager.Common -{ - public static class IDGenerationUtil - { - //锁对象 - private static readonly object lockTimeCode = new object(); - - private static Dictionary? dic = null; - - /// - /// 批量获取流水号 - /// - /// 流水号前缀 - /// 填充位数,e.g 3为 000 - /// 流水号数量 - /// 分隔符 - /// 流水号集合 - public static List GetListNewId(string? preCode = null, int fillCount = 0, int pCount = 1, string? separatorChar = null) - { - List list = new List(); - int num = 1; - StringBuilder sb = new StringBuilder(); - for (int i = 0; i < pCount; i++) - { - sb.Clear(); - sb.Append(preCode); - DateTime now = DateTime.Now; - string? text = now.ToString("yyyyMMddms"); - sb.Append(text); - sb.Append(separatorChar); - lock (lockTimeCode) - { - if (!dic.ContainsKey(text)) - { - if (dic.Count > 10) - { - dic.Clear(); - } - num++; - dic.Add(text, 1); - } - else - { - if (dic[text] > 8998) - { - while (true) - { - string? a = text; - now = DateTime.Now; - if (a == now.ToString("yyyyMMddms")) - { - Thread.Sleep(0); - continue; - } - break; - } - goto end_IL_004e; - } - Dictionary dictionary = dic; - string? key = text; - dictionary[key]++; - num = dic[text]; - } - string? value = num.ToString().PadLeft(fillCount, '0'); - sb.Append(value); - list.Add(sb.ToString()); - end_IL_004e:; - } - } - return list; - } - - } -} diff --git a/EOM.TSHotelManager.Core/Util/ApplicationVersion.cs b/EOM.TSHotelManager.Core/Util/ApplicationVersion.cs new file mode 100644 index 0000000..71c9f46 --- /dev/null +++ b/EOM.TSHotelManager.Core/Util/ApplicationVersion.cs @@ -0,0 +1,28 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EOM.TSHotelManager.Core +{ + /// + /// 应用版本 + /// + [SqlSugar.SugarTable("applicationversion")] + public class Applicationversion + { + /// + /// 流水号 + /// + [SugarColumn(ColumnName = "base_versionId")]//数据库是自增才配自增 + public int base_versionId { get; set; } + + /// + /// 版本号 + /// + [SugarColumn(ColumnName = "base_version")]//数据库是自增才配自增 + public string? base_version { get; set; } + } +} diff --git a/EOM.TSHotelManager.Common/Util/IDCardUtil.cs b/EOM.TSHotelManager.Core/Util/Cardcodes.cs similarity index 33% rename from EOM.TSHotelManager.Common/Util/IDCardUtil.cs rename to EOM.TSHotelManager.Core/Util/Cardcodes.cs index bcb5d8e..2b8f9bd 100644 --- a/EOM.TSHotelManager.Common/Util/IDCardUtil.cs +++ b/EOM.TSHotelManager.Core/Util/Cardcodes.cs @@ -1,81 +1,21 @@ -/* - * 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.TSHotelManager.EntityFramework; -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace EOM.TSHotelManager.Common +namespace EOM.TSHotelManager.Core { /// - /// 身份证号码工具类 + /// 卡片代码 /// - public class IDCardUtil + [SqlSugar.SugarTable("cardcodes")] + public class Cardcodes { /// - /// 身份证号 - /// - private readonly PgRepository cardCodeRepository; - - /// - /// + /// 卡片代码 /// - /// - public IDCardUtil(PgRepository cardCodeRepository) - { - this.cardCodeRepository = cardCodeRepository; - } - - /// - /// 查询地区码 - /// - /// - /// - public string? SelectCardCode(string? identityCard) - { - var cardid = identityCard.Substring(0, 6).ToString(); - cardcodes cardcodes = new cardcodes(); - var pcd = string.Empty; - cardcodes = cardCodeRepository.GetSingle(a => a.bm == cardid); - pcd = cardcodes == null ? "" : string.Join(",", cardcodes.Province + cardcodes.City + cardcodes.District); - return pcd; - } - - } - - /// - /// - /// - public class cardcodes - { - /// - /// - /// - public cardcodes() + public Cardcodes() { } @@ -108,7 +48,5 @@ namespace EOM.TSHotelManager.Common /// 地区识别码 /// public System.String bm { get { return this._bm; } set { this._bm = value; } } - } - } diff --git a/EOM.TSHotelManager.Common/RecordHelper/OperationLog.cs b/EOM.TSHotelManager.Core/Util/OperationLog.cs similarity index 99% rename from EOM.TSHotelManager.Common/RecordHelper/OperationLog.cs rename to EOM.TSHotelManager.Core/Util/OperationLog.cs index 0046480..911dc67 100644 --- a/EOM.TSHotelManager.Common/RecordHelper/OperationLog.cs +++ b/EOM.TSHotelManager.Core/Util/OperationLog.cs @@ -26,7 +26,7 @@ using System; using System.Linq; using System.Net; -namespace EOM.TSHotelManager.Common +namespace EOM.TSHotelManager.Core { /// /// 日志等级 diff --git a/EOM.TSHotelManager.EntityFramework/AppSettingsJson.cs b/EOM.TSHotelManager.EntityFramework/AppSettingsJson.cs index ce283c5..00c80dd 100644 --- a/EOM.TSHotelManager.EntityFramework/AppSettingsJson.cs +++ b/EOM.TSHotelManager.EntityFramework/AppSettingsJson.cs @@ -21,7 +21,7 @@ namespace EOM.TSHotelManager.EntityFramework string? applicationExeDirectory = ApplicationExeDirectory(); var builder = new ConfigurationBuilder() .SetBasePath(applicationExeDirectory) - .AddJsonFile("dbsettings.json"); + .AddJsonFile("appsettings.json"); return builder.Build(); } } diff --git a/EOM.TSHotelManager.EntityFramework/EOM.TSHotelManager.EntityFramework.csproj b/EOM.TSHotelManager.EntityFramework/EOM.TSHotelManager.EntityFramework.csproj index 897bc58..168d52e 100644 --- a/EOM.TSHotelManager.EntityFramework/EOM.TSHotelManager.EntityFramework.csproj +++ b/EOM.TSHotelManager.EntityFramework/EOM.TSHotelManager.EntityFramework.csproj @@ -6,16 +6,6 @@ enable - - - - - - - PreserveNewest - - - diff --git a/EOM.TSHotelManager.EntityFramework/dbsettings.json b/EOM.TSHotelManager.EntityFramework/dbsettings.json deleted file mode 100644 index 96ef3f1..0000000 --- a/EOM.TSHotelManager.EntityFramework/dbsettings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "ConnectionStrings": { - "PgSqlConnectStr": "PORT=5630;DATABASE=tshoteldb;HOST=localhost;PASSWORD=yjj0720.;USER ID=sqw" - } -} diff --git a/EOM.TSHotelManager.Web.sln b/EOM.TSHotelManager.Web.sln index 2ec5821..957815c 100644 --- a/EOM.TSHotelManager.Web.sln +++ b/EOM.TSHotelManager.Web.sln @@ -13,8 +13,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOM.TSHotelManager.WebApi", EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Library", "Library\Library.csproj", "{F27A7D1A-6468-4689-8B83-53CE3B7B0E17}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EOM.TSHotelManager.Common", "EOM.TSHotelManager.Common\EOM.TSHotelManager.Common.csproj", "{D3506829-1B8B-4DC7-A44A-DE672A90DE05}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -41,10 +39,6 @@ Global {F27A7D1A-6468-4689-8B83-53CE3B7B0E17}.Debug|Any CPU.Build.0 = Debug|Any CPU {F27A7D1A-6468-4689-8B83-53CE3B7B0E17}.Release|Any CPU.ActiveCfg = Release|Any CPU {F27A7D1A-6468-4689-8B83-53CE3B7B0E17}.Release|Any CPU.Build.0 = Release|Any CPU - {D3506829-1B8B-4DC7-A44A-DE672A90DE05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D3506829-1B8B-4DC7-A44A-DE672A90DE05}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D3506829-1B8B-4DC7-A44A-DE672A90DE05}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D3506829-1B8B-4DC7-A44A-DE672A90DE05}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/EOM.TSHotelManager.WebApi/Controllers/Business/Customer/CustoController.cs b/EOM.TSHotelManager.WebApi/Controllers/Business/Customer/CustoController.cs index 5325052..9bc3e8e 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Business/Customer/CustoController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Business/Customer/CustoController.cs @@ -53,8 +53,8 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// /// - [HttpPost] - public bool UpdCustomerTypeByCustoNo([FromBody] string? custoNo, int userType) + [HttpGet] + public bool UpdCustomerTypeByCustoNo([FromQuery]string custoNo,int userType) { return customerService.UpdCustomerTypeByCustoNo(custoNo, userType); } diff --git a/EOM.TSHotelManager.WebApi/Controllers/Business/Room/RoomTypeController.cs b/EOM.TSHotelManager.WebApi/Controllers/Business/Room/RoomTypeController.cs new file mode 100644 index 0000000..ca25303 --- /dev/null +++ b/EOM.TSHotelManager.WebApi/Controllers/Business/Room/RoomTypeController.cs @@ -0,0 +1,50 @@ +using EOM.TSHotelManager.Application; +using EOM.TSHotelManager.Core; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.WebApi.Controllers +{ + /// + /// 房间类型控制器 + /// + public class RoomTypeController : ControllerBase + { + /// + /// 房间类型 + /// + private readonly IRoomTypeService roomTypeService; + + /// + /// + /// + /// + public RoomTypeController(IRoomTypeService roomTypeService) + { + this.roomTypeService = roomTypeService; + } + + /// + /// 获取所有房间类型 + /// + /// + [HttpGet] + public List SelectRoomTypesAll() + { + return roomTypeService.SelectRoomTypesAll(); + } + + /// + /// 根据房间编号查询房间类型名称 + /// + /// + /// + [HttpGet] + public RoomType SelectRoomTypeByRoomNo([FromQuery]string? no) + { + return roomTypeService.SelectRoomTypeByRoomNo(no); + } + + } +} diff --git a/EOM.TSHotelManager.WebApi/Controllers/Util/UtilController.cs b/EOM.TSHotelManager.WebApi/Controllers/Util/UtilController.cs new file mode 100644 index 0000000..15ef882 --- /dev/null +++ b/EOM.TSHotelManager.WebApi/Controllers/Util/UtilController.cs @@ -0,0 +1,70 @@ +using EOM.TSHotelManager.Application; +using EOM.TSHotelManager.Core; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.WebApi.Controllers +{ + /// + /// 工具类控制器 + /// + public class UtilController : ControllerBase + { + /// + /// 工具 + /// + private readonly IUtilService utilService; + + /// + /// + /// + /// + public UtilController(IUtilService utilService) + { + this.utilService = utilService; + } + + /// + /// 查询身份证号码 + /// + /// + /// + [HttpGet] + public string SelectCardCode([FromQuery]string identityCard) + { + return utilService.SelectCardCode(identityCard); + } + + /// + /// 检测版本号 + /// + /// + [HttpGet] + public Applicationversion CheckBaseVersion() + { + return utilService.CheckBaseVersion(); + } + + /// + /// 添加操作日志 + /// + /// + /// + [HttpPost] + public bool InsertOperationLog([FromBody]OperationLog opr) + { + return utilService.InsertOperationLog(opr); + } + + /// + /// 查询所有操作日志 + /// + /// + [HttpGet] + public List SelectOperationlogAll() + { + return utilService.SelectOperationlogAll(); + } + } +} diff --git a/EOM.TSHotelManager.WebApi/Controllers/Worker/WorkerController.cs b/EOM.TSHotelManager.WebApi/Controllers/Worker/WorkerController.cs index d527b42..8a9c042 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Worker/WorkerController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Worker/WorkerController.cs @@ -65,7 +65,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool AddWorker(Worker worker) + public bool AddWorker([FromBody]Worker worker) { return workerService.AddWorker(worker); } @@ -105,13 +105,12 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// 根据员工编号和密码修改密码 /// - /// - /// + /// /// [HttpPost] - public bool UpdWorkerPwdByWorkNo([FromBody]string? workId, string? workPwd) + public bool UpdWorkerPwdByWorkNo([FromBody]Worker worker) { - return workerService.UpdWorkerPwdByWorkNo(workId, workPwd); + return workerService.UpdWorkerPwdByWorkNo(worker); } } } diff --git a/EOM.TSHotelManager.WebApi/Controllers/Zero/Admin/AdminController.cs b/EOM.TSHotelManager.WebApi/Controllers/Zero/Admin/AdminController.cs index c8103e0..11b8e75 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Zero/Admin/AdminController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Zero/Admin/AdminController.cs @@ -1,5 +1,7 @@ using EOM.TSHotelManager.Application; using EOM.TSHotelManager.Core; +using EOM.TSHotelManager.WebApi.Filter; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; diff --git a/EOM.TSHotelManager.WebApi/EOM.TSHotelManager.WebApi.xml b/EOM.TSHotelManager.WebApi/EOM.TSHotelManager.WebApi.xml index 46ab6b8..776d8d7 100644 --- a/EOM.TSHotelManager.WebApi/EOM.TSHotelManager.WebApi.xml +++ b/EOM.TSHotelManager.WebApi/EOM.TSHotelManager.WebApi.xml @@ -307,6 +307,35 @@ + + + 房间类型控制器 + + + + + 房间类型 + + + + + + + + + + + 获取所有房间类型 + + + + + + 根据房间编号查询房间类型名称 + + + + 商品消费控制器 @@ -566,6 +595,48 @@ + + + 工具类控制器 + + + + + 工具 + + + + + + + + + + + 查询身份证号码 + + + + + + + 检测版本号 + + + + + + 添加操作日志 + + + + + + + 查询所有操作日志 + + + 员工打卡控制器 @@ -778,12 +849,11 @@ - + 根据员工编号和密码修改密码 - - + @@ -1319,6 +1389,30 @@ + + + Action方法调用之前执行 + + + + + + Action 方法调用后,Result 方法调用前执行 + + + + + + Result 方法调用前执行 + + + + + + Result 方法调用后执行 + + + diff --git a/EOM.TSHotelManager.WebApi/Filter/ActionFilter.cs b/EOM.TSHotelManager.WebApi/Filter/ActionFilter.cs new file mode 100644 index 0000000..1bb12fe --- /dev/null +++ b/EOM.TSHotelManager.WebApi/Filter/ActionFilter.cs @@ -0,0 +1,59 @@ +using Microsoft.AspNetCore.Mvc.Controllers; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Filters; +using System; + +namespace EOM.TSHotelManager.WebApi.Filter +{ + public class ActionFilter : ActionFilterAttribute + { + /// + /// Action方法调用之前执行 + /// + /// + public override void OnActionExecuting(ActionExecutingContext context) + { + var descriptor = context.ActionDescriptor as ControllerActionDescriptor; + + string param = string.Empty; + string globalParam = string.Empty; + + foreach (var arg in context.ActionArguments) + { + string value = Newtonsoft.Json.JsonConvert.SerializeObject(arg.Value); + param += $"{arg.Key} : {value} \r\n"; + globalParam += value; + } + Console.WriteLine($"webapi方法名称:【{descriptor.ActionName}】接收到参数为:{param}"); + } + + /// + /// Action 方法调用后,Result 方法调用前执行 + /// + /// + public override void OnActionExecuted(ActionExecutedContext context) { } + + /// + /// Result 方法调用前执行 + /// + /// + public override void OnResultExecuting(ResultExecutingContext context) { } + + /// + /// Result 方法调用后执行 + /// + /// + public override void OnResultExecuted(ResultExecutedContext context) + { + var descriptor = context.ActionDescriptor as ControllerActionDescriptor; + + string result = string.Empty; + if (context.Result is ObjectResult) + { + result = Newtonsoft.Json.JsonConvert.SerializeObject(((ObjectResult)context.Result).Value); + } + + Console.WriteLine($"webapi方法名称【{descriptor.ActionName}】执行的返回值 : {result}"); + } + } +} diff --git a/EOM.TSHotelManager.WebApi/Startup.cs b/EOM.TSHotelManager.WebApi/Startup.cs index 7cf2a6d..da3b6d0 100644 --- a/EOM.TSHotelManager.WebApi/Startup.cs +++ b/EOM.TSHotelManager.WebApi/Startup.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; +using System.Text; using System.Threading.Tasks; using Autofac; using EOM.Encrypt; @@ -64,10 +65,11 @@ namespace EOM.TSHotelManager.WebApi Url = new Uri("https://www.oscode.top/") } }); + //ȡͬ¸ֲxmlעͣһȡҵ߼㡢ʵͽӿڲ㼴 - s.IncludeXmlComments("bin/Debug/net6.0/EOM.TSHotelManager.Application.xml"); - s.IncludeXmlComments("bin/Debug/net6.0/EOM.TSHotelManager.Core.xml"); - s.IncludeXmlComments("bin/Debug/net6.0/EOM.TSHotelManager.WebApi.xml"); + s.IncludeXmlComments(AppContext.BaseDirectory+"EOM.TSHotelManager.Application.xml"); + s.IncludeXmlComments(AppContext.BaseDirectory+"EOM.TSHotelManager.Core.xml"); + s.IncludeXmlComments(AppContext.BaseDirectory+"EOM.TSHotelManager.WebApi.xml"); #endregion #region ʽʱ @@ -98,7 +100,6 @@ namespace EOM.TSHotelManager.WebApi endpoints.MapControllers(); }); - #region ʹSwaggerм app.UseSwagger(); app.UseSwaggerUI(s => diff --git a/EOM.TSHotelManager.WebApi/appsettings.json b/EOM.TSHotelManager.WebApi/appsettings.json index d9d9a9b..d458644 100644 --- a/EOM.TSHotelManager.WebApi/appsettings.json +++ b/EOM.TSHotelManager.WebApi/appsettings.json @@ -6,5 +6,8 @@ "Microsoft.Hosting.Lifetime": "Information" } }, + "ConnectionStrings": { + "PgSqlConnectStr": "PORT=5630;DATABASE=tshoteldb;HOST=.;PASSWORD=.;USER ID=postgres" + }, "AllowedHosts": "*" } -- Gitee From 25adff21e624b760c7f52a821771877fb096684d Mon Sep 17 00:00:00 2001 From: Chunkit Yeung Date: Sat, 28 Jan 2023 21:42:38 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=83=A8=E5=88=86?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Business/Customer/CustoService.cs | 45 +++++++++++----- .../Business/Customer/ICustoService.cs | 2 +- .../Business/Customer/OSelectCustoAllDto.cs | 2 +- .../Business/Customer/SelectCustoAll.cs | 53 +++++++++++++++++++ .../Business/Reser/IReserService.cs | 4 +- .../Business/Reser/ReserService.cs | 6 +-- .../Business/Spend/ISpendService.cs | 7 ++- .../Business/Spend/SpendService.cs | 14 ++--- .../Util/IUtilService.cs | 2 +- .../Util/UtilService.cs | 2 +- .../Worker/Picture/WorkerPicService.cs | 10 ++-- .../Zero/Base/BaseService.cs | 4 ++ .../Zero/Notice/INoticeService.cs | 7 +++ .../Zero/Notice/NoticeService.cs | 6 +-- EOM.TSHotelManager.Core/Business/Cash/Cash.cs | 2 +- .../Business/Customer/Custo.cs | 13 +++-- .../Business/Customer/CustoType.cs | 4 +- .../Business/Customer/PassPortType.cs | 4 +- .../Business/Customer/SexType.cs | 4 +- .../Business/Reser/Reser.cs | 8 +-- EOM.TSHotelManager.Core/Business/Room/Room.cs | 4 +- .../Business/Room/RoomState.cs | 4 +- .../Business/Room/RoomType.cs | 4 +- .../Business/Sellthing/SellThing.cs | 4 +- .../Business/Spend/Spend.cs | 6 +-- EOM.TSHotelManager.Core/Business/Wti/Wti.cs | 8 +-- .../EOM.TSHotelManager.Core.csproj | 2 +- EOM.TSHotelManager.Core/Sys/NavBar/NavBar.cs | 4 +- EOM.TSHotelManager.Core/Util/OperationLog.cs | 6 +-- EOM.TSHotelManager.Core/Worker/Worker.cs | 4 +- EOM.TSHotelManager.Core/Worker/WorkerCheck.cs | 4 +- .../Worker/WorkerGoodBad.cs | 6 +-- .../Worker/WorkerHistory.cs | 8 +-- EOM.TSHotelManager.Core/Zero/AdminType.cs | 4 +- EOM.TSHotelManager.Core/Zero/CheckInfo.cs | 4 +- EOM.TSHotelManager.Core/Zero/Dept.cs | 17 ++++-- EOM.TSHotelManager.Core/Zero/Education.cs | 4 +- EOM.TSHotelManager.Core/Zero/Module.cs | 4 +- EOM.TSHotelManager.Core/Zero/Notice.cs | 6 +-- EOM.TSHotelManager.Core/Zero/VipRule.cs | 4 +- EOM.TSHotelManager.Core/Zero/position.cs | 4 +- .../EOM.TSHotelManager.EntityFramework.csproj | 4 +- .../Business/Customer/CustoController.cs | 4 +- .../Business/Reser/ReserController.cs | 6 +-- .../Business/Room/RoomController.cs | 4 +- .../Business/Sellthing/SellthingController.cs | 8 +-- .../Business/Spend/SpendController.cs | 14 +++-- .../{UtilController.cs => AppController.cs} | 8 +-- .../Controllers/Zero/Admin/AdminController.cs | 4 +- .../Zero/Module/ModuleController.cs | 4 +- .../Zero/Notice/NoticeController.cs | 11 ++++ .../EOM.TSHotelManager.WebApi.csproj | 4 +- .../EOM.TSHotelManager.WebApi.xml | 33 +++++++----- EOM.TSHotelManager.WebApi/Startup.cs | 20 +++++-- 54 files changed, 281 insertions(+), 153 deletions(-) create mode 100644 EOM.TSHotelManager.Application/Business/Customer/SelectCustoAll.cs rename EOM.TSHotelManager.WebApi/Controllers/Util/{UtilController.cs => AppController.cs} (87%) diff --git a/EOM.TSHotelManager.Application/Business/Customer/CustoService.cs b/EOM.TSHotelManager.Application/Business/Customer/CustoService.cs index 70ae768..88a4ecb 100644 --- a/EOM.TSHotelManager.Application/Business/Customer/CustoService.cs +++ b/EOM.TSHotelManager.Application/Business/Customer/CustoService.cs @@ -30,6 +30,7 @@ using EOM.Encrypt; using EOM.TSHotelManager.Core; using EOM.TSHotelManager.EntityFramework; using Npgsql; +using SqlSugar; namespace EOM.TSHotelManager.Application { @@ -95,8 +96,8 @@ namespace EOM.TSHotelManager.Application /// public bool InsertCustomerInfo(Custo custo) { - string? NewID = encrypt.Encryption(custo.CustoID); - string? NewTel = encrypt.Encryption(custo.CustoTel); + string? NewID = encrypt.Encryption(custo.CustoID,EncryptionLevel.Enhanced); + string? NewTel = encrypt.Encryption(custo.CustoTel, EncryptionLevel.Enhanced); custo.CustoID = NewID; custo.CustoTel = NewTel; return custoRepository.Insert(custo); @@ -154,11 +155,11 @@ namespace EOM.TSHotelManager.Application var listDates = new List(); listSource.ForEach(source => { - var year = source.SpendTime.ToString("yyyy"); + var year = Convert.ToDateTime(source.SpendTime).ToString("yyyy"); if (!custoSpends.Select(a => a.Years).ToList().Contains(year)) { - var startDate = new DateTime(source.SpendTime.Year, 1, 1, 0, 0, 0); - var endDate = new DateTime(source.SpendTime.Year, 12, 31, 23, 59, 59); + 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); custoSpends.Add(new CustoSpend { Years = year, @@ -175,12 +176,10 @@ namespace EOM.TSHotelManager.Application /// 查询所有客户信息 /// /// - public OSelectCustoAllDto SelectCustoAll(int? pageIndex,int? pageSize) + public OSelectCustoAllDto SelectCustoAll(SelectCustoAll selectCustoAll) { OSelectCustoAllDto oSelectCustoAllDto = new OSelectCustoAllDto(); - var count = 0; - //查询出所有性别类型 List sexTypes = new List(); sexTypes = sexTypeRepository.GetList(); @@ -193,13 +192,34 @@ namespace EOM.TSHotelManager.Application //查询出所有客户信息 List custos = new List(); - if (!pageIndex.IsNullOrEmpty() && !pageSize.IsNullOrEmpty()) + var where = Expressionable.Create(); + + where = where.And(a => a.delete_mk != 1); + + if (!selectCustoAll.CustoNo.IsNullOrEmpty()) + { + where = where.And(a => a.CustoNo.Contains(selectCustoAll.CustoNo)); + } + if (!selectCustoAll.CustoName.IsNullOrEmpty()) { - custos = custoRepository.AsQueryable().ToPageList((int)pageIndex, (int)pageSize,ref count).OrderBy(a => a.CustoNo).ToList(); + where = where.And(a => a.CustoName.Contains(selectCustoAll.CustoName)); + } + if (!selectCustoAll.delete_mk.IsNullOrEmpty()) + { + where = where.And(a => a.delete_mk == selectCustoAll.delete_mk); + } + + var count = 0; + if (!selectCustoAll.pageIndex.IsNullOrEmpty() && !selectCustoAll.pageSize.IsNullOrEmpty()) + { + custos = custoRepository.GetPageList(where.ToExpression(), + new PageModel { TotalCount = count, PageIndex = (int)selectCustoAll.pageIndex - 1, PageSize = (int)selectCustoAll.pageSize }); + count = custoRepository.Count(where.ToExpression()); } else { - custos = custoRepository.AsQueryable().OrderBy(a => a.CustoNo).ToList(); + custos = custoRepository.GetList(where.ToExpression()).OrderByDescending(a => a.datains_date).ToList(); + count = custos.Count(); } custos.ForEach(source => @@ -221,8 +241,9 @@ namespace EOM.TSHotelManager.Application source.typeName = string.IsNullOrEmpty(custoType.TypeName) ? "" : custoType.TypeName; }); - oSelectCustoAllDto.custos = custos; + oSelectCustoAllDto.listSource = custos; oSelectCustoAllDto.total = count; + return oSelectCustoAllDto; } diff --git a/EOM.TSHotelManager.Application/Business/Customer/ICustoService.cs b/EOM.TSHotelManager.Application/Business/Customer/ICustoService.cs index d1f758f..75b95ec 100644 --- a/EOM.TSHotelManager.Application/Business/Customer/ICustoService.cs +++ b/EOM.TSHotelManager.Application/Business/Customer/ICustoService.cs @@ -63,7 +63,7 @@ namespace EOM.TSHotelManager.Application /// 查询所有客户信息 /// /// - OSelectCustoAllDto SelectCustoAll(int? pageIndex, int? pageSize); + OSelectCustoAllDto SelectCustoAll(SelectCustoAll selectCustoAll); /// /// 查询指定客户信息 diff --git a/EOM.TSHotelManager.Application/Business/Customer/OSelectCustoAllDto.cs b/EOM.TSHotelManager.Application/Business/Customer/OSelectCustoAllDto.cs index 4b7ae13..d0242e2 100644 --- a/EOM.TSHotelManager.Application/Business/Customer/OSelectCustoAllDto.cs +++ b/EOM.TSHotelManager.Application/Business/Customer/OSelectCustoAllDto.cs @@ -34,7 +34,7 @@ namespace EOM.TSHotelManager.Application /// /// 数据源 /// - public List custos { get; set; } + public List listSource { get; set; } /// /// 总数 diff --git a/EOM.TSHotelManager.Application/Business/Customer/SelectCustoAll.cs b/EOM.TSHotelManager.Application/Business/Customer/SelectCustoAll.cs new file mode 100644 index 0000000..35e3dee --- /dev/null +++ b/EOM.TSHotelManager.Application/Business/Customer/SelectCustoAll.cs @@ -0,0 +1,53 @@ +/* + * 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? delete_mk { get; set; } + /// + /// 用户编号 + /// + public string? CustoNo { get; set; } + /// + /// 用户名字 + /// + public string? CustoName { get; set; } + /// + /// 当前页数 + /// + public int? pageIndex { get; set; } + /// + /// 当前页总数 + /// + public int? pageSize { get; set; } + } +} \ No newline at end of file diff --git a/EOM.TSHotelManager.Application/Business/Reser/IReserService.cs b/EOM.TSHotelManager.Application/Business/Reser/IReserService.cs index 9152c52..16293c3 100644 --- a/EOM.TSHotelManager.Application/Business/Reser/IReserService.cs +++ b/EOM.TSHotelManager.Application/Business/Reser/IReserService.cs @@ -48,9 +48,9 @@ namespace EOM.TSHotelManager.Application /// /// 删除预约信息 /// - /// + /// /// - bool DeleteReserInfo(string? rid); + bool DeleteReserInfo(Reser reser); /// /// 添加预约信息 diff --git a/EOM.TSHotelManager.Application/Business/Reser/ReserService.cs b/EOM.TSHotelManager.Application/Business/Reser/ReserService.cs index 1870d2d..a005a6a 100644 --- a/EOM.TSHotelManager.Application/Business/Reser/ReserService.cs +++ b/EOM.TSHotelManager.Application/Business/Reser/ReserService.cs @@ -90,16 +90,16 @@ namespace EOM.TSHotelManager.Application /// /// 删除预约信息 /// - /// + /// /// - public bool DeleteReserInfo(string? rid) + public bool DeleteReserInfo(Reser reser) { return reserRepository.Update(a => new Reser() { delete_mk = 1, datachg_usr = string.Empty, datachg_date = DateTime.Now - },a => a.ReserId == rid); + },a => a.ReserId == reser.ReserId); } diff --git a/EOM.TSHotelManager.Application/Business/Spend/ISpendService.cs b/EOM.TSHotelManager.Application/Business/Spend/ISpendService.cs index 4bd0852..7152fc8 100644 --- a/EOM.TSHotelManager.Application/Business/Spend/ISpendService.cs +++ b/EOM.TSHotelManager.Application/Business/Spend/ISpendService.cs @@ -22,6 +22,7 @@ * */ using EOM.TSHotelManager.Core; +using System; using System.Collections.Generic; namespace EOM.TSHotelManager.Application @@ -107,11 +108,9 @@ namespace EOM.TSHotelManager.Application /// /// 将转房前的未结算记录一同转移到新房间 /// - /// - /// - /// + /// /// - bool UpdateSpendInfoByRoomNo(List spends, string? newRoom, string? custoNo); + bool UpdateSpendInfoByRoomNo(Spend spend); #endregion /// diff --git a/EOM.TSHotelManager.Application/Business/Spend/SpendService.cs b/EOM.TSHotelManager.Application/Business/Spend/SpendService.cs index 87c8289..fc92da3 100644 --- a/EOM.TSHotelManager.Application/Business/Spend/SpendService.cs +++ b/EOM.TSHotelManager.Application/Business/Spend/SpendService.cs @@ -218,20 +218,20 @@ namespace EOM.TSHotelManager.Application /// /// 将转房前的未结算记录一同转移到新房间 /// - /// - /// - /// + /// /// - public bool UpdateSpendInfoByRoomNo(List spends, string? newRoom, string? custoNo) + public bool UpdateSpendInfoByRoomNo(Spend spend) { - var listSpendId = spends.Select(a => a.SpendName).Distinct().ToList(); + //查询当前用户未结算的数据 + 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();*/ return spendRepository.Update(a => new Spend() { - RoomNo = newRoom, + RoomNo = spend.RoomNo, datachg_usr = string.Empty, datachg_date = DateTime.Now - }, a => listSpendId.Contains(a.RoomNo) && a.CustoNo == custoNo && a.MoneyState.Equals(SpendConsts.UnSettle) && a.SpendTime >= DateTime.Now + }, a => listSpendId.Contains(a.SpendName) && a.CustoNo.Equals(spend.CustoNo) && a.SpendTime >= DateTime.Now && a.SpendTime <= DateTime.Now); diff --git a/EOM.TSHotelManager.Application/Util/IUtilService.cs b/EOM.TSHotelManager.Application/Util/IUtilService.cs index d830e4d..1495c51 100644 --- a/EOM.TSHotelManager.Application/Util/IUtilService.cs +++ b/EOM.TSHotelManager.Application/Util/IUtilService.cs @@ -30,7 +30,7 @@ namespace EOM.TSHotelManager.Application /// /// /// - bool InsertOperationLog(OperationLog opr); + bool AddLog(OperationLog opr); /// /// 查询所有操作日志 diff --git a/EOM.TSHotelManager.Application/Util/UtilService.cs b/EOM.TSHotelManager.Application/Util/UtilService.cs index 97be8dc..6c711d5 100644 --- a/EOM.TSHotelManager.Application/Util/UtilService.cs +++ b/EOM.TSHotelManager.Application/Util/UtilService.cs @@ -69,7 +69,7 @@ namespace EOM.TSHotelManager.Application /// /// /// - public bool InsertOperationLog(OperationLog opr) + public bool AddLog(OperationLog opr) { return operationLogRepository.Insert(opr); } diff --git a/EOM.TSHotelManager.Application/Worker/Picture/WorkerPicService.cs b/EOM.TSHotelManager.Application/Worker/Picture/WorkerPicService.cs index 0d9d3ea..ae42b8b 100644 --- a/EOM.TSHotelManager.Application/Worker/Picture/WorkerPicService.cs +++ b/EOM.TSHotelManager.Application/Worker/Picture/WorkerPicService.cs @@ -1,4 +1,5 @@ -using EOM.Encrypt; +using CK.Common; +using EOM.Encrypt; using EOM.TSHotelManager.Core; using EOM.TSHotelManager.EntityFramework; using System; @@ -47,11 +48,8 @@ namespace EOM.TSHotelManager.Application workerPicSource = workerPicRepository.GetSingle(a => a.WorkerId.Equals(workerPic.WorkerId)); - if (workerPicSource != null) - { - workerPicSource.Pic = workerPicSource == null || string.IsNullOrEmpty(workerPicSource.Pic) ? "" : workerPicSource.Pic; - } - + //workerPicSource.Pic = workerPicSource == null || string.IsNullOrEmpty(workerPicSource.Pic) ? "" : workerPicSource.Pic; + return workerPicSource; } /// diff --git a/EOM.TSHotelManager.Application/Zero/Base/BaseService.cs b/EOM.TSHotelManager.Application/Zero/Base/BaseService.cs index d80e129..b66e5ba 100644 --- a/EOM.TSHotelManager.Application/Zero/Base/BaseService.cs +++ b/EOM.TSHotelManager.Application/Zero/Base/BaseService.cs @@ -480,6 +480,10 @@ namespace EOM.TSHotelManager.Application /// public bool DelDept(Dept dept) { + if (dept.IsNullOrEmpty()) + { + return false; + } return deptRepository.Update(a => new Dept() { delete_mk = 1, diff --git a/EOM.TSHotelManager.Application/Zero/Notice/INoticeService.cs b/EOM.TSHotelManager.Application/Zero/Notice/INoticeService.cs index 4404560..24a4cfd 100644 --- a/EOM.TSHotelManager.Application/Zero/Notice/INoticeService.cs +++ b/EOM.TSHotelManager.Application/Zero/Notice/INoticeService.cs @@ -39,6 +39,13 @@ namespace EOM.TSHotelManager.Application List SelectNoticeAll(); #endregion + /// + /// 查询公告 + /// + /// + /// + Notice SelectNoticeByNoticeNo(string noticeId); + #region 上传公告信息 /// /// 上传公告信息 diff --git a/EOM.TSHotelManager.Application/Zero/Notice/NoticeService.cs b/EOM.TSHotelManager.Application/Zero/Notice/NoticeService.cs index 159e2ef..279c1af 100644 --- a/EOM.TSHotelManager.Application/Zero/Notice/NoticeService.cs +++ b/EOM.TSHotelManager.Application/Zero/Notice/NoticeService.cs @@ -75,12 +75,12 @@ namespace EOM.TSHotelManager.Application /// /// 根据公告编号查找公告信息 /// - /// + /// /// - public Notice SelectNoticeByNoticeNo(string? NoticeNo) + public Notice SelectNoticeByNoticeNo(string? noticeId) { Notice notice = new Notice(); - notice = noticeRepository.GetSingle(a => a.NoticeNo == NoticeNo); + notice = noticeRepository.GetSingle(a => a.NoticeNo == noticeId); switch (notice.NoticeType) { case "PersonnelChanges": diff --git a/EOM.TSHotelManager.Core/Business/Cash/Cash.cs b/EOM.TSHotelManager.Core/Business/Cash/Cash.cs index e564b21..e1b9919 100644 --- a/EOM.TSHotelManager.Core/Business/Cash/Cash.cs +++ b/EOM.TSHotelManager.Core/Business/Cash/Cash.cs @@ -60,7 +60,7 @@ namespace EOM.TSHotelManager.Core /// /// 入库时间 /// - public DateTime CashTime { get; set; } + public DateTime? CashTime { get; set; } /// /// 资产来源 /// diff --git a/EOM.TSHotelManager.Core/Business/Customer/Custo.cs b/EOM.TSHotelManager.Core/Business/Customer/Custo.cs index 91334f0..f2105eb 100644 --- a/EOM.TSHotelManager.Core/Business/Customer/Custo.cs +++ b/EOM.TSHotelManager.Core/Business/Customer/Custo.cs @@ -32,10 +32,15 @@ namespace EOM.TSHotelManager.Core [SqlSugar.SugarTable("customer")] public class Custo { + /// + /// 自增ID + /// + //[SqlSugar.SugarColumn(ColumnName = "id", IsPrimaryKey = true,IsIdentity = true)] + //public int Id { get; set; } /// /// 客户编号 /// - [SqlSugar.SugarColumn(ColumnName = "custo_no",IsPrimaryKey = true)] + [SqlSugar.SugarColumn(ColumnName = "custo_no", IsPrimaryKey = true)] public string? CustoNo { get; set; } /// /// 客户名称 @@ -71,7 +76,7 @@ namespace EOM.TSHotelManager.Core /// 出生日期 /// [SqlSugar.SugarColumn(ColumnName = "custo_birth", IsNullable = true)] - public DateTime CustoBirth { get; set; } + public DateTime? CustoBirth { get; set; } /// /// 客户类型 /// @@ -103,7 +108,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料创建时间 /// - public DateTime datains_date { get; set; } + public DateTime? datains_date { get; set; } /// /// 资料更新人 /// @@ -111,7 +116,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料更新时间 /// - public DateTime datachg_date { get; set; } + public DateTime? datachg_date { get; set; } } } diff --git a/EOM.TSHotelManager.Core/Business/Customer/CustoType.cs b/EOM.TSHotelManager.Core/Business/Customer/CustoType.cs index b89c3b9..d1b5de1 100644 --- a/EOM.TSHotelManager.Core/Business/Customer/CustoType.cs +++ b/EOM.TSHotelManager.Core/Business/Customer/CustoType.cs @@ -51,7 +51,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料创建时间 /// - public DateTime datains_date { get; set; } + public DateTime? datains_date { get; set; } /// /// 资料更新人 /// @@ -59,6 +59,6 @@ namespace EOM.TSHotelManager.Core /// /// 资料更新时间 /// - public DateTime datachg_date { get; set; } + public DateTime? datachg_date { get; set; } } } diff --git a/EOM.TSHotelManager.Core/Business/Customer/PassPortType.cs b/EOM.TSHotelManager.Core/Business/Customer/PassPortType.cs index f05a9c4..f9760dc 100644 --- a/EOM.TSHotelManager.Core/Business/Customer/PassPortType.cs +++ b/EOM.TSHotelManager.Core/Business/Customer/PassPortType.cs @@ -56,7 +56,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料创建时间 /// - public DateTime datains_date { get; set; } + public DateTime? datains_date { get; set; } /// /// 资料更新人 /// @@ -64,6 +64,6 @@ namespace EOM.TSHotelManager.Core /// /// 资料更新时间 /// - public DateTime datachg_date { get; set; } + public DateTime? datachg_date { get; set; } } } diff --git a/EOM.TSHotelManager.Core/Business/Customer/SexType.cs b/EOM.TSHotelManager.Core/Business/Customer/SexType.cs index 2e6eb95..69ae8d7 100644 --- a/EOM.TSHotelManager.Core/Business/Customer/SexType.cs +++ b/EOM.TSHotelManager.Core/Business/Customer/SexType.cs @@ -57,7 +57,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料创建时间 /// - public DateTime datains_date { get; set; } + public DateTime? datains_date { get; set; } /// /// 资料更新人 /// @@ -65,6 +65,6 @@ namespace EOM.TSHotelManager.Core /// /// 资料更新时间 /// - public DateTime datachg_date { get; set; } + public DateTime? datachg_date { get; set; } } } diff --git a/EOM.TSHotelManager.Core/Business/Reser/Reser.cs b/EOM.TSHotelManager.Core/Business/Reser/Reser.cs index 35f111e..55ef39f 100644 --- a/EOM.TSHotelManager.Core/Business/Reser/Reser.cs +++ b/EOM.TSHotelManager.Core/Business/Reser/Reser.cs @@ -55,11 +55,11 @@ namespace EOM.TSHotelManager.Core /// /// 预约起始 /// - public DateTime ReserDate { get; set; } + public DateTime? ReserDate { get; set; } /// /// 预约止日 /// - public DateTime ReserEndDay { get; set; } + public DateTime? ReserEndDay { get; set; } /// /// 删除标记 /// @@ -71,7 +71,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料创建时间 /// - public DateTime datains_date { get; set; } + public DateTime? datains_date { get; set; } /// /// 资料更新人 /// @@ -79,7 +79,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料更新时间 /// - public DateTime datachg_date { get; set; } + public DateTime? datachg_date { get; set; } } } diff --git a/EOM.TSHotelManager.Core/Business/Room/Room.cs b/EOM.TSHotelManager.Core/Business/Room/Room.cs index 51cab35..5d1d961 100644 --- a/EOM.TSHotelManager.Core/Business/Room/Room.cs +++ b/EOM.TSHotelManager.Core/Business/Room/Room.cs @@ -114,7 +114,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料创建时间 /// - public DateTime datains_date { get; set; } + public DateTime? datains_date { get; set; } /// /// 资料更新人 /// @@ -122,7 +122,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料更新时间 /// - public DateTime datachg_date { get; set; } + public DateTime? datachg_date { get; set; } } } diff --git a/EOM.TSHotelManager.Core/Business/Room/RoomState.cs b/EOM.TSHotelManager.Core/Business/Room/RoomState.cs index 280159b..8b3d415 100644 --- a/EOM.TSHotelManager.Core/Business/Room/RoomState.cs +++ b/EOM.TSHotelManager.Core/Business/Room/RoomState.cs @@ -52,7 +52,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料创建时间 /// - public DateTime datains_date { get; set; } + public DateTime? datains_date { get; set; } /// /// 资料更新人 /// @@ -60,6 +60,6 @@ namespace EOM.TSHotelManager.Core /// /// 资料更新时间 /// - public DateTime datachg_date { get; set; } + public DateTime? datachg_date { get; set; } } } diff --git a/EOM.TSHotelManager.Core/Business/Room/RoomType.cs b/EOM.TSHotelManager.Core/Business/Room/RoomType.cs index bce36c8..eb33ef6 100644 --- a/EOM.TSHotelManager.Core/Business/Room/RoomType.cs +++ b/EOM.TSHotelManager.Core/Business/Room/RoomType.cs @@ -53,7 +53,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料创建时间 /// - public DateTime datains_date { get; set; } + public DateTime? datains_date { get; set; } /// /// 资料更新人 /// @@ -61,6 +61,6 @@ namespace EOM.TSHotelManager.Core /// /// 资料更新时间 /// - public DateTime datachg_date { get; set; } + public DateTime? datachg_date { get; set; } } } diff --git a/EOM.TSHotelManager.Core/Business/Sellthing/SellThing.cs b/EOM.TSHotelManager.Core/Business/Sellthing/SellThing.cs index ba30d73..8b2c542 100644 --- a/EOM.TSHotelManager.Core/Business/Sellthing/SellThing.cs +++ b/EOM.TSHotelManager.Core/Business/Sellthing/SellThing.cs @@ -69,7 +69,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料创建时间 /// - public DateTime datains_date { get; set; } + public DateTime? datains_date { get; set; } /// /// 资料更新人 /// @@ -77,6 +77,6 @@ namespace EOM.TSHotelManager.Core /// /// 资料更新时间 /// - public DateTime datachg_date { get; set; } + public DateTime? datachg_date { get; set; } } } diff --git a/EOM.TSHotelManager.Core/Business/Spend/Spend.cs b/EOM.TSHotelManager.Core/Business/Spend/Spend.cs index d61e759..32279b9 100644 --- a/EOM.TSHotelManager.Core/Business/Spend/Spend.cs +++ b/EOM.TSHotelManager.Core/Business/Spend/Spend.cs @@ -69,7 +69,7 @@ namespace EOM.TSHotelManager.Core /// /// 消费时间 /// - public DateTime SpendTime { get; set; } + public DateTime? SpendTime { get; set; } /// /// 结算状态 /// @@ -85,7 +85,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料创建时间 /// - public DateTime datains_date { get; set; } + public DateTime? datains_date { get; set; } /// /// 资料更新人 /// @@ -93,7 +93,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料更新时间 /// - public DateTime datachg_date { get; set; } + public DateTime? datachg_date { get; set; } /// /// 结算状态描述 diff --git a/EOM.TSHotelManager.Core/Business/Wti/Wti.cs b/EOM.TSHotelManager.Core/Business/Wti/Wti.cs index 8a17560..c0754fc 100644 --- a/EOM.TSHotelManager.Core/Business/Wti/Wti.cs +++ b/EOM.TSHotelManager.Core/Business/Wti/Wti.cs @@ -46,12 +46,12 @@ namespace EOM.TSHotelManager.Core /// 开始使用时间 /// [SqlSugar.SugarColumn(ColumnName = "UseDate")] - public DateTime UseDate { get; set; } + public DateTime? UseDate { get; set; } /// /// 结束使用时间 /// [SqlSugar.SugarColumn(ColumnName = "EndDate")] - public DateTime EndDate { get; set; } + public DateTime? EndDate { get; set; } /// /// 水费 /// @@ -84,7 +84,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料创建时间 /// - public DateTime datains_date { get; set; } + public DateTime? datains_date { get; set; } /// /// 资料更新人 /// @@ -92,7 +92,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料更新时间 /// - public DateTime datachg_date { get; set; } + public DateTime? datachg_date { get; set; } } diff --git a/EOM.TSHotelManager.Core/EOM.TSHotelManager.Core.csproj b/EOM.TSHotelManager.Core/EOM.TSHotelManager.Core.csproj index fe414e4..83fcd06 100644 --- a/EOM.TSHotelManager.Core/EOM.TSHotelManager.Core.csproj +++ b/EOM.TSHotelManager.Core/EOM.TSHotelManager.Core.csproj @@ -8,7 +8,7 @@ - + diff --git a/EOM.TSHotelManager.Core/Sys/NavBar/NavBar.cs b/EOM.TSHotelManager.Core/Sys/NavBar/NavBar.cs index 36abd75..13f46f5 100644 --- a/EOM.TSHotelManager.Core/Sys/NavBar/NavBar.cs +++ b/EOM.TSHotelManager.Core/Sys/NavBar/NavBar.cs @@ -48,7 +48,7 @@ namespace EOM.TSHotelManager.Core /// /// 新增时间 /// - public DateTime datains_date { get; set; } + public DateTime? datains_date { get; set; } /// /// 修改人 /// @@ -56,6 +56,6 @@ namespace EOM.TSHotelManager.Core /// /// 修改时间 /// - public DateTime datachg_date { get; set; } + public DateTime? datachg_date { get; set; } } } diff --git a/EOM.TSHotelManager.Core/Util/OperationLog.cs b/EOM.TSHotelManager.Core/Util/OperationLog.cs index 911dc67..1e360c4 100644 --- a/EOM.TSHotelManager.Core/Util/OperationLog.cs +++ b/EOM.TSHotelManager.Core/Util/OperationLog.cs @@ -57,7 +57,7 @@ namespace EOM.TSHotelManager.Core /// 操作时间 /// [SqlSugar.SugarColumn(ColumnName = "OperationTime")] - public DateTime OperationTime { get; set; } + public DateTime? OperationTime { get; set; } /// /// 操作信息 /// @@ -94,7 +94,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料创建时间 /// - public DateTime datains_date { get; set; } + public DateTime? datains_date { get; set; } /// /// 资料更新人 /// @@ -102,7 +102,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料更新时间 /// - public DateTime datachg_date { get; set; } + public DateTime? datachg_date { get; set; } /// /// 日志等级 diff --git a/EOM.TSHotelManager.Core/Worker/Worker.cs b/EOM.TSHotelManager.Core/Worker/Worker.cs index e475ecd..e517ad3 100644 --- a/EOM.TSHotelManager.Core/Worker/Worker.cs +++ b/EOM.TSHotelManager.Core/Worker/Worker.cs @@ -46,7 +46,7 @@ namespace EOM.TSHotelManager.Core /// 出生日期 /// [SqlSugar.SugarColumn(ColumnName = "WorkerBirthday")] - public DateTime WorkerBirthday { get; set; } + public DateTime? WorkerBirthday { get; set; } /// /// 员工性别 /// @@ -110,7 +110,7 @@ namespace EOM.TSHotelManager.Core /// /// 员工入职时间 /// - public DateTime WorkerTime { get; set; } + public DateTime? WorkerTime { get; set; } /// /// 员工面貌 /// diff --git a/EOM.TSHotelManager.Core/Worker/WorkerCheck.cs b/EOM.TSHotelManager.Core/Worker/WorkerCheck.cs index 8e13365..1606942 100644 --- a/EOM.TSHotelManager.Core/Worker/WorkerCheck.cs +++ b/EOM.TSHotelManager.Core/Worker/WorkerCheck.cs @@ -70,7 +70,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料创建时间 /// - public DateTime datains_date { get; set; } + public DateTime? datains_date { get; set; } /// /// 资料更新人 /// @@ -78,7 +78,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料更新时间 /// - public DateTime datachg_date { get; set; } + public DateTime? datachg_date { get; set; } } } diff --git a/EOM.TSHotelManager.Core/Worker/WorkerGoodBad.cs b/EOM.TSHotelManager.Core/Worker/WorkerGoodBad.cs index 7714c5c..8910dc5 100644 --- a/EOM.TSHotelManager.Core/Worker/WorkerGoodBad.cs +++ b/EOM.TSHotelManager.Core/Worker/WorkerGoodBad.cs @@ -65,7 +65,7 @@ namespace EOM.TSHotelManager.Core /// /// 奖惩时间 /// - public DateTime GBTime { get; set; } + public DateTime? GBTime { get; set; } /// /// 类型名称 /// @@ -82,7 +82,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料创建时间 /// - public DateTime datains_date { get; set; } + public DateTime? datains_date { get; set; } /// /// 资料更新人 /// @@ -90,6 +90,6 @@ namespace EOM.TSHotelManager.Core /// /// 资料更新时间 /// - public DateTime datachg_date { get; set; } + public DateTime? datachg_date { get; set; } } } diff --git a/EOM.TSHotelManager.Core/Worker/WorkerHistory.cs b/EOM.TSHotelManager.Core/Worker/WorkerHistory.cs index 73fec9e..73abc23 100644 --- a/EOM.TSHotelManager.Core/Worker/WorkerHistory.cs +++ b/EOM.TSHotelManager.Core/Worker/WorkerHistory.cs @@ -44,11 +44,11 @@ namespace EOM.TSHotelManager.Core /// /// 开始时间 /// - public DateTime StartDate { get; set; } + public DateTime? StartDate { get; set; } /// /// 结束时间 /// - public DateTime EndDate { get; set; } + public DateTime? EndDate { get; set; } /// /// 职位 /// @@ -68,7 +68,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料创建时间 /// - public DateTime datains_date { get; set; } + public DateTime? datains_date { get; set; } /// /// 资料更新人 /// @@ -76,6 +76,6 @@ namespace EOM.TSHotelManager.Core /// /// 资料更新时间 /// - public DateTime datachg_date { get; set; } + public DateTime? datachg_date { get; set; } } } diff --git a/EOM.TSHotelManager.Core/Zero/AdminType.cs b/EOM.TSHotelManager.Core/Zero/AdminType.cs index 9eb2e5d..509f5c5 100644 --- a/EOM.TSHotelManager.Core/Zero/AdminType.cs +++ b/EOM.TSHotelManager.Core/Zero/AdminType.cs @@ -63,7 +63,7 @@ namespace EOM.TSHotelManager.Core /// /// 新增时间 /// - public DateTime datains_date { get; set; } + public DateTime? datains_date { get; set; } /// /// 修改人 /// @@ -71,6 +71,6 @@ namespace EOM.TSHotelManager.Core /// /// 修改时间 /// - public DateTime datachg_date { get; set; } + public DateTime? datachg_date { get; set; } } } diff --git a/EOM.TSHotelManager.Core/Zero/CheckInfo.cs b/EOM.TSHotelManager.Core/Zero/CheckInfo.cs index be947cf..a1e9022 100644 --- a/EOM.TSHotelManager.Core/Zero/CheckInfo.cs +++ b/EOM.TSHotelManager.Core/Zero/CheckInfo.cs @@ -72,7 +72,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料创建时间 /// - public DateTime datains_date { get; set; } + public DateTime? datains_date { get; set; } /// /// 资料更新人 /// @@ -80,6 +80,6 @@ namespace EOM.TSHotelManager.Core /// /// 资料更新时间 /// - public DateTime datachg_date { get; set; } + public DateTime? datachg_date { get; set; } } } diff --git a/EOM.TSHotelManager.Core/Zero/Dept.cs b/EOM.TSHotelManager.Core/Zero/Dept.cs index e7145c9..60b6a61 100644 --- a/EOM.TSHotelManager.Core/Zero/Dept.cs +++ b/EOM.TSHotelManager.Core/Zero/Dept.cs @@ -39,22 +39,27 @@ namespace EOM.TSHotelManager.Core /// /// 部门编号 /// + [SqlSugar.SugarColumn(ColumnName = "dept_no")] public string? dept_no { get; set; } /// /// 部门名称 /// + [SqlSugar.SugarColumn(ColumnName = "dept_name")] public string? dept_name { get; set; } /// /// 部门描述 /// + [SqlSugar.SugarColumn(ColumnName = "dept_desc")] public string? dept_desc { get; set; } /// /// 创建时间(部门) /// - public DateTime dept_date { get; set; } + [SqlSugar.SugarColumn(ColumnName = "dept_date")] + public DateTime? dept_date { get; set; } /// /// 部门主管 /// + [SqlSugar.SugarColumn(ColumnName = "dept_leader")] public string? dept_leader { get; set; } /// /// 部门主管 @@ -64,6 +69,7 @@ namespace EOM.TSHotelManager.Core /// /// 上级部门 /// + [SqlSugar.SugarColumn(ColumnName = "dept_parent")] public string? dept_parent { get; set; } /// /// 上级部门 @@ -73,23 +79,28 @@ namespace EOM.TSHotelManager.Core /// /// 删除标记 /// + [SqlSugar.SugarColumn(ColumnName = "delete_mk")] public int delete_mk { get; set; } /// /// 资料创建人 /// + [SqlSugar.SugarColumn(ColumnName = "datains_usr")] public string? datains_usr { get; set; } /// /// 资料创建时间 /// - public DateTime datains_date { get; set; } + [SqlSugar.SugarColumn(ColumnName = "datains_date")] + public DateTime? datains_date { get; set; } /// /// 资料更新人 /// + [SqlSugar.SugarColumn(ColumnName = "datachg_usr")] public string? datachg_usr { get; set; } /// /// 资料更新时间 /// - public DateTime datachg_date { get; set; } + [SqlSugar.SugarColumn(ColumnName = "datachg_date")] + public DateTime? datachg_date { get; set; } } } diff --git a/EOM.TSHotelManager.Core/Zero/Education.cs b/EOM.TSHotelManager.Core/Zero/Education.cs index c7011eb..c75d003 100644 --- a/EOM.TSHotelManager.Core/Zero/Education.cs +++ b/EOM.TSHotelManager.Core/Zero/Education.cs @@ -55,7 +55,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料创建时间 /// - public DateTime datains_date { get; set; } + public DateTime? datains_date { get; set; } /// /// 资料更新人 /// @@ -63,7 +63,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料更新时间 /// - public DateTime datachg_date { get; set; } + public DateTime? datachg_date { get; set; } } } diff --git a/EOM.TSHotelManager.Core/Zero/Module.cs b/EOM.TSHotelManager.Core/Zero/Module.cs index 5e6b9e1..04779f7 100644 --- a/EOM.TSHotelManager.Core/Zero/Module.cs +++ b/EOM.TSHotelManager.Core/Zero/Module.cs @@ -40,7 +40,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料创建时间 /// - public DateTime datains_time { get; set; } + public DateTime? datains_time { get; set; } /// /// 资料更新人 @@ -50,6 +50,6 @@ namespace EOM.TSHotelManager.Core /// /// 资料更新时间 /// - public DateTime datachg_time { get; set; } + public DateTime? datachg_time { get; set; } } } diff --git a/EOM.TSHotelManager.Core/Zero/Notice.cs b/EOM.TSHotelManager.Core/Zero/Notice.cs index 69b8076..07ef662 100644 --- a/EOM.TSHotelManager.Core/Zero/Notice.cs +++ b/EOM.TSHotelManager.Core/Zero/Notice.cs @@ -56,7 +56,7 @@ namespace EOM.TSHotelManager.Core /// 公告时间 /// [SqlSugar.SugarColumn(ColumnName = "NoticeTime")] - public DateTime NoticeTime { get; set; } + public DateTime? NoticeTime { get; set; } /// /// 公告正文 /// @@ -79,7 +79,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料创建时间 /// - public DateTime datains_date { get; set; } + public DateTime? datains_date { get; set; } /// /// 资料更新人 /// @@ -87,7 +87,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料更新时间 /// - public DateTime datachg_date { get; set; } + public DateTime? datachg_date { get; set; } } } diff --git a/EOM.TSHotelManager.Core/Zero/VipRule.cs b/EOM.TSHotelManager.Core/Zero/VipRule.cs index b4d6d9b..ae7faaa 100644 --- a/EOM.TSHotelManager.Core/Zero/VipRule.cs +++ b/EOM.TSHotelManager.Core/Zero/VipRule.cs @@ -73,7 +73,7 @@ namespace EOM.TSHotelManager.Core /// /// 新增时间 /// - public DateTime datains_date { get; set; } + public DateTime? datains_date { get; set; } /// /// 修改人 /// @@ -81,7 +81,7 @@ namespace EOM.TSHotelManager.Core /// /// 修改时间 /// - public DateTime datachg_date { get; set; } + public DateTime? datachg_date { get; set; } /// /// 会员等级描述 diff --git a/EOM.TSHotelManager.Core/Zero/position.cs b/EOM.TSHotelManager.Core/Zero/position.cs index c8ac2dc..b1be022 100644 --- a/EOM.TSHotelManager.Core/Zero/position.cs +++ b/EOM.TSHotelManager.Core/Zero/position.cs @@ -55,7 +55,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料创建时间 /// - public DateTime datains_date { get; set; } + public DateTime? datains_date { get; set; } /// /// 资料更新人 /// @@ -63,7 +63,7 @@ namespace EOM.TSHotelManager.Core /// /// 资料更新时间 /// - public DateTime datachg_date { get; set; } + public DateTime? datachg_date { get; set; } } } diff --git a/EOM.TSHotelManager.EntityFramework/EOM.TSHotelManager.EntityFramework.csproj b/EOM.TSHotelManager.EntityFramework/EOM.TSHotelManager.EntityFramework.csproj index 168d52e..a08a531 100644 --- a/EOM.TSHotelManager.EntityFramework/EOM.TSHotelManager.EntityFramework.csproj +++ b/EOM.TSHotelManager.EntityFramework/EOM.TSHotelManager.EntityFramework.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/EOM.TSHotelManager.WebApi/Controllers/Business/Customer/CustoController.cs b/EOM.TSHotelManager.WebApi/Controllers/Business/Customer/CustoController.cs index 9bc3e8e..bbb7ab2 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Business/Customer/CustoController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Business/Customer/CustoController.cs @@ -74,9 +74,9 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public OSelectCustoAllDto SelectCustoAll([FromQuery]int? pageIndex, int? pageSize) + public OSelectCustoAllDto SelectCustoAll([FromQuery]SelectCustoAll selectCustoAll) { - return customerService.SelectCustoAll(pageIndex,pageSize); + return customerService.SelectCustoAll(selectCustoAll); } /// diff --git a/EOM.TSHotelManager.WebApi/Controllers/Business/Reser/ReserController.cs b/EOM.TSHotelManager.WebApi/Controllers/Business/Reser/ReserController.cs index fd0ae4d..d7bd0a5 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Business/Reser/ReserController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Business/Reser/ReserController.cs @@ -50,12 +50,12 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// 删除预约信息 /// - /// + /// /// [HttpPost] - public bool DeleteReserInfo([FromBody]string? rid) + public bool DeleteReserInfo([FromBody]Reser reser) { - return reserService.DeleteReserInfo(rid); + return reserService.DeleteReserInfo(reser); } /// diff --git a/EOM.TSHotelManager.WebApi/Controllers/Business/Room/RoomController.cs b/EOM.TSHotelManager.WebApi/Controllers/Business/Room/RoomController.cs index 0736ddf..1f679d9 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Business/Room/RoomController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Business/Room/RoomController.cs @@ -187,8 +187,8 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// /// - [HttpPost] - public bool UpdateRoomStateByRoomNo([FromBody]string? roomno, int stateid) + [HttpGet] + public bool UpdateRoomStateByRoomNo([FromQuery]string? roomno, int stateid) { return roomService.UpdateRoomStateByRoomNo(roomno,stateid); } diff --git a/EOM.TSHotelManager.WebApi/Controllers/Business/Sellthing/SellthingController.cs b/EOM.TSHotelManager.WebApi/Controllers/Business/Sellthing/SellthingController.cs index e93de8b..52b94db 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Business/Sellthing/SellthingController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Business/Sellthing/SellthingController.cs @@ -67,8 +67,8 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// /// - [HttpPost] - public bool DeleteSellThing([FromBody] string? roomNo, string? custoNo, string? sellName) + [HttpGet] + public bool DeleteSellThing([FromQuery] string? roomNo, string? custoNo, string? sellName) { return sellService.DeleteSellThing(roomNo, custoNo, sellName); } @@ -78,8 +78,8 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// /// - [HttpPost] - public bool DeleteSellThingBySellNo([FromBody]string? sellNo) + [HttpGet] + public bool DeleteSellThingBySellNo([FromQuery]string? sellNo) { return sellService.DeleteSellThingBySellNo(sellNo); } diff --git a/EOM.TSHotelManager.WebApi/Controllers/Business/Spend/SpendController.cs b/EOM.TSHotelManager.WebApi/Controllers/Business/Spend/SpendController.cs index 740988b..aa8bb6c 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Business/Spend/SpendController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Business/Spend/SpendController.cs @@ -75,7 +75,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - List SelectSpendInfoAll() + public List SelectSpendInfoAll() { return spendService.SelectSpendInfoAll(); } @@ -108,8 +108,8 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// /// - [HttpPost] - public bool UpdateMoneyState([FromBody] string? roomno, string? checktime) + [HttpGet] + public bool UpdateMoneyState([FromQuery] string? roomno, string? checktime) { return spendService.UpdateMoneyState(roomno, checktime); } @@ -117,14 +117,12 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// 将转房前的未结算记录一同转移到新房间 /// - /// - /// - /// + /// /// [HttpPost] - public bool UpdateSpendInfoByRoomNo([FromBody]List spends, string? newRoom, string? custoNo) + public bool UpdateSpendInfoByRoomNo([FromQuery] Spend spend) { - return spendService.UpdateSpendInfoByRoomNo(spends, newRoom, custoNo); + return spendService.UpdateSpendInfoByRoomNo(spend); } /// diff --git a/EOM.TSHotelManager.WebApi/Controllers/Util/UtilController.cs b/EOM.TSHotelManager.WebApi/Controllers/Util/AppController.cs similarity index 87% rename from EOM.TSHotelManager.WebApi/Controllers/Util/UtilController.cs rename to EOM.TSHotelManager.WebApi/Controllers/Util/AppController.cs index 15ef882..0ef88b5 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Util/UtilController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Util/AppController.cs @@ -9,7 +9,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// 工具类控制器 /// - public class UtilController : ControllerBase + public class AppController : ControllerBase { /// /// 工具 @@ -20,7 +20,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// /// - public UtilController(IUtilService utilService) + public AppController(IUtilService utilService) { this.utilService = utilService; } @@ -52,9 +52,9 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool InsertOperationLog([FromBody]OperationLog opr) + public bool AddLog([FromBody]OperationLog opr) { - return utilService.InsertOperationLog(opr); + return utilService.AddLog(opr); } /// diff --git a/EOM.TSHotelManager.WebApi/Controllers/Zero/Admin/AdminController.cs b/EOM.TSHotelManager.WebApi/Controllers/Zero/Admin/AdminController.cs index 11b8e75..181f163 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Zero/Admin/AdminController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Zero/Admin/AdminController.cs @@ -43,8 +43,8 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// /// - [HttpPost] - public Admin SelectAdminPwdByAccount([FromBody]string? account) + [HttpGet] + public Admin SelectAdminPwdByAccount([FromQuery]string? account) { return adminService.SelectAdminPwdByAccount(account); } diff --git a/EOM.TSHotelManager.WebApi/Controllers/Zero/Module/ModuleController.cs b/EOM.TSHotelManager.WebApi/Controllers/Zero/Module/ModuleController.cs index 6b6a749..7152a0c 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Zero/Module/ModuleController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Zero/Module/ModuleController.cs @@ -40,8 +40,8 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// /// - [HttpGet] - public List GetAllModuleByAdmin([FromQuery]Admin admin) + [HttpPost] + public List GetAllModuleByAdmin([FromBody]Admin admin) { return adminModuleZeroService.GetAllModuleByAdmin(admin); } diff --git a/EOM.TSHotelManager.WebApi/Controllers/Zero/Notice/NoticeController.cs b/EOM.TSHotelManager.WebApi/Controllers/Zero/Notice/NoticeController.cs index 6015dd3..0928f1c 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Zero/Notice/NoticeController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Zero/Notice/NoticeController.cs @@ -37,6 +37,17 @@ namespace EOM.TSHotelManager.WebApi.Controllers } #endregion + /// + /// 查询公告 + /// + /// + /// + [HttpGet] + public Notice SelectNoticeByNoticeNo([FromQuery]string noticeId) + { + return noticeService.SelectNoticeByNoticeNo(noticeId); + } + #region 上传公告信息 /// /// 上传公告信息 diff --git a/EOM.TSHotelManager.WebApi/EOM.TSHotelManager.WebApi.csproj b/EOM.TSHotelManager.WebApi/EOM.TSHotelManager.WebApi.csproj index e831fc1..09cc55b 100644 --- a/EOM.TSHotelManager.WebApi/EOM.TSHotelManager.WebApi.csproj +++ b/EOM.TSHotelManager.WebApi/EOM.TSHotelManager.WebApi.csproj @@ -20,8 +20,10 @@ - + + + diff --git a/EOM.TSHotelManager.WebApi/EOM.TSHotelManager.WebApi.xml b/EOM.TSHotelManager.WebApi/EOM.TSHotelManager.WebApi.xml index 776d8d7..18a0fb2 100644 --- a/EOM.TSHotelManager.WebApi/EOM.TSHotelManager.WebApi.xml +++ b/EOM.TSHotelManager.WebApi/EOM.TSHotelManager.WebApi.xml @@ -77,7 +77,7 @@ - + 查询所有客户信息 @@ -147,11 +147,11 @@ - + 删除预约信息 - + @@ -483,13 +483,11 @@ - + 将转房前的未结算记录一同转移到新房间 - - - + @@ -595,43 +593,43 @@ - + 工具类控制器 - + 工具 - + - + 查询身份证号码 - + 检测版本号 - + 添加操作日志 - + 查询所有操作日志 @@ -1332,6 +1330,13 @@ + + + 查询公告 + + + + 上传公告信息 diff --git a/EOM.TSHotelManager.WebApi/Startup.cs b/EOM.TSHotelManager.WebApi/Startup.cs index da3b6d0..6466977 100644 --- a/EOM.TSHotelManager.WebApi/Startup.cs +++ b/EOM.TSHotelManager.WebApi/Startup.cs @@ -4,8 +4,11 @@ using System.IO; using System.Linq; using System.Reflection; using System.Text; +using System.Text.Encodings.Web; +using System.Text.Unicode; using System.Threading.Tasks; using Autofac; +using Autofac.Core; using EOM.Encrypt; using EOM.TSHotelManager.EntityFramework; using Microsoft.AspNetCore.Builder; @@ -17,7 +20,9 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; using Microsoft.OpenApi.Models; +using Newtonsoft.Json.Serialization; namespace EOM.TSHotelManager.WebApi { @@ -33,7 +38,17 @@ namespace EOM.TSHotelManager.WebApi // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { - services.AddControllers(); + //services.AddControllers(); + services.AddControllers().AddJsonOptions(opts => + { + opts.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All); + opts.JsonSerializerOptions.PropertyNamingPolicy = null; + }).AddNewtonsoftJson(opt => + { + //ʱʽӦ + opt.SerializerSettings.DateFormatString = "yyyy-MM-dd HH:mm:ss"; + opt.SerializerSettings.ContractResolver = new DefaultContractResolver(); + }); #region ȫ· //ڸǰ׺ûض·ǰǰ׺ @@ -65,7 +80,6 @@ namespace EOM.TSHotelManager.WebApi Url = new Uri("https://www.oscode.top/") } }); - //ȡͬ¸ֲxmlעͣһȡҵ߼㡢ʵͽӿڲ㼴 s.IncludeXmlComments(AppContext.BaseDirectory+"EOM.TSHotelManager.Application.xml"); s.IncludeXmlComments(AppContext.BaseDirectory+"EOM.TSHotelManager.Core.xml"); @@ -79,7 +93,6 @@ namespace EOM.TSHotelManager.WebApi #endregion }); #endregion - } @@ -107,6 +120,7 @@ namespace EOM.TSHotelManager.WebApi s.SwaggerEndpoint("/swagger/v1/swagger.json", "EOM.TSHotelManagerӿĵ"); }); #endregion + } /// -- Gitee