Quellcode durchsuchen

胖子天骄项目初始化

shengtang
747575620@qq.com vor 1 Jahr
Commit
3eb9944300
100 geänderte Dateien mit 8125 neuen und 0 gelöschten Zeilen
  1. +3
    -0
      .gitignore
  2. +36
    -0
      backend/BPA.MES.Base.Application/BPA.MES.Base.Application.csproj
  3. +2846
    -0
      backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml
  4. +64
    -0
      backend/BPA.MES.Base.Application/Const/ClaimConst.cs
  5. +22
    -0
      backend/BPA.MES.Base.Application/Entitys/Base/DeviceRecipeEntity.cs
  6. +23
    -0
      backend/BPA.MES.Base.Application/Entitys/Base/DevicesInfoEntity.cs
  7. +21
    -0
      backend/BPA.MES.Base.Application/Entitys/Base/GroupInfoEntity.cs
  8. +31
    -0
      backend/BPA.MES.Base.Application/Entitys/Base/MaterialsInfoEntity.cs
  9. +33
    -0
      backend/BPA.MES.Base.Application/Entitys/Base/RecipeMaterialEntity.cs
  10. +21
    -0
      backend/BPA.MES.Base.Application/Entitys/Base/RecipesGroupEntity.cs
  11. +25
    -0
      backend/BPA.MES.Base.Application/Entitys/Base/RecipesInfoEntity.cs
  12. +30
    -0
      backend/BPA.MES.Base.Application/Entitys/Base/StoreInfoEntity.cs
  13. +29
    -0
      backend/BPA.MES.Base.Application/Entitys/Sys/AccountEntity.cs
  14. +29
    -0
      backend/BPA.MES.Base.Application/Entitys/Sys/AuthorizeTemplateEntity.cs
  15. +27
    -0
      backend/BPA.MES.Base.Application/Entitys/Sys/AuthorizeTemplateItemEntity.cs
  16. +30
    -0
      backend/BPA.MES.Base.Application/Entitys/Sys/AuthorizeTemplateMapEntity.cs
  17. +69
    -0
      backend/BPA.MES.Base.Application/Entitys/Sys/EmployeeEntity.cs
  18. +46
    -0
      backend/BPA.MES.Base.Application/Entitys/Sys/ModuleEntity.cs
  19. +32
    -0
      backend/BPA.MES.Base.Application/Entitys/Sys/RoleEntity.cs
  20. +19
    -0
      backend/BPA.MES.Base.Application/GlobalUsings.cs
  21. +99
    -0
      backend/BPA.MES.Base.Application/Services/DeviceService/Dtos/DeviceRecipeDto.cs
  22. +51
    -0
      backend/BPA.MES.Base.Application/Services/DeviceService/Dtos/DevicesInfoDto.cs
  23. +145
    -0
      backend/BPA.MES.Base.Application/Services/DeviceService/Services/DeviceRecipeService.cs
  24. +111
    -0
      backend/BPA.MES.Base.Application/Services/DeviceService/Services/DevicesInfoService.cs
  25. +49
    -0
      backend/BPA.MES.Base.Application/Services/DeviceService/Services/IDeviceRecipeService.cs
  26. +49
    -0
      backend/BPA.MES.Base.Application/Services/DeviceService/Services/IDevicesInfoService.cs
  27. +58
    -0
      backend/BPA.MES.Base.Application/Services/MaterialService/Dtos/MaterialsInfoDto.cs
  28. +48
    -0
      backend/BPA.MES.Base.Application/Services/MaterialService/Services/IMaterialsInfoService.cs
  29. +115
    -0
      backend/BPA.MES.Base.Application/Services/MaterialService/Services/MaterialsInfoService.cs
  30. +54
    -0
      backend/BPA.MES.Base.Application/Services/RecipesService/Dtos/GroupInfoDto.cs
  31. +91
    -0
      backend/BPA.MES.Base.Application/Services/RecipesService/Dtos/RecipeMaterialDto.cs
  32. +66
    -0
      backend/BPA.MES.Base.Application/Services/RecipesService/Dtos/RecipesInfoDto.cs
  33. +97
    -0
      backend/BPA.MES.Base.Application/Services/RecipesService/Services/GroupInfoService.cs
  34. +43
    -0
      backend/BPA.MES.Base.Application/Services/RecipesService/Services/IGroupInfoService.cs
  35. +49
    -0
      backend/BPA.MES.Base.Application/Services/RecipesService/Services/IRecipeMaterialService.cs
  36. +54
    -0
      backend/BPA.MES.Base.Application/Services/RecipesService/Services/IRecipesInfoService.cs
  37. +131
    -0
      backend/BPA.MES.Base.Application/Services/RecipesService/Services/RecipeMaterialService.cs
  38. +132
    -0
      backend/BPA.MES.Base.Application/Services/RecipesService/Services/RecipesInfoService.cs
  39. +94
    -0
      backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AccountInput.cs
  40. +29
    -0
      backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AccountOutput.cs
  41. +134
    -0
      backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AuthorModuleInput.cs
  42. +70
    -0
      backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AuthorModuleItemInput.cs
  43. +12
    -0
      backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AuthorModuleItemOutput.cs
  44. +68
    -0
      backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AuthorModuleOutput.cs
  45. +97
    -0
      backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AuthorizeInput.cs
  46. +27
    -0
      backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AuthorizeOutput.cs
  47. +74
    -0
      backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AuthorizeTemplateInput.cs
  48. +24
    -0
      backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AuthorizeTemplateOutput.cs
  49. +141
    -0
      backend/BPA.MES.Base.Application/Services/SystemService/Dtos/EmployeeInput.cs
  50. +69
    -0
      backend/BPA.MES.Base.Application/Services/SystemService/Dtos/EmployeeOutput.cs
  51. +8
    -0
      backend/BPA.MES.Base.Application/Services/SystemService/Dtos/Mapper.cs
  52. +97
    -0
      backend/BPA.MES.Base.Application/Services/SystemService/Dtos/ModuleInput.cs
  53. +48
    -0
      backend/BPA.MES.Base.Application/Services/SystemService/Dtos/ModuleOutput.cs
  54. +108
    -0
      backend/BPA.MES.Base.Application/Services/SystemService/Dtos/ModuleTreeInput.cs
  55. +59
    -0
      backend/BPA.MES.Base.Application/Services/SystemService/Dtos/ModuleTreeOutput.cs
  56. +71
    -0
      backend/BPA.MES.Base.Application/Services/SystemService/Dtos/RoleInput.cs
  57. +24
    -0
      backend/BPA.MES.Base.Application/Services/SystemService/Dtos/RoleOutput.cs
  58. +62
    -0
      backend/BPA.MES.Base.Application/Services/SystemService/Dtos/UserRoleCacheDto.cs
  59. +645
    -0
      backend/BPA.MES.Base.Application/Services/SystemService/Services/AuthorizeService.cs
  60. +63
    -0
      backend/BPA.MES.Base.Application/Services/SystemService/Services/IAuthorizeService.cs
  61. +12
    -0
      backend/BPA.MES.Base.Application/applicationsettings.json
  62. +23
    -0
      backend/BPA.MES.Base.Core/BPA.MES.Base.Core.csproj
  63. +131
    -0
      backend/BPA.MES.Base.Core/BPA.MES.Base.Core.xml
  64. +27
    -0
      backend/BPA.MES.Base.Core/DEntityBase.cs
  65. +21
    -0
      backend/BPA.MES.Base.Core/EmptyExtensions.cs
  66. +22
    -0
      backend/BPA.MES.Base.Core/RequestPage.cs
  67. +109
    -0
      backend/BPA.MES.Base.Core/SqlSugarPagedList.cs
  68. +41
    -0
      backend/BPA.MES.Base.Core/SqlsugarSetup.cs
  69. +65
    -0
      backend/BPA.MES.Base.Core/TreeExtensions.cs
  70. +19
    -0
      backend/BPA.MES.Base.Web.Core/BPA.MES.Base.Web.Core.csproj
  71. +8
    -0
      backend/BPA.MES.Base.Web.Core/BPA.MES.Base.Web.Core.xml
  72. +16
    -0
      backend/BPA.MES.Base.Web.Core/Handlers/JwtHandler.cs
  73. +52
    -0
      backend/BPA.MES.Base.Web.Core/Startup.cs
  74. +21
    -0
      backend/BPA.MES.Base.Web.Entry/BPA.MES.Base.Web.Entry.csproj
  75. +9
    -0
      backend/BPA.MES.Base.Web.Entry/BPA.MES.Base.Web.Entry.csproj.user
  76. +1
    -0
      backend/BPA.MES.Base.Web.Entry/Program.cs
  77. +31
    -0
      backend/BPA.MES.Base.Web.Entry/Properties/launchSettings.json
  78. +22
    -0
      backend/BPA.MES.Base.Web.Entry/SingleFilePublish.cs
  79. +10
    -0
      backend/BPA.MES.Base.Web.Entry/appsettings.Development.json
  80. +18
    -0
      backend/BPA.MES.Base.Web.Entry/appsettings.json
  81. +43
    -0
      backend/BPA.MES.Base.sln
  82. +16
    -0
      frontend/.editorconfig
  83. +8
    -0
      frontend/.eslintignore
  84. +7
    -0
      frontend/.eslintrc.js
  85. +41
    -0
      frontend/.gitignore
  86. +22
    -0
      frontend/.prettierignore
  87. +21
    -0
      frontend/.prettierrc.js
  88. +57
    -0
      frontend/README.md
  89. +126
    -0
      frontend/config/config.ts
  90. +28
    -0
      frontend/config/defaultSettings.ts
  91. +16
    -0
      frontend/config/proxy.ts
  92. +20
    -0
      frontend/config/routes.ts
  93. +23
    -0
      frontend/jest.config.ts
  94. +11
    -0
      frontend/jsconfig.json
  95. +103
    -0
      frontend/package.json
  96. +22
    -0
      frontend/playwright.config.ts
  97. BIN
     
  98. +1
    -0
      frontend/public/CNAME
  99. BIN
     
  100. BIN
     

+ 3
- 0
.gitignore Datei anzeigen

@@ -0,0 +1,3 @@
.vs
obj
bin

+ 36
- 0
backend/BPA.MES.Base.Application/BPA.MES.Base.Application.csproj Datei anzeigen

@@ -0,0 +1,36 @@
<Project Sdk="Microsoft.NET.Sdk">


<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>BPA.MES.Base.Application.xml</DocumentationFile>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>


<ItemGroup>
<None Remove="applicationsettings.json" />
<None Remove="BPA.MES.Base.Application.xml" />
</ItemGroup>

<ItemGroup>
<Content Include="applicationsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BPA.MES.Base.Core\BPA.MES.Base.Core.csproj" />
</ItemGroup>

<ItemGroup>
<Folder Include="Entitys\Base\" />
<Folder Include="Services\DeviceService\" />
<Folder Include="Services\MaterialService\" />
<Folder Include="Services\RecipesService\" />
<Folder Include="Services\CustomCodeService\" />
<Folder Include="Services\SystemService\" />
</ItemGroup>

</Project>

+ 2846
- 0
backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml
Datei-Diff unterdrückt, da er zu groß ist
Datei anzeigen


+ 64
- 0
backend/BPA.MES.Base.Application/Const/ClaimConst.cs Datei anzeigen

@@ -0,0 +1,64 @@
namespace BPA.MES.Base.Application
{
/// <summary>
/// 名 称 :
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/3/4 10:15:54
/// 描 述 :
/// </summary>
public class ClaimConst
{
/// <summary>
/// 用户Id
/// </summary>
public const string CLAINM_USERID = "UserId";
/// <summary>
/// 账号
/// </summary>
public const string CLAINM_ACCOUNT = "Account";
/// <summary>
/// 名称
/// </summary>
public const string CLAINM_NAME = "Name";
/// <summary>
/// 头像
/// </summary>
public const string CLAINM_AVATARURL = "AvatarUrl";
/// <summary>
/// 电话
/// </summary>
public const string CLAINM_PHONE = "Phone";
/// <summary>
/// 性别
/// </summary>
public const string CLAINM_SEX = "0";
/// <summary>
/// 是否授权
/// </summary>
public const string CLAINM_ISAUTH = "0";
/// <summary>
/// 微信session_key
/// </summary>
public const string SESSION_KEY = "session_key";
/// <summary>
/// 是否超级管理
/// </summary>
public const string CLAINM_SUPERADMIN = "SuperAdmin";
/// <summary>
/// 租户Id
/// </summary>
public const string TENANT_ID = "TenantId";
/// <summary>
/// 用户组织机构Id
/// </summary>
public const string CLAINM_ORGID = "OrgId";
/// <summary>
/// 用户组织机构名称
/// </summary>
public const string CLAINM_ORGNAME = "OrgName";
/// <summary>
/// 是否是管理员
/// </summary>
public const bool ISADMIN = false;
}
}

+ 22
- 0
backend/BPA.MES.Base.Application/Entitys/Base/DeviceRecipeEntity.cs Datei anzeigen

@@ -0,0 +1,22 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :设备配方表
/// 创 建 人 :yangxiao
/// 创建时间 :2023/3/2 13:57:00
/// 描 述 :
/// </summary>
[SugarTable("devices_recipes")]
public class DeviceRecipeEntity : DEntityBase
{
/// <summary>
/// 设备Id
/// </summary>
public string DeviceId { get; set; }
/// <summary>
/// 配方Id
/// </summary>
public string RecipesId { get; set; }
}
}

+ 23
- 0
backend/BPA.MES.Base.Application/Entitys/Base/DevicesInfoEntity.cs Datei anzeigen

@@ -0,0 +1,23 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :设备
/// 创 建 人 :yangxiao
/// 创建时间 :2023/3/2 13:51:45
/// 描 述 :
/// </summary>
[SugarTable("devices_info")]
public class DevicesInfoEntity: DEntityBase
{
/// <summary>
/// 名称
/// </summary>
[Required(ErrorMessage = "名称不能为空")]
public string Name { get; set; }
/// <summary>
/// 编码
/// </summary>
[Required(ErrorMessage = "编码不能为空")]
public string Code { get; set; }
}
}

+ 21
- 0
backend/BPA.MES.Base.Application/Entitys/Base/GroupInfoEntity.cs Datei anzeigen

@@ -0,0 +1,21 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :分组信息
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/3/10 14:01:15
/// 描 述 :
/// </summary>
[SugarTable("group_info")]
public class GroupInfoEntity: DEntityBase
{
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 介绍
/// </summary>
public string Des { get; set; }
}
}

+ 31
- 0
backend/BPA.MES.Base.Application/Entitys/Base/MaterialsInfoEntity.cs Datei anzeigen

@@ -0,0 +1,31 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :物料
/// 创 建 人 :yangxiao
/// 创建时间 :2023/3/2 13:52:00
/// 描 述 :
/// </summary>
[SugarTable("materials_info")]
public class MaterialsInfoEntity: DEntityBase
{
/// <summary>
/// 名称
/// </summary>
[Required(ErrorMessage = "名称不能为空")]
public string Name { get; set; }
/// <summary>
/// 编码
/// </summary>
[Required(ErrorMessage = "编码不能为空")]
public string Code { get; set; }
/// <summary>
/// 单位
/// </summary>
public string Unit { get; set; }
/// <summary>
/// 每秒出水量(g)
/// </summary>
public string Wos { get; set; }
}
}

+ 33
- 0
backend/BPA.MES.Base.Application/Entitys/Base/RecipeMaterialEntity.cs Datei anzeigen

@@ -0,0 +1,33 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :配方物料信息
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/3/2 13:58:19
/// 描 述 :
/// </summary>
[SugarTable("recipes_material")]
public class RecipeMaterialEntity : DEntityBase
{
/// <summary>
/// 物料Id
/// </summary>
public string MaterialId { get; set; }
/// <summary>
/// 配方Id
/// </summary>
public string RecipesId { get; set; }
/// <summary>
/// 通道
/// </summary>
public string Outlet { get; set; }
/// <summary>
/// 顺序
/// </summary>
public string Sort { get; set; }
/// <summary>
/// 时间(s)
/// </summary>
public string Time { get; set; }
}
}

+ 21
- 0
backend/BPA.MES.Base.Application/Entitys/Base/RecipesGroupEntity.cs Datei anzeigen

@@ -0,0 +1,21 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :配方分组
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/3/10 14:56:03
/// 描 述 :
/// </summary>
[SugarTable("recipes_group")]
public class RecipesGroupEntity
{
/// <summary>
/// 组Id
/// </summary>
public string GroupId { get; set; }
/// <summary>
/// 产品Id
/// </summary>
public string RecipesId { get; set; }
}
}

+ 25
- 0
backend/BPA.MES.Base.Application/Entitys/Base/RecipesInfoEntity.cs Datei anzeigen

@@ -0,0 +1,25 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :配方信息
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/3/2 13:57:15
/// 描 述 :
/// </summary>
[SugarTable("recipes_info")]
public class RecipesInfoEntity : DEntityBase
{
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 自定义编码
/// </summary>
public string Code { get; set; }
/// <summary>
/// 图标
/// </summary>
public string PicUrl { get; set; }
}
}

+ 30
- 0
backend/BPA.MES.Base.Application/Entitys/Base/StoreInfoEntity.cs Datei anzeigen

@@ -0,0 +1,30 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :店铺信息
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/3/2 13:52:13
/// 描 述 :
/// </summary>
[SugarTable("store_info")]
public class StoreInfoEntity : DEntityBase
{
/// <summary>
/// 名称
/// </summary>
[Required(ErrorMessage = "名称不能为空")]
public string Name { get; set; }
/// <summary>
/// 地址
/// </summary>
public string Address { get; set; }
/// <summary>
/// 联系电话
/// </summary>
public string Phone { get; set; }
/// <summary>
/// 负责人
/// </summary>
public string Directors { get; set; }
}
}

+ 29
- 0
backend/BPA.MES.Base.Application/Entitys/Sys/AccountEntity.cs Datei anzeigen

@@ -0,0 +1,29 @@

namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :账户信息
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/1/3 10:18:43
/// 描 述 :
/// </summary>
[SugarTable("sys_account")]
public class AccountEntity : DEntityBase
{
/// <summary>
/// 账号
/// </summary>
[SugarColumn(IsNullable = false)]
public string Account { get; set; }
/// <summary>
/// 密码
/// </summary>
[SugarColumn(IsNullable = false)]
public string Pwd { get; set; }
/// <summary>
/// 员工表Id
/// </summary>
[SugarColumn(IsNullable = false)]
public string EmployeeId { get; set; }
}
}

