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