1
This commit is contained in:
@@ -0,0 +1,25 @@
|
|||||||
|
// Copyright (c) 2022-Now 少林寺驻北固山办事处大神父王喇嘛
|
||||||
|
//
|
||||||
|
// SimpleAdmin 基于 Apache License Version 2.0 协议发布,可用于商业项目,但必须遵守以下补充条款:
|
||||||
|
// 1.请不要删除和修改根目录下的LICENSE文件。
|
||||||
|
// 2.请不要删除和修改SimpleAdmin源码头部的版权声明。
|
||||||
|
// 3.分发源码时候,请注明软件出处 https://gitee.com/dotnetmoyu/SimpleAdmin
|
||||||
|
// 4.基于本软件的作品,只能使用 SimpleAdmin 作为后台服务,除外情况不可商用且不允许二次分发或开源。
|
||||||
|
// 5.请不得将本软件应用于危害国家安全、荣誉和利益的行为,不能以任何形式用于非法为目的的行为。
|
||||||
|
// 6.任何基于本软件而产生的一切法律纠纷和责任,均于我司无关。
|
||||||
|
|
||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
[SugarTable("ob_company", TableDescription = "入职业务公司")]
|
||||||
|
[Tenant(SqlSugarConst.DB_DEFAULT)]
|
||||||
|
public class ObCompany : BaseEntity
|
||||||
|
{
|
||||||
|
public virtual string CompanyCode { get; set; }
|
||||||
|
public virtual string CompanyName { get; set; }
|
||||||
|
public virtual string LegalName { get; set; }
|
||||||
|
public string UnifiedSocialCreditCode { get; set; }
|
||||||
|
public string LegalRepresentative { get; set; }
|
||||||
|
public string RegisteredAddress { get; set; }
|
||||||
|
public string ContactPhone { get; set; }
|
||||||
|
public string Remark { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
// Copyright (c) 2022-Now 少林寺驻北固山办事处大神父王喇嘛
|
||||||
|
//
|
||||||
|
// SimpleAdmin 基于 Apache License Version 2.0 协议发布,可用于商业项目,但必须遵守以下补充条款:
|
||||||
|
// 1.请不要删除和修改根目录下的LICENSE文件。
|
||||||
|
// 2.请不要删除和修改SimpleAdmin源码头部的版权声明。
|
||||||
|
// 3.分发源码时候,请注明软件出处 https://gitee.com/dotnetmoyu/SimpleAdmin
|
||||||
|
// 4.基于本软件的作品,只能使用 SimpleAdmin 作为后台服务,除外情况不可商用且不允许二次分发或开源。
|
||||||
|
// 5.请不得将本软件应用于危害国家安全、荣誉和利益的行为,不能以任何形式用于非法为目的的行为。
|
||||||
|
// 6.任何基于本软件而产生的一切法律纠纷和责任,均于我司无关。
|
||||||
|
|
||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
[SugarTable("ob_contract_scope", TableDescription = "公司岗位合同适用范围")]
|
||||||
|
[Tenant(SqlSugarConst.DB_DEFAULT)]
|
||||||
|
public class ObContractScope : BaseEntity
|
||||||
|
{
|
||||||
|
public long CompanyId { get; set; }
|
||||||
|
public long? PositionId { get; set; }
|
||||||
|
public long TemplateId { get; set; }
|
||||||
|
public long TemplateVersionId { get; set; }
|
||||||
|
public bool Required { get; set; }
|
||||||
|
public int? SortCode { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
// Copyright (c) 2022-Now 少林寺驻北固山办事处大神父王喇嘛
|
||||||
|
//
|
||||||
|
// SimpleAdmin 基于 Apache License Version 2.0 协议发布,可用于商业项目,但必须遵守以下补充条款:
|
||||||
|
// 1.请不要删除和修改根目录下的LICENSE文件。
|
||||||
|
// 2.请不要删除和修改SimpleAdmin源码头部的版权声明。
|
||||||
|
// 3.分发源码时候,请注明软件出处 https://gitee.com/dotnetmoyu/SimpleAdmin
|
||||||
|
// 4.基于本软件的作品,只能使用 SimpleAdmin 作为后台服务,除外情况不可商用且不允许二次分发或开源。
|
||||||
|
// 5.请不得将本软件应用于危害国家安全、荣誉和利益的行为,不能以任何形式用于非法为目的的行为。
|
||||||
|
// 6.任何基于本软件而产生的一切法律纠纷和责任,均于我司无关。
|
||||||
|
|
||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
[SugarTable("ob_contract_template", TableDescription = "合同模板主档案")]
|
||||||
|
[Tenant(SqlSugarConst.DB_DEFAULT)]
|
||||||
|
public class ObContractTemplate : BaseEntity
|
||||||
|
{
|
||||||
|
public string TemplateCode { get; set; }
|
||||||
|
public string TemplateName { get; set; }
|
||||||
|
public string ContractType { get; set; }
|
||||||
|
public string Description { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
// Copyright (c) 2022-Now 少林寺驻北固山办事处大神父王喇嘛
|
||||||
|
//
|
||||||
|
// SimpleAdmin 基于 Apache License Version 2.0 协议发布,可用于商业项目,但必须遵守以下补充条款:
|
||||||
|
// 1.请不要删除和修改根目录下的LICENSE文件。
|
||||||
|
// 2.请不要删除和修改SimpleAdmin源码头部的版权声明。
|
||||||
|
// 3.分发源码时候,请注明软件出处 https://gitee.com/dotnetmoyu/SimpleAdmin
|
||||||
|
// 4.基于本软件的作品,只能使用 SimpleAdmin 作为后台服务,除外情况不可商用且不允许二次分发或开源。
|
||||||
|
// 5.请不得将本软件应用于危害国家安全、荣誉和利益的行为,不能以任何形式用于非法为目的的行为。
|
||||||
|
// 6.任何基于本软件而产生的一切法律纠纷和责任,均于我司无关。
|
||||||
|
|
||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
[SugarTable("ob_contract_template_version", TableDescription = "合同模板版本")]
|
||||||
|
[Tenant(SqlSugarConst.DB_DEFAULT)]
|
||||||
|
public class ObContractTemplateVersion : BaseEntity
|
||||||
|
{
|
||||||
|
public long TemplateId { get; set; }
|
||||||
|
public string VersionNo { get; set; }
|
||||||
|
public long SourceDocxFileId { get; set; }
|
||||||
|
public string FileHash { get; set; }
|
||||||
|
public DateTime? EffectiveDate { get; set; }
|
||||||
|
public DateTime? ExpiryDate { get; set; }
|
||||||
|
public string VersionStatus { get; set; } = ContractTemplateVersionStatus.Draft;
|
||||||
|
public string Remark { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
// Copyright (c) 2022-Now 少林寺驻北固山办事处大神父王喇嘛
|
||||||
|
//
|
||||||
|
// SimpleAdmin 基于 Apache License Version 2.0 协议发布,可用于商业项目,但必须遵守以下补充条款:
|
||||||
|
// 1.请不要删除和修改根目录下的LICENSE文件。
|
||||||
|
// 2.请不要删除和修改SimpleAdmin源码头部的版权声明。
|
||||||
|
// 3.分发源码时候,请注明软件出处 https://gitee.com/dotnetmoyu/SimpleAdmin
|
||||||
|
// 4.基于本软件的作品,只能使用 SimpleAdmin 作为后台服务,除外情况不可商用且不允许二次分发或开源。
|
||||||
|
// 5.请不得将本软件应用于危害国家安全、荣誉和利益的行为,不能以任何形式用于非法为目的的行为。
|
||||||
|
// 6.任何基于本软件而产生的一切法律纠纷和责任,均于我司无关。
|
||||||
|
|
||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
[SugarTable("ob_employee", TableDescription = "正式员工档案")]
|
||||||
|
[Tenant(SqlSugarConst.DB_DEFAULT)]
|
||||||
|
public class ObEmployee : BaseEntity
|
||||||
|
{
|
||||||
|
public string EmployeeNo { get; set; }
|
||||||
|
public string InternalNo { get; set; }
|
||||||
|
public string EmployeeName { get; set; }
|
||||||
|
public long CompanyId { get; set; }
|
||||||
|
public string DepartmentName { get; set; }
|
||||||
|
public long PositionId { get; set; }
|
||||||
|
public string Gender { get; set; }
|
||||||
|
public string Phone { get; set; }
|
||||||
|
public string IdCardNumber { get; set; }
|
||||||
|
public string College { get; set; }
|
||||||
|
public string Education { get; set; }
|
||||||
|
public string Major { get; set; }
|
||||||
|
public DateTime? BirthDate { get; set; }
|
||||||
|
public string RegisteredResidence { get; set; }
|
||||||
|
public string Nation { get; set; }
|
||||||
|
public string ContactAddress { get; set; }
|
||||||
|
public DateTime? EntryDate { get; set; }
|
||||||
|
public DateTime? ContractStartDate { get; set; }
|
||||||
|
public DateTime? ContractEndDate { get; set; }
|
||||||
|
public DateTime? ProbationStartDate { get; set; }
|
||||||
|
public DateTime? ProbationEndDate { get; set; }
|
||||||
|
public DateTime? RegularizationDate { get; set; }
|
||||||
|
public string SocialInsuranceCompany { get; set; }
|
||||||
|
public string ContractNature { get; set; }
|
||||||
|
public string BankCardNumber { get; set; }
|
||||||
|
public string BankAccountName { get; set; }
|
||||||
|
public string BankName { get; set; }
|
||||||
|
public string Remark { get; set; }
|
||||||
|
public string ExtraInfoJson { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
// Copyright (c) 2022-Now 少林寺驻北固山办事处大神父王喇嘛
|
||||||
|
//
|
||||||
|
// SimpleAdmin 基于 Apache License Version 2.0 协议发布,可用于商业项目,但必须遵守以下补充条款:
|
||||||
|
// 1.请不要删除和修改根目录下的LICENSE文件。
|
||||||
|
// 2.请不要删除和修改SimpleAdmin源码头部的版权声明。
|
||||||
|
// 3.分发源码时候,请注明软件出处 https://gitee.com/dotnetmoyu/SimpleAdmin
|
||||||
|
// 4.基于本软件的作品,只能使用 SimpleAdmin 作为后台服务,除外情况不可商用且不允许二次分发或开源。
|
||||||
|
// 5.请不得将本软件应用于危害国家安全、荣誉和利益的行为,不能以任何形式用于非法为目的的行为。
|
||||||
|
// 6.任何基于本软件而产生的一切法律纠纷和责任,均于我司无关。
|
||||||
|
|
||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
[SugarTable("ob_form_field", TableDescription = "动态入职填写字段")]
|
||||||
|
[Tenant(SqlSugarConst.DB_DEFAULT)]
|
||||||
|
public class ObFormField : BaseEntity
|
||||||
|
{
|
||||||
|
public string FieldCode { get; set; }
|
||||||
|
public string FieldName { get; set; }
|
||||||
|
public string DataType { get; set; }
|
||||||
|
public string OptionsJson { get; set; }
|
||||||
|
public string ValidationRule { get; set; }
|
||||||
|
public string Placeholder { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
// Copyright (c) 2022-Now 少林寺驻北固山办事处大神父王喇嘛
|
||||||
|
//
|
||||||
|
// SimpleAdmin 基于 Apache License Version 2.0 协议发布,可用于商业项目,但必须遵守以下补充条款:
|
||||||
|
// 1.请不要删除和修改根目录下的LICENSE文件。
|
||||||
|
// 2.请不要删除和修改SimpleAdmin源码头部的版权声明。
|
||||||
|
// 3.分发源码时候,请注明软件出处 https://gitee.com/dotnetmoyu/SimpleAdmin
|
||||||
|
// 4.基于本软件的作品,只能使用 SimpleAdmin 作为后台服务,除外情况不可商用且不允许二次分发或开源。
|
||||||
|
// 5.请不得将本软件应用于危害国家安全、荣誉和利益的行为,不能以任何形式用于非法为目的的行为。
|
||||||
|
// 6.任何基于本软件而产生的一切法律纠纷和责任,均于我司无关。
|
||||||
|
|
||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
[SugarTable("ob_form_requirement", TableDescription = "公司岗位动态填写项要求")]
|
||||||
|
[Tenant(SqlSugarConst.DB_DEFAULT)]
|
||||||
|
public class ObFormRequirement : BaseEntity
|
||||||
|
{
|
||||||
|
public long CompanyId { get; set; }
|
||||||
|
public long? PositionId { get; set; }
|
||||||
|
public long FieldId { get; set; }
|
||||||
|
public bool Required { get; set; }
|
||||||
|
public int? SortCode { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
// Copyright (c) 2022-Now 少林寺驻北固山办事处大神父王喇嘛
|
||||||
|
//
|
||||||
|
// SimpleAdmin 基于 Apache License Version 2.0 协议发布,可用于商业项目,但必须遵守以下补充条款:
|
||||||
|
// 1.请不要删除和修改根目录下的LICENSE文件。
|
||||||
|
// 2.请不要删除和修改SimpleAdmin源码头部的版权声明。
|
||||||
|
// 3.分发源码时候,请注明软件出处 https://gitee.com/dotnetmoyu/SimpleAdmin
|
||||||
|
// 4.基于本软件的作品,只能使用 SimpleAdmin 作为后台服务,除外情况不可商用且不允许二次分发或开源。
|
||||||
|
// 5.请不得将本软件应用于危害国家安全、荣誉和利益的行为,不能以任何形式用于非法为目的的行为。
|
||||||
|
// 6.任何基于本软件而产生的一切法律纠纷和责任,均于我司无关。
|
||||||
|
|
||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
[SugarTable("ob_material_requirement", TableDescription = "公司岗位入职资料要求")]
|
||||||
|
[Tenant(SqlSugarConst.DB_DEFAULT)]
|
||||||
|
public class ObMaterialRequirement : BaseEntity
|
||||||
|
{
|
||||||
|
public long CompanyId { get; set; }
|
||||||
|
public long? PositionId { get; set; }
|
||||||
|
public long MaterialTypeId { get; set; }
|
||||||
|
public bool Required { get; set; }
|
||||||
|
public int? SortCode { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
// Copyright (c) 2022-Now 少林寺驻北固山办事处大神父王喇嘛
|
||||||
|
//
|
||||||
|
// SimpleAdmin 基于 Apache License Version 2.0 协议发布,可用于商业项目,但必须遵守以下补充条款:
|
||||||
|
// 1.请不要删除和修改根目录下的LICENSE文件。
|
||||||
|
// 2.请不要删除和修改SimpleAdmin源码头部的版权声明。
|
||||||
|
// 3.分发源码时候,请注明软件出处 https://gitee.com/dotnetmoyu/SimpleAdmin
|
||||||
|
// 4.基于本软件的作品,只能使用 SimpleAdmin 作为后台服务,除外情况不可商用且不允许二次分发或开源。
|
||||||
|
// 5.请不得将本软件应用于危害国家安全、荣誉和利益的行为,不能以任何形式用于非法为目的的行为。
|
||||||
|
// 6.任何基于本软件而产生的一切法律纠纷和责任,均于我司无关。
|
||||||
|
|
||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
[SugarTable("ob_material_type", TableDescription = "入职上传资料类型")]
|
||||||
|
[Tenant(SqlSugarConst.DB_DEFAULT)]
|
||||||
|
public class ObMaterialType : BaseEntity
|
||||||
|
{
|
||||||
|
public string MaterialCode { get; set; }
|
||||||
|
public string MaterialName { get; set; }
|
||||||
|
public string AllowedExtensions { get; set; }
|
||||||
|
public int MaxFileCount { get; set; }
|
||||||
|
public int? MaxFileSizeMb { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
// Copyright (c) 2022-Now 少林寺驻北固山办事处大神父王喇嘛
|
||||||
|
//
|
||||||
|
// SimpleAdmin 基于 Apache License Version 2.0 协议发布,可用于商业项目,但必须遵守以下补充条款:
|
||||||
|
// 1.请不要删除和修改根目录下的LICENSE文件。
|
||||||
|
// 2.请不要删除和修改SimpleAdmin源码头部的版权声明。
|
||||||
|
// 3.分发源码时候,请注明软件出处 https://gitee.com/dotnetmoyu/SimpleAdmin
|
||||||
|
// 4.基于本软件的作品,只能使用 SimpleAdmin 作为后台服务,除外情况不可商用且不允许二次分发或开源。
|
||||||
|
// 5.请不得将本软件应用于危害国家安全、荣誉和利益的行为,不能以任何形式用于非法为目的的行为。
|
||||||
|
// 6.任何基于本软件而产生的一切法律纠纷和责任,均于我司无关。
|
||||||
|
|
||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
[SugarTable("ob_onboarding_task", TableDescription = "新员工入职任务")]
|
||||||
|
[Tenant(SqlSugarConst.DB_DEFAULT)]
|
||||||
|
public class ObOnboardingTask : BaseEntity
|
||||||
|
{
|
||||||
|
public string TaskNo { get; set; }
|
||||||
|
public long? EmployeeId { get; set; }
|
||||||
|
public long CompanyId { get; set; }
|
||||||
|
public long PositionId { get; set; }
|
||||||
|
public long? AssignedReviewerUserId { get; set; }
|
||||||
|
public string TaskStatus { get; set; } = OnboardingTaskStatus.Draft;
|
||||||
|
public DateTime? LinkExpireAt { get; set; }
|
||||||
|
public int SubmitCount { get; set; }
|
||||||
|
public DateTime? LastSubmittedAt { get; set; }
|
||||||
|
public DateTime? AuditedAt { get; set; }
|
||||||
|
public DateTime? ArchivedAt { get; set; }
|
||||||
|
public string RejectReason { get; set; }
|
||||||
|
public string Remark { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
// Copyright (c) 2022-Now 少林寺驻北固山办事处大神父王喇嘛
|
||||||
|
//
|
||||||
|
// SimpleAdmin 基于 Apache License Version 2.0 协议发布,可用于商业项目,但必须遵守以下补充条款:
|
||||||
|
// 1.请不要删除和修改根目录下的LICENSE文件。
|
||||||
|
// 2.请不要删除和修改SimpleAdmin源码头部的版权声明。
|
||||||
|
// 3.分发源码时候,请注明软件出处 https://gitee.com/dotnetmoyu/SimpleAdmin
|
||||||
|
// 4.基于本软件的作品,只能使用 SimpleAdmin 作为后台服务,除外情况不可商用且不允许二次分发或开源。
|
||||||
|
// 5.请不得将本软件应用于危害国家安全、荣誉和利益的行为,不能以任何形式用于非法为目的的行为。
|
||||||
|
// 6.任何基于本软件而产生的一切法律纠纷和责任,均于我司无关。
|
||||||
|
|
||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
[SugarTable("ob_position", TableDescription = "入职业务岗位")]
|
||||||
|
[Tenant(SqlSugarConst.DB_DEFAULT)]
|
||||||
|
public class ObPosition : BaseEntity
|
||||||
|
{
|
||||||
|
public long CompanyId { get; set; }
|
||||||
|
public virtual string PositionCode { get; set; }
|
||||||
|
public virtual string PositionName { get; set; }
|
||||||
|
public decimal? DefaultContractYears { get; set; }
|
||||||
|
public int? DefaultProbationMonths { get; set; }
|
||||||
|
public string DefaultParamsJson { get; set; }
|
||||||
|
public string Remark { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
// Copyright (c) 2022-Now 少林寺驻北固山办事处大神父王喇嘛
|
||||||
|
//
|
||||||
|
// SimpleAdmin 基于 Apache License Version 2.0 协议发布,可用于商业项目,但必须遵守以下补充条款:
|
||||||
|
// 1.请不要删除和修改根目录下的LICENSE文件。
|
||||||
|
// 2.请不要删除和修改SimpleAdmin源码头部的版权声明。
|
||||||
|
// 3.分发源码时候,请注明软件出处 https://gitee.com/dotnetmoyu/SimpleAdmin
|
||||||
|
// 4.基于本软件的作品,只能使用 SimpleAdmin 作为后台服务,除外情况不可商用且不允许二次分发或开源。
|
||||||
|
// 5.请不得将本软件应用于危害国家安全、荣誉和利益的行为,不能以任何形式用于非法为目的的行为。
|
||||||
|
// 6.任何基于本软件而产生的一切法律纠纷和责任,均于我司无关。
|
||||||
|
|
||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
[SugarTable("ob_task_audit", TableDescription = "入职任务提交与审核记录")]
|
||||||
|
[Tenant(SqlSugarConst.DB_DEFAULT)]
|
||||||
|
public class ObTaskAudit : BaseEntity
|
||||||
|
{
|
||||||
|
public long TaskId { get; set; }
|
||||||
|
public int AuditRound { get; set; }
|
||||||
|
public string AuditAction { get; set; }
|
||||||
|
public long? AuditorUserId { get; set; }
|
||||||
|
public string AuditOpinion { get; set; }
|
||||||
|
public string SnapshotJson { get; set; }
|
||||||
|
public DateTime AuditedAt { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
// Copyright (c) 2022-Now 少林寺驻北固山办事处大神父王喇嘛
|
||||||
|
//
|
||||||
|
// SimpleAdmin 基于 Apache License Version 2.0 协议发布,可用于商业项目,但必须遵守以下补充条款:
|
||||||
|
// 1.请不要删除和修改根目录下的LICENSE文件。
|
||||||
|
// 2.请不要删除和修改SimpleAdmin源码头部的版权声明。
|
||||||
|
// 3.分发源码时候,请注明软件出处 https://gitee.com/dotnetmoyu/SimpleAdmin
|
||||||
|
// 4.基于本软件的作品,只能使用 SimpleAdmin 作为后台服务,除外情况不可商用且不允许二次分发或开源。
|
||||||
|
// 5.请不得将本软件应用于危害国家安全、荣誉和利益的行为,不能以任何形式用于非法为目的的行为。
|
||||||
|
// 6.任何基于本软件而产生的一切法律纠纷和责任,均于我司无关。
|
||||||
|
|
||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
[SugarTable("ob_task_contract", TableDescription = "入职任务合同明细")]
|
||||||
|
[Tenant(SqlSugarConst.DB_DEFAULT)]
|
||||||
|
public class ObTaskContract : BaseEntity
|
||||||
|
{
|
||||||
|
public long TaskId { get; set; }
|
||||||
|
public long TemplateId { get; set; }
|
||||||
|
public long TemplateVersionId { get; set; }
|
||||||
|
public string ContractName { get; set; }
|
||||||
|
public string ContractType { get; set; }
|
||||||
|
public bool Required { get; set; }
|
||||||
|
public string ContractStatus { get; set; } = TaskContractStatus.PendingGenerate;
|
||||||
|
public long? GeneratedDocxFileId { get; set; }
|
||||||
|
public long? GeneratedPdfFileId { get; set; }
|
||||||
|
public DateTime? GeneratedAt { get; set; }
|
||||||
|
public DateTime? ReadAt { get; set; }
|
||||||
|
public DateTime? ConfirmedAt { get; set; }
|
||||||
|
public DateTime? OfflineSignedAt { get; set; }
|
||||||
|
public DateTime? PrintedAt { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
// Copyright (c) 2022-Now 少林寺驻北固山办事处大神父王喇嘛
|
||||||
|
//
|
||||||
|
// SimpleAdmin 基于 Apache License Version 2.0 协议发布,可用于商业项目,但必须遵守以下补充条款:
|
||||||
|
// 1.请不要删除和修改根目录下的LICENSE文件。
|
||||||
|
// 2.请不要删除和修改SimpleAdmin源码头部的版权声明。
|
||||||
|
// 3.分发源码时候,请注明软件出处 https://gitee.com/dotnetmoyu/SimpleAdmin
|
||||||
|
// 4.基于本软件的作品,只能使用 SimpleAdmin 作为后台服务,除外情况不可商用且不允许二次分发或开源。
|
||||||
|
// 5.请不得将本软件应用于危害国家安全、荣誉和利益的行为,不能以任何形式用于非法为目的的行为。
|
||||||
|
// 6.任何基于本软件而产生的一切法律纠纷和责任,均于我司无关。
|
||||||
|
|
||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
[SugarTable("ob_task_contract_variable", TableDescription = "任务合同变量最终值快照")]
|
||||||
|
[Tenant(SqlSugarConst.DB_DEFAULT)]
|
||||||
|
public class ObTaskContractVariable : BaseEntity
|
||||||
|
{
|
||||||
|
public long TaskContractId { get; set; }
|
||||||
|
public string VariableCode { get; set; }
|
||||||
|
public string VariableName { get; set; }
|
||||||
|
public string VariableType { get; set; }
|
||||||
|
public string DataType { get; set; }
|
||||||
|
public string VariableValue { get; set; }
|
||||||
|
public string SourceType { get; set; }
|
||||||
|
public bool IsManualOverride { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
// Copyright (c) 2022-Now 少林寺驻北固山办事处大神父王喇嘛
|
||||||
|
//
|
||||||
|
// SimpleAdmin 基于 Apache License Version 2.0 协议发布,可用于商业项目,但必须遵守以下补充条款:
|
||||||
|
// 1.请不要删除和修改根目录下的LICENSE文件。
|
||||||
|
// 2.请不要删除和修改SimpleAdmin源码头部的版权声明。
|
||||||
|
// 3.分发源码时候,请注明软件出处 https://gitee.com/dotnetmoyu/SimpleAdmin
|
||||||
|
// 4.基于本软件的作品,只能使用 SimpleAdmin 作为后台服务,除外情况不可商用且不允许二次分发或开源。
|
||||||
|
// 5.请不得将本软件应用于危害国家安全、荣誉和利益的行为,不能以任何形式用于非法为目的的行为。
|
||||||
|
// 6.任何基于本软件而产生的一切法律纠纷和责任,均于我司无关。
|
||||||
|
|
||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
[SugarTable("ob_task_employee_info", TableDescription = "候选人提交的固定基础信息")]
|
||||||
|
[Tenant(SqlSugarConst.DB_DEFAULT)]
|
||||||
|
public class ObTaskEmployeeInfo : BaseEntity
|
||||||
|
{
|
||||||
|
public long TaskId { get; set; }
|
||||||
|
public string EmployeeNo { get; set; }
|
||||||
|
public string InternalNo { get; set; }
|
||||||
|
public string EmployeeName { get; set; }
|
||||||
|
public string DepartmentName { get; set; }
|
||||||
|
public string Gender { get; set; }
|
||||||
|
public string Phone { get; set; }
|
||||||
|
public string IdCardNumber { get; set; }
|
||||||
|
public string College { get; set; }
|
||||||
|
public string Education { get; set; }
|
||||||
|
public string Major { get; set; }
|
||||||
|
public DateTime? BirthDate { get; set; }
|
||||||
|
public string RegisteredResidence { get; set; }
|
||||||
|
public string Nation { get; set; }
|
||||||
|
public string ContactAddress { get; set; }
|
||||||
|
public DateTime? EntryDate { get; set; }
|
||||||
|
public DateTime? ContractStartDate { get; set; }
|
||||||
|
public DateTime? ContractEndDate { get; set; }
|
||||||
|
public DateTime? ProbationStartDate { get; set; }
|
||||||
|
public DateTime? ProbationEndDate { get; set; }
|
||||||
|
public DateTime? RegularizationDate { get; set; }
|
||||||
|
public string SocialInsuranceCompany { get; set; }
|
||||||
|
public string ContractNature { get; set; }
|
||||||
|
public string BankCardNumber { get; set; }
|
||||||
|
public string BankAccountName { get; set; }
|
||||||
|
public string BankName { get; set; }
|
||||||
|
public string Remark { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
// Copyright (c) 2022-Now 少林寺驻北固山办事处大神父王喇嘛
|
||||||
|
//
|
||||||
|
// SimpleAdmin 基于 Apache License Version 2.0 协议发布,可用于商业项目,但必须遵守以下补充条款:
|
||||||
|
// 1.请不要删除和修改根目录下的LICENSE文件。
|
||||||
|
// 2.请不要删除和修改SimpleAdmin源码头部的版权声明。
|
||||||
|
// 3.分发源码时候,请注明软件出处 https://gitee.com/dotnetmoyu/SimpleAdmin
|
||||||
|
// 4.基于本软件的作品,只能使用 SimpleAdmin 作为后台服务,除外情况不可商用且不允许二次分发或开源。
|
||||||
|
// 5.请不得将本软件应用于危害国家安全、荣誉和利益的行为,不能以任何形式用于非法为目的的行为。
|
||||||
|
// 6.任何基于本软件而产生的一切法律纠纷和责任,均于我司无关。
|
||||||
|
|
||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
[SugarTable("ob_task_form_value", TableDescription = "候选人动态填写信息")]
|
||||||
|
[Tenant(SqlSugarConst.DB_DEFAULT)]
|
||||||
|
public class ObTaskFormValue : BaseEntity
|
||||||
|
{
|
||||||
|
public long TaskId { get; set; }
|
||||||
|
public long FieldId { get; set; }
|
||||||
|
public string FieldCode { get; set; }
|
||||||
|
public string FieldName { get; set; }
|
||||||
|
public string FieldValue { get; set; }
|
||||||
|
public int SubmitRound { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
// Copyright (c) 2022-Now 少林寺驻北固山办事处大神父王喇嘛
|
||||||
|
//
|
||||||
|
// SimpleAdmin 基于 Apache License Version 2.0 协议发布,可用于商业项目,但必须遵守以下补充条款:
|
||||||
|
// 1.请不要删除和修改根目录下的LICENSE文件。
|
||||||
|
// 2.请不要删除和修改SimpleAdmin源码头部的版权声明。
|
||||||
|
// 3.分发源码时候,请注明软件出处 https://gitee.com/dotnetmoyu/SimpleAdmin
|
||||||
|
// 4.基于本软件的作品,只能使用 SimpleAdmin 作为后台服务,除外情况不可商用且不允许二次分发或开源。
|
||||||
|
// 5.请不得将本软件应用于危害国家安全、荣誉和利益的行为,不能以任何形式用于非法为目的的行为。
|
||||||
|
// 6.任何基于本软件而产生的一切法律纠纷和责任,均于我司无关。
|
||||||
|
|
||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
[SugarTable("ob_task_link", TableDescription = "新员工专属填写链接")]
|
||||||
|
[Tenant(SqlSugarConst.DB_DEFAULT)]
|
||||||
|
public class ObTaskLink : BaseEntity
|
||||||
|
{
|
||||||
|
public long TaskId { get; set; }
|
||||||
|
public string TokenHash { get; set; }
|
||||||
|
public string LinkStatus { get; set; } = OnboardingLinkStatus.Active;
|
||||||
|
public DateTime ExpiresAt { get; set; }
|
||||||
|
public DateTime? LastAccessedAt { get; set; }
|
||||||
|
public int AccessCount { get; set; }
|
||||||
|
public DateTime? RevokedAt { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
// Copyright (c) 2022-Now 少林寺驻北固山办事处大神父王喇嘛
|
||||||
|
//
|
||||||
|
// SimpleAdmin 基于 Apache License Version 2.0 协议发布,可用于商业项目,但必须遵守以下补充条款:
|
||||||
|
// 1.请不要删除和修改根目录下的LICENSE文件。
|
||||||
|
// 2.请不要删除和修改SimpleAdmin源码头部的版权声明。
|
||||||
|
// 3.分发源码时候,请注明软件出处 https://gitee.com/dotnetmoyu/SimpleAdmin
|
||||||
|
// 4.基于本软件的作品,只能使用 SimpleAdmin 作为后台服务,除外情况不可商用且不允许二次分发或开源。
|
||||||
|
// 5.请不得将本软件应用于危害国家安全、荣誉和利益的行为,不能以任何形式用于非法为目的的行为。
|
||||||
|
// 6.任何基于本软件而产生的一切法律纠纷和责任,均于我司无关。
|
||||||
|
|
||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
[SugarTable("ob_task_material", TableDescription = "候选人上传资料")]
|
||||||
|
[Tenant(SqlSugarConst.DB_DEFAULT)]
|
||||||
|
public class ObTaskMaterial : BaseEntity
|
||||||
|
{
|
||||||
|
public long TaskId { get; set; }
|
||||||
|
public long MaterialTypeId { get; set; }
|
||||||
|
public string MaterialName { get; set; }
|
||||||
|
public long FileId { get; set; }
|
||||||
|
public int SubmitRound { get; set; }
|
||||||
|
public DateTime UploadedAt { get; set; }
|
||||||
|
public string ReviewStatus { get; set; } = TaskMaterialReviewStatus.Pending;
|
||||||
|
public string ReviewRemark { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
// Copyright (c) 2022-Now 少林寺驻北固山办事处大神父王喇嘛
|
||||||
|
//
|
||||||
|
// SimpleAdmin 基于 Apache License Version 2.0 协议发布,可用于商业项目,但必须遵守以下补充条款:
|
||||||
|
// 1.请不要删除和修改根目录下的LICENSE文件。
|
||||||
|
// 2.请不要删除和修改SimpleAdmin源码头部的版权声明。
|
||||||
|
// 3.分发源码时候,请注明软件出处 https://gitee.com/dotnetmoyu/SimpleAdmin
|
||||||
|
// 4.基于本软件的作品,只能使用 SimpleAdmin 作为后台服务,除外情况不可商用且不允许二次分发或开源。
|
||||||
|
// 5.请不得将本软件应用于危害国家安全、荣誉和利益的行为,不能以任何形式用于非法为目的的行为。
|
||||||
|
// 6.任何基于本软件而产生的一切法律纠纷和责任,均于我司无关。
|
||||||
|
|
||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
[SugarTable("ob_task_operation_log", TableDescription = "入职任务操作日志")]
|
||||||
|
[Tenant(SqlSugarConst.DB_DEFAULT)]
|
||||||
|
public class ObTaskOperationLog : BaseEntity
|
||||||
|
{
|
||||||
|
public long TaskId { get; set; }
|
||||||
|
public string OperatorType { get; set; }
|
||||||
|
public long? OperatorUserId { get; set; }
|
||||||
|
public string OperationType { get; set; }
|
||||||
|
public string OperationContent { get; set; }
|
||||||
|
public string ChangeDataJson { get; set; }
|
||||||
|
public string IpAddress { get; set; }
|
||||||
|
public DateTime OperatedAt { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
// Copyright (c) 2022-Now 少林寺驻北固山办事处大神父王喇嘛
|
||||||
|
//
|
||||||
|
// SimpleAdmin 基于 Apache License Version 2.0 协议发布,可用于商业项目,但必须遵守以下补充条款:
|
||||||
|
// 1.请不要删除和修改根目录下的LICENSE文件。
|
||||||
|
// 2.请不要删除和修改SimpleAdmin源码头部的版权声明。
|
||||||
|
// 3.分发源码时候,请注明软件出处 https://gitee.com/dotnetmoyu/SimpleAdmin
|
||||||
|
// 4.基于本软件的作品,只能使用 SimpleAdmin 作为后台服务,除外情况不可商用且不允许二次分发或开源。
|
||||||
|
// 5.请不得将本软件应用于危害国家安全、荣誉和利益的行为,不能以任何形式用于非法为目的的行为。
|
||||||
|
// 6.任何基于本软件而产生的一切法律纠纷和责任,均于我司无关。
|
||||||
|
|
||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
[SugarTable("ob_template_variable", TableDescription = "合同模板变量定义")]
|
||||||
|
[Tenant(SqlSugarConst.DB_DEFAULT)]
|
||||||
|
public class ObTemplateVariable : BaseEntity
|
||||||
|
{
|
||||||
|
public long TemplateVersionId { get; set; }
|
||||||
|
public string VariableCode { get; set; }
|
||||||
|
public string VariableName { get; set; }
|
||||||
|
public string VariableType { get; set; }
|
||||||
|
public string DataType { get; set; }
|
||||||
|
public string EmployeeField { get; set; }
|
||||||
|
public string DefaultValue { get; set; }
|
||||||
|
public string OptionsJson { get; set; }
|
||||||
|
public string FormatRule { get; set; }
|
||||||
|
public bool Required { get; set; }
|
||||||
|
public bool HrEditable { get; set; }
|
||||||
|
public int? SortCode { get; set; }
|
||||||
|
public string Remark { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,103 @@
|
|||||||
|
// Copyright (c) 2022-Now 少林寺驻北固山办事处大神父王喇嘛
|
||||||
|
//
|
||||||
|
// SimpleAdmin 基于 Apache License Version 2.0 协议发布,可用于商业项目,但必须遵守以下补充条款:
|
||||||
|
// 1.请不要删除和修改根目录下的LICENSE文件。
|
||||||
|
// 2.请不要删除和修改SimpleAdmin源码头部的版权声明。
|
||||||
|
// 3.分发源码时候,请注明软件出处 https://gitee.com/dotnetmoyu/SimpleAdmin
|
||||||
|
// 4.基于本软件的作品,只能使用 SimpleAdmin 作为后台服务,除外情况不可商用且不允许二次分发或开源。
|
||||||
|
// 5.请不得将本软件应用于危害国家安全、荣誉和利益的行为,不能以任何形式用于非法为目的的行为。
|
||||||
|
// 6.任何基于本软件而产生的一切法律纠纷和责任,均于我司无关。
|
||||||
|
|
||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 入职任务状态。
|
||||||
|
/// </summary>
|
||||||
|
public static class OnboardingTaskStatus
|
||||||
|
{
|
||||||
|
public const string Draft = "draft";
|
||||||
|
public const string PendingFill = "pending_fill";
|
||||||
|
public const string Reviewing = "reviewing";
|
||||||
|
public const string Rejected = "rejected";
|
||||||
|
public const string Approved = "approved";
|
||||||
|
public const string Archived = "archived";
|
||||||
|
public const string Expired = "expired";
|
||||||
|
public const string Revoked = "revoked";
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 入职链接状态。
|
||||||
|
/// </summary>
|
||||||
|
public static class OnboardingLinkStatus
|
||||||
|
{
|
||||||
|
public const string Active = "active";
|
||||||
|
public const string Expired = "expired";
|
||||||
|
public const string Revoked = "revoked";
|
||||||
|
public const string Replaced = "replaced";
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 合同模板版本状态。
|
||||||
|
/// </summary>
|
||||||
|
public static class ContractTemplateVersionStatus
|
||||||
|
{
|
||||||
|
public const string Draft = "draft";
|
||||||
|
public const string Enabled = "enabled";
|
||||||
|
public const string Disabled = "disabled";
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 入职任务合同状态。
|
||||||
|
/// </summary>
|
||||||
|
public static class TaskContractStatus
|
||||||
|
{
|
||||||
|
public const string PendingGenerate = "pending_generate";
|
||||||
|
public const string PendingConfirm = "pending_confirm";
|
||||||
|
public const string Confirmed = "confirmed";
|
||||||
|
public const string OfflinePendingSign = "offline_pending_sign";
|
||||||
|
public const string Archived = "archived";
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 合同变量类型。
|
||||||
|
/// </summary>
|
||||||
|
public static class ContractVariableType
|
||||||
|
{
|
||||||
|
public const string Employee = "employee";
|
||||||
|
public const string Company = "company";
|
||||||
|
public const string Contract = "contract";
|
||||||
|
public const string System = "system";
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 合同变量最终值来源。
|
||||||
|
/// </summary>
|
||||||
|
public static class ContractVariableSourceType
|
||||||
|
{
|
||||||
|
public const string Employee = "employee";
|
||||||
|
public const string Company = "company";
|
||||||
|
public const string HrInput = "hr_input";
|
||||||
|
public const string System = "system";
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 入职资料审核状态。
|
||||||
|
/// </summary>
|
||||||
|
public static class TaskMaterialReviewStatus
|
||||||
|
{
|
||||||
|
public const string Pending = "pending";
|
||||||
|
public const string Passed = "passed";
|
||||||
|
public const string NeedSupplement = "need_supplement";
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 入职审核动作。
|
||||||
|
/// </summary>
|
||||||
|
public static class OnboardingAuditAction
|
||||||
|
{
|
||||||
|
public const string Submit = "submit";
|
||||||
|
public const string Approve = "approve";
|
||||||
|
public const string Reject = "reject";
|
||||||
|
public const string Revoke = "revoke";
|
||||||
|
public const string Archive = "archive";
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
public class OnboardingCompanyPageInput : BasePageInput
|
||||||
|
{
|
||||||
|
public virtual string CompanyName { get; set; }
|
||||||
|
public string Status { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class OnboardingCompanyAddInput : ObCompany
|
||||||
|
{
|
||||||
|
[global::System.ComponentModel.DataAnnotations.Required(ErrorMessage = "公司编码不能为空")]
|
||||||
|
public override string CompanyCode { get; set; }
|
||||||
|
|
||||||
|
[global::System.ComponentModel.DataAnnotations.Required(ErrorMessage = "公司名称不能为空")]
|
||||||
|
public override string CompanyName { get; set; }
|
||||||
|
|
||||||
|
[global::System.ComponentModel.DataAnnotations.Required(ErrorMessage = "合同甲方全称不能为空")]
|
||||||
|
public override string LegalName { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class OnboardingCompanyEditInput : OnboardingCompanyAddInput
|
||||||
|
{
|
||||||
|
[IdNotNull(ErrorMessage = "公司Id不能为空")]
|
||||||
|
public override long Id { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
public interface IOnboardingCompanyService : ITransient
|
||||||
|
{
|
||||||
|
Task<SqlSugarPagedList<ObCompany>> Page(OnboardingCompanyPageInput input);
|
||||||
|
Task<List<ObCompany>> ListEnabled();
|
||||||
|
Task<ObCompany> Detail(BaseIdInput input);
|
||||||
|
Task Add(OnboardingCompanyAddInput input);
|
||||||
|
Task Edit(OnboardingCompanyEditInput input);
|
||||||
|
Task Delete(BaseIdListInput input);
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
public class OnboardingCompanyService : DbRepository<ObCompany>, IOnboardingCompanyService
|
||||||
|
{
|
||||||
|
public async Task<SqlSugarPagedList<ObCompany>> Page(OnboardingCompanyPageInput input)
|
||||||
|
{
|
||||||
|
return await Context.Queryable<ObCompany>()
|
||||||
|
.WhereIF(!string.IsNullOrWhiteSpace(input.CompanyName), it => it.CompanyName.Contains(input.CompanyName) || it.CompanyCode.Contains(input.CompanyName))
|
||||||
|
.WhereIF(!string.IsNullOrWhiteSpace(input.Status), it => it.Status == input.Status)
|
||||||
|
.OrderByIF(!string.IsNullOrWhiteSpace(input.SortField), $"{input.SortField} {input.SortOrder}")
|
||||||
|
.OrderBy(it => it.CreateTime)
|
||||||
|
.ToPagedListAsync(input.PageNum, input.PageSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task<List<ObCompany>> ListEnabled() => Context.Queryable<ObCompany>().Where(it => it.Status == "enable").OrderBy(it => it.CompanyName).ToListAsync();
|
||||||
|
|
||||||
|
public async Task<ObCompany> Detail(BaseIdInput input) => await GetByIdAsync(input.Id) ?? throw Oops.Bah("公司不存在");
|
||||||
|
|
||||||
|
public async Task Add(OnboardingCompanyAddInput input)
|
||||||
|
{
|
||||||
|
await EnsureCodeUnique(input.CompanyCode, 0);
|
||||||
|
await InsertAsync(input.Adapt<ObCompany>());
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task Edit(OnboardingCompanyEditInput input)
|
||||||
|
{
|
||||||
|
await Detail(new BaseIdInput { Id = input.Id });
|
||||||
|
await EnsureCodeUnique(input.CompanyCode, input.Id);
|
||||||
|
await UpdateAsync(input.Adapt<ObCompany>());
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task Delete(BaseIdListInput input)
|
||||||
|
{
|
||||||
|
if (input.Ids.Count == 0) return;
|
||||||
|
if (await Context.Queryable<ObPosition>().AnyAsync(it => input.Ids.Contains(it.CompanyId))) throw Oops.Bah("公司下仍有岗位,不能删除");
|
||||||
|
if (await Context.Queryable<ObOnboardingTask>().AnyAsync(it => input.Ids.Contains(it.CompanyId))) throw Oops.Bah("公司已有入职任务,不能删除");
|
||||||
|
if (await Context.Queryable<ObEmployee>().AnyAsync(it => input.Ids.Contains(it.CompanyId))) throw Oops.Bah("公司已有正式员工,不能删除");
|
||||||
|
await DeleteByIdsAsync(input.Ids.Cast<object>().ToArray());
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task EnsureCodeUnique(string code, long id)
|
||||||
|
{
|
||||||
|
if (await Context.Queryable<ObCompany>().AnyAsync(it => it.CompanyCode == code && it.Id != id)) throw Oops.Bah("公司编码已存在");
|
||||||
|
}
|
||||||
|
}
|
||||||
+27
@@ -0,0 +1,27 @@
|
|||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
public class OnboardingContractScopePageInput : BasePageInput
|
||||||
|
{
|
||||||
|
public long? CompanyId { get; set; }
|
||||||
|
public long? PositionId { get; set; }
|
||||||
|
public long? TemplateId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class OnboardingContractScopeAddInput
|
||||||
|
{
|
||||||
|
[IdNotNull(ErrorMessage = "公司Id不能为空")]
|
||||||
|
public long CompanyId { get; set; }
|
||||||
|
public long? PositionId { get; set; }
|
||||||
|
[IdNotNull(ErrorMessage = "模板Id不能为空")]
|
||||||
|
public long TemplateId { get; set; }
|
||||||
|
[IdNotNull(ErrorMessage = "模板版本Id不能为空")]
|
||||||
|
public long TemplateVersionId { get; set; }
|
||||||
|
public bool Required { get; set; } = true;
|
||||||
|
public int? SortCode { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class OnboardingContractScopeEditInput : OnboardingContractScopeAddInput
|
||||||
|
{
|
||||||
|
[IdNotNull(ErrorMessage = "适用范围Id不能为空")]
|
||||||
|
public long Id { get; set; }
|
||||||
|
}
|
||||||
+26
@@ -0,0 +1,26 @@
|
|||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
public class OnboardingContractTemplatePageInput : BasePageInput
|
||||||
|
{
|
||||||
|
public string TemplateName { get; set; }
|
||||||
|
public string ContractType { get; set; }
|
||||||
|
public string Status { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class OnboardingContractTemplateAddInput
|
||||||
|
{
|
||||||
|
[global::System.ComponentModel.DataAnnotations.Required(ErrorMessage = "模板编码不能为空")]
|
||||||
|
public string TemplateCode { get; set; }
|
||||||
|
[global::System.ComponentModel.DataAnnotations.Required(ErrorMessage = "模板名称不能为空")]
|
||||||
|
public string TemplateName { get; set; }
|
||||||
|
[global::System.ComponentModel.DataAnnotations.Required(ErrorMessage = "合同类型不能为空")]
|
||||||
|
public string ContractType { get; set; }
|
||||||
|
public string Description { get; set; }
|
||||||
|
public string Status { get; set; } = "enable";
|
||||||
|
}
|
||||||
|
|
||||||
|
public class OnboardingContractTemplateEditInput : OnboardingContractTemplateAddInput
|
||||||
|
{
|
||||||
|
[IdNotNull(ErrorMessage = "模板Id不能为空")]
|
||||||
|
public long Id { get; set; }
|
||||||
|
}
|
||||||
+30
@@ -0,0 +1,30 @@
|
|||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
public class OnboardingContractVersionPageInput : BasePageInput
|
||||||
|
{
|
||||||
|
[IdNotNull(ErrorMessage = "模板Id不能为空")]
|
||||||
|
public long TemplateId { get; set; }
|
||||||
|
public string VersionStatus { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class OnboardingContractVersionAddInput
|
||||||
|
{
|
||||||
|
[IdNotNull(ErrorMessage = "模板Id不能为空")]
|
||||||
|
public long TemplateId { get; set; }
|
||||||
|
[global::System.ComponentModel.DataAnnotations.Required(ErrorMessage = "版本号不能为空")]
|
||||||
|
public string VersionNo { get; set; }
|
||||||
|
[IdNotNull(ErrorMessage = "DOCX源文件不能为空")]
|
||||||
|
public long SourceDocxFileId { get; set; }
|
||||||
|
public string FileHash { get; set; }
|
||||||
|
public DateTime? EffectiveDate { get; set; }
|
||||||
|
public DateTime? ExpiryDate { get; set; }
|
||||||
|
public string Remark { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class OnboardingContractVersionStatusInput
|
||||||
|
{
|
||||||
|
[IdNotNull(ErrorMessage = "版本Id不能为空")]
|
||||||
|
public long Id { get; set; }
|
||||||
|
[global::System.ComponentModel.DataAnnotations.Required(ErrorMessage = "版本状态不能为空")]
|
||||||
|
public string VersionStatus { get; set; }
|
||||||
|
}
|
||||||
+35
@@ -0,0 +1,35 @@
|
|||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
public class OnboardingTemplateVariablePageInput : BasePageInput
|
||||||
|
{
|
||||||
|
[IdNotNull(ErrorMessage = "模板版本Id不能为空")]
|
||||||
|
public long TemplateVersionId { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class OnboardingTemplateVariableAddInput
|
||||||
|
{
|
||||||
|
[IdNotNull(ErrorMessage = "模板版本Id不能为空")]
|
||||||
|
public long TemplateVersionId { get; set; }
|
||||||
|
[global::System.ComponentModel.DataAnnotations.Required(ErrorMessage = "变量编码不能为空")]
|
||||||
|
public string VariableCode { get; set; }
|
||||||
|
[global::System.ComponentModel.DataAnnotations.Required(ErrorMessage = "变量名称不能为空")]
|
||||||
|
public string VariableName { get; set; }
|
||||||
|
[global::System.ComponentModel.DataAnnotations.Required(ErrorMessage = "变量类型不能为空")]
|
||||||
|
public string VariableType { get; set; }
|
||||||
|
[global::System.ComponentModel.DataAnnotations.Required(ErrorMessage = "数据类型不能为空")]
|
||||||
|
public string DataType { get; set; }
|
||||||
|
public string EmployeeField { get; set; }
|
||||||
|
public string DefaultValue { get; set; }
|
||||||
|
public string OptionsJson { get; set; }
|
||||||
|
public string FormatRule { get; set; }
|
||||||
|
public bool Required { get; set; }
|
||||||
|
public bool HrEditable { get; set; }
|
||||||
|
public int? SortCode { get; set; }
|
||||||
|
public string Remark { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class OnboardingTemplateVariableEditInput : OnboardingTemplateVariableAddInput
|
||||||
|
{
|
||||||
|
[IdNotNull(ErrorMessage = "变量Id不能为空")]
|
||||||
|
public long Id { get; set; }
|
||||||
|
}
|
||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
public interface IOnboardingContractTemplateService : ITransient
|
||||||
|
{
|
||||||
|
Task<SqlSugarPagedList<ObContractTemplate>> Page(OnboardingContractTemplatePageInput input);
|
||||||
|
Task<ObContractTemplate> Detail(BaseIdInput input);
|
||||||
|
Task Add(OnboardingContractTemplateAddInput input);
|
||||||
|
Task Edit(OnboardingContractTemplateEditInput input);
|
||||||
|
Task Delete(BaseIdListInput input);
|
||||||
|
Task<SqlSugarPagedList<ObContractTemplateVersion>> VersionPage(OnboardingContractVersionPageInput input);
|
||||||
|
Task AddVersion(OnboardingContractVersionAddInput input);
|
||||||
|
Task SetVersionStatus(OnboardingContractVersionStatusInput input);
|
||||||
|
Task<SqlSugarPagedList<ObTemplateVariable>> VariablePage(OnboardingTemplateVariablePageInput input);
|
||||||
|
Task AddVariable(OnboardingTemplateVariableAddInput input);
|
||||||
|
Task EditVariable(OnboardingTemplateVariableEditInput input);
|
||||||
|
Task DeleteVariable(BaseIdListInput input); Task<SqlSugarPagedList<ObContractScope>> ScopePage(OnboardingContractScopePageInput input);
|
||||||
|
Task AddScope(OnboardingContractScopeAddInput input);
|
||||||
|
Task EditScope(OnboardingContractScopeEditInput input);
|
||||||
|
Task DeleteScope(BaseIdListInput input);}
|
||||||
+149
@@ -0,0 +1,149 @@
|
|||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
/// <summary>合同模板主档案;具体 DOCX 文件、变量与适用范围均挂在此档案下。</summary>
|
||||||
|
public class OnboardingContractTemplateService : DbRepository<ObContractTemplate>, IOnboardingContractTemplateService
|
||||||
|
{
|
||||||
|
public async Task<SqlSugarPagedList<ObContractTemplate>> Page(OnboardingContractTemplatePageInput input)
|
||||||
|
{
|
||||||
|
return await Context.Queryable<ObContractTemplate>()
|
||||||
|
.WhereIF(!string.IsNullOrWhiteSpace(input.TemplateName), it => it.TemplateName.Contains(input.TemplateName) || it.TemplateCode.Contains(input.TemplateName))
|
||||||
|
.WhereIF(!string.IsNullOrWhiteSpace(input.ContractType), it => it.ContractType == input.ContractType)
|
||||||
|
.WhereIF(!string.IsNullOrWhiteSpace(input.Status), it => it.Status == input.Status)
|
||||||
|
.OrderByIF(!string.IsNullOrWhiteSpace(input.SortField), $"{input.SortField} {input.SortOrder}")
|
||||||
|
.OrderBy(it => it.TemplateName)
|
||||||
|
.ToPagedListAsync(input.PageNum, input.PageSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<ObContractTemplate> Detail(BaseIdInput input) => await GetByIdAsync(input.Id) ?? throw Oops.Bah("合同模板不存在");
|
||||||
|
|
||||||
|
public async Task Add(OnboardingContractTemplateAddInput input)
|
||||||
|
{
|
||||||
|
await EnsureCodeUnique(input.TemplateCode, 0);
|
||||||
|
await InsertAsync(input.Adapt<ObContractTemplate>());
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task Edit(OnboardingContractTemplateEditInput input)
|
||||||
|
{
|
||||||
|
await Detail(new BaseIdInput { Id = input.Id });
|
||||||
|
await EnsureCodeUnique(input.TemplateCode, input.Id);
|
||||||
|
await UpdateAsync(input.Adapt<ObContractTemplate>());
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task Delete(BaseIdListInput input)
|
||||||
|
{
|
||||||
|
if (input.Ids.Count == 0) return;
|
||||||
|
if (await Context.Queryable<ObContractTemplateVersion>().AnyAsync(it => input.Ids.Contains(it.TemplateId))) throw Oops.Bah("模板已有版本,不能删除");
|
||||||
|
if (await Context.Queryable<ObContractScope>().AnyAsync(it => input.Ids.Contains(it.TemplateId))) throw Oops.Bah("模板已配置适用范围,不能删除");
|
||||||
|
if (await Context.Queryable<ObTaskContract>().AnyAsync(it => input.Ids.Contains(it.TemplateId))) throw Oops.Bah("模板已生成入职合同,不能删除");
|
||||||
|
await DeleteByIdsAsync(input.Ids.Cast<object>().ToArray());
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task EnsureCodeUnique(string code, long id)
|
||||||
|
{
|
||||||
|
if (await Context.Queryable<ObContractTemplate>().AnyAsync(it => it.TemplateCode == code && it.Id != id)) throw Oops.Bah("模板编码已存在");
|
||||||
|
}
|
||||||
|
public async Task<SqlSugarPagedList<ObContractTemplateVersion>> VersionPage(OnboardingContractVersionPageInput input)
|
||||||
|
{
|
||||||
|
return await Context.Queryable<ObContractTemplateVersion>().Where(it => it.TemplateId == input.TemplateId)
|
||||||
|
.WhereIF(!string.IsNullOrWhiteSpace(input.VersionStatus), it => it.VersionStatus == input.VersionStatus)
|
||||||
|
.OrderByDescending(it => it.CreateTime).ToPagedListAsync(input.PageNum, input.PageSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task AddVersion(OnboardingContractVersionAddInput input)
|
||||||
|
{
|
||||||
|
await Detail(new BaseIdInput { Id = input.TemplateId });
|
||||||
|
var file = await Context.Queryable<SysFile>().InSingleAsync(input.SourceDocxFileId) ?? throw Oops.Bah("DOCX源文件不存在");
|
||||||
|
if (!string.Equals(file.Suffix, "docx", StringComparison.OrdinalIgnoreCase)) throw Oops.Bah("合同模板仅支持DOCX文件");
|
||||||
|
if (await Context.Queryable<ObContractTemplateVersion>().AnyAsync(it => it.TemplateId == input.TemplateId && it.VersionNo == input.VersionNo)) throw Oops.Bah("该模板版本号已存在");
|
||||||
|
await Context.Insertable(input.Adapt<ObContractTemplateVersion>()).ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task SetVersionStatus(OnboardingContractVersionStatusInput input)
|
||||||
|
{
|
||||||
|
if (input.VersionStatus != ContractTemplateVersionStatus.Enabled && input.VersionStatus != ContractTemplateVersionStatus.Disabled) throw Oops.Bah("版本状态仅支持启用或停用");
|
||||||
|
var version = await Context.Queryable<ObContractTemplateVersion>().InSingleAsync(input.Id) ?? throw Oops.Bah("模板版本不存在");
|
||||||
|
if (input.VersionStatus == ContractTemplateVersionStatus.Enabled && !await Context.Queryable<ObTemplateVariable>().AnyAsync(it => it.TemplateVersionId == input.Id)) throw Oops.Bah("请先配置模板变量后再启用");
|
||||||
|
version.VersionStatus = input.VersionStatus;
|
||||||
|
await Context.Updateable(version).ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task<SqlSugarPagedList<ObTemplateVariable>> VariablePage(OnboardingTemplateVariablePageInput input)
|
||||||
|
{
|
||||||
|
return await Context.Queryable<ObTemplateVariable>().Where(it => it.TemplateVersionId == input.TemplateVersionId)
|
||||||
|
.OrderBy(it => it.SortCode).OrderBy(it => it.VariableCode).ToPagedListAsync(input.PageNum, input.PageSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task AddVariable(OnboardingTemplateVariableAddInput input)
|
||||||
|
{
|
||||||
|
await EnsureVersionDraft(input.TemplateVersionId);
|
||||||
|
await EnsureVariableUnique(input.TemplateVersionId, input.VariableCode, 0);
|
||||||
|
await Context.Insertable(input.Adapt<ObTemplateVariable>()).ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task EditVariable(OnboardingTemplateVariableEditInput input)
|
||||||
|
{
|
||||||
|
var variable = await Context.Queryable<ObTemplateVariable>().InSingleAsync(input.Id) ?? throw Oops.Bah("模板变量不存在");
|
||||||
|
if (variable.TemplateVersionId != input.TemplateVersionId) throw Oops.Bah("不允许变更变量所属版本");
|
||||||
|
await EnsureVersionDraft(input.TemplateVersionId);
|
||||||
|
await EnsureVariableUnique(input.TemplateVersionId, input.VariableCode, input.Id);
|
||||||
|
await Context.Updateable(input.Adapt<ObTemplateVariable>()).ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task DeleteVariable(BaseIdListInput input)
|
||||||
|
{
|
||||||
|
if (input.Ids.Count == 0) return;
|
||||||
|
var versionIds = await Context.Queryable<ObTemplateVariable>().Where(it => input.Ids.Contains(it.Id)).Select(it => it.TemplateVersionId).ToListAsync();
|
||||||
|
foreach (var versionId in versionIds.Distinct()) await EnsureVersionDraft(versionId);
|
||||||
|
await Context.Deleteable<ObTemplateVariable>().In(input.Ids).ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task EnsureVersionDraft(long versionId)
|
||||||
|
{
|
||||||
|
var version = await Context.Queryable<ObContractTemplateVersion>().InSingleAsync(versionId) ?? throw Oops.Bah("模板版本不存在");
|
||||||
|
if (version.VersionStatus != ContractTemplateVersionStatus.Draft) throw Oops.Bah("只有草稿版本可维护变量");
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task EnsureVariableUnique(long versionId, string code, long id)
|
||||||
|
{
|
||||||
|
if (await Context.Queryable<ObTemplateVariable>().AnyAsync(it => it.TemplateVersionId == versionId && it.VariableCode == code && it.Id != id)) throw Oops.Bah("该版本变量编码已存在");
|
||||||
|
} public async Task<SqlSugarPagedList<ObContractScope>> ScopePage(OnboardingContractScopePageInput input)
|
||||||
|
{
|
||||||
|
return await Context.Queryable<ObContractScope>()
|
||||||
|
.WhereIF(input.CompanyId.HasValue, it => it.CompanyId == input.CompanyId.Value)
|
||||||
|
.WhereIF(input.PositionId.HasValue, it => it.PositionId == input.PositionId.Value)
|
||||||
|
.WhereIF(input.TemplateId.HasValue, it => it.TemplateId == input.TemplateId.Value)
|
||||||
|
.OrderBy(it => it.SortCode).ToPagedListAsync(input.PageNum, input.PageSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task AddScope(OnboardingContractScopeAddInput input)
|
||||||
|
{
|
||||||
|
await EnsureScopeValid(input.CompanyId, input.PositionId, input.TemplateId, input.TemplateVersionId);
|
||||||
|
await EnsureScopeUnique(input.CompanyId, input.PositionId, input.TemplateVersionId, 0);
|
||||||
|
await Context.Insertable(input.Adapt<ObContractScope>()).ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task EditScope(OnboardingContractScopeEditInput input)
|
||||||
|
{
|
||||||
|
if (!await Context.Queryable<ObContractScope>().AnyAsync(it => it.Id == input.Id)) throw Oops.Bah("合同适用范围不存在");
|
||||||
|
await EnsureScopeValid(input.CompanyId, input.PositionId, input.TemplateId, input.TemplateVersionId);
|
||||||
|
await EnsureScopeUnique(input.CompanyId, input.PositionId, input.TemplateVersionId, input.Id);
|
||||||
|
await Context.Updateable(input.Adapt<ObContractScope>()).ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task DeleteScope(BaseIdListInput input)
|
||||||
|
{
|
||||||
|
if (input.Ids.Count > 0) await Context.Deleteable<ObContractScope>().In(input.Ids).ExecuteCommandAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task EnsureScopeValid(long companyId, long? positionId, long templateId, long versionId)
|
||||||
|
{
|
||||||
|
if (!await Context.Queryable<ObCompany>().AnyAsync(it => it.Id == companyId && it.Status == "enable")) throw Oops.Bah("所属公司不存在或未启用");
|
||||||
|
if (positionId.HasValue && !await Context.Queryable<ObPosition>().AnyAsync(it => it.Id == positionId.Value && it.CompanyId == companyId && it.Status == "enable")) throw Oops.Bah("岗位不存在、未启用或不属于该公司");
|
||||||
|
var version = await Context.Queryable<ObContractTemplateVersion>().InSingleAsync(versionId) ?? throw Oops.Bah("合同版本不存在");
|
||||||
|
if (version.TemplateId != templateId || version.VersionStatus != ContractTemplateVersionStatus.Enabled) throw Oops.Bah("只能配置该模板的已启用合同版本");
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task EnsureScopeUnique(long companyId, long? positionId, long versionId, long id)
|
||||||
|
{
|
||||||
|
if (await Context.Queryable<ObContractScope>().AnyAsync(it => it.CompanyId == companyId && it.PositionId == positionId && it.TemplateVersionId == versionId && it.Id != id)) throw Oops.Bah("该公司、岗位和合同版本的适用范围已存在");
|
||||||
|
}}
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
public class OnboardingPositionPageInput : BasePageInput
|
||||||
|
{
|
||||||
|
public long? CompanyId { get; set; }
|
||||||
|
public virtual string PositionName { get; set; }
|
||||||
|
public string Status { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class OnboardingPositionAddInput : ObPosition
|
||||||
|
{
|
||||||
|
[global::System.ComponentModel.DataAnnotations.Required(ErrorMessage = "岗位编码不能为空")]
|
||||||
|
public override string PositionCode { get; set; }
|
||||||
|
|
||||||
|
[global::System.ComponentModel.DataAnnotations.Required(ErrorMessage = "岗位名称不能为空")]
|
||||||
|
public override string PositionName { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class OnboardingPositionEditInput : OnboardingPositionAddInput
|
||||||
|
{
|
||||||
|
[IdNotNull(ErrorMessage = "岗位Id不能为空")]
|
||||||
|
public override long Id { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
public interface IOnboardingPositionService : ITransient
|
||||||
|
{
|
||||||
|
Task<SqlSugarPagedList<ObPosition>> Page(OnboardingPositionPageInput input);
|
||||||
|
Task<List<ObPosition>> ListEnabled(long companyId);
|
||||||
|
Task<ObPosition> Detail(BaseIdInput input);
|
||||||
|
Task Add(OnboardingPositionAddInput input);
|
||||||
|
Task Edit(OnboardingPositionEditInput input);
|
||||||
|
Task Delete(BaseIdListInput input);
|
||||||
|
}
|
||||||
@@ -0,0 +1,52 @@
|
|||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
public class OnboardingPositionService : DbRepository<ObPosition>, IOnboardingPositionService
|
||||||
|
{
|
||||||
|
public async Task<SqlSugarPagedList<ObPosition>> Page(OnboardingPositionPageInput input)
|
||||||
|
{
|
||||||
|
return await Context.Queryable<ObPosition>()
|
||||||
|
.WhereIF(input.CompanyId.HasValue, it => it.CompanyId == input.CompanyId.Value)
|
||||||
|
.WhereIF(!string.IsNullOrWhiteSpace(input.PositionName), it => it.PositionName.Contains(input.PositionName) || it.PositionCode.Contains(input.PositionName))
|
||||||
|
.WhereIF(!string.IsNullOrWhiteSpace(input.Status), it => it.Status == input.Status)
|
||||||
|
.OrderByIF(!string.IsNullOrWhiteSpace(input.SortField), $"{input.SortField} {input.SortOrder}")
|
||||||
|
.OrderBy(it => it.PositionName)
|
||||||
|
.ToPagedListAsync(input.PageNum, input.PageSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Task<List<ObPosition>> ListEnabled(long companyId) => Context.Queryable<ObPosition>().Where(it => it.CompanyId == companyId && it.Status == "enable").OrderBy(it => it.PositionName).ToListAsync();
|
||||||
|
|
||||||
|
public async Task<ObPosition> Detail(BaseIdInput input) => await GetByIdAsync(input.Id) ?? throw Oops.Bah("岗位不存在");
|
||||||
|
|
||||||
|
public async Task Add(OnboardingPositionAddInput input)
|
||||||
|
{
|
||||||
|
await EnsureCompanyExists(input.CompanyId);
|
||||||
|
await EnsureCodeUnique(input.CompanyId, input.PositionCode, 0);
|
||||||
|
await InsertAsync(input.Adapt<ObPosition>());
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task Edit(OnboardingPositionEditInput input)
|
||||||
|
{
|
||||||
|
await Detail(new BaseIdInput { Id = input.Id });
|
||||||
|
await EnsureCompanyExists(input.CompanyId);
|
||||||
|
await EnsureCodeUnique(input.CompanyId, input.PositionCode, input.Id);
|
||||||
|
await UpdateAsync(input.Adapt<ObPosition>());
|
||||||
|
}
|
||||||
|
|
||||||
|
public async Task Delete(BaseIdListInput input)
|
||||||
|
{
|
||||||
|
if (input.Ids.Count == 0) return;
|
||||||
|
if (await Context.Queryable<ObOnboardingTask>().AnyAsync(it => input.Ids.Contains(it.PositionId))) throw Oops.Bah("岗位已有入职任务,不能删除");
|
||||||
|
if (await Context.Queryable<ObEmployee>().AnyAsync(it => input.Ids.Contains(it.PositionId))) throw Oops.Bah("岗位已有正式员工,不能删除");
|
||||||
|
await DeleteByIdsAsync(input.Ids.Cast<object>().ToArray());
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task EnsureCompanyExists(long companyId)
|
||||||
|
{
|
||||||
|
if (!await Context.Queryable<ObCompany>().AnyAsync(it => it.Id == companyId)) throw Oops.Bah("所属公司不存在或已删除");
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task EnsureCodeUnique(long companyId, string code, long id)
|
||||||
|
{
|
||||||
|
if (await Context.Queryable<ObPosition>().AnyAsync(it => it.CompanyId == companyId && it.PositionCode == code && it.Id != id)) throw Oops.Bah("该公司下岗位编码已存在");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
public class OnboardingTaskCreateInput
|
||||||
|
{
|
||||||
|
[IdNotNull(ErrorMessage = "公司Id不能为空")]
|
||||||
|
public long CompanyId { get; set; }
|
||||||
|
[IdNotNull(ErrorMessage = "岗位Id不能为空")]
|
||||||
|
public long PositionId { get; set; }
|
||||||
|
public long? AssignedReviewerUserId { get; set; }
|
||||||
|
public DateTime? LinkExpireAt { get; set; }
|
||||||
|
public string Remark { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class OnboardingTaskCreatedOutput
|
||||||
|
{
|
||||||
|
public long TaskId { get; set; }
|
||||||
|
public string TaskNo { get; set; }
|
||||||
|
public string LinkToken { get; set; }
|
||||||
|
public DateTime ExpiresAt { get; set; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
public class OnboardingTaskPublicAccessInput { [global::System.ComponentModel.DataAnnotations.Required] public string Token { get; set; } }
|
||||||
|
public class OnboardingTaskPublicSaveInput : ObTaskEmployeeInfo
|
||||||
|
{
|
||||||
|
[global::System.ComponentModel.DataAnnotations.Required] public string Token { get; set; }
|
||||||
|
[global::System.ComponentModel.DataAnnotations.Required] public new string EmployeeName { get; set; }
|
||||||
|
[global::System.ComponentModel.DataAnnotations.Required] public new string Phone { get; set; }
|
||||||
|
[global::System.ComponentModel.DataAnnotations.Required] public new string IdCardNumber { get; set; }
|
||||||
|
}
|
||||||
|
public class OnboardingTaskPublicDetailOutput { public ObOnboardingTask Task { get; set; } public ObTaskEmployeeInfo EmployeeInfo { get; set; } public List<ObTaskContract> Contracts { get; set; } }
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
public interface IOnboardingTaskService : ITransient
|
||||||
|
{
|
||||||
|
Task<OnboardingTaskCreatedOutput> Create(OnboardingTaskCreateInput input);
|
||||||
|
}
|
||||||
@@ -0,0 +1,34 @@
|
|||||||
|
namespace SimpleAdmin.Application;
|
||||||
|
|
||||||
|
public class OnboardingTaskService : IOnboardingTaskService
|
||||||
|
{
|
||||||
|
private readonly ISqlSugarClient _db;
|
||||||
|
private readonly IConfigService _configService;
|
||||||
|
public OnboardingTaskService(ISqlSugarClient db, IConfigService configService) { _db = db; _configService = configService; }
|
||||||
|
|
||||||
|
public async Task<OnboardingTaskCreatedOutput> Create(OnboardingTaskCreateInput input)
|
||||||
|
{
|
||||||
|
if (!await _db.Queryable<ObCompany>().AnyAsync(it => it.Id == input.CompanyId && it.Status == "enable")) throw Oops.Bah("公司不存在或未启用");
|
||||||
|
if (!await _db.Queryable<ObPosition>().AnyAsync(it => it.Id == input.PositionId && it.CompanyId == input.CompanyId && it.Status == "enable")) throw Oops.Bah("岗位不存在、未启用或不属于该公司");
|
||||||
|
var scopes = await _db.Queryable<ObContractScope>().Where(it => it.CompanyId == input.CompanyId && (it.PositionId == null || it.PositionId == input.PositionId)).ToListAsync();
|
||||||
|
if (scopes.Count == 0) throw Oops.Bah("该公司和岗位尚未配置合同适用范围");
|
||||||
|
var taskId = global::SimpleAdmin.Core.Utils.CommonUtils.GetSingleId();
|
||||||
|
var expiryConfig = await _configService.GetByConfigKey(CateGoryConst.CONFIG_BIZ_DEFINE, "onboard.link.expireHours");
|
||||||
|
if (expiryConfig == null || !int.TryParse(expiryConfig.ConfigValue, out var expiryHours) || expiryHours <= 0) throw Oops.Bah("请在系统配置中设置 onboard.link.expireHours(正整数小时)");
|
||||||
|
var expiresAt = DateTime.Now.AddHours(expiryHours);
|
||||||
|
var token = Guid.NewGuid().ToString("N");
|
||||||
|
var task = new ObOnboardingTask { Id = taskId, TaskNo = $"OB{DateTime.Now:yyyyMMddHHmmss}{taskId.ToString()[^4..]}", CompanyId = input.CompanyId, PositionId = input.PositionId, AssignedReviewerUserId = input.AssignedReviewerUserId, LinkExpireAt = expiresAt, TaskStatus = OnboardingTaskStatus.PendingFill, Remark = input.Remark };
|
||||||
|
await _db.Ado.BeginTranAsync();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
await _db.Insertable(task).ExecuteCommandAsync();
|
||||||
|
await _db.Insertable(new ObTaskLink { Id = global::SimpleAdmin.Core.Utils.CommonUtils.GetSingleId(), TaskId = taskId, TokenHash = Convert.ToHexString(global::System.Security.Cryptography.SHA256.HashData(global::System.Text.Encoding.UTF8.GetBytes(token))), ExpiresAt = expiresAt }).ExecuteCommandAsync();
|
||||||
|
var templateIds = scopes.Select(it => it.TemplateId).Distinct().ToList();
|
||||||
|
var templates = await _db.Queryable<ObContractTemplate>().Where(it => templateIds.Contains(it.Id)).ToListAsync();
|
||||||
|
await _db.Insertable(scopes.Select(it => new ObTaskContract { Id = global::SimpleAdmin.Core.Utils.CommonUtils.GetSingleId(), TaskId = taskId, TemplateId = it.TemplateId, TemplateVersionId = it.TemplateVersionId, ContractName = templates.First(x => x.Id == it.TemplateId).TemplateName, ContractType = templates.First(x => x.Id == it.TemplateId).ContractType, Required = it.Required }).ToList()).ExecuteCommandAsync();
|
||||||
|
await _db.Ado.CommitTranAsync();
|
||||||
|
}
|
||||||
|
catch { await _db.Ado.RollbackTranAsync(); throw; }
|
||||||
|
return new OnboardingTaskCreatedOutput { TaskId = taskId, TaskNo = task.TaskNo, LinkToken = token, ExpiresAt = expiresAt };
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -54,11 +54,54 @@
|
|||||||
排序码
|
排序码
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:SimpleAdmin.Application.OnboardingTaskStatus">
|
||||||
|
<summary>
|
||||||
|
入职任务状态。
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="T:SimpleAdmin.Application.OnboardingLinkStatus">
|
||||||
|
<summary>
|
||||||
|
入职链接状态。
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="T:SimpleAdmin.Application.ContractTemplateVersionStatus">
|
||||||
|
<summary>
|
||||||
|
合同模板版本状态。
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="T:SimpleAdmin.Application.TaskContractStatus">
|
||||||
|
<summary>
|
||||||
|
入职任务合同状态。
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="T:SimpleAdmin.Application.ContractVariableType">
|
||||||
|
<summary>
|
||||||
|
合同变量类型。
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="T:SimpleAdmin.Application.ContractVariableSourceType">
|
||||||
|
<summary>
|
||||||
|
合同变量最终值来源。
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="T:SimpleAdmin.Application.TaskMaterialReviewStatus">
|
||||||
|
<summary>
|
||||||
|
入职资料审核状态。
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
|
<member name="T:SimpleAdmin.Application.OnboardingAuditAction">
|
||||||
|
<summary>
|
||||||
|
入职审核动作。
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="T:SimpleAdmin.Application.ApplicationSettingsOptions">
|
<member name="T:SimpleAdmin.Application.ApplicationSettingsOptions">
|
||||||
<summary>
|
<summary>
|
||||||
系统配置
|
系统配置
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="T:SimpleAdmin.Application.OnboardingContractTemplateService">
|
||||||
|
<summary>合同模板主档案;具体 DOCX 文件、变量与适用范围均挂在此档案下。</summary>
|
||||||
|
</member>
|
||||||
<member name="T:SimpleAdmin.Application.IOrgService">
|
<member name="T:SimpleAdmin.Application.IOrgService">
|
||||||
<summary>
|
<summary>
|
||||||
机构服务
|
机构服务
|
||||||
|
|||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
namespace SimpleAdmin.Web.Core;
|
||||||
|
|
||||||
|
[ApiDescriptionSettings("Application", Tag = "入职公司管理")]
|
||||||
|
[Route("biz/onboarding/company")]
|
||||||
|
[RolePermission]
|
||||||
|
public class OnboardingCompanyController
|
||||||
|
{
|
||||||
|
private readonly IOnboardingCompanyService _service;
|
||||||
|
public OnboardingCompanyController(IOnboardingCompanyService service) => _service = service;
|
||||||
|
|
||||||
|
[HttpGet("page")] public async Task<dynamic> Page([FromQuery] OnboardingCompanyPageInput input) => await _service.Page(input);
|
||||||
|
[HttpGet("list-enabled")] public async Task<dynamic> ListEnabled() => await _service.ListEnabled();
|
||||||
|
[HttpGet("detail")] public async Task<dynamic> Detail([FromQuery] BaseIdInput input) => await _service.Detail(input);
|
||||||
|
[HttpPost("add")] public async Task Add([FromBody] OnboardingCompanyAddInput input) => await _service.Add(input);
|
||||||
|
[HttpPost("edit")] public async Task Edit([FromBody] OnboardingCompanyEditInput input) => await _service.Edit(input);
|
||||||
|
[HttpPost("delete")] public async Task Delete([FromBody] BaseIdListInput input) => await _service.Delete(input);
|
||||||
|
}
|
||||||
+25
@@ -0,0 +1,25 @@
|
|||||||
|
namespace SimpleAdmin.Web.Core;
|
||||||
|
|
||||||
|
[ApiDescriptionSettings("Application", Tag = "入职合同模板")]
|
||||||
|
[Route("biz/onboarding/contract-template")]
|
||||||
|
[RolePermission]
|
||||||
|
public class OnboardingContractTemplateController
|
||||||
|
{
|
||||||
|
private readonly IOnboardingContractTemplateService _service;
|
||||||
|
public OnboardingContractTemplateController(IOnboardingContractTemplateService service) => _service = service;
|
||||||
|
|
||||||
|
[HttpGet("page")] public async Task<dynamic> Page([FromQuery] OnboardingContractTemplatePageInput input) => await _service.Page(input);
|
||||||
|
[HttpGet("detail")] public async Task<dynamic> Detail([FromQuery] BaseIdInput input) => await _service.Detail(input);
|
||||||
|
[HttpPost("add")] public async Task Add([FromBody] OnboardingContractTemplateAddInput input) => await _service.Add(input);
|
||||||
|
[HttpPost("edit")] public async Task Edit([FromBody] OnboardingContractTemplateEditInput input) => await _service.Edit(input);
|
||||||
|
[HttpPost("delete")] public async Task Delete([FromBody] BaseIdListInput input) => await _service.Delete(input);
|
||||||
|
[HttpGet("version/page")] public async Task<dynamic> VersionPage([FromQuery] OnboardingContractVersionPageInput input) => await _service.VersionPage(input);
|
||||||
|
[HttpPost("version/add")] public async Task AddVersion([FromBody] OnboardingContractVersionAddInput input) => await _service.AddVersion(input);
|
||||||
|
[HttpPost("version/set-status")] public async Task SetVersionStatus([FromBody] OnboardingContractVersionStatusInput input) => await _service.SetVersionStatus(input);
|
||||||
|
[HttpGet("variable/page")] public async Task<dynamic> VariablePage([FromQuery] OnboardingTemplateVariablePageInput input) => await _service.VariablePage(input);
|
||||||
|
[HttpPost("variable/add")] public async Task AddVariable([FromBody] OnboardingTemplateVariableAddInput input) => await _service.AddVariable(input);
|
||||||
|
[HttpPost("variable/edit")] public async Task EditVariable([FromBody] OnboardingTemplateVariableEditInput input) => await _service.EditVariable(input);
|
||||||
|
[HttpPost("variable/delete")] public async Task DeleteVariable([FromBody] BaseIdListInput input) => await _service.DeleteVariable(input); [HttpGet("scope/page")] public async Task<dynamic> ScopePage([FromQuery] OnboardingContractScopePageInput input) => await _service.ScopePage(input);
|
||||||
|
[HttpPost("scope/add")] public async Task AddScope([FromBody] OnboardingContractScopeAddInput input) => await _service.AddScope(input);
|
||||||
|
[HttpPost("scope/edit")] public async Task EditScope([FromBody] OnboardingContractScopeEditInput input) => await _service.EditScope(input);
|
||||||
|
[HttpPost("scope/delete")] public async Task DeleteScope([FromBody] BaseIdListInput input) => await _service.DeleteScope(input);}
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
namespace SimpleAdmin.Web.Core;
|
||||||
|
|
||||||
|
[ApiDescriptionSettings("Application", Tag = "入职岗位管理")]
|
||||||
|
[Route("biz/onboarding/position")]
|
||||||
|
[RolePermission]
|
||||||
|
public class OnboardingPositionController
|
||||||
|
{
|
||||||
|
private readonly IOnboardingPositionService _service;
|
||||||
|
public OnboardingPositionController(IOnboardingPositionService service) => _service = service;
|
||||||
|
|
||||||
|
[HttpGet("page")] public async Task<dynamic> Page([FromQuery] OnboardingPositionPageInput input) => await _service.Page(input);
|
||||||
|
[HttpGet("list-enabled")] public async Task<dynamic> ListEnabled([FromQuery] long companyId) => await _service.ListEnabled(companyId);
|
||||||
|
[HttpGet("detail")] public async Task<dynamic> Detail([FromQuery] BaseIdInput input) => await _service.Detail(input);
|
||||||
|
[HttpPost("add")] public async Task Add([FromBody] OnboardingPositionAddInput input) => await _service.Add(input);
|
||||||
|
[HttpPost("edit")] public async Task Edit([FromBody] OnboardingPositionEditInput input) => await _service.Edit(input);
|
||||||
|
[HttpPost("delete")] public async Task Delete([FromBody] BaseIdListInput input) => await _service.Delete(input);
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
namespace SimpleAdmin.Web.Core;
|
||||||
|
|
||||||
|
[ApiDescriptionSettings("Application", Tag = "入职任务")]
|
||||||
|
[Route("biz/onboarding/task")]
|
||||||
|
[RolePermission]
|
||||||
|
public class OnboardingTaskController
|
||||||
|
{
|
||||||
|
private readonly IOnboardingTaskService _service;
|
||||||
|
public OnboardingTaskController(IOnboardingTaskService service) => _service = service;
|
||||||
|
[HttpPost("create")] public async Task<dynamic> Create([FromBody] OnboardingTaskCreateInput input) => await _service.Create(input);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user