+ 29
- 0
backend/BPA.MES.Base.Application/Entitys/Sys/AuthorizeTemplateEntity.cs Datei anzeigen

@@ -0,0 +1,29 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 授权模板表
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/1/4 17:31:11
/// 描 述 :
/// </summary>
[SugarTable("sys_authorizetemplate")]
public class AuthorizeTemplateEntity : DEntityBase
{
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 描述
/// </summary>
public string Remark { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime? CreateAt { get; set; }
/// <summary>
/// 是否删除
/// </summary>
public bool IsDeleted { get; set; }
}
}

+ 27
- 0
backend/BPA.MES.Base.Application/Entitys/Sys/AuthorizeTemplateItemEntity.cs Datei anzeigen

@@ -0,0 +1,27 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 : 授权模板子项表
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/1/4 17:31:27
/// 描 述 :
/// </summary>
[SugarTable("sys_authorizetemplate_item")]
public class AuthorizeTemplateItemEntity : DEntityBase
{
/// <summary>
/// 模板编号
/// </summary>
public string TB_TemplateId { get; set; }

/// <summary>
/// 模块编号
/// </summary>
public string TB_ModuleId { get; set; }

/// <summary>
/// 是否删除
/// </summary>
public bool IsDeleted { get; set; }
}
}

+ 30
- 0
backend/BPA.MES.Base.Application/Entitys/Sys/AuthorizeTemplateMapEntity.cs Datei anzeigen

@@ -0,0 +1,30 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :授权对象表
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/1/4 17:31:39
/// 描 述 :
/// </summary>
[SugarTable("sys_authorizetemplatemap")]
public class AuthorizeTemplateMapEntity : DEntityBase
{
/// <summary>
/// 授权模板编号
/// </summary>
public string TemplateId { get; set; }

/// <summary>
/// 授权对象编号(用户编号,角色编号)
/// </summary>
public string ObjectId { get; set; }
/// <summary>
/// 授权类型 1:用户,2:角色
/// </summary>
public int AuthorizeType { get; set; }
/// <summary>
/// 是否删除
/// </summary>
public bool IsDeleted { get; set; }
}
}

+ 69
- 0
backend/BPA.MES.Base.Application/Entitys/Sys/EmployeeEntity.cs Datei anzeigen

@@ -0,0 +1,69 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :员工信息
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/1/4 17:44:31
/// 描 述 :
/// </summary>
[SugarTable("sys_employee")]
public class EmployeeEntity : DEntityBase
{
/// <summary>
/// 员工姓名
/// </summary>
[SugarColumn(IsNullable = false)]
public string Name { get; set; }
/// <summary>
/// 1男2女
/// </summary>
[SugarColumn(IsNullable = true)]
public int Gender { get; set; }
/// <summary>
/// 手机号
/// </summary>
[SugarColumn(IsNullable = false)]
public string Phone { get; set; }
/// <summary>
/// 员工IC卡
/// </summary>
[SugarColumn(IsNullable = true)]
public string ICCard { get; set; }
/// <summary>
/// 头像
/// </summary>
[SugarColumn(IsNullable = true)]
public string Header { get; set; }

[SugarColumn(IsNullable = false)]
public DateTime JoinDate { get; set; }
/// <summary>
/// 入职时间
/// </summary>
[SugarColumn(IsNullable = true)]
public DateTime? OutDate { get; set; }
/// <summary>
/// 身份证
/// </summary>
[SugarColumn(IsNullable = true)]
public string IdCard { get; set; }
/// <summary>
/// 1在职2出差3离职
/// </summary>
[SugarColumn(IsNullable = false)]
public int Stutas { get; set; }
/// <summary>
/// 超管
/// </summary>
[SugarColumn(IsNullable = false)]
public bool IsAdmin { get; set; }
/// <summary>
/// 角色Id
/// </summary>
public string TB_RoleId { get; set; }
/// <summary>
/// 是否删除
/// </summary>
public bool IsDeleted { get; set; }
}
}

+ 46
- 0
backend/BPA.MES.Base.Application/Entitys/Sys/ModuleEntity.cs Datei anzeigen

@@ -0,0 +1,46 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :模块菜单表
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/1/4 17:32:15
/// 描 述 :
/// </summary>
[SugarTable("sys_module")]
public class ModuleEntity : DEntityBase
{
/// <summary>
/// 类别 1:菜单,2:视图,3:功能
/// </summary>
public int Category { get; set; }

/// <summary>
/// 菜单打开方式 0:框架内嵌,1:新开页面
/// </summary>
public int OpenType { get; set; }

/// <summary>
/// 父级编号
/// </summary>
public string ParentId { get; set; }

/// <summary>
/// 名称
/// </summary>
public string Name { set; get; }

/// <summary>
/// 图标
/// </summary>
public string Icon { set; get; }

/// <summary>
/// 地址
/// </summary>
public string Url { set; get; }
/// <summary>
/// 状态
/// </summary>
public bool IsDisabled { get; set; }
}
}

+ 32
- 0
backend/BPA.MES.Base.Application/Entitys/Sys/RoleEntity.cs Datei anzeigen

@@ -0,0 +1,32 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :角色信息
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/1/4 17:32:32
/// 描 述 :
/// </summary>
[SugarTable("sys_role")]
public class RoleEntity : DEntityBase
{
/// <summary>
/// 角色名称
/// </summary>
public string Name { get; set; }

/// <summary>
/// 角色类型 1超级管理员,2其他
/// </summary>
public int? RoleType { get; set; }

/// <summary>
/// 角色描述
/// </summary>
public string Description { get; set; }

/// <summary>
/// 是否删除
/// </summary>
public bool IsDeleted { get; set; }
}
}

+ 19
- 0
backend/BPA.MES.Base.Application/GlobalUsings.cs Datei anzeigen

@@ -0,0 +1,19 @@
global using Furion;
global using Furion.DataEncryption;
global using Furion.DataValidation;
global using Furion.DependencyInjection;
global using Furion.DynamicApiController;
global using Furion.Extensions;
global using Furion.FriendlyException;
global using Furion.Logging;
global using Mapster;
global using Microsoft.AspNetCore.Authorization;
global using Microsoft.AspNetCore.Http;
global using Microsoft.AspNetCore.Mvc;
global using Microsoft.CodeAnalysis;
global using BPA.MES.Base.Core;
global using static BPA.MES.Base.Core.TreeExtensions;
global using System.ComponentModel.DataAnnotations;
global using BPA.MES.Base.Application.Entitys;
global using Furion.DataEncryption.Extensions;
global using SqlSugar;

+ 99
- 0
backend/BPA.MES.Base.Application/Services/DeviceService/Dtos/DeviceRecipeDto.cs Datei anzeigen

@@ -0,0 +1,99 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :设备Dto类
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/3/2 16:12:06
/// 描 述 :
/// </summary>
public class DeviceRecipeDto : DeviceRecipeEntity
{

}
/// <summary>
/// 增加
/// </summary>
public class DeviceRecipeAddInput : DeviceRecipeDto
{

}
/// <summary>
/// 更新
/// </summary>
public class DeviceRecipeUpdateInput : DeviceRecipeDto
{

}
/// <summary>
/// 删除
/// </summary>
public class DeviceRecipeDelInput
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
}
/// <summary>
/// 不分页
/// </summary>
public class DeviceRecipeQueryInput
{
/// <summary>
/// 设备Id
/// </summary>
public string DeviceId { get; set; }
}
/// <summary>
/// 分页
/// </summary>
public class DeviceRecipeQueryPageInput : RequestPage
{

}

public class DeviceRecipeBatchAddInput
{
/// <summary>
/// 设备Id
/// </summary>
public string DeviceId { get; set; }
/// <summary>
/// 配方数组
/// </summary>
public List<string> RecipesIds { get; set; } = new();
}


/// <summary>
/// 输出
/// </summary>
public class DeviceRecipeOutput : DeviceRecipeDto
{
/// <summary>
/// 设备名称
/// </summary>
public string DeviceName { get; set; }
/// <summary>
/// 配方名称
/// </summary>
public string RecipeName { get; set; }
/// <summary>
/// 配方代码
/// </summary>
public string RecipeCode { get; set; }
/// <summary>
/// 分组Id
/// </summary>
public string GroupId { get; set; }
/// <summary>
/// 分组名称
/// </summary>
public string GroupName { get; set; }
/// <summary>
/// 配方图片地址
/// </summary>
public string RecipesPic { get; set; }
}
}

+ 51
- 0
backend/BPA.MES.Base.Application/Services/DeviceService/Dtos/DevicesInfoDto.cs Datei anzeigen

@@ -0,0 +1,51 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :设备Dto类
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/3/2 16:12:06
/// 描 述 :
/// </summary>
public class DevicesInfoDto : DevicesInfoEntity
{

}
/// <summary>
/// 增加
/// </summary>
public class DevicesInfoAddInput : DevicesInfoDto
{

}
/// <summary>
/// 更新
/// </summary>
public class DevicesInfoUpdateInput : DevicesInfoDto
{

}
/// <summary>
/// 删除
/// </summary>
public class DevicesInfoDelInput
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
}
/// <summary>
/// 分页
/// </summary>
public class DevicesInfoQueryPageInput : RequestPage
{

}
/// <summary>
/// 输出
/// </summary>
public class DevicesInfoOutput : DevicesInfoDto
{

}
}

+ 145
- 0
backend/BPA.MES.Base.Application/Services/DeviceService/Services/DeviceRecipeService.cs Datei anzeigen

@@ -0,0 +1,145 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :设备服务
/// 创 建 人 :yangxiao
/// 创建时间 :2023/3/2 16:11:04
/// 描 述 :店铺数据维护
/// </summary>
[ApiDescriptionSettings(Name = "DeviceRecipe", KeepName = true, SplitCamelCase = true, KeepVerb = true)]
public class DeviceRecipeService : IDeviceRecipeService, ITransient, IDynamicApiController
{
private readonly ISqlSugarClient _dbContext;
public DeviceRecipeService(ISqlSugarClient db)
{
_dbContext = db;
}
/// <summary>
/// 增加
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public async Task<bool> Add(DeviceRecipeAddInput input)
{
var r_entity = await _dbContext.Queryable<DeviceRecipeEntity>().FirstAsync(x => x.DeviceId == input.DeviceId && x.RecipesId==input.RecipesId);
if (r_entity != null)
{
throw Oops.Bah("名称已存在!");
}
DeviceRecipeEntity entity = input.Adapt<DeviceRecipeEntity>();
return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync();
}
/// <summary>
/// 批量下发配方
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>

public async Task<bool> BatchUpdate(DeviceRecipeBatchAddInput input)
{
bool result = false;
List<DeviceRecipeEntity> dr_entitys = new();
foreach (var item in input.RecipesIds)
{
DeviceRecipeEntity entity = new();
entity.RecipesId = item;
entity.DeviceId = input.DeviceId;
dr_entitys.Add(entity);
}
try
{
_dbContext.Ado.BeginTran();
await _dbContext.Deleteable<DeviceRecipeEntity>().Where(x => x.DeviceId == input.DeviceId).ExecuteCommandAsync();
if (input.RecipesIds.Any())
{
await _dbContext.Insertable(dr_entitys).ExecuteCommandAsync();
}
_dbContext.Ado.CommitTran();
result = true;
}
catch (Exception ex)
{
throw Oops.Bah("更新失败!");
}
return result;
}
/// <summary>
/// 删除
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpPost]
public async Task<bool> Del(DeviceRecipeDelInput input)
{
var res = await _dbContext.Deleteable<DeviceRecipeEntity>().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync();
return res;
}
/// <summary>
/// 详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpGet]
public async Task<DeviceRecipeOutput> Detail(string Id)
{
var entity = await _dbContext.Queryable<DeviceRecipeEntity>().FirstAsync(x => x.Id == Id);
DeviceRecipeOutput output = entity.Adapt<DeviceRecipeOutput>();
return output;
}
/// <summary>
/// 列表
/// </summary>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpPost,AllowAnonymous]
public async Task<List<DeviceRecipeOutput>> List(DeviceRecipeQueryInput input)
{
var output = await _dbContext.Queryable<DeviceRecipeEntity>()
.LeftJoin<RecipesInfoEntity>((a,b)=>a.RecipesId==b.Id)
.LeftJoin<RecipesGroupEntity>((a,b,c)=>a.RecipesId==c.RecipesId)
.LeftJoin<GroupInfoEntity>((a, b, c,d)=>c.GroupId==d.Id)
.WhereIF(!string.IsNullOrEmpty(input.DeviceId),a=>a.DeviceId==input.DeviceId)
.Select((a, b, c,d) => new DeviceRecipeOutput
{
DeviceId = a.DeviceId,
RecipeName = b.Name,
RecipeCode = b.Code,
RecipesId = a.RecipesId,
RecipesPic =b.PicUrl,
GroupId = c.GroupId,
GroupName = d.Name
})
.ToListAsync();
return output;
}
/// <summary>
/// 分页
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public async Task<SqlSugarPagedList<DeviceRecipeOutput>> PagedList(DeviceRecipeQueryPageInput input)
{
var entity = await _dbContext.Queryable<DeviceRecipeEntity>()
.ToPagedListAsync(input.PageIndex, input.PageSize);
SqlSugarPagedList<DeviceRecipeOutput> output = entity.Adapt<SqlSugarPagedList<DeviceRecipeOutput>>();
return output;
}
/// <summary>
/// 更新
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpPost]
public async Task<bool> Update(DeviceRecipeUpdateInput input)
{
var res = await _dbContext.Updateable<DeviceRecipeEntity>().ExecuteCommandHasChangeAsync();
return res;
}
}
}

+ 111
- 0
backend/BPA.MES.Base.Application/Services/DeviceService/Services/DevicesInfoService.cs Datei anzeigen

@@ -0,0 +1,111 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :设备服务
/// 创 建 人 :yangxiao
/// 创建时间 :2023/3/2 16:11:04
/// 描 述 :店铺数据维护
/// </summary>
[ApiDescriptionSettings(Name = "DevicesInfo", KeepName = true, SplitCamelCase = true, KeepVerb = true)]
public class DevicesInfoService : IDevicesInfoService, ITransient, IDynamicApiController
{
private readonly ISqlSugarClient _dbContext;
public DevicesInfoService(ISqlSugarClient db)
{
_dbContext = db;
}
/// <summary>
/// 增加
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public async Task<bool> Add(DevicesInfoAddInput input)
{
var r_entity = await _dbContext.Queryable<DevicesInfoEntity>().FirstAsync(x => x.Name == input.Name);
if (r_entity != null)
{
throw Oops.Bah("名称已存在!");
}
DevicesInfoEntity entity = input.Adapt<DevicesInfoEntity>();
return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync();
}
/// <summary>
/// 删除
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpPost]
public async Task<bool> Del(DevicesInfoDelInput input)
{
var res = await _dbContext.Deleteable<DevicesInfoEntity>().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync();
return res;
}
/// <summary>
/// 详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpGet]
public async Task<DevicesInfoOutput> Detail(string Id)
{
var entity = await _dbContext.Queryable<DevicesInfoEntity>().FirstAsync(x => x.Id == Id);
DevicesInfoOutput output = entity.Adapt<DevicesInfoOutput>();
return output;
}
/// <summary>
/// 列表
/// </summary>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpGet]
public async Task<List<DevicesInfoOutput>> List()
{
var entity = await _dbContext.Queryable<DevicesInfoEntity>().ToListAsync();
List<DevicesInfoOutput> output = entity.Adapt<List<DevicesInfoOutput>>();
return output;
}
/// <summary>
/// 分页
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public async Task<SqlSugarPagedList<DevicesInfoOutput>> PagedList(DevicesInfoQueryPageInput input)
{
var entity = await _dbContext.Queryable<DevicesInfoEntity>()
.ToPagedListAsync(input.PageIndex, input.PageSize);
SqlSugarPagedList<DevicesInfoOutput> output = entity.Adapt<SqlSugarPagedList<DevicesInfoOutput>>();
return output;
}
/// <summary>
/// 下拉
/// </summary>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpGet]
public async Task<dynamic> SelectList()
{
var entity = await _dbContext.Queryable<DevicesInfoEntity>().Select(x => new
{
key = x.Id,
value = x.Name
}).ToListAsync();
return entity;
}
/// <summary>
/// 更新
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpPost]
public async Task<bool> Update(DevicesInfoUpdateInput input)
{
var res = await _dbContext.Updateable<DevicesInfoEntity>().ExecuteCommandHasChangeAsync();
return res;
}
}
}

+ 49
- 0
backend/BPA.MES.Base.Application/Services/DeviceService/Services/IDeviceRecipeService.cs Datei anzeigen

@@ -0,0 +1,49 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :设备配方服务
/// 创 建 人 :yangxiao
/// 创建时间 :2023/3/2 18:30:58
/// 描 述 :
/// </summary>
public interface IDeviceRecipeService
{
/// <summary>
/// 增加
/// </summary>
/// <returns></returns>
Task<bool> Add(DeviceRecipeAddInput input);
/// <summary>
/// 移除
/// </summary>
/// <returns></returns>
Task<bool> Del(DeviceRecipeDelInput input);
/// <summary>
/// 更新
/// </summary>
/// <returns></returns>
Task<bool> Update(DeviceRecipeUpdateInput input);
/// <summary>
/// 不分页列表
/// </summary>
/// <returns></returns>
Task<List<DeviceRecipeOutput>> List(DeviceRecipeQueryInput input);
/// <summary>
/// 分页列表
/// </summary>
/// <returns></returns>
Task<SqlSugarPagedList<DeviceRecipeOutput>> PagedList(DeviceRecipeQueryPageInput input);
/// <summary>
/// 查询单条
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
Task<DeviceRecipeOutput> Detail(string Id);
/// <summary>
/// 批量下发配方
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
Task<bool> BatchUpdate(DeviceRecipeBatchAddInput input);
}
}

+ 49
- 0
backend/BPA.MES.Base.Application/Services/DeviceService/Services/IDevicesInfoService.cs Datei anzeigen

@@ -0,0 +1,49 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :设备服务
/// 创 建 人 :yangxiao
/// 创建时间 :2023/3/2 18:30:58
/// 描 述 :
/// </summary>
public interface IDevicesInfoService
{
/// <summary>
/// 增加
/// </summary>
/// <returns></returns>
Task<bool> Add(DevicesInfoAddInput input);
/// <summary>
/// 移除
/// </summary>
/// <returns></returns>
Task<bool> Del(DevicesInfoDelInput input);
/// <summary>
/// 更新
/// </summary>
/// <returns></returns>
Task<bool> Update(DevicesInfoUpdateInput input);
/// <summary>
/// 不分页列表
/// </summary>
/// <returns></returns>
Task<List<DevicesInfoOutput>> List();
/// <summary>
/// 分页列表
/// </summary>
/// <returns></returns>
Task<SqlSugarPagedList<DevicesInfoOutput>> PagedList(DevicesInfoQueryPageInput input);
/// <summary>
/// 下拉列表
/// </summary>
/// <returns></returns>
Task<dynamic> SelectList();
/// <summary>
/// 查询单条
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
Task<DevicesInfoOutput> Detail(string Id);
}
}

+ 58
- 0
backend/BPA.MES.Base.Application/Services/MaterialService/Dtos/MaterialsInfoDto.cs Datei anzeigen

@@ -0,0 +1,58 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :设备Dto类
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/3/2 16:12:06
/// 描 述 :
/// </summary>
public class MaterialsInfoDto : MaterialsInfoEntity
{

}
/// <summary>
/// 增加
/// </summary>
public class MaterialsInfoAddInput : MaterialsInfoDto
{

}
/// <summary>
/// 更新
/// </summary>
public class MaterialsInfoUpdateInput : MaterialsInfoDto
{

}
/// <summary>
/// 删除
/// </summary>
public class MaterialsInfoDelInput
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
}
/// <summary>
/// 分页
/// </summary>
public class MaterialsInfoQueryPageInput : RequestPage
{
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 编码
/// </summary>
public string Code { get; set; }
}
/// <summary>
/// 输出
/// </summary>
public class MaterialsInfoOutput : MaterialsInfoDto
{

}
}

+ 48
- 0
backend/BPA.MES.Base.Application/Services/MaterialService/Services/IMaterialsInfoService.cs Datei anzeigen

@@ -0,0 +1,48 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :物料服务
/// 创 建 人 :yangxiao
/// 创建时间 :2023/3/2 18:31:53
/// 描 述 :
/// </summary>
public interface IMaterialsInfoService
{
/// <summary>
/// 增加
/// </summary>
/// <returns></returns>
Task<bool> Add(MaterialsInfoAddInput input);
/// <summary>
/// 移除
/// </summary>
/// <returns></returns>
Task<bool> Del(MaterialsInfoDelInput input);
/// <summary>
/// 更新
/// </summary>
/// <returns></returns>
Task<bool> Update(MaterialsInfoUpdateInput input);
/// <summary>
/// 不分页列表
/// </summary>
/// <returns></returns>
Task<List<MaterialsInfoOutput>> List();
/// <summary>
/// 分页列表
/// </summary>
/// <returns></returns>
Task<SqlSugarPagedList<MaterialsInfoOutput>> PagedList(MaterialsInfoQueryPageInput input);
/// <summary>
/// 下拉列表
/// </summary>
/// <returns></returns>
Task<dynamic> SelectList();
/// <summary>
/// 查询单条
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
Task<MaterialsInfoOutput> Detail(string Id);
}
}

+ 115
- 0
backend/BPA.MES.Base.Application/Services/MaterialService/Services/MaterialsInfoService.cs Datei anzeigen

@@ -0,0 +1,115 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :物料服务
/// 创 建 人 :yangxiao
/// 创建时间 :2023/3/2 16:11:04
/// 描 述 :店铺数据维护
/// </summary>
[ApiDescriptionSettings(Name = "MaterialsInfo", KeepName = true, SplitCamelCase = true, KeepVerb = true)]
public class MaterialsInfoService : IMaterialsInfoService, ITransient, IDynamicApiController
{
private readonly ISqlSugarClient _dbContext;
public MaterialsInfoService(ISqlSugarClient db)
{
_dbContext = db;
}
/// <summary>
/// 增加
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public async Task<bool> Add(MaterialsInfoAddInput input)
{
var r_entity = await _dbContext.Queryable<MaterialsInfoEntity>().FirstAsync(x => x.Name == input.Name);
if (r_entity != null)
{
throw Oops.Bah("名称已存在!");
}
MaterialsInfoEntity entity = input.Adapt<MaterialsInfoEntity>();
return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync();
}
/// <summary>
/// 删除
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpPost]
public async Task<bool> Del(MaterialsInfoDelInput input)
{
var res = await _dbContext.Deleteable<MaterialsInfoEntity>().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync();
return res;
}
/// <summary>
/// 详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpGet]
public async Task<MaterialsInfoOutput> Detail(string Id)
{
var entity = await _dbContext.Queryable<MaterialsInfoEntity>().FirstAsync(x => x.Id == Id);
MaterialsInfoOutput output = entity.Adapt<MaterialsInfoOutput>();
return output;
}
/// <summary>
/// 列表
/// </summary>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpGet]
public async Task<List<MaterialsInfoOutput>> List()
{
var entity = await _dbContext.Queryable<MaterialsInfoEntity>().ToListAsync();
List<MaterialsInfoOutput> output = entity.Adapt<List<MaterialsInfoOutput>>();
return output;
}
/// <summary>
/// 分页
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public async Task<SqlSugarPagedList<MaterialsInfoOutput>> PagedList(MaterialsInfoQueryPageInput input)
{
var entity = await _dbContext.Queryable<MaterialsInfoEntity>()
.WhereIF(!string.IsNullOrEmpty(input.Name),x=>x.Name.Contains(input.Name))
.WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Code.Contains(input.Code))
.ToPagedListAsync(input.PageIndex, input.PageSize);
SqlSugarPagedList<MaterialsInfoOutput> output = entity.Adapt<SqlSugarPagedList<MaterialsInfoOutput>>();
return output;
}
/// <summary>
/// 下拉
/// </summary>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpGet]
public async Task<dynamic> SelectList()
{
var entity = await _dbContext.Queryable<MaterialsInfoEntity>().Select(x => new
{
key = x.Id,
value = x.Name
}).ToListAsync();
return entity;
}
/// <summary>
/// 更新
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpPost]
public async Task<bool> Update(MaterialsInfoUpdateInput input)
{
var entity = await _dbContext.Queryable<MaterialsInfoEntity>().Where(x => x.Id == input.Id).FirstAsync();
entity = input.Adapt<MaterialsInfoEntity>();
var res = await _dbContext.Updateable(entity).ExecuteCommandHasChangeAsync();
return res;
}
}
}

+ 54
- 0
backend/BPA.MES.Base.Application/Services/RecipesService/Dtos/GroupInfoDto.cs Datei anzeigen

@@ -0,0 +1,54 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :产品分组
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/3/10 13:59:43
/// 描 述 :
/// </summary>
public class GroupInfoDto : GroupInfoEntity
{

}
/// <summary>
/// 增加
/// </summary>
public class GroupInfoAddInput : GroupInfoDto
{

}
/// <summary>
/// 更新
/// </summary>
public class GroupInfoUpdateInput : GroupInfoDto
{

}
/// <summary>
/// 删除
/// </summary>
public class GroupInfoDelInput
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
}
/// <summary>
/// 分页
/// </summary>
public class GroupInfoQueryPageInput : RequestPage
{
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
}
/// <summary>
/// 输出
/// </summary>
public class GroupInfoOutput : GroupInfoDto
{

}
}

+ 91
- 0
backend/BPA.MES.Base.Application/Services/RecipesService/Dtos/RecipeMaterialDto.cs Datei anzeigen

@@ -0,0 +1,91 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :配方物料Dto类
/// 创 建 人 :yangxiao
/// 创建时间 :2023/3/2 16:12:06
/// 描 述 :
/// </summary>
public class RecipeMaterialDto : RecipeMaterialEntity
{

}
/// <summary>
/// 增加
/// </summary>
public class RecipeMaterialAddInput
{
/// <summary>
/// 物料Id
/// </summary>
public string MaterialId { get; set; }
/// <summary>
/// 配方Id
/// </summary>
public string RecipesId { get; set; }
/// <summary>
/// 通道
/// </summary>
public string Outlet { get; set; }
/// <summary>
/// 顺序
/// </summary>
public string Sort { get; set; }
/// <summary>
/// 时间(s)
/// </summary>
public string Time { get; set; }
}
/// <summary>
/// 更新
/// </summary>
public class RecipeMaterialUpdateInput : RecipeMaterialDto
{

}
/// <summary>
/// 删除
/// </summary>
public class RecipeMaterialDelInput
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
}
/// <summary>
/// 不分页
/// </summary>
public class RecipeMaterialQueryInput
{
/// <summary>
/// 配方Id
/// </summary>
public string RecipesId { get; set; }
}
/// <summary>
/// 分页
/// </summary>
public class RecipeMaterialQueryPageInput : RequestPage
{

}
/// <summary>
/// 输出
/// </summary>
public class RecipeMaterialOutput : RecipeMaterialDto
{
/// <summary>
/// 配方名称
/// </summary>
public string RecipesName { get; set; }
/// <summary>
/// 物料名称
/// </summary>
public string MaterialName { get; set; }
/// <summary>
/// 物料编码
/// </summary>
public string MaterialCode { get; set; }
}
}

+ 66
- 0
backend/BPA.MES.Base.Application/Services/RecipesService/Dtos/RecipesInfoDto.cs Datei anzeigen

@@ -0,0 +1,66 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :配方Dto类
/// 创 建 人 :yangxiao
/// 创建时间 :2023/3/2 16:12:06
/// 描 述 :
/// </summary>
public class RecipesInfoDto : RecipesInfoEntity
{

}
/// <summary>
/// 增加
/// </summary>
public class RecipesInfoAddInput : RecipesInfoDto
{

}
/// <summary>
/// 更新
/// </summary>
public class RecipesInfoUpdateInput : RecipesInfoDto
{

}
/// <summary>
/// 删除
/// </summary>
public class RecipesInfoDelInput
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
}
/// <summary>
/// 分页
/// </summary>
public class RecipesInfoQueryPageInput : RequestPage
{
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 分组id
/// </summary>
public string GroupId { get; set; }
}
/// <summary>
/// 输出
/// </summary>
public class RecipesInfoOutput : RecipesInfoDto
{
/// <summary>
/// 分组Id
/// </summary>
public string GroupId { get; set; }
}

public class RecipesGroupInput : RecipesGroupEntity
{

}
}

+ 97
- 0
backend/BPA.MES.Base.Application/Services/RecipesService/Services/GroupInfoService.cs Datei anzeigen

@@ -0,0 +1,97 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :分组信息
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/3/10 14:03:06
/// 描 述 :
/// </summary>
[ApiDescriptionSettings(Name = "GroupInfo", KeepName = true, SplitCamelCase = true, KeepVerb = true)]
public class GroupInfoService : IGroupInfoService, ITransient, IDynamicApiController
{
private readonly ISqlSugarClient _dbContext;
public GroupInfoService(ISqlSugarClient db)
{
_dbContext = db;
}
/// <summary>
/// 增加
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public async Task<bool> Add(GroupInfoAddInput input)
{
GroupInfoEntity entity = input.Adapt<GroupInfoEntity>();
return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync();
}
/// <summary>
/// 删除
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpPost]
public async Task<bool> Del(GroupInfoDelInput input)
{
var res = await _dbContext.Deleteable<GroupInfoEntity>().Where(x=>x.Id==input.Id).ExecuteCommandHasChangeAsync();
return res;
}
/// <summary>
/// 详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpGet]
public async Task<GroupInfoOutput> Detail(string Id)
{
var entity = await _dbContext.Queryable<GroupInfoEntity>().FirstAsync();
GroupInfoOutput output = entity.Adapt<GroupInfoOutput>();
return output;
}
/// <summary>
/// 列表
/// </summary>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpPost, AllowAnonymous]
public async Task<List<GroupInfoOutput>> List()
{
var entity = await _dbContext.Queryable<GroupInfoEntity>().ToListAsync();
List<GroupInfoOutput> output = entity.Adapt<List<GroupInfoOutput>>();
return output;
}
/// <summary>
/// 分页
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public async Task<SqlSugarPagedList<GroupInfoOutput>> PagedList(GroupInfoQueryPageInput input)
{
var entity = await _dbContext.Queryable<GroupInfoEntity>()
.ToPagedListAsync(input.PageIndex, input.PageSize);
SqlSugarPagedList<GroupInfoOutput> output = entity.Adapt<SqlSugarPagedList<GroupInfoOutput>>();
return output;
}
/// <summary>
/// 更新
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpPost]
public async Task<bool> Update(GroupInfoUpdateInput input)
{
var entity = await _dbContext.Queryable<GroupInfoEntity>().FirstAsync(x=>x.Id==input.Id);
if (entity == null)
{
throw Oops.Bah("数据不存在!");
}
entity = input.Adapt<GroupInfoEntity>();
var res = await _dbContext.Updateable(entity).ExecuteCommandHasChangeAsync();
return res;
}
}
}

+ 43
- 0
backend/BPA.MES.Base.Application/Services/RecipesService/Services/IGroupInfoService.cs Datei anzeigen

@@ -0,0 +1,43 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :分组信息
/// 创 建 人 :yangxiao
/// 创建时间 :2023/3/10 14:03:21
/// 描 述 :
/// </summary>
public interface IGroupInfoService
{
/// <summary>
/// 增加
/// </summary>
/// <returns></returns>
Task<bool> Add(GroupInfoAddInput input);
/// <summary>
/// 移除
/// </summary>
/// <returns></returns>
Task<bool> Del(GroupInfoDelInput input);
/// <summary>
/// 更新
/// </summary>
/// <returns></returns>
Task<bool> Update(GroupInfoUpdateInput input);
/// <summary>
/// 不分页列表
/// </summary>
/// <returns></returns>
Task<List<GroupInfoOutput>> List();
/// <summary>
/// 分页列表
/// </summary>
/// <returns></returns>
Task<SqlSugarPagedList<GroupInfoOutput>> PagedList(GroupInfoQueryPageInput input);
/// <summary>
/// 查询单条
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
Task<GroupInfoOutput> Detail(string Id);
}
}

+ 49
- 0
backend/BPA.MES.Base.Application/Services/RecipesService/Services/IRecipeMaterialService.cs Datei anzeigen

@@ -0,0 +1,49 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :配方物料服务
/// 创 建 人 :yangxiao
/// 创建时间 :2023/3/2 18:33:18
/// 描 述 :
/// </summary>
public interface IRecipeMaterialService
{
/// <summary>
/// 增加
/// </summary>
/// <returns></returns>
Task<bool> Add(RecipeMaterialAddInput input);
/// <summary>
/// 批量增加
/// </summary>
/// <param name="inputs"></param>
/// <returns></returns>
Task<bool> BatchAdd(List<RecipeMaterialAddInput> inputs);
/// <summary>
/// 移除
/// </summary>
/// <returns></returns>
Task<bool> Del(RecipeMaterialDelInput input);
/// <summary>
/// 更新
/// </summary>
/// <returns></returns>
Task<bool> Update(RecipeMaterialUpdateInput input);
/// <summary>
/// 不分页列表
/// </summary>
/// <returns></returns>
Task<List<RecipeMaterialOutput>> List(RecipeMaterialQueryInput input);
/// <summary>
/// 分页列表
/// </summary>
/// <returns></returns>
Task<SqlSugarPagedList<RecipeMaterialOutput>> PagedList(RecipeMaterialQueryPageInput input);
/// <summary>
/// 查询单条
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
Task<RecipeMaterialOutput> Detail(string Id);
}
}

+ 54
- 0
backend/BPA.MES.Base.Application/Services/RecipesService/Services/IRecipesInfoService.cs Datei anzeigen

@@ -0,0 +1,54 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :配方服务
/// 创 建 人 :yangxiao
/// 创建时间 :2023/3/2 18:33:18
/// 描 述 :
/// </summary>
public interface IRecipesInfoService
{
/// <summary>
/// 增加
/// </summary>
/// <returns></returns>
Task<bool> Add(RecipesInfoAddInput input);
/// <summary>
/// 移除
/// </summary>
/// <returns></returns>
Task<bool> Del(RecipesInfoDelInput input);
/// <summary>
/// 更新
/// </summary>
/// <returns></returns>
Task<bool> Update(RecipesInfoUpdateInput input);
/// <summary>
/// 不分页列表
/// </summary>
/// <returns></returns>
Task<List<RecipesInfoOutput>> List();
/// <summary>
/// 分页列表
/// </summary>
/// <returns></returns>
Task<SqlSugarPagedList<RecipesInfoOutput>> PagedList(RecipesInfoQueryPageInput input);
/// <summary>
/// 下拉列表
/// </summary>
/// <returns></returns>
Task<dynamic> SelectList();
/// <summary>
/// 查询单条
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
Task<RecipesInfoOutput> Detail(string Id);
/// <summary>
/// 更改物料分组
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
Task<bool> ChangeGroup(RecipesGroupInput input);
}
}

+ 131
- 0
backend/BPA.MES.Base.Application/Services/RecipesService/Services/RecipeMaterialService.cs Datei anzeigen

@@ -0,0 +1,131 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :配方物料服务
/// 创 建 人 :yangxiao
/// 创建时间 :2023/3/2 16:11:04
/// 描 述 :配方物料数据维护
/// </summary>
[ApiDescriptionSettings(Name = "RecipeMaterial", KeepName = true, SplitCamelCase = true, KeepVerb = true)]
public class RecipeMaterialService : IRecipeMaterialService, ITransient, IDynamicApiController
{
private readonly ISqlSugarClient _dbContext;
public RecipeMaterialService(ISqlSugarClient db)
{
_dbContext = db;
}
/// <summary>
/// 增加
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public async Task<bool> Add(RecipeMaterialAddInput input)
{
RecipeMaterialEntity entity = input.Adapt<RecipeMaterialEntity>();
return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync();
}
/// <summary>
/// 批量增加
/// </summary>
/// <param name="inputs"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
public async Task<bool> BatchAdd(List<RecipeMaterialAddInput> inputs)
{
bool result = false;
List<RecipeMaterialEntity> entitys = inputs.Adapt<List<RecipeMaterialEntity>>();
try
{
_dbContext.Ado.BeginTran();
await _dbContext.Deleteable<RecipeMaterialEntity>().Where(x => x.RecipesId == inputs[0].RecipesId).ExecuteCommandAsync();
await _dbContext.Insertable(entitys).ExecuteCommandAsync();
_dbContext.Ado.CommitTran();
result = true;
}
catch (Exception ex)
{
_dbContext.Ado.RollbackTran();
throw Oops.Bah("保存失败!");
}
return result;
}

/// <summary>
/// 删除
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpPost]
public async Task<bool> Del(RecipeMaterialDelInput input)
{
var res = await _dbContext.Deleteable<RecipeMaterialEntity>().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync();
return res;
}
/// <summary>
/// 详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpGet]
public async Task<RecipeMaterialOutput> Detail(string Id)
{
var entity = await _dbContext.Queryable<RecipeMaterialEntity>().FirstAsync(x => x.Id == Id);
RecipeMaterialOutput output = entity.Adapt<RecipeMaterialOutput>();
return output;
}
/// <summary>
/// 列表
/// </summary>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpPost,AllowAnonymous]
public async Task<List<RecipeMaterialOutput>> List(RecipeMaterialQueryInput input)
{
var output = await _dbContext.Queryable<RecipeMaterialEntity>()
.LeftJoin<RecipesInfoEntity>((a,b)=>a.RecipesId==b.Id)
.LeftJoin<MaterialsInfoEntity>((a,b,c)=>a.MaterialId==c.Id)
.WhereIF(!string.IsNullOrEmpty(input.RecipesId),(a,b,c)=>a.RecipesId==input.RecipesId)
.Select((a,b,c)=>new RecipeMaterialOutput
{
MaterialName = c.Name,
MaterialCode = c.Code,
MaterialId = c.Id,
RecipesId = a.RecipesId,
RecipesName = b.Name,
Sort = a.Sort,
Time = a.Time,
Outlet = a.Outlet
})
.ToListAsync();
return output;
}
/// <summary>
/// 分页
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public async Task<SqlSugarPagedList<RecipeMaterialOutput>> PagedList(RecipeMaterialQueryPageInput input)
{
var entity = await _dbContext.Queryable<RecipeMaterialEntity>()
.ToPagedListAsync(input.PageIndex, input.PageSize);
SqlSugarPagedList<RecipeMaterialOutput> output = entity.Adapt<SqlSugarPagedList<RecipeMaterialOutput>>();
return output;
}
/// <summary>
/// 更新
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpPost]
public async Task<bool> Update(RecipeMaterialUpdateInput input)
{
var res = await _dbContext.Updateable<RecipeMaterialEntity>().ExecuteCommandHasChangeAsync();
return res;
}
}
}

+ 132
- 0
backend/BPA.MES.Base.Application/Services/RecipesService/Services/RecipesInfoService.cs Datei anzeigen

@@ -0,0 +1,132 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :物料服务
/// 创 建 人 :yangxiao
/// 创建时间 :2023/3/2 16:11:04
/// 描 述 :店铺数据维护
/// </summary>
[ApiDescriptionSettings(Name = "RecipesInfo", KeepName = true, SplitCamelCase = true, KeepVerb = true)]
public class RecipesInfoService : IRecipesInfoService, ITransient, IDynamicApiController
{
private readonly ISqlSugarClient _dbContext;
public RecipesInfoService(ISqlSugarClient db)
{
_dbContext = db;
}
/// <summary>
/// 增加
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public async Task<bool> Add(RecipesInfoAddInput input)
{
var r_entity = await _dbContext.Queryable<RecipesInfoEntity>().FirstAsync(x => x.Name == input.Name);
if (r_entity != null)
{
throw Oops.Bah("名称已存在!");
}
RecipesInfoEntity entity = input.Adapt<RecipesInfoEntity>();
return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync();
}
/// <summary>
/// 删除
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpPost]
public async Task<bool> Del(RecipesInfoDelInput input)
{
var res = await _dbContext.Deleteable<RecipesInfoEntity>().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync();
return res;
}
/// <summary>
/// 详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpGet]
public async Task<RecipesInfoOutput> Detail(string Id)
{
var entity = await _dbContext.Queryable<RecipesInfoEntity>().FirstAsync(x => x.Id == Id);
RecipesInfoOutput output = entity.Adapt<RecipesInfoOutput>();
return output;
}
/// <summary>
/// 列表
/// </summary>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpGet]
public async Task<List<RecipesInfoOutput>> List()
{
var entity = await _dbContext.Queryable<RecipesInfoEntity>().ToListAsync();
List<RecipesInfoOutput> output = entity.Adapt<List<RecipesInfoOutput>>();
return output;
}
/// <summary>
/// 分页
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public async Task<SqlSugarPagedList<RecipesInfoOutput>> PagedList(RecipesInfoQueryPageInput input)
{
var entity = await _dbContext.Queryable<RecipesInfoEntity>()
.LeftJoin<RecipesGroupEntity>((a,b)=>a.Id==b.RecipesId)
.WhereIF(!string.IsNullOrEmpty(input.Name), (a, b) => a.Name.Contains(input.Name))
.WhereIF(!string.IsNullOrEmpty(input.GroupId), (a, b) => b.GroupId==input.GroupId)
.Select<RecipesInfoOutput>()
.ToPagedListAsync(input.PageIndex, input.PageSize);
SqlSugarPagedList<RecipesInfoOutput> output = entity.Adapt<SqlSugarPagedList<RecipesInfoOutput>>();
return output;
}
/// <summary>
/// 下拉
/// </summary>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpGet]
public async Task<dynamic> SelectList()
{
var entity = await _dbContext.Queryable<RecipesInfoEntity>().Select(x => new
{
key = x.Id,
value = x.Name
}).ToListAsync();
return entity;
}
/// <summary>
/// 更新
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpPost]
public async Task<bool> Update(RecipesInfoUpdateInput input)
{
var entity = await _dbContext.Queryable<RecipesInfoEntity>().Where(x => x.Id == input.Id).FirstAsync();
entity = input.Adapt<RecipesInfoEntity>();
var res = await _dbContext.Updateable(entity).ExecuteCommandHasChangeAsync();
return res;
}
[HttpPost]
public async Task<bool> ChangeGroup(RecipesGroupInput input)
{
var isExit = await _dbContext.Queryable<RecipesGroupEntity>().FirstAsync(x=>x.RecipesId==input.RecipesId);
var entity = input.Adapt<RecipesGroupEntity>();
if (isExit==null)
{
return await _dbContext.Insertable(entity).ExecuteCommandIdentityIntoEntityAsync();
}
else
{
return await _dbContext.Updateable(entity).Where(x => x.RecipesId == input.RecipesId).ExecuteCommandHasChangeAsync();
}
}
}
}

+ 94
- 0
backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AccountInput.cs Datei anzeigen

@@ -0,0 +1,94 @@
/// <summary>
/// 名 称 :[账号信息]实体基础
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/1/3 10:21:42
/// 描 述 :
/// </summary>
namespace BPA.MES.Base.Application
{
/// <summary>
/// [账号信息]入参基础
/// </summary>
public class AccountInput
{
/// <summary>
/// 账号
/// </summary>
/// <example>admin</example>
public string Account { get; set; }
/// <summary>
/// 密码
/// </summary>
/// <example>e10adc3949ba59abbe56e057f20f883e</example>
public string Pwd { get; set; }
}
/// <summary>
/// [账号信息]添加入参
/// </summary>
public class AccountAddInput : AccountInput
{
/// <summary>
/// 员工编号
/// </summary>
public string TB_Employee_Id { get; set; }
}
/// <summary>
/// [账号信息]修改入参
/// </summary>
public class AccountUpdateInput : AccountInput
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
/// <summary>
/// 员工编号
/// </summary>
public string TB_Employee_Id { get; set; }
}
/// <summary>
/// [账号信息]修改密码
/// </summary>
public class AccountUpdatePwdInput: AccountInput
{
/// <summary>
/// 新密码
/// </summary>
public string NewPwd { get; set; }
}
/// <summary>
/// [账号信息]删除入参
/// </summary>
public class AccountDelInput
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
/// <summary>
/// [账号信息]普通查询入参
/// </summary>
public class AccountQueryInput
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
/// <summary>
/// [账号信息]分页查询入参
/// </summary>
public class AccountQueryPageInput : RequestPage
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
/// <summary>
/// 设备名称
/// </summary>
public string Name { get; set; }
}
}

+ 29
- 0
backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AccountOutput.cs Datei anzeigen

@@ -0,0 +1,29 @@
namespace BPA.MES.Base.Application
{
/// <summary>
/// 名 称 :[账号信息]输出实体
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/1/3 10:22:37
/// 描 述 :
/// </summary>
public class AccountOutput
{
/// <summary>
/// 主键
/// </summary>
public string Id { get;set; }
/// <summary>
/// 账号
/// </summary>
public string Account { get; set; }
/// <summary>
/// 密码
/// </summary>
public string Pwd { get; set; }
/// <summary>
/// 员工id
/// </summary>
public string TB_Employee_Id { get; set; }

}
}

+ 134
- 0
backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AuthorModuleInput.cs Datei anzeigen

@@ -0,0 +1,134 @@
///<summary>
/// 名 称 :[授权模块]实体基础
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/1/3 10:21:42
/// 描 述
/// </summary>
namespace BPA.MES.Base.Application
{
/// <summary>
/// [授权模块]入参基础
/// </summary>
public class AuthorModuleInput
{
/// <summary>
/// 子级列表
/// </summary>
public List<AuthorModuleInput>? Childrens { get; set; }
/// <summary>
/// 拥有权限
/// </summary>
public bool HasPermission { get; set; }
/// <summary>
/// 模块编号
/// </summary>
public string Id { get; set; }

/// <summary>
/// 类别 1:菜单,2:视图,3:功能
/// </summary>
public int Category { get; set; }

/// <summary>
/// 菜单打开方式 0:框架内嵌,1:新开页面
/// </summary>
public int OpenType { get; set; }

/// <summary>
/// 父级编号
/// </summary>
public string ParentId { get; set; }

/// <summary>
/// 名称
/// </summary>
public string Name { set; get; }

/// <summary>
/// 图标
/// </summary>
public string Icon { set; get; }

/// <summary>
/// 地址
/// </summary>
public string Url { set; get; }
/// <summary>
/// 排序码
/// </summary>
public int Sort { set; get; }
/// <summary>
/// 启用禁用
/// </summary>
public bool IsDisabled { get; set; }

/// <summary>
/// 子集
/// </summary>
public List<ModuleTreeInput>? Children { get; set; }
}
/// <summary>
/// [授权模块]添加入参
/// </summary>
public class AuthorModuleAddInput : AuthorModuleInput
{

}

/// <summary>
/// [授权模块]批量授权信息
/// </summary>
public class AuthorModulesAddInput
{
/// <summary>
/// 模板名称
/// </summary>
public string TemplateName { set; get; }

/// <summary>
/// 授权模块
/// </summary>
public List<string> ModuleIds { get; set; }
}

/// <summary>
/// [授权模块]修改入参
/// </summary>
public class AuthorModuleUpdateInput : AuthorModuleInput
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
/// <summary>
/// [授权模块]删除入参
/// </summary>
public class AuthorModuleDelInput
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
/// <summary>
/// [授权模块]普通查询入参
/// </summary>
public class AuthorModuleQueryInput
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
/// <summary>
/// [授权模块]分页查询入参
/// </summary>
public class AuthorModuleQueryPageInput : RequestPage
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
}

+ 70
- 0
backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AuthorModuleItemInput.cs Datei anzeigen

@@ -0,0 +1,70 @@
///<summary>
/// 名 称 :[账号信息]实体基础
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/1/3 10:21:42
/// 描 述
/// </summary>
namespace BPA.MES.Base.Application
{
/// <summary>
/// [账号信息]入参基础
/// </summary>
public class AuthorModuleItemInput
{
/// <summary>
/// 模板Id
/// </summary>
public string TB_TemplateId { get; set; }
/// <summary>
/// 模块Id
/// </summary>
public List<string> TB_ModuleIds { get; set; }
}
/// <summary>
/// [账号信息]添加入参
/// </summary>
public class AuthorModuleItemAddInput : AuthorModuleItemInput
{

}
/// <summary>
/// [账号信息]修改入参
/// </summary>
public class AuthorModuleItemUpdateInput : AuthorModuleItemInput
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
/// <summary>
/// [账号信息]删除入参
/// </summary>
public class AuthorModuleItemDelInput
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
/// <summary>
/// [账号信息]普通查询入参
/// </summary>
public class AuthorModuleItemQueryInput
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
/// <summary>
/// [账号信息]分页查询入参
/// </summary>
public class AuthorModuleItemQueryPageInput : RequestPage
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
}

+ 12
- 0
backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AuthorModuleItemOutput.cs Datei anzeigen

@@ -0,0 +1,12 @@
namespace BPA.MES.Base.Application
{
/// <summary>
/// 名 称 :
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/1/4 17:20:51
/// 描 述 :
/// </summary>
public class AuthorModuleItemOutput
{
}
}

+ 68
- 0
backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AuthorModuleOutput.cs Datei anzeigen

@@ -0,0 +1,68 @@
namespace BPA.MES.Base.Application
{
/// <summary>
/// 名 称 :授权模块输出
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/1/4 17:18:24
/// 描 述 :
/// </summary>
public class AuthorModuleOutput
{
/// <summary>
/// 子级列表
/// </summary>
public List<AuthorModuleOutput>? Childrens { get; set; }
/// <summary>
/// 拥有权限
/// </summary>
public bool HasPermission { get; set; }
/// <summary>
/// 模块编号
/// </summary>
public string Id { get; set; }

/// <summary>
/// 类别 1:菜单,2:视图,3:功能
/// </summary>
public int Category { get; set; }

/// <summary>
/// 菜单打开方式 0:框架内嵌,1:新开页面
/// </summary>
public int OpenType { get; set; }

/// <summary>
/// 父级编号
/// </summary>
public string ParentId { get; set; }

/// <summary>
/// 名称
/// </summary>
public string Name { set; get; }

/// <summary>
/// 图标
/// </summary>
public string Icon { set; get; }

/// <summary>
/// 地址
/// </summary>
public string Url { set; get; }
/// <summary>
/// 排序码
/// </summary>
public int Sort { set; get; }
/// <summary>
/// 启用禁用
/// </summary>
public bool IsDisabled { get; set; }

/// <summary>
/// 子集
/// </summary>
public List<ModuleTreeInput>? Children { get; set; }
}
}

+ 97
- 0
backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AuthorizeInput.cs Datei anzeigen

@@ -0,0 +1,97 @@
///<summary>
/// 名 称 :[授权信息]实体基础
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/1/3 10:21:42
/// 描 述
/// </summary>
namespace BPA.MES.Base.Application
{
/// <summary>
/// [授权信息]入参基础
/// </summary>
public class AuthorizeInput
{
/// <summary>
/// 关键字
/// </summary>
public string Keyword { get; set; }
/// <summary>
/// 模板Id
/// </summary>
public string TemplateId { get; set; }
/// <summary>
/// 授权类型 1:用户,2:角色
/// </summary>
public int Type { get; set; }
/// <summary>
/// 授权对象
/// </summary>
public List<string>? ObjectIds { get; set; }
}
/// <summary>
/// [授权信息]添加入参
/// </summary>
public class AuthorizeAddInput : AuthorizeInput
{

}
/// <summary>
/// [授权信息]角色授权入参
/// </summary>
public class AuthorMapAddInput
{
/// <summary>
/// 模板编号
/// </summary>
public List<string> TemplateIds { get; set; }
/// <summary>
/// 授权类型 1用户 2角色
/// </summary>

public int AuthorizeType { get; set; }
/// <summary>
/// 授权对象
/// </summary>
public string ObjectId { get; set; }
}
/// <summary>
/// [授权信息]修改入参
/// </summary>
public class AuthorizeUpdateInput : AuthorizeInput
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
/// <summary>
/// [授权信息]删除入参
/// </summary>
public class AuthorizeDelInput
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
/// <summary>
/// [授权信息]普通查询入参
/// </summary>
public class AuthorizeQueryInput
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
/// <summary>
/// [授权信息]分页查询入参
/// </summary>
public class AuthorizeQueryPageInput : RequestPage
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
}

+ 27
- 0
backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AuthorizeOutput.cs Datei anzeigen

@@ -0,0 +1,27 @@
namespace BPA.MES.Base.Application
{
/// <summary>
/// 名 称 :授权信息输出
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/1/4 17:24:21
/// 描 述 :
/// </summary>
public class AuthorizeOutput
{
/// <summary>
/// 编号
/// </summary>
public string Id { get; set; }

/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }

/// <summary>
/// 已授权
/// </summary>
public bool IsAuthorized { get; set; }
}
}

+ 74
- 0
backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AuthorizeTemplateInput.cs Datei anzeigen

@@ -0,0 +1,74 @@
///<summary>
/// 名 称 :[授权模块]实体基础
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/1/3 10:21:42
/// 描 述
/// </summary>
namespace BPA.MES.Base.Application
{
/// <summary>
/// [授权模块]入参基础
/// </summary>
public class AuthorizeTemplateInput
{
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 描述
/// </summary>
public string Remark { get; set; }
}
/// <summary>
/// [授权模块]添加入参
/// </summary>
public class AuthorizeTemplateAddInput : AuthorizeTemplateInput
{

}
/// <summary>
/// [授权模块]修改入参
/// </summary>
public class AuthorizeTemplateUpdateInput : AuthorizeTemplateInput
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
/// <summary>
/// [授权模块]删除入参
/// </summary>
public class AuthorizeTemplateDelInput
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
/// <summary>
/// [授权模块]普通查询入参
/// </summary>
public class AuthorizeTemplateQueryInput
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
/// <summary>
/// [授权模块]分页查询入参
/// </summary>
public class AuthorizeTemplateQueryPageInput : RequestPage
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
/// <summary>
/// 关键字
/// </summary>
public string Keyword { get; set; }
}
}

+ 24
- 0
backend/BPA.MES.Base.Application/Services/SystemService/Dtos/AuthorizeTemplateOutput.cs Datei anzeigen

@@ -0,0 +1,24 @@
namespace BPA.MES.Base.Application
{
/// <summary>
/// 名 称 :授权模块输出
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/1/4 9:48:24
/// 描 述 :
/// </summary>
public class AuthorizeTemplateOutput
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 描述
/// </summary>
public string Remark { get; set; }
}
}

+ 141
- 0
backend/BPA.MES.Base.Application/Services/SystemService/Dtos/EmployeeInput.cs Datei anzeigen

@@ -0,0 +1,141 @@
namespace BPA.MES.Base.Application
{
/// <summary>
/// 名 称 :
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/1/5 15:15:50
/// 描 述 :
/// </summary>
public class EmployeeInput
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
/// <summary>
/// 排序
/// </summary>
public int Sort { get; set; }
/// <summary>
/// 员工姓名
/// </summary>

public string Name { get; set; }
/// <summary>
/// 1男2女
/// </summary>

public int Gender { get; set; }
/// <summary>
/// 手机号
/// </summary>

public string Phone { get; set; }
/// <summary>
/// 员工IC卡
/// </summary>

public string ICCard { get; set; }
/// <summary>
/// 头像
/// </summary>

public string Header { get; set; }
/// <summary>
/// 入职时间
/// </summary>

public DateTime JoinDate { get; set; }

/// <summary>
/// 离职时间
/// </summary>
public DateTime? OutDate { get; set; }
/// <summary>
/// 身份证
/// </summary>

public string IdCard { get; set; }
/// <summary>
/// 1在职2出差3离职
/// </summary>

public int Stutas { get; set; }
/// <summary>
/// 角色Id
/// </summary>
public string TB_RoleId { get; set; }
/// <summary>
/// 是否存在账号
/// </summary>
public bool IsAccount { get; set; }
/// <summary>
/// 账号
/// </summary>
public string Account { get; set; }
}

/// <summary>
/// [授权信息]添加入参
/// </summary>
public class EmployeeAddInput : EmployeeInput
{

}
/// <summary>
/// [授权信息]修改入参
/// </summary>
public class EmployeeUpdateInput : EmployeeInput
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
/// <summary>
/// [授权信息]删除入参
/// </summary>
public class EmployeeDelInput
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
/// <summary>
/// [授权信息]普通查询入参
/// </summary>
public class EmployeeQueryInput
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
/// <summary>
/// [授权信息]分页查询入参
/// </summary>
public class EmployeeQueryPageInput : RequestPage
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
/// <summary>
/// 关键字
/// </summary>
public string Keyword { get; set; }
/// <summary>
/// 状态
/// </summary>
public int Status { get; set; }
/// <summary>
/// 性别
/// </summary>
public int Gender { get; set; }
/// <summary>
/// 入职时间
/// </summary>
public DateTime? JoinDate { get; set; }
}
}

+ 69
- 0
backend/BPA.MES.Base.Application/Services/SystemService/Dtos/EmployeeOutput.cs Datei anzeigen

@@ -0,0 +1,69 @@
namespace BPA.MES.Base.Application
{
/// <summary>
/// 名 称 :[员工信息]
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/1/5 15:18:02
/// 描 述 :
/// </summary>
public class EmployeeOutput
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
/// <summary>
/// 排序
/// </summary>
public int Sort { get; set; }
/// <summary>
/// 员工姓名
/// </summary>
public string Name { get; set; }
/// <summary>
/// 1男2女
/// </summary>

public int Gender { get; set; }
/// <summary>
/// 手机号
/// </summary>
public string Phone { get; set; }
/// <summary>
/// 员工IC卡
/// </summary>
public string ICCard { get; set; }
/// <summary>
/// 头像
/// </summary>
public string Header { get; set; }
/// <summary>
/// 入职时间
/// </summary>
public DateTime JoinDate { get; set; }
/// <summary>
/// 离职时间
/// </summary>
public DateTime? OutDate { get; set; }
/// <summary>
/// 身份证
/// </summary>
public string IdCard { get; set; }
/// <summary>
/// 1在职2出差3离职
/// </summary>
public int Stutas { get; set; }
/// <summary>
/// 角色Id
/// </summary>
public string TB_RoleId { get; set; }
/// <summary>
/// 是否存在账号
/// </summary>
public bool IsAccount { get; set; }
/// <summary>
/// 账号
/// </summary>
public string Account { get; set; }
}
}

+ 8
- 0
backend/BPA.MES.Base.Application/Services/SystemService/Dtos/Mapper.cs Datei anzeigen

@@ -0,0 +1,8 @@
namespace BPA.MES.Base.Application;

public class Mapper : IRegister
{
public void Register(TypeAdapterConfig config)
{
}
}

+ 97
- 0
backend/BPA.MES.Base.Application/Services/SystemService/Dtos/ModuleInput.cs Datei anzeigen

@@ -0,0 +1,97 @@
///<summary>
/// 名 称 :[模块信息]实体基础
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/1/3 10:21:42
/// 描 述
/// </summary>
namespace BPA.MES.Base.Application
{
/// <summary>
/// [模块信息]入参基础
/// </summary>
public class ModuleInput
{
/// <summary>
/// 类别 1:菜单,2:视图,3:功能
/// </summary>
public int Category { get; set; }
/// <summary>
/// 菜单打开方式 0:框架内嵌,1:新开页面
/// </summary>
public int OpenType { get; set; }
/// <summary>
/// 父级编号
/// </summary>
public string ParentId { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { set; get; }
/// <summary>
/// 图标
/// </summary>
public string Icon { set; get; }
/// <summary>
/// 地址
/// </summary>
public string Url { set; get; }
/// <summary>
/// 排序码
/// </summary>
public int Sort { set; get; }
/// <summary>
/// 启用禁用
/// </summary>
public bool IsDisabled { get; set; }
}
/// <summary>
/// [模块信息]添加入参
/// </summary>
public class ModuleAddInput : ModuleInput
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
}
/// <summary>
/// [模块信息]修改入参
/// </summary>
public class ModuleUpdateInput : ModuleInput
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
/// <summary>
/// [模块信息]删除入参
/// </summary>
public class ModuleDelInput
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
/// <summary>
/// [模块信息]普通查询入参
/// </summary>
public class ModuleQueryInput
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
/// <summary>
/// [模块信息]分页查询入参
/// </summary>
public class ModuleQueryPageInput : RequestPage
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
}

+ 48
- 0
backend/BPA.MES.Base.Application/Services/SystemService/Dtos/ModuleOutput.cs Datei anzeigen

@@ -0,0 +1,48 @@
namespace BPA.MES.Base.Application
{
/// <summary>
/// 名 称 :
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/1/4 9:48:24
/// 描 述 :
/// </summary>
public class ModuleOutput
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
/// <summary>
/// 类别 1:菜单,2:视图,3:功能
/// </summary>
public int Category { get; set; }
/// <summary>
/// 菜单打开方式 0:框架内嵌,1:新开页面
/// </summary>
public int OpenType { get; set; }
/// <summary>
/// 父级编号
/// </summary>
public string ParentId { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { set; get; }
/// <summary>
/// 图标
/// </summary>
public string Icon { set; get; }
/// <summary>
/// 地址
/// </summary>
public string Url { set; get; }
/// <summary>
/// 排序码
/// </summary>
public int Sort { set; get; }
/// <summary>
/// 启用禁用
/// </summary>
public bool IsDisabled { get; set; }
}
}

+ 108
- 0
backend/BPA.MES.Base.Application/Services/SystemService/Dtos/ModuleTreeInput.cs Datei anzeigen

@@ -0,0 +1,108 @@
///<summary>
/// 名 称 :[菜单模块树]实体基础
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/1/3 10:21:42
/// 描 述
/// </summary>
namespace BPA.MES.Base.Application
{
/// <summary>
/// [菜单模块树]入参基础
/// </summary>
public class ModuleTreeInput
{
/// <summary>
/// 类别 1:菜单,2:视图,3:功能
/// </summary>
public int Category { get; set; }

/// <summary>
/// 菜单打开方式 0:框架内嵌,1:新开页面
/// </summary>
public int OpenType { get; set; }

/// <summary>
/// 父级编号
/// </summary>
public string ParentId { get; set; }

/// <summary>
/// 名称
/// </summary>
public string Name { set; get; }

/// <summary>
/// 图标
/// </summary>
public string Icon { set; get; }

/// <summary>
/// 地址
/// </summary>
public string Url { set; get; }
/// <summary>
/// 排序码
/// </summary>
public int Sort { set; get; }
/// <summary>
/// 启用禁用
/// </summary>
public bool IsDisabled { get; set; }

/// <summary>
/// 子集
/// </summary>
public List<ModuleTreeInput> Children { get; set; }
}
/// <summary>
/// [菜单模块树]添加入参
/// </summary>
public class ModuleTreeAddInput : ModuleTreeInput
{

}
/// <summary>
/// [菜单模块树]修改入参
/// </summary>
public class ModuleTreeUpdateInput : ModuleTreeInput
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
/// <summary>
/// [菜单模块树]删除入参
/// </summary>
public class ModuleTreeDelInput
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
/// <summary>
/// [菜单模块树]普通查询入参
/// </summary>
public class ModuleTreeQueryInput
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
}
/// <summary>
/// [菜单模块树]分页查询入参
/// </summary>
public class ModuleTreeQueryPageInput : RequestPage
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
}

+ 59
- 0
backend/BPA.MES.Base.Application/Services/SystemService/Dtos/ModuleTreeOutput.cs Datei anzeigen

@@ -0,0 +1,59 @@
namespace BPA.MES.Base.Application
{
/// <summary>
/// 名 称 :[菜单模块树]输出
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/1/4 16:14:43
/// 描 述 :
/// </summary>
public class ModuleTreeOutput
{
/// <summary>
/// 模块编号
/// </summary>
public string Id { get; set; }

/// <summary>
/// 类别 1:菜单,2:视图,3:功能
/// </summary>
public int Category { get; set; }

/// <summary>
/// 菜单打开方式 0:框架内嵌,1:新开页面
/// </summary>
public int OpenType { get; set; }

/// <summary>
/// 父级编号
/// </summary>
public string ParentId { get; set; }

/// <summary>
/// 名称
/// </summary>
public string Name { set; get; }

/// <summary>
/// 图标
/// </summary>
public string Icon { set; get; }

/// <summary>
/// 地址
/// </summary>
public string Url { set; get; }
/// <summary>
/// 排序码
/// </summary>
public int Sort { set; get; }
/// <summary>
/// 启用禁用
/// </summary>
public bool IsDisabled { get; set; }

/// <summary>
/// 子集
/// </summary>
public List<ModuleTreeOutput> Children { get; set; }
}
}

+ 71
- 0
backend/BPA.MES.Base.Application/Services/SystemService/Dtos/RoleInput.cs Datei anzeigen

@@ -0,0 +1,71 @@
namespace BPA.MES.Base.Application
{
/// <summary>
/// 名 称 :[角色信息]
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/1/4 9:43:25
/// 描 述 :
/// </summary>
public class RoleInput
{
/// <summary>
/// 角色名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 角色描述
/// </summary>
public string Description { get; set; }
}
/// <summary>
/// [角色信息]添加入参
/// </summary>
public class RoleAddInput : RoleInput
{

}
/// <summary>
/// [角色信息]修改入参
/// </summary>
public class RoleUpdateInput : RoleInput
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
/// <summary>
/// [角色信息]删除入参
/// </summary>
public class RoleDelInput
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
/// <summary>
/// [角色信息]普通查询入参
/// </summary>
public class RoleQueryInput
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
}
/// <summary>
/// [角色信息]分页查询入参
/// </summary>
public class RoleQueryPageInput : RequestPage
{
/// <summary>
/// 主键
/// </summary>
public string? Id { get; set; }
/// <summary>
/// 关键字
/// </summary>
public string Keyword { get; set; }
}
}

+ 24
- 0
backend/BPA.MES.Base.Application/Services/SystemService/Dtos/RoleOutput.cs Datei anzeigen

@@ -0,0 +1,24 @@
namespace BPA.MES.Base.Application
{
/// <summary>
/// 名 称 :角色信息
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/1/4 9:43:42
/// 描 述 :
/// </summary>
public class RoleOutput
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
/// <summary>
/// 角色名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 角色描述
/// </summary>
public string Description { get; set; }
}
}

+ 62
- 0
backend/BPA.MES.Base.Application/Services/SystemService/Dtos/UserRoleCacheDto.cs Datei anzeigen

@@ -0,0 +1,62 @@





namespace BPA.MES.Base.Application
{
/// <summary>
/// 名 称 :个人角色信息
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/1/4 17:46:47
/// 描 述 :
/// </summary>
public class UserRoleCacheDto
{
public List<string> AuthorizationCodes { get; set; }
public List<UserMenu> Menus { get; set; }
}

/// <summary>
/// 个人菜单信息
/// </summary>
public class UserMenu : ITree<UserMenu>
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
/// <summary>
/// 菜单名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 菜单地址
/// </summary>
public string Url { get; set; }
/// <summary>
/// 菜单图标
/// </summary>
public string Icon { get; set; }
/// <summary>
/// 菜单子项
/// </summary>
public List<UserMenu> Children { get; set; }
/// <summary>
/// 父级Id
/// </summary>
public string ParentId { get; set; }
/// <summary>
/// 分页信息
/// </summary>
public string Sort { get; set; }
/// <summary>
/// 打开类型
/// </summary>
public int OpenType { get; set; }
/// <summary>
/// 类别
/// </summary>
public int Category { get; set; }
}
}

+ 645
- 0
backend/BPA.MES.Base.Application/Services/SystemService/Services/AuthorizeService.cs Datei anzeigen

@@ -0,0 +1,645 @@
namespace BPA.MES.Base.Application
{
/// <summary>
/// 名 称 :授权服务
/// 创 建 人 :yangxiao
/// 创建时间 :2023/3/2 16:11:04
/// 描 述 :授权服务数据维护
/// </summary>
[ApiDescriptionSettings(Name = "Authorize", KeepName = true, SplitCamelCase = true, KeepVerb = true)]
public class AuthorizeService : IAuthorizeService, ITransient, IDynamicApiController
{
private readonly IHttpContextAccessor _httpContextAccessor;
private readonly ISqlSugarClient db;
private readonly ISqlSugarClient _dbContext;
public AuthorizeService(ISqlSugarClient db, IHttpContextAccessor httpContextAccessor)
{
this.db = db;
_dbContext = db;
_httpContextAccessor = httpContextAccessor;
}
#region 当前用户
/// <summary>
/// 登录
/// </summary>
/// <param name="input"></param>
/// <returns></returns>

[AllowAnonymous]
public async Task<bool> Login(AccountInput input)
{
var Info = await db.Queryable<AccountEntity>().FirstAsync(t => t.Account == input.Account && t.Pwd == input.Pwd);
if (Info == null)
throw Oops.Bah("请输入正确的账号和密码");
var User = await db.Queryable<EmployeeEntity>().FirstAsync(t => t.Id == Info.EmployeeId);
if (User == null)
{
throw Oops.Bah("账号没有权限");
}
//return ResolveService<IJwtService>().CreateAccessToken(new UserIdentity
//{
// Id = User.Id,
// UserName = User.Name,
// IsAdmin = User.IsAdmin,
//});

// 生成Token令牌
//var accessToken = await _jwtBearerManager.CreateTokenAdmin(user);
var accessToken = JWTEncryption.Encrypt(new Dictionary<string, object>
{
{ClaimConst.CLAINM_USERID, User.Id},
{ClaimConst.CLAINM_NAME,User.Name},
{ClaimConst.CLAINM_ISAUTH,User.IsAdmin},
},20);
// 设置Swagger自动登录
_httpContextAccessor.HttpContext.SigninToSwagger(accessToken);
// 生成刷新Token令牌
var refreshToken =
JWTEncryption.GenerateRefreshToken(accessToken, 25);

_httpContextAccessor.HttpContext.Response.Headers["access-token"] = accessToken;
// 设置刷新Token令牌
_httpContextAccessor.HttpContext.Response.Headers["x-access-token"] = refreshToken;
return true;
}
/// <summary>
/// 获取个人信息
/// </summary>
/// <returns></returns>
public async Task<object> GetUserInfo()
{
string userId = App.User?.FindFirst(ClaimConst.CLAINM_USERID)?.Value;
var user = await db.Queryable<EmployeeEntity>().LeftJoin<RoleEntity>((t, x) => t.TB_RoleId == x.Id)
.Where((t, x) => t.Id == userId).Select((t, x) => new
{
RoleName = x.Name,
RoleType = x.RoleType,
Id = t.Id,
UserName = t.Name
}).FirstAsync();


var menus = (await GetJurisdictionItemsAsync())?.Menus;
return new
{
Menus = menus,
UserInfo = new
{
UserId = user?.Id,
user?.RoleName,
user?.UserName
}
};
}
[HttpGet]
public async Task<List<string>> MultipleModuleAuthorityAsync()
{
return (await GetJurisdictionItemsAsync())?.AuthorizationCodes;
}
/// <summary>
/// 获取用户权限
/// </summary>
/// <returns></returns>
[HttpGet]
async Task<UserRoleCacheDto> GetJurisdictionItemsAsync()
{

string userId = App.User?.FindFirst(ClaimConst.CLAINM_USERID)?.Value;
var result = new UserRoleCacheDto();

result.AuthorizationCodes = (await GetAuthorityModuleIdsAsync(userId)) ?? new List<string>();

if (result.AuthorizationCodes.HasVal())
{
var temp = await db.Queryable<ModuleEntity>().Where(t => t.Category == 1 || t.Category == 2 || t.Category == 3)
.Where(t => result.AuthorizationCodes.Contains(t.Id) && !t.IsDisabled).OrderBy(t => t.ParentId)
.ToListAsync();

result.Menus = temp.Adapt<List<UserMenu>>().BuildTree();
}

result.Menus = result.Menus ?? new List<UserMenu>();

return result;
}
/// <summary>
/// 获取权限模块编号
/// </summary>
/// <param name="userId"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpGet]
async Task<List<string>> GetAuthorityModuleIdsAsync(string userId)
{
List<string> moduleIds = null;

var user = await db.Queryable<EmployeeEntity>().Where(m => m.Id == userId).FirstAsync();

if (user == null)
{
return moduleIds;
}

//超管用户
if (user.IsAdmin)
{
moduleIds = await db.Queryable<ModuleEntity>()
.OrderBy(m => m.ParentId).OrderBy(m => m.Name)
.ToListAsync(m => m.Id);
}
else
{
moduleIds = await GetAuthorityModuleIdsAsync((category) =>
{
if (category == 1)
{
return user.Id;
}
if (category == 2)
{
return user.TB_RoleId;
}
else
{
throw new NotImplementedException("无效授权类别");
}
});
}

return moduleIds;
}
/// <summary>
/// 获取账户信息
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public async Task<SqlSugarPagedList<AccountOutput>> AccountPageList(AccountQueryPageInput input)
{
var entity = await _dbContext.Queryable<AccountEntity>()
.ToPagedListAsync(input.PageIndex,input.PageSize);
SqlSugarPagedList<AccountOutput> output = entity.Adapt<SqlSugarPagedList<AccountOutput>>();
return output;
}

/// <summary>
/// 添加账户
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public async Task<bool> AddAccount(AccountAddInput input)
{
var entity = input.Adapt<AccountEntity>();
return await _dbContext.Insertable(entity).ExecuteCommandIdentityIntoEntityAsync();
}
/// <summary>
/// 修改账户信息
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public async Task<bool> UpdateAccount(AccountUpdateInput input) {
var entity = input.Adapt<AccountEntity>();
return await _dbContext.Updateable(entity).ExecuteCommandHasChangeAsync();
}
/// <summary>
/// 删除账户
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public async Task<bool> DelAccount(AccountDelInput input) {
var entity = input.Adapt<AccountEntity>();
return await _dbContext.Deleteable(entity).Where(x=>x.Id==input.Id).ExecuteCommandHasChangeAsync();
}
/// <summary>
/// 获取授权模块编号
/// </summary>
/// <param name="getObjectId"></param>
/// <returns></returns>
[HttpGet]
async Task<List<string>> GetAuthorityModuleIdsAsync(Func<int, string> getObjectId)
{
for (int index = 1; index <= 2; index++)
{
var objectId = getObjectId(index);
var templateIds = await db.Queryable<AuthorizeTemplateMapEntity>().LeftJoin<AuthorizeTemplateEntity>((t, x) => t.TemplateId == x.Id)
.Where((t, x) => t.AuthorizeType == index && t.ObjectId == objectId).ToListAsync(t => t.TemplateId);

if (!templateIds.HasVal() || templateIds.Count == 0)
{
continue;
}
return await db.Queryable<AuthorizeTemplateItemEntity>().LeftJoin<ModuleEntity>((t, x) => t.TB_ModuleId == x.Id)
.Where((t, x) => templateIds.Contains(t.TB_TemplateId))
.GroupBy((t, x) => t.TB_ModuleId).ToListAsync(t => t.TB_ModuleId);
}
return null;
}
#endregion


#region 角色
[HttpPost]
public async Task<bool> AddRole(RoleAddInput input)
{
var check = await db.Queryable<RoleEntity>().FirstAsync(t => t.Name == input.Name);
if (check != null) throw Oops.Bah ("角色名称不能重复");
var model = input.Adapt<RoleEntity>();
model.RoleType = 2;
return await db.Insertable(model).ExecuteCommandAsync() > 0;
}
[HttpPost]
public async Task<bool> EditRole(RoleUpdateInput input)
{
if (!await db.Queryable<RoleEntity>().Where(it => it.Id == input.Id).AnyAsync())
throw Oops.Bah("角色不存在或已被删除");
if (await _dbContext.Queryable<RoleEntity>().Where(it => it.Id != input.Id && it.Name == input.Name).AnyAsync())
throw Oops.Bah("角色名称已经存在");
return await _dbContext.Updateable<RoleEntity>(input).Where(a => a.Id == input.Id).ExecuteCommandHasChangeAsync();
}
[HttpGet]
public async Task<bool> RemoveRole(string input)
{
return await db.Updateable<RoleEntity>().Where(t => t.Id == input).ExecuteCommandHasChangeAsync();
}
[HttpGet]
public async Task<RoleOutput> GetRole(string input)
{
var entity = await db.Queryable<RoleEntity>().FirstAsync(t => t.Id == input);
return entity.Adapt<RoleOutput>();
}
[HttpGet]
public async Task<List<RoleOutput>> GetRoleList()
{
var entity = await db.Queryable<RoleEntity>().Where(t => t.RoleType != 1).ToListAsync();
return entity.Adapt<List<RoleOutput>>();
}
[HttpPost]
public async Task<SqlSugarPagedList<RoleOutput>> QueryRole(RoleQueryPageInput input)
{
var eneity = await db.Queryable<RoleEntity>()
.WhereIF(!string.IsNullOrEmpty(input.Keyword), t => t.Name.Contains(input.Keyword))
.Select<RoleOutput>()
.ToPagedListAsync(input.PageIndex, input.PageSize);
return eneity;
}
#endregion

#region 模块
[HttpPost]
public async Task<bool> AddModule(ModuleAddInput input)
{
input.ParentId = input.ParentId ?? string.Empty;
input.Id = null;
return (await db.Insertable(input.Adapt<ModuleEntity>()).ExecuteCommandAsync()) > 0;
}
[HttpPost]

public async Task<bool> EditModule(ModuleUpdateInput input)
{
if (!await db.Queryable<ModuleEntity>().Where(it => it.Id == input.Id ).AnyAsync())
{
throw Oops.Bah("模块不存在或已被删除");
}
input.ParentId = input.ParentId ?? string.Empty;
return await db.Updateable<ModuleEntity>(input).Where(a => a.Id == input.Id).ExecuteCommandHasChangeAsync();
}
[HttpGet]

public async Task RemoveModule(string input)
{
var list = await db.Queryable<ModuleEntity>().Where(it => it.ParentId == input).ToListAsync();
if (list.HasVal())
{
foreach (var item in list)
{
await RemoveModule(item.Id);
}
}
await _dbContext.Updateable<ModuleEntity>().Where(it => it.Id == input).ExecuteCommandAsync();
}
[HttpPost]
public async Task<List<ModuleTreeOutput>> GetTreeGrid(ModuleTreeQueryInput input)
{
var list = new List<ModuleTreeOutput>();

var datas = await db.Queryable<ModuleEntity>()
.WhereIF(!string.IsNullOrEmpty(input.Name), t => t.Name.Contains(input.Name))
.OrderBy(it => it.ParentId)
.OrderBy(it => it.Name)
.ToListAsync();

var modules = datas.Adapt<List<ModuleTreeOutput>>();

if (modules.HasVal())
{
foreach (var item in modules.Where(it => it.Category == 1))
{
item.Children = modules.Where(it => it.ParentId == item.Id && it.Category == 2).OrderBy(it => it.Sort).ToList();
foreach (var view in item.Children)
{
view.Children = modules.Where(it => it.ParentId == view.Id && it.Category == 3).OrderBy(it => it.Sort).ToList();
}

list.Add(item);
}
}
return list;
}
#endregion

#region 授权模板
[HttpPost]
public async Task<bool> AddAuthorTemp(AuthorizeTemplateAddInput input)
{
if (await db.Queryable<AuthorizeTemplateEntity>().Where(it => it.Name == input.Name && it.IsDeleted == false).AnyAsync())
throw Oops.Bah("模板名称已经存在");
var data = await db.Insertable(input.Adapt<AuthorizeTemplateEntity>()).ExecuteCommandAsync();
return data > 0;
}
[HttpPost]
public async Task<bool> EditAuthorTemp(AuthorizeTemplateUpdateInput input)
{
if (!await db.Queryable<AuthorizeTemplateEntity>().Where(it => it.Id == input.Id && it.IsDeleted == false).AnyAsync())
throw Oops.Bah("模板不存在或已被删除");
if (await db.Queryable<AuthorizeTemplateEntity>().Where(it => it.Id != input.Id && it.Name == input.Name && it.IsDeleted == false).AnyAsync())
throw Oops.Bah("模板名称已经存在");
return await db.Updateable<AuthorizeTemplateEntity>(input).Where(a => a.Id == input.Id).ExecuteCommandHasChangeAsync();
}
[HttpGet]
public async Task<bool> RemoveAuthorTemp(string input)
{
var f1 = await db.Updateable<AuthorizeTemplateEntity>().SetColumns(t => t.IsDeleted == true).Where(t => t.Id == input).ExecuteCommandHasChangeAsync();
var f2 = await db.Updateable<AuthorizeTemplateItemEntity>().SetColumns(T => T.IsDeleted == true).Where(t => t.TB_TemplateId == input).ExecuteCommandHasChangeAsync();
return f1 && f2;
}
[HttpPost]
public async Task<SqlSugarPagedList<AuthorizeTemplateOutput>> QueryAuthorTemp(AuthorizeTemplateQueryPageInput input)
{
RefAsync<int> Total = 0;
var data = await db.Queryable<AuthorizeTemplateEntity>().Where(t => !t.IsDeleted)
.WhereIF(!string.IsNullOrEmpty(input.Keyword), t => t.Name.Contains(input.Keyword))
.OrderByDescending(t => t.CreateAt)
.Select<AuthorizeTemplateOutput>()
.ToPagedListAsync(input.PageIndex, input.PageSize);
return data;
}
public async Task<AuthorizeTemplateOutput> GetAuthorTemp(string input)
{
var data = await db.Queryable<AuthorizeTemplateEntity>().Where(it => it.Id == input && it.IsDeleted == false).FirstAsync();
return data.Adapt<AuthorizeTemplateOutput>();
}
#endregion

#region 授权模板详情
[HttpGet]
public async Task<List<AuthorModuleOutput>> GetModuleByTemplateId(string input)
{
List<AuthorModuleOutput> result = new List<AuthorModuleOutput>();
var modules = await db.Queryable<ModuleEntity>().ToListAsync();
var roots = modules.Adapt<List<AuthorModuleOutput>>();
db.ThenMapper(roots, item =>
{
item.HasPermission = db.Queryable<AuthorizeTemplateItemEntity>().Where(m => m.TB_TemplateId == input && m.TB_ModuleId == item.Id).Any();
});
if (roots.HasVal())
{
foreach (var item in roots.Where(it => it.Category == 1))
{
item.Childrens = roots.Where(it => it.ParentId == item.Id && it.Category == 2).OrderBy(it => it.Name).ToList();

foreach (var view in item.Childrens)
{
view.Childrens = roots.Where(it => it.ParentId == view.Id && it.Category == 3).OrderBy(it => it.Name).ToList();
}

result.Add(item);
}
}
return result;
}
[HttpPost]
public async Task<bool> EditTemplateItem(AuthorModuleItemUpdateInput input)
{
var temp = await db.Queryable<AuthorizeTemplateEntity>().FirstAsync(t => t.Id == input.TB_TemplateId && t.IsDeleted == false);
await db.Updateable<AuthorizeTemplateItemEntity>().SetColumns(T => T.IsDeleted == true)
.Where(t => t.TB_TemplateId == input.TB_TemplateId).ExecuteCommandHasChangeAsync();

var entity = input.TB_ModuleIds.Distinct().ToList().ConvertAll(t => new AuthorizeTemplateItemEntity
{
TB_ModuleId = t,
TB_TemplateId = input.TB_TemplateId
});
var res = await db.Insertable(entity).ExecuteCommandAsync();
return res > 0;
}
[HttpPost]
public async Task<List<AuthorizeOutput>> GetAuthorizeObjects(AuthorizeInput input)
{
List<AuthorizeOutput> result;
if (input.Type == 2)
{
var temp = await db.Queryable<RoleEntity>()
.Where(t => t.RoleType != 1)
.Where(t => t.IsDeleted == false)
.WhereIF(!string.IsNullOrWhiteSpace(input.Keyword), t => t.Name.Contains(input.Keyword))
.OrderBy(t => t.RoleType)
.OrderBy(t => t.Name)
.ToListAsync();

result = temp.Adapt<List<AuthorizeOutput>>();
db.ThenMapper(result, item =>
{
item.IsAuthorized = db.Queryable<AuthorizeTemplateMapEntity>()
.Where(m => m.TemplateId == input.TemplateId && m.AuthorizeType == input.Type && m.ObjectId == item.Id).Any();
});
}
else
{
var temp = await db.Queryable<EmployeeEntity>()
.Where(t => t.IsAdmin == false)
.Where(t => t.IsDeleted == false)
.WhereIF(!string.IsNullOrWhiteSpace(input.Keyword), t => t.Name.Contains(input.Keyword))
.OrderBy(t => t.Name)
.ToListAsync();
result = temp.Adapt<List<AuthorizeOutput>>();
db.ThenMapper(result, item =>
{
item.IsAuthorized = db.Queryable<AuthorizeTemplateMapEntity>().Where(t => t.IsDeleted == false)
.Where(m => m.TemplateId == input.TemplateId && m.AuthorizeType == input.Type && m.ObjectId == item.Id).Any();
});
}
if (result.HasVal())
{
result = result.OrderByDescending(m => m.IsAuthorized).ThenBy(m => m.Name).ToList();
}
return result;
}
[HttpPost]
public async Task<bool> RemoveAuthorize(AuthorizeInput input)
{
var objectIds = input.ObjectIds.Distinct().ToArray();
return await db.Updateable<AuthorizeTemplateMapEntity>().SetColumns(t => t.IsDeleted == true)
.Where(it => it.TemplateId == input.TemplateId && it.AuthorizeType == input.Type && objectIds.Contains(it.ObjectId))
.ExecuteCommandHasChangeAsync();
}
[HttpPost]
public async Task AddAuthorize(AuthorMapAddInput input)
{
foreach (var item in input.TemplateIds.Distinct())
{
if (!await _dbContext.Queryable<AuthorizeTemplateMapEntity>().AnyAsync(m => m.TemplateId == item && m.AuthorizeType == input.AuthorizeType && m.IsDeleted == false && m.ObjectId == input.ObjectId))
{
await _dbContext.Insertable(new AuthorizeTemplateMapEntity()
{
TemplateId = item,
ObjectId = input.ObjectId,
AuthorizeType = input.AuthorizeType
}).ExecuteCommandAsync();
}
}
}
[HttpPost]
public async Task<bool> SaveAuthorize(AuthorModulesAddInput input)
{
if (await db.Queryable<AuthorizeTemplateEntity>().Where(it => it.Name == input.TemplateName && it.IsDeleted == false).AnyAsync())
{
throw Oops.Bah("模板名称已经存在");
}
AuthorizeTemplateEntity Model = new AuthorizeTemplateEntity();
Model.Name = input.TemplateName;
List<AuthorizeTemplateItemEntity> templateItems = input.ModuleIds.ConvertAll(m => new AuthorizeTemplateItemEntity
{
TB_TemplateId = Model.Id,
TB_ModuleId = m
});
try
{
db.Ado.BeginTran();
var f1 = (await db.Insertable(Model).ExecuteCommandAsync()) > 0;
var f2 = (await _dbContext.Insertable(templateItems).ExecuteCommandAsync()) > 0;
db.Ado.CommitTran();
return f1 && f2;
}
catch (Exception)
{
db.Ado.RollbackTran();
return false;
}
}
[HttpGet]
public async Task<bool> RestoreAccountByUser(string input)
{
var Demo = "123456".ToMD5Encrypt();
return await db.Updateable<AccountEntity>().SetColumns(t => t.Pwd == Demo)
.Where(t => t.EmployeeId == input).ExecuteCommandHasChangeAsync();
}
[HttpPost]
public async Task<bool> AddAccountByUser(AccountAddInput input)
{
var temp = await db.Queryable<AccountEntity>().FirstAsync(t => t.EmployeeId == input.TB_Employee_Id);
if (temp != null)
{
//throw new BusinessException("该员工已绑定账户,请勿重复绑定");
temp.Account = input.Account;
return await db.Updateable(temp).ExecuteCommandAsync() > 0;
}
else
{
var model = input.Adapt<AccountEntity>();
//默认123456
model.Pwd = "123456".ToMD5Encrypt();
return await db.Insertable(model).ExecuteCommandAsync() > 0;
}
}
[HttpPost]
public async Task<bool> EditAccountPwd(AccountUpdatePwdInput input)
{
var model = db.Queryable<AccountEntity>().First(t => t.Account == input.Account && t.Pwd == input.Pwd);
if (model == null) throw Oops.Bah("原密码不正确");
model.Pwd = input.NewPwd;
return await db.Updateable(model).ExecuteCommandAsync() > 0;
}
[HttpGet]
public async Task<AccountOutput> GetAccountByUser(string input)
{
var data = await db.Queryable<AccountEntity>().FirstAsync(t => t.EmployeeId == input);
return data.Adapt<AccountOutput>();
}

[HttpPost]
public async Task<bool> AddEmployee(EmployeeAddInput input)
{
var model = input.Adapt<EmployeeEntity>();
model.IsAdmin = false;
var temp = await db.Queryable<EmployeeEntity>().FirstAsync(t => t.Name.Equals(input.Name) && t.Phone.Equals(input.Phone) && t.IsDeleted == false);
if (temp != null) throw Oops.Bah("该员工已经存在");
return await db.Insertable(model).ExecuteCommandAsync() > 0;
}
[HttpPost]
public async Task<bool> EditEmployee(EmployeeUpdateInput input)
{
var temp = await db.Queryable<EmployeeEntity>().FirstAsync(t => t.Id == input.Id);
temp.Header = input.Header;
temp.IdCard = input.IdCard;
temp.Gender = input.Gender;
temp.JoinDate = input.JoinDate;
temp.OutDate = input.OutDate;
temp.Name = input.Name;
temp.Phone = input.Phone;
temp.Stutas = input.Stutas;
return await db.Updateable(temp).ExecuteCommandHasChangeAsync();
}
[HttpPost]
public async Task<SqlSugarPagedList<EmployeeOutput>> QueryEmployee(EmployeeQueryPageInput input)
{
var entity = await db.Queryable<EmployeeEntity>()

.WhereIF(!string.IsNullOrEmpty(input.Keyword), t => t.Name.Contains(input.Keyword) || t.Phone.Contains(input.Keyword))
.WhereIF(input.Status > 0, t => t.Stutas == input.Status).WhereIF(input.Gender > 0, t => t.Gender == input.Gender)
.WhereIF(input.JoinDate.HasValue, t => t.JoinDate <= input.JoinDate.Value)
.Where(t => t.IsAdmin == false)
.Where(t => t.IsDeleted == false)
.Select(t => new EmployeeOutput()
{
Id = t.Id.SelectAll(),
IsAccount = SqlFunc.Subqueryable<AccountEntity>().Where(s => s.EmployeeId == t.Id).Any(),
Account = SqlFunc.Subqueryable<AccountEntity>().Where(s => s.EmployeeId == t.Id).Select(s => s.Account)
})
.ToPagedListAsync(input.PageIndex, input.PageSize);
return entity;
}
[HttpGet]
public async Task<bool> RemoveEmployee([FromQuery] string employeeId)
{
bool result = false;
var entity =await db.Queryable<AccountEntity>().FirstAsync(x=>x.EmployeeId== employeeId);
try
{
db.Ado.BeginTran();
await db.Deleteable<EmployeeEntity>().Where(t => t.Id == employeeId).ExecuteCommandAsync();
if (entity!=null)
{
entity.EmployeeId = string.Empty;
await db.Updateable(entity).ExecuteCommandAsync();
}
db.Ado.CommitTran();
result = true;
}
catch (Exception ex)
{
db.Ado.RollbackTran();
throw Oops.Bah("删除失败!");
}
return result;
}
[HttpGet]
public async Task<List<EmployeeOutput>> EmployeeList()
{
var data = await db.Queryable<EmployeeEntity>().Where(t => t.IsAdmin == false).ToListAsync();
return data.Adapt<List<EmployeeOutput>>();
}
#endregion
}
}

+ 63
- 0
backend/BPA.MES.Base.Application/Services/SystemService/Services/IAuthorizeService.cs Datei anzeigen

@@ -0,0 +1,63 @@
namespace BPA.MES.Base.Application;

public interface IAuthorizeService
{

#region 账户
Task<bool> RestoreAccountByUser(string input);
Task<bool> AddAccountByUser(AccountAddInput input);
Task<bool> EditAccountPwd(AccountUpdatePwdInput input);
Task<AccountOutput> GetAccountByUser(string input);
Task<SqlSugarPagedList<AccountOutput>> AccountPageList(AccountQueryPageInput input);
Task<bool> AddAccount(AccountAddInput input);
Task<bool> UpdateAccount(AccountUpdateInput input);
Task<bool> DelAccount(AccountDelInput input);
Task<bool> Login(AccountInput input);

#endregion

#region 员工
Task<bool> AddEmployee(EmployeeAddInput input);
Task<bool> EditEmployee(EmployeeUpdateInput input);
Task<SqlSugarPagedList<EmployeeOutput>> QueryEmployee(EmployeeQueryPageInput input);
Task<bool> RemoveEmployee(string input);
Task<List<EmployeeOutput>> EmployeeList();
#endregion


Task<object> GetUserInfo();
Task<List<string>> MultipleModuleAuthorityAsync();

#region 角色
Task<bool> AddRole(RoleAddInput input);
Task<bool> EditRole(RoleUpdateInput input);
Task<bool> RemoveRole(string input);
Task<RoleOutput> GetRole(string input);
Task<List<RoleOutput>> GetRoleList();
Task<SqlSugarPagedList<RoleOutput>> QueryRole(RoleQueryPageInput input);
#endregion

#region 模块
Task<bool> AddModule(ModuleAddInput input);
Task<bool> EditModule(ModuleUpdateInput input);
Task RemoveModule(string input);
Task<List<ModuleTreeOutput>> GetTreeGrid(ModuleTreeQueryInput input);
#endregion

#region 授权模板
Task<bool> AddAuthorTemp(AuthorizeTemplateAddInput input);
Task<bool> EditAuthorTemp(AuthorizeTemplateUpdateInput input);
Task<bool> RemoveAuthorTemp(string input);
Task<SqlSugarPagedList<AuthorizeTemplateOutput>> QueryAuthorTemp(AuthorizeTemplateQueryPageInput input);
Task<AuthorizeTemplateOutput> GetAuthorTemp(string input);
#endregion

#region 授权模板详情
Task<List<AuthorModuleOutput>> GetModuleByTemplateId(string input);
Task<bool> EditTemplateItem(AuthorModuleItemUpdateInput input);
Task<List<AuthorizeOutput>> GetAuthorizeObjects(AuthorizeInput input);
Task<bool> RemoveAuthorize(AuthorizeInput input);
Task<bool> SaveAuthorize(AuthorModulesAddInput input);
Task AddAuthorize(AuthorMapAddInput input);
#endregion
}

+ 12
- 0
backend/BPA.MES.Base.Application/applicationsettings.json Datei anzeigen

@@ -0,0 +1,12 @@
{
"SpecificationDocumentSettings": {
"DocumentTitle": "MES数据接口"
},
"CorsAccessorSettings": {
"WithExposedHeaders": [
"access-token",
"x-access-token",
"environment"
]
}
}

+ 23
- 0
backend/BPA.MES.Base.Core/BPA.MES.Base.Core.csproj Datei anzeigen

@@ -0,0 +1,23 @@
<Project Sdk="Microsoft.NET.Sdk">


<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>BPA.MES.Base.Core.xml</DocumentationFile>
</PropertyGroup>


<ItemGroup>
<None Remove="BPA.MES.Base.Core.xml" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Furion.Extras.Authentication.JwtBearer" Version="4.8.6.6" />
<PackageReference Include="Furion.Extras.ObjectMapper.Mapster" Version="4.8.6.6" />
<PackageReference Include="Furion.Pure" Version="4.8.6.6" />
<PackageReference Include="SqlSugarCore" Version="5.1.3.50" />
<PackageReference Include="Yitter.IdGenerator" Version="1.0.14" />
</ItemGroup>

</Project>

+ 131
- 0
backend/BPA.MES.Base.Core/BPA.MES.Base.Core.xml Datei anzeigen

@@ -0,0 +1,131 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>BPA.MES.Base.Core</name>
</assembly>
<members>
<member name="T:BPA.MES.Base.Core.DEntityBase">
<summary>
名 称 :主键
创 建 人 :yangxiao
创建时间 :2023/3/2 13:59:33
描 述 :
</summary>
</member>
<member name="P:BPA.MES.Base.Core.DEntityBase.Id">
<summary>
主键
</summary>
</member>
<member name="T:BPA.MES.Base.Core.EmptyExtensions">
<summary>
名 称 :
创 建 人 :yangxiao
创建时间 : 2023/3/4 9:51:33
描 述 :
</summary>
</member>
<member name="T:BPA.MES.Base.Core.RequestPage">
<summary>
名 称 :分页基础类
创 建 人 :yangxiao
创建时间 : 2023/3/2 16:15:41
描 述 :
</summary>
</member>
<member name="P:BPA.MES.Base.Core.RequestPage.PageIndex">
<summary>
页码
</summary>
<example>1</example>
</member>
<member name="P:BPA.MES.Base.Core.RequestPage.PageSize">
<summary>
页大小
</summary>
<example>10</example>
</member>
<member name="T:BPA.MES.Base.Core.SqlSugarPagedList`1">
<summary>
名 称 :分页泛型集合
创 建 人 :yangxiao
创建时间 : 2023/3/2 16:21:27
描 述 :
</summary>
</member>
<member name="P:BPA.MES.Base.Core.SqlSugarPagedList`1.Page">
<summary>
页码
</summary>
</member>
<member name="P:BPA.MES.Base.Core.SqlSugarPagedList`1.PageSize">
<summary>
页容量
</summary>
</member>
<member name="P:BPA.MES.Base.Core.SqlSugarPagedList`1.Total">
<summary>
总条数
</summary>
</member>
<member name="P:BPA.MES.Base.Core.SqlSugarPagedList`1.TotalPages">
<summary>
总页数
</summary>
</member>
<member name="P:BPA.MES.Base.Core.SqlSugarPagedList`1.Items">
<summary>
当前页集合
</summary>
</member>
<member name="P:BPA.MES.Base.Core.SqlSugarPagedList`1.HasPrevPage">
<summary>
是否有上一页
</summary>
</member>
<member name="P:BPA.MES.Base.Core.SqlSugarPagedList`1.HasNextPage">
<summary>
是否有下一页
</summary>
</member>
<member name="T:BPA.MES.Base.Core.SqlSugarPagedExtensions">
<summary>
分页拓展类
</summary>
</member>
<member name="M:BPA.MES.Base.Core.SqlSugarPagedExtensions.ToPagedList``1(SqlSugar.ISugarQueryable{``0},System.Int32,System.Int32)">
<summary>
分页拓展
</summary>
<param name="entity"></param>
<param name="pageIndex"></param>
<param name="pageSize"></param>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Core.SqlSugarPagedExtensions.ToPagedListAsync``1(SqlSugar.ISugarQueryable{``0},System.Int32,System.Int32)">
<summary>
分页拓展
</summary>
<param name="entity"></param>
<param name="pageIndex"></param>
<param name="pageSize"></param>
<returns></returns>
</member>
<member name="T:BPA.MES.Base.Core.SqlsugarSetup">
<summary>
名 称 :数据库启动类
创 建 人 :yangxiao
创建时间 : 2023/3/23 14:09:30
描 述 :
</summary>
</member>
<member name="T:BPA.MES.Base.Core.TreeExtensions">
<summary>
名 称 :
创 建 人 :yangxiao
创建时间 : 2023/3/4 9:50:52
描 述 :
</summary>
</member>
</members>
</doc>

+ 27
- 0
backend/BPA.MES.Base.Core/DEntityBase.cs Datei anzeigen

@@ -0,0 +1,27 @@
using SqlSugar;
using System.ComponentModel;
using Yitter.IdGenerator;

namespace BPA.MES.Base.Core
{
/// <summary>
/// 名 称 :主键
/// 创 建 人 :yangxiao
/// 创建时间 :2023/3/2 13:59:33
/// 描 述 :
/// </summary>
public class DEntityBase
{
/// <summary>
/// 主键
/// </summary>
[Description("主键")]
[SugarColumn(IsPrimaryKey = true)]
public string Id { get; set; }
public DEntityBase()
{
var b = YitIdHelper.NextId();
Id = b.ToString();
}
}
}

+ 21
- 0
backend/BPA.MES.Base.Core/EmptyExtensions.cs Datei anzeigen

@@ -0,0 +1,21 @@
namespace BPA.MES.Base.Core
{
/// <summary>
/// 名 称 :
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/3/4 9:51:33
/// 描 述 :
/// </summary>
public static class EmptyExtensions
{
public static bool HasVal<T>(this T obj)
{
if (obj != null)
{
return !obj.Equals(default(T));
}

return false;
}
}
}

+ 22
- 0
backend/BPA.MES.Base.Core/RequestPage.cs Datei anzeigen

@@ -0,0 +1,22 @@
namespace BPA.MES.Base.Core
{
/// <summary>
/// 名 称 :分页基础类
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/3/2 16:15:41
/// 描 述 :
/// </summary>
public class RequestPage
{
/// <summary>
/// 页码
/// </summary>
/// <example>1</example>
public int PageIndex { get; set; }
/// <summary>
/// 页大小
/// </summary>
/// <example>10</example>
public int PageSize { get; set; }
}
}

+ 109
- 0
backend/BPA.MES.Base.Core/SqlSugarPagedList.cs Datei anzeigen

@@ -0,0 +1,109 @@
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace BPA.MES.Base.Core
{
/// <summary>
/// 名 称 :分页泛型集合
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/3/2 16:21:27
/// 描 述 :
/// </summary>
public class SqlSugarPagedList<TEntity>
where TEntity : new()
{
/// <summary>
/// 页码
/// </summary>
public int Page { get; set; }

/// <summary>
/// 页容量
/// </summary>
public int PageSize { get; set; }

/// <summary>
/// 总条数
/// </summary>
public int Total { get; set; }

/// <summary>
/// 总页数
/// </summary>
public int TotalPages { get; set; }

/// <summary>
/// 当前页集合
/// </summary>
public IEnumerable<TEntity> Items { get; set; }

/// <summary>
/// 是否有上一页
/// </summary>
public bool HasPrevPage { get; set; }

/// <summary>
/// 是否有下一页
/// </summary>
public bool HasNextPage { get; set; }
}

/// <summary>
/// 分页拓展类
/// </summary>
public static class SqlSugarPagedExtensions
{
/// <summary>
/// 分页拓展
/// </summary>
/// <param name="entity"></param>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <returns></returns>
public static SqlSugarPagedList<TEntity> ToPagedList<TEntity>(this ISugarQueryable<TEntity> entity, int pageIndex, int pageSize)
where TEntity : new()
{
var total = 0;
var items = entity.ToPageList(pageIndex, pageSize, ref total);
var totalPages = (int)Math.Ceiling(total / (double)pageSize);
return new SqlSugarPagedList<TEntity>
{
Page = pageIndex,
PageSize = pageSize,
Items = items,
Total = total,
TotalPages = totalPages,
HasNextPage = pageIndex < totalPages,
HasPrevPage = pageIndex - 1 > 0
};
}

/// <summary>
/// 分页拓展
/// </summary>
/// <param name="entity"></param>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <returns></returns>
public static async Task<SqlSugarPagedList<TEntity>> ToPagedListAsync<TEntity>(this ISugarQueryable<TEntity> entity, int pageIndex, int pageSize)
where TEntity : new()
{
RefAsync<int> total = 0;
var items = await entity.ToPageListAsync(pageIndex, pageSize, total);
var totalPages = (int)Math.Ceiling(total / (double)pageSize);
return new SqlSugarPagedList<TEntity>
{
Page = pageIndex,
PageSize = pageSize,
Items = items,
Total = total,
TotalPages = totalPages,
HasNextPage = pageIndex < totalPages,
HasPrevPage = pageIndex - 1 > 0
};
}

}
}

+ 41
- 0
backend/BPA.MES.Base.Core/SqlsugarSetup.cs Datei anzeigen

@@ -0,0 +1,41 @@
using Furion;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using SqlSugar;
using System;
using System.Collections.Generic;

namespace BPA.MES.Base.Core
{
/// <summary>
/// 名 称 :数据库启动类
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/3/23 14:09:30
/// 描 述 :
/// </summary>
public static class SqlsugarSetup
{
public static void AddSqlsugarSetup(this IServiceCollection services, IConfiguration configuration, string dbName = "ConnectionString")
{
//如果多个数数据库传 List<ConnectionConfig>
var dbs = App.GetConfig<List<ConnectionConfig>>("ConnectionConfigs")[0];
var configConnection = new ConnectionConfig()
{
DbType = dbs.DbType,
ConnectionString = dbs.ConnectionString,
IsAutoCloseConnection = dbs.IsAutoCloseConnection,
};
SqlSugarScope sqlSugar = new SqlSugarScope(configConnection,
db =>
{
//单例参数配置,所有上下文生效
db.Aop.OnLogExecuting = (sql, pars) =>
{
Console.WriteLine(sql);//输出sql
};
});

services.AddSingleton<ISqlSugarClient>(sqlSugar);//这边是SqlSugarScope用AddSingleton
}
}
}

+ 65
- 0
backend/BPA.MES.Base.Core/TreeExtensions.cs Datei anzeigen

@@ -0,0 +1,65 @@
using System;
using System.Collections.Generic;
using System.Linq;

namespace BPA.MES.Base.Core
{
/// <summary>
/// 名 称 :
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/3/4 9:50:52
/// 描 述 :
/// </summary>
public static class TreeExtensions
{
public static List<T> BuildTree<T>(this List<T> list, string rootId = "") where T : class, ITree<T>
{
string rootId2 = rootId;
List<T> list2 = list;
List<T> resul = null;
if (list2.HasVal())
{
List<T> list3 = list2.Where((T e) => e.ParentId == rootId2).ToList();
if (list3.HasVal())
{
resul = new List<T>();
list3.ForEach(delegate (T it)
{
it.Children = list2.BuildTree(it.Id);
resul.Add(it);
});
}
}

return resul;
}
public interface ITree<T> where T : class
{
string Id { get; set; }

string ParentId { get; set; }

List<T> Children { get; set; }
}
public static List<T> DeleteTreeNodes<T>(this List<T> list, Func<T, bool> condition) where T : class, ITree<T>
{
if (list.HasVal())
{
for (int i = 0; i < list.Count; i++)
{
T val = list[i];
if (condition(val))
{
list.Remove(val);
}
else if (val.Children.HasVal())
{
val.Children.DeleteTreeNodes(condition);
}
}
}

return list;
}
}
}

+ 19
- 0
backend/BPA.MES.Base.Web.Core/BPA.MES.Base.Web.Core.csproj Datei anzeigen

@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">


<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<NoWarn>1701;1702;1591</NoWarn>
<DocumentationFile>BPA.MES.Base.Web.Core.xml</DocumentationFile>
</PropertyGroup>


<ItemGroup>
<None Remove="BPA.MES.Base.Web.Core.xml" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\BPA.MES.Base.Application\BPA.MES.Base.Application.csproj" />
</ItemGroup>

</Project>

+ 8
- 0
backend/BPA.MES.Base.Web.Core/BPA.MES.Base.Web.Core.xml Datei anzeigen

@@ -0,0 +1,8 @@
<?xml version="1.0"?>
<doc>
<assembly>
<name>BPA.MES.Base.Web.Core</name>
</assembly>
<members>
</members>
</doc>

+ 16
- 0
backend/BPA.MES.Base.Web.Core/Handlers/JwtHandler.cs Datei anzeigen

@@ -0,0 +1,16 @@
using Furion.Authorization;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using System.Threading.Tasks;

namespace BPA.MES.Base.Web.Core;

public class JwtHandler : AppAuthorizeHandler
{
public override Task<bool> PipelineAsync(AuthorizationHandlerContext context, DefaultHttpContext httpContext)
{
// 这里写您的授权判断逻辑,授权通过返回 true,否则返回 false

return Task.FromResult(true);
}
}

+ 52
- 0
backend/BPA.MES.Base.Web.Core/Startup.cs Datei anzeigen

@@ -0,0 +1,52 @@
using BPA.MES.Base.Core;
using Furion;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Yitter.IdGenerator;

namespace BPA.MES.Base.Web.Core;

public class Startup : AppStartup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddConsoleFormatter();
services.AddJwt<JwtHandler>();

services.AddCorsAccessor();
services.AddSqlsugarSetup(App.Configuration);
// 配置雪花Id算法机器码
YitIdHelper.SetIdGenerator(new IdGeneratorOptions
{
WorkerId = 5
});
services.AddControllers()
.AddInjectWithUnifyResult();
}

public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}

app.UseHttpsRedirection();

app.UseRouting();

app.UseCorsAccessor();

app.UseAuthentication();
app.UseAuthorization();

app.UseInject(string.Empty);

app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
});
}
}

+ 21
- 0
backend/BPA.MES.Base.Web.Entry/BPA.MES.Base.Web.Entry.csproj Datei anzeigen

@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk.Web">


<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<SatelliteResourceLanguages>en-US</SatelliteResourceLanguages>
<PublishReadyToRunComposite>true</PublishReadyToRunComposite>
</PropertyGroup>


<ItemGroup>
<ProjectReference Include="..\BPA.MES.Base.Web.Core\BPA.MES.Base.Web.Core.csproj" />
</ItemGroup>
<ProjectExtensions>
<VisualStudio>
<UserProperties properties_4launchsettings_1json__JsonSchema="" />
</VisualStudio>
</ProjectExtensions>

</Project>

+ 9
- 0
backend/BPA.MES.Base.Web.Entry/BPA.MES.Base.Web.Entry.csproj.user Datei anzeigen

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DebuggerFlavor>ProjectDebugger</DebuggerFlavor>
</PropertyGroup>
<PropertyGroup>
<ActiveDebugProfile>BPA.MES.Base.Web.Entry</ActiveDebugProfile>
</PropertyGroup>
</Project>

+ 1
- 0
backend/BPA.MES.Base.Web.Entry/Program.cs Datei anzeigen

@@ -0,0 +1 @@
Serve.Run(RunOptions.Default.WithArgs(args));

+ 31
- 0
backend/BPA.MES.Base.Web.Entry/Properties/launchSettings.json Datei anzeigen

@@ -0,0 +1,31 @@
{
"$schema": "http://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:53785",
"sslPort": 44342
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true,
"launchUrl": "",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"BPA.MES.Base.Web.Entry": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "",
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

+ 22
- 0
backend/BPA.MES.Base.Web.Entry/SingleFilePublish.cs Datei anzeigen

@@ -0,0 +1,22 @@
using Furion;
using System.Reflection;

namespace BPA.MES.Base.Web.Entry;

public class SingleFilePublish : ISingleFilePublish
{
public Assembly[] IncludeAssemblies()
{
return Array.Empty<Assembly>();
}

public string[] IncludeAssemblyNames()
{
return new[]
{
"BPA.MES.Base.Application",
"BPA.MES.Base.Core",
"BPA.MES.Base.Web.Core"
};
}
}

+ 10
- 0
backend/BPA.MES.Base.Web.Entry/appsettings.Development.json Datei anzeigen

@@ -0,0 +1,10 @@
{
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning",
"Microsoft.EntityFrameworkCore": "Information"
}
}
}

+ 18
- 0
backend/BPA.MES.Base.Web.Entry/appsettings.json Datei anzeigen

@@ -0,0 +1,18 @@
{
"$schema": "https://gitee.com/dotnetchina/Furion/raw/v4/schemas/v4/furion-schema.json",
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning",
"Microsoft.EntityFrameworkCore": "Information"
}
},
"AllowedHosts": "*",
"ConnectionConfigs": [
{
"ConnectionString": "server=10.2.1.254;Port=3306;Database=bpa_mes_base;Uid=root;Pwd=BapAdmin123456.;",
"DbType": "MySql",
"IsAutoCloseConnection": true
}
]
}

+ 43
- 0
backend/BPA.MES.Base.sln Datei anzeigen

@@ -0,0 +1,43 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.3.32519.111
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPA.MES.Base.Application", "BPA.MES.Base.Application\BPA.MES.Base.Application.csproj", "{AB699EE9-43A8-46F2-A855-04A26DE63372}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPA.MES.Base.Web.Core", "BPA.MES.Base.Web.Core\BPA.MES.Base.Web.Core.csproj", "{9D14BB78-DA2A-4040-B9DB-5A515B599181}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPA.MES.Base.Core", "BPA.MES.Base.Core\BPA.MES.Base.Core.csproj", "{4FB30091-15C7-4FD9-AB7D-266814F360F5}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BPA.MES.Base.Web.Entry", "BPA.MES.Base.Web.Entry\BPA.MES.Base.Web.Entry.csproj", "{C8D99F52-EDC7-411F-8300-6DB14BF59E8C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{AB699EE9-43A8-46F2-A855-04A26DE63372}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AB699EE9-43A8-46F2-A855-04A26DE63372}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AB699EE9-43A8-46F2-A855-04A26DE63372}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AB699EE9-43A8-46F2-A855-04A26DE63372}.Release|Any CPU.Build.0 = Release|Any CPU
{9D14BB78-DA2A-4040-B9DB-5A515B599181}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9D14BB78-DA2A-4040-B9DB-5A515B599181}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9D14BB78-DA2A-4040-B9DB-5A515B599181}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9D14BB78-DA2A-4040-B9DB-5A515B599181}.Release|Any CPU.Build.0 = Release|Any CPU
{4FB30091-15C7-4FD9-AB7D-266814F360F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4FB30091-15C7-4FD9-AB7D-266814F360F5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4FB30091-15C7-4FD9-AB7D-266814F360F5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4FB30091-15C7-4FD9-AB7D-266814F360F5}.Release|Any CPU.Build.0 = Release|Any CPU
{C8D99F52-EDC7-411F-8300-6DB14BF59E8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C8D99F52-EDC7-411F-8300-6DB14BF59E8C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C8D99F52-EDC7-411F-8300-6DB14BF59E8C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C8D99F52-EDC7-411F-8300-6DB14BF59E8C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {B2073C2C-0FD3-452B-8047-8134D68E12CE}
EndGlobalSection
EndGlobal

+ 16
- 0
frontend/.editorconfig Datei anzeigen

@@ -0,0 +1,16 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab

+ 8
- 0
frontend/.eslintignore Datei anzeigen

@@ -0,0 +1,8 @@
/lambda/
/scripts
/config
.history
public
dist
.umi
mock

+ 7
- 0
frontend/.eslintrc.js Datei anzeigen

@@ -0,0 +1,7 @@
module.exports = {
extends: [require.resolve('@umijs/lint/dist/config/eslint')],
globals: {
page: true,
REACT_APP_ENV: true,
},
};

+ 41
- 0
frontend/.gitignore Datei anzeigen

@@ -0,0 +1,41 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
**/node_modules
# roadhog-api-doc ignore
/src/utils/request-temp.js
_roadhog-api-doc

# production
/dist

# misc
.DS_Store
npm-debug.log*
yarn-error.log

/coverage
.idea
yarn.lock
package-lock.json
*bak
.vscode


# visual studio code
.history
*.log
functions/*
.temp/**

# umi
.umi
.umi-production
.umi-test

# screenshot
screenshot
.firebase
.eslintcache

build

+ 22
- 0
frontend/.prettierignore Datei anzeigen

@@ -0,0 +1,22 @@
**/*.svg
.umi
.umi-production
/dist
.dockerignore
.DS_Store
.eslintignore
*.png
*.toml
docker
.editorconfig
Dockerfile*
.gitignore
.prettierignore
LICENSE
.eslintcache
*.lock
yarn-error.log
.history
CNAME
/build
/public

+ 21
- 0
frontend/.prettierrc.js Datei anzeigen

@@ -0,0 +1,21 @@
module.exports = {
singleQuote: true,
trailingComma: 'all',
printWidth: 100,
proseWrap: 'never',
endOfLine: 'lf',
overrides: [
{
files: '.prettierrc',
options: {
parser: 'json',
},
},
{
files: 'document.ejs',
options: {
parser: 'html',
},
},
],
};

+ 57
- 0
frontend/README.md Datei anzeigen

@@ -0,0 +1,57 @@
# Ant Design Pro

This project is initialized with [Ant Design Pro](https://pro.ant.design). Follow is the quick guide for how to use.

## Environment Prepare

Install `node_modules`:

```bash
npm install
```

or

```bash
yarn
```

## Provided Scripts

Ant Design Pro provides some useful script to help you quick start and build with web project, code style check and test.

Scripts provided in `package.json`. It's safe to modify or add additional script:

### Start project

```bash
npm start
```

### Build project

```bash
npm run build
```

### Check code style

```bash
npm run lint
```

You can also use script to auto fix some lint error:

```bash
npm run lint:fix
```

### Test code

```bash
npm test
```

## More

You can view full document on our [official website](https://pro.ant.design). And welcome any feedback in our [github](https://github.com/ant-design/ant-design-pro).

+ 126
- 0
frontend/config/config.ts Datei anzeigen

@@ -0,0 +1,126 @@
// https://umijs.org/config/
import { defineConfig } from '@umijs/max';
import { join } from 'path';
import defaultSettings from './defaultSettings';
import proxy from './proxy';
import routes from './routes';

const { REACT_APP_ENV = 'dev' } = process.env;

export default defineConfig({
/**
* @name 开启 hash 模式
* @description 让 build 之后的产物包含 hash 后缀。通常用于增量发布和避免浏览器加载缓存。
* @doc https://umijs.org/docs/api/config#hash
*/
history:{type:'hash'},
hash: true,

/**
* @name 兼容性设置
* @description 设置 ie11 不一定完美兼容,需要检查自己使用的所有依赖
* @doc https://umijs.org/docs/api/config#targets
*/
// targets: {
// ie: 11,
// },
/**
* @name 路由的配置,不在路由中引入的文件不会编译
* @description 只支持 path,component,routes,redirect,wrappers,title 的配置
* @doc https://umijs.org/docs/guides/routes
*/
// umi routes: https://umijs.org/docs/routing
routes,
/**
* @name 主题的配置
* @description 虽然叫主题,但是其实只是 less 的变量设置
* @doc antd的主题设置 https://ant.design/docs/react/customize-theme-cn
* @doc umi 的theme 配置 https://umijs.org/docs/api/config#theme
*/
theme: {
// 如果不想要 configProvide 动态设置主题需要把这个设置为 default
// 只有设置为 variable, 才能使用 configProvide 动态设置主色调
'root-entry-name': 'variable',
},
/**
* @name moment 的国际化配置
* @description 如果对国际化没有要求,打开之后能减少js的包大小
* @doc https://umijs.org/docs/api/config#ignoremomentlocale
*/
ignoreMomentLocale: false,
/**
* @name 代理配置
* @description 可以让你的本地服务器代理到你的服务器上,这样你就可以访问服务器的数据了
* @see 要注意以下 代理只能在本地开发时使用,build 之后就无法使用了。
* @doc 代理介绍 https://umijs.org/docs/guides/proxy
* @doc 代理配置 https://umijs.org/docs/api/config#proxy
*/
proxy: proxy[REACT_APP_ENV as keyof typeof proxy],
/**
* @name 快速热更新配置
* @description 一个不错的热更新组件,更新时可以保留 state
*/
fastRefresh: true,
//============== 以下都是max的插件配置 ===============
/**
* @name 数据流插件
* @@doc https://umijs.org/docs/max/data-flow
*/
model: {},
/**
* 一个全局的初始数据流,可以用它在插件之间共享数据
* @description 可以用来存放一些全局的数据,比如用户信息,或者一些全局的状态,全局初始状态在整个 Umi 项目的最开始创建。
* @doc https://umijs.org/docs/max/data-flow#%E5%85%A8%E5%B1%80%E5%88%9D%E5%A7%8B%E7%8A%B6%E6%80%81
*/
initialState: {},
/**
* @name layout 插件
* @doc https://umijs.org/docs/max/layout-menu
*/
layout: {
locale: false,
...defaultSettings,
},
/**
* @name 国际化插件
* @doc https://umijs.org/docs/max/i18n
*/
locale: {
},
/**
* @name antd 插件
* @description 内置了 babel import 插件
* @doc https://umijs.org/docs/max/antd#antd
*/
antd: {},
/**
* @name moment2dayjs 插件
* @description 将项目中的 moment 替换为 dayjs
* @doc https://umijs.org/docs/max/moment2dayjs
*/
moment2dayjs: {
preset: 'antd',
plugins: ['duration'],
},
/**
* @name 网络请求配置
* @description 它基于 axios 和 ahooks 的 useRequest 提供了一套统一的网络请求和错误处理方案。
* @doc https://umijs.org/docs/max/request
*/
request: {},
/**
* @name 权限插件
* @description 基于 initialState 的权限插件,必须先打开 initialState
* @doc https://umijs.org/docs/max/access
*/
access: {},
//================ pro 插件配置 =================
presets: ['umi-presets-pro'],
keepalive: [/./],
tabsLayout: {},
mfsu: {
strategy: 'normal',
},
requestRecord: {},
});

+ 28
- 0
frontend/config/defaultSettings.ts Datei anzeigen

@@ -0,0 +1,28 @@
import { Settings as LayoutSettings } from '@ant-design/pro-components';

/**
* @name
*/
const Settings: LayoutSettings & {
pwa?: boolean;
logo?: string;
title?:any
} = {
navTheme: 'light',
colorPrimary: '#13C2C2',
layout: 'mix',
contentWidth: 'Fluid',
fixedHeader: false,
fixSiderbar: true,
colorWeak: false,
title: "五芳斋中控管理系统",
menu: {
locale: false, // 禁用多语言功能
},
pwa: false,
splitMenus:false,
logo: './logo.png',
iconfontUrl: '',
};

export default Settings;

+ 16
- 0
frontend/config/proxy.ts Datei anzeigen

@@ -0,0 +1,16 @@
/**
* @name 代理的配置
* @see 在生产环境 代理是无法生效的,所以这里没有生产环境的配置
* @doc https://umijs.org/docs/guides/proxy
*/
export default {
dev: {
'/api/': {
target: 'http://localhost:5000',
pathRewrite: {
'/api': '/api'
},
changeOrigin: true,
}
}
};

+ 20
- 0
frontend/config/routes.ts Datei anzeigen

@@ -0,0 +1,20 @@
export default [
{ path: '/user', layout: false, routes: [{ path: '/user/login', component: './user/login' }] },
{ path: '/', icon: 'SmileOutlined', component: './welcome',name:'欢迎页' },
{ path:'/logs',icon: 'SettingOutlined',name:'日志管理',
routes: [{ path: '/logs/log',name:'日志管理', component: './logs/index' }]
},
{
icon: 'SettingOutlined',
path: '/system',
name:'系统管理',
routes: [
{ path: '/system/account',name:'账号管理', component: './system/account' },
{ path: '/system/user',name:'人员管理', component: './system/user' },
{ path: '/system/role',name:'角色管理', component: './system/role' },
{ path: '/system/module',name:'模块管理', component: './system/module' },
{ path: '/system/authTemplate',name:'权限管理', component: './system/authTemplate' },
],
},
{ path: '*', layout: false, component: './404' },
];

+ 23
- 0
frontend/jest.config.ts Datei anzeigen

@@ -0,0 +1,23 @@
import { configUmiAlias, createConfig } from '@umijs/max/test';

export default async () => {
const config = await configUmiAlias({
...createConfig({
target: 'browser',
}),
});

console.log();
return {
...config,
testEnvironmentOptions: {
...(config?.testEnvironmentOptions || {}),
url: 'http://localhost:8000',
},
setupFiles: [...(config.setupFiles || []), './tests/setupTests.jsx'],
globals: {
...config.globals,
localStorage: null,
},
};
};

+ 11
- 0
frontend/jsconfig.json Datei anzeigen

@@ -0,0 +1,11 @@
{
"compilerOptions": {
"jsx": "react-jsx",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"]
}
}
}

+ 103
- 0
frontend/package.json Datei anzeigen

@@ -0,0 +1,103 @@
{
"name": "ant-design-pro",
"version": "6.0.0",
"license": "ISC",
"private": true,
"description": "An out-of-box UI solution for enterprise applications",
"scripts": {
"analyze": "cross-env ANALYZE=1 max build",
"build": "max build",
"deploy": "npm run build && npm run gh-pages",
"dev": "npm run start:dev",
"gh-pages": "gh-pages -d dist",
"i18n-remove": "pro i18n-remove --write",
"postinstall": "max setup",
"jest": "jest",
"lint": "npm run lint:js && npm run lint:prettier && npm run tsc",
"lint-staged": "lint-staged",
"lint-staged:js": "eslint --ext .js,.jsx,.ts,.tsx ",
"lint:fix": "eslint --fix --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src ",
"lint:js": "eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src",
"lint:prettier": "prettier -c --write \"**/**.{js,jsx,tsx,ts,less,md,json}\" --end-of-line auto",
"openapi": "max openapi",
"prepare": "cd ../.. && husky install frontend/.husky",
"prettier": "prettier -c --write \"**/**.{js,jsx,tsx,ts,less,md,json}\"",
"preview": "npm run build && max preview --port 8000",
"record": "cross-env NODE_ENV=development REACT_APP_ENV=test max record --scene=login",
"serve": "umi-serve",
"start:mock": "cross-env UMI_ENV=dev max dev",
"start": "cross-env UMI_ENV=dev max dev",
"start:dev": "cross-env REACT_APP_ENV=dev MOCK=none UMI_ENV=dev max dev",
"start:no-mock": "cross-env MOCK=none UMI_ENV=dev max dev",
"start:pre": "cross-env REACT_APP_ENV=pre UMI_ENV=dev max dev",
"start:test": "cross-env REACT_APP_ENV=test MOCK=none UMI_ENV=dev max dev",
"test": "jest",
"test:coverage": "npm run jest -- --coverage",
"test:update": "npm run jest -- -u",
"tsc": "tsc --noEmit"
},
"lint-staged": {
"**/*.{js,jsx,ts,tsx}": "npm run lint-staged:js",
"**/*.{js,jsx,tsx,ts,less,md,json}": [
"prettier --write"
]
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 10"
],
"dependencies": {
"@ant-design/icons": "^4.8.0",
"@ant-design/pro-components": "^2.3.44",
"@ant-design/pro-layout": "^7.8.3",
"@ant-design/use-emotion-css": "1.0.4",
"@umijs/route-utils": "^2.2.2",
"antd": "^5.2.3",
"classnames": "^2.3.2",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-unicorn": "^46.0.0",
"js-md5": "^0.7.3",
"lodash": "^4.17.21",
"moment": "^2.29.4",
"omit.js": "^2.0.2",
"rc-menu": "^9.8.1",
"rc-util": "^5.25.2",
"react": "^18.2.0",
"react-dev-inspector": "^1.8.3",
"react-dom": "^18.2.0",
"react-helmet-async": "^1.3.0"
},
"devDependencies": {
"@ant-design/pro-cli": "^2.1.5",
"@testing-library/react": "^13.4.0",
"@types/classnames": "^2.3.1",
"@types/express": "^4.17.14",
"@types/history": "^4.7.11",
"@types/jest": "^29.2.4",
"@types/js-md5": "^0.7.0",
"@types/lodash": "^4.14.191",
"@types/react": "^17.0.52",
"@types/react-dom": "^17.0.18",
"@types/react-helmet": "^6.1.6",
"@umijs/lint": "^4.0.35",
"@umijs/max": "^4.0.55",
"cross-env": "^7.0.3",
"eslint": "^8.29.0",
"express": "^4.18.2",
"gh-pages": "^3.2.3",
"husky": "^7.0.4",
"jest": "^29.3.1",
"jest-environment-jsdom": "^29.3.1",
"lint-staged": "^10.5.4",
"mockjs": "^1.1.0",
"prettier": "^2.8.1",
"swagger-ui-dist": "^4.15.5",
"ts-node": "^10.9.1",
"typescript": "^4.9.4",
"umi-presets-pro": "^2.0.0"
},
"engines": {
"node": ">=12.0.0"
}
}

+ 22
- 0
frontend/playwright.config.ts Datei anzeigen

@@ -0,0 +1,22 @@
// playwright.config.ts
import type { PlaywrightTestConfig } from '@playwright/test';
import { devices } from '@playwright/test';

const config: PlaywrightTestConfig = {
forbidOnly: !!process.env.CI,
retries: process.env.CI ? 2 : 0,
use: {
trace: 'on-first-retry',
},
projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
{
name: 'firefox',
use: { ...devices['Desktop Firefox'] },
},
],
};
export default config;


+ 1
- 0
frontend/public/CNAME Datei anzeigen

@@ -0,0 +1 @@
preview.pro.ant.design



Einige Dateien werden nicht angezeigt, da zu viele Dateien in diesem Diff geändert wurden.

Laden…
Abbrechen
Speichern