diff --git a/Lib/Tiobon.Core.Base.dll b/Lib/Tiobon.Core.Base.dll new file mode 100644 index 00000000..18efcb21 Binary files /dev/null and b/Lib/Tiobon.Core.Base.dll differ diff --git a/Tiobon.Core.Api/Tiobon.Core.Api.csproj b/Tiobon.Core.Api/Tiobon.Core.Api.csproj index 4cb6815c..d49888fc 100644 --- a/Tiobon.Core.Api/Tiobon.Core.Api.csproj +++ b/Tiobon.Core.Api/Tiobon.Core.Api.csproj @@ -130,6 +130,12 @@ + + + ..\Lib\Tiobon.Core.Base.dll + + + diff --git a/Tiobon.Core.Common/Seed/FrameSeed.cs b/Tiobon.Core.Common/Seed/FrameSeed.cs index 45980b43..a6d020ab 100644 --- a/Tiobon.Core.Common/Seed/FrameSeed.cs +++ b/Tiobon.Core.Common/Seed/FrameSeed.cs @@ -892,8 +892,7 @@ namespace " + strNameSpace + @" var ls = IDbFirst.IsCreateDefaultValue().IsCreateAttribute() .SettingClassTemplate(p => p = -@"using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models" + (isMuti ? "." + ConnId + "" : "") + @"; +@"using Tiobon.Core.Model.Models" + (isMuti ? "." + ConnId + "" : "") + @"; namespace " + strNameSpace + @" { diff --git a/Tiobon.Core.Extensions/ServiceExtensions/AutofacModuleRegister.cs b/Tiobon.Core.Extensions/ServiceExtensions/AutofacModuleRegister.cs index 58266d2c..7ac2453c 100644 --- a/Tiobon.Core.Extensions/ServiceExtensions/AutofacModuleRegister.cs +++ b/Tiobon.Core.Extensions/ServiceExtensions/AutofacModuleRegister.cs @@ -3,9 +3,9 @@ using Autofac.Extras.DynamicProxy; using Serilog; using System.Reflection; using Tiobon.Core.AOP; +using Tiobon.Core.Base.IServices; using Tiobon.Core.Common; using Tiobon.Core.IRepository.Base; -using Tiobon.Core.IServices.BASE; using Tiobon.Core.Model; using Tiobon.Core.Repository.Base; using Tiobon.Core.Repository.UnitOfWorks; diff --git a/Tiobon.Core.Extensions/Tiobon.Core.Extensions.csproj b/Tiobon.Core.Extensions/Tiobon.Core.Extensions.csproj index 2244dc66..30a4a57e 100644 --- a/Tiobon.Core.Extensions/Tiobon.Core.Extensions.csproj +++ b/Tiobon.Core.Extensions/Tiobon.Core.Extensions.csproj @@ -41,4 +41,10 @@ + + + ..\Lib\Tiobon.Core.Base.dll + + + diff --git a/Tiobon.Core.IServices/BASE/IBaseServices.cs b/Tiobon.Core.IServices/BASE/IBaseServices.cs deleted file mode 100644 index 5985f4e5..00000000 --- a/Tiobon.Core.IServices/BASE/IBaseServices.cs +++ /dev/null @@ -1,177 +0,0 @@ -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using SqlSugar; -using System.Data; -using System.Linq.Expressions; -using Tiobon.Core.Common; -using Tiobon.Core.Model; - -namespace Tiobon.Core.IServices.BASE; - -public interface IBaseServices where TEntity : class -{ - ISqlSugarClient Db { get; } - - Task QueryById(object objId); - Task QueryById(object objId, bool blnUseCache = false); - Task> QueryByIDs(object[] lstIds); - - Task Add(TEntity model); - - Task> Add(List listEntity); - - Task DeleteById(object id); - - Task Delete(TEntity model); - - Task DeleteByIds(object[] ids); - - Task Update(TEntity model); - Task Update(List model); - Task Update(TEntity entity, string where); - - Task Update(object operateAnonymousObjects); - - Task Update(TEntity entity, List lstColumns = null, List lstIgnoreColumns = null, string where = ""); - - Task> Query(); - Task> Query(string where); - Task> Query(Expression> whereExpression); - Task> Query(Expression> whereExpression, string orderByFields); - Task> Query(Expression> expression); - Task> Query(Expression> expression, Expression> whereExpression, string orderByFields); - Task> Query(Expression> whereExpression, Expression> orderByExpression, bool isAsc = true); - Task> Query(string where, string orderByFields); - Task> QuerySql(string sql, SugarParameter[] parameters = null); - Task QueryTable(string sql, SugarParameter[] parameters = null); - - Task> Query(Expression> whereExpression, int top, string orderByFields); - Task> Query(string where, int top, string orderByFields); - - Task> Query( - Expression> whereExpression, int pageIndex, int pageSize, string orderByFields); - Task> Query(string where, int pageIndex, int pageSize, string orderByFields); - - - Task> QueryPage(Expression> whereExpression, int pageIndex = 1, int pageSize = 20, string orderByFields = null); - - Task> QueryMuch( - Expression> joinExpression, - Expression> selectExpression, - Expression> whereLambda = null) where T : class, new(); - Task> QueryPage(PaginationModel pagination); - - #region 分表 - Task QueryByIdSplit(object objId); - Task> AddSplit(TEntity entity); - Task DeleteSplit(TEntity entity, DateTime dateTime); - Task UpdateSplit(TEntity entity, DateTime dateTime); - Task> QueryPageSplit(Expression> whereExpression, DateTime beginTime, DateTime endTime, int pageIndex = 1, int pageSize = 20, string orderByFields = null); - #endregion -} - - -/// -/// 增删改查接口 -/// -/// -/// -/// -/// -public interface IBaseServices where TEntity : class -{ - ISqlSugarClient Db { get; } - - Task AnyAsync(object objId); - - Task AnyAsync(Expression> whereExpression); - - /// - /// 根据ID查询实体数据是否存在 - /// - /// - /// - Task QueryById(object objId); - Task QueryById(object objId, bool blnUseCache = false); - Task> QueryByIDs(object[] lstIds); - - Task> QueryForm(QueryForm body); - - Task Add(TInsertDto model); - - Task> Add(List listEntity); - - Task DeleteById(object id); - Task DeleteById1(object id); - - Task Delete(TEntity model); - - Task DeleteByIds(object[] ids); - Task DeleteByIds1(long[] ids); - - /// - /// 根据表达式,删除实体 - /// - /// - /// - Task Delete(Expression> whereExpression); - - Task Update(long Id, TEditDto model); - Task Update(long Id, TEditDto model, List lstColumns = null, List lstIgnoreColumns = null, string where = ""); - - Task Update(Dictionary editModels); - Task Update(List model); - Task Update(TEntity entity, string where); - - Task Update(object operateAnonymousObjects); - - Task Update(TEntity entity, List lstColumns = null, List lstIgnoreColumns = null, string where = ""); - Task Update(List entitys, List lstColumns = null, List lstIgnoreColumns = null, string where = ""); - - Task> Query(); - Task> Query(string where); - Task> Query(Expression> whereExpression); - - Task> QueryDto(Expression> whereExpression); - Task QuerySingle(object objId); - Task QuerySingle(Expression> whereExpression); - Task QuerySingleDto(Expression> whereExpression); - Task> Query(Expression> whereExpression, string orderByFields); - Task> Query(Expression> expression); - Task> Query(Expression> expression, Expression> whereExpression, string orderByFields); - Task> Query(Expression> whereExpression, Expression> orderByExpression, bool isAsc = true); - Task> Query(string where, string orderByFields); - Task> QuerySql(string sql, SugarParameter[] parameters = null); - Task QueryTable(string sql, SugarParameter[] parameters = null); - - Task> Query(Expression> whereExpression, int top, string orderByFields); - Task> Query(string where, int top, string orderByFields); - - Task> Query( - Expression> whereExpression, int pageIndex, int pageSize, string orderByFields); - Task> Query(string where, int pageIndex, int pageSize, string orderByFields); - - - Task> QueryPage(Expression> whereExpression, int pageIndex = 1, int pageSize = 20, string orderByFields = null); - Task> QueryFilterPage([FromBody] QueryBody body); - Task> QueryFilterPage(QueryBody filter, string condition, bool? IsEnable = true); - Task> ExportExcel(QueryExport body); - - Task> ImportExcel(IFormFile file, string menuName = null, long? MasterId = null); - - Task> DownloadExcel(string menuName); - - Task> QueryMuch( - Expression> joinExpression, - Expression> selectExpression, - Expression> whereLambda = null) where T : class, new(); - Task> QueryPage(PaginationModel pagination); - - #region 分表 - Task QueryByIdSplit(object objId); - Task> AddSplit(TEntity entity); - Task DeleteSplit(TEntity entity, DateTime dateTime); - Task UpdateSplit(TEntity entity, DateTime dateTime); - Task> QueryPageSplit(Expression> whereExpression, DateTime beginTime, DateTime endTime, int pageIndex = 1, int pageSize = 20, string orderByFields = null); - #endregion -} diff --git a/Tiobon.Core.IServices/Ghra/IGhra_JobServices.cs b/Tiobon.Core.IServices/Ghra/IGhra_JobServices.cs index c466e21a..ca4a4b56 100644 --- a/Tiobon.Core.IServices/Ghra/IGhra_JobServices.cs +++ b/Tiobon.Core.IServices/Ghra/IGhra_JobServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// Ghra_Job(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghra/IGhra_LegalCompanyServices.cs b/Tiobon.Core.IServices/Ghra/IGhra_LegalCompanyServices.cs index 72372570..3981782b 100644 --- a/Tiobon.Core.IServices/Ghra/IGhra_LegalCompanyServices.cs +++ b/Tiobon.Core.IServices/Ghra/IGhra_LegalCompanyServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// Ghra_LegalCompany(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghra/IGhra_StaffEduBGServices.cs b/Tiobon.Core.IServices/Ghra/IGhra_StaffEduBGServices.cs index ae8394ee..cb2f20ac 100644 --- a/Tiobon.Core.IServices/Ghra/IGhra_StaffEduBGServices.cs +++ b/Tiobon.Core.IServices/Ghra/IGhra_StaffEduBGServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// Ghra_StaffEduBG(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghra/IGhra_StaffGroupDetailServices.cs b/Tiobon.Core.IServices/Ghra/IGhra_StaffGroupDetailServices.cs index 554c32fc..89452bbc 100644 --- a/Tiobon.Core.IServices/Ghra/IGhra_StaffGroupDetailServices.cs +++ b/Tiobon.Core.IServices/Ghra/IGhra_StaffGroupDetailServices.cs @@ -1,11 +1,8 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices -{ - /// - /// 人员群组明细(自定义服务接口) - /// +namespace Tiobon.Core.IServices +{ + /// + /// 人员群组明细(自定义服务接口) + /// public interface IGhra_StaffGroupDetailServices :IBaseServices { } diff --git a/Tiobon.Core.IServices/Ghra/IGhra_StaffGroupServices.cs b/Tiobon.Core.IServices/Ghra/IGhra_StaffGroupServices.cs index bddd0c9d..3bd218d8 100644 --- a/Tiobon.Core.IServices/Ghra/IGhra_StaffGroupServices.cs +++ b/Tiobon.Core.IServices/Ghra/IGhra_StaffGroupServices.cs @@ -1,16 +1,10 @@ -using Newtonsoft.Json.Linq; -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model; -using Tiobon.Core.Model.Models; +namespace Tiobon.Core.IServices; -namespace Tiobon.Core.IServices -{ - /// - /// 人员群组(自定义服务接口) - /// - public interface IGhra_StaffGroupServices :IBaseServices - { - Task> GetStaffInfoColumnData(); - Task>> GetStaffGroupInfoByID(long Id, JObject FBody); - } +/// +/// 人员群组(自定义服务接口) +/// +public interface IGhra_StaffGroupServices : IBaseServices +{ + Task> GetStaffInfoColumnData(); + Task>> GetStaffGroupInfoByID(long Id, JObject FBody); } \ No newline at end of file diff --git a/Tiobon.Core.IServices/Ghra/IGhra_StaffLicenceServices.cs b/Tiobon.Core.IServices/Ghra/IGhra_StaffLicenceServices.cs index daa3cf7d..2d5ff445 100644 --- a/Tiobon.Core.IServices/Ghra/IGhra_StaffLicenceServices.cs +++ b/Tiobon.Core.IServices/Ghra/IGhra_StaffLicenceServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// Ghra_StaffLicence(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghra/IGhra_StaffServices.cs b/Tiobon.Core.IServices/Ghra/IGhra_StaffServices.cs index 842e6e3d..f53e973e 100644 --- a/Tiobon.Core.IServices/Ghra/IGhra_StaffServices.cs +++ b/Tiobon.Core.IServices/Ghra/IGhra_StaffServices.cs @@ -1,8 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// Ghra_Staff(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghra/IGhra_StaffSocialRelationServices.cs b/Tiobon.Core.IServices/Ghra/IGhra_StaffSocialRelationServices.cs index de886554..4bc21d79 100644 --- a/Tiobon.Core.IServices/Ghra/IGhra_StaffSocialRelationServices.cs +++ b/Tiobon.Core.IServices/Ghra/IGhra_StaffSocialRelationServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// Ghra_StaffSocialRelation(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghra/IGhra_StaffTrainingServices.cs b/Tiobon.Core.IServices/Ghra/IGhra_StaffTrainingServices.cs index eedd0211..1128a701 100644 --- a/Tiobon.Core.IServices/Ghra/IGhra_StaffTrainingServices.cs +++ b/Tiobon.Core.IServices/Ghra/IGhra_StaffTrainingServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// Ghra_StaffTraining(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghra/IGhra_StaffWorkExpServices.cs b/Tiobon.Core.IServices/Ghra/IGhra_StaffWorkExpServices.cs index cb598ed6..d61dffe2 100644 --- a/Tiobon.Core.IServices/Ghra/IGhra_StaffWorkExpServices.cs +++ b/Tiobon.Core.IServices/Ghra/IGhra_StaffWorkExpServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// Ghra_StaffWorkExp(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghra/IGhra_ZoneServices.cs b/Tiobon.Core.IServices/Ghra/IGhra_ZoneServices.cs index 007ef316..fef294da 100644 --- a/Tiobon.Core.IServices/Ghra/IGhra_ZoneServices.cs +++ b/Tiobon.Core.IServices/Ghra/IGhra_ZoneServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 厂区(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrc/IGhrc_PeriodMasterServices.cs b/Tiobon.Core.IServices/Ghrc/IGhrc_PeriodMasterServices.cs index 5edf6580..836f57fb 100644 --- a/Tiobon.Core.IServices/Ghrc/IGhrc_PeriodMasterServices.cs +++ b/Tiobon.Core.IServices/Ghrc/IGhrc_PeriodMasterServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// Ghrc_PeriodMaster(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrc/IGhrc_SalaryItemServices.cs b/Tiobon.Core.IServices/Ghrc/IGhrc_SalaryItemServices.cs index dc7a5d63..c62b0175 100644 --- a/Tiobon.Core.IServices/Ghrc/IGhrc_SalaryItemServices.cs +++ b/Tiobon.Core.IServices/Ghrc/IGhrc_SalaryItemServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// Ghrc_SalaryItem(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_AttachmentServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_AttachmentServices.cs index 8275b8fd..f88832e6 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_AttachmentServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_AttachmentServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model; -using Tiobon.Core.Model.Models; -using Tiobon.Core.Model.ViewModels; +using Tiobon.Core.Model.ViewModels; namespace Tiobon.Core.IServices; diff --git a/Tiobon.Core.IServices/Ghre/IGhre_ConfigGroupServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_ConfigGroupServices.cs index 026ef82c..f77dad5b 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_ConfigGroupServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_ConfigGroupServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 参数配置组(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_ConfigServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_ConfigServices.cs index 16509eb6..c64f617c 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_ConfigServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_ConfigServices.cs @@ -1,8 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 参数配置(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_CourseClassServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_CourseClassServices.cs index 7fe4252b..41df1f58 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_CourseClassServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_CourseClassServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 课程分类(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_CourseServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_CourseServices.cs index a0c75960..a272ac59 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_CourseServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_CourseServices.cs @@ -1,7 +1,4 @@ using Tiobon.Core.Common; -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model; -using Tiobon.Core.Model.Models; using Tiobon.Core.Model.ViewModels.Extend; namespace Tiobon.Core.IServices; diff --git a/Tiobon.Core.IServices/Ghre/IGhre_CourseSnapServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_CourseSnapServices.cs index e12ed2ae..16a0e4c8 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_CourseSnapServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_CourseSnapServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// Ghre_CourseSnap(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_CourseWareAttachmentServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_CourseWareAttachmentServices.cs index 8f7721a5..9c29c0b0 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_CourseWareAttachmentServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_CourseWareAttachmentServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 课件附件(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_CourseWareServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_CourseWareServices.cs index b0bbbd9b..d92f7a91 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_CourseWareServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_CourseWareServices.cs @@ -1,8 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 课件(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_CreditPointServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_CreditPointServices.cs index 26d828c9..97dbcfa5 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_CreditPointServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_CreditPointServices.cs @@ -1,7 +1,4 @@ using Tiobon.Core.Common; -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model; -using Tiobon.Core.Model.Models; namespace Tiobon.Core.IServices; diff --git a/Tiobon.Core.IServices/Ghre/IGhre_ExamMessageLogServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_ExamMessageLogServices.cs index c17a34bd..f2cc39ae 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_ExamMessageLogServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_ExamMessageLogServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 考试通知记录(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_ExamPaperConfigServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_ExamPaperConfigServices.cs index 5dbd1f4e..1f6b3d8c 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_ExamPaperConfigServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_ExamPaperConfigServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 试卷配置(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_ExamPaperQuestionServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_ExamPaperQuestionServices.cs index 474d33c8..806e89f5 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_ExamPaperQuestionServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_ExamPaperQuestionServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 试卷题目(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_ExamPaperServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_ExamPaperServices.cs index b0957936..70b99ffb 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_ExamPaperServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_ExamPaperServices.cs @@ -1,8 +1,5 @@ using Microsoft.AspNetCore.Mvc; using Tiobon.Core.Common; -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model; -using Tiobon.Core.Model.Models; namespace Tiobon.Core.IServices; diff --git a/Tiobon.Core.IServices/Ghre/IGhre_ExamRecordAnswerServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_ExamRecordAnswerServices.cs index 5e369ddc..d77f731d 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_ExamRecordAnswerServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_ExamRecordAnswerServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// Ghre_ExamRecordAnswer(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_ExamRecordDetailServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_ExamRecordDetailServices.cs index 88487653..42216187 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_ExamRecordDetailServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_ExamRecordDetailServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// Ghre_ExamRecordDetail(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_ExamServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_ExamServices.cs index 3a725319..ceda8442 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_ExamServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_ExamServices.cs @@ -1,7 +1,4 @@ using Tiobon.Core.Common; -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model; -using Tiobon.Core.Model.Models; namespace Tiobon.Core.IServices; diff --git a/Tiobon.Core.IServices/Ghre/IGhre_ExamStaffServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_ExamStaffServices.cs index a5c6e04c..2a726950 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_ExamStaffServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_ExamStaffServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// Ghre_ExamStaff(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_QuestionAnswerServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_QuestionAnswerServices.cs index 0d5f12f2..5aa132b5 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_QuestionAnswerServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_QuestionAnswerServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 题目答案(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_QuestionServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_QuestionServices.cs index b7e540f3..badcbc98 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_QuestionServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_QuestionServices.cs @@ -1,8 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 题目(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_RequiredCourseServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_RequiredCourseServices.cs index d46750f4..c17c1d38 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_RequiredCourseServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_RequiredCourseServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 必选修查询(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_SchoolAttachmentServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_SchoolAttachmentServices.cs index f2a75f63..14f4df5f 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_SchoolAttachmentServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_SchoolAttachmentServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 培训机构附件(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_SchoolServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_SchoolServices.cs index dad8405e..3fdc3b49 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_SchoolServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_SchoolServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 培训机构(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_StudyRecordDetailServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_StudyRecordDetailServices.cs index 7de92971..9cda08bc 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_StudyRecordDetailServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_StudyRecordDetailServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 培训记录明细(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_StudyRuleResultServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_StudyRuleResultServices.cs index 6b1937a4..fbf6eaad 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_StudyRuleResultServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_StudyRuleResultServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 必选修规则结果(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_StudyRuleStaffServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_StudyRuleStaffServices.cs index 9bc0a25d..3f04919f 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_StudyRuleStaffServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_StudyRuleStaffServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 必选修规则人员(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_TeacherAttachmentServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_TeacherAttachmentServices.cs index fd6e7957..929bd77b 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_TeacherAttachmentServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_TeacherAttachmentServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// Ghre_TeacherAttachment(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_TeacherChangeAttachmentServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_TeacherChangeAttachmentServices.cs index 5f3f63a4..fe9344f0 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_TeacherChangeAttachmentServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_TeacherChangeAttachmentServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 培训讲师异动附件(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_TeacherChangeServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_TeacherChangeServices.cs index c1d3e2a6..3018bcb4 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_TeacherChangeServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_TeacherChangeServices.cs @@ -1,8 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 培训讲师异动(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghre/IGhre_TeacherServices.cs b/Tiobon.Core.IServices/Ghre/IGhre_TeacherServices.cs index 3b3709c5..7bb3ae0c 100644 --- a/Tiobon.Core.IServices/Ghre/IGhre_TeacherServices.cs +++ b/Tiobon.Core.IServices/Ghre/IGhre_TeacherServices.cs @@ -1,8 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// Ghre_Teacher(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_AssessConfigServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_AssessConfigServices.cs index ef76d239..21661bf3 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_AssessConfigServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_AssessConfigServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 面试评估设定(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_ConfigGroupServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_ConfigGroupServices.cs index 5d5bcc7e..353e132c 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_ConfigGroupServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_ConfigGroupServices.cs @@ -1,8 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 招聘参数配置组(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_ConfigServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_ConfigServices.cs index c7ea6700..51c82be2 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_ConfigServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_ConfigServices.cs @@ -1,8 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 招聘参数配置(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_HumanRequestDetailServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_HumanRequestDetailServices.cs index b60588c4..a1ba305d 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_HumanRequestDetailServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_HumanRequestDetailServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 人力需求维护明细(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_HumanRequestServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_HumanRequestServices.cs index af3e077b..322e184d 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_HumanRequestServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_HumanRequestServices.cs @@ -1,7 +1,4 @@ using Tiobon.Core.Common; -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model; -using Tiobon.Core.Model.Models; namespace Tiobon.Core.IServices; diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_InterviewAssessDetailServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_InterviewAssessDetailServices.cs index ea1c21cf..5d608030 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_InterviewAssessDetailServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_InterviewAssessDetailServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 面试单评估明细(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_InterviewAssessServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_InterviewAssessServices.cs index 4aa28e80..b2937b75 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_InterviewAssessServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_InterviewAssessServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 面试单评估(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_InterviewLogServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_InterviewLogServices.cs index 4ed5227e..0190a5e2 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_InterviewLogServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_InterviewLogServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 面试工单日志(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_InterviewOrderServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_InterviewOrderServices.cs index d0638db4..45e9a2e9 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_InterviewOrderServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_InterviewOrderServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 面试工单(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_InterviewRecordServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_InterviewRecordServices.cs index d929c5bc..0f425c60 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_InterviewRecordServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_InterviewRecordServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 面试记录(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_OfferApplyOrderSalaryServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_OfferApplyOrderSalaryServices.cs index 7644755c..33cbd610 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_OfferApplyOrderSalaryServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_OfferApplyOrderSalaryServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 录用审批单薪资(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_OfferApplyOrderServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_OfferApplyOrderServices.cs index 669e67e1..0f3c09d6 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_OfferApplyOrderServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_OfferApplyOrderServices.cs @@ -1,8 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 录用审批单(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeEduBGServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeEduBGServices.cs index f90bfec6..b16e316c 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeEduBGServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeEduBGServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 教育背景(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeHomeServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeHomeServices.cs index 403e8a56..7ec24802 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeHomeServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeHomeServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 家庭关系(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeInfoColumnServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeInfoColumnServices.cs index 535980cd..0a0c6edb 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeInfoColumnServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeInfoColumnServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 简历信息栏位(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeInfoGroupServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeInfoGroupServices.cs index 46aa8cdd..ccd2ab36 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeInfoGroupServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeInfoGroupServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 简历组别(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeLicenceServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeLicenceServices.cs index 3f5e4204..574907ca 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeLicenceServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeLicenceServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 证件(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs index 0451c292..437e6c77 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeServices.cs @@ -1,9 +1,5 @@ using Microsoft.AspNetCore.Mvc; -using Newtonsoft.Json.Linq; using Tiobon.Core.Common; -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model; -using Tiobon.Core.Model.Models; using Tiobon.Core.Model.ViewModels.Extend; namespace Tiobon.Core.IServices; diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeStatementServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeStatementServices.cs index 1a7f9d05..fdf0da93 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeStatementServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeStatementServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 简历声明(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeTagServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeTagServices.cs index 4b55a81e..8e79e115 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeTagServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeTagServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 简历标签(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeTemplateServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeTemplateServices.cs index b3525fd7..b38a82d9 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeTemplateServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeTemplateServices.cs @@ -1,7 +1,4 @@ using Tiobon.Core.Common; -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model; -using Tiobon.Core.Model.Models; using Tiobon.Core.Model.ViewModels.Extend; namespace Tiobon.Core.IServices; diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeTrainingServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeTrainingServices.cs index eff1af67..ec93fdd5 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeTrainingServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeTrainingServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 简历培训记录(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeWorkExpServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeWorkExpServices.cs index e17b3e60..f0e0a1cc 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeWorkExpServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_ResumeWorkExpServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 工作经历(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_StatementServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_StatementServices.cs index 2f607c76..f5aed2b6 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_StatementServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_StatementServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 声明(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_TemplateServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_TemplateServices.cs index 3e5c0ee3..6748dfa7 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_TemplateServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_TemplateServices.cs @@ -1,8 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 招聘模板(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_YearHumanApplyOrderServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_YearHumanApplyOrderServices.cs index 9608bdc6..7a34484e 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_YearHumanApplyOrderServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_YearHumanApplyOrderServices.cs @@ -1,8 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 年度人力申请(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrh/IGhrh_YearHumanSettingsServices.cs b/Tiobon.Core.IServices/Ghrh/IGhrh_YearHumanSettingsServices.cs index 23158fd1..565290fd 100644 --- a/Tiobon.Core.IServices/Ghrh/IGhrh_YearHumanSettingsServices.cs +++ b/Tiobon.Core.IServices/Ghrh/IGhrh_YearHumanSettingsServices.cs @@ -1,8 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 年度人力配置(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrm/IGhrm_MessageTextServices.cs b/Tiobon.Core.IServices/Ghrm/IGhrm_MessageTextServices.cs index 74198f2c..33d17260 100644 --- a/Tiobon.Core.IServices/Ghrm/IGhrm_MessageTextServices.cs +++ b/Tiobon.Core.IServices/Ghrm/IGhrm_MessageTextServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// Ghrm_MessageText(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrm/IGhrm_MessageUserServices.cs b/Tiobon.Core.IServices/Ghrm/IGhrm_MessageUserServices.cs index 7f720afb..00f30a10 100644 --- a/Tiobon.Core.IServices/Ghrm/IGhrm_MessageUserServices.cs +++ b/Tiobon.Core.IServices/Ghrm/IGhrm_MessageUserServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// Ghrm_MessageUser(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghro/IGhro_DeptServices.cs b/Tiobon.Core.IServices/Ghro/IGhro_DeptServices.cs index 1e272123..058dc929 100644 --- a/Tiobon.Core.IServices/Ghro/IGhro_DeptServices.cs +++ b/Tiobon.Core.IServices/Ghro/IGhro_DeptServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// Ghro_Dept(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrp/IGhrp_PerformanceItemServices.cs b/Tiobon.Core.IServices/Ghrp/IGhrp_PerformanceItemServices.cs index 43e8de4a..6797ec5c 100644 --- a/Tiobon.Core.IServices/Ghrp/IGhrp_PerformanceItemServices.cs +++ b/Tiobon.Core.IServices/Ghrp/IGhrp_PerformanceItemServices.cs @@ -1,12 +1,8 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; +namespace Tiobon.Core.IServices; -namespace Tiobon.Core.IServices -{ - /// - /// 考核指标(自定义服务接口) - /// - public interface IGhrp_PerformanceItemServices :IBaseServices +/// +/// 考核指标(自定义服务接口) +/// +public interface IGhrp_PerformanceItemServices :IBaseServices { - } } \ No newline at end of file diff --git a/Tiobon.Core.IServices/Ghrp/IGhrp_PerformancePeriodServices.cs b/Tiobon.Core.IServices/Ghrp/IGhrp_PerformancePeriodServices.cs index 16569d20..4a76f3b2 100644 --- a/Tiobon.Core.IServices/Ghrp/IGhrp_PerformancePeriodServices.cs +++ b/Tiobon.Core.IServices/Ghrp/IGhrp_PerformancePeriodServices.cs @@ -1,13 +1,8 @@ -using Newtonsoft.Json.Linq; -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices -{ - /// - /// 考核期间(自定义服务接口) - /// +namespace Tiobon.Core.IServices +{ + /// + /// 考核期间(自定义服务接口) + /// public interface IGhrp_PerformancePeriodServices :IBaseServices { Task BatchCreatePeriod(JObject jsonParam); diff --git a/Tiobon.Core.IServices/Ghrp/IGhrp_PerformancePeriodTypeServices.cs b/Tiobon.Core.IServices/Ghrp/IGhrp_PerformancePeriodTypeServices.cs index e1a4582d..ef1073db 100644 --- a/Tiobon.Core.IServices/Ghrp/IGhrp_PerformancePeriodTypeServices.cs +++ b/Tiobon.Core.IServices/Ghrp/IGhrp_PerformancePeriodTypeServices.cs @@ -1,12 +1,8 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices -{ - /// - /// 考核周期类别(自定义服务接口) - /// +namespace Tiobon.Core.IServices +{ + /// + /// 考核周期类别(自定义服务接口) + /// public interface IGhrp_PerformancePeriodTypeServices :IBaseServices { Task>> GetStageItems(string Stage); diff --git a/Tiobon.Core.IServices/Ghrp/IGhrp_PerformanceTemplateServices.cs b/Tiobon.Core.IServices/Ghrp/IGhrp_PerformanceTemplateServices.cs index b4266f1b..768f98eb 100644 --- a/Tiobon.Core.IServices/Ghrp/IGhrp_PerformanceTemplateServices.cs +++ b/Tiobon.Core.IServices/Ghrp/IGhrp_PerformanceTemplateServices.cs @@ -1,11 +1,8 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices -{ - /// - /// 考核模板(自定义服务接口) - /// +namespace Tiobon.Core.IServices +{ + /// + /// 考核模板(自定义服务接口) + /// public interface IGhrp_PerformanceTemplateServices :IBaseServices { } diff --git a/Tiobon.Core.IServices/Ghrs/IGhrs_AttachmentServices.cs b/Tiobon.Core.IServices/Ghrs/IGhrs_AttachmentServices.cs index 4ddcd7e2..8733270a 100644 --- a/Tiobon.Core.IServices/Ghrs/IGhrs_AttachmentServices.cs +++ b/Tiobon.Core.IServices/Ghrs/IGhrs_AttachmentServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// Ghrs_Attachment(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrs/IGhrs_DataRoleDetailServices.cs b/Tiobon.Core.IServices/Ghrs/IGhrs_DataRoleDetailServices.cs index 5d434903..d45c42de 100644 --- a/Tiobon.Core.IServices/Ghrs/IGhrs_DataRoleDetailServices.cs +++ b/Tiobon.Core.IServices/Ghrs/IGhrs_DataRoleDetailServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// Ghrs_DataRoleDetail(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrs/IGhrs_LangKeyServices.cs b/Tiobon.Core.IServices/Ghrs/IGhrs_LangKeyServices.cs index 03e7347e..d95d5527 100644 --- a/Tiobon.Core.IServices/Ghrs/IGhrs_LangKeyServices.cs +++ b/Tiobon.Core.IServices/Ghrs/IGhrs_LangKeyServices.cs @@ -1,8 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// Ghrs_LangKey(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrs/IGhrs_ListCommonSqlServices.cs b/Tiobon.Core.IServices/Ghrs/IGhrs_ListCommonSqlServices.cs index 3c1dadef..16864940 100644 --- a/Tiobon.Core.IServices/Ghrs/IGhrs_ListCommonSqlServices.cs +++ b/Tiobon.Core.IServices/Ghrs/IGhrs_ListCommonSqlServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// Ghrs_ListCommonSql(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrs/IGhrs_MailOutboxServices.cs b/Tiobon.Core.IServices/Ghrs/IGhrs_MailOutboxServices.cs index 040030dd..0e860603 100644 --- a/Tiobon.Core.IServices/Ghrs/IGhrs_MailOutboxServices.cs +++ b/Tiobon.Core.IServices/Ghrs/IGhrs_MailOutboxServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// Ghrs_MailOutbox(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrs/IGhrs_MenuServices.cs b/Tiobon.Core.IServices/Ghrs/IGhrs_MenuServices.cs index e6dad364..77ab9dd9 100644 --- a/Tiobon.Core.IServices/Ghrs/IGhrs_MenuServices.cs +++ b/Tiobon.Core.IServices/Ghrs/IGhrs_MenuServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// Ghrs_Menu(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrs/IGhrs_ParaDetailServices.cs b/Tiobon.Core.IServices/Ghrs/IGhrs_ParaDetailServices.cs index 5fb5a571..0a2ae520 100644 --- a/Tiobon.Core.IServices/Ghrs/IGhrs_ParaDetailServices.cs +++ b/Tiobon.Core.IServices/Ghrs/IGhrs_ParaDetailServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// Ghrs_ParaDetail(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrs/IGhrs_UserServices.cs b/Tiobon.Core.IServices/Ghrs/IGhrs_UserServices.cs index 2b89eb7c..aefd896a 100644 --- a/Tiobon.Core.IServices/Ghrs/IGhrs_UserServices.cs +++ b/Tiobon.Core.IServices/Ghrs/IGhrs_UserServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 系统用户(自定义服务接口) diff --git a/Tiobon.Core.IServices/Ghrz/IGhrz_Shihua_OA_EmploymentServices.cs b/Tiobon.Core.IServices/Ghrz/IGhrz_Shihua_OA_EmploymentServices.cs index fc7cade5..4f74f24f 100644 --- a/Tiobon.Core.IServices/Ghrz/IGhrz_Shihua_OA_EmploymentServices.cs +++ b/Tiobon.Core.IServices/Ghrz/IGhrz_Shihua_OA_EmploymentServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// Ghrz_Shihua_OA_Employment(自定义服务接口) diff --git a/Tiobon.Core.IServices/GlobalUsings.cs b/Tiobon.Core.IServices/GlobalUsings.cs index 93487424..43f84361 100644 --- a/Tiobon.Core.IServices/GlobalUsings.cs +++ b/Tiobon.Core.IServices/GlobalUsings.cs @@ -1,2 +1,4 @@ -global using Tiobon.Core.IServices.BASE; -global using Tiobon.Core.Model.Models; \ No newline at end of file +global using Tiobon.Core.Base.IServices; +global using Tiobon.Core.Model.Models; +global using Newtonsoft.Json.Linq; +global using Tiobon.Core.Model; \ No newline at end of file diff --git a/Tiobon.Core.IServices/ICommonServices.cs b/Tiobon.Core.IServices/ICommonServices.cs index cd3c71b3..0bf5ddcb 100644 --- a/Tiobon.Core.IServices/ICommonServices.cs +++ b/Tiobon.Core.IServices/ICommonServices.cs @@ -1,8 +1,5 @@ using Microsoft.AspNetCore.Http; -using Newtonsoft.Json.Linq; using Tiobon.Core.Common; -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model; namespace Tiobon.Core.IServices; diff --git a/Tiobon.Core.IServices/IDS4Db/IApplicationUserServices.cs b/Tiobon.Core.IServices/IDS4Db/IApplicationUserServices.cs index 6b6b1d4d..b16bd90c 100644 --- a/Tiobon.Core.IServices/IDS4Db/IApplicationUserServices.cs +++ b/Tiobon.Core.IServices/IDS4Db/IApplicationUserServices.cs @@ -1,5 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.IDS4DbModels; +using Tiobon.Core.Model.IDS4DbModels; namespace Tiobon.Core.IServices; diff --git a/Tiobon.Core.IServices/IDepartmentServices.cs b/Tiobon.Core.IServices/IDepartmentServices.cs index 76efd1ee..d163ad18 100644 --- a/Tiobon.Core.IServices/IDepartmentServices.cs +++ b/Tiobon.Core.IServices/IDepartmentServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// IDepartmentServices diff --git a/Tiobon.Core.IServices/IGhra_GradeServices.cs b/Tiobon.Core.IServices/IGhra_GradeServices.cs index 856d83df..88105912 100644 --- a/Tiobon.Core.IServices/IGhra_GradeServices.cs +++ b/Tiobon.Core.IServices/IGhra_GradeServices.cs @@ -1,11 +1,8 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// 年级(自定义服务接口) /// - public interface IGhra_GradeServices :IBaseServices +public interface IGhra_GradeServices :IBaseServices { } \ No newline at end of file diff --git a/Tiobon.Core.IServices/IModuleServices.cs b/Tiobon.Core.IServices/IModuleServices.cs index bdf989b9..ae0192a4 100644 --- a/Tiobon.Core.IServices/IModuleServices.cs +++ b/Tiobon.Core.IServices/IModuleServices.cs @@ -1,12 +1,9 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - namespace Tiobon.Core.IServices; /// /// ModuleServices /// - public interface IModuleServices :IBaseServices +public interface IModuleServices :IBaseServices { diff --git a/Tiobon.Core.IServices/IOperateLogServices.cs b/Tiobon.Core.IServices/IOperateLogServices.cs index ed376d89..647f75b1 100644 --- a/Tiobon.Core.IServices/IOperateLogServices.cs +++ b/Tiobon.Core.IServices/IOperateLogServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// IOperateLogServices diff --git a/Tiobon.Core.IServices/IPasswordLibServices.cs b/Tiobon.Core.IServices/IPasswordLibServices.cs index a6e64f68..ac5d7c43 100644 --- a/Tiobon.Core.IServices/IPasswordLibServices.cs +++ b/Tiobon.Core.IServices/IPasswordLibServices.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; public partial interface IPasswordLibServices :IBaseServices { diff --git a/Tiobon.Core.IServices/IPermissionServices.cs b/Tiobon.Core.IServices/IPermissionServices.cs index 15f86a0a..889fc0f0 100644 --- a/Tiobon.Core.IServices/IPermissionServices.cs +++ b/Tiobon.Core.IServices/IPermissionServices.cs @@ -1,6 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; public partial interface IPermissionServices : IBaseServices { diff --git a/Tiobon.Core.IServices/IReportServices.cs b/Tiobon.Core.IServices/IReportServices.cs index a8d48b37..85f0e78d 100644 --- a/Tiobon.Core.IServices/IReportServices.cs +++ b/Tiobon.Core.IServices/IReportServices.cs @@ -1,7 +1,4 @@ using Tiobon.Core.Common; -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model; -using Tiobon.Core.Model.Models; namespace Tiobon.Core.IServices; diff --git a/Tiobon.Core.IServices/IRoleModulePermissionServices.cs b/Tiobon.Core.IServices/IRoleModulePermissionServices.cs index fd942d16..34c3f53a 100644 --- a/Tiobon.Core.IServices/IRoleModulePermissionServices.cs +++ b/Tiobon.Core.IServices/IRoleModulePermissionServices.cs @@ -1,6 +1,3 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - namespace Tiobon.Core.IServices; /// diff --git a/Tiobon.Core.IServices/IRoleServices.cs b/Tiobon.Core.IServices/IRoleServices.cs index 886f4065..caedba08 100644 --- a/Tiobon.Core.IServices/IRoleServices.cs +++ b/Tiobon.Core.IServices/IRoleServices.cs @@ -1,6 +1,3 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - namespace Tiobon.Core.IServices; /// diff --git a/Tiobon.Core.IServices/ISplitDemoServices.cs b/Tiobon.Core.IServices/ISplitDemoServices.cs index 68b551ae..df9d1c69 100644 --- a/Tiobon.Core.IServices/ISplitDemoServices.cs +++ b/Tiobon.Core.IServices/ISplitDemoServices.cs @@ -1,8 +1,3 @@ - - -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - namespace Tiobon.Core.IServices; /// diff --git a/Tiobon.Core.IServices/ITasksLogServices.cs b/Tiobon.Core.IServices/ITasksLogServices.cs index 9524f38c..f5e53c97 100644 --- a/Tiobon.Core.IServices/ITasksLogServices.cs +++ b/Tiobon.Core.IServices/ITasksLogServices.cs @@ -1,8 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// ITasksLogServices diff --git a/Tiobon.Core.IServices/ITasksQzServices.cs b/Tiobon.Core.IServices/ITasksQzServices.cs index 3ba1e22c..c24d1bfc 100644 --- a/Tiobon.Core.IServices/ITasksQzServices.cs +++ b/Tiobon.Core.IServices/ITasksQzServices.cs @@ -1,8 +1,4 @@ - -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; /// /// ITasksQzServices diff --git a/Tiobon.Core.IServices/ITenantService.cs b/Tiobon.Core.IServices/ITenantService.cs index 3c2a029d..6af63d7c 100644 --- a/Tiobon.Core.IServices/ITenantService.cs +++ b/Tiobon.Core.IServices/ITenantService.cs @@ -1,7 +1,4 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - -namespace Tiobon.Core.IServices; +namespace Tiobon.Core.IServices; public interface ITenantService : IBaseServices { diff --git a/Tiobon.Core.IServices/IUserRoleServices.cs b/Tiobon.Core.IServices/IUserRoleServices.cs index d7f93221..c8138bf2 100644 --- a/Tiobon.Core.IServices/IUserRoleServices.cs +++ b/Tiobon.Core.IServices/IUserRoleServices.cs @@ -1,6 +1,3 @@ -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - namespace Tiobon.Core.IServices; /// diff --git a/Tiobon.Core.IServices/IsysUserInfoServices.cs b/Tiobon.Core.IServices/IsysUserInfoServices.cs index c7633a0c..2563d204 100644 --- a/Tiobon.Core.IServices/IsysUserInfoServices.cs +++ b/Tiobon.Core.IServices/IsysUserInfoServices.cs @@ -1,8 +1,3 @@ - - -using Tiobon.Core.IServices.BASE; -using Tiobon.Core.Model.Models; - namespace Tiobon.Core.IServices; /// diff --git a/Tiobon.Core.IServices/Tiobon.Core.IServices.csproj b/Tiobon.Core.IServices/Tiobon.Core.IServices.csproj index def6c6cf..5a479337 100644 --- a/Tiobon.Core.IServices/Tiobon.Core.IServices.csproj +++ b/Tiobon.Core.IServices/Tiobon.Core.IServices.csproj @@ -17,4 +17,10 @@ + + + ..\Lib\Tiobon.Core.Base.dll + + + diff --git a/Tiobon.Core.Services/BASE/BaseServices.cs b/Tiobon.Core.Services/BASE/BaseServices.cs deleted file mode 100644 index e6ea9ed6..00000000 --- a/Tiobon.Core.Services/BASE/BaseServices.cs +++ /dev/null @@ -1,2322 +0,0 @@ -namespace Tiobon.Core.Services.BASE; - -/// -/// 增删改查基础服务 -/// -/// -/// -/// -/// -public class BaseServices : IBaseServices where TEntity : class, new() -{ - public ICaching _caching; - - public BaseServices(IBaseRepository BaseDal = null, ICaching caching = null) - { - this.BaseDal = BaseDal; - _caching = caching; - } - - //public IBaseRepository baseDal = new BaseRepository(); - public IBaseRepository BaseDal { get; set; } //通过在子类的构造函数中注入,这里是基类,不用构造函数 - - public ISqlSugarClient Db => BaseDal.Db; - public int? LangId => App.User.GetLangId(); - - /// - /// 根据ID查询实体数据是否存在 - /// - /// - /// - public async Task AnyAsync(object objId) - { - var data = await BaseDal.AnyAsync(objId); - return data; - } - - public async Task AnyAsync(Expression> whereExpression) - { - var data = await BaseDal.AnyAsync(whereExpression); - return data; - } - - public virtual async Task QueryById(object objId) - { - var data = new TEntity(); - var dto = Mapper.Map(data).ToANew(); - - var entityInfo = Db.EntityMaintenance.GetEntityInfo(typeof(TEntity)); - - var keyName = entityInfo.Columns.Where(x => x.IsPrimarykey == true).FirstOrDefault()?.DbColumnName ?? "Id"; - - string sql = @$"DECLARE @langId INT = 1,@ID BIGINT = '{objId}'; - SELECT *, - isnull - ((SELECT CASE WHEN @langId = 1 THEN UserName ELSE UserEname END - FROM Ghrs_User kk - WHERE kk.UserId = a.CreateBy), - '') - + ' ' - + [dbo].[FLangKeyToValue] ('GHR_Common_000078', @langId, '于 ') - + ' ' - + CONVERT (NVARCHAR (16), CreateTime, 121) - + ' ' - + [dbo].[FLangKeyToValue] ('GHR_Common_000079', @langId, ' 创建') - CreateDataInfo, - isnull - ((SELECT CASE WHEN @langId = 1 THEN UserName ELSE UserEname END - FROM Ghrs_User kk - WHERE kk.UserId = a.UpdateBy), - '') - + ' ' - + [dbo].[FLangKeyToValue] ('GHR_Common_000078', @langId, '于') - + ' ' - + CONVERT (NVARCHAR (16), UpdateTime, 121) - + ' ' - + [dbo].[FLangKeyToValue] - ('GHR_Common_000080', @langId, ' 最后修改') - UpdateDataInfo - FROM {entityInfo.DbTableName} a - WHERE a.{keyName} = @ID AND IsEnable='1'"; - dto = await Db.Ado.SqlQuerySingleAsync(sql); - return dto; - } - - /// - /// 根据ID查询一条数据 - /// - /// id(必须指定主键特性 [SugarColumn(IsPrimaryKey=true)]),如果是联合主键,请使用Where条件 - /// 是否使用缓存 - /// 数据实体 - public async Task QueryById(object objId, bool blnUseCache = false) - { - var data = await BaseDal.QueryById(objId, blnUseCache); - return Mapper.Map(data).ToANew(); - } - - /// - /// 根据ID查询数据 - /// - /// id列表(必须指定主键特性 [SugarColumn(IsPrimaryKey=true)]),如果是联合主键,请使用Where条件 - /// 数据实体列表 - public async Task> QueryByIDs(object[] lstIds) - { - var data = await BaseDal.QueryByIDs(lstIds); - return Mapper.Map(data).ToANew>(); - } - - public virtual async Task> QueryForm(QueryForm body) - { - var data = new ServiceFormResult(); - string sql = string.Empty; - var dt = new DataTable(); - - if (body.id != null) - { - Type entityType = typeof(TEntity); - sql = @$"DECLARE @langId INT = '{body.langId}',@ID BIGINT = '{body.id}'; - - SELECT *, - isnull - ((SELECT CASE WHEN @langId = 1 THEN UserName ELSE UserEname END - FROM Ghrs_User kk - WHERE kk.UserId = a.CreateBy), - '') - + ' ' - + [dbo].[FLangKeyToValue] ('GHR_Common_000078', @langId, '于 ') - + ' ' - + CONVERT (NVARCHAR (16), CreateTime, 121) - + ' ' - + [dbo].[FLangKeyToValue] ('GHR_Common_000079', @langId, ' 创建') - CreateDataInfo, - isnull - ((SELECT CASE WHEN @langId = 1 THEN UserName ELSE UserEname END - FROM Ghrs_User kk - WHERE kk.UserId = a.UpdateBy), - '') - + ' ' - + [dbo].[FLangKeyToValue] ('GHR_Common_000078', @langId, '于') - + ' ' - + CONVERT (NVARCHAR (16), UpdateTime, 121) - + ' ' - + [dbo].[FLangKeyToValue] - ('GHR_Common_000080', @langId, ' 最后修改') - UpdateDataInfo - FROM {entityType.GetEntityTableName()} a - WHERE a.Id = @ID"; - data.result.DT_TableDataT1 = await Db.Ado.SqlQueryAsync(sql); - } - else - { - var list = new List - { - new TEntity() - }; - - data.result.DT_TableDataT1 = Mapper.Map(list).ToANew>(); - - } - #region JM_PageFormActionsT1 - dynamic JM_PageFormActionsT1 = new ExpandoObject(); - - //var toolbars = await _caching.GetAsync>(body.menuName + "FormToolbar"); - //if (toolbars == null || (toolbars != null && !toolbars.Any())) - //{ - - // if (toolbars.Any()) - // await _caching.SetAsync(body.menuName + "FormToolbar", toolbars); - //} - sql = @$"SELECT field fnKey, [dbo].[FLangKeyToValue] (mkey, {body.langId}, label) fnTitle, icon - FROM Ghrs_PageSettingEdit - WHERE IsEnable = 1 AND pageNo = '{body.menuName}' AND elementType = 'FnKey'"; - var toolbars = await Db.Ado.SqlQueryAsync(sql); - - JM_PageFormActionsT1.Toolbar = toolbars; - #endregion - - #region JM_TableColumnT1 - dynamic JM_TableColumnT1 = new ExpandoObject(); - var tableColumn = new JArray(); - sql = @$"SELECT field, - [dbo].[FLangKeyToValue] (mkey, {body.langId}, label) - label, - required, - editable, - rowNum, - colNum, - dataType, - elementType, - dbo.FS_GetdataSourceBySet - (dataSource, APIDataSourceType, Ghrs_PageSettingEdit.APIDataSourceID) - dataSource, - defaultHidden, - isPrimaryKey, - isSingleColumn,multipleSelect - FROM Ghrs_PageSettingEdit - WHERE IsEnable = 1 - AND pageNo = '{body.menuName}' - AND elementType NOT IN ('FnKey', 'PageGroup');"; - dt = await Db.Ado.GetDataTableAsync(sql); - - for (int i = 0; i < dt.Rows.Count; i++) - { - JObject item = - new JObject { - new JProperty("field", dt.Rows[i]["field"].ToString()), - new JProperty("label", dt.Rows[i]["label"].ToString()), - new JProperty("required", !string.IsNullOrWhiteSpace(dt.Rows[i]["required"].ToString()) ? Convert.ToBoolean(dt.Rows[i]["required"]) : null), - new JProperty("editable", !string.IsNullOrWhiteSpace(dt.Rows[i]["editable"].ToString()) ? Convert.ToBoolean(dt.Rows[i]["editable"]) : null), - new JProperty("rowNum", !string.IsNullOrWhiteSpace(dt.Rows[i]["rowNum"].ToString()) ? Convert.ToInt32(dt.Rows[i]["rowNum"]) : null), - new JProperty("colNum", !string.IsNullOrWhiteSpace(dt.Rows[i]["colNum"].ToString()) ? Convert.ToInt32(dt.Rows[i]["colNum"]) : null), - new JProperty("dataType", dt.Rows[i]["dataType"].ToString()), - new JProperty("elementType", dt.Rows[i]["elementType"].ToString()), - new JProperty("dataSource", dt.Rows[i]["dataSource"].ToString()), - new JProperty("defaultHidden", dt.Rows[i]["defaultHidden"].ToString()), - new JProperty("isPrimaryKey", !string.IsNullOrWhiteSpace(dt.Rows[i]["isPrimaryKey"].ToString()) ? Convert.ToBoolean(dt.Rows[i]["isPrimaryKey"]) : null), - new JProperty("isSingleColumn", !string.IsNullOrWhiteSpace(dt.Rows[i]["isSingleColumn"].ToString()) ? Convert.ToInt32(dt.Rows[i]["isSingleColumn"]) : null), - new JProperty("multipleSelect", !string.IsNullOrWhiteSpace(dt.Rows[i]["multipleSelect"].ToString()) ? Convert.ToBoolean(dt.Rows[i]["multipleSelect"]) : null) - }; - tableColumn.Add(item); - } - JM_TableColumnT1.TableColumn = tableColumn; - #endregion - - #region JM_PageFormT1 - dynamic JM_PageFormT1 = new ExpandoObject(); - var pageForm = new JArray(); - JObject pageFormItem = new JObject { - new JProperty("disabled", false), - new JProperty("labelAlign", "right"), - new JProperty("labelCol", "{span: 6}"), - new JProperty("labelWidth",120), - new JProperty("layout", "horizontal") - }; - - sql = $@"SELECT [dbo].[FLangKeyToValue] (MKey, {body.langId}, MenuName) pageTitle, - IUDProcedure apiName - FROM Ghrs_Menu - WHERE MenuNo = '{body.menuName}' AND IsEnable = 1"; - dt = await Db.Ado.GetDataTableAsync(sql); - if (dt.Rows.Count > 0) - { - pageFormItem.Add(new JProperty("pageTitle", dt.Rows[0]["pageTitle"].ToString())); - pageFormItem.Add(new JProperty("apiName", dt.Rows[0]["apiName"].ToString())); - } - pageForm.Add(pageFormItem); - JM_PageFormT1.PageForm = pageForm; - #endregion - - #region DT_PageMutiMsg - var DT_PageMutiMsg = await _caching.GetAsync>("DT_PageMutiMsg"); - if (DT_PageMutiMsg == null || (DT_PageMutiMsg != null && !DT_PageMutiMsg.Any())) - { - sql = $@"SELECT Langkey field, - CASE {body.langId} - WHEN 1 THEN isnull (Value01, LangValue) - WHEN 2 THEN isnull (Value02, LangValue) - WHEN 3 THEN isnull (Value03, LangValue) - WHEN 4 THEN isnull (Value04, LangValue) - WHEN 5 THEN isnull (Value05, LangValue) - WHEN 6 THEN isnull (Value06, LangValue) - WHEN 7 THEN isnull (Value07, LangValue) - WHEN 8 THEN isnull (Value08, LangValue) - WHEN 9 THEN isnull (Value09, LangValue) - WHEN 10 THEN isnull (Value10, LangValue) - END label - FROM Ghrs_LangKey - WHERE (LangKey LIKE 'GHR_Page%' OR LangKey LIKE 'GHR_Common%') - AND IsEnable = 1"; - DT_PageMutiMsg = Db.Ado.SqlQuery(sql); - if (DT_PageMutiMsg.Any()) - await _caching.SetAsync("DT_PageMutiMsg", DT_PageMutiMsg); - } - #endregion - - data.result.JM_PageFormActionsT1 = JM_PageFormActionsT1; - data.result.JM_TableColumnT1 = JM_TableColumnT1; - data.result.JM_PageFormT1 = JM_PageFormT1; - data.result.DT_PageMutiMsg = DT_PageMutiMsg; - return data; - } - - #region 新增 - - /// - /// 写入实体数据 - /// - /// 实体类 - /// - public virtual async Task Add(TInsertDto entity) - { - var entity1 = Mapper.Map(entity).ToANew(); - if (UserContext.Context != null) - { - HttpRequest request = UserContext.Context.Request; - var api = request.Path.ObjToString().TrimEnd('/').ToLower(); - var ip = GetUserIp(UserContext.Context); - - BasePoco ent = entity1 as BasePoco; - - ent.CreateIP = ip; - ent.CreateProg = api; - } - - - #region 检查是否存在相同值 - CheckOnly(entity1); - #endregion - - return await BaseDal.Add(entity1); - } - - /// - /// 批量插入实体(速度快) - /// - /// 实体集合 - /// 影响行数 - public virtual async Task> Add(List listEntity) - { - if (listEntity != null && listEntity.Any()) - { - var userId = App.User.ID; - var api = string.Empty; - var ip = string.Empty; - if (UserContext.Context != null) - { - HttpRequest request = UserContext.Context.Request; - api = request.Path.ObjToString().TrimEnd('/').ToLower(); - ip = GetUserIp(UserContext.Context); - } - - - var list = new List(); - - foreach (var item in listEntity) - { - var entity = new TEntity(); - ConvertTInsertDto2TEntity(item, entity); - list.Add(entity); - } - - //var list = Mapper.Map(listEntity).ToANew>(); - list.ForEach(entity => - { - BasePoco ent = entity as BasePoco; - ent.CreateIP = ip; - ent.CreateProg = api; - - - #region 检查是否存在相同值 - CheckOnly(entity); - #endregion - }); - return await BaseDal.Add(list); - } - else return default; - } - #endregion - - /// - /// 更新实体数据 - /// - /// 实体类 - /// - public virtual async Task Update(long Id, TEditDto editModel) - { - HttpRequest request = UserContext.Context.Request; - var api = request.Path.ObjToString().TrimEnd('/').ToLower(); - var ip = GetUserIp(UserContext.Context); - - if (editModel == null || !await BaseDal.AnyAsync(Id)) - return false; - - var entity = await BaseDal.QueryById(Id); - ConvertTEditDto2TEntity(editModel, entity); - BasePoco ent = entity as BasePoco; - ent.UpdateIP = ip; - ent.UpdateProg = api; - CheckOnly(entity, Id); - return await BaseDal.Update(entity); - } - public virtual async Task Update(long Id, TEditDto editModel, List lstColumns = null, List lstIgnoreColumns = null, string where = "") - { - HttpRequest request = UserContext.Context.Request; - var api = request.Path.ObjToString().TrimEnd('/').ToLower(); - var ip = GetUserIp(UserContext.Context); - - if (editModel == null || !await BaseDal.AnyAsync(Id)) - return false; - - var entity = await BaseDal.QueryById(Id); - ConvertTEditDto2TEntity(editModel, entity); - BasePoco ent = entity as BasePoco; - ent.UpdateIP = ip; - ent.UpdateProg = api; - CheckOnly(entity, Id); - return await BaseDal.Update(entity, lstColumns, lstIgnoreColumns, where); - } - public async Task Update(Dictionary editModels) - { - HttpRequest request = UserContext.Context.Request; - var api = request.Path.ObjToString().TrimEnd('/').ToLower(); - var ip = GetUserIp(UserContext.Context); - - List entities = new List(); - foreach (var keyValuePairs in editModels) - { - if (keyValuePairs.Value == null || !BaseDal.Any(keyValuePairs.Key)) - continue; - - var entity = await BaseDal.QueryById(keyValuePairs.Key); - - ConvertTEditDto2TEntity(keyValuePairs.Value, entity); - BasePoco ent = entity as BasePoco; - ent.UpdateIP = ip; - ent.UpdateProg = api; - CheckOnly(entity, keyValuePairs.Key); - entities.Add(entity); - } - - return await BaseDal.Update(entities); - } - /// - /// 更新实体数据 - /// - /// 实体类 - /// - public async Task Update(List listEntity) - { - HttpRequest request = UserContext.Context.Request; - var api = request.Path.ObjToString().TrimEnd('/').ToLower(); - var ip = GetUserIp(UserContext.Context); - listEntity.ForEach(entity => - { - BasePoco ent = entity as BasePoco; - ent.UpdateIP = ip; - ent.UpdateProg = api; - }); - return await BaseDal.Update(listEntity); - } - - public async Task Update(TEntity entity, string where) - { - HttpRequest request = UserContext.Context.Request; - var api = request.Path.ObjToString().TrimEnd('/').ToLower(); - var ip = GetUserIp(UserContext.Context); - BasePoco ent = entity as BasePoco; - ent.UpdateIP = ip; - ent.UpdateProg = api; - return await BaseDal.Update(entity, where); - } - - public async Task Update(object operateAnonymousObjects) - { - return await BaseDal.Update(operateAnonymousObjects); - } - - public async Task Update(TEntity entity, List lstColumns = null, List lstIgnoreColumns = null, string where = "") - { - return await BaseDal.Update(entity, lstColumns, lstIgnoreColumns, where); - } - public async Task Update(List entitys, List lstColumns = null, List lstIgnoreColumns = null, string where = "") - { - return await BaseDal.Update(entitys, lstColumns, lstIgnoreColumns, where); - } - - - /// - /// 根据实体删除一条数据 - /// - /// 实体类 - /// - public async Task Delete(TEntity entity) - { - return await BaseDal.Delete(entity); - } - - /// - /// 删除指定ID的数据 - /// - /// 主键ID - /// - public async Task DeleteById(object id) - { - return await BaseDal.DeleteById(id); - } - - /// - /// 删除指定ID的数据 - /// - /// 主键ID - /// - public virtual async Task DeleteById1(object id) - { - var entity = await BaseDal.QueryById(id); - BasePoco ent = entity as BasePoco; - ent.IsEnable = 0; - return await BaseDal.Update(entity); - } - - /// - /// 删除指定ID集合的数据(批量删除) - /// - /// 主键ID集合 - /// - public async Task DeleteByIds(object[] ids) - { - return await BaseDal.DeleteByIds(ids); - } - /// - /// 删除指定ID集合的数据(批量删除) - /// - /// 主键ID集合 - /// - public virtual async Task DeleteByIds1(long[] ids) - { - HttpRequest request = UserContext.Context.Request; - var api = request.Path.ObjToString().TrimEnd('/').ToLower(); - var ip = GetUserIp(UserContext.Context); - - List entities = new List(); - foreach (var id in ids) - { - if (id == null || !BaseDal.Any(id)) - continue; - - var entity = await BaseDal.QueryById(id); - - BasePoco ent = entity as BasePoco; - ent.UpdateIP = ip; - ent.UpdateProg = api; - ent.IsEnable = 0; - entities.Add(entity); - } - - return await BaseDal.Update(entities); - } - - /// - /// 根据表达式,删除实体 - /// - /// 表达式 - /// - public async Task Delete(Expression> whereExpression) - { - return await BaseDal.Delete(whereExpression); - } - - /// - /// 查询所有数据 - /// - /// 数据列表 - public async Task> Query() - { - return await BaseDal.Query(); - } - - /// - /// 查询数据列表 - /// - /// 条件 - /// 数据列表 - public async Task> Query(string where) - { - return await BaseDal.Query(where); - } - - /// - /// 查询数据列表 - /// - /// whereExpression - /// 数据列表 - public async Task> Query(Expression> whereExpression) - { - return await BaseDal.Query(whereExpression); - } - - public virtual async Task> QueryDto(Expression> whereExpression) - { - var data = await BaseDal.Query(whereExpression); - return Mapper.Map(data).ToANew>(); - } - public virtual async Task QuerySingle(object objId) - { - var entity = await BaseDal.QueryById(objId); - return entity; - } - public async Task QuerySingle(Expression> whereExpression) - { - var entitys = await BaseDal.Query(whereExpression); - var entity = entitys.FirstOrDefault(); - if (entity == null) - return default; - else return entity; - } - public virtual async Task QuerySingleDto(Expression> whereExpression) - { - var entity = await QuerySingle(whereExpression); - if (entity == null) - return default; - else return Mapper.Map(entity).ToANew(); - } - - /// - /// 按照特定列查询数据列表 - /// - /// - /// - /// - public async Task> Query(Expression> expression) - { - return await BaseDal.Query(expression); - } - - /// - /// 按照特定列查询数据列表带条件排序 - /// - /// - /// 过滤条件 - /// 查询实体条件 - /// 排序条件 - /// - public async Task> Query(Expression> expression, Expression> whereExpression, string orderByFileds) - { - return await BaseDal.Query(expression, whereExpression, orderByFileds); - } - - /// - /// 查询一个列表 - /// - /// 条件表达式 - /// 排序字段,如name asc,age desc - /// 数据列表 - public async Task> Query(Expression> whereExpression, Expression> orderByExpression, bool isAsc = true) - { - return await BaseDal.Query(whereExpression, orderByExpression, isAsc); - } - - public async Task> Query(Expression> whereExpression, string orderByFileds) - { - return await BaseDal.Query(whereExpression, orderByFileds); - } - - /// - /// 查询一个列表 - /// - /// 条件 - /// 排序字段,如name asc,age desc - /// 数据列表 - public async Task> Query(string where, string orderByFileds) - { - return await BaseDal.Query(where, orderByFileds); - } - - /// - /// 根据sql语句查询 - /// - /// 完整的sql语句 - /// 参数 - /// 泛型集合 - public async Task> QuerySql(string sql, SugarParameter[] parameters = null) - { - return await BaseDal.QuerySql(sql, parameters); - } - - /// - /// 根据sql语句查询 - /// - /// 完整的sql语句 - /// 参数 - /// DataTable - public async Task QueryTable(string sql, SugarParameter[] parameters = null) - { - return await BaseDal.QueryTable(sql, parameters); - } - - /// - /// 查询前N条数据 - /// - /// 条件表达式 - /// 前N条 - /// 排序字段,如name asc,age desc - /// 数据列表 - public async Task> Query(Expression> whereExpression, int top, string orderByFileds) - { - return await BaseDal.Query(whereExpression, top, orderByFileds); - } - - /// - /// 查询前N条数据 - /// - /// 条件 - /// 前N条 - /// 排序字段,如name asc,age desc - /// 数据列表 - public async Task> Query(string where, int top, string orderByFileds) - { - return await BaseDal.Query(where, top, orderByFileds); - } - - /// - /// 分页查询 - /// - /// 条件表达式 - /// 页码(下标0) - /// 页大小 - /// 排序字段,如name asc,age desc - /// 数据列表 - public async Task> Query(Expression> whereExpression, int pageIndex, int pageSize, string orderByFileds) - { - return await BaseDal.Query(whereExpression, pageIndex, pageSize, orderByFileds); - } - - /// - /// 分页查询 - /// - /// 条件 - /// 页码(下标0) - /// 页大小 - /// 排序字段,如name asc,age desc - /// 数据列表 - public async Task> Query(string where, int pageIndex, int pageSize, string orderByFileds) - { - return await BaseDal.Query(where, pageIndex, pageSize, orderByFileds); - } - - public async Task> QueryPage(Expression> whereExpression, int pageIndex = 1, int pageSize = 20, string orderByFileds = null) - { - return await BaseDal.QueryPage(whereExpression, pageIndex, pageSize, orderByFileds); - } - - public virtual async Task> QueryFilterPage(QueryBody filter) - { - return await QueryFilterPage(filter, null); - } - public virtual async Task> QueryFilterPage(QueryBody filter, string condition, bool? IsEnable = true) - { - if (string.IsNullOrWhiteSpace(filter.orderBy)) - filter.orderBy = "CreateTime1 DESC"; - - if (filter.pageSize == 0) - filter.pageSize = 10000; - - Type entityType = typeof(TEntity); - var properties = entityType.GetGenericProperties(); - - var countSql = @$" SELECT COUNT(1) FROM {entityType.GetEntityTableName()} A"; - var sql1 = @$"DECLARE @langId INT = {filter.langId};"; - var sql = @$" SELECT A.*, - ISNULL ((SELECT CASE WHEN @langId = 1 THEN UserName ELSE UserEname END - FROM Ghrs_User B - WHERE B.UserId = A.CreateBy), - '') CreateDataInfo, - ISNULL ((SELECT CASE WHEN @langId = 1 THEN UserName ELSE UserEname END - FROM Ghrs_User B - WHERE B.UserId = A.UpdateBy), - '') UpdateDataInfo, ISNULL(A.UpdateTime, A.CreateTime) CreateTime1 - FROM {entityType.GetEntityTableName()} A"; - string conditions = " WHERE 1=1 "; - - if (properties.Any(x => x.Name == "DataBelongID")) - conditions += $" AND dbo.FUserDataBelongPriv ({App.User.ID}, A.DataBelongID, NULL) = 1"; - - if (IsEnable == true) - conditions += " AND IsEnable = 1"; - else if (IsEnable == false) - conditions += " AND IsEnable = 0"; - - if (!string.IsNullOrWhiteSpace(condition)) - conditions += " AND " + condition; - - - if (filter.jsonParam != null) - foreach (JProperty jProperty in filter.jsonParam.Properties()) - { - var name = jProperty.Name; - var value = jProperty.Value.ToString(); - if (name == "page" || name == "pageSize" || !properties.Any(x => x.Name == name)) - continue; - if (!string.IsNullOrWhiteSpace(value)) - conditions = DealConditions(conditions, name, value); - } - - sql += conditions; - countSql += conditions; - int total = await Db.Ado.GetIntAsync(countSql); - - sql = "SELECT * FROM (SELECT *, ROW_NUMBER() OVER (ORDER BY " + filter.orderBy + ") NUM FROM (SELECT * FROM (" + sql + " "; - sql += ") A ) B ) C"; - - sql += " WHERE NUM <= " + filter.pageNum * filter.pageSize + " AND NUM >" + (filter.pageNum - 1) * filter.pageSize; - sql = sql1 + sql; - var entitys = await Db.Ado.SqlQueryAsync(sql); - - if (entitys != null) - { - var dyDataBelongID = entityType.GetProperty("DataBelongID"); - var entityTypeDto = typeof(TEntityDto); - var propertieDtos = entityTypeDto.GetGenericProperties(); - if (propertieDtos.Any(x => x.Name == "DataBelongName")) - for (int i = 0; i < entitys.Count; i++) - { - var dataBelongID = dyDataBelongID.GetValue(entitys[i]); - if (dataBelongID != null) - { - var propertie = entityTypeDto.GetProperty("DataBelongName"); - propertie.SetValue(entitys[i], await GetDataBelongName(dataBelongID.ObjToInt())); - } - } - } - - return new ServicePageResult(filter.pageNum, total, filter.pageSize, entitys); - - } - public virtual async Task> ExportExcel(QueryExport body) - { - QueryBody filter = new QueryBody(); - filter.pageNum = 1; - filter.jsonParam = body.jsonParam; - filter.pageSize = 1000000; - filter.langId = body.langId; - - var condition = "1=1"; - if (body.exportSet.SelectRowKeys != null && body.exportSet.SelectRowKeys.Any()) - condition += $" AND Id IN({string.Join(",", body.exportSet.SelectRowKeys)})"; - - var data = await QueryFilterPage(filter, condition, true); - - string sql = $@"SELECT * - FROM Ghrs_PageSettingQuery - WHERE IsEnable = 1 - AND PageNo = '{body.menuName}' - AND (defaultHidden = 'false' OR defaultHidden is null OR defaultHidden ='') - ORDER BY SortNo ASC"; - - var columns = DbAccess.QueryList(sql); - - var fieldDescs = new Dictionary(); - if (body.exportSet.ExFields.Any()) - body.exportSet.ExFields.ForEach(x => - { - if (columns.Any(o => o.field == x)) - { - var label = columns.FirstOrDefault(o => o.field == x)?.label; - if (!fieldDescs.ContainsKey(x)) - fieldDescs.Add(x, label); - - } - }); - else - fieldDescs = columns.ToDictionary(item => item.field, item => item.label); - var dt = ToDataTable(data.result.DT_TableDataT1, fieldDescs, null); - // 获取所有列名 - var dtColumns = dt.Columns; - - var id = SnowFlakeSingle.instance.getID(); - var physicsPath = $"{Environment.CurrentDirectory}{Path.DirectorySeparatorChar}wwwroot"; - var path = $"{$"{Path.DirectorySeparatorChar}files{Path.DirectorySeparatorChar}export{Path.DirectorySeparatorChar}{id}{Path.DirectorySeparatorChar}"}"; - if (!Directory.Exists(physicsPath + path)) - Directory.CreateDirectory(physicsPath + path); - - path = path + body.exportSet.TitleName + ".xlsx"; - NPOIHelper.ExportExcel(dt, body.exportSet.TitleName, "sheet1", physicsPath + path); - - var result = new ExcelData(); - result.filePath = "/Advanced" + path; - result.fileName = body.exportSet.TitleName + ".xlsx"; - return ServiceResult.OprateSuccess("导出成功", result); - } - /// - /// 列名按照前端显示顺序导出 - /// - /// - /// - /// - public static (List, List) Sort(Dictionary columns, List ExportFields) - { - List fields = new List(); - List colunms = new List(); - if (ExportFields == null || ExportFields.Count == 0) - { - return (columns.Keys.ToList(), columns.Values.ToList()); - } - - foreach (var field in ExportFields) - { - foreach (var item in columns) - { - if (item.Key == field) - { - fields.Add(item.Key); - colunms.Add(item.Value); - } - } - } - - return (fields, colunms); - } - public static DataTable ToDataTable(List list, Dictionary fieldDescs = null, params string[] propertyName) - { - var (fields, colunms) = Sort(fieldDescs, null); - - List propertyNameList = new List(); - if (propertyName != null) - { - propertyNameList.AddRange(propertyName); - } - DataTable result = new DataTable(); - if (list.Count > 0) - { - PropertyInfo[] propertys = list[0].GetType().GetProperties(); - for (int i = 0; i < fields.Count; i++) - { - foreach (PropertyInfo pi in propertys) - { - if (propertyNameList.Count == 0) - { - //if (DBNull.Value.Equals(pi.PropertyType)) - //{ - // // pi.PropertyType = DateTime; - //} - Type colType = pi.PropertyType; - if (colType.IsGenericType && colType.GetGenericTypeDefinition() == typeof(Nullable<>)) - { - colType = colType.GetGenericArguments()[0]; - } - if (fields[i] == pi.Name) - { - result.Columns.Add(colunms[i], colType); - } - //result.Columns.Add(pi.Name, pi.PropertyType); - } - else - { - if (propertyNameList.Contains(pi.Name)) - { - if (fields[i] == pi.Name) - result.Columns.Add(fields[i], pi.PropertyType); - } - } - } - } - for (int i = 0; i < list.Count; i++) - { - ArrayList tempList = new ArrayList(); - for (int j = 0; j < fields.Count; j++) - { - foreach (PropertyInfo pi in propertys) - { - if (fields[j] == pi.Name) - { - if (propertyNameList.Count == 0) - { - object obj = pi.GetValue(list[i], null); - tempList.Add(obj); - } - else - { - if (propertyNameList.Contains(pi.Name)) - { - object obj = pi.GetValue(list[i], null); - tempList.Add(obj); - } - } - } - } - } - object[] array = tempList.ToArray(); - - try - { - result.LoadDataRow(array, true); - } - catch (Exception E) - { - - } - - } - } - return result; - } - public virtual async Task> ImportExcel(IFormFile file, string menuName = null, long? MasterId = null) - { - var data = new ExcelData(); - var (path, filepath) = await ReportHelper.GetImportFilePath(file, menuName); - var id1 = SnowFlakeSingle.instance.getID(); - string errorFileName = path + SnowFlakeSingle.instance.getID() + FileHelper.GetPostfixStr(filepath); - - var dt = ReportHelper.ReadImportExcel(filepath); - var columns = await QueryExportColumn(menuName); - - var (dictList, errorCount) = await ReportHelper.ValidImportExcel(Db, columns, dt); - - if (errorCount > 0) - { - NPOIHelper.ExportExcel(dt, null, "导入数据", FileHelper.GetPhysicsPath() + errorFileName); - data.filePath = "/Advanced" + errorFileName; - data.ErrorCount = errorCount; - } - else - { - Type entityType = typeof(TEntity); - await Db.Insertable(dictList).AS(entityType.GetEntityTableName()).ExecuteCommandAsync(); - data.SuccessCount = dictList.Count; - } - - return ServiceResult.OprateSuccess("导入成功!", data); - } - public async Task> QueryExportColumn(string menuName) - { - var sql = $@"SELECT Row_Number () - OVER (ORDER BY CONVERT (INT, rowNum), CONVERT (INT, colNum)) - sortNum, - field, - [dbo].[FLangKeyToValue] (mkey, 1, label) - label, - dbo.FS_GetdataSourceBySet - (dataSource, APIDataSourceType, Ghrs_PageSettingEdit.APIDataSourceID) - dataSource, - APIDataSourceType - dataSourceType, - required, - dataType, - CONVERT (NVARCHAR (1000), '') - commentText -- StaffWith - , - elementType - + CASE WHEN multipleSelect = 'true' THEN '_multiple' ELSE '' END - elementType, - APIDataSourceID - dataSourceId, - CASE - WHEN elementType = 'YearMonthPicker' AND required = 'true' - THEN - '必填;输入年月,如(2024-01),不是年月日' - WHEN elementType = 'YearMonthPicker' - THEN - '输入年月,如(2024-01),不是年月日' - WHEN required = 'true' - THEN - '必填' - WHEN required = 'true' AND dataType = 'int' - THEN - '必填且输入整数' - WHEN required = 'true' AND dataType = 'decimal' - THEN - '必填且输入整数' - WHEN required = 'false' AND dataType = 'int' - THEN - '输入整数' - WHEN elementType = 'GDatePicker' - THEN - '输入日期' - ELSE - NULL - END - Comment - FROM Ghrs_PageSettingEdit - WHERE IsEnable = 1 - AND elementType NOT IN ('FnKey', 'PageGroup') - AND pageNo = '{menuName}' - --and editable = 'true' - AND defaultHidden ! = 'true' - AND elementType ! = 'FileUpload' - AND dataType ! = ''"; - - return await Db.Ado.SqlQueryAsync(sql); - } - - public virtual async Task> DownloadExcel(string menuName) - { - - var tableNmae = string.Empty; - Type entityType = typeof(TEntity); - var columns = await QueryExportColumn(menuName); - - var dt = await Db.Ado.GetDataTableAsync("SELECT TOP 1 * FROM " + entityType.GetEntityTableName() + " WHERE IsEnable=1"); - - var MenuName = await Db.Ado.GetStringAsync($"SELECT MenuName FROM Ghrs_Menu WHERE MenuNo = '{menuName}'"); - //columns = columns.WhereIF(param.exportSet.ExFields.Any(), x => param.exportSet.ExFields.Contains(x.field)).ToList(); - - var path = ReportHelper.ImportTemplate(Db, columns, dt, menuName); - var result = ServiceResult.OprateSuccess($"{MenuName}_{DateTimeHelper.ConvertToSecondString1(DateTime.Now)}.xlsx", path); - return result; - } - - public async Task> QueryMuch(Expression> joinExpression, Expression> selectExpression, Expression> whereLambda = null) where T : class, new() - { - return await BaseDal.QueryMuch(joinExpression, selectExpression, whereLambda); - } - - public async Task> QueryPage(PaginationModel pagination) - { - var express = DynamicLinqFactory.CreateLambda(pagination.Conditions); - return await QueryPage(express, pagination.PageIndex, pagination.PageSize, pagination.OrderByFileds); - } - - #region 分表 - - public async Task> AddSplit(TEntity entity) - { - return await BaseDal.AddSplit(entity); - } - - public async Task UpdateSplit(TEntity entity, DateTime dateTime) - { - return await BaseDal.UpdateSplit(entity, dateTime); - } - - /// - /// 根据实体删除一条数据 - /// - /// 实体类 - /// - public async Task DeleteSplit(TEntity entity, DateTime dateTime) - { - return await BaseDal.DeleteSplit(entity, dateTime); - } - - public async Task QueryByIdSplit(object objId) - { - return await BaseDal.QueryByIdSplit(objId); - } - - public async Task> QueryPageSplit(Expression> whereExpression, DateTime beginTime, DateTime endTime, int pageIndex = 1, int pageSize = 20, string orderByFields = null) - { - return await BaseDal.QueryPageSplit(whereExpression, beginTime, endTime, pageIndex, pageSize, orderByFields); - } - - #endregion - - public static string GetUserIp(HttpContext context) - { - string realIP = null; - string forwarded = null; - string remoteIpAddress = context.Connection.RemoteIpAddress.ToString(); - if (context.Request.Headers.ContainsKey("X-Real-IP")) - { - realIP = context.Request.Headers["X-Real-IP"].ToString(); - if (realIP != remoteIpAddress) - { - remoteIpAddress = realIP; - } - } - if (context.Request.Headers.ContainsKey("X-Forwarded-For")) - { - forwarded = context.Request.Headers["X-Forwarded-For"].ToString(); - if (forwarded != remoteIpAddress) - { - remoteIpAddress = forwarded; - } - } - remoteIpAddress = remoteIpAddress.Replace("::ffff:", null); - return remoteIpAddress; - } - - - #region 辅助方法 - /// - /// 转换TEditDto2TEntity - /// - /// - /// - /// - protected void ConvertTEditDto2TEntity(TEditDto source, TEntity dest) - { - foreach (System.Reflection.PropertyInfo mItem in typeof(TEditDto).GetProperties()) - { - if (dest.HasField(mItem.Name)) - dest.SetValueForField(mItem.Name, mItem.GetValue(source, null)); - } - //dest.SetValueForField(DbConsts.ColunmName_LastModificationTime, DateTimeHelper.Now()); - //if (_currentUserId != default) - //{ - // //dest.SetValueForField(DbConsts.ColunmName_LastModifierId, _currentUserId); - // dest.SetValueForField(DbConsts.ColunmName_LastModifier, _currentUserName); - //} - - //if (_currentTenantId != null) - //{ - // dest.SetValueForField(DbConsts.ColunmName_TenantId, _currentTenantId); - //} - } - protected void ConvertTInsertDto2TEntity(TInsertDto source, TEntity dest) - { - foreach (System.Reflection.PropertyInfo mItem in typeof(TEditDto).GetProperties()) - { - if (dest.HasField(mItem.Name)) - dest.SetValueForField(mItem.Name, mItem.GetValue(source, null)); - } - //dest.SetValueForField(DbConsts.ColunmName_LastModificationTime, DateTimeHelper.Now()); - //if (_currentUserId != default) - //{ - // //dest.SetValueForField(DbConsts.ColunmName_LastModifierId, _currentUserId); - // dest.SetValueForField(DbConsts.ColunmName_LastModifier, _currentUserName); - //} - - //if (_currentTenantId != null) - //{ - // dest.SetValueForField(DbConsts.ColunmName_TenantId, _currentTenantId); - //} - } - - #region 检查表中是否已经存在相同代码的数据 - - public static void CheckOnly(TEntity entity, long? id = null) - { - Type entityType = typeof(TEntity); - var tableName = entityType.GetEntityTableName(); - - var names = new List(); - var values = new List(); - var descriptions = new List(); - entity.GetOnlyList(out names, out values, out descriptions); - for (int i = 0; i < names.Count; i++) - { - CheckCodeExist(tableName, names[i], values[i], id != null ? ModifyType.Edit : ModifyType.Add, descriptions[i], id); - } - } - /// - /// 检查表中是否已经存在相同代码的数据 - /// - /// 表名 - /// 字段名 - /// 字段值 - /// ModifyType.Add,ModifyType.Edit - /// ModifyType.Edit时修改记录的ROW_ID值 - /// 判断栏位的提示名称 - public static void CheckCodeExist(string tableName, string fieldName, object fieldValue, ModifyType modifyType, string promptName, long? rowid = null, string whereCondition = null) - { - try - { - CheckCodeExist(tableName, fieldName, fieldValue, modifyType, rowid, promptName, whereCondition); - } - catch (Exception) - { - throw; - } - } - - /// - /// 检查表中是否已经存在相同代码的数据 - /// - /// 表名 - /// 字段名 - /// 字段值 - /// 条件 - /// ModifyType.Add,ModifyType.Edit - /// ModifyType.Edit时修改记录的ROW_ID值 - /// 判断栏位的提示名称 - /// Where后的条件,如:IS_ALCON='Y' - public static bool CheckCodeExist(string tableName, string fieldName, object fieldValue, ModifyType modifyType, long? rowid, string promptName, string whereCondition) - { - try - { - bool result = false; - if (modifyType == ModifyType.Add) - { - string sql = string.Empty; - sql = "SELECT COUNT(*) FROM " + tableName + " WHERE " + fieldName + "='" + fieldValue + "' AND IsEnable=1"; - - if (!string.IsNullOrEmpty(whereCondition)) - sql += " AND " + whereCondition; - - int count = Convert.ToInt32(DbAccess.ExecuteScalar(sql)); - if (count > 0) - { - result = true; - throw new Exception(string.Format("{0}【{1}】已经存在!", promptName, fieldValue)); - } - else - result = false; - - } - else if (modifyType == ModifyType.Edit) - { - string sql = string.Empty; - sql = "SELECT COUNT(*) FROM " + tableName + " WHERE " + fieldName + "='" + fieldValue + "' AND IsEnable=1 AND ID!='" + rowid.Value + "'"; - - if (!string.IsNullOrEmpty(whereCondition)) - sql += " AND " + whereCondition; - - int count = Convert.ToInt32(DbAccess.ExecuteScalar(sql)); - if (count > 0) - { - result = true; - throw new Exception(string.Format("{0}【{1}】已经存在!", promptName, fieldValue)); - } - else - result = false; - } - return result; - } - catch (Exception) - { - throw; - } - } - #endregion - - #region 自动编号 - /// - /// 自动编号 - /// - /// 表名 - /// 栏位名 - /// 前缀 - /// - public async Task GenerateContinuousSequence(string tableCode, string columnCode, string prefixTemp, int length = 7, int tempLength = 6) - { - try - { - string result = string.Empty; - int sequence; - - #region 查询 - DbSelect dbSelect = new(tableCode + " A", "A", null); - dbSelect.IsInitDefaultValue = false; - - if (!string.IsNullOrEmpty(prefixTemp)) - dbSelect.Select("MAX(SUBSTRING(A." + columnCode + "," + (prefixTemp.Length + 1).ToString() + "," + tempLength.ToString() + "))"); - else - dbSelect.Select("MAX(A." + columnCode + ")"); - //} - //dbSelect.Select("MAX(CONVERT(DECIMAL,SUBSTRING(A.ISSUE_NO," + (prefix.Length + dateString.Length + 1).ToString() + "," + tempLength.ToString() + ")))"); - if (!string.IsNullOrEmpty(prefixTemp)) - dbSelect.Where("SUBSTRING(A." + columnCode + ",1," + (prefixTemp.Length).ToString() + ")", " = ", prefixTemp); - dbSelect.Where("LEN(A." + columnCode + ")", "=", length); - string sql = dbSelect.GetSql(); - //await Db.Ado.GetScalarAsync(sql) - string maxSequence = Convert.ToString(await Db.Ado.GetScalarAsync(sql)); - #endregion - //tempLength = tempLength - dateString.Length; - if (string.IsNullOrEmpty(maxSequence)) - result = prefixTemp + Convert.ToString(1).PadLeft(tempLength, '0'); - else - { - if (!string.IsNullOrEmpty(prefixTemp)) - { - if (int.TryParse(maxSequence, out sequence)) - { - sequence += 1; - if (sequence.ToString().Length > tempLength) - throw new Exception("自动生成字串长度已经超过设定长度!"); - } - else - throw new Exception("表中的数据无法进行自动编号,请联系软件开发商!"); - result = prefixTemp + sequence.ToString().PadLeft(tempLength, '0'); - } - else - { - if (int.TryParse(maxSequence, out sequence)) - { - sequence += 1; - if (sequence.ToString().Length > length) - throw new Exception("自动生成字串长度已经超过设定长度!"); - } - else - throw new Exception("表中的数据无法进行自动编号,请联系软件开发商!"); - result = sequence.ToString().PadLeft(length, '0'); - } - } - return result; - } - catch (Exception) { throw; } - } - #endregion - - #region 获取通用参数设定 - public async Task GetParaLabel(string key, string value) - { - string label = value; - - if (value.IsNullOrEmpty()) - return null; - var list = await _caching.GetAsync>(key); - if (list == null || (list != null && !list.Any())) - { - string sql = $@"SELECT * -FROM Ghrs_ParaDetail -WHERE ParaMasterId IN (SELECT ParaMasterId - FROM Ghrs_ParaMaster - WHERE ParaMasterNo = '{key}' - AND ParaTypeNo IN ('GhrStaff', - 'GHRPara', - 'Train', - 'Resume', - 'GHRAttend','Performance','Survey')) - AND IsEnable = 1 -ORDER BY SortNo ASC"; - list = DbAccess.QueryList(sql); - if (list.Any()) - await _caching.SetAsync(key, list); - } - - if (list.Any(x => x.ParaDetailNo == value)) - label = list.FirstOrDefault(x => x.ParaDetailNo == value)?.ParaDetailName; - return label; - } - - public async Task> GetParaList(string key) - { - if (key.IsNullOrEmpty()) - return null; - - var list = await _caching.GetAsync>(key); - if (list == null || (list != null && !list.Any())) - { - string sql = $@"SELECT * -FROM Ghrs_ParaDetail -WHERE ParaMasterId IN (SELECT ParaMasterId - FROM Ghrs_ParaMaster - WHERE ParaMasterNo = '{key}' - AND ParaTypeNo IN ('GhrStaff', - 'GHRPara', - 'Train', - 'Resume', - 'GHRAttend')) - AND IsEnable = 1 -ORDER BY SortNo ASC"; - list = DbAccess.QueryList(sql); - if (list.Any()) - await _caching.SetAsync(key, list); - } - return list; - } - - public async Task GetParaLabelListString(string ParaTypeNo, string ParaMasterNo, string value) - { - string label = value; - - if (value.IsNullOrEmpty()) - return null; - - string sql = $@"SELECT [dbo].[FLangKeyToValue](mkey,1,ParaDetailName) ParaDetailName -FROM Ghrs_ParaDetail -where IsEnable=1 - and ParaTypeNo = '{ParaTypeNo}' - and ParaMasterNo = '{ParaMasterNo}' - and ParaDetailNo in (select value from Openjson('{value}')) -ORDER BY SortNo ASC"; - var list = DbAccess.QueryList(sql); - - label = string.Join(",", list.Select(o => o.ParaDetailName)); - return label; - } - - public async Task GetParaLabel(int? id) - { - string label = string.Empty; - - if (id.IsNullOrEmpty()) - return null; - var ParaMasterNo = DbAccess.ExecuteScalar(@$"SELECT ParaMasterNo -FROM Ghrs_ParaDetail -WHERE ParaDetailId ='{id}'"); - - var list = await _caching.GetAsync>(ParaMasterNo.ObjToString()); - if (list == null || (list != null && !list.Any())) - { - string sql = $@"SELECT * -FROM Ghrs_ParaDetail -WHERE ParaMasterId IN (SELECT ParaMasterId - FROM Ghrs_ParaMaster - WHERE ParaMasterNo = '{ParaMasterNo}' - AND ParaTypeNo IN ('GhrStaff', - 'GHRPara', - 'Train', - 'Resume', - 'GHRAttend')) - AND IsEnable = 1 -ORDER BY SortNo ASC"; - list = DbAccess.QueryList(sql); - if (list.Any()) - await _caching.SetAsync(ParaMasterNo.ObjToString(), list); - } - - if (list.Any(x => x.ParaDetailId == id)) - label = list.FirstOrDefault(x => x.ParaDetailId == id)?.ParaDetailName; - return label; - } - - /// - /// - /// - /// - /// - public async Task GetDataBelongName(int? id) - { - string label = string.Empty; - - if (id == null) - return null; - if (_caching != null) - { - var list = await _caching.GetAsync>("DataBelong"); - if (list == null || (list != null && !list.Any())) - { - list = await Db.Queryable().ToListAsync(); - if (list.Any()) - await _caching.SetAsync("DataBelong", list); - } - - if (list.Any(x => x.DataBelongId == id)) - label = list.FirstOrDefault(x => x.DataBelongId == id)?.DataBelongName; - } - else - label = await Db.Queryable().Where(x => x.DataBelongId == id).Select(x => x.DataBelongName).FirstAsync(); - - - return label; - } - #endregion - - #region 处理json查询条件 - public string DealConditions(string conditions, string name, string value) - { - var jsonParam = JsonHelper.JsonToObj(value); - - switch (jsonParam.operationKey) - { - case "Include": - if (jsonParam.columnValue != null) - conditions += $" AND {name} LIKE '%{jsonParam.columnValue}%'"; - break; - case "NotInclude": - if (jsonParam.columnValue != null) - conditions += $" AND {name} NOT LIKE '%{jsonParam.columnValue}%'"; - break; - case "IsNull": - conditions += $" AND {name} IS NULL"; - break; - case "NotNull": - conditions += $" AND {name} IS NOT NULL"; - break; - case "Equal": - if (jsonParam.columnValue != null) - conditions += $" AND {name} ='{jsonParam.columnValue}'"; - break; - case "NotEqual": - if (jsonParam.columnValue != null) - conditions += $" AND {name} !='{jsonParam.columnValue}'"; - break; - case "GreaterOrEqual"://大于等于 - if (jsonParam.columnValue != null) - conditions += $" AND {name} >='{jsonParam.columnValue}'"; - break; - case "Greater"://大于 - if (jsonParam.columnValue != null) - conditions += $" AND {name} >'{jsonParam.columnValue}'"; - break; - case "LessOrEqual"://小于等于 - if (jsonParam.columnValue != null) - conditions += $" AND {name} <='{jsonParam.columnValue}'"; - break; - case "Less"://小于 - if (jsonParam.columnValue != null) - conditions += $" AND {name} <'{jsonParam.columnValue}'"; - break; - case "EqualAny":// - if (jsonParam.columnValue != null) - { - var ids1 = JsonHelper.JsonToObj>(jsonParam.columnValue.ToString()); - - conditions += $" AND {name} IN ({string.Join(",", ids1.Select(id => "'" + id + "'"))})"; - } - break; - case "NotEqualAny":// - if (jsonParam.columnValue != null) - { - var ids1 = JsonHelper.JsonToObj>(jsonParam.columnValue.ToString()); - - conditions += $" AND ({name} NOT IN ({string.Join(",", ids1.Select(id => "'" + id + "'"))}) OR {name} IS NULL)"; - } - break; - case "Range":// - if (jsonParam.columnValue != null) - { - var ids1 = JsonHelper.JsonToObj>(jsonParam.columnValue.ToString()); - - conditions += $" AND ({name}>='{ids1[0]} 00:00:00' AND {name}<='{ids1[1]} 23:59:59')"; - } - break; - default: - break; - } - - return conditions; - } - public string DealConditions1(string conditions, string name, string value) - { - return DealConditions(conditions, "A." + name, value); - } - #endregion - - public string GetQueryString(string sqlSelect, int? currentPage = null, int? pageSize = null, string sortField = null) - { - string queryString = string.Empty; - if (string.IsNullOrEmpty(sortField)) - queryString = "SELECT * FROM (SELECT *, ROW_NUMBER() OVER (ORDER BY ROW_ID) NUM FROM (SELECT * FROM (" + sqlSelect + " WHERE 1=1 "; - else - { - if (!string.IsNullOrEmpty(sortField)) - queryString = "SELECT * FROM (SELECT *, ROW_NUMBER() OVER (ORDER BY " + sortField + ") NUM FROM (SELECT * FROM (" + sqlSelect + " "; - else - queryString = "SELECT * FROM (SELECT *, ROW_NUMBER() OVER (ORDER BY " + sortField + " DESC) NUM FROM (SELECT * FROM (" + sqlSelect + " "; - } - queryString += ") A ) B ) C"; - if (currentPage != null && pageSize != null) - queryString += " WHERE NUM <= " + currentPage * pageSize + " AND NUM >" + (currentPage - 1) * pageSize; - return queryString; - } - - public int? GetStaffId() - { - int? StaffId = null; - string sql = $"SELECT UserStaffID FROM Ghrs_User WHERE UserId='{App.User.ID}'"; - string StaffId1 = Convert.ToString(DbAccess.ExecuteScalar(sql)); - if (!StaffId1.IsNull()) - StaffId = Convert.ToInt32(StaffId1); - return StaffId; - } - public async Task GetUser() - { - return await Db.Queryable().Where(x => x.UserId == App.User.ID).FirstAsync(); - } - - #region 获取部门列表 - public static void LoopToAppendChildren(List depts, List depts1, Ghro_Dept dept) - { - var depts2 = depts.Where(x => x.ParentDeptID == dept.DeptID).ToList(); - depts1.AddRange(depts2); - foreach (var item in depts2) - { - LoopToAppendChildren(depts, depts1, item); - } - } - public async Task> GetDeptList(List depts, int? deptId = null) - { - if (!depts.Any()) - depts = await Db.Queryable().ToListAsync(); - if (!deptId.IsNullOrEmpty()) - { - var dept = depts.Where(x => x.DeptID == deptId).FirstOrDefault(); - List depts1 = [dept]; - - LoopToAppendChildren(depts, depts1, dept); - return depts1; - } - else return depts; - } - #endregion - - public async Task> GetUserStaffPrivIds(int userId, int? staffId = null, DateTime? date = null) - { - if (date == null) date = DateTime.Now; - var @CDate = date; - var @UserID = userId; - var @StaffID = staffId.IsNullOrEmpty() ? -1 : staffId.Value; - int @UserStaffID = await Db.Ado.GetIntAsync($"SELECT UserStaffID FROM Ghrs_User WHERE UserId='{userId}'"); - - var @CompanySpecCode = string.Empty; - int @UserDeptID = 0; - //int @DataRoleType = 0; //--1 员工自身 2 全部人员 3 按设定 - //int @DeptType = 0; //1 按挑选 2 主管(含下阶) 3 主管(不含下阶) 4 部门助理(含下阶) 5 部门助理(不含下阶) 6 所在部门(含下阶) 7 所在部门(不含下阶) 8: 全部部门 - int? - @DeptID, - @TitleID, - @GradeID, - @DataBelongID, - @PeriodMasterID, - @ZoneID, - @StaffType1; - var sql = @$"SELECT CompanySpecCode - FROM ghro_company - WHERE IsEnable = 1"; - @CompanySpecCode = await Db.Ado.GetStringAsync(sql); - - //--读取使用者对应的资料权限群组 - sql = @$"SELECT b.DataRoleID, - DataRoleType, - DeptType, - AllDataBelong, - AllGrade, - AllTitle, - AllZone, - AllPeriodMaster, - ALLDL_IDL, - DataRoleNo - FROM Ghrs_UserDataRole a, Ghrs_DataRole b - WHERE UserID = {@UserID} - AND a.IsEnable = 1 - AND b.IsEnable = 1 - AND b.DataRoleId = a.DataRoleId - ORDER BY DataRoleType, DeptType DESC"; - - var dataRoles = await Db.Ado.SqlQueryAsync(sql); - - var scr = Db.Queryable(); - if (@StaffID == -1) - { - if (dataRoles.Where(x => x.DataRoleType == 2).Any())// 全部人员权限 - return await scr.Select(x => x.StaffID).ToListAsync(); - - var staffIds = new List(); - var depts = new List(); - depts = await GetDeptList(depts); - for (int i = 0; i < dataRoles.Count; i++) - { - var deptIds = new List(); - var dataRole = dataRoles[i]; - - //--2 集团数据归属编号 - var dataBelongIds = new List(); - if (dataRole.@AllDataBelong == 0) - { - dataBelongIds = await Db.Queryable() - .Where(x => - x.IsEnable == 1 && - x.DataTypeID == 2 && - x.DataID != null && - x.DataRoleId != null && - x.DataRoleId == dataRole.DataRoleID) - .Select(x => x.DataID.Value).ToListAsync(); - } - - //-- 3 职等编号 - var gradeIds = new List(); - if (dataRole.@AllGrade == 0) - { - gradeIds = await Db.Queryable() - .Where(x => - x.IsEnable == 1 && - x.DataTypeID == 3 && - x.DataID != null && - x.DataRoleId != null && - x.DataRoleId == dataRole.DataRoleID) - .Select(x => x.DataID.Value).ToListAsync(); - } - - //-- 4 职称编号 - var titleIds = new List(); - if (dataRole.@AllTitle == 0) - { - titleIds = await Db.Queryable() - .Where(x => - x.IsEnable == 1 && - x.DataTypeID == 4 && - x.DataID != null && - x.DataRoleId != null && - x.DataRoleId == dataRole.DataRoleID) - .Select(x => x.DataID.Value).ToListAsync(); - } - - //-- 5 厂区编号 - var zoneIds = new List(); - if (dataRole.@AllZone == 0) - { - zoneIds = await Db.Queryable() - .Where(x => - x.IsEnable == 1 && - x.DataTypeID == 5 && - x.DataID != null && - x.DataRoleId != null && - x.DataRoleId == dataRole.DataRoleID) - .Select(x => x.DataID.Value).ToListAsync(); - } - - //-- 6 计薪类别编号 - var periodMasterIds = new List(); - if (dataRole.@AllPeriodMaster == 0) - { - periodMasterIds = await Db.Queryable() - .Where(x => - x.IsEnable == 1 && - x.DataTypeID == 6 && - x.DataID != null && - x.DataRoleId != null && - x.DataRoleId == dataRole.DataRoleID) - .Select(x => x.DataID.Value).ToListAsync(); - } - - //-- 7 直间接编号 - var DL_IDLIds = new List(); - if (dataRole.@ALLDL_IDL == 0) - DL_IDLIds = await Db.Queryable().Where(x => - x.IsEnable == 1 && - x.DataTypeID == 6 && - x.DataID != null && - x.DataRoleId != null && - x.DataRoleId == dataRole.DataRoleID) - .Select(x => x.DataID.Value).ToListAsync(); - - //判断部门的权限 @DeptType - - - //7 所在部门(不含下阶) - if (dataRole.@DeptType == 7) - deptIds.Add(@UserStaffID); - - //6 所在部门(含下阶) - if (dataRole.@DeptType == 6) - { - var dept = depts.Where(x => x.DeptID == @UserStaffID).FirstOrDefault(); - if (dept != null) - await GetDeptList(depts, dept.DeptID); - } - - //5 部门助理(不含下阶) - if (dataRole.@DeptType == 5) - { - var depts1 = depts.Where(x => x.DeptAssID == @UserStaffID).ToList(); - deptIds.AddRange(depts1.Select(x => x.DeptID.Value).ToList()); - } - - //4 部门助理(含下阶) - if (dataRole.@DeptType == 4) - { - var depts1 = depts.Where(x => x.DeptAssID == @UserStaffID).ToList(); - - foreach (var dept in depts1) - { - var items = await GetDeptList(depts, dept.DeptID); - deptIds.AddRange(items.Select(x => x.DeptID.Value).ToList()); - } - } - - //3 主管(不含下阶) - if (dataRole.@DeptType == 3) - { - var depts1 = depts.Where(x => x.DeptManagerID == @UserStaffID).ToList(); - - deptIds.AddRange(depts1.Select(x => x.DeptID.Value).ToList()); - } - - //2 主管(含下阶) - if (dataRole.@DeptType == 2) - { - var depts1 = depts.Where(x => x.DeptManagerID == @UserStaffID).ToList(); - - foreach (var dept in depts1) - { - var items = await GetDeptList(depts, dept.DeptID); - deptIds.AddRange(items.Select(x => x.DeptID.Value).ToList()); - } - } - - //1 按挑选 - if (dataRole.@DeptType == 1) - { - - sql = @$"SELECT DataID - FROM Ghrs_DataRoleDetail - WHERE IsEnable = 1 - AND DataRoleID = {dataRole.DataRoleID} - AND DataTypeID = 1 - AND IncludeSub = 0"; - - var dataIDs = await Db.Ado.SqlQueryAsync(sql); - - - if (!dataIDs.Any()) - { - sql = @$"SELECT DataID - FROM Ghrs_DataRoleDetail - WHERE IsEnable = 1 - AND DataRoleID = {dataRole.DataRoleID} - AND DataTypeID = 1 - AND IncludeSub = 1"; - - dataIDs = await Db.Ado.SqlQueryAsync(sql); - - foreach (var dataID in dataIDs) - { - var items = await GetDeptList(depts, dataID); - deptIds.AddRange(items.Select(x => x.DeptID.Value).ToList()); - } - } - else - deptIds.AddRange(dataIDs); - - } - deptIds = deptIds.Distinct().ToList(); - var ids = await scr - .WhereIF(dataRole.@AllDataBelong == 0, x => x.DataBelongID != null && dataBelongIds.Contains(x.DataBelongID.Value)) - .WhereIF(dataRole.@AllGrade == 0, x => x.GradeID != null && gradeIds.Contains(x.GradeID.Value)) - .WhereIF(dataRole.@AllTitle == 0, x => x.TitleID != null && titleIds.Contains(x.TitleID.Value)) - .WhereIF(dataRole.@AllZone == 0, x => x.ZoneID != null && zoneIds.Contains(x.ZoneID.Value)) - .WhereIF(dataRole.@AllPeriodMaster == 0, x => x.PeriodMasterID != null && periodMasterIds.Contains(x.PeriodMasterID.Value)) - .WhereIF(dataRole.@ALLDL_IDL == 0, x => x.StaffType1 != null && DL_IDLIds.Contains(x.StaffType1.Value)) - .Where(x => (x.DeptID != null && deptIds.Contains(x.DeptID.Value)) - ).Select(x => x.StaffID).ToListAsync(); - staffIds.AddRange(ids); - } - - staffIds.Add(UserStaffID); - staffIds.Distinct().ToList(); - return staffIds; - - } - else - { - #region 员工默认有自己的权限 - if (staffId == @UserStaffID) - return [@StaffID]; - #endregion - - sql = @$"SELECT DeptID, - TitleID, - GradeID, - ZoneID, - DataBelongID, - PeriodMasterID, - StaffType1 - FROM ghra_Staff - WHERE StaffID = {staffId}"; - - var staff = await Db.Ado.SqlQuerySingleAsync(sql); - if (staff.IsNullOrEmpty()) - return []; - - @DeptID = staff.DeptID; - @TitleID = staff.TitleID; - @GradeID = staff.GradeID; - @ZoneID = staff.ZoneID; - @DataBelongID = staff.DataBelongID; - @PeriodMasterID = staff.PeriodMasterID; - @StaffType1 = staff.StaffType1; - - #region 员工默认有自己下属的权限 - sql = @$"select count(1) from Ghro_Dept - where IsEnable=1 and DeptManagerID={@UserStaffID} - and [dbo].[FDeptAisBChild] ({@DeptID},DeptID{@CDate},1)=1 )"; - - //--副主管也有权限 - int? @IsOneDeptTowManager = await Db.Ado.GetIntAsync($"SELECT dbo.FS_ParameterValue('IsOneDeptTowManager')"); - if (@IsOneDeptTowManager == 1) - sql = @$"select count(1) from Ghro_Dept - where IsEnable=1 and DeptManagerID2={@UserStaffID} - and [dbo].[FDeptAisBChild] ({@DeptID},DeptID{@CDate},1)=1 )"; - #endregion - - for (int i = 0; i < dataRoles.Count; i++) - { - var dataRole = dataRoles[i]; - - if (dataRole.DataRoleType == 2)// 全部人员权限 - return [@StaffID]; - - if (dataRole.DataRoleType == 1 && @UserStaffID == @StaffID) // 员工自身权限 - return [@StaffID]; - - //1 部门编号 - //2 集团数据归属编号 - //3 职等编号 - //4 职称编号 - //5 厂区编号 - //6 计薪类别编号 - //7 直间接编号 - if (dataRole.@AllDataBelong == 0) - { - sql = @$"SELECT DataID - FROM Ghrs_DataRoleDetail - WHERE IsEnable = 1 - AND DataRoleID = {dataRole.DataRoleID} - AND {@DataBelongID} = DataID - AND DataTypeID = 2"; - var dataIDs = await Db.Ado.SqlQueryAsync(sql); - if (!dataIDs.Any()) - continue; - } - - if (dataRole.@AllGrade == 0) - { - sql = @$"SELECT DataID - FROM Ghrs_DataRoleDetail - WHERE IsEnable = 1 - AND DataRoleID = {dataRole.DataRoleID} - AND {@DataBelongID} = DataID - AND DataTypeID = 3"; - var dataIDs = await Db.Ado.SqlQueryAsync(sql); - if (!dataIDs.Any()) - continue; - } - if (dataRole.@AllTitle == 0) - { - sql = @$"SELECT DataID - FROM Ghrs_DataRoleDetail - WHERE IsEnable = 1 - AND DataRoleID = {dataRole.DataRoleID} - AND {@DataBelongID} = DataID - AND DataTypeID = 4"; - var dataIDs = await Db.Ado.SqlQueryAsync(sql); - if (!dataIDs.Any()) - continue; - } - if (dataRole.@AllZone == 0) - { - sql = @$"SELECT DataID - FROM Ghrs_DataRoleDetail - WHERE IsEnable = 1 - AND DataRoleID = {dataRole.DataRoleID} - AND {@DataBelongID} = DataID - AND DataTypeID = 5"; - var dataIDs = await Db.Ado.SqlQueryAsync(sql); - if (!dataIDs.Any()) - continue; - } - if (dataRole.@AllPeriodMaster == 0) - { - sql = @$"SELECT DataID - FROM Ghrs_DataRoleDetail - WHERE IsEnable = 1 - AND DataRoleID = {dataRole.DataRoleID} - AND {@DataBelongID} = DataID - AND DataTypeID = 6"; - var dataIDs = await Db.Ado.SqlQueryAsync(sql); - if (!dataIDs.Any()) - continue; - } - if (dataRole.ALLDL_IDL == 0) - { - sql = @$"SELECT DataID - FROM Ghrs_DataRoleDetail - WHERE IsEnable = 1 - AND DataRoleID = {dataRole.DataRoleID} - AND {@DataBelongID} = DataID - AND DataTypeID = 7"; - var dataIDs = await Db.Ado.SqlQueryAsync(sql); - if (!dataIDs.Any()) - continue; - } - //判断部门的权限 @DeptType - //1 按挑选 - //2 主管(含下阶) - //3 主管(不含下阶) - //4 部门助理(含下阶) - //5 部门助理(不含下阶) - //6 所在部门(含下阶) - //7 所在部门(不含下阶) - - if (dataRole.@DeptType == 7) - { - if (@UserDeptID == 0) - { - sql = $@"SELECT DeptID - FROM Ghra_staff - WHERE StaffID = {@UserStaffID}"; - @UserDeptID = await Db.Ado.GetIntAsync(sql); - } - if (@DeptID != @UserDeptID) - continue; - } - - if (dataRole.@DeptType == 6) - { - if (@UserDeptID == 0) - { - sql = $@"SELECT DeptID - FROM Ghra_staff - WHERE StaffID = {@UserStaffID}"; - @UserDeptID = await Db.Ado.GetIntAsync(sql); - } - sql = @$"SELECT [dbo].[FDeptAisBChild] ({@DeptID}, - {@UserDeptID}, - {@CDate}, - 1)"; - - if (await Db.Ado.GetIntAsync(sql) == 0) - continue; - } - - if (dataRole.@DeptType == 5) - { - sql = @$"SELECT count (1) - FROM Ghro_Dept - WHERE IsEnable = 1 - AND DeptAssID = {@UserStaffID} - AND DeptID = {@DeptID}"; - - if (await Db.Ado.GetIntAsync(sql) == 0) - continue; - } - - if (dataRole.@DeptType == 4) - { - sql = @$"SELECT COUNT (1) - FROM Ghro_Dept - WHERE IsEnable = 1 - AND DeptAssID = {@UserStaffID} - AND [dbo].[FDeptAisBChild] ({@DeptID}, - DeptID, - {@CDate}, - 1) = 1"; - - if (await Db.Ado.GetIntAsync(sql) == 0) - continue; - } - - if (dataRole.@DeptType == 3) - { - sql = @$"SELECT count (1) - FROM Ghro_Dept - WHERE IsEnable = 1 - AND DeptManagerID = {@UserStaffID} - AND DeptID = {@DeptID}"; - - if (await Db.Ado.GetIntAsync(sql) == 0) - continue; - } - - if (dataRole.@DeptType == 2) - { - sql = @$"SELECT count (1) - FROM Ghro_Dept - WHERE IsEnable = 1 - AND DeptManagerID = {@UserStaffID} - AND [dbo].[FDeptAisBChild] ({@DeptID}, - DeptID, - {@CDate}, - 1) = 1"; - - if (await Db.Ado.GetIntAsync(sql) == 0) - continue; - } - - if (dataRole.@DeptType == 1) - { - - sql = @$"SELECT count (1) - FROM Ghrs_DataRoleDetail - WHERE IsEnable = 1 - AND DataRoleID = {dataRole.DataRoleID} - AND {@DeptID} = DataID - AND DataTypeID = 1 - AND IncludeSub = 0"; - - var tempId = await Db.Ado.GetIntAsync(sql); - - if (tempId == 0) - { - sql = @$"SELECT count (1) - FROM Ghrs_DataRoleDetail - WHERE IsEnable = 1 - AND DataRoleID = {dataRole.DataRoleID} - AND [dbo].[FDeptAisBChild] ({@DeptID}, - DataID, - {@CDate}, - 1) = 1 - AND DataTypeID = 1 - AND IncludeSub = 1"; - - tempId = await Db.Ado.GetIntAsync(sql); - } - - if (tempId == 0) continue; - - } - return [@StaffID]; - } - } - return default; - - } - - //public int GetTotalCount(string sqlSelect) - //{ - // string sql = string.Empty; - - // try - // { - // int count = Convert.ToInt32(DBHelper.ExecuteScalar(sql)); - // return count; - // } - // catch (Exception Ex) - // { - // throw; - // } - //} - - public async Task QueryCompanyCode() - { - var sql = @$"SELECT CompanySpecCode - FROM ghro_company - WHERE IsEnable = 1"; - return await Db.Ado.GetStringAsync(sql); - } - - #region 发送站内信 - public async Task SendMessage(List staffIds, string title, string content, string webUrl = null) - { - for (int i = 0; i < staffIds.Count; i++) - { - //string sql = @$"select UserId from Ghrs_User where UserStaffID={staffIds[i]}"; - - //var userId = await Db.Ado.GetIntAsync(sql); - - - var id = await Db.Insertable(new Ghrm_MessageText() - { - GroupType = "Staff", - Title = title, - Content = content, - SortNo = 0, - IsDefault = 0, - IsEnable = 1, - WEBUrl = webUrl, - Tag = "Resume", - JumpType = webUrl == null ? "text" : "link" - }).ExecuteReturnIdentityAsync(); - await Db.Insertable(new Ghrm_MessageUser() - { - MessageTextID = id, - SenderStaffID = 0, - ReceiveStaffID = staffIds[i], - SortNo = 0, - IsDefault = 0, - IsEnable = 1, - ReadStatus = 0, - }).ExecuteReturnIdentityAsync(); - - } - - await SendQYWechateMessage(staffIds, title, content); - - } - public async Task SendQYWechateMessage(List staffIds, string title, string content, string webUrl = null) - { - string sql = @$"Declare @Json nvarchar(max) = '' - set @Json = (select '{title}' title, - 'textcard' msgtype, - '
'+CONVERT(nvarchar(16),getdate(),121)+'
-
{content}
-
' [description] , - 'Re'+(select Top 1 ParameterValue from Ghrs_Parameter where ParameterNo='GHRURL')+'/appOauth.html?jumpPage='+'F_APP_message/msgGroupList' url, - 'GHR' picurl, - '' htmlStr, - {string.Join(',', staffIds.Select(x => x))} toStaffIDs - for json path) - -- select @Json - exec [dbo].[PS_CreateWorkwxMsg] @Json,'Resume'"; - - sql = @$"Declare @Json nvarchar(max) = '' - set @Json = (select '{title}' title, - 'text' msgtype, - '{content}\n请至【GHR人力资源系统-招聘】下查看' [description] , - 'Re'+(select Top 1 ParameterValue from Ghrs_Parameter where ParameterNo='GHRURL')+'/appOauth.html?jumpPage='+'F_APP_message/msgGroupList' url, - 'GHR' picurl, - '' htmlStr, - '{string.Join(',', staffIds.Select(x => x))}' toStaffIDs - for json path) - -- select @Json - exec [dbo].[PS_CreateWorkwxMsg] @Json,'Resume'"; - - // Declare @Json nvarchar(max) = '' - // set @Json = (select '测试提醒' title, - // 'markdown' msgtype, - // '您有个简历待面试,面试时间:2024/12/15 00:00~08:08,请及时查看! - //> **流程信息 * * - //> 申 请 人:< font color =\"info\">tisking 陶兰 - //> 假 别: < font color =\"warning\">事假 - //> 开始时间:< font color =\"comment\">2022-01-21 09:00 - //> 结束时间:< font color =\"comment\">2022-01-21 11:00 - //> - //> 请尽快核准" - // ' [description] , - // '' url, - // 'GHR' picurl, - // '' htmlStr, - // StaffID toStaffIDs - // from Ghra_Staff - // where StaffNo = 'tisking' - // for json path) - // select @Json - // exec[dbo].[PS_CreateWorkwxMsg] @Json,'Test' - - - - await Db.Ado.ExecuteCommandAsync(sql); - } - - #endregion - - #region 获取多语 - public async Task QueryLangValue(string key, int? langId, string defaultValue) - { - string sql = $"select [dbo].[FLangKeyToValue]('{key}',{langId},null)"; - string value = await Db.Ado.GetStringAsync(sql); - if (value.IsNullOrEmpty()) value = defaultValue; - return value; - } - public async Task QueryLangValue(string key, string defaultValue) - { - return await QueryLangValue(key, LangId, defaultValue); - } - public async Task QueryLangValue(string key, string defaultValue, object arg0) - { - var value = await QueryLangValue(key, LangId, defaultValue); - return string.Format(value, arg0); - } - public async Task QueryLangValue(string key, string defaultValue, object arg0, object arg1) - { - var value = await QueryLangValue(key, LangId, defaultValue); - return string.Format(value, arg0, arg1); - } - public async Task QueryLangValue(string key, string defaultValue, object arg0, object arg1, object arg2) - { - var value = await QueryLangValue(key, LangId, defaultValue); - return string.Format(value, arg0, arg1, arg2); - } - #endregion - - - - public async Task QueryConfigValue(string code, string tableName = "Ghre_Config") - { - var sql = @$"SELECT ConfigValue FROM {tableName} WHERE ConfigCode='MULTIPLE_EXAM_SCORE_RECOGNITION' AND IsEnable=1"; - return await Db.Ado.GetStringAsync(sql); - } - - #endregion -} \ No newline at end of file diff --git a/Tiobon.Core.Services/BASE/BaseServices1.cs b/Tiobon.Core.Services/BASE/BaseServices1.cs deleted file mode 100644 index ff9e112a..00000000 --- a/Tiobon.Core.Services/BASE/BaseServices1.cs +++ /dev/null @@ -1,328 +0,0 @@ -namespace Tiobon.Core.Services.BASE; - -public class BaseServices : IBaseServices where TEntity : class, new() -{ - public BaseServices(IBaseRepository BaseDal = null) - { - this.BaseDal = BaseDal; - } - - //public IBaseRepository baseDal = new BaseRepository(); - public IBaseRepository BaseDal { get; set; } //通过在子类的构造函数中注入,这里是基类,不用构造函数 - - public ISqlSugarClient Db => BaseDal.Db; - - public async Task QueryById(object objId) - { - return await BaseDal.QueryById(objId); - } - - /// - /// 根据ID查询一条数据 - /// - /// id(必须指定主键特性 [SugarColumn(IsPrimaryKey=true)]),如果是联合主键,请使用Where条件 - /// 是否使用缓存 - /// 数据实体 - public async Task QueryById(object objId, bool blnUseCache = false) - { - return await BaseDal.QueryById(objId, blnUseCache); - } - - /// - /// 根据ID查询数据 - /// - /// id列表(必须指定主键特性 [SugarColumn(IsPrimaryKey=true)]),如果是联合主键,请使用Where条件 - /// 数据实体列表 - public async Task> QueryByIDs(object[] lstIds) - { - return await BaseDal.QueryByIDs(lstIds); - } - - /// - /// 写入实体数据 - /// - /// 博文实体类 - /// - public async Task Add(TEntity entity) - { - return await BaseDal.Add(entity); - } - - /// - /// 批量插入实体(速度快) - /// - /// 实体集合 - /// 影响行数 - public async Task> Add(List listEntity) - { - return await BaseDal.Add(listEntity); - } - - /// - /// 更新实体数据 - /// - /// 博文实体类 - /// - public async Task Update(TEntity entity) - { - return await BaseDal.Update(entity); - } - /// - /// 更新实体数据 - /// - /// 博文实体类 - /// - public async Task Update(List entity) - { - return await BaseDal.Update(entity); - } - - public async Task Update(TEntity entity, string where) - { - return await BaseDal.Update(entity, where); - } - - public async Task Update(object operateAnonymousObjects) - { - return await BaseDal.Update(operateAnonymousObjects); - } - - public async Task Update(TEntity entity, List lstColumns = null, List lstIgnoreColumns = null, string where = "") - { - return await BaseDal.Update(entity, lstColumns, lstIgnoreColumns, where); - } - - - /// - /// 根据实体删除一条数据 - /// - /// 博文实体类 - /// - public async Task Delete(TEntity entity) - { - return await BaseDal.Delete(entity); - } - - /// - /// 删除指定ID的数据 - /// - /// 主键ID - /// - public async Task DeleteById(object id) - { - return await BaseDal.DeleteById(id); - } - - /// - /// 删除指定ID集合的数据(批量删除) - /// - /// 主键ID集合 - /// - public async Task DeleteByIds(object[] ids) - { - return await BaseDal.DeleteByIds(ids); - } - - - /// - /// 查询所有数据 - /// - /// 数据列表 - public async Task> Query() - { - return await BaseDal.Query(); - } - - /// - /// 查询数据列表 - /// - /// 条件 - /// 数据列表 - public async Task> Query(string where) - { - return await BaseDal.Query(where); - } - - /// - /// 查询数据列表 - /// - /// whereExpression - /// 数据列表 - public async Task> Query(Expression> whereExpression) - { - return await BaseDal.Query(whereExpression); - } - - /// - /// 按照特定列查询数据列表 - /// - /// - /// - /// - public async Task> Query(Expression> expression) - { - return await BaseDal.Query(expression); - } - - /// - /// 按照特定列查询数据列表带条件排序 - /// - /// - /// 过滤条件 - /// 查询实体条件 - /// 排序条件 - /// - public async Task> Query(Expression> expression, Expression> whereExpression, string orderByFileds) - { - return await BaseDal.Query(expression, whereExpression, orderByFileds); - } - - /// - /// 查询一个列表 - /// - /// 条件表达式 - /// 排序字段,如name asc,age desc - /// 数据列表 - public async Task> Query(Expression> whereExpression, Expression> orderByExpression, bool isAsc = true) - { - return await BaseDal.Query(whereExpression, orderByExpression, isAsc); - } - - public async Task> Query(Expression> whereExpression, string orderByFileds) - { - return await BaseDal.Query(whereExpression, orderByFileds); - } - - /// - /// 查询一个列表 - /// - /// 条件 - /// 排序字段,如name asc,age desc - /// 数据列表 - public async Task> Query(string where, string orderByFileds) - { - return await BaseDal.Query(where, orderByFileds); - } - - /// - /// 根据sql语句查询 - /// - /// 完整的sql语句 - /// 参数 - /// 泛型集合 - public async Task> QuerySql(string sql, SugarParameter[] parameters = null) - { - return await BaseDal.QuerySql(sql, parameters); - } - - /// - /// 根据sql语句查询 - /// - /// 完整的sql语句 - /// 参数 - /// DataTable - public async Task QueryTable(string sql, SugarParameter[] parameters = null) - { - return await BaseDal.QueryTable(sql, parameters); - } - - /// - /// 查询前N条数据 - /// - /// 条件表达式 - /// 前N条 - /// 排序字段,如name asc,age desc - /// 数据列表 - public async Task> Query(Expression> whereExpression, int top, string orderByFileds) - { - return await BaseDal.Query(whereExpression, top, orderByFileds); - } - - /// - /// 查询前N条数据 - /// - /// 条件 - /// 前N条 - /// 排序字段,如name asc,age desc - /// 数据列表 - public async Task> Query(string where, int top, string orderByFileds) - { - return await BaseDal.Query(where, top, orderByFileds); - } - - /// - /// 分页查询 - /// - /// 条件表达式 - /// 页码(下标0) - /// 页大小 - /// 排序字段,如name asc,age desc - /// 数据列表 - public async Task> Query(Expression> whereExpression, int pageIndex, int pageSize, string orderByFileds) - { - return await BaseDal.Query(whereExpression, pageIndex, pageSize, orderByFileds); - } - - /// - /// 分页查询 - /// - /// 条件 - /// 页码(下标0) - /// 页大小 - /// 排序字段,如name asc,age desc - /// 数据列表 - public async Task> Query(string where, int pageIndex, int pageSize, string orderByFileds) - { - return await BaseDal.Query(where, pageIndex, pageSize, orderByFileds); - } - - public async Task> QueryPage(Expression> whereExpression, int pageIndex = 1, int pageSize = 20, string orderByFileds = null) - { - return await BaseDal.QueryPage(whereExpression, pageIndex, pageSize, orderByFileds); - } - public async Task> QueryMuch(Expression> joinExpression, Expression> selectExpression, Expression> whereLambda = null) where T : class, new() - { - return await BaseDal.QueryMuch(joinExpression, selectExpression, whereLambda); - } - - public async Task> QueryPage(PaginationModel pagination) - { - var express = DynamicLinqFactory.CreateLambda(pagination.Conditions); - return await QueryPage(express, pagination.PageIndex, pagination.PageSize, pagination.OrderByFileds); - } - - #region 分表 - - public async Task> AddSplit(TEntity entity) - { - return await BaseDal.AddSplit(entity); - } - - public async Task UpdateSplit(TEntity entity, DateTime dateTime) - { - return await BaseDal.UpdateSplit(entity, dateTime); - } - - /// - /// 根据实体删除一条数据 - /// - /// 博文实体类 - /// - public async Task DeleteSplit(TEntity entity, DateTime dateTime) - { - return await BaseDal.DeleteSplit(entity, dateTime); - } - - public async Task QueryByIdSplit(object objId) - { - return await BaseDal.QueryByIdSplit(objId); - } - - public async Task> QueryPageSplit(Expression> whereExpression, DateTime beginTime, DateTime endTime, int pageIndex = 1, int pageSize = 20, string orderByFields = null) - { - return await BaseDal.QueryPageSplit(whereExpression, beginTime, endTime, pageIndex, pageSize, orderByFields); - } - - #endregion -} - \ No newline at end of file diff --git a/Tiobon.Core.Services/GlobalUsings.cs b/Tiobon.Core.Services/GlobalUsings.cs index 5a6748bd..901cd902 100644 --- a/Tiobon.Core.Services/GlobalUsings.cs +++ b/Tiobon.Core.Services/GlobalUsings.cs @@ -18,7 +18,6 @@ global using Tiobon.Core.Common.UserManager; global using Tiobon.Core.DataAccess; global using Tiobon.Core.IRepository.Base; global using Tiobon.Core.IServices; -global using Tiobon.Core.IServices.BASE; global using Tiobon.Core.Model; global using Tiobon.Core.Model.Models; global using Tiobon.Core.Model.ViewModels.Extend; diff --git a/Tiobon.Core.Services/Tiobon.Core.Services.csproj b/Tiobon.Core.Services/Tiobon.Core.Services.csproj index 2863da8a..0472c1fe 100644 --- a/Tiobon.Core.Services/Tiobon.Core.Services.csproj +++ b/Tiobon.Core.Services/Tiobon.Core.Services.csproj @@ -31,5 +31,12 @@ + + + + + ..\Lib\Tiobon.Core.Base.dll + + diff --git a/Tiobon.Core.Tasks/Tiobon.Core.Tasks.csproj b/Tiobon.Core.Tasks/Tiobon.Core.Tasks.csproj index 882489df..4fc308d4 100644 --- a/Tiobon.Core.Tasks/Tiobon.Core.Tasks.csproj +++ b/Tiobon.Core.Tasks/Tiobon.Core.Tasks.csproj @@ -15,4 +15,10 @@ + + + ..\Lib\Tiobon.Core.Base.dll + + + diff --git a/Tiobon.Core.Tests/Tiobon.Core.Tests.csproj b/Tiobon.Core.Tests/Tiobon.Core.Tests.csproj index 0befef43..d9ada485 100644 --- a/Tiobon.Core.Tests/Tiobon.Core.Tests.csproj +++ b/Tiobon.Core.Tests/Tiobon.Core.Tests.csproj @@ -50,6 +50,12 @@ + + + ..\Lib\Tiobon.Core.Base.dll + + +