diff --git a/EOM.TSHotelManager.Application/Business/Reser/ReserService.cs b/EOM.TSHotelManager.Application/Business/Reser/ReserService.cs index 58716aa31bd54225ee100849c8f31954c2ea833d..1870d2d1601b630a6a182801484c5a3f80babe69 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 7e8cba7b194188c0b6fb81866319d58ab988b1db..2a446bcf24f94d6a1e1093aafe67d53b7c3ab7d5 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 399a73b71f67dc532e0dd025f35c721a3a0b071e..d9965f45a9a458828fe18506bc55104a040009f5 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 3f52efdbeff1b8eca22c8fd649c873056867d5e1..a250587bd39ad4d91adc62e8a9a2e3bbd114b1f8 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 dd6664c090116a0223a271b77c5db85e6644b3ed..39fc493db0c93693fdbace1170dc51c5b301b11c 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 e47e665975727732bef6529562ae70d92394c3df..87c8289381e8ddd60510340fe90ff0d275baf79d 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 83b7681b7e36dedbc7e0b89135f317b9c3c09bc9..0e4d6262c745ec8f092c5927ff0f67d7c09fc374 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 e2a2d102eb907284e61f771a939a2c6af3a4027a..8449846e34a3301e068a29e28f48aea4f85ec9b9 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 0000000000000000000000000000000000000000..d830e4db1d04a41590cdd4cd9a7aa31a1725ad46 --- /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 a485760a6196919d517b0185e175b440f48b099f..97be8dc153c8e8e9f1e85a6e8000c4591f619299 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 e0762ad66c0918aa032a0c44ac6f3d7130c58fde..8c005d7a85c356f7940ac6ba0fb89bec8e9b2fd3 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 49194476cbbf7be849994f133b10cdf5b3a162d8..0d9d3ea228d502b78a9cd053c40114b094b68cc4 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 36354df5641591a8a470a630be63212c617245e6..bb9d724c3434885e61f39d92ec4d1137b7c89a5b 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 d413ab1fe10faf9b5262408475dd221d0a886769..b3df4ecf7ab31e990290bf6231f5b278711c19fa 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 035edfee708c5eba218a33a356a47ceb564bea99..d80e129aa7ecedd1bda3e6e6d894f01144e0efab 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 447df48ba9d54c2231be0f2c725037d8e4b9b471..52ece9dffdc54f855f9d250835f86297f68f241a 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 93cb6cb5b10b88f33f52fcb6db45ab890db4212f..0000000000000000000000000000000000000000 --- 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 9eb3d130acaed98773987f5e10c9362e61426b48..0000000000000000000000000000000000000000 --- 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 f1f5c237ed5e70f48e128caaf640b90ed85e74bc..0000000000000000000000000000000000000000 --- 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 439d3da76709f853e0853ea26068cec3355ce579..0000000000000000000000000000000000000000 --- 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 9f7814eecd9be76064255af5bb6e58ed9e632536..0000000000000000000000000000000000000000 --- 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 d82852bfd7beaa61a3620f9cbf8e44b532edb5a9..0000000000000000000000000000000000000000 --- 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 0e1ed916ec0d7b449b8e2382517000c75b986942..0000000000000000000000000000000000000000 --- 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 c57d996ef966b85b17ac8715c8e64560adb5137c..0000000000000000000000000000000000000000 --- 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 0000000000000000000000000000000000000000..71c9f469e33b2bacfe8b25c64d6c34528e5e9673 --- /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 bcb5d8e4b18f2e7aa866d71e02a58c6cea343c77..2b8f9bd15a57d2e5aed237f36ac847edc24193a3 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 0046480ad53a94777d0a6ffcab7859a8901cb6d3..911dc670464fbe3f9447d35022be901c76e6b1ce 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 ce283c51780d1efc7d2714c77f6440b45e45f642..00c80dde57fec35f6abd66f3e1cee7207172537c 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 897bc58f77994cca21a9cde34d670812a31bbac6..168d52e766c27075398f57c856d9c877266f6995 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 96ef3f1225f9bc83185d17d286a1dfd6706f147d..0000000000000000000000000000000000000000 --- 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 2ec582156fb11ddee373083b1d31b7fc68ebf698..957815c0bb022f84d57b88f4cfb6886a18a8f9e6 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 532505258193c3e18aff84c9c600c7a264af6614..9bc3e8ec7b220ff719f4fbbbc9adac33199408ab 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 0000000000000000000000000000000000000000..ca25303b86ac1921961748ec1e2da311059563b1 --- /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 0000000000000000000000000000000000000000..15ef88221acfd0a806b2f4c581358f34ab88278f --- /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 d527b4267b3f832de48606c195ab51f9aa0935aa..8a9c04221bc88d0a4fcd748980936655e7bb8d19 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 c8103e00586273b56e4f2b8d118ff93dd79a38a2..11b8e75fe2fe8b3555e9a8c98ab925cd6979447b 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 46ab6b892f18b24ebef9c52ab62a653d3e431279..776d8d7968c58c8877f10bd69b6b8c9cf83d4454 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 0000000000000000000000000000000000000000..1bb12fefe7daf5e7b70f40d0f6be60a0025f8d6d --- /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 7cf2a6d42f2d5448a57163c698fb8d97d8fef441..da3b6d03eee205a71150a5e62fc77dc98a349b99 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 d9d9a9bff6fd6f3ee7ea00de958f135a4a28c6e6..d4586446720e8f025abed51e147b26dc82e11e4e 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": "*" }