From 8d0f62c3e7e197cf2831c1e64eaf7658f9c7ae39 Mon Sep 17 00:00:00 2001 From: Chunkit Yeung Date: Sat, 9 Mar 2024 17:25:30 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81Housekeeping=202=E3=80=81Fixed=20bugs?= =?UTF-8?q?=203=E3=80=81Add=20Authorization=20for=20WebApi=204=E3=80=81Upg?= =?UTF-8?q?rade=20some=20Nuget=20Package?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Business/Cash/CashService.cs | 7 +- .../Business/Cash/ICashService.cs | 1 - .../Business/Customer/CustoService.cs | 23 +++-- .../Business/Customer/ICustoService.cs | 3 +- .../Business/Fonts/FontsService.cs | 7 +- .../Business/Fonts/IFontsService.cs | 1 - .../Business/Reser/IReserService.cs | 1 - .../Business/Reser/ReserService.cs | 6 +- .../Business/Room/IRoomService.cs | 1 - .../Business/Room/IRoomTypeService.cs | 1 - .../Business/Room/RoomService.cs | 13 ++- .../Business/Room/RoomTypeService.cs | 3 +- .../Business/Sellthing/ISellService.cs | 2 - .../Business/Sellthing/SellService.cs | 14 ++- .../Business/Spend/ISpendService.cs | 2 - .../Business/Spend/SpendService.cs | 15 ++-- .../Business/Wti/IWtiService.cs | 1 - .../Business/Wti/WtiService.cs | 10 +-- .../Sys/NavBar/NavBarService.cs | 7 +- .../Util/IUtilService.cs | 5 -- .../Util/UtilService.cs | 7 +- .../Worker/Check/IWorkerCheckService.cs | 1 - .../Worker/Check/WorkerCheckService.cs | 5 +- .../Worker/GoodBad/IWorkerGoodBadService.cs | 1 - .../Worker/GoodBad/WorkerGoodBadService.cs | 7 +- .../Worker/History/IWorkerHistoryService.cs | 1 - .../Worker/History/WorkerHistoryService.cs | 2 - .../Worker/IWorkerService.cs | 1 - .../Worker/Picture/IWorkerPicService.cs | 5 -- .../Worker/Picture/WorkerPicService.cs | 12 +-- .../Worker/WorkerService.cs | 58 +++++++++---- .../Zero/Admin/AdminService.cs | 44 +++++++--- .../Zero/Admin/IAdminService.cs | 1 - .../Zero/Base/BaseService.cs | 24 ++--- .../Zero/Base/IBaseService.cs | 5 -- .../Zero/CheckInfo/CheckInfoService.cs | 3 - .../Zero/CheckInfo/ICheckInfoService.cs | 1 - .../Zero/Module/AdminModuleZeroService.cs | 5 -- .../Zero/Module/IAdminModuleZeroService.cs | 5 -- .../Zero/Notice/INoticeService.cs | 1 - .../Zero/Notice/NoticeService.cs | 4 +- .../Zero/VipRule/IVipRuleAppService.cs | 5 -- .../Zero/VipRule/VipRuleAppService.cs | 11 +-- EOM.TSHotelManager.Common.Core/BaseDTO.cs | 18 ++-- .../Business/Customer/CustoType.cs | 2 - .../Business/Customer/PassPortType.cs | 6 -- .../Business/Customer/SexType.cs | 6 -- .../Business/Room/RoomState.cs | 2 - .../Business/Room/RoomType.cs | 6 +- .../Business/Sellthing/SellThing.cs | 1 - .../Business/Spend/SpendConsts.cs | 6 -- .../Business/Wti/Wti.cs | 4 +- .../Sys/NavBar/NavBar.cs | 10 +-- .../Util/ApplicationVersion.cs | 5 -- .../Util/Cardcodes.cs | 8 +- .../Util/OperationLog.cs | 2 - .../Worker/GBType.cs | 2 - .../Worker/WorkerGoodBad.cs | 4 - .../Worker/WorkerHistory.cs | 2 +- .../Worker/WorkerPic.cs | 10 +-- EOM.TSHotelManager.Common.Core/Zero/Admin.cs | 2 +- .../Zero/AdminType.cs | 6 -- EOM.TSHotelManager.Common.Core/Zero/Base.cs | 6 -- .../Zero/CheckInfo.cs | 2 - EOM.TSHotelManager.Common.Core/Zero/Dept.cs | 4 - .../Zero/Education.cs | 6 -- EOM.TSHotelManager.Common.Core/Zero/Module.cs | 8 +- .../Zero/ModuleConsts.cs | 6 -- .../Zero/ModuleZero.cs | 10 +-- EOM.TSHotelManager.Common.Core/Zero/Nation.cs | 6 -- .../Zero/VipRule.cs | 6 -- .../Zero/position.cs | 6 -- .../AppSettingsJson.cs | 6 -- .../Repository/PgRepository.cs | 16 ++-- .../Business/Cash/CashController.cs | 3 +- .../Business/Customer/CustoController.cs | 13 ++- .../Business/Fonts/FontsController.cs | 1 - .../Business/Reser/ReserController.cs | 8 +- .../Business/Room/RoomController.cs | 15 ++-- .../Business/Room/RoomTypeController.cs | 3 +- .../Business/Sellthing/SellthingController.cs | 15 ++-- .../Business/Spend/SpendController.cs | 16 ++-- .../Controllers/Business/Wti/WtiController.cs | 15 ++-- .../Sys/NavBar/NavBarController.cs | 1 - .../Controllers/Util/AppController.cs | 7 +- .../Worker/Check/WorkerCheckController.cs | 7 +- .../Worker/GoodBad/WorkerGoodBadController.cs | 5 +- .../Worker/History/WorkerHistoryController.cs | 5 +- .../Worker/Picture/WorkerPictureController.cs | 11 ++- .../Controllers/Worker/WorkerController.cs | 17 ++-- .../Controllers/Zero/Admin/AdminController.cs | 15 ++-- .../Controllers/Zero/Base/BaseController.cs | 73 ++++++++-------- .../Zero/CheckInfo/CheckInfoController.cs | 1 - .../Zero/Module/ModuleController.cs | 7 +- .../Zero/Notice/NoticeController.cs | 5 +- .../Zero/VipRule/VipRuleController.cs | 9 +- .../SkipCustomActionFilterAttribute.cs | 6 ++ .../EOM.TSHotelManager.WebApi.csproj | 12 +++ .../Filter/ActionFilter.cs | 59 ------------- .../AuthorizeAllControllersConvention.cs | 35 ++++++++ EOM.TSHotelManager.WebApi/Program.cs | 8 -- .../Router_Extension/MvcOptionsExtensions.cs | 4 +- EOM.TSHotelManager.WebApi/Startup.cs | 87 +++++++++++-------- EOM.TSHotelManager.WebApi/appsettings.json | 9 +- 104 files changed, 393 insertions(+), 595 deletions(-) create mode 100644 EOM.TSHotelManager.WebApi/CustomAttribute/SkipCustomActionFilterAttribute.cs delete mode 100644 EOM.TSHotelManager.WebApi/Filter/ActionFilter.cs create mode 100644 EOM.TSHotelManager.WebApi/Filter/AuthorizeAllControllersConvention.cs diff --git a/EOM.TSHotelManager.Application/Business/Cash/CashService.cs b/EOM.TSHotelManager.Application/Business/Cash/CashService.cs index 84ff681..a6691bb 100644 --- a/EOM.TSHotelManager.Application/Business/Cash/CashService.cs +++ b/EOM.TSHotelManager.Application/Business/Cash/CashService.cs @@ -21,9 +21,6 @@ *SOFTWARE. * */ -using System; -using System.Collections.Generic; -using System.Linq; using EOM.TSHotelManager.Common.Core; using EOM.TSHotelManager.EntityFramework; @@ -32,7 +29,7 @@ namespace EOM.TSHotelManager.Application /// /// 资产信息接口实现类 /// - public class CashService:ICashService + public class CashService : ICashService { /// /// 资产信息 @@ -89,7 +86,7 @@ namespace EOM.TSHotelManager.Application cs.ForEach(source => { var dept = depts.FirstOrDefault(a => a.dept_no.Equals(source.CashClub)); - source.DeptName = dept == null? "" : dept.dept_name; + source.DeptName = dept == null ? "" : dept.dept_name; var worker = workers.FirstOrDefault(a => a.WorkerId.Equals(source.CashPerson)); source.PersonName = worker == null ? "" : worker.WorkerName; diff --git a/EOM.TSHotelManager.Application/Business/Cash/ICashService.cs b/EOM.TSHotelManager.Application/Business/Cash/ICashService.cs index 3106ddc..471806e 100644 --- a/EOM.TSHotelManager.Application/Business/Cash/ICashService.cs +++ b/EOM.TSHotelManager.Application/Business/Cash/ICashService.cs @@ -22,7 +22,6 @@ * */ using EOM.TSHotelManager.Common.Core; -using System.Collections.Generic; namespace EOM.TSHotelManager.Application { diff --git a/EOM.TSHotelManager.Application/Business/Customer/CustoService.cs b/EOM.TSHotelManager.Application/Business/Customer/CustoService.cs index df842c6..7865833 100644 --- a/EOM.TSHotelManager.Application/Business/Customer/CustoService.cs +++ b/EOM.TSHotelManager.Application/Business/Customer/CustoService.cs @@ -21,15 +21,10 @@ *SOFTWARE. * */ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; using CK.Common; using EOM.Encrypt; using EOM.TSHotelManager.Common.Core; using EOM.TSHotelManager.EntityFramework; -using Npgsql; using SqlSugar; namespace EOM.TSHotelManager.Application @@ -37,7 +32,7 @@ namespace EOM.TSHotelManager.Application /// /// 客户信息接口实现类 /// - public class CustoService:ICustoService + public class CustoService : ICustoService { /// /// 客户信息 @@ -96,7 +91,7 @@ namespace EOM.TSHotelManager.Application /// public bool InsertCustomerInfo(Custo custo) { - string NewID = encrypt.Encryption(custo.CustoID,EncryptionLevel.Enhanced); + string NewID = encrypt.Encryption(custo.CustoID, EncryptionLevel.Enhanced); string NewTel = encrypt.Encryption(custo.CustoTel, EncryptionLevel.Enhanced); custo.CustoID = NewID; custo.CustoTel = NewTel; @@ -117,7 +112,7 @@ namespace EOM.TSHotelManager.Application custo.CustoTel = NewTel; return custoRepository.Update(a => new Custo() { - CustoName = custo.CustoName, + CustoName = custo.CustoName, CustoSex = custo.CustoSex, CustoType = custo.CustoType, CustoBirth = custo.CustoBirth, @@ -126,7 +121,7 @@ namespace EOM.TSHotelManager.Application CustoTel = custo.CustoTel, PassportType = custo.PassportType, datachg_usr = custo.datachg_usr - },a => a.CustoNo == custo.CustoNo); + }, a => a.CustoNo == custo.CustoNo); } /// @@ -135,7 +130,7 @@ namespace EOM.TSHotelManager.Application /// /// /// - public bool UpdCustomerTypeByCustoNo(string custoNo,int userType) + public bool UpdCustomerTypeByCustoNo(string custoNo, int userType) { return custoRepository.Update(a => new Custo() { @@ -166,7 +161,7 @@ namespace EOM.TSHotelManager.Application }); } }); - + custoSpends = custoSpends.OrderBy(a => a.Years).ToList(); return custoSpends; } @@ -175,7 +170,7 @@ namespace EOM.TSHotelManager.Application /// 查询所有客户信息 /// /// - public OSelectCustoAllDto SelectCustoAll(int? pageIndex,int? pageSize) + public OSelectCustoAllDto SelectCustoAll(int? pageIndex, int? pageSize, bool onlyVip = false) { OSelectCustoAllDto oSelectCustoAllDto = new OSelectCustoAllDto(); @@ -196,6 +191,10 @@ namespace EOM.TSHotelManager.Application if (pageIndex != 0 && pageSize != 0) { custos = custoRepository.AsQueryable().ToPageList((int)pageIndex, (int)pageSize, ref count); + if (onlyVip) + { + custos = custoRepository.AsQueryable().Where(a => a.CustoType != 0).ToPageList((int)pageIndex, (int)pageSize, ref count); + } } else { diff --git a/EOM.TSHotelManager.Application/Business/Customer/ICustoService.cs b/EOM.TSHotelManager.Application/Business/Customer/ICustoService.cs index f6617b5..cc83e3a 100644 --- a/EOM.TSHotelManager.Application/Business/Customer/ICustoService.cs +++ b/EOM.TSHotelManager.Application/Business/Customer/ICustoService.cs @@ -22,7 +22,6 @@ * */ using EOM.TSHotelManager.Common.Core; -using System.Collections.Generic; namespace EOM.TSHotelManager.Application { @@ -63,7 +62,7 @@ namespace EOM.TSHotelManager.Application /// 查询所有客户信息 /// /// - OSelectCustoAllDto SelectCustoAll(int? pageIndex, int? pageSize); + OSelectCustoAllDto SelectCustoAll(int? pageIndex, int? pageSize, bool onlyVip = false); /// /// 查询指定客户信息 diff --git a/EOM.TSHotelManager.Application/Business/Fonts/FontsService.cs b/EOM.TSHotelManager.Application/Business/Fonts/FontsService.cs index baf5d61..c4c6d8a 100644 --- a/EOM.TSHotelManager.Application/Business/Fonts/FontsService.cs +++ b/EOM.TSHotelManager.Application/Business/Fonts/FontsService.cs @@ -23,18 +23,13 @@ */ using EOM.TSHotelManager.Common.Core; using EOM.TSHotelManager.EntityFramework; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace EOM.TSHotelManager.Application { /// /// 酒店宣传联动内容接口实现类 /// - public class FontsService:IFontsService + public class FontsService : IFontsService { /// /// 跑马灯 diff --git a/EOM.TSHotelManager.Application/Business/Fonts/IFontsService.cs b/EOM.TSHotelManager.Application/Business/Fonts/IFontsService.cs index 0dd43ac..623ea34 100644 --- a/EOM.TSHotelManager.Application/Business/Fonts/IFontsService.cs +++ b/EOM.TSHotelManager.Application/Business/Fonts/IFontsService.cs @@ -22,7 +22,6 @@ * */ using EOM.TSHotelManager.Common.Core; -using System.Collections.Generic; namespace EOM.TSHotelManager.Application { diff --git a/EOM.TSHotelManager.Application/Business/Reser/IReserService.cs b/EOM.TSHotelManager.Application/Business/Reser/IReserService.cs index e089667..b3345a2 100644 --- a/EOM.TSHotelManager.Application/Business/Reser/IReserService.cs +++ b/EOM.TSHotelManager.Application/Business/Reser/IReserService.cs @@ -22,7 +22,6 @@ * */ using EOM.TSHotelManager.Common.Core; -using System.Collections.Generic; namespace EOM.TSHotelManager.Application { diff --git a/EOM.TSHotelManager.Application/Business/Reser/ReserService.cs b/EOM.TSHotelManager.Application/Business/Reser/ReserService.cs index 951ccc8..5dcf803 100644 --- a/EOM.TSHotelManager.Application/Business/Reser/ReserService.cs +++ b/EOM.TSHotelManager.Application/Business/Reser/ReserService.cs @@ -24,15 +24,13 @@ using EOM.Encrypt; using EOM.TSHotelManager.Common.Core; using EOM.TSHotelManager.EntityFramework; -using System; -using System.Collections.Generic; namespace EOM.TSHotelManager.Application { /// /// 预约信息接口实现类 /// - public class ReserService:IReserService + public class ReserService : IReserService { /// /// 预约信息 @@ -98,7 +96,7 @@ namespace EOM.TSHotelManager.Application { delete_mk = 1, datachg_usr = string.Empty - },a => a.ReserId == reser.ReserId); + }, a => a.ReserId == reser.ReserId); } diff --git a/EOM.TSHotelManager.Application/Business/Room/IRoomService.cs b/EOM.TSHotelManager.Application/Business/Room/IRoomService.cs index 30df5c9..c23b657 100644 --- a/EOM.TSHotelManager.Application/Business/Room/IRoomService.cs +++ b/EOM.TSHotelManager.Application/Business/Room/IRoomService.cs @@ -22,7 +22,6 @@ * */ using EOM.TSHotelManager.Common.Core; -using System.Collections.Generic; namespace EOM.TSHotelManager.Application { diff --git a/EOM.TSHotelManager.Application/Business/Room/IRoomTypeService.cs b/EOM.TSHotelManager.Application/Business/Room/IRoomTypeService.cs index dfef4b7..a68444c 100644 --- a/EOM.TSHotelManager.Application/Business/Room/IRoomTypeService.cs +++ b/EOM.TSHotelManager.Application/Business/Room/IRoomTypeService.cs @@ -22,7 +22,6 @@ * */ using EOM.TSHotelManager.Common.Core; -using System.Collections.Generic; namespace EOM.TSHotelManager.Application { diff --git a/EOM.TSHotelManager.Application/Business/Room/RoomService.cs b/EOM.TSHotelManager.Application/Business/Room/RoomService.cs index aaf42d7..6dc7d3d 100644 --- a/EOM.TSHotelManager.Application/Business/Room/RoomService.cs +++ b/EOM.TSHotelManager.Application/Business/Room/RoomService.cs @@ -24,16 +24,13 @@ using CK.Common; using EOM.TSHotelManager.Common.Core; using EOM.TSHotelManager.EntityFramework; -using System; -using System.Collections.Generic; -using System.Linq; namespace EOM.TSHotelManager.Application { /// /// 客房信息接口实现类 /// - public class RoomService:IRoomService + public class RoomService : IRoomService { /// /// 客房信息 @@ -146,7 +143,7 @@ namespace EOM.TSHotelManager.Application source.CustoName = custo.IsNullOrEmpty() ? "" : custo.CustoName; //把入住时间格式化 - source.CheckTimeFormat = string.IsNullOrEmpty(source.CheckTime + "") ? "" + source.CheckTimeFormat = string.IsNullOrEmpty(source.CheckTime + "") ? "" : Convert.ToDateTime(source.CheckTime).ToString("yyyy-MM-dd HH:mm"); }); @@ -220,7 +217,7 @@ namespace EOM.TSHotelManager.Application CheckTime = null, CheckOutTime = DateTime.Now, RoomStateId = 3 - },a => a.RoomNo == room); + }, a => a.RoomNo == room); } #endregion @@ -249,7 +246,7 @@ namespace EOM.TSHotelManager.Application CheckTime = r.CheckTime, RoomStateId = r.RoomStateId, CustoNo = r.CustoNo - },a => a.RoomNo == r.RoomNo); + }, a => a.RoomNo == r.RoomNo); } #endregion @@ -347,7 +344,7 @@ namespace EOM.TSHotelManager.Application return roomRepository.Update(a => new Room() { RoomStateId = stateid - },a => a.RoomNo == roomno); + }, a => a.RoomNo == roomno); } #endregion diff --git a/EOM.TSHotelManager.Application/Business/Room/RoomTypeService.cs b/EOM.TSHotelManager.Application/Business/Room/RoomTypeService.cs index 92ed01a..5a55208 100644 --- a/EOM.TSHotelManager.Application/Business/Room/RoomTypeService.cs +++ b/EOM.TSHotelManager.Application/Business/Room/RoomTypeService.cs @@ -23,14 +23,13 @@ */ using EOM.TSHotelManager.Common.Core; using EOM.TSHotelManager.EntityFramework; -using System.Collections.Generic; namespace EOM.TSHotelManager.Application { /// /// 房间类型接口实现类 /// - public class RoomTypeService:IRoomTypeService + public class RoomTypeService : IRoomTypeService { /// /// 客房类型 diff --git a/EOM.TSHotelManager.Application/Business/Sellthing/ISellService.cs b/EOM.TSHotelManager.Application/Business/Sellthing/ISellService.cs index 83fd849..c691d80 100644 --- a/EOM.TSHotelManager.Application/Business/Sellthing/ISellService.cs +++ b/EOM.TSHotelManager.Application/Business/Sellthing/ISellService.cs @@ -22,8 +22,6 @@ * */ using EOM.TSHotelManager.Common.Core; -using System; -using System.Collections.Generic; namespace EOM.TSHotelManager.Application { diff --git a/EOM.TSHotelManager.Application/Business/Sellthing/SellService.cs b/EOM.TSHotelManager.Application/Business/Sellthing/SellService.cs index 5673aa4..ab62a99 100644 --- a/EOM.TSHotelManager.Application/Business/Sellthing/SellService.cs +++ b/EOM.TSHotelManager.Application/Business/Sellthing/SellService.cs @@ -21,8 +21,6 @@ *SOFTWARE. * */ -using System; -using System.Collections.Generic; using CK.Common; using EOM.TSHotelManager.Common.Core; using EOM.TSHotelManager.EntityFramework; @@ -33,7 +31,7 @@ namespace EOM.TSHotelManager.Application /// /// 商品信息接口实现类 /// - public class SellService:ISellService + public class SellService : ISellService { /// /// 商品信息 @@ -101,10 +99,10 @@ namespace EOM.TSHotelManager.Application /// public bool UpdateSellThing(string stock, string sellNo) { - return sellThingRepository.Update(a => new SellThing() + return sellThingRepository.Update(a => new SellThing() { Stock = Convert.ToInt32(stock), - },a => a.SellNo == sellNo); + }, a => a.SellNo == sellNo); } /// @@ -120,7 +118,7 @@ namespace EOM.TSHotelManager.Application SellPrice = sellThing.SellPrice, Stock = sellThing.Stock, format = sellThing.format, - },a => a.SellNo == sellThing.SellNo); + }, a => a.SellNo == sellThing.SellNo); } /// @@ -135,7 +133,7 @@ namespace EOM.TSHotelManager.Application return spendRepository.Update(a => new Spend() { delete_mk = 1, - },a => a.MoneyState.Equals(SpendConsts.UnSettle) && a.RoomNo == roomNo && a.CustoNo == custoNo + }, a => a.MoneyState.Equals(SpendConsts.UnSettle) && a.RoomNo == roomNo && a.CustoNo == custoNo && a.SpendName == sellName); } @@ -159,7 +157,7 @@ namespace EOM.TSHotelManager.Application /// /// /// - public SellThing SelectSellThingByNameAndPrice(string name,string price) + public SellThing SelectSellThingByNameAndPrice(string name, string price) { SellThing sellThing = null; sellThing = sellThingRepository.GetSingle(a => a.SellName == name && a.SellPrice == Convert.ToDecimal(price)); diff --git a/EOM.TSHotelManager.Application/Business/Spend/ISpendService.cs b/EOM.TSHotelManager.Application/Business/Spend/ISpendService.cs index 962a3a9..5f8ffcc 100644 --- a/EOM.TSHotelManager.Application/Business/Spend/ISpendService.cs +++ b/EOM.TSHotelManager.Application/Business/Spend/ISpendService.cs @@ -22,8 +22,6 @@ * */ using EOM.TSHotelManager.Common.Core; -using System; -using System.Collections.Generic; namespace EOM.TSHotelManager.Application { diff --git a/EOM.TSHotelManager.Application/Business/Spend/SpendService.cs b/EOM.TSHotelManager.Application/Business/Spend/SpendService.cs index 34e1f0d..6c77c20 100644 --- a/EOM.TSHotelManager.Application/Business/Spend/SpendService.cs +++ b/EOM.TSHotelManager.Application/Business/Spend/SpendService.cs @@ -21,9 +21,6 @@ *SOFTWARE. * */ -using System; -using System.Collections.Generic; -using System.Linq; using EOM.TSHotelManager.Common.Core; using EOM.TSHotelManager.EntityFramework; @@ -32,7 +29,7 @@ namespace EOM.TSHotelManager.Application /// /// 商品消费接口实现类 /// - public class SpendService:ISpendService + public class SpendService : ISpendService { /// /// 商品消费 @@ -190,7 +187,7 @@ namespace EOM.TSHotelManager.Application /// /// /// - public object SelectMoneyByRoomNoAndTime(string roomno,string custono) + public object SelectMoneyByRoomNoAndTime(string roomno, string custono) { return spendRepository.GetList(a => a.RoomNo == roomno && a.CustoNo == custono && a.MoneyState.Equals(SpendConsts.UnSettle)).Sum(a => a.SpendMoney); } @@ -208,7 +205,7 @@ namespace EOM.TSHotelManager.Application return spendRepository.Update(a => new Spend() { MoneyState = SpendConsts.Settled - },a => a.RoomNo == roomno && a.SpendTime >= Convert.ToDateTime(checktime) && a.SpendTime <= DateTime.Now); + }, a => a.RoomNo == roomno && a.SpendTime >= Convert.ToDateTime(checktime) && a.SpendTime <= DateTime.Now); } #endregion @@ -223,12 +220,12 @@ namespace EOM.TSHotelManager.Application //查询当前用户未结算的数据 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 = spend.RoomNo, datachg_usr = spend.datachg_usr - }, a => listSpendId.Contains(a.SpendName) && a.CustoNo.Equals(spend.CustoNo) && a.SpendTime >= DateTime.Now + }, a => listSpendId.Contains(a.SpendName) && a.CustoNo.Equals(spend.CustoNo) && a.SpendTime >= DateTime.Now && a.SpendTime <= DateTime.Now); @@ -247,7 +244,7 @@ namespace EOM.TSHotelManager.Application SpendAmount = spend.SpendAmount, SpendMoney = spend.SpendMoney, - }, a => a.MoneyState.Equals(SpendConsts.UnSettle) + }, a => a.MoneyState.Equals(SpendConsts.UnSettle) && a.RoomNo.Equals(spend.RoomNo) && a.CustoNo.Equals(spend.CustoNo) && a.SpendName.Equals(spend.SpendName)); diff --git a/EOM.TSHotelManager.Application/Business/Wti/IWtiService.cs b/EOM.TSHotelManager.Application/Business/Wti/IWtiService.cs index 4b2d1e0..90633cd 100644 --- a/EOM.TSHotelManager.Application/Business/Wti/IWtiService.cs +++ b/EOM.TSHotelManager.Application/Business/Wti/IWtiService.cs @@ -22,7 +22,6 @@ * */ using EOM.TSHotelManager.Common.Core; -using System.Collections.Generic; namespace EOM.TSHotelManager.Application { diff --git a/EOM.TSHotelManager.Application/Business/Wti/WtiService.cs b/EOM.TSHotelManager.Application/Business/Wti/WtiService.cs index 5926026..b239893 100644 --- a/EOM.TSHotelManager.Application/Business/Wti/WtiService.cs +++ b/EOM.TSHotelManager.Application/Business/Wti/WtiService.cs @@ -21,8 +21,6 @@ *SOFTWARE. * */ -using System; -using System.Collections.Generic; using EOM.TSHotelManager.Common.Core; using EOM.TSHotelManager.EntityFramework; @@ -31,7 +29,7 @@ namespace EOM.TSHotelManager.Application /// /// 水电信息接口实现类 /// - public class WtiService:IWtiService + public class WtiService : IWtiService { /// /// 水电信息 @@ -133,7 +131,7 @@ namespace EOM.TSHotelManager.Application CustoNo = w.CustoNo, datachg_usr = w.datachg_usr, RoomNo = w.RoomNo - },a => a.WtiNo == w.WtiNo); + }, a => a.WtiNo == w.WtiNo); } #endregion @@ -151,7 +149,7 @@ namespace EOM.TSHotelManager.Application WaterUse = w.WaterUse, PowerUse = w.PowerUse, datachg_usr = w.datachg_usr - },a => a.RoomNo == w.RoomNo && a.UseDate >= w.UseDate && a.EndDate >= w.EndDate); + }, a => a.RoomNo == w.RoomNo && a.UseDate >= w.UseDate && a.EndDate >= w.EndDate); } #endregion @@ -187,7 +185,7 @@ namespace EOM.TSHotelManager.Application return wtiRepository.Update(a => new Wti() { delete_mk = 1 - },a => a.RoomNo == roomno && a.UseDate >= Convert.ToDateTime(usedate) && a.EndDate >= Convert.ToDateTime(enddate)); + }, a => a.RoomNo == roomno && a.UseDate >= Convert.ToDateTime(usedate) && a.EndDate >= Convert.ToDateTime(enddate)); } #endregion } diff --git a/EOM.TSHotelManager.Application/Sys/NavBar/NavBarService.cs b/EOM.TSHotelManager.Application/Sys/NavBar/NavBarService.cs index 803911b..199ef2f 100644 --- a/EOM.TSHotelManager.Application/Sys/NavBar/NavBarService.cs +++ b/EOM.TSHotelManager.Application/Sys/NavBar/NavBarService.cs @@ -1,17 +1,12 @@ using EOM.TSHotelManager.Common.Core; using EOM.TSHotelManager.EntityFramework; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace EOM.TSHotelManager.Application { /// /// 导航控件模块 /// - public class NavBarService:INavBarService + public class NavBarService : INavBarService { /// /// 导航控件 diff --git a/EOM.TSHotelManager.Application/Util/IUtilService.cs b/EOM.TSHotelManager.Application/Util/IUtilService.cs index 1bd6f50..ad793a7 100644 --- a/EOM.TSHotelManager.Application/Util/IUtilService.cs +++ b/EOM.TSHotelManager.Application/Util/IUtilService.cs @@ -1,9 +1,4 @@ using EOM.TSHotelManager.Common.Core; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace EOM.TSHotelManager.Application { diff --git a/EOM.TSHotelManager.Application/Util/UtilService.cs b/EOM.TSHotelManager.Application/Util/UtilService.cs index 4db67c6..ff4a6af 100644 --- a/EOM.TSHotelManager.Application/Util/UtilService.cs +++ b/EOM.TSHotelManager.Application/Util/UtilService.cs @@ -1,17 +1,12 @@ using EOM.TSHotelManager.Common.Core; using EOM.TSHotelManager.EntityFramework; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace EOM.TSHotelManager.Application { /// /// 工具接口实现类 /// - public class UtilService: IUtilService + public class UtilService : IUtilService { /// /// 卡片代码 diff --git a/EOM.TSHotelManager.Application/Worker/Check/IWorkerCheckService.cs b/EOM.TSHotelManager.Application/Worker/Check/IWorkerCheckService.cs index 166dc57..280462d 100644 --- a/EOM.TSHotelManager.Application/Worker/Check/IWorkerCheckService.cs +++ b/EOM.TSHotelManager.Application/Worker/Check/IWorkerCheckService.cs @@ -22,7 +22,6 @@ * */ using EOM.TSHotelManager.Common.Core; -using System.Collections.Generic; namespace EOM.TSHotelManager.Application { diff --git a/EOM.TSHotelManager.Application/Worker/Check/WorkerCheckService.cs b/EOM.TSHotelManager.Application/Worker/Check/WorkerCheckService.cs index 8c79842..6d4eda1 100644 --- a/EOM.TSHotelManager.Application/Worker/Check/WorkerCheckService.cs +++ b/EOM.TSHotelManager.Application/Worker/Check/WorkerCheckService.cs @@ -23,16 +23,13 @@ */ using EOM.TSHotelManager.Common.Core; using EOM.TSHotelManager.EntityFramework; -using System; -using System.Collections.Generic; -using System.Linq; namespace EOM.TSHotelManager.Application { /// /// 员工打卡接口实现类 /// - public class WorkerCheckService:IWorkerCheckService + public class WorkerCheckService : IWorkerCheckService { /// /// 员工打卡 diff --git a/EOM.TSHotelManager.Application/Worker/GoodBad/IWorkerGoodBadService.cs b/EOM.TSHotelManager.Application/Worker/GoodBad/IWorkerGoodBadService.cs index 3a84b23..ab11c02 100644 --- a/EOM.TSHotelManager.Application/Worker/GoodBad/IWorkerGoodBadService.cs +++ b/EOM.TSHotelManager.Application/Worker/GoodBad/IWorkerGoodBadService.cs @@ -22,7 +22,6 @@ * */ using EOM.TSHotelManager.Common.Core; -using System.Collections.Generic; namespace EOM.TSHotelManager.Application { diff --git a/EOM.TSHotelManager.Application/Worker/GoodBad/WorkerGoodBadService.cs b/EOM.TSHotelManager.Application/Worker/GoodBad/WorkerGoodBadService.cs index c9982e7..ae2d213 100644 --- a/EOM.TSHotelManager.Application/Worker/GoodBad/WorkerGoodBadService.cs +++ b/EOM.TSHotelManager.Application/Worker/GoodBad/WorkerGoodBadService.cs @@ -23,18 +23,13 @@ */ using EOM.TSHotelManager.Common.Core; using EOM.TSHotelManager.EntityFramework; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace EOM.TSHotelManager.Application { /// /// 员工奖惩记录接口实现类 /// - public class WorkerGoodBadService:IWorkerGoodBadService + public class WorkerGoodBadService : IWorkerGoodBadService { /// /// 员工奖惩记录 diff --git a/EOM.TSHotelManager.Application/Worker/History/IWorkerHistoryService.cs b/EOM.TSHotelManager.Application/Worker/History/IWorkerHistoryService.cs index 5be139c..f465f2f 100644 --- a/EOM.TSHotelManager.Application/Worker/History/IWorkerHistoryService.cs +++ b/EOM.TSHotelManager.Application/Worker/History/IWorkerHistoryService.cs @@ -22,7 +22,6 @@ * */ using EOM.TSHotelManager.Common.Core; -using System.Collections.Generic; namespace EOM.TSHotelManager.Application { diff --git a/EOM.TSHotelManager.Application/Worker/History/WorkerHistoryService.cs b/EOM.TSHotelManager.Application/Worker/History/WorkerHistoryService.cs index e3006d0..8790cbe 100644 --- a/EOM.TSHotelManager.Application/Worker/History/WorkerHistoryService.cs +++ b/EOM.TSHotelManager.Application/Worker/History/WorkerHistoryService.cs @@ -23,8 +23,6 @@ */ using EOM.TSHotelManager.Common.Core; using EOM.TSHotelManager.EntityFramework; -using System; -using System.Collections.Generic; namespace EOM.TSHotelManager.Application { diff --git a/EOM.TSHotelManager.Application/Worker/IWorkerService.cs b/EOM.TSHotelManager.Application/Worker/IWorkerService.cs index a3d4465..8c61bc1 100644 --- a/EOM.TSHotelManager.Application/Worker/IWorkerService.cs +++ b/EOM.TSHotelManager.Application/Worker/IWorkerService.cs @@ -22,7 +22,6 @@ * */ using EOM.TSHotelManager.Common.Core; -using System.Collections.Generic; namespace EOM.TSHotelManager.Application { diff --git a/EOM.TSHotelManager.Application/Worker/Picture/IWorkerPicService.cs b/EOM.TSHotelManager.Application/Worker/Picture/IWorkerPicService.cs index 02d46ce..4ef5587 100644 --- a/EOM.TSHotelManager.Application/Worker/Picture/IWorkerPicService.cs +++ b/EOM.TSHotelManager.Application/Worker/Picture/IWorkerPicService.cs @@ -1,9 +1,4 @@ using EOM.TSHotelManager.Common.Core; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace EOM.TSHotelManager.Application { diff --git a/EOM.TSHotelManager.Application/Worker/Picture/WorkerPicService.cs b/EOM.TSHotelManager.Application/Worker/Picture/WorkerPicService.cs index b6bb168..fbef80b 100644 --- a/EOM.TSHotelManager.Application/Worker/Picture/WorkerPicService.cs +++ b/EOM.TSHotelManager.Application/Worker/Picture/WorkerPicService.cs @@ -1,13 +1,5 @@ -using CK.Common; -using EOM.Encrypt; -using EOM.TSHotelManager.Common.Core; +using EOM.TSHotelManager.Common.Core; using EOM.TSHotelManager.EntityFramework; -using System; -using System.Collections.Generic; -using System.Configuration; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace EOM.TSHotelManager.Application { @@ -49,7 +41,7 @@ namespace EOM.TSHotelManager.Application workerPicSource = workerPicRepository.GetSingle(a => a.WorkerId.Equals(workerPic.WorkerId)); //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 c5b9de5..4720319 100644 --- a/EOM.TSHotelManager.Application/Worker/WorkerService.cs +++ b/EOM.TSHotelManager.Application/Worker/WorkerService.cs @@ -21,22 +21,22 @@ *SOFTWARE. * */ -using CK.Common; using EOM.Encrypt; using EOM.TSHotelManager.Common.Core; using EOM.TSHotelManager.EntityFramework; +using Microsoft.Extensions.Configuration; +using Microsoft.IdentityModel.Tokens; using SqlSugar; -using SqlSugar.DistributedSystem.Snowflake; -using System; -using System.Collections.Generic; -using System.Linq; +using System.IdentityModel.Tokens.Jwt; +using System.Security.Claims; +using System.Text; namespace EOM.TSHotelManager.Application { /// /// 员工信息接口实现类 /// - public class WorkerService:IWorkerService + public class WorkerService : IWorkerService { /// /// 员工信息 @@ -74,7 +74,12 @@ namespace EOM.TSHotelManager.Application private readonly EOM.Encrypt.Encrypt encrypt; /// - /// + /// 配置 + /// + private readonly IConfiguration configuration; + + /// + /// 构造函数 /// /// /// @@ -83,7 +88,8 @@ namespace EOM.TSHotelManager.Application /// /// /// - public WorkerService(PgRepository workerRepository, PgRepository sexTypeRepository, PgRepository educationRepository, PgRepository nationRepository, PgRepository deptRepository, PgRepository positionRepository, EOM.Encrypt.Encrypt encrypt) + /// + public WorkerService(PgRepository workerRepository, PgRepository sexTypeRepository, PgRepository educationRepository, PgRepository nationRepository, PgRepository deptRepository, PgRepository positionRepository, Encrypt.Encrypt encrypt, IConfiguration configuration) { this.workerRepository = workerRepository; this.sexTypeRepository = sexTypeRepository; @@ -92,6 +98,7 @@ namespace EOM.TSHotelManager.Application this.deptRepository = deptRepository; this.positionRepository = positionRepository; this.encrypt = encrypt; + this.configuration = configuration; } #region 修改员工信息 @@ -106,7 +113,7 @@ namespace EOM.TSHotelManager.Application var sourceTelStr = string.Empty; if (!string.IsNullOrEmpty(worker.WorkerTel)) { - sourceTelStr = encrypt.Encryption(worker.WorkerTel,EncryptionLevel.Enhanced); + sourceTelStr = encrypt.Encryption(worker.WorkerTel, EncryptionLevel.Enhanced); } //加密身份证 var sourceIdStr = string.Empty; @@ -124,11 +131,11 @@ namespace EOM.TSHotelManager.Application WorkerFace = worker.WorkerFace, WorkerEducation = worker.WorkerEducation, WorkerNation = worker.WorkerNation, - CardId= worker.CardId, - WorkerSex = worker.WorkerSex, + CardId = worker.CardId, + WorkerSex = worker.WorkerSex, WorkerBirthday = worker.WorkerBirthday, datachg_usr = worker.datachg_usr - },a => a.WorkerId.Equals(worker.WorkerId)); + }, a => a.WorkerId.Equals(worker.WorkerId)); } #endregion @@ -232,7 +239,7 @@ namespace EOM.TSHotelManager.Application var position = positions.FirstOrDefault(a => a.position_no == source.WorkerPosition); source.PositionName = string.IsNullOrEmpty(position.position_name) ? "" : position.position_name; }); - + return workers; } @@ -241,9 +248,9 @@ namespace EOM.TSHotelManager.Application /// /// /// - public bool CheckWorkerBydepartment(string deptNo) + public bool CheckWorkerBydepartment(string deptNo) { - var workers = workerRepository.Count(a=> a.WorkerClub.Equals(deptNo)); + var workers = workerRepository.Count(a => a.WorkerClub.Equals(deptNo)); return workers > 0 ? true : false; } @@ -324,6 +331,25 @@ namespace EOM.TSHotelManager.Application //职位 var position = positionRepository.GetSingle(a => a.position_no == w.WorkerPosition); w.PositionName = string.IsNullOrEmpty(position.position_name) ? "" : position.position_name; + + //附带Token + var tokenHandler = new JwtSecurityTokenHandler(); + var key = Encoding.UTF8.GetBytes(configuration["Jwt:Key"]); + var tokenDescriptor = new SecurityTokenDescriptor + { + Subject = new ClaimsIdentity(new Claim[] + { + new Claim(ClaimTypes.Name, w.WorkerId) + }), + Expires = DateTime.Now.AddMinutes(20), // 设置Token过期时间 + SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(key), SecurityAlgorithms.HmacSha256Signature), + Audience = configuration["Jwt:Audience"], + Issuer = configuration["Jwt:Issuer"] + }; + + var token = tokenHandler.CreateToken(tokenDescriptor); + w.user_token = tokenHandler.WriteToken(token); + return w; } #endregion @@ -340,7 +366,7 @@ namespace EOM.TSHotelManager.Application { WorkerPwd = NewPwd, datachg_usr = worker.datachg_usr - },a => a.WorkerId == worker.WorkerId); + }, a => a.WorkerId == worker.WorkerId); } } diff --git a/EOM.TSHotelManager.Application/Zero/Admin/AdminService.cs b/EOM.TSHotelManager.Application/Zero/Admin/AdminService.cs index 4b3d259..0f686b9 100644 --- a/EOM.TSHotelManager.Application/Zero/Admin/AdminService.cs +++ b/EOM.TSHotelManager.Application/Zero/Admin/AdminService.cs @@ -25,10 +25,11 @@ using CK.Common; using EOM.Encrypt; using EOM.TSHotelManager.Common.Core; using EOM.TSHotelManager.EntityFramework; -using SqlSugar.DistributedSystem.Snowflake; -using System; -using System.Collections.Generic; -using System.Linq; +using Microsoft.Extensions.Configuration; +using Microsoft.IdentityModel.Tokens; +using System.IdentityModel.Tokens.Jwt; +using System.Security.Claims; +using System.Text; namespace EOM.TSHotelManager.Application { @@ -53,16 +54,23 @@ namespace EOM.TSHotelManager.Application private readonly EOM.Encrypt.Encrypt encrypt; /// - /// + /// 配置 + /// + private readonly IConfiguration configuration; + + /// + /// 构造函数 /// /// /// /// - public AdminService(PgRepository adminRepository, PgRepository adminTypeRepository, EOM.Encrypt.Encrypt encrypt) + /// + public AdminService(PgRepository adminRepository, PgRepository adminTypeRepository, Encrypt.Encrypt encrypt, IConfiguration configuration) { this.adminRepository = adminRepository; this.adminTypeRepository = adminTypeRepository; this.encrypt = encrypt; + this.configuration = configuration; } #region 根据超管密码查询员工类型和权限 @@ -75,7 +83,7 @@ namespace EOM.TSHotelManager.Application { Admin admins = new Admin(); - //admin.AdminPassword = encrypt.Encryption(admin.AdminPassword); + //admin.AdminPassword = encrypt.Decryption(admin.AdminPassword); admins = adminRepository.GetSingle(a => a.AdminAccount == admin.AdminAccount); @@ -85,16 +93,32 @@ namespace EOM.TSHotelManager.Application return admins; } - var frontEncryed = encrypt.Encryption(admins.AdminPassword, EncryptionLevel.Enhanced); - var backEncryed = encrypt.Encryption(admin.AdminPassword, EncryptionLevel.Enhanced); + var backEncryed = encrypt.Encryption(admins.AdminPassword, EncryptionLevel.Enhanced); - if (!encrypt.Compare(frontEncryed, backEncryed)) + if (!encrypt.Compare(admin.AdminPassword, backEncryed)) { admins = null; return admins; } admins.AdminPassword = ""; + //附带Token + var tokenHandler = new JwtSecurityTokenHandler(); + var key = Encoding.UTF8.GetBytes(configuration["Jwt:Key"]); + var tokenDescriptor = new SecurityTokenDescriptor + { + Subject = new ClaimsIdentity(new Claim[] + { + new Claim(ClaimTypes.Name, admins.AdminAccount) + }), + Expires = DateTime.Now.AddMinutes(20), // 设置Token过期时间 + SigningCredentials = new SigningCredentials(new SymmetricSecurityKey(key), SecurityAlgorithms.HmacSha256Signature), + Audience = configuration["Jwt:Audience"], + Issuer = configuration["Jwt:Issuer"] + }; + + var token = tokenHandler.CreateToken(tokenDescriptor); + admins.user_token = tokenHandler.WriteToken(token); return admins; } #endregion diff --git a/EOM.TSHotelManager.Application/Zero/Admin/IAdminService.cs b/EOM.TSHotelManager.Application/Zero/Admin/IAdminService.cs index 4452685..93ff8fd 100644 --- a/EOM.TSHotelManager.Application/Zero/Admin/IAdminService.cs +++ b/EOM.TSHotelManager.Application/Zero/Admin/IAdminService.cs @@ -22,7 +22,6 @@ * */ using EOM.TSHotelManager.Common.Core; -using System.Collections.Generic; namespace EOM.TSHotelManager.Application { diff --git a/EOM.TSHotelManager.Application/Zero/Base/BaseService.cs b/EOM.TSHotelManager.Application/Zero/Base/BaseService.cs index f41b8c2..352bcaf 100644 --- a/EOM.TSHotelManager.Application/Zero/Base/BaseService.cs +++ b/EOM.TSHotelManager.Application/Zero/Base/BaseService.cs @@ -25,19 +25,13 @@ using CK.Common; using EOM.TSHotelManager.Common.Core; using EOM.TSHotelManager.EntityFramework; using SqlSugar; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Text; -using System.Threading.Tasks; namespace EOM.TSHotelManager.Application { /// /// 基础信息接口实现类 /// - public class BaseService:IBaseService + public class BaseService : IBaseService { /// /// 员工信息 @@ -399,7 +393,7 @@ namespace EOM.TSHotelManager.Application return educationRepository.Update(a => new Education() { education_name = education.education_name, - datachg_usr =education.datachg_usr + datachg_usr = education.datachg_usr }, a => a.education_no == education.education_no); } @@ -419,10 +413,16 @@ namespace EOM.TSHotelManager.Application depts = deptRepository.GetList(a => a.delete_mk != 1); depts.ForEach(source => { - var dept = depts.FirstOrDefault(a => a.dept_no == source.dept_parent); - source.parent_name = dept == null || string.IsNullOrEmpty(dept.dept_name) ? "无" : dept.dept_name; - var leader = workers.FirstOrDefault(a => source.dept_leader != null && a.WorkerId == source.dept_leader); - source.leader_name = leader == null || string.IsNullOrEmpty(leader.WorkerName) ? "无" : leader.WorkerName; + if (!source.dept_parent.IsNullOrEmpty()) + { + var dept = depts.FirstOrDefault(a => a.dept_no == source.dept_parent); + source.parent_name = dept == null || string.IsNullOrEmpty(dept.dept_name) ? "无" : dept.dept_name; + } + if (!source.dept_leader.IsNullOrEmpty()) + { + var leader = workers.FirstOrDefault(a => a.WorkerId == source.dept_leader); + source.leader_name = leader == null || string.IsNullOrEmpty(leader.WorkerName) ? "无" : leader.WorkerName; + } }); return depts; diff --git a/EOM.TSHotelManager.Application/Zero/Base/IBaseService.cs b/EOM.TSHotelManager.Application/Zero/Base/IBaseService.cs index f5d5221..7f388e3 100644 --- a/EOM.TSHotelManager.Application/Zero/Base/IBaseService.cs +++ b/EOM.TSHotelManager.Application/Zero/Base/IBaseService.cs @@ -22,11 +22,6 @@ * */ using EOM.TSHotelManager.Common.Core; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace EOM.TSHotelManager.Application { diff --git a/EOM.TSHotelManager.Application/Zero/CheckInfo/CheckInfoService.cs b/EOM.TSHotelManager.Application/Zero/CheckInfo/CheckInfoService.cs index fa6ab12..e5f9385 100644 --- a/EOM.TSHotelManager.Application/Zero/CheckInfo/CheckInfoService.cs +++ b/EOM.TSHotelManager.Application/Zero/CheckInfo/CheckInfoService.cs @@ -23,9 +23,6 @@ */ using EOM.TSHotelManager.Common.Core; using EOM.TSHotelManager.EntityFramework; -using System; -using System.Collections.Generic; -using System.Data.SqlClient; namespace EOM.TSHotelManager.Application { diff --git a/EOM.TSHotelManager.Application/Zero/CheckInfo/ICheckInfoService.cs b/EOM.TSHotelManager.Application/Zero/CheckInfo/ICheckInfoService.cs index 38af52d..874c478 100644 --- a/EOM.TSHotelManager.Application/Zero/CheckInfo/ICheckInfoService.cs +++ b/EOM.TSHotelManager.Application/Zero/CheckInfo/ICheckInfoService.cs @@ -22,7 +22,6 @@ * */ using EOM.TSHotelManager.Common.Core; -using System.Collections.Generic; namespace EOM.TSHotelManager.Application { diff --git a/EOM.TSHotelManager.Application/Zero/Module/AdminModuleZeroService.cs b/EOM.TSHotelManager.Application/Zero/Module/AdminModuleZeroService.cs index 08d6d22..41af447 100644 --- a/EOM.TSHotelManager.Application/Zero/Module/AdminModuleZeroService.cs +++ b/EOM.TSHotelManager.Application/Zero/Module/AdminModuleZeroService.cs @@ -1,10 +1,5 @@ using EOM.TSHotelManager.Common.Core; using EOM.TSHotelManager.EntityFramework; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace EOM.TSHotelManager.Application { diff --git a/EOM.TSHotelManager.Application/Zero/Module/IAdminModuleZeroService.cs b/EOM.TSHotelManager.Application/Zero/Module/IAdminModuleZeroService.cs index afcbfae..38d2f2d 100644 --- a/EOM.TSHotelManager.Application/Zero/Module/IAdminModuleZeroService.cs +++ b/EOM.TSHotelManager.Application/Zero/Module/IAdminModuleZeroService.cs @@ -1,9 +1,4 @@ using EOM.TSHotelManager.Common.Core; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace EOM.TSHotelManager.Application { diff --git a/EOM.TSHotelManager.Application/Zero/Notice/INoticeService.cs b/EOM.TSHotelManager.Application/Zero/Notice/INoticeService.cs index 15954c2..b90cd71 100644 --- a/EOM.TSHotelManager.Application/Zero/Notice/INoticeService.cs +++ b/EOM.TSHotelManager.Application/Zero/Notice/INoticeService.cs @@ -22,7 +22,6 @@ * */ using EOM.TSHotelManager.Common.Core; -using System.Collections.Generic; namespace EOM.TSHotelManager.Application { diff --git a/EOM.TSHotelManager.Application/Zero/Notice/NoticeService.cs b/EOM.TSHotelManager.Application/Zero/Notice/NoticeService.cs index f0167bc..83ab411 100644 --- a/EOM.TSHotelManager.Application/Zero/Notice/NoticeService.cs +++ b/EOM.TSHotelManager.Application/Zero/Notice/NoticeService.cs @@ -23,15 +23,13 @@ */ using EOM.TSHotelManager.Common.Core; using EOM.TSHotelManager.EntityFramework; -using System; -using System.Collections.Generic; namespace EOM.TSHotelManager.Application { /// /// 公告信息接口实现类 /// - public class NoticeService:INoticeService + public class NoticeService : INoticeService { /// /// 公告 diff --git a/EOM.TSHotelManager.Application/Zero/VipRule/IVipRuleAppService.cs b/EOM.TSHotelManager.Application/Zero/VipRule/IVipRuleAppService.cs index a168e0f..6fe660a 100644 --- a/EOM.TSHotelManager.Application/Zero/VipRule/IVipRuleAppService.cs +++ b/EOM.TSHotelManager.Application/Zero/VipRule/IVipRuleAppService.cs @@ -23,11 +23,6 @@ *模块说明:会员等级规则功能模块接口 */ using EOM.TSHotelManager.Common.Core; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace EOM.TSHotelManager.Application { diff --git a/EOM.TSHotelManager.Application/Zero/VipRule/VipRuleAppService.cs b/EOM.TSHotelManager.Application/Zero/VipRule/VipRuleAppService.cs index 49b4fd4..04b9a33 100644 --- a/EOM.TSHotelManager.Application/Zero/VipRule/VipRuleAppService.cs +++ b/EOM.TSHotelManager.Application/Zero/VipRule/VipRuleAppService.cs @@ -23,18 +23,13 @@ */ using EOM.TSHotelManager.Common.Core; using EOM.TSHotelManager.EntityFramework; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace EOM.TSHotelManager.Application { /// /// 会员等级规则功能模块接口实现类 /// - public class VipRuleAppService:IVipRuleAppService + public class VipRuleAppService : IVipRuleAppService { /// /// 会员等级规则 @@ -106,7 +101,7 @@ namespace EOM.TSHotelManager.Application /// public bool AddVipRule(VipRule vipRule) { - return vipRuleRepository.Insert(new VipRule() + return vipRuleRepository.Insert(new VipRule() { rule_id = vipRule.rule_id, rule_name = vipRule.rule_name, @@ -128,7 +123,7 @@ namespace EOM.TSHotelManager.Application { delete_mk = 1, datachg_usr = vipRule.datachg_usr, - },a => a.rule_id == vipRule.rule_id); + }, a => a.rule_id == vipRule.rule_id); } /// diff --git a/EOM.TSHotelManager.Common.Core/BaseDTO.cs b/EOM.TSHotelManager.Common.Core/BaseDTO.cs index b10f82d..b9692b7 100644 --- a/EOM.TSHotelManager.Common.Core/BaseDTO.cs +++ b/EOM.TSHotelManager.Common.Core/BaseDTO.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace EOM.TSHotelManager.Common.Core { @@ -16,8 +12,8 @@ namespace EOM.TSHotelManager.Common.Core /// /// 资料创建时间 /// - [SqlSugar.SugarColumn(/*InsertServerTime = true,*/ IsOnlyIgnoreUpdate = true)] - public DateTime? datains_date { get; set; } + [SqlSugar.SugarColumn(IsOnlyIgnoreUpdate = true)] + public DateTime? datains_date { get; set; } = DateTime.Now; /// /// 资料更新人 /// @@ -26,8 +22,12 @@ namespace EOM.TSHotelManager.Common.Core /// /// 资料更新时间 /// - [SqlSugar.SugarColumn(/*UpdateServerTime = true,*/IsOnlyIgnoreInsert = true)] - public DateTime? datachg_date { get; set; } - + [SqlSugar.SugarColumn(IsOnlyIgnoreInsert = true)] + public DateTime? datachg_date { get; set; } = DateTime.Now; + /// + /// Token + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string user_token { get; set; } } } diff --git a/EOM.TSHotelManager.Common.Core/Business/Customer/CustoType.cs b/EOM.TSHotelManager.Common.Core/Business/Customer/CustoType.cs index a566445..c0cc2aa 100644 --- a/EOM.TSHotelManager.Common.Core/Business/Customer/CustoType.cs +++ b/EOM.TSHotelManager.Common.Core/Business/Customer/CustoType.cs @@ -22,8 +22,6 @@ * *模块说明:客户类型类 */ -using System; - namespace EOM.TSHotelManager.Common.Core { /// diff --git a/EOM.TSHotelManager.Common.Core/Business/Customer/PassPortType.cs b/EOM.TSHotelManager.Common.Core/Business/Customer/PassPortType.cs index 7d0a5ca..7ac1ff0 100644 --- a/EOM.TSHotelManager.Common.Core/Business/Customer/PassPortType.cs +++ b/EOM.TSHotelManager.Common.Core/Business/Customer/PassPortType.cs @@ -22,12 +22,6 @@ * *模块说明:证件类型类 */ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace EOM.TSHotelManager.Common.Core { /// diff --git a/EOM.TSHotelManager.Common.Core/Business/Customer/SexType.cs b/EOM.TSHotelManager.Common.Core/Business/Customer/SexType.cs index e78a48d..f34d86a 100644 --- a/EOM.TSHotelManager.Common.Core/Business/Customer/SexType.cs +++ b/EOM.TSHotelManager.Common.Core/Business/Customer/SexType.cs @@ -22,12 +22,6 @@ * *模块说明:性别类 */ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace EOM.TSHotelManager.Common.Core { /// diff --git a/EOM.TSHotelManager.Common.Core/Business/Room/RoomState.cs b/EOM.TSHotelManager.Common.Core/Business/Room/RoomState.cs index 2ad589f..4f67103 100644 --- a/EOM.TSHotelManager.Common.Core/Business/Room/RoomState.cs +++ b/EOM.TSHotelManager.Common.Core/Business/Room/RoomState.cs @@ -22,8 +22,6 @@ * *模块说明:房间状态类 */ -using System; - namespace EOM.TSHotelManager.Common.Core { /// diff --git a/EOM.TSHotelManager.Common.Core/Business/Room/RoomType.cs b/EOM.TSHotelManager.Common.Core/Business/Room/RoomType.cs index 40a1759..171a6b0 100644 --- a/EOM.TSHotelManager.Common.Core/Business/Room/RoomType.cs +++ b/EOM.TSHotelManager.Common.Core/Business/Room/RoomType.cs @@ -22,15 +22,13 @@ * *模块说明:房间类型类 */ -using System; - namespace EOM.TSHotelManager.Common.Core { /// /// 房间类型 /// [SqlSugar.SugarTable("roomtype")] - public class RoomType: BaseDTO + public class RoomType : BaseDTO { /// /// 类型编号 @@ -45,7 +43,7 @@ namespace EOM.TSHotelManager.Common.Core /// /// 房间租金 /// - [SqlSugar.SugarColumn(ColumnName = "room_rent",ColumnDataType = "decimal")] + [SqlSugar.SugarColumn(ColumnName = "room_rent", ColumnDataType = "decimal")] public decimal RoomRent { get; set; } /// diff --git a/EOM.TSHotelManager.Common.Core/Business/Sellthing/SellThing.cs b/EOM.TSHotelManager.Common.Core/Business/Sellthing/SellThing.cs index 7bb7b96..5651c11 100644 --- a/EOM.TSHotelManager.Common.Core/Business/Sellthing/SellThing.cs +++ b/EOM.TSHotelManager.Common.Core/Business/Sellthing/SellThing.cs @@ -22,7 +22,6 @@ * *模块说明:商品信息类 */ -using System; //using System.ComponentModel.DataAnnotations.Schema; namespace EOM.TSHotelManager.Common.Core diff --git a/EOM.TSHotelManager.Common.Core/Business/Spend/SpendConsts.cs b/EOM.TSHotelManager.Common.Core/Business/Spend/SpendConsts.cs index b92d514..4e920c8 100644 --- a/EOM.TSHotelManager.Common.Core/Business/Spend/SpendConsts.cs +++ b/EOM.TSHotelManager.Common.Core/Business/Spend/SpendConsts.cs @@ -22,12 +22,6 @@ * *模块说明:结算状态常量 */ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace EOM.TSHotelManager.Common.Core { /// diff --git a/EOM.TSHotelManager.Common.Core/Business/Wti/Wti.cs b/EOM.TSHotelManager.Common.Core/Business/Wti/Wti.cs index 0175d98..b9608cd 100644 --- a/EOM.TSHotelManager.Common.Core/Business/Wti/Wti.cs +++ b/EOM.TSHotelManager.Common.Core/Business/Wti/Wti.cs @@ -35,7 +35,7 @@ namespace EOM.TSHotelManager.Common.Core /// /// 信息编号 /// - [SqlSugar.SugarColumn(ColumnName = "WtiNo",IsIdentity =true,IsPrimaryKey =true)] + [SqlSugar.SugarColumn(ColumnName = "WtiNo", IsIdentity = true, IsPrimaryKey = true)] public int WtiNo { get; set; } /// /// 房间编号 @@ -65,7 +65,7 @@ namespace EOM.TSHotelManager.Common.Core /// /// 记录员 /// - [SqlSugar.SugarColumn(ColumnName = "Record",DefaultValue = "Admin")] + [SqlSugar.SugarColumn(ColumnName = "Record", DefaultValue = "Admin")] public string Record { get; set; } /// /// 客户编号 diff --git a/EOM.TSHotelManager.Common.Core/Sys/NavBar/NavBar.cs b/EOM.TSHotelManager.Common.Core/Sys/NavBar/NavBar.cs index 7211388..969fd7a 100644 --- a/EOM.TSHotelManager.Common.Core/Sys/NavBar/NavBar.cs +++ b/EOM.TSHotelManager.Common.Core/Sys/NavBar/NavBar.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace EOM.TSHotelManager.Common.Core +namespace EOM.TSHotelManager.Common.Core { /// /// 导航控件实体类 @@ -15,7 +9,7 @@ namespace EOM.TSHotelManager.Common.Core /// /// 导航控件ID /// - [SqlSugar.SugarColumn(IsIdentity =true)] + [SqlSugar.SugarColumn(IsIdentity = true)] public int nav_id { get; set; } /// /// 导航控件名称 diff --git a/EOM.TSHotelManager.Common.Core/Util/ApplicationVersion.cs b/EOM.TSHotelManager.Common.Core/Util/ApplicationVersion.cs index 9953177..adb0fcc 100644 --- a/EOM.TSHotelManager.Common.Core/Util/ApplicationVersion.cs +++ b/EOM.TSHotelManager.Common.Core/Util/ApplicationVersion.cs @@ -1,9 +1,4 @@ using SqlSugar; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace EOM.TSHotelManager.Common.Core { diff --git a/EOM.TSHotelManager.Common.Core/Util/Cardcodes.cs b/EOM.TSHotelManager.Common.Core/Util/Cardcodes.cs index 96dec22..0901645 100644 --- a/EOM.TSHotelManager.Common.Core/Util/Cardcodes.cs +++ b/EOM.TSHotelManager.Common.Core/Util/Cardcodes.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace EOM.TSHotelManager.Common.Core +namespace EOM.TSHotelManager.Common.Core { /// /// 卡片代码 diff --git a/EOM.TSHotelManager.Common.Core/Util/OperationLog.cs b/EOM.TSHotelManager.Common.Core/Util/OperationLog.cs index c183859..a0ec77e 100644 --- a/EOM.TSHotelManager.Common.Core/Util/OperationLog.cs +++ b/EOM.TSHotelManager.Common.Core/Util/OperationLog.cs @@ -23,8 +23,6 @@ *模块说明:操作日志类 */ using System; -using System.Linq; -using System.Net; namespace EOM.TSHotelManager.Common.Core { diff --git a/EOM.TSHotelManager.Common.Core/Worker/GBType.cs b/EOM.TSHotelManager.Common.Core/Worker/GBType.cs index f9985d0..22220d6 100644 --- a/EOM.TSHotelManager.Common.Core/Worker/GBType.cs +++ b/EOM.TSHotelManager.Common.Core/Worker/GBType.cs @@ -23,8 +23,6 @@ *模块说明:奖惩类型类 */ //using EOM.TSHotelManager.Common.Core; -using System; - namespace EOM.TSHotelManager.Common.Core { /// diff --git a/EOM.TSHotelManager.Common.Core/Worker/WorkerGoodBad.cs b/EOM.TSHotelManager.Common.Core/Worker/WorkerGoodBad.cs index cfef27c..7dff223 100644 --- a/EOM.TSHotelManager.Common.Core/Worker/WorkerGoodBad.cs +++ b/EOM.TSHotelManager.Common.Core/Worker/WorkerGoodBad.cs @@ -23,10 +23,6 @@ *模块说明:员工奖惩类 */ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace EOM.TSHotelManager.Common.Core { diff --git a/EOM.TSHotelManager.Common.Core/Worker/WorkerHistory.cs b/EOM.TSHotelManager.Common.Core/Worker/WorkerHistory.cs index 18e4caa..23b7fbc 100644 --- a/EOM.TSHotelManager.Common.Core/Worker/WorkerHistory.cs +++ b/EOM.TSHotelManager.Common.Core/Worker/WorkerHistory.cs @@ -35,7 +35,7 @@ namespace EOM.TSHotelManager.Common.Core /// /// 编号 /// - [SqlSugar.SugarColumn(IsOnlyIgnoreInsert = true,IsOnlyIgnoreUpdate = true)] + [SqlSugar.SugarColumn(IsOnlyIgnoreInsert = true, IsOnlyIgnoreUpdate = true)] public int Id { get; set; } /// /// 工号 diff --git a/EOM.TSHotelManager.Common.Core/Worker/WorkerPic.cs b/EOM.TSHotelManager.Common.Core/Worker/WorkerPic.cs index f49b916..381a152 100644 --- a/EOM.TSHotelManager.Common.Core/Worker/WorkerPic.cs +++ b/EOM.TSHotelManager.Common.Core/Worker/WorkerPic.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -//using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - +//using System.ComponentModel.DataAnnotations.Schema; namespace EOM.TSHotelManager.Common.Core { /// @@ -16,7 +10,7 @@ namespace EOM.TSHotelManager.Common.Core /// /// 自增长流水号 /// - [SqlSugar.SugarColumn(IsIdentity = true,ColumnName = "Id",IsPrimaryKey = true)] + [SqlSugar.SugarColumn(IsIdentity = true, ColumnName = "Id", IsPrimaryKey = true)] public int Id { get; set; } /// /// 工号 diff --git a/EOM.TSHotelManager.Common.Core/Zero/Admin.cs b/EOM.TSHotelManager.Common.Core/Zero/Admin.cs index da92a8c..4b1b7ae 100644 --- a/EOM.TSHotelManager.Common.Core/Zero/Admin.cs +++ b/EOM.TSHotelManager.Common.Core/Zero/Admin.cs @@ -96,6 +96,6 @@ namespace EOM.TSHotelManager.Common.Core /// [SqlSugar.SugarColumn(IsIgnore = true)] public string DeleteNm { get; set; } - + } } diff --git a/EOM.TSHotelManager.Common.Core/Zero/AdminType.cs b/EOM.TSHotelManager.Common.Core/Zero/AdminType.cs index 09a3944..ae072d5 100644 --- a/EOM.TSHotelManager.Common.Core/Zero/AdminType.cs +++ b/EOM.TSHotelManager.Common.Core/Zero/AdminType.cs @@ -22,12 +22,6 @@ * *模块说明:管理员类型 */ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace EOM.TSHotelManager.Common.Core { /// diff --git a/EOM.TSHotelManager.Common.Core/Zero/Base.cs b/EOM.TSHotelManager.Common.Core/Zero/Base.cs index 1b14386..6154936 100644 --- a/EOM.TSHotelManager.Common.Core/Zero/Base.cs +++ b/EOM.TSHotelManager.Common.Core/Zero/Base.cs @@ -22,12 +22,6 @@ * *模块说明:系统信息静态类 */ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace EOM.TSHotelManager.Common.Core { /// diff --git a/EOM.TSHotelManager.Common.Core/Zero/CheckInfo.cs b/EOM.TSHotelManager.Common.Core/Zero/CheckInfo.cs index 259fbeb..06366e6 100644 --- a/EOM.TSHotelManager.Common.Core/Zero/CheckInfo.cs +++ b/EOM.TSHotelManager.Common.Core/Zero/CheckInfo.cs @@ -22,8 +22,6 @@ * *模块说明:监管统计类 */ -using System; - namespace EOM.TSHotelManager.Common.Core { /// diff --git a/EOM.TSHotelManager.Common.Core/Zero/Dept.cs b/EOM.TSHotelManager.Common.Core/Zero/Dept.cs index f3bd3b3..0252197 100644 --- a/EOM.TSHotelManager.Common.Core/Zero/Dept.cs +++ b/EOM.TSHotelManager.Common.Core/Zero/Dept.cs @@ -23,10 +23,6 @@ *模块说明:部门实体类 */ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace EOM.TSHotelManager.Common.Core { diff --git a/EOM.TSHotelManager.Common.Core/Zero/Education.cs b/EOM.TSHotelManager.Common.Core/Zero/Education.cs index d679a0f..c562be9 100644 --- a/EOM.TSHotelManager.Common.Core/Zero/Education.cs +++ b/EOM.TSHotelManager.Common.Core/Zero/Education.cs @@ -22,12 +22,6 @@ * *模块说明:学历类 */ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace EOM.TSHotelManager.Common.Core { /// diff --git a/EOM.TSHotelManager.Common.Core/Zero/Module.cs b/EOM.TSHotelManager.Common.Core/Zero/Module.cs index ecf7ade..cc1460b 100644 --- a/EOM.TSHotelManager.Common.Core/Zero/Module.cs +++ b/EOM.TSHotelManager.Common.Core/Zero/Module.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace EOM.TSHotelManager.Common.Core +namespace EOM.TSHotelManager.Common.Core { /// /// 模块实体 diff --git a/EOM.TSHotelManager.Common.Core/Zero/ModuleConsts.cs b/EOM.TSHotelManager.Common.Core/Zero/ModuleConsts.cs index 3132738..61d1885 100644 --- a/EOM.TSHotelManager.Common.Core/Zero/ModuleConsts.cs +++ b/EOM.TSHotelManager.Common.Core/Zero/ModuleConsts.cs @@ -22,12 +22,6 @@ * *模块说明:系统模块常量类 */ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace EOM.TSHotelManager.Common.Core { /// diff --git a/EOM.TSHotelManager.Common.Core/Zero/ModuleZero.cs b/EOM.TSHotelManager.Common.Core/Zero/ModuleZero.cs index d7103c5..39399d0 100644 --- a/EOM.TSHotelManager.Common.Core/Zero/ModuleZero.cs +++ b/EOM.TSHotelManager.Common.Core/Zero/ModuleZero.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace EOM.TSHotelManager.Common.Core +namespace EOM.TSHotelManager.Common.Core { /// @@ -16,7 +10,7 @@ namespace EOM.TSHotelManager.Common.Core /// /// 模块ID /// - [SqlSugar.SugarColumn(IsIdentity = true,ColumnName = "module_id")] + [SqlSugar.SugarColumn(IsIdentity = true, ColumnName = "module_id")] public int module_id { get; set; } /// /// 管理员账号 diff --git a/EOM.TSHotelManager.Common.Core/Zero/Nation.cs b/EOM.TSHotelManager.Common.Core/Zero/Nation.cs index 41ba761..fdc8e33 100644 --- a/EOM.TSHotelManager.Common.Core/Zero/Nation.cs +++ b/EOM.TSHotelManager.Common.Core/Zero/Nation.cs @@ -22,12 +22,6 @@ * *模块说明:民族类 */ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace EOM.TSHotelManager.Common.Core { /// diff --git a/EOM.TSHotelManager.Common.Core/Zero/VipRule.cs b/EOM.TSHotelManager.Common.Core/Zero/VipRule.cs index b4903b2..2a905c1 100644 --- a/EOM.TSHotelManager.Common.Core/Zero/VipRule.cs +++ b/EOM.TSHotelManager.Common.Core/Zero/VipRule.cs @@ -22,12 +22,6 @@ * *模块说明:会员等级规则类 */ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace EOM.TSHotelManager.Common.Core { /// diff --git a/EOM.TSHotelManager.Common.Core/Zero/position.cs b/EOM.TSHotelManager.Common.Core/Zero/position.cs index 66cb504..2758355 100644 --- a/EOM.TSHotelManager.Common.Core/Zero/position.cs +++ b/EOM.TSHotelManager.Common.Core/Zero/position.cs @@ -22,12 +22,6 @@ * *模块说明:职务类 */ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace EOM.TSHotelManager.Common.Core { /// diff --git a/EOM.TSHotelManager.EntityFramework/AppSettingsJson.cs b/EOM.TSHotelManager.EntityFramework/AppSettingsJson.cs index 77f118f..cd3a0ec 100644 --- a/EOM.TSHotelManager.EntityFramework/AppSettingsJson.cs +++ b/EOM.TSHotelManager.EntityFramework/AppSettingsJson.cs @@ -1,10 +1,4 @@ using Microsoft.Extensions.Configuration; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace EOM.TSHotelManager.EntityFramework { diff --git a/EOM.TSHotelManager.EntityFramework/Repository/PgRepository.cs b/EOM.TSHotelManager.EntityFramework/Repository/PgRepository.cs index 4277485..d35d4a8 100644 --- a/EOM.TSHotelManager.EntityFramework/Repository/PgRepository.cs +++ b/EOM.TSHotelManager.EntityFramework/Repository/PgRepository.cs @@ -1,10 +1,5 @@ -using SqlSugar; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Configuration; +using SqlSugar; namespace EOM.TSHotelManager.EntityFramework { @@ -22,9 +17,10 @@ namespace EOM.TSHotelManager.EntityFramework MoreSettings = new ConnMoreSettings() { PgSqlIsAutoToLower = false, //数据库存在大写字段的 - //,需要把这个设为false ,并且实体和字段名称要一样 - //如果数据库里的数据表本身就为小写,则改成true - //详细可以参考官网https://www.donet5.com/Home/Doc + //,需要把这个设为false ,并且实体和字段名称要一样 + //如果数据库里的数据表本身就为小写,则改成true + //详细可以参考官网https://www.donet5.com/Home/Doc + DisableMillisecond = true, }, ConnectionString = AppSettingsJson.GetAppSettings().GetConnectionString("PgSqlConnectStr") }); diff --git a/EOM.TSHotelManager.WebApi/Controllers/Business/Cash/CashController.cs b/EOM.TSHotelManager.WebApi/Controllers/Business/Cash/CashController.cs index 1852b24..388523c 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Business/Cash/CashController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Business/Cash/CashController.cs @@ -1,6 +1,5 @@ using EOM.TSHotelManager.Application; using EOM.TSHotelManager.Common.Core; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; @@ -31,7 +30,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool AddCashInfo([FromBody]Cash cash) + public bool AddCashInfo([FromBody] Cash cash) { return cashService.AddCashInfo(cash); } diff --git a/EOM.TSHotelManager.WebApi/Controllers/Business/Customer/CustoController.cs b/EOM.TSHotelManager.WebApi/Controllers/Business/Customer/CustoController.cs index 676e1e7..6310c7d 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Business/Customer/CustoController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Business/Customer/CustoController.cs @@ -1,6 +1,5 @@ using EOM.TSHotelManager.Application; using EOM.TSHotelManager.Common.Core; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; @@ -31,7 +30,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool InsertCustomerInfo([FromBody]Custo custo) + public bool InsertCustomerInfo([FromBody] Custo custo) { return customerService.InsertCustomerInfo(custo); } @@ -42,7 +41,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool UpdCustomerInfoByCustoNo([FromBody]Custo custo) + public bool UpdCustomerInfoByCustoNo([FromBody] Custo custo) { return customerService.UpdCustomerInfoByCustoNo(custo); } @@ -54,7 +53,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public bool UpdCustomerTypeByCustoNo([FromQuery]string custoNo,int userType) + public bool UpdCustomerTypeByCustoNo([FromQuery] string custoNo, int userType) { return customerService.UpdCustomerTypeByCustoNo(custoNo, userType); } @@ -74,9 +73,9 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public OSelectCustoAllDto SelectCustoAll([FromQuery] int pageIndex, int pageSize) + public OSelectCustoAllDto SelectCustoAll([FromQuery] int pageIndex, int pageSize, bool onlyVip = false) { - return customerService.SelectCustoAll(pageIndex,pageSize); + return customerService.SelectCustoAll(pageIndex, pageSize, onlyVip); } /// @@ -84,7 +83,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public List SelectCustoByInfo([FromBody]Custo custo) + public List SelectCustoByInfo([FromBody] Custo custo) { return customerService.SelectCustoByInfo(custo); } diff --git a/EOM.TSHotelManager.WebApi/Controllers/Business/Fonts/FontsController.cs b/EOM.TSHotelManager.WebApi/Controllers/Business/Fonts/FontsController.cs index 053fd7d..d7adc6f 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Business/Fonts/FontsController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Business/Fonts/FontsController.cs @@ -1,6 +1,5 @@ using EOM.TSHotelManager.Application; using EOM.TSHotelManager.Common.Core; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; diff --git a/EOM.TSHotelManager.WebApi/Controllers/Business/Reser/ReserController.cs b/EOM.TSHotelManager.WebApi/Controllers/Business/Reser/ReserController.cs index 37ce05e..2a9055c 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Business/Reser/ReserController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Business/Reser/ReserController.cs @@ -1,9 +1,7 @@ using EOM.TSHotelManager.Application; using EOM.TSHotelManager.Common.Core; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; -using System.Security.Cryptography; namespace EOM.TSHotelManager.WebApi.Controllers { @@ -42,7 +40,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public Reser SelectReserInfoByRoomNo([FromQuery]string no) + public Reser SelectReserInfoByRoomNo([FromQuery] string no) { return reserService.SelectReserInfoByRoomNo(no); } @@ -53,7 +51,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool DeleteReserInfo([FromBody]Reser reser) + public bool DeleteReserInfo([FromBody] Reser reser) { return reserService.DeleteReserInfo(reser); } @@ -64,7 +62,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool InserReserInfo([FromBody]Reser r) + public bool InserReserInfo([FromBody] Reser r) { return reserService.InserReserInfo(r); } diff --git a/EOM.TSHotelManager.WebApi/Controllers/Business/Room/RoomController.cs b/EOM.TSHotelManager.WebApi/Controllers/Business/Room/RoomController.cs index b6656ad..edc935e 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Business/Room/RoomController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Business/Room/RoomController.cs @@ -1,6 +1,5 @@ using EOM.TSHotelManager.Application; using EOM.TSHotelManager.Common.Core; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; @@ -31,7 +30,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public List SelectRoomByRoomState([FromQuery]int stateid) + public List SelectRoomByRoomState([FromQuery] int stateid) { return roomService.SelectRoomByRoomState(stateid); } @@ -105,7 +104,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool UpdateRoomInfo([FromBody]Room r) + public bool UpdateRoomInfo([FromBody] Room r) { return roomService.UpdateRoomInfo(r); } @@ -146,7 +145,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public object SelectRoomByRoomPrice([FromQuery]string r) + public object SelectRoomByRoomPrice([FromQuery] string r) { return roomService.SelectRoomByRoomPrice(r); } @@ -188,9 +187,9 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public bool UpdateRoomStateByRoomNo([FromQuery]string roomno, int stateid) + public bool UpdateRoomStateByRoomNo([FromQuery] string roomno, int stateid) { - return roomService.UpdateRoomStateByRoomNo(roomno,stateid); + return roomService.UpdateRoomStateByRoomNo(roomno, stateid); } /// @@ -199,7 +198,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool InsertRoom([FromBody]Room rn) + public bool InsertRoom([FromBody] Room rn) { return roomService.InsertRoom(rn); } @@ -230,7 +229,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public object SelectRoomStateIdByRoomNo([FromQuery]string roomno) + public object SelectRoomStateIdByRoomNo([FromQuery] string roomno) { return roomService.SelectRoomStateIdByRoomNo(roomno); } diff --git a/EOM.TSHotelManager.WebApi/Controllers/Business/Room/RoomTypeController.cs b/EOM.TSHotelManager.WebApi/Controllers/Business/Room/RoomTypeController.cs index 173edab..d9d5fac 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Business/Room/RoomTypeController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Business/Room/RoomTypeController.cs @@ -1,6 +1,5 @@ using EOM.TSHotelManager.Application; using EOM.TSHotelManager.Common.Core; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; @@ -41,7 +40,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public RoomType SelectRoomTypeByRoomNo([FromQuery]string no) + public RoomType SelectRoomTypeByRoomNo([FromQuery] string no) { return roomTypeService.SelectRoomTypeByRoomNo(no); } diff --git a/EOM.TSHotelManager.WebApi/Controllers/Business/Sellthing/SellthingController.cs b/EOM.TSHotelManager.WebApi/Controllers/Business/Sellthing/SellthingController.cs index 0cf486f..e6f491e 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Business/Sellthing/SellthingController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Business/Sellthing/SellthingController.cs @@ -1,10 +1,7 @@ using EOM.TSHotelManager.Application; using EOM.TSHotelManager.Common.Core; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -using System.Collections; using System.Collections.Generic; -using System.Xml.Linq; namespace EOM.TSHotelManager.WebApi.Controllers { @@ -32,7 +29,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public List SelectSellThingAll([FromQuery]SellThing sellThing = null) + public List SelectSellThingAll([FromQuery] SellThing sellThing = null) { return sellService.SelectSellThingAll(sellThing); } @@ -44,7 +41,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool UpdateSellThing([FromBody]string stock, string sellNo) + public bool UpdateSellThing([FromBody] string stock, string sellNo) { return sellService.UpdateSellThing(stock, sellNo); } @@ -79,7 +76,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public bool DeleteSellThingBySellNo([FromQuery]string sellNo) + public bool DeleteSellThingBySellNo([FromQuery] string sellNo) { return sellService.DeleteSellThingBySellNo(sellNo); } @@ -91,7 +88,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public SellThing SelectSellThingByNameAndPrice([FromQuery]string name, string price) + public SellThing SelectSellThingByNameAndPrice([FromQuery] string name, string price) { return sellService.SelectSellThingByNameAndPrice(name, price); } @@ -103,7 +100,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public SellThing SelectSellInfoBySellNo([FromQuery]string SellNo) + public SellThing SelectSellInfoBySellNo([FromQuery] string SellNo) { return sellService.SelectSellInfoBySellNo(SellNo); } @@ -114,7 +111,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool InsertSellThing([FromBody]SellThing st) + public bool InsertSellThing([FromBody] SellThing st) { return sellService.InsertSellThing(st); } diff --git a/EOM.TSHotelManager.WebApi/Controllers/Business/Spend/SpendController.cs b/EOM.TSHotelManager.WebApi/Controllers/Business/Spend/SpendController.cs index cd619cd..afae9b6 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Business/Spend/SpendController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Business/Spend/SpendController.cs @@ -1,8 +1,6 @@ using EOM.TSHotelManager.Application; using EOM.TSHotelManager.Common.Core; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; -using System; using System.Collections.Generic; namespace EOM.TSHotelManager.WebApi.Controllers @@ -32,7 +30,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool InsertSpendInfo([FromBody]Spend s) + public bool InsertSpendInfo([FromBody] Spend s) { return spendService.InsertSpendInfo(s); } @@ -43,7 +41,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public List SelectSpendByCustoNo([FromQuery]string No) + public List SelectSpendByCustoNo([FromQuery] string No) { return spendService.SelectSpendByCustoNo(No); } @@ -54,7 +52,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public List SelectSpendByRoomNo([FromQuery]string No) + public List SelectSpendByRoomNo([FromQuery] string No) { return spendService.SelectSpendByRoomNo(No); } @@ -65,7 +63,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public List SeletHistorySpendInfoAll([FromQuery]string custoNo) + public List SeletHistorySpendInfoAll([FromQuery] string custoNo) { return spendService.SeletHistorySpendInfoAll(custoNo); } @@ -85,7 +83,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public List SelectSpendInfoRoomNo([FromQuery]string RoomNo) + public List SelectSpendInfoRoomNo([FromQuery] string RoomNo) { return spendService.SelectSpendInfoRoomNo(RoomNo); } @@ -97,7 +95,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public object SelectMoneyByRoomNoAndTime([FromQuery]string roomno, string custono) + public object SelectMoneyByRoomNoAndTime([FromQuery] string roomno, string custono) { return spendService.SelectMoneyByRoomNoAndTime(roomno, custono); } @@ -131,7 +129,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool UpdSpenInfo([FromBody]Spend spend) + public bool UpdSpenInfo([FromBody] Spend spend) { return spendService.UpdSpenInfo(spend); } diff --git a/EOM.TSHotelManager.WebApi/Controllers/Business/Wti/WtiController.cs b/EOM.TSHotelManager.WebApi/Controllers/Business/Wti/WtiController.cs index 097996f..d83cc81 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Business/Wti/WtiController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Business/Wti/WtiController.cs @@ -1,6 +1,5 @@ using EOM.TSHotelManager.Application; using EOM.TSHotelManager.Common.Core; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; @@ -31,7 +30,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public Wti SelectWtiInfoByRoomNo([FromQuery]string roomNo) + public Wti SelectWtiInfoByRoomNo([FromQuery] string roomNo) { return this.wtiService.SelectWtiInfoByRoomNo(roomNo); } @@ -44,7 +43,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public Wti SelectWtiInfoByRoomNoAndTime([FromQuery]string roomno, string usedate, string enddate) + public Wti SelectWtiInfoByRoomNoAndTime([FromQuery] string roomno, string usedate, string enddate) { return this.wtiService.SelectWtiInfoByRoomNoAndTime(roomno, usedate, enddate); } @@ -65,7 +64,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool InsertWtiInfo([FromBody]Wti w) + public bool InsertWtiInfo([FromBody] Wti w) { return this.wtiService.InsertWtiInfo(w); } @@ -76,7 +75,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool UpdateWtiInfo([FromBody]Wti w) + public bool UpdateWtiInfo([FromBody] Wti w) { return this.wtiService.UpdateWtiInfo(w); } @@ -87,7 +86,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool UpdateWtiInfoByRoomNoAndDateTime([FromBody]Wti w) + public bool UpdateWtiInfoByRoomNoAndDateTime([FromBody] Wti w) { return this.wtiService.UpdateWtiInfoByRoomNoAndDateTime(w); } @@ -107,7 +106,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool DeleteWtiInfoByRoomNoAndDateTime([FromBody]string roomno, string usedate, string enddate) + public bool DeleteWtiInfoByRoomNoAndDateTime([FromBody] string roomno, string usedate, string enddate) { return this.wtiService.DeleteWtiInfoByRoomNoAndDateTime(roomno, usedate, enddate); } @@ -117,7 +116,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public List ListWtiInfoByRoomNo([FromQuery]string roomno) + public List ListWtiInfoByRoomNo([FromQuery] string roomno) { return this.wtiService.ListWtiInfoByRoomNo(roomno); } diff --git a/EOM.TSHotelManager.WebApi/Controllers/Sys/NavBar/NavBarController.cs b/EOM.TSHotelManager.WebApi/Controllers/Sys/NavBar/NavBarController.cs index cd228e0..4e7d3dc 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Sys/NavBar/NavBarController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Sys/NavBar/NavBarController.cs @@ -1,6 +1,5 @@ using EOM.TSHotelManager.Application; using EOM.TSHotelManager.Common.Core; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; diff --git a/EOM.TSHotelManager.WebApi/Controllers/Util/AppController.cs b/EOM.TSHotelManager.WebApi/Controllers/Util/AppController.cs index a57b70f..9dc8a97 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Util/AppController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Util/AppController.cs @@ -1,6 +1,6 @@ using EOM.TSHotelManager.Application; using EOM.TSHotelManager.Common.Core; -using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; @@ -31,7 +31,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public string SelectCardCode([FromQuery]string identityCard) + public string SelectCardCode([FromQuery] string identityCard) { return utilService.SelectCardCode(identityCard); } @@ -41,6 +41,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] + [AllowAnonymous] public Applicationversion CheckBaseVersion() { return utilService.CheckBaseVersion(); @@ -52,7 +53,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool AddLog([FromBody]OperationLog opr) + public bool AddLog([FromBody] OperationLog opr) { return utilService.AddLog(opr); } diff --git a/EOM.TSHotelManager.WebApi/Controllers/Worker/Check/WorkerCheckController.cs b/EOM.TSHotelManager.WebApi/Controllers/Worker/Check/WorkerCheckController.cs index 7029c79..aaf78ca 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Worker/Check/WorkerCheckController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Worker/Check/WorkerCheckController.cs @@ -1,6 +1,5 @@ using EOM.TSHotelManager.Application; using EOM.TSHotelManager.Common.Core; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; @@ -31,7 +30,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public List SelectCheckInfoByWorkerNo([FromQuery]string wid) + public List SelectCheckInfoByWorkerNo([FromQuery] string wid) { return workerCheckService.SelectCheckInfoByWorkerNo(wid); } @@ -42,7 +41,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public object SelectWorkerCheckDaySumByWorkerNo([FromQuery]string wkn) + public object SelectWorkerCheckDaySumByWorkerNo([FromQuery] string wkn) { return workerCheckService.SelectWorkerCheckDaySumByWorkerNo(wkn); } @@ -64,7 +63,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool AddCheckInfo([FromBody]WorkerCheck workerCheck) + public bool AddCheckInfo([FromBody] WorkerCheck workerCheck) { return workerCheckService.AddCheckInfo(workerCheck); } diff --git a/EOM.TSHotelManager.WebApi/Controllers/Worker/GoodBad/WorkerGoodBadController.cs b/EOM.TSHotelManager.WebApi/Controllers/Worker/GoodBad/WorkerGoodBadController.cs index 4444af3..0170449 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Worker/GoodBad/WorkerGoodBadController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Worker/GoodBad/WorkerGoodBadController.cs @@ -1,6 +1,5 @@ using EOM.TSHotelManager.Application; using EOM.TSHotelManager.Common.Core; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; @@ -31,7 +30,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool AddGoodBad([FromBody]WorkerGoodBad goodBad) + public bool AddGoodBad([FromBody] WorkerGoodBad goodBad) { return workerGoodBadService.AddGoodBad(goodBad); } @@ -42,7 +41,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public List SelectAllGoodBadByWorkNo([FromQuery]string wn) + public List SelectAllGoodBadByWorkNo([FromQuery] string wn) { return workerGoodBadService.SelectAllGoodBadByWorkNo(wn); } diff --git a/EOM.TSHotelManager.WebApi/Controllers/Worker/History/WorkerHistoryController.cs b/EOM.TSHotelManager.WebApi/Controllers/Worker/History/WorkerHistoryController.cs index 1a800e4..b0da49a 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Worker/History/WorkerHistoryController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Worker/History/WorkerHistoryController.cs @@ -1,6 +1,5 @@ using EOM.TSHotelManager.Application; using EOM.TSHotelManager.Common.Core; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; @@ -31,7 +30,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool AddHistoryByWorkerId([FromBody]WorkerHistory workerHistory) + public bool AddHistoryByWorkerId([FromBody] WorkerHistory workerHistory) { return workerHistoryService.AddHistoryByWorkerId(workerHistory); } @@ -42,7 +41,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public List SelectHistoryByWorkerId([FromQuery]string wid) + public List SelectHistoryByWorkerId([FromQuery] string wid) { return workerHistoryService.SelectHistoryByWorkerId(wid); } diff --git a/EOM.TSHotelManager.WebApi/Controllers/Worker/Picture/WorkerPictureController.cs b/EOM.TSHotelManager.WebApi/Controllers/Worker/Picture/WorkerPictureController.cs index 51e9445..f937393 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Worker/Picture/WorkerPictureController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Worker/Picture/WorkerPictureController.cs @@ -1,6 +1,5 @@ using EOM.TSHotelManager.Application; using EOM.TSHotelManager.Common.Core; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; namespace EOM.TSHotelManager.WebApi.Controllers @@ -30,7 +29,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public WorkerPic WorkerPic([FromQuery]WorkerPic workerPic) + public WorkerPic WorkerPic([FromQuery] WorkerPic workerPic) { return workerPicService.WorkerPic(workerPic); } @@ -41,7 +40,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool InsertWorkerPic([FromBody]WorkerPic workerPic) + public bool InsertWorkerPic([FromBody] WorkerPic workerPic) { return workerPicService.InsertWorkerPic(workerPic); } @@ -52,7 +51,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool DeleteWorkerPic([FromBody]WorkerPic workerPic) + public bool DeleteWorkerPic([FromBody] WorkerPic workerPic) { return workerPicService.DeleteWorkerPic(workerPic); } @@ -63,9 +62,9 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool UpdateWorkerPic([FromBody]WorkerPic workerPic) + public bool UpdateWorkerPic([FromBody] WorkerPic workerPic) { - return workerPicService.UpdateWorkerPic(workerPic); + return workerPicService.UpdateWorkerPic(workerPic); } } diff --git a/EOM.TSHotelManager.WebApi/Controllers/Worker/WorkerController.cs b/EOM.TSHotelManager.WebApi/Controllers/Worker/WorkerController.cs index 4623d21..b74c7ac 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Worker/WorkerController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Worker/WorkerController.cs @@ -1,6 +1,6 @@ using EOM.TSHotelManager.Application; using EOM.TSHotelManager.Common.Core; -using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; @@ -31,7 +31,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool UpdateWorker([FromBody]Worker worker) + public bool UpdateWorker([FromBody] Worker worker) { return workerService.UpdateWorker(worker); } @@ -42,7 +42,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool ManagerWorkerAccount([FromBody]Worker worker) + public bool ManagerWorkerAccount([FromBody] Worker worker) { return workerService.ManagerWorkerAccount(worker); } @@ -54,7 +54,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// [HttpPost] - public bool UpdateWorkerPositionAndClub([FromBody]Worker worker) + public bool UpdateWorkerPositionAndClub([FromBody] Worker worker) { return workerService.UpdateWorkerPositionAndClub(worker); } @@ -65,7 +65,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool AddWorker([FromBody]Worker worker) + public bool AddWorker([FromBody] Worker worker) { return workerService.AddWorker(worker); } @@ -97,7 +97,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public Worker SelectWorkerInfoByWorkerId([FromQuery]string workerId) + public Worker SelectWorkerInfoByWorkerId([FromQuery] string workerId) { return workerService.SelectWorkerInfoByWorkerId(workerId); } @@ -108,7 +108,8 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public Worker SelectWorkerInfoByWorkerIdAndWorkerPwd([FromBody]Worker worker) + [AllowAnonymous] + public Worker SelectWorkerInfoByWorkerIdAndWorkerPwd([FromBody] Worker worker) { return workerService.SelectWorkerInfoByWorkerIdAndWorkerPwd(worker); } @@ -119,7 +120,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool UpdWorkerPwdByWorkNo([FromBody]Worker worker) + public bool UpdWorkerPwdByWorkNo([FromBody] Worker worker) { 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 d8908b7..843b8e1 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Zero/Admin/AdminController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Zero/Admin/AdminController.cs @@ -1,8 +1,6 @@ using EOM.TSHotelManager.Application; using EOM.TSHotelManager.Common.Core; -using EOM.TSHotelManager.WebApi.Filter; using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; @@ -33,7 +31,8 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public Admin SelectMangerByPass([FromBody]Admin admin) + [AllowAnonymous] + public Admin SelectMangerByPass([FromBody] Admin admin) { return adminService.SelectMangerByPass(admin); } @@ -44,7 +43,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public Admin SelectAdminPwdByAccount([FromQuery]string account) + public Admin SelectAdminPwdByAccount([FromQuery] string account) { return adminService.SelectAdminPwdByAccount(account); } @@ -65,7 +64,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool UpdateNewPwdByOldPwd([FromBody]Admin admin) + public bool UpdateNewPwdByOldPwd([FromBody] Admin admin) { return adminService.UpdateNewPwdByOldPwd(admin); } @@ -86,7 +85,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool AddAdmin([FromBody]Admin admin) + public bool AddAdmin([FromBody] Admin admin) { return adminService.AddAdmin(admin); } @@ -97,7 +96,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public Admin GetAdminInfoByAdminAccount([FromQuery]Admin admin) + public Admin GetAdminInfoByAdminAccount([FromQuery] Admin admin) { return adminService.GetAdminInfoByAdminAccount(admin); } @@ -118,7 +117,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool UpdAccount([FromBody]Admin admins) + public bool UpdAccount([FromBody] Admin admins) { return adminService.UpdAccount(admins); } diff --git a/EOM.TSHotelManager.WebApi/Controllers/Zero/Base/BaseController.cs b/EOM.TSHotelManager.WebApi/Controllers/Zero/Base/BaseController.cs index 91030b9..e7eec77 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Zero/Base/BaseController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Zero/Base/BaseController.cs @@ -1,6 +1,5 @@ using EOM.TSHotelManager.Application; using EOM.TSHotelManager.Common.Core; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; @@ -32,7 +31,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public List SelectSexTypeAll([FromQuery]SexType sexType = null) + public List SelectSexTypeAll([FromQuery] SexType sexType = null) { return baseService.SelectSexTypeAll(sexType); } @@ -42,7 +41,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public SexType SelectSexType([FromQuery]SexType sexType) + public SexType SelectSexType([FromQuery] SexType sexType) { return baseService.SelectSexType(sexType); } @@ -53,7 +52,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool AddSexType([FromBody]SexType sexType) + public bool AddSexType([FromBody] SexType sexType) { return baseService.AddSexType(sexType); } @@ -64,7 +63,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool DelSexType([FromBody]SexType sexType) + public bool DelSexType([FromBody] SexType sexType) { return baseService.DelSexType(sexType); } @@ -75,7 +74,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool UpdSexType([FromBody]SexType sexType) + public bool UpdSexType([FromBody] SexType sexType) { return baseService.UpdSexType(sexType); } @@ -89,7 +88,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public List SelectPositionAll([FromQuery]Position position = null) + public List SelectPositionAll([FromQuery] Position position = null) { return baseService.SelectPositionAll(position); } @@ -99,7 +98,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public Position SelectPosition([FromQuery]Position position) + public Position SelectPosition([FromQuery] Position position) { return baseService.SelectPosition(position); } @@ -110,7 +109,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool AddPosition([FromBody]Position position) + public bool AddPosition([FromBody] Position position) { return baseService.AddPosition(position); } @@ -121,7 +120,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool DelPosition([FromBody]Position position) + public bool DelPosition([FromBody] Position position) { return baseService.DelPosition(position); } @@ -132,7 +131,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool UpdPosition([FromBody]Position position) + public bool UpdPosition([FromBody] Position position) { return baseService.UpdPosition(position); } @@ -146,7 +145,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public List SelectNationAll([FromQuery]Nation nation = null) + public List SelectNationAll([FromQuery] Nation nation = null) { return baseService.SelectNationAll(nation); } @@ -156,7 +155,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public Nation SelectNation([FromQuery]Nation nation) + public Nation SelectNation([FromQuery] Nation nation) { return baseService.SelectNation(nation); } @@ -167,7 +166,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool AddNation([FromBody]Nation nation) + public bool AddNation([FromBody] Nation nation) { return baseService.AddNation(nation); } @@ -178,7 +177,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool DelNation([FromBody]Nation nation) + public bool DelNation([FromBody] Nation nation) { return baseService.DelNation(nation); } @@ -189,7 +188,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool UpdNation([FromBody]Nation nation) + public bool UpdNation([FromBody] Nation nation) { return baseService.UpdNation(nation); } @@ -203,7 +202,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public List SelectEducationAll([FromQuery]Education education = null) + public List SelectEducationAll([FromQuery] Education education = null) { return baseService.SelectEducationAll(education); } @@ -213,7 +212,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public Education SelectEducation([FromQuery]Education education) + public Education SelectEducation([FromQuery] Education education) { return baseService.SelectEducation(education); } @@ -224,7 +223,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool AddEducation([FromBody]Education education) + public bool AddEducation([FromBody] Education education) { return baseService.AddEducation(education); } @@ -235,7 +234,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool DelEducation([FromBody]Education education) + public bool DelEducation([FromBody] Education education) { return baseService.DelEducation(education); } @@ -246,7 +245,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool UpdEducation([FromBody]Education education) + public bool UpdEducation([FromBody] Education education) { return baseService.UpdEducation(education); } @@ -280,7 +279,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public Dept SelectDept([FromQuery]Dept dept) + public Dept SelectDept([FromQuery] Dept dept) { return baseService.SelectDept(dept); } @@ -291,7 +290,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool AddDept([FromBody]Dept dept) + public bool AddDept([FromBody] Dept dept) { return baseService.AddDept(dept); } @@ -302,7 +301,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool DelDept([FromBody]Dept dept) + public bool DelDept([FromBody] Dept dept) { return baseService.DelDept(dept); } @@ -313,7 +312,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool UpdDept([FromBody]Dept dept) + public bool UpdDept([FromBody] Dept dept) { return baseService.UpdDept(dept); } @@ -348,7 +347,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public CustoType SelectCustoTypeByTypeId([FromQuery]CustoType custoType) + public CustoType SelectCustoTypeByTypeId([FromQuery] CustoType custoType) { return baseService.SelectCustoTypeByTypeId(custoType); } @@ -359,7 +358,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool InsertCustoType([FromBody]CustoType custoType) + public bool InsertCustoType([FromBody] CustoType custoType) { return baseService.InsertCustoType(custoType); } @@ -370,7 +369,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool DeleteCustoType([FromBody]CustoType custoType) + public bool DeleteCustoType([FromBody] CustoType custoType) { return baseService.DeleteCustoType(custoType); } @@ -381,7 +380,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool UpdateCustoType([FromBody]CustoType custoType) + public bool UpdateCustoType([FromBody] CustoType custoType) { return baseService.UpdateCustoType(custoType); } @@ -416,7 +415,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public PassPortType SelectPassPortTypeByTypeId([FromQuery]PassPortType passPortType) + public PassPortType SelectPassPortTypeByTypeId([FromQuery] PassPortType passPortType) { return baseService.SelectPassPortTypeByTypeId(passPortType); } @@ -427,7 +426,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool InsertPassPortType([FromBody]PassPortType passPortType) + public bool InsertPassPortType([FromBody] PassPortType passPortType) { return baseService.InsertPassPortType(passPortType); } @@ -438,7 +437,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool DeletePassPortType([FromBody]PassPortType portType) + public bool DeletePassPortType([FromBody] PassPortType portType) { return baseService.DeletePassPortType(portType); } @@ -449,7 +448,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool UpdatePassPortType([FromBody]PassPortType portType) + public bool UpdatePassPortType([FromBody] PassPortType portType) { return baseService.UpdatePassPortType(portType); } @@ -484,7 +483,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public GBType SelectGBTypeByTypeId([FromQuery]GBType gBType) + public GBType SelectGBTypeByTypeId([FromQuery] GBType gBType) { return baseService.SelectGBTypeByTypeId(gBType); } @@ -495,7 +494,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool InsertGBType([FromBody]GBType gBType) + public bool InsertGBType([FromBody] GBType gBType) { return baseService.InsertGBType(gBType); } @@ -506,7 +505,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool DeleteGBType([FromBody]GBType gBType) + public bool DeleteGBType([FromBody] GBType gBType) { return baseService.DeleteGBType(gBType); } @@ -517,7 +516,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool UpdateGBType([FromBody]GBType gBType) + public bool UpdateGBType([FromBody] GBType gBType) { return baseService.UpdateGBType(gBType); } diff --git a/EOM.TSHotelManager.WebApi/Controllers/Zero/CheckInfo/CheckInfoController.cs b/EOM.TSHotelManager.WebApi/Controllers/Zero/CheckInfo/CheckInfoController.cs index 3d3b328..2b30e05 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Zero/CheckInfo/CheckInfoController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Zero/CheckInfo/CheckInfoController.cs @@ -1,6 +1,5 @@ using EOM.TSHotelManager.Application; using EOM.TSHotelManager.Common.Core; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; diff --git a/EOM.TSHotelManager.WebApi/Controllers/Zero/Module/ModuleController.cs b/EOM.TSHotelManager.WebApi/Controllers/Zero/Module/ModuleController.cs index ca46647..51fbe3d 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Zero/Module/ModuleController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Zero/Module/ModuleController.cs @@ -1,6 +1,5 @@ using EOM.TSHotelManager.Application; using EOM.TSHotelManager.Common.Core; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; @@ -41,7 +40,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public List GetAllModuleByAdmin([FromBody]Admin admin) + public List GetAllModuleByAdmin([FromBody] Admin admin) { return adminModuleZeroService.GetAllModuleByAdmin(admin); } @@ -52,7 +51,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool AddModuleZeroList([FromBody]List moduleZeros) + public bool AddModuleZeroList([FromBody] List moduleZeros) { return adminModuleZeroService.AddModuleZeroList(moduleZeros); } @@ -63,7 +62,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool DelModuleZeroList([FromBody]ModuleZero moduleZero) + public bool DelModuleZeroList([FromBody] ModuleZero moduleZero) { return adminModuleZeroService.DelModuleZeroList(moduleZero); } diff --git a/EOM.TSHotelManager.WebApi/Controllers/Zero/Notice/NoticeController.cs b/EOM.TSHotelManager.WebApi/Controllers/Zero/Notice/NoticeController.cs index 83f5a92..b30c7ab 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Zero/Notice/NoticeController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Zero/Notice/NoticeController.cs @@ -1,6 +1,5 @@ using EOM.TSHotelManager.Application; using EOM.TSHotelManager.Common.Core; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; @@ -43,7 +42,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public Notice SelectNoticeByNoticeNo([FromQuery]string noticeId) + public Notice SelectNoticeByNoticeNo([FromQuery] string noticeId) { return noticeService.SelectNoticeByNoticeNo(noticeId); } @@ -55,7 +54,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool InsertNotice([FromBody]Notice notice) + public bool InsertNotice([FromBody] Notice notice) { return noticeService.InsertNotice(notice); } diff --git a/EOM.TSHotelManager.WebApi/Controllers/Zero/VipRule/VipRuleController.cs b/EOM.TSHotelManager.WebApi/Controllers/Zero/VipRule/VipRuleController.cs index add0c91..096da0c 100644 --- a/EOM.TSHotelManager.WebApi/Controllers/Zero/VipRule/VipRuleController.cs +++ b/EOM.TSHotelManager.WebApi/Controllers/Zero/VipRule/VipRuleController.cs @@ -1,6 +1,5 @@ using EOM.TSHotelManager.Application; using EOM.TSHotelManager.Common.Core; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using System.Collections.Generic; @@ -41,7 +40,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpGet] - public VipRule SelectVipRule([FromQuery]VipRule vipRule) + public VipRule SelectVipRule([FromQuery] VipRule vipRule) { return vipRuleAppService.SelectVipRule(vipRule); } @@ -52,7 +51,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool AddVipRule([FromBody]VipRule vipRule) + public bool AddVipRule([FromBody] VipRule vipRule) { return vipRuleAppService.AddVipRule(vipRule); } @@ -63,7 +62,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool DelVipRule([FromBody]VipRule vipRule) + public bool DelVipRule([FromBody] VipRule vipRule) { return vipRuleAppService.DelVipRule(vipRule); } @@ -74,7 +73,7 @@ namespace EOM.TSHotelManager.WebApi.Controllers /// /// [HttpPost] - public bool UpdVipRule([FromBody]VipRule vipRule) + public bool UpdVipRule([FromBody] VipRule vipRule) { return vipRuleAppService.UpdVipRule(vipRule); } diff --git a/EOM.TSHotelManager.WebApi/CustomAttribute/SkipCustomActionFilterAttribute.cs b/EOM.TSHotelManager.WebApi/CustomAttribute/SkipCustomActionFilterAttribute.cs new file mode 100644 index 0000000..8d634c7 --- /dev/null +++ b/EOM.TSHotelManager.WebApi/CustomAttribute/SkipCustomActionFilterAttribute.cs @@ -0,0 +1,6 @@ +using System; + +[AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)] +public class SkipCustomActionFilterAttribute : Attribute +{ +} diff --git a/EOM.TSHotelManager.WebApi/EOM.TSHotelManager.WebApi.csproj b/EOM.TSHotelManager.WebApi/EOM.TSHotelManager.WebApi.csproj index 11d5875..5ab2620 100644 --- a/EOM.TSHotelManager.WebApi/EOM.TSHotelManager.WebApi.csproj +++ b/EOM.TSHotelManager.WebApi/EOM.TSHotelManager.WebApi.csproj @@ -18,13 +18,22 @@ False + + + + + + + + + @@ -34,6 +43,9 @@ + + ..\Library\CK.Common.dll + ..\Library\EOM.Encrypt.dll diff --git a/EOM.TSHotelManager.WebApi/Filter/ActionFilter.cs b/EOM.TSHotelManager.WebApi/Filter/ActionFilter.cs deleted file mode 100644 index 1bb12fe..0000000 --- a/EOM.TSHotelManager.WebApi/Filter/ActionFilter.cs +++ /dev/null @@ -1,59 +0,0 @@ -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/Filter/AuthorizeAllControllersConvention.cs b/EOM.TSHotelManager.WebApi/Filter/AuthorizeAllControllersConvention.cs new file mode 100644 index 0000000..57343d8 --- /dev/null +++ b/EOM.TSHotelManager.WebApi/Filter/AuthorizeAllControllersConvention.cs @@ -0,0 +1,35 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc.ApplicationModels; +using Microsoft.AspNetCore.Mvc.Authorization; +using System.Linq; + +namespace EOM.TSHotelManager.WebApi.Filter +{ + public class AuthorizeAllControllersConvention : IApplicationModelConvention + { + public void Apply(ApplicationModel application) + { + foreach (var controller in application.Controllers) + { + var hasAllowAnonymousAttribute = controller.ControllerType.GetCustomAttributes(true) + .Any(attr => attr.GetType() == typeof(AllowAnonymousAttribute)); + + if (!hasAllowAnonymousAttribute) + { + controller.Filters.Add(new AuthorizeFilter()); + } + + foreach (var action in controller.Actions) + { + var hasAllowAnonymousAttributeOnAction = action.ActionMethod.GetCustomAttributes(true) + .Any(attr => attr.GetType() == typeof(AllowAnonymousAttribute)); + + if (!hasAllowAnonymousAttributeOnAction) + { + action.Filters.Add(new AuthorizeFilter()); + } + } + } + } + } +} diff --git a/EOM.TSHotelManager.WebApi/Program.cs b/EOM.TSHotelManager.WebApi/Program.cs index a173445..7f9520c 100644 --- a/EOM.TSHotelManager.WebApi/Program.cs +++ b/EOM.TSHotelManager.WebApi/Program.cs @@ -1,14 +1,6 @@ -using Autofac; using Autofac.Extensions.DependencyInjection; -using EOM.TSHotelManager.EntityFramework; using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; namespace EOM.TSHotelManager.WebApi { diff --git a/EOM.TSHotelManager.WebApi/Router_Extension/MvcOptionsExtensions.cs b/EOM.TSHotelManager.WebApi/Router_Extension/MvcOptionsExtensions.cs index a98e2b1..c291def 100644 --- a/EOM.TSHotelManager.WebApi/Router_Extension/MvcOptionsExtensions.cs +++ b/EOM.TSHotelManager.WebApi/Router_Extension/MvcOptionsExtensions.cs @@ -1,5 +1,5 @@ -using Microsoft.AspNetCore.Mvc.Routing; -using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Routing; namespace EOM.TSHotelManager.WebApi { diff --git a/EOM.TSHotelManager.WebApi/Startup.cs b/EOM.TSHotelManager.WebApi/Startup.cs index ce93daa..cceb591 100644 --- a/EOM.TSHotelManager.WebApi/Startup.cs +++ b/EOM.TSHotelManager.WebApi/Startup.cs @@ -1,59 +1,70 @@ -using System; -using System.Collections.Generic; -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 EOM.TSHotelManager.WebApi.Filter; +using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; -using Microsoft.Extensions.Options; +using Microsoft.IdentityModel.Tokens; using Microsoft.OpenApi.Models; using Newtonsoft.Json.Serialization; +using System; +using System.IO; +using System.Reflection; +using System.Text; namespace EOM.TSHotelManager.WebApi { public class Startup { + private readonly IConfiguration _configuration; + public Startup(IConfiguration configuration) { - Configuration = configuration; + _configuration = configuration; } - public IConfiguration Configuration { get; } - // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { - //services.AddCors(options => - //{ - // options.AddDefaultPolicy(builder => - // { - // builder - // .AllowAnyOrigin() // κԴ - // .AllowAnyMethod() // κHTTP - // .AllowAnyHeader()// κHTTPͷֶ - // .AllowCredentials(); - // }); - //}); - - services.AddControllers().AddJsonOptions(opts => + services.AddAuthentication(options => + { + options.DefaultAuthenticateScheme = JwtBearerDefaults.AuthenticationScheme; + options.DefaultChallengeScheme = JwtBearerDefaults.AuthenticationScheme; + }).AddJwtBearer("Bearer", options => + { + options.TokenValidationParameters = new TokenValidationParameters + { + ValidateIssuer = true, + ValidateAudience = true, + ValidateLifetime = true, + ValidateIssuerSigningKey = true, + ValidIssuer = _configuration["Jwt:Issuer"], + ValidAudience = _configuration["Jwt:Audience"], // Чaudienceֵ + IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_configuration["Jwt:Key"])) + }; + }); + + services.AddAuthorization(options => + { + // һΪApiAccessIJ + options.AddPolicy("ApiAccess", policy => + { + policy.AuthenticationSchemes.Add("Bearer"); + policy.RequireAuthenticatedUser(); + }); + + // ʹ涨ġApiAccessΪĬϲ + options.DefaultPolicy = options.GetPolicy("ApiAccess"); + }); + + + services.AddControllers(options => { - opts.JsonSerializerOptions.Encoder = JavaScriptEncoder.Create(UnicodeRanges.All); - opts.JsonSerializerOptions.PropertyNamingPolicy = null; + options.Conventions.Add(new AuthorizeAllControllersConvention()); }).AddNewtonsoftJson(opt => { //ʱʽӦ @@ -92,9 +103,9 @@ namespace EOM.TSHotelManager.WebApi } }); //ȡͬ¸ֲxmlעͣһȡҵ߼㡢ʵͽӿڲ㼴 - s.IncludeXmlComments(AppContext.BaseDirectory+"EOM.TSHotelManager.Application.xml"); - s.IncludeXmlComments(AppContext.BaseDirectory+"EOM.TSHotelManager.Common.Core.xml"); - s.IncludeXmlComments(AppContext.BaseDirectory+"EOM.TSHotelManager.WebApi.xml"); + s.IncludeXmlComments(AppContext.BaseDirectory + "EOM.TSHotelManager.Application.xml"); + s.IncludeXmlComments(AppContext.BaseDirectory + "EOM.TSHotelManager.Common.Core.xml"); + s.IncludeXmlComments(AppContext.BaseDirectory + "EOM.TSHotelManager.WebApi.xml"); #endregion #region ʽʱ @@ -104,7 +115,7 @@ namespace EOM.TSHotelManager.WebApi #endregion }); #endregion - + } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. @@ -119,6 +130,8 @@ namespace EOM.TSHotelManager.WebApi app.UseRouting(); + app.UseAuthentication(); + app.UseAuthorization(); app.UseEndpoints(endpoints => diff --git a/EOM.TSHotelManager.WebApi/appsettings.json b/EOM.TSHotelManager.WebApi/appsettings.json index 5711b4b..87bf622 100644 --- a/EOM.TSHotelManager.WebApi/appsettings.json +++ b/EOM.TSHotelManager.WebApi/appsettings.json @@ -7,7 +7,12 @@ } }, "ConnectionStrings": { - "PgSqlConnectStr": "Host=127.1.1.1;Port=5432;Username=postgres;Password=123;Database=tshoteldb;" + "PgSqlConnectStr": "Host=.;Port=5432;Username=postgres;Password=.;Database=tshoteldb;" }, - "AllowedHosts": "*" + "AllowedHosts": "*", + "Jwt": { + "Key": ".", + "Issuer": ".", + "Audience": "." + } } -- Gitee