diff --git a/src/Token.ManagementApi.Host/.dockerignore b/.dockerignore similarity index 90% rename from src/Token.ManagementApi.Host/.dockerignore rename to .dockerignore index cd967fc3a29985bd1e9bcc194d6d804d35689a5c..3729ff0cd1acce411e814ec416b82ac0f239a4e0 100644 --- a/src/Token.ManagementApi.Host/.dockerignore +++ b/.dockerignore @@ -1,4 +1,5 @@ -**/.dockerignore +**/.classpath +**/.dockerignore **/.env **/.git **/.gitignore @@ -7,7 +8,6 @@ **/.toolstarget **/.vs **/.vscode -**/.idea **/*.*proj.user **/*.dbmdl **/*.jfm diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000000000000000000000000000000000000..5c14a11128513df3eb6da9719c45e7bfdf759622 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,44 @@ +kind: pipeline +name: managementapi +type: docker + +platform: + os: linux + arch: amd64 + +steps: + - name: managementapi + when: + branch: + - master + image: docker:dind + environment: + IMAGE: managementapi + ASPNETCORE_ENVIRONMENT: Development + volumes: + - name: dockersock + path: /var/run/docker.sock + commands: + - docker build -f ./src/Token.ManagementApi.Host/Dockerfile -t managementapi . + + - name: managementapi-push + image: docker:dind + when: + branch: + - master + environment: + IMAGE: managementapi + ASPNETCORE_ENVIRONMENT: Development + volumes: + - name: dockersock + path: /var/run/docker.sock + - name: logs + path: /root/logs/managementapi/logs:/app/logs + commands: + - docker stop managementapi && docker rm managementapi + - docker run -d -network token --name managementapi adminapi:latest + +volumes: + - name: dockersock + host: + path: /var/run/docker.sock diff --git a/.vs/Management/DesignTimeBuild/.dtbcache.v2 b/.vs/Management/DesignTimeBuild/.dtbcache.v2 index 3b689f307ad848a3babf1d0f2a1aedc37151ffeb..fbb48ef7a0165b2066b675771082ce5f898651ab 100644 Binary files a/.vs/Management/DesignTimeBuild/.dtbcache.v2 and b/.vs/Management/DesignTimeBuild/.dtbcache.v2 differ diff --git a/.vs/Management/v17/.futdcache.v1 b/.vs/Management/v17/.futdcache.v1 index 03d87e85c9b5081e87aa4e06e6ba77c9c9acc892..cecc0b59d924791d3d895e3ecfad543829069267 100644 Binary files a/.vs/Management/v17/.futdcache.v1 and b/.vs/Management/v17/.futdcache.v1 differ diff --git a/.vs/Management/v17/.suo b/.vs/Management/v17/.suo index aed85fd0498862fa55d5aea4fde3d66cd25b33aa..c731485e2bc27d33129e9743084869ff6114e55b 100644 Binary files a/.vs/Management/v17/.suo and b/.vs/Management/v17/.suo differ diff --git a/.vs/ProjectEvaluation/management.metadata.v2 b/.vs/ProjectEvaluation/management.metadata.v2 index 01eb341077a8b052d8e8a5d76ad3711013175ea0..25c7647039923b1ae8b465f02297add73736b95a 100644 Binary files a/.vs/ProjectEvaluation/management.metadata.v2 and b/.vs/ProjectEvaluation/management.metadata.v2 differ diff --git a/.vs/ProjectEvaluation/management.projects.v2 b/.vs/ProjectEvaluation/management.projects.v2 index 1b9059b220c941c523efa8ce48d2063f02fedfce..a6b3f4a82a4f8eebb4e5143551d358a319a999af 100644 Binary files a/.vs/ProjectEvaluation/management.projects.v2 and b/.vs/ProjectEvaluation/management.projects.v2 differ diff --git a/src/Token.HttpApi/IPrincipalAccessor.cs b/src/Token.HttpApi/IPrincipalAccessor.cs index 9905baa52ee45c191929e51573121babe6a3d89e..b4fdfb5586ac95a602ea766f8fca1ef5b172376a 100644 --- a/src/Token.HttpApi/IPrincipalAccessor.cs +++ b/src/Token.HttpApi/IPrincipalAccessor.cs @@ -8,7 +8,7 @@ public interface IPrincipalAccessor string Name { get; } Guid ID { get; } - string GetUser(string token); + UserInfo GetUser(string token); bool? IsAuthenticated(); @@ -26,6 +26,12 @@ public interface IPrincipalAccessor /// T GetUserInfo(); + /// + /// 获取权限列表 + /// + /// + List GetRoleIds(); + List GetUserInfoFromToken(string claimType); /// @@ -34,5 +40,5 @@ public interface IPrincipalAccessor /// Guid UserId(); - Task CreateTokenAsync(T userInfo); + Task CreateTokenAsync(UserInfo userInfo); } diff --git a/src/Token.HttpApi/PrincipalAccessor.cs b/src/Token.HttpApi/PrincipalAccessor.cs index 80e3f92447b1e8301bca52e961e6c8e87b57d71a..2d7b646abb695a62da03960d76793fc674b20036 100644 --- a/src/Token.HttpApi/PrincipalAccessor.cs +++ b/src/Token.HttpApi/PrincipalAccessor.cs @@ -7,6 +7,7 @@ using Microsoft.IdentityModel.Tokens; using Newtonsoft.Json; using Token.HttpApi.Module; using Token.Management.Domain; +using Token.Management.Domain.Management.AccessFunction; using Token.Management.Domain.Users; using Volo.Abp.DependencyInjection; @@ -42,7 +43,9 @@ public class PrincipalAccessor : IPrincipalAccessor, ITransientDependency public IEnumerable GetClaimsIdentity() { - return _contextAccessor.HttpContext.User.Claims; + var token = GetToken(); + JwtSecurityTokenHandler securityTokenHandler = new(); + return securityTokenHandler.ReadJwtToken(token).Claims; } public List GetClaimValueByType(string claimType) @@ -50,6 +53,15 @@ public class PrincipalAccessor : IPrincipalAccessor, ITransientDependency return GetClaimsIdentity().Where(item => item.Type == claimType).Select(item => item.Value).ToList(); } + public List GetRoleIds() + { + var roleIds = GetClaimValueByType(Constants.Role).FirstOrDefault(); + if (roleIds.IsNullOrEmpty()) + throw new BusinessException(401, "账号未授权"); + + return JsonConvert.DeserializeObject>(roleIds); + } + public List GetUserInfoFromToken(string claimType) { JwtSecurityTokenHandler securityTokenHandler = new(); @@ -60,13 +72,15 @@ public class PrincipalAccessor : IPrincipalAccessor, ITransientDependency : new List(); } - public string GetUser(string token) + public UserInfo GetUser(string token) { JwtSecurityTokenHandler securityTokenHandler = new(); - return securityTokenHandler.ReadJwtToken(token).Claims.Where(item => item.Type == Constants.User) - .Select(item => item.Value).FirstOrDefault() ?? ""; + var userInfoStr= securityTokenHandler.ReadJwtToken(token).Claims.Where(item => item.Type == Constants.User) + .Select(item => item.Value).FirstOrDefault(); + return JsonConvert.DeserializeObject(userInfoStr); } + public string GetTenantId() { HttpContext? httpContext = _contextAccessor.HttpContext; @@ -93,16 +107,20 @@ public class PrincipalAccessor : IPrincipalAccessor, ITransientDependency return JsonConvert.DeserializeObject(result); } - public Task CreateTokenAsync(T userInfo) + public Task CreateTokenAsync(UserInfo userInfo) { - var user = userInfo as UserInfo; // 添加一些需要的键值对 - Claim[] claims = { new Claim(Constants.User, JsonConvert.SerializeObject(userInfo)) }; - if (user != null) + List claims = new List() { - claims.AddFirst(new Claim(Constants.Role,JsonConvert.SerializeObject(user.UserRoleFunction.Select(x=>x.RoleId)))); - } + new Claim(Constants.Department,JsonConvert.SerializeObject(userInfo?.UserDepartmentFunction.Select(x=>x.DepartmentId))), + new Claim(Constants.Role,JsonConvert.SerializeObject(userInfo?.UserRoleFunction.Select(x=>x.RoleId))) + }; + + userInfo.UserRoleFunction.Clear();; + userInfo.UserDepartmentFunction.Clear(); + + claims.AddFirst(new Claim(Constants.User, JsonConvert.SerializeObject(userInfo))); byte[] keyBytes = Encoding.UTF8.GetBytes(_tokenOptions.SecretKey!); SigningCredentials cred = new(new SymmetricSecurityKey(keyBytes), diff --git a/src/Token.HttpApi/Token.HttpApi.csproj b/src/Token.HttpApi/Token.HttpApi.csproj index 2eb3a53c3b1b09252dfb8de59c95b665ca1277c1..53946878f41c8326bcc4a561af4cff0e80ce2a18 100644 --- a/src/Token.HttpApi/Token.HttpApi.csproj +++ b/src/Token.HttpApi/Token.HttpApi.csproj @@ -10,10 +10,10 @@ - + - - + + diff --git a/src/Token.HttpApi/TokenHttpApiModule.cs b/src/Token.HttpApi/TokenHttpApiModule.cs index e7c4a510a3fbe61ead9eea17a7e61bed732d11d7..9170a5009dbf1c461e626c1745bde3b474bff852 100644 --- a/src/Token.HttpApi/TokenHttpApiModule.cs +++ b/src/Token.HttpApi/TokenHttpApiModule.cs @@ -165,5 +165,6 @@ public class TokenHttpApiModule : AbpModule app.UseAuthentication(); app.UseAuthorization(); + } } diff --git a/src/Token.Infrastructure/Extension/DESHelper.cs b/src/Token.Infrastructure/Extension/DESHelper.cs new file mode 100644 index 0000000000000000000000000000000000000000..9acf9024f4f777e73388613ea098aba75aae3f78 --- /dev/null +++ b/src/Token.Infrastructure/Extension/DESHelper.cs @@ -0,0 +1,59 @@ +using System.Security.Cryptography; +using System.Text; +using Volo.Abp.DependencyInjection; + +namespace Token.Infrastructure.Extension; + +public class DESHelper:ISingletonDependency +{ + private const string Key = "TOKENKEY"; + + /// + /// DES加密 + /// + /// + /// + public string DESEncrypt(string value) + { + DESCryptoServiceProvider des = new(); + var inputByteArray = Encoding.Default.GetBytes(value); + des.Key = Encoding.ASCII.GetBytes(Key); + des.IV = Encoding.ASCII.GetBytes(Key); + var ms = new MemoryStream(); + var cs = new CryptoStream(ms, des.CreateEncryptor(), CryptoStreamMode.Write); + cs.Write(inputByteArray, 0, inputByteArray.Length); + cs.FlushFinalBlock(); + var ret = new StringBuilder(); + foreach (var b in ms.ToArray()) + { + ret.AppendFormat("{0:X2}", b); + } + ret.ToString(); + return ret.ToString(); + + } + + /// + /// 解密 + /// + /// + /// + public string DESDecrypt(string value) + { + DESCryptoServiceProvider des = new(); + var inputByteArray = new byte[value.Length / 2]; + for (var x = 0; x < value.Length / 2; x++) + { + var i = Convert.ToInt32(value.Substring(x * 2, 2), 16); + inputByteArray[x] = (byte)i; + } + des.Key = Encoding.ASCII.GetBytes(Key); + des.IV = Encoding.ASCII.GetBytes(Key); + var ms = new MemoryStream(); + var cs = new CryptoStream(ms, des.CreateDecryptor(), CryptoStreamMode.Write); + cs.Write(inputByteArray, 0, inputByteArray.Length); + cs.FlushFinalBlock(); + return Encoding.Default.GetString(ms.ToArray()); + } + +} diff --git a/src/Token.Infrastructure/TokenInfrastructureModule.cs b/src/Token.Infrastructure/TokenInfrastructureModule.cs new file mode 100644 index 0000000000000000000000000000000000000000..c16161b2a99e723a8780e32935d247b486da6cf1 --- /dev/null +++ b/src/Token.Infrastructure/TokenInfrastructureModule.cs @@ -0,0 +1,8 @@ +using Volo.Abp.Modularity; + +namespace Token.Infrastructure; + +public class TokenInfrastructureModule:AbpModule +{ + +} diff --git a/src/Token.Management.Application.Contracts/AppServices/Management/IRoleService.cs b/src/Token.Management.Application.Contracts/AppServices/Management/IRoleService.cs index 421b3ac0046d8bb06599ee5b9d40406ce082f6a2..861dc8918b329376f3e3ed28143cfa61155b9c91 100644 --- a/src/Token.Management.Application.Contracts/AppServices/Management/IRoleService.cs +++ b/src/Token.Management.Application.Contracts/AppServices/Management/IRoleService.cs @@ -3,6 +3,7 @@ using Token.Management.Application.Contracts.Module.Management; using Token.Management.Application.Contracts.Module.Users; using Token.Management.Domain.Management; using Token.Management.Domain.Management.AccessFunction; +using Token.Management.Domain.Users; namespace Management.Application.Services.Management; @@ -25,7 +26,7 @@ public interface IRoleService Task> RecursionUserMenu(List roles, List menuIds, Guid parentId); /// - /// 获取角色分页数据 + /// 获取角色分页数据 /// /// /// diff --git a/src/Token.Management.Application.Contracts/AppServices/Users/IUserInfoService.cs b/src/Token.Management.Application.Contracts/AppServices/Users/IUserInfoService.cs index 42eaf5d32f6ccbbef0f297734b66b61747eef56e..c59e11408ba8055574cadc390eeffda9b55fe94b 100644 --- a/src/Token.Management.Application.Contracts/AppServices/Users/IUserInfoService.cs +++ b/src/Token.Management.Application.Contracts/AppServices/Users/IUserInfoService.cs @@ -1,4 +1,5 @@ -using Token.Management.Application.Contracts.Module.Management; +using Token.Management.Application.Contracts.Module; +using Token.Management.Application.Contracts.Module.Management; using Token.Management.Application.Contracts.Module.Users; namespace Token.Management.Application.Contracts.AppServices.Users; @@ -13,14 +14,14 @@ public interface IUserInfoService /// /// /// - Task GetUserInfo(LoginInput input); + Task<(UserInfoDto, string)> GetUserInfo(LoginInput input); /// - /// 用户分页数据 + /// 用户分页数据 /// + /// /// - Task, int>> GetUserInfoPaging(string? code, DateTime? startTime, DateTime? endTime, - sbyte statue = -1, int pageNo = 1, int pageSize = 20); + Task, int>> GetUserInfoPaging(UserInfoPagingInput input); /// /// 获取账号下所有部门 diff --git a/src/Token.Management.Application.Contracts/AppServices/Users/UserInfoPagingInput.cs b/src/Token.Management.Application.Contracts/AppServices/Users/UserInfoPagingInput.cs new file mode 100644 index 0000000000000000000000000000000000000000..8f3106d1b0ad9fdfc42ec9800b7c103b264f981f --- /dev/null +++ b/src/Token.Management.Application.Contracts/AppServices/Users/UserInfoPagingInput.cs @@ -0,0 +1,14 @@ +using Token.Management.Application.Contracts.Module; + +namespace Token.Management.Application.Contracts.AppServices.Users; + +/// +/// 获取用户列表input +/// +public class UserInfoPagingInput:PageInput +{ + /// + /// 状态 + /// + public sbyte? Status { get; set; } +} diff --git a/src/Token.Management.Application.Contracts/AppServices/WorkContent/IWorkDemoMainService.cs b/src/Token.Management.Application.Contracts/AppServices/WorkContent/IWorkDemoMainService.cs new file mode 100644 index 0000000000000000000000000000000000000000..741f34e7a42c25cda49e01057e14c1eb779e54c6 --- /dev/null +++ b/src/Token.Management.Application.Contracts/AppServices/WorkContent/IWorkDemoMainService.cs @@ -0,0 +1,25 @@ +namespace Token.Management.Application.Contracts.AppServices.WorkContent; + +/// +/// WorkDemo实例 +/// +public interface IWorkDemoMainService +{ + /// + /// 创建一个Demo + /// + /// + /// + Task CreateWorkDemoMainAsync(WorkDemoMainDto dto); + + /// + /// 获取Demo列表 + /// + /// + /// + /// + /// + /// + /// + Task<(List, int)> GetWorkDemoListAsync(DateTime? startTime,DateTime? endTime,string keyword,int pageNo,int pageSize); +} diff --git a/src/Token.Management.Application.Contracts/AppServices/WorkContent/WorkContentDemoDto.cs b/src/Token.Management.Application.Contracts/AppServices/WorkContent/WorkContentDemoDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..9d066bf2e65b31314b11f29a0e87b2f7b3af5ac9 --- /dev/null +++ b/src/Token.Management.Application.Contracts/AppServices/WorkContent/WorkContentDemoDto.cs @@ -0,0 +1,56 @@ +using Token.Management.Application.Contracts.Module.Users; +using Token.Management.Domain.Shared; + +namespace Token.Management.Application.Contracts.AppServices.WorkContent; + +/// +/// WorkContent +/// +public class WorkContentDemoDto +{ + /// + /// Id + /// + public Guid Id { get; set; } + + /// + /// 表单工作流状态 + /// + public WorkFlowNodeStatusEnum WorkFlowNodeStatus { get; set; } + + /// + /// 表单工作流状态 + /// + public string WorkFlowNodeStatusName { get; set; } + + /// + /// 实例id + /// + public Guid? WorkflowInstanceId { get; set; } + + /// + /// 提交时间 + /// + public DateTime? SubmitTime { get; set; } + + /// + /// 子项目名称 + /// + public string? Name { get; set; } + + /// + /// 子项目内容 + /// + public string? Content { get; set; } + + /// + /// 项目负责人 + /// + public Guid PrincipalId { get; set; } + + public Guid WorkDemoMainId { get; set; } + + public virtual UserInfoDto Principal { get; set; } + + public virtual WorkDemoMainDto WorkDemoMain { get; set; } +} diff --git a/src/Token.Management.Application.Contracts/AppServices/WorkContent/WorkDemoMainDto.cs b/src/Token.Management.Application.Contracts/AppServices/WorkContent/WorkDemoMainDto.cs new file mode 100644 index 0000000000000000000000000000000000000000..929cbcd4bdc7634e325b28e2af83ec2ce26884ce --- /dev/null +++ b/src/Token.Management.Application.Contracts/AppServices/WorkContent/WorkDemoMainDto.cs @@ -0,0 +1,53 @@ +using Token.Management.Domain.Shared; + +namespace Token.Management.Application.Contracts.AppServices.WorkContent; + +/// +/// WorkDemo +/// +public class WorkDemoMainDto +{ + /// + /// Id + /// + public Guid Id { get; set; } + + /// + /// 工作流Dmeo名称 + /// + public string? Name { get; set; } + + /// + /// 工作流Demo备注 + /// + public string? Remark { get; set; } + + /// + /// 工作流Demo内容 + /// + public string? Content { get; set; } + + /// + /// 表单工作流状态 + /// + public WorkFlowNodeStatusEnum WorkFlowNodeStatus { get; set; } + + /// + /// 表单工作流状态 + /// + public string WorkFlowNodeStatusName { get; set; } + + /// + /// 项目开始时间 + /// + public DateTime? StartTime { get; set; } + + /// + /// 项目结束时间 + /// + public DateTime? EndTime { get; set; } + + public bool IsDeleted { get; set; } + + public List WorkContentDemo { get; set; } = new List(); +} diff --git a/src/Token.Management.Application.Contracts/AppServices/WorkFlow/IWorkflowTemplateService.cs b/src/Token.Management.Application.Contracts/AppServices/WorkFlow/IWorkflowTemplateService.cs index a9e62b87fc667966962e8d5ea3b2080c6a2ceb81..461f3c651da702bf8940285d23cc3cb6b28e3994 100644 --- a/src/Token.Management.Application.Contracts/AppServices/WorkFlow/IWorkflowTemplateService.cs +++ b/src/Token.Management.Application.Contracts/AppServices/WorkFlow/IWorkflowTemplateService.cs @@ -1,4 +1,5 @@ -using Token.Management.Application.Contracts.Module.WorkFlow; +using Token.Management.Application.Contracts.Module; +using Token.Management.Application.Contracts.Module.WorkFlow; using Token.Management.Domain.WorkFlow; namespace Token.Management.Application.Contracts.AppServices.WorkFlow; @@ -16,10 +17,9 @@ public interface IWorkflowTemplateService /// 获取模板 /// /// - /// - /// + /// /// - Task<(List, int)> GetWorkflowTemplatePage(string? name, int pageNo = 1, int pageSize = 20); + Task<(List, int)> GetWorkflowTemplatePage(string? name, PageInput input); /// /// 删除模板 @@ -43,7 +43,7 @@ public interface IWorkflowTemplateService Task> GetWorkflowNodeTemplates(Guid workflowId); /// - /// 获取节点已存在角色 + /// 获取节点已存在角色 /// /// /// diff --git a/src/Token.Management.Application.Contracts/Module/PageInput.cs b/src/Token.Management.Application.Contracts/Module/PageInput.cs index b3a7575ee118ce5bee557784872e6430bc28a9ce..687a35e59a87c2f960833e91c2b0bbe37c10e9dc 100644 --- a/src/Token.Management.Application.Contracts/Module/PageInput.cs +++ b/src/Token.Management.Application.Contracts/Module/PageInput.cs @@ -5,6 +5,16 @@ /// public class PageInput { + /// + /// 开始时间 + /// + public DateTime? StartTime { get; set; } + + /// + /// 结束时间 + /// + public DateTime? EndTime { get; set; } + /// /// 当前页 /// diff --git a/src/Token.Management.Application.Contracts/Module/Users/UserInfoDto.cs b/src/Token.Management.Application.Contracts/Module/Users/UserInfoDto.cs index ab444b0de7e2923ac5fe1d75f0f9c5a71b854f71..2ff5f084574d9d7393fe3f08291fd26c570be956 100644 --- a/src/Token.Management.Application.Contracts/Module/Users/UserInfoDto.cs +++ b/src/Token.Management.Application.Contracts/Module/Users/UserInfoDto.cs @@ -1,4 +1,4 @@ -using Token.Management.Application.Contracts.Module.Management; +using Token.Management.Application.Contracts.Module.Management; using Token.Management.Domain.Base; using Token.Management.Domain.Shared; @@ -41,12 +41,12 @@ public class UserInfoDto : SerialNumberEntity /// /// 账号状态 /// - public StatueEnum Statue { get; set; } + public StatusEnum Status { get; set; } /// - /// 状态描述 + /// 状态描述 /// - public string? StatueName { get; set; } + public string? StatusName { get; set; } /// /// 性别 diff --git a/src/Token.Management.Application.Contracts/Token.Management.Application.Contracts.csproj b/src/Token.Management.Application.Contracts/Token.Management.Application.Contracts.csproj index 0f3edc93c6e3e4e3330ef10073c8a32eed87d211..4dae1b285b1766231c7e709dadd40deac38432c8 100644 --- a/src/Token.Management.Application.Contracts/Token.Management.Application.Contracts.csproj +++ b/src/Token.Management.Application.Contracts/Token.Management.Application.Contracts.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Token.Management.Application/MapperProfile.cs b/src/Token.Management.Application/MapperProfile.cs index 8c42717a01698200f3c02cbdcfbd1747bf4bcf4c..b2246c396ab6188923d3ec3170b61fe201b06191 100644 --- a/src/Token.Management.Application/MapperProfile.cs +++ b/src/Token.Management.Application/MapperProfile.cs @@ -1,5 +1,6 @@ -using AutoMapper; +using AutoMapper; using Token.Infrastructure.Extension; +using Token.Management.Application.Contracts.AppServices.WorkContent; using Token.Management.Application.Contracts.Module.Management; using Token.Management.Application.Contracts.Module.Management.AccessFunction; using Token.Management.Application.Contracts.Module.Users; @@ -8,11 +9,12 @@ using Token.Management.Domain.Management; using Token.Management.Domain.Management.AccessFunction; using Token.Management.Domain.Shared; using Token.Management.Domain.Users; +using Token.Management.Domain.WorkContent; using Token.Management.Domain.WorkFlow; namespace Token.Management.Application; -public class MapperProfile: Profile +public class MapperProfile : Profile { public MapperProfile() { @@ -20,10 +22,10 @@ public class MapperProfile: Profile .ForMember(dest => dest.Role, l => l.MapFrom(a => a.UserRoleFunction.Select(a => a.Role))) .ForMember(dest => dest.SexName, l => l.MapFrom(a => a.Sex.GetEnumString())) .ForMember(dest => dest.Sex, l => l.MapFrom(a => (sbyte)a.Sex)) - .ForMember(dest => dest.StatueName, l => l.MapFrom(a => a.Statue.GetEnumString())) + .ForMember(dest => dest.StatusName, l => l.MapFrom(a => a.Status.GetEnumString())) .ForMember(dest => dest.Department, l => l.MapFrom(a => a.UserDepartmentFunction.Select(a => a.Department))); CreateMap() - .ForMember(dest=>dest.Sex,l=>l.MapFrom(a=>(SexEnum)a.Sex)); + .ForMember(dest => dest.Sex, l => l.MapFrom(a => (SexEnum)a.Sex)); CreateMap(); CreateMap(); CreateMap(); @@ -53,5 +55,19 @@ public class MapperProfile: Profile CreateMap(); CreateMap(); #endregion + + #region WorkDemo + + CreateMap(); + CreateMap() + .ForMember(x=>x.WorkFlowNodeStatusName, + x=>x.MapFrom(x=>x.WorkFlowNodeStatus.GetEnumString())); + CreateMap(); + CreateMap() + .ForMember(x=>x.WorkFlowNodeStatusName, + x=>x.MapFrom(x=>x.WorkFlowNodeStatus.GetEnumString())); + + + #endregion } } diff --git a/src/Token.Management.Application/Services/Management/RoleService.cs b/src/Token.Management.Application/Services/Management/RoleService.cs index 4bd191c161833c73649805af7c89e9ba37282ea8..d73ab1c1634e0793a36b8db6d88481507830a84d 100644 --- a/src/Token.Management.Application/Services/Management/RoleService.cs +++ b/src/Token.Management.Application/Services/Management/RoleService.cs @@ -16,7 +16,6 @@ namespace Token.Management.Application.Services.Management; public class RoleService : ApplicationService, IRoleService { - private readonly IMapper _mapper; private readonly IPrincipalAccessor _principalAccessor; private readonly IRepository _roleRepository; private readonly IRepository _menuRepository; @@ -24,7 +23,6 @@ public class RoleService : ApplicationService, IRoleService private readonly IUserRoleFunctionRepository _userRoleFunctionRepository; private readonly IRepository _menuRoleFunctionRepository; public RoleService( - IMapper mapper, IPrincipalAccessor principalAccessor, IUserInfoRepository userInfoRepository, IRepository menuRepository, @@ -32,7 +30,6 @@ public class RoleService : ApplicationService, IRoleService IRepository menuRoleFunctionRepository, IRepository roleRepository) { - _mapper = mapper; _menuRepository = menuRepository; _principalAccessor = principalAccessor; _userInfoRepository = userInfoRepository; @@ -42,7 +39,7 @@ public class RoleService : ApplicationService, IRoleService } public async Task CreateRole(RoleDto role) { - var data = _mapper.Map(role); + var data = ObjectMapper.Map(role); if (data.Code.IsNull() || data.Name.IsNull()) throw new BusinessException("角色编号或名称不能为空"); if (await _roleRepository.AnyAsync(a => a.Code == data.Code || a.Name == data.Name)) throw new BusinessException("已经存在相同编号或名称的角色"); @@ -52,7 +49,7 @@ public class RoleService : ApplicationService, IRoleService await CurrentUnitOfWork.SaveChangesAsync(); - return _mapper.Map(data); + return ObjectMapper.Map(data); } @@ -128,14 +125,16 @@ public class RoleService : ApplicationService, IRoleService .GetListAsync(a => (string.IsNullOrEmpty(name) || a.Name!.ToLower().Contains(name.ToLower())))) .OrderBy(x=>x.Index); - return _mapper.Map>(data); + return ObjectMapper.Map,List>(data); } public async Task<(List, int)> GetRoleUserInfo(Guid id, PageInput input) { var data=await _userRoleFunctionRepository - .GetPageListAsync(x => id==x.RoleId,a => a.CreationTime, input.SkipCount,input.MaxResultCount); - return (_mapper.Map>(data.Item1),data.Item2); + .GetPageUserListAsync(x => id==x.RoleId,a => a.CreationTime, + input.SkipCount,input.MaxResultCount); + + return (ObjectMapper.Map,List>(data.Item1),data.Item2); } public async Task<(List, int)> GetRoleUserInfoNotExit(Guid id,PageInput input) @@ -147,13 +146,12 @@ public class RoleService : ApplicationService, IRoleService &&!a.UserRoleFunction.Any(a => a.RoleId == id), x=>x.CreationTime,input.SkipCount,input.MaxResultCount); - return (_mapper.Map>(data.Item1),data.Item2); + return (ObjectMapper.Map,List>(data.Item1),data.Item2); } public async Task> GetUserMenuList() { - var user = _principalAccessor.GetUserInfo(); - var roleIds = user.UserRoleFunction!.Select(x=>x.RoleId).ToList(); + var roleIds = _principalAccessor.GetRoleIds(); var menuRole =(await _menuRoleFunctionRepository.GetListAsync(a => roleIds.Contains(a.RoleId))) .Select(x=>x.MenuId) @@ -196,7 +194,7 @@ public class RoleService : ApplicationService, IRoleService var data = await _roleRepository.FirstOrDefaultAsync(a => a.Id == role.Id); if (data == null) throw new BusinessException("数据不存在或者已经被删除"); - _mapper.Map(role, data); + ObjectMapper.Map(role, data); await _roleRepository.UpdateAsync(data); return role; @@ -204,7 +202,7 @@ public class RoleService : ApplicationService, IRoleService public async Task UpdateRoleIndex(List roles) { - var data = _mapper.Map>(roles); + var data = ObjectMapper.Map,List>(roles); for (int i = 0; i < data.Count; i++) { data[i].Index = i; diff --git a/src/Token.Management.Application/Services/Users/UserInfoService.cs b/src/Token.Management.Application/Services/Users/UserInfoService.cs index 94b851f7470104c25a1fa035543dee5a34c07ab0..cd271460d679e0b7eea69eee2c709131a5a31d2e 100644 --- a/src/Token.Management.Application/Services/Users/UserInfoService.cs +++ b/src/Token.Management.Application/Services/Users/UserInfoService.cs @@ -1,10 +1,11 @@ -using AutoMapper; -using Management.Application.Services.Management; -using Token.HttpApi; +using Token.HttpApi; +using Token.Infrastructure.Extension; using Token.Management.Application.Contracts.AppServices.Users; +using Token.Management.Application.Contracts.Module; using Token.Management.Application.Contracts.Module.Management; using Token.Management.Application.Contracts.Module.Users; using Token.Management.Domain; +using Token.Management.Domain.Management; using Token.Management.Domain.Shared; using Token.Management.Domain.Users; using Volo.Abp.Application.Services; @@ -14,19 +15,16 @@ namespace Token.Management.Application.Services.Users; public class UserInfoService : ApplicationService, IUserInfoService { - private readonly IMapper _mapper; + private readonly DESHelper _desHelper; private readonly IPrincipalAccessor _principalAccessor; - private readonly IDepartmentService _departmentService; private readonly IUserInfoRepository _userInfoRepository; public UserInfoService( - IMapper mapper, - IDepartmentService departmentService, - IPrincipalAccessor principalAccessor, IUserInfoRepository userInfoRepository) + IPrincipalAccessor principalAccessor, + IUserInfoRepository userInfoRepository, DESHelper desHelper) { - _mapper = mapper; - _departmentService = departmentService; _principalAccessor = principalAccessor; _userInfoRepository = userInfoRepository; + _desHelper = desHelper; } public async Task CreateUserInfo(UserInfoDto userInfo) @@ -34,10 +32,10 @@ public class UserInfoService : ApplicationService, IUserInfoService if (await _userInfoRepository.AnyAsync(a => a.AccountNumber == userInfo.AccountNumber)) throw new BusinessException("已经存在相同账号!"); - var data=_mapper.Map(userInfo); + var data=ObjectMapper.Map(userInfo); data =await _userInfoRepository.InsertAsync(data); - return _mapper.Map(data); + return ObjectMapper.Map(data); } public async Task DeleteUserInfoAsync(Guid userId) @@ -49,33 +47,32 @@ public class UserInfoService : ApplicationService, IUserInfoService } - public async Task GetUserInfo(LoginInput input) + public async Task<(UserInfoDto,string)> GetUserInfo(LoginInput input) { var data=await _userInfoRepository - .GetAsync(a=>a.AccountNumber==input.AccountNumber&&a.Password==input.Password); + .GetAsync(a=>a.AccountNumber==input.AccountNumber&&a.Password== input.Password); if (data == null) throw new BusinessException("账号或者密码错误"); - return _mapper.Map(data); + var token=await _principalAccessor.CreateTokenAsync(data); + + return (ObjectMapper.Map(data),token); } public async Task> GetUserInfoDepartmentList(Guid userId) { var data = await _userInfoRepository.GetAsync(a => a.Id == userId); + var departments=data.Department; - return _mapper.Map>(data); + return ObjectMapper.Map,List>(departments); } - public async Task, int>> GetUserInfoPaging(string? code, DateTime? startTime, DateTime? endTime, sbyte statue = -1, int pageNo = 1, int pageSize = 20) + public async Task, int>> GetUserInfoPaging(UserInfoPagingInput input) { - var data = await _userInfoRepository - .GetListAsync(a => a.CreationTime > startTime && a.CreationTime < endTime && - (string.IsNullOrEmpty(code) || a.Name.ToLower().Contains(code)) && - (statue == -1 || (StatueEnum)statue == a.Statue), - a => a.CreationTime,pageNo,pageSize); + var data = await _userInfoRepository.GetListAsync(input.StartTime,input.EndTime,input.Keyword,input.Status,input.SkipCount,input.MaxResultCount); - return new Tuple, int>(_mapper.Map>(data.Item1),data.Item2); + return new Tuple, int>(ObjectMapper.Map,List>(data.Item1),data.Item2); } public async Task UpdateUserInfo(UserInfoDto userInfo) @@ -85,13 +82,12 @@ public class UserInfoService : ApplicationService, IUserInfoService throw new BusinessException("用户不存在或者已经被删除"); data.Name = userInfo.Name; - data.Statue = userInfo.Statue; + data.Status = userInfo.Status; data.Sex =(SexEnum) userInfo.Sex; data.MobileNumber = userInfo.MobileNumber; data.EMail=userInfo.EMail; await _userInfoRepository.UpdateAsync(data); - - return _mapper.Map(data); + return ObjectMapper.Map(data); } } diff --git a/src/Token.Management.Application/Services/WorkContent/WorkDemoMainService.cs b/src/Token.Management.Application/Services/WorkContent/WorkDemoMainService.cs new file mode 100644 index 0000000000000000000000000000000000000000..2e253047ea7fc4907987260c188ee4a6c1eb92a8 --- /dev/null +++ b/src/Token.Management.Application/Services/WorkContent/WorkDemoMainService.cs @@ -0,0 +1,37 @@ +using Token.Management.Application.Contracts.AppServices.WorkContent; +using Token.Management.Domain; +using Token.Management.Domain.Shared; +using Token.Management.Domain.WorkContent; +using Volo.Abp.Application.Services; +using Volo.Abp.Domain.Repositories; + +namespace Token.Management.Application.Services.WorkContent; + +public class WorkDemoMainService:ApplicationService,IWorkDemoMainService +{ + private readonly IWorkDemoMainRepository _workDemoMainRepository; + + public WorkDemoMainService(IWorkDemoMainRepository workDemoMainRepository) + { + _workDemoMainRepository = workDemoMainRepository; + } + + public async Task CreateWorkDemoMainAsync(WorkDemoMainDto dto) + { + if (await _workDemoMainRepository.AnyAsync(x => x.Name == dto.Name)) + { + throw new BusinessException("存在重复名称"); + } + + var data = ObjectMapper.Map(dto); + data.WorkFlowNodeStatus = WorkFlowNodeStatusEnum.UnDeal; + data =await _workDemoMainRepository.InsertAsync(data); + } + + public async Task<(List, int)> GetWorkDemoListAsync(DateTime? startTime, DateTime? endTime, string keyword, int pageNo, int pageSize) + { + var result = await _workDemoMainRepository.GetWorkDemoListAsync(startTime, endTime, keyword, pageNo, pageSize); + + return (ObjectMapper.Map,List>(result.Item1),result.Item2); + } +} diff --git a/src/Token.Management.Application/Services/WorkFlow/WorkflowTemplateService.cs b/src/Token.Management.Application/Services/WorkFlow/WorkflowTemplateService.cs index 5df56e56a550ce2a6558f1871059469f47f62641..04fd83e34cc07ad37c7d91512e75c1b0bd824f77 100644 --- a/src/Token.Management.Application/Services/WorkFlow/WorkflowTemplateService.cs +++ b/src/Token.Management.Application/Services/WorkFlow/WorkflowTemplateService.cs @@ -3,9 +3,11 @@ using Management.Application.Services.Management; using Token.HttpApi; using Token.Infrastructure.Extension; using Token.Management.Application.Contracts.AppServices.WorkFlow; +using Token.Management.Application.Contracts.Module; using Token.Management.Application.Contracts.Module.Users; using Token.Management.Application.Contracts.Module.WorkFlow; using Token.Management.Domain; +using Token.Management.Domain.Users; using Token.Management.Domain.WorkFlow; using Volo.Abp.Application.Services; using Volo.Abp.Domain.Repositories; @@ -14,20 +16,17 @@ namespace Token.Management.Application.Services.WorkFlow; public class WorkflowTemplateService : ApplicationService, IWorkflowTemplateService { - private readonly IMapper _mapper; private readonly IRoleService _iRoleService; private readonly IPrincipalAccessor _principalAccessor; private readonly IWorkflowTemplateRepository _workflowTemplateRepository; private readonly IWorkflowApprovalRoleRepository _workflowApprovalRoleRepository; private readonly IWorkflowNodeTemplateRepository _workflowNodeTemplateRepository; public WorkflowTemplateService( - IMapper mapper, IRoleService iRoleService, IPrincipalAccessor principalAccessor, IWorkflowApprovalRoleRepository workflowApprovalRoleRepository, IWorkflowNodeTemplateRepository workflowNodeTemplateRepository, IWorkflowTemplateRepository workflowTemplateRepository) { - _mapper = mapper; _iRoleService = iRoleService; _principalAccessor = principalAccessor; _workflowApprovalRoleRepository = workflowApprovalRoleRepository; @@ -50,12 +49,12 @@ public class WorkflowTemplateService : ApplicationService, IWorkflowTemplateServ public async Task CreateWorkflowNodeTemplate(WorkflowNodeTemplateDto templateDto) { - var data = _mapper.Map(templateDto); + var data = ObjectMapper.Map(templateDto); var code = await _workflowNodeTemplateRepository.GetWorkflowNodeTemplateMaxIndex(templateDto.WorkflowTemplateId); data.Code = code; data = await _workflowNodeTemplateRepository.InsertAsync(data); - return _mapper.Map(data); + return ObjectMapper.Map(data); } public async Task CreateWorkflowTemplate(WorkflowTemplateDto workflow) @@ -69,14 +68,14 @@ public class WorkflowTemplateService : ApplicationService, IWorkflowTemplateServ if (await _workflowTemplateRepository.AnyAsync(a => a.Name == workflow.Name || a.Code == workflow.Code)) throw new BusinessException("模板编号或者模板名称重复"); - var data = _mapper.Map(workflow); + var data = ObjectMapper.Map(workflow); data.WorkflowInstance = new List(); data = await _workflowTemplateRepository.InsertAsync(data); - return _mapper.Map(data); + return ObjectMapper.Map(data); } public async Task DeleteWorkflowNodeTemplate(Guid workflowNodeId) @@ -119,17 +118,16 @@ public class WorkflowTemplateService : ApplicationService, IWorkflowTemplateServ .GetListAsync(a => a.WorkflowTemplateId == workflowId)).OrderBy(x => x.Code) .ToList(); - return _mapper.Map>(data); + return ObjectMapper.Map,List>(data); } - public async Task<(List, int)> GetWorkflowTemplatePage(string? name, int pageNo = 1, int pageSize = 20) + public async Task<(List, int)> GetWorkflowTemplatePage(string? name, PageInput input) { var data = await _workflowTemplateRepository - .GetPageListAsync(a => (string.IsNullOrEmpty(name) || a.Name!.ToLower().Contains(name.ToLower())), - a => a.CreationTime, pageNo, pageSize); + .GetPageListAsync(name, input.SkipCount, input.MaxResultCount); - return (_mapper.Map>(data.Item1), data.Item2); + return (ObjectMapper.Map,List>(data.Item1), data.Item2); } public async Task UpdateWorkflowNodeTemplate(WorkflowNodeTemplateDto workflowNodeTemplate) @@ -147,11 +145,11 @@ public class WorkflowTemplateService : ApplicationService, IWorkflowTemplateServ public async Task> UpdateWorkflowNodeTemplateIndex(List workflows) { - var data = _mapper.Map>(workflows); + var data = ObjectMapper.Map,List>(workflows); UpdateWorkflowNodeTemplateHandleIndex(data); - return await Task.FromResult(_mapper.Map>(data)); + return await Task.FromResult(ObjectMapper.Map,List>(data)); } public void UpdateWorkflowNodeTemplateHandleIndex(List workflows) @@ -176,7 +174,7 @@ public class WorkflowTemplateService : ApplicationService, IWorkflowTemplateServ if (await _workflowTemplateRepository.AnyAsync(a => workflow.Id != a.Id && (a.Name == workflow.Name || a.Code == workflow.Code))) throw new BusinessException("模板编号或者模板名称重复"); - _mapper.Map(workflow, data); + ObjectMapper.Map(workflow, data); await _workflowTemplateRepository.UpdateAsync(data); @@ -187,7 +185,7 @@ public class WorkflowTemplateService : ApplicationService, IWorkflowTemplateServ { var data = await _workflowTemplateRepository.GetListAsync(); - return _mapper.Map>(data); + return ObjectMapper.Map,List>(data); } public async Task GetsTheNextNode(Guid id) @@ -201,7 +199,7 @@ public class WorkflowTemplateService : ApplicationService, IWorkflowTemplateServ { var data = await _workflowNodeTemplateRepository.GetListAsync(a => a.Id == workTemplateId); - return _mapper.Map>(data); + return ObjectMapper.Map,List>(data); } public async Task> GetWorkflowNodeRoleUserInfoDto(Guid workTemplateId) @@ -209,6 +207,7 @@ public class WorkflowTemplateService : ApplicationService, IWorkflowTemplateServ var data = await _workflowNodeTemplateRepository.GetListAsync(a => a.WorkflowTemplateId == workTemplateId); var roles = data.SelectMany(a => a.WorkflowApprovalRole).Select(a => a.RoleId).ToList(); + var userInfo = await _iRoleService.GetRoleUserAllAsync(roles); var workflowNodeRoleUserInfos = new List(); foreach (var d in data) @@ -218,7 +217,8 @@ public class WorkflowTemplateService : ApplicationService, IWorkflowTemplateServ Id = d.Id, Code = d.Code, Remark = d.Remark, - UserInfo = _mapper.Map>(userInfo.FindAll(a => d.WorkflowApprovalRole.Select(a => a.RoleId).Contains(a.RoleId)).Distinct()) + UserInfo = ObjectMapper + .Map,List>(userInfo.FindAll(a => d.WorkflowApprovalRole.Select(a => a.RoleId).Contains(a.RoleId)).Select(x=>x.UserInfo).Distinct()) }; workflowNodeRoleUserInfos.Add(workflowNodeRoleUserInfo); } diff --git a/src/Token.Management.Application/Token.Management.Application.csproj b/src/Token.Management.Application/Token.Management.Application.csproj index 8f5d09ddc603005e13280291f8655d50419e480d..7681e1467390f3f035106bc2e98913f706dcdd42 100644 --- a/src/Token.Management.Application/Token.Management.Application.csproj +++ b/src/Token.Management.Application/Token.Management.Application.csproj @@ -7,15 +7,16 @@ - - - + + + + diff --git a/src/Token.Management.Application/TokenManagementApplicationModule.cs b/src/Token.Management.Application/TokenManagementApplicationModule.cs index 5518106d40579e4f2f6b9b61a504c3d6b1428a6e..683a86c368c14059010008791f7f840728187ef9 100644 --- a/src/Token.Management.Application/TokenManagementApplicationModule.cs +++ b/src/Token.Management.Application/TokenManagementApplicationModule.cs @@ -1,10 +1,14 @@ -using Token.Management.Application.Contracts; +using Token.Infrastructure; +using Token.Management.Application.Contracts; +using Token.Management.EntityFrameworkCore.EntityFrameworkCore; using Volo.Abp.AutoMapper; using Volo.Abp.Modularity; namespace Token.Management.Application; [DependsOn(typeof(TokenManagementApplicationContractsModule), + typeof(TokenInfrastructureModule), + typeof(TokenManagementEntityFrameworkCoreModule), typeof(AbpAutoMapperModule))] public class TokenManagementApplicationModule : AbpModule { diff --git a/src/Token.Management.Domain.Shared/StatueEnum.cs b/src/Token.Management.Domain.Shared/StatusEnum.cs similarity index 93% rename from src/Token.Management.Domain.Shared/StatueEnum.cs rename to src/Token.Management.Domain.Shared/StatusEnum.cs index 2dcdf6a182a21ccd407dc0f2c748da3d44aff252..51a74917e10169bd4436cdf05b35e16c17d7d1b5 100644 --- a/src/Token.Management.Domain.Shared/StatueEnum.cs +++ b/src/Token.Management.Domain.Shared/StatusEnum.cs @@ -5,7 +5,7 @@ namespace Token.Management.Domain.Shared; /// /// 用户状态 /// -public enum StatueEnum +public enum StatusEnum { /// /// 启用 diff --git a/src/Token.Management.Domain.Shared/WorkFlowNodeStatusEnum.cs b/src/Token.Management.Domain.Shared/WorkFlowNodeStatusEnum.cs index 16ddcbda808fde7e1e31430caf2d0434e863e74f..e76f833420cab8990cfe6be874cf11785ccdce11 100644 --- a/src/Token.Management.Domain.Shared/WorkFlowNodeStatusEnum.cs +++ b/src/Token.Management.Domain.Shared/WorkFlowNodeStatusEnum.cs @@ -8,27 +8,27 @@ namespace Token.Management.Domain.Shared; public enum WorkFlowNodeStatusEnum { /// - /// 驳回 + /// 驳回 /// [Description("驳回")] Rejected = 0, /// - /// 通过 + /// 通过 /// - [Description("通过")] Pass, + [Description("通过")] Pass=1, /// - /// 未处理 + /// 未处理 /// - [Description("未处理")] UnDeal, + [Description("未处理")] UnDeal=2, /// - /// 终止【用作当前整个流程终止】 + /// 终止【用作当前整个流程终止】 /// - [Description("终止")] Terminate, + [Description("终止")] Terminate=3, /// - /// 撤回 + /// 撤回 /// - [Description("未处理")] Withdraw = 5 + [Description("撤回")] Withdraw = 4 } diff --git a/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreConfig.cs b/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreConfig.cs index cf809d3b6c932f79e57c46108c47c2f1e9617d46..f770354f6c7886797947a98942597811c2271a52 100644 --- a/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreConfig.cs +++ b/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreConfig.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Token.Infrastructure.Extension; using Token.Management.Domain.Management; using Token.Management.Domain.Management.AccessFunction; using Token.Management.Domain.SystemService; @@ -11,12 +12,10 @@ namespace Token.Management.EntityFrameworkCore.EntityFrameworkCore; public static class EntityFrameworkCoreConfig { - public static ModelBuilder Config(this ModelBuilder builder) + public static ModelBuilder Config(this ModelBuilder builder) { - builder.Entity(x => - { - x.HasKey(x => x.Count); - }); + var des = new DESHelper(); + builder.Entity().HasKey(x=>x.Count); builder.Entity(x => { @@ -27,10 +26,12 @@ public static class EntityFrameworkCoreConfig x.Property(x => x.Name).HasComment("用户昵称"); x.Property(x => x.Password).HasComment("密码"); x.Property(x => x.Sex).HasComment("性别"); - x.Property(x => x.Statue).HasComment("状态"); + x.Property(x => x.Status).HasComment("状态"); x.Property(x => x.EMail).HasComment("邮箱"); x.Property(x => x.HeadPortraits).HasComment("头像"); + x.Property(x => x.Password) + .HasConversion(x => des.DESEncrypt(x),x => des.DESDecrypt(x)); }); builder.Entity(x => @@ -152,6 +153,21 @@ public static class EntityFrameworkCoreConfig }); + builder.Entity(x => + { + x.ToTable("token_company"); + x.HasIndex(x => x.Id); + x.HasKey(x => x.Id); + }); + + builder.Entity(x => + { + x.ToTable("token_work_content_demo"); + + x.HasIndex(x => x.Id); + x.HasKey(x => x.Id); + + }); return builder; } } diff --git a/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreInitialData.cs b/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreInitialData.cs index 350fa644e78d4171d3af28ac19ad8b49c338895b..4f60a390663bb54669c825c7e7a4257ee3efb387 100644 --- a/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreInitialData.cs +++ b/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/EntityFrameworkCoreInitialData.cs @@ -1,4 +1,5 @@ -using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; +using Token.Infrastructure.Extension; using Token.Management.Domain.Management; using Token.Management.Domain.Management.AccessFunction; using Token.Management.Domain.Shared; @@ -15,7 +16,8 @@ public static class EntityFrameworkCoreInitialData /// public static void Initia(this ModelBuilder model) { - var now=DateTime.Now; + var des = new DESHelper(); + var now = DateTime.Now; var userInfoData = new List() { new(Guid.NewGuid()) @@ -26,21 +28,21 @@ public static class EntityFrameworkCoreInitialData HeadPortraits="https://upfile2.asqql.com/upfile/hdimg/wmtp/wmtp/2018-07/08/18_7_8_16_10_08yoqapqci.jpg", MobileNumber=13049809673, Name="管理员", - Password="Aa010426", + Password=des.DESEncrypt("123456"), CreationTime=now, - Statue =StatueEnum.Enable + Status =StatusEnum.Enable }, }; model.Entity().HasData(userInfoData); - var roleData =new Role(Guid.NewGuid()) - { - Name = "管理员", - Code = "admin", - Index = 0, - Remark = "系统管理员", - CreationTime = now, + var roleData = new Role(Guid.NewGuid()) + { + Name = "管理员", + Code = "admin", + Index = 0, + Remark = "系统管理员", + CreationTime = now, }; model.Entity().HasData(roleData); @@ -66,7 +68,8 @@ public static class EntityFrameworkCoreInitialData var userDepartmentFunction = new List(); foreach (var u in userInfoData) { - userDepartmentFunction.Add(new UserDepartmentFunction(Guid.NewGuid()) { + userDepartmentFunction.Add(new UserDepartmentFunction(Guid.NewGuid()) + { UserInfoId = u.Id, DepartmentId = departmentData.Id, CreationTime = now, @@ -74,7 +77,7 @@ public static class EntityFrameworkCoreInitialData userRole.Add(new UserRoleFunction(Guid.NewGuid()) { UserInfoId = u.Id, - RoleId= roleData.Id, + RoleId = roleData.Id, CreationTime = now, }); } @@ -123,7 +126,7 @@ public static class EntityFrameworkCoreInitialData { CreationTime = now, Component = "UserConfig", - Index =1, + Index = 1, Name = "用户权限配置", ParentId = menuSystem.Id, Path = "/system/userConfig/index", @@ -162,9 +165,10 @@ public static class EntityFrameworkCoreInitialData foreach (var d in menu) { - menuRoleFunction.Add(new MenuRoleFunction(Guid.NewGuid()) { - MenuId=d.Id, - RoleId= roleData.Id, + menuRoleFunction.Add(new MenuRoleFunction(Guid.NewGuid()) + { + MenuId = d.Id, + RoleId = roleData.Id, }); } model.Entity().HasData(menuRoleFunction); diff --git a/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/TokenDbContext.cs b/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/TokenDbContext.cs index 0bbc7b360ef286d5740554b8a8276ff4d139caff..28533827005f6c3d7300027263dd84335fdaff82 100644 --- a/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/TokenDbContext.cs +++ b/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/TokenDbContext.cs @@ -1,4 +1,4 @@ -using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; using Token.Management.Domain.Management; using Token.Management.Domain.Management.AccessFunction; using Token.Management.Domain.SystemService; @@ -57,16 +57,16 @@ public class TokenDbContext : AbpDbContext optionsBuilder.UseQueryTrackingBehavior(QueryTrackingBehavior.NoTrackingWithIdentityResolution); #if DEBUG +#endif // 显示更详细的异常日志 optionsBuilder.EnableDetailedErrors(); -#endif } protected override void OnModelCreating(ModelBuilder builder) { - builder.Initia(); - + builder.Config(); + builder.Initia(); } diff --git a/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/UserRoleFunctionRepository.cs b/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/UserRoleFunctionRepository.cs index fdbd0130f187f616d03f73f665295ecf19a7ac37..e7cac9a786ab504453d87defb4318d62f17e067d 100644 --- a/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/UserRoleFunctionRepository.cs +++ b/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/UserRoleFunctionRepository.cs @@ -1,6 +1,8 @@ using System.Linq.Expressions; using Microsoft.EntityFrameworkCore; using Token.Management.Domain.Management.AccessFunction; +using Token.Management.Domain.Users; +using Volo.Abp.Domain.Entities.Auditing; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; @@ -28,6 +30,22 @@ public class UserRoleFunctionRepository:EfCoreRepository, int)> GetPageUserListAsync(Expression> expression, Expression> sort, int skipCount, int maxResultCount) + { + var dbContext = await GetDbContextAsync(); + + var query = + dbContext.UserRoleFunction.Where(expression) + .OrderBy(sort) + .Select(x=>x.UserInfo); + + var count =await query.CountAsync(); + + var result =await query.PageBy(skipCount, maxResultCount).ToListAsync(); + + return (result, count); + } + public async Task> GetListAsync(Expression> expression, Expression> select,Expression>? property=null) { @@ -43,4 +61,14 @@ public class UserRoleFunctionRepository:EfCoreRepository> GetUserInfoAsync(Expression> expression) + { + var dbContext = await GetDbContextAsync(); + + var query = dbContext.UserRoleFunction.Where(expression) + .Select(x=>x.UserInfo); + + return await query.ToListAsync(); + } } diff --git a/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/Users/UserInfoRepository.cs b/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/Users/UserInfoRepository.cs index cf307d51924b4ea5c1c20bd5572b2fee1e74f8e8..b691ccbebb3a8d69b59f66d2fbc8877c52d7e2ff 100644 --- a/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/Users/UserInfoRepository.cs +++ b/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/Users/UserInfoRepository.cs @@ -1,5 +1,6 @@ using System.Linq.Expressions; using Microsoft.EntityFrameworkCore; +using Token.Management.Domain.Shared; using Token.Management.Domain.Users; using Volo.Abp.Domain.Repositories.EntityFrameworkCore; using Volo.Abp.EntityFrameworkCore; @@ -12,6 +13,26 @@ public class UserInfoRepository:EfCoreRepository,I { } + public async Task<(List, int)> GetListAsync(DateTime? startTime, DateTime? endTime, string? keyword, + sbyte? status, int skipCount, int maxResultCount) + { + var dbContext = await GetDbContextAsync(); + + var quer = + dbContext.UserInfo + .WhereIf(startTime.HasValue, x => x.CreationTime >= startTime) + .WhereIf(endTime.HasValue, x => x.CreationTime <= endTime) + .WhereIf(!keyword.IsNullOrWhiteSpace(), + x => x.Name.Contains(keyword) || x.AccountNumber.Contains(keyword)) + .WhereIf(status.HasValue, x => x.Status == (StatusEnum?)status); + + var count =await quer.CountAsync(); + + var result =await quer.PageBy(skipCount, maxResultCount).ToListAsync(); + + return (result, count); + } + public async Task<(List, int)> GetListAsync(Expression> expression, Expression> sort, int skipCount, int maxResultCount) { var dbContext = await GetDbContextAsync(); diff --git a/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/WorkContent/WorkContentDemoRepository.cs b/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/WorkContent/WorkContentDemoRepository.cs new file mode 100644 index 0000000000000000000000000000000000000000..0d3ba56c07ddd75e2cf7d16da90fd2a6334ea4f4 --- /dev/null +++ b/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/WorkContent/WorkContentDemoRepository.cs @@ -0,0 +1,13 @@ +using Token.Management.Domain.WorkContent; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace Token.Management.EntityFrameworkCore.EntityFrameworkCore.WorkContent; + +public class WorkContentDemoRepository:EfCoreRepository,IWorkContentDemoRepository +{ + public WorkContentDemoRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) + { + } + +} diff --git a/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/WorkContent/WorkDemoMainRepository.cs b/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/WorkContent/WorkDemoMainRepository.cs new file mode 100644 index 0000000000000000000000000000000000000000..1551509345c67492cbc435d7144e884455980a10 --- /dev/null +++ b/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/WorkContent/WorkDemoMainRepository.cs @@ -0,0 +1,31 @@ +using Microsoft.EntityFrameworkCore; +using Token.Management.Domain.WorkContent; +using Volo.Abp.Domain.Repositories.EntityFrameworkCore; +using Volo.Abp.EntityFrameworkCore; + +namespace Token.Management.EntityFrameworkCore.EntityFrameworkCore.WorkContent; + +public class WorkDemoMainRepository:EfCoreRepository,IWorkDemoMainRepository +{ + public WorkDemoMainRepository(IDbContextProvider dbContextProvider) : base(dbContextProvider) + { + } + + public async Task<(List, int)> GetWorkDemoListAsync(DateTime? startTime, DateTime? endTime, string keyword, int pageNo, int pageSize) + { + var dbContext = await GetDbContextAsync(); + + var query = + dbContext.WorkDemoMain + .WhereIf(!keyword.IsNullOrWhiteSpace(), + x => x.Name.Contains(keyword) || x.Content.Contains(keyword) || x.Remark.Contains(keyword)) + .WhereIf(startTime.HasValue, x => x.CreationTime >= startTime) + .WhereIf(endTime.HasValue, x => x.CreationTime <= endTime); + + var count = await query.CountAsync(); + + var result = await query.PageBy(pageNo, pageSize).ToListAsync(); + + return (result, count); + } +} diff --git a/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/WorkFlow/WorkflowNodeTemplateRepository.cs b/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/WorkFlow/WorkflowNodeTemplateRepository.cs index 2175b8bab0c1209f98afe2eeca7da4129f0ebcef..2fda363f2783d7943c2086fb6a6b864236dbd05b 100644 --- a/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/WorkFlow/WorkflowNodeTemplateRepository.cs +++ b/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/WorkFlow/WorkflowNodeTemplateRepository.cs @@ -45,12 +45,13 @@ public class WorkflowNodeTemplateRepository:EfCoreRepository x.WorkflowApprovalRole) - .Select(x => x.RoleId) - .ToListAsync(); - } + .Select(x => x.RoleId); + + return await query.ToListAsync(); + } public async Task GetAsync(Expression> expression) { diff --git a/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/WorkFlow/WorkflowTemplateRepository.cs b/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/WorkFlow/WorkflowTemplateRepository.cs index bcfd475e6b9579c3873a6a2c96f752328737a6ed..73d7460bef05c06650852616f61215a9977ff706 100644 --- a/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/WorkFlow/WorkflowTemplateRepository.cs +++ b/src/Token.Management.EntityFrameworkCore/EntityFrameworkCore/WorkFlow/WorkflowTemplateRepository.cs @@ -42,14 +42,13 @@ public class WorkflowTemplateRepository:EfCoreRepository, int)> GetPageListAsync(Expression> expression, Expression> sort, int skipCount, int maxResultCount) + public async Task<(List, int)> GetPageListAsync(string keyword, int skipCount,int maxResultCount) { var dbContext = await GetDbContextAsync(); var query = dbContext.WorkflowTemplate - .Where(expression) - .OrderBy(sort); + .WhereIf(!keyword.IsNullOrWhiteSpace(),x=>x.Code.Contains(keyword)||x.Name.Contains(keyword)||x.Remark.Contains(keyword)); var count =await query.CountAsync(); diff --git a/src/Token.Management.EntityFrameworkCore/Migrations/20220607173109_Date.Designer.cs b/src/Token.Management.EntityFrameworkCore/Migrations/20220607173109_Date.Designer.cs new file mode 100644 index 0000000000000000000000000000000000000000..2ec854ae1238cd96ff03abd74568db4cb13b3999 --- /dev/null +++ b/src/Token.Management.EntityFrameworkCore/Migrations/20220607173109_Date.Designer.cs @@ -0,0 +1,1095 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Token.Management.EntityFrameworkCore.EntityFrameworkCore; + +#nullable disable + +namespace Token.Management.EntityFrameworkCore.Migrations +{ + [DbContext(typeof(TokenDbContext))] + [Migration("20220607173109_Date")] + partial class Date + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("Token.Management.Domain.Management.AccessFunction.MenuRoleFunction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("MenuId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("UserInfoId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.HasIndex("MenuId"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserInfoId"); + + b.ToTable("token_menu_role_function", (string)null); + + b.HasData( + new + { + Id = new Guid("07f07059-3c28-4517-9cab-754ee22955c1"), + CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + IsDeleted = false, + MenuId = new Guid("cb90ab74-4ba5-4286-9ffc-f579e1de4afa"), + RoleId = new Guid("420a80c3-42b0-47b7-b491-46bee216ac64") + }, + new + { + Id = new Guid("7d8114c9-9e9e-4463-a2ee-e78799aca22a"), + CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + IsDeleted = false, + MenuId = new Guid("1eee3f07-9612-47d0-9897-c1d4fce15414"), + RoleId = new Guid("420a80c3-42b0-47b7-b491-46bee216ac64") + }, + new + { + Id = new Guid("43730628-a3b5-48e5-94dd-7d79d28156e4"), + CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + IsDeleted = false, + MenuId = new Guid("741f6e15-143d-489a-b747-38f106481d0b"), + RoleId = new Guid("420a80c3-42b0-47b7-b491-46bee216ac64") + }, + new + { + Id = new Guid("1db2cf2f-d354-4093-b621-1dc94a5a4f3a"), + CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + IsDeleted = false, + MenuId = new Guid("fee42ae9-c72d-4df0-8094-efa024d1c6e5"), + RoleId = new Guid("420a80c3-42b0-47b7-b491-46bee216ac64") + }, + new + { + Id = new Guid("484e547c-26b4-49d7-8f0d-bd2107380951"), + CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + IsDeleted = false, + MenuId = new Guid("6f1eed56-e99c-4100-a0f9-4df39f14a0ca"), + RoleId = new Guid("420a80c3-42b0-47b7-b491-46bee216ac64") + }, + new + { + Id = new Guid("59e92709-2366-4b66-8462-41f62620c48b"), + CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + IsDeleted = false, + MenuId = new Guid("dc7de715-7147-4fd9-95eb-c062c126ea72"), + RoleId = new Guid("420a80c3-42b0-47b7-b491-46bee216ac64") + }, + new + { + Id = new Guid("df0e69b1-eadd-457f-8d76-c7808c065582"), + CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + IsDeleted = false, + MenuId = new Guid("07bf458c-029a-4826-a5af-d9d51edb4020"), + RoleId = new Guid("420a80c3-42b0-47b7-b491-46bee216ac64") + }); + }); + + modelBuilder.Entity("Token.Management.Domain.Management.AccessFunction.UserDepartmentFunction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("DepartmentId") + .HasColumnType("char(36)"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("UserInfoId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("DepartmentId"); + + b.HasIndex("Id"); + + b.HasIndex("UserInfoId"); + + b.ToTable("token_user_department_function", (string)null); + + b.HasData( + new + { + Id = new Guid("f071ae1b-c55c-44c1-8f94-6b4bfeb9bc0f"), + CreationTime = new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), + DepartmentId = new Guid("bd809e02-4630-422d-bf82-8d77c2140b08"), + IsDeleted = false, + UserInfoId = new Guid("c46acc21-5067-4611-a5a1-1ce653c33e84") + }); + }); + + modelBuilder.Entity("Token.Management.Domain.Management.AccessFunction.UserRoleFunction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("UserInfoId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserInfoId"); + + b.ToTable("token_user_role_function", (string)null); + + b.HasData( + new + { + Id = new Guid("b94fada4-5433-49b1-bc06-9b553a8a2ed4"), + CreationTime = new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), + IsDeleted = false, + RoleId = new Guid("420a80c3-42b0-47b7-b491-46bee216ac64"), + UserInfoId = new Guid("c46acc21-5067-4611-a5a1-1ce653c33e84") + }); + }); + + modelBuilder.Entity("Token.Management.Domain.Management.Company", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .HasColumnType("longtext"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("Describe") + .HasColumnType("longtext"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("Logo") + .HasColumnType("longtext"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.ToTable("token_company", (string)null); + + b.HasData( + new + { + Id = new Guid("b5c12e64-e349-48b2-b9ea-3b21eb3e9e4b"), + Code = "wr", + CreationTime = new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), + Describe = "微软(Microsoft)是一家 美国 跨国科技企业,由 比尔·盖茨 和 保罗·艾伦 于1975年4月4日创立。 公司总部设立在 华盛顿州 雷德蒙德 (Redmond,邻近 西雅图 ),以 研发 、 制造 、 授权 和提供广泛的 电脑软件 服务业务为主 。", + IsDeleted = false, + Name = "Microsoft" + }); + }); + + modelBuilder.Entity("Token.Management.Domain.Management.Department", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .HasColumnType("longtext"); + + b.Property("CompanyId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("Index") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("UserInfoId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("CompanyId"); + + b.HasIndex("Id"); + + b.HasIndex("UserInfoId"); + + b.ToTable("token_department", (string)null); + + b.HasData( + new + { + Id = new Guid("bd809e02-4630-422d-bf82-8d77c2140b08"), + Code = "cs", + CompanyId = new Guid("b5c12e64-e349-48b2-b9ea-3b21eb3e9e4b"), + CreationTime = new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), + Index = 0, + IsDeleted = false, + Name = "测试部门" + }); + }); + + modelBuilder.Entity("Token.Management.Domain.Management.Menu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Component") + .HasColumnType("longtext"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("Icon") + .HasColumnType("longtext"); + + b.Property("Index") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("Path") + .HasColumnType("longtext"); + + b.Property("Title") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.ToTable("token_menu", (string)null); + + b.HasData( + new + { + Id = new Guid("cb90ab74-4ba5-4286-9ffc-f579e1de4afa"), + Component = "Home", + CreationTime = new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), + Index = 0, + IsDeleted = false, + Name = "首页", + Path = "/home/index", + Title = "首页" + }, + new + { + Id = new Guid("1eee3f07-9612-47d0-9897-c1d4fce15414"), + Component = "User", + CreationTime = new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), + Index = 1, + IsDeleted = false, + Name = "用户管理", + Path = "/user/index", + Title = "用户管理" + }, + new + { + Id = new Guid("741f6e15-143d-489a-b747-38f106481d0b"), + Component = "System", + CreationTime = new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), + Index = 2, + IsDeleted = false, + Name = "系统配置", + Path = "/system/index", + Title = "系统配置" + }, + new + { + Id = new Guid("fee42ae9-c72d-4df0-8094-efa024d1c6e5"), + Component = "Work", + CreationTime = new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), + Index = 3, + IsDeleted = false, + Name = "工作", + Path = "/Work/index", + Title = "工作" + }, + new + { + Id = new Guid("6f1eed56-e99c-4100-a0f9-4df39f14a0ca"), + Component = "UserConfig", + CreationTime = new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), + Index = 1, + IsDeleted = false, + Name = "用户权限配置", + ParentId = new Guid("741f6e15-143d-489a-b747-38f106481d0b"), + Path = "/system/userConfig/index", + Title = "用户权限配置" + }, + new + { + Id = new Guid("dc7de715-7147-4fd9-95eb-c062c126ea72"), + Component = "RoleConfig", + CreationTime = new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), + Index = 0, + IsDeleted = false, + Name = "角色配置", + ParentId = new Guid("741f6e15-143d-489a-b747-38f106481d0b"), + Path = "/system/roleConfig/index", + Title = "角色配置" + }, + new + { + Id = new Guid("07bf458c-029a-4826-a5af-d9d51edb4020"), + Component = "WorkConfig", + CreationTime = new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), + Index = 2, + IsDeleted = false, + Name = "工作流配置", + ParentId = new Guid("741f6e15-143d-489a-b747-38f106481d0b"), + Path = "/system/workConfig/index", + Title = "工作流配置" + }); + }); + + modelBuilder.Entity("Token.Management.Domain.Management.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .HasColumnType("longtext") + .HasComment("角色编号"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("Index") + .HasColumnType("int") + .HasComment("序号"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext") + .HasComment("角色名称"); + + b.Property("ParentId") + .HasColumnType("char(36)") + .HasComment("父节点"); + + b.Property("Remark") + .HasColumnType("longtext") + .HasComment("备注"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.ToTable("token_role", (string)null); + + b.HasData( + new + { + Id = new Guid("420a80c3-42b0-47b7-b491-46bee216ac64"), + Code = "admin", + CreationTime = new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), + Index = 0, + IsDeleted = false, + Name = "管理员", + Remark = "系统管理员" + }); + }); + + modelBuilder.Entity("Token.Management.Domain.SystemService.SystemMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("IsCheck") + .HasColumnType("tinyint(1)"); + + b.Property("Message") + .HasColumnType("longtext"); + + b.Property("Title") + .HasColumnType("longtext"); + + b.Property("WorkFormCode") + .HasColumnType("int"); + + b.Property("WorkFormId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.ToTable("token_system_message", (string)null); + }); + + modelBuilder.Entity("Token.Management.Domain.Users.UserInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AccountNumber") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("EMail") + .HasColumnType("longtext") + .HasComment("邮箱"); + + b.Property("HeadPortraits") + .HasColumnType("longtext") + .HasComment("头像"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("MobileNumber") + .HasMaxLength(11) + .HasColumnType("bigint"); + + b.Property("Name") + .HasColumnType("longtext") + .HasComment("用户昵称"); + + b.Property("Password") + .HasColumnType("longtext") + .HasComment("密码"); + + b.Property("Sex") + .HasColumnType("int") + .HasComment("性别"); + + b.Property("Status") + .HasColumnType("int") + .HasComment("状态"); + + b.Property("WXOpenId") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.ToTable("token_user_info", (string)null); + + b.HasData( + new + { + Id = new Guid("c46acc21-5067-4611-a5a1-1ce653c33e84"), + AccountNumber = "admin", + CreationTime = new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), + EMail = "239573049@qq.com", + HeadPortraits = "https://upfile2.asqql.com/upfile/hdimg/wmtp/wmtp/2018-07/08/18_7_8_16_10_08yoqapqci.jpg", + IsDeleted = false, + MobileNumber = 13049809673L, + Name = "管理员", + Password = "349843DE4F81CDE9456ADEACACE77ECF8DA4197169214575", + Sex = 1, + Status = 0 + }); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkContent.WorkContentDemo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Content") + .HasColumnType("longtext"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("PrincipalId") + .HasColumnType("char(36)"); + + b.Property("SubmitTime") + .HasColumnType("datetime(6)"); + + b.Property("WorkDemoMainId") + .HasColumnType("char(36)"); + + b.Property("WorkFlowNodeStatus") + .HasColumnType("int"); + + b.Property("WorkflowInstanceId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.HasIndex("PrincipalId"); + + b.HasIndex("WorkDemoMainId"); + + b.ToTable("token_work_content_demo", (string)null); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkContent.WorkDemoMain", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Content") + .HasColumnType("longtext"); + + b.Property("EndTime") + .HasColumnType("datetime(6)"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Remark") + .HasColumnType("longtext"); + + b.Property("StartTime") + .HasColumnType("datetime(6)"); + + b.Property("WorkFlowNodeStatus") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.ToTable("token_work_demo_main", (string)null); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkFlow.WorkflowApprovalRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("WorkflowNodeTemplateId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("WorkflowNodeTemplateId"); + + b.ToTable("token_workflow_approval_role", (string)null); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkFlow.WorkflowApprovers", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("UserInfoId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .HasColumnType("longtext"); + + b.Property("WorkFlowFormCode") + .HasColumnType("int"); + + b.Property("WorkflowInstanceId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.HasIndex("WorkflowInstanceId"); + + b.ToTable("token_workflow_approvers", (string)null); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkFlow.WorkflowInstance", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ArchiveDate") + .HasColumnType("datetime(6)"); + + b.Property("Code") + .HasColumnType("longtext") + .HasComment("工作流实例code"); + + b.Property("CurrentRoleCode") + .HasColumnType("longtext"); + + b.Property("HasBeenRead") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Remark") + .HasColumnType("longtext") + .HasComment("工作流实例备注"); + + b.Property("SponsorId") + .HasColumnType("char(36)"); + + b.Property("SponsorName") + .HasColumnType("longtext"); + + b.Property("SponsoredDate") + .HasColumnType("datetime(6)"); + + b.Property("WorkFlowFormCode") + .HasColumnType("int"); + + b.Property("WorkFormId") + .HasColumnType("char(36)"); + + b.Property("WorkflowStatus") + .HasColumnType("int"); + + b.Property("WorkflowTemplateId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.HasIndex("SponsorId"); + + b.HasIndex("WorkflowTemplateId"); + + b.ToTable("token_workflow_instance", (string)null); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkFlow.WorkflowNodeInstance", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditDate") + .HasColumnType("datetime(6)"); + + b.Property("AuditPersonId") + .HasColumnType("char(36)"); + + b.Property("AuditPersonName") + .HasColumnType("longtext"); + + b.Property("Code") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("NextNodeId") + .HasColumnType("char(36)"); + + b.Property("NextTemplateNodeId") + .HasColumnType("char(36)"); + + b.Property("NodeStatus") + .HasColumnType("int"); + + b.Property("PrevNodeId") + .HasColumnType("char(36)"); + + b.Property("PrevTemplateNodeId") + .HasColumnType("char(36)"); + + b.Property("Remark") + .HasColumnType("longtext"); + + b.Property("TemplateNodeId") + .HasColumnType("char(36)"); + + b.Property("WorkflowInstanceId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.HasIndex("WorkflowInstanceId"); + + b.ToTable("token_workflowNode_instance", (string)null); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkFlow.WorkflowNodeTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("NextNodeId") + .HasColumnType("char(36)"); + + b.Property("PrevNodeId") + .HasColumnType("char(36)"); + + b.Property("Remark") + .HasColumnType("longtext"); + + b.Property("WorkflowTemplateId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.HasIndex("WorkflowTemplateId"); + + b.ToTable("token_workflow_node_template", (string)null); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkFlow.WorkflowTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .HasColumnType("longtext") + .HasComment("工作流模板编号"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext") + .HasComment("工作流模板名称"); + + b.Property("Remark") + .HasColumnType("longtext") + .HasComment("工作流模板备注"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.ToTable("token_workflow_template", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Data.ExtraPropertyDictionary", b => + { + b.Property("Count") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.HasKey("Count"); + + b.ToTable("ExtraPropertyDictionary"); + }); + + modelBuilder.Entity("Token.Management.Domain.Management.AccessFunction.MenuRoleFunction", b => + { + b.HasOne("Token.Management.Domain.Management.Menu", "Menu") + .WithMany() + .HasForeignKey("MenuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Token.Management.Domain.Management.Role", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Token.Management.Domain.Users.UserInfo", null) + .WithMany("MenuRoleFunction") + .HasForeignKey("UserInfoId"); + + b.Navigation("Menu"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("Token.Management.Domain.Management.AccessFunction.UserDepartmentFunction", b => + { + b.HasOne("Token.Management.Domain.Management.Department", "Department") + .WithMany("UserDepartmentFunction") + .HasForeignKey("DepartmentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Token.Management.Domain.Users.UserInfo", "UserInfo") + .WithMany("UserDepartmentFunction") + .HasForeignKey("UserInfoId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Department"); + + b.Navigation("UserInfo"); + }); + + modelBuilder.Entity("Token.Management.Domain.Management.AccessFunction.UserRoleFunction", b => + { + b.HasOne("Token.Management.Domain.Management.Role", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Token.Management.Domain.Users.UserInfo", "UserInfo") + .WithMany("UserRoleFunction") + .HasForeignKey("UserInfoId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + + b.Navigation("UserInfo"); + }); + + modelBuilder.Entity("Token.Management.Domain.Management.Department", b => + { + b.HasOne("Token.Management.Domain.Management.Company", "Company") + .WithMany("Department") + .HasForeignKey("CompanyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Token.Management.Domain.Users.UserInfo", null) + .WithMany("Department") + .HasForeignKey("UserInfoId"); + + b.Navigation("Company"); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkContent.WorkContentDemo", b => + { + b.HasOne("Token.Management.Domain.Users.UserInfo", "Principal") + .WithMany() + .HasForeignKey("PrincipalId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Token.Management.Domain.WorkContent.WorkDemoMain", "WorkDemoMain") + .WithMany("WorkContentDemo") + .HasForeignKey("WorkDemoMainId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Principal"); + + b.Navigation("WorkDemoMain"); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkFlow.WorkflowApprovalRole", b => + { + b.HasOne("Token.Management.Domain.Management.Role", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Token.Management.Domain.WorkFlow.WorkflowNodeTemplate", "WorkflowNodeTemplate") + .WithMany("WorkflowApprovalRole") + .HasForeignKey("WorkflowNodeTemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + + b.Navigation("WorkflowNodeTemplate"); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkFlow.WorkflowApprovers", b => + { + b.HasOne("Token.Management.Domain.WorkFlow.WorkflowInstance", "WorkflowInstance") + .WithMany("WorkflowApprovers") + .HasForeignKey("WorkflowInstanceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("WorkflowInstance"); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkFlow.WorkflowInstance", b => + { + b.HasOne("Token.Management.Domain.Users.UserInfo", "Sponsor") + .WithMany() + .HasForeignKey("SponsorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Token.Management.Domain.WorkFlow.WorkflowTemplate", "WorkflowTemplate") + .WithMany("WorkflowInstance") + .HasForeignKey("WorkflowTemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Sponsor"); + + b.Navigation("WorkflowTemplate"); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkFlow.WorkflowNodeInstance", b => + { + b.HasOne("Token.Management.Domain.WorkFlow.WorkflowInstance", "WorkflowInstance") + .WithMany("WorkflowNodeInstances") + .HasForeignKey("WorkflowInstanceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("WorkflowInstance"); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkFlow.WorkflowNodeTemplate", b => + { + b.HasOne("Token.Management.Domain.WorkFlow.WorkflowTemplate", "WorkflowTemplate") + .WithMany("WorkflowNodeTemplate") + .HasForeignKey("WorkflowTemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("WorkflowTemplate"); + }); + + modelBuilder.Entity("Token.Management.Domain.Management.Company", b => + { + b.Navigation("Department"); + }); + + modelBuilder.Entity("Token.Management.Domain.Management.Department", b => + { + b.Navigation("UserDepartmentFunction"); + }); + + modelBuilder.Entity("Token.Management.Domain.Users.UserInfo", b => + { + b.Navigation("Department"); + + b.Navigation("MenuRoleFunction"); + + b.Navigation("UserDepartmentFunction"); + + b.Navigation("UserRoleFunction"); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkContent.WorkDemoMain", b => + { + b.Navigation("WorkContentDemo"); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkFlow.WorkflowInstance", b => + { + b.Navigation("WorkflowApprovers"); + + b.Navigation("WorkflowNodeInstances"); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkFlow.WorkflowNodeTemplate", b => + { + b.Navigation("WorkflowApprovalRole"); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkFlow.WorkflowTemplate", b => + { + b.Navigation("WorkflowInstance"); + + b.Navigation("WorkflowNodeTemplate"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Token.Management.EntityFrameworkCore/Migrations/20220607173109_Date.cs b/src/Token.Management.EntityFrameworkCore/Migrations/20220607173109_Date.cs new file mode 100644 index 0000000000000000000000000000000000000000..667633128b24ea97400f86709e1cc4d4e80110c5 --- /dev/null +++ b/src/Token.Management.EntityFrameworkCore/Migrations/20220607173109_Date.cs @@ -0,0 +1,790 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Token.Management.EntityFrameworkCore.Migrations +{ + public partial class Date : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterDatabase() + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "ExtraPropertyDictionary", + columns: table => new + { + Count = table.Column(type: "int", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + }, + constraints: table => + { + table.PrimaryKey("PK_ExtraPropertyDictionary", x => x.Count); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "token_company", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Code = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Logo = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Describe = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false), + CreationTime = table.Column(type: "datetime(6)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_token_company", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "token_menu", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Index = table.Column(type: "int", nullable: false), + Component = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Title = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Icon = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Path = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ParentId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false), + CreationTime = table.Column(type: "datetime(6)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_token_menu", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "token_role", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "longtext", nullable: true, comment: "角色名称") + .Annotation("MySql:CharSet", "utf8mb4"), + Code = table.Column(type: "longtext", nullable: true, comment: "角色编号") + .Annotation("MySql:CharSet", "utf8mb4"), + Remark = table.Column(type: "longtext", nullable: true, comment: "备注") + .Annotation("MySql:CharSet", "utf8mb4"), + Index = table.Column(type: "int", nullable: false, comment: "序号"), + ParentId = table.Column(type: "char(36)", nullable: true, comment: "父节点", collation: "ascii_general_ci"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false), + CreationTime = table.Column(type: "datetime(6)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_token_role", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "token_system_message", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Title = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Message = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IsCheck = table.Column(type: "tinyint(1)", nullable: false), + WorkFormCode = table.Column(type: "int", nullable: false), + WorkFormId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_token_system_message", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "token_user_info", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + AccountNumber = table.Column(type: "longtext", nullable: false) + .Annotation("MySql:CharSet", "utf8mb4"), + Password = table.Column(type: "longtext", nullable: true, comment: "密码") + .Annotation("MySql:CharSet", "utf8mb4"), + WXOpenId = table.Column(type: "varchar(50)", maxLength: 50, nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Name = table.Column(type: "longtext", nullable: true, comment: "用户昵称") + .Annotation("MySql:CharSet", "utf8mb4"), + HeadPortraits = table.Column(type: "longtext", nullable: true, comment: "头像") + .Annotation("MySql:CharSet", "utf8mb4"), + Sex = table.Column(type: "int", nullable: false, comment: "性别"), + Status = table.Column(type: "int", nullable: false, comment: "状态"), + MobileNumber = table.Column(type: "bigint", maxLength: 11, nullable: true), + EMail = table.Column(type: "longtext", nullable: true, comment: "邮箱") + .Annotation("MySql:CharSet", "utf8mb4"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false), + CreationTime = table.Column(type: "datetime(6)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_token_user_info", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "token_work_demo_main", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Remark = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Content = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + WorkFlowNodeStatus = table.Column(type: "int", nullable: false), + StartTime = table.Column(type: "datetime(6)", nullable: true), + EndTime = table.Column(type: "datetime(6)", nullable: true), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_token_work_demo_main", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "token_workflow_template", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "longtext", nullable: true, comment: "工作流模板名称") + .Annotation("MySql:CharSet", "utf8mb4"), + Code = table.Column(type: "longtext", nullable: true, comment: "工作流模板编号") + .Annotation("MySql:CharSet", "utf8mb4"), + Remark = table.Column(type: "longtext", nullable: true, comment: "工作流模板备注") + .Annotation("MySql:CharSet", "utf8mb4"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_token_workflow_template", x => x.Id); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "token_department", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Code = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + ParentId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + Index = table.Column(type: "int", nullable: false), + CompanyId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + UserInfoId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_token_department", x => x.Id); + table.ForeignKey( + name: "FK_token_department_token_company_CompanyId", + column: x => x.CompanyId, + principalTable: "token_company", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_token_department_token_user_info_UserInfoId", + column: x => x.UserInfoId, + principalTable: "token_user_info", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "token_menu_role_function", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + MenuId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + RoleId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + UserInfoId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") + }, + constraints: table => + { + table.PrimaryKey("PK_token_menu_role_function", x => x.Id); + table.ForeignKey( + name: "FK_token_menu_role_function_token_menu_MenuId", + column: x => x.MenuId, + principalTable: "token_menu", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_token_menu_role_function_token_role_RoleId", + column: x => x.RoleId, + principalTable: "token_role", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_token_menu_role_function_token_user_info_UserInfoId", + column: x => x.UserInfoId, + principalTable: "token_user_info", + principalColumn: "Id"); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "token_user_role_function", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + UserInfoId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + RoleId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + CreationTime = table.Column(type: "datetime(6)", nullable: false), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_token_user_role_function", x => x.Id); + table.ForeignKey( + name: "FK_token_user_role_function_token_role_RoleId", + column: x => x.RoleId, + principalTable: "token_role", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_token_user_role_function_token_user_info_UserInfoId", + column: x => x.UserInfoId, + principalTable: "token_user_info", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "token_work_content_demo", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Content = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + PrincipalId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + WorkDemoMainId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + WorkFlowNodeStatus = table.Column(type: "int", nullable: false), + WorkflowInstanceId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + SubmitTime = table.Column(type: "datetime(6)", nullable: true), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_token_work_content_demo", x => x.Id); + table.ForeignKey( + name: "FK_token_work_content_demo_token_user_info_PrincipalId", + column: x => x.PrincipalId, + principalTable: "token_user_info", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_token_work_content_demo_token_work_demo_main_WorkDemoMainId", + column: x => x.WorkDemoMainId, + principalTable: "token_work_demo_main", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "token_workflow_instance", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + SponsorId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + SponsorName = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Code = table.Column(type: "longtext", nullable: true, comment: "工作流实例code") + .Annotation("MySql:CharSet", "utf8mb4"), + Remark = table.Column(type: "longtext", nullable: true, comment: "工作流实例备注") + .Annotation("MySql:CharSet", "utf8mb4"), + WorkflowTemplateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + WorkFormId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + WorkflowStatus = table.Column(type: "int", nullable: false), + SponsoredDate = table.Column(type: "datetime(6)", nullable: true), + WorkFlowFormCode = table.Column(type: "int", nullable: false), + ArchiveDate = table.Column(type: "datetime(6)", nullable: true), + HasBeenRead = table.Column(type: "tinyint(1)", nullable: false), + CurrentRoleCode = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_token_workflow_instance", x => x.Id); + table.ForeignKey( + name: "FK_token_workflow_instance_token_user_info_SponsorId", + column: x => x.SponsorId, + principalTable: "token_user_info", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_token_workflow_instance_token_workflow_template_WorkflowTemp~", + column: x => x.WorkflowTemplateId, + principalTable: "token_workflow_template", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "token_workflow_node_template", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + WorkflowTemplateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Code = table.Column(type: "int", nullable: false), + PrevNodeId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + NextNodeId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + Remark = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_token_workflow_node_template", x => x.Id); + table.ForeignKey( + name: "FK_token_workflow_node_template_token_workflow_template_Workflo~", + column: x => x.WorkflowTemplateId, + principalTable: "token_workflow_template", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "token_user_department_function", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + UserInfoId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + DepartmentId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false), + CreationTime = table.Column(type: "datetime(6)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_token_user_department_function", x => x.Id); + table.ForeignKey( + name: "FK_token_user_department_function_token_department_DepartmentId", + column: x => x.DepartmentId, + principalTable: "token_department", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_token_user_department_function_token_user_info_UserInfoId", + column: x => x.UserInfoId, + principalTable: "token_user_info", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "token_workflow_approvers", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + UserInfoId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + UserName = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + WorkflowInstanceId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + WorkFlowFormCode = table.Column(type: "int", nullable: false), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_token_workflow_approvers", x => x.Id); + table.ForeignKey( + name: "FK_token_workflow_approvers_token_workflow_instance_WorkflowIns~", + column: x => x.WorkflowInstanceId, + principalTable: "token_workflow_instance", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "token_workflowNode_instance", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + WorkflowInstanceId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + Name = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + Code = table.Column(type: "int", nullable: false), + TemplateNodeId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + PrevTemplateNodeId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + NextTemplateNodeId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + PrevNodeId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + NextNodeId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + Remark = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AuditPersonId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), + AuditPersonName = table.Column(type: "longtext", nullable: true) + .Annotation("MySql:CharSet", "utf8mb4"), + AuditDate = table.Column(type: "datetime(6)", nullable: true), + NodeStatus = table.Column(type: "int", nullable: false), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_token_workflowNode_instance", x => x.Id); + table.ForeignKey( + name: "FK_token_workflowNode_instance_token_workflow_instance_Workflow~", + column: x => x.WorkflowInstanceId, + principalTable: "token_workflow_instance", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.CreateTable( + name: "token_workflow_approval_role", + columns: table => new + { + Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + WorkflowNodeTemplateId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + RoleId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), + IsDeleted = table.Column(type: "tinyint(1)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_token_workflow_approval_role", x => x.Id); + table.ForeignKey( + name: "FK_token_workflow_approval_role_token_role_RoleId", + column: x => x.RoleId, + principalTable: "token_role", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_token_workflow_approval_role_token_workflow_node_template_Wo~", + column: x => x.WorkflowNodeTemplateId, + principalTable: "token_workflow_node_template", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }) + .Annotation("MySql:CharSet", "utf8mb4"); + + migrationBuilder.InsertData( + table: "token_company", + columns: new[] { "Id", "Code", "CreationTime", "Describe", "IsDeleted", "Logo", "Name" }, + values: new object[] { new Guid("b5c12e64-e349-48b2-b9ea-3b21eb3e9e4b"), "wr", new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), "微软(Microsoft)是一家 美国 跨国科技企业,由 比尔·盖茨 和 保罗·艾伦 于1975年4月4日创立。 公司总部设立在 华盛顿州 雷德蒙德 (Redmond,邻近 西雅图 ),以 研发 、 制造 、 授权 和提供广泛的 电脑软件 服务业务为主 。", false, null, "Microsoft" }); + + migrationBuilder.InsertData( + table: "token_menu", + columns: new[] { "Id", "Component", "CreationTime", "Icon", "Index", "IsDeleted", "Name", "ParentId", "Path", "Title" }, + values: new object[,] + { + { new Guid("07bf458c-029a-4826-a5af-d9d51edb4020"), "WorkConfig", new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), null, 2, false, "工作流配置", new Guid("741f6e15-143d-489a-b747-38f106481d0b"), "/system/workConfig/index", "工作流配置" }, + { new Guid("1eee3f07-9612-47d0-9897-c1d4fce15414"), "User", new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), null, 1, false, "用户管理", null, "/user/index", "用户管理" }, + { new Guid("6f1eed56-e99c-4100-a0f9-4df39f14a0ca"), "UserConfig", new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), null, 1, false, "用户权限配置", new Guid("741f6e15-143d-489a-b747-38f106481d0b"), "/system/userConfig/index", "用户权限配置" }, + { new Guid("741f6e15-143d-489a-b747-38f106481d0b"), "System", new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), null, 2, false, "系统配置", null, "/system/index", "系统配置" }, + { new Guid("cb90ab74-4ba5-4286-9ffc-f579e1de4afa"), "Home", new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), null, 0, false, "首页", null, "/home/index", "首页" }, + { new Guid("dc7de715-7147-4fd9-95eb-c062c126ea72"), "RoleConfig", new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), null, 0, false, "角色配置", new Guid("741f6e15-143d-489a-b747-38f106481d0b"), "/system/roleConfig/index", "角色配置" }, + { new Guid("fee42ae9-c72d-4df0-8094-efa024d1c6e5"), "Work", new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), null, 3, false, "工作", null, "/Work/index", "工作" } + }); + + migrationBuilder.InsertData( + table: "token_role", + columns: new[] { "Id", "Code", "CreationTime", "Index", "IsDeleted", "Name", "ParentId", "Remark" }, + values: new object[] { new Guid("420a80c3-42b0-47b7-b491-46bee216ac64"), "admin", new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), 0, false, "管理员", null, "系统管理员" }); + + migrationBuilder.InsertData( + table: "token_user_info", + columns: new[] { "Id", "AccountNumber", "CreationTime", "EMail", "HeadPortraits", "IsDeleted", "MobileNumber", "Name", "Password", "Sex", "Status", "WXOpenId" }, + values: new object[] { new Guid("c46acc21-5067-4611-a5a1-1ce653c33e84"), "admin", new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), "239573049@qq.com", "https://upfile2.asqql.com/upfile/hdimg/wmtp/wmtp/2018-07/08/18_7_8_16_10_08yoqapqci.jpg", false, 13049809673L, "管理员", "349843DE4F81CDE9456ADEACACE77ECF8DA4197169214575", 1, 0, null }); + + migrationBuilder.InsertData( + table: "token_department", + columns: new[] { "Id", "Code", "CompanyId", "CreationTime", "Index", "IsDeleted", "Name", "ParentId", "UserInfoId" }, + values: new object[] { new Guid("bd809e02-4630-422d-bf82-8d77c2140b08"), "cs", new Guid("b5c12e64-e349-48b2-b9ea-3b21eb3e9e4b"), new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), 0, false, "测试部门", null, null }); + + migrationBuilder.InsertData( + table: "token_menu_role_function", + columns: new[] { "Id", "CreationTime", "IsDeleted", "MenuId", "RoleId", "UserInfoId" }, + values: new object[,] + { + { new Guid("07f07059-3c28-4517-9cab-754ee22955c1"), new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), false, new Guid("cb90ab74-4ba5-4286-9ffc-f579e1de4afa"), new Guid("420a80c3-42b0-47b7-b491-46bee216ac64"), null }, + { new Guid("1db2cf2f-d354-4093-b621-1dc94a5a4f3a"), new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), false, new Guid("fee42ae9-c72d-4df0-8094-efa024d1c6e5"), new Guid("420a80c3-42b0-47b7-b491-46bee216ac64"), null }, + { new Guid("43730628-a3b5-48e5-94dd-7d79d28156e4"), new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), false, new Guid("741f6e15-143d-489a-b747-38f106481d0b"), new Guid("420a80c3-42b0-47b7-b491-46bee216ac64"), null }, + { new Guid("484e547c-26b4-49d7-8f0d-bd2107380951"), new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), false, new Guid("6f1eed56-e99c-4100-a0f9-4df39f14a0ca"), new Guid("420a80c3-42b0-47b7-b491-46bee216ac64"), null }, + { new Guid("59e92709-2366-4b66-8462-41f62620c48b"), new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), false, new Guid("dc7de715-7147-4fd9-95eb-c062c126ea72"), new Guid("420a80c3-42b0-47b7-b491-46bee216ac64"), null }, + { new Guid("7d8114c9-9e9e-4463-a2ee-e78799aca22a"), new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), false, new Guid("1eee3f07-9612-47d0-9897-c1d4fce15414"), new Guid("420a80c3-42b0-47b7-b491-46bee216ac64"), null }, + { new Guid("df0e69b1-eadd-457f-8d76-c7808c065582"), new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), false, new Guid("07bf458c-029a-4826-a5af-d9d51edb4020"), new Guid("420a80c3-42b0-47b7-b491-46bee216ac64"), null } + }); + + migrationBuilder.InsertData( + table: "token_user_role_function", + columns: new[] { "Id", "CreationTime", "IsDeleted", "RoleId", "UserInfoId" }, + values: new object[] { new Guid("b94fada4-5433-49b1-bc06-9b553a8a2ed4"), new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), false, new Guid("420a80c3-42b0-47b7-b491-46bee216ac64"), new Guid("c46acc21-5067-4611-a5a1-1ce653c33e84") }); + + migrationBuilder.InsertData( + table: "token_user_department_function", + columns: new[] { "Id", "CreationTime", "DepartmentId", "IsDeleted", "UserInfoId" }, + values: new object[] { new Guid("f071ae1b-c55c-44c1-8f94-6b4bfeb9bc0f"), new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), new Guid("bd809e02-4630-422d-bf82-8d77c2140b08"), false, new Guid("c46acc21-5067-4611-a5a1-1ce653c33e84") }); + + migrationBuilder.CreateIndex( + name: "IX_token_company_Id", + table: "token_company", + column: "Id"); + + migrationBuilder.CreateIndex( + name: "IX_token_department_CompanyId", + table: "token_department", + column: "CompanyId"); + + migrationBuilder.CreateIndex( + name: "IX_token_department_Id", + table: "token_department", + column: "Id"); + + migrationBuilder.CreateIndex( + name: "IX_token_department_UserInfoId", + table: "token_department", + column: "UserInfoId"); + + migrationBuilder.CreateIndex( + name: "IX_token_menu_Id", + table: "token_menu", + column: "Id"); + + migrationBuilder.CreateIndex( + name: "IX_token_menu_role_function_Id", + table: "token_menu_role_function", + column: "Id"); + + migrationBuilder.CreateIndex( + name: "IX_token_menu_role_function_MenuId", + table: "token_menu_role_function", + column: "MenuId"); + + migrationBuilder.CreateIndex( + name: "IX_token_menu_role_function_RoleId", + table: "token_menu_role_function", + column: "RoleId"); + + migrationBuilder.CreateIndex( + name: "IX_token_menu_role_function_UserInfoId", + table: "token_menu_role_function", + column: "UserInfoId"); + + migrationBuilder.CreateIndex( + name: "IX_token_role_Id", + table: "token_role", + column: "Id"); + + migrationBuilder.CreateIndex( + name: "IX_token_system_message_Id", + table: "token_system_message", + column: "Id"); + + migrationBuilder.CreateIndex( + name: "IX_token_user_department_function_DepartmentId", + table: "token_user_department_function", + column: "DepartmentId"); + + migrationBuilder.CreateIndex( + name: "IX_token_user_department_function_Id", + table: "token_user_department_function", + column: "Id"); + + migrationBuilder.CreateIndex( + name: "IX_token_user_department_function_UserInfoId", + table: "token_user_department_function", + column: "UserInfoId"); + + migrationBuilder.CreateIndex( + name: "IX_token_user_info_Id", + table: "token_user_info", + column: "Id"); + + migrationBuilder.CreateIndex( + name: "IX_token_user_role_function_Id", + table: "token_user_role_function", + column: "Id"); + + migrationBuilder.CreateIndex( + name: "IX_token_user_role_function_RoleId", + table: "token_user_role_function", + column: "RoleId"); + + migrationBuilder.CreateIndex( + name: "IX_token_user_role_function_UserInfoId", + table: "token_user_role_function", + column: "UserInfoId"); + + migrationBuilder.CreateIndex( + name: "IX_token_work_content_demo_Id", + table: "token_work_content_demo", + column: "Id"); + + migrationBuilder.CreateIndex( + name: "IX_token_work_content_demo_PrincipalId", + table: "token_work_content_demo", + column: "PrincipalId"); + + migrationBuilder.CreateIndex( + name: "IX_token_work_content_demo_WorkDemoMainId", + table: "token_work_content_demo", + column: "WorkDemoMainId"); + + migrationBuilder.CreateIndex( + name: "IX_token_work_demo_main_Id", + table: "token_work_demo_main", + column: "Id"); + + migrationBuilder.CreateIndex( + name: "IX_token_workflow_approval_role_Id", + table: "token_workflow_approval_role", + column: "Id"); + + migrationBuilder.CreateIndex( + name: "IX_token_workflow_approval_role_RoleId", + table: "token_workflow_approval_role", + column: "RoleId"); + + migrationBuilder.CreateIndex( + name: "IX_token_workflow_approval_role_WorkflowNodeTemplateId", + table: "token_workflow_approval_role", + column: "WorkflowNodeTemplateId"); + + migrationBuilder.CreateIndex( + name: "IX_token_workflow_approvers_Id", + table: "token_workflow_approvers", + column: "Id"); + + migrationBuilder.CreateIndex( + name: "IX_token_workflow_approvers_WorkflowInstanceId", + table: "token_workflow_approvers", + column: "WorkflowInstanceId"); + + migrationBuilder.CreateIndex( + name: "IX_token_workflow_instance_Id", + table: "token_workflow_instance", + column: "Id"); + + migrationBuilder.CreateIndex( + name: "IX_token_workflow_instance_SponsorId", + table: "token_workflow_instance", + column: "SponsorId"); + + migrationBuilder.CreateIndex( + name: "IX_token_workflow_instance_WorkflowTemplateId", + table: "token_workflow_instance", + column: "WorkflowTemplateId"); + + migrationBuilder.CreateIndex( + name: "IX_token_workflow_node_template_Id", + table: "token_workflow_node_template", + column: "Id"); + + migrationBuilder.CreateIndex( + name: "IX_token_workflow_node_template_WorkflowTemplateId", + table: "token_workflow_node_template", + column: "WorkflowTemplateId"); + + migrationBuilder.CreateIndex( + name: "IX_token_workflow_template_Id", + table: "token_workflow_template", + column: "Id"); + + migrationBuilder.CreateIndex( + name: "IX_token_workflowNode_instance_Id", + table: "token_workflowNode_instance", + column: "Id"); + + migrationBuilder.CreateIndex( + name: "IX_token_workflowNode_instance_WorkflowInstanceId", + table: "token_workflowNode_instance", + column: "WorkflowInstanceId"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "ExtraPropertyDictionary"); + + migrationBuilder.DropTable( + name: "token_menu_role_function"); + + migrationBuilder.DropTable( + name: "token_system_message"); + + migrationBuilder.DropTable( + name: "token_user_department_function"); + + migrationBuilder.DropTable( + name: "token_user_role_function"); + + migrationBuilder.DropTable( + name: "token_work_content_demo"); + + migrationBuilder.DropTable( + name: "token_workflow_approval_role"); + + migrationBuilder.DropTable( + name: "token_workflow_approvers"); + + migrationBuilder.DropTable( + name: "token_workflowNode_instance"); + + migrationBuilder.DropTable( + name: "token_menu"); + + migrationBuilder.DropTable( + name: "token_department"); + + migrationBuilder.DropTable( + name: "token_work_demo_main"); + + migrationBuilder.DropTable( + name: "token_role"); + + migrationBuilder.DropTable( + name: "token_workflow_node_template"); + + migrationBuilder.DropTable( + name: "token_workflow_instance"); + + migrationBuilder.DropTable( + name: "token_company"); + + migrationBuilder.DropTable( + name: "token_user_info"); + + migrationBuilder.DropTable( + name: "token_workflow_template"); + } + } +} diff --git a/src/Token.Management.EntityFrameworkCore/Migrations/TokenDbContextModelSnapshot.cs b/src/Token.Management.EntityFrameworkCore/Migrations/TokenDbContextModelSnapshot.cs new file mode 100644 index 0000000000000000000000000000000000000000..8ad4bef0404801dc5416a5381a756d6e50bf4ddb --- /dev/null +++ b/src/Token.Management.EntityFrameworkCore/Migrations/TokenDbContextModelSnapshot.cs @@ -0,0 +1,1093 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Token.Management.EntityFrameworkCore.EntityFrameworkCore; + +#nullable disable + +namespace Token.Management.EntityFrameworkCore.Migrations +{ + [DbContext(typeof(TokenDbContext))] + partial class TokenDbContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "6.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("Token.Management.Domain.Management.AccessFunction.MenuRoleFunction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("MenuId") + .HasColumnType("char(36)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("UserInfoId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.HasIndex("MenuId"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserInfoId"); + + b.ToTable("token_menu_role_function", (string)null); + + b.HasData( + new + { + Id = new Guid("07f07059-3c28-4517-9cab-754ee22955c1"), + CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + IsDeleted = false, + MenuId = new Guid("cb90ab74-4ba5-4286-9ffc-f579e1de4afa"), + RoleId = new Guid("420a80c3-42b0-47b7-b491-46bee216ac64") + }, + new + { + Id = new Guid("7d8114c9-9e9e-4463-a2ee-e78799aca22a"), + CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + IsDeleted = false, + MenuId = new Guid("1eee3f07-9612-47d0-9897-c1d4fce15414"), + RoleId = new Guid("420a80c3-42b0-47b7-b491-46bee216ac64") + }, + new + { + Id = new Guid("43730628-a3b5-48e5-94dd-7d79d28156e4"), + CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + IsDeleted = false, + MenuId = new Guid("741f6e15-143d-489a-b747-38f106481d0b"), + RoleId = new Guid("420a80c3-42b0-47b7-b491-46bee216ac64") + }, + new + { + Id = new Guid("1db2cf2f-d354-4093-b621-1dc94a5a4f3a"), + CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + IsDeleted = false, + MenuId = new Guid("fee42ae9-c72d-4df0-8094-efa024d1c6e5"), + RoleId = new Guid("420a80c3-42b0-47b7-b491-46bee216ac64") + }, + new + { + Id = new Guid("484e547c-26b4-49d7-8f0d-bd2107380951"), + CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + IsDeleted = false, + MenuId = new Guid("6f1eed56-e99c-4100-a0f9-4df39f14a0ca"), + RoleId = new Guid("420a80c3-42b0-47b7-b491-46bee216ac64") + }, + new + { + Id = new Guid("59e92709-2366-4b66-8462-41f62620c48b"), + CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + IsDeleted = false, + MenuId = new Guid("dc7de715-7147-4fd9-95eb-c062c126ea72"), + RoleId = new Guid("420a80c3-42b0-47b7-b491-46bee216ac64") + }, + new + { + Id = new Guid("df0e69b1-eadd-457f-8d76-c7808c065582"), + CreationTime = new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), + IsDeleted = false, + MenuId = new Guid("07bf458c-029a-4826-a5af-d9d51edb4020"), + RoleId = new Guid("420a80c3-42b0-47b7-b491-46bee216ac64") + }); + }); + + modelBuilder.Entity("Token.Management.Domain.Management.AccessFunction.UserDepartmentFunction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("DepartmentId") + .HasColumnType("char(36)"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("UserInfoId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("DepartmentId"); + + b.HasIndex("Id"); + + b.HasIndex("UserInfoId"); + + b.ToTable("token_user_department_function", (string)null); + + b.HasData( + new + { + Id = new Guid("f071ae1b-c55c-44c1-8f94-6b4bfeb9bc0f"), + CreationTime = new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), + DepartmentId = new Guid("bd809e02-4630-422d-bf82-8d77c2140b08"), + IsDeleted = false, + UserInfoId = new Guid("c46acc21-5067-4611-a5a1-1ce653c33e84") + }); + }); + + modelBuilder.Entity("Token.Management.Domain.Management.AccessFunction.UserRoleFunction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("UserInfoId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("UserInfoId"); + + b.ToTable("token_user_role_function", (string)null); + + b.HasData( + new + { + Id = new Guid("b94fada4-5433-49b1-bc06-9b553a8a2ed4"), + CreationTime = new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), + IsDeleted = false, + RoleId = new Guid("420a80c3-42b0-47b7-b491-46bee216ac64"), + UserInfoId = new Guid("c46acc21-5067-4611-a5a1-1ce653c33e84") + }); + }); + + modelBuilder.Entity("Token.Management.Domain.Management.Company", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .HasColumnType("longtext"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("Describe") + .HasColumnType("longtext"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("Logo") + .HasColumnType("longtext"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.ToTable("token_company", (string)null); + + b.HasData( + new + { + Id = new Guid("b5c12e64-e349-48b2-b9ea-3b21eb3e9e4b"), + Code = "wr", + CreationTime = new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), + Describe = "微软(Microsoft)是一家 美国 跨国科技企业,由 比尔·盖茨 和 保罗·艾伦 于1975年4月4日创立。 公司总部设立在 华盛顿州 雷德蒙德 (Redmond,邻近 西雅图 ),以 研发 、 制造 、 授权 和提供广泛的 电脑软件 服务业务为主 。", + IsDeleted = false, + Name = "Microsoft" + }); + }); + + modelBuilder.Entity("Token.Management.Domain.Management.Department", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .HasColumnType("longtext"); + + b.Property("CompanyId") + .HasColumnType("char(36)"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("Index") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("UserInfoId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("CompanyId"); + + b.HasIndex("Id"); + + b.HasIndex("UserInfoId"); + + b.ToTable("token_department", (string)null); + + b.HasData( + new + { + Id = new Guid("bd809e02-4630-422d-bf82-8d77c2140b08"), + Code = "cs", + CompanyId = new Guid("b5c12e64-e349-48b2-b9ea-3b21eb3e9e4b"), + CreationTime = new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), + Index = 0, + IsDeleted = false, + Name = "测试部门" + }); + }); + + modelBuilder.Entity("Token.Management.Domain.Management.Menu", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Component") + .HasColumnType("longtext"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("Icon") + .HasColumnType("longtext"); + + b.Property("Index") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("ParentId") + .HasColumnType("char(36)"); + + b.Property("Path") + .HasColumnType("longtext"); + + b.Property("Title") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.ToTable("token_menu", (string)null); + + b.HasData( + new + { + Id = new Guid("cb90ab74-4ba5-4286-9ffc-f579e1de4afa"), + Component = "Home", + CreationTime = new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), + Index = 0, + IsDeleted = false, + Name = "首页", + Path = "/home/index", + Title = "首页" + }, + new + { + Id = new Guid("1eee3f07-9612-47d0-9897-c1d4fce15414"), + Component = "User", + CreationTime = new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), + Index = 1, + IsDeleted = false, + Name = "用户管理", + Path = "/user/index", + Title = "用户管理" + }, + new + { + Id = new Guid("741f6e15-143d-489a-b747-38f106481d0b"), + Component = "System", + CreationTime = new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), + Index = 2, + IsDeleted = false, + Name = "系统配置", + Path = "/system/index", + Title = "系统配置" + }, + new + { + Id = new Guid("fee42ae9-c72d-4df0-8094-efa024d1c6e5"), + Component = "Work", + CreationTime = new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), + Index = 3, + IsDeleted = false, + Name = "工作", + Path = "/Work/index", + Title = "工作" + }, + new + { + Id = new Guid("6f1eed56-e99c-4100-a0f9-4df39f14a0ca"), + Component = "UserConfig", + CreationTime = new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), + Index = 1, + IsDeleted = false, + Name = "用户权限配置", + ParentId = new Guid("741f6e15-143d-489a-b747-38f106481d0b"), + Path = "/system/userConfig/index", + Title = "用户权限配置" + }, + new + { + Id = new Guid("dc7de715-7147-4fd9-95eb-c062c126ea72"), + Component = "RoleConfig", + CreationTime = new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), + Index = 0, + IsDeleted = false, + Name = "角色配置", + ParentId = new Guid("741f6e15-143d-489a-b747-38f106481d0b"), + Path = "/system/roleConfig/index", + Title = "角色配置" + }, + new + { + Id = new Guid("07bf458c-029a-4826-a5af-d9d51edb4020"), + Component = "WorkConfig", + CreationTime = new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), + Index = 2, + IsDeleted = false, + Name = "工作流配置", + ParentId = new Guid("741f6e15-143d-489a-b747-38f106481d0b"), + Path = "/system/workConfig/index", + Title = "工作流配置" + }); + }); + + modelBuilder.Entity("Token.Management.Domain.Management.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .HasColumnType("longtext") + .HasComment("角色编号"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("Index") + .HasColumnType("int") + .HasComment("序号"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext") + .HasComment("角色名称"); + + b.Property("ParentId") + .HasColumnType("char(36)") + .HasComment("父节点"); + + b.Property("Remark") + .HasColumnType("longtext") + .HasComment("备注"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.ToTable("token_role", (string)null); + + b.HasData( + new + { + Id = new Guid("420a80c3-42b0-47b7-b491-46bee216ac64"), + Code = "admin", + CreationTime = new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), + Index = 0, + IsDeleted = false, + Name = "管理员", + Remark = "系统管理员" + }); + }); + + modelBuilder.Entity("Token.Management.Domain.SystemService.SystemMessage", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("IsCheck") + .HasColumnType("tinyint(1)"); + + b.Property("Message") + .HasColumnType("longtext"); + + b.Property("Title") + .HasColumnType("longtext"); + + b.Property("WorkFormCode") + .HasColumnType("int"); + + b.Property("WorkFormId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.ToTable("token_system_message", (string)null); + }); + + modelBuilder.Entity("Token.Management.Domain.Users.UserInfo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AccountNumber") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("CreationTime") + .HasColumnType("datetime(6)"); + + b.Property("EMail") + .HasColumnType("longtext") + .HasComment("邮箱"); + + b.Property("HeadPortraits") + .HasColumnType("longtext") + .HasComment("头像"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("MobileNumber") + .HasMaxLength(11) + .HasColumnType("bigint"); + + b.Property("Name") + .HasColumnType("longtext") + .HasComment("用户昵称"); + + b.Property("Password") + .HasColumnType("longtext") + .HasComment("密码"); + + b.Property("Sex") + .HasColumnType("int") + .HasComment("性别"); + + b.Property("Status") + .HasColumnType("int") + .HasComment("状态"); + + b.Property("WXOpenId") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.ToTable("token_user_info", (string)null); + + b.HasData( + new + { + Id = new Guid("c46acc21-5067-4611-a5a1-1ce653c33e84"), + AccountNumber = "admin", + CreationTime = new DateTime(2022, 6, 8, 1, 31, 8, 952, DateTimeKind.Local).AddTicks(5195), + EMail = "239573049@qq.com", + HeadPortraits = "https://upfile2.asqql.com/upfile/hdimg/wmtp/wmtp/2018-07/08/18_7_8_16_10_08yoqapqci.jpg", + IsDeleted = false, + MobileNumber = 13049809673L, + Name = "管理员", + Password = "349843DE4F81CDE9456ADEACACE77ECF8DA4197169214575", + Sex = 1, + Status = 0 + }); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkContent.WorkContentDemo", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Content") + .HasColumnType("longtext"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("PrincipalId") + .HasColumnType("char(36)"); + + b.Property("SubmitTime") + .HasColumnType("datetime(6)"); + + b.Property("WorkDemoMainId") + .HasColumnType("char(36)"); + + b.Property("WorkFlowNodeStatus") + .HasColumnType("int"); + + b.Property("WorkflowInstanceId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.HasIndex("PrincipalId"); + + b.HasIndex("WorkDemoMainId"); + + b.ToTable("token_work_content_demo", (string)null); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkContent.WorkDemoMain", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Content") + .HasColumnType("longtext"); + + b.Property("EndTime") + .HasColumnType("datetime(6)"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Remark") + .HasColumnType("longtext"); + + b.Property("StartTime") + .HasColumnType("datetime(6)"); + + b.Property("WorkFlowNodeStatus") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.ToTable("token_work_demo_main", (string)null); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkFlow.WorkflowApprovalRole", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("RoleId") + .HasColumnType("char(36)"); + + b.Property("WorkflowNodeTemplateId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.HasIndex("RoleId"); + + b.HasIndex("WorkflowNodeTemplateId"); + + b.ToTable("token_workflow_approval_role", (string)null); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkFlow.WorkflowApprovers", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("UserInfoId") + .HasColumnType("char(36)"); + + b.Property("UserName") + .HasColumnType("longtext"); + + b.Property("WorkFlowFormCode") + .HasColumnType("int"); + + b.Property("WorkflowInstanceId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.HasIndex("WorkflowInstanceId"); + + b.ToTable("token_workflow_approvers", (string)null); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkFlow.WorkflowInstance", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("ArchiveDate") + .HasColumnType("datetime(6)"); + + b.Property("Code") + .HasColumnType("longtext") + .HasComment("工作流实例code"); + + b.Property("CurrentRoleCode") + .HasColumnType("longtext"); + + b.Property("HasBeenRead") + .HasColumnType("tinyint(1)"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("Remark") + .HasColumnType("longtext") + .HasComment("工作流实例备注"); + + b.Property("SponsorId") + .HasColumnType("char(36)"); + + b.Property("SponsorName") + .HasColumnType("longtext"); + + b.Property("SponsoredDate") + .HasColumnType("datetime(6)"); + + b.Property("WorkFlowFormCode") + .HasColumnType("int"); + + b.Property("WorkFormId") + .HasColumnType("char(36)"); + + b.Property("WorkflowStatus") + .HasColumnType("int"); + + b.Property("WorkflowTemplateId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.HasIndex("SponsorId"); + + b.HasIndex("WorkflowTemplateId"); + + b.ToTable("token_workflow_instance", (string)null); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkFlow.WorkflowNodeInstance", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("AuditDate") + .HasColumnType("datetime(6)"); + + b.Property("AuditPersonId") + .HasColumnType("char(36)"); + + b.Property("AuditPersonName") + .HasColumnType("longtext"); + + b.Property("Code") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("NextNodeId") + .HasColumnType("char(36)"); + + b.Property("NextTemplateNodeId") + .HasColumnType("char(36)"); + + b.Property("NodeStatus") + .HasColumnType("int"); + + b.Property("PrevNodeId") + .HasColumnType("char(36)"); + + b.Property("PrevTemplateNodeId") + .HasColumnType("char(36)"); + + b.Property("Remark") + .HasColumnType("longtext"); + + b.Property("TemplateNodeId") + .HasColumnType("char(36)"); + + b.Property("WorkflowInstanceId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.HasIndex("WorkflowInstanceId"); + + b.ToTable("token_workflowNode_instance", (string)null); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkFlow.WorkflowNodeTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .HasColumnType("int"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("NextNodeId") + .HasColumnType("char(36)"); + + b.Property("PrevNodeId") + .HasColumnType("char(36)"); + + b.Property("Remark") + .HasColumnType("longtext"); + + b.Property("WorkflowTemplateId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.HasIndex("WorkflowTemplateId"); + + b.ToTable("token_workflow_node_template", (string)null); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkFlow.WorkflowTemplate", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("Code") + .HasColumnType("longtext") + .HasComment("工作流模板编号"); + + b.Property("IsDeleted") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext") + .HasComment("工作流模板名称"); + + b.Property("Remark") + .HasColumnType("longtext") + .HasComment("工作流模板备注"); + + b.HasKey("Id"); + + b.HasIndex("Id"); + + b.ToTable("token_workflow_template", (string)null); + }); + + modelBuilder.Entity("Volo.Abp.Data.ExtraPropertyDictionary", b => + { + b.Property("Count") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.HasKey("Count"); + + b.ToTable("ExtraPropertyDictionary"); + }); + + modelBuilder.Entity("Token.Management.Domain.Management.AccessFunction.MenuRoleFunction", b => + { + b.HasOne("Token.Management.Domain.Management.Menu", "Menu") + .WithMany() + .HasForeignKey("MenuId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Token.Management.Domain.Management.Role", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Token.Management.Domain.Users.UserInfo", null) + .WithMany("MenuRoleFunction") + .HasForeignKey("UserInfoId"); + + b.Navigation("Menu"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("Token.Management.Domain.Management.AccessFunction.UserDepartmentFunction", b => + { + b.HasOne("Token.Management.Domain.Management.Department", "Department") + .WithMany("UserDepartmentFunction") + .HasForeignKey("DepartmentId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Token.Management.Domain.Users.UserInfo", "UserInfo") + .WithMany("UserDepartmentFunction") + .HasForeignKey("UserInfoId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Department"); + + b.Navigation("UserInfo"); + }); + + modelBuilder.Entity("Token.Management.Domain.Management.AccessFunction.UserRoleFunction", b => + { + b.HasOne("Token.Management.Domain.Management.Role", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Token.Management.Domain.Users.UserInfo", "UserInfo") + .WithMany("UserRoleFunction") + .HasForeignKey("UserInfoId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + + b.Navigation("UserInfo"); + }); + + modelBuilder.Entity("Token.Management.Domain.Management.Department", b => + { + b.HasOne("Token.Management.Domain.Management.Company", "Company") + .WithMany("Department") + .HasForeignKey("CompanyId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Token.Management.Domain.Users.UserInfo", null) + .WithMany("Department") + .HasForeignKey("UserInfoId"); + + b.Navigation("Company"); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkContent.WorkContentDemo", b => + { + b.HasOne("Token.Management.Domain.Users.UserInfo", "Principal") + .WithMany() + .HasForeignKey("PrincipalId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Token.Management.Domain.WorkContent.WorkDemoMain", "WorkDemoMain") + .WithMany("WorkContentDemo") + .HasForeignKey("WorkDemoMainId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Principal"); + + b.Navigation("WorkDemoMain"); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkFlow.WorkflowApprovalRole", b => + { + b.HasOne("Token.Management.Domain.Management.Role", "Role") + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Token.Management.Domain.WorkFlow.WorkflowNodeTemplate", "WorkflowNodeTemplate") + .WithMany("WorkflowApprovalRole") + .HasForeignKey("WorkflowNodeTemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + + b.Navigation("WorkflowNodeTemplate"); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkFlow.WorkflowApprovers", b => + { + b.HasOne("Token.Management.Domain.WorkFlow.WorkflowInstance", "WorkflowInstance") + .WithMany("WorkflowApprovers") + .HasForeignKey("WorkflowInstanceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("WorkflowInstance"); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkFlow.WorkflowInstance", b => + { + b.HasOne("Token.Management.Domain.Users.UserInfo", "Sponsor") + .WithMany() + .HasForeignKey("SponsorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Token.Management.Domain.WorkFlow.WorkflowTemplate", "WorkflowTemplate") + .WithMany("WorkflowInstance") + .HasForeignKey("WorkflowTemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Sponsor"); + + b.Navigation("WorkflowTemplate"); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkFlow.WorkflowNodeInstance", b => + { + b.HasOne("Token.Management.Domain.WorkFlow.WorkflowInstance", "WorkflowInstance") + .WithMany("WorkflowNodeInstances") + .HasForeignKey("WorkflowInstanceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("WorkflowInstance"); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkFlow.WorkflowNodeTemplate", b => + { + b.HasOne("Token.Management.Domain.WorkFlow.WorkflowTemplate", "WorkflowTemplate") + .WithMany("WorkflowNodeTemplate") + .HasForeignKey("WorkflowTemplateId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("WorkflowTemplate"); + }); + + modelBuilder.Entity("Token.Management.Domain.Management.Company", b => + { + b.Navigation("Department"); + }); + + modelBuilder.Entity("Token.Management.Domain.Management.Department", b => + { + b.Navigation("UserDepartmentFunction"); + }); + + modelBuilder.Entity("Token.Management.Domain.Users.UserInfo", b => + { + b.Navigation("Department"); + + b.Navigation("MenuRoleFunction"); + + b.Navigation("UserDepartmentFunction"); + + b.Navigation("UserRoleFunction"); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkContent.WorkDemoMain", b => + { + b.Navigation("WorkContentDemo"); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkFlow.WorkflowInstance", b => + { + b.Navigation("WorkflowApprovers"); + + b.Navigation("WorkflowNodeInstances"); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkFlow.WorkflowNodeTemplate", b => + { + b.Navigation("WorkflowApprovalRole"); + }); + + modelBuilder.Entity("Token.Management.Domain.WorkFlow.WorkflowTemplate", b => + { + b.Navigation("WorkflowInstance"); + + b.Navigation("WorkflowNodeTemplate"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Token.Management.EntityFrameworkCore/Token.Management.EntityFrameworkCore.csproj b/src/Token.Management.EntityFrameworkCore/Token.Management.EntityFrameworkCore.csproj index 092d735b1d6c95a0067f41fbace95f2737a5160e..341de384d1e7104e2e9a892f943a827f843d4e92 100644 --- a/src/Token.Management.EntityFrameworkCore/Token.Management.EntityFrameworkCore.csproj +++ b/src/Token.Management.EntityFrameworkCore/Token.Management.EntityFrameworkCore.csproj @@ -15,12 +15,13 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + + diff --git a/src/Token.ManagementApi.Host/Controllers/LoginController.cs b/src/Token.ManagementApi.Host/Controllers/LoginController.cs index 4cc6ee8a9cbe5f211ba1347444daa2745883cf0a..51f36efd6ad0bdc2ddbd56144169a56988418d1d 100644 --- a/src/Token.ManagementApi.Host/Controllers/LoginController.cs +++ b/src/Token.ManagementApi.Host/Controllers/LoginController.cs @@ -35,10 +35,7 @@ public class LoginController : BaseController { var userInfo = await _userInfoService.GetUserInfo(input); - //生成令牌 - var token = await _principalAccessor.CreateTokenAsync(userInfo); - - return new OkObjectResult(new { token, userInfo }); + return new OkObjectResult(new { token=userInfo.Item2, userInfo=userInfo.Item1 }); } /// diff --git a/src/Token.ManagementApi.Host/Controllers/MenuController.cs b/src/Token.ManagementApi.Host/Controllers/MenuController.cs index b58e5103d40c008eb6fad11d29292e15ae59b543..96011fea90658e8636f8173b0f0239601c78b696 100644 --- a/src/Token.ManagementApi.Host/Controllers/MenuController.cs +++ b/src/Token.ManagementApi.Host/Controllers/MenuController.cs @@ -12,6 +12,7 @@ public class MenuController : BaseController { private readonly IRoleService _roleService; + /// public MenuController( IRoleService roleService ) diff --git a/src/Token.ManagementApi.Host/Controllers/RoleController.cs b/src/Token.ManagementApi.Host/Controllers/RoleController.cs index f846418093dbba9c6b1f243bf39ba5024830610c..47201fb8a4cb1bb4ebf4b7711c5d6ea3f18581a9 100644 --- a/src/Token.ManagementApi.Host/Controllers/RoleController.cs +++ b/src/Token.ManagementApi.Host/Controllers/RoleController.cs @@ -25,7 +25,7 @@ public class RoleController : BaseController } /// - /// 获取角色列表 + /// 获取角色列表 /// /// /// diff --git a/src/Token.ManagementApi.Host/Controllers/UserInfoController.cs b/src/Token.ManagementApi.Host/Controllers/UserInfoController.cs index ecfcce75bb399cf57b224898d176da7cf693b57e..163c07a9239f5858c64c641ef7cf6f540e603a2a 100644 --- a/src/Token.ManagementApi.Host/Controllers/UserInfoController.cs +++ b/src/Token.ManagementApi.Host/Controllers/UserInfoController.cs @@ -2,6 +2,7 @@ using Token.HttpApi; using Token.Infrastructure; using Token.Management.Application.Contracts.AppServices.Users; +using Token.Management.Application.Contracts.Module; using Token.Management.Application.Contracts.Module.Users; using Token.ManagementApi.Host.Module; @@ -23,21 +24,15 @@ public class UserInfoController : BaseController } /// - /// 获取用户账号分页 + /// 获取用户账号分页 /// - /// - /// - /// - /// - /// - /// + /// /// [HttpGet] - public async Task>> GetUserInfoPaging(string? code, DateTime? startTime, - DateTime? endTime, sbyte statue = -1, int pageNo = 1, int pageSize = 20) + public async Task>> GetUserInfoPaging([FromQuery]UserInfoPagingInput input) { - var data = await _userInfoService.GetUserInfoPaging(code, startTime, endTime, statue, pageNo, pageSize); - return new PagingModelView>(SerialNumberHelper.GetList(data.Item1, pageNo, pageSize), + var data = await _userInfoService.GetUserInfoPaging(input); + return new PagingModelView>(SerialNumberHelper.GetList(data.Item1,input.PageNo,input.PageSize), data.Item2); } diff --git a/src/Token.ManagementApi.Host/Controllers/WorkDemoMainController.cs b/src/Token.ManagementApi.Host/Controllers/WorkDemoMainController.cs new file mode 100644 index 0000000000000000000000000000000000000000..5e41a9de19e1edd2da48f95cb86fddae68d15873 --- /dev/null +++ b/src/Token.ManagementApi.Host/Controllers/WorkDemoMainController.cs @@ -0,0 +1,47 @@ +using Microsoft.AspNetCore.Mvc; +using Token.Management.Application.Contracts.AppServices.WorkContent; +using Token.Management.Application.Contracts.Module; +using Token.ManagementApi.Host.Module; + +namespace Token.ManagementApi.Host.Controllers; + +/// +/// Demo +/// Demo +/// +[Route("api/[controller]/[action]")] +[ApiController] +public class WorkDemoMainController:ControllerBase +{ + private readonly IWorkDemoMainService _workDemoMainService; + + /// + public WorkDemoMainController(IWorkDemoMainService workDemoMainService) + { + _workDemoMainService = workDemoMainService; + } + + /// + /// 创建Demo + /// + /// + [HttpPost] + public async Task CreateWorkDemoMainAsync(WorkDemoMainDto dto) + { + await _workDemoMainService.CreateWorkDemoMainAsync(dto); + } + + /// + /// 获取Demo列表 + /// + /// + /// + [HttpGet] + public async Task>> GetWorkDemoListAsync(PageInput input) + { + var result = await _workDemoMainService.GetWorkDemoListAsync(input.StartTime, input.EndTime, input.Keyword, + input.SkipCount, input.MaxResultCount); + + return new PagingModelView>(result.Item1,result.Item2); + } +} diff --git a/src/Token.ManagementApi.Host/Controllers/WorkFlow/WorkflowTemplateController.cs b/src/Token.ManagementApi.Host/Controllers/WorkFlow/WorkflowTemplateController.cs index a62fcf1471095269d4de59dbf51b310da7eb1182..ed3b8f5e81bb1a28d2c434fb0659e426214f3dac 100644 --- a/src/Token.ManagementApi.Host/Controllers/WorkFlow/WorkflowTemplateController.cs +++ b/src/Token.ManagementApi.Host/Controllers/WorkFlow/WorkflowTemplateController.cs @@ -2,6 +2,7 @@ using Token.HttpApi; using Token.Infrastructure; using Token.Management.Application.Contracts.AppServices.WorkFlow; +using Token.Management.Application.Contracts.Module; using Token.Management.Application.Contracts.Module.WorkFlow; using Token.Management.Domain; using Token.ManagementApi.Host.Module; @@ -43,7 +44,7 @@ public class WorkflowTemplateController : BaseController public async Task>> GetWorkflowTemplatePage(string? name, int pageNo = 1, int pageSize = 20) { - var data = await _workflowTemplateService.GetWorkflowTemplatePage(name, pageNo, pageSize); + var data = await _workflowTemplateService.GetWorkflowTemplatePage(name, new PageInput(){PageNo =pageNo,PageSize =pageSize}); return new PagingModelView>(SerialNumberHelper.GetList(data.Item1, pageNo, pageSize), data.Item2); } diff --git a/src/Token.ManagementApi.Host/Dockerfile b/src/Token.ManagementApi.Host/Dockerfile index 417d6f7ba2413b6a68c9b08c58e1fc11771e6c79..030aa6e29ea92dd5d58dad83015148daf19b67ee 100644 --- a/src/Token.ManagementApi.Host/Dockerfile +++ b/src/Token.ManagementApi.Host/Dockerfile @@ -1,14 +1,21 @@ -FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base +FROM mcr.microsoft.com/dotnet/aspnet:6.0.3-alpine3.15-amd64 AS base WORKDIR /app EXPOSE 80 EXPOSE 443 -FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build +FROM mcr.microsoft.com/dotnet/sdk:6.0.201-alpine3.15-amd64 AS build WORKDIR /src -COPY ["Token.ManagementApi.Host/Token.ManagementApi.Host.csproj", "Token.ManagementApi.Host/"] -RUN dotnet restore "Token.ManagementApi.Host/Token.ManagementApi.Host.csproj" +COPY ["src/Token.ManagementApi.Host/Token.ManagementApi.Host.csproj", "src/Token.ManagementApi.Host/"] +COPY ["src/Token.Infrastructure/Token.Infrastructure.csproj", "src/Token.Infrastructure/"] +COPY ["src/Token.Mangement.Domain/Token.Mangement.Domain.csproj", "src/Token.Mangement.Domain/"] +COPY ["src/Token.Management.Domain.Shared/Token.Management.Domain.Shared.csproj", "src/Token.Management.Domain.Shared/"] +COPY ["src/Token.HttpApi/Token.HttpApi.csproj", "src/Token.HttpApi/"] +COPY ["src/Token.Management.Application/Token.Management.Application.csproj", "src/Token.Management.Application/"] +COPY ["src/Token.Management.Application.Contracts/Token.Management.Application.Contracts.csproj", "src/Token.Management.Application.Contracts/"] +COPY ["src/Token.Management.EntityFrameworkCore/Token.Management.EntityFrameworkCore.csproj", "src/Token.Management.EntityFrameworkCore/"] +RUN dotnet restore "src/Token.ManagementApi.Host/Token.ManagementApi.Host.csproj" COPY . . -WORKDIR "/src/Token.ManagementApi.Host" +WORKDIR "/src/src/Token.ManagementApi.Host" RUN dotnet build "Token.ManagementApi.Host.csproj" -c Release -o /app/build FROM build AS publish diff --git a/src/Token.ManagementApi.Host/Properties/launchSettings.json b/src/Token.ManagementApi.Host/Properties/launchSettings.json index 22f943f350722e3fe2fc63496cac4267a99d02a0..b4e58d14c7b2f63190c023db1bd35ce8287d0fce 100644 --- a/src/Token.ManagementApi.Host/Properties/launchSettings.json +++ b/src/Token.ManagementApi.Host/Properties/launchSettings.json @@ -1,23 +1,14 @@ -{ - "$schema": "https://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:58453", - "sslPort": 44380 - } - }, +{ "profiles": { "Token.ManagementApi.Host": { "commandName": "Project", - "dotnetRunMessages": true, "launchBrowser": true, "launchUrl": "swagger", - "applicationUrl": "https://localhost:7019;http://localhost:5125", "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" - } + }, + "dotnetRunMessages": true, + "applicationUrl": "https://localhost:7019;http://localhost:5125" }, "IIS Express": { "commandName": "IISExpress", @@ -26,6 +17,22 @@ "environmentVariables": { "ASPNETCORE_ENVIRONMENT": "Development" } + }, + "Docker": { + "commandName": "Docker", + "launchBrowser": true, + "launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger", + "publishAllPorts": true, + "useSSL": true + } + }, + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:58453", + "sslPort": 44380 } } -} +} \ No newline at end of file diff --git a/src/Token.ManagementApi.Host/Token.ManagementApi.Host.csproj b/src/Token.ManagementApi.Host/Token.ManagementApi.Host.csproj index 5345086931eacd39618abb1a53faa33ffe5bef78..0716005648205a944f52f87f2beb26a1d7c1def7 100644 --- a/src/Token.ManagementApi.Host/Token.ManagementApi.Host.csproj +++ b/src/Token.ManagementApi.Host/Token.ManagementApi.Host.csproj @@ -6,6 +6,8 @@ enable Linux True + a27d2199-5c11-4d6f-a783-dbe58227c567 + ..\.. @@ -13,15 +15,16 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + + - - - - - + + + + + diff --git a/src/Token.ManagementApi.Host/TokenManagementApiModule.cs b/src/Token.ManagementApi.Host/TokenManagementApiModule.cs index c1a42b99c83854c2299c6f1b585c306d718e28e9..c6b7a2b588b060da0dd82fb990a7a1723fc664c6 100644 --- a/src/Token.ManagementApi.Host/TokenManagementApiModule.cs +++ b/src/Token.ManagementApi.Host/TokenManagementApiModule.cs @@ -1,4 +1,4 @@ -using Token.HttpApi; +using Token.HttpApi; using Token.Management.Application; using Token.Management.EntityFrameworkCore.EntityFrameworkCore; using Volo.Abp; @@ -12,13 +12,12 @@ namespace Token.ManagementApi.Host; /// Api模块 /// [DependsOn( - typeof(AbpAutofacModule), typeof(TokenHttpApiModule), - typeof(TokenManagementEntityFrameworkCoreModule), + typeof(AbpAutofacModule), typeof(TokenManagementApplicationModule), typeof(AbpAspNetCoreModule) )] -public class TokenManagementApiModule : AbpModule +public class TokenManagementApiModule : AbpModule { /// /// Use diff --git a/src/Token.Mangement.Domain/Base/WorkFlowStatue.cs b/src/Token.Mangement.Domain/Base/WorkFlowStatue.cs index a837c93897957eb43ff65d9a6ce2145f5a81b629..bd51b4ac30ba4222832da8b4524b5c84eac26069 100644 --- a/src/Token.Mangement.Domain/Base/WorkFlowStatue.cs +++ b/src/Token.Mangement.Domain/Base/WorkFlowStatue.cs @@ -1,4 +1,4 @@ -using Token.Management.Domain.Shared; +using Token.Management.Domain.Shared; using Volo.Abp; using Volo.Abp.Domain.Entities; @@ -7,13 +7,18 @@ namespace Token.Management.Domain.Base; /// /// /// -public class WorkFlowStatue : AggregateRoot, ISoftDelete +public class WorkFlowStatus : Entity, ISoftDelete { /// /// 表单工作流状态 /// public WorkFlowNodeStatusEnum WorkFlowNodeStatus { get; set; } + /// + /// 实例id + /// + public Guid? WorkflowInstanceId { get; set; } + /// /// 提交时间 /// diff --git a/src/Token.Mangement.Domain/Constants.cs b/src/Token.Mangement.Domain/Constants.cs index d65bef23da5b703a427d70c335bceed2fd87e6df..af87e83bb13f433511875a95110192508f02048d 100644 --- a/src/Token.Mangement.Domain/Constants.cs +++ b/src/Token.Mangement.Domain/Constants.cs @@ -33,4 +33,6 @@ public class Constants public static string DefaultTodayDateStr => "yyyyMMdd"; public static string DefaultFullDateStr => "yyyyMMddHHmmss"; + + public static string Department => "Department"; } diff --git a/src/Token.Mangement.Domain/Management/AccessFunction/IUserRoleFunctionRepository.cs b/src/Token.Mangement.Domain/Management/AccessFunction/IUserRoleFunctionRepository.cs index 4bea23907e92481c491acf6e89b813b63b56b270..12d2a069bde67f8ad0b6a72209a31a97eba581a8 100644 --- a/src/Token.Mangement.Domain/Management/AccessFunction/IUserRoleFunctionRepository.cs +++ b/src/Token.Mangement.Domain/Management/AccessFunction/IUserRoleFunctionRepository.cs @@ -1,4 +1,5 @@ using System.Linq.Expressions; +using Token.Management.Domain.Users; using Volo.Abp.Domain.Repositories; namespace Token.Management.Domain.Management.AccessFunction; @@ -20,6 +21,18 @@ public interface IUserRoleFunctionRepository:IRepository Task<(List, int)> GetPageListAsync(Expression> expression, Expression> sort,int skipCount,int maxResultCount); + /// + /// 分页获取排序 + /// + /// + /// + /// + /// + /// + /// + Task<(List, int)> GetPageUserListAsync(Expression> expression, + Expression> sort,int skipCount,int maxResultCount); + /// /// /// @@ -32,4 +45,11 @@ public interface IUserRoleFunctionRepository:IRepository Task> GetListAsync(Expression> expression, Expression> select,Expression>? property=null); + /// + /// + /// + /// + /// + Task> GetUserInfoAsync(Expression> expression); + } diff --git a/src/Token.Mangement.Domain/Management/AccessFunction/MenuRoleFunction.cs b/src/Token.Mangement.Domain/Management/AccessFunction/MenuRoleFunction.cs index 7488da765635af51d05bb6af9f117e82d81a2e02..e75ad17b505c5b48c642dc4a36a902ddfc8e946b 100644 --- a/src/Token.Mangement.Domain/Management/AccessFunction/MenuRoleFunction.cs +++ b/src/Token.Mangement.Domain/Management/AccessFunction/MenuRoleFunction.cs @@ -1,4 +1,4 @@ -using Volo.Abp; +using Volo.Abp; using Volo.Abp.Auditing; using Volo.Abp.Domain.Entities; @@ -7,7 +7,7 @@ namespace Token.Management.Domain.Management.AccessFunction; /// /// 角色菜单配置 /// -public class MenuRoleFunction : AggregateRoot,ISoftDelete,IHasCreationTime +public class MenuRoleFunction : Entity, ISoftDelete, IHasCreationTime { /// public MenuRoleFunction() @@ -15,7 +15,7 @@ public class MenuRoleFunction : AggregateRoot,ISoftDelete,IHasCreationTime } /// - public MenuRoleFunction(Guid id):base(id) + public MenuRoleFunction(Guid id) : base(id) { } diff --git a/src/Token.Mangement.Domain/Management/AccessFunction/UserDepartmentFunction.cs b/src/Token.Mangement.Domain/Management/AccessFunction/UserDepartmentFunction.cs index c703e67a2b18fab38c7d0afefdd0f5c8bc92ee89..7f4bd615b093ea1896f7dc942f29fbe97ac0024b 100644 --- a/src/Token.Mangement.Domain/Management/AccessFunction/UserDepartmentFunction.cs +++ b/src/Token.Mangement.Domain/Management/AccessFunction/UserDepartmentFunction.cs @@ -1,4 +1,4 @@ -using Token.Management.Domain.Users; +using Token.Management.Domain.Users; using Volo.Abp; using Volo.Abp.Auditing; using Volo.Abp.Domain.Entities; @@ -8,7 +8,7 @@ namespace Token.Management.Domain.Management.AccessFunction; /// /// 用户部门配置 /// -public class UserDepartmentFunction : AggregateRoot, ISoftDelete, IHasCreationTime +public class UserDepartmentFunction : Entity, ISoftDelete, IHasCreationTime { /// public UserDepartmentFunction() diff --git a/src/Token.Mangement.Domain/Management/AccessFunction/UserRoleFunction.cs b/src/Token.Mangement.Domain/Management/AccessFunction/UserRoleFunction.cs index 5e3bdd4992bdd12a610ebdbefbe78f30dd1d08b7..8dc8399163fd4a8288a5d9ef369dd1f6b90d9392 100644 --- a/src/Token.Mangement.Domain/Management/AccessFunction/UserRoleFunction.cs +++ b/src/Token.Mangement.Domain/Management/AccessFunction/UserRoleFunction.cs @@ -1,4 +1,4 @@ -using Token.Management.Domain.Users; +using Token.Management.Domain.Users; using Volo.Abp; using Volo.Abp.Auditing; using Volo.Abp.Domain.Entities; @@ -8,7 +8,7 @@ namespace Token.Management.Domain.Management.AccessFunction; /// /// 用户角色配置 /// -public class UserRoleFunction : AggregateRoot, ISoftDelete, IHasCreationTime +public class UserRoleFunction : Entity, ISoftDelete, IHasCreationTime { /// public UserRoleFunction(Guid id) : base(id) diff --git a/src/Token.Mangement.Domain/Management/Company.cs b/src/Token.Mangement.Domain/Management/Company.cs index 08d892c249a726d713a904690871310926bf41c2..2fb140275698085b305dd7e921e7e1e2e9cbaa10 100644 --- a/src/Token.Mangement.Domain/Management/Company.cs +++ b/src/Token.Mangement.Domain/Management/Company.cs @@ -1,4 +1,4 @@ -using Volo.Abp; +using Volo.Abp; using Volo.Abp.Auditing; using Volo.Abp.Domain.Entities; @@ -7,7 +7,7 @@ namespace Token.Management.Domain.Management; /// /// 公司 /// -public class Company : AggregateRoot, ISoftDelete,IHasCreationTime +public class Company : Entity, ISoftDelete, IHasCreationTime { /// public Company() diff --git a/src/Token.Mangement.Domain/Management/Department.cs b/src/Token.Mangement.Domain/Management/Department.cs index 93923fd0ca9654ce59cf1bccebadf1c98cd499e2..95c713e484a58f853c28cee07b6f9f0459c5808e 100644 --- a/src/Token.Mangement.Domain/Management/Department.cs +++ b/src/Token.Mangement.Domain/Management/Department.cs @@ -1,4 +1,4 @@ -using Token.Management.Domain.Management.AccessFunction; +using Token.Management.Domain.Management.AccessFunction; using Volo.Abp; using Volo.Abp.Auditing; using Volo.Abp.Domain.Entities; @@ -8,7 +8,7 @@ namespace Token.Management.Domain.Management; /// /// 部门 /// -public class Department : AggregateRoot, ISoftDelete,IHasCreationTime +public class Department : Entity, ISoftDelete, IHasCreationTime { /// public Department() diff --git a/src/Token.Mangement.Domain/Management/Menu.cs b/src/Token.Mangement.Domain/Management/Menu.cs index b7b43055909f3bd37807d263455d21709e3cdd9f..96fffda99607e989026c6aa539702ae21c8c115d 100644 --- a/src/Token.Mangement.Domain/Management/Menu.cs +++ b/src/Token.Mangement.Domain/Management/Menu.cs @@ -1,4 +1,4 @@ -using Volo.Abp; +using Volo.Abp; using Volo.Abp.Auditing; using Volo.Abp.Domain.Entities; @@ -7,7 +7,7 @@ namespace Token.Management.Domain.Management; /// /// 菜单 /// -public class Menu : AggregateRoot, ISoftDelete,IHasCreationTime +public class Menu : Entity, ISoftDelete, IHasCreationTime { /// public Menu() diff --git a/src/Token.Mangement.Domain/Management/Role.cs b/src/Token.Mangement.Domain/Management/Role.cs index 82175a70828194befce898fd1516fbfd7b37f477..6ab1e806f999b07dabba938a4eeaf37b906a8844 100644 --- a/src/Token.Mangement.Domain/Management/Role.cs +++ b/src/Token.Mangement.Domain/Management/Role.cs @@ -1,4 +1,4 @@ -using Volo.Abp; +using Volo.Abp; using Volo.Abp.Auditing; using Volo.Abp.Domain.Entities; @@ -7,7 +7,7 @@ namespace Token.Management.Domain.Management; /// /// 角色表 /// -public class Role : AggregateRoot, ISoftDelete,IHasCreationTime +public class Role : Entity, ISoftDelete, IHasCreationTime { /// public Role() diff --git a/src/Token.Mangement.Domain/SystemService/SystemMessage.cs b/src/Token.Mangement.Domain/SystemService/SystemMessage.cs index 56dab0701897cc8550d16fca9d0a507441f8860f..f4c982889294bfe2f12f30bd0b5a240702e27c5f 100644 --- a/src/Token.Mangement.Domain/SystemService/SystemMessage.cs +++ b/src/Token.Mangement.Domain/SystemService/SystemMessage.cs @@ -1,4 +1,4 @@ -using Token.Management.Domain.Shared; +using Token.Management.Domain.Shared; using Volo.Abp.Auditing; using Volo.Abp.Domain.Entities; @@ -7,7 +7,7 @@ namespace Token.Management.Domain.SystemService; /// /// 系统信息 /// -public class SystemMessage:AggregateRoot,IHasCreationTime +public class SystemMessage : Entity, IHasCreationTime { /// /// 标题 diff --git a/src/Token.Mangement.Domain/Token.Mangement.Domain.csproj b/src/Token.Mangement.Domain/Token.Mangement.Domain.csproj index 25ef106ecc81b89dd8542dfd6a398f2318ea561b..6f673d8270129a09f0a3907dc18b5d208bed13ef 100644 --- a/src/Token.Mangement.Domain/Token.Mangement.Domain.csproj +++ b/src/Token.Mangement.Domain/Token.Mangement.Domain.csproj @@ -10,8 +10,8 @@ - - + + diff --git a/src/Token.Mangement.Domain/Users/IUserInfoRepository.cs b/src/Token.Mangement.Domain/Users/IUserInfoRepository.cs index 7a9003a4280536a491c0d543ca370491254a581d..2c0c733694bcb1e3b423155be0040b8e2e38050e 100644 --- a/src/Token.Mangement.Domain/Users/IUserInfoRepository.cs +++ b/src/Token.Mangement.Domain/Users/IUserInfoRepository.cs @@ -8,6 +8,8 @@ namespace Token.Management.Domain.Users; /// public interface IUserInfoRepository:IRepository { + Task<(List, int)> GetListAsync(DateTime? startTime,DateTime? endTime,string? keyword,sbyte? status,int skipCount,int maxResultCount); + /// /// /// diff --git a/src/Token.Mangement.Domain/Users/UserInfo.cs b/src/Token.Mangement.Domain/Users/UserInfo.cs index 51e599e1f5d37d6edb6ab9d8bd7fce12509d2922..e2ba2d4382d6e7cbeab49048279b20d7d3ba507f 100644 --- a/src/Token.Mangement.Domain/Users/UserInfo.cs +++ b/src/Token.Mangement.Domain/Users/UserInfo.cs @@ -1,4 +1,4 @@ -using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations; using Token.Management.Domain.Management; using Token.Management.Domain.Management.AccessFunction; using Token.Management.Domain.Shared; @@ -11,7 +11,7 @@ namespace Token.Management.Domain.Users; /// /// 用户表 /// -public class UserInfo : AggregateRoot, ISoftDelete,IHasCreationTime +public class UserInfo : Entity, ISoftDelete, IHasCreationTime { /// public UserInfo() @@ -58,7 +58,7 @@ public class UserInfo : AggregateRoot, ISoftDelete,IHasCreationTime /// /// 账号状态 /// - public StatueEnum Statue { get; set; } + public StatusEnum Status { get; set; } /// /// 手机号 diff --git a/src/Token.Mangement.Domain/WorkContent/IWorkContentDemoRepository.cs b/src/Token.Mangement.Domain/WorkContent/IWorkContentDemoRepository.cs new file mode 100644 index 0000000000000000000000000000000000000000..a6369874501d4f06591dbf6b0e6e87a8d0a6b551 --- /dev/null +++ b/src/Token.Mangement.Domain/WorkContent/IWorkContentDemoRepository.cs @@ -0,0 +1,11 @@ +using Volo.Abp.Domain.Repositories; + +namespace Token.Management.Domain.WorkContent; + +/// +/// +/// +public interface IWorkContentDemoRepository:IRepository +{ + +} diff --git a/src/Token.Mangement.Domain/WorkContent/IWorkDemoMainRepository.cs b/src/Token.Mangement.Domain/WorkContent/IWorkDemoMainRepository.cs new file mode 100644 index 0000000000000000000000000000000000000000..b876c8ebf683e09720cb7404c01c124f60c2c902 --- /dev/null +++ b/src/Token.Mangement.Domain/WorkContent/IWorkDemoMainRepository.cs @@ -0,0 +1,21 @@ +using Volo.Abp.Domain.Repositories; + +namespace Token.Management.Domain.WorkContent; + +/// +/// 工作Demo +/// +public interface IWorkDemoMainRepository:IRepository +{ + /// + /// + /// + /// + /// + /// + /// + /// + /// + Task<(List, int)> GetWorkDemoListAsync(DateTime? startTime, DateTime? endTime, string keyword, + int pageNo, int pageSize); +} diff --git a/src/Token.Mangement.Domain/WorkContent/WorkContentDemo.cs b/src/Token.Mangement.Domain/WorkContent/WorkContentDemo.cs new file mode 100644 index 0000000000000000000000000000000000000000..c8a9033f28faf7cbaf37a9fac683c15040e2f79e --- /dev/null +++ b/src/Token.Mangement.Domain/WorkContent/WorkContentDemo.cs @@ -0,0 +1,31 @@ +using Token.Management.Domain.Base; +using Token.Management.Domain.Users; + +namespace Token.Management.Domain.WorkContent; + +/// +/// 子任务 +/// +public class WorkContentDemo : WorkFlowStatus +{ + /// + /// 子项目名称 + /// + public string? Name { get; set; } + + /// + /// 子项目内容 + /// + public string? Content { get; set; } + + /// + /// 项目负责人 + /// + public Guid PrincipalId { get; set; } + + public Guid WorkDemoMainId { get; set; } + + public virtual UserInfo Principal { get; set; } + + public virtual WorkDemoMain WorkDemoMain { get; set; } +} diff --git a/src/Token.Mangement.Domain/WorkContent/WorkDemoMain.cs b/src/Token.Mangement.Domain/WorkContent/WorkDemoMain.cs index 21fe45d36e0c4b289db7c466a081a6ec37f00070..0f0d303bcf4fac8da9c0c1554a4022c4680c6f73 100644 --- a/src/Token.Mangement.Domain/WorkContent/WorkDemoMain.cs +++ b/src/Token.Mangement.Domain/WorkContent/WorkDemoMain.cs @@ -1,14 +1,48 @@ -using Token.Management.Domain.Base; +using Token.Management.Domain.Shared; +using Volo.Abp; +using Volo.Abp.Auditing; +using Volo.Abp.Domain.Entities; namespace Token.Management.Domain.WorkContent; /// /// 工作流Demo /// -public class WorkDemoMain : WorkFlowStatue +public class WorkDemoMain : Entity, ISoftDelete,IHasCreationTime { + /// + /// 工作流Dmeo名称 + /// public string? Name { get; set; } + + /// + /// 工作流Demo备注 + /// public string? Remark { get; set; } + + /// + /// 工作流Demo内容 + /// public string? Content { get; set; } - public int Count { get; set; } + + /// + /// 表单工作流状态 + /// + public WorkFlowNodeStatusEnum WorkFlowNodeStatus { get; set; } + + /// + /// 项目开始时间 + /// + public DateTime? StartTime { get; set; } + + /// + /// 项目结束时间 + /// + public DateTime? EndTime { get; set; } + + public bool IsDeleted { get; set; } + + public virtual List WorkContentDemo { get; set; } = new List(); + + public DateTime CreationTime { get; } } diff --git a/src/Token.Mangement.Domain/WorkFlow/IWorkflowTemplateRepository.cs b/src/Token.Mangement.Domain/WorkFlow/IWorkflowTemplateRepository.cs index a31b9a9b0255fc02eeac97aaa9708c784df0518b..e0701e7d2e0ecbce1e8114d75279f542d3a46f84 100644 --- a/src/Token.Mangement.Domain/WorkFlow/IWorkflowTemplateRepository.cs +++ b/src/Token.Mangement.Domain/WorkFlow/IWorkflowTemplateRepository.cs @@ -25,11 +25,9 @@ public interface IWorkflowTemplateRepository:IRepository /// /// /// - /// - /// + /// /// /// - /// /// - Task<(List,int)> GetPageListAsync(Expression> expression,Expression> select,int skipCount,int maxResultCount); + Task<(List, int)> GetPageListAsync(string keyword, int skipCount,int maxResultCount); } diff --git a/src/Token.Mangement.Domain/WorkFlow/WorkflowApprovalRole.cs b/src/Token.Mangement.Domain/WorkFlow/WorkflowApprovalRole.cs index beb34649a01b2823ca00844af41fa075eccd373c..c402d6c1b17c11b25d079b21a178959704520bb6 100644 --- a/src/Token.Mangement.Domain/WorkFlow/WorkflowApprovalRole.cs +++ b/src/Token.Mangement.Domain/WorkFlow/WorkflowApprovalRole.cs @@ -1,11 +1,11 @@ -using Token.Management.Domain.Management; +using Token.Management.Domain.Management; using Volo.Abp; using Volo.Abp.Auditing; using Volo.Abp.Domain.Entities; namespace Token.Management.Domain.WorkFlow; -public class WorkflowApprovalRole : AggregateRoot, ISoftDelete,IHasCreationTime +public class WorkflowApprovalRole : Entity, ISoftDelete, IHasCreationTime { /// diff --git a/src/Token.Mangement.Domain/WorkFlow/WorkflowApprovers.cs b/src/Token.Mangement.Domain/WorkFlow/WorkflowApprovers.cs index 93eb2f111c8f7236f535e708e8123f5d04fbf934..426ec8d54828cf88f8a98a8fc1254d5f63c27509 100644 --- a/src/Token.Mangement.Domain/WorkFlow/WorkflowApprovers.cs +++ b/src/Token.Mangement.Domain/WorkFlow/WorkflowApprovers.cs @@ -1,4 +1,4 @@ -using Token.Management.Domain.Shared; +using Token.Management.Domain.Shared; using Volo.Abp; using Volo.Abp.Auditing; using Volo.Abp.Domain.Entities; @@ -8,7 +8,7 @@ namespace Token.Management.Domain.WorkFlow; /// /// /// -public class WorkflowApprovers : AggregateRoot, ISoftDelete,IHasCreationTime +public class WorkflowApprovers : Entity, ISoftDelete, IHasCreationTime { /// /// 当前接单操作人 diff --git a/src/Token.Mangement.Domain/WorkFlow/WorkflowInstance.cs b/src/Token.Mangement.Domain/WorkFlow/WorkflowInstance.cs index 49d40b03ca86f33ae4de4419429b051c673b53ce..c06a135873ae018234597f494d41ca8cd687f1a2 100644 --- a/src/Token.Mangement.Domain/WorkFlow/WorkflowInstance.cs +++ b/src/Token.Mangement.Domain/WorkFlow/WorkflowInstance.cs @@ -1,4 +1,4 @@ -using Token.Management.Domain.Shared; +using Token.Management.Domain.Shared; using Token.Management.Domain.Users; using Volo.Abp; using Volo.Abp.Auditing; @@ -9,7 +9,7 @@ namespace Token.Management.Domain.WorkFlow; /// /// 工作流实例 /// -public class WorkflowInstance : AggregateRoot, ISoftDelete,IHasCreationTime +public class WorkflowInstance : Entity, ISoftDelete, IHasCreationTime { /// /// 流程发起人 @@ -81,17 +81,17 @@ public class WorkflowInstance : AggregateRoot, ISoftDelete,IHasCreationTim /// public UserInfo? Sponsor { get; set; } - public WorkflowTemplate? WorkflowTemplate { get; set; } + public virtual WorkflowTemplate? WorkflowTemplate { get; set; } /// /// 已审核人员信息 /// - public List WorkflowApprovers { get; set; } = new(); + public virtual List WorkflowApprovers { get; set; } = new(); /// /// 当前实际的流程节点 /// - public List WorkflowNodeInstances { get; set; } = new(); + public virtual List WorkflowNodeInstances { get; set; } = new(); public bool IsDeleted { get; set; } diff --git a/src/Token.Mangement.Domain/WorkFlow/WorkflowNodeInstance.cs b/src/Token.Mangement.Domain/WorkFlow/WorkflowNodeInstance.cs index 464876f4452cdd642d830888f274b8a5016a8c09..fe9bed65f4c0cebba7904a98c78135f6ae8e3578 100644 --- a/src/Token.Mangement.Domain/WorkFlow/WorkflowNodeInstance.cs +++ b/src/Token.Mangement.Domain/WorkFlow/WorkflowNodeInstance.cs @@ -1,4 +1,4 @@ -using Token.Management.Domain.Shared; +using Token.Management.Domain.Shared; using Volo.Abp; using Volo.Abp.Auditing; using Volo.Abp.Domain.Entities; @@ -8,7 +8,7 @@ namespace Token.Management.Domain.WorkFlow; /// /// 工作流实例节点 /// -public class WorkflowNodeInstance : AggregateRoot, ISoftDelete,IHasCreationTime +public class WorkflowNodeInstance : Entity, ISoftDelete, IHasCreationTime { /// /// 关联流程 diff --git a/src/Token.Mangement.Domain/WorkFlow/WorkflowNodeTemplate.cs b/src/Token.Mangement.Domain/WorkFlow/WorkflowNodeTemplate.cs index ffec614fa981273149fa6719faa8e9d46be9c018..4b22689610b1c4e79fc21b174940b13e9a25c45c 100644 --- a/src/Token.Mangement.Domain/WorkFlow/WorkflowNodeTemplate.cs +++ b/src/Token.Mangement.Domain/WorkFlow/WorkflowNodeTemplate.cs @@ -1,4 +1,4 @@ -using Volo.Abp; +using Volo.Abp; using Volo.Abp.Auditing; using Volo.Abp.Domain.Entities; @@ -7,7 +7,7 @@ namespace Token.Management.Domain.WorkFlow; /// /// 流程节点 /// -public class WorkflowNodeTemplate : AggregateRoot, ISoftDelete,IHasCreationTime +public class WorkflowNodeTemplate : Entity, ISoftDelete, IHasCreationTime { /// /// 关联流程模板 diff --git a/src/Token.Mangement.Domain/WorkFlow/WorkflowTemplate.cs b/src/Token.Mangement.Domain/WorkFlow/WorkflowTemplate.cs index e317df84682826bcba6e872d5a4dc6837e123782..d44c25e1290c3221b76db04068c35df6feabc2f3 100644 --- a/src/Token.Mangement.Domain/WorkFlow/WorkflowTemplate.cs +++ b/src/Token.Mangement.Domain/WorkFlow/WorkflowTemplate.cs @@ -1,4 +1,4 @@ -using Volo.Abp; +using Volo.Abp; using Volo.Abp.Auditing; using Volo.Abp.Domain.Entities; @@ -7,7 +7,7 @@ namespace Token.Management.Domain.WorkFlow; /// /// 流程模板 /// -public class WorkflowTemplate : AggregateRoot, ISoftDelete,IHasCreationTime +public class WorkflowTemplate : Entity, ISoftDelete, IHasCreationTime { /// /// 流程名称 @@ -24,11 +24,12 @@ public class WorkflowTemplate : AggregateRoot, ISoftDelete,IHasCreationTim /// public string? Remark { get; set; } - public List WorkflowInstance { get; set; } = new(); - - public List WorkflowNodeTemplate { get; set; } = new(); public bool IsDeleted { get; set; } public DateTime CreationTime { get; } + + public List WorkflowInstance { get; set; } = new(); + + public List WorkflowNodeTemplate { get; set; } = new(); }