diff --git a/EOM.TSHotelManager.Application/Business/Cash/CashService.cs b/EOM.TSHotelManager.Application/Business/Cash/CashService.cs new file mode 100644 index 0000000000000000000000000000000000000000..bff8f9d997922027a2f8e0251dbc4ae608c95751 --- /dev/null +++ b/EOM.TSHotelManager.Application/Business/Cash/CashService.cs @@ -0,0 +1,102 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using System; +using System.Collections.Generic; +using System.Linq; +using EOM.TSHotelManager.Core; +using EOM.TSHotelManager.EntityFramework; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 资产信息接口实现类 + /// + public class CashService:ICashService + { + /// + /// 资产信息 + /// + private readonly PgRepository cashRepository; + + /// + /// 部门 + /// + private readonly PgRepository deptRepository; + + /// + /// 员工 + /// + private readonly PgRepository workerRepository; + + /// + /// + /// + /// + /// + /// + public CashService(PgRepository cashRepository, PgRepository deptRepository, PgRepository workerRepository) + { + this.cashRepository = cashRepository; + this.deptRepository = deptRepository; + this.workerRepository = workerRepository; + } + + /// + /// 添加资产信息 + /// + /// + /// + public bool AddCashInfo(Cash cash) + { + return cashRepository.Insert(cash); + } + + /// + /// 查询资产信息 + /// + /// + public List SelectCashInfoAll() + { + //查询所有部门信息 + List depts = new List(); + depts = deptRepository.GetList(a => a.delete_mk != 1); + //查询所有员工信息 + List workers = new List(); + workers = workerRepository.GetList(a => a.delete_mk != 1); + List cs = new List(); + cs = cashRepository.GetList(a => a.delete_mk != 1); + cs.ForEach(source => + { + var dept = depts.FirstOrDefault(a => a.dept_no.Equals(source.CashClub)); + source.DeptName = dept == null ? "" : dept.dept_name; + var worker = workers.FirstOrDefault(a => a.WorkerId.Equals(source.CashPerson)); + source.PersonName = worker == null ? "" : worker.WorkerName; + + source.CashPriceStr = source.CashPrice == 0 ? "" : Decimal.Parse(source.CashPrice.ToString()).ToString("#,##0.00").ToString(); + + }); + return cs; + } + } +} diff --git a/EOM.TSHotelManager.Application/Business/Cash/ICashService.cs b/EOM.TSHotelManager.Application/Business/Cash/ICashService.cs new file mode 100644 index 0000000000000000000000000000000000000000..47705baa682164a9aec423677ce4e1215e30fc30 --- /dev/null +++ b/EOM.TSHotelManager.Application/Business/Cash/ICashService.cs @@ -0,0 +1,47 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EOM.TSHotelManager.Core; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 资产信息接口 + /// + public interface ICashService + { + /// + /// 添加资产信息 + /// + /// + /// + bool AddCashInfo(Cash cash); + + /// + /// 查询资产信息 + /// + /// + List SelectCashInfoAll(); + } +} \ No newline at end of file diff --git a/EOM.TSHotelManager.Application/Business/Customer/CustoService.cs b/EOM.TSHotelManager.Application/Business/Customer/CustoService.cs new file mode 100644 index 0000000000000000000000000000000000000000..5a56b51c337c91926121f7f2671518179c34a6ce --- /dev/null +++ b/EOM.TSHotelManager.Application/Business/Customer/CustoService.cs @@ -0,0 +1,301 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Linq.Expressions; +using CK.Common; +using EncryptTools.Core; +using EOM.TSHotelManager.Core; +using EOM.TSHotelManager.EntityFramework; +using Npgsql; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 客户信息接口实现类 + /// + public class CustoService:ICustoService + { + /// + /// 客户信息 + /// + private readonly PgRepository custoRepository; + + /// + /// 消费情况 + /// + private readonly PgRepository spendRepository; + + /// + /// 性别类型 + /// + private readonly PgRepository sexTypeRepository; + + /// + /// 证件类型 + /// + private readonly PgRepository passPortTypeRepository; + + /// + /// 客户类型 + /// + private readonly PgRepository custoTypeRepository; + + Encrypt encrypt = new Encrypt(); + + /// + /// + /// + /// + /// + /// + /// + /// + public CustoService(PgRepository custoRepository, PgRepository spendRepository, PgRepository sexTypeRepository, PgRepository passPortTypeRepository, PgRepository custoTypeRepository) + { + this.custoRepository = custoRepository; + this.spendRepository = spendRepository; + this.sexTypeRepository = sexTypeRepository; + this.passPortTypeRepository = passPortTypeRepository; + this.custoTypeRepository = custoTypeRepository; + } + + #region 添加客户信息 + /// + /// 添加客户信息 + /// + /// + /// + public bool InsertCustomerInfo(Custo custo) + { + string? NewID = encrypt.Encryption(custo.CustoID); + string? NewTel = encrypt.Encryption(custo.CustoTel); + custo.CustoID = NewID; + custo.CustoTel = NewTel; + return custoRepository.Insert(custo); + } + #endregion + + /// + /// 更新客户信息 + /// + /// + /// + public bool UpdCustomerInfoByCustoNo(Custo custo) + { + string? NewID = encrypt.Encryption(custo.CustoID); + string? NewTel = encrypt.Encryption(custo.CustoTel); + custo.CustoID = NewID; + custo.CustoTel = NewTel; + return custoRepository.Update(a => new Custo() + { + CustoName = custo.CustoName, + CustoSex = custo.CustoSex, + CustoType = custo.CustoType, + CustoBirth = custo.CustoBirth, + CustoAdress = custo.CustoAdress, + CustoID = custo.CustoID, + CustoTel = custo.CustoTel, + PassportType = custo.PassportType, + datachg_usr = custo.datachg_usr, + datachg_date = DateTime.Now + },a => a.CustoNo == custo.CustoNo); + } + + /// + /// 更新客户类型(即会员等级) + /// + /// + /// + /// + public bool UpdCustomerTypeByCustoNo(string? custoNo,int userType) + { + return custoRepository.Update(a => new Custo() + { + CustoType = userType + }, a => a.CustoNo.Equals(custoNo)); + } + + /// + /// 查询酒店盈利情况 + /// + /// + public List SelectAllMoney() + { + List custoSpends = new List(); + var listSource = spendRepository.GetList(a => a.MoneyState.Equals(SpendConsts.Settled)).OrderBy(a => a.SpendTime).ToList(); + var listDates = new List(); + listSource.ForEach(source => + { + var year = source.SpendTime.ToString("yyyy"); + if (!custoSpends.Select(a => a.Years).ToList().Contains(year)) + { + var startDate = new DateTime(source.SpendTime.Year, 1, 1, 0, 0, 0); + var endDate = new DateTime(source.SpendTime.Year, 12, 31, 23, 59, 59); + custoSpends.Add(new CustoSpend + { + Years = year, + Money = listSource.Where(a => a.SpendTime >= startDate && a.SpendTime <= endDate).Sum(a => a.SpendMoney) + }); + } + }); + + custoSpends = custoSpends.OrderBy(a => a.Years).ToList(); + return custoSpends; + } + + /// + /// 查询所有客户信息 + /// + /// + public OSelectCustoAllDto SelectCustoAll(int? pageIndex,int? pageSize) + { + OSelectCustoAllDto oSelectCustoAllDto = new OSelectCustoAllDto(); + + var count = 0; + + //查询出所有性别类型 + List sexTypes = new List(); + sexTypes = sexTypeRepository.GetList(); + //查询出所有证件类型 + List passPortTypes = new List(); + passPortTypes = passPortTypeRepository.GetList(); + //查询出所有客户类型 + List custoTypes = new List(); + custoTypes = custoTypeRepository.GetList(); + //查询出所有客户信息 + List custos = new List(); + + if (!pageIndex.IsNullOrEmpty() && !pageSize.IsNullOrEmpty()) + { + custos = custoRepository.AsQueryable().ToPageList((int)pageIndex, (int)pageSize,ref count).OrderBy(a => a.CustoNo).ToList(); + } + else + { + custos = custoRepository.AsQueryable().OrderBy(a => a.CustoNo).ToList(); + } + + custos.ForEach(source => + { + //解密身份证号码 + var sourceStr = source.CustoID.Contains("·") ? encrypt.Decryption(source.CustoID) : source.CustoID; + source.CustoID = sourceStr; + //解密联系方式 + var sourceTelStr = source.CustoTel.Contains("·") ? encrypt.Decryption(source.CustoTel) : source.CustoTel; + source.CustoTel = sourceTelStr; + //性别类型 + var sexType = sexTypes.FirstOrDefault(a => a.sexId == source.CustoSex); + source.SexName = string.IsNullOrEmpty(sexType.sexName) ? "" : sexType.sexName; + //证件类型 + var passPortType = passPortTypes.FirstOrDefault(a => a.PassportId == source.PassportType); + source.PassportName = string.IsNullOrEmpty(passPortType.PassportName) ? "" : passPortType.PassportName; + //客户类型 + var custoType = custoTypes.FirstOrDefault(a => a.UserType == source.CustoType); + source.typeName = string.IsNullOrEmpty(custoType.TypeName) ? "" : custoType.TypeName; + }); + + oSelectCustoAllDto.custos = custos; + oSelectCustoAllDto.total = count; + return oSelectCustoAllDto; + } + + /// + /// 查询指定客户信息 + /// + /// + public List SelectCustoByInfo(Custo custo) + { + //查询出所有性别类型 + List sexTypes = new List(); + sexTypes = sexTypeRepository.GetList(); + //查询出所有证件类型 + List passPortTypes = new List(); + passPortTypes = passPortTypeRepository.GetList(); + //查询出所有客户类型 + List custoTypes = new List(); + custoTypes = custoTypeRepository.GetList(); + //查询出所有客户信息 + List custos = new List(); + if (!custo.CustoNo.IsNullOrEmpty()) + { + custos = custoRepository.GetList(a => a.CustoNo.Contains(custo.CustoNo)).OrderBy(a => a.CustoNo).ToList(); + } + if (!custo.CustoName.IsNullOrEmpty()) + { + custos = custoRepository.GetList(a => a.CustoName.Contains(custo.CustoName)).OrderBy(a => a.CustoNo).ToList(); + } + custos.ForEach(source => + { + //解密身份证号码 + var sourceStr = source.CustoID.Contains("·") ? encrypt.Decryption(source.CustoID) : source.CustoID; + source.CustoID = sourceStr; + //解密联系方式 + var sourceTelStr = source.CustoTel.Contains("·") ? encrypt.Decryption(source.CustoTel) : source.CustoTel; + source.CustoTel = sourceTelStr; + //性别类型 + var sexType = sexTypes.FirstOrDefault(a => a.sexId == source.CustoSex); + source.SexName = string.IsNullOrEmpty(sexType.sexName) ? "" : sexType.sexName; + //证件类型 + var passPortType = passPortTypes.FirstOrDefault(a => a.PassportId == source.PassportType); + source.PassportName = string.IsNullOrEmpty(passPortType.PassportName) ? "" : passPortType.PassportName; + //客户类型 + var custoType = custoTypes.FirstOrDefault(a => a.UserType == source.CustoType); + source.typeName = string.IsNullOrEmpty(custoType.TypeName) ? "" : custoType.TypeName; + }); + return custos; + } + + /// + /// 根据客户编号查询客户信息 + /// + /// + /// + public Custo SelectCardInfoByCustoNo(string? CustoNo) + { + Custo c = custoRepository.GetSingle(a => a.CustoNo.Contains(CustoNo)); + if (c.IsNullOrEmpty()) + { + return null; + } + //性别类型 + var sexType = sexTypeRepository.GetSingle(a => a.sexId == c.CustoSex); + c.SexName = string.IsNullOrEmpty(sexType.sexName) ? "" : sexType.sexName; + //证件类型 + var passPortType = passPortTypeRepository.GetSingle(a => a.PassportId == c.PassportType); + c.PassportName = string.IsNullOrEmpty(passPortType.PassportName) ? "" : passPortType.PassportName; + //客户类型 + var custoType = custoTypeRepository.GetSingle(a => a.UserType == c.CustoType); + c.typeName = string.IsNullOrEmpty(custoType.TypeName) ? "" : custoType.TypeName; + //解密身份证号码 + var sourceStr = c.CustoID.Contains("·") ? encrypt.Decryption(c.CustoID) : c.CustoID; + c.CustoID = sourceStr; + //解密联系方式 + var sourceTelStr = c.CustoTel.Contains("·") ? encrypt.Decryption(c.CustoTel) : c.CustoTel; + c.CustoTel = sourceTelStr; + return c; + } + + } +} diff --git a/EOM.TSHotelManager.Application/Business/Customer/ICustoService.cs b/EOM.TSHotelManager.Application/Business/Customer/ICustoService.cs new file mode 100644 index 0000000000000000000000000000000000000000..d1f758ff81144b6a7842a5ab0b2026f84a0651b8 --- /dev/null +++ b/EOM.TSHotelManager.Application/Business/Customer/ICustoService.cs @@ -0,0 +1,82 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EOM.TSHotelManager.Core; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 客户信息接口 + /// + public interface ICustoService + { + /// + /// 添加客户信息 + /// + /// + /// + bool InsertCustomerInfo(Custo custo); + + /// + /// 更新客户信息 + /// + /// + /// + bool UpdCustomerInfoByCustoNo(Custo custo); + + /// + /// 更新客户类型(即会员等级) + /// + /// + /// + /// + bool UpdCustomerTypeByCustoNo(string? custoNo, int userType); + + /// + /// 查询酒店盈利情况 + /// + /// + List SelectAllMoney(); + + /// + /// 查询所有客户信息 + /// + /// + OSelectCustoAllDto SelectCustoAll(int? pageIndex, int? pageSize); + + /// + /// 查询指定客户信息 + /// + /// + List SelectCustoByInfo(Custo custo); + + /// + /// 根据客户编号查询客户信息 + /// + /// + /// + Custo SelectCardInfoByCustoNo(string? CustoNo); + + } +} \ No newline at end of file diff --git a/EOM.TSHotelManager.Application/Business/Customer/OSelectCustoAllDto.cs b/EOM.TSHotelManager.Application/Business/Customer/OSelectCustoAllDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..4b7ae137c2988a14e61437edb666f0f73accc30b --- /dev/null +++ b/EOM.TSHotelManager.Application/Business/Customer/OSelectCustoAllDto.cs @@ -0,0 +1,44 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EOM.TSHotelManager.Core; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 查询所有客户信息 + /// 输出DTO + /// + public class OSelectCustoAllDto + { + /// + /// 数据源 + /// + public List custos { get; set; } + + /// + /// 总数 + /// + public int total { get; set; } + } +} \ No newline at end of file diff --git a/EOM.TSHotelManager.Application/Business/Fonts/FontsService.cs b/EOM.TSHotelManager.Application/Business/Fonts/FontsService.cs new file mode 100644 index 0000000000000000000000000000000000000000..0a2c9edd22652c6556850eaad1f320d795b87ab9 --- /dev/null +++ b/EOM.TSHotelManager.Application/Business/Fonts/FontsService.cs @@ -0,0 +1,64 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EOM.TSHotelManager.Core; +using EOM.TSHotelManager.EntityFramework; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 酒店宣传联动内容接口实现类 + /// + public class FontsService:IFontsService + { + /// + /// 跑马灯 + /// + private readonly PgRepository fontsRepository; + + /// + /// + /// + /// + public FontsService(PgRepository fontsRepository) + { + this.fontsRepository = fontsRepository; + } + + /// + /// 查询所有宣传联动内容(跑马灯) + /// + /// + public List SelectFontAll() + { + List fonts = new List(); + fonts = fontsRepository.GetList(); + return fonts; + } + } +} diff --git a/EOM.TSHotelManager.Application/Business/Fonts/IFontsService.cs b/EOM.TSHotelManager.Application/Business/Fonts/IFontsService.cs new file mode 100644 index 0000000000000000000000000000000000000000..9cf39bdb67fd5369db42c3c2750cb92e5bb883fd --- /dev/null +++ b/EOM.TSHotelManager.Application/Business/Fonts/IFontsService.cs @@ -0,0 +1,40 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EOM.TSHotelManager.Core; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 酒店宣传联动内容接口 + /// + public interface IFontsService + { + /// + /// 查询所有宣传联动内容(跑马灯) + /// + /// + List SelectFontAll(); + } +} \ No newline at end of file diff --git a/EOM.TSHotelManager.Application/Business/Reser/IReserService.cs b/EOM.TSHotelManager.Application/Business/Reser/IReserService.cs new file mode 100644 index 0000000000000000000000000000000000000000..9152c52d18111418b62b074158f5fd491f478845 --- /dev/null +++ b/EOM.TSHotelManager.Application/Business/Reser/IReserService.cs @@ -0,0 +1,63 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EOM.TSHotelManager.Core; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 预约信息接口 + /// + public interface IReserService + { + + /// + /// 获取所有预约信息 + /// + /// + List SelectReserAll(); + + /// + /// 根据房间编号获取预约信息 + /// + /// + /// + Reser SelectReserInfoByRoomNo(string? no); + + /// + /// 删除预约信息 + /// + /// + /// + bool DeleteReserInfo(string? rid); + + /// + /// 添加预约信息 + /// + /// + /// + bool InserReserInfo(Reser r); + + } +} \ No newline at end of file diff --git a/EOM.TSHotelManager.Application/Business/Reser/ReserService.cs b/EOM.TSHotelManager.Application/Business/Reser/ReserService.cs new file mode 100644 index 0000000000000000000000000000000000000000..179764118e4cfc7ac0249882bcb36819f31d1ef3 --- /dev/null +++ b/EOM.TSHotelManager.Application/Business/Reser/ReserService.cs @@ -0,0 +1,107 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EncryptTools.Core; +using EOM.TSHotelManager.Common; +using EOM.TSHotelManager.Core; +using EOM.TSHotelManager.EntityFramework; +using System; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 预约信息接口实现类 + /// + public class ReserService:IReserService + { + /// + /// 预约信息 + /// + private readonly PgRepository reserRepository; + + Encrypt encrypt = new Encrypt(); + + /// + /// 获取所有预约信息 + /// + /// + public List SelectReserAll() + { + List rss = new List(); + rss = reserRepository.GetList(a => a.delete_mk == 0); + rss.ForEach(source => + { + //解密联系方式 + var sourceTelStr = source.CustoTel.Contains("·") ? encrypt.Decryption(source.CustoTel) : source.CustoTel; + source.CustoTel = sourceTelStr; + }); + return rss; + } + + /// + /// 根据房间编号获取预约信息 + /// + /// + /// + public Reser SelectReserInfoByRoomNo(string? no) + { + Reser res = null; + res = reserRepository.GetSingle(a => a.ReserRoom == no && a.delete_mk != 1); + //解密联系方式 + var sourceTelStr = res.CustoTel.Contains("·") ? encrypt.Decryption(res.CustoTel) : res.CustoTel; + res.CustoTel = sourceTelStr; + return res; + } + + /// + /// 删除预约信息 + /// + /// + /// + public bool DeleteReserInfo(string? rid) + { + return reserRepository.Update(a => new Reser() + { + delete_mk = 1, + datachg_usr = LoginInfo.WorkerNo, + datachg_date = DateTime.Now + },a => a.ReserId == rid); + + } + + /// + /// 添加预约信息 + /// + /// + /// + public bool InserReserInfo(Reser r) + { + var cryStr = encrypt.Encryption(r.CustoTel); + r.CustoTel = cryStr; + return reserRepository.Insert(r); + } + + + } +} diff --git a/EOM.TSHotelManager.Application/Business/Room/IRoomService.cs b/EOM.TSHotelManager.Application/Business/Room/IRoomService.cs new file mode 100644 index 0000000000000000000000000000000000000000..a9552969d594db4ecdc3b8bdda9ec737cdadc679 --- /dev/null +++ b/EOM.TSHotelManager.Application/Business/Room/IRoomService.cs @@ -0,0 +1,204 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EOM.TSHotelManager.Core; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 房间信息接口 + /// + public interface IRoomService + { + #region 根据房间状态获取相应状态的房间信息 + /// + /// 根据房间状态获取相应状态的房间信息 + /// + /// + /// + List SelectRoomByRoomState(int stateid); + #endregion + + #region 根据房间状态来查询可使用的房间 + /// + /// 根据房间状态来查询可使用的房间 + /// + /// + List SelectCanUseRoomAll(); + #endregion + + #region 获取所有房间信息 + /// + /// 获取所有房间信息 + /// + /// + List SelectRoomAll(); + #endregion + + #region 获取房间分区的信息 + /// + /// 获取房间分区的信息 + /// + /// + List SelectRoomByTypeName(string? TypeName); + #endregion + + #region 根据房间编号查询房间信息 + /// + /// 根据房间编号查询房间信息 + /// + /// + /// + Room SelectRoomByRoomNo(string? no); + #endregion + + #region 根据房间编号退房(退房) + /// + /// 根据房间编号退房(退房) + /// + /// + /// + bool UpdateRoomByRoomNo(string? room); + #endregion + + #region 根据房间编号查询截止到今天住了多少天 + /// + /// 根据房间编号查询截止到今天住了多少天 + /// + /// + /// + object DayByRoomNo(string? roomno); + #endregion + + #region 根据房间编号修改房间信息(入住) + /// + /// 根据房间编号修改房间信息(入住) + /// + /// + /// + bool UpdateRoomInfo(Room r); + #endregion + + #region 根据房间编号修改房间信息(预约) + /// + /// 根据房间编号修改房间信息(预约) + /// + /// + /// + bool UpdateRoomInfoWithReser(Room r); + #endregion + + #region 查询可入住房间数量 + /// + /// 查询可入住房间数量 + /// + /// + object SelectCanUseRoomAllByRoomState(); + #endregion + + #region 查询已入住房间数量 + /// + /// 查询已入住房间数量 + /// + /// + object SelectNotUseRoomAllByRoomState(); + #endregion + + #region 根据房间编号查询房间价格 + /// + /// 根据房间编号查询房间价格 + /// + /// + object SelectRoomByRoomPrice(string? r); + #endregion + + #region 查询脏房数量 + /// + /// 查询脏房数量 + /// + /// + object SelectNotClearRoomAllByRoomState(); + #endregion + + #region 查询维修房数量 + /// + /// 查询维修房数量 + /// + /// + object SelectFixingRoomAllByRoomState(); + #endregion + + #region 查询预约房数量 + /// + /// 查询预约房数量 + /// + /// + object SelectReseredRoomAllByRoomState(); + #endregion + + #region 根据房间编号更改房间状态 + /// + /// 根据房间编号更改房间状态 + /// + /// + /// + /// + bool UpdateRoomStateByRoomNo(string? roomno, int stateid); + #endregion + + #region 添加房间 + /// + /// 添加房间 + /// + /// + /// + bool InsertRoom(Room rn); + #endregion + + #region 查询所有可消费(已住)房间 + /// + /// 查询所有可消费(已住)房间 + /// + /// + List SelectRoomByStateAll(); + #endregion + + #region 获取所有房间状态 + /// + /// 获取所有房间状态 + /// + /// + List SelectRoomStateAll(); + #endregion + + #region 根据房间编号查询房间状态编号 + /// + /// 根据房间编号查询房间状态编号 + /// + /// + /// + object SelectRoomStateIdByRoomNo(string? roomno); + #endregion + } +} \ No newline at end of file diff --git a/EOM.TSHotelManager.Application/Business/Room/IRoomTypeService.cs b/EOM.TSHotelManager.Application/Business/Room/IRoomTypeService.cs new file mode 100644 index 0000000000000000000000000000000000000000..7e8cba7b194188c0b6fb81866319d58ab988b1db --- /dev/null +++ b/EOM.TSHotelManager.Application/Business/Room/IRoomTypeService.cs @@ -0,0 +1,51 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EOM.TSHotelManager.Core; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 客房信息接口 + /// + public interface IRoomTypeService + { + #region 获取所有房间类型 + /// + /// 获取所有房间类型 + /// + /// + List SelectRoomTypesAll(); + #endregion + + #region 根据房间编号查询房间类型名称 + /// + /// 根据房间编号查询房间类型名称 + /// + /// + /// + RoomType SelectRoomTypeByRoomNo(string? no); + #endregion + } +} \ No newline at end of file diff --git a/EOM.TSHotelManager.Application/Business/Room/RoomService.cs b/EOM.TSHotelManager.Application/Business/Room/RoomService.cs new file mode 100644 index 0000000000000000000000000000000000000000..399a73b71f67dc532e0dd025f35c721a3a0b071e --- /dev/null +++ b/EOM.TSHotelManager.Application/Business/Room/RoomService.cs @@ -0,0 +1,424 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using CK.Common; +using EOM.TSHotelManager.Common; +using EOM.TSHotelManager.Core; +using EOM.TSHotelManager.EntityFramework; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 客房信息接口实现类 + /// + public class RoomService:IRoomService + { + /// + /// 客房信息 + /// + private readonly PgRepository roomRepository; + + /// + /// 客房状态 + /// + private readonly PgRepository roomStateRepository; + + /// + /// 客房类型 + /// + private readonly PgRepository roomTypeRepository; + + /// + /// 客户信息 + /// + private readonly PgRepository custoRepository; + + /// + /// + /// + /// + /// + /// + /// + public RoomService(PgRepository roomRepository, PgRepository roomStateRepository, PgRepository roomTypeRepository, PgRepository custoRepository) + { + this.roomRepository = roomRepository; + this.roomStateRepository = roomStateRepository; + this.roomTypeRepository = roomTypeRepository; + this.custoRepository = custoRepository; + } + + #region 根据房间状态获取相应状态的房间信息 + /// + /// 根据房间状态获取相应状态的房间信息 + /// + /// + /// + public List SelectRoomByRoomState(int stateid) + { + List roomStates = new List(); + roomStates = roomStateRepository.GetList(a => a.delete_mk != 1); + List roomTypes = new List(); + roomTypes = roomTypeRepository.GetList(a => a.delete_mk != 1); + List rooms = new List(); + rooms = roomRepository.GetList(a => a.delete_mk != 1 && a.RoomStateId == stateid).OrderBy(a => a.RoomNo).ToList(); + rooms.ForEach(source => + { + var roomState = roomStates.FirstOrDefault(a => a.RoomStateId == source.RoomStateId); + source.RoomState = string.IsNullOrEmpty(roomState.RoomStateName) ? "" : roomState.RoomStateName; + var roomType = roomTypes.FirstOrDefault(a => a.Roomtype == source.RoomType); + source.RoomName = string.IsNullOrEmpty(roomType.RoomName) ? "" : roomType.RoomName; + }); + return rooms; + } + #endregion + + #region 根据房间状态来查询可使用的房间 + /// + /// 根据房间状态来查询可使用的房间 + /// + /// + public List SelectCanUseRoomAll() + { + List roomStates = new List(); + roomStates = roomStateRepository.GetList(a => a.delete_mk != 1); + List roomTypes = new List(); + roomTypes = roomTypeRepository.GetList(a => a.delete_mk != 1); + List rooms = new List(); + rooms = roomRepository.GetList(a => a.delete_mk != 1 && a.RoomStateId == 0).OrderBy(a => a.RoomNo).ToList(); + rooms.ForEach(source => + { + var roomState = roomStates.FirstOrDefault(a => a.RoomStateId == source.RoomStateId); + source.RoomState = string.IsNullOrEmpty(roomState.RoomStateName) ? "" : roomState.RoomStateName; + var roomType = roomTypes.FirstOrDefault(a => a.Roomtype == source.RoomType); + source.RoomName = string.IsNullOrEmpty(roomType.RoomName) ? "" : roomType.RoomName; + }); + return rooms; + } + #endregion + + #region 获取所有房间信息 + /// + /// 获取所有房间信息 + /// + /// + public List SelectRoomAll() + { + List roomStates = new List(); + roomStates = roomStateRepository.GetList(a => a.delete_mk != 1); + List roomTypes = new List(); + roomTypes = roomTypeRepository.GetList(a => a.delete_mk != 1); + List rooms = new List(); + rooms = roomRepository.GetList(a => a.delete_mk != 1).OrderBy(a => a.RoomNo).ToList(); + var listCustoNo = rooms.Select(a => a.CustoNo).Distinct().ToList(); + List custos = new List(); + custos = custoRepository.GetList(a => listCustoNo.Contains(a.CustoNo)); + rooms.ForEach(source => + { + var roomState = roomStates.FirstOrDefault(a => a.RoomStateId == source.RoomStateId); + source.RoomState = string.IsNullOrEmpty(roomState.RoomStateName) ? "" : roomState.RoomStateName; + var roomType = roomTypes.FirstOrDefault(a => a.Roomtype == source.RoomType); + source.RoomName = string.IsNullOrEmpty(roomType.RoomName) ? "" : roomType.RoomName; + + var custo = custos.FirstOrDefault(a => a.CustoNo.Equals(source.CustoNo)); + source.CustoName = custo.IsNullOrEmpty() ? "" : custo.CustoName; + + //把入住时间格式化 + source.CheckTimeFormat = string.IsNullOrEmpty(source.CheckTime + "") ? "" + : Convert.ToDateTime(source.CheckTime).ToString("yyyy-MM-dd HH:mm"); + + }); + return rooms; + } + #endregion + + #region 获取房间分区的信息 + /// + /// 获取房间分区的信息 + /// + /// + public List SelectRoomByTypeName(string? TypeName) + { + List roomStates = new List(); + roomStates = roomStateRepository.GetList(a => a.delete_mk != 1); + List roomTypes = new List(); + roomTypes = roomTypeRepository.GetList(a => a.delete_mk != 1 && a.RoomName == TypeName); + var listTypes = roomTypes.Select(a => a.Roomtype).Distinct().ToList(); + List rooms = new List(); + rooms = roomRepository.GetList(a => a.delete_mk != 1 && listTypes.Contains(a.RoomType)).OrderBy(a => a.RoomNo).ToList(); + var listCustoNo = rooms.Select(a => a.CustoNo).Distinct().ToList(); + List custos = new List(); + custos = custoRepository.GetList(a => listCustoNo.Contains(a.CustoNo)); + rooms.ForEach(source => + { + var roomState = roomStates.FirstOrDefault(a => a.RoomStateId == source.RoomStateId); + source.RoomState = string.IsNullOrEmpty(roomState.RoomStateName) ? "" : roomState.RoomStateName; + var roomType = roomTypes.FirstOrDefault(a => a.Roomtype == source.RoomType); + source.RoomName = string.IsNullOrEmpty(roomType.RoomName) ? "" : roomType.RoomName; + + var custo = custos.FirstOrDefault(a => a.CustoNo.Equals(source.CustoNo)); + source.CustoName = custo.IsNullOrEmpty() ? "" : custo.CustoName; + + }); + return rooms; + } + #endregion + + #region 根据房间编号查询房间信息 + /// + /// 根据房间编号查询房间信息 + /// + /// + /// + public Room SelectRoomByRoomNo(string? no) + { + List roomStates = new List(); + roomStates = roomStateRepository.GetList(a => a.delete_mk != 1); + Room room = new Room(); + room = roomRepository.GetSingle(a => a.delete_mk != 1 && a.RoomNo == no); + var roomSate = roomStates.FirstOrDefault(a => a.RoomStateId == room.RoomStateId); + room.RoomState = string.IsNullOrEmpty(roomSate.RoomStateName) ? "" : roomSate.RoomStateName; + return room; + } + #endregion + + #region 根据房间编号退房(退房) + /// + /// 根据房间编号退房(退房) + /// + /// + /// + public bool UpdateRoomByRoomNo(string? room) + { + return roomRepository.Update(a => new Room() + { + CustoNo = null, + CheckTime = null, + CheckOutTime = DateTime.Now, + RoomStateId = 3 + },a => a.RoomNo == room); + } + #endregion + + #region 根据房间编号查询截止到今天住了多少天 + /// + /// 根据房间编号查询截止到今天住了多少天 + /// + /// + /// + public object DayByRoomNo(string? roomno) + { + return Math.Abs(((TimeSpan)(roomRepository.GetSingle(a => a.RoomNo == roomno).CheckTime - DateTime.Now)).Days); + } + #endregion + + #region 根据房间编号修改房间信息(入住) + /// + /// 根据房间编号修改房间信息(入住) + /// + /// + /// + public bool UpdateRoomInfo(Room r) + { + return roomRepository.Update(a => new Room() + { + CheckTime = r.CheckTime, + RoomStateId = r.RoomStateId, + CustoNo = r.CustoNo + },a => a.RoomNo == r.RoomNo); + } + #endregion + + #region 根据房间编号修改房间信息(预约) + /// + /// 根据房间编号修改房间信息(预约) + /// + /// + /// + public bool UpdateRoomInfoWithReser(Room r) + { + return roomRepository.Update(a => new Room() + { + RoomStateId = r.RoomStateId, + datachg_usr = LoginInfo.WorkerNo, + datachg_date = DateTime.Now + }, a => a.RoomNo == r.RoomNo); + } + #endregion + + #region 查询可入住房间数量 + /// + /// 查询可入住房间数量 + /// + /// + public object SelectCanUseRoomAllByRoomState() + { + return roomRepository.GetList(a => a.RoomStateId == 0 && a.delete_mk != 1).OrderBy(a => a.RoomNo).Count(); + } + #endregion + + #region 查询已入住房间数量 + /// + /// 查询已入住房间数量 + /// + /// + public object SelectNotUseRoomAllByRoomState() + { + return roomRepository.GetList(a => a.RoomStateId == 1 && a.delete_mk != 1).OrderBy(a => a.RoomNo).Count(); + } + #endregion + + #region 根据房间编号查询房间价格 + /// + /// 根据房间编号查询房间价格 + /// + /// + public object SelectRoomByRoomPrice(string? r) + { + return roomRepository.GetSingle(a => a.RoomNo == r).RoomMoney; + } + #endregion + + #region 查询脏房数量 + /// + /// 查询脏房数量 + /// + /// + public object SelectNotClearRoomAllByRoomState() + { + return roomRepository.GetList(a => a.RoomStateId == 3 && a.delete_mk != 1).OrderBy(a => a.RoomNo).Count(); + } + #endregion + + #region 查询维修房数量 + /// + /// 查询维修房数量 + /// + /// + public object SelectFixingRoomAllByRoomState() + { + return roomRepository.GetList(a => a.RoomStateId == 2 && a.delete_mk != 1).OrderBy(a => a.RoomNo).Count(); + } + #endregion + + #region 查询预约房数量 + /// + /// 查询预约房数量 + /// + /// + public object SelectReseredRoomAllByRoomState() + { + return roomRepository.GetList(a => a.RoomStateId == 4 && a.delete_mk != 1).OrderBy(a => a.RoomNo).Count(); + } + #endregion + + #region 根据房间编号更改房间状态 + /// + /// 根据房间编号更改房间状态 + /// + /// + /// + /// + public bool UpdateRoomStateByRoomNo(string? roomno, int stateid) + { + return roomRepository.Update(a => new Room() + { + RoomStateId = stateid, + datains_usr = LoginInfo.WorkerNo, + datachg_date = DateTime.Now + },a => a.RoomNo == roomno); + } + #endregion + + #region 添加房间 + /// + /// 添加房间 + /// + /// + /// + public bool InsertRoom(Room rn) + { + try + { + return roomRepository.Insert(rn); + } + catch (Exception) + { + return false; + } + } + #endregion + + #region 查询所有可消费(已住)房间 + /// + /// 查询所有可消费(已住)房间 + /// + /// + public List SelectRoomByStateAll() + { + List roomStates = new List(); + roomStates = roomStateRepository.GetList(a => a.delete_mk != 1); + List roomTypes = new List(); + roomTypes = roomTypeRepository.GetList(a => a.delete_mk != 1); + List rooms = new List(); + rooms = roomRepository.GetList(a => a.delete_mk != 1 && a.RoomStateId == 1).OrderBy(a => a.RoomNo).ToList(); + rooms.ForEach(source => + { + var roomState = roomStates.FirstOrDefault(a => a.RoomStateId == source.RoomStateId); + source.RoomState = string.IsNullOrEmpty(roomState.RoomStateName) ? "" : roomState.RoomStateName; + var roomType = roomTypes.FirstOrDefault(a => a.Roomtype == source.RoomType); + source.RoomName = string.IsNullOrEmpty(roomType.RoomName) ? "" : roomType.RoomName; + }); + return rooms; + } + #endregion + + #region 获取所有房间状态 + /// + /// 获取所有房间状态 + /// + /// + public List SelectRoomStateAll() + { + List rs = new List(); + rs = roomStateRepository.GetList(a => a.delete_mk != 1); + return rs; + } + #endregion + + #region 根据房间编号查询房间状态编号 + /// + /// 根据房间编号查询房间状态编号 + /// + /// + /// + public object SelectRoomStateIdByRoomNo(string? roomno) + { + return roomRepository.GetSingle(a => a.RoomNo == roomno).RoomStateId; + } + #endregion + } +} diff --git a/EOM.TSHotelManager.Application/Business/Room/RoomTypeService.cs b/EOM.TSHotelManager.Application/Business/Room/RoomTypeService.cs new file mode 100644 index 0000000000000000000000000000000000000000..3f52efdbeff1b8eca22c8fd649c873056867d5e1 --- /dev/null +++ b/EOM.TSHotelManager.Application/Business/Room/RoomTypeService.cs @@ -0,0 +1,86 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EOM.TSHotelManager.Core; +using EOM.TSHotelManager.EntityFramework; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 房间类型接口实现类 + /// + public class RoomTypeService:IRoomTypeService + { + + /// + /// 客房类型 + /// + private readonly PgRepository roomTypeRepository; + + /// + /// 客房信息 + /// + private readonly PgRepository roomRepository; + + /// + /// + /// + /// + /// + public RoomTypeService(PgRepository roomTypeRepository, PgRepository roomRepository) + { + this.roomTypeRepository = roomTypeRepository; + this.roomRepository = roomRepository; + } + + #region 获取所有房间类型 + /// + /// 获取所有房间类型 + /// + /// + public List SelectRoomTypesAll() + { + List types = new List(); + types = roomTypeRepository.GetList(a => a.delete_mk != 1); + return types; + } + #endregion + + #region 根据房间编号查询房间类型名称 + /// + /// 根据房间编号查询房间类型名称 + /// + /// + /// + public RoomType SelectRoomTypeByRoomNo(string? no) + { + RoomType roomtype = new RoomType(); + Room room = new Room(); + room = roomRepository.GetSingle(a => a.RoomNo == no && a.delete_mk != 1); + roomtype.RoomName = roomTypeRepository.GetSingle(a => a.Roomtype == room.RoomStateId).RoomName; + return roomtype; + } + #endregion + } +} diff --git a/EOM.TSHotelManager.Application/Business/Sellthing/ISellService.cs b/EOM.TSHotelManager.Application/Business/Sellthing/ISellService.cs new file mode 100644 index 0000000000000000000000000000000000000000..4bc21c90a8608b3fbc8504add29357b1de5767f5 --- /dev/null +++ b/EOM.TSHotelManager.Application/Business/Sellthing/ISellService.cs @@ -0,0 +1,97 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EOM.TSHotelManager.Core; +using System; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 商品接口 + /// + public interface ISellService + { + /// + /// 查询所有商品 + /// + /// + List SelectSellThingAll(SellThing sellThing = null); + + /// + /// 修改商品 + /// + /// + /// + /// + bool UpdateSellThing(string? stock, string? sellNo); + + /// + /// 修改商品信息 + /// + /// + /// + bool UpdateSellthingInfo(SellThing sellThing); + + /// + /// 撤回客户消费信息 + /// + /// + /// + /// + /// + bool DeleteSellThing(string? roomNo, string? custoNo, string? sellName); + + /// + /// 根据商品编号删除商品信息 + /// + /// + /// + bool DeleteSellThingBySellNo(string? sellNo); + + /// + /// 根据商品名称和价格查询商品编号 + /// + /// + /// + /// + SellThing SelectSellThingByNameAndPrice(string? name, string? price); + + + /// + /// 根据商品编号查询商品信息 + /// + /// + /// + SellThing SelectSellInfoBySellNo(string? SellNo); + + #region 添加商品 + /// + /// 添加商品 + /// + /// + /// + bool InsertSellThing(SellThing st); + #endregion + } +} \ No newline at end of file diff --git a/EOM.TSHotelManager.Application/Business/Sellthing/SellService.cs b/EOM.TSHotelManager.Application/Business/Sellthing/SellService.cs new file mode 100644 index 0000000000000000000000000000000000000000..dd6664c090116a0223a271b77c5db85e6644b3ed --- /dev/null +++ b/EOM.TSHotelManager.Application/Business/Sellthing/SellService.cs @@ -0,0 +1,201 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using System; +using System.Collections.Generic; +using CK.Common; +using EOM.TSHotelManager.Common; +using EOM.TSHotelManager.Core; +using EOM.TSHotelManager.EntityFramework; +using SqlSugar; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 商品信息接口实现类 + /// + public class SellService:ISellService + { + /// + /// 商品信息 + /// + private readonly PgRepository sellThingRepository; + + /// + /// 消费情况 + /// + private readonly PgRepository spendRepository; + + /// + /// + /// + /// + /// + public SellService(PgRepository sellThingRepository, PgRepository spendRepository) + { + this.sellThingRepository = sellThingRepository; + this.spendRepository = spendRepository; + } + + /// + /// 查询所有商品 + /// + /// + public List SelectSellThingAll(SellThing sellThing = null) + { + List sellThings = new List(); + var exp = Expressionable.Create().And(a => a.delete_mk == 0); + if (sellThing.IsNullOrEmpty()) + { + sellThings = sellThingRepository.GetList(exp.ToExpression()); + sellThings.ForEach(_sellThing => + { + _sellThing.SellPriceStr = Decimal.Parse(_sellThing.SellPrice.ToString()).ToString("#,##0.00").ToString(); + }); + } + else + { + //商品编号 + if (!sellThing.SellNo.IsNullOrEmpty()) + { + exp = exp.And(a => a.SellNo.Contains(sellThing.SellNo)); + } + //商品名称 + if (!sellThing.SellName.IsNullOrEmpty()) + { + exp = exp.Or(a => a.SellName.Contains(sellThing.SellName)); + } + sellThings = sellThingRepository.GetList(exp.ToExpression()); + sellThings.ForEach(_sellThing => + { + _sellThing.SellPriceStr = Decimal.Parse(_sellThing.SellPrice.ToString()).ToString("#,##0.00").ToString(); + }); + } + return sellThings; + } + + /// + /// 更新商品数量 + /// + /// + /// + /// + public bool UpdateSellThing(string? stock, string? sellNo) + { + return sellThingRepository.Update(a => new SellThing() + { + Stock = Convert.ToInt32(stock), + datachg_usr = LoginInfo.WorkerNo, + datachg_date = DateTime.Now + },a => a.SellNo == sellNo); + } + + /// + /// 修改商品信息 + /// + /// + /// + public bool UpdateSellthingInfo(SellThing sellThing) + { + return sellThingRepository.Update(a => new SellThing() + { + SellName = sellThing.SellName, + SellPrice = sellThing.SellPrice, + Stock = sellThing.Stock, + format = sellThing.format, + },a => a.SellNo == sellThing.SellNo); + } + + /// + /// 撤回客户消费信息 + /// + /// + /// + /// + /// + public bool DeleteSellThing(string? roomNo, string? custoNo, string? sellName) + { + return spendRepository.Update(a => new Spend() + { + delete_mk = 1, + datachg_usr = LoginInfo.WorkerNo, + datachg_date = DateTime.Now + },a => a.MoneyState.Equals(SpendConsts.UnSettle) && a.RoomNo == roomNo && a.CustoNo == custoNo + && a.SpendName == sellName); + + } + + /// + /// 根据商品编号删除商品信息 + /// + /// + /// + public bool DeleteSellThingBySellNo(string? sellNo) + { + return sellThingRepository.Update(a => new SellThing() + { + delete_mk = 1, + datachg_usr = AdminInfo.Account, + datachg_date = DateTime.Now + }, a => a.SellNo == sellNo); + } + + /// + /// 根据商品名称和价格查询商品编号 + /// + /// + /// + /// + public SellThing SelectSellThingByNameAndPrice(string? name,string? price) + { + SellThing sellThing = null; + sellThing = sellThingRepository.GetSingle(a => a.SellName == name && a.SellPrice == Convert.ToDecimal(price)); + return sellThing; + } + + + /// + /// 根据商品编号查询商品信息 + /// + /// + /// + public SellThing SelectSellInfoBySellNo(string? SellNo) + { + SellThing st = null; + st = sellThingRepository.GetSingle(a => a.SellNo == SellNo && a.delete_mk != 1); + return st; + } + + #region 添加商品 + /// + /// 添加商品 + /// + /// + /// + public bool InsertSellThing(SellThing st) + { + return sellThingRepository.Insert(st); + } + #endregion + } +} diff --git a/EOM.TSHotelManager.Application/Business/Spend/ISpendService.cs b/EOM.TSHotelManager.Application/Business/Spend/ISpendService.cs new file mode 100644 index 0000000000000000000000000000000000000000..4bd0852015c4e87e03f27f88baa262e1e1fa8056 --- /dev/null +++ b/EOM.TSHotelManager.Application/Business/Spend/ISpendService.cs @@ -0,0 +1,124 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EOM.TSHotelManager.Core; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 消费信息接口 + /// + public interface ISpendService + { + #region 添加消费信息 + /// + /// 添加消费信息 + /// + /// + /// + bool InsertSpendInfo(Spend s); + #endregion + + #region 根据客户编号查询消费信息 + /// + /// 根据客户编号查询消费信息 + /// + /// + /// + List SelectSpendByCustoNo(string? No); + #endregion + + #region 根据房间编号查询消费信息 + /// + /// 根据房间编号查询消费信息 + /// + /// + /// + List SelectSpendByRoomNo(string? No); + #endregion + + #region 根据客户编号查询历史消费信息 + /// + /// 根据客户编号查询历史消费信息 + /// + /// + /// + List SeletHistorySpendInfoAll(string? custoNo); + #endregion + + #region 查询消费的所有信息 + /// + /// 查询消费的所有信息 + /// + /// + List SelectSpendInfoAll(); + #endregion + + #region 根据房间号查询消费的所有信息 + /// + /// 根据房间号查询消费的所有信息 + /// + /// + List SelectSpendInfoRoomNo(string? RoomNo); + #endregion + + #region 根据房间编号、入住时间到当前时间查询消费总金额 + /// + /// 根据房间编号、入住时间到当前时间查询消费总金额 + /// + /// + /// + /// + object SelectMoneyByRoomNoAndTime(string? roomno, string? custono); + #endregion + + #region 根据房间编号、入住时间和当前时间修改结算状态 + /// + /// 根据房间编号、入住时间和当前时间修改结算状态 + /// + /// + /// + /// + bool UpdateMoneyState(string? roomno, string? checktime); + #endregion + + #region 将转房前的未结算记录一同转移到新房间 + /// + /// 将转房前的未结算记录一同转移到新房间 + /// + /// + /// + /// + /// + bool UpdateSpendInfoByRoomNo(List spends, string? newRoom, string? custoNo); + #endregion + + /// + /// 更新消费信息 + /// + /// + /// + bool UpdSpenInfo(Spend spend); + } +} \ No newline at end of file diff --git a/EOM.TSHotelManager.Application/Business/Spend/SpendService.cs b/EOM.TSHotelManager.Application/Business/Spend/SpendService.cs new file mode 100644 index 0000000000000000000000000000000000000000..e47e665975727732bef6529562ae70d92394c3df --- /dev/null +++ b/EOM.TSHotelManager.Application/Business/Spend/SpendService.cs @@ -0,0 +1,261 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using System; +using System.Collections.Generic; +using System.Linq; +using EOM.TSHotelManager.Common; +using EOM.TSHotelManager.Core; +using EOM.TSHotelManager.EntityFramework; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 商品消费接口实现类 + /// + public class SpendService:ISpendService + { + /// + /// 商品消费 + /// + private readonly PgRepository spendRepository; + + /// + /// + /// + /// + public SpendService(PgRepository spendRepository) + { + this.spendRepository = spendRepository; + } + + #region 添加消费信息 + /// + /// 添加消费信息 + /// + /// + /// + public bool InsertSpendInfo(Spend s) + { + return spendRepository.Insert(s); + } + #endregion + + #region 根据客户编号查询消费信息 + /// + /// 根据客户编号查询消费信息 + /// + /// + /// + public List SelectSpendByCustoNo(string? No) + { + List ls = new List(); + ls = spendRepository.GetList(a => a.CustoNo == No && a.MoneyState.Equals(SpendConsts.UnSettle) && a.delete_mk != 1); + ls.ForEach(source => + { + source.SpendStateNm = string.IsNullOrEmpty(source.MoneyState) ? "" + : source.MoneyState.Equals(SpendConsts.Settled) ? "已结算" : "未结算"; + + source.SpendPriceStr = string.IsNullOrEmpty(source.SpendPrice + "") ? "" + : Decimal.Parse(source.SpendPrice.ToString()).ToString("#,##0.00").ToString(); + + source.SpendMoneyStr = string.IsNullOrEmpty(source.SpendMoney + "") ? "" + : Decimal.Parse(source.SpendMoney.ToString()).ToString("#,##0.00").ToString(); + }); + return ls; + } + #endregion + + #region 根据客户编号查询历史消费信息 + /// + /// 根据客户编号查询历史消费信息 + /// + /// + /// + public List SeletHistorySpendInfoAll(string? custoNo) + { + List ls = new List(); + ls = spendRepository.GetList(a => a.CustoNo == custoNo && a.MoneyState.Equals(SpendConsts.Settled) && a.delete_mk != 1); + ls.ForEach(source => + { + source.SpendStateNm = string.IsNullOrEmpty(source.MoneyState) ? "" + : source.MoneyState.Equals(SpendConsts.Settled) ? "已结算" : "未结算"; + + source.SpendPriceStr = string.IsNullOrEmpty(source.SpendPrice + "") ? "" + : Decimal.Parse(source.SpendPrice.ToString()).ToString("#,##0.00").ToString(); + + source.SpendMoneyStr = string.IsNullOrEmpty(source.SpendMoney + "") ? "" + : Decimal.Parse(source.SpendMoney.ToString()).ToString("#,##0.00").ToString(); + }); + return ls; + } + #endregion + + #region 根据房间编号查询消费信息 + /// + /// 根据房间编号查询消费信息 + /// + /// + /// + public List SelectSpendByRoomNo(string? No) + { + List ls = new List(); + ls = spendRepository.GetList(a => a.RoomNo == No && a.MoneyState.Equals(SpendConsts.UnSettle) && a.delete_mk != 1); + ls.ForEach(source => + { + source.SpendStateNm = string.IsNullOrEmpty(source.MoneyState) ? "" + : source.MoneyState.Equals(SpendConsts.Settled) ? "已结算" : "未结算"; + + source.SpendPriceStr = string.IsNullOrEmpty(source.SpendPrice + "") ? "" + : Decimal.Parse(source.SpendPrice.ToString()).ToString("#,##0.00").ToString(); + + source.SpendMoneyStr = string.IsNullOrEmpty(source.SpendMoney + "") ? "" + : Decimal.Parse(source.SpendMoney.ToString()).ToString("#,##0.00").ToString(); + }); + return ls; + } + #endregion + + #region 查询消费的所有信息 + /// + /// 查询消费的所有信息 + /// + /// + public List SelectSpendInfoAll() + { + List ls = new List(); + ls = spendRepository.GetList(a => a.delete_mk != 1).OrderByDescending(a => a.SpendTime).ToList(); + ls.ForEach(source => + { + source.SpendStateNm = string.IsNullOrEmpty(source.MoneyState) ? "" + : source.MoneyState.Equals(SpendConsts.Settled) ? "已结算" : "未结算"; + + source.SpendPriceStr = string.IsNullOrEmpty(source.SpendPrice + "") ? "" + : Decimal.Parse(source.SpendPrice.ToString()).ToString("#,##0.00").ToString(); + + source.SpendMoneyStr = string.IsNullOrEmpty(source.SpendMoney + "") ? "" + : Decimal.Parse(source.SpendMoney.ToString()).ToString("#,##0.00").ToString(); + }); + return ls; + } + #endregion + + #region 根据房间号查询消费的所有信息 + /// + /// 根据房间号查询消费的所有信息 + /// + /// + public List SelectSpendInfoRoomNo(string? RoomNo) + { + List ls = new List(); + ls = spendRepository.GetList(a => a.RoomNo == RoomNo && a.delete_mk != 1 && a.MoneyState.Equals(SpendConsts.UnSettle)); + ls.ForEach(source => + { + source.SpendStateNm = string.IsNullOrEmpty(source.MoneyState) ? "" + : source.MoneyState.Equals(SpendConsts.Settled) ? "已结算" : "未结算"; + + source.SpendPriceStr = string.IsNullOrEmpty(source.SpendPrice + "") ? "" + : Decimal.Parse(source.SpendPrice.ToString()).ToString("#,##0.00").ToString(); + + source.SpendMoneyStr = string.IsNullOrEmpty(source.SpendMoney + "") ? "" + : Decimal.Parse(source.SpendMoney.ToString()).ToString("#,##0.00").ToString(); + }); + return ls; + } + #endregion + + #region 根据房间编号、入住时间到当前时间查询消费总金额 + /// + /// 根据房间编号、入住时间到当前时间查询消费总金额 + /// + /// + /// + /// + 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); + } + #endregion + + #region 根据房间编号、入住时间和当前时间修改结算状态 + /// + /// 根据房间编号、入住时间和当前时间修改结算状态 + /// + /// + /// + /// + public bool UpdateMoneyState(string? roomno, string? checktime) + { + return spendRepository.Update(a => new Spend() + { + MoneyState = SpendConsts.Settled, + datachg_usr = LoginInfo.WorkerNo, + datachg_date = DateTime.Now + },a => a.RoomNo == roomno && a.SpendTime >= Convert.ToDateTime(checktime) && a.SpendTime <= DateTime.Now); + } + #endregion + + #region 将转房前的未结算记录一同转移到新房间 + /// + /// 将转房前的未结算记录一同转移到新房间 + /// + /// + /// + /// + /// + public bool UpdateSpendInfoByRoomNo(List spends, string? newRoom, string? custoNo) + { + var listSpendId = spends.Select(a => a.SpendName).Distinct().ToList(); + + return spendRepository.Update(a => new Spend() + { + RoomNo = newRoom, + datachg_usr = LoginInfo.WorkerNo, + datachg_date = DateTime.Now + }, a => listSpendId.Contains(a.RoomNo) && a.CustoNo == custoNo && a.MoneyState.Equals(SpendConsts.UnSettle) && a.SpendTime >= DateTime.Now + && a.SpendTime <= DateTime.Now); + + + } + #endregion + + /// + /// 更新消费信息 + /// + /// + /// + public bool UpdSpenInfo(Spend spend) + { + return spendRepository.Update(a => new Spend() + { + SpendAmount = spend.SpendAmount, + SpendMoney = spend.SpendMoney, + + }, 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 new file mode 100644 index 0000000000000000000000000000000000000000..c1bdcc9015402d451a32ffd3b252fb02cfb9021e --- /dev/null +++ b/EOM.TSHotelManager.Application/Business/Wti/IWtiService.cs @@ -0,0 +1,117 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EOM.TSHotelManager.Core; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 水电信息接口 + /// + public interface IWtiService + { + #region 根据房间编号查询水电费信息 + /// + /// 根据房间编号查询水电费信息 + /// + /// + /// + Wti SelectWtiInfoByRoomNo(string? roomNo); + #endregion + + #region 根据房间编号、使用时间查询水电费信息 + /// + /// 根据房间编号、使用时间查询水电费信息 + /// + /// + /// + /// + /// + Wti SelectWtiInfoByRoomNoAndTime(string? roomno, string? usedate, string? enddate); + #endregion + + #region 获取所有水电费信息 + /// + /// 获取所有水电费信息 + /// + /// + List SelectWtiInfoAll(); + #endregion + + #region 添加水电费信息 + /// + /// 添加水电费信息 + /// + /// + /// + bool InsertWtiInfo(Wti w); + #endregion + + #region 修改水电费信息(根据房间编号) + /// + /// 修改水电费信息(根据房间编号) + /// + /// + /// + bool UpdateWtiInfo(Wti w); + #endregion + + #region 根据房间信息、使用时间修改水电费 + /// + /// 根据房间信息、使用时间修改水电费 + /// + /// + /// + bool UpdateWtiInfoByRoomNoAndDateTime(Wti w); + #endregion + + #region 删除水电费信息:根据房间编号 + /// + /// 删除水电费信息:根据房间编号 + /// + /// + /// + //bool DeleteWtiInfo(string? roomno); + #endregion + + #region 根据房间编号、使用时间删除水电费信息 + /// + /// 根据房间编号、使用时间删除水电费信息 + /// + /// + /// + /// + /// + bool DeleteWtiInfoByRoomNoAndDateTime(string? roomno, string? usedate, string? enddate); + #endregion + + #region 根据房间编号获取该房间所有水电费信息 + /// + /// 获取所有水电费信息 + /// + /// + List ListWtiInfoByRoomNo(string? roomno); + #endregion + } +} \ No newline at end of file diff --git a/EOM.TSHotelManager.Application/Business/Wti/WtiService.cs b/EOM.TSHotelManager.Application/Business/Wti/WtiService.cs new file mode 100644 index 0000000000000000000000000000000000000000..83b7681b7e36dedbc7e0b89135f317b9c3c09bc9 --- /dev/null +++ b/EOM.TSHotelManager.Application/Business/Wti/WtiService.cs @@ -0,0 +1,199 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using System; +using System.Collections.Generic; +using EOM.TSHotelManager.Common; +using EOM.TSHotelManager.Core; +using EOM.TSHotelManager.EntityFramework; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 水电信息接口实现类 + /// + public class WtiService:IWtiService + { + /// + /// 水电信息 + /// + private readonly PgRepository wtiRepository; + + /// + /// + /// + /// + public WtiService(PgRepository wtiRepository) + { + this.wtiRepository = wtiRepository; + } + + #region 根据房间编号查询水电费信息 + /// + /// 根据房间编号查询水电费信息 + /// + /// + /// + public Wti SelectWtiInfoByRoomNo(string? roomNo) + { + Wti w = new Wti(); + w = wtiRepository.GetSingle(a => a.RoomNo.Contains(roomNo) && a.delete_mk != 1); + return w; + } + #endregion + + #region 根据房间编号、使用时间查询水电费信息 + /// + /// 根据房间编号、使用时间查询水电费信息 + /// + /// + /// + /// + /// + public Wti SelectWtiInfoByRoomNoAndTime(string? roomno, string? usedate, string? enddate) + { + Wti w = null; + w = wtiRepository.GetSingle(a => a.RoomNo == roomno && a.UseDate >= Convert.ToDateTime(usedate) && a.EndDate >= Convert.ToDateTime(enddate)); + return w; + } + #endregion + + #region 获取所有水电费信息 + /// + /// 获取所有水电费信息 + /// + /// + public List SelectWtiInfoAll() + { + List wti = new List(); + wti = wtiRepository.GetList(a => a.delete_mk != 1); + return wti; + } + #endregion + + #region 根据房间编号获取该房间所有水电费信息 + /// + /// 获取所有水电费信息 + /// + /// + public List ListWtiInfoByRoomNo(string? roomno) + { + List wti = new List(); + wti = wtiRepository.GetList(a => a.delete_mk != 1 && a.RoomNo.Equals(roomno)); + return wti; + } + #endregion + + #region 添加水电费信息 + /// + /// 添加水电费信息 + /// + /// + /// + public bool InsertWtiInfo(Wti w) + { + return wtiRepository.Insert(w); + } + #endregion + + #region 修改水电费信息(根据房间编号) + /// + /// 修改水电费信息(根据房间编号) + /// + /// + /// + public bool UpdateWtiInfo(Wti w) + { + return wtiRepository.Update(a => new Wti() + { + UseDate = w.UseDate, + EndDate = w.EndDate, + WaterUse = w.WaterUse, + PowerUse = w.PowerUse, + Record = w.Record, + CustoNo = w.CustoNo, + datachg_usr = w.datachg_usr, + datachg_date = w.datachg_date, + RoomNo = w.RoomNo + },a => a.WtiNo == w.WtiNo); + + } + #endregion + + #region 根据房间信息、使用时间修改水电费 + /// + /// 根据房间信息、使用时间修改水电费 + /// + /// + /// + public bool UpdateWtiInfoByRoomNoAndDateTime(Wti w) + { + return wtiRepository.Update(a => new Wti() + { + WaterUse = w.WaterUse, + PowerUse = w.PowerUse, + datachg_usr = LoginInfo.WorkerNo, + datachg_date = DateTime.Now, + },a => a.RoomNo == w.RoomNo && a.UseDate >= w.UseDate && a.EndDate >= w.EndDate); + } + #endregion + + #region 删除水电费信息:根据房间编号 + /// + /// 删除水电费信息:根据房间编号 + /// + /// + /// + //public bool DeleteWtiInfo(string? roomno) + //{ + // return base.Update(a => new Wti() + // { + // delete_mk = 1, + // datachg_usr = LoginInfo.WorkerNo, + // datachg_date = DateTime.Now + // }, a => a.WtiNo == roomno); + //} + #endregion + + #region 根据房间编号、使用时间删除水电费信息 + /// + /// 根据房间编号、使用时间删除水电费信息 + /// + /// + /// + /// + /// + public bool DeleteWtiInfoByRoomNoAndDateTime(string? roomno, string? usedate, string? enddate) + { + //string? sql = "delete from WTINFO where RoomNo='{0}' and UseDate='{1}' and EndDate='{2}'"; + //sql = string?.Format(sql, roomno, usedate, enddate); + return wtiRepository.Update(a => new Wti() + { + delete_mk = 1, + datachg_usr = LoginInfo.WorkerNo, + datachg_date = DateTime.Now + },a => a.RoomNo == roomno && a.UseDate >= Convert.ToDateTime(usedate) && a.EndDate >= Convert.ToDateTime(enddate)); + } + #endregion + } +} diff --git a/EOM.TSHotelManager.Application/EOM.TSHotelManager.Application.csproj b/EOM.TSHotelManager.Application/EOM.TSHotelManager.Application.csproj new file mode 100644 index 0000000000000000000000000000000000000000..fb379c19dbf35d3163efa49d22d082d0b39a396e --- /dev/null +++ b/EOM.TSHotelManager.Application/EOM.TSHotelManager.Application.csproj @@ -0,0 +1,34 @@ + + + + net6.0 + enable + enable + True + + + + 1701;1702;8618; + + + + 1701;1702;8618; + + + + + + + + + + + + + + + ..\Library\CK.Common.dll + + + + diff --git a/EOM.TSHotelManager.Application/Sys/NavBar/INavBarService.cs b/EOM.TSHotelManager.Application/Sys/NavBar/INavBarService.cs new file mode 100644 index 0000000000000000000000000000000000000000..44b33f95d791e5a9fe04ba9d8483be16d6641f7f --- /dev/null +++ b/EOM.TSHotelManager.Application/Sys/NavBar/INavBarService.cs @@ -0,0 +1,16 @@ +using EOM.TSHotelManager.Core; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 导航控件模块接口 + /// + public interface INavBarService + { + /// + /// 导航控件列表 + /// + /// + List NavBarList(); + } +} \ No newline at end of file diff --git a/EOM.TSHotelManager.Application/Sys/NavBar/NavBarService.cs b/EOM.TSHotelManager.Application/Sys/NavBar/NavBarService.cs new file mode 100644 index 0000000000000000000000000000000000000000..d8d2cfbd5e566cb6cb4bd5d394c1a0fba11de6d9 --- /dev/null +++ b/EOM.TSHotelManager.Application/Sys/NavBar/NavBarService.cs @@ -0,0 +1,41 @@ +using EOM.TSHotelManager.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 + { + /// + /// 导航控件 + /// + private readonly PgRepository navBarRepository; + + /// + /// + /// + /// + public NavBarService(PgRepository navBarRepository) + { + this.navBarRepository = navBarRepository; + } + + /// + /// 导航控件列表 + /// + /// + public List NavBarList() + { + var navBarList = navBarRepository.GetList(a => a.delete_mk != 1); + + return navBarList; + } + } +} diff --git a/EOM.TSHotelManager.Application/Worker/Check/IWorkerCheckService.cs b/EOM.TSHotelManager.Application/Worker/Check/IWorkerCheckService.cs new file mode 100644 index 0000000000000000000000000000000000000000..98fe435745ae60bce79427387ca013c35ca77ba0 --- /dev/null +++ b/EOM.TSHotelManager.Application/Worker/Check/IWorkerCheckService.cs @@ -0,0 +1,62 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EOM.TSHotelManager.Core; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 员工打卡接口 + /// + public interface IWorkerCheckService + { + /// + /// 根据员工编号查询其所有的打卡记录 + /// + /// + /// + List SelectCheckInfoByWorkerNo(string? wid); + + /// + /// 查询员工签到天数 + /// + /// + /// + object SelectWorkerCheckDaySumByWorkerNo(string? wkn); + + /// + /// 查询今天员工是否已签到 + /// + /// + /// + object SelectToDayCheckInfoByWorkerNo(string? wkn); + + /// + /// 添加员工打卡数据 + /// + /// + /// + bool AddCheckInfo(WorkerCheck workerCheck); + } +} \ No newline at end of file diff --git a/EOM.TSHotelManager.Application/Worker/Check/WorkerCheckService.cs b/EOM.TSHotelManager.Application/Worker/Check/WorkerCheckService.cs new file mode 100644 index 0000000000000000000000000000000000000000..71d980c1ca8e9d26d0087f03dab5d081c2df10c1 --- /dev/null +++ b/EOM.TSHotelManager.Application/Worker/Check/WorkerCheckService.cs @@ -0,0 +1,102 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EOM.TSHotelManager.Core; +using EOM.TSHotelManager.EntityFramework; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 员工打卡接口实现类 + /// + public class WorkerCheckService:IWorkerCheckService + { + /// + /// 员工打卡 + /// + private readonly PgRepository workerCheckRepository; + + /// + /// + /// + /// + public WorkerCheckService(PgRepository workerCheckRepository) + { + this.workerCheckRepository = workerCheckRepository; + } + + /// + /// 根据员工编号查询其所有的打卡记录 + /// + /// + /// + public List SelectCheckInfoByWorkerNo(string? wid) + { + List workerChecks = new List(); + workerChecks = workerCheckRepository.GetList(a => a.WorkerNo == wid && a.delete_mk != 1); + workerChecks.ForEach(source => + { + source.CheckStateNm = source.CheckState == 0 ? "打卡成功" : "打卡失败"; + }); + return workerChecks; + } + + + /// + /// 查询员工签到天数 + /// + /// + /// + public object SelectWorkerCheckDaySumByWorkerNo(string? wkn) + { + return workerCheckRepository.GetList(a => a.WorkerNo == wkn && a.delete_mk != 1).Count; + } + + + /// + /// 查询今天员工是否已签到 + /// + /// + /// + public object SelectToDayCheckInfoByWorkerNo(string? wkn) + { + //string? sql = "select Count(*) from WORKERCHECK where WorkerNo = '"+wkn+ "' and DATEDIFF(CURRENT_DATE(),workercheck.CheckTime)"; + var listCheckInfo = workerCheckRepository.GetList(a => a.WorkerNo == wkn && a.delete_mk != 1); + var count = listCheckInfo.Where(a => a.CheckTime.ToShortDateString() == DateTime.Now.ToShortDateString()).Count() > 0 ? 1 : 0; + return count; + } + + /// + /// 添加员工打卡数据 + /// + /// + /// + public bool AddCheckInfo(WorkerCheck workerCheck) + { + return workerCheckRepository.Insert(workerCheck); + } + } +} diff --git a/EOM.TSHotelManager.Application/Worker/GoodBad/IWorkerGoodBadService.cs b/EOM.TSHotelManager.Application/Worker/GoodBad/IWorkerGoodBadService.cs new file mode 100644 index 0000000000000000000000000000000000000000..1bfd29c137edf9d18e0a28bdae12e20518732c26 --- /dev/null +++ b/EOM.TSHotelManager.Application/Worker/GoodBad/IWorkerGoodBadService.cs @@ -0,0 +1,48 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EOM.TSHotelManager.Core; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 员工奖惩信息接口 + /// + public interface IWorkerGoodBadService + { + /// + /// 添加员工奖惩记录 + /// + /// + /// + bool AddGoodBad(WorkerGoodBad goodBad); + + /// + /// 根据工号查找所有的奖惩记录信息 + /// + /// + /// + List SelectAllGoodBadByWorkNo(string? wn); + } +} \ No newline at end of file diff --git a/EOM.TSHotelManager.Application/Worker/GoodBad/WorkerGoodBadService.cs b/EOM.TSHotelManager.Application/Worker/GoodBad/WorkerGoodBadService.cs new file mode 100644 index 0000000000000000000000000000000000000000..ad5a1b5fd54e77f0df2a497bf460e0a7440fcfce --- /dev/null +++ b/EOM.TSHotelManager.Application/Worker/GoodBad/WorkerGoodBadService.cs @@ -0,0 +1,104 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EOM.TSHotelManager.Core; +using EOM.TSHotelManager.EntityFramework; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 员工奖惩记录接口实现类 + /// + public class WorkerGoodBadService:IWorkerGoodBadService + { + /// + /// 员工奖惩记录 + /// + private readonly PgRepository workerGoogBadRepository; + + /// + /// 管理员记录 + /// + private readonly PgRepository adminRepository; + + /// + /// 奖惩类型 + /// + private readonly PgRepository goodbadTypeRepository; + + /// + /// + /// + /// + /// + /// + public WorkerGoodBadService(PgRepository workerGoogBadRepository, PgRepository adminRepository, PgRepository goodbadTypeRepository) + { + this.workerGoogBadRepository = workerGoogBadRepository; + this.adminRepository = adminRepository; + this.goodbadTypeRepository = goodbadTypeRepository; + } + + /// + /// 添加员工奖惩记录 + /// + /// + /// + public bool AddGoodBad(WorkerGoodBad goodBad) + { + return workerGoogBadRepository.Insert(goodBad); + } + + /// + /// 根据工号查找所有的奖惩记录信息 + /// + /// + /// + public List SelectAllGoodBadByWorkNo(string? wn) + { + //查询所有超级管理员 + List admins = new List(); + admins = adminRepository.GetList(a => a.DeleteMk != 1); + List gBTypes = new List(); + gBTypes = goodbadTypeRepository.GetList(a => a.delete_mk != 1); + List gb = new List(); + gb = workerGoogBadRepository.GetList(a => a.WorkNo == wn); + gb.ForEach(source => + { + //奖惩类型 + var gbType = gBTypes.FirstOrDefault(a => a.GBTypeId == source.GBType); + source.TypeName = string.IsNullOrEmpty(gbType.GBName) ? "" : gbType.GBName; + + //操作人 + var admin = admins.FirstOrDefault(a => a.AdminAccount == source.GBOperation); + source.OperationName = string.IsNullOrEmpty(admin.AdminName) ? "" : admin.AdminName; + }); + return gb; + } + } +} diff --git a/EOM.TSHotelManager.Application/Worker/History/IWorkerHistoryService.cs b/EOM.TSHotelManager.Application/Worker/History/IWorkerHistoryService.cs new file mode 100644 index 0000000000000000000000000000000000000000..66cbb498b9f27da5e0095364ac72eeb9314c374f --- /dev/null +++ b/EOM.TSHotelManager.Application/Worker/History/IWorkerHistoryService.cs @@ -0,0 +1,48 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EOM.TSHotelManager.Core; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 员工履历信息接口 + /// + public interface IWorkerHistoryService + { + /// + /// 根据工号添加员工履历 + /// + /// + /// + bool AddHistoryByWorkerId(WorkerHistory workerHistory); + + /// + /// 根据工号查询履历信息 + /// + /// + /// + List SelectHistoryByWorkerId(string? wid); + } +} \ No newline at end of file diff --git a/EOM.TSHotelManager.Application/Worker/History/WorkerHistoryService.cs b/EOM.TSHotelManager.Application/Worker/History/WorkerHistoryService.cs new file mode 100644 index 0000000000000000000000000000000000000000..438f15317881d55e485d712a854ba53ac14ff552 --- /dev/null +++ b/EOM.TSHotelManager.Application/Worker/History/WorkerHistoryService.cs @@ -0,0 +1,72 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EOM.TSHotelManager.Core; +using EOM.TSHotelManager.EntityFramework; +using System; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 员工履历接口实现类 + /// + public class WorkerHistoryService : IWorkerHistoryService + { + /// + /// 员工履历 + /// + private readonly PgRepository workerHistoryRepository; + + /// + /// + /// + /// + public WorkerHistoryService(PgRepository workerHistoryRepository) + { + this.workerHistoryRepository = workerHistoryRepository; + } + + /// + /// 根据工号添加员工履历 + /// + /// + /// + public bool AddHistoryByWorkerId(WorkerHistory workerHistory) + { + return workerHistoryRepository.Insert(workerHistory); + } + + /// + /// 根据工号查询履历信息 + /// + /// + /// + public List SelectHistoryByWorkerId(string? wid) + { + List why = new List(); + why = workerHistoryRepository.GetList(a => a.delete_mk != 1 && a.WorkerId == wid); + return why; + } + } +} diff --git a/EOM.TSHotelManager.Application/Worker/IWorkerService.cs b/EOM.TSHotelManager.Application/Worker/IWorkerService.cs new file mode 100644 index 0000000000000000000000000000000000000000..e0762ad66c0918aa032a0c44ac6f3d7130c58fde --- /dev/null +++ b/EOM.TSHotelManager.Application/Worker/IWorkerService.cs @@ -0,0 +1,102 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EOM.TSHotelManager.Core; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 员工信息接口 + /// + public interface IWorkerService + { + #region 修改员工信息 + /// + /// 修改员工信息 + /// + /// + /// + bool UpdateWorker(Worker worker); + #endregion + + /// + /// 员工账号禁/启用 + /// + /// + /// + bool ManagerWorkerAccount(Worker worker); + + /// + /// 更新员工职位和部门 + /// + /// + /// + + bool UpdateWorkerPositionAndClub(Worker worker); + + #region 添加员工信息 + /// + /// 添加员工信息 + /// + /// + /// + bool AddWorker(Worker worker); + #endregion + + #region 获取所有工作人员信息 + /// + /// 获取所有工作人员信息 + /// + /// + List SelectWorkerAll(); + #endregion + + #region 根据登录名称查询员工信息 + /// + /// 根据登录名称查询员工信息 + /// + /// + /// + Worker SelectWorkerInfoByWorkerId(string? workerId); + #endregion + + #region 根据登录名称、密码查询员工信息 + /// + /// 根据登录名称、密码查询员工信息 + /// + /// + /// + Worker SelectWorkerInfoByWorkerIdAndWorkerPwd(Worker worker); + #endregion + + + /// + /// 根据员工编号和密码修改密码 + /// + /// + /// + /// + bool UpdWorkerPwdByWorkNo(string? workId, string? workPwd); + } +} \ No newline at end of file diff --git a/EOM.TSHotelManager.Application/Worker/Picture/IWorkerPicService.cs b/EOM.TSHotelManager.Application/Worker/Picture/IWorkerPicService.cs new file mode 100644 index 0000000000000000000000000000000000000000..5c342d5cfca5cf19782160864ff701f93f0b4668 --- /dev/null +++ b/EOM.TSHotelManager.Application/Worker/Picture/IWorkerPicService.cs @@ -0,0 +1,40 @@ +using EOM.TSHotelManager.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 员工照片模块接口 + /// + public interface IWorkerPicService + { + /// + /// 查询员工照片 + /// + /// + /// + WorkerPic WorkerPic(WorkerPic workerPic); + /// + /// 添加员工照片 + /// + /// + /// + bool InsertWorkerPic(WorkerPic workerPic); + /// + /// 删除员工照片 + /// + /// + /// + bool DeleteWorkerPic(WorkerPic workerPic); + /// + /// 更新员工照片 + /// + /// + /// + bool UpdateWorkerPic(WorkerPic workerPic); + } +} diff --git a/EOM.TSHotelManager.Application/Worker/Picture/WorkerPicService.cs b/EOM.TSHotelManager.Application/Worker/Picture/WorkerPicService.cs new file mode 100644 index 0000000000000000000000000000000000000000..f231388084d521f2bf31c9a426ab13ac716b0279 --- /dev/null +++ b/EOM.TSHotelManager.Application/Worker/Picture/WorkerPicService.cs @@ -0,0 +1,90 @@ +using EncryptTools.Core; +using EOM.TSHotelManager.Common; +using EOM.TSHotelManager.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 +{ + /// + /// 员工照片接口实现类 + /// + public class WorkerPicService : IWorkerPicService + { + /// + /// 员工照片 + /// + private readonly PgRepository workerPicRepository; + + /// + /// + /// + /// + public WorkerPicService(PgRepository workerPicRepository) + { + this.workerPicRepository = workerPicRepository; + } + + Encrypt encrypt = new Encrypt(); + + /// + /// 查询员工照片 + /// + /// + /// + public WorkerPic WorkerPic(WorkerPic workerPic) + { + var workerPicSource = new WorkerPic(); + + workerPicSource = workerPicRepository.GetSingle(a => a.WorkerId.Equals(workerPic.WorkerId)); + + if (workerPicSource != null) + { + workerPicSource.Pic = workerPicSource == null || string.IsNullOrEmpty(workerPicSource.Pic) ? "" : encrypt.Decryption(HttpHelper.baseUrl) + workerPicSource.Pic; + } + + return workerPicSource; + } + /// + /// 添加员工照片 + /// + /// + /// + public bool InsertWorkerPic(WorkerPic workerPic) + { + return workerPicRepository.Insert(new WorkerPic + { + WorkerId = workerPic.WorkerId, + Pic = workerPic.Pic + }); + } + + /// + /// 删除员工照片 + /// + /// + /// + public bool DeleteWorkerPic(WorkerPic workerPic) + { + return workerPicRepository.Delete(a => a.WorkerId.Equals(workerPic.WorkerId)); + } + + /// + /// 更新员工照片 + /// + /// + /// + public bool UpdateWorkerPic(WorkerPic workerPic) + { + return workerPicRepository.Update(a => new WorkerPic + { + Pic = workerPic.Pic + }, a => a.WorkerId.Equals(workerPic.WorkerId)); + } + } +} diff --git a/EOM.TSHotelManager.Application/Worker/WorkerService.cs b/EOM.TSHotelManager.Application/Worker/WorkerService.cs new file mode 100644 index 0000000000000000000000000000000000000000..e711697ffb14450cd94558277ef4ef9a2eeef093 --- /dev/null +++ b/EOM.TSHotelManager.Application/Worker/WorkerService.cs @@ -0,0 +1,327 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EncryptTools.Core; +using EOM.TSHotelManager.Common; +using EOM.TSHotelManager.Core; +using EOM.TSHotelManager.EntityFramework; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 员工信息接口实现类 + /// + public class WorkerService:IWorkerService + { + /// + /// 员工信息 + /// + private readonly PgRepository workerRepository; + + /// + /// 性别类型 + /// + private readonly PgRepository sexTypeRepository; + + /// + /// 学历类型 + /// + private readonly PgRepository educationRepository; + + /// + /// 民族类型 + /// + private readonly PgRepository nationRepository; + + /// + /// 部门 + /// + private readonly PgRepository deptRepository; + + /// + /// 职务 + /// + private readonly PgRepository positionRepository; + + /// + /// 实例化信息加密插件 + /// + Encrypt encrypt = new Encrypt(); + + /// + /// + /// + /// + /// + /// + /// + /// + /// + public WorkerService(PgRepository workerRepository, PgRepository sexTypeRepository, PgRepository educationRepository, PgRepository nationRepository, PgRepository deptRepository, PgRepository positionRepository) + { + this.workerRepository = workerRepository; + this.sexTypeRepository = sexTypeRepository; + this.educationRepository = educationRepository; + this.nationRepository = nationRepository; + this.deptRepository = deptRepository; + this.positionRepository = positionRepository; + } + + #region 修改员工信息 + /// + /// 修改员工信息 + /// + /// + /// + public bool UpdateWorker(Worker worker) + { + //加密联系方式 + var sourceTelStr = string.Empty; + if (!string.IsNullOrEmpty(worker.WorkerTel)) + { + sourceTelStr = encrypt.Encryption(worker.WorkerTel); + } + //加密身份证 + var sourceIdStr = string.Empty; + if (!string.IsNullOrEmpty(worker.CardId)) + { + sourceIdStr = encrypt.Encryption(worker.CardId); + } + worker.WorkerTel = sourceTelStr; + worker.CardId = sourceIdStr; + return workerRepository.Update(a => new Worker() + { + WorkerName = worker.WorkerName, + WorkerTel = worker.WorkerTel, + WorkerAddress = worker.WorkerAddress, + WorkerFace = worker.WorkerFace, + WorkerEducation = worker.WorkerEducation, + WorkerNation = worker.WorkerNation, + CardId= worker.CardId, + WorkerSex = worker.WorkerSex, + WorkerBirthday = worker.WorkerBirthday, + datachg_usr = AdminInfo.Account, + datachg_date = DateTime.Now + },a => a.WorkerId.Equals(worker.WorkerId)); + + } + #endregion + + /// + /// 员工账号禁/启用 + /// + /// + /// + public bool ManagerWorkerAccount(Worker worker) + { + return workerRepository.Update(a => new Worker() + { + delete_mk = worker.delete_mk + }, a => a.WorkerId == worker.WorkerId); + } + + /// + /// 更新员工职位和部门 + /// + /// + /// + + public bool UpdateWorkerPositionAndClub(Worker worker) + { + return workerRepository.Update(a => new Worker() + { + WorkerClub = worker.WorkerClub, + WorkerPosition = worker.WorkerPosition, + datachg_usr = AdminInfo.Account, + datachg_date = DateTime.Now + }, a => a.WorkerId == worker.WorkerId); + } + + #region 添加员工信息 + /// + /// 添加员工信息 + /// + /// + /// + public bool AddWorker(Worker worker) + { + string? NewID = encrypt.Encryption(worker.CardId); + string? NewTel = encrypt.Encryption(worker.WorkerTel); + worker.CardId = NewID; + worker.WorkerTel = NewTel; + return workerRepository.Insert(worker); + } + #endregion + + #region 获取所有工作人员信息 + /// + /// 获取所有工作人员信息 + /// + /// + public List SelectWorkerAll() + { + //查询所有教育程度信息 + List educations = new List(); + educations = educationRepository.GetList(a => a.delete_mk != 1); + //查询所有性别类型信息 + List sexTypes = new List(); + sexTypes = sexTypeRepository.GetList(a => a.delete_mk != 1); + //查询所有民族类型信息 + List nations = new List(); + nations = nationRepository.GetList(a => a.delete_mk != 1); + //查询所有部门信息 + List depts = new List(); + depts = deptRepository.GetList(a => a.delete_mk != 1); + //查询所有职位信息 + List positions = new List(); + positions = positionRepository.GetList(a => a.delete_mk != 1); + //查询所有员工信息 + List workers = new List(); + workers = workerRepository.Change().GetList(); + workers.ForEach(source => + { + //解密身份证号码 + var sourceStr = source.CardId.Contains("·") ? encrypt.Decryption(source.CardId) : source.CardId; + source.CardId = sourceStr; + //解密联系方式 + var sourceTelStr = source.WorkerTel.Contains("·") ? encrypt.Decryption(source.WorkerTel) : source.WorkerTel; + source.WorkerTel = sourceTelStr; + //性别类型 + var sexType = sexTypes.FirstOrDefault(a => a.sexId == source.WorkerSex); + source.WorkerSexName = string.IsNullOrEmpty(sexType.sexName) ? "" : sexType.sexName; + //教育程度 + var eduction = educations.FirstOrDefault(a => a.education_no == source.WorkerEducation); + source.EducationName = string.IsNullOrEmpty(eduction.education_name) ? "" : eduction.education_name; + //民族类型 + var nation = nations.FirstOrDefault(a => a.nation_no == source.WorkerNation); + source.NationName = string.IsNullOrEmpty(nation.nation_name) ? "" : nation.nation_name; + //部门 + var dept = depts.FirstOrDefault(a => a.dept_no == source.WorkerClub); + source.ClubName = string.IsNullOrEmpty(dept.dept_name) ? "" : dept.dept_name; + //职位 + var position = positions.FirstOrDefault(a => a.position_no == source.WorkerPosition); + source.PositionName = string.IsNullOrEmpty(position.position_name) ? "" : position.position_name; + }); + + return workers; + } + #endregion + + #region 根据登录名称查询员工信息 + /// + /// 根据登录名称查询员工信息 + /// + /// + /// + public Worker SelectWorkerInfoByWorkerId(string? workerId) + { + Worker w = new Worker(); + w = workerRepository.GetSingle(a => a.WorkerId == workerId); + //解密身份证号码 + var sourceStr = w.CardId.Contains("·") ? encrypt.Decryption(w.CardId) : w.CardId; + w.CardId = sourceStr; + //解密联系方式 + var sourceTelStr = w.WorkerTel.Contains("·") ? encrypt.Decryption(w.WorkerTel) : w.WorkerTel; + w.WorkerTel = sourceTelStr; + //性别类型 + var sexType = sexTypeRepository.GetSingle(a => a.sexId == w.WorkerSex); + w.WorkerSexName = string.IsNullOrEmpty(sexType.sexName) ? "" : sexType.sexName; + //教育程度 + var eduction = educationRepository.GetSingle(a => a.education_no == w.WorkerEducation); + w.EducationName = string.IsNullOrEmpty(eduction.education_name) ? "" : eduction.education_name; + //民族类型 + var nation = nationRepository.GetSingle(a => a.nation_no == w.WorkerNation); + w.NationName = string.IsNullOrEmpty(nation.nation_name) ? "" : nation.nation_name; + //部门 + var dept = deptRepository.GetSingle(a => a.dept_no == w.WorkerClub); + w.ClubName = string.IsNullOrEmpty(dept.dept_name) ? "" : dept.dept_name; + //职位 + var position = positionRepository.GetSingle(a => a.position_no == w.WorkerPosition); + w.PositionName = string.IsNullOrEmpty(position.position_name) ? "" : position.position_name; + return w; + } + #endregion + + #region 根据登录名称、密码查询员工信息 + /// + /// 根据登录名称、密码查询员工信息 + /// + /// + /// + public Worker SelectWorkerInfoByWorkerIdAndWorkerPwd(Worker worker) + { + Worker w = new Worker(); + w = workerRepository.GetSingle(a => a.WorkerId == worker.WorkerId); + if (w == null) + { + w = null; + return w; + } + + if (!encrypt.Compare(w.WorkerPwd, worker.WorkerPwd)) + { + w = null; + return w; + } + + //性别类型 + var sexType = sexTypeRepository.GetSingle(a => a.sexId == w.WorkerSex); + w.WorkerSexName = string.IsNullOrEmpty(sexType.sexName) ? "" : sexType.sexName; + //教育程度 + var eduction = educationRepository.GetSingle(a => a.education_no == w.WorkerEducation); + w.EducationName = string.IsNullOrEmpty(eduction.education_name) ? "" : eduction.education_name; + //民族类型 + var nation = nationRepository.GetSingle(a => a.nation_no == w.WorkerNation); + w.NationName = string.IsNullOrEmpty(nation.nation_name) ? "" : nation.nation_name; + //部门 + var dept = deptRepository.GetSingle(a => a.dept_no == w.WorkerClub); + w.ClubName = string.IsNullOrEmpty(dept.dept_name) ? "" : dept.dept_name; + //职位 + var position = positionRepository.GetSingle(a => a.position_no == w.WorkerPosition); + w.PositionName = string.IsNullOrEmpty(position.position_name) ? "" : position.position_name; + return w; + } + #endregion + + /// + /// 根据员工编号和密码修改密码 + /// + /// + /// + /// + public bool UpdWorkerPwdByWorkNo(string? workId,string? workPwd) + { + string? NewPwd = encrypt.Decryption(workPwd); + return workerRepository.Update(a => new Worker() + { + WorkerPwd = NewPwd, + datachg_usr = LoginInfo.WorkerNo, + datachg_date = DateTime.Now + },a => a.WorkerId == workId); + } + + } +} diff --git a/EOM.TSHotelManager.Application/Zero/Admin/AdminService.cs b/EOM.TSHotelManager.Application/Zero/Admin/AdminService.cs new file mode 100644 index 0000000000000000000000000000000000000000..c6d8a0561b8b3c01c8b29f7edc0884fb3a339dff --- /dev/null +++ b/EOM.TSHotelManager.Application/Zero/Admin/AdminService.cs @@ -0,0 +1,219 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using CK.Common; +using EncryptTools.Core; +using EOM.TSHotelManager.Common; +using EOM.TSHotelManager.Core; +using EOM.TSHotelManager.EntityFramework; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 管理员数据访问层 + /// + public class AdminService : IAdminService + { + /// + /// 管理员 + /// + private readonly PgRepository adminRepository; + + /// + /// 管理员类型 + /// + private readonly PgRepository adminTypeRepository; + + Encrypt encrypt = new Encrypt(); + + /// + /// + /// + /// + /// + public AdminService(PgRepository adminRepository, PgRepository adminTypeRepository) + { + this.adminRepository = adminRepository; + this.adminTypeRepository = adminTypeRepository; + } + + #region 根据超管密码查询员工类型和权限 + /// + /// 根据超管密码查询员工类型和权限 + /// + /// + /// + public Admin SelectMangerByPass(Admin admin) + { + Admin admins = new Admin(); + + //admin.AdminPassword = encrypt.Encryption(admin.AdminPassword); + + admins = adminRepository.GetSingle(a => a.AdminAccount == admin.AdminAccount); + + if (admins.IsNullOrEmpty()) + { + admins = null; + return admins; + } + if (!encrypt.Compare(admins.AdminPassword, admin.AdminPassword)) + { + admins = null; + return admins; + } + return admins; + } + #endregion + + #region 根据超管账号查询对应的密码 + /// + /// 根据超管账号查询对应的密码 + /// + /// + /// + public Admin SelectAdminPwdByAccount(string? account) + { + Admin admin = new Admin(); + admin = adminRepository.GetSingle(a => a.AdminAccount == account); + //admin.AdminPassword = admin.AdminPassword.Contains(":") ? encrypt.DeEncryptStr(admin.AdminPassword) : admin.AdminPassword; + return admin; + } + #endregion + + /// + /// 获取所有管理员列表 + /// + /// + public List GetAllAdminList() + { + var listAdmins = adminRepository.GetList(); + var listAdminType = adminTypeRepository.GetList(a => a.delete_mk != 1); + listAdmins.ForEach(admins => + { + var isAdminType = admins.IsAdmin == 1 ? "是" : "否"; + admins.IsAdminNm = isAdminType; + + var adminType = listAdminType.FirstOrDefault(a => a.type_id.Equals(admins.AdminType)); + admins.TypeName = adminType == null ? "" : adminType.type_name; + + var adminDelete = admins.DeleteMk == 1 ? "是" : "否"; + admins.DeleteNm = adminDelete; + + }); + + return listAdmins; + } + + /// + /// 修改密码 + /// + /// + /// + public bool UpdateNewPwdByOldPwd(Admin admin) + { + admin.AdminPassword = encrypt.Encryption(admin.AdminPassword); + return adminRepository.Update(a => new Admin() + { + AdminPassword = admin.AdminPassword, + datachg_usr = AdminInfo.Account, + datachg_time = DateTime.Now + }, a => a.AdminAccount == admin.AdminAccount); + } + + /// + /// 获取管理员列表(已启用) + /// + /// + public List GetAllAdmin() + { + var listAdmin = adminRepository.GetList(a => a.DeleteMk != 1); + var listAdminType = adminTypeRepository.GetList(a => a.delete_mk != 1); + listAdmin.ForEach(admin => + { + var isAdminType = admin.IsAdmin == 1 ? "是" : "否"; + admin.IsAdminNm = isAdminType; + + var adminType = listAdminType.FirstOrDefault(a => a.type_id.Equals(admin.AdminType)); + admin.TypeName = adminType == null ? "" : adminType.type_name; + }); + return listAdmin; + } + + /// + /// 添加管理员 + /// + /// + /// + public bool AddAdmin(Admin admin) + { + admin.AdminPassword = encrypt.Encryption(admin.AdminPassword); + bool result = adminRepository.Insert(admin); + return result; + } + + /// + /// 获取管理员信息 + /// + /// + /// + public Admin GetAdminInfoByAdminAccount(Admin admin) + { + var adminInfo = adminRepository.GetSingle(a => a.AdminAccount.Equals(admin.AdminAccount)); + if (adminInfo != null) + { + var adminType = adminTypeRepository.GetSingle(a => a.type_id.Equals(adminInfo.AdminType)); + adminInfo.TypeName = adminType.type_name; + } + return adminInfo; + } + + /// + /// 获取所有管理员类型 + /// + /// + public List GetAllAdminTypes() + { + var listAdminTypes = adminTypeRepository.GetList(a => a.delete_mk != 1); + return listAdminTypes; + } + + /// + /// 更新管理员账户 + /// + /// + /// + public bool UpdAccount(Admin admins) + { + admins.DeleteMk = admins.DeleteMk == 0 ? 1 : 0; + return adminRepository.Update(a => new Admin() + { + DeleteMk = admins.DeleteMk + }, a => a.Id == admins.Id); + } + + + } +} diff --git a/EOM.TSHotelManager.Application/Zero/Admin/IAdminService.cs b/EOM.TSHotelManager.Application/Zero/Admin/IAdminService.cs new file mode 100644 index 0000000000000000000000000000000000000000..f4319f3429a009880bc3895624a7977057cbc3dc --- /dev/null +++ b/EOM.TSHotelManager.Application/Zero/Admin/IAdminService.cs @@ -0,0 +1,99 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EOM.TSHotelManager.Core; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 管理员数据访问接口 + /// + public interface IAdminService + { + + #region 根据超管密码查询员工类型和权限 + /// + /// 根据超管密码查询员工类型和权限 + /// + /// + /// + Admin SelectMangerByPass(Admin admin); + #endregion + + #region 根据超管账号查询对应的密码 + /// + /// 根据超管账号查询对应的密码 + /// + /// + /// + Admin SelectAdminPwdByAccount(string? account); + #endregion + + /// + /// 获取所有管理员列表 + /// + /// + List GetAllAdminList(); + + /// + /// 修改密码 + /// + /// + /// + bool UpdateNewPwdByOldPwd(Admin admin); + + /// + /// 获取管理员列表 + /// + /// + List GetAllAdmin(); + + /// + /// 添加管理员 + /// + /// + /// + bool AddAdmin(Admin admin); + + /// + /// 获取管理员信息 + /// + /// + /// + Admin GetAdminInfoByAdminAccount(Admin admin); + + /// + /// 获取所有管理员类型 + /// + /// + List GetAllAdminTypes(); + + /// + /// 批量更新管理员账户 + /// + /// + /// + bool UpdAccount(Admin admins); + } +} \ No newline at end of file diff --git a/EOM.TSHotelManager.Application/Zero/Base/BaseService.cs b/EOM.TSHotelManager.Application/Zero/Base/BaseService.cs new file mode 100644 index 0000000000000000000000000000000000000000..035edfee708c5eba218a33a356a47ceb564bea99 --- /dev/null +++ b/EOM.TSHotelManager.Application/Zero/Base/BaseService.cs @@ -0,0 +1,761 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using CK.Common; +using EOM.TSHotelManager.Common; +using EOM.TSHotelManager.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 + { + /// + /// 员工信息 + /// + private readonly PgRepository workerRepository; + + /// + /// 性别类型 + /// + private readonly PgRepository sexTypeRepository; + + /// + /// 学历类型 + /// + private readonly PgRepository educationRepository; + + /// + /// 民族类型 + /// + private readonly PgRepository nationRepository; + + /// + /// 部门 + /// + private readonly PgRepository deptRepository; + + /// + /// 职务 + /// + private readonly PgRepository positionRepository; + + /// + /// 证件类型 + /// + private readonly PgRepository passPortTypeRepository; + + /// + /// 客户类型 + /// + private readonly PgRepository custoTypeRepository; + + /// + /// 奖惩类型 + /// + private readonly PgRepository goodbadTypeRepository; + + /// + /// 基础URL + /// + private readonly PgRepository baseRepository; + + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + public BaseService(PgRepository workerRepository, PgRepository sexTypeRepository, PgRepository educationRepository, PgRepository nationRepository, PgRepository deptRepository, PgRepository positionRepository, PgRepository passPortTypeRepository, PgRepository custoTypeRepository, PgRepository goodbadTypeRepository, PgRepository baseRepository) + { + this.workerRepository = workerRepository; + this.sexTypeRepository = sexTypeRepository; + this.educationRepository = educationRepository; + this.nationRepository = nationRepository; + this.deptRepository = deptRepository; + this.positionRepository = positionRepository; + this.passPortTypeRepository = passPortTypeRepository; + this.custoTypeRepository = custoTypeRepository; + this.goodbadTypeRepository = goodbadTypeRepository; + this.baseRepository = baseRepository; + } + + #region 性别模块 + + /// + /// 查询所有性别类型 + /// + /// + public List SelectSexTypeAll(SexType sexType = null) + { + var where = Expressionable.Create(); + if (sexType != null && sexType.sexName.IsNullOrEmpty()) + { + where = where.And(a => a.delete_mk == sexType.delete_mk); + } + if (sexType != null && !sexType.sexName.IsNullOrEmpty()) + { + where = where.And(a => a.sexName.Contains(sexType.sexName)); + } + return sexTypeRepository.GetList(where.ToExpression()); + } + + /// + /// 查询性别类型 + /// + /// + public SexType SelectSexType(SexType sexType) + { + SexType sexTypes = new SexType(); + sexTypes = sexTypeRepository.GetSingle(a => a.sexId == sexType.sexId); + return sexTypes; + } + + /// + /// 添加性别类型 + /// + /// + /// + public bool AddSexType(SexType sexType) + { + return sexTypeRepository.Insert(sexType); + } + + /// + /// 删除性别类型 + /// + /// + /// + public bool DelSexType(SexType sexType) + { + return sexTypeRepository.Update(a => new SexType() + { + delete_mk = sexType.delete_mk, + datachg_usr = LoginInfo.WorkerNo, + datachg_date = DateTime.Now + }, a => a.sexId == sexType.sexId); + } + + /// + /// 更新性别类型 + /// + /// + /// + public bool UpdSexType(SexType sexType) + { + return sexTypeRepository.Update(a => new SexType() + { + sexName = sexType.sexName, + datachg_usr = LoginInfo.WorkerNo, + datachg_date = DateTime.Now + }, a => a.sexId == sexType.sexId); + } + + #endregion + + #region 职位模块 + + /// + /// 查询所有职位类型 + /// + /// + public List SelectPositionAll(Position position = null) + { + var where = Expressionable.Create(); + if (position != null && position.position_name.IsNullOrEmpty()) + { + where = where.And(a => a.delete_mk == position.delete_mk); + } + if (position != null && !position.position_name.IsNullOrEmpty()) + { + where = where.And(a => a.position_name.Contains(position.position_name)); + } + return positionRepository.GetList(where.ToExpression()); + } + + /// + /// 查询职位类型 + /// + /// + public Position SelectPosition(Position position) + { + Position position1 = new Position(); + position1 = positionRepository.GetSingle(a => a.position_no == position.position_no); + return position1; + } + + /// + /// 添加职位类型 + /// + /// + /// + public bool AddPosition(Position position) + { + return positionRepository.Insert(position); + } + + /// + /// 删除职位类型 + /// + /// + /// + public bool DelPosition(Position position) + { + return positionRepository.Update(a => new Position() + { + delete_mk = position.delete_mk, + datachg_usr = LoginInfo.WorkerNo, + datachg_date = DateTime.Now + }, a => a.position_no == position.position_no); + } + + /// + /// 更新职位类型 + /// + /// + /// + public bool UpdPosition(Position position) + { + return positionRepository.Update(a => new Position() + { + position_name = position.position_name, + datachg_usr = LoginInfo.WorkerNo, + datachg_date = DateTime.Now + }, a => a.position_no == position.position_no); + } + + #endregion + + #region 民族模块 + + /// + /// 查询所有民族类型 + /// + /// + public List SelectNationAll(Nation nation = null) + { + var where = Expressionable.Create(); + if (nation != null && nation.nation_name.IsNullOrEmpty()) + { + where = where.And(a => a.delete_mk == nation.delete_mk); + } + if (nation != null && !nation.nation_name.IsNullOrEmpty()) + { + where = where.And(a => a.nation_name.Contains(nation.nation_name)); + } + return nationRepository.GetList(where.ToExpression()); + } + + /// + /// 查询民族类型 + /// + /// + public Nation SelectNation(Nation nation) + { + Nation nation1 = new Nation(); + nation1 = nationRepository.GetSingle(a => a.nation_no.Equals(nation.nation_no)); + return nation1; + } + + /// + /// 添加民族类型 + /// + /// + /// + public bool AddNation(Nation nation) + { + return nationRepository.Insert(nation); + } + + /// + /// 删除民族类型 + /// + /// + /// + public bool DelNation(Nation nation) + { + return nationRepository.Update(a => new Nation() + { + delete_mk = nation.delete_mk, + datachg_usr = LoginInfo.WorkerNo, + datachg_date = DateTime.Now + }, a => a.nation_no.Equals(nation.nation_no)); + + } + + /// + /// 更新民族类型 + /// + /// + /// + public bool UpdNation(Nation nation) + { + return nationRepository.Update(a => new Nation() + { + nation_name = nation.nation_name, + datachg_usr = LoginInfo.WorkerNo, + datachg_date = DateTime.Now + }, a => a.nation_no.Equals(nation.nation_no)); + } + + #endregion + + #region 学历模块 + + /// + /// 查询所有学历类型 + /// + /// + public List SelectEducationAll(Education education = null) + { + var where = Expressionable.Create(); + if (education != null && education.education_name.IsNullOrEmpty()) + { + where = where.And(a => a.delete_mk == education.delete_mk); + } + if (education != null && !education.education_name.IsNullOrEmpty()) + { + where = where.And(a => a.education_name.Contains(education.education_name)); + } + return educationRepository.GetList(where.ToExpression()); + } + + /// + /// 查询学历类型 + /// + /// + public Education SelectEducation(Education education) + { + Education education1 = new Education(); + education1 = educationRepository.GetSingle(a => a.education_no == education.education_no); + return education1; + } + + /// + /// 添加学历类型 + /// + /// + /// + public bool AddEducation(Education education) + { + return educationRepository.Insert(education); + } + + /// + /// 删除学历类型 + /// + /// + /// + public bool DelEducation(Education education) + { + return educationRepository.Update(a => new Education() + { + delete_mk = education.delete_mk, + datachg_usr = LoginInfo.WorkerNo, + datachg_date = DateTime.Now + }, a => a.education_no == education.education_no); + } + + /// + /// 更新学历类型 + /// + /// + /// + public bool UpdEducation(Education education) + { + return educationRepository.Update(a => new Education() + { + education_name = education.education_name, + datachg_usr = LoginInfo.WorkerNo, + datachg_date = DateTime.Now + }, a => a.education_no == education.education_no); + } + + #endregion + + #region 部门模块 + + /// + /// 查询所有部门类型(可用) + /// + /// + public List SelectDeptAllCanUse() + { + List workers = new List(); + workers = workerRepository.GetList(a => a.delete_mk != 1); + List depts = new List(); + 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; + + }); + return depts; + } + + /// + /// 查询所有部门类型 + /// + /// + public List SelectDeptAll() + { + List workers = new List(); + workers = workerRepository.GetList(a => a.delete_mk != 1); + List depts = new List(); + 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 ? "" : dept.dept_name; + var leader = workers.FirstOrDefault(a => source.dept_leader != null && a.WorkerId == source.dept_leader); + source.leader_name = leader == null ? "" : leader.WorkerName; + }); + return depts; + } + + /// + /// 查询部门类型 + /// + /// + public Dept SelectDept(Dept dept) + { + Dept dept1 = new Dept(); + dept1 = deptRepository.GetSingle(a => a.dept_no.Equals(dept.dept_no)); + return dept1; + } + + /// + /// 添加部门类型 + /// + /// + /// + public bool AddDept(Dept dept) + { + return deptRepository.Insert(dept); + } + + /// + /// 删除部门类型 + /// + /// + /// + public bool DelDept(Dept dept) + { + return deptRepository.Update(a => new Dept() + { + delete_mk = 1, + datachg_usr = LoginInfo.WorkerNo, + datachg_date = DateTime.Now + }, a => a.dept_no == dept.dept_no); + } + + /// + /// 更新部门类型 + /// + /// + /// + public bool UpdDept(Dept dept) + { + return deptRepository.Update(a => new Dept() + { + dept_name = dept.dept_name, + dept_desc = dept.dept_desc, + dept_leader = dept.dept_leader, + dept_parent = dept.dept_parent, + datachg_usr = LoginInfo.WorkerNo, + datachg_date = DateTime.Now + }, a => a.dept_no == dept.dept_no); + } + + #endregion + + #region 客户类型模块 + + /// + /// 查询所有客户类型(可用) + /// + /// + public List SelectCustoTypeAllCanUse() + { + List custoTypes = new List(); + custoTypes = custoTypeRepository.GetList(a => a.delete_mk != 1); + return custoTypes; + } + + /// + /// 查询所有客户类型 + /// + /// + public List SelectCustoTypeAll() + { + List custoTypes = new List(); + custoTypes = custoTypeRepository.GetList(); + return custoTypes; + } + + /// + /// 根据客户类型ID查询类型名称 + /// + /// + /// + public CustoType SelectCustoTypeByTypeId(CustoType custoType) + { + CustoType custoTypes = new CustoType(); + custoType = custoTypeRepository.GetSingle(a => a.UserType == custoType.UserType && a.delete_mk != 1); + return custoTypes; + } + + /// + /// 添加客户类型 + /// + /// + /// + public bool InsertCustoType(CustoType custoType) + { + return custoTypeRepository.Insert(custoType); + } + + /// + /// 删除客户类型 + /// + /// + /// + public bool DeleteCustoType(CustoType custoType) + { + return custoTypeRepository.Update(a => new CustoType() + { + delete_mk = 1, + datachg_usr = AdminInfo.Account, + datachg_date = DateTime.Now + }, a => a.UserType == custoType.UserType); + } + + /// + /// 更新客户类型 + /// + /// + /// + public bool UpdateCustoType(CustoType custoType) + { + return custoTypeRepository.Update(a => new CustoType() + { + TypeName = custoType.TypeName, + datachg_usr = AdminInfo.Account, + datachg_date = DateTime.Now + }, a => a.UserType == custoType.UserType); + } + + #endregion + + #region 证件类型模块 + + /// + /// 查询所有证件类型(可用) + /// + /// + public List SelectPassPortTypeAllCanUse() + { + List passPortTypes = new List(); + passPortTypes = passPortTypeRepository.GetList(a => a.delete_mk != 1); + return passPortTypes; + } + + /// + /// 查询所有证件类型 + /// + /// + public List SelectPassPortTypeAll() + { + List passPortTypes = new List(); + passPortTypes = passPortTypeRepository.GetList(); + return passPortTypes; + } + + /// + /// 根据证件类型ID查询类型名称 + /// + /// + /// + public PassPortType SelectPassPortTypeByTypeId(PassPortType passPortType) + { + PassPortType passPortType1 = new PassPortType(); + passPortType1 = passPortTypeRepository.GetSingle(a => a.PassportId == passPortType.PassportId && a.delete_mk != 1); + return passPortType1; + } + + /// + /// 添加证件类型 + /// + /// + /// + public bool InsertPassPortType(PassPortType passPortType) + { + return passPortTypeRepository.Insert(passPortType); + } + + /// + /// 删除证件类型 + /// + /// + /// + public bool DeletePassPortType(PassPortType portType) + { + return passPortTypeRepository.Update(a => new PassPortType() + { + delete_mk = 1, + datachg_usr = AdminInfo.Account, + datachg_date = DateTime.Now + }, a => a.PassportId == portType.PassportId); + } + + /// + /// 更新证件类型 + /// + /// + /// + public bool UpdatePassPortType(PassPortType portType) + { + return passPortTypeRepository.Update(a => new PassPortType() + { + PassportName = portType.PassportName, + datachg_usr = AdminInfo.Account, + datachg_date = DateTime.Now + }, a => a.PassportId == portType.PassportId); + } + + #endregion + + #region 奖惩类型模块 + + /// + /// 查询所有奖惩类型(可用) + /// + /// + public List SelectGBTypeAllCanUse() + { + List gBTypes = new List(); + gBTypes = goodbadTypeRepository.GetList(a => a.delete_mk != 1); + return gBTypes; + } + + /// + /// 查询所有奖惩类型 + /// + /// + public List SelectGBTypeAll() + { + List gBTypes = new List(); + gBTypes = goodbadTypeRepository.GetList(); + return gBTypes; + } + + /// + /// 根据奖惩类型ID查询类型名称 + /// + /// + /// + public GBType SelectGBTypeByTypeId(GBType gBType) + { + GBType gBType1 = new GBType(); + gBType1 = goodbadTypeRepository.GetSingle(a => a.GBTypeId == gBType.GBTypeId && a.delete_mk != 1); + return gBType1; + } + + /// + /// 添加奖惩类型 + /// + /// + /// + public bool InsertGBType(GBType gBType) + { + return goodbadTypeRepository.Insert(gBType); + } + + /// + /// 删除奖惩类型 + /// + /// + /// + public bool DeleteGBType(GBType gBType) + { + return goodbadTypeRepository.Update(a => new GBType() + { + delete_mk = 1, + datachg_usr = AdminInfo.Account, + datachg_date = DateTime.Now + }, a => a.GBTypeId == gBType.GBTypeId); + } + + /// + /// 更新奖惩类型 + /// + /// + /// + public bool UpdateGBType(GBType gBType) + { + return goodbadTypeRepository.Update(a => new GBType() + { + GBName = gBType.GBName, + datachg_usr = AdminInfo.Account, + datachg_date = DateTime.Now + }, a => a.GBTypeId == gBType.GBTypeId); + } + + #endregion + + #region URL模块 + /// + /// 基础URL + /// + /// + public Base GetBase() + { + var baseTemp = new Base(); + + baseTemp = baseRepository.GetSingle(a => a.url_no == 1); + + return baseTemp; + } + #endregion + } +} diff --git a/EOM.TSHotelManager.Application/Zero/Base/IBaseService.cs b/EOM.TSHotelManager.Application/Zero/Base/IBaseService.cs new file mode 100644 index 0000000000000000000000000000000000000000..001efeef496b770a71abea9e6d5f21ad6475bb55 --- /dev/null +++ b/EOM.TSHotelManager.Application/Zero/Base/IBaseService.cs @@ -0,0 +1,369 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EOM.TSHotelManager.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 基础信息接口 + /// + public interface IBaseService + { + #region 性别模块 + + /// + /// 查询所有性别类型 + /// + /// + List SelectSexTypeAll(SexType sexType = null); + + /// + /// 查询性别类型 + /// + /// + SexType SelectSexType(SexType sexType); + + /// + /// 添加性别类型 + /// + /// + /// + bool AddSexType(SexType sexType); + + /// + /// 删除性别类型 + /// + /// + /// + bool DelSexType(SexType sexType); + + /// + /// 更新性别类型 + /// + /// + /// + bool UpdSexType(SexType sexType); + + #endregion + + #region 职位模块 + + /// + /// 查询所有职位类型 + /// + /// + List SelectPositionAll(Position position = null); + + /// + /// 查询职位类型 + /// + /// + Position SelectPosition(Position position); + + /// + /// 添加职位类型 + /// + /// + /// + bool AddPosition(Position position); + + /// + /// 删除职位类型 + /// + /// + /// + bool DelPosition(Position position); + + /// + /// 更新职位类型 + /// + /// + /// + bool UpdPosition(Position position); + + #endregion + + #region 民族模块 + + /// + /// 查询所有民族类型 + /// + /// + List SelectNationAll(Nation nation = null); + + /// + /// 查询民族类型 + /// + /// + Nation SelectNation(Nation nation); + + /// + /// 添加民族类型 + /// + /// + /// + bool AddNation(Nation nation); + + /// + /// 删除民族类型 + /// + /// + /// + bool DelNation(Nation nation); + + /// + /// 更新民族类型 + /// + /// + /// + bool UpdNation(Nation nation); + + #endregion + + #region 学历模块 + + /// + /// 查询所有学历类型 + /// + /// + List SelectEducationAll(Education education = null); + + /// + /// 查询学历类型 + /// + /// + Education SelectEducation(Education education); + + /// + /// 添加学历类型 + /// + /// + /// + bool AddEducation(Education education); + + /// + /// 删除学历类型 + /// + /// + /// + bool DelEducation(Education education); + + /// + /// 更新学历类型 + /// + /// + /// + bool UpdEducation(Education education); + + #endregion + + #region 部门模块 + + /// + /// 查询所有部门类型(可用) + /// + /// + List SelectDeptAllCanUse(); + + /// + /// 查询所有部门类型 + /// + /// + List SelectDeptAll(); + + /// + /// 查询部门类型 + /// + /// + Dept SelectDept(Dept dept); + + /// + /// 添加部门类型 + /// + /// + /// + bool AddDept(Dept dept); + + /// + /// 删除部门类型 + /// + /// + /// + bool DelDept(Dept dept); + + /// + /// 更新部门类型 + /// + /// + /// + bool UpdDept(Dept dept); + + #endregion + + #region 客户类型模块 + + /// + /// 查询所有客户类型(可用) + /// + /// + List SelectCustoTypeAllCanUse(); + + /// + /// 查询所有客户类型 + /// + /// + List SelectCustoTypeAll(); + + /// + /// 根据客户类型ID查询类型名称 + /// + /// + /// + CustoType SelectCustoTypeByTypeId(CustoType custoType); + + /// + /// 添加客户类型 + /// + /// + /// + bool InsertCustoType(CustoType custoType); + + /// + /// 删除客户类型 + /// + /// + /// + bool DeleteCustoType(CustoType custoType); + + /// + /// 更新客户类型 + /// + /// + /// + bool UpdateCustoType(CustoType custoType); + + #endregion + + #region 证件类型模块 + + /// + /// 查询所有证件类型(可用) + /// + /// + List SelectPassPortTypeAllCanUse(); + + /// + /// 查询所有证件类型 + /// + /// + List SelectPassPortTypeAll(); + + /// + /// 根据证件类型ID查询类型名称 + /// + /// + /// + PassPortType SelectPassPortTypeByTypeId(PassPortType passPortType); + + /// + /// 添加证件类型 + /// + /// + /// + bool InsertPassPortType(PassPortType passPortType); + + /// + /// 删除证件类型 + /// + /// + /// + bool DeletePassPortType(PassPortType portType); + + /// + /// 更新证件类型 + /// + /// + /// + bool UpdatePassPortType(PassPortType portType); + + #endregion + + #region 奖惩类型模块 + + /// + /// 查询所有证件类型(可用) + /// + /// + List SelectGBTypeAllCanUse(); + + /// + /// 查询所有奖惩类型 + /// + /// + List SelectGBTypeAll(); + + /// + /// 根据奖惩类型ID查询类型名称 + /// + /// + /// + GBType SelectGBTypeByTypeId(GBType gBType); + + /// + /// 添加奖惩类型 + /// + /// + /// + bool InsertGBType(GBType gBType); + + /// + /// 删除奖惩类型 + /// + /// + /// + bool DeleteGBType(GBType gBType); + + /// + /// 更新奖惩类型 + /// + /// + /// + bool UpdateGBType(GBType gBType); + + #endregion + + #region URL模块 + /// + /// 基础URL + /// + /// + Base GetBase(); + #endregion + } +} diff --git a/EOM.TSHotelManager.Application/Zero/CheckInfo/CheckInfoService.cs b/EOM.TSHotelManager.Application/Zero/CheckInfo/CheckInfoService.cs new file mode 100644 index 0000000000000000000000000000000000000000..475b6047667b9156eaa65081f2c147a34079f486 --- /dev/null +++ b/EOM.TSHotelManager.Application/Zero/CheckInfo/CheckInfoService.cs @@ -0,0 +1,62 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EOM.TSHotelManager.Core; +using EOM.TSHotelManager.EntityFramework; +using System; +using System.Collections.Generic; +using System.Data.SqlClient; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 监管统计接口实现类 + /// + public class CheckInfoService : ICheckInfoService + { + /// + /// 监管统计 + /// + private readonly PgRepository checkInfoRepository; + + /// + /// + /// + /// + public CheckInfoService(PgRepository checkInfoRepository) + { + this.checkInfoRepository = checkInfoRepository; + } + + /// + /// 查询所有监管统计信息 + /// + /// + public List SelectCheckInfoAll() + { + List cif = new List(); + cif = checkInfoRepository.GetList(a => a.delete_mk != 1); + return cif; + } + } +} diff --git a/EOM.TSHotelManager.Application/Zero/CheckInfo/ICheckInfoService.cs b/EOM.TSHotelManager.Application/Zero/CheckInfo/ICheckInfoService.cs new file mode 100644 index 0000000000000000000000000000000000000000..1582ab3dd87650a9f32f17d32a30e0e939807982 --- /dev/null +++ b/EOM.TSHotelManager.Application/Zero/CheckInfo/ICheckInfoService.cs @@ -0,0 +1,40 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EOM.TSHotelManager.Core; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 监管统计接口 + /// + public interface ICheckInfoService + { + /// + /// 查询所有监管统计信息 + /// + /// + List SelectCheckInfoAll(); + } +} \ No newline at end of file diff --git a/EOM.TSHotelManager.Application/Zero/Module/AdminModuleZeroService.cs b/EOM.TSHotelManager.Application/Zero/Module/AdminModuleZeroService.cs new file mode 100644 index 0000000000000000000000000000000000000000..d052519b60f46fa8de8c57787c356d8a2e4ed181 --- /dev/null +++ b/EOM.TSHotelManager.Application/Zero/Module/AdminModuleZeroService.cs @@ -0,0 +1,152 @@ +using EOM.TSHotelManager.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 AdminModuleZeroService : IAdminModuleZeroService + { + /// + /// 模块权限 + /// + private readonly PgRepository moduleZeroRepository; + + /// + /// + /// + /// + public AdminModuleZeroService(PgRepository moduleZeroRepository) + { + this.moduleZeroRepository = moduleZeroRepository; + } + + /// + /// 获取所有模块 + /// + /// + public List GetAllModule() + { + List modules = moduleZeroRepository.Change().GetList(); + modules.ForEach(source => + { + switch (source.module_name) + { + case ModuleConsts.BaseInfo: + source.module_name = ModuleConsts.BaseInfo + "||" + "基础信息"; + break; + case ModuleConsts.CashInfo: + source.module_name = ModuleConsts.CashInfo + "||" + "财务信息"; + break; + case ModuleConsts.WtiInfo: + source.module_name = ModuleConsts.WtiInfo + "||" + "水电管理"; + break; + case ModuleConsts.CheckInfo: + source.module_name = ModuleConsts.CheckInfo + "||" + "监管统计"; + break; + case ModuleConsts.RoomManager: + source.module_name = ModuleConsts.RoomManager + "||" + "客房管理"; + break; + case ModuleConsts.CustomerManager: + source.module_name = ModuleConsts.CustomerManager + "||" + "客户管理"; + break; + case ModuleConsts.HumanResourcesManager: + source.module_name = ModuleConsts.HumanResourcesManager + "||" + "人事管理"; + break; + case ModuleConsts.MaterialManager: + source.module_name = ModuleConsts.MaterialManager + "||" + "物资管理"; + break; + case ModuleConsts.OperationLogManager: + source.module_name = ModuleConsts.OperationLogManager + "||" + "员工操作日志"; + break; + case ModuleConsts.AdminManager: + source.module_name = ModuleConsts.AdminManager + "||" + "系统管理"; + break; + } + }); + return modules; + } + + /// + /// 根据账号获取对应模块 + /// + /// + /// + public List GetAllModuleByAdmin(Admin admin) + { + List moduleZeros = moduleZeroRepository.GetList(a => a.admin_account.Equals(admin.AdminAccount) + && a.module_enable == 1); + moduleZeros.ForEach(source => + { + switch (source.module_name) + { + case ModuleConsts.BaseInfo: + source.module_name = ModuleConsts.BaseInfo + "||" + "基础信息"; + break; + case ModuleConsts.CashInfo: + source.module_name = ModuleConsts.CashInfo + "||" + "财务信息"; + break; + case ModuleConsts.WtiInfo: + source.module_name = ModuleConsts.WtiInfo + "||" + "水电管理"; + break; + case ModuleConsts.CheckInfo: + source.module_name = ModuleConsts.CheckInfo + "||" + "监管统计"; + break; + case ModuleConsts.RoomManager: + source.module_name = ModuleConsts.RoomManager + "||" + "客房管理"; + break; + case ModuleConsts.CustomerManager: + source.module_name = ModuleConsts.CustomerManager + "||" + "客户管理"; + break; + case ModuleConsts.HumanResourcesManager: + source.module_name = ModuleConsts.HumanResourcesManager + "||" + "人事管理"; + break; + case ModuleConsts.MaterialManager: + source.module_name = ModuleConsts.MaterialManager + "||" + "物资管理"; + break; + case ModuleConsts.OperationLogManager: + source.module_name = ModuleConsts.OperationLogManager + "||" + "员工操作日志"; + break; + case ModuleConsts.AdminManager: + source.module_name = ModuleConsts.AdminManager + "||" + "系统管理"; + break; + } + }); + return moduleZeros; + } + + /// + /// 批量添加模块 + /// + /// + /// + public bool AddModuleZeroList(List moduleZeros) + { + moduleZeros.ForEach(moduleZero => + { + moduleZero.module_name = moduleZero.module_name.Split('|', '|').FirstOrDefault().ToString(); + }); + var result = moduleZeroRepository.InsertRange(moduleZeros); + return result; + } + + /// + /// 批量删除模块 + /// + /// + /// + public bool DelModuleZeroList(ModuleZero moduleZero) + { + var result = moduleZeroRepository.Delete(a => a.admin_account.Equals(moduleZero.admin_account)); + return result; + } + + + } +} diff --git a/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Services/IAdminInfoService.cs b/EOM.TSHotelManager.Application/Zero/Module/IAdminModuleZeroService.cs similarity index 32% rename from HotelManagerSystemWebApi.Application/Zero/AdminInfo/Services/IAdminInfoService.cs rename to EOM.TSHotelManager.Application/Zero/Module/IAdminModuleZeroService.cs index cf3f878222959202d21e30c06cfad7de27bff16c..1baa1f29c30cd6ff52fdc3c85c379d5bb54f457d 100644 --- a/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Services/IAdminInfoService.cs +++ b/EOM.TSHotelManager.Application/Zero/Module/IAdminModuleZeroService.cs @@ -1,50 +1,43 @@ -using Furion.DependencyInjection; +using EOM.TSHotelManager.Core; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace HotelManagerSystemWebApi.Application +namespace EOM.TSHotelManager.Application { /// - /// 管理员信息模块接口 + /// 管理员模块权限管理接口 /// - public interface IAdminInfoService + public interface IAdminModuleZeroService { /// - /// 查询管理员信息列表 + /// 获取所有模块 /// - /// /// - OAdminInfoListDto AdminInfoList(AdminInfoListDto adminInfoListDto); + List GetAllModule(); /// - /// 查询管理员信息 + /// 根据账号获取对应模块 /// - /// + /// /// - OAdminInfoDto AdminInfo(AdminInfoDto adminInfoDto); + List GetAllModuleByAdmin(Admin admin); /// - /// 添加管理员信息 + /// 批量添加模块 /// - /// + /// /// - OAddAdminInfoDto AddAdminInfo(AddAdminInfoDto addAdminInfoDto); + bool AddModuleZeroList(List moduleZeros); /// - /// 删除管理员信息 + /// 批量删除模块 /// - /// + /// /// - ODelAdminInfoDto DelAdminInfo(DelAdminInfoDto delAdminInfoDto); + bool DelModuleZeroList(ModuleZero moduleZero); - /// - /// 更新管理员信息 - /// - /// - /// - OUpdAdminInfoDto UpdAdminInfo(UpdAdminInfoDto updAdminInfoDto); } } diff --git a/EOM.TSHotelManager.Application/Zero/Notice/INoticeService.cs b/EOM.TSHotelManager.Application/Zero/Notice/INoticeService.cs new file mode 100644 index 0000000000000000000000000000000000000000..4404560bf2cc5aa1ca94c2496f565ab59508c091 --- /dev/null +++ b/EOM.TSHotelManager.Application/Zero/Notice/INoticeService.cs @@ -0,0 +1,52 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EOM.TSHotelManager.Core; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 公告接口 + /// + public interface INoticeService + { + #region 获取所有公告信息 + /// + /// 获取所有公告信息 + /// + /// + List SelectNoticeAll(); + #endregion + + #region 上传公告信息 + /// + /// 上传公告信息 + /// + /// + /// + bool InsertNotice(Notice notice); + + #endregion + } +} \ No newline at end of file diff --git a/EOM.TSHotelManager.Application/Zero/Notice/NoticeService.cs b/EOM.TSHotelManager.Application/Zero/Notice/NoticeService.cs new file mode 100644 index 0000000000000000000000000000000000000000..159e2ef8db30d2671c12abd11dcd0977ca52a3ad --- /dev/null +++ b/EOM.TSHotelManager.Application/Zero/Notice/NoticeService.cs @@ -0,0 +1,110 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EOM.TSHotelManager.Core; +using EOM.TSHotelManager.EntityFramework; +using System; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 公告信息接口实现类 + /// + public class NoticeService:INoticeService + { + /// + /// 公告 + /// + private readonly PgRepository noticeRepository; + + /// + /// + /// + /// + public NoticeService(PgRepository noticeRepository) + { + this.noticeRepository = noticeRepository; + } + + #region 获取所有公告信息 + /// + /// 获取所有公告信息 + /// + /// + public List SelectNoticeAll() + { + List ntc = new List(); + ntc = noticeRepository.GetList(a => a.delete_mk != 1); + ntc.ForEach(source => + { + switch (source.NoticeType) + { + case "PersonnelChanges": + source.NoticeTypeName = "人事变动"; + break; + case "GeneralNotice": + source.NoticeTypeName = "普通公告"; + break; + } + }); + return ntc; + } + #endregion + + /// + /// 根据公告编号查找公告信息 + /// + /// + /// + public Notice SelectNoticeByNoticeNo(string? NoticeNo) + { + Notice notice = new Notice(); + notice = noticeRepository.GetSingle(a => a.NoticeNo == NoticeNo); + switch (notice.NoticeType) + { + case "PersonnelChanges": + notice.NoticeTypeName = "人事变动"; + break; + case "GeneralNotice": + notice.NoticeTypeName = "普通公告"; + break; + } + return notice; + } + + #region 上传公告信息 + /// + /// 上传公告信息 + /// + /// + /// + public bool InsertNotice(Notice notice) + { + return noticeRepository.Insert(notice); + } + + #endregion + + } +} diff --git a/EOM.TSHotelManager.Application/Zero/VipRule/IVipRuleAppService.cs b/EOM.TSHotelManager.Application/Zero/VipRule/IVipRuleAppService.cs new file mode 100644 index 0000000000000000000000000000000000000000..23cd4ade2197e13034ea02eaa61212bf247ff8d5 --- /dev/null +++ b/EOM.TSHotelManager.Application/Zero/VipRule/IVipRuleAppService.cs @@ -0,0 +1,73 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + *模块说明:会员等级规则功能模块接口 + */ +using EOM.TSHotelManager.Core; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EOM.TSHotelManager.Application +{ + /// + /// 会员等级规则功能模块接口 + /// + public interface IVipRuleAppService + { + /// + /// 查询会员等级规则列表 + /// + /// + List SelectVipRuleList(); + + /// + /// 查询会员等级规则 + /// + /// + /// + VipRule SelectVipRule(VipRule vipRule); + + /// + /// 添加会员等级规则 + /// + /// + /// + bool AddVipRule(VipRule vipRule); + + /// + /// 删除会员等级规则 + /// + /// + /// + bool DelVipRule(VipRule vipRule); + + /// + /// 更新会员等级规则 + /// + /// + /// + bool UpdVipRule(VipRule vipRule); + } +} diff --git a/EOM.TSHotelManager.Application/Zero/VipRule/VipRuleAppService.cs b/EOM.TSHotelManager.Application/Zero/VipRule/VipRuleAppService.cs new file mode 100644 index 0000000000000000000000000000000000000000..447df48ba9d54c2231be0f2c725037d8e4b9b471 --- /dev/null +++ b/EOM.TSHotelManager.Application/Zero/VipRule/VipRuleAppService.cs @@ -0,0 +1,154 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using EOM.TSHotelManager.Common; +using EOM.TSHotelManager.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 + { + /// + /// 会员等级规则 + /// + private readonly PgRepository vipRuleRepository; + + /// + /// 客户类型 + /// + private readonly PgRepository custoTypeRepository; + + /// + /// + /// + /// + /// + public VipRuleAppService(PgRepository vipRuleRepository, PgRepository custoTypeRepository) + { + this.vipRuleRepository = vipRuleRepository; + this.custoTypeRepository = custoTypeRepository; + } + + /// + /// 查询会员等级规则列表 + /// + /// + public List SelectVipRuleList() + { + List vipRules = new List(); + + var listSource = vipRuleRepository.GetList(a => a.delete_mk != 1); + + var listUserType = custoTypeRepository.GetList(a => a.delete_mk != 1); + + listSource.ForEach(source => + { + var userType = listUserType.FirstOrDefault(a => a.UserType == source.type_id); + source.type_name = userType == null ? "" : userType.TypeName; + }); + + vipRules = listSource; + + return vipRules; + } + + /// + /// 查询会员等级规则 + /// + /// + /// + public VipRule SelectVipRule(VipRule vipRule) + { + VipRule vipRule1 = new VipRule(); + + var source = vipRuleRepository.GetSingle(a => a.rule_id.Equals(vipRule.rule_id)); + + var userType = custoTypeRepository.GetSingle(a => a.UserType == source.type_id); + source.type_name = userType == null ? "" : userType.TypeName; + + vipRule1 = source; + + return vipRule1; + } + + /// + /// 添加会员等级规则 + /// + /// + /// + public bool AddVipRule(VipRule vipRule) + { + return vipRuleRepository.Insert(new VipRule() + { + rule_id = vipRule.rule_id, + rule_name = vipRule.rule_name, + rule_value = vipRule.rule_value, + type_id = vipRule.type_id, + delete_mk = 0, + datains_usr = AdminInfo.Account, + datains_date = DateTime.Now + }); + } + + /// + /// 删除会员等级规则 + /// + /// + /// + public bool DelVipRule(VipRule vipRule) + { + return vipRuleRepository.Update(a => new VipRule + { + delete_mk = 1, + datachg_usr = AdminInfo.Account, + datachg_date = DateTime.Now + },a => a.rule_id == vipRule.rule_id); + } + + /// + /// 更新会员等级规则 + /// + /// + /// + public bool UpdVipRule(VipRule vipRule) + { + return vipRuleRepository.Update(a => new VipRule + { + rule_name = vipRule.rule_name, + rule_value = vipRule.rule_value, + delete_mk = vipRule.delete_mk, + datachg_usr = AdminInfo.Account, + datachg_date = DateTime.Now + }, a => a.rule_id == vipRule.rule_id); + } + } +} diff --git a/EOM.TSHotelManager.Common/EOM.TSHotelManager.Common.csproj b/EOM.TSHotelManager.Common/EOM.TSHotelManager.Common.csproj new file mode 100644 index 0000000000000000000000000000000000000000..93cb6cb5b10b88f33f52fcb6db45ab890db4212f --- /dev/null +++ b/EOM.TSHotelManager.Common/EOM.TSHotelManager.Common.csproj @@ -0,0 +1,17 @@ + + + + net6.0 + enable + enable + + + + + + + + + + + diff --git a/EOM.TSHotelManager.Common/HttpHelper.cs b/EOM.TSHotelManager.Common/HttpHelper.cs new file mode 100644 index 0000000000000000000000000000000000000000..483d7723f94b0403189ead8a6d110d4bfa963270 --- /dev/null +++ b/EOM.TSHotelManager.Common/HttpHelper.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Text; +using System.Threading.Tasks; + +namespace EOM.TSHotelManager.Common +{ + /// + /// 文件上传帮助类 + /// + public class HttpHelper + { + #region 受限于打包插件的限制才放在这,个人开发时建议统一在App.Config进行配置 + + /// + /// 数据库配置连接 + /// + public const string? mysqlString = "server = localhost; user id = softuser; password = .; database = tshoteldb;"; + public const string? pgsqlString = "qpyxeqMNN342V18jm3VN+iCeovxqQKgUHzzuYeGmV90jqMTPS5/bJLdDi3XQw4T820gCZ8prLDZICtlvqHJ9Uhn0uys9KYEP0iMuvoE5vsw3JtsetpU7O58CXkujZzMi·%*c>fd;d*d#b%ad;0 + /// 照片文件配置URL + /// + public const string? baseUrl = "RricsELofi55yQ4YD7ndbNP0T7c6nnhD8ASRT6/B35hjaWAdRSS0is7uQearyz60·e$>^b$?%^ff*;c?<$$ca?$#a%ddc;a0c"; + /// + /// 上传照片URL + /// + public const string? postUrl = "qDxYOlHl/qx0D2DqQZ1fe6SR1JUnAdqex4VBmlwGoKZ2OJdf7qx9sxjnZbHlo/GM·%%*;#<%? + /// WebClient上传文件至服务器 + /// + /// 文件名,全路径格式 + /// 服务器文件夹路径 + public static string? UpLoadFile(string? fileNamePath, string? uriString) + { + // 创建WebClient实例 + WebClient myWebClient = new WebClient(); + byte[] responseData = myWebClient.UploadFile(uriString, "POST", fileNamePath);//得到返回的内容 + String str = Encoding.UTF8.GetString(responseData);//得到的目的字符串 + + return str.Replace('\"', ' '); + } + } +} diff --git a/EOM.TSHotelManager.Common/RecordHelper/AdminInfo.cs b/EOM.TSHotelManager.Common/RecordHelper/AdminInfo.cs new file mode 100644 index 0000000000000000000000000000000000000000..f1f5c237ed5e70f48e128caaf640b90ed85e74bc --- /dev/null +++ b/EOM.TSHotelManager.Common/RecordHelper/AdminInfo.cs @@ -0,0 +1,66 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + *模块说明:管理员信息静态类 + */ +using System.Linq; +using System.Net; + +namespace EOM.TSHotelManager.Common +{ + /// + /// 管理员信息静态类 + /// + public class AdminInfo + { + /// + /// 存储当前超管账号 + /// + public static string? Account = ""; + + /// + /// 存储当前超管类型 + /// + public static string? Type = ""; + + /// + /// 存储当前超管用户组 + /// + public static string? Group = ""; + + /// + /// 存储当前超管名称 + /// + public static string? Name = ""; + + /// + /// 是否为超管 + /// + public static bool isAdmin; + + /// + /// 存储当前软件版本 + /// + public static string? SoftwareVersion = ""; + + } +} diff --git a/EOM.TSHotelManager.Common/RecordHelper/IOperationlogService.cs b/EOM.TSHotelManager.Common/RecordHelper/IOperationlogService.cs new file mode 100644 index 0000000000000000000000000000000000000000..439d3da76709f853e0853ea26068cec3355ce579 --- /dev/null +++ b/EOM.TSHotelManager.Common/RecordHelper/IOperationlogService.cs @@ -0,0 +1,46 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using System.Collections.Generic; + +namespace EOM.TSHotelManager.Common +{ + /// + /// 操作日志数据访问层 + /// + public interface IOperationlogService + { + /// + /// 添加操作日志 + /// + /// + /// + bool InsertOperationLog(OperationLog opr); + + /// + /// 查询所有操作日志 + /// + /// + List SelectOperationlogAll(); + } +} \ No newline at end of file diff --git a/EOM.TSHotelManager.Common/RecordHelper/LoginInfo.cs b/EOM.TSHotelManager.Common/RecordHelper/LoginInfo.cs new file mode 100644 index 0000000000000000000000000000000000000000..9f7814eecd9be76064255af5bb6e58ed9e632536 --- /dev/null +++ b/EOM.TSHotelManager.Common/RecordHelper/LoginInfo.cs @@ -0,0 +1,57 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + *模块说明:登录信息静态类 + */ +using System.Linq; +using System.Net; + +namespace EOM.TSHotelManager.Common +{ + public static class LoginInfo + { + /// + /// 存储当前员工编号 + /// + public static string? WorkerNo = ""; + + /// + /// 存储当前员工姓名 + /// + public static string? WorkerName = ""; + + /// + /// 存储当前员工职位 + /// + public static string? WorkerPosition = ""; + + /// + /// 存储当前员工部门 + /// + public static string? WorkerClub = ""; + + /// + /// 存储当前软件版本 + /// + public static string? SoftwareVersion = ""; + } +} diff --git a/EOM.TSHotelManager.Common/RecordHelper/OperationLog.cs b/EOM.TSHotelManager.Common/RecordHelper/OperationLog.cs new file mode 100644 index 0000000000000000000000000000000000000000..0046480ad53a94777d0a6ffcab7859a8901cb6d3 --- /dev/null +++ b/EOM.TSHotelManager.Common/RecordHelper/OperationLog.cs @@ -0,0 +1,114 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + *模块说明:操作日志类 + */ +using System; +using System.Linq; +using System.Net; + +namespace EOM.TSHotelManager.Common +{ + /// + /// 日志等级 + /// + public enum RecordLevel + { + /// + /// 普通警告 + /// + Normal = 100, + /// + /// 严重警告 + /// + Warning = 200, + /// + /// 危险警告 + /// + Danger = 300, + } + + /// + /// 操作日志 + /// + [SqlSugar.SugarTable("operationlog")] + public class OperationLog + { + /// + /// 操作时间 + /// + [SqlSugar.SugarColumn(ColumnName = "OperationTime")] + public DateTime OperationTime { get; set; } + /// + /// 操作信息 + /// + [SqlSugar.SugarColumn(ColumnName = "LogContent")] + public string? LogContent { get; set; } + /// + /// 操作账号 + /// + [SqlSugar.SugarColumn(ColumnName = "OperationAccount")] + public string? OperationAccount { get; set; } + /// + /// 日志等级 + /// + [SqlSugar.SugarColumn(ColumnName = "OperationLevel")] + public RecordLevel OperationLevel { get; set; } + /// + /// 删除标记 + /// + [SqlSugar.SugarColumn(ColumnName = "delete_mk")] + public int delete_mk { get; set; } + /// + /// 软件版本 + /// + [SqlSugar.SugarColumn(ColumnName = "SoftwareVersion")] + public string? SoftwareVersion { get; set; } + /// + /// 登录IP + /// + [SqlSugar.SugarColumn(ColumnName = "login_ip")] + public string? login_ip { get; set; } + /// 资料创建人 + /// + public string? datains_usr { get; set; } + /// + /// 资料创建时间 + /// + public DateTime datains_date { get; set; } + /// + /// 资料更新人 + /// + public string? datachg_usr { get; set; } + /// + /// 资料更新时间 + /// + public DateTime datachg_date { get; set; } + + /// + /// 日志等级 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? OperationLevelNm { get; set; } + + } +} diff --git a/EOM.TSHotelManager.Common/RecordHelper/OperationlogService.cs b/EOM.TSHotelManager.Common/RecordHelper/OperationlogService.cs new file mode 100644 index 0000000000000000000000000000000000000000..a485760a6196919d517b0185e175b440f48b099f --- /dev/null +++ b/EOM.TSHotelManager.Common/RecordHelper/OperationlogService.cs @@ -0,0 +1,79 @@ +/* + * MIT License + *Copyright (c) 2021 易开元(Easy-Open-Meta) + + *Permission is hereby granted, free of charge, to any person obtaining a copy + *of this software and associated documentation files (the "Software"), to deal + *in the Software without restriction, including without limitation the rights + *to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + *copies of the Software, and to permit persons to whom the Software is + *furnished to do so, subject to the following conditions: + + *The above copyright notice and this permission notice shall be included in all + *copies or substantial portions of the Software. + + *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + *IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + *FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + *AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + *LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + *SOFTWARE. + * + */ +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Net; +using EOM.TSHotelManager.EntityFramework; + +namespace EOM.TSHotelManager.Common +{ + /// + /// 操作日志数据访问层 + /// + public class OperationlogService:IOperationlogService + { + /// + /// 操作日志 + /// + private readonly PgRepository operationLogRepository; + + /// + /// + /// + /// + public OperationlogService(PgRepository operationLogRepository) + { + this.operationLogRepository = operationLogRepository; + } + + /// + /// 添加操作日志 + /// + /// + /// + public bool InsertOperationLog(OperationLog opr) + { + return operationLogRepository.Insert(opr); + } + + /// + /// 查询所有操作日志 + /// + /// + public List SelectOperationlogAll() + { + List operationLogs = new List(); + operationLogs = operationLogRepository.GetList(a => a.delete_mk != 1).OrderByDescending(a => a.OperationTime).ToList(); + operationLogs.ForEach(source => + { + source.OperationLevelNm = source.OperationLevel == RecordLevel.Normal ? "常规操作" : source.OperationLevel == RecordLevel.Warning ? "敏感操作" : "严重操作"; + }); + return operationLogs; + } + + + } +} diff --git a/EOM.TSHotelManager.Common/RecordHelper/RecordHelper.cs b/EOM.TSHotelManager.Common/RecordHelper/RecordHelper.cs new file mode 100644 index 0000000000000000000000000000000000000000..d82852bfd7beaa61a3620f9cbf8e44b532edb5a9 --- /dev/null +++ b/EOM.TSHotelManager.Common/RecordHelper/RecordHelper.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Net; + +namespace EOM.TSHotelManager.Common +{ + /// + /// 日志记录助手 + /// + public class RecordHelper + { + private readonly IOperationlogService operationlogService; + + public RecordHelper(IOperationlogService operationlogService) + { + this.operationlogService = operationlogService; + } + + /// + /// 记录信息集合 + /// + /// + /// + public void Record(string? OperationLog, int level) + { + var logDetail = new OperationLog + { + OperationTime = DateTime.Now, + LogContent = OperationLog, + OperationAccount = LoginInfo.WorkerNo + AdminInfo.Account, + OperationLevel = level == 1 ? RecordLevel.Normal : level == 2 ? RecordLevel.Warning : RecordLevel.Danger, + SoftwareVersion = AdminInfo.SoftwareVersion + LoginInfo.SoftwareVersion, + delete_mk = 0, + datains_usr = AdminInfo.Account + LoginInfo.WorkerNo, + datains_date = DateTime.Now + }; + operationlogService.InsertOperationLog(logDetail); + } + + } +} diff --git a/HotelManagerSystemWebApi.Core/Util/ApplicationVersionUtil.cs b/EOM.TSHotelManager.Common/Util/ApplicationVersionUtil.cs similarity index 69% rename from HotelManagerSystemWebApi.Core/Util/ApplicationVersionUtil.cs rename to EOM.TSHotelManager.Common/Util/ApplicationVersionUtil.cs index ec4ea5bb5059dad3174152723b68e61cf86ac112..0e1ed916ec0d7b449b8e2382517000c75b986942 100644 --- a/HotelManagerSystemWebApi.Core/Util/ApplicationVersionUtil.cs +++ b/EOM.TSHotelManager.Common/Util/ApplicationVersionUtil.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -22,32 +22,49 @@ * *模块说明:检测软件版本 */ +using EOM.TSHotelManager.EntityFramework; using SqlSugar; -using SYS.Common; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Common { /// /// 程序版本号检测 /// - public class ApplicationVersionUtil:Repository + public class ApplicationVersionUtil { + /// + /// 应用检测 + /// + private readonly PgRepository applicationRepository; + + /// + /// + /// + /// + public ApplicationVersionUtil(PgRepository applicationRepository) + { + this.applicationRepository = applicationRepository; + } + /// /// 检测版本号 /// /// public applicationversion CheckBaseVersion() { - return base.GetSingle(a => a.base_versionId == 1); + return applicationRepository.GetSingle(a => a.base_versionId == 1); } } - [Table("applicationversion")] + /// + /// + /// + [SqlSugar.SugarTable("applicationversion")] public class applicationversion { /// @@ -60,6 +77,6 @@ namespace HotelManagerSystemWebApi.Core /// 版本号 /// [SugarColumn(ColumnName = "base_version")]//数据库是自增才配自增 - public string base_version { get; set; } + public string? base_version { get; set; } } } diff --git a/HotelManagerSystemWebApi.Core/Util/IDCardUtil.cs b/EOM.TSHotelManager.Common/Util/IDCardUtil.cs similarity index 81% rename from HotelManagerSystemWebApi.Core/Util/IDCardUtil.cs rename to EOM.TSHotelManager.Common/Util/IDCardUtil.cs index fc245053d588f0ec40ac51ba789ee0092a2c34bd..bcb5d8e4b18f2e7aa866d71e02a58c6cea343c77 100644 --- a/HotelManagerSystemWebApi.Core/Util/IDCardUtil.cs +++ b/EOM.TSHotelManager.Common/Util/IDCardUtil.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -22,31 +22,45 @@ * *模块说明:身份证号码工具类 */ -using SYS.Common; +using EOM.TSHotelManager.EntityFramework; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace HotelManagerSystemWebApi.Core.Util +namespace EOM.TSHotelManager.Common { /// /// 身份证号码工具类 /// - public class IDCardUtil:Repository + public class IDCardUtil { + /// + /// 身份证号 + /// + private readonly PgRepository cardCodeRepository; + + /// + /// + /// + /// + public IDCardUtil(PgRepository cardCodeRepository) + { + this.cardCodeRepository = cardCodeRepository; + } + /// /// 查询地区码 /// /// /// - public string SelectCardCode(string identityCard) + public string? SelectCardCode(string? identityCard) { var cardid = identityCard.Substring(0, 6).ToString(); cardcodes cardcodes = new cardcodes(); var pcd = string.Empty; - cardcodes = base.GetSingle(a => a.bm == cardid); + cardcodes = cardCodeRepository.GetSingle(a => a.bm == cardid); pcd = cardcodes == null ? "" : string.Join(",", cardcodes.Province + cardcodes.City + cardcodes.District); return pcd; } diff --git a/EOM.TSHotelManager.Common/Util/IDGenerationUtil.cs b/EOM.TSHotelManager.Common/Util/IDGenerationUtil.cs new file mode 100644 index 0000000000000000000000000000000000000000..c57d996ef966b85b17ac8715c8e64560adb5137c --- /dev/null +++ b/EOM.TSHotelManager.Common/Util/IDGenerationUtil.cs @@ -0,0 +1,80 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace EOM.TSHotelManager.Common +{ + public static class IDGenerationUtil + { + //锁对象 + private static readonly object lockTimeCode = new object(); + + private static Dictionary? dic = null; + + /// + /// 批量获取流水号 + /// + /// 流水号前缀 + /// 填充位数,e.g 3为 000 + /// 流水号数量 + /// 分隔符 + /// 流水号集合 + public static List GetListNewId(string? preCode = null, int fillCount = 0, int pCount = 1, string? separatorChar = null) + { + List list = new List(); + int num = 1; + StringBuilder sb = new StringBuilder(); + for (int i = 0; i < pCount; i++) + { + sb.Clear(); + sb.Append(preCode); + DateTime now = DateTime.Now; + string? text = now.ToString("yyyyMMddms"); + sb.Append(text); + sb.Append(separatorChar); + lock (lockTimeCode) + { + if (!dic.ContainsKey(text)) + { + if (dic.Count > 10) + { + dic.Clear(); + } + num++; + dic.Add(text, 1); + } + else + { + if (dic[text] > 8998) + { + while (true) + { + string? a = text; + now = DateTime.Now; + if (a == now.ToString("yyyyMMddms")) + { + Thread.Sleep(0); + continue; + } + break; + } + goto end_IL_004e; + } + Dictionary dictionary = dic; + string? key = text; + dictionary[key]++; + num = dic[text]; + } + string? value = num.ToString().PadLeft(fillCount, '0'); + sb.Append(value); + list.Add(sb.ToString()); + end_IL_004e:; + } + } + return list; + } + + } +} diff --git a/HotelManagerSystemWebApi.Core/Business/Cash/Cash.cs b/EOM.TSHotelManager.Core/Business/Cash/Cash.cs similarity index 70% rename from HotelManagerSystemWebApi.Core/Business/Cash/Cash.cs rename to EOM.TSHotelManager.Core/Business/Cash/Cash.cs index ac4413170c99699793e93cf41b5b3db15f3f1090..e564b21f799f096ab7a4456ff5bafface9af2ec4 100644 --- a/HotelManagerSystemWebApi.Core/Business/Cash/Cash.cs +++ b/EOM.TSHotelManager.Core/Business/Cash/Cash.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -23,32 +23,40 @@ *模块说明:资产类 */ using System; -using System.ComponentModel.DataAnnotations.Schema; - -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 资产管理 /// - [Table("cashinfo")] + [SqlSugar.SugarTable("cashinfo")] public class Cash { /// /// 资产编号 /// - public string CashNo { get; set; } + public string? CashNo { get; set; } /// /// 资产名称 /// - public string CashName { get; set; } + public string? CashName { get; set; } /// /// 资产总值 /// public decimal CashPrice { get; set; } /// + /// 资产总值描述 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? CashPriceStr { get; set; } + /// /// 所属部门 /// - public string CashClub { get; set; } + public string? CashClub { get; set; } + /// + /// 所属部门描述 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? DeptName { get; set; } /// /// 入库时间 /// @@ -56,11 +64,16 @@ namespace HotelManagerSystemWebApi.Core /// /// 资产来源 /// - public string CashSource { get; set; } + public string? CashSource { get; set; } + /// + /// 资产经办人 + /// + public string? CashPerson { get; set; } /// /// 资产经办人 /// - public string CashPerson { get; set; } + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? PersonName { get; set; } /// /// 删除标记 /// @@ -68,7 +81,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料创建人 /// - public string datains_usr { get; set; } + public string? datains_usr { get; set; } /// /// 资料创建时间 /// @@ -76,7 +89,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料更新人 /// - public string datachg_usr { get; set; } + public string? datachg_usr { get; set; } /// /// 资料更新时间 /// diff --git a/HotelManagerSystemWebApi.Core/Business/Customer/Custo.cs b/EOM.TSHotelManager.Core/Business/Customer/Custo.cs similarity index 60% rename from HotelManagerSystemWebApi.Core/Business/Customer/Custo.cs rename to EOM.TSHotelManager.Core/Business/Customer/Custo.cs index 4deb12238f81e34facc33a8b24a0396b549550d6..91334f001d6e2901c7a6752173c0d277efb52c2c 100644 --- a/HotelManagerSystemWebApi.Core/Business/Customer/Custo.cs +++ b/EOM.TSHotelManager.Core/Business/Customer/Custo.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -23,67 +23,75 @@ *模块说明:客户信息类 */ using System; -using System.ComponentModel.DataAnnotations.Schema; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 客户信息 /// - [Table("userinfo")] + [SqlSugar.SugarTable("customer")] public class Custo { /// /// 客户编号 /// - public string CustoNo { get; set; } + [SqlSugar.SugarColumn(ColumnName = "custo_no",IsPrimaryKey = true)] + public string? CustoNo { get; set; } /// /// 客户名称 /// - public string CustoName { get; set; } + [SqlSugar.SugarColumn(ColumnName = "custo_name", IsNullable = false)] + public string? CustoName { get; set; } /// /// 客户性别 /// + [SqlSugar.SugarColumn(ColumnName = "custo_sex", IsNullable = true)] public int CustoSex { get; set; } /// /// 客户电话 /// - public string CustoTel { get; set; } + [SqlSugar.SugarColumn(ColumnName = "custo_tel", IsNullable = false)] + public string? CustoTel { get; set; } /// /// 证件类型 /// + [SqlSugar.SugarColumn(ColumnName = "passport_type", IsNullable = false)] public int PassportType { get; set; } /// /// 证件号码 /// - public string CustoID { get; set; } + [SqlSugar.SugarColumn(ColumnName = "passport_id", IsNullable = false)] + public string? CustoID { get; set; } /// /// 居住地址 /// - public string CustoAdress { get; set; } + [SqlSugar.SugarColumn(ColumnName = "custo_address", IsNullable = true)] + public string? CustoAdress { get; set; } /// /// 出生日期 /// + [SqlSugar.SugarColumn(ColumnName = "custo_birth", IsNullable = true)] public DateTime CustoBirth { get; set; } /// /// 客户类型 /// + [SqlSugar.SugarColumn(ColumnName = "custo_type", IsNullable = false)] public int CustoType { get; set; } - ///// - ///// 客户类型 - ///// - //[SqlSugar.SugarColumn(IsIgnore = true)] - //public string typeName { get; set; } - ///// - ///// 证件类型 - ///// - //[SqlSugar.SugarColumn(IsIgnore = true)] - //public string PassportName { get; set; } - ///// - ///// 性别 - ///// - //[SqlSugar.SugarColumn(IsIgnore = true)] - //public string SexName { get; set; } + /// + /// 客户类型 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? typeName { get; set; } + /// + /// 证件类型 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? PassportName { get; set; } + /// + /// 性别 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? SexName { get; set; } /// /// 删除标记 /// @@ -91,7 +99,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料创建人 /// - public string datains_usr { get; set; } + public string? datains_usr { get; set; } /// /// 资料创建时间 /// @@ -99,7 +107,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料更新人 /// - public string datachg_usr { get; set; } + public string? datachg_usr { get; set; } /// /// 资料更新时间 /// diff --git a/HotelManagerSystemWebApi.Core/Business/Customer/CustoSpend.cs b/EOM.TSHotelManager.Core/Business/Customer/CustoSpend.cs similarity index 91% rename from HotelManagerSystemWebApi.Core/Business/Customer/CustoSpend.cs rename to EOM.TSHotelManager.Core/Business/Customer/CustoSpend.cs index f65789c1d2e582be6d566927b689a530eb49a6d4..8ec8bcfa8a2be3c4f452dd64ed1b7eae62dc6d19 100644 --- a/HotelManagerSystemWebApi.Core/Business/Customer/CustoSpend.cs +++ b/EOM.TSHotelManager.Core/Business/Customer/CustoSpend.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -22,7 +22,7 @@ * *模块说明:酒店盈利情况类 */ -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 酒店盈利情况 @@ -32,7 +32,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 年 /// - public string Years { get; set; } + public string? Years { get; set; } /// /// 总金额 /// diff --git a/HotelManagerSystemWebApi.Core/Business/Customer/CustoType.cs b/EOM.TSHotelManager.Core/Business/Customer/CustoType.cs similarity index 86% rename from HotelManagerSystemWebApi.Core/Business/Customer/CustoType.cs rename to EOM.TSHotelManager.Core/Business/Customer/CustoType.cs index 43d033ad51991314d8868410ccfac3626d1b21a5..b89c3b99f6c8fc47a04161a804584950a46e031e 100644 --- a/HotelManagerSystemWebApi.Core/Business/Customer/CustoType.cs +++ b/EOM.TSHotelManager.Core/Business/Customer/CustoType.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -23,14 +23,13 @@ *模块说明:客户类型类 */ using System; -using System.ComponentModel.DataAnnotations.Schema; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 客户类型 /// - [Table("usertype")] + [SqlSugar.SugarTable("usertype")] public class CustoType { /// @@ -40,7 +39,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 类型名字 /// - public string TypeName { get; set; } + public string? TypeName { get; set; } /// /// 删除标记 /// @@ -48,7 +47,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料创建人 /// - public string datains_usr { get; set; } + public string? datains_usr { get; set; } /// /// 资料创建时间 /// @@ -56,7 +55,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料更新人 /// - public string datachg_usr { get; set; } + public string? datachg_usr { get; set; } /// /// 资料更新时间 /// diff --git a/HotelManagerSystemWebApi.Core/Business/Customer/PassPortType.cs b/EOM.TSHotelManager.Core/Business/Customer/PassPortType.cs similarity index 86% rename from HotelManagerSystemWebApi.Core/Business/Customer/PassPortType.cs rename to EOM.TSHotelManager.Core/Business/Customer/PassPortType.cs index 274b3b9f517ceee980129df0c3dd33c01d1cb138..f05a9c410b5ec5e0d8bca55152420441e8148df1 100644 --- a/HotelManagerSystemWebApi.Core/Business/Customer/PassPortType.cs +++ b/EOM.TSHotelManager.Core/Business/Customer/PassPortType.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -24,17 +24,16 @@ */ using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 证件类型 /// - [Table("passporttype")] + [SqlSugar.SugarTable("passporttype")] public class PassPortType { /// @@ -45,7 +44,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 证件名称 /// - public string PassportName { get; set; } + public string? PassportName { get; set; } /// /// 删除标记 /// @@ -53,7 +52,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料创建人 /// - public string datains_usr { get; set; } + public string? datains_usr { get; set; } /// /// 资料创建时间 /// @@ -61,7 +60,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料更新人 /// - public string datachg_usr { get; set; } + public string? datachg_usr { get; set; } /// /// 资料更新时间 /// diff --git a/HotelManagerSystemWebApi.Core/Business/Customer/SexType.cs b/EOM.TSHotelManager.Core/Business/Customer/SexType.cs similarity index 86% rename from HotelManagerSystemWebApi.Core/Business/Customer/SexType.cs rename to EOM.TSHotelManager.Core/Business/Customer/SexType.cs index 018261a343ec26d81d668eee9671dd3056de9a8d..2e6eb95c387cc9214d629f625deef181d2e29114 100644 --- a/HotelManagerSystemWebApi.Core/Business/Customer/SexType.cs +++ b/EOM.TSHotelManager.Core/Business/Customer/SexType.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -24,17 +24,16 @@ */ using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 性别 /// - [Table("sextype")] + [SqlSugar.SugarTable("sextype")] public class SexType { /// @@ -45,7 +44,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 性别名称 /// - public string sexName { get; set; } + public string? sexName { get; set; } /// /// 删除标记 @@ -54,7 +53,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料创建人 /// - public string datains_usr { get; set; } + public string? datains_usr { get; set; } /// /// 资料创建时间 /// @@ -62,7 +61,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料更新人 /// - public string datachg_usr { get; set; } + public string? datachg_usr { get; set; } /// /// 资料更新时间 /// diff --git a/HotelManagerSystemWebApi.Core/Business/Fonts/Fonts.cs b/EOM.TSHotelManager.Core/Business/Fonts/Fonts.cs similarity index 86% rename from HotelManagerSystemWebApi.Core/Business/Fonts/Fonts.cs rename to EOM.TSHotelManager.Core/Business/Fonts/Fonts.cs index fd2b8e0991cadfe2088e2b6245bedacfc97b8b7d..04909a73640a0e4ee821d8598b27a99ae92d36a9 100644 --- a/HotelManagerSystemWebApi.Core/Business/Fonts/Fonts.cs +++ b/EOM.TSHotelManager.Core/Business/Fonts/Fonts.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -22,14 +22,12 @@ * *模块说明:宣传联动类 */ -using System.ComponentModel.DataAnnotations.Schema; - -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 酒店宣传联动内容 /// - [Table("fonts")] + [SqlSugar.SugarTable("fonts")] public class Fonts { /// @@ -40,6 +38,6 @@ namespace HotelManagerSystemWebApi.Core /// /// 宣传内容 /// - public string FontsMess { get; set; } + public string? FontsMess { get; set; } } } diff --git a/HotelManagerSystemWebApi.Core/Business/Reser/Reser.cs b/EOM.TSHotelManager.Core/Business/Reser/Reser.cs similarity index 82% rename from HotelManagerSystemWebApi.Core/Business/Reser/Reser.cs rename to EOM.TSHotelManager.Core/Business/Reser/Reser.cs index 264c1a3c3f0b998e0d18b5ab67e47bb2cfd147e8..35f111ec755716dd4781409b11b7ab0ce3554a7d 100644 --- a/HotelManagerSystemWebApi.Core/Business/Reser/Reser.cs +++ b/EOM.TSHotelManager.Core/Business/Reser/Reser.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -23,36 +23,35 @@ *模块说明:预约类 */ using System; -using System.ComponentModel.DataAnnotations.Schema; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 预约列表 /// - [Table("reser")] + [SqlSugar.SugarTable("reser")] public class Reser { /// /// 预约编号 /// - public string ReserId { get; set; } + public string? ReserId { get; set; } /// /// 客户名称 /// - public string CustoName { get; set; } + public string? CustoName { get; set; } /// /// 预约电话 /// - public string CustoTel { get; set; } + public string? CustoTel { get; set; } /// /// 预约渠道 /// - public string ReserWay { get; set; } + public string? ReserWay { get; set; } /// /// 预约房号 /// - public string ReserRoom { get; set; } + public string? ReserRoom { get; set; } /// /// 预约起始 /// @@ -68,7 +67,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料创建人 /// - public string datains_usr { get; set; } + public string? datains_usr { get; set; } /// /// 资料创建时间 /// @@ -76,7 +75,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料更新人 /// - public string datachg_usr { get; set; } + public string? datachg_usr { get; set; } /// /// 资料更新时间 /// diff --git a/HotelManagerSystemWebApi.Core/Business/Room/Room.cs b/EOM.TSHotelManager.Core/Business/Room/Room.cs similarity index 60% rename from HotelManagerSystemWebApi.Core/Business/Room/Room.cs rename to EOM.TSHotelManager.Core/Business/Room/Room.cs index 2eee0caff5f9d76ffafd175e277fe8666a8232cc..51cab35fc50c279bcbde048cf7d5901b5bdf2821 100644 --- a/HotelManagerSystemWebApi.Core/Business/Room/Room.cs +++ b/EOM.TSHotelManager.Core/Business/Room/Room.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -25,71 +25,84 @@ using System; using System.ComponentModel.DataAnnotations.Schema; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 房间实体类 /// - [Table("room")] + [SqlSugar.SugarTable("room")] public class Room { /// /// 房间编号 /// - public string RoomNo { get; set; } + [SqlSugar.SugarColumn(ColumnName = "room_no", IsPrimaryKey = true)] + public string? RoomNo { get; set; } /// /// 房间类型 /// + [SqlSugar.SugarColumn(ColumnName = "room_type")] public int RoomType { get; set; } /// /// 客户编号 /// - public string CustoNo { get; set; } + [SqlSugar.SugarColumn(ColumnName = "custo_no")] + public string? CustoNo { get; set; } + /// + /// 客户姓名 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? CustoName { get; set; } /// /// 最后一次入住时间 /// + [SqlSugar.SugarColumn(ColumnName = "check_in_time")] public DateTime? CheckTime { get; set; } /// /// 最后一次退房时间 /// + [SqlSugar.SugarColumn(ColumnName = "check_out_time")] public DateTime? CheckOutTime { get; set; } /// /// 房间状态ID /// + [SqlSugar.SugarColumn(ColumnName = "room_state_id")] public int RoomStateId { get; set; } - ///// - ///// 房间状态 - ///// - //[SqlSugar.SugarColumn(IsIgnore = true)] - //public string RoomState { get; set; } + /// + /// 房间状态 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? RoomState { get; set; } /// /// 房间单价 /// + [SqlSugar.SugarColumn(ColumnName = "room_rent")] public decimal RoomMoney { get; set; } /// /// 房间押金 /// - [Column("deposit")] + [SqlSugar.SugarColumn(ColumnName = "room_deposit")] public decimal RoomDeposit { get; set; } /// /// 房间位置 /// - public string RoomPosition { get; set; } - ///// - ///// 客户类型名称 - ///// - //[SqlSugar.SugarColumn(IsIgnore = true)] - //public string typeName { get; set; } - ///// - ///// 房间名称 - ///// - //[SqlSugar.SugarColumn(IsIgnore = true)] - //public string RoomName { get; set; } - ///// - ///// 最后一次入住时间 - ///// - //[SqlSugar.SugarColumn(IsIgnore = true)] - //public string CheckTimeFormat { get; set; } + [SqlSugar.SugarColumn(ColumnName = "room_position")] + public string? RoomPosition { get; set; } + /// + /// 客户类型名称 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? typeName { get; set; } + /// + /// 房间名称 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? RoomName { get; set; } + /// + /// 最后一次入住时间 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? CheckTimeFormat { get; set; } /// /// 删除标记 /// @@ -97,7 +110,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料创建人 /// - public string datains_usr { get; set; } + public string? datains_usr { get; set; } /// /// 资料创建时间 /// @@ -105,7 +118,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料更新人 /// - public string datachg_usr { get; set; } + public string? datachg_usr { get; set; } /// /// 资料更新时间 /// diff --git a/HotelManagerSystemWebApi.Core/Business/Room/RoomState.cs b/EOM.TSHotelManager.Core/Business/Room/RoomState.cs similarity index 84% rename from HotelManagerSystemWebApi.Core/Business/Room/RoomState.cs rename to EOM.TSHotelManager.Core/Business/Room/RoomState.cs index 28e33ca0ecfcc5e250db33cd1dfbb081e06ffccd..280159b92fbc87135bc1a6bb6b8264339784acc3 100644 --- a/HotelManagerSystemWebApi.Core/Business/Room/RoomState.cs +++ b/EOM.TSHotelManager.Core/Business/Room/RoomState.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -23,14 +23,13 @@ *模块说明:房间状态类 */ using System; -using System.ComponentModel.DataAnnotations.Schema; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 房间状态 /// - [Table("roomstate")] + [SqlSugar.SugarTable("roomstate")] public class RoomState { /// @@ -40,8 +39,8 @@ namespace HotelManagerSystemWebApi.Core /// /// 房间状态 /// - [Column("RoomState")] - public string RoomStateName { get; set; } + [SqlSugar.SugarColumn(ColumnName = "RoomState")] + public string? RoomStateName { get; set; } /// /// 删除标记 /// @@ -49,7 +48,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料创建人 /// - public string datains_usr { get; set; } + public string? datains_usr { get; set; } /// /// 资料创建时间 /// @@ -57,7 +56,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料更新人 /// - public string datachg_usr { get; set; } + public string? datachg_usr { get; set; } /// /// 资料更新时间 /// diff --git a/HotelManagerSystemWebApi.Core/Business/Room/RoomType.cs b/EOM.TSHotelManager.Core/Business/Room/RoomType.cs similarity index 83% rename from HotelManagerSystemWebApi.Core/Business/Room/RoomType.cs rename to EOM.TSHotelManager.Core/Business/Room/RoomType.cs index dca134ad5abacf22753cbf0cdacac1adfb746ab2..bce36c80483eb3cd4879daf1fae4f719fd993818 100644 --- a/HotelManagerSystemWebApi.Core/Business/Room/RoomType.cs +++ b/EOM.TSHotelManager.Core/Business/Room/RoomType.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -23,26 +23,24 @@ *模块说明:房间类型类 */ using System; -using System.ComponentModel.DataAnnotations.Schema; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 房间类型 /// - [Table("roomtype")] + [SqlSugar.SugarTable("roomtype")] public class RoomType { /// /// 类型编号 /// - //[SqlSugar.SugarColumn(ColumnName = "RoomType")] - [Column("RoomType")] + [SqlSugar.SugarColumn(ColumnName = "RoomType")] public int Roomtype { get; set; } /// /// 房间类型 /// - public string RoomName { get; set; } + public string? RoomName { get; set; } /// /// 删除标记 @@ -51,7 +49,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料创建人 /// - public string datains_usr { get; set; } + public string? datains_usr { get; set; } /// /// 资料创建时间 /// @@ -59,7 +57,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料更新人 /// - public string datachg_usr { get; set; } + public string? datachg_usr { get; set; } /// /// 资料更新时间 /// diff --git a/HotelManagerSystemWebApi.Core/Business/Sellthing/SellThing.cs b/EOM.TSHotelManager.Core/Business/Sellthing/SellThing.cs similarity index 80% rename from HotelManagerSystemWebApi.Core/Business/Sellthing/SellThing.cs rename to EOM.TSHotelManager.Core/Business/Sellthing/SellThing.cs index 304d08a2bcdb1efe054c9db7455e322f687b8309..ba30d73e2b1413134f08286661dbb094e63ffa12 100644 --- a/HotelManagerSystemWebApi.Core/Business/Sellthing/SellThing.cs +++ b/EOM.TSHotelManager.Core/Business/Sellthing/SellThing.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -25,35 +25,35 @@ using System; using System.ComponentModel.DataAnnotations.Schema; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 商品信息 /// - [Table("sellthing")] + [SqlSugar.SugarTable("sellthing")] public class SellThing { /// /// 商品编号 /// - public string SellNo { get; set; } + public string? SellNo { get; set; } /// /// 商品名称 /// - public string SellName { get; set; } + public string? SellName { get; set; } /// /// 商品价格 /// public decimal SellPrice { get; set; } - ///// - ///// 商品价格描述 - ///// - //[SqlSugar.SugarColumn(IsIgnore = true)] - //public string SellPriceStr { get; set; } + /// + /// 商品价格描述 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? SellPriceStr { get; set; } /// /// 规格型号 /// - public string format { get; set; } + public string? format { get; set; } /// /// 库存 /// @@ -65,7 +65,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料创建人 /// - public string datains_usr { get; set; } + public string? datains_usr { get; set; } /// /// 资料创建时间 /// @@ -73,7 +73,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料更新人 /// - public string datachg_usr { get; set; } + public string? datachg_usr { get; set; } /// /// 资料更新时间 /// diff --git a/HotelManagerSystemWebApi.Core/Business/Spend/Spend.cs b/EOM.TSHotelManager.Core/Business/Spend/Spend.cs similarity index 71% rename from HotelManagerSystemWebApi.Core/Business/Spend/Spend.cs rename to EOM.TSHotelManager.Core/Business/Spend/Spend.cs index 76994298e2260098e8c619f8a58d58a22481e450..d61e759cfbe9458c988a937859f7f10706b49f6a 100644 --- a/HotelManagerSystemWebApi.Core/Business/Spend/Spend.cs +++ b/EOM.TSHotelManager.Core/Business/Spend/Spend.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -23,28 +23,27 @@ *模块说明:消费信息类 */ using System; -using System.ComponentModel.DataAnnotations.Schema; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 消费信息 /// - [Table("custospend")] + [SqlSugar.SugarTable("custospend")] public class Spend { /// /// 房间编号 /// - public string RoomNo { get; set; } + public string? RoomNo { get; set; } /// /// 客户编号 /// - public string CustoNo { get; set; } + public string? CustoNo { get; set; } /// /// 商品名称 /// - public string SpendName { get; set; } + public string? SpendName { get; set; } /// /// 消费数量 /// @@ -53,20 +52,20 @@ namespace HotelManagerSystemWebApi.Core /// 商品单价 /// public decimal SpendPrice { get; set; } - ///// - ///// 商品单价描述 - ///// - //[SqlSugar.SugarColumn(IsIgnore = true)] - //public string SpendPriceStr { get; set; } + /// + /// 商品单价描述 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? SpendPriceStr { get; set; } /// /// 消费金额 /// public decimal SpendMoney { get; set; } - ///// - ///// 消费金额描述 - ///// - //[SqlSugar.SugarColumn(IsIgnore = true)] - //public string SpendMoneyStr { get; set; } + /// + /// 消费金额描述 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? SpendMoneyStr { get; set; } /// /// 消费时间 /// @@ -74,7 +73,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 结算状态 /// - public string MoneyState { get; set; } + public string? MoneyState { get; set; } /// /// 删除标记 /// @@ -82,7 +81,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料创建人 /// - public string datains_usr { get; set; } + public string? datains_usr { get; set; } /// /// 资料创建时间 /// @@ -90,16 +89,16 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料更新人 /// - public string datachg_usr { get; set; } + public string? datachg_usr { get; set; } /// /// 资料更新时间 /// public DateTime datachg_date { get; set; } - ///// - ///// 结算状态描述 - ///// - //[SqlSugar.SugarColumn(IsIgnore = true)] - //public string SpendStateNm { get; set; } + /// + /// 结算状态描述 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? SpendStateNm { get; set; } } } diff --git a/HotelManagerSystemWebApi.Core/Business/Spend/SpendConsts.cs b/EOM.TSHotelManager.Core/Business/Spend/SpendConsts.cs similarity index 88% rename from HotelManagerSystemWebApi.Core/Business/Spend/SpendConsts.cs rename to EOM.TSHotelManager.Core/Business/Spend/SpendConsts.cs index 32d854705a8753436c8e7946ad84b27ea66f6af9..4aba97b4c0d64ae43fb32861bf443ac7c2d4325d 100644 --- a/HotelManagerSystemWebApi.Core/Business/Spend/SpendConsts.cs +++ b/EOM.TSHotelManager.Core/Business/Spend/SpendConsts.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -28,7 +28,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 结算状态常量 @@ -38,11 +38,11 @@ namespace HotelManagerSystemWebApi.Core /// /// 已结算状态常量 /// - public const string Settled = "Settled"; + public const string? Settled = "Settled"; /// /// 未结算状态常量 /// - public const string UnSettle = "UnSettle"; + public const string? UnSettle = "UnSettle"; } } diff --git a/HotelManagerSystemWebApi.Core/Business/Wti/Wti.cs b/EOM.TSHotelManager.Core/Business/Wti/Wti.cs similarity index 74% rename from HotelManagerSystemWebApi.Core/Business/Wti/Wti.cs rename to EOM.TSHotelManager.Core/Business/Wti/Wti.cs index 1780b3d65398fb4ab9ad9369591912b8a6d7fdf3..8a1756042ccff93c15087d38933c3df9002b7747 100644 --- a/HotelManagerSystemWebApi.Core/Business/Wti/Wti.cs +++ b/EOM.TSHotelManager.Core/Business/Wti/Wti.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -23,65 +23,64 @@ *模块说明:水电信息类 */ using System; -using System.ComponentModel.DataAnnotations.Schema; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 水电信息 /// - [Table("wtinfo")] + [SqlSugar.SugarTable("wtinfo")] public class Wti { /// /// 信息编号 /// - [Column("WtiNo")] + [SqlSugar.SugarColumn(ColumnName = "WtiNo",IsIdentity =true,IsPrimaryKey =true)] public int WtiNo { get; set; } /// /// 房间编号 /// - [Column("RoomNo")] - public string RoomNo { get; set; } + [SqlSugar.SugarColumn(ColumnName = "RoomNo")] + public string? RoomNo { get; set; } /// /// 开始使用时间 /// - [Column("UseDate")] + [SqlSugar.SugarColumn(ColumnName = "UseDate")] public DateTime UseDate { get; set; } /// /// 结束使用时间 /// - [Column("EndDate")] + [SqlSugar.SugarColumn(ColumnName = "EndDate")] public DateTime EndDate { get; set; } /// /// 水费 /// - [Column( "WaterUse")] + [SqlSugar.SugarColumn(ColumnName = "WaterUse")] public decimal WaterUse { get; set; } /// /// 电费 /// - [Column("PowerUse")] + [SqlSugar.SugarColumn(ColumnName = "PowerUse")] public decimal PowerUse { get; set; } /// /// 记录员 /// - [Column("Record")] - public string Record { get; set; } + [SqlSugar.SugarColumn(ColumnName = "Record")] + public string? Record { get; set; } /// /// 客户编号 /// - [Column("CustoNo")] - public string CustoNo { get; set; } + [SqlSugar.SugarColumn(ColumnName = "CustoNo")] + public string? CustoNo { get; set; } /// /// 删除标记 /// - [Column("delete_mk")] + [SqlSugar.SugarColumn(ColumnName = "delete_mk")] public int delete_mk { get; set; } /// /// 资料创建人 /// - public string datains_usr { get; set; } + public string? datains_usr { get; set; } /// /// 资料创建时间 /// @@ -89,7 +88,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料更新人 /// - public string datachg_usr { get; set; } + public string? datachg_usr { get; set; } /// /// 资料更新时间 /// diff --git a/EOM.TSHotelManager.Core/EOM.TSHotelManager.Core.csproj b/EOM.TSHotelManager.Core/EOM.TSHotelManager.Core.csproj new file mode 100644 index 0000000000000000000000000000000000000000..fe414e416bba1c718b381955546b547eb145308b --- /dev/null +++ b/EOM.TSHotelManager.Core/EOM.TSHotelManager.Core.csproj @@ -0,0 +1,14 @@ + + + + net6.0 + enable + enable + True + + + + + + + diff --git a/HotelManagerSystemWebApi.Core/Util/CounterRuleConsts.cs b/EOM.TSHotelManager.Core/Sys/NavBar/NavBar.cs similarity index 40% rename from HotelManagerSystemWebApi.Core/Util/CounterRuleConsts.cs rename to EOM.TSHotelManager.Core/Sys/NavBar/NavBar.cs index 4f0afa3c537618b52a9aefb880a83f33983005b4..36abd751ebfa64989ab09b178fe65989cb98d693 100644 --- a/HotelManagerSystemWebApi.Core/Util/CounterRuleConsts.cs +++ b/EOM.TSHotelManager.Core/Sys/NavBar/NavBar.cs @@ -4,66 +4,58 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// - /// 流水号规则常量 + /// 导航控件实体类 /// - public class CounterRuleConsts + [SqlSugar.SugarTable("nav_bar")] + public class NavBar { /// - /// 员工工号流水号规则 + /// 导航控件ID /// - public const string WorkerId = "WorkerId"; - + [SqlSugar.SugarColumn(IsIdentity =true)] + public int nav_id { get; set; } /// - /// 民族类型编号 + /// 导航控件名称 /// - public const string NationId = "NationId"; - + public string? nav_name { get; set; } /// - /// 客户类型编号 + /// 导航控件排序 /// - public const string CustoId = "CustoId"; - + public int nav_or { get; set; } /// - /// 预约编号 + /// 导航控件图片 /// - public const string ReserId = "ReserId"; - + public string? nav_pic { get; set; } /// - /// 商品编号 + /// 导航控件事件 /// - public const string SellId = "SellId"; - + public string? nav_event { get; set; } /// - /// 公告编号 + /// 导航控件事件 /// - public const string NoticeId = "NoticeId"; - + public int margin_left { get; set; } /// - /// 资产编号 + /// 删除标记 /// - public const string CashInfo = "CashInfo"; - + public int delete_mk { get; set; } /// - /// 部门编号 + /// 新增人 /// - public const string DeptInfo = "DeptInfo"; - + public string? datains_usr { get; set; } /// - /// 学历编号 + /// 新增时间 /// - public const string EducationId = "EducationId"; - + public DateTime datains_date { get; set; } /// - /// 职位编号 + /// 修改人 /// - public const string PositionId = "PositionId"; - + public string? datachg_usr { get; set; } /// - /// 会员等级类型编号 + /// 修改时间 /// - public const string VipRuleId = "VipRuleId"; + public DateTime datachg_date { get; set; } } } diff --git a/HotelManagerSystemWebApi.Core/Worker/GBType.cs b/EOM.TSHotelManager.Core/Worker/GBType.cs similarity index 86% rename from HotelManagerSystemWebApi.Core/Worker/GBType.cs rename to EOM.TSHotelManager.Core/Worker/GBType.cs index 56101d211370b6dda7ccc1ae73f5487a02b8c8a3..32858c612168e346181f95fe2a3e71a86ead5d6e 100644 --- a/HotelManagerSystemWebApi.Core/Worker/GBType.cs +++ b/EOM.TSHotelManager.Core/Worker/GBType.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -23,14 +23,13 @@ *模块说明:奖惩类型类 */ using System; -using System.ComponentModel.DataAnnotations.Schema; -namespace SYS.Application +namespace EOM.TSHotelManager.Application { /// /// 奖惩类型实体类 /// - [Table("gbtype")] + [SqlSugar.SugarTable("gbtype")] public class GBType { /// @@ -41,7 +40,7 @@ namespace SYS.Application /// /// 奖惩名称 /// - public string GBName { get; set; } + public string? GBName { get; set; } /// /// 删除标记 @@ -51,7 +50,7 @@ namespace SYS.Application /// /// 资料新增人 /// - public string datains_usr { get; set; } + public string? datains_usr { get; set; } /// /// 资料新增日期 @@ -61,7 +60,7 @@ namespace SYS.Application /// /// 资料更新人 /// - public string datachg_usr { get; set; } + public string? datachg_usr { get; set; } /// /// 资料更新日期 diff --git a/HotelManagerSystemWebApi.Core/Worker/Worker.cs b/EOM.TSHotelManager.Core/Worker/Worker.cs similarity index 54% rename from HotelManagerSystemWebApi.Core/Worker/Worker.cs rename to EOM.TSHotelManager.Core/Worker/Worker.cs index f94b418b5f978ca6c14d8366c878d193a002999a..e475ecdd0eb918e08a1b617adabb9cdccc9a4ede 100644 --- a/HotelManagerSystemWebApi.Core/Worker/Worker.cs +++ b/EOM.TSHotelManager.Core/Worker/Worker.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -23,91 +23,90 @@ *模块说明:员工信息类 */ using System; -using System.ComponentModel.DataAnnotations.Schema; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 员工信息 /// - [Table("worker")] + [SqlSugar.SugarTable("worker")] public class Worker { /// /// 员工账号/工号 /// - [Column("WorkerId")] - public string WorkerId { get; set; } + [SqlSugar.SugarColumn(ColumnName = "WorkerId")] + public string? WorkerId { get; set; } /// /// 员工姓名 /// - [Column("WorkerName")] - public string WorkerName { get; set; } + [SqlSugar.SugarColumn(ColumnName = "WorkerName")] + public string? WorkerName { get; set; } /// /// 出生日期 /// - [Column("WorkerBirthday")] + [SqlSugar.SugarColumn(ColumnName = "WorkerBirthday")] public DateTime WorkerBirthday { get; set; } /// /// 员工性别 /// - [Column("WorkerSex")] + [SqlSugar.SugarColumn(ColumnName = "WorkerSex")] public int WorkerSex { get; set; } - ///// - ///// 员工性别(名称描述) - ///// - //[SqlSugar.SugarColumn(IsIgnore = true)] - //public string WorkerSexName { get; set; } + /// + /// 员工性别(名称描述) + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? WorkerSexName { get; set; } /// /// 民族类型 /// - [Column("WorkerNation")] - public string WorkerNation { get; set; } - ///// - ///// 民族名称 - ///// - //[SqlSugar.SugarColumn(IsIgnore = true)] - //public string NationName { get; set; } + [SqlSugar.SugarColumn(ColumnName = "WorkerNation")] + public string? WorkerNation { get; set; } + /// + /// 民族名称 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? NationName { get; set; } /// /// 员工电话 /// - [Column("WorkerTel")] - public string WorkerTel { get; set; } + [SqlSugar.SugarColumn(ColumnName = "WorkerTel")] + public string? WorkerTel { get; set; } /// /// 所属部门 /// - [Column("WorkerClub")] - public string WorkerClub { get; set; } - ///// - ///// 部门名称 - ///// - //[SqlSugar.SugarColumn(IsIgnore = true)] - //public string ClubName { get; set; } + [SqlSugar.SugarColumn(ColumnName = "WorkerClub")] + public string? WorkerClub { get; set; } + /// + /// 部门名称 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? ClubName { get; set; } /// /// 居住地址 /// - [Column("WorkerAddress")] - public string WorkerAddress { get; set; } + [SqlSugar.SugarColumn(ColumnName = "WorkerAddress")] + public string? WorkerAddress { get; set; } /// /// 员工职位 /// - [Column("WorkerPosition")] - public string WorkerPosition { get; set; } - ///// - ///// 职位名称 - ///// - //[SqlSugar.SugarColumn(IsIgnore = true)] - //public string PositionName { get; set; } + [SqlSugar.SugarColumn(ColumnName = "WorkerPosition")] + public string? WorkerPosition { get; set; } + /// + /// 职位名称 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? PositionName { get; set; } /// /// 证件号码 /// - [Column("CardID")] - public string CardId { get; set; } + [SqlSugar.SugarColumn(ColumnName = "CardID")] + public string? CardId { get; set; } /// /// 员工密码 /// - [Column("WorkerPwd")] - public string WorkerPwd { get; set; } + [SqlSugar.SugarColumn(IsOnlyIgnoreInsert = true)] + public string? WorkerPwd { get; set; } /// /// 员工入职时间 /// @@ -115,21 +114,21 @@ namespace HotelManagerSystemWebApi.Core /// /// 员工面貌 /// - public string WorkerFace { get; set; } - ///// - ///// 群众面貌描述 - ///// - //[SqlSugar.SugarColumn(IsIgnore = true)] - //public string FaceName { get; set; } + public string? WorkerFace { get; set; } + /// + /// 群众面貌描述 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? FaceName { get; set; } /// /// 教育程度 /// - public string WorkerEducation { get; set; } - ///// - ///// 教育程度名称 - ///// - //[SqlSugar.SugarColumn(IsIgnore = true)] - //public string EducationName { get; set; } + public string? WorkerEducation { get; set; } + /// + /// 教育程度名称 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? EducationName { get; set; } /// /// 删除标记 /// @@ -137,7 +136,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料创建人 /// - public string datains_usr { get; set; } + public string? datains_usr { get; set; } /// /// 资料创建时间 /// @@ -145,7 +144,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料更新人 /// - public string datachg_usr { get; set; } + public string? datachg_usr { get; set; } /// /// 资料更新时间 /// diff --git a/HotelManagerSystemWebApi.Core/Worker/WorkerCheck.cs b/EOM.TSHotelManager.Core/Worker/WorkerCheck.cs similarity index 75% rename from HotelManagerSystemWebApi.Core/Worker/WorkerCheck.cs rename to EOM.TSHotelManager.Core/Worker/WorkerCheck.cs index 164484747ce265e8880ba0215c2a1d2669093fb9..8e13365124f48317a05dd50e331715c741cef2f6 100644 --- a/HotelManagerSystemWebApi.Core/Worker/WorkerCheck.cs +++ b/EOM.TSHotelManager.Core/Worker/WorkerCheck.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -22,22 +22,25 @@ * *模块说明:打卡考勤类 */ -using Furion.DatabaseAccessor; using System; -using System.ComponentModel.DataAnnotations.Schema; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 员工打卡考勤 /// - [Table("workercheck")] - public class WorkerCheck:EntityBase + [SqlSugar.SugarTable("workercheck")] + public class WorkerCheck { + /// + /// 编号 + /// + [SqlSugar.SugarColumn(IsOnlyIgnoreInsert = true, IsOnlyIgnoreUpdate = true)] + public int Id { get; set; } /// /// 工号 /// - public string WorkerNo { get; set; } + public string? WorkerNo { get; set; } /// /// 打卡时间 /// @@ -45,17 +48,17 @@ namespace HotelManagerSystemWebApi.Core /// /// 打卡方式 /// - public string CheckWay { get; set; } + public string? CheckWay { get; set; } /// /// 打卡状态 /// public int CheckState { get; set; } - ///// - ///// 打卡状态 - ///// - //[SqlSugar.SugarColumn(IsIgnore = true)] - //public string CheckStateNm { get; set; } + /// + /// 打卡状态 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? CheckStateNm { get; set; } /// /// 删除标记 /// @@ -63,7 +66,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料创建人 /// - public string datains_usr { get; set; } + public string? datains_usr { get; set; } /// /// 资料创建时间 /// @@ -71,7 +74,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料更新人 /// - public string datachg_usr { get; set; } + public string? datachg_usr { get; set; } /// /// 资料更新时间 /// diff --git a/HotelManagerSystemWebApi.Core/Worker/WorkerGoodBad.cs b/EOM.TSHotelManager.Core/Worker/WorkerGoodBad.cs similarity index 71% rename from HotelManagerSystemWebApi.Core/Worker/WorkerGoodBad.cs rename to EOM.TSHotelManager.Core/Worker/WorkerGoodBad.cs index f72ed1b0af809de4138aaee759585e9e4058f66c..7714c5cfeb208fb2372eb4e5f5fdda7f856e585f 100644 --- a/HotelManagerSystemWebApi.Core/Worker/WorkerGoodBad.cs +++ b/EOM.TSHotelManager.Core/Worker/WorkerGoodBad.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -22,30 +22,33 @@ * *模块说明:员工奖惩类 */ -using Furion.DatabaseAccessor; using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 员工奖罚 /// - [Table("workergoodbad")] - public class WorkerGoodBad:EntityBase + [SqlSugar.SugarTable("workergoodbad")] + public class WorkerGoodBad { + /// + /// 编号 + /// + [SqlSugar.SugarColumn(IsOnlyIgnoreInsert = true, IsOnlyIgnoreUpdate = true)] + public int Id { get; set; } /// /// 工号 /// - public string WorkNo { get; set; } + public string? WorkNo { get; set; } /// /// 奖惩信息 /// - public string GBInfo { get; set; } + public string? GBInfo { get; set; } /// /// 奖惩类型 /// @@ -53,21 +56,21 @@ namespace HotelManagerSystemWebApi.Core /// /// 奖惩操作人 /// - public string GBOperation { get; set; } - ///// - ///// 奖惩操作人 - ///// - //[SqlSugar.SugarColumn(IsIgnore = true)] - //public string OperationName { get; set; } + public string? GBOperation { get; set; } + /// + /// 奖惩操作人 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? OperationName { get; set; } /// /// 奖惩时间 /// public DateTime GBTime { get; set; } - ///// - ///// 类型名称 - ///// - //[SqlSugar.SugarColumn(IsIgnore = true)] - //public string TypeName { get; set; } + /// + /// 类型名称 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? TypeName { get; set; } /// /// 删除标记 /// @@ -75,7 +78,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料创建人 /// - public string datains_usr { get; set; } + public string? datains_usr { get; set; } /// /// 资料创建时间 /// @@ -83,7 +86,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料更新人 /// - public string datachg_usr { get; set; } + public string? datachg_usr { get; set; } /// /// 资料更新时间 /// diff --git a/HotelManagerSystemWebApi.Core/Worker/WorkerHistory.cs b/EOM.TSHotelManager.Core/Worker/WorkerHistory.cs similarity index 78% rename from HotelManagerSystemWebApi.Core/Worker/WorkerHistory.cs rename to EOM.TSHotelManager.Core/Worker/WorkerHistory.cs index 55da25fbb683d846e30671ca758d8c4532b4e968..73fec9e0f182d7b33391b0f3561a2643520b8c7a 100644 --- a/HotelManagerSystemWebApi.Core/Worker/WorkerHistory.cs +++ b/EOM.TSHotelManager.Core/Worker/WorkerHistory.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -22,22 +22,25 @@ * *模块说明:履历类 */ -using Furion.DatabaseAccessor; using System; -using System.ComponentModel.DataAnnotations.Schema; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 员工履历 /// - [Table("workerhistory")] - public class WorkerHistory:EntityBase + [SqlSugar.SugarTable("workerhistory")] + public class WorkerHistory { + /// + /// 编号 + /// + [SqlSugar.SugarColumn(IsOnlyIgnoreInsert = true,IsOnlyIgnoreUpdate = true)] + public int Id { get; set; } /// /// 工号 /// - public string WorkerId { get; set; } + public string? WorkerId { get; set; } /// /// 开始时间 /// @@ -49,11 +52,11 @@ namespace HotelManagerSystemWebApi.Core /// /// 职位 /// - public string Position { get; set; } + public string? Position { get; set; } /// /// 公司 /// - public string Company { get; set; } + public string? Company { get; set; } /// /// 删除标记 /// @@ -61,7 +64,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料创建人 /// - public string datains_usr { get; set; } + public string? datains_usr { get; set; } /// /// 资料创建时间 /// @@ -69,7 +72,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料更新人 /// - public string datachg_usr { get; set; } + public string? datachg_usr { get; set; } /// /// 资料更新时间 /// diff --git a/HotelManagerSystemWebApi.Core/Worker/WorkerPic.cs b/EOM.TSHotelManager.Core/Worker/WorkerPic.cs similarity index 41% rename from HotelManagerSystemWebApi.Core/Worker/WorkerPic.cs rename to EOM.TSHotelManager.Core/Worker/WorkerPic.cs index 2f5f43c3bafefdf573e6cc6850e7783af0a40684..e77a6ede79101651d82e89f9eee4f4dca29b923b 100644 --- a/HotelManagerSystemWebApi.Core/Worker/WorkerPic.cs +++ b/EOM.TSHotelManager.Core/Worker/WorkerPic.cs @@ -1,29 +1,33 @@ -using Furion.DatabaseAccessor; -using System; +using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 员工照片 /// - [Table("workerpic")] - public class WorkerPic:EntityBase + [SqlSugar.SugarTable("workerpic")] + public class WorkerPic { + /// + /// 自增长流水号 + /// + [SqlSugar.SugarColumn(IsIdentity = true,ColumnName = "Id",IsPrimaryKey = true)] + public int Id { get; set; } /// /// 工号 /// - [Column("WorkerId")] - public string WorkerId { get; set; } + [SqlSugar.SugarColumn(ColumnName = "WorkerId")] + public string? WorkerId { get; set; } /// /// 照片路径 /// - [Column("Pic")] - public string Pic { get; set; } + [SqlSugar.SugarColumn(ColumnName = "Pic")] + public string? Pic { get; set; } } } diff --git a/HotelManagerSystemWebApi.Core/Util/CounterHelper.cs b/EOM.TSHotelManager.Core/Zero/Admin.cs similarity index 42% rename from HotelManagerSystemWebApi.Core/Util/CounterHelper.cs rename to EOM.TSHotelManager.Core/Zero/Admin.cs index 2a083c599ffb59f6b407a1d56d87aaba69f06460..58848ee68ed9c46270b05727b7fb2054d8c328ef 100644 --- a/HotelManagerSystemWebApi.Core/Util/CounterHelper.cs +++ b/EOM.TSHotelManager.Core/Zero/Admin.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -20,109 +20,70 @@ *OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE *SOFTWARE. * - *模块说明:流水号规则 + *模块说明:管理员实体类 */ -using SYS.Common; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// - /// 流水号规则 + /// 管理员实体类 /// - public class CounterHelper:Repository + [SqlSugar.SugarTable("admininfo")] + public class Admin { /// - /// 获取生成编号 + /// 构造函数 /// - /// - /// - public string GetNewId(string str) + public Admin() { - var count = 0; - var Str = string.Empty; - counterrule counterrule = new counterrule(); - counterrule = base.GetSingle(a => a.rule_name == str); - Str = counterrule.prefix_name + counterrule.separating_char + DateTime.Now.ToString(counterrule.custo_format) - + counterrule.number_format + counterrule.now_id; - count++; - var exe2 = base.Update(a => new counterrule() - { - now_id = counterrule.now_id + count - },a => a.rule_name == str); - return Str; } - } - - /// - /// - /// - public class counterrule - { - /// - /// - /// - public counterrule() - { - } - - private System.Int32 _rule_id; - /// - /// 规则编号 - /// - public System.Int32 rule_id { get { return this._rule_id; } set { this._rule_id = value; } } - private System.String _rule_name; /// - /// 规格名称 + /// 编号 /// - public System.String rule_name { get { return this._rule_name; } set { this._rule_name = value; } } + public int Id { get; set; } - private System.String _rule_desc; + private string? _AdminAccount; /// - /// 规则描述 + /// 管理员账号 /// - public System.String rule_desc { get { return this._rule_desc; } set { this._rule_desc = value; } } + [SqlSugar.SugarColumn(IsPrimaryKey = true)] + public string? AdminAccount { get { return this._AdminAccount; } set { this._AdminAccount = value; } } - private System.Int32? _now_id; + private string? _AdminPassword; /// - /// 当前ID + /// 管理员密码 /// - public System.Int32? now_id { get { return this._now_id; } set { this._now_id = value; } } + public string? AdminPassword { get { return this._AdminPassword; } set { this._AdminPassword = value; } } - private System.String _prefix_name; + private string? _AdminType; /// - /// 规则简写 + /// 管理员类型 /// - public System.String prefix_name { get { return this._prefix_name; } set { this._prefix_name = value; } } + public string? AdminType { get { return this._AdminType; } set { this._AdminType = value; } } - private System.String _custo_format; + private string? _AdminName; /// - /// 规则格式 + /// 管理员名称 /// - public System.String custo_format { get { return this._custo_format; } set { this._custo_format = value; } } + public string? AdminName { get { return this._AdminName; } set { this._AdminName = value; } } - private System.String _number_format; + private System.Int32 _IsAdmin; /// - /// 编号前缀 + /// 是否为超级管理员 /// - public System.String number_format { get { return this._number_format; } set { this._number_format = value; } } + public System.Int32 IsAdmin { get { return this._IsAdmin; } set { this._IsAdmin = value; } } - private System.String _separating_char; + private System.Int32 _DeleteMk; /// - /// 规则分割符 + /// 删除标记 /// - public System.String separating_char { get { return this._separating_char; } set { this._separating_char = value; } } + public System.Int32 DeleteMk { get { return this._DeleteMk; } set { this._DeleteMk = value; } } - private System.String _datains_usrid; + private string? _datains_usr; /// /// 资料新增人 /// - public System.String datains_usrid { get { return this._datains_usrid; } set { this._datains_usrid = value; } } + public string? datains_usr { get { return this._datains_usr; } set { this._datains_usr = value; } } private System.DateTime? _datains_time; /// @@ -130,16 +91,35 @@ namespace HotelManagerSystemWebApi.Core /// public System.DateTime? datains_time { get { return this._datains_time; } set { this._datains_time = value; } } - private System.String _datachg_usrid; + private string? _datachg_usr; /// /// 资料更新人 /// - public System.String datachg_usrid { get { return this._datachg_usrid; } set { this._datachg_usrid = value; } } + public string? datachg_usr { get { return this._datachg_usr; } set { this._datachg_usr = value; } } private System.DateTime? _datachg_time; /// /// 资料更新时间 /// public System.DateTime? datachg_time { get { return this._datachg_time; } set { this._datachg_time = value; } } + + /// + /// 管理员类型描述 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? IsAdminNm { get; set; } + + /// + /// 管理员类型 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? TypeName { get; set; } + + /// + /// 删除标记描述 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? DeleteNm { get; set; } + } } diff --git a/HotelManagerSystemWebApi.Core/Zero/AdminType.cs b/EOM.TSHotelManager.Core/Zero/AdminType.cs similarity index 82% rename from HotelManagerSystemWebApi.Core/Zero/AdminType.cs rename to EOM.TSHotelManager.Core/Zero/AdminType.cs index c975b6afcdddddf1c52ffe6aa2995bcb1380b933..9eb2e5da2f733da7fe3b6db461b34bf62c2f49f9 100644 --- a/HotelManagerSystemWebApi.Core/Zero/AdminType.cs +++ b/EOM.TSHotelManager.Core/Zero/AdminType.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -22,21 +22,19 @@ * *模块说明:管理员类型 */ -using Furion.DatabaseAccessor; using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 管理员类型 /// - [Table("admintype")] - public class AdminType:IEntity + [SqlSugar.SugarTable("admintype")] + public class AdminType { /// /// 编号 @@ -46,12 +44,12 @@ namespace HotelManagerSystemWebApi.Core /// /// 管理员类型 /// - public string type_id { get; set; } + public string? type_id { get; set; } /// /// 类型名称 /// - public string type_name { get; set; } + public string? type_name { get; set; } /// /// 删除标记 @@ -61,7 +59,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 新增人 /// - public string datains_usr { get; set; } + public string? datains_usr { get; set; } /// /// 新增时间 /// @@ -69,7 +67,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 修改人 /// - public string datachg_usr { get; set; } + public string? datachg_usr { get; set; } /// /// 修改时间 /// diff --git a/HotelManagerSystemWebApi.Core/Zero/Base.cs b/EOM.TSHotelManager.Core/Zero/Base.cs similarity index 86% rename from HotelManagerSystemWebApi.Core/Zero/Base.cs rename to EOM.TSHotelManager.Core/Zero/Base.cs index 3c119dbd4bc44d432815f2f3cfdb52750e2eb26d..d89ea14d0f1046e44b5c2bf0a1debfa26e811f4f 100644 --- a/HotelManagerSystemWebApi.Core/Zero/Base.cs +++ b/EOM.TSHotelManager.Core/Zero/Base.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -24,14 +24,16 @@ */ using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { - [Table("base")] + /// + /// 系统信息 + /// + [SqlSugar.SugarTable("base")] public class Base { /// @@ -42,6 +44,6 @@ namespace HotelManagerSystemWebApi.Core /// /// 地址 /// - public string url_addr { get; set; } + public string? url_addr { get; set; } } } diff --git a/HotelManagerSystemWebApi.Core/Zero/CheckInfo.cs b/EOM.TSHotelManager.Core/Zero/CheckInfo.cs similarity index 78% rename from HotelManagerSystemWebApi.Core/Zero/CheckInfo.cs rename to EOM.TSHotelManager.Core/Zero/CheckInfo.cs index bda798a72030579965ccf25b0ae84836fd8c9c2b..be947cf9fd6dcedd01425a001afc1a91c165b4df 100644 --- a/HotelManagerSystemWebApi.Core/Zero/CheckInfo.cs +++ b/EOM.TSHotelManager.Core/Zero/CheckInfo.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -22,34 +22,32 @@ * *模块说明:监管统计类 */ -using Furion.DatabaseAccessor; using System; -using System.ComponentModel.DataAnnotations.Schema; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 监管统计 /// - [Table("checkinfo")] - public class CheckInfo : IEntity + [SqlSugar.SugarTable("checkinfo")] + public class CheckInfo { /// /// 监管统计编号 /// - public string CheckNo { get; set; } + public string? CheckNo { get; set; } /// /// 监管部门 /// - public string CheckClub { get; set; } + public string? CheckClub { get; set; } /// /// 监管进度 /// - public string CheckProgres { get; set; } + public string? CheckProgres { get; set; } /// /// /// - public string CheckCash { get; set; } + public string? CheckCash { get; set; } /// /// /// @@ -57,11 +55,11 @@ namespace HotelManagerSystemWebApi.Core /// /// /// - public string CheckPerson { get; set; } + public string? CheckPerson { get; set; } /// /// /// - public string CheckAdvice { get; set; } + public string? CheckAdvice { get; set; } /// /// 删除标记 @@ -70,7 +68,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料创建人 /// - public string datains_usr { get; set; } + public string? datains_usr { get; set; } /// /// 资料创建时间 /// @@ -78,7 +76,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料更新人 /// - public string datachg_usr { get; set; } + public string? datachg_usr { get; set; } /// /// 资料更新时间 /// diff --git a/HotelManagerSystemWebApi.Core/Zero/Dept.cs b/EOM.TSHotelManager.Core/Zero/Dept.cs similarity index 73% rename from HotelManagerSystemWebApi.Core/Zero/Dept.cs rename to EOM.TSHotelManager.Core/Zero/Dept.cs index a07b9215f52cd8b4355a010f8e20d3d117b7255d..e7145c9a908a30609483a5760649f4d5e3dabad1 100644 --- a/HotelManagerSystemWebApi.Core/Zero/Dept.cs +++ b/EOM.TSHotelManager.Core/Zero/Dept.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -24,31 +24,30 @@ */ using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 部门表 /// - [Table("dept")] + [SqlSugar.SugarTable("dept")] public class Dept { /// /// 部门编号 /// - public string dept_no { get; set; } + public string? dept_no { get; set; } /// /// 部门名称 /// - public string dept_name { get; set; } + public string? dept_name { get; set; } /// /// 部门描述 /// - public string dept_desc { get; set; } + public string? dept_desc { get; set; } /// /// 创建时间(部门) /// @@ -56,21 +55,21 @@ namespace HotelManagerSystemWebApi.Core /// /// 部门主管 /// - public string dept_leader { get; set; } - ///// - ///// 部门主管 - ///// - //[SqlSugar.SugarColumn(IsIgnore = true)] - //public string leader_name { get; set; } + public string? dept_leader { get; set; } + /// + /// 部门主管 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? leader_name { get; set; } + /// + /// 上级部门 + /// + public string? dept_parent { get; set; } /// /// 上级部门 /// - public string dept_parent { get; set; } - ///// - ///// 上级部门 - ///// - //[SqlSugar.SugarColumn(IsIgnore = true)] - //public string parent_name { get; set; } + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? parent_name { get; set; } /// /// 删除标记 /// @@ -78,7 +77,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料创建人 /// - public string datains_usr { get; set; } + public string? datains_usr { get; set; } /// /// 资料创建时间 /// @@ -86,7 +85,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料更新人 /// - public string datachg_usr { get; set; } + public string? datachg_usr { get; set; } /// /// 资料更新时间 /// diff --git a/HotelManagerSystemWebApi.Core/Zero/Education.cs b/EOM.TSHotelManager.Core/Zero/Education.cs similarity index 84% rename from HotelManagerSystemWebApi.Core/Zero/Education.cs rename to EOM.TSHotelManager.Core/Zero/Education.cs index 7baf32f73634e5c7f388fdbcee96740a4271154f..c7011eb743920c3dc216227408aae72587fd3873 100644 --- a/HotelManagerSystemWebApi.Core/Zero/Education.cs +++ b/EOM.TSHotelManager.Core/Zero/Education.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -24,27 +24,26 @@ */ using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 学历 /// - [Table("education")] + [SqlSugar.SugarTable("education")] public class Education { /// /// 学历编号 /// - public string education_no { get; set; } + public string? education_no { get; set; } /// /// 学历名称 /// - public string education_name { get; set; } + public string? education_name { get; set; } /// /// 删除标记 /// @@ -52,7 +51,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料创建人 /// - public string datains_usr { get; set; } + public string? datains_usr { get; set; } /// /// 资料创建时间 /// @@ -60,7 +59,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料更新人 /// - public string datachg_usr { get; set; } + public string? datachg_usr { get; set; } /// /// 资料更新时间 /// diff --git a/HotelManagerSystemWebApi.Core/Zero/Module.cs b/EOM.TSHotelManager.Core/Zero/Module.cs similarity index 76% rename from HotelManagerSystemWebApi.Core/Zero/Module.cs rename to EOM.TSHotelManager.Core/Zero/Module.cs index 4e7b6770f02c2b6037367abcd45c78ec17cbe7eb..5e6b9e1981e3e6a4f84419c7ac33b3f67030c305 100644 --- a/HotelManagerSystemWebApi.Core/Zero/Module.cs +++ b/EOM.TSHotelManager.Core/Zero/Module.cs @@ -1,16 +1,15 @@ using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 模块实体 /// - [Table("module")] + [SqlSugar.SugarTable("module")] public class Module { /// @@ -21,12 +20,12 @@ namespace HotelManagerSystemWebApi.Core /// /// 模块名称 /// - public string module_name { get; set; } + public string? module_name { get; set; } /// /// 模块描述 /// - public string module_desc { get; set; } + public string? module_desc { get; set; } /// /// 删除标记 @@ -36,7 +35,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料创建人 /// - public string datains_usr { get; set; } + public string? datains_usr { get; set; } /// /// 资料创建时间 @@ -46,7 +45,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料更新人 /// - public string datachg_usr { get; set; } + public string? datachg_usr { get; set; } /// /// 资料更新时间 diff --git a/HotelManagerSystemWebApi.Core/Zero/ModuleConsts.cs b/EOM.TSHotelManager.Core/Zero/ModuleConsts.cs similarity index 74% rename from HotelManagerSystemWebApi.Core/Zero/ModuleConsts.cs rename to EOM.TSHotelManager.Core/Zero/ModuleConsts.cs index afe62e572ae2a81c6c63ed8f8716c982144c9655..45ce18097b8b70ac2f296f5fd269ed0d6c2f4b08 100644 --- a/HotelManagerSystemWebApi.Core/Zero/ModuleConsts.cs +++ b/EOM.TSHotelManager.Core/Zero/ModuleConsts.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -28,7 +28,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 系统模块常量类 @@ -38,42 +38,42 @@ namespace HotelManagerSystemWebApi.Core /// /// 基础信息 /// - public const string BaseInfo = "BaseInfo"; + public const string? BaseInfo = "BaseInfo"; /// /// 财务信息 /// - public const string CashInfo = "CashInfo"; + public const string? CashInfo = "CashInfo"; /// /// 水电管理 /// - public const string WtiInfo = "WtiInfo"; + public const string? WtiInfo = "WtiInfo"; /// /// 监管统计 /// - public const string CheckInfo = "CheckInfo"; + public const string? CheckInfo = "CheckInfo"; /// /// 客房管理 /// - public const string RoomManager = "RoomManager"; + public const string? RoomManager = "RoomManager"; /// /// 客户管理 /// - public const string CustomerManager = "CustomerManager"; + public const string? CustomerManager = "CustomerManager"; /// /// 人事管理 /// - public const string HumanResourcesManager = "HumanResourcesManager"; + public const string? HumanResourcesManager = "HumanResourcesManager"; /// /// 物资管理 /// - public const string MaterialManager = "MaterialManager"; + public const string? MaterialManager = "MaterialManager"; /// /// 员工操作日志 /// - public const string OperationLogManager = "OperationLogManager"; + public const string? OperationLogManager = "OperationLogManager"; /// /// 系统管理 /// - public const string AdminManager = "AdminManager"; + public const string? AdminManager = "AdminManager"; } } diff --git a/HotelManagerSystemWebApi.Core/Zero/ModuleZero.cs b/EOM.TSHotelManager.Core/Zero/ModuleZero.cs similarity index 57% rename from HotelManagerSystemWebApi.Core/Zero/ModuleZero.cs rename to EOM.TSHotelManager.Core/Zero/ModuleZero.cs index f81e3ada8cdf80f286aeb6766f6e8aa28cdcabb5..7c7e3d9a2c4aa0af0ae4c4b83a3d86e6720792a0 100644 --- a/HotelManagerSystemWebApi.Core/Zero/ModuleZero.cs +++ b/EOM.TSHotelManager.Core/Zero/ModuleZero.cs @@ -1,37 +1,37 @@ using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 模块权限表 /// - [Table("module_zero")] + [SqlSugar.SugarTable("module_zero")] public class ModuleZero { /// /// 模块ID /// + [SqlSugar.SugarColumn(IsIdentity = true,ColumnName = "module_id")] public int module_id { get; set; } /// /// 管理员账号 /// - [Column("admin_account")] - public string admin_account { get; set; } + [SqlSugar.SugarColumn(ColumnName = "admin_account")] + public string? admin_account { get; set; } /// /// 模块名称 /// - [Column("module_name")] - public string module_name { get; set; } + [SqlSugar.SugarColumn(ColumnName = "module_name")] + public string? module_name { get; set; } /// /// 是否开启 /// - [Column("module_enable")] + [SqlSugar.SugarColumn(ColumnName = "module_enable")] public int module_enable { get; set; } } } diff --git a/HotelManagerSystemWebApi.Core/Zero/Nation.cs b/EOM.TSHotelManager.Core/Zero/Nation.cs similarity index 84% rename from HotelManagerSystemWebApi.Core/Zero/Nation.cs rename to EOM.TSHotelManager.Core/Zero/Nation.cs index a0d876a67fcfad4c39af5fa00cae54c26285c1b2..d67a5524ad1bc69b57b485479c3c227498838496 100644 --- a/HotelManagerSystemWebApi.Core/Zero/Nation.cs +++ b/EOM.TSHotelManager.Core/Zero/Nation.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -24,27 +24,26 @@ */ using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 民族 /// - [Table("nation")] + [SqlSugar.SugarTable("nation")] public class Nation { /// /// 民族编号 /// - public string nation_no { get; set; } + public string? nation_no { get; set; } /// /// 民族名称 /// - public string nation_name { get; set; } + public string? nation_name { get; set; } /// /// 删除标记 /// @@ -52,7 +51,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料创建人 /// - public string datains_usr { get; set; } + public string? datains_usr { get; set; } /// /// 资料创建时间 /// @@ -60,7 +59,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料更新人 /// - public string datachg_usr { get; set; } + public string? datachg_usr { get; set; } /// /// 资料更新时间 /// diff --git a/HotelManagerSystemWebApi.Core/Zero/Notice.cs b/EOM.TSHotelManager.Core/Zero/Notice.cs similarity index 67% rename from HotelManagerSystemWebApi.Core/Zero/Notice.cs rename to EOM.TSHotelManager.Core/Zero/Notice.cs index a02f687d70886501ef044d4462b296308164190d..69b8076f201c3bb9fc82d9778b19be3de6d0ca37 100644 --- a/HotelManagerSystemWebApi.Core/Zero/Notice.cs +++ b/EOM.TSHotelManager.Core/Zero/Notice.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -23,60 +23,59 @@ *模块说明:任命公告类 */ using System; -using System.ComponentModel.DataAnnotations.Schema; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 任命公告 /// - [Table("uploadinfo")] + [SqlSugar.SugarTable("uploadinfo")] public class Notice { /// /// 公告编号 /// - [Column("NoticeNo")] - public string NoticeNo { get; set; } + [SqlSugar.SugarColumn(ColumnName = "NoticeNo")] + public string? NoticeNo { get; set; } /// /// 公告主题 /// - [Column("Noticetheme")] - public string Noticetheme { get; set; } + [SqlSugar.SugarColumn(ColumnName = "Noticetheme")] + public string? Noticetheme { get; set; } /// /// 公告类型 /// - [Column("NoticeType")] - public string NoticeType { get; set; } - ///// - ///// 公告类型(描述) - ///// - //[SqlSugar.SugarColumn(IsIgnore = true)] - //public string NoticeTypeName { get; set; } + [SqlSugar.SugarColumn(ColumnName = "NoticeType")] + public string? NoticeType { get; set; } + /// + /// 公告类型(描述) + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? NoticeTypeName { get; set; } /// /// 公告时间 /// - [Column("NoticeTime")] + [SqlSugar.SugarColumn(ColumnName = "NoticeTime")] public DateTime NoticeTime { get; set; } /// /// 公告正文 /// - [Column("NoticeContent")] - public string NoticeContent { get; set; } + [SqlSugar.SugarColumn(ColumnName = "NoticeContent")] + public string? NoticeContent { get; set; } /// /// 发文部门 /// - [Column("NoticeClub")] - public string NoticeClub { get; set; } + [SqlSugar.SugarColumn(ColumnName = "NoticeClub")] + public string? NoticeClub { get; set; } /// /// 删除标记 /// - [Column("delete_mk")] + [SqlSugar.SugarColumn(ColumnName = "delete_mk")] public int delete_mk { get; set; } /// /// 资料创建人 /// - public string datains_usr { get; set; } + public string? datains_usr { get; set; } /// /// 资料创建时间 /// @@ -84,7 +83,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料更新人 /// - public string datachg_usr { get; set; } + public string? datachg_usr { get; set; } /// /// 资料更新时间 /// diff --git a/HotelManagerSystemWebApi.Core/Zero/VipRule.cs b/EOM.TSHotelManager.Core/Zero/VipRule.cs similarity index 79% rename from HotelManagerSystemWebApi.Core/Zero/VipRule.cs rename to EOM.TSHotelManager.Core/Zero/VipRule.cs index f7739164c44bd10d3c6b9b1b0f1e5ae4b62ce2e0..b4d6d9bd7b9d34381eebdc19d08ac21ea4ff368b 100644 --- a/HotelManagerSystemWebApi.Core/Zero/VipRule.cs +++ b/EOM.TSHotelManager.Core/Zero/VipRule.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -22,21 +22,19 @@ * *模块说明:会员等级规则类 */ -using Furion.DatabaseAccessor; using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 会员等级规则类 /// - [Table("vip_rule")] - public class VipRule:IEntity + [SqlSugar.SugarTable("vip_rule")] + public class VipRule { /// /// 索引ID @@ -46,12 +44,12 @@ namespace HotelManagerSystemWebApi.Core /// /// 会员规则流水号 /// - public string rule_id { get; set; } + public string? rule_id { get; set; } /// /// 会员规则名称 /// - public string rule_name { get; set; } + public string? rule_name { get; set; } /// /// 预设数值(历史消费总额) @@ -70,7 +68,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 新增人 /// - public string datains_usr { get; set; } + public string? datains_usr { get; set; } /// /// 新增时间 @@ -79,16 +77,16 @@ namespace HotelManagerSystemWebApi.Core /// /// 修改人 /// - public string datachg_usr { get; set; } + public string? datachg_usr { get; set; } /// /// 修改时间 /// public DateTime datachg_date { get; set; } - ///// - ///// 会员等级描述 - ///// - //[SqlSugar.SugarColumn(IsIgnore = true)] - //public string type_name { get; set; } + /// + /// 会员等级描述 + /// + [SqlSugar.SugarColumn(IsIgnore = true)] + public string? type_name { get; set; } } } diff --git a/HotelManagerSystemWebApi.Core/Zero/position.cs b/EOM.TSHotelManager.Core/Zero/position.cs similarity index 84% rename from HotelManagerSystemWebApi.Core/Zero/position.cs rename to EOM.TSHotelManager.Core/Zero/position.cs index 503feffbe6484768a991852e610e3d217d6c310d..c8ac2dcf636b51e338c0fb2116bc038f5131920a 100644 --- a/HotelManagerSystemWebApi.Core/Zero/position.cs +++ b/EOM.TSHotelManager.Core/Zero/position.cs @@ -1,6 +1,6 @@ /* * MIT License - *Copyright (c) 2021 咖啡与网络(java-and-net) + *Copyright (c) 2021 易开元(Easy-Open-Meta) *Permission is hereby granted, free of charge, to any person obtaining a copy *of this software and associated documentation files (the "Software"), to deal @@ -24,27 +24,26 @@ */ using System; using System.Collections.Generic; -using System.ComponentModel.DataAnnotations.Schema; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace HotelManagerSystemWebApi.Core +namespace EOM.TSHotelManager.Core { /// /// 职位 /// - [Table("position")] + [SqlSugar.SugarTable("position")] public class Position { /// /// 职位编号 /// - public string position_no { get; set; } + public string? position_no { get; set; } /// /// 职位名称 /// - public string position_name { get; set; } + public string? position_name { get; set; } /// /// 删除标记 /// @@ -52,7 +51,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料创建人 /// - public string datains_usr { get; set; } + public string? datains_usr { get; set; } /// /// 资料创建时间 /// @@ -60,7 +59,7 @@ namespace HotelManagerSystemWebApi.Core /// /// 资料更新人 /// - public string datachg_usr { get; set; } + public string? datachg_usr { get; set; } /// /// 资料更新时间 /// diff --git a/EOM.TSHotelManager.EntityFramework/AppSettingsJson.cs b/EOM.TSHotelManager.EntityFramework/AppSettingsJson.cs new file mode 100644 index 0000000000000000000000000000000000000000..ce283c51780d1efc7d2714c77f6440b45e45f642 --- /dev/null +++ b/EOM.TSHotelManager.EntityFramework/AppSettingsJson.cs @@ -0,0 +1,28 @@ +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 +{ + public class AppSettingsJson + { + public static string? ApplicationExeDirectory() + { + var location = System.Reflection.Assembly.GetExecutingAssembly().Location; + var appRoot = Path.GetDirectoryName(location); + return appRoot; + } + public static IConfigurationRoot GetAppSettings() + { + string? applicationExeDirectory = ApplicationExeDirectory(); + var builder = new ConfigurationBuilder() + .SetBasePath(applicationExeDirectory) + .AddJsonFile("dbsettings.json"); + return builder.Build(); + } + } +} diff --git a/HotelManagerSystemWebApi.EntityFramework.Core/HotelManagerSystemWebApi.EntityFramework.Core.csproj b/EOM.TSHotelManager.EntityFramework/EOM.TSHotelManager.EntityFramework.csproj similarity index 41% rename from HotelManagerSystemWebApi.EntityFramework.Core/HotelManagerSystemWebApi.EntityFramework.Core.csproj rename to EOM.TSHotelManager.EntityFramework/EOM.TSHotelManager.EntityFramework.csproj index 95944c0e319890024322183ee8c47de5e80e672f..897bc58f77994cca21a9cde34d670812a31bbac6 100644 --- a/HotelManagerSystemWebApi.EntityFramework.Core/HotelManagerSystemWebApi.EntityFramework.Core.csproj +++ b/EOM.TSHotelManager.EntityFramework/EOM.TSHotelManager.EntityFramework.csproj @@ -1,12 +1,13 @@ - + - net5.0 + net6.0 + enable + enable - @@ -16,11 +17,13 @@ - + + + - + diff --git a/EOM.TSHotelManager.EntityFramework/Repository/PgRepository.cs b/EOM.TSHotelManager.EntityFramework/Repository/PgRepository.cs new file mode 100644 index 0000000000000000000000000000000000000000..42774851d5c2d7fb26c0099ddab97a3fb35c2396 --- /dev/null +++ b/EOM.TSHotelManager.EntityFramework/Repository/PgRepository.cs @@ -0,0 +1,41 @@ +using SqlSugar; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.Extensions.Configuration; + +namespace EOM.TSHotelManager.EntityFramework +{ + public class PgRepository : SimpleClient where T : class, new() + { + public PgRepository(ISqlSugarClient context = null) : base(context)//注意这里要有默认值等于null + { + if (context == null) + { + base.Context = new SqlSugarClient(new ConnectionConfig() + { + DbType = SqlSugar.DbType.PostgreSQL,//此处为设置数据库,支持各大主流数据库 + InitKeyType = InitKeyType.Attribute,//此处为初始化配置类型,有按特性进行初始化,也有其他的进行初始化 + IsAutoCloseConnection = true,//此处为是否自动关闭数据库连接,可以理解为是DBHelper里的Close()方法 + MoreSettings = new ConnMoreSettings() + { + PgSqlIsAutoToLower = false, //数据库存在大写字段的 + //,需要把这个设为false ,并且实体和字段名称要一样 + //如果数据库里的数据表本身就为小写,则改成true + //详细可以参考官网https://www.donet5.com/Home/Doc + }, + ConnectionString = AppSettingsJson.GetAppSettings().GetConnectionString("PgSqlConnectStr") + }); + + base.Context.Aop.OnError = (ex) => + { + //此处为AOP切面编程代码块,常用于数据库连接日志记录 + //或者查看详细的报错信息,打印ex的内容即可 + }; + } + } + + } +} diff --git a/EOM.TSHotelManager.EntityFramework/dbsettings.json b/EOM.TSHotelManager.EntityFramework/dbsettings.json new file mode 100644 index 0000000000000000000000000000000000000000..96ef3f1225f9bc83185d17d286a1dfd6706f147d --- /dev/null +++ b/EOM.TSHotelManager.EntityFramework/dbsettings.json @@ -0,0 +1,5 @@ +{ + "ConnectionStrings": { + "PgSqlConnectStr": "PORT=5630;DATABASE=tshoteldb;HOST=localhost;PASSWORD=yjj0720.;USER ID=sqw" + } +} diff --git a/EOM.TSHotelManager.Web.sln b/EOM.TSHotelManager.Web.sln new file mode 100644 index 0000000000000000000000000000000000000000..2ec582156fb11ddee373083b1d31b7fc68ebf698 --- /dev/null +++ b/EOM.TSHotelManager.Web.sln @@ -0,0 +1,55 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.3.32922.545 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOM.TSHotelManager.Core", "EOM.TSHotelManager.Core\EOM.TSHotelManager.Core.csproj", "{FDC49899-865F-4DBB-AF9C-576D8BF68897}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOM.TSHotelManager.EntityFramework", "EOM.TSHotelManager.EntityFramework\EOM.TSHotelManager.EntityFramework.csproj", "{B0415048-E431-4FCF-9CF7-C1345C6F7750}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOM.TSHotelManager.Application", "EOM.TSHotelManager.Application\EOM.TSHotelManager.Application.csproj", "{FE75A00A-4B07-49CE-8F17-F483044A569A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EOM.TSHotelManager.WebApi", "EOM.TSHotelManager.WebApi\EOM.TSHotelManager.WebApi.csproj", "{4E6141F1-5096-46AB-AF4F-6BB6F348366C}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Library", "Library\Library.csproj", "{F27A7D1A-6468-4689-8B83-53CE3B7B0E17}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EOM.TSHotelManager.Common", "EOM.TSHotelManager.Common\EOM.TSHotelManager.Common.csproj", "{D3506829-1B8B-4DC7-A44A-DE672A90DE05}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FDC49899-865F-4DBB-AF9C-576D8BF68897}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FDC49899-865F-4DBB-AF9C-576D8BF68897}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FDC49899-865F-4DBB-AF9C-576D8BF68897}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FDC49899-865F-4DBB-AF9C-576D8BF68897}.Release|Any CPU.Build.0 = Release|Any CPU + {B0415048-E431-4FCF-9CF7-C1345C6F7750}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0415048-E431-4FCF-9CF7-C1345C6F7750}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0415048-E431-4FCF-9CF7-C1345C6F7750}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0415048-E431-4FCF-9CF7-C1345C6F7750}.Release|Any CPU.Build.0 = Release|Any CPU + {FE75A00A-4B07-49CE-8F17-F483044A569A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FE75A00A-4B07-49CE-8F17-F483044A569A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FE75A00A-4B07-49CE-8F17-F483044A569A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FE75A00A-4B07-49CE-8F17-F483044A569A}.Release|Any CPU.Build.0 = Release|Any CPU + {4E6141F1-5096-46AB-AF4F-6BB6F348366C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4E6141F1-5096-46AB-AF4F-6BB6F348366C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4E6141F1-5096-46AB-AF4F-6BB6F348366C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4E6141F1-5096-46AB-AF4F-6BB6F348366C}.Release|Any CPU.Build.0 = Release|Any CPU + {F27A7D1A-6468-4689-8B83-53CE3B7B0E17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F27A7D1A-6468-4689-8B83-53CE3B7B0E17}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F27A7D1A-6468-4689-8B83-53CE3B7B0E17}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F27A7D1A-6468-4689-8B83-53CE3B7B0E17}.Release|Any CPU.Build.0 = Release|Any CPU + {D3506829-1B8B-4DC7-A44A-DE672A90DE05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D3506829-1B8B-4DC7-A44A-DE672A90DE05}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D3506829-1B8B-4DC7-A44A-DE672A90DE05}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D3506829-1B8B-4DC7-A44A-DE672A90DE05}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {AD202AAD-1D93-4B16-84FE-CE52283EAB41} + EndGlobalSection +EndGlobal diff --git a/EOM.TSHotelManager.WebApi/.config/dotnet-tools.json b/EOM.TSHotelManager.WebApi/.config/dotnet-tools.json new file mode 100644 index 0000000000000000000000000000000000000000..43a4368a7de95b2f94dbcbc3073029fec3ec355c --- /dev/null +++ b/EOM.TSHotelManager.WebApi/.config/dotnet-tools.json @@ -0,0 +1,12 @@ +{ + "version": 1, + "isRoot": true, + "tools": { + "dotnet-ef": { + "version": "7.0.1", + "commands": [ + "dotnet-ef" + ] + } + } +} \ No newline at end of file diff --git a/EOM.TSHotelManager.WebApi/Controllers/Business/Cash/CashController.cs b/EOM.TSHotelManager.WebApi/Controllers/Business/Cash/CashController.cs new file mode 100644 index 0000000000000000000000000000000000000000..852a3de8d34c48defe3093f4c7286bedcdc74f00 --- /dev/null +++ b/EOM.TSHotelManager.WebApi/Controllers/Business/Cash/CashController.cs @@ -0,0 +1,50 @@ +using EOM.TSHotelManager.Application; +using EOM.TSHotelManager.Core; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.WebApi.Controllers +{ + /// + /// 资产信息控制器 + /// + public class CashController : ControllerBase + { + /// + /// 资产信息 + /// + private readonly ICashService cashService; + + /// + /// + /// + /// + public CashController(ICashService cashService) + { + this.cashService = cashService; + } + + /// + /// 添加资产信息 + /// + /// + /// + [HttpPost] + public bool AddCashInfo([FromBody]Cash cash) + { + return cashService.AddCashInfo(cash); + } + + /// + /// 查询资产信息 + /// + /// + [HttpGet] + public List SelectCashInfoAll() + { + return cashService.SelectCashInfoAll(); + } + + } +} diff --git a/EOM.TSHotelManager.WebApi/Controllers/Business/Customer/CustoController.cs b/EOM.TSHotelManager.WebApi/Controllers/Business/Customer/CustoController.cs new file mode 100644 index 0000000000000000000000000000000000000000..532505258193c3e18aff84c9c600c7a264af6614 --- /dev/null +++ b/EOM.TSHotelManager.WebApi/Controllers/Business/Customer/CustoController.cs @@ -0,0 +1,104 @@ +using EOM.TSHotelManager.Application; +using EOM.TSHotelManager.Core; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.WebApi.Controllers +{ + /// + /// 用户信息控制器 + /// + public class CustoController : ControllerBase + { + /// + /// 用户信息 + /// + private readonly ICustoService customerService; + + /// + /// + /// + /// + public CustoController(ICustoService customerService) + { + this.customerService = customerService; + } + + /// + /// 添加客户信息 + /// + /// + /// + [HttpPost] + public bool InsertCustomerInfo([FromBody]Custo custo) + { + return customerService.InsertCustomerInfo(custo); + } + + /// + /// 更新客户信息 + /// + /// + /// + [HttpPost] + public bool UpdCustomerInfoByCustoNo([FromBody]Custo custo) + { + return customerService.UpdCustomerInfoByCustoNo(custo); + } + + /// + /// 更新客户类型(即会员等级) + /// + /// + /// + /// + [HttpPost] + public bool UpdCustomerTypeByCustoNo([FromBody] string? custoNo, int userType) + { + return customerService.UpdCustomerTypeByCustoNo(custoNo, userType); + } + + /// + /// 查询酒店盈利情况 + /// + /// + [HttpGet] + public List SelectAllMoney() + { + return customerService.SelectAllMoney(); + } + + /// + /// 查询所有客户信息 + /// + /// + [HttpGet] + public OSelectCustoAllDto SelectCustoAll([FromQuery]int? pageIndex, int? pageSize) + { + return customerService.SelectCustoAll(pageIndex,pageSize); + } + + /// + /// 查询指定客户信息 + /// + /// + [HttpGet] + public List SelectCustoByInfo([FromQuery] Custo custo) + { + return customerService.SelectCustoByInfo(custo); + } + + /// + /// 根据客户编号查询客户信息 + /// + /// + /// + [HttpGet] + public Custo SelectCardInfoByCustoNo([FromQuery] string? CustoNo) + { + return customerService.SelectCardInfoByCustoNo(CustoNo); + } + + } +} diff --git a/EOM.TSHotelManager.WebApi/Controllers/Business/Fonts/FontsController.cs b/EOM.TSHotelManager.WebApi/Controllers/Business/Fonts/FontsController.cs new file mode 100644 index 0000000000000000000000000000000000000000..9c599ef68da55ca26c24f60e36bbd532079ed6e0 --- /dev/null +++ b/EOM.TSHotelManager.WebApi/Controllers/Business/Fonts/FontsController.cs @@ -0,0 +1,38 @@ +using EOM.TSHotelManager.Application; +using EOM.TSHotelManager.Core; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.WebApi.Controllers +{ + /// + /// 酒店宣传联动内容控制器 + /// + public class FontsController : ControllerBase + { + /// + /// 酒店宣传联动内容 + /// + private readonly IFontsService fontsService; + + /// + /// + /// + /// + public FontsController(IFontsService fontsService) + { + this.fontsService = fontsService; + } + + /// + /// 查询所有宣传联动内容(跑马灯) + /// + /// + [HttpGet] + public List SelectFontAll() + { + return fontsService.SelectFontAll(); + } + } +} diff --git a/EOM.TSHotelManager.WebApi/Controllers/Business/Reser/ReserController.cs b/EOM.TSHotelManager.WebApi/Controllers/Business/Reser/ReserController.cs new file mode 100644 index 0000000000000000000000000000000000000000..fd0ae4da4a0f1874bc390ec809d989ed708dfbf5 --- /dev/null +++ b/EOM.TSHotelManager.WebApi/Controllers/Business/Reser/ReserController.cs @@ -0,0 +1,72 @@ +using EOM.TSHotelManager.Application; +using EOM.TSHotelManager.Core; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; +using System.Security.Cryptography; + +namespace EOM.TSHotelManager.WebApi.Controllers +{ + /// + /// 预约信息控制器 + /// + public class ReserController : ControllerBase + { + /// + /// 预约信息 + /// + private readonly IReserService reserService; + + /// + /// + /// + /// + public ReserController(IReserService reserService) + { + this.reserService = reserService; + } + + /// + /// 获取所有预约信息 + /// + /// + [HttpGet] + public List SelectReserAll() + { + return reserService.SelectReserAll(); + } + + /// + /// 根据房间编号获取预约信息 + /// + /// + /// + [HttpGet] + public Reser SelectReserInfoByRoomNo([FromQuery]string? no) + { + return reserService.SelectReserInfoByRoomNo(no); + } + + /// + /// 删除预约信息 + /// + /// + /// + [HttpPost] + public bool DeleteReserInfo([FromBody]string? rid) + { + return reserService.DeleteReserInfo(rid); + } + + /// + /// 添加预约信息 + /// + /// + /// + [HttpPost] + 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 new file mode 100644 index 0000000000000000000000000000000000000000..0736ddfca9f67d614f712d30818397c9e4851f6c --- /dev/null +++ b/EOM.TSHotelManager.WebApi/Controllers/Business/Room/RoomController.cs @@ -0,0 +1,239 @@ +using EOM.TSHotelManager.Application; +using EOM.TSHotelManager.Core; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.WebApi.Controllers +{ + /// + /// 房间信息控制器 + /// + public class RoomController : ControllerBase + { + /// + /// 房间信息 + /// + private readonly IRoomService roomService; + + /// + /// + /// + /// + public RoomController(IRoomService roomService) + { + this.roomService = roomService; + } + + /// + /// 根据房间状态获取相应状态的房间信息 + /// + /// + /// + [HttpGet] + public List SelectRoomByRoomState([FromQuery]int stateid) + { + return roomService.SelectRoomByRoomState(stateid); + } + + /// + /// 根据房间状态来查询可使用的房间 + /// + /// + [HttpGet] + public List SelectCanUseRoomAll() + { + return roomService.SelectCanUseRoomAll(); + } + + /// + /// 获取所有房间信息 + /// + /// + [HttpGet] + public List SelectRoomAll() + { + return roomService.SelectRoomAll(); + } + + /// + /// 获取房间分区的信息 + /// + /// + [HttpGet] + public List SelectRoomByTypeName([FromQuery] string? TypeName) + { + return roomService.SelectRoomByTypeName(TypeName); + } + + /// + /// 根据房间编号查询房间信息 + /// + /// + /// + [HttpGet] + public Room SelectRoomByRoomNo([FromQuery] string? no) + { + return roomService.SelectRoomByRoomNo(no); + } + + /// + /// 根据房间编号退房(退房) + /// + /// + /// + [HttpGet] + public bool UpdateRoomByRoomNo([FromQuery] string? room) + { + return roomService.UpdateRoomByRoomNo(room); + } + + /// + /// 根据房间编号查询截止到今天住了多少天 + /// + /// + /// + [HttpGet] + public object DayByRoomNo([FromQuery] string? roomno) + { + return roomService.DayByRoomNo(roomno); + } + + /// + /// 根据房间编号修改房间信息(入住) + /// + /// + /// + [HttpPost] + public bool UpdateRoomInfo([FromBody]Room r) + { + return roomService.UpdateRoomInfo(r); + } + + /// + /// 根据房间编号修改房间信息(预约) + /// + /// + /// + [HttpPost] + public bool UpdateRoomInfoWithReser([FromBody] Room r) + { + return roomService.UpdateRoomInfoWithReser(r); + } + + /// + /// 查询可入住房间数量 + /// + /// + [HttpGet] + public object SelectCanUseRoomAllByRoomState() + { + return roomService.SelectCanUseRoomAllByRoomState(); + } + + /// + /// 查询已入住房间数量 + /// + /// + [HttpGet] + public object SelectNotUseRoomAllByRoomState() + { + return roomService.SelectNotUseRoomAllByRoomState(); + } + + /// + /// 根据房间编号查询房间价格 + /// + /// + [HttpGet] + public object SelectRoomByRoomPrice([FromQuery]string? r) + { + return roomService.SelectRoomByRoomPrice(r); + } + + /// + /// 查询脏房数量 + /// + /// + [HttpGet] + public object SelectNotClearRoomAllByRoomState() + { + return roomService.SelectNotClearRoomAllByRoomState(); + } + + /// + /// 查询维修房数量 + /// + /// + [HttpGet] + public object SelectFixingRoomAllByRoomState() + { + return roomService.SelectFixingRoomAllByRoomState(); + } + + /// + /// 查询预约房数量 + /// + /// + [HttpGet] + public object SelectReseredRoomAllByRoomState() + { + return roomService.SelectReseredRoomAllByRoomState(); + } + + /// + /// 根据房间编号更改房间状态 + /// + /// + /// + /// + [HttpPost] + public bool UpdateRoomStateByRoomNo([FromBody]string? roomno, int stateid) + { + return roomService.UpdateRoomStateByRoomNo(roomno,stateid); + } + + /// + /// 添加房间 + /// + /// + /// + [HttpPost] + public bool InsertRoom([FromBody]Room rn) + { + return roomService.InsertRoom(rn); + } + + /// + /// 查询所有可消费(已住)房间 + /// + /// + [HttpGet] + public List SelectRoomByStateAll() + { + return roomService.SelectRoomByStateAll(); + } + + /// + /// 获取所有房间状态 + /// + /// + [HttpGet] + public List SelectRoomStateAll() + { + return roomService.SelectRoomStateAll(); + } + + /// + /// 根据房间编号查询房间状态编号 + /// + /// + /// + [HttpGet] + public object SelectRoomStateIdByRoomNo([FromQuery]string? roomno) + { + return roomService.SelectRoomStateIdByRoomNo(roomno); + } + + } +} diff --git a/EOM.TSHotelManager.WebApi/Controllers/Business/Sellthing/SellthingController.cs b/EOM.TSHotelManager.WebApi/Controllers/Business/Sellthing/SellthingController.cs new file mode 100644 index 0000000000000000000000000000000000000000..e93de8b43532309c20144f690b4465aef4c02584 --- /dev/null +++ b/EOM.TSHotelManager.WebApi/Controllers/Business/Sellthing/SellthingController.cs @@ -0,0 +1,122 @@ +using EOM.TSHotelManager.Application; +using EOM.TSHotelManager.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 +{ + /// + /// 商品消费控制器 + /// + public class SellthingController : ControllerBase + { + /// + /// 商品消费 + /// + private readonly ISellService sellService; + + /// + /// + /// + /// + public SellthingController(ISellService sellService) + { + this.sellService = sellService; + } + + /// + /// 查询所有商品 + /// + /// + [HttpGet] + public List SelectSellThingAll([FromQuery]SellThing sellThing = null) + { + return sellService.SelectSellThingAll(sellThing); + } + + /// + /// 修改商品 + /// + /// + /// + /// + [HttpPost] + public bool UpdateSellThing([FromBody]string? stock, string? sellNo) + { + return sellService.UpdateSellThing(stock, sellNo); + } + + /// + /// 修改商品信息 + /// + /// + /// + [HttpPost] + public bool UpdateSellthingInfo([FromBody] SellThing sellThing) + { + return sellService.UpdateSellthingInfo(sellThing); + } + + /// + /// 撤回客户消费信息 + /// + /// + /// + /// + /// + [HttpPost] + public bool DeleteSellThing([FromBody] string? roomNo, string? custoNo, string? sellName) + { + return sellService.DeleteSellThing(roomNo, custoNo, sellName); + } + + /// + /// 根据商品编号删除商品信息 + /// + /// + /// + [HttpPost] + public bool DeleteSellThingBySellNo([FromBody]string? sellNo) + { + return sellService.DeleteSellThingBySellNo(sellNo); + } + + /// + /// 根据商品名称和价格查询商品编号 + /// + /// + /// + /// + [HttpGet] + public SellThing SelectSellThingByNameAndPrice([FromQuery]string? name, string? price) + { + return sellService.SelectSellThingByNameAndPrice(name, price); + } + + + /// + /// 根据商品编号查询商品信息 + /// + /// + /// + [HttpGet] + public SellThing SelectSellInfoBySellNo([FromQuery]string? SellNo) + { + return sellService.SelectSellInfoBySellNo(SellNo); + } + + /// + /// 添加商品 + /// + /// + /// + [HttpPost] + 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 new file mode 100644 index 0000000000000000000000000000000000000000..740988b8b6f1830c53dbc42b45b68065a3837276 --- /dev/null +++ b/EOM.TSHotelManager.WebApi/Controllers/Business/Spend/SpendController.cs @@ -0,0 +1,142 @@ +using EOM.TSHotelManager.Application; +using EOM.TSHotelManager.Core; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.WebApi.Controllers +{ + /// + /// 消费信息控制器 + /// + public class SpendController : ControllerBase + { + /// + /// 消费信息 + /// + private readonly ISpendService spendService; + + /// + /// + /// + /// + public SpendController(ISpendService spendService) + { + this.spendService = spendService; + } + + /// + /// 添加消费信息 + /// + /// + /// + [HttpPost] + public bool InsertSpendInfo([FromBody]Spend s) + { + return spendService.InsertSpendInfo(s); + } + + /// + /// 根据客户编号查询消费信息 + /// + /// + /// + [HttpGet] + public List SelectSpendByCustoNo([FromQuery]string? No) + { + return spendService.SelectSpendByCustoNo(No); + } + + /// + /// 根据房间编号查询消费信息 + /// + /// + /// + [HttpGet] + public List SelectSpendByRoomNo([FromQuery]string? No) + { + return spendService.SelectSpendByRoomNo(No); + } + + /// + /// 根据客户编号查询历史消费信息 + /// + /// + /// + [HttpGet] + public List SeletHistorySpendInfoAll([FromQuery]string? custoNo) + { + return spendService.SeletHistorySpendInfoAll(custoNo); + } + + /// + /// 查询消费的所有信息 + /// + /// + [HttpGet] + List SelectSpendInfoAll() + { + return spendService.SelectSpendInfoAll(); + } + + /// + /// 根据房间号查询消费的所有信息 + /// + /// + [HttpGet] + public List SelectSpendInfoRoomNo([FromQuery]string? RoomNo) + { + return spendService.SelectSpendInfoRoomNo(RoomNo); + } + + /// + /// 根据房间编号、入住时间到当前时间查询消费总金额 + /// + /// + /// + /// + [HttpGet] + public object SelectMoneyByRoomNoAndTime([FromQuery]string? roomno, string? custono) + { + return spendService.SelectMoneyByRoomNoAndTime(roomno, custono); + } + + /// + /// 根据房间编号、入住时间和当前时间修改结算状态 + /// + /// + /// + /// + [HttpPost] + public bool UpdateMoneyState([FromBody] string? roomno, string? checktime) + { + return spendService.UpdateMoneyState(roomno, checktime); + } + + /// + /// 将转房前的未结算记录一同转移到新房间 + /// + /// + /// + /// + /// + [HttpPost] + public bool UpdateSpendInfoByRoomNo([FromBody]List spends, string? newRoom, string? custoNo) + { + return spendService.UpdateSpendInfoByRoomNo(spends, newRoom, custoNo); + } + + /// + /// 更新消费信息 + /// + /// + /// + [HttpPost] + 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 new file mode 100644 index 0000000000000000000000000000000000000000..e196f02050599994d9c6c6bcad10797e4ab1583a --- /dev/null +++ b/EOM.TSHotelManager.WebApi/Controllers/Business/Wti/WtiController.cs @@ -0,0 +1,126 @@ +using EOM.TSHotelManager.Application; +using EOM.TSHotelManager.Core; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.WebApi.Controllers +{ + /// + /// 水电信息控制器 + /// + public class WtiController : ControllerBase + { + /// + /// 水电信息 + /// + private readonly IWtiService wtiService; + + /// + /// + /// + /// + public WtiController(IWtiService wtiService) + { + this.wtiService = wtiService; + } + + /// + /// 根据房间编号查询水电费信息 + /// + /// + /// + [HttpGet] + public Wti SelectWtiInfoByRoomNo([FromQuery]string? roomNo) + { + return this.wtiService.SelectWtiInfoByRoomNo(roomNo); + } + + /// + /// 根据房间编号、使用时间查询水电费信息 + /// + /// + /// + /// + /// + [HttpGet] + public Wti SelectWtiInfoByRoomNoAndTime([FromQuery]string? roomno, string? usedate, string? enddate) + { + return this.wtiService.SelectWtiInfoByRoomNoAndTime(roomno, usedate, enddate); + } + + /// + /// 获取所有水电费信息 + /// + /// + [HttpGet] + public List SelectWtiInfoAll() + { + return this.wtiService.SelectWtiInfoAll(); + } + + /// + /// 添加水电费信息 + /// + /// + /// + [HttpPost] + public bool InsertWtiInfo([FromBody]Wti w) + { + return this.wtiService.InsertWtiInfo(w); + } + + /// + /// 修改水电费信息(根据房间编号) + /// + /// + /// + [HttpPost] + public bool UpdateWtiInfo([FromBody]Wti w) + { + return this.wtiService.UpdateWtiInfo(w); + } + + /// + /// 根据房间信息、使用时间修改水电费 + /// + /// + /// + [HttpPost] + public bool UpdateWtiInfoByRoomNoAndDateTime([FromBody]Wti w) + { + return this.wtiService.UpdateWtiInfoByRoomNoAndDateTime(w); + } + + /// + /// 删除水电费信息:根据房间编号 + /// + /// + /// + //bool DeleteWtiInfo(string? roomno); + + /// + /// 根据房间编号、使用时间删除水电费信息 + /// + /// + /// + /// + /// + [HttpPost] + public bool DeleteWtiInfoByRoomNoAndDateTime([FromBody]string? roomno, string? usedate, string? enddate) + { + return this.wtiService.DeleteWtiInfoByRoomNoAndDateTime(roomno, usedate, enddate); + } + + /// + /// 获取所有水电费信息 + /// + /// + [HttpGet] + 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 new file mode 100644 index 0000000000000000000000000000000000000000..e816bf69573f664ef8188e9d7fd2b746af6ecdd9 --- /dev/null +++ b/EOM.TSHotelManager.WebApi/Controllers/Sys/NavBar/NavBarController.cs @@ -0,0 +1,39 @@ +using EOM.TSHotelManager.Application; +using EOM.TSHotelManager.Core; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.WebApi.Controllers +{ + /// + /// 导航控件模块控制器 + /// + public class NavBarController : ControllerBase + { + /// + /// 导航控件 + /// + private readonly INavBarService navBarService; + + /// + /// + /// + /// + public NavBarController(INavBarService navBarService) + { + this.navBarService = navBarService; + } + + /// + /// 导航控件列表 + /// + /// + [HttpGet] + public List NavBarList() + { + return navBarService.NavBarList(); + } + + } +} diff --git a/EOM.TSHotelManager.WebApi/Controllers/Worker/Check/WorkerCheckController.cs b/EOM.TSHotelManager.WebApi/Controllers/Worker/Check/WorkerCheckController.cs new file mode 100644 index 0000000000000000000000000000000000000000..1832d807abda00635438033557f0a64a7bd58d2f --- /dev/null +++ b/EOM.TSHotelManager.WebApi/Controllers/Worker/Check/WorkerCheckController.cs @@ -0,0 +1,72 @@ +using EOM.TSHotelManager.Application; +using EOM.TSHotelManager.Core; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.WebApi.Controllers +{ + /// + /// 员工打卡控制器 + /// + public class WorkerCheckController : ControllerBase + { + /// + /// 员工打卡 + /// + private readonly IWorkerCheckService workerCheckService; + + /// + /// + /// + /// + public WorkerCheckController(IWorkerCheckService workerCheckService) + { + this.workerCheckService = workerCheckService; + } + + /// + /// 根据员工编号查询其所有的打卡记录 + /// + /// + /// + [HttpGet] + public List SelectCheckInfoByWorkerNo([FromQuery]string? wid) + { + return workerCheckService.SelectCheckInfoByWorkerNo(wid); + } + + /// + /// 查询员工签到天数 + /// + /// + /// + [HttpGet] + public object SelectWorkerCheckDaySumByWorkerNo([FromQuery]string? wkn) + { + return workerCheckService.SelectWorkerCheckDaySumByWorkerNo(wkn); + } + + /// + /// 查询今天员工是否已签到 + /// + /// + /// + [HttpGet] + public object SelectToDayCheckInfoByWorkerNo([FromQuery] string? wkn) + { + return workerCheckService.SelectToDayCheckInfoByWorkerNo(wkn); + } + + /// + /// 添加员工打卡数据 + /// + /// + /// + [HttpPost] + 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 new file mode 100644 index 0000000000000000000000000000000000000000..e10609a08c2aa53227333e197173d2bd43217a58 --- /dev/null +++ b/EOM.TSHotelManager.WebApi/Controllers/Worker/GoodBad/WorkerGoodBadController.cs @@ -0,0 +1,50 @@ +using EOM.TSHotelManager.Application; +using EOM.TSHotelManager.Core; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.WebApi.Controllers +{ + /// + /// 奖惩信息控制器 + /// + public class WorkerGoodBadController : ControllerBase + { + /// + /// 奖惩信息 + /// + private readonly IWorkerGoodBadService workerGoodBadService; + + /// + /// + /// + /// + public WorkerGoodBadController(IWorkerGoodBadService workerGoodBadService) + { + this.workerGoodBadService = workerGoodBadService; + } + + /// + /// 添加员工奖惩记录 + /// + /// + /// + [HttpPost] + public bool AddGoodBad([FromBody]WorkerGoodBad goodBad) + { + return workerGoodBadService.AddGoodBad(goodBad); + } + + /// + /// 根据工号查找所有的奖惩记录信息 + /// + /// + /// + [HttpGet] + 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 new file mode 100644 index 0000000000000000000000000000000000000000..7a644d7d224211946d00281084f055f163c4af07 --- /dev/null +++ b/EOM.TSHotelManager.WebApi/Controllers/Worker/History/WorkerHistoryController.cs @@ -0,0 +1,50 @@ +using EOM.TSHotelManager.Application; +using EOM.TSHotelManager.Core; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.WebApi.Controllers +{ + /// + /// 员工履历控制器 + /// + public class WorkerHistoryController : ControllerBase + { + /// + /// 员工履历 + /// + private readonly IWorkerHistoryService workerHistoryService; + + /// + /// + /// + /// + public WorkerHistoryController(IWorkerHistoryService workerHistoryService) + { + this.workerHistoryService = workerHistoryService; + } + + /// + /// 根据工号添加员工履历 + /// + /// + /// + [HttpPost] + public bool AddHistoryByWorkerId([FromBody]WorkerHistory workerHistory) + { + return workerHistoryService.AddHistoryByWorkerId(workerHistory); + } + + /// + /// 根据工号查询履历信息 + /// + /// + /// + [HttpGet] + 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 new file mode 100644 index 0000000000000000000000000000000000000000..a0a72159397fbd90bb06b88ec8a12c8cdc3eefc7 --- /dev/null +++ b/EOM.TSHotelManager.WebApi/Controllers/Worker/Picture/WorkerPictureController.cs @@ -0,0 +1,73 @@ +using EOM.TSHotelManager.Application; +using EOM.TSHotelManager.Core; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; + +namespace EOM.TSHotelManager.WebApi.Controllers +{ + /// + /// 照片控制器 + /// + public class WorkerPictureController : ControllerBase + { + /// + /// 照片 + /// + private readonly IWorkerPicService workerPicService; + + /// + /// + /// + /// + public WorkerPictureController(IWorkerPicService workerPicService) + { + this.workerPicService = workerPicService; + } + + /// + /// 查询员工照片 + /// + /// + /// + [HttpGet] + public WorkerPic WorkerPic([FromQuery]WorkerPic workerPic) + { + return workerPicService.WorkerPic(workerPic); + } + + /// + /// 添加员工照片 + /// + /// + /// + [HttpPost] + public bool InsertWorkerPic([FromBody]WorkerPic workerPic) + { + return workerPicService.InsertWorkerPic(workerPic); + } + + /// + /// 删除员工照片 + /// + /// + /// + [HttpPost] + public bool DeleteWorkerPic([FromBody]WorkerPic workerPic) + { + return workerPicService.DeleteWorkerPic(workerPic); + } + + /// + /// 更新员工照片 + /// + /// + /// + [HttpPost] + public bool UpdateWorkerPic([FromBody]WorkerPic workerPic) + { + return workerPicService.UpdateWorkerPic(workerPic); + } + + } + +} diff --git a/EOM.TSHotelManager.WebApi/Controllers/Zero/Admin/AdminController.cs b/EOM.TSHotelManager.WebApi/Controllers/Zero/Admin/AdminController.cs new file mode 100644 index 0000000000000000000000000000000000000000..c8103e00586273b56e4f2b8d118ff93dd79a38a2 --- /dev/null +++ b/EOM.TSHotelManager.WebApi/Controllers/Zero/Admin/AdminController.cs @@ -0,0 +1,125 @@ +using EOM.TSHotelManager.Application; +using EOM.TSHotelManager.Core; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.WebApi.Controllers +{ + /// + /// 管理员控制器 + /// + public class AdminController : ControllerBase + { + /// + /// 管理员模块 + /// + private readonly IAdminService adminService; + + /// + /// + /// + /// + public AdminController(IAdminService adminService) + { + this.adminService = adminService; + } + + /// + /// 根据超管密码查询员工类型和权限 + /// + /// + /// + [HttpPost] + public Admin SelectMangerByPass([FromBody]Admin admin) + { + return adminService.SelectMangerByPass(admin); + } + + /// + /// 根据超管账号查询对应的密码 + /// + /// + /// + [HttpPost] + public Admin SelectAdminPwdByAccount([FromBody]string? account) + { + return adminService.SelectAdminPwdByAccount(account); + } + + /// + /// 获取所有管理员列表 + /// + /// + [HttpGet] + public List GetAllAdminList() + { + return adminService.GetAllAdminList(); + } + + /// + /// 修改密码 + /// + /// + /// + [HttpPost] + public bool UpdateNewPwdByOldPwd([FromBody]Admin admin) + { + return adminService.UpdateNewPwdByOldPwd(admin); + } + + /// + /// 获取管理员列表 + /// + /// + [HttpGet] + public List GetAllAdmin() + { + return adminService.GetAllAdmin(); + } + + /// + /// 添加管理员 + /// + /// + /// + [HttpPost] + public bool AddAdmin([FromBody]Admin admin) + { + return adminService.AddAdmin(admin); + } + + /// + /// 获取管理员信息 + /// + /// + /// + [HttpGet] + public Admin GetAdminInfoByAdminAccount([FromQuery]Admin admin) + { + return adminService.GetAdminInfoByAdminAccount(admin); + } + + /// + /// 获取所有管理员类型 + /// + /// + [HttpGet] + public List GetAllAdminTypes() + { + return adminService.GetAllAdminTypes(); + } + + /// + /// 批量更新管理员账户 + /// + /// + /// + [HttpPost] + 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 new file mode 100644 index 0000000000000000000000000000000000000000..08914b02bfa73bd47533b57a023fc75643b17afb --- /dev/null +++ b/EOM.TSHotelManager.WebApi/Controllers/Zero/Base/BaseController.cs @@ -0,0 +1,539 @@ +using EOM.TSHotelManager.Application; +using EOM.TSHotelManager.Core; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.WebApi.Controllers +{ + /// + /// 基础信息控制器 + /// + public class BaseController : ControllerBase + { + /// + /// 基础信息 + /// + private readonly IBaseService baseService; + + /// + /// + /// + /// + public BaseController(IBaseService baseService) + { + this.baseService = baseService; + } + + #region 性别模块 + + /// + /// 查询所有性别类型 + /// + /// + [HttpGet] + public List SelectSexTypeAll([FromQuery]SexType sexType = null) + { + return baseService.SelectSexTypeAll(sexType); + } + + /// + /// 查询性别类型 + /// + /// + [HttpGet] + public SexType SelectSexType([FromQuery]SexType sexType) + { + return baseService.SelectSexType(sexType); + } + + /// + /// 添加性别类型 + /// + /// + /// + [HttpPost] + public bool AddSexType([FromBody]SexType sexType) + { + return baseService.AddSexType(sexType); + } + + /// + /// 删除性别类型 + /// + /// + /// + [HttpPost] + public bool DelSexType([FromBody]SexType sexType) + { + return baseService.DelSexType(sexType); + } + + /// + /// 更新性别类型 + /// + /// + /// + [HttpPost] + public bool UpdSexType([FromBody]SexType sexType) + { + return baseService.UpdSexType(sexType); + } + + #endregion + + #region 职位模块 + + /// + /// 查询所有职位类型 + /// + /// + [HttpGet] + public List SelectPositionAll([FromQuery]Position position = null) + { + return baseService.SelectPositionAll(position); + } + + /// + /// 查询职位类型 + /// + /// + [HttpGet] + public Position SelectPosition([FromQuery]Position position) + { + return baseService.SelectPosition(position); + } + + /// + /// 添加职位类型 + /// + /// + /// + [HttpPost] + public bool AddPosition([FromBody]Position position) + { + return baseService.AddPosition(position); + } + + /// + /// 删除职位类型 + /// + /// + /// + [HttpPost] + public bool DelPosition([FromBody]Position position) + { + return baseService.DelPosition(position); + } + + /// + /// 更新职位类型 + /// + /// + /// + [HttpPost] + public bool UpdPosition([FromBody]Position position) + { + return baseService.UpdPosition(position); + } + + #endregion + + #region 民族模块 + + /// + /// 查询所有民族类型 + /// + /// + [HttpGet] + public List SelectNationAll([FromQuery]Nation nation = null) + { + return baseService.SelectNationAll(nation); + } + + /// + /// 查询民族类型 + /// + /// + [HttpGet] + public Nation SelectNation([FromQuery]Nation nation) + { + return baseService.SelectNation(nation); + } + + /// + /// 添加民族类型 + /// + /// + /// + [HttpPost] + public bool AddNation([FromBody]Nation nation) + { + return baseService.AddNation(nation); + } + + /// + /// 删除民族类型 + /// + /// + /// + [HttpPost] + public bool DelNation([FromBody]Nation nation) + { + return baseService.DelNation(nation); + } + + /// + /// 更新民族类型 + /// + /// + /// + [HttpPost] + public bool UpdNation([FromBody]Nation nation) + { + return baseService.UpdNation(nation); + } + + #endregion + + #region 学历模块 + + /// + /// 查询所有学历类型 + /// + /// + [HttpGet] + public List SelectEducationAll([FromQuery]Education education = null) + { + return baseService.SelectEducationAll(education); + } + + /// + /// 查询学历类型 + /// + /// + [HttpGet] + public Education SelectEducation([FromQuery]Education education) + { + return baseService.SelectEducation(education); + } + + /// + /// 添加学历类型 + /// + /// + /// + [HttpPost] + public bool AddEducation([FromBody]Education education) + { + return baseService.AddEducation(education); + } + + /// + /// 删除学历类型 + /// + /// + /// + [HttpPost] + public bool DelEducation([FromBody]Education education) + { + return baseService.DelEducation(education); + } + + /// + /// 更新学历类型 + /// + /// + /// + [HttpPost] + public bool UpdEducation([FromBody]Education education) + { + return baseService.UpdEducation(education); + } + + #endregion + + #region 部门模块 + + /// + /// 查询所有部门类型(可用) + /// + /// + [HttpGet] + public List SelectDeptAllCanUse() + { + return baseService.SelectDeptAllCanUse(); + } + + /// + /// 查询所有部门类型 + /// + /// + [HttpGet] + public List SelectDeptAll() + { + return baseService.SelectDeptAll(); + } + + /// + /// 查询部门类型 + /// + /// + [HttpGet] + public Dept SelectDept([FromQuery]Dept dept) + { + return baseService.SelectDept(dept); + } + + /// + /// 添加部门类型 + /// + /// + /// + [HttpPost] + public bool AddDept([FromBody]Dept dept) + { + return baseService.AddDept(dept); + } + + /// + /// 删除部门类型 + /// + /// + /// + [HttpPost] + public bool DelDept([FromBody]Dept dept) + { + return baseService.DelDept(dept); + } + + /// + /// 更新部门类型 + /// + /// + /// + [HttpPost] + public bool UpdDept([FromBody]Dept dept) + { + return baseService.UpdDept(dept); + } + + #endregion + + #region 客户类型模块 + + /// + /// 查询所有客户类型(可用) + /// + /// + [HttpGet] + public List SelectCustoTypeAllCanUse() + { + return baseService.SelectCustoTypeAllCanUse(); + } + + /// + /// 查询所有客户类型 + /// + /// + [HttpGet] + public List SelectCustoTypeAll() + { + return baseService.SelectCustoTypeAll(); + } + + /// + /// 根据客户类型ID查询类型名称 + /// + /// + /// + [HttpGet] + public CustoType SelectCustoTypeByTypeId([FromQuery]CustoType custoType) + { + return baseService.SelectCustoTypeByTypeId(custoType); + } + + /// + /// 添加客户类型 + /// + /// + /// + [HttpPost] + public bool InsertCustoType([FromBody]CustoType custoType) + { + return baseService.InsertCustoType(custoType); + } + + /// + /// 删除客户类型 + /// + /// + /// + [HttpPost] + public bool DeleteCustoType([FromBody]CustoType custoType) + { + return baseService.DeleteCustoType(custoType); + } + + /// + /// 更新客户类型 + /// + /// + /// + [HttpPost] + public bool UpdateCustoType([FromBody]CustoType custoType) + { + return baseService.UpdateCustoType(custoType); + } + + #endregion + + #region 证件类型模块 + + /// + /// 查询所有证件类型(可用) + /// + /// + [HttpGet] + public List SelectPassPortTypeAllCanUse() + { + return baseService.SelectPassPortTypeAllCanUse(); + } + + /// + /// 查询所有证件类型 + /// + /// + [HttpGet] + public List SelectPassPortTypeAll() + { + return baseService.SelectPassPortTypeAll(); + } + + /// + /// 根据证件类型ID查询类型名称 + /// + /// + /// + [HttpGet] + public PassPortType SelectPassPortTypeByTypeId([FromQuery]PassPortType passPortType) + { + return baseService.SelectPassPortTypeByTypeId(passPortType); + } + + /// + /// 添加证件类型 + /// + /// + /// + [HttpPost] + public bool InsertPassPortType([FromBody]PassPortType passPortType) + { + return baseService.InsertPassPortType(passPortType); + } + + /// + /// 删除证件类型 + /// + /// + /// + [HttpPost] + public bool DeletePassPortType([FromBody]PassPortType portType) + { + return baseService.DeletePassPortType(portType); + } + + /// + /// 更新证件类型 + /// + /// + /// + [HttpPost] + public bool UpdatePassPortType([FromBody]PassPortType portType) + { + return baseService.UpdatePassPortType(portType); + } + + #endregion + + #region 奖惩类型模块 + + /// + /// 查询所有奖惩类型(可用) + /// + /// + [HttpGet] + public List SelectGBTypeAllCanUse() + { + return baseService.SelectGBTypeAllCanUse(); + } + + /// + /// 查询所有奖惩类型 + /// + /// + [HttpGet] + public List SelectGBTypeAll() + { + return baseService.SelectGBTypeAll(); + } + + /// + /// 根据奖惩类型ID查询类型名称 + /// + /// + /// + [HttpGet] + public GBType SelectGBTypeByTypeId([FromQuery]GBType gBType) + { + return baseService.SelectGBTypeByTypeId(gBType); + } + + /// + /// 添加奖惩类型 + /// + /// + /// + [HttpPost] + public bool InsertGBType([FromBody]GBType gBType) + { + return baseService.InsertGBType(gBType); + } + + /// + /// 删除奖惩类型 + /// + /// + /// + [HttpPost] + public bool DeleteGBType([FromBody]GBType gBType) + { + return baseService.DeleteGBType(gBType); + } + + /// + /// 更新奖惩类型 + /// + /// + /// + [HttpPost] + public bool UpdateGBType([FromBody]GBType gBType) + { + return baseService.UpdateGBType(gBType); + } + + #endregion + + #region URL模块 + /// + /// 基础URL + /// + /// + [HttpGet] + public Base GetBase() + { + return baseService.GetBase(); + } + #endregion + } +} diff --git a/EOM.TSHotelManager.WebApi/Controllers/Zero/CheckInfo/CheckInfoController.cs b/EOM.TSHotelManager.WebApi/Controllers/Zero/CheckInfo/CheckInfoController.cs new file mode 100644 index 0000000000000000000000000000000000000000..de5f621c9e9e37794c1f5e518f046a08aa5db5a1 --- /dev/null +++ b/EOM.TSHotelManager.WebApi/Controllers/Zero/CheckInfo/CheckInfoController.cs @@ -0,0 +1,38 @@ +using EOM.TSHotelManager.Application; +using EOM.TSHotelManager.Core; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.WebApi.Controllers +{ + /// + /// 监管统计控制器 + /// + public class CheckInfoController : ControllerBase + { + /// + /// 监管统计 + /// + private readonly ICheckInfoService checkInfoService; + + /// + /// + /// + /// + public CheckInfoController(ICheckInfoService checkInfoService) + { + this.checkInfoService = checkInfoService; + } + + /// + /// 查询所有监管统计信息 + /// + /// + [HttpGet] + public List SelectCheckInfoAll() + { + return checkInfoService.SelectCheckInfoAll(); + } + } +} diff --git a/EOM.TSHotelManager.WebApi/Controllers/Zero/Module/ModuleController.cs b/EOM.TSHotelManager.WebApi/Controllers/Zero/Module/ModuleController.cs new file mode 100644 index 0000000000000000000000000000000000000000..6b6a74933982ae0c82707bbd85a791b1779a4507 --- /dev/null +++ b/EOM.TSHotelManager.WebApi/Controllers/Zero/Module/ModuleController.cs @@ -0,0 +1,72 @@ +using EOM.TSHotelManager.Application; +using EOM.TSHotelManager.Core; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.WebApi.Controllers +{ + /// + /// 系统模块控制器 + /// + public class ModuleController : ControllerBase + { + /// + /// 系统模块 + /// + private readonly IAdminModuleZeroService adminModuleZeroService; + + /// + /// + /// + /// + public ModuleController(IAdminModuleZeroService adminModuleZeroService) + { + this.adminModuleZeroService = adminModuleZeroService; + } + + /// + /// 获取所有模块 + /// + /// + [HttpGet] + public List GetAllModule() + { + return adminModuleZeroService.GetAllModule(); + } + + /// + /// 根据账号获取对应模块 + /// + /// + /// + [HttpGet] + public List GetAllModuleByAdmin([FromQuery]Admin admin) + { + return adminModuleZeroService.GetAllModuleByAdmin(admin); + } + + /// + /// 批量添加模块 + /// + /// + /// + [HttpPost] + public bool AddModuleZeroList([FromBody]List moduleZeros) + { + return adminModuleZeroService.AddModuleZeroList(moduleZeros); + } + + /// + /// 批量删除模块 + /// + /// + /// + [HttpPost] + 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 new file mode 100644 index 0000000000000000000000000000000000000000..6015dd3ec5b38f52bda1cc6c8f1b7616a8f9ac22 --- /dev/null +++ b/EOM.TSHotelManager.WebApi/Controllers/Zero/Notice/NoticeController.cs @@ -0,0 +1,55 @@ +using EOM.TSHotelManager.Application; +using EOM.TSHotelManager.Core; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.WebApi.Controllers +{ + /// + /// 公告控制器 + /// + public class NoticeController : ControllerBase + { + /// + /// 公告 + /// + private readonly INoticeService noticeService; + + /// + /// + /// + /// + public NoticeController(INoticeService noticeService) + { + this.noticeService = noticeService; + } + + #region 获取所有公告信息 + /// + /// 获取所有公告信息 + /// + /// + [HttpGet] + public List SelectNoticeAll() + { + return noticeService.SelectNoticeAll(); + } + #endregion + + #region 上传公告信息 + /// + /// 上传公告信息 + /// + /// + /// + [HttpPost] + public bool InsertNotice([FromBody]Notice notice) + { + return noticeService.InsertNotice(notice); + } + + #endregion + + } +} diff --git a/EOM.TSHotelManager.WebApi/Controllers/Zero/VipRule/VipRuleController.cs b/EOM.TSHotelManager.WebApi/Controllers/Zero/VipRule/VipRuleController.cs new file mode 100644 index 0000000000000000000000000000000000000000..343d195d202f472f35ba2d217956be37998e8cac --- /dev/null +++ b/EOM.TSHotelManager.WebApi/Controllers/Zero/VipRule/VipRuleController.cs @@ -0,0 +1,82 @@ +using EOM.TSHotelManager.Application; +using EOM.TSHotelManager.Core; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using System.Collections.Generic; + +namespace EOM.TSHotelManager.WebApi.Controllers +{ + /// + /// 会员规则控制器 + /// + public class VipRuleController : ControllerBase + { + /// + /// 会员规则 + /// + private readonly IVipRuleAppService vipRuleAppService; + + /// + /// + /// + /// + public VipRuleController(IVipRuleAppService vipRuleAppService) + { + this.vipRuleAppService = vipRuleAppService; + } + + /// + /// 查询会员等级规则列表 + /// + /// + [HttpGet] + public List SelectVipRuleList() + { + return vipRuleAppService.SelectVipRuleList(); + } + + /// + /// 查询会员等级规则 + /// + /// + /// + [HttpGet] + public VipRule SelectVipRule([FromQuery]VipRule vipRule) + { + return vipRuleAppService.SelectVipRule(vipRule); + } + + /// + /// 添加会员等级规则 + /// + /// + /// + [HttpPost] + public bool AddVipRule([FromBody]VipRule vipRule) + { + return vipRuleAppService.AddVipRule(vipRule); + } + + /// + /// 删除会员等级规则 + /// + /// + /// + [HttpPost] + public bool DelVipRule([FromBody]VipRule vipRule) + { + return vipRuleAppService.DelVipRule(vipRule); + } + + /// + /// 更新会员等级规则 + /// + /// + /// + [HttpPost] + public bool UpdVipRule([FromBody]VipRule vipRule) + { + return vipRuleAppService.UpdVipRule(vipRule); + } + } +} diff --git a/EOM.TSHotelManager.WebApi/EOM.TSHotelManager.WebApi.csproj b/EOM.TSHotelManager.WebApi/EOM.TSHotelManager.WebApi.csproj new file mode 100644 index 0000000000000000000000000000000000000000..cbf388878bdadac2096beb6ea68e8690a1229d33 --- /dev/null +++ b/EOM.TSHotelManager.WebApi/EOM.TSHotelManager.WebApi.csproj @@ -0,0 +1,37 @@ + + + + net6.0-windows8.0 + EOM.TSHotelManager.WebApi.Program + + + + EOM.TSHotelManager.WebApi.xml + + Off + 1701;1702;1591; + True + + + + False + + + + + + + + + + + + + + + + + + + + diff --git a/EOM.TSHotelManager.WebApi/EOM.TSHotelManager.WebApi.xml b/EOM.TSHotelManager.WebApi/EOM.TSHotelManager.WebApi.xml new file mode 100644 index 0000000000000000000000000000000000000000..48f3b925adaa35fa6202d6d010bb9c45a369facb --- /dev/null +++ b/EOM.TSHotelManager.WebApi/EOM.TSHotelManager.WebApi.xml @@ -0,0 +1,1303 @@ + + + + EOM.TSHotelManager.WebApi + + + + + 资产信息控制器 + + + + + 资产信息 + + + + + + + + + + + 添加资产信息 + + + + + + + 查询资产信息 + + + + + + 用户信息控制器 + + + + + 用户信息 + + + + + + + + + + + 添加客户信息 + + + + + + + 更新客户信息 + + + + + + + 更新客户类型(即会员等级) + + + + + + + + 查询酒店盈利情况 + + + + + + 查询所有客户信息 + + + + + + 查询指定客户信息 + + + + + + 根据客户编号查询客户信息 + + + + + + + 酒店宣传联动内容控制器 + + + + + 酒店宣传联动内容 + + + + + + + + + + + 查询所有宣传联动内容(跑马灯) + + + + + + 预约信息控制器 + + + + + 预约信息 + + + + + + + + + + + 获取所有预约信息 + + + + + + 根据房间编号获取预约信息 + + + + + + + 删除预约信息 + + + + + + + 添加预约信息 + + + + + + + 房间信息控制器 + + + + + 房间信息 + + + + + + + + + + + 根据房间状态获取相应状态的房间信息 + + + + + + + 根据房间状态来查询可使用的房间 + + + + + + 获取所有房间信息 + + + + + + 获取房间分区的信息 + + + + + + 根据房间编号查询房间信息 + + + + + + + 根据房间编号退房(退房) + + + + + + + 根据房间编号查询截止到今天住了多少天 + + + + + + + 根据房间编号修改房间信息(入住) + + + + + + + 根据房间编号修改房间信息(预约) + + + + + + + 查询可入住房间数量 + + + + + + 查询已入住房间数量 + + + + + + 根据房间编号查询房间价格 + + + + + + 查询脏房数量 + + + + + + 查询维修房数量 + + + + + + 查询预约房数量 + + + + + + 根据房间编号更改房间状态 + + + + + + + + 添加房间 + + + + + + + 查询所有可消费(已住)房间 + + + + + + 获取所有房间状态 + + + + + + 根据房间编号查询房间状态编号 + + + + + + + 商品消费控制器 + + + + + 商品消费 + + + + + + + + + + + 查询所有商品 + + + + + + 修改商品 + + + + + + + + 修改商品信息 + + + + + + + 撤回客户消费信息 + + + + + + + + + 根据商品编号删除商品信息 + + + + + + + 根据商品名称和价格查询商品编号 + + + + + + + + 根据商品编号查询商品信息 + + + + + + + 添加商品 + + + + + + + 消费信息控制器 + + + + + 消费信息 + + + + + + + + + + + 添加消费信息 + + + + + + + 根据客户编号查询消费信息 + + + + + + + 根据房间编号查询消费信息 + + + + + + + 根据客户编号查询历史消费信息 + + + + + + + 查询消费的所有信息 + + + + + + 根据房间号查询消费的所有信息 + + + + + + 根据房间编号、入住时间到当前时间查询消费总金额 + + + + + + + + 根据房间编号、入住时间和当前时间修改结算状态 + + + + + + + + 将转房前的未结算记录一同转移到新房间 + + + + + + + + + 更新消费信息 + + + + + + + 水电信息控制器 + + + + + 水电信息 + + + + + + + + + + + 根据房间编号查询水电费信息 + + + + + + + 根据房间编号、使用时间查询水电费信息 + + + + + + + + + 获取所有水电费信息 + + + + + + 添加水电费信息 + + + + + + + 修改水电费信息(根据房间编号) + + + + + + + 根据房间信息、使用时间修改水电费 + + + + + + + 根据房间编号、使用时间删除水电费信息 + + + + + + + + + 获取所有水电费信息 + + + + + + 导航控件模块控制器 + + + + + 导航控件 + + + + + + + + + + + 导航控件列表 + + + + + + 员工打卡控制器 + + + + + 员工打卡 + + + + + + + + + + + 根据员工编号查询其所有的打卡记录 + + + + + + + 查询员工签到天数 + + + + + + + 查询今天员工是否已签到 + + + + + + + 添加员工打卡数据 + + + + + + + 奖惩信息控制器 + + + + + 奖惩信息 + + + + + + + + + + + 添加员工奖惩记录 + + + + + + + 根据工号查找所有的奖惩记录信息 + + + + + + + 员工履历控制器 + + + + + 员工履历 + + + + + + + + + + + 根据工号添加员工履历 + + + + + + + 根据工号查询履历信息 + + + + + + + 照片控制器 + + + + + 照片 + + + + + + + + + + + 查询员工照片 + + + + + + + 添加员工照片 + + + + + + + 删除员工照片 + + + + + + + 更新员工照片 + + + + + + + 管理员控制器 + + + + + 管理员模块 + + + + + + + + + + + 根据超管密码查询员工类型和权限 + + + + + + + 根据超管账号查询对应的密码 + + + + + + + 获取所有管理员列表 + + + + + + 修改密码 + + + + + + + 获取管理员列表 + + + + + + 添加管理员 + + + + + + + 获取管理员信息 + + + + + + + 获取所有管理员类型 + + + + + + 批量更新管理员账户 + + + + + + + 基础信息控制器 + + + + + 基础信息 + + + + + + + + + + + 查询所有性别类型 + + + + + + 查询性别类型 + + + + + + 添加性别类型 + + + + + + + 删除性别类型 + + + + + + + 更新性别类型 + + + + + + + 查询所有职位类型 + + + + + + 查询职位类型 + + + + + + 添加职位类型 + + + + + + + 删除职位类型 + + + + + + + 更新职位类型 + + + + + + + 查询所有民族类型 + + + + + + 查询民族类型 + + + + + + 添加民族类型 + + + + + + + 删除民族类型 + + + + + + + 更新民族类型 + + + + + + + 查询所有学历类型 + + + + + + 查询学历类型 + + + + + + 添加学历类型 + + + + + + + 删除学历类型 + + + + + + + 更新学历类型 + + + + + + + 查询所有部门类型(可用) + + + + + + 查询所有部门类型 + + + + + + 查询部门类型 + + + + + + 添加部门类型 + + + + + + + 删除部门类型 + + + + + + + 更新部门类型 + + + + + + + 查询所有客户类型(可用) + + + + + + 查询所有客户类型 + + + + + + 根据客户类型ID查询类型名称 + + + + + + + 添加客户类型 + + + + + + + 删除客户类型 + + + + + + + 更新客户类型 + + + + + + + 查询所有证件类型(可用) + + + + + + 查询所有证件类型 + + + + + + 根据证件类型ID查询类型名称 + + + + + + + 添加证件类型 + + + + + + + 删除证件类型 + + + + + + + 更新证件类型 + + + + + + + 查询所有奖惩类型(可用) + + + + + + 查询所有奖惩类型 + + + + + + 根据奖惩类型ID查询类型名称 + + + + + + + 添加奖惩类型 + + + + + + + 删除奖惩类型 + + + + + + + 更新奖惩类型 + + + + + + + 基础URL + + + + + + 监管统计控制器 + + + + + 监管统计 + + + + + + + + + + + 查询所有监管统计信息 + + + + + + 系统模块控制器 + + + + + 系统模块 + + + + + + + + + + + 获取所有模块 + + + + + + 根据账号获取对应模块 + + + + + + + 批量添加模块 + + + + + + + 批量删除模块 + + + + + + + 公告控制器 + + + + + 公告 + + + + + + + + + + + 获取所有公告信息 + + + + + + 上传公告信息 + + + + + + + 会员规则控制器 + + + + + 会员规则 + + + + + + + + + + + 查询会员等级规则列表 + + + + + + 查询会员等级规则 + + + + + + + 添加会员等级规则 + + + + + + + 删除会员等级规则 + + + + + + + 更新会员等级规则 + + + + + + + Mvc扩展方法 + + + + + 扩展方法 + + + + + + + + + + + + + + + + + + + + + + + + + 全局路由前缀配置 + + + + + 定义一个路由前缀变量 + + + + + 调用时传入指定的路由前缀 + + + + + + AutoFac + + + + + diff --git a/EOM.TSHotelManager.WebApi/MvcOptionsExtensions.cs b/EOM.TSHotelManager.WebApi/MvcOptionsExtensions.cs new file mode 100644 index 0000000000000000000000000000000000000000..a98e2b1e6df55784d20b41255db792592843d442 --- /dev/null +++ b/EOM.TSHotelManager.WebApi/MvcOptionsExtensions.cs @@ -0,0 +1,22 @@ +using Microsoft.AspNetCore.Mvc.Routing; +using Microsoft.AspNetCore.Mvc; + +namespace EOM.TSHotelManager.WebApi +{ + /// + /// Mvc扩展方法 + /// + public static class MvcOptionsExtensions + { + /// + /// 扩展方法 + /// + /// + /// + public static void UseCentralRoutePrefix(this MvcOptions opts, IRouteTemplateProvider routeAttribute) + { + // 添加我们自定义 实现IApplicationModelConvention的RouteConvention + opts.Conventions.Insert(0, new RouteConvention(routeAttribute)); + } + } +} diff --git a/EOM.TSHotelManager.WebApi/Program.cs b/EOM.TSHotelManager.WebApi/Program.cs new file mode 100644 index 0000000000000000000000000000000000000000..3cf7d8bc44b6d1ade7cad7083efaaf6948cdf19c --- /dev/null +++ b/EOM.TSHotelManager.WebApi/Program.cs @@ -0,0 +1,42 @@ +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 +{ + /// + /// + /// + public class Program + { + /// + /// + /// + /// + public static void Main(string?[] args) + { + CreateHostBuilder(args).Build().Run(); + } + + /// + /// + /// + /// + /// + public static IHostBuilder CreateHostBuilder(string?[] args) => + Host.CreateDefaultBuilder(args) + .UseServiceProviderFactory(new AutofacServiceProviderFactory())//滻Ĭ + .ConfigureWebHostDefaults(webBuilder => + { + webBuilder.UseStartup(); + }); + } +} diff --git a/HotelManagerSystemWebApi.Web.Entry/Properties/launchSettings.json b/EOM.TSHotelManager.WebApi/Properties/launchSettings.json similarity index 66% rename from HotelManagerSystemWebApi.Web.Entry/Properties/launchSettings.json rename to EOM.TSHotelManager.WebApi/Properties/launchSettings.json index 74af6a9893b21749894fda805bd1a7f850a643bc..6cbbe87453e5968c6fb3437e3fc45e562a1e81a8 100644 --- a/HotelManagerSystemWebApi.Web.Entry/Properties/launchSettings.json +++ b/EOM.TSHotelManager.WebApi/Properties/launchSettings.json @@ -4,28 +4,28 @@ "windowsAuthentication": false, "anonymousAuthentication": true, "iisExpress": { - "applicationUrl": "http://localhost:53785", - "sslPort": 44342 + "applicationUrl": "http://localhost:63001", + "sslPort": 0 } }, "profiles": { "IIS Express": { "commandName": "IISExpress", "launchBrowser": true, - "launchUrl": "", + "launchUrl": "swagger/index.html", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } }, - "HotelManagerSystemWebApi.Web.Entry": { + "EOM.TSHotelManager.WebApi": { "commandName": "Project", - "dotnetRunMessages": "true", + "dotnetRunMessages": true, "launchBrowser": true, - "launchUrl": "", - "applicationUrl": "https://localhost:5001;http://localhost:5000", + "launchUrl": "swagger/index.html", + "applicationUrl": "http://localhost:63001", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } } } -} \ No newline at end of file +} diff --git a/EOM.TSHotelManager.WebApi/RouteConvention.cs b/EOM.TSHotelManager.WebApi/RouteConvention.cs new file mode 100644 index 0000000000000000000000000000000000000000..42eb6dd7ab47f93768ff9932159dcc1a87725f39 --- /dev/null +++ b/EOM.TSHotelManager.WebApi/RouteConvention.cs @@ -0,0 +1,57 @@ +using Microsoft.AspNetCore.Mvc.ApplicationModels; +using Microsoft.AspNetCore.Mvc.Routing; +using System.Linq; + +namespace EOM.TSHotelManager.WebApi +{ + /// + /// 全局路由前缀配置 + /// + public class RouteConvention:IApplicationModelConvention + { + /// + /// 定义一个路由前缀变量 + /// + private readonly AttributeRouteModel _centralPrefix; + + /// + /// 调用时传入指定的路由前缀 + /// + /// + public RouteConvention(IRouteTemplateProvider routeTemplateProvider) + { + _centralPrefix = new AttributeRouteModel(routeTemplateProvider); + } + + //接口的Apply方法 + public void Apply(ApplicationModel application) + { + //遍历所有的 Controller + foreach (var controller in application.Controllers) + { + // 1、已经标记了 RouteAttribute 的 Controller + //这一块需要注意,如果在控制器中已经标注有路由了,则会在路由的前面再添加指定的路由内容。 + var matchedSelectors = controller.Selectors.Where(x => x.AttributeRouteModel != null).ToList(); + if (matchedSelectors.Any()) + { + foreach (var selectorModel in matchedSelectors) + { + // 在 当前路由上 再 添加一个 路由前缀 + selectorModel.AttributeRouteModel = AttributeRouteModel.CombineAttributeRouteModel(_centralPrefix, + selectorModel.AttributeRouteModel); + } + } + //2、 没有标记 RouteAttribute 的 Controller + var unmatchedSelectors = controller.Selectors.Where(x => x.AttributeRouteModel == null).ToList(); + if (unmatchedSelectors.Any()) + { + foreach (var selectorModel in unmatchedSelectors) + { + // 添加一个 路由前缀 + selectorModel.AttributeRouteModel = _centralPrefix; + } + } + } + } + } +} diff --git a/EOM.TSHotelManager.WebApi/Startup.cs b/EOM.TSHotelManager.WebApi/Startup.cs new file mode 100644 index 0000000000000000000000000000000000000000..3d7e3b410cc0f6dc1df46b8aa80d139a4875e86c --- /dev/null +++ b/EOM.TSHotelManager.WebApi/Startup.cs @@ -0,0 +1,139 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Threading.Tasks; +using Autofac; +using EncryptTools.Core; +using EOM.TSHotelManager.EntityFramework; +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.OpenApi.Models; + +namespace EOM.TSHotelManager.WebApi +{ + public class Startup + { + public Startup(IConfiguration 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.AddControllers(); + + #region ȫ· + //ڸǰ׺ûض·ǰǰ׺ + services.AddMvc(opt => + { + opt.UseCentralRoutePrefix(new RouteAttribute("api/[controller]/[action]")); + }); + #endregion + + #region עSwagger + services.AddSwaggerGen(s => + { + #region ע Swagger + s.SwaggerDoc("v1", new OpenApiInfo() + { + Title = "EOM.TSHotelManager.Web", //Swaggerĵ + Version = "version-1.0.0", //Swaggerĵİ汾 + Description = "ӿĵ", //Swaggerĵ + License = new OpenApiLicense() + { + Name = "MIT", + Url = new Uri("https://mit-license.org/") + }, //SwaggerĵĿԴȨЭ + TermsOfService = new Uri("https://www.oscode.top/"), //Swaggerĵķ֧ҳ + Contact = new OpenApiContact + { + Name = "׿Ԫ(Easy-Open-Meta)", + Email = "eom-official@oscode.top", + Url = new Uri("https://www.oscode.top/") + } + }); + //ȡͬ¸ֲxmlעͣһȡҵ߼㡢ʵͽӿڲ㼴 + s.IncludeXmlComments("bin/Debug/net6.0/EOM.TSHotelManager.Application.xml"); + s.IncludeXmlComments("bin/Debug/net6.0/EOM.TSHotelManager.Core.xml"); + s.IncludeXmlComments("bin/Debug/net6.0/EOM.TSHotelManager.WebApi.xml"); + #endregion + + #region ʽʱ + //s.IncludeXmlComments("EOM.TSHotelManager.Application.xml"); + //s.IncludeXmlComments("EOM.TSHotelManager.Core.xml"); + //s.IncludeXmlComments("EOM.TSHotelManager.WebApi.xml"); + #endregion + }); + #endregion + + + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IWebHostEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + + app.UseRouting(); + + app.UseAuthorization(); + + app.UseEndpoints(endpoints => + { + endpoints.MapControllers(); + }); + + + #region ʹSwaggerм + app.UseSwagger(); + app.UseSwaggerUI(s => + { + s.SwaggerEndpoint("/swagger/v1/swagger.json", "EOM.TSHotelManagerӿĵ"); + }); + #endregion + } + + /// + /// AutoFac + /// + /// + public void ConfigureContainer(ContainerBuilder builder) + { + #region AutoFac IOC,ʵע + try + { + //עִ + builder.RegisterGeneric(typeof(PgRepository<>)).As(typeof(PgRepository<>)); + + //ע + var assemblyService = Assembly.LoadFrom(Path.Combine(AppContext.BaseDirectory, "EOM.TSHotelManager.Application.dll")); + builder.RegisterAssemblyTypes(assemblyService) + .AsImplementedInterfaces() + .InstancePerDependency() + .PropertiesAutowired(); + } + catch (Exception ex) + { + throw new Exception(ex.Message + "\n" + ex.InnerException); + } + #endregion + } + + + } +} diff --git a/HotelManagerSystemWebApi.Web.Entry/appsettings.Development.json b/EOM.TSHotelManager.WebApi/appsettings.Development.json similarity index 98% rename from HotelManagerSystemWebApi.Web.Entry/appsettings.Development.json rename to EOM.TSHotelManager.WebApi/appsettings.Development.json index 45fe774a9f86f1e84f718cc516e30f7390408b1e..8983e0fc1c5e2795ccfde0c771c6d66c88ef4a42 100644 --- a/HotelManagerSystemWebApi.Web.Entry/appsettings.Development.json +++ b/EOM.TSHotelManager.WebApi/appsettings.Development.json @@ -6,4 +6,4 @@ "Microsoft.Hosting.Lifetime": "Information" } } -} \ No newline at end of file +} diff --git a/EOM.TSHotelManager.WebApi/appsettings.json b/EOM.TSHotelManager.WebApi/appsettings.json new file mode 100644 index 0000000000000000000000000000000000000000..d9d9a9bff6fd6f3ee7ea00de958f135a4a28c6e6 --- /dev/null +++ b/EOM.TSHotelManager.WebApi/appsettings.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Information", + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information" + } + }, + "AllowedHosts": "*" +} diff --git a/HotelManagerSystemWebApi.Application/HotelManagerSystemWebApi.Application.csproj b/HotelManagerSystemWebApi.Application/HotelManagerSystemWebApi.Application.csproj deleted file mode 100644 index 296a0ff572bcc6354e38626d8092ad5a3ca046e7..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Application/HotelManagerSystemWebApi.Application.csproj +++ /dev/null @@ -1,30 +0,0 @@ - - - - net5.0 - 1701;1702;1591 - HotelManagerSystemWebApi.Application.xml - - - - - - - - - - PreserveNewest - - - - - - - - - - - - - - diff --git a/HotelManagerSystemWebApi.Application/HotelManagerSystemWebApi.Application.xml b/HotelManagerSystemWebApi.Application/HotelManagerSystemWebApi.Application.xml deleted file mode 100644 index 576ef1988d32239576ac8adee17ab94121be4c42..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Application/HotelManagerSystemWebApi.Application.xml +++ /dev/null @@ -1,319 +0,0 @@ - - - - HotelManagerSystemWebApi.Application - - - - - 管理员信息控制器 - - - - - 管理员信息 - - - - - 构造函数 - - - - - - 查询管理员信息列表 - - - - - - - 查询管理员信息 - - - - - - - 添加管理员信息 - - - - - - - 删除管理员信息 - - - - - - - 更新管理员信息 - - - - - - - 添加管理员信息 - 输入DTO - - - - - 管理员账号 - - - - - 管理员密码 - - - - - 管理员类型 - - - - - 管理员名称 - - - - - 是否为超级管理员 - - - - - 删除标记 - - - - - 资料新增人 - - - - - 资料新增时间 - - - - - 查询管理员信息 - 输入DTO - - - - - 管理员账号 - - - - - 查询管理员信息列表 - 输入DTO - - - - - 管理员名称 - - - - - 是否为超级管理员 - - - - - 删除管理员信息 - 输入DTO - - - - - 管理员账号 - - - - - 添加管理员信息 - 输出DTO - - - - - 查询管理员信息 - 输出DTO - - - - - 数据源 - - - - - 查询管理员信息列表 - - - - - 数据源 - - - - - 删除管理员信息 - 输出DTO - - - - - 更新管理员信息 - 输出DTO - - - - - 更新管理员信息 - 输入DTO - - - - - 管理员账号 - - - - - 管理员密码 - - - - - 管理员类型 - - - - - 管理员名称 - - - - - 是否为超级管理员 - - - - - 删除标记 - - - - - 资料新增人 - - - - - 资料新增时间 - - - - - 管理员信息模块接口实现 - - - - - 管理员信息仓储 - - - - - - - - - - - 查询管理员信息列表 - - - - - - - 查询管理员信息 - - - - - - - 添加管理员信息 - - - - - - - 删除管理员信息 - - - - - - - 更新管理员信息 - - - - - - - 管理员信息模块接口 - - - - - 查询管理员信息列表 - - - - - - - 查询管理员信息 - - - - - - - 添加管理员信息 - - - - - - - 删除管理员信息 - - - - - - - 更新管理员信息 - - - - - - diff --git a/HotelManagerSystemWebApi.Application/Zero/AdminInfo/AdminInfoAppService.cs b/HotelManagerSystemWebApi.Application/Zero/AdminInfo/AdminInfoAppService.cs deleted file mode 100644 index 3d97d68ddf2cebcc74591e7b8f468d2d4a37aa33..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Application/Zero/AdminInfo/AdminInfoAppService.cs +++ /dev/null @@ -1,81 +0,0 @@ -using Furion.DependencyInjection; -using Furion.DynamicApiController; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HotelManagerSystemWebApi.Application -{ - /// - /// 管理员信息控制器 - /// - public class AdminInfoAppService: IDynamicApiController - { - /// - /// 管理员信息 - /// - private readonly IAdminInfoService adminInfoService; - - /// - /// 构造函数 - /// - /// - public AdminInfoAppService(IAdminInfoService adminInfoService) - { - this.adminInfoService = adminInfoService; - } - - /// - /// 查询管理员信息列表 - /// - /// - /// - public OAdminInfoListDto AdminInfoList(AdminInfoListDto adminInfoListDto) - { - return adminInfoService.AdminInfoList(adminInfoListDto); - } - - /// - /// 查询管理员信息 - /// - /// - /// - public OAdminInfoDto AdminInfo(AdminInfoDto adminInfoDto) - { - return adminInfoService.AdminInfo(adminInfoDto); - } - - /// - /// 添加管理员信息 - /// - /// - /// - public OAddAdminInfoDto AddAdminInfo(AddAdminInfoDto addAdminInfoDto) - { - return adminInfoService.AddAdminInfo(addAdminInfoDto); - } - - /// - /// 删除管理员信息 - /// - /// - /// - public ODelAdminInfoDto DelAdminInfo(DelAdminInfoDto delAdminInfoDto) - { - return adminInfoService.DelAdminInfo(delAdminInfoDto); - } - - /// - /// 更新管理员信息 - /// - /// - /// - public OUpdAdminInfoDto UpdAdminInfo(UpdAdminInfoDto updAdminInfoDto) - { - return adminInfoService.UpdAdminInfo(updAdminInfoDto); - } - - } -} diff --git a/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/AddAdminInfoDto.cs b/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/AddAdminInfoDto.cs deleted file mode 100644 index 23e05e5bc310f7b1828c3f4b305c516a42d69fc0..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/AddAdminInfoDto.cs +++ /dev/null @@ -1,57 +0,0 @@ -using HotelManagerSystemWebApi.Core; -using System.ComponentModel.DataAnnotations; - -namespace HotelManagerSystemWebApi.Application -{ - /// - /// 添加管理员信息 - /// 输入DTO - /// - public class AddAdminInfoDto:IBaseDto - { - /// - /// 管理员账号 - /// - [Required] - public System.String AdminAccount { get; set; } - - /// - /// 管理员密码 - /// - [Required] - public System.String AdminPassword { get; set; } - - /// - /// 管理员类型 - /// - [Required] - public System.String AdminType { get; set; } - - /// - /// 管理员名称 - /// - [Required] - public System.String AdminName { get; set; } - - /// - /// 是否为超级管理员 - /// - public System.Int32 IsAdmin { get; set; } - - /// - /// 删除标记 - /// - public System.Int32 DeleteMk { get; set; } - - /// - /// 资料新增人 - /// - public System.String datains_usr { get; set; } - - /// - /// 资料新增时间 - /// - public System.DateTime? datains_time { get; set; } - - } -} \ No newline at end of file diff --git a/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/AdminInfoDto.cs b/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/AdminInfoDto.cs deleted file mode 100644 index fab52f25010bb5a971d0e36508bbe085d31eccb8..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/AdminInfoDto.cs +++ /dev/null @@ -1,18 +0,0 @@ -using HotelManagerSystemWebApi.Core; -using System.ComponentModel.DataAnnotations; - -namespace HotelManagerSystemWebApi.Application -{ - /// - /// 查询管理员信息 - /// 输入DTO - /// - public class AdminInfoDto:IBaseDto - { - /// - /// 管理员账号 - /// - [Required] - public string AdminAccount { get; set; } - } -} \ No newline at end of file diff --git a/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/AdminInfoListDto.cs b/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/AdminInfoListDto.cs deleted file mode 100644 index 87607b1e373c3e4267a79a3f5592a454454ef0b5..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/AdminInfoListDto.cs +++ /dev/null @@ -1,21 +0,0 @@ -using HotelManagerSystemWebApi.Core; - -namespace HotelManagerSystemWebApi.Application -{ - /// - /// 查询管理员信息列表 - /// 输入DTO - /// - public class AdminInfoListDto:IListDto - { - /// - /// 管理员名称 - /// - public string AdminName { get; set; } - - /// - /// 是否为超级管理员 - /// - public int? IsAdmin { get; set; } - } -} \ No newline at end of file diff --git a/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/DelAdminInfoDto.cs b/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/DelAdminInfoDto.cs deleted file mode 100644 index 65d93e791d9d2b056f372dca0cf26ede12b84f63..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/DelAdminInfoDto.cs +++ /dev/null @@ -1,18 +0,0 @@ -using HotelManagerSystemWebApi.Core; -using System.ComponentModel.DataAnnotations; - -namespace HotelManagerSystemWebApi.Application -{ - /// - /// 删除管理员信息 - /// 输入DTO - /// - public class DelAdminInfoDto:IBaseDto - { - /// - /// 管理员账号 - /// - [Required] - public System.String AdminAccount { get; set; } - } -} \ No newline at end of file diff --git a/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/OAddAdminInfoDto.cs b/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/OAddAdminInfoDto.cs deleted file mode 100644 index 330ac58a53d4bd375a75154e4753cd223f953deb..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/OAddAdminInfoDto.cs +++ /dev/null @@ -1,13 +0,0 @@ -using HotelManagerSystemWebApi.Core; - -namespace HotelManagerSystemWebApi.Application -{ - /// - /// 添加管理员信息 - /// 输出DTO - /// - public class OAddAdminInfoDto:MsgDto - { - - } -} \ No newline at end of file diff --git a/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/OAdminInfoDto.cs b/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/OAdminInfoDto.cs deleted file mode 100644 index 99da1e02adad3b74785521123635fa7b9e2fb6bf..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/OAdminInfoDto.cs +++ /dev/null @@ -1,16 +0,0 @@ -using HotelManagerSystemWebApi.Core; - -namespace HotelManagerSystemWebApi.Application -{ - /// - /// 查询管理员信息 - /// 输出DTO - /// - public class OAdminInfoDto:MsgDto - { - /// - /// 数据源 - /// - public AdminInfo source { get; set; } - } -} \ No newline at end of file diff --git a/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/OAdminInfoListDto.cs b/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/OAdminInfoListDto.cs deleted file mode 100644 index e4d4ad7d11ce291bae856ad135eac61ce78ce43b..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/OAdminInfoListDto.cs +++ /dev/null @@ -1,17 +0,0 @@ -using HotelManagerSystemWebApi.Core; -using System.Collections.Generic; - -namespace HotelManagerSystemWebApi.Application -{ - /// - /// 查询管理员信息列表 - /// - public class OAdminInfoListDto:MsgDto - { - /// - /// 数据源 - /// - public List listSource { get; set; } - - } -} \ No newline at end of file diff --git a/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/ODelAdminInfoDto.cs b/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/ODelAdminInfoDto.cs deleted file mode 100644 index a262e0de761f8c36164c0d659f88bd16294787c9..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/ODelAdminInfoDto.cs +++ /dev/null @@ -1,13 +0,0 @@ -using HotelManagerSystemWebApi.Core; - -namespace HotelManagerSystemWebApi.Application -{ - /// - /// 删除管理员信息 - /// 输出DTO - /// - public class ODelAdminInfoDto:MsgDto - { - - } -} \ No newline at end of file diff --git a/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/OUpdAdminInfoDto.cs b/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/OUpdAdminInfoDto.cs deleted file mode 100644 index 179b2d444b8ca44afdeb1e8753efea35c4110275..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/OUpdAdminInfoDto.cs +++ /dev/null @@ -1,12 +0,0 @@ -using HotelManagerSystemWebApi.Core; - -namespace HotelManagerSystemWebApi.Application -{ - /// - /// 更新管理员信息 - /// 输出DTO - /// - public class OUpdAdminInfoDto:MsgDto - { - } -} \ No newline at end of file diff --git a/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/UpdAdminInfoDto.cs b/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/UpdAdminInfoDto.cs deleted file mode 100644 index 28193bf5a47823419ed97a3378ec71b45dfadcc4..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Dtos/UpdAdminInfoDto.cs +++ /dev/null @@ -1,56 +0,0 @@ -using HotelManagerSystemWebApi.Core; -using System.ComponentModel.DataAnnotations; - -namespace HotelManagerSystemWebApi.Application -{ - /// - /// 更新管理员信息 - /// 输入DTO - /// - public class UpdAdminInfoDto:IBaseDto - { - /// - /// 管理员账号 - /// - [Required] - public System.String AdminAccount { get; set; } - - /// - /// 管理员密码 - /// - [Required] - public System.String AdminPassword { get; set; } - - /// - /// 管理员类型 - /// - [Required] - public System.String AdminType { get; set; } - - /// - /// 管理员名称 - /// - [Required] - public System.String AdminName { get; set; } - - /// - /// 是否为超级管理员 - /// - public System.Int32 IsAdmin { get; set; } - - /// - /// 删除标记 - /// - public System.Int32 DeleteMk { get; set; } - - /// - /// 资料新增人 - /// - public System.String datains_usr { get; set; } - - /// - /// 资料新增时间 - /// - public System.DateTime? datains_time { get; set; } - } -} \ No newline at end of file diff --git a/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Services/AdminInfoService.cs b/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Services/AdminInfoService.cs deleted file mode 100644 index 82bc023f6b5bf1b4248c1dd7771d085d60becd83..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Application/Zero/AdminInfo/Services/AdminInfoService.cs +++ /dev/null @@ -1,196 +0,0 @@ -using Furion.DatabaseAccessor; -using Furion.DependencyInjection; -using Furion.LinqBuilder; -using HotelManagerSystemWebApi.Core; -using jvncorelib.Entitylib; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HotelManagerSystemWebApi.Application -{ - /// - /// 管理员信息模块接口实现 - /// - public class AdminInfoService: IAdminInfoService, ITransient - //笔记:如果把Migrations层删除后使用瞬时服务,必须让EntityFramework.Core层被Web.Core层引用,否则会导致服务无法被正常识别 - { - /// - /// 管理员信息仓储 - /// - private readonly IRepository adminInfoRepository; - - /// - /// - /// - /// - public AdminInfoService(IRepository adminInfoRepository) - { - this.adminInfoRepository = adminInfoRepository; - } - - /// - /// 查询管理员信息列表 - /// - /// - /// - public OAdminInfoListDto AdminInfoList(AdminInfoListDto adminInfoListDto) - { - OAdminInfoListDto oAdminInfoListDto = new OAdminInfoListDto(); - - var where = LinqExpression.Create(a => a.DeleteMk != 1); - - //管理员名称 - if (!adminInfoListDto.AdminName.IsNullOrEmpty()) - { - where = where.And(a => a.AdminName.Equals(adminInfoListDto.AdminName)); - } - //是否为超级管理员 - if (!adminInfoListDto.IsAdmin.IsNullOrEmpty()) - { - where = where.And(a => a.IsAdmin == adminInfoListDto.IsAdmin); - } - - var listSource = adminInfoRepository.AsQueryable(where).Distinct().ToList(); - - oAdminInfoListDto.listSource = listSource; - - oAdminInfoListDto.OK(); - - return oAdminInfoListDto; - } - - /// - /// 查询管理员信息 - /// - /// - /// - public OAdminInfoDto AdminInfo(AdminInfoDto adminInfoDto) - { - OAdminInfoDto oAdminInfoDto = new OAdminInfoDto(); - - var where = LinqExpression.Create(a => a.DeleteMk != 1); - - //管理员账号 - if (!adminInfoDto.AdminAccount.IsNullOrEmpty()) - { - where = where.And(a => a.AdminAccount.Equals(adminInfoDto.AdminAccount)); - } - - var source = adminInfoRepository.FirstOrDefault(where); - - if (source.IsNullOrEmpty()) - { - oAdminInfoDto.Error_NotFound(); - return oAdminInfoDto; - } - - oAdminInfoDto.source = source; - oAdminInfoDto.OK(); - - return oAdminInfoDto; - } - - /// - /// 添加管理员信息 - /// - /// - /// - public OAddAdminInfoDto AddAdminInfo(AddAdminInfoDto addAdminInfoDto) - { - OAddAdminInfoDto oAddAdminInfoDto = new OAddAdminInfoDto(); - - var where = LinqExpression.Create(a => a.DeleteMk != 1); - - //管理员账号 - if (!addAdminInfoDto.AdminAccount.IsNullOrEmpty()) - { - where = where.And(a => a.AdminAccount.Equals(addAdminInfoDto.AdminAccount)); - } - - var source = adminInfoRepository.FirstOrDefault(where); - - if (!source.IsNullOrEmpty()) - { - oAddAdminInfoDto.Error_Exist("该管理员已存在,无法添加"); - return oAddAdminInfoDto; - } - - source = source.UpdateToModel(addAdminInfoDto); - source.datains_usr = addAdminInfoDto.NowLoginUsr; - source.datains_time = DateTime.Now; - this.adminInfoRepository.Insert(source); - - oAddAdminInfoDto.OK(); - - return oAddAdminInfoDto; - } - - /// - /// 删除管理员信息 - /// - /// - /// - public ODelAdminInfoDto DelAdminInfo(DelAdminInfoDto delAdminInfoDto) - { - ODelAdminInfoDto oDelAdminInfoDto = new ODelAdminInfoDto(); - - var where = LinqExpression.Create(a => a.DeleteMk != 1); - - //管理员账号 - if (!delAdminInfoDto.AdminAccount.IsNullOrEmpty()) - { - where = where.And(a => a.AdminAccount.Equals(delAdminInfoDto.AdminAccount)); - } - - var source = adminInfoRepository.FirstOrDefault(where); - - if (source.IsNullOrEmpty()) - { - oDelAdminInfoDto.Error_NotFound(); - return oDelAdminInfoDto; - } - - this.adminInfoRepository.Delete(source); - - oDelAdminInfoDto.OK(); - - return oDelAdminInfoDto; - } - - /// - /// 更新管理员信息 - /// - /// - /// - public OUpdAdminInfoDto UpdAdminInfo(UpdAdminInfoDto updAdminInfoDto) - { - OUpdAdminInfoDto oUpdAdminInfoDto = new OUpdAdminInfoDto(); - - var where = LinqExpression.Create(a => a.DeleteMk != 1); - - //管理员账号 - if (!updAdminInfoDto.AdminAccount.IsNullOrEmpty()) - { - where = where.And(a => a.AdminAccount.Equals(updAdminInfoDto.AdminAccount)); - } - - var source = adminInfoRepository.FirstOrDefault(where); - - if (source.IsNullOrEmpty()) - { - oUpdAdminInfoDto.Error_Exist(); - return oUpdAdminInfoDto; - } - - source = source.UpdateToModel(updAdminInfoDto); - source.datains_usr = updAdminInfoDto.NowLoginUsr; - source.datains_time = DateTime.Now; - this.adminInfoRepository.Update(source); - oUpdAdminInfoDto.OK(); - return oUpdAdminInfoDto; - } - } -} diff --git a/HotelManagerSystemWebApi.Application/applicationsettings.json b/HotelManagerSystemWebApi.Application/applicationsettings.json deleted file mode 100644 index 83ae7e9c32d1d13d6efa3f525c2160375226aa3b..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Application/applicationsettings.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "SpecificationDocumentSettings": { - "DocumentTitle": "TSHotelManagerSystem 2.0 | WebAPI接口文档", - "GroupOpenApiInfos": [ - { - "DefaultGroupName": "TSHotelManagerSystem 2.0", - "Group": "Default", - "Title": "WebAPI接口文档", - "Description": "用于TS酒店管理系统v2.0版本的后端WebAPI接口。", - "Version": "1.0.0", - "TermsOfService": "https://gitee.com/java-and-net/topsky-hotel-manager-system-web-api", - "Contact": { - "Name": "咖啡与网络(Java&Net)", - "Url": "https://www.jvnorg.site/", - "Email": "jvnopensource@163.com" - }, - "License": { - "Name": "MIT", - "Url": "https://gitee.com/java-and-net/topsky-hotel-manager-system-web-api/blob/master/LICENSE" - } - } - ] - } -} \ No newline at end of file diff --git a/HotelManagerSystemWebApi.Core/Customer/CustomerInfo.cs b/HotelManagerSystemWebApi.Core/Customer/CustomerInfo.cs deleted file mode 100644 index cd4ed89cb4d56c73fdf44938ec429dc0c199175a..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Core/Customer/CustomerInfo.cs +++ /dev/null @@ -1,92 +0,0 @@ -using Furion.DatabaseAccessor; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace HotelManagerSystemWebApi.Core -{ - /// - /// 客户信息表 - /// - [Table("userinfo")] - public class CustomerInfo : IEntity - { - /// - /// - /// - public CustomerInfo() - { - } - - /// - /// 用户编号 - /// - [Key] - [Column(Order = 1)] - public System.String CustoNo { get; set; } - - /// - /// 用户名称 - /// - public System.String CustoName { get; set; } - - /// - /// 用户性别 - /// - public System.Int32 CustoSex { get; set; } - - /// - /// 用户电话 - /// - public System.String CustoTel { get; set; } - - /// - /// 证照类型 - /// - public System.Int32 PassportType { get; set; } - - /// - /// 证件号码 - /// - public System.String CustoID { get; set; } - - /// - /// 居住地址 - /// - public System.String CustoAdress { get; set; } - - /// - /// 出生日期 - /// - public System.DateTime CustoBirth { get; set; } - - /// - /// 客户类型 - /// - public System.Int32 CustoType { get; set; } - - /// - /// 删除标记 - /// - public System.Int32 delete_mk { get; set; } - - /// - /// 资料创建人 - /// - public System.String datains_usr { get; set; } - - /// - /// 资料创建时间 - /// - public System.DateTime? datains_date { get; set; } - - /// - /// 资料更新人 - /// - public System.String datachg_usr { get; set; } - - /// - /// 资料更新时间 - /// - public System.DateTime? datachg_date { get; set; } - } -} diff --git a/HotelManagerSystemWebApi.Core/Customer/CustomerType.cs b/HotelManagerSystemWebApi.Core/Customer/CustomerType.cs deleted file mode 100644 index 5231e89b83a4d99c9e45b501f061013a45f04fe2..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Core/Customer/CustomerType.cs +++ /dev/null @@ -1,57 +0,0 @@ -using Furion.DatabaseAccessor; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace HotelManagerSystemWebApi.Core -{ - /// - /// 客户类型表 - /// - [Table("usertype")] - public class CustomerType : IEntity - { - /// - /// - /// - public CustomerType() - { - } - - /// - /// 客户类型ID - /// - [Key] - [Column(Order = 1)] - public System.Int32 UserType { get; set; } - - /// - /// 客户类型名称 - /// - public System.String TypeName { get; set; } - - /// - /// 删除标记 - /// - public System.Int32 delete_mk { get; set; } - - /// - /// 资料创建人 - /// - public System.String datains_usr { get; set; } - - /// - /// 资料创建时间 - /// - public System.DateTime? datains_date { get; set; } - - /// - /// 资料更新人 - /// - public System.String datachg_usr { get; set; } - - /// - /// 资料更新时间 - /// - public System.DateTime? datachg_date { get; set; } - } -} diff --git a/HotelManagerSystemWebApi.Core/Customer/VipRule.cs b/HotelManagerSystemWebApi.Core/Customer/VipRule.cs deleted file mode 100644 index 10b4b706a1ae272f415bd4f129886bad5a860069..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Core/Customer/VipRule.cs +++ /dev/null @@ -1,72 +0,0 @@ -using Furion.DatabaseAccessor; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace HotelManagerSystemWebApi.Core -{ - /// - /// 会员等级规则表 - /// - [Table("vip_rule")] - public class VipRule : IEntity - { - /// - /// 会员等级规则表 - /// - public VipRule() - { - } - - /// - /// 索引ID - /// - [Key] - [Column(Order = 1)] - public System.Int32 id { get; set; } - - /// - /// 会员规则流水号 - /// - public System.String rule_id { get; set; } - - /// - /// 会员规则名称 - /// - public System.String rule_name { get; set; } - - /// - /// 预设数值 - /// - public System.Decimal rule_value { get; set; } - - /// - /// 会员等级 - /// - public System.Int32 type_id { get; set; } - - /// - /// 删除标记 - /// - public System.Int32 delete_mk { get; set; } - - /// - /// 资料创建人 - /// - public System.String datains_usr { get; set; } - - /// - /// 资料创建时间 - /// - public System.DateTime? datains_date { get; set; } - - /// - /// 资料更新人 - /// - public System.String datachg_usr { get; set; } - - /// - /// 资料更新时间 - /// - public System.DateTime? datachg_date { get; set; } - } -} diff --git a/HotelManagerSystemWebApi.Core/DtoExtend/BaseDto/BaseDto.cs b/HotelManagerSystemWebApi.Core/DtoExtend/BaseDto/BaseDto.cs deleted file mode 100644 index 70008b1f2ab219f76c7ad3f6f8ce5e327cd4c553..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Core/DtoExtend/BaseDto/BaseDto.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HotelManagerSystemWebApi.Core -{ - /// - /// DTO基础类 - /// - public class BaseDto - { - /// - /// 当前登录人员 - /// - public string NowLoginUsr { get; set; } - } -} diff --git a/HotelManagerSystemWebApi.Core/DtoExtend/BaseDto/IBaseDto.cs b/HotelManagerSystemWebApi.Core/DtoExtend/BaseDto/IBaseDto.cs deleted file mode 100644 index c7e68ae555386766cde2978dd70c61dd5f3e6f9b..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Core/DtoExtend/BaseDto/IBaseDto.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HotelManagerSystemWebApi.Core -{ - /// - /// 输入DTO - /// - public class IBaseDto:BaseDto - { - - } -} diff --git a/HotelManagerSystemWebApi.Core/DtoExtend/BaseDto/IListDto.cs b/HotelManagerSystemWebApi.Core/DtoExtend/BaseDto/IListDto.cs deleted file mode 100644 index 6e652b323eea5bb702a745b227b3d1543665288c..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Core/DtoExtend/BaseDto/IListDto.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HotelManagerSystemWebApi.Core -{ - /// - /// 输入DTO(列表) - /// - public class IListDto:BaseDto - { - /// - /// 页数 - /// - public int? PageIndex { get; set; } - - /// - /// 总数 - /// - public int? PageSize { get; set; } - } -} diff --git a/HotelManagerSystemWebApi.Core/DtoExtend/BaseDto/MsgDto.cs b/HotelManagerSystemWebApi.Core/DtoExtend/BaseDto/MsgDto.cs deleted file mode 100644 index f0b8b71c54e26c57783b16714279241aa9d18879..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Core/DtoExtend/BaseDto/MsgDto.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HotelManagerSystemWebApi.Core -{ - /// - /// 输出DTO - /// - public abstract class MsgDto:BaseDto - { - /// - /// 状态码 - /// - public StatusCode Status { get; set; } - /// - /// 消息 - /// - public string ErrorMessage { get; set; } - } -} diff --git a/HotelManagerSystemWebApi.Core/DtoExtend/DtoExtend.cs b/HotelManagerSystemWebApi.Core/DtoExtend/DtoExtend.cs deleted file mode 100644 index 2895fa2b068d2f67c816a1fd9b0607374fd2fd2b..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Core/DtoExtend/DtoExtend.cs +++ /dev/null @@ -1,361 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; -using System.Threading.Tasks; - -namespace HotelManagerSystemWebApi.Core -{ - /// - /// 实体类库 - /// - public static class DtoExtend - { - /// - /// 复制实体A的数据到实体B - /// - /// - /// - /// - /// - public static T2 CopyModelTo(this T1 t1) where T2 : class, new() - { - T2 t2 = Activator.CreateInstance(); - var tInType = t1.GetType(); - foreach (var itemOut in t1.GetType().GetProperties()) - { - var itemIn = tInType.GetProperty(itemOut.Name); ; - if (itemIn != null) - { - itemOut.SetValue(t2, itemIn.GetValue(t1)); - } - } - return t2; - } - - /// - /// 实体更新数据 - /// - /// 输出实体类型 - /// 输入实体类型 - /// 输入数据源 - /// 输入数据源 - /// 输出数据源 - /// - public static T1 UpdateToModel(this T1 _T1, T2 _T2) where T2 : class where T1 : class, new() - { - if (_T1 == null) - { - _T1 = new T1(); - } - List _T1PI = typeof(T1).GetProperties().ToList(); - List _T2PI = typeof(T2).GetProperties().ToList(); - if (_T2 == null) - { - return _T1; - } - - _T1PI.ForEach(_PI1 => - { - _T2PI.ForEach(_PI2 => - { - //字段名称 - var propName = _PI2.Name.ToUpper(); - //判断源实体中有没有对应的字段属性 - if (!propName.Equals(_PI1.Name.ToUpper())) - { - //获取字段的自定义属性 - var mappingField = _PI2.GetCustomAttribute(); - //如果自定义的映射属性存在,则取属性名称 - if (mappingField != null) - { - propName = mappingField.ColName; - } - else - { - propName = _PI2.Name; - } - } - //判断源实体中有没有对应的字段属性 - if (propName.ToUpper().Equals(_PI1.Name.ToUpper())) - { - object value = _PI2.GetValue(_T2, null); - Type t = _PI1.PropertyType; - if ((!t.Equals(_PI2.PropertyType)) && value != null) - { - if (t == typeof(int)) - { - value = Convert.ToInt32(_PI2.GetValue(_T2, null)); - } - else if (t == typeof(int?)) - { - value = Convert.ToInt32(_PI2.GetValue(_T2, null)); - } - else if (t == typeof(string)) - { - if (_PI2.PropertyType == typeof(byte[])) - { - value = System.Text.Encoding.UTF8.GetString((byte[])_PI2.GetValue(_T2, null)); - } - else - { - value = _PI2.GetValue(_T2, null) + ""; - } - } - else if (t == typeof(DateTime)) - { - value = Convert.ToDateTime(_PI2.GetValue(_T2, null)); - } - else if (t == typeof(DateTime?)) - { - value = Convert.ToDateTime(_PI2.GetValue(_T2, null)); - } - else if (t == typeof(decimal?)) - { - value = Convert.ToDecimal(_PI2.GetValue(_T2, null)); - } - else if (t == typeof(decimal)) - { - value = Convert.ToDecimal(_PI2.GetValue(_T2, null)); - } - else if (t == typeof(byte[])) - { - value = System.Text.Encoding.UTF8.GetBytes(_PI2.GetValue(_T2, null) + ""); - } - else - { - value = _PI2.GetValue(_T2, null); - } - } - if (_PI1.CustomAttributes.Count(a => a.AttributeType.Name.Equals("KeyAttribute")) > 0) - { - if ((value + "") != "") - { - _PI1.SetValue(_T1, value, null); - } - } - else - { - _PI1.SetValue(_T1, value, null); - } - } - }); - }); - return _T1; - } - - /// - /// 设置调用成功 - /// - /// - /// - /// - /// - public static T OK(this T dto, string strMsg = "请求成功") where T : MsgDto - { - dto.Status = StatusCode.OK; - return dto; - } - - /// - /// 成功,空数据 - /// - /// - /// - /// - /// - public static T setEmpty(this T dto, string strMsg = "无数据") where T : MsgDto - { - dto.Status = StatusCode.Empty; - dto.ErrorMessage = strMsg; - return dto; - } - - /// - /// 异常报错 - /// - /// - /// - /// - /// - public static T Error(this T dto, string strMsg = "异常报错") where T : MsgDto - { - dto.Status = StatusCode.Error; - dto.ErrorMessage = strMsg; - return dto; - } - - /// - /// 缺少参数 - /// - /// - /// - /// - /// - public static T Error_Required(this T dto, string strMsg = "缺少参数") where T : MsgDto - { - dto.Status = StatusCode.Required; - dto.ErrorMessage = strMsg; - return dto; - } - - /// - /// 数据过期 - /// - /// - /// - /// - /// - public static T Error_Exp(this T dto, string strMsg = "数据已过期") where T : MsgDto - { - dto.Status = StatusCode.Exp; - dto.ErrorMessage = strMsg; - return dto; - } - - /// - /// 数据不存在 - /// - /// - /// - /// - /// - public static T Error_NotFound(this T dto, string strMsg = "数据不存在") where T : MsgDto - { - dto.Status = StatusCode.NotFound; - dto.ErrorMessage = strMsg; - return dto; - } - - /// - /// 参数问题 - /// - /// - /// - /// - /// - public static T Error_Param(this T dto, string strMsg = "参数问题") where T : MsgDto - { - dto.Status = StatusCode.Param; - dto.ErrorMessage = strMsg; - return dto; - } - - /// - /// 服务器中止操作 - /// - /// - /// - /// - /// - public static T Error_Stop(this T dto, string strMsg = "服务器中止操作") where T : MsgDto - { - dto.Status = StatusCode.Stop; - dto.ErrorMessage = strMsg; - return dto; - } - - /// - /// 异常调用 - /// - /// - /// - /// - /// - public static T Error_ExceptionCall(this T dto, string strMsg = "接口异常调用") where T : MsgDto - { - dto.Status = StatusCode.ExceptionCall; - dto.ErrorMessage = strMsg; - return dto; - } - - /// - /// ORM数据库操作失败 - /// - /// - /// - /// - /// - public static T Error_ORM(this T dto, string strMsg = "数据库操作失败") where T : MsgDto - { - dto.Status = StatusCode.ORMError; - dto.ErrorMessage = strMsg; - return dto; - } - - /// - /// 数据已经存在 - /// - /// - /// - /// - /// - public static T Error_Exist(this T dto, string strMsg = "信息已存在") where T : MsgDto - { - dto.Status = StatusCode.Exist; - dto.ErrorMessage = strMsg; - return dto; - } - - /// - /// 密码错误 - /// - /// - /// - /// - /// - public static T Error_Pwd(this T dto, string strMsg = "密码错误") where T : MsgDto - { - dto.Status = StatusCode.PwdError; - dto.ErrorMessage = strMsg; - return dto; - } - - - #region Token 状态集合 - /// - /// 设置状态为Token缺失 - /// - /// - /// - /// - /// - public static T Token_Null(this T dto, string strMsg = "Token缺失") where T : MsgDto - { - dto.Status = StatusCode.TokenNull; - dto.ErrorMessage = strMsg; - return dto; - } - - /// - /// 设置状态为Token格式不正确 - /// - /// - /// - /// - /// - public static T Token_Format(this T dto, string strMsg = "Token格式不正确") where T : MsgDto - { - dto.Status = StatusCode.TokenFormat; - dto.ErrorMessage = strMsg; - return dto; - } - - /// - /// 设置状态为Token过期 - /// - /// - /// - /// - /// - public static T Token_Exp(this T dto, string strMsg = "Token过期") where T : MsgDto - { - dto.Status = StatusCode.TokenExp; - dto.ErrorMessage = strMsg; - return dto; - } - #endregion - - } -} diff --git a/HotelManagerSystemWebApi.Core/DtoExtend/MappingField.cs b/HotelManagerSystemWebApi.Core/DtoExtend/MappingField.cs deleted file mode 100644 index b17de8c6eca4eb42e32fd6a2b194c6b7f8273a6d..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Core/DtoExtend/MappingField.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace HotelManagerSystemWebApi.Core -{ - /// - /// 字段映射 - /// - [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = false)] - public class MappingField : Attribute - { - public string ColName { get; } - public MappingField(string colName) - { - this.ColName = colName; - } - } -} diff --git a/HotelManagerSystemWebApi.Core/DtoExtend/StatusCode.cs b/HotelManagerSystemWebApi.Core/DtoExtend/StatusCode.cs deleted file mode 100644 index c2f1b9d15b36e5e159bf02d3e24f0dad3e05e2ff..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Core/DtoExtend/StatusCode.cs +++ /dev/null @@ -1,74 +0,0 @@ -namespace HotelManagerSystemWebApi.Core -{ - /// - /// 状态码枚举类 - /// - public enum StatusCode - { - /// - /// 初始化状态 - /// - INIT = 0, - /// - /// 成功 - /// - OK = 200, - /// - /// 无数据 - /// - Empty = 201, - /// - /// 异常报错 - /// - Error = 400, - /// - /// 缺少参数 - /// - Required = 401, - /// - /// 过期 - /// - Exp = 403, - /// - /// 不存在 - /// - NotFound = 404, - /// - /// 参数问题 - /// - Param = 405, - /// - /// 服务器中止操作 - /// - Stop = 406, - /// - /// 异常调用 - /// - ExceptionCall = 407, - /// - /// ORM数据库操作失败 - /// - ORMError = 408, - /// - ///数据已经存在 - /// - Exist = 409, - /// - /// 密码错误 - /// - PwdError = 410, - /// - /// Token缺失 - /// - TokenNull = 301, - /// - /// Token格式不正确 - /// - TokenFormat = 302, - /// - /// Token过期 - /// - TokenExp = 303 - - } -} \ No newline at end of file diff --git a/HotelManagerSystemWebApi.Core/HotelManagerSystemWebApi.Core.csproj b/HotelManagerSystemWebApi.Core/HotelManagerSystemWebApi.Core.csproj deleted file mode 100644 index a272fbdaae854dc8f3d2a3e1f5689c0f37571ef5..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Core/HotelManagerSystemWebApi.Core.csproj +++ /dev/null @@ -1,39 +0,0 @@ - - - - net5.0 - 1701;1702;1591 - HotelManagerSystemWebApi.Core.xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/HotelManagerSystemWebApi.Core/HotelManagerSystemWebApi.Core.xml b/HotelManagerSystemWebApi.Core/HotelManagerSystemWebApi.Core.xml deleted file mode 100644 index a1f6e145aa9dde026086a9cb89dc1f4543738059..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Core/HotelManagerSystemWebApi.Core.xml +++ /dev/null @@ -1,2098 +0,0 @@ - - - - HotelManagerSystemWebApi.Core - - - - - 资产管理 - - - - - 资产编号 - - - - - 资产名称 - - - - - 资产总值 - - - - - 所属部门 - - - - - 入库时间 - - - - - 资产来源 - - - - - 资产经办人 - - - - - 删除标记 - - - - - 资料创建人 - - - - - 资料创建时间 - - - - - 资料更新人 - - - - - 资料更新时间 - - - - - 客户信息 - - - - - 客户编号 - - - - - 客户名称 - - - - - 客户性别 - - - - - 客户电话 - - - - - 证件类型 - - - - - 证件号码 - - - - - 居住地址 - - - - - 出生日期 - - - - - 客户类型 - - - - - 删除标记 - - - - - 资料创建人 - - - - - 资料创建时间 - - - - - 资料更新人 - - - - - 资料更新时间 - - - - - 酒店盈利情况 - - - - - 年 - - - - - 总金额 - - - - - 客户类型 - - - - - 客户类型 - - - - - 类型名字 - - - - - 删除标记 - - - - - 资料创建人 - - - - - 资料创建时间 - - - - - 资料更新人 - - - - - 资料更新时间 - - - - - 证件类型 - - - - - 证件类型 - - - - - 证件名称 - - - - - 删除标记 - - - - - 资料创建人 - - - - - 资料创建时间 - - - - - 资料更新人 - - - - - 资料更新时间 - - - - - 性别 - - - - - 性别ID - - - - - 性别名称 - - - - - 删除标记 - - - - - 资料创建人 - - - - - 资料创建时间 - - - - - 资料更新人 - - - - - 资料更新时间 - - - - - 酒店宣传联动内容 - - - - - 宣传内容编号 - - - - - 宣传内容 - - - - - 预约列表 - - - - - 预约编号 - - - - - 客户名称 - - - - - 预约电话 - - - - - 预约渠道 - - - - - 预约房号 - - - - - 预约起始 - - - - - 预约止日 - - - - - 删除标记 - - - - - 资料创建人 - - - - - 资料创建时间 - - - - - 资料更新人 - - - - - 资料更新时间 - - - - - 房间实体类 - - - - - 房间编号 - - - - - 房间类型 - - - - - 客户编号 - - - - - 最后一次入住时间 - - - - - 最后一次退房时间 - - - - - 房间状态ID - - - - - 房间单价 - - - - - 房间押金 - - - - - 房间位置 - - - - - 删除标记 - - - - - 资料创建人 - - - - - 资料创建时间 - - - - - 资料更新人 - - - - - 资料更新时间 - - - - - 房间状态 - - - - - 房间状态编号 - - - - - 房间状态 - - - - - 删除标记 - - - - - 资料创建人 - - - - - 资料创建时间 - - - - - 资料更新人 - - - - - 资料更新时间 - - - - - 房间类型 - - - - - 类型编号 - - - - - 房间类型 - - - - - 删除标记 - - - - - 资料创建人 - - - - - 资料创建时间 - - - - - 资料更新人 - - - - - 资料更新时间 - - - - - 商品信息 - - - - - 商品编号 - - - - - 商品名称 - - - - - 商品价格 - - - - - 规格型号 - - - - - 库存 - - - - - 删除标记 - - - - - 资料创建人 - - - - - 资料创建时间 - - - - - 资料更新人 - - - - - 资料更新时间 - - - - - 消费信息 - - - - - 房间编号 - - - - - 客户编号 - - - - - 商品名称 - - - - - 消费数量 - - - - - 商品单价 - - - - - 消费金额 - - - - - 消费时间 - - - - - 结算状态 - - - - - 删除标记 - - - - - 资料创建人 - - - - - 资料创建时间 - - - - - 资料更新人 - - - - - 资料更新时间 - - - - - 结算状态常量 - - - - - 已结算状态常量 - - - - - 未结算状态常量 - - - - - 水电信息 - - - - - 信息编号 - - - - - 房间编号 - - - - - 开始使用时间 - - - - - 结束使用时间 - - - - - 水费 - - - - - 电费 - - - - - 记录员 - - - - - 客户编号 - - - - - 删除标记 - - - - - 资料创建人 - - - - - 资料创建时间 - - - - - 资料更新人 - - - - - 资料更新时间 - - - - - DTO基础类 - - - - - 当前登录人员 - - - - - 输入DTO - - - - - 输入DTO(列表) - - - - - 页数 - - - - - 总数 - - - - - 输出DTO - - - - - 状态码 - - - - - 消息 - - - - - 实体类库 - - - - - 复制实体A的数据到实体B - - - - - - - - - 实体更新数据 - - 输出实体类型 - 输入实体类型 - 输入数据源 - 输入数据源 - 输出数据源 - - - - - 设置调用成功 - - - - - - - - - 成功,空数据 - - - - - - - - - 异常报错 - - - - - - - - - 缺少参数 - - - - - - - - - 数据过期 - - - - - - - - - 数据不存在 - - - - - - - - - 参数问题 - - - - - - - - - 服务器中止操作 - - - - - - - - - 异常调用 - - - - - - - - - ORM数据库操作失败 - - - - - - - - - 数据已经存在 - - - - - - - - - 密码错误 - - - - - - - - - 设置状态为Token缺失 - - - - - - - - - 设置状态为Token格式不正确 - - - - - - - - - 设置状态为Token过期 - - - - - - - - - 字段映射 - - - - - 状态码枚举类 - - - - - 初始化状态 - - - - - 成功 - - - - - 无数据 - - - - - 异常报错 - - - - - 缺少参数 - - - - - 过期 - - - - - 不存在 - - - - - 参数问题 - - - - - 服务器中止操作 - - - - - 异常调用 - - - - - ORM数据库操作失败 - - - - - 数据已经存在 - - - - - 密码错误 - - - - - Token缺失 - - - - - Token格式不正确 - - - - - Token过期 - - - - - 员工信息 - - - - - 员工账号/工号 - - - - - 员工姓名 - - - - - 出生日期 - - - - - 员工性别 - - - - - 民族类型 - - - - - 员工电话 - - - - - 所属部门 - - - - - 居住地址 - - - - - 员工职位 - - - - - 证件号码 - - - - - 员工密码 - - - - - 员工入职时间 - - - - - 员工面貌 - - - - - 教育程度 - - - - - 删除标记 - - - - - 资料创建人 - - - - - 资料创建时间 - - - - - 资料更新人 - - - - - 资料更新时间 - - - - - 员工打卡考勤 - - - - - 工号 - - - - - 打卡时间 - - - - - 打卡方式 - - - - - 打卡状态 - - - - - 删除标记 - - - - - 资料创建人 - - - - - 资料创建时间 - - - - - 资料更新人 - - - - - 资料更新时间 - - - - - 员工奖罚 - - - - - 工号 - - - - - 奖惩信息 - - - - - 奖惩类型 - - - - - 奖惩操作人 - - - - - 奖惩时间 - - - - - 删除标记 - - - - - 资料创建人 - - - - - 资料创建时间 - - - - - 资料更新人 - - - - - 资料更新时间 - - - - - 员工履历 - - - - - 工号 - - - - - 开始时间 - - - - - 结束时间 - - - - - 职位 - - - - - 公司 - - - - - 删除标记 - - - - - 资料创建人 - - - - - 资料创建时间 - - - - - 资料更新人 - - - - - 资料更新时间 - - - - - 员工照片 - - - - - 工号 - - - - - 照片路径 - - - - - 管理员信息实体类 - - - - - 管理员账号 - - - - - 管理员密码 - - - - - 管理员类型 - - - - - 管理员名称 - - - - - 是否为超级管理员 - - - - - 删除标记 - - - - - 资料新增人 - - - - - 资料新增时间 - - - - - 资料更新人 - - - - - 资料更新时间 - - - - - 管理员类型 - - - - - 编号 - - - - - 管理员类型 - - - - - 类型名称 - - - - - 删除标记 - - - - - 新增人 - - - - - 新增时间 - - - - - 修改人 - - - - - 修改时间 - - - - - 地址编号 - - - - - 地址 - - - - - 地区识别码 - - - - - - - - - - 编号 - - - - - 省份 - - - - - 城市 - - - - - 地区 - - - - - 地区识别码 - - - - - 监管统计 - - - - - 监管统计编号 - - - - - 监管部门 - - - - - 监管进度 - - - - - - - - - - - - - - - - - - - - - - - - - 删除标记 - - - - - 资料创建人 - - - - - 资料创建时间 - - - - - 资料更新人 - - - - - 资料更新时间 - - - - - 流水号生成规则表 - - - - - - - - - - 规则编号 - - - - - 规格名称 - - - - - 规则描述 - - - - - 当前ID - - - - - 规则简写 - - - - - 规则格式 - - - - - 编号前缀 - - - - - 规则分割符 - - - - - 资料新增人 - - - - - 资料新增时间 - - - - - 资料更新人 - - - - - 资料更新时间 - - - - - 部门表 - - - - - 部门编号 - - - - - 部门名称 - - - - - 部门描述 - - - - - 创建时间(部门) - - - - - 部门主管 - - - - - 上级部门 - - - - - 删除标记 - - - - - 资料创建人 - - - - - 资料创建时间 - - - - - 资料更新人 - - - - - 资料更新时间 - - - - - 学历 - - - - - 学历编号 - - - - - 学历名称 - - - - - 删除标记 - - - - - 资料创建人 - - - - - 资料创建时间 - - - - - 资料更新人 - - - - - 资料更新时间 - - - - - 模块实体 - - - - - 模块ID - - - - - 模块名称 - - - - - 模块描述 - - - - - 删除标记 - - - - - 资料创建人 - - - - - 资料创建时间 - - - - - 资料更新人 - - - - - 资料更新时间 - - - - - 系统模块常量类 - - - - - 基础信息 - - - - - 财务信息 - - - - - 水电管理 - - - - - 监管统计 - - - - - 客房管理 - - - - - 客户管理 - - - - - 人事管理 - - - - - 物资管理 - - - - - 员工操作日志 - - - - - 系统管理 - - - - - 模块权限表 - - - - - 模块ID - - - - - 管理员账号 - - - - - 模块名称 - - - - - 是否开启 - - - - - 民族 - - - - - 民族编号 - - - - - 民族名称 - - - - - 删除标记 - - - - - 资料创建人 - - - - - 资料创建时间 - - - - - 资料更新人 - - - - - 资料更新时间 - - - - - 任命公告 - - - - - 公告编号 - - - - - 公告主题 - - - - - 公告类型 - - - - - 公告时间 - - - - - 公告正文 - - - - - 发文部门 - - - - - 删除标记 - - - - - 资料创建人 - - - - - 资料创建时间 - - - - - 资料更新人 - - - - - 资料更新时间 - - - - - 操作日志表 - - - - - - - - - - 记录ID - - - - - 记录时间 - - - - - 日志内容 - - - - - 被记录账户 - - - - - 日志等级 - - - - - 删除标记 - - - - - 资料创建人 - - - - - 资料创建时间 - - - - - 资料更新人 - - - - - 资料更新时间 - - - - - 职位 - - - - - 职位编号 - - - - - 职位名称 - - - - - 删除标记 - - - - - 资料创建人 - - - - - 资料创建时间 - - - - - 资料更新人 - - - - - 资料更新时间 - - - - - 会员等级规则类 - - - - - 索引ID - - - - - 会员规则流水号 - - - - - 会员规则名称 - - - - - 预设数值(历史消费总额) - - - - - 会员等级 - - - - - 删除标识 - - - - - 新增人 - - - - - 新增时间 - - - - - 修改人 - - - - - 修改时间 - - - - - 奖惩类型实体类 - - - - - 奖惩编号 - - - - - 奖惩名称 - - - - - 删除标记 - - - - - 资料新增人 - - - - - 资料新增日期 - - - - - 资料更新人 - - - - - 资料更新日期 - - - - diff --git a/HotelManagerSystemWebApi.Core/Zero/AdminInfo.cs b/HotelManagerSystemWebApi.Core/Zero/AdminInfo.cs deleted file mode 100644 index cf01a87915345b12ea1d0567d21de56705df0ec1..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Core/Zero/AdminInfo.cs +++ /dev/null @@ -1,64 +0,0 @@ -using Furion.DatabaseAccessor; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace HotelManagerSystemWebApi.Core -{ - /// - /// 管理员信息实体类 - /// - [Table("admininfo")] - public class AdminInfo: EntityBase - { - - /// - /// 管理员账号 - /// - public System.String AdminAccount { get; set; } - - /// - /// 管理员密码 - /// - public System.String AdminPassword { get; set; } - - /// - /// 管理员类型 - /// - public System.String AdminType { get; set; } - - /// - /// 管理员名称 - /// - public System.String AdminName { get; set; } - - /// - /// 是否为超级管理员 - /// - public System.Int32? IsAdmin { get; set; } - - /// - /// 删除标记 - /// - public System.Int32? DeleteMk { get; set; } - - /// - /// 资料新增人 - /// - public System.String datains_usr { get; set; } - - /// - /// 资料新增时间 - /// - public System.DateTime? datains_time { get; set; } - - /// - /// 资料更新人 - /// - public System.String datachg_usr { get; set; } - - /// - /// 资料更新时间 - /// - public System.DateTime? datachg_time { get; set; } - } -} diff --git a/HotelManagerSystemWebApi.Core/Zero/CardCodes.cs b/HotelManagerSystemWebApi.Core/Zero/CardCodes.cs deleted file mode 100644 index 0440b92d69d5d149e1f46b0e065c41d6d16b0fbc..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Core/Zero/CardCodes.cs +++ /dev/null @@ -1,47 +0,0 @@ -using Furion.DatabaseAccessor; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace HotelManagerSystemWebApi.Core -{ - /// - /// 地区识别码 - /// - [Table("cardcodes")] - public class CardCodes : IEntity - { - /// - /// - /// - public CardCodes() - { - } - - /// - /// 编号 - /// - [Key] - [Column(Order = 1)] - public System.Int64 id { get; set; } - - /// - /// 省份 - /// - public System.String Province { get; set; } - - /// - /// 城市 - /// - public System.String City { get; set; } - - /// - /// 地区 - /// - public System.String District { get; set; } - - /// - /// 地区识别码 - /// - public System.String bm { get; set; } - } -} diff --git a/HotelManagerSystemWebApi.Core/Zero/CounterRule.cs b/HotelManagerSystemWebApi.Core/Zero/CounterRule.cs deleted file mode 100644 index 1864e4bc70e4e1d0c71c0734cb2bc5f5c150aadd..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Core/Zero/CounterRule.cs +++ /dev/null @@ -1,82 +0,0 @@ -using Furion.DatabaseAccessor; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace HotelManagerSystemWebApi.Core -{ - /// - /// 流水号生成规则表 - /// - [Table("counterrule")] - public class CounterRule : IEntity - { - /// - /// - /// - public CounterRule() - { - } - - /// - /// 规则编号 - /// - [Key] - [Column(Order = 1)] - public System.Int32 rule_id { get; set; } - - /// - /// 规格名称 - /// - public System.String rule_name { get; set; } - - /// - /// 规则描述 - /// - public System.String rule_desc { get; set; } - - /// - /// 当前ID - /// - public System.Int32? now_id { get; set; } - - /// - /// 规则简写 - /// - public System.String prefix_name { get; set; } - - /// - /// 规则格式 - /// - public System.String custo_format { get; set; } - - /// - /// 编号前缀 - /// - public System.String number_format { get; set; } - - /// - /// 规则分割符 - /// - public System.String separating_char { get; set; } - - /// - /// 资料新增人 - /// - public System.String datains_usrid { get; set; } - - /// - /// 资料新增时间 - /// - public System.DateTime? datains_time { get; set; } - - /// - /// 资料更新人 - /// - public System.String datachg_usrid { get; set; } - - /// - /// 资料更新时间 - /// - public System.DateTime? datachg_time { get; set; } - } -} diff --git a/HotelManagerSystemWebApi.Core/Zero/OperationLog.cs b/HotelManagerSystemWebApi.Core/Zero/OperationLog.cs deleted file mode 100644 index 78630faf521db558c430c4042d9069ef66ab08b9..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Core/Zero/OperationLog.cs +++ /dev/null @@ -1,73 +0,0 @@ -using Furion.DatabaseAccessor; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; - -namespace HotelManagerSystemWebApi.Core -{ - /// - /// 操作日志表 - /// - [Table("operationlog")] - public class OperationLog : IEntity - { - /// - /// - /// - public OperationLog() - { - } - - /// - /// 记录ID - /// - [Key] - [Column(Order = 1)] - public System.Int32 OperationId { get; set; } - - /// - /// 记录时间 - /// - public System.DateTime OperationTime { get; set; } - - /// - /// 日志内容 - /// - [Column("OperationLog")] - public System.String OperationLogContent { get; set; } - - /// - /// 被记录账户 - /// - public System.String OperationAccount { get; set; } - - /// - /// 日志等级 - /// - public System.Int32? OperationLevel { get; set; } - - /// - /// 删除标记 - /// - public System.Int32 delete_mk { get; set; } - - /// - /// 资料创建人 - /// - public System.String datains_usr { get; set; } - - /// - /// 资料创建时间 - /// - public System.DateTime? datains_date { get; set; } - - /// - /// 资料更新人 - /// - public System.String datachg_usr { get; set; } - - /// - /// 资料更新时间 - /// - public System.DateTime? datachg_date { get; set; } - } -} diff --git a/HotelManagerSystemWebApi.EntityFramework.Core/DbContexts/DefaultDbContext.cs b/HotelManagerSystemWebApi.EntityFramework.Core/DbContexts/DefaultDbContext.cs deleted file mode 100644 index cbc1764e121602f4ad50e6c5088fffb495ef11d9..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.EntityFramework.Core/DbContexts/DefaultDbContext.cs +++ /dev/null @@ -1,13 +0,0 @@ -using Furion.DatabaseAccessor; -using Microsoft.EntityFrameworkCore; - -namespace HotelManagerSystemWebApi.EntityFramework.Core -{ - [AppDbContext("NpgSqlConnectStr", DbProvider.Npgsql)] - public class DefaultDbContext : AppDbContext - { - public DefaultDbContext(DbContextOptions options) : base(options) - { - } - } -} \ No newline at end of file diff --git a/HotelManagerSystemWebApi.EntityFramework.Core/Startup.cs b/HotelManagerSystemWebApi.EntityFramework.Core/Startup.cs deleted file mode 100644 index 7ced7f9cc541b6f8064e7c874c652373a37b5455..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.EntityFramework.Core/Startup.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Furion; -using Furion.DatabaseAccessor; -using Microsoft.Extensions.DependencyInjection; - -namespace HotelManagerSystemWebApi.EntityFramework.Core -{ - public class Startup : AppStartup - { - public void ConfigureServices(IServiceCollection services) - { - services.AddDatabaseAccessor(options => - { - options.AddDbPool(); - }); - } - } -} \ No newline at end of file diff --git a/HotelManagerSystemWebApi.EntityFramework.Core/dbsettings.json b/HotelManagerSystemWebApi.EntityFramework.Core/dbsettings.json deleted file mode 100644 index cb717b4a4757d79db7bdca13070126aa29400c16..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.EntityFramework.Core/dbsettings.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "ConnectionStrings": { - "MySqlConnectStr": "Data Source=127.0.0.1;Database=tshoteldb;User ID=softuser;Password=yjj990720;pooling=true;port=3306;sslmode=none;CharSet=utf8" - } -} \ No newline at end of file diff --git a/HotelManagerSystemWebApi.Web.Core/Handlers/JwtHandler.cs b/HotelManagerSystemWebApi.Web.Core/Handlers/JwtHandler.cs deleted file mode 100644 index e24f31df35e75324844731def41883f8f0e69f09..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Web.Core/Handlers/JwtHandler.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Furion.Authorization; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; -using System.Threading.Tasks; - -namespace HotelManagerSystemWebApi.Web.Core -{ - public class JwtHandler : AppAuthorizeHandler - { - public override Task PipelineAsync(AuthorizationHandlerContext context, DefaultHttpContext httpContext) - { - // 这里写您的授权判断逻辑,授权通过返回 true,否则返回 false - - return Task.FromResult(true); - } - } -} \ No newline at end of file diff --git a/HotelManagerSystemWebApi.Web.Core/HotelManagerSystemWebApi.Web.Core.csproj b/HotelManagerSystemWebApi.Web.Core/HotelManagerSystemWebApi.Web.Core.csproj deleted file mode 100644 index 80bd83cab588aa592a1c4390d5e1f02e900bf064..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Web.Core/HotelManagerSystemWebApi.Web.Core.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - - net5.0 - 1701;1702;1591 - HotelManagerSystemWebApi.Web.Core.xml - - - - - - - - - - - - diff --git a/HotelManagerSystemWebApi.Web.Core/HotelManagerSystemWebApi.Web.Core.xml b/HotelManagerSystemWebApi.Web.Core/HotelManagerSystemWebApi.Web.Core.xml deleted file mode 100644 index 3894e728885d546ef17712206b93c7fe5b57fe80..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Web.Core/HotelManagerSystemWebApi.Web.Core.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - HotelManagerSystemWebApi.Web.Core - - - - diff --git a/HotelManagerSystemWebApi.Web.Core/Startup.cs b/HotelManagerSystemWebApi.Web.Core/Startup.cs deleted file mode 100644 index cfa813cd08d0d32e1e83fd1976f2fb8daf59dd8f..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Web.Core/Startup.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Furion; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Hosting; - -namespace HotelManagerSystemWebApi.Web.Core -{ - public class Startup : AppStartup - { - public void ConfigureServices(IServiceCollection services) - { - services.AddJwt(); - services.AddCorsAccessor(); - - services.AddControllers() - .AddInjectWithUnifyResult(); - } - - public void Configure(IApplicationBuilder app, IWebHostEnvironment env) - { - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } - - app.UseHttpsRedirection(); - - app.UseRouting(); - - app.UseCorsAccessor(); - - app.UseAuthentication(); - app.UseAuthorization(); - - app.UseInject(string.Empty); - - app.UseEndpoints(endpoints => - { - endpoints.MapControllers(); - }); - } - } -} \ No newline at end of file diff --git a/HotelManagerSystemWebApi.Web.Entry/HotelManagerSystemWebApi.Web.Entry.csproj b/HotelManagerSystemWebApi.Web.Entry/HotelManagerSystemWebApi.Web.Entry.csproj deleted file mode 100644 index bf5e885ea8ac341c6431e45974d4fe9c77ee4c55..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Web.Entry/HotelManagerSystemWebApi.Web.Entry.csproj +++ /dev/null @@ -1,28 +0,0 @@ - - - - net5.0 - - - - - - - - - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - diff --git a/HotelManagerSystemWebApi.Web.Entry/Program.cs b/HotelManagerSystemWebApi.Web.Entry/Program.cs deleted file mode 100644 index 667def21b0084c653d4a14565e549e9dc01826b4..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Web.Entry/Program.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Hosting; - -namespace HotelManagerSystemWebApi.Web.Entry -{ - public class Program - { - public static void Main(string[] args) - { - CreateHostBuilder(args).Build().Run(); - } - - public static IHostBuilder CreateHostBuilder(string[] args) => - Host.CreateDefaultBuilder(args) - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.Inject() - .UseStartup(); - }); - } -} \ No newline at end of file diff --git a/HotelManagerSystemWebApi.Web.Entry/Startup.cs b/HotelManagerSystemWebApi.Web.Entry/Startup.cs deleted file mode 100644 index c2799fc99b4702a578d825782cb535764e7d4d2b..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Web.Entry/Startup.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; - -namespace HotelManagerSystemWebApi.Web.Entry -{ - public class Startup - { - public Startup(IConfiguration configuration) - { - Configuration = configuration; - } - - public IConfiguration Configuration { get; } - - public void ConfigureServices(IServiceCollection services) - { - // 代码迁移至 HotelManagerSystemWebApi.Web.Core/Startup.cs - } - - public void Configure(IApplicationBuilder app, IWebHostEnvironment env) - { - // 代码迁移至 HotelManagerSystemWebApi.Web.Core/Startup.cs - } - } -} \ No newline at end of file diff --git a/HotelManagerSystemWebApi.Web.Entry/appsettings.json b/HotelManagerSystemWebApi.Web.Entry/appsettings.json deleted file mode 100644 index 6d840522ffcd3a41f8e78585624055c6e1fe5ff6..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.Web.Entry/appsettings.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "DynamicApiControllerSettings": { - "ModelToQuery": true, - "KeepVerb": true, - "KeepName": true, - "VerbToHttpMethods": [ - [ "Add", "POST" ], // => Addǰ׺дΪ[HttpPost] - [ "Del", "POST" ], // => Delǰ׺дΪ[HttpPost] - [ "Upd", "POST" ], // => Updǰ׺дΪ[HttpPost] - [ "Select", "GET" ] // => Selectǰ׺дΪ[HttpGet] - ], - "DefaultHttpMethod": "GET", - "LowercaseRoute":false - }, - "Logging": { - "LogLevel": { - "Default": "Information", - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information", - "Microsoft.EntityFrameworkCore": "Information" - } - }, - "AllowedHosts": "*" - } \ No newline at end of file diff --git a/HotelManagerSystemWebApi.sln b/HotelManagerSystemWebApi.sln deleted file mode 100644 index fa9e62ad10990827837699ec371be8a7c5b2fd62..0000000000000000000000000000000000000000 --- a/HotelManagerSystemWebApi.sln +++ /dev/null @@ -1,49 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30223.230 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HotelManagerSystemWebApi.Application", "HotelManagerSystemWebApi.Application\HotelManagerSystemWebApi.Application.csproj", "{AB699EE9-43A8-46F2-A855-04A26DE63372}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HotelManagerSystemWebApi.EntityFramework.Core", "HotelManagerSystemWebApi.EntityFramework.Core\HotelManagerSystemWebApi.EntityFramework.Core.csproj", "{4BD77E5C-138D-4F2D-B709-F9020F306AF3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HotelManagerSystemWebApi.Web.Core", "HotelManagerSystemWebApi.Web.Core\HotelManagerSystemWebApi.Web.Core.csproj", "{9D14BB78-DA2A-4040-B9DB-5A515B599181}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HotelManagerSystemWebApi.Core", "HotelManagerSystemWebApi.Core\HotelManagerSystemWebApi.Core.csproj", "{4FB30091-15C7-4FD9-AB7D-266814F360F5}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HotelManagerSystemWebApi.Web.Entry", "HotelManagerSystemWebApi.Web.Entry\HotelManagerSystemWebApi.Web.Entry.csproj", "{C8D99F52-EDC7-411F-8300-6DB14BF59E8C}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {AB699EE9-43A8-46F2-A855-04A26DE63372}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AB699EE9-43A8-46F2-A855-04A26DE63372}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AB699EE9-43A8-46F2-A855-04A26DE63372}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AB699EE9-43A8-46F2-A855-04A26DE63372}.Release|Any CPU.Build.0 = Release|Any CPU - {4BD77E5C-138D-4F2D-B709-F9020F306AF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4BD77E5C-138D-4F2D-B709-F9020F306AF3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4BD77E5C-138D-4F2D-B709-F9020F306AF3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4BD77E5C-138D-4F2D-B709-F9020F306AF3}.Release|Any CPU.Build.0 = Release|Any CPU - {9D14BB78-DA2A-4040-B9DB-5A515B599181}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9D14BB78-DA2A-4040-B9DB-5A515B599181}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9D14BB78-DA2A-4040-B9DB-5A515B599181}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9D14BB78-DA2A-4040-B9DB-5A515B599181}.Release|Any CPU.Build.0 = Release|Any CPU - {4FB30091-15C7-4FD9-AB7D-266814F360F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4FB30091-15C7-4FD9-AB7D-266814F360F5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4FB30091-15C7-4FD9-AB7D-266814F360F5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4FB30091-15C7-4FD9-AB7D-266814F360F5}.Release|Any CPU.Build.0 = Release|Any CPU - {C8D99F52-EDC7-411F-8300-6DB14BF59E8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C8D99F52-EDC7-411F-8300-6DB14BF59E8C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C8D99F52-EDC7-411F-8300-6DB14BF59E8C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C8D99F52-EDC7-411F-8300-6DB14BF59E8C}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {B2073C2C-0FD3-452B-8047-8134D68E12CE} - EndGlobalSection -EndGlobal diff --git a/Library/CK.Common.dll b/Library/CK.Common.dll new file mode 100644 index 0000000000000000000000000000000000000000..55487f472ab2b3d3ba15b599e059791afd7aef93 Binary files /dev/null and b/Library/CK.Common.dll differ diff --git a/Library/Library.csproj b/Library/Library.csproj new file mode 100644 index 0000000000000000000000000000000000000000..132c02c59c23649c0b1ecd3906af6a82a3852d7a --- /dev/null +++ b/Library/Library.csproj @@ -0,0 +1,9 @@ + + + + net6.0 + enable + enable + + + diff --git a/README.md b/README.md index 98804eb4d7befba6a65e8c5c50b0140dbd4d18fb..c864776a6a571c47c51bd7561000312c1f8e198b 100644 --- a/README.md +++ b/README.md @@ -29,21 +29,21 @@ ### :mag_right: 系统开发环境: -操作系统:Windows 10(x64) +操作系统:Windows 11(x64) -开发工具:Microsoft Visual Studio 2019(系统最新版本) +开发工具:Microsoft Visual Studio 2022(系统最新版本) -数据库:MySQL v8.0.23(强烈推荐!) +数据库:PostgreSQL v13 -数据库管理工具:Navicat 15 +数据库管理工具:Navicat 16 开发语言:C#语言、LINQ语言 开发平台:.Net -开发框架:.Net 5/Furion +开发框架:.Net 6/Furion -开发技术:.NET 5 WebAPI +开发技术:.NET 6 WebAPI ### :open_file_folder: 系统结构: @@ -99,27 +99,16 @@ HotelManagerSystemWebApi **咖啡与网络(后期维护和开发)** -### :computer: 项目运行部署(执行下面步骤前需先安装.NET 5 SDK和Runtime): +### :computer: 项目运行部署(执行下面步骤前需先安装.NET 6 SDK和Runtime): -**下载并安装Microsoft Visual Studio Professional 2019及以上版本,并通过下载Zip包解压,打开.sln后缀格式文件运行。** +**下载并安装Microsoft Visual Studio Professional 2022及以上版本,并通过下载Zip包解压,打开.sln后缀格式文件运行。** ### :inbox_tray: 数据库运行部署(本地): -**作者及开发团队强烈建议使用MySQL数据库,安装MySQL数据库并开启服务,通过可视化管理工具对数据库进行建立,可通过打开执行数据库脚本文件夹内的.sql后缀格式文件进行快速建立数据表和导入数据,执行步骤(以MySQL数据库为例):** +**作者及开发团队强烈建议使用PostgreSQL数据库,安装PostgreSQL数据库并开启服务,通过可视化管理工具对数据库进行建立,可通过打开执行数据库脚本文件夹内的.sql后缀格式文件进行快速建立数据表和导入数据,执行步骤(以PostgreSQL数据库为例):** **1、通过可视化管理工具打开Table.sql文件进行数据表建立。** **2、随后打开Data.sql文件进行数据导入。** -### :exclamation: 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request(https://gitee.com/java-and-net/topsky-hotel-manager-system-web-api/pulls) - -1. # :chart_with_upwards_trend: Star趋势图(感谢[Giteye](https://giteye.net/)提供的趋势图报表功能!): - - [![Giteye chart](https://chart.giteye.net/gitee/java-and-net/topsky-hotel-manager-system-web-api/QXF965PJ.png)](https://giteye.net/chart/QXF965PJ)](https://giteye.net/chart/Z9DD26VK) - ​ [![咖啡与网络/TopskyHotelManagerSystem-WebApi](https://gitee.com/java-and-net/topsky-hotel-manager-system-web-api/widgets/widget_card.svg?colors=4183c4,ffffff,ffffff,e3e9ed,666666,9b9b9b)](https://gitee.com/java-and-net/topsky-hotel-manager-system-web-api)