Bladeren bron

产线料仓与工单业务

shengtang
747575620@qq.com 1 jaar geleden
bovenliggende
commit
ec90f0772b
28 gewijzigde bestanden met toevoegingen van 1765 en 43 verwijderingen
  1. +1
    -0
      backend/BPA.MES.Base.Application/BPA.MES.Base.Application.csproj
  2. +752
    -25
      backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml
  3. +21
    -0
      backend/BPA.MES.Base.Application/Entitys/App/Pztj_LineDevicesEntity.cs
  4. +21
    -0
      backend/BPA.MES.Base.Application/Entitys/App/Pztj_LineStocksEntity.cs
  5. +1
    -0
      backend/BPA.MES.Base.Application/Entitys/App/Pztj_WorkInfoEntity.cs
  6. +9
    -1
      backend/BPA.MES.Base.Application/Entitys/App/Pztj_WorkInfoItemEntity.cs
  7. +5
    -10
      backend/BPA.MES.Base.Application/Entitys/App/Pztj_WorkInfoStatusEntity.cs
  8. +31
    -0
      backend/BPA.MES.Base.Application/Entitys/Base/OperLogEntity.cs
  9. +47
    -0
      backend/BPA.MES.Base.Application/Filters/OperLogAttribute .cs
  10. +1
    -1
      backend/BPA.MES.Base.Application/Services/CraftsInfoService/Services/CraftsStepsService.cs
  11. +1
    -1
      backend/BPA.MES.Base.Application/Services/DeviceService/Services/DevicesInfoService.cs
  12. +37
    -0
      backend/BPA.MES.Base.Application/Services/OperLogService/Dtos/OperLogDto.cs
  13. +17
    -0
      backend/BPA.MES.Base.Application/Services/OperLogService/Services/IOperLogService.cs
  14. +12
    -0
      backend/BPA.MES.Base.Application/Services/OperLogService/Services/OperLogService.cs
  15. +76
    -0
      backend/BPA.MES.Base.Application/Services/ProductLineService/Dtos/ProductLineDeviceDto.cs
  16. +1
    -0
      backend/BPA.MES.Base.Application/Services/ProductLineService/Dtos/ProductLineDto.cs
  17. +69
    -0
      backend/BPA.MES.Base.Application/Services/ProductLineService/Dtos/ProductLineStockDto.cs
  18. +52
    -0
      backend/BPA.MES.Base.Application/Services/ProductLineService/Services/IProductLineService.cs
  19. +122
    -1
      backend/BPA.MES.Base.Application/Services/ProductLineService/Services/ProductLineService.cs
  20. +83
    -0
      backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkInfoDto.cs
  21. +71
    -0
      backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkInfoItemDto.cs
  22. +72
    -0
      backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkInfoStatusDto.cs
  23. +53
    -0
      backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/IWorkInfoService.cs
  24. +125
    -0
      backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkInfoService.cs
  25. +28
    -0
      backend/BPA.MES.Base.Application/Subscriber/ToDoEventSubscriber.cs
  26. +14
    -0
      backend/BPA.MES.Base.Web.Core/BPA.MES.Base.Web.Core.xml
  27. +34
    -1
      backend/BPA.MES.Base.Web.Core/Handlers/JwtHandler.cs
  28. +9
    -3
      backend/BPA.MES.Base.Web.Core/Startup.cs

+ 1
- 0
backend/BPA.MES.Base.Application/BPA.MES.Base.Application.csproj Bestand weergeven

@@ -30,6 +30,7 @@
<Folder Include="Services\RecipesService\" />
<Folder Include="Services\CustomCodeService\" />
<Folder Include="Services\SystemService\" />
<Folder Include="MQTT\" />
</ItemGroup>

</Project>

+ 752
- 25
backend/BPA.MES.Base.Application/BPA.MES.Base.Application.xml Bestand weergeven

@@ -250,6 +250,42 @@
添加时间
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Entitys.Pztj_LineDevicesEntity">
<summary>
名 称 :产线设备
创 建 人 :yangxiao
创建时间 : 2023/7/20 16:45:05
描 述 :
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.Pztj_LineDevicesEntity.LineId">
<summary>
产线Id
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.Pztj_LineDevicesEntity.DeviceId">
<summary>
产线设备
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Entitys.Pztj_LineStocksEntity">
<summary>
名 称 :产线料仓
创 建 人 :yangxiao
创建时间 :2023/7/20 16:45:40
描 述 :
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.Pztj_LineStocksEntity.LineId">
<summary>
产线Id
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.Pztj_LineStocksEntity.StockId">
<summary>
产线料仓
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Entitys.Pztj_MaterialsInfoEntity">
<summary>
名 称 :胖子天骄原料管理
@@ -347,25 +383,35 @@
描 述 :
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Entitys.App.Pztj_WorkStatusEntity">
<member name="P:BPA.MES.Base.Application.Entitys.Pztj_WorkInfoItemEntity.Name">
<summary>
名 称 :
工单名称
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.Pztj_WorkInfoItemEntity.Number">
<summary>
产量
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Entitys.Pztj_WorkInfoStatusEntity">
<summary>
名 称 :工单状态
创 建 人 :yangxiao
创建时间 : 2023/7/18 18:07:21
创建时间 :2023/7/18 18:07:21
描 述 :
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.App.Pztj_WorkStatusEntity.WorkId">
<member name="P:BPA.MES.Base.Application.Entitys.Pztj_WorkInfoStatusEntity.WorkId">
<summary>
工单Id
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.App.Pztj_WorkStatusEntity.Status">
<member name="P:BPA.MES.Base.Application.Entitys.Pztj_WorkInfoStatusEntity.Status">
<summary>
工单状态
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.App.Pztj_WorkStatusEntity.CreateTime">
<member name="P:BPA.MES.Base.Application.Entitys.Pztj_WorkInfoStatusEntity.CreateTime">
<summary>
创建时间
</summary>
@@ -452,6 +498,34 @@
每秒出水量(g)
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Entitys.OperLogEntity">
<summary>
名 称 :操作日志
创 建 人 :yangxiao
创建时间 :2023/7/20 15:10:59
描 述 :
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.OperLogEntity.Name">
<summary>
操作标题
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.OperLogEntity.Context">
<summary>
内容
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.OperLogEntity.Result">
<summary>
返回值
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Entitys.OperLogEntity.CreateTime">
<summary>
创建时间
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Entitys.Base.OrderInfoEntity">
<summary>
名 称 :订单服务
@@ -801,6 +875,22 @@
是否删除
</summary>
</member>
<member name="T:BPA.MES.Base.Application.OperLogAttribute">
<summary>
名 称 :接口AOP
创 建 人 :yangxiao
创建时间 : 2023/7/20 15:04:06
描 述 :
</summary>
</member>
<member name="M:BPA.MES.Base.Application.OperLogAttribute.OnActionExecutionAsync(Microsoft.AspNetCore.Mvc.Filters.ActionExecutingContext,Microsoft.AspNetCore.Mvc.Filters.ActionExecutionDelegate)">
<summary>
执行操作前后
</summary>
<param name="context"></param>
<param name="next"></param>
<returns></returns>
</member>
<member name="T:BPA.MES.Base.Application.Services.BaseService">
<summary>
名 称 :
@@ -2343,6 +2433,56 @@
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="T:BPA.MES.Base.Application.Services.OperLogDto">
<summary>
名 称 :
创 建 人 :yangxiao
创建时间 : 2023/7/20 15:15:48
描 述 :
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.OperLogDto.Name">
<summary>
操作标题
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.OperLogDto.Context">
<summary>
内容
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.OperLogDto.CreateTime">
<summary>
创建时间
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.OperLogAddInput">
<summary>
增加
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.IOperLogService">
<summary>
名 称 :日志服务
创 建 人 :yangxiao
创建时间 : 2023/7/20 15:17:58
描 述 :
</summary>
</member>
<member name="M:BPA.MES.Base.Application.Services.IOperLogService.Add(BPA.MES.Base.Application.Services.WorkInfoAddInput)">
<summary>
增加
</summary>
<returns></returns>
</member>
<member name="T:BPA.MES.Base.Application.Services.OperLogService">
<summary>
名 称 :操作日志
创 建 人 :yangxiao
创建时间 : 2023/7/20 15:17:24
描 述 :
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.GroupInfoDto">
<summary>
名 称 :产品分组
@@ -2407,6 +2547,81 @@
</summary>
<example></example>
</member>
<member name="T:BPA.MES.Base.Application.Services.ProductLineDeviceDto">
<summary>
名 称 :产线设备
创 建 人 :yangxiao
创建时间 : 2023/7/20 17:00:32
描 述 :
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProductLineDeviceDto.LineId">
<summary>
产线Id
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProductLineDeviceDto.DeviceId">
<summary>
产线设备
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.ProductLineDeviceQueryPageInput">
<summary>
产线设备分页
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProductLineDeviceQueryPageInput.Name">
<summary>
名称
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProductLineDeviceQueryPageInput.LineId">
<summary>
产线Id
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.ProductLineDeviceDelInput">
<summary>
删除产线设备
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProductLineDeviceDelInput.Id">
<summary>
主键
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.ProductLineDeviceOutput">
<summary>
产线设备关联信息
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProductLineDeviceOutput.Id">
<summary>
主键
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProductLineDeviceOutput.DeviceName">
<summary>
名称
</summary>
<example>设备名称</example>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProductLineDeviceOutput.DeviceCode">
<summary>
编码
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProductLineDeviceOutput.DeviceType">
<summary>
设备类型
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProductLineDeviceOutput.Describe">
<summary>
设备描述
</summary>
<example>设备描述</example>
</member>
<member name="T:BPA.MES.Base.Application.Services.ProductLineDto">
<summary>
名 称 :产线管理
@@ -2480,6 +2695,70 @@
主键
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.ProductLineStockDto">
<summary>
名 称 :
创 建 人 :yangxiao
创建时间 : 2023/7/20 18:25:18
描 述 :
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProductLineStockDto.LineId">
<summary>
产线Id
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProductLineStockDto.StockId">
<summary>
产线设备
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.ProductLineStockQueryPageInput">
<summary>
产线设备分页
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProductLineStockQueryPageInput.Name">
<summary>
名称
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProductLineStockQueryPageInput.LineId">
<summary>
产线Id
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.ProductLineStockDelInput">
<summary>
删除产线设备
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProductLineStockDelInput.Id">
<summary>
主键
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.ProductLineStockOutput">
<summary>
产线设备关联信息
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProductLineStockOutput.Id">
<summary>
主键
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProductLineStockOutput.StockName">
<summary>
名称
</summary>
<example>设备名称</example>
</member>
<member name="P:BPA.MES.Base.Application.Services.ProductLineStockOutput.StockCode">
<summary>
编码
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.GroupInfoService">
<summary>
名 称 :分组信息
@@ -2641,6 +2920,54 @@
<param name="Id"></param>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IProductLineService.AddDevice(BPA.MES.Base.Application.Services.ProductLineDeviceAddInput)">
<summary>
产线添加设备
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IProductLineService.DeleteDevice(BPA.MES.Base.Application.Services.ProductLineDeviceDelInput)">
<summary>
产线删除设备
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IProductLineService.DeviceList">
<summary>
产线设备不分页
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IProductLineService.DevicePageList(BPA.MES.Base.Application.Services.ProductLineDeviceQueryPageInput)">
<summary>
产线设备分页
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IProductLineService.AddStock(BPA.MES.Base.Application.Services.ProductLineStockAddInput)">
<summary>
产线添加料仓
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IProductLineService.DeleteStock(BPA.MES.Base.Application.Services.ProductLineStockDelInput)">
<summary>
产线删除料仓
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IProductLineService.StockList">
<summary>
产线料仓不分页
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IProductLineService.StockPageList(BPA.MES.Base.Application.Services.ProductLineStockQueryPageInput)">
<summary>
产线料仓分页
</summary>
<returns></returns>
</member>
<member name="T:BPA.MES.Base.Application.Services.ProductLineService">
<summary>
名 称 :产线服务
@@ -2701,47 +3028,95 @@
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="T:BPA.MES.Base.Application.Services.RecipeMaterialDto">
<member name="M:BPA.MES.Base.Application.Services.ProductLineService.AddDevice(BPA.MES.Base.Application.Services.ProductLineDeviceAddInput)">
<summary>
名 称 :配方物料Dto类
创 建 人 :yangxiao
创建时间 :2023/3/2 16:12:06
描 述 :
产线添加设备
</summary>
<returns></returns>
</member>
<member name="T:BPA.MES.Base.Application.Services.RecipeMaterialAddInput">
<member name="M:BPA.MES.Base.Application.Services.ProductLineService.DeleteDevice(BPA.MES.Base.Application.Services.ProductLineDeviceDelInput)">
<summary>
增加
产线删除设备
</summary>
<returns></returns>
</member>
<member name="P:BPA.MES.Base.Application.Services.RecipeMaterialAddInput.MaterialId">
<member name="M:BPA.MES.Base.Application.Services.ProductLineService.DeviceList">
<summary>
物料Id
产线设备不分页
</summary>
<returns></returns>
</member>
<member name="P:BPA.MES.Base.Application.Services.RecipeMaterialAddInput.RecipesId">
<member name="M:BPA.MES.Base.Application.Services.ProductLineService.DevicePageList(BPA.MES.Base.Application.Services.ProductLineDeviceQueryPageInput)">
<summary>
配方Id
产线设备分页
</summary>
<returns></returns>
</member>
<member name="P:BPA.MES.Base.Application.Services.RecipeMaterialAddInput.Outlet">
<member name="M:BPA.MES.Base.Application.Services.ProductLineService.AddStock(BPA.MES.Base.Application.Services.ProductLineStockAddInput)">
<summary>
通道
产线添加料仓
</summary>
<returns></returns>
</member>
<member name="P:BPA.MES.Base.Application.Services.RecipeMaterialAddInput.Sort">
<member name="M:BPA.MES.Base.Application.Services.ProductLineService.DeleteStock(BPA.MES.Base.Application.Services.ProductLineStockDelInput)">
<summary>
顺序
产线删除料仓
</summary>
<returns></returns>
</member>
<member name="P:BPA.MES.Base.Application.Services.RecipeMaterialAddInput.Time">
<member name="M:BPA.MES.Base.Application.Services.ProductLineService.StockList">
<summary>
时间(s)
产线料仓不分页
</summary>
<returns></returns>
</member>
<member name="T:BPA.MES.Base.Application.Services.RecipeMaterialUpdateInput">
<member name="M:BPA.MES.Base.Application.Services.ProductLineService.StockPageList(BPA.MES.Base.Application.Services.ProductLineStockQueryPageInput)">
<summary>
更新
产线料仓分页
</summary>
<returns></returns>
</member>
<member name="T:BPA.MES.Base.Application.Services.RecipeMaterialDto">
<summary>
名 称 :配方物料Dto类
创 建 人 :yangxiao
创建时间 :2023/3/2 16:12:06
描 述 :
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.RecipeMaterialAddInput">
<summary>
增加
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.RecipeMaterialAddInput.MaterialId">
<summary>
物料Id
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.RecipeMaterialAddInput.RecipesId">
<summary>
配方Id
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.RecipeMaterialAddInput.Outlet">
<summary>
通道
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.RecipeMaterialAddInput.Sort">
<summary>
顺序
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.RecipeMaterialAddInput.Time">
<summary>
时间(s)
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.RecipeMaterialUpdateInput">
<summary>
更新
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.RecipeMaterialDelInput">
@@ -3299,6 +3674,350 @@
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="T:BPA.MES.Base.Application.Services.WorkInfoDto">
<summary>
名 称 :
创 建 人 :yangxiao
创建时间 : 2023/7/20 14:29:09
描 述 :
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.WorkInfoDto.Name">
<summary>
工单名称
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.WorkInfoDto.LineId">
<summary>
产线Id
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.WorkInfoDto.FinalId">
<summary>
成品Id
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.WorkInfoDto.Number">
<summary>
产量
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.WorkInfoDto.CreatTime">
<summary>
创建时间
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.WorkInfoAddInput">
<summary>
增加
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.WorkInfoUpdateInput">
<summary>
更新
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.WorkInfoUpdateInput.Id">
<summary>
主键
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.WorkInfoDelInput">
<summary>
删除
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.WorkInfoDelInput.Id">
<summary>
主键
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.WorkInfoQueryPageInput">
<summary>
分页
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.WorkInfoQueryPageInput.Name">
<summary>
名称
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.WorkInfoQueryPageInput.Code">
<summary>
编码
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.WorkInfoOutput">
<summary>
输出
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.WorkInfoOutput.Id">
<summary>
主键
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.WorkInfoItemDto">
<summary>
名 称 :工单产量
创 建 人 :yangxiao
创建时间 : 2023/7/20 14:29:25
描 述 :
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.WorkInfoItemDto.Name">
<summary>
工单名称
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.WorkInfoItemDto.Number">
<summary>
产量
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.WorkInfoItemAddInput">
<summary>
增加
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.WorkInfoItemUpdateInput">
<summary>
更新
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.WorkInfoItemUpdateInput.Id">
<summary>
主键
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.WorkInfoItemDelInput">
<summary>
删除
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.WorkInfoItemDelInput.Id">
<summary>
主键
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.WorkInfoItemQueryPageInput">
<summary>
分页
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.WorkInfoItemQueryPageInput.Name">
<summary>
名称
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.WorkInfoItemQueryPageInput.Code">
<summary>
编码
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.WorkInfoItemOutput">
<summary>
输出
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.WorkInfoItemOutput.Id">
<summary>
主键
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.WorkInfoStatusDto">
<summary>
名 称 :工单状态
创 建 人 :yangxiao
创建时间 :2023/7/20 14:29:39
描 述 :
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.WorkInfoStatusDto.WorkId">
<summary>
工单Id
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.WorkInfoStatusDto.Status">
<summary>
工单状态
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.WorkInfoStatusDto.CreateTime">
<summary>
创建时间
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.WorkInfoStatusAddInput">
<summary>
增加
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.WorkInfoStatusUpdateInput">
<summary>
更新
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.WorkInfoStatusUpdateInput.Id">
<summary>
主键
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.WorkInfoStatusUpdateInput.WorkInfoId">
<summary>
工单Id
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.WorkInfoStatusDelInput">
<summary>
删除
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.WorkInfoStatusDelInput.Id">
<summary>
主键
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.WorkInfoStatusQueryPageInput">
<summary>
分页
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.WorkInfoStatusOutput">
<summary>
输出
</summary>
</member>
<member name="P:BPA.MES.Base.Application.Services.WorkInfoStatusOutput.Id">
<summary>
主键
</summary>
</member>
<member name="T:BPA.MES.Base.Application.Services.IWorkInfoService">
<summary>
名 称 :工单服务
创 建 人 :yangxiao
创建时间 : 2023/7/20 14:39:28
描 述 :
</summary>
</member>
<member name="M:BPA.MES.Base.Application.Services.IWorkInfoService.Add(BPA.MES.Base.Application.Services.WorkInfoAddInput)">
<summary>
增加
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IWorkInfoService.Del(BPA.MES.Base.Application.Services.WorkInfoDelInput)">
<summary>
移除
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IWorkInfoService.Update(BPA.MES.Base.Application.Services.WorkInfoUpdateInput)">
<summary>
更新
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IWorkInfoService.List">
<summary>
不分页列表
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IWorkInfoService.PagedList(BPA.MES.Base.Application.Services.WorkInfoQueryPageInput)">
<summary>
分页列表
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IWorkInfoService.SelectList">
<summary>
下拉列表
</summary>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IWorkInfoService.Detail(System.String)">
<summary>
查询单条
</summary>
<param name="Id"></param>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.IWorkInfoService.UpdateStatus(BPA.MES.Base.Application.Services.WorkInfoStatusUpdateInput)">
<summary>
更改状态
</summary>
<returns></returns>
</member>
<member name="T:BPA.MES.Base.Application.Services.WorkInfoService.Services.WorkInfoService">
<summary>
名 称 :工单服务
创 建 人 :yangxiao
创建时间 :2023/7/20 14:39:41
描 述 :
</summary>
</member>
<member name="M:BPA.MES.Base.Application.Services.WorkInfoService.Services.WorkInfoService.Add(BPA.MES.Base.Application.Services.WorkInfoAddInput)">
<summary>
增加
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.WorkInfoService.Services.WorkInfoService.Del(BPA.MES.Base.Application.Services.WorkInfoDelInput)">
<summary>
删除
</summary>
<param name="input"></param>
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="M:BPA.MES.Base.Application.Services.WorkInfoService.Services.WorkInfoService.Detail(System.String)">
<summary>
详情
</summary>
<param name="Id"></param>
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="M:BPA.MES.Base.Application.Services.WorkInfoService.Services.WorkInfoService.List">
<summary>
列表
</summary>
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="M:BPA.MES.Base.Application.Services.WorkInfoService.Services.WorkInfoService.PagedList(BPA.MES.Base.Application.Services.WorkInfoQueryPageInput)">
<summary>
分页
</summary>
<param name="input"></param>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Application.Services.WorkInfoService.Services.WorkInfoService.SelectList">
<summary>
下拉
</summary>
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="M:BPA.MES.Base.Application.Services.WorkInfoService.Services.WorkInfoService.Update(BPA.MES.Base.Application.Services.WorkInfoUpdateInput)">
<summary>
更新
</summary>
<param name="input"></param>
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="M:BPA.MES.Base.Application.Services.WorkInfoService.Services.WorkInfoService.UpdateStatus(BPA.MES.Base.Application.Services.WorkInfoStatusUpdateInput)">
<summary>
修改工单状态
</summary>
<param name="input"></param>
<returns></returns>
<exception cref="T:System.NotImplementedException"></exception>
</member>
<member name="T:BPA.MES.Base.Application.AccountInput">
<summary>
[账号信息]入参基础
@@ -4622,5 +5341,13 @@
<param name="getObjectId"></param>
<returns></returns>
</member>
<member name="T:BPA.MES.Base.Application.Subscriber.ToDoEventSubscriber">
<summary>
名 称 :
创 建 人 :yangxiao
创建时间 : 2023/7/20 15:09:49
描 述 :
</summary>
</member>
</members>
</doc>

+ 21
- 0
backend/BPA.MES.Base.Application/Entitys/App/Pztj_LineDevicesEntity.cs Bestand weergeven

@@ -0,0 +1,21 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :产线设备
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/7/20 16:45:05
/// 描 述 :
/// </summary>
[SugarTable("productline_devices")]
public class Pztj_LineDevicesEntity : DEntityBase
{
/// <summary>
/// 产线Id
/// </summary>
public string LineId { get; set; }
/// <summary>
/// 产线设备
/// </summary>
public string DeviceId { get; set; }
}
}

+ 21
- 0
backend/BPA.MES.Base.Application/Entitys/App/Pztj_LineStocksEntity.cs Bestand weergeven

@@ -0,0 +1,21 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :产线料仓
/// 创 建 人 :yangxiao
/// 创建时间 :2023/7/20 16:45:40
/// 描 述 :
/// </summary>
[SugarTable("productline_stocks")]
public class Pztj_LineStocksEntity : DEntityBase
{
/// <summary>
/// 产线Id
/// </summary>
public string LineId { get; set; }
/// <summary>
/// 产线料仓
/// </summary>
public string StockId { get; set; }
}
}

+ 1
- 0
backend/BPA.MES.Base.Application/Entitys/App/Pztj_WorkInfoEntity.cs Bestand weergeven

@@ -6,6 +6,7 @@
/// 创建时间 : 2023/7/18 17:54:43
/// 描 述 :
/// </summary>
[SugarTable("work_info")]
public class Pztj_WorkInfoEntity : DEntityBase
{
/// <summary>


+ 9
- 1
backend/BPA.MES.Base.Application/Entitys/App/Pztj_WorkInfoItemEntity.cs Bestand weergeven

@@ -6,8 +6,16 @@
/// 创建时间 : 2023/7/18 18:12:55
/// 描 述 :
/// </summary>
public class Pztj_WorkInfoItemEntity
[SugarTable("work_info_item")]
public class Pztj_WorkInfoItemEntity : DEntityBase
{
/// <summary>
/// 工单名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 产量
/// </summary>
public string Number { get; set; }
}
}

backend/BPA.MES.Base.Application/Entitys/App/Pztj_WorkStatusEntity.cs → backend/BPA.MES.Base.Application/Entitys/App/Pztj_WorkInfoStatusEntity.cs Bestand weergeven

@@ -1,18 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.MES.Base.Application.Entitys.App
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :
/// 名 称 :工单状态
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/7/18 18:07:21
/// 创建时间 :2023/7/18 18:07:21
/// 描 述 :
/// </summary>
public class Pztj_WorkStatusEntity
[SugarTable("work_info_status")]
public class Pztj_WorkInfoStatusEntity : DEntityBase
{
/// <summary>
/// 工单Id

+ 31
- 0
backend/BPA.MES.Base.Application/Entitys/Base/OperLogEntity.cs Bestand weergeven

@@ -0,0 +1,31 @@
namespace BPA.MES.Base.Application.Entitys
{
/// <summary>
/// 名 称 :操作日志
/// 创 建 人 :yangxiao
/// 创建时间 :2023/7/20 15:10:59
/// 描 述 :
/// </summary>
[SugarTable("oper_log")]
public class OperLogEntity : DEntityBase
{
/// <summary>
/// 操作标题
/// </summary>
public string Name { get; set; }
/// <summary>
/// 内容
/// </summary>
public string Context { get; set; }
/// <summary>
/// 返回值
/// </summary>
[SugarColumn(IsNullable = true)]
public string Result { get; set; }
/// <summary>
/// 创建时间
/// </summary>
[SugarColumn(IsNullable = true)]
public DateTime? CreateTime { get; set; }
}
}

+ 47
- 0
backend/BPA.MES.Base.Application/Filters/OperLogAttribute .cs Bestand weergeven

@@ -0,0 +1,47 @@
using Furion.EventBus;
using Furion.JsonSerialization;
using Microsoft.AspNetCore.Mvc.Filters;
using System.Diagnostics;
using System.Security.Claims;

namespace BPA.MES.Base.Application
{
/// <summary>
/// 名 称 :接口AOP
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/7/20 15:04:06
/// 描 述 :
/// </summary>
public class OperLogAttribute : ActionFilterAttribute
{
public string _name;
public OperLogAttribute(string name)
{
_name = name;
}
/// <summary>
/// 执行操作前后
/// </summary>
/// <param name="context"></param>
/// <param name="next"></param>
/// <returns></returns>
public override async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
{
// 获取 HttpContext 和 HttpRequest 对象
var httpContext = context.HttpContext;
var httpRequest = httpContext.Request;
var sw = new Stopwatch();
sw.Start();
var actionContext = await next();
sw.Stop();
var userName = httpContext.User?.FindFirstValue(ClaimConst.CLAINM_NAME);
// 代码参考接口方式
await MessageCenter.PublishAsync("ToDo:OperLog", new OperLogEntity()
{
Context = context.ActionArguments.Count < 1 ? string.Empty : JSON.Serialize(context.ActionArguments),
Name = $"[{userName}]{_name}",
Result = actionContext.Exception == null? "true" : EnhancedStackTrace.Current().ToString()
});
}
}
}

+ 1
- 1
backend/BPA.MES.Base.Application/Services/CraftsInfoService/Services/CraftsStepsService.cs Bestand weergeven

@@ -112,7 +112,7 @@
throw Oops.Bah("名称或编码已存在!");
}
Pztj_CraftStepsEntity entity = input.Adapt<Pztj_CraftStepsEntity>();
var res = await _dbContext.Updateable(entity).IgnoreColumns(true).IgnoreColumns(true).ExecuteCommandHasChangeAsync();
var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync();
return res;
}
}


+ 1
- 1
backend/BPA.MES.Base.Application/Services/DeviceService/Services/DevicesInfoService.cs Bestand weergeven

@@ -112,7 +112,7 @@
throw Oops.Bah("名称或编码已存在!");
}
Pztj_DevicesInfoEntity entity = input.Adapt<Pztj_DevicesInfoEntity>();
var res = await _dbContext.Updateable(entity).IgnoreColumns(true).IgnoreColumns(true).ExecuteCommandHasChangeAsync();
var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync();
return res;
}
}


+ 37
- 0
backend/BPA.MES.Base.Application/Services/OperLogService/Dtos/OperLogDto.cs Bestand weergeven

@@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BPA.MES.Base.Application.Services
{
/// <summary>
/// 名 称 :
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/7/20 15:15:48
/// 描 述 :
/// </summary>
public class OperLogDto
{
/// <summary>
/// 操作标题
/// </summary>
public string Name { get; set; }
/// <summary>
/// 内容
/// </summary>
public string Context { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
}
/// <summary>
/// 增加
/// </summary>
public class OperLogAddInput: OperLogDto
{
}
}

+ 17
- 0
backend/BPA.MES.Base.Application/Services/OperLogService/Services/IOperLogService.cs Bestand weergeven

@@ -0,0 +1,17 @@
namespace BPA.MES.Base.Application.Services
{
/// <summary>
/// 名 称 :日志服务
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/7/20 15:17:58
/// 描 述 :
/// </summary>
public interface IOperLogService
{
/// <summary>
/// 增加
/// </summary>
/// <returns></returns>
Task<bool> Add(WorkInfoAddInput input);
}
}

+ 12
- 0
backend/BPA.MES.Base.Application/Services/OperLogService/Services/OperLogService.cs Bestand weergeven

@@ -0,0 +1,12 @@
namespace BPA.MES.Base.Application.Services
{
/// <summary>
/// 名 称 :操作日志
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/7/20 15:17:24
/// 描 述 :
/// </summary>
public class OperLogService
{
}
}

+ 76
- 0
backend/BPA.MES.Base.Application/Services/ProductLineService/Dtos/ProductLineDeviceDto.cs Bestand weergeven

@@ -0,0 +1,76 @@
namespace BPA.MES.Base.Application.Services
{
/// <summary>
/// 名 称 :产线设备
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/7/20 17:00:32
/// 描 述 :
/// </summary>
public class ProductLineDeviceDto
{
/// <summary>
/// 产线Id
/// </summary>
public string LineId { get; set; }
/// <summary>
/// 产线设备
/// </summary>
public string DeviceId { get; set; }
}
public class ProductLineDeviceAddInput: ProductLineDeviceDto {
}
/// <summary>
/// 产线设备分页
/// </summary>
public class ProductLineDeviceQueryPageInput : RequestPage
{
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 产线Id
/// </summary>
public string LineId { get; set; }
}
/// <summary>
/// 删除产线设备
/// </summary>
public class ProductLineDeviceDelInput: ProductLineDeviceDto
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
}
/// <summary>
/// 产线设备关联信息
/// </summary>
public class ProductLineDeviceOutput: ProductLineDeviceDto
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
/// <summary>
/// 名称
/// </summary>
/// <example>设备名称</example>
public string DeviceName { get; set; }
/// <summary>
/// 编码
/// </summary>
public string DeviceCode { get; set; }
/// <summary>
/// 设备类型
/// </summary>
public string DeviceType { get; set; }
/// <summary>
/// 设备描述
/// </summary>
/// <example>设备描述</example>
public string Describe { get; set; }
}
}

+ 1
- 0
backend/BPA.MES.Base.Application/Services/ProductLineService/Dtos/ProductLineDto.cs Bestand weergeven

@@ -72,4 +72,5 @@
/// </summary>
public string Id { get; set; }
}
}

+ 69
- 0
backend/BPA.MES.Base.Application/Services/ProductLineService/Dtos/ProductLineStockDto.cs Bestand weergeven

@@ -0,0 +1,69 @@
namespace BPA.MES.Base.Application.Services
{
/// <summary>
/// 名 称 :
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/7/20 18:25:18
/// 描 述 :
/// </summary>
public class ProductLineStockDto
{
/// <summary>
/// 产线Id
/// </summary>
public string LineId { get; set; }
/// <summary>
/// 产线设备
/// </summary>
public string StockId { get; set; }
}
public class ProductLineStockAddInput : ProductLineStockDto
{


}
/// <summary>
/// 产线设备分页
/// </summary>
public class ProductLineStockQueryPageInput : RequestPage
{
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 产线Id
/// </summary>
public string LineId { get; set; }
}
/// <summary>
/// 删除产线设备
/// </summary>
public class ProductLineStockDelInput : ProductLineStockDto
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
}
/// <summary>
/// 产线设备关联信息
/// </summary>
public class ProductLineStockOutput : ProductLineStockDto
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
/// <summary>
/// 名称
/// </summary>
/// <example>设备名称</example>
public string StockName { get; set; }
/// <summary>
/// 编码
/// </summary>
public string StockCode { get; set; }
}
}


+ 52
- 0
backend/BPA.MES.Base.Application/Services/ProductLineService/Services/IProductLineService.cs Bestand weergeven

@@ -44,5 +44,57 @@
/// <param name="Id"></param>
/// <returns></returns>
Task<ProductLineOutput> Detail(string Id);
/// <summary>
/// 产线添加设备
/// </summary>
/// <returns></returns>
Task<bool> AddDevice(ProductLineDeviceAddInput input);
/// <summary>
/// 产线删除设备
/// </summary>
/// <returns></returns>
Task<bool> DeleteDevice(ProductLineDeviceDelInput input);
///// <summary>
///// 产线更新设备
///// </summary>
///// <returns></returns>
//Task<bool> UpdateDevice(string DeviceId);
/// <summary>
/// 产线设备不分页
/// </summary>
/// <returns></returns>
Task<List<ProductLineDeviceOutput>> DeviceList();
/// <summary>
/// 产线设备分页
/// </summary>
/// <returns></returns>
Task<SqlSugarPagedList<ProductLineDeviceOutput>> DevicePageList(ProductLineDeviceQueryPageInput input);


/// <summary>
/// 产线添加料仓
/// </summary>
/// <returns></returns>
Task<bool> AddStock(ProductLineStockAddInput input);
/// <summary>
/// 产线删除料仓
/// </summary>
/// <returns></returns>
Task<bool> DeleteStock(ProductLineStockDelInput input);
///// <summary>
///// 产线更新料仓
///// </summary>
///// <returns></returns>
//Task<bool> UpdateStock(string StockId);
/// <summary>
/// 产线料仓不分页
/// </summary>
/// <returns></returns>
Task<List<ProductLineStockOutput>> StockList();
/// <summary>
/// 产线料仓分页
/// </summary>
/// <returns></returns>
Task<SqlSugarPagedList<ProductLineStockOutput>> StockPageList(ProductLineStockQueryPageInput input);
}
}

+ 122
- 1
backend/BPA.MES.Base.Application/Services/ProductLineService/Services/ProductLineService.cs Bestand weergeven

@@ -55,6 +55,7 @@
ProductLineOutput output = entity.Adapt<ProductLineOutput>();
return output;
}
/// <summary>
/// 列表
/// </summary>
@@ -112,9 +113,129 @@
throw Oops.Bah("名称或编码已存在!");
}
ProductLineEntity entity = input.Adapt<ProductLineEntity>();
var res = await _dbContext.Updateable(entity).IgnoreColumns(true).IgnoreColumns(true).ExecuteCommandHasChangeAsync();
var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync();
return res;
}
/// <summary>
/// 产线添加设备
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<bool> AddDevice(ProductLineDeviceAddInput input)
{
var r_entity = await _dbContext.Queryable<Pztj_LineDevicesEntity>().FirstAsync(x => x.DeviceId == input.DeviceId);
if (r_entity != null)
{
throw Oops.Bah("设备已存在!");
}
Pztj_LineDevicesEntity entity = input.Adapt<Pztj_LineDevicesEntity>();
return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync();
}
/// <summary>
/// 产线删除设备
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<bool> DeleteDevice(ProductLineDeviceDelInput input)
{
var res = await _dbContext.Deleteable<Pztj_LineDevicesEntity>().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync();
return res;
}
/// <summary>
/// 产线设备不分页
/// </summary>
/// <returns></returns>
[HttpGet]
public async Task<List<ProductLineDeviceOutput>> DeviceList()
{
var entity = await _dbContext.Queryable<Pztj_LineDevicesEntity>().ToListAsync();
List<ProductLineDeviceOutput> output = entity.Adapt<List<ProductLineDeviceOutput>>();
return output;
}
/// <summary>
/// 产线设备分页
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<SqlSugarPagedList<ProductLineDeviceOutput>> DevicePageList(ProductLineDeviceQueryPageInput input)
{
var entity = await _dbContext.Queryable<Pztj_LineDevicesEntity>()
.LeftJoin<Pztj_DevicesInfoEntity>((a,b)=>a.DeviceId==b.Id)
.WhereIF(!string.IsNullOrEmpty(input.Name), (a, b) => b.Name.Contains(input.Name))
.Where((a, b) => a.LineId == input.LineId)
.Select((a,b)=>new ProductLineDeviceOutput
{
DeviceId = a.DeviceId,
DeviceCode = b.Code,
DeviceName = b.Name,
Describe = b.Describe,
DeviceType = b.DeviceType,
Id = a.Id,
LineId = a.LineId
})
.ToPagedListAsync(input.PageIndex, input.PageSize);
return entity;
}


/// <summary>
/// 产线添加料仓
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<bool> AddStock(ProductLineStockAddInput input)
{
var r_entity = await _dbContext.Queryable<Pztj_LineStocksEntity>().FirstAsync(x => x.StockId == input.StockId);
if (r_entity != null)
{
throw Oops.Bah("设备已存在!");
}
Pztj_LineStocksEntity entity = input.Adapt<Pztj_LineStocksEntity>();
return await _dbContext.Insertable(entity).IgnoreColumns(ignoreNullColumn: true).ExecuteCommandIdentityIntoEntityAsync();
}
/// <summary>
/// 产线删除料仓
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<bool> DeleteStock(ProductLineStockDelInput input)
{
var res = await _dbContext.Deleteable<Pztj_LineStocksEntity>().Where(x => x.Id == input.Id).ExecuteCommandHasChangeAsync();
return res;
}
/// <summary>
/// 产线料仓不分页
/// </summary>
/// <returns></returns>
[HttpGet]
public async Task<List<ProductLineStockOutput>> StockList()
{
var entity = await _dbContext.Queryable<Pztj_LineStocksEntity>().ToListAsync();
List<ProductLineStockOutput> output = entity.Adapt<List<ProductLineStockOutput>>();
return output;
}
/// <summary>
/// 产线料仓分页
/// </summary>
/// <returns></returns>
[HttpPost]
public async Task<SqlSugarPagedList<ProductLineStockOutput>> StockPageList(ProductLineStockQueryPageInput input)
{
var entity = await _dbContext.Queryable<Pztj_LineStocksEntity>()
.LeftJoin<Pztj_StockInfoEntity>((a, b) => a.StockId == b.Id)
.WhereIF(!string.IsNullOrEmpty(input.Name), (a, b) => b.Name.Contains(input.Name))
.Where((a, b) => a.LineId == input.LineId)
.Select((a, b) => new ProductLineStockOutput
{
StockId = a.StockId,
StockCode = b.Code,
StockName = b.Name,
Id = a.Id,
LineId = a.LineId
})
.ToPagedListAsync(input.PageIndex, input.PageSize);
return entity;
}
}
}


+ 83
- 0
backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkInfoDto.cs Bestand weergeven

@@ -0,0 +1,83 @@
namespace BPA.MES.Base.Application.Services
{
/// <summary>
/// 名 称 :
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/7/20 14:29:09
/// 描 述 :
/// </summary>
public class WorkInfoDto
{
/// <summary>
/// 工单名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 产线Id
/// </summary>
public string LineId { get; set; }
/// <summary>
/// 成品Id
/// </summary>
public string FinalId { get; set; }
/// <summary>
/// 产量
/// </summary>
public string Number { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public string CreatTime { get; set; }
}
/// <summary>
/// 增加
/// </summary>
public class WorkInfoAddInput : WorkInfoDto
{

}
/// <summary>
/// 更新
/// </summary>
public class WorkInfoUpdateInput : WorkInfoDto
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
}
/// <summary>
/// 删除
/// </summary>
public class WorkInfoDelInput
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
}
/// <summary>
/// 分页
/// </summary>
public class WorkInfoQueryPageInput : RequestPage
{
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 编码
/// </summary>
public string Code { get; set; }
}
/// <summary>
/// 输出
/// </summary>
public class WorkInfoOutput : WorkInfoDto
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
}
}

+ 71
- 0
backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkInfoItemDto.cs Bestand weergeven

@@ -0,0 +1,71 @@
namespace BPA.MES.Base.Application.Services
{
/// <summary>
/// 名 称 :工单产量
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/7/20 14:29:25
/// 描 述 :
/// </summary>
public class WorkInfoItemDto
{
/// <summary>
/// 工单名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 产量
/// </summary>
public string Number { get; set; }
}
/// <summary>
/// 增加
/// </summary>
public class WorkInfoItemAddInput : WorkInfoItemDto
{

}
/// <summary>
/// 更新
/// </summary>
public class WorkInfoItemUpdateInput : WorkInfoItemDto
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
}
/// <summary>
/// 删除
/// </summary>
public class WorkInfoItemDelInput
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
}
/// <summary>
/// 分页
/// </summary>
public class WorkInfoItemQueryPageInput : RequestPage
{
/// <summary>
/// 名称
/// </summary>
public string Name { get; set; }
/// <summary>
/// 编码
/// </summary>
public string Code { get; set; }
}
/// <summary>
/// 输出
/// </summary>
public class WorkInfoItemOutput : WorkInfoItemDto
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
}
}

+ 72
- 0
backend/BPA.MES.Base.Application/Services/WorkInfoService/Dtos/WorkInfoStatusDto.cs Bestand weergeven

@@ -0,0 +1,72 @@
namespace BPA.MES.Base.Application.Services
{
/// <summary>
/// 名 称 :工单状态
/// 创 建 人 :yangxiao
/// 创建时间 :2023/7/20 14:29:39
/// 描 述 :
/// </summary>
public class WorkInfoStatusDto
{
/// <summary>
/// 工单Id
/// </summary>
public string WorkId { get; set; }
/// <summary>
/// 工单状态
/// </summary>
public string Status { get; set; }
/// <summary>
/// 创建时间
/// </summary>
public DateTime CreateTime { get; set; }
}
/// <summary>
/// 增加
/// </summary>
public class WorkInfoStatusAddInput : WorkInfoStatusDto
{

}
/// <summary>
/// 更新
/// </summary>
public class WorkInfoStatusUpdateInput : WorkInfoStatusDto
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
/// <summary>
/// 工单Id
/// </summary>
public string WorkInfoId { get; set; }
}
/// <summary>
/// 删除
/// </summary>
public class WorkInfoStatusDelInput
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
}
/// <summary>
/// 分页
/// </summary>
public class WorkInfoStatusQueryPageInput : RequestPage
{
}
/// <summary>
/// 输出
/// </summary>
public class WorkInfoStatusOutput : WorkInfoStatusDto
{
/// <summary>
/// 主键
/// </summary>
public string Id { get; set; }
}
}

+ 53
- 0
backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/IWorkInfoService.cs Bestand weergeven

@@ -0,0 +1,53 @@
namespace BPA.MES.Base.Application.Services
{
/// <summary>
/// 名 称 :工单服务
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/7/20 14:39:28
/// 描 述 :
/// </summary>
public interface IWorkInfoService
{
/// <summary>
/// 增加
/// </summary>
/// <returns></returns>
Task<bool> Add(WorkInfoAddInput input);
/// <summary>
/// 移除
/// </summary>
/// <returns></returns>
Task<bool> Del(WorkInfoDelInput input);
/// <summary>
/// 更新
/// </summary>
/// <returns></returns>
Task<bool> Update(WorkInfoUpdateInput input);
/// <summary>
/// 不分页列表
/// </summary>
/// <returns></returns>
Task<List<WorkInfoOutput>> List();
/// <summary>
/// 分页列表
/// </summary>
/// <returns></returns>
Task<SqlSugarPagedList<WorkInfoOutput>> PagedList(WorkInfoQueryPageInput input);
/// <summary>
/// 下拉列表
/// </summary>
/// <returns></returns>
Task<dynamic> SelectList();
/// <summary>
/// 查询单条
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
Task<WorkInfoOutput> Detail(string Id);
/// <summary>
/// 更改状态
/// </summary>
/// <returns></returns>
Task<bool> UpdateStatus(WorkInfoStatusUpdateInput input);
}
}

+ 125
- 0
backend/BPA.MES.Base.Application/Services/WorkInfoService/Services/WorkInfoService.cs Bestand weergeven

@@ -0,0 +1,125 @@
using Furion.EventBus;

namespace BPA.MES.Base.Application.Services.WorkInfoService.Services
{
/// <summary>
/// 名 称 :工单服务
/// 创 建 人 :yangxiao
/// 创建时间 :2023/7/20 14:39:41
/// 描 述 :
/// </summary>
[ApiDescriptionSettings("工单服务", Order = 0, Tag = "工单服务", Name = "WorkInfoInfo", KeepName = true, SplitCamelCase = true, KeepVerb = true)]
public class WorkInfoService : IWorkInfoService, ITransient, IDynamicApiController
{
private readonly ISqlSugarClient _dbContext;
private readonly IEventPublisher _eventPublisher;
public WorkInfoService(ISqlSugarClient db, IEventPublisher eventPublisher)
{
_dbContext = db;
_eventPublisher = eventPublisher;
}
/// <summary>
/// 增加
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost, OperLog("增加工单")]
public async Task<bool> Add(WorkInfoAddInput input)
{
Pztj_WorkInfoEntity entity = input.Adapt<Pztj_WorkInfoEntity>();
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(WorkInfoDelInput input)
{
var res = await _dbContext.Deleteable<Pztj_WorkInfoEntity>().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<WorkInfoOutput> Detail(string Id)
{
var entity = await _dbContext.Queryable<Pztj_WorkInfoEntity>().FirstAsync(x => x.Id == Id);
WorkInfoOutput output = entity.Adapt<WorkInfoOutput>();
return output;
}
/// <summary>
/// 列表
/// </summary>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpGet]
public async Task<List<WorkInfoOutput>> List()
{
var entity = await _dbContext.Queryable<Pztj_WorkInfoEntity>().ToListAsync();
List<WorkInfoOutput> output = entity.Adapt<List<WorkInfoOutput>>();
return output;
}
/// <summary>
/// 分页
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost]
public async Task<SqlSugarPagedList<WorkInfoOutput>> PagedList(WorkInfoQueryPageInput input)
{
var entity = await _dbContext.Queryable<Pztj_WorkInfoEntity>()
.WhereIF(!string.IsNullOrEmpty(input.Name), x => x.Name.Contains(input.Name))
.WhereIF(!string.IsNullOrEmpty(input.Code), x => x.Name.Contains(input.Code))
.ToPagedListAsync(input.PageIndex, input.PageSize);
SqlSugarPagedList<WorkInfoOutput> output = entity.Adapt<SqlSugarPagedList<WorkInfoOutput>>();
return output;
}
/// <summary>
/// 下拉
/// </summary>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[HttpGet]
public async Task<dynamic> SelectList()
{
var entity = await _dbContext.Queryable<Pztj_WorkInfoEntity>().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(WorkInfoUpdateInput input)
{
Pztj_WorkInfoEntity entity = input.Adapt<Pztj_WorkInfoEntity>();
var res = await _dbContext.Updateable(entity).IgnoreColumns(true).ExecuteCommandHasChangeAsync();
return res;
}
/// <summary>
/// 修改工单状态
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
public async Task<bool> UpdateStatus(WorkInfoStatusUpdateInput input)
{
Pztj_WorkInfoStatusEntity entity = input.Adapt<Pztj_WorkInfoStatusEntity>();
var res = await _dbContext.Insertable(entity).IgnoreColumns(true).ExecuteCommandIdentityIntoEntityAsync();
return res;
}
}
}

+ 28
- 0
backend/BPA.MES.Base.Application/Subscriber/ToDoEventSubscriber.cs Bestand weergeven

@@ -0,0 +1,28 @@
using Furion.EventBus;

namespace BPA.MES.Base.Application.Subscriber
{
/// <summary>
/// 名 称 :
/// 创 建 人 :yangxiao
/// 创建时间 : 2023/7/20 15:09:49
/// 描 述 :
/// </summary>
public class ToDoEventSubscriber : IEventSubscriber
{
private readonly ISqlSugarClient _dbContext;
public ToDoEventSubscriber(ISqlSugarClient db)
{
_dbContext = db;
}

[EventSubscribe("ToDo:OperLog")]
public async Task CreateToDo(EventHandlerExecutingContext context)
{
var todo = context.Source;
OperLogEntity entity =(OperLogEntity)todo.Payload;
await _dbContext.Insertable(entity).ExecuteCommandAsync();
await Task.CompletedTask;
}
}
}

+ 14
- 0
backend/BPA.MES.Base.Web.Core/BPA.MES.Base.Web.Core.xml Bestand weergeven

@@ -4,5 +4,19 @@
<name>BPA.MES.Base.Web.Core</name>
</assembly>
<members>
<member name="M:BPA.MES.Base.Web.Core.JwtHandler.HandleAsync(Microsoft.AspNetCore.Authorization.AuthorizationHandlerContext)">
<summary>
重写 Handler 添加自动刷新收取逻辑
</summary>
<param name="context"></param>
<returns></returns>
</member>
<member name="M:BPA.MES.Base.Web.Core.JwtHandler.CheckAuthorzie(Microsoft.AspNetCore.Http.DefaultHttpContext)">
<summary>
检查权限
</summary>
<param name="httpContext"></param>
<returns></returns>
</member>
</members>
</doc>

+ 34
- 1
backend/BPA.MES.Base.Web.Core/Handlers/JwtHandler.cs Bestand weergeven

@@ -1,4 +1,5 @@
using Furion.Authorization;
using Furion.DataEncryption;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using System.Threading.Tasks;
@@ -7,10 +8,42 @@ namespace BPA.MES.Base.Web.Core;

public class JwtHandler : AppAuthorizeHandler
{
/// <summary>
/// 重写 Handler 添加自动刷新收取逻辑
/// </summary>
/// <param name="context"></param>
/// <returns></returns>
public override async Task HandleAsync(AuthorizationHandlerContext context)
{
// 自动刷新 token
if (JWTEncryption.AutoRefreshToken(context, context.GetCurrentHttpContext(), expiredTime: 20, refreshTokenExpiredTime: 25))
{
await AuthorizeHandleAsync(context);
}
else context.Fail(); // 授权失败
}
public override Task<bool> PipelineAsync(AuthorizationHandlerContext context, DefaultHttpContext httpContext)
{
// 这里写您的授权判断逻辑,授权通过返回 true,否则返回 false

return Task.FromResult(true);
return Task.FromResult(CheckAuthorzie(httpContext));
}
/// <summary>
/// 检查权限
/// </summary>
/// <param name="httpContext"></param>
/// <returns></returns>
private static bool CheckAuthorzie(DefaultHttpContext httpContext)
{
// 获取权限特性
var securityDefineAttribute = httpContext.GetMetadata<SecurityDefineAttribute>();
if (securityDefineAttribute == null)
{
return true;
}
else
{
return false;
}
}
}

+ 9
- 3
backend/BPA.MES.Base.Web.Core/Startup.cs Bestand weergeven

@@ -1,4 +1,5 @@
using BPA.MES.Base.Core;
using BPA.MES.Base.Application.Subscriber;
using BPA.MES.Base.Core;
using Furion;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
@@ -13,8 +14,7 @@ public class Startup : AppStartup
public void ConfigureServices(IServiceCollection services)
{
services.AddConsoleFormatter();
services.AddJwt<JwtHandler>();

services.AddJwt<JwtHandler>(enableGlobalAuthorize: true);
services.AddCorsAccessor();
services.AddSqlsugarSetup(App.Configuration);
// 配置雪花Id算法机器码
@@ -22,6 +22,12 @@ public class Startup : AppStartup
{
WorkerId = 5
});
// 注册 EventBus 服务
services.AddEventBus(builder =>
{
// 通过类型注册
builder.AddSubscriber(typeof(ToDoEventSubscriber));
});
services.AddControllers()
.AddInjectWithUnifyResult();
}


Laden…
Annuleren
Opslaan