Browse Source

修改 文件名

dev_DY_CC
郑勃旭 1 year ago
parent
commit
b8d02414f7
  1. 9
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/AssembleJobs/DTOs/AssembleJobDTO.cs
  2. 509
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/AssembleJobs/DTOs/AssembleJobDetailDTO.cs
  3. 11
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/AssembleJobs/IAssembleJobAppService.cs
  4. 519
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/AssembleJobs/Inputs/AssembleJobDetailInput.cs
  5. 9
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobDTO.cs
  6. 512
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobDetailDTO.cs
  7. 522
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobDetailInput.cs
  8. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobPermissions.cs
  9. 14
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/CoatingIssueJobs/ICoatingIssueJobAppService.cs
  10. 7
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/AssembleNotes/DTOs/AssembleNoteDTO.cs
  11. 513
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/AssembleNotes/DTOs/AssembleNoteDetailDTO.cs
  12. 506
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/AssembleNotes/Inputs/AssembleNoteDetailInput.cs
  13. 9
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/AssembleNotes/Inputs/AssembleNoteEditInput.cs
  14. 9
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/CoatingIssueNotes/CoatingIssueNoteDTO.cs
  15. 516
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/CoatingIssueNotes/CoatingIssueNoteDetailDTO.cs
  16. 509
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/CoatingIssueNotes/CoatingIssueNoteDetailInput.cs
  17. 9
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/CoatingIssueNotes/CoatingIssueNoteEditInput.cs
  18. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Permissions/StorePermissionDefinitionProvider.cs
  19. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/MaterialRequests/AssembleRequests/Inputs/AssembleRequestEditInput.cs
  20. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/MaterialRequests/CoatingMaterialRequests/CoatingMaterialRequestEditInput.cs
  21. 209
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleJobs/AssembleJobAppService.cs
  22. 277
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs
  23. 7
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAutoMapperProfile.cs
  24. 50
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/IssueNotes/CoatingIssueNotes/CoatingIssueNoteAppService.cs
  25. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/IssueNotes/CoatingIssueNotes/CoatingIssueNoteAutoMapperProfile.cs
  26. 167
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/AssembleRequests/AssembleRequestAppService.cs
  27. 411
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/CoatingMaterialRequests/CoatingMaterialRequestAppService.cs
  28. 12
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/InjectionRequests/InjectionRequestAppService.cs
  29. 41
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/AssembleJobs/AssembleJob.cs
  30. 479
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/AssembleJobs/AssembleJobDetail.cs
  31. 110
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/AssembleJobs/AssembleJobManager.cs
  32. 46
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJob.cs
  33. 484
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobDetail.cs
  34. 139
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobManager.cs
  35. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/IIssueJobRepository.cs
  36. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/InjectionJobs/IInjectionJobRepository.cs
  37. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/InjectionJobs/InjectionJobManager.cs
  38. 7
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/IssueNotes/AssembleNotes/AssembleNote.cs
  39. 500
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/IssueNotes/AssembleNotes/AssembleNoteDetail.cs
  40. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/IssueNotes/CoatingIssueNotes/CoatingIssueNote.cs
  41. 503
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/IssueNotes/CoatingIssueNotes/CoatingIssueNoteDetail.cs
  42. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/AssembleRequests/AssembleRequestManager.cs
  43. 3
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/AssembleRequests/IAssembleRequestManager.cs
  44. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/CoatingMaterialRequests/CoatingMaterialRequestManager.cs
  45. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/CoatingMaterialRequests/ICoatingMaterialRequestManager.cs
  46. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestManager.cs
  47. 23
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/IssueJobs/AssembleJobs/AssembleJobDbContextModelCreatingExtensions.cs
  48. 21
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/IssueJobs/CoatingIssueJob/CoatingIssueJobDbContextModelCreatingExtensions.cs
  49. 50
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/IssueNotes/AssembleNotes/AssembleNoteDbContextModelCreatingExtensions.cs
  50. 50
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/IssueNotes/CoatingIssueNoteDbContextModelCreatingExtensions.cs
  51. 55
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/AssembleJobAutoMapperProfile.cs
  52. 55
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/CoatingIssueJobAutoMapperProfile.cs
  53. 30
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/AssembleNoteAutoMapperProfile.cs
  54. 30
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/CoatingIssueNoteAutoMapperProfile.cs
  55. 228
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/AssembleJobEventHandler.cs
  56. 240
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/CoatingIssueJobEventHandler.cs
  57. 395
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/AssembleRequestEventHandler.cs
  58. 473
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/CoatingMaterialRequestEventHandler.cs
  59. 38
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/CoatingIssueNoteEventHandler.cs
  60. 88
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/AssembleNoteEventHandler.cs
  61. 102
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/CoatingIssueNoteEventHandler.cs

9
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/AssembleJobs/DTOs/AssembleJobDTO.cs

@ -28,14 +28,7 @@ public class AssembleJobDTO : SfsJobDTOBase<AssembleJobDetailDTO>
/// </summary>
[Display(Name = "要货单号")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string AssembleIssueRequestsNumber { get; set; }
/// <summary>
/// 车间
/// </summary>
[Display(Name = "车间")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string Workshop { get; set; }
public string AssembleRequestNumber { get; set; }
/// <summary>
/// 使用在途库

509
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/AssembleJobs/DTOs/AssembleJobDetailDTO.cs

@ -1,112 +1,519 @@
using System;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain;
using System.ComponentModel.DataAnnotations.Schema;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class AssembleJobDetailDTO : SfsJobRecommendFromDetailDTOBase, IHasToLocation
public class AssembleJobDetailDTO : SfsDetailDTOBase
{
#region 库存基础信息
/// <summary>
/// 请求库位
/// 物品代码
/// </summary>
[Display(Name = "请求库位")]
public string RequestLocationCode { get; set; }
public string ItemCode { get; set; }
/// <summary>
/// 物品名称
/// </summary>
public string ItemName { get; set; }
/// <summary>
/// 物品描述1
/// </summary>
public string ItemDesc1 { get; set; }
/// <summary>
/// 物品描述2
/// </summary>
public string ItemDesc2 { get; set; }
/// <summary>
/// 标包数量
/// </summary>
[Display(Name = "标包数量")]
[Column(TypeName = "decimal(18,6)")]
public decimal StdPackQty { get; set; }
/// <summary>
/// 库存状态
/// </summary>
public EnumInventoryStatus Status { get; set; }
/// <summary>
/// 到库位
/// 计量单
/// </summary>
[Display(Name = "到库位")]
public string ToLocationCode { get; set; }
public string Uom { get; set; }
#endregion
#region 请求信息
/// <summary>
/// 请求库位
/// </summary>
public string RequestLocationCode { get; set; }
/// <summary>
/// 到库区
/// 到库区
/// </summary>
[Display(Name = "到库区")]
public string ToLocationArea { get; set; }
public string RequestLocationArea { get; set; }
/// <summary>
/// 到库位组
/// 到库位组
/// </summary>
[Display(Name = "到库位组")]
public string ToLocationGroup { get; set; }
public string RequestLocationGroup { get; set; }
/// <summary>
/// 到ERP库位
/// 到ERP库位
/// </summary>
[Display(Name = "到ERP库位")]
public string ToLocationErpCode { get; set; }
public string RequestLocationErpCode { get; set; }
/// <summary>
/// 到仓库
/// 到仓库
/// </summary>
[Display(Name = "到仓库")]
public string ToWarehouseCode { get; set; }
public string RequestWarehouseCode { get; set; }
/// <summary>
/// 在途库库位
/// 在途库库位
/// </summary>
[Display(Name = "在途库库位")]
public string OnTheWayLocationCode { get; set; }
/// <summary>
/// 生产线
/// 生产线
/// </summary>
[Display(Name = "生产线")]
public string ProdLine { get; set; }
/// <summary>
/// 工作中心
/// 位置码
/// </summary>
public string PositionCode { get; set; }
/// <summary>
/// 推荐的类型
/// </summary>
public EnumRecommendType RecommendType { get; set; }
/// <summary>
/// 需求数量
/// </summary>
public decimal RequestQty { get; set; }
#endregion
#region 推荐来源
/// <summary>
/// 推荐来源托标签
/// </summary>
public string RecommendFromContainerCode { get; set; }
/// <summary>
/// 推荐来源箱标签
/// </summary>
public string RecommendFromPackingCode { get; set; }
/// <summary>
/// 推荐来源批次供应商批次
/// </summary>
public string RecommendFromSupplierBatch { get; set; }
/// <summary>
/// 推荐来源批次到货时间
/// </summary>
public DateTime RecommendFromArriveDate { get; set; }
/// <summary>
/// 推荐来源批次生产时间
/// </summary>
public DateTime RecommendFromProduceDate { get; set; }
/// <summary>
/// 推荐来源批次过期时间
/// </summary>
public DateTime RecommendFromExpireDate { get; set; }
/// <summary>
/// 推荐来源批次排序
/// </summary>
public string RecommendFromLot { get; set; }
/// <summary>
/// 推荐来源库位
/// </summary>
public string RecommendFromLocationCode { get; set; }
/// <summary>
/// 推荐来源库区
/// </summary>
public string RecommendFromLocationArea { get; set; }
/// <summary>
/// 推荐来源库位组
/// </summary>
public string RecommendFromLocationGroup { get; set; }
/// <summary>
/// 推荐来源ERP库位
/// </summary>
[Display(Name = "工作中心")]
public string WorkStation { get; set; }
public string RecommendFromLocationErpCode { get; set; }
/// <summary>
/// 过期时间
/// 推荐来源仓库
/// </summary>
[Display(Name = "过期时间")]
public DateTime ExpiredTime { get; set; }
public string RecommendFromWarehouseCode { get; set; }
/// <summary>
/// 工序
/// 推荐来源数量
/// </summary>
[Display(Name = "工序")]
public string Operation { get; set; }
public decimal RecommendFromQty { get; set; }
#endregion
#region 推荐目标
/// <summary>
/// 推荐目标托标签
/// </summary>
public string RecommendToContainerCode { get; set; }
/// <summary>
/// 推荐目标箱标签
/// </summary>
public string RecommendToPackingCode { get; set; }
/// <summary>
/// 推荐目标批次供应商批次
/// </summary>
public string RecommendToSupplierBatch { get; set; }
/// <summary>
/// 推荐目标批次到货时间
/// </summary>
public DateTime RecommendToArriveDate { get; set; }
/// <summary>
/// 推荐目标批次生产时间
/// </summary>
public DateTime RecommendToProduceDate { get; set; }
/// <summary>
/// 推荐目标批次过期时间
/// </summary>
public DateTime RecommendToExpireDate { get; set; }
/// <summary>
/// 推荐目标批次排序
/// </summary>
public string RecommendToLot { get; set; }
/// <summary>
/// 推荐目标库位
/// </summary>
public string RecommendToLocationCode { get; set; }
/// <summary>
/// 推荐目标库区
/// </summary>
public string RecommendToLocationArea { get; set; }
/// <summary>
/// 配送方式
/// 推荐目标库位组
/// </summary>
[Display(Name = "配送方式")]
public EnumDistributionType DistributionType { get; set; }
public string RecommendToLocationGroup { get; set; }
/// <summary>
/// 取整方式
/// 推荐目标ERP库位
/// </summary>
[Display(Name = "取整方式")]
public EnumTruncType TruncType { get; set; }
public string RecommendToLocationErpCode { get; set; }
/// <summary>
/// 取整后数量
/// 推荐目标仓库
/// </summary>
[Display(Name = "取整后数量")]
public decimal RoundedQty { get; set; }
public string RecommendToWarehouseCode { get; set; }
/// <summary>
/// 计划拆分规则
/// 推荐目标数量
/// </summary>
[Display(Name = "计划拆分规则")]
public EnumPlannedSplitRule PlannedSplitRule { get; set; }
public decimal RecommendToQty { get; set; }
#endregion
#region 库移来源
/// <summary>
/// 计划开始时间
/// 库移来源托标签
/// </summary>
[Display(Name = "计划开始时间")]
public DateTime PlanBeginTime { get; set; }
public string TransferLibFromContainerCode { get; set; }
/// <summary>
/// 每次配送数量
/// 库移来源箱标签
/// </summary>
[Display(Name = "每次配送数量")]
public decimal DeliveryQty { get; set; }
public string TransferLibFromPackingCode { get; set; }
/// <summary>
/// 库移来源批次供应商批次
/// </summary>
public string TransferLibFromSupplierBatch { get; set; }
/// <summary>
/// 库移来源批次到货时间
/// </summary>
public DateTime TransferLibFromArriveDate { get; set; }
/// <summary>
/// 库移来源批次生产时间
/// </summary>
public DateTime TransferLibFromProduceDate { get; set; }
/// <summary>
/// 库移来源批次过期时间
/// </summary>
public DateTime TransferLibFromExpireDate { get; set; }
/// <summary>
/// 库移来源批次排序
/// </summary>
public string TransferLibFromLot { get; set; }
/// <summary>
/// 库移来源库位
/// </summary>
public string TransferLibFromLocationCode { get; set; }
/// <summary>
/// 库移来源库区
/// </summary>
public string TransferLibFromLocationArea { get; set; }
/// <summary>
/// 库移来源库位组
/// </summary>
public string TransferLibFromLocationGroup { get; set; }
/// <summary>
/// 库移来源ERP库位
/// </summary>
public string TransferLibFromLocationErpCode { get; set; }
/// <summary>
/// 库移来源仓库
/// </summary>
public string TransferLibFromWarehouseCode { get; set; }
/// <summary>
/// 库移来源数量
/// </summary>
public decimal TransferLibFromQty { get; set; }
#endregion
#region 库移目标
/// <summary>
/// 库移目标托标签
/// </summary>
public string TransferLibToContainerCode { get; set; }
/// <summary>
/// 库移目标箱标签
/// </summary>
public string TransferLibToPackingCode { get; set; }
/// <summary>
/// 库移目标批次供应商批次
/// </summary>
public string TransferLibToSupplierBatch { get; set; }
/// <summary>
/// 库移目标批次到货时间
/// </summary>
public DateTime TransferLibToArriveDate { get; set; }
/// <summary>
/// 库移目标批次生产时间
/// </summary>
public DateTime TransferLibToProduceDate { get; set; }
/// <summary>
/// 库移目标批次过期时间
/// </summary>
public DateTime TransferLibToExpireDate { get; set; }
/// <summary>
/// 库移目标批次排序
/// </summary>
public string TransferLibToLot { get; set; }
/// <summary>
/// 库移目标库位
/// </summary>
public string TransferLibToLocationCode { get; set; }
/// <summary>
/// 库移目标库区
/// </summary>
public string TransferLibToLocationArea { get; set; }
/// <summary>
/// 库移目标库位组
/// </summary>
public string TransferLibToLocationGroup { get; set; }
/// <summary>
/// 库移目标ERP库位
/// </summary>
public string TransferLibToLocationErpCode { get; set; }
/// <summary>
/// 库移目标仓库
/// </summary>
public string TransferLibToWarehouseCode { get; set; }
/// <summary>
/// 库移目标数量
/// </summary>
public decimal TransferLibToQty { get; set; }
#endregion
#region 实际来源
/// <summary>
/// 实际目标托标签
/// </summary>
public string HandledFromContainerCode { get; set; }
/// <summary>
/// 实际箱标签
/// </summary>
public string HandledFromPackingCode { get; set; }
/// <summary>
/// 实际批次供应商批次
/// </summary>
public string HandledFromSupplierBatch { get; set; }
/// <summary>
/// 实际批次到货时间
/// </summary>
public DateTime HandledFromArriveDate { get; set; }
/// <summary>
/// 实际批次生产时间
/// </summary>
public DateTime HandledFromProduceDate { get; set; }
/// <summary>
/// 实际批次过期时间
/// </summary>
public DateTime HandledFromExpireDate { get; set; }
/// <summary>
/// 实际批次排序
/// </summary>
public string HandledFromLot { get; set; }
/// <summary>
/// 实际库位
/// </summary>
public string HandledFromLocationCode { get; set; }
/// <summary>
/// 实际库区
/// </summary>
public string HandledFromLocationArea { get; set; }
/// <summary>
/// 实际库位组
/// </summary>
public string HandledFromLocationGroup { get; set; }
/// <summary>
/// 实际ERP库位
/// </summary>
public string HandledFromLocationErpCode { get; set; }
/// <summary>
/// 实际仓库
/// </summary>
public string HandledFromWarehouseCode { get; set; }
/// <summary>
/// 实际数量
/// </summary>
public decimal HandledFromQty { get; set; }
#endregion
#region 实际目标
/// <summary>
/// 实际目标托标签
/// </summary>
public string HandledToContainerCode { get; set; }
/// <summary>
/// 实际箱标签
/// </summary>
public string HandledToPackingCode { get; set; }
/// <summary>
/// 实际批次供应商批次
/// </summary>
public string HandledToSupplierBatch { get; set; }
/// <summary>
/// 实际批次到货时间
/// </summary>
public DateTime HandledToArriveDate { get; set; }
/// <summary>
/// 实际批次生产时间
/// </summary>
public DateTime HandledToProduceDate { get; set; }
/// <summary>
/// 实际批次过期时间
/// </summary>
public DateTime HandledToExpireDate { get; set; }
/// <summary>
/// 实际批次排序
/// </summary>
public string HandledToLot { get; set; }
/// <summary>
/// 实际库位
/// </summary>
public string HandledToLocationCode { get; set; }
/// <summary>
/// 实际库区
/// </summary>
public string HandledToLocationArea { get; set; }
/// <summary>
/// 实际库位组
/// </summary>
public string HandledToLocationGroup { get; set; }
/// <summary>
/// 实际ERP库位
/// </summary>
public string HandledToLocationErpCode { get; set; }
/// <summary>
/// 实际仓库
/// </summary>
public string HandledToWarehouseCode { get; set; }
/// <summary>
/// 实际数量
/// </summary>
public decimal HandledToQty { get; set; }
#endregion
}

11
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/AssembleJobs/IAssembleJobAppService.cs

@ -8,19 +8,8 @@ namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public interface IAssembleJobAppService
: ISfsJobAppServiceBase<AssembleJobDTO, SfsJobRequestInputBase, AssembleJobCheckInput, AssembleJobEditInput>
{
Task<List<AssembleJobDTO>> CheckJobExistByItemCodeAndLocationCode(string itemCode, string locationCode);
Task CancelByMaterialRequestAsync(string assembleNumber);
Task<PagedResultDto<AssembleJobDTO>> GetListByTypeAsync(SfsJobRequestInputBase requestInput, string requestType,
bool includeDetails = false, CancellationToken cancellationToken = default);
Task<List<AssembleJobDTO>> GetByRequestNumberAsync(string requestNumber);
/// <summary>
/// 保存拆箱时涉及的明细修改
/// </summary>
/// <returns></returns>
Task<AssembleJobDTO> SaveDetail_SplitPackingAsync(SplitPacking_UpdateJobDetailInput input);
}

519
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/AssembleJobs/Inputs/AssembleJobDetailInput.cs

@ -1,134 +1,519 @@
using System;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain;
using System.ComponentModel.DataAnnotations.Schema;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class AssembleJobDetailInput : SfsJobRecommendFromDetailInputBase, IHasToLocation
public class AssembleJobDetailInput : SfsDetailInputBase
{
#region 库存基础信息
/// <summary>
/// 请求库位
/// 物品代码
/// </summary>
[Display(Name = "请求库位")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string RequestLocationCode { get; set; }
public string ItemCode { get; set; }
/// <summary>
/// 物品名称
/// </summary>
public string ItemName { get; set; }
/// <summary>
/// 物品描述1
/// </summary>
public string ItemDesc1 { get; set; }
/// <summary>
/// 物品描述2
/// </summary>
public string ItemDesc2 { get; set; }
/// <summary>
/// 标包数量
/// </summary>
[Display(Name = "标包数量")]
[Column(TypeName = "decimal(18,6)")]
public decimal StdPackQty { get; set; }
/// <summary>
/// 库存状态
/// </summary>
public EnumInventoryStatus Status { get; set; }
/// <summary>
/// 到库位
/// 计量单
/// </summary>
[Display(Name = "到库位")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ToLocationCode { get; set; }
public string Uom { get; set; }
#endregion
#region 请求信息
/// <summary>
/// 请求库位
/// </summary>
public string RequestLocationCode { get; set; }
/// <summary>
/// 到库区
/// 到库区
/// </summary>
[Display(Name = "到库区")]
public string ToLocationArea { get; set; }
public string RequestLocationArea { get; set; }
/// <summary>
/// 到库位组
/// 到库位组
/// </summary>
[Display(Name = "到库位组")]
public string ToLocationGroup { get; set; }
public string RequestLocationGroup { get; set; }
/// <summary>
/// 到ERP库位
/// 到ERP库位
/// </summary>
[Display(Name = "到ERP库位")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ToLocationErpCode { get; set; }
public string RequestLocationErpCode { get; set; }
/// <summary>
/// 到仓库
/// 到仓库
/// </summary>
[Display(Name = "到仓库")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ToWarehouseCode { get; set; }
public string RequestWarehouseCode { get; set; }
/// <summary>
/// 在途库库位
/// 在途库库位
/// </summary>
[Display(Name = "在途库库位")]
public string OnTheWayLocationCode { get; set; }
/// <summary>
/// 生产线
/// 生产线
/// </summary>
[Display(Name = "生产线")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ProdLine { get; set; }
/// <summary>
/// 工作中心
/// 位置码
/// </summary>
public string PositionCode { get; set; }
/// <summary>
/// 推荐的类型
/// </summary>
[Display(Name = "工作中心")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string WorkStation { get; set; }
public EnumRecommendType RecommendType { get; set; }
/// <summary>
/// 过期时间
/// 需求数量
/// </summary>
[Display(Name = "过期时间")]
[Required(ErrorMessage = "{0}是必填项")]
public DateTime ExpiredTime { get; set; }
public decimal RequestQty { get; set; }
#endregion
#region 推荐来源
/// <summary>
/// 工序
/// 推荐来源托标签
/// </summary>
[Display(Name = "工序")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string Operation { get; set; }
public string RecommendFromContainerCode { get; set; }
/// <summary>
/// 配送方式
/// 推荐来源箱标签
/// </summary>
[Display(Name = "配送方式")]
public EnumDistributionType DistributionType { get; set; }
public string RecommendFromPackingCode { get; set; }
/// <summary>
/// 取整方式
/// 推荐来源批次供应商批次
/// </summary>
[Display(Name = "取整方式")]
public EnumTruncType TruncType { get; set; }
public string RecommendFromSupplierBatch { get; set; }
/// <summary>
/// 取整后数量
/// 推荐来源批次到货时间
/// </summary>
[Display(Name = "取整后数量")]
public decimal RoundedQty { get; set; }
public DateTime RecommendFromArriveDate { get; set; }
/// <summary>
/// 计划拆分规则
/// 推荐来源批次生产时间
/// </summary>
[Display(Name = "计划拆分规则")]
public EnumPlannedSplitRule PlannedSplitRule { get; set; }
public DateTime RecommendFromProduceDate { get; set; }
/// <summary>
/// 计划开始时间
/// 推荐来源批次过期时间
/// </summary>
[Display(Name = "计划开始时间")]
public DateTime PlanBeginTime { get; set; }
public DateTime RecommendFromExpireDate { get; set; }
/// <summary>
/// 每次配送数量
/// 推荐来源批次排序
/// </summary>
[Display(Name = "每次配送数量")]
public decimal DeliveryQty { get; set; }
public string RecommendFromLot { get; set; }
/// <summary>
/// 位置码
/// 推荐来源库
/// </summary>
public string PositionCode { get; set; }
public string RecommendFromLocationCode { get; set; }
/// <summary>
/// 推荐类型
/// 推荐来源库区
/// </summary>
public EnumRecommendType RecommendType { get; set; }
public string RecommendFromLocationArea { get; set; }
/// <summary>
/// 推荐来源库位组
/// </summary>
public string RecommendFromLocationGroup { get; set; }
/// <summary>
/// 推荐来源ERP库位
/// </summary>
public string RecommendFromLocationErpCode { get; set; }
/// <summary>
/// 推荐来源仓库
/// </summary>
public string RecommendFromWarehouseCode { get; set; }
/// <summary>
/// 推荐来源数量
/// </summary>
public decimal RecommendFromQty { get; set; }
#endregion
#region 推荐目标
/// <summary>
/// 推荐目标托标签
/// </summary>
public string RecommendToContainerCode { get; set; }
/// <summary>
/// 推荐目标箱标签
/// </summary>
public string RecommendToPackingCode { get; set; }
/// <summary>
/// 推荐目标批次供应商批次
/// </summary>
public string RecommendToSupplierBatch { get; set; }
/// <summary>
/// 推荐目标批次到货时间
/// </summary>
public DateTime RecommendToArriveDate { get; set; }
/// <summary>
/// 推荐目标批次生产时间
/// </summary>
public DateTime RecommendToProduceDate { get; set; }
/// <summary>
/// 推荐目标批次过期时间
/// </summary>
public DateTime RecommendToExpireDate { get; set; }
/// <summary>
/// 推荐目标批次排序
/// </summary>
public string RecommendToLot { get; set; }
/// <summary>
/// 推荐目标库位
/// </summary>
public string RecommendToLocationCode { get; set; }
/// <summary>
/// 推荐目标库区
/// </summary>
public string RecommendToLocationArea { get; set; }
/// <summary>
/// 推荐目标库位组
/// </summary>
public string RecommendToLocationGroup { get; set; }
/// <summary>
/// 推荐目标ERP库位
/// </summary>
public string RecommendToLocationErpCode { get; set; }
/// <summary>
/// 推荐目标仓库
/// </summary>
public string RecommendToWarehouseCode { get; set; }
/// <summary>
/// 推荐目标数量
/// </summary>
public decimal RecommendToQty { get; set; }
#endregion
#region 库移来源
/// <summary>
/// 库移来源托标签
/// </summary>
public string TransferLibFromContainerCode { get; set; }
/// <summary>
/// 库移来源箱标签
/// </summary>
public string TransferLibFromPackingCode { get; set; }
/// <summary>
/// 库移来源批次供应商批次
/// </summary>
public string TransferLibFromSupplierBatch { get; set; }
/// <summary>
/// 库移来源批次到货时间
/// </summary>
public DateTime TransferLibFromArriveDate { get; set; }
/// <summary>
/// 库移来源批次生产时间
/// </summary>
public DateTime TransferLibFromProduceDate { get; set; }
/// <summary>
/// 库移来源批次过期时间
/// </summary>
public DateTime TransferLibFromExpireDate { get; set; }
/// <summary>
/// 库移来源批次排序
/// </summary>
public string TransferLibFromLot { get; set; }
/// <summary>
/// 库移来源库位
/// </summary>
public string TransferLibFromLocationCode { get; set; }
/// <summary>
/// 库移来源库区
/// </summary>
public string TransferLibFromLocationArea { get; set; }
/// <summary>
/// 库移来源库位组
/// </summary>
public string TransferLibFromLocationGroup { get; set; }
/// <summary>
/// 库移来源ERP库位
/// </summary>
public string TransferLibFromLocationErpCode { get; set; }
/// <summary>
/// 库移来源仓库
/// </summary>
public string TransferLibFromWarehouseCode { get; set; }
/// <summary>
/// 库移来源数量
/// </summary>
public decimal TransferLibFromQty { get; set; }
#endregion
#region 库移目标
/// <summary>
/// 库移目标托标签
/// </summary>
public string TransferLibToContainerCode { get; set; }
/// <summary>
/// 库移目标箱标签
/// </summary>
public string TransferLibToPackingCode { get; set; }
/// <summary>
/// 库移目标批次供应商批次
/// </summary>
public string TransferLibToSupplierBatch { get; set; }
/// <summary>
/// 库移目标批次到货时间
/// </summary>
public DateTime TransferLibToArriveDate { get; set; }
/// <summary>
/// 库移目标批次生产时间
/// </summary>
public DateTime TransferLibToProduceDate { get; set; }
/// <summary>
/// 库移目标批次过期时间
/// </summary>
public DateTime TransferLibToExpireDate { get; set; }
/// <summary>
/// 库移目标批次排序
/// </summary>
public string TransferLibToLot { get; set; }
/// <summary>
/// 库移目标库位
/// </summary>
public string TransferLibToLocationCode { get; set; }
/// <summary>
/// 库移目标库区
/// </summary>
public string TransferLibToLocationArea { get; set; }
/// <summary>
/// 库移目标库位组
/// </summary>
public string TransferLibToLocationGroup { get; set; }
/// <summary>
/// 库移目标ERP库位
/// </summary>
public string TransferLibToLocationErpCode { get; set; }
/// <summary>
/// 库移目标仓库
/// </summary>
public string TransferLibToWarehouseCode { get; set; }
/// <summary>
/// 库移目标数量
/// </summary>
public decimal TransferLibToQty { get; set; }
#endregion
#region 实际来源
/// <summary>
/// 实际目标托标签
/// </summary>
public string HandledFromContainerCode { get; set; }
/// <summary>
/// 实际箱标签
/// </summary>
public string HandledFromPackingCode { get; set; }
/// <summary>
/// 实际批次供应商批次
/// </summary>
public string HandledFromSupplierBatch { get; set; }
/// <summary>
/// 实际批次到货时间
/// </summary>
public DateTime HandledFromArriveDate { get; set; }
/// <summary>
/// 实际批次生产时间
/// </summary>
public DateTime HandledFromProduceDate { get; set; }
/// <summary>
/// 实际批次过期时间
/// </summary>
public DateTime HandledFromExpireDate { get; set; }
/// <summary>
/// 实际批次排序
/// </summary>
public string HandledFromLot { get; set; }
/// <summary>
/// 实际库位
/// </summary>
public string HandledFromLocationCode { get; set; }
/// <summary>
/// 实际库区
/// </summary>
public string HandledFromLocationArea { get; set; }
/// <summary>
/// 实际库位组
/// </summary>
public string HandledFromLocationGroup { get; set; }
/// <summary>
/// 实际ERP库位
/// </summary>
public string HandledFromLocationErpCode { get; set; }
/// <summary>
/// 实际仓库
/// </summary>
public string HandledFromWarehouseCode { get; set; }
/// <summary>
/// 实际数量
/// </summary>
public decimal HandledFromQty { get; set; }
#endregion
#region 实际目标
/// <summary>
/// 实际目标托标签
/// </summary>
public string HandledToContainerCode { get; set; }
/// <summary>
/// 实际箱标签
/// </summary>
public string HandledToPackingCode { get; set; }
/// <summary>
/// 实际批次供应商批次
/// </summary>
public string HandledToSupplierBatch { get; set; }
/// <summary>
/// 实际批次到货时间
/// </summary>
public DateTime HandledToArriveDate { get; set; }
/// <summary>
/// 实际批次生产时间
/// </summary>
public DateTime HandledToProduceDate { get; set; }
/// <summary>
/// 实际批次过期时间
/// </summary>
public DateTime HandledToExpireDate { get; set; }
/// <summary>
/// 实际批次排序
/// </summary>
public string HandledToLot { get; set; }
/// <summary>
/// 实际库位
/// </summary>
public string HandledToLocationCode { get; set; }
/// <summary>
/// 实际库区
/// </summary>
public string HandledToLocationArea { get; set; }
/// <summary>
/// 实际库位组
/// </summary>
public string HandledToLocationGroup { get; set; }
/// <summary>
/// 实际ERP库位
/// </summary>
public string HandledToLocationErpCode { get; set; }
/// <summary>
/// 实际仓库
/// </summary>
public string HandledToWarehouseCode { get; set; }
/// <summary>
/// 实际数量
/// </summary>
public decimal HandledToQty { get; set; }
#endregion
}

9
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobDTO.cs

@ -29,14 +29,7 @@ public class CoatingIssueJobDTO : SfsJobDTOBase<CoatingIssueJobDetailDTO>
/// </summary>
[Display(Name = "要货单号")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string MaterialRequestNumber { get; set; }
/// <summary>
/// 车间
/// </summary>
[Display(Name = "车间")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string Workshop { get; set; }
public string MaterialRequestNumber { get; set; }
/// <summary>
/// 使用在途库

512
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobDetailDTO.cs

@ -1,113 +1,519 @@
using System;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain;
using System.ComponentModel.DataAnnotations.Schema;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Application.Contracts;
namespace Win_in.Sfs.Wms.Store.Jobs.IssueJobs;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class CoatingIssueJobDetailDTO : SfsJobRecommendFromDetailDTOBase, IHasToLocation
public class CoatingIssueJobDetailDTO : SfsDetailDTOBase
{
#region 库存基础信息
/// <summary>
/// 请求库位
/// 物品代码
/// </summary>
[Display(Name = "请求库位")]
public string RequestLocationCode { get; set; }
public string ItemCode { get; set; }
/// <summary>
/// 物品名称
/// </summary>
public string ItemName { get; set; }
/// <summary>
/// 物品描述1
/// </summary>
public string ItemDesc1 { get; set; }
/// <summary>
/// 物品描述2
/// </summary>
public string ItemDesc2 { get; set; }
/// <summary>
/// 标包数量
/// </summary>
[Display(Name = "标包数量")]
[Column(TypeName = "decimal(18,6)")]
public decimal StdPackQty { get; set; }
/// <summary>
/// 库存状态
/// </summary>
public EnumInventoryStatus Status { get; set; }
/// <summary>
/// 到库位
/// 计量单
/// </summary>
[Display(Name = "到库位")]
public string ToLocationCode { get; set; }
public string Uom { get; set; }
#endregion
#region 请求信息
/// <summary>
/// 请求库位
/// </summary>
public string RequestLocationCode { get; set; }
/// <summary>
/// 到库区
/// 到库区
/// </summary>
[Display(Name = "到库区")]
public string ToLocationArea { get; set; }
public string RequestLocationArea { get; set; }
/// <summary>
/// 到库位组
/// 到库位组
/// </summary>
[Display(Name = "到库位组")]
public string ToLocationGroup { get; set; }
public string RequestLocationGroup { get; set; }
/// <summary>
/// 到ERP库位
/// 到ERP库位
/// </summary>
[Display(Name = "到ERP库位")]
public string ToLocationErpCode { get; set; }
public string RequestLocationErpCode { get; set; }
/// <summary>
/// 到仓库
/// 到仓库
/// </summary>
[Display(Name = "到仓库")]
public string ToWarehouseCode { get; set; }
public string RequestWarehouseCode { get; set; }
/// <summary>
/// 在途库库位
/// 在途库库位
/// </summary>
[Display(Name = "在途库库位")]
public string OnTheWayLocationCode { get; set; }
/// <summary>
/// 生产线
/// 生产线
/// </summary>
[Display(Name = "生产线")]
public string ProdLine { get; set; }
/// <summary>
/// 工作中心
/// 位置码
/// </summary>
public string PositionCode { get; set; }
/// <summary>
/// 推荐的类型
/// </summary>
public EnumRecommendType RecommendType { get; set; }
/// <summary>
/// 需求数量
/// </summary>
public decimal RequestQty { get; set; }
#endregion
#region 推荐来源
/// <summary>
/// 推荐来源托标签
/// </summary>
public string RecommendFromContainerCode { get; set; }
/// <summary>
/// 推荐来源箱标签
/// </summary>
public string RecommendFromPackingCode { get; set; }
/// <summary>
/// 推荐来源批次供应商批次
/// </summary>
public string RecommendFromSupplierBatch { get; set; }
/// <summary>
/// 推荐来源批次到货时间
/// </summary>
public DateTime RecommendFromArriveDate { get; set; }
/// <summary>
/// 推荐来源批次生产时间
/// </summary>
public DateTime RecommendFromProduceDate { get; set; }
/// <summary>
/// 推荐来源批次过期时间
/// </summary>
public DateTime RecommendFromExpireDate { get; set; }
/// <summary>
/// 推荐来源批次排序
/// </summary>
public string RecommendFromLot { get; set; }
/// <summary>
/// 推荐来源库位
/// </summary>
public string RecommendFromLocationCode { get; set; }
/// <summary>
/// 推荐来源库区
/// </summary>
public string RecommendFromLocationArea { get; set; }
/// <summary>
/// 推荐来源库位组
/// </summary>
public string RecommendFromLocationGroup { get; set; }
/// <summary>
/// 推荐来源ERP库位
/// </summary>
[Display(Name = "工作中心")]
public string WorkStation { get; set; }
public string RecommendFromLocationErpCode { get; set; }
/// <summary>
/// 过期时间
/// 推荐来源仓库
/// </summary>
[Display(Name = "过期时间")]
public DateTime ExpiredTime { get; set; }
public string RecommendFromWarehouseCode { get; set; }
/// <summary>
/// 工序
/// 推荐来源数量
/// </summary>
[Display(Name = "工序")]
public string Operation { get; set; }
public decimal RecommendFromQty { get; set; }
#endregion
#region 推荐目标
/// <summary>
/// 推荐目标托标签
/// </summary>
public string RecommendToContainerCode { get; set; }
/// <summary>
/// 推荐目标箱标签
/// </summary>
public string RecommendToPackingCode { get; set; }
/// <summary>
/// 推荐目标批次供应商批次
/// </summary>
public string RecommendToSupplierBatch { get; set; }
/// <summary>
/// 推荐目标批次到货时间
/// </summary>
public DateTime RecommendToArriveDate { get; set; }
/// <summary>
/// 推荐目标批次生产时间
/// </summary>
public DateTime RecommendToProduceDate { get; set; }
/// <summary>
/// 推荐目标批次过期时间
/// </summary>
public DateTime RecommendToExpireDate { get; set; }
/// <summary>
/// 推荐目标批次排序
/// </summary>
public string RecommendToLot { get; set; }
/// <summary>
/// 推荐目标库位
/// </summary>
public string RecommendToLocationCode { get; set; }
/// <summary>
/// 推荐目标库区
/// </summary>
public string RecommendToLocationArea { get; set; }
/// <summary>
/// 配送方式
/// 推荐目标库位组
/// </summary>
[Display(Name = "配送方式")]
public EnumDistributionType DistributionType { get; set; }
public string RecommendToLocationGroup { get; set; }
/// <summary>
/// 取整方式
/// 推荐目标ERP库位
/// </summary>
[Display(Name = "取整方式")]
public EnumTruncType TruncType { get; set; }
public string RecommendToLocationErpCode { get; set; }
/// <summary>
/// 取整后数量
/// 推荐目标仓库
/// </summary>
[Display(Name = "取整后数量")]
public decimal RoundedQty { get; set; }
public string RecommendToWarehouseCode { get; set; }
/// <summary>
/// 计划拆分规则
/// 推荐目标数量
/// </summary>
[Display(Name = "计划拆分规则")]
public EnumPlannedSplitRule PlannedSplitRule { get; set; }
public decimal RecommendToQty { get; set; }
#endregion
#region 库移来源
/// <summary>
/// 计划开始时间
/// 库移来源托标签
/// </summary>
[Display(Name = "计划开始时间")]
public DateTime PlanBeginTime { get; set; }
public string TransferLibFromContainerCode { get; set; }
/// <summary>
/// 每次配送数量
/// 库移来源箱标签
/// </summary>
[Display(Name = "每次配送数量")]
public decimal DeliveryQty { get; set; }
public string TransferLibFromPackingCode { get; set; }
/// <summary>
/// 库移来源批次供应商批次
/// </summary>
public string TransferLibFromSupplierBatch { get; set; }
/// <summary>
/// 库移来源批次到货时间
/// </summary>
public DateTime TransferLibFromArriveDate { get; set; }
/// <summary>
/// 库移来源批次生产时间
/// </summary>
public DateTime TransferLibFromProduceDate { get; set; }
/// <summary>
/// 库移来源批次过期时间
/// </summary>
public DateTime TransferLibFromExpireDate { get; set; }
/// <summary>
/// 库移来源批次排序
/// </summary>
public string TransferLibFromLot { get; set; }
/// <summary>
/// 库移来源库位
/// </summary>
public string TransferLibFromLocationCode { get; set; }
/// <summary>
/// 库移来源库区
/// </summary>
public string TransferLibFromLocationArea { get; set; }
/// <summary>
/// 库移来源库位组
/// </summary>
public string TransferLibFromLocationGroup { get; set; }
/// <summary>
/// 库移来源ERP库位
/// </summary>
public string TransferLibFromLocationErpCode { get; set; }
/// <summary>
/// 库移来源仓库
/// </summary>
public string TransferLibFromWarehouseCode { get; set; }
/// <summary>
/// 库移来源数量
/// </summary>
public decimal TransferLibFromQty { get; set; }
#endregion
#region 库移目标
/// <summary>
/// 库移目标托标签
/// </summary>
public string TransferLibToContainerCode { get; set; }
/// <summary>
/// 库移目标箱标签
/// </summary>
public string TransferLibToPackingCode { get; set; }
/// <summary>
/// 库移目标批次供应商批次
/// </summary>
public string TransferLibToSupplierBatch { get; set; }
/// <summary>
/// 库移目标批次到货时间
/// </summary>
public DateTime TransferLibToArriveDate { get; set; }
/// <summary>
/// 库移目标批次生产时间
/// </summary>
public DateTime TransferLibToProduceDate { get; set; }
/// <summary>
/// 库移目标批次过期时间
/// </summary>
public DateTime TransferLibToExpireDate { get; set; }
/// <summary>
/// 库移目标批次排序
/// </summary>
public string TransferLibToLot { get; set; }
/// <summary>
/// 库移目标库位
/// </summary>
public string TransferLibToLocationCode { get; set; }
/// <summary>
/// 库移目标库区
/// </summary>
public string TransferLibToLocationArea { get; set; }
/// <summary>
/// 库移目标库位组
/// </summary>
public string TransferLibToLocationGroup { get; set; }
/// <summary>
/// 库移目标ERP库位
/// </summary>
public string TransferLibToLocationErpCode { get; set; }
/// <summary>
/// 库移目标仓库
/// </summary>
public string TransferLibToWarehouseCode { get; set; }
/// <summary>
/// 库移目标数量
/// </summary>
public decimal TransferLibToQty { get; set; }
#endregion
#region 实际来源
/// <summary>
/// 实际目标托标签
/// </summary>
public string HandledFromContainerCode { get; set; }
/// <summary>
/// 实际箱标签
/// </summary>
public string HandledFromPackingCode { get; set; }
/// <summary>
/// 实际批次供应商批次
/// </summary>
public string HandledFromSupplierBatch { get; set; }
/// <summary>
/// 实际批次到货时间
/// </summary>
public DateTime HandledFromArriveDate { get; set; }
/// <summary>
/// 实际批次生产时间
/// </summary>
public DateTime HandledFromProduceDate { get; set; }
/// <summary>
/// 实际批次过期时间
/// </summary>
public DateTime HandledFromExpireDate { get; set; }
/// <summary>
/// 实际批次排序
/// </summary>
public string HandledFromLot { get; set; }
/// <summary>
/// 实际库位
/// </summary>
public string HandledFromLocationCode { get; set; }
/// <summary>
/// 实际库区
/// </summary>
public string HandledFromLocationArea { get; set; }
/// <summary>
/// 实际库位组
/// </summary>
public string HandledFromLocationGroup { get; set; }
/// <summary>
/// 实际ERP库位
/// </summary>
public string HandledFromLocationErpCode { get; set; }
/// <summary>
/// 实际仓库
/// </summary>
public string HandledFromWarehouseCode { get; set; }
/// <summary>
/// 实际数量
/// </summary>
public decimal HandledFromQty { get; set; }
#endregion
#region 实际目标
/// <summary>
/// 实际目标托标签
/// </summary>
public string HandledToContainerCode { get; set; }
/// <summary>
/// 实际箱标签
/// </summary>
public string HandledToPackingCode { get; set; }
/// <summary>
/// 实际批次供应商批次
/// </summary>
public string HandledToSupplierBatch { get; set; }
/// <summary>
/// 实际批次到货时间
/// </summary>
public DateTime HandledToArriveDate { get; set; }
/// <summary>
/// 实际批次生产时间
/// </summary>
public DateTime HandledToProduceDate { get; set; }
/// <summary>
/// 实际批次过期时间
/// </summary>
public DateTime HandledToExpireDate { get; set; }
/// <summary>
/// 实际批次排序
/// </summary>
public string HandledToLot { get; set; }
/// <summary>
/// 实际库位
/// </summary>
public string HandledToLocationCode { get; set; }
/// <summary>
/// 实际库区
/// </summary>
public string HandledToLocationArea { get; set; }
/// <summary>
/// 实际库位组
/// </summary>
public string HandledToLocationGroup { get; set; }
/// <summary>
/// 实际ERP库位
/// </summary>
public string HandledToLocationErpCode { get; set; }
/// <summary>
/// 实际仓库
/// </summary>
public string HandledToWarehouseCode { get; set; }
/// <summary>
/// 实际数量
/// </summary>
public decimal HandledToQty { get; set; }
#endregion
}

522
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobDetailInput.cs

@ -1,135 +1,519 @@
using System;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain;
using System.ComponentModel.DataAnnotations.Schema;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Application.Contracts;
namespace Win_in.Sfs.Wms.Store.Jobs.IssueJobs;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class CoatingIssueJobDetailInput : SfsJobRecommendFromDetailInputBase, IHasToLocation
public class CoatingIssueJobDetailInput : SfsDetailInputBase
{
#region 库存基础信息
/// <summary>
/// 请求库位
/// 物品代码
/// </summary>
[Display(Name = "请求库位")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string RequestLocationCode { get; set; }
public string ItemCode { get; set; }
/// <summary>
/// 物品名称
/// </summary>
public string ItemName { get; set; }
/// <summary>
/// 物品描述1
/// </summary>
public string ItemDesc1 { get; set; }
/// <summary>
/// 物品描述2
/// </summary>
public string ItemDesc2 { get; set; }
/// <summary>
/// 标包数量
/// </summary>
[Display(Name = "标包数量")]
[Column(TypeName = "decimal(18,6)")]
public decimal StdPackQty { get; set; }
/// <summary>
/// 库存状态
/// </summary>
public EnumInventoryStatus Status { get; set; }
/// <summary>
/// 到库位
/// 计量单
/// </summary>
[Display(Name = "到库位")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ToLocationCode { get; set; }
public string Uom { get; set; }
#endregion
#region 请求信息
/// <summary>
/// 请求库位
/// </summary>
public string RequestLocationCode { get; set; }
/// <summary>
/// 到库区
/// 到库区
/// </summary>
[Display(Name = "到库区")]
public string ToLocationArea { get; set; }
public string RequestLocationArea { get; set; }
/// <summary>
/// 到库位组
/// 到库位组
/// </summary>
[Display(Name = "到库位组")]
public string ToLocationGroup { get; set; }
public string RequestLocationGroup { get; set; }
/// <summary>
/// 到ERP库位
/// 到ERP库位
/// </summary>
[Display(Name = "到ERP库位")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ToLocationErpCode { get; set; }
public string RequestLocationErpCode { get; set; }
/// <summary>
/// 到仓库
/// 到仓库
/// </summary>
[Display(Name = "到仓库")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ToWarehouseCode { get; set; }
public string RequestWarehouseCode { get; set; }
/// <summary>
/// 在途库库位
/// 在途库库位
/// </summary>
[Display(Name = "在途库库位")]
public string OnTheWayLocationCode { get; set; }
/// <summary>
/// 生产线
/// 生产线
/// </summary>
[Display(Name = "生产线")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ProdLine { get; set; }
/// <summary>
/// 工作中心
/// 位置码
/// </summary>
public string PositionCode { get; set; }
/// <summary>
/// 推荐的类型
/// </summary>
[Display(Name = "工作中心")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string WorkStation { get; set; }
public EnumRecommendType RecommendType { get; set; }
/// <summary>
/// 过期时间
/// 需求数量
/// </summary>
[Display(Name = "过期时间")]
[Required(ErrorMessage = "{0}是必填项")]
public DateTime ExpiredTime { get; set; }
public decimal RequestQty { get; set; }
#endregion
#region 推荐来源
/// <summary>
/// 工序
/// 推荐来源托标签
/// </summary>
[Display(Name = "工序")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string Operation { get; set; }
public string RecommendFromContainerCode { get; set; }
/// <summary>
/// 配送方式
/// 推荐来源箱标签
/// </summary>
[Display(Name = "配送方式")]
public EnumDistributionType DistributionType { get; set; }
public string RecommendFromPackingCode { get; set; }
/// <summary>
/// 取整方式
/// 推荐来源批次供应商批次
/// </summary>
[Display(Name = "取整方式")]
public EnumTruncType TruncType { get; set; }
public string RecommendFromSupplierBatch { get; set; }
/// <summary>
/// 取整后数量
/// 推荐来源批次到货时间
/// </summary>
[Display(Name = "取整后数量")]
public decimal RoundedQty { get; set; }
public DateTime RecommendFromArriveDate { get; set; }
/// <summary>
/// 计划拆分规则
/// 推荐来源批次生产时间
/// </summary>
[Display(Name = "计划拆分规则")]
public EnumPlannedSplitRule PlannedSplitRule { get; set; }
public DateTime RecommendFromProduceDate { get; set; }
/// <summary>
/// 计划开始时间
/// 推荐来源批次过期时间
/// </summary>
[Display(Name = "计划开始时间")]
public DateTime PlanBeginTime { get; set; }
public DateTime RecommendFromExpireDate { get; set; }
/// <summary>
/// 每次配送数量
/// 推荐来源批次排序
/// </summary>
[Display(Name = "每次配送数量")]
public decimal DeliveryQty { get; set; }
public string RecommendFromLot { get; set; }
/// <summary>
/// 位置码
/// 推荐来源库
/// </summary>
public string PositionCode { get; set; }
public string RecommendFromLocationCode { get; set; }
/// <summary>
/// 推荐类型
/// 推荐来源库区
/// </summary>
public EnumRecommendType RecommendType { get; set; }
public string RecommendFromLocationArea { get; set; }
/// <summary>
/// 推荐来源库位组
/// </summary>
public string RecommendFromLocationGroup { get; set; }
/// <summary>
/// 推荐来源ERP库位
/// </summary>
public string RecommendFromLocationErpCode { get; set; }
/// <summary>
/// 推荐来源仓库
/// </summary>
public string RecommendFromWarehouseCode { get; set; }
/// <summary>
/// 推荐来源数量
/// </summary>
public decimal RecommendFromQty { get; set; }
#endregion
#region 推荐目标
/// <summary>
/// 推荐目标托标签
/// </summary>
public string RecommendToContainerCode { get; set; }
/// <summary>
/// 推荐目标箱标签
/// </summary>
public string RecommendToPackingCode { get; set; }
/// <summary>
/// 推荐目标批次供应商批次
/// </summary>
public string RecommendToSupplierBatch { get; set; }
/// <summary>
/// 推荐目标批次到货时间
/// </summary>
public DateTime RecommendToArriveDate { get; set; }
/// <summary>
/// 推荐目标批次生产时间
/// </summary>
public DateTime RecommendToProduceDate { get; set; }
/// <summary>
/// 推荐目标批次过期时间
/// </summary>
public DateTime RecommendToExpireDate { get; set; }
/// <summary>
/// 推荐目标批次排序
/// </summary>
public string RecommendToLot { get; set; }
/// <summary>
/// 推荐目标库位
/// </summary>
public string RecommendToLocationCode { get; set; }
/// <summary>
/// 推荐目标库区
/// </summary>
public string RecommendToLocationArea { get; set; }
/// <summary>
/// 推荐目标库位组
/// </summary>
public string RecommendToLocationGroup { get; set; }
/// <summary>
/// 推荐目标ERP库位
/// </summary>
public string RecommendToLocationErpCode { get; set; }
/// <summary>
/// 推荐目标仓库
/// </summary>
public string RecommendToWarehouseCode { get; set; }
/// <summary>
/// 推荐目标数量
/// </summary>
public decimal RecommendToQty { get; set; }
#endregion
#region 库移来源
/// <summary>
/// 库移来源托标签
/// </summary>
public string TransferLibFromContainerCode { get; set; }
/// <summary>
/// 库移来源箱标签
/// </summary>
public string TransferLibFromPackingCode { get; set; }
/// <summary>
/// 库移来源批次供应商批次
/// </summary>
public string TransferLibFromSupplierBatch { get; set; }
/// <summary>
/// 库移来源批次到货时间
/// </summary>
public DateTime TransferLibFromArriveDate { get; set; }
/// <summary>
/// 库移来源批次生产时间
/// </summary>
public DateTime TransferLibFromProduceDate { get; set; }
/// <summary>
/// 库移来源批次过期时间
/// </summary>
public DateTime TransferLibFromExpireDate { get; set; }
/// <summary>
/// 库移来源批次排序
/// </summary>
public string TransferLibFromLot { get; set; }
/// <summary>
/// 库移来源库位
/// </summary>
public string TransferLibFromLocationCode { get; set; }
/// <summary>
/// 库移来源库区
/// </summary>
public string TransferLibFromLocationArea { get; set; }
/// <summary>
/// 库移来源库位组
/// </summary>
public string TransferLibFromLocationGroup { get; set; }
/// <summary>
/// 库移来源ERP库位
/// </summary>
public string TransferLibFromLocationErpCode { get; set; }
/// <summary>
/// 库移来源仓库
/// </summary>
public string TransferLibFromWarehouseCode { get; set; }
/// <summary>
/// 库移来源数量
/// </summary>
public decimal TransferLibFromQty { get; set; }
#endregion
#region 库移目标
/// <summary>
/// 库移目标托标签
/// </summary>
public string TransferLibToContainerCode { get; set; }
/// <summary>
/// 库移目标箱标签
/// </summary>
public string TransferLibToPackingCode { get; set; }
/// <summary>
/// 库移目标批次供应商批次
/// </summary>
public string TransferLibToSupplierBatch { get; set; }
/// <summary>
/// 库移目标批次到货时间
/// </summary>
public DateTime TransferLibToArriveDate { get; set; }
/// <summary>
/// 库移目标批次生产时间
/// </summary>
public DateTime TransferLibToProduceDate { get; set; }
/// <summary>
/// 库移目标批次过期时间
/// </summary>
public DateTime TransferLibToExpireDate { get; set; }
/// <summary>
/// 库移目标批次排序
/// </summary>
public string TransferLibToLot { get; set; }
/// <summary>
/// 库移目标库位
/// </summary>
public string TransferLibToLocationCode { get; set; }
/// <summary>
/// 库移目标库区
/// </summary>
public string TransferLibToLocationArea { get; set; }
/// <summary>
/// 库移目标库位组
/// </summary>
public string TransferLibToLocationGroup { get; set; }
/// <summary>
/// 库移目标ERP库位
/// </summary>
public string TransferLibToLocationErpCode { get; set; }
/// <summary>
/// 库移目标仓库
/// </summary>
public string TransferLibToWarehouseCode { get; set; }
/// <summary>
/// 库移目标数量
/// </summary>
public decimal TransferLibToQty { get; set; }
#endregion
#region 实际来源
/// <summary>
/// 实际目标托标签
/// </summary>
public string HandledFromContainerCode { get; set; }
/// <summary>
/// 实际箱标签
/// </summary>
public string HandledFromPackingCode { get; set; }
/// <summary>
/// 实际批次供应商批次
/// </summary>
public string HandledFromSupplierBatch { get; set; }
/// <summary>
/// 实际批次到货时间
/// </summary>
public DateTime HandledFromArriveDate { get; set; }
/// <summary>
/// 实际批次生产时间
/// </summary>
public DateTime HandledFromProduceDate { get; set; }
/// <summary>
/// 实际批次过期时间
/// </summary>
public DateTime HandledFromExpireDate { get; set; }
/// <summary>
/// 实际批次排序
/// </summary>
public string HandledFromLot { get; set; }
/// <summary>
/// 实际库位
/// </summary>
public string HandledFromLocationCode { get; set; }
/// <summary>
/// 实际库区
/// </summary>
public string HandledFromLocationArea { get; set; }
/// <summary>
/// 实际库位组
/// </summary>
public string HandledFromLocationGroup { get; set; }
/// <summary>
/// 实际ERP库位
/// </summary>
public string HandledFromLocationErpCode { get; set; }
/// <summary>
/// 实际仓库
/// </summary>
public string HandledFromWarehouseCode { get; set; }
/// <summary>
/// 实际数量
/// </summary>
public decimal HandledFromQty { get; set; }
#endregion
#region 实际目标
/// <summary>
/// 实际目标托标签
/// </summary>
public string HandledToContainerCode { get; set; }
/// <summary>
/// 实际箱标签
/// </summary>
public string HandledToPackingCode { get; set; }
/// <summary>
/// 实际批次供应商批次
/// </summary>
public string HandledToSupplierBatch { get; set; }
/// <summary>
/// 实际批次到货时间
/// </summary>
public DateTime HandledToArriveDate { get; set; }
/// <summary>
/// 实际批次生产时间
/// </summary>
public DateTime HandledToProduceDate { get; set; }
/// <summary>
/// 实际批次过期时间
/// </summary>
public DateTime HandledToExpireDate { get; set; }
/// <summary>
/// 实际批次排序
/// </summary>
public string HandledToLot { get; set; }
/// <summary>
/// 实际库位
/// </summary>
public string HandledToLocationCode { get; set; }
/// <summary>
/// 实际库区
/// </summary>
public string HandledToLocationArea { get; set; }
/// <summary>
/// 实际库位组
/// </summary>
public string HandledToLocationGroup { get; set; }
/// <summary>
/// 实际ERP库位
/// </summary>
public string HandledToLocationErpCode { get; set; }
/// <summary>
/// 实际仓库
/// </summary>
public string HandledToWarehouseCode { get; set; }
/// <summary>
/// 实际数量
/// </summary>
public decimal HandledToQty { get; set; }
#endregion
}

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobPermissions.cs

@ -2,7 +2,7 @@ using Volo.Abp.Authorization.Permissions;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Jobs.IssueJobs;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public static class CoatingIssueJobPermissions
{

14
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/CoatingIssueJobs/ICoatingIssueJobAppService.cs

@ -9,19 +9,7 @@ namespace Win_in.Sfs.Wms.Store.Jobs.IssueJobs;
public interface ICoatingIssueJobAppService
: ISfsJobAppServiceBase<CoatingIssueJobDTO, SfsJobRequestInputBase, CoatingIssueJobCheckInput, CoatingIssueJobEditInput>
{
Task<List<CoatingIssueJobDTO>> CheckJobExistByItemCodeAndLocationCode(string itemCode, string locationCode);
Task CancelByMaterialRequestAsync(string materialNumber);
Task<PagedResultDto<CoatingIssueJobDTO>> GetListByTypeAsync(SfsJobRequestInputBase requestInput, string requestType,
bool includeDetails = false, CancellationToken cancellationToken = default);
Task CancelByMaterialRequestAsync(string coatingIssueNumber);
Task<List<CoatingIssueJobDTO>> GetByRequestNumberAsync(string requestNumber);
/// <summary>
/// 保存拆箱时涉及的明细修改
/// </summary>
/// <returns></returns>
Task<CoatingIssueJobDTO> SaveDetail_SplitPackingAsync(SplitPacking_UpdateJobDetailInput input);
}

7
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/AssembleNotes/DTOs/AssembleNoteDTO.cs

@ -13,13 +13,6 @@ public class AssembleNoteDTO : SfsStoreDTOBase<AssembleNoteDetailDTO>, IHasJobNu
[Display(Name = "任务ID")]
public string JobNumber { get; set; }
/// <summary>
/// 车间
/// </summary>
[Display(Name = "车间")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string Workshop { get; set; }
/// <summary>
/// 请求代码
/// </summary>

513
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/AssembleNotes/DTOs/AssembleNoteDetailDTO.cs

@ -1,42 +1,519 @@
using System;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain;
using System.ComponentModel.DataAnnotations.Schema;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class AssembleNoteDetailDTO : SfsStoreRecommendFromDetailWithFromToDTOBase
public class AssembleNoteDetailDTO : SfsDetailDTOBase
{
#region 库存基础信息
/// <summary>
/// 发料时间
/// 物品代码
/// </summary>
[Display(Name = "发料时间")]
public DateTime IssueTime { get; set; }
public string ItemCode { get; set; }
/// <summary>
/// 过期时间
/// 物品名称
/// </summary>
[Display(Name = "过期时间")]
public DateTime ExpiredTime { get; set; }
public string ItemName { get; set; }
/// <summary>
/// 生产线
/// 物品描述1
/// </summary>
[Display(Name = "生产线")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ProdLine { get; set; }
public string ItemDesc1 { get; set; }
/// <summary>
/// 物品描述2
/// </summary>
public string ItemDesc2 { get; set; }
/// <summary>
/// 标包数量
/// </summary>
[Display(Name = "标包数量")]
[Column(TypeName = "decimal(18,6)")]
public decimal StdPackQty { get; set; }
/// <summary>
/// 库存状态
/// </summary>
public EnumInventoryStatus Status { get; set; }
/// <summary>
/// 计量单位
/// </summary>
public string Uom { get; set; }
#endregion
#region 请求信息
/// <summary>
/// 请求库位
/// </summary>
public string RequestLocationCode { get; set; }
/// <summary>
/// 工作中心
/// 到库区
/// </summary>
[Display(Name = "工作中心")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string WorkStation { get; set; }
public string RequestLocationArea { get; set; }
/// <summary>
/// 在途库库位
/// 到库位组
/// </summary>
public string RequestLocationGroup { get; set; }
/// <summary>
/// 到ERP库位
/// </summary>
public string RequestLocationErpCode { get; set; }
/// <summary>
/// 到仓库
/// </summary>
public string RequestWarehouseCode { get; set; }
/// <summary>
/// 在途库库位
/// </summary>
[Display(Name = "在途库库位")]
public string OnTheWayLocationCode { get; set; }
/// <summary>
/// 生产线
/// </summary>
public string ProdLine { get; set; }
/// <summary>
/// 位置码
/// </summary>
public string PositionCode { get; set; }
/// <summary>
/// 推荐的类型
/// </summary>
public EnumRecommendType RecommendType { get; set; }
/// <summary>
/// 需求数量
/// </summary>
public decimal RequestQty { get; set; }
#endregion
#region 推荐来源
/// <summary>
/// 推荐来源托标签
/// </summary>
public string RecommendFromContainerCode { get; set; }
/// <summary>
/// 推荐来源箱标签
/// </summary>
public string RecommendFromPackingCode { get; set; }
/// <summary>
/// 推荐来源批次供应商批次
/// </summary>
public string RecommendFromSupplierBatch { get; set; }
/// <summary>
/// 推荐来源批次到货时间
/// </summary>
public DateTime RecommendFromArriveDate { get; set; }
/// <summary>
/// 推荐来源批次生产时间
/// </summary>
public DateTime RecommendFromProduceDate { get; set; }
/// <summary>
/// 推荐来源批次过期时间
/// </summary>
public DateTime RecommendFromExpireDate { get; set; }
/// <summary>
/// 推荐来源批次排序
/// </summary>
public string RecommendFromLot { get; set; }
/// <summary>
/// 推荐来源库位
/// </summary>
public string RecommendFromLocationCode { get; set; }
/// <summary>
/// 推荐来源库区
/// </summary>
public string RecommendFromLocationArea { get; set; }
/// <summary>
/// 推荐来源库位组
/// </summary>
public string RecommendFromLocationGroup { get; set; }
/// <summary>
/// 推荐来源ERP库位
/// </summary>
public string RecommendFromLocationErpCode { get; set; }
/// <summary>
/// 推荐来源仓库
/// </summary>
public string RecommendFromWarehouseCode { get; set; }
/// <summary>
/// 推荐来源数量
/// </summary>
public decimal RecommendFromQty { get; set; }
#endregion
#region 推荐目标
/// <summary>
/// 推荐目标托标签
/// </summary>
public string RecommendToContainerCode { get; set; }
/// <summary>
/// 推荐目标箱标签
/// </summary>
public string RecommendToPackingCode { get; set; }
/// <summary>
/// 推荐目标批次供应商批次
/// </summary>
public string RecommendToSupplierBatch { get; set; }
/// <summary>
/// 推荐目标批次到货时间
/// </summary>
public DateTime RecommendToArriveDate { get; set; }
/// <summary>
/// 推荐目标批次生产时间
/// </summary>
public DateTime RecommendToProduceDate { get; set; }
/// <summary>
/// 推荐目标批次过期时间
/// </summary>
public DateTime RecommendToExpireDate { get; set; }
/// <summary>
/// 推荐目标批次排序
/// </summary>
public string RecommendToLot { get; set; }
/// <summary>
/// 推荐目标库位
/// </summary>
public string RecommendToLocationCode { get; set; }
/// <summary>
/// 推荐目标库区
/// </summary>
public string RecommendToLocationArea { get; set; }
/// <summary>
/// 推荐目标库位组
/// </summary>
public string RecommendToLocationGroup { get; set; }
/// <summary>
/// 推荐目标ERP库位
/// </summary>
public string RecommendToLocationErpCode { get; set; }
/// <summary>
/// 推荐目标仓库
/// </summary>
public string RecommendToWarehouseCode { get; set; }
/// <summary>
/// 推荐目标数量
/// </summary>
public decimal RecommendToQty { get; set; }
#endregion
#region 库移来源
/// <summary>
/// 库移来源托标签
/// </summary>
public string TransferLibFromContainerCode { get; set; }
/// <summary>
/// 库移来源箱标签
/// </summary>
public string TransferLibFromPackingCode { get; set; }
/// <summary>
/// 库移来源批次供应商批次
/// </summary>
public string TransferLibFromSupplierBatch { get; set; }
/// <summary>
/// 库移来源批次到货时间
/// </summary>
public DateTime TransferLibFromArriveDate { get; set; }
/// <summary>
/// 库移来源批次生产时间
/// </summary>
public DateTime TransferLibFromProduceDate { get; set; }
/// <summary>
/// 库移来源批次过期时间
/// </summary>
public DateTime TransferLibFromExpireDate { get; set; }
/// <summary>
/// 库移来源批次排序
/// </summary>
public string TransferLibFromLot { get; set; }
/// <summary>
/// 库移来源库位
/// </summary>
public string TransferLibFromLocationCode { get; set; }
/// <summary>
/// 库移来源库区
/// </summary>
public string TransferLibFromLocationArea { get; set; }
/// <summary>
/// 库移来源库位组
/// </summary>
public string TransferLibFromLocationGroup { get; set; }
/// <summary>
/// 库移来源ERP库位
/// </summary>
public string TransferLibFromLocationErpCode { get; set; }
/// <summary>
/// 库移来源仓库
/// </summary>
public string TransferLibFromWarehouseCode { get; set; }
/// <summary>
/// 库移来源数量
/// </summary>
public decimal TransferLibFromQty { get; set; }
#endregion
#region 库移目标
/// <summary>
/// 库移目标托标签
/// </summary>
public string TransferLibToContainerCode { get; set; }
/// <summary>
/// 库移目标箱标签
/// </summary>
public string TransferLibToPackingCode { get; set; }
/// <summary>
/// 库移目标批次供应商批次
/// </summary>
public string TransferLibToSupplierBatch { get; set; }
/// <summary>
/// 库移目标批次到货时间
/// </summary>
public DateTime TransferLibToArriveDate { get; set; }
/// <summary>
/// 库移目标批次生产时间
/// </summary>
public DateTime TransferLibToProduceDate { get; set; }
/// <summary>
/// 库移目标批次过期时间
/// </summary>
public DateTime TransferLibToExpireDate { get; set; }
/// <summary>
/// 库移目标批次排序
/// </summary>
public string TransferLibToLot { get; set; }
/// <summary>
/// 库移目标库位
/// </summary>
public string TransferLibToLocationCode { get; set; }
/// <summary>
/// 库移目标库区
/// </summary>
public string TransferLibToLocationArea { get; set; }
/// <summary>
/// 库移目标库位组
/// </summary>
public string TransferLibToLocationGroup { get; set; }
/// <summary>
/// 库移目标ERP库位
/// </summary>
public string TransferLibToLocationErpCode { get; set; }
/// <summary>
/// 库移目标仓库
/// </summary>
public string TransferLibToWarehouseCode { get; set; }
/// <summary>
/// 库移目标数量
/// </summary>
public decimal TransferLibToQty { get; set; }
#endregion
#region 实际来源
/// <summary>
/// 实际目标托标签
/// </summary>
public string HandledFromContainerCode { get; set; }
/// <summary>
/// 实际箱标签
/// </summary>
public string HandledFromPackingCode { get; set; }
/// <summary>
/// 实际批次供应商批次
/// </summary>
public string HandledFromSupplierBatch { get; set; }
/// <summary>
/// 实际批次到货时间
/// </summary>
public DateTime HandledFromArriveDate { get; set; }
/// <summary>
/// 实际批次生产时间
/// </summary>
public DateTime HandledFromProduceDate { get; set; }
/// <summary>
/// 实际批次过期时间
/// </summary>
public DateTime HandledFromExpireDate { get; set; }
/// <summary>
/// 实际批次排序
/// </summary>
public string HandledFromLot { get; set; }
/// <summary>
/// 实际库位
/// </summary>
public string HandledFromLocationCode { get; set; }
/// <summary>
/// 实际库区
/// </summary>
public string HandledFromLocationArea { get; set; }
/// <summary>
/// 实际库位组
/// </summary>
public string HandledFromLocationGroup { get; set; }
/// <summary>
/// 实际ERP库位
/// </summary>
public string HandledFromLocationErpCode { get; set; }
/// <summary>
/// 实际仓库
/// </summary>
public string HandledFromWarehouseCode { get; set; }
/// <summary>
/// 实际数量
/// </summary>
public decimal HandledFromQty { get; set; }
#endregion
#region 实际目标
/// <summary>
/// 实际目标托标签
/// </summary>
public string HandledToContainerCode { get; set; }
/// <summary>
/// 实际箱标签
/// </summary>
public string HandledToPackingCode { get; set; }
/// <summary>
/// 实际批次供应商批次
/// </summary>
public string HandledToSupplierBatch { get; set; }
/// <summary>
/// 实际批次到货时间
/// </summary>
public DateTime HandledToArriveDate { get; set; }
/// <summary>
/// 实际批次生产时间
/// </summary>
public DateTime HandledToProduceDate { get; set; }
/// <summary>
/// 实际批次过期时间
/// </summary>
public DateTime HandledToExpireDate { get; set; }
/// <summary>
/// 实际批次排序
/// </summary>
public string HandledToLot { get; set; }
/// <summary>
/// 实际库位
/// </summary>
public string HandledToLocationCode { get; set; }
/// <summary>
/// 实际库区
/// </summary>
public string HandledToLocationArea { get; set; }
/// <summary>
/// 实际库位组
/// </summary>
public string HandledToLocationGroup { get; set; }
/// <summary>
/// 实际ERP库位
/// </summary>
public string HandledToLocationErpCode { get; set; }
/// <summary>
/// 实际仓库
/// </summary>
public string HandledToWarehouseCode { get; set; }
/// <summary>
/// 实际数量
/// </summary>
public decimal HandledToQty { get; set; }
#endregion
}

506
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/AssembleNotes/Inputs/AssembleNoteDetailInput.cs

@ -1,53 +1,519 @@
using System;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain;
using System.ComponentModel.DataAnnotations.Schema;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class AssembleNoteDetailInput : SfsStoreRecommendFromDetailWithFromToInputBase
public class AssembleNoteDetailInput : SfsDetailInputBase
{
#region 库存基础信息
/// <summary>
/// 发料时间
/// 物品代码
/// </summary>
[Display(Name = "发料时间")]
public DateTime IssueTime { get; set; }
public string ItemCode { get; set; }
/// <summary>
/// 过期时间
/// 物品名称
/// </summary>
[Display(Name = "过期时间")]
public DateTime ExpiredTime { get; set; }
public string ItemName { get; set; }
/// <summary>
/// 生产线
/// 物品描述1
/// </summary>
[Display(Name = "生产线")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ProdLine { get; set; }
public string ItemDesc1 { get; set; }
/// <summary>
/// 物品描述2
/// </summary>
public string ItemDesc2 { get; set; }
/// <summary>
/// 标包数量
/// </summary>
[Display(Name = "标包数量")]
[Column(TypeName = "decimal(18,6)")]
public decimal StdPackQty { get; set; }
/// <summary>
/// 库存状态
/// </summary>
public EnumInventoryStatus Status { get; set; }
/// <summary>
/// 计量单位
/// </summary>
public string Uom { get; set; }
#endregion
#region 请求信息
/// <summary>
/// 请求库位
/// </summary>
public string RequestLocationCode { get; set; }
/// <summary>
/// 工作中心
/// 到库区
/// </summary>
[Display(Name = "工作中心")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string WorkStation { get; set; }
public string RequestLocationArea { get; set; }
/// <summary>
/// 在途库库位
/// 到库位组
/// </summary>
public string RequestLocationGroup { get; set; }
/// <summary>
/// 到ERP库位
/// </summary>
public string RequestLocationErpCode { get; set; }
/// <summary>
/// 到仓库
/// </summary>
public string RequestWarehouseCode { get; set; }
/// <summary>
/// 在途库库位
/// </summary>
[Display(Name = "在途库库位")]
public string OnTheWayLocationCode { get; set; }
/// <summary>
/// 位置码
/// 生产线
/// </summary>
public string ProdLine { get; set; }
/// <summary>
/// 位置码
/// </summary>
public string PositionCode { get; set; }
/// <summary>
/// 推荐类型
/// 推荐类型
/// </summary>
public EnumRecommendType RecommendType { get; set; }
/// <summary>
/// 需求数量
/// </summary>
public decimal RequestQty { get; set; }
#endregion
#region 推荐来源
/// <summary>
/// 推荐来源托标签
/// </summary>
public string RecommendFromContainerCode { get; set; }
/// <summary>
/// 推荐来源箱标签
/// </summary>
public string RecommendFromPackingCode { get; set; }
/// <summary>
/// 推荐来源批次供应商批次
/// </summary>
public string RecommendFromSupplierBatch { get; set; }
/// <summary>
/// 推荐来源批次到货时间
/// </summary>
public DateTime RecommendFromArriveDate { get; set; }
/// <summary>
/// 推荐来源批次生产时间
/// </summary>
public DateTime RecommendFromProduceDate { get; set; }
/// <summary>
/// 推荐来源批次过期时间
/// </summary>
public DateTime RecommendFromExpireDate { get; set; }
/// <summary>
/// 推荐来源批次排序
/// </summary>
public string RecommendFromLot { get; set; }
/// <summary>
/// 推荐来源库位
/// </summary>
public string RecommendFromLocationCode { get; set; }
/// <summary>
/// 推荐来源库区
/// </summary>
public string RecommendFromLocationArea { get; set; }
/// <summary>
/// 推荐来源库位组
/// </summary>
public string RecommendFromLocationGroup { get; set; }
/// <summary>
/// 推荐来源ERP库位
/// </summary>
public string RecommendFromLocationErpCode { get; set; }
/// <summary>
/// 推荐来源仓库
/// </summary>
public string RecommendFromWarehouseCode { get; set; }
/// <summary>
/// 推荐来源数量
/// </summary>
public decimal RecommendFromQty { get; set; }
#endregion
#region 推荐目标
/// <summary>
/// 推荐目标托标签
/// </summary>
public string RecommendToContainerCode { get; set; }
/// <summary>
/// 推荐目标箱标签
/// </summary>
public string RecommendToPackingCode { get; set; }
/// <summary>
/// 推荐目标批次供应商批次
/// </summary>
public string RecommendToSupplierBatch { get; set; }
/// <summary>
/// 推荐目标批次到货时间
/// </summary>
public DateTime RecommendToArriveDate { get; set; }
/// <summary>
/// 推荐目标批次生产时间
/// </summary>
public DateTime RecommendToProduceDate { get; set; }
/// <summary>
/// 推荐目标批次过期时间
/// </summary>
public DateTime RecommendToExpireDate { get; set; }
/// <summary>
/// 推荐目标批次排序
/// </summary>
public string RecommendToLot { get; set; }
/// <summary>
/// 推荐目标库位
/// </summary>
public string RecommendToLocationCode { get; set; }
/// <summary>
/// 推荐目标库区
/// </summary>
public string RecommendToLocationArea { get; set; }
/// <summary>
/// 推荐目标库位组
/// </summary>
public string RecommendToLocationGroup { get; set; }
/// <summary>
/// 推荐目标ERP库位
/// </summary>
public string RecommendToLocationErpCode { get; set; }
/// <summary>
/// 推荐目标仓库
/// </summary>
public string RecommendToWarehouseCode { get; set; }
/// <summary>
/// 推荐目标数量
/// </summary>
public decimal RecommendToQty { get; set; }
#endregion
#region 库移来源
/// <summary>
/// 库移来源托标签
/// </summary>
public string TransferLibFromContainerCode { get; set; }
/// <summary>
/// 库移来源箱标签
/// </summary>
public string TransferLibFromPackingCode { get; set; }
/// <summary>
/// 库移来源批次供应商批次
/// </summary>
public string TransferLibFromSupplierBatch { get; set; }
/// <summary>
/// 库移来源批次到货时间
/// </summary>
public DateTime TransferLibFromArriveDate { get; set; }
/// <summary>
/// 库移来源批次生产时间
/// </summary>
public DateTime TransferLibFromProduceDate { get; set; }
/// <summary>
/// 库移来源批次过期时间
/// </summary>
public DateTime TransferLibFromExpireDate { get; set; }
/// <summary>
/// 库移来源批次排序
/// </summary>
public string TransferLibFromLot { get; set; }
/// <summary>
/// 库移来源库位
/// </summary>
public string TransferLibFromLocationCode { get; set; }
/// <summary>
/// 库移来源库区
/// </summary>
public string TransferLibFromLocationArea { get; set; }
/// <summary>
/// 库移来源库位组
/// </summary>
public string TransferLibFromLocationGroup { get; set; }
/// <summary>
/// 库移来源ERP库位
/// </summary>
public string TransferLibFromLocationErpCode { get; set; }
/// <summary>
/// 库移来源仓库
/// </summary>
public string TransferLibFromWarehouseCode { get; set; }
/// <summary>
/// 库移来源数量
/// </summary>
public decimal TransferLibFromQty { get; set; }
#endregion
#region 库移目标
/// <summary>
/// 库移目标托标签
/// </summary>
public string TransferLibToContainerCode { get; set; }
/// <summary>
/// 库移目标箱标签
/// </summary>
public string TransferLibToPackingCode { get; set; }
/// <summary>
/// 库移目标批次供应商批次
/// </summary>
public string TransferLibToSupplierBatch { get; set; }
/// <summary>
/// 库移目标批次到货时间
/// </summary>
public DateTime TransferLibToArriveDate { get; set; }
/// <summary>
/// 库移目标批次生产时间
/// </summary>
public DateTime TransferLibToProduceDate { get; set; }
/// <summary>
/// 库移目标批次过期时间
/// </summary>
public DateTime TransferLibToExpireDate { get; set; }
/// <summary>
/// 库移目标批次排序
/// </summary>
public string TransferLibToLot { get; set; }
/// <summary>
/// 库移目标库位
/// </summary>
public string TransferLibToLocationCode { get; set; }
/// <summary>
/// 库移目标库区
/// </summary>
public string TransferLibToLocationArea { get; set; }
/// <summary>
/// 库移目标库位组
/// </summary>
public string TransferLibToLocationGroup { get; set; }
/// <summary>
/// 库移目标ERP库位
/// </summary>
public string TransferLibToLocationErpCode { get; set; }
/// <summary>
/// 库移目标仓库
/// </summary>
public string TransferLibToWarehouseCode { get; set; }
/// <summary>
/// 库移目标数量
/// </summary>
public decimal TransferLibToQty { get; set; }
#endregion
#region 实际来源
/// <summary>
/// 实际目标托标签
/// </summary>
public string HandledFromContainerCode { get; set; }
/// <summary>
/// 实际箱标签
/// </summary>
public string HandledFromPackingCode { get; set; }
/// <summary>
/// 实际批次供应商批次
/// </summary>
public string HandledFromSupplierBatch { get; set; }
/// <summary>
/// 实际批次到货时间
/// </summary>
public DateTime HandledFromArriveDate { get; set; }
/// <summary>
/// 实际批次生产时间
/// </summary>
public DateTime HandledFromProduceDate { get; set; }
/// <summary>
/// 实际批次过期时间
/// </summary>
public DateTime HandledFromExpireDate { get; set; }
/// <summary>
/// 实际批次排序
/// </summary>
public string HandledFromLot { get; set; }
/// <summary>
/// 实际库位
/// </summary>
public string HandledFromLocationCode { get; set; }
/// <summary>
/// 实际库区
/// </summary>
public string HandledFromLocationArea { get; set; }
/// <summary>
/// 实际库位组
/// </summary>
public string HandledFromLocationGroup { get; set; }
/// <summary>
/// 实际ERP库位
/// </summary>
public string HandledFromLocationErpCode { get; set; }
/// <summary>
/// 实际仓库
/// </summary>
public string HandledFromWarehouseCode { get; set; }
/// <summary>
/// 实际数量
/// </summary>
public decimal HandledFromQty { get; set; }
#endregion
#region 实际目标
/// <summary>
/// 实际目标托标签
/// </summary>
public string HandledToContainerCode { get; set; }
/// <summary>
/// 实际箱标签
/// </summary>
public string HandledToPackingCode { get; set; }
/// <summary>
/// 实际批次供应商批次
/// </summary>
public string HandledToSupplierBatch { get; set; }
/// <summary>
/// 实际批次到货时间
/// </summary>
public DateTime HandledToArriveDate { get; set; }
/// <summary>
/// 实际批次生产时间
/// </summary>
public DateTime HandledToProduceDate { get; set; }
/// <summary>
/// 实际批次过期时间
/// </summary>
public DateTime HandledToExpireDate { get; set; }
/// <summary>
/// 实际批次排序
/// </summary>
public string HandledToLot { get; set; }
/// <summary>
/// 实际库位
/// </summary>
public string HandledToLocationCode { get; set; }
/// <summary>
/// 实际库区
/// </summary>
public string HandledToLocationArea { get; set; }
/// <summary>
/// 实际库位组
/// </summary>
public string HandledToLocationGroup { get; set; }
/// <summary>
/// 实际ERP库位
/// </summary>
public string HandledToLocationErpCode { get; set; }
/// <summary>
/// 实际仓库
/// </summary>
public string HandledToWarehouseCode { get; set; }
/// <summary>
/// 实际数量
/// </summary>
public decimal HandledToQty { get; set; }
#endregion
}

9
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/AssembleNotes/Inputs/AssembleNoteEditInput.cs

@ -26,14 +26,7 @@ public class AssembleNoteEditInput : SfsStoreCreateOrUpdateInputBase
/// </summary>
[Display(Name = "任务ID")]
[Required(ErrorMessage = "{0}是必填项")]
public string JobNumber { get; set; }
/// <summary>
/// 车间
/// </summary>
[Display(Name = "车间")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string Workshop { get; set; }
public string JobNumber { get; set; }
/// <summary>
/// 明细列表

9
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/CoatingIssueNotes/CoatingIssueNoteDTO.cs

@ -7,20 +7,12 @@ namespace Win_in.Sfs.Wms.Store.Notes.IssueNotes;
public class CoatingIssueNoteDTO : SfsStoreDTOBase<CoatingIssueNoteDetailDTO>, IHasJobNumber, IHasRequestNumber
{
/// <summary>
/// 任务ID
/// </summary>
[Display(Name = "任务ID")]
public string JobNumber { get; set; }
/// <summary>
/// 车间
/// </summary>
[Display(Name = "车间")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string Workshop { get; set; }
/// <summary>
/// 请求代码
/// </summary>
@ -51,5 +43,4 @@ public class CoatingIssueNoteDTO : SfsStoreDTOBase<CoatingIssueNoteDetailDTO>, I
/// </summary>
[Display(Name = "确认时间")]
public DateTime? ConfirmTime { get; set; }
}

516
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/CoatingIssueNotes/CoatingIssueNoteDetailDTO.cs

@ -1,43 +1,519 @@
using System;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using System.ComponentModel.DataAnnotations.Schema;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Notes.IssueNotes;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class CoatingIssueNoteDetailDTO : SfsStoreRecommendFromDetailWithFromToDTOBase
public class CoatingIssueNoteDetailDTO : SfsDetailDTOBase
{
#region 库存基础信息
/// <summary>
/// 发料时间
/// 物品代码
/// </summary>
[Display(Name = "发料时间")]
public DateTime IssueTime { get; set; }
public string ItemCode { get; set; }
/// <summary>
/// 过期时间
/// 物品名称
/// </summary>
[Display(Name = "过期时间")]
public DateTime ExpiredTime { get; set; }
public string ItemName { get; set; }
/// <summary>
/// 生产线
/// 物品描述1
/// </summary>
[Display(Name = "生产线")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ProdLine { get; set; }
public string ItemDesc1 { get; set; }
/// <summary>
/// 物品描述2
/// </summary>
public string ItemDesc2 { get; set; }
/// <summary>
/// 标包数量
/// </summary>
[Display(Name = "标包数量")]
[Column(TypeName = "decimal(18,6)")]
public decimal StdPackQty { get; set; }
/// <summary>
/// 库存状态
/// </summary>
public EnumInventoryStatus Status { get; set; }
/// <summary>
/// 计量单位
/// </summary>
public string Uom { get; set; }
#endregion
#region 请求信息
/// <summary>
/// 请求库位
/// </summary>
public string RequestLocationCode { get; set; }
/// <summary>
/// 工作中心
/// 到库区
/// </summary>
[Display(Name = "工作中心")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string WorkStation { get; set; }
public string RequestLocationArea { get; set; }
/// <summary>
/// 在途库库位
/// 到库位组
/// </summary>
public string RequestLocationGroup { get; set; }
/// <summary>
/// 到ERP库位
/// </summary>
public string RequestLocationErpCode { get; set; }
/// <summary>
/// 到仓库
/// </summary>
public string RequestWarehouseCode { get; set; }
/// <summary>
/// 在途库库位
/// </summary>
[Display(Name = "在途库库位")]
public string OnTheWayLocationCode { get; set; }
/// <summary>
/// 生产线
/// </summary>
public string ProdLine { get; set; }
/// <summary>
/// 位置码
/// </summary>
public string PositionCode { get; set; }
/// <summary>
/// 推荐的类型
/// </summary>
public EnumRecommendType RecommendType { get; set; }
/// <summary>
/// 需求数量
/// </summary>
public decimal RequestQty { get; set; }
#endregion
#region 推荐来源
/// <summary>
/// 推荐来源托标签
/// </summary>
public string RecommendFromContainerCode { get; set; }
/// <summary>
/// 推荐来源箱标签
/// </summary>
public string RecommendFromPackingCode { get; set; }
/// <summary>
/// 推荐来源批次供应商批次
/// </summary>
public string RecommendFromSupplierBatch { get; set; }
/// <summary>
/// 推荐来源批次到货时间
/// </summary>
public DateTime RecommendFromArriveDate { get; set; }
/// <summary>
/// 推荐来源批次生产时间
/// </summary>
public DateTime RecommendFromProduceDate { get; set; }
/// <summary>
/// 推荐来源批次过期时间
/// </summary>
public DateTime RecommendFromExpireDate { get; set; }
/// <summary>
/// 推荐来源批次排序
/// </summary>
public string RecommendFromLot { get; set; }
/// <summary>
/// 推荐来源库位
/// </summary>
public string RecommendFromLocationCode { get; set; }
/// <summary>
/// 推荐来源库区
/// </summary>
public string RecommendFromLocationArea { get; set; }
/// <summary>
/// 推荐来源库位组
/// </summary>
public string RecommendFromLocationGroup { get; set; }
/// <summary>
/// 推荐来源ERP库位
/// </summary>
public string RecommendFromLocationErpCode { get; set; }
/// <summary>
/// 推荐来源仓库
/// </summary>
public string RecommendFromWarehouseCode { get; set; }
/// <summary>
/// 推荐来源数量
/// </summary>
public decimal RecommendFromQty { get; set; }
#endregion
#region 推荐目标
/// <summary>
/// 推荐目标托标签
/// </summary>
public string RecommendToContainerCode { get; set; }
/// <summary>
/// 推荐目标箱标签
/// </summary>
public string RecommendToPackingCode { get; set; }
/// <summary>
/// 推荐目标批次供应商批次
/// </summary>
public string RecommendToSupplierBatch { get; set; }
/// <summary>
/// 推荐目标批次到货时间
/// </summary>
public DateTime RecommendToArriveDate { get; set; }
/// <summary>
/// 推荐目标批次生产时间
/// </summary>
public DateTime RecommendToProduceDate { get; set; }
/// <summary>
/// 推荐目标批次过期时间
/// </summary>
public DateTime RecommendToExpireDate { get; set; }
/// <summary>
/// 推荐目标批次排序
/// </summary>
public string RecommendToLot { get; set; }
/// <summary>
/// 推荐目标库位
/// </summary>
public string RecommendToLocationCode { get; set; }
/// <summary>
/// 推荐目标库区
/// </summary>
public string RecommendToLocationArea { get; set; }
/// <summary>
/// 推荐目标库位组
/// </summary>
public string RecommendToLocationGroup { get; set; }
/// <summary>
/// 推荐目标ERP库位
/// </summary>
public string RecommendToLocationErpCode { get; set; }
/// <summary>
/// 推荐目标仓库
/// </summary>
public string RecommendToWarehouseCode { get; set; }
/// <summary>
/// 推荐目标数量
/// </summary>
public decimal RecommendToQty { get; set; }
#endregion
#region 库移来源
/// <summary>
/// 库移来源托标签
/// </summary>
public string TransferLibFromContainerCode { get; set; }
/// <summary>
/// 库移来源箱标签
/// </summary>
public string TransferLibFromPackingCode { get; set; }
/// <summary>
/// 库移来源批次供应商批次
/// </summary>
public string TransferLibFromSupplierBatch { get; set; }
/// <summary>
/// 库移来源批次到货时间
/// </summary>
public DateTime TransferLibFromArriveDate { get; set; }
/// <summary>
/// 库移来源批次生产时间
/// </summary>
public DateTime TransferLibFromProduceDate { get; set; }
/// <summary>
/// 库移来源批次过期时间
/// </summary>
public DateTime TransferLibFromExpireDate { get; set; }
/// <summary>
/// 库移来源批次排序
/// </summary>
public string TransferLibFromLot { get; set; }
/// <summary>
/// 库移来源库位
/// </summary>
public string TransferLibFromLocationCode { get; set; }
/// <summary>
/// 库移来源库区
/// </summary>
public string TransferLibFromLocationArea { get; set; }
/// <summary>
/// 库移来源库位组
/// </summary>
public string TransferLibFromLocationGroup { get; set; }
/// <summary>
/// 库移来源ERP库位
/// </summary>
public string TransferLibFromLocationErpCode { get; set; }
/// <summary>
/// 库移来源仓库
/// </summary>
public string TransferLibFromWarehouseCode { get; set; }
/// <summary>
/// 库移来源数量
/// </summary>
public decimal TransferLibFromQty { get; set; }
#endregion
#region 库移目标
/// <summary>
/// 库移目标托标签
/// </summary>
public string TransferLibToContainerCode { get; set; }
/// <summary>
/// 库移目标箱标签
/// </summary>
public string TransferLibToPackingCode { get; set; }
/// <summary>
/// 库移目标批次供应商批次
/// </summary>
public string TransferLibToSupplierBatch { get; set; }
/// <summary>
/// 库移目标批次到货时间
/// </summary>
public DateTime TransferLibToArriveDate { get; set; }
/// <summary>
/// 库移目标批次生产时间
/// </summary>
public DateTime TransferLibToProduceDate { get; set; }
/// <summary>
/// 库移目标批次过期时间
/// </summary>
public DateTime TransferLibToExpireDate { get; set; }
/// <summary>
/// 库移目标批次排序
/// </summary>
public string TransferLibToLot { get; set; }
/// <summary>
/// 库移目标库位
/// </summary>
public string TransferLibToLocationCode { get; set; }
/// <summary>
/// 库移目标库区
/// </summary>
public string TransferLibToLocationArea { get; set; }
/// <summary>
/// 库移目标库位组
/// </summary>
public string TransferLibToLocationGroup { get; set; }
/// <summary>
/// 库移目标ERP库位
/// </summary>
public string TransferLibToLocationErpCode { get; set; }
/// <summary>
/// 库移目标仓库
/// </summary>
public string TransferLibToWarehouseCode { get; set; }
/// <summary>
/// 库移目标数量
/// </summary>
public decimal TransferLibToQty { get; set; }
#endregion
#region 实际来源
/// <summary>
/// 实际目标托标签
/// </summary>
public string HandledFromContainerCode { get; set; }
/// <summary>
/// 实际箱标签
/// </summary>
public string HandledFromPackingCode { get; set; }
/// <summary>
/// 实际批次供应商批次
/// </summary>
public string HandledFromSupplierBatch { get; set; }
/// <summary>
/// 实际批次到货时间
/// </summary>
public DateTime HandledFromArriveDate { get; set; }
/// <summary>
/// 实际批次生产时间
/// </summary>
public DateTime HandledFromProduceDate { get; set; }
/// <summary>
/// 实际批次过期时间
/// </summary>
public DateTime HandledFromExpireDate { get; set; }
/// <summary>
/// 实际批次排序
/// </summary>
public string HandledFromLot { get; set; }
/// <summary>
/// 实际库位
/// </summary>
public string HandledFromLocationCode { get; set; }
/// <summary>
/// 实际库区
/// </summary>
public string HandledFromLocationArea { get; set; }
/// <summary>
/// 实际库位组
/// </summary>
public string HandledFromLocationGroup { get; set; }
/// <summary>
/// 实际ERP库位
/// </summary>
public string HandledFromLocationErpCode { get; set; }
/// <summary>
/// 实际仓库
/// </summary>
public string HandledFromWarehouseCode { get; set; }
/// <summary>
/// 实际数量
/// </summary>
public decimal HandledFromQty { get; set; }
#endregion
#region 实际目标
/// <summary>
/// 实际目标托标签
/// </summary>
public string HandledToContainerCode { get; set; }
/// <summary>
/// 实际箱标签
/// </summary>
public string HandledToPackingCode { get; set; }
/// <summary>
/// 实际批次供应商批次
/// </summary>
public string HandledToSupplierBatch { get; set; }
/// <summary>
/// 实际批次到货时间
/// </summary>
public DateTime HandledToArriveDate { get; set; }
/// <summary>
/// 实际批次生产时间
/// </summary>
public DateTime HandledToProduceDate { get; set; }
/// <summary>
/// 实际批次过期时间
/// </summary>
public DateTime HandledToExpireDate { get; set; }
/// <summary>
/// 实际批次排序
/// </summary>
public string HandledToLot { get; set; }
/// <summary>
/// 实际库位
/// </summary>
public string HandledToLocationCode { get; set; }
/// <summary>
/// 实际库区
/// </summary>
public string HandledToLocationArea { get; set; }
/// <summary>
/// 实际库位组
/// </summary>
public string HandledToLocationGroup { get; set; }
/// <summary>
/// 实际ERP库位
/// </summary>
public string HandledToLocationErpCode { get; set; }
/// <summary>
/// 实际仓库
/// </summary>
public string HandledToWarehouseCode { get; set; }
/// <summary>
/// 实际数量
/// </summary>
public decimal HandledToQty { get; set; }
#endregion
}

509
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/CoatingIssueNotes/CoatingIssueNoteDetailInput.cs

@ -1,54 +1,519 @@
using System;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain;
using System.ComponentModel.DataAnnotations.Schema;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Application.Contracts;
namespace Win_in.Sfs.Wms.Store.Notes.IssueNotes;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class CoatingIssueNoteDetailInput : SfsStoreRecommendFromDetailWithFromToInputBase
public class CoatingIssueNoteDetailInput : SfsDetailInputBase
{
#region 库存基础信息
/// <summary>
/// 发料时间
/// 物品代码
/// </summary>
[Display(Name = "发料时间")]
public DateTime IssueTime { get; set; }
public string ItemCode { get; set; }
/// <summary>
/// 过期时间
/// 物品名称
/// </summary>
[Display(Name = "过期时间")]
public DateTime ExpiredTime { get; set; }
public string ItemName { get; set; }
/// <summary>
/// 生产线
/// 物品描述1
/// </summary>
[Display(Name = "生产线")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ProdLine { get; set; }
public string ItemDesc1 { get; set; }
/// <summary>
/// 物品描述2
/// </summary>
public string ItemDesc2 { get; set; }
/// <summary>
/// 标包数量
/// </summary>
[Display(Name = "标包数量")]
[Column(TypeName = "decimal(18,6)")]
public decimal StdPackQty { get; set; }
/// <summary>
/// 库存状态
/// </summary>
public EnumInventoryStatus Status { get; set; }
/// <summary>
/// 计量单位
/// </summary>
public string Uom { get; set; }
#endregion
#region 请求信息
/// <summary>
/// 请求库位
/// </summary>
public string RequestLocationCode { get; set; }
/// <summary>
/// 工作中心
/// 到库区
/// </summary>
[Display(Name = "工作中心")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string WorkStation { get; set; }
public string RequestLocationArea { get; set; }
/// <summary>
/// 在途库库位
/// 到库位组
/// </summary>
public string RequestLocationGroup { get; set; }
/// <summary>
/// 到ERP库位
/// </summary>
public string RequestLocationErpCode { get; set; }
/// <summary>
/// 到仓库
/// </summary>
public string RequestWarehouseCode { get; set; }
/// <summary>
/// 在途库库位
/// </summary>
[Display(Name = "在途库库位")]
public string OnTheWayLocationCode { get; set; }
/// <summary>
/// 位置码
/// 生产线
/// </summary>
public string ProdLine { get; set; }
/// <summary>
/// 位置码
/// </summary>
public string PositionCode { get; set; }
/// <summary>
/// 推荐类型
/// 推荐类型
/// </summary>
public EnumRecommendType RecommendType { get; set; }
/// <summary>
/// 需求数量
/// </summary>
public decimal RequestQty { get; set; }
#endregion
#region 推荐来源
/// <summary>
/// 推荐来源托标签
/// </summary>
public string RecommendFromContainerCode { get; set; }
/// <summary>
/// 推荐来源箱标签
/// </summary>
public string RecommendFromPackingCode { get; set; }
/// <summary>
/// 推荐来源批次供应商批次
/// </summary>
public string RecommendFromSupplierBatch { get; set; }
/// <summary>
/// 推荐来源批次到货时间
/// </summary>
public DateTime RecommendFromArriveDate { get; set; }
/// <summary>
/// 推荐来源批次生产时间
/// </summary>
public DateTime RecommendFromProduceDate { get; set; }
/// <summary>
/// 推荐来源批次过期时间
/// </summary>
public DateTime RecommendFromExpireDate { get; set; }
/// <summary>
/// 推荐来源批次排序
/// </summary>
public string RecommendFromLot { get; set; }
/// <summary>
/// 推荐来源库位
/// </summary>
public string RecommendFromLocationCode { get; set; }
/// <summary>
/// 推荐来源库区
/// </summary>
public string RecommendFromLocationArea { get; set; }
/// <summary>
/// 推荐来源库位组
/// </summary>
public string RecommendFromLocationGroup { get; set; }
/// <summary>
/// 推荐来源ERP库位
/// </summary>
public string RecommendFromLocationErpCode { get; set; }
/// <summary>
/// 推荐来源仓库
/// </summary>
public string RecommendFromWarehouseCode { get; set; }
/// <summary>
/// 推荐来源数量
/// </summary>
public decimal RecommendFromQty { get; set; }
#endregion
#region 推荐目标
/// <summary>
/// 推荐目标托标签
/// </summary>
public string RecommendToContainerCode { get; set; }
/// <summary>
/// 推荐目标箱标签
/// </summary>
public string RecommendToPackingCode { get; set; }
/// <summary>
/// 推荐目标批次供应商批次
/// </summary>
public string RecommendToSupplierBatch { get; set; }
/// <summary>
/// 推荐目标批次到货时间
/// </summary>
public DateTime RecommendToArriveDate { get; set; }
/// <summary>
/// 推荐目标批次生产时间
/// </summary>
public DateTime RecommendToProduceDate { get; set; }
/// <summary>
/// 推荐目标批次过期时间
/// </summary>
public DateTime RecommendToExpireDate { get; set; }
/// <summary>
/// 推荐目标批次排序
/// </summary>
public string RecommendToLot { get; set; }
/// <summary>
/// 推荐目标库位
/// </summary>
public string RecommendToLocationCode { get; set; }
/// <summary>
/// 推荐目标库区
/// </summary>
public string RecommendToLocationArea { get; set; }
/// <summary>
/// 推荐目标库位组
/// </summary>
public string RecommendToLocationGroup { get; set; }
/// <summary>
/// 推荐目标ERP库位
/// </summary>
public string RecommendToLocationErpCode { get; set; }
/// <summary>
/// 推荐目标仓库
/// </summary>
public string RecommendToWarehouseCode { get; set; }
/// <summary>
/// 推荐目标数量
/// </summary>
public decimal RecommendToQty { get; set; }
#endregion
#region 库移来源
/// <summary>
/// 库移来源托标签
/// </summary>
public string TransferLibFromContainerCode { get; set; }
/// <summary>
/// 库移来源箱标签
/// </summary>
public string TransferLibFromPackingCode { get; set; }
/// <summary>
/// 库移来源批次供应商批次
/// </summary>
public string TransferLibFromSupplierBatch { get; set; }
/// <summary>
/// 库移来源批次到货时间
/// </summary>
public DateTime TransferLibFromArriveDate { get; set; }
/// <summary>
/// 库移来源批次生产时间
/// </summary>
public DateTime TransferLibFromProduceDate { get; set; }
/// <summary>
/// 库移来源批次过期时间
/// </summary>
public DateTime TransferLibFromExpireDate { get; set; }
/// <summary>
/// 库移来源批次排序
/// </summary>
public string TransferLibFromLot { get; set; }
/// <summary>
/// 库移来源库位
/// </summary>
public string TransferLibFromLocationCode { get; set; }
/// <summary>
/// 库移来源库区
/// </summary>
public string TransferLibFromLocationArea { get; set; }
/// <summary>
/// 库移来源库位组
/// </summary>
public string TransferLibFromLocationGroup { get; set; }
/// <summary>
/// 库移来源ERP库位
/// </summary>
public string TransferLibFromLocationErpCode { get; set; }
/// <summary>
/// 库移来源仓库
/// </summary>
public string TransferLibFromWarehouseCode { get; set; }
/// <summary>
/// 库移来源数量
/// </summary>
public decimal TransferLibFromQty { get; set; }
#endregion
#region 库移目标
/// <summary>
/// 库移目标托标签
/// </summary>
public string TransferLibToContainerCode { get; set; }
/// <summary>
/// 库移目标箱标签
/// </summary>
public string TransferLibToPackingCode { get; set; }
/// <summary>
/// 库移目标批次供应商批次
/// </summary>
public string TransferLibToSupplierBatch { get; set; }
/// <summary>
/// 库移目标批次到货时间
/// </summary>
public DateTime TransferLibToArriveDate { get; set; }
/// <summary>
/// 库移目标批次生产时间
/// </summary>
public DateTime TransferLibToProduceDate { get; set; }
/// <summary>
/// 库移目标批次过期时间
/// </summary>
public DateTime TransferLibToExpireDate { get; set; }
/// <summary>
/// 库移目标批次排序
/// </summary>
public string TransferLibToLot { get; set; }
/// <summary>
/// 库移目标库位
/// </summary>
public string TransferLibToLocationCode { get; set; }
/// <summary>
/// 库移目标库区
/// </summary>
public string TransferLibToLocationArea { get; set; }
/// <summary>
/// 库移目标库位组
/// </summary>
public string TransferLibToLocationGroup { get; set; }
/// <summary>
/// 库移目标ERP库位
/// </summary>
public string TransferLibToLocationErpCode { get; set; }
/// <summary>
/// 库移目标仓库
/// </summary>
public string TransferLibToWarehouseCode { get; set; }
/// <summary>
/// 库移目标数量
/// </summary>
public decimal TransferLibToQty { get; set; }
#endregion
#region 实际来源
/// <summary>
/// 实际目标托标签
/// </summary>
public string HandledFromContainerCode { get; set; }
/// <summary>
/// 实际箱标签
/// </summary>
public string HandledFromPackingCode { get; set; }
/// <summary>
/// 实际批次供应商批次
/// </summary>
public string HandledFromSupplierBatch { get; set; }
/// <summary>
/// 实际批次到货时间
/// </summary>
public DateTime HandledFromArriveDate { get; set; }
/// <summary>
/// 实际批次生产时间
/// </summary>
public DateTime HandledFromProduceDate { get; set; }
/// <summary>
/// 实际批次过期时间
/// </summary>
public DateTime HandledFromExpireDate { get; set; }
/// <summary>
/// 实际批次排序
/// </summary>
public string HandledFromLot { get; set; }
/// <summary>
/// 实际库位
/// </summary>
public string HandledFromLocationCode { get; set; }
/// <summary>
/// 实际库区
/// </summary>
public string HandledFromLocationArea { get; set; }
/// <summary>
/// 实际库位组
/// </summary>
public string HandledFromLocationGroup { get; set; }
/// <summary>
/// 实际ERP库位
/// </summary>
public string HandledFromLocationErpCode { get; set; }
/// <summary>
/// 实际仓库
/// </summary>
public string HandledFromWarehouseCode { get; set; }
/// <summary>
/// 实际数量
/// </summary>
public decimal HandledFromQty { get; set; }
#endregion
#region 实际目标
/// <summary>
/// 实际目标托标签
/// </summary>
public string HandledToContainerCode { get; set; }
/// <summary>
/// 实际箱标签
/// </summary>
public string HandledToPackingCode { get; set; }
/// <summary>
/// 实际批次供应商批次
/// </summary>
public string HandledToSupplierBatch { get; set; }
/// <summary>
/// 实际批次到货时间
/// </summary>
public DateTime HandledToArriveDate { get; set; }
/// <summary>
/// 实际批次生产时间
/// </summary>
public DateTime HandledToProduceDate { get; set; }
/// <summary>
/// 实际批次过期时间
/// </summary>
public DateTime HandledToExpireDate { get; set; }
/// <summary>
/// 实际批次排序
/// </summary>
public string HandledToLot { get; set; }
/// <summary>
/// 实际库位
/// </summary>
public string HandledToLocationCode { get; set; }
/// <summary>
/// 实际库区
/// </summary>
public string HandledToLocationArea { get; set; }
/// <summary>
/// 实际库位组
/// </summary>
public string HandledToLocationGroup { get; set; }
/// <summary>
/// 实际ERP库位
/// </summary>
public string HandledToLocationErpCode { get; set; }
/// <summary>
/// 实际仓库
/// </summary>
public string HandledToWarehouseCode { get; set; }
/// <summary>
/// 实际数量
/// </summary>
public decimal HandledToQty { get; set; }
#endregion
}

9
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/CoatingIssueNotes/CoatingIssueNoteEditInput.cs

@ -27,14 +27,7 @@ public class CoatingIssueNoteEditInput : SfsStoreCreateOrUpdateInputBase
/// </summary>
[Display(Name = "任务ID")]
[Required(ErrorMessage = "{0}是必填项")]
public string JobNumber { get; set; }
/// <summary>
/// 车间
/// </summary>
[Display(Name = "车间")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string Workshop { get; set; }
public string JobNumber { get; set; }
/// <summary>
/// 明细列表

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Permissions/StorePermissionDefinitionProvider.cs

@ -100,6 +100,7 @@ public class StorePermissionDefinitionProvider : PermissionDefinitionProvider
storeGroup.AddPutawayJobPermission();
storeGroup.AddIssueJobPermission();
storeGroup.AddInjectionJobPermission();
storeGroup.AddCoatingIssueJobPermission();
storeGroup.AddAssembleJobPermission();
storeGroup.AddThirdLocationJobPermission();
storeGroup.AddContainerJobPermission();

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/MaterialRequests/AssembleRequests/Inputs/AssembleRequestEditInput.cs

@ -24,7 +24,7 @@ public class AssembleIssueRequestsEditInput : SfsStoreRequestCreateOrUpdateInput
/// 明细列表
/// </summary>
[Display(Name = "明细列表")]
public List<InjectionRequestDetailInput> Details { get; set; } = new List<InjectionRequestDetailInput>();
public List<AssembleRequestDetailInput> Details { get; set; } = new List<AssembleRequestDetailInput>();
#endregion
#region Create

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/MaterialRequests/CoatingMaterialRequests/CoatingMaterialRequestEditInput.cs

@ -25,7 +25,7 @@ public class CoatingMaterialRequestEditInput : SfsStoreRequestCreateOrUpdateInpu
/// 明细列表
/// </summary>
[Display(Name = "明细列表")]
public List<InjectionRequestDetailInput> Details { get; set; } = new List<InjectionRequestDetailInput>();
public List<CoatingMaterialRequestDetailInput> Details { get; set; } = new List<CoatingMaterialRequestDetailInput>();
#endregion
#region Create

209
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleJobs/AssembleJobAppService.cs

@ -1,69 +1,122 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Linq.Expressions;
using System.Threading;
using System.Threading.Tasks;
using Castle.Components.DictionaryAdapter;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.ObjectMapping;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Basedata.Domain.Shared;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Domain.Shared;
using Win_in.Sfs.Wms.Store.Notes;
namespace Win_in.Sfs.Wms.Store.Application;
[Authorize]
[Route($"{StoreConsts.RootPath}assemble-job")]
public class AssembleJobAppService
: SfsJobAppServiceBase<AssembleJob, AssembleJobDetail, AssembleJobDTO, SfsJobRequestInputBase, AssembleJobCheckInput, AssembleJobEditInput>,
IAssembleJobAppService
: SfsJobAppServiceBase<AssembleJob, AssembleJobDetail, AssembleJobDTO, SfsJobRequestInputBase,
AssembleJobCheckInput, AssembleJobEditInput>,
IAssembleJobAppService, ITransferLibCallback
{
private readonly IAssembleJobManager _assembleJobManager;
private readonly ILocationAppService _locationAppService;
private readonly ITransferLibJobAppService _transferLibJobAppService;
public AssembleJobAppService(
IAssembleJobRepository repository, IAssembleJobManager assembleJobManager
) : base(repository, assembleJobManager)
IAssembleJobRepository repository, IAssembleJobManager assembleJobManager,
ILocationAppService locationAppService, ITransferLibJobAppService transferLibJobAppService) : base(repository, assembleJobManager)
{
_assembleJobManager = assembleJobManager;
_locationAppService = locationAppService;
_transferLibJobAppService = transferLibJobAppService;
}
[HttpPost("add-many")]
public override async Task<List<AssembleJobDTO>> CreateManyAsync(List<AssembleJobEditInput> inputs)
{
foreach (var input in inputs)
{
await CheckMinRowAndSetStatusAsync(input).ConfigureAwait(false);
}
return await base.CreateManyAsync(inputs).ConfigureAwait(false);
}
[HttpPost("")]
public override async Task<AssembleJobDTO> CreateAsync(AssembleJobEditInput input)
{
await CheckMinRowAndSetStatusAsync(input).ConfigureAwait(false);
return await base.CreateAsync(input).ConfigureAwait(false);
}
/// <summary>
/// 根据物品和库位 检查是否存在发料任务
/// 判断是不是在最底层 如果不是则把状态变更为等待 并把库移推荐的From和To赋值
/// </summary>
/// <param name="itemCode"></param>
/// <param name="locationCode"></param>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[Authorize]
[HttpGet("check-job-exist")]
public virtual async Task<List<AssembleJobDTO>> CheckJobExistByItemCodeAndLocationCode(string itemCode,
string locationCode)
private async Task CheckMinRowAndSetStatusAsync(AssembleJobEditInput input)
{
var entities = await _repository.GetListAsync(c =>
c.Details.Any(p =>
(p.ItemCode == itemCode && p.RecommendFromLocationCode == locationCode) ||
(p.ItemCode == itemCode && p.ToLocationCode == locationCode))
&& (c.JobStatus == EnumJobStatus.Open || c.JobStatus == EnumJobStatus.Doing), true).ConfigureAwait(false);
var dtos = ObjectMapper.Map<List<AssembleJob>, List<AssembleJobDTO>>(entities);
return dtos;
var jobDetailInputdetail = input.Details.FirstOrDefault();
var loctionDto = await _locationAppService.GetByCodeAsync(jobDetailInputdetail.RecommendFromLocationCode)
.ConfigureAwait(false);
if (loctionDto.RowCode != 1)
{
input.JobStatus = EnumJobStatus.Wait;
jobDetailInputdetail.TransferLibFromArriveDate = jobDetailInputdetail.RecommendFromArriveDate;
jobDetailInputdetail.TransferLibFromContainerCode = jobDetailInputdetail.RecommendFromContainerCode;
jobDetailInputdetail.TransferLibFromExpireDate = jobDetailInputdetail.RecommendFromExpireDate;
jobDetailInputdetail.TransferLibFromLocationArea = jobDetailInputdetail.RecommendFromLocationArea;
jobDetailInputdetail.TransferLibFromLocationCode = jobDetailInputdetail.RecommendFromLocationCode;
jobDetailInputdetail.TransferLibFromLocationErpCode = jobDetailInputdetail.RecommendFromLocationErpCode;
jobDetailInputdetail.TransferLibFromLocationGroup = jobDetailInputdetail.RecommendFromLocationGroup;
jobDetailInputdetail.TransferLibFromLot = jobDetailInputdetail.RecommendFromLot;
jobDetailInputdetail.TransferLibFromPackingCode = jobDetailInputdetail.RecommendFromPackingCode;
jobDetailInputdetail.TransferLibFromProduceDate = jobDetailInputdetail.RecommendFromProduceDate;
jobDetailInputdetail.TransferLibFromQty = jobDetailInputdetail.RecommendFromQty;
jobDetailInputdetail.TransferLibFromSupplierBatch = jobDetailInputdetail.RecommendFromSupplierBatch;
jobDetailInputdetail.TransferLibFromWarehouseCode = jobDetailInputdetail.RecommendFromWarehouseCode;
jobDetailInputdetail.TransferLibToArriveDate = jobDetailInputdetail.RecommendToArriveDate;
jobDetailInputdetail.TransferLibToContainerCode = jobDetailInputdetail.RecommendToContainerCode;
jobDetailInputdetail.TransferLibToExpireDate = jobDetailInputdetail.RecommendToExpireDate;
jobDetailInputdetail.TransferLibToLocationArea = jobDetailInputdetail.RecommendToLocationArea;
jobDetailInputdetail.TransferLibToLocationCode = jobDetailInputdetail.RecommendToLocationCode;
jobDetailInputdetail.TransferLibToLocationErpCode = jobDetailInputdetail.RecommendToLocationErpCode;
jobDetailInputdetail.TransferLibToLocationGroup = jobDetailInputdetail.RecommendToLocationGroup;
jobDetailInputdetail.TransferLibToLot = jobDetailInputdetail.RecommendToLot;
jobDetailInputdetail.TransferLibToPackingCode = jobDetailInputdetail.RecommendToPackingCode;
jobDetailInputdetail.TransferLibToProduceDate = jobDetailInputdetail.RecommendToProduceDate;
jobDetailInputdetail.TransferLibToQty = jobDetailInputdetail.RecommendToQty;
jobDetailInputdetail.TransferLibToSupplierBatch = jobDetailInputdetail.RecommendToSupplierBatch;
jobDetailInputdetail.TransferLibToWarehouseCode = jobDetailInputdetail.RecommendToWarehouseCode;
}
}
[HttpPost("cancel-by-request/{assembleNumber}")]
[HttpPost("cancel-by-request/{assembleRequestNumber}")]
public virtual async Task CancelByMaterialRequestAsync(string assembleNumber)
{
var entities = await _repository.GetListAsync(p => p.AssembleIssueRequestsNumber == assembleNumber).ConfigureAwait(false);
var entities = await _repository.GetListAsync(p => p.AssembleRequestNumber == assembleNumber)
.ConfigureAwait(false);
foreach (var entity in entities)
{
await _assembleJobManager.CancelAsync(entity).ConfigureAwait(false);
}
}
[HttpPost("invalid")]
public override async Task CancelAsync(Guid id)
{
@ -71,74 +124,70 @@ public class AssembleJobAppService
if (assembleJob == null)
{
throw new UserFriendlyException($"未找到ID为 {id} 的任务");
}
}
await _assembleJobManager.CancelAsync(assembleJob).ConfigureAwait(false);
}
[HttpPost("by-request-number/{requestNumber}")]
public virtual async Task<List<AssembleJobDTO>> GetByRequestNumberAsync(string requestNumber)
{
var entitys = await _repository.GetListAsync(p => p.AssembleRequestNumber == requestNumber)
.ConfigureAwait(false);
return ObjectMapper.Map<List<AssembleJob>, List<AssembleJobDTO>>(entitys);
}
/// <summary>
/// 根据叫料请求类型获取发料任务
/// </summary>
/// <param name="requestInput"></param>
/// <param name="requestType">
/// 叫料请求类型:
/// 人工拉动:Issue_Manual;
/// 线边拉动:Issue_WIP;
/// </param>
/// <param name="includeDetails"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
[HttpPost("by-type/{requestType}")]
public virtual async Task<PagedResultDto<AssembleJobDTO>> GetListByTypeAsync(SfsJobRequestInputBase requestInput,
string requestType, bool includeDetails = false, CancellationToken cancellationToken = default)
[HttpPost("Do-Call-Back")]
public async Task DoTransferLibCallbackAsync(TransferLibJobDTO dto)
{
Expression<Func<AssembleJob, bool>> expression = p => p.RequestType == requestType;
if (requestInput.Condition.Filters?.Count > 0)
{
expression = expression.And(requestInput.Condition.Filters.ToLambda<AssembleJob>());
}
var job = await _repository.FindAsync(p => p.Number == dto.JobNumber).ConfigureAwait(false);
return await GetPagedListAsync(expression, requestInput.SkipCount, requestInput.MaxResultCount,
requestInput.Sorting, includeDetails, cancellationToken).ConfigureAwait(false);
//todo 等云峰写好换成真实的
var transferLibJobDto = await _transferLibJobAppService.GetByNumberAsync("AAA").ConfigureAwait(false);
var transferLibNote = new TransferLibNote();
}
var transferLibNoteDetail = transferLibNote.Details.First();
[HttpPost("by-request-number/{requestNumber}")]
public virtual async Task<List<AssembleJobDTO>> GetByRequestNumberAsync(string requestNumber)
{
var entitys = await _repository.GetListAsync(p => p.AssembleIssueRequestsNumber == requestNumber).ConfigureAwait(false);
return ObjectMapper.Map<List<AssembleJob>, List<AssembleJobDTO>>(entitys);
var jobDetail = job.Details.First();
job.JobStatus = EnumJobStatus.Open;
jobDetail.TransferLibFromArriveDate = transferLibNoteDetail.HandledFromArriveDate;
jobDetail.TransferLibFromContainerCode = transferLibNoteDetail.HandledFromContainerCode;
jobDetail.TransferLibFromExpireDate = transferLibNoteDetail.HandledFromExpireDate;
jobDetail.TransferLibFromLocationArea = transferLibNoteDetail.HandledFromLocationArea;
jobDetail.TransferLibFromLocationCode = transferLibNoteDetail.HandledFromLocationCode;
jobDetail.TransferLibFromLocationErpCode = transferLibNoteDetail.HandledFromLocationErpCode;
jobDetail.TransferLibFromLocationGroup = transferLibNoteDetail.HandledFromLocationGroup;
jobDetail.TransferLibFromLot = transferLibNoteDetail.HandledFromLot;
jobDetail.TransferLibFromPackingCode = transferLibNoteDetail.HandledFromPackingCode;
jobDetail.TransferLibFromProduceDate = transferLibNoteDetail.HandledFromProduceDate;
jobDetail.TransferLibFromQty = transferLibNoteDetail.HandledFromQty;
jobDetail.TransferLibFromSupplierBatch = transferLibNoteDetail.HandledFromSupplierBatch;
jobDetail.TransferLibFromWarehouseCode = transferLibNoteDetail.HandledFromWarehouseCode;
jobDetail.TransferLibToArriveDate = transferLibNoteDetail.HandledToArriveDate;
jobDetail.TransferLibToContainerCode = transferLibNoteDetail.HandledToContainerCode;
jobDetail.TransferLibToExpireDate = transferLibNoteDetail.HandledToExpireDate;
jobDetail.TransferLibToLocationArea = transferLibNoteDetail.HandledToLocationArea;
jobDetail.TransferLibToLocationCode = transferLibNoteDetail.HandledToLocationCode;
jobDetail.TransferLibToLocationErpCode = transferLibNoteDetail.HandledToLocationErpCode;
jobDetail.TransferLibToLocationGroup = transferLibNoteDetail.HandledToLocationGroup;
jobDetail.TransferLibToLot = transferLibNoteDetail.HandledToLot;
jobDetail.TransferLibToPackingCode = transferLibNoteDetail.HandledToPackingCode;
jobDetail.TransferLibToProduceDate = transferLibNoteDetail.HandledToProduceDate;
jobDetail.TransferLibToQty = transferLibNoteDetail.HandledToQty;
jobDetail.TransferLibToSupplierBatch = transferLibNoteDetail.HandledToSupplierBatch;
jobDetail.TransferLibToWarehouseCode = transferLibNoteDetail.HandledToWarehouseCode;
await _repository.UpdateAsync(job).ConfigureAwait(false);
return;
}
/// <summary>
/// 保存拆箱时涉及的明细修改
/// </summary>
/// <returns></returns>
[HttpPost("save-detail-split-packing")]
public virtual async Task<AssembleJobDTO> SaveDetail_SplitPackingAsync(SplitPacking_UpdateJobDetailInput input)
[HttpPost("test")]
public virtual async Task Test()
{
var job = await _repository.FindAsync(p => p.Number == input.Number).ConfigureAwait(false);
AssembleJobDetail detail = job.Details.FirstOrDefault(p => p.RecommendPackingCode == input.FromPackingCode ); /*&& p.HandledQty == input.FromQty*/
if (detail == null)
{
//throw new UserFriendlyException($"根据HandledPackingCode={input.FromPackingCode}取AssembleJobDetail表为空!");
throw new UserFriendlyException($"根据RecommendPackingCode={input.FromPackingCode}取AssembleJobDetail表为空!");
}
//插入目标箱
var newDetail = CommonHelper.CloneObj(detail);
newDetail.SetId(GuidGenerator.Create());
newDetail.RecommendPackingCode = input.ToPackingCode;
newDetail.RecommendQty = input.ToQty;
newDetail.HandledPackingCode = detail.HandledPackingCode.HasValue() ? input.ToPackingCode : null; //源实际实际箱码有值,则新记录实际箱码有值
newDetail.HandledQty = detail.HandledQty > 0 ? input.ToQty : 0;
//newDetail.CreationTime = CommonHelper.CurTime;
job.Details.Add(newDetail);
//修改源箱
detail.RecommendQty = input.FromQty - input.ToQty;
detail.HandledQty = detail.HandledQty > 0 ? input.FromQty - input.ToQty : 0;
var entity = await _repository.UpdateAsync(job).ConfigureAwait(false);
var ret = ObjectMapper.Map<AssembleJob, AssembleJobDTO>(entity);
return ret;
Console.WriteLine("FuAZCZXVZXVXZVZ");
await Task.CompletedTask;
}
}

277
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAppService.cs

@ -1,195 +1,194 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Linq.Expressions;
using System.Threading;
using System.Threading.Tasks;
using Castle.Components.DictionaryAdapter;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.ObjectMapping;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Basedata.Domain.Shared;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Application;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Domain.Shared;
using Win_in.Sfs.Wms.Store.Jobs.IssueJobs;
using Win_in.Sfs.Wms.Store.Notes;
namespace Win_in.Sfs.Wms.Store.Jobs.IssueJobs;
namespace Win_in.Sfs.Wms.Store.Application;
[Authorize]
[Route($"{StoreConsts.RootPath}coatingissue-job")]
[Route($"{StoreConsts.RootPath}coating-issue-job")]
public class CoatingIssueJobAppService
: SfsJobAppServiceBase<CoatingIssueJob, CoatingIssueJobDetail, CoatingIssueJobDTO, SfsJobRequestInputBase, CoatingIssueJobCheckInput, CoatingIssueJobEditInput>,
ICoatingIssueJobAppService
: SfsJobAppServiceBase<CoatingIssueJob, CoatingIssueJobDetail, CoatingIssueJobDTO, SfsJobRequestInputBase,
CoatingIssueJobCheckInput, CoatingIssueJobEditInput>,
ICoatingIssueJobAppService, ITransferLibCallback
{
private readonly ICoatingIssueJobManager _CoatingIssueJobManager;
private readonly ICoatingIssueJobManager _coatingIssueJobManager;
private readonly ILocationAppService _locationAppService;
private readonly ITransferLibJobAppService _transferLibJobAppService;
public CoatingIssueJobAppService(
ICoatingIssueJobRepository repository, ICoatingIssueJobManager CoatingIssueJobManager
) : base(repository, CoatingIssueJobManager)
ICoatingIssueJobRepository repository, ICoatingIssueJobManager coatingIssueJobManager,
ILocationAppService locationAppService, ITransferLibJobAppService transferLibJobAppService) : base(repository, coatingIssueJobManager)
{
_CoatingIssueJobManager = CoatingIssueJobManager;
_coatingIssueJobManager = coatingIssueJobManager;
_locationAppService = locationAppService;
_transferLibJobAppService = transferLibJobAppService;
}
[HttpPost("add-many")]
public override async Task<List<CoatingIssueJobDTO>> CreateManyAsync(List<CoatingIssueJobEditInput> inputs)
{
foreach (var input in inputs)
{
await CheckMinRowAndSetStatusAsync(input).ConfigureAwait(false);
}
return await base.CreateManyAsync(inputs).ConfigureAwait(false);
}
[HttpPost("")]
public override async Task<CoatingIssueJobDTO> CreateAsync(CoatingIssueJobEditInput input)
{
await CheckMinRowAndSetStatusAsync(input).ConfigureAwait(false);
return await base.CreateAsync(input).ConfigureAwait(false);
}
/// <summary>
/// 根据物品和库位 检查是否存在发料任务
/// 判断是不是在最底层 如果不是则把状态变更为等待 并把库移推荐的From和To赋值
/// </summary>
/// <param name="itemCode"></param>
/// <param name="locationCode"></param>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[Authorize]
[HttpGet("check-job-exist")]
public virtual async Task<List<CoatingIssueJobDTO>> CheckJobExistByItemCodeAndLocationCode(string itemCode,
string locationCode)
private async Task CheckMinRowAndSetStatusAsync(CoatingIssueJobEditInput input)
{
var entities = await _repository.GetListAsync(c =>
c.Details.Any(p =>
p.ItemCode == itemCode && p.RecommendFromLocationCode == locationCode ||
p.ItemCode == itemCode && p.ToLocationCode == locationCode)
&& (c.JobStatus == EnumJobStatus.Open || c.JobStatus == EnumJobStatus.Doing), true).ConfigureAwait(false);
var dtos = ObjectMapper.Map<List<CoatingIssueJob>, List<CoatingIssueJobDTO>>(entities);
return dtos;
var jobDetailInputdetail = input.Details.FirstOrDefault();
var loctionDto = await _locationAppService.GetByCodeAsync(jobDetailInputdetail.RecommendFromLocationCode)
.ConfigureAwait(false);
if (loctionDto.RowCode != 1)
{
input.JobStatus = EnumJobStatus.Wait;
jobDetailInputdetail.TransferLibFromArriveDate = jobDetailInputdetail.RecommendFromArriveDate;
jobDetailInputdetail.TransferLibFromContainerCode = jobDetailInputdetail.RecommendFromContainerCode;
jobDetailInputdetail.TransferLibFromExpireDate = jobDetailInputdetail.RecommendFromExpireDate;
jobDetailInputdetail.TransferLibFromLocationArea = jobDetailInputdetail.RecommendFromLocationArea;
jobDetailInputdetail.TransferLibFromLocationCode = jobDetailInputdetail.RecommendFromLocationCode;
jobDetailInputdetail.TransferLibFromLocationErpCode = jobDetailInputdetail.RecommendFromLocationErpCode;
jobDetailInputdetail.TransferLibFromLocationGroup = jobDetailInputdetail.RecommendFromLocationGroup;
jobDetailInputdetail.TransferLibFromLot = jobDetailInputdetail.RecommendFromLot;
jobDetailInputdetail.TransferLibFromPackingCode = jobDetailInputdetail.RecommendFromPackingCode;
jobDetailInputdetail.TransferLibFromProduceDate = jobDetailInputdetail.RecommendFromProduceDate;
jobDetailInputdetail.TransferLibFromQty = jobDetailInputdetail.RecommendFromQty;
jobDetailInputdetail.TransferLibFromSupplierBatch = jobDetailInputdetail.RecommendFromSupplierBatch;
jobDetailInputdetail.TransferLibFromWarehouseCode = jobDetailInputdetail.RecommendFromWarehouseCode;
jobDetailInputdetail.TransferLibToArriveDate = jobDetailInputdetail.RecommendToArriveDate;
jobDetailInputdetail.TransferLibToContainerCode = jobDetailInputdetail.RecommendToContainerCode;
jobDetailInputdetail.TransferLibToExpireDate = jobDetailInputdetail.RecommendToExpireDate;
jobDetailInputdetail.TransferLibToLocationArea = jobDetailInputdetail.RecommendToLocationArea;
jobDetailInputdetail.TransferLibToLocationCode = jobDetailInputdetail.RecommendToLocationCode;
jobDetailInputdetail.TransferLibToLocationErpCode = jobDetailInputdetail.RecommendToLocationErpCode;
jobDetailInputdetail.TransferLibToLocationGroup = jobDetailInputdetail.RecommendToLocationGroup;
jobDetailInputdetail.TransferLibToLot = jobDetailInputdetail.RecommendToLot;
jobDetailInputdetail.TransferLibToPackingCode = jobDetailInputdetail.RecommendToPackingCode;
jobDetailInputdetail.TransferLibToProduceDate = jobDetailInputdetail.RecommendToProduceDate;
jobDetailInputdetail.TransferLibToQty = jobDetailInputdetail.RecommendToQty;
jobDetailInputdetail.TransferLibToSupplierBatch = jobDetailInputdetail.RecommendToSupplierBatch;
jobDetailInputdetail.TransferLibToWarehouseCode = jobDetailInputdetail.RecommendToWarehouseCode;
}
}
[HttpPost("cancel-by-request/{materialNumber}")]
public virtual async Task CancelByMaterialRequestAsync(string materialNumber)
[HttpPost("cancel-by-request/{requestNumber}")]
public virtual async Task CancelByMaterialRequestAsync(string requestNumber)
{
var entities = await _repository.GetListAsync(p => p.MaterialRequestNumber == materialNumber).ConfigureAwait(false);
var entities = await _repository.GetListAsync(p => p.MaterialRequestNumber == requestNumber)
.ConfigureAwait(false);
foreach (var entity in entities)
{
await _CoatingIssueJobManager.CancelAsync(entity).ConfigureAwait(false);
await _coatingIssueJobManager.CancelAsync(entity).ConfigureAwait(false);
}
}
//[Authorize(CoatingIssueJobPermissions.Delete)]
//[HttpDelete("details/{id}")]
//public virtual async Task DeleteDetailAsync(Guid id, Guid detailId)
//{
// var entity = await _repository.GetAsync(id);
// Check.NotNull(entity, EntityClassName);
// var input = new CoatingIssueJobCheckInput
// {
// JobStatuses = new List<EnumJobStatus>() { EnumJobStatus.Pending, EnumJobStatus.Open },
// };
// var result = new AbpValidationResult();
// var detail = entity.GetDetail(detailId);
// _CoatingIssueJobManager.CheckJobStatus(entity, input.JobStatuses, result);
// if (result.Errors.Any())
// {
// throw new AbpValidationException("任务状态错误,不能进行删除明细操作");
// }
// entity.RemoveDetail(detailId);
//}
//[Authorize(CoatingIssueJobPermissions.Delete)]
[HttpPost("invalid")]
public override async Task CancelAsync(Guid id)
{
var CoatingIssueJob = await _repository.GetAsync(id).ConfigureAwait(false);
if (CoatingIssueJob == null)
var coatingIssueJob = await _repository.GetAsync(id).ConfigureAwait(false);
if (coatingIssueJob == null)
{
throw new UserFriendlyException($"未找到ID为 {id} 的任务");
}
/*
var listLocationCode = new List<string>();//取出所有当前job 影响的库位code
foreach (var detail in CoatingIssueJob.Details)
{
if (detail.HandledLocationCode != null)
{
listLocationCode.Add(detail.HandledLocationCode);
}
if (detail.HandledLocationCode != null)
{
listLocationCode.Add(detail.RecommendLocationCode);
}
if (detail.HandledLocationCode != null)
{
listLocationCode.Add(detail.RequestLocationCode);
}
if (detail.HandledLocationCode != null)
{
listLocationCode.Add(detail.ToLocationCode);
}
}
listLocationCode = listLocationCode.Distinct().ToList();
*/
await _CoatingIssueJobManager.CancelAsync(CoatingIssueJob).ConfigureAwait(false);
}
/// <summary>
/// 根据叫料请求类型获取发料任务
/// </summary>
/// <param name="requestInput"></param>
/// <param name="requestType">
/// 叫料请求类型:
/// 人工拉动:Issue_Manual;
/// 线边拉动:Issue_WIP;
/// </param>
/// <param name="includeDetails"></param>
/// <param name="cancellationToken"></param>
/// <returns></returns>
[HttpPost("by-type/{requestType}")]
public virtual async Task<PagedResultDto<CoatingIssueJobDTO>> GetListByTypeAsync(SfsJobRequestInputBase requestInput,
string requestType, bool includeDetails = false, CancellationToken cancellationToken = default)
{
Expression<Func<CoatingIssueJob, bool>> expression = p => p.RequestType == requestType;
if (requestInput.Condition.Filters?.Count > 0)
{
expression = expression.And(requestInput.Condition.Filters.ToLambda<CoatingIssueJob>());
}
return await GetPagedListAsync(expression, requestInput.SkipCount, requestInput.MaxResultCount,
requestInput.Sorting, includeDetails, cancellationToken).ConfigureAwait(false);
await _coatingIssueJobManager.CancelAsync(coatingIssueJob).ConfigureAwait(false);
}
[HttpPost("by-request-number/{requestNumber}")]
public virtual async Task<List<CoatingIssueJobDTO>> GetByRequestNumberAsync(string requestNumber)
{
var entitys = await _repository.GetListAsync(p => p.MaterialRequestNumber == requestNumber).ConfigureAwait(false);
var entitys = await _repository.GetListAsync(p => p.MaterialRequestNumber == requestNumber)
.ConfigureAwait(false);
return ObjectMapper.Map<List<CoatingIssueJob>, List<CoatingIssueJobDTO>>(entitys);
}
/// <summary>
/// 保存拆箱时涉及的明细修改
/// </summary>
/// <returns></returns>
[HttpPost("save-detail-split-packing")]
public virtual async Task<CoatingIssueJobDTO> SaveDetail_SplitPackingAsync(SplitPacking_UpdateJobDetailInput input)
[HttpPost("Do-Call-Back")]
public async Task DoTransferLibCallbackAsync(TransferLibJobDTO dto)
{
var job = await _repository.FindAsync(p => p.Number == input.Number).ConfigureAwait(false);
var detail = job.Details.FirstOrDefault(p => p.RecommendPackingCode == input.FromPackingCode); /*&& p.HandledQty == input.FromQty*/
if (detail == null)
{
throw new UserFriendlyException($"根据RecommendPackingCode={input.FromPackingCode}取CoatingIssueJobDetail表为空!");
}
//插入目标箱
var newDetail = CommonHelper.CloneObj(detail);
newDetail.SetId(GuidGenerator.Create());
newDetail.RecommendPackingCode = input.ToPackingCode;
newDetail.RecommendQty = input.ToQty;
newDetail.HandledPackingCode = detail.HandledPackingCode.HasValue() ? input.ToPackingCode : null; //源实际实际箱码有值,则新记录实际箱码有值
newDetail.HandledQty = detail.HandledQty > 0 ? input.ToQty : 0;
//newDetail.CreationTime = CommonHelper.CurTime;
job.Details.Add(newDetail);
//修改源箱
detail.RecommendQty = input.FromQty - input.ToQty;
detail.HandledQty = detail.HandledQty > 0 ? input.FromQty - input.ToQty : 0;
var entity = await _repository.UpdateAsync(job).ConfigureAwait(false);
var ret = ObjectMapper.Map<CoatingIssueJob, CoatingIssueJobDTO>(entity);
return ret;
var job = await _repository.FindAsync(p => p.Number == dto.JobNumber).ConfigureAwait(false);
//todo 等云峰写好换成真实的
var transferLibJobDto = await _transferLibJobAppService.GetByNumberAsync("AAA").ConfigureAwait(false);
var transferLibNote = new TransferLibNote();
var transferLibNoteDetail = transferLibNote.Details.First();
var jobDetail = job.Details.First();
job.JobStatus = EnumJobStatus.Open;
jobDetail.TransferLibFromArriveDate = transferLibNoteDetail.HandledFromArriveDate;
jobDetail.TransferLibFromContainerCode = transferLibNoteDetail.HandledFromContainerCode;
jobDetail.TransferLibFromExpireDate = transferLibNoteDetail.HandledFromExpireDate;
jobDetail.TransferLibFromLocationArea = transferLibNoteDetail.HandledFromLocationArea;
jobDetail.TransferLibFromLocationCode = transferLibNoteDetail.HandledFromLocationCode;
jobDetail.TransferLibFromLocationErpCode = transferLibNoteDetail.HandledFromLocationErpCode;
jobDetail.TransferLibFromLocationGroup = transferLibNoteDetail.HandledFromLocationGroup;
jobDetail.TransferLibFromLot = transferLibNoteDetail.HandledFromLot;
jobDetail.TransferLibFromPackingCode = transferLibNoteDetail.HandledFromPackingCode;
jobDetail.TransferLibFromProduceDate = transferLibNoteDetail.HandledFromProduceDate;
jobDetail.TransferLibFromQty = transferLibNoteDetail.HandledFromQty;
jobDetail.TransferLibFromSupplierBatch = transferLibNoteDetail.HandledFromSupplierBatch;
jobDetail.TransferLibFromWarehouseCode = transferLibNoteDetail.HandledFromWarehouseCode;
jobDetail.TransferLibToArriveDate = transferLibNoteDetail.HandledToArriveDate;
jobDetail.TransferLibToContainerCode = transferLibNoteDetail.HandledToContainerCode;
jobDetail.TransferLibToExpireDate = transferLibNoteDetail.HandledToExpireDate;
jobDetail.TransferLibToLocationArea = transferLibNoteDetail.HandledToLocationArea;
jobDetail.TransferLibToLocationCode = transferLibNoteDetail.HandledToLocationCode;
jobDetail.TransferLibToLocationErpCode = transferLibNoteDetail.HandledToLocationErpCode;
jobDetail.TransferLibToLocationGroup = transferLibNoteDetail.HandledToLocationGroup;
jobDetail.TransferLibToLot = transferLibNoteDetail.HandledToLot;
jobDetail.TransferLibToPackingCode = transferLibNoteDetail.HandledToPackingCode;
jobDetail.TransferLibToProduceDate = transferLibNoteDetail.HandledToProduceDate;
jobDetail.TransferLibToQty = transferLibNoteDetail.HandledToQty;
jobDetail.TransferLibToSupplierBatch = transferLibNoteDetail.HandledToSupplierBatch;
jobDetail.TransferLibToWarehouseCode = transferLibNoteDetail.HandledToWarehouseCode;
await _repository.UpdateAsync(job).ConfigureAwait(false);
return;
}
[HttpPost("test")]
public virtual async Task Test()
{
Console.WriteLine("FuAZCZXVZXVXZVZ");
await Task.CompletedTask;
}
}

7
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobAutoMapperProfile.cs

@ -1,5 +1,7 @@
using AutoMapper;
using Volo.Abp.AutoMapper;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Jobs.IssueJobs;
namespace Win_in.Sfs.Wms.Store.Application;
@ -8,9 +10,10 @@ public partial class StoreApplicationAutoMapperProfile : Profile
{
private void CoatingIssueJobAutoMapperProfile()
{
CreateMap<CoatingIssueJob, CoatingIssueJobDTO>();
CreateMap<CoatingIssueJob, CoatingIssueJobDTO>()
.ReverseMap();
CreateMap<CoatingIssueJobDTO, CoatingIssueJob>();
//CreateMap<CoatingIssueJobDTO, CoatingIssueJob>();
CreateMap<CoatingIssueJobDetail, CoatingIssueJobDetailDTO>()
;

50
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/IssueNotes/CoatingIssueNotes/CoatingIssueNoteAppService.cs

@ -11,30 +11,28 @@ using Volo.Abp.Application.Dtos;
using Volo.Abp.Domain.Entities;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Event;
using Win_in.Sfs.Wms.Store.Application;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Domain.Shared;
using Win_in.Sfs.Wms.Store.Notes.IssueNotes;
namespace Win_in.Sfs.Wms.Store.Notes.IssueNotes;
namespace Win_in.Sfs.Wms.Store.Application;
[Authorize]
[Route($"{StoreConsts.RootPath}coatingissue-note")]
[Route($"{StoreConsts.RootPath}coating-note")]
public class CoatingIssueNoteAppService :
SfsStoreWithDetailsAppServiceBase<CoatingIssueNote, CoatingIssueNoteDTO, SfsStoreRequestInputBase, CoatingIssueNoteEditInput, CoatingIssueNoteDetail,
CoatingIssueNoteDetailDTO, SfsStoreRequestInputBase, CoatingIssueNoteImportInput>,
ICoatingIssueNoteAppService
{
private readonly ICoatingIssueNoteManager _CoatingIssueNoteManager;
private readonly ICoatingIssueNoteManager _coatingIssueNoteManager;
public CoatingIssueNoteAppService(
ICoatingIssueNoteRepository repository,
ICoatingIssueNoteManager CoatingIssueNoteManager
ICoatingIssueNoteManager coatingIssueNoteManager
) : base(repository)
{
_CoatingIssueNoteManager = CoatingIssueNoteManager;
_coatingIssueNoteManager = coatingIssueNoteManager;
}
[HttpPost("")]
@ -42,7 +40,7 @@ public class CoatingIssueNoteAppService :
public override async Task<CoatingIssueNoteDTO> CreateAsync(CoatingIssueNoteEditInput input)
{
var entity = ObjectMapper.Map<CoatingIssueNoteEditInput, CoatingIssueNote>(input);
await _CoatingIssueNoteManager.CreateAsync(entity).ConfigureAwait(false);
await _coatingIssueNoteManager.CreateAsync(entity).ConfigureAwait(false);
var dto = ObjectMapper.Map<CoatingIssueNote, CoatingIssueNoteDTO>(entity);
return dto;
}
@ -55,11 +53,11 @@ public class CoatingIssueNoteAppService :
[HttpPost("confirm/{id}")]
public virtual async Task<CoatingIssueNoteDTO> ConfirmAsync(Guid id)
{
var issueNote = await _repository.GetAsync(id).ConfigureAwait(false);
issueNote.Confirmed = true;
issueNote = await _repository.UpdateAsync(issueNote).ConfigureAwait(false);
await LocalEventBus.PublishAsync(new SfsConfirmedEntityEventData<CoatingIssueNote>(issueNote), false).ConfigureAwait(false);
return ObjectMapper.Map<CoatingIssueNote, CoatingIssueNoteDTO>(issueNote);
var coatingIssueNote = await _repository.GetAsync(id).ConfigureAwait(false);
coatingIssueNote.Confirmed = true;
coatingIssueNote = await _repository.UpdateAsync(coatingIssueNote).ConfigureAwait(false);
await LocalEventBus.PublishAsync(new SfsConfirmedEntityEventData<CoatingIssueNote>(coatingIssueNote), false).ConfigureAwait(false);
return ObjectMapper.Map<CoatingIssueNote, CoatingIssueNoteDTO>(coatingIssueNote);
}
[HttpPost("confirm-by-number/{number}")]
@ -67,7 +65,7 @@ public class CoatingIssueNoteAppService :
{
var entity = await _repository.FindAsync(p => p.Number == number).ConfigureAwait(false);
Check.NotNull(entity, nameof(CoatingIssueNote));
var result = await _CoatingIssueNoteManager.ConfirmAsync(entity.Id).ConfigureAwait(false);
var result = await _coatingIssueNoteManager.ConfirmAsync(entity.Id).ConfigureAwait(false);
var dto = ObjectMapper.Map<CoatingIssueNote, CoatingIssueNoteDTO>(result);
return dto;
}
@ -108,26 +106,4 @@ public class CoatingIssueNoteAppService :
return dtos;
}
//[HttpPost("")]
//[Authorize(IssueNotePermissions.Create)]
//public override Task<IssueNoteDTO> CreateAsync(IssueNoteCreateInput input)
//{
// return base.CreateAsync(input);
//}
//[HttpPut]
//[Route($"{StoreConsts.RootPath}{id}")]
//[Authorize(IssueNotePermissions.Update)]
//public override Task<IssueNoteDTO> UpdateAsync(Guid id, IssueNoteUpdateInput input)
//{
// return base.UpdateAsync(id, input);
//}
//[HttpDelete]
//[Route($"{StoreConsts.RootPath}{id}")]
//[Authorize(IssueNotePermissions.Delete)]
//public override Task DeleteAsync(Guid id)
//{
// return base.DeleteAsync(id);
//}
}

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/IssueNotes/CoatingIssueNotes/CoatingIssueNoteAutoMapperProfile.cs

@ -1,5 +1,7 @@
using AutoMapper;
using Volo.Abp.AutoMapper;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Notes.IssueNotes;

167
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/AssembleRequests/AssembleRequestAppService.cs

@ -15,6 +15,7 @@ using Volo.Abp.Application.Dtos;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.ObjectMapping;
using Win_in.Sfs.Basedata.Application;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
@ -40,18 +41,20 @@ public class AssembleIssueRequestsAppService : SfsStoreRequestAppServiceBase<Ass
private readonly IAreaAppService _areaApp;
private readonly ILocationAppService _locationAppService;
private readonly IItemBasicAppService _itemBasicAppService;
private readonly IProductionLineAppService _productionLineAppService;
private readonly IInjectionJobAppService _issueJobAppService;
public AssembleIssueRequestsAppService(
IAssembleIssueRequestsRepository repository,
IAssembleIssueRequestsManager assembleRequestManager,
private readonly IProductionLineAppService _productionLineAppService;
private readonly ITransactionTypeAppService _transactionTypeAppService;
public AssembleRequestAppService(
IAssembleRequestRepository repository,
IAssembleRequestManager assembleRequestManager,
IPreparationPlanManager preparationPlanManager,
IItemStoreRelationAppService itemStoreRelationApp,
IAreaAppService areaApp,
ILocationAppService locationAppService,
IItemBasicAppService itemBasicAppService,
IProductionLineAppService productionLineAppService,
IInjectionJobAppService issueJobAppService)
ITransactionTypeAppService transactionTypeAppService
)
: base(repository, assembleRequestManager)
{
_assembleRequestManager = assembleRequestManager;
@ -60,7 +63,8 @@ public class AssembleIssueRequestsAppService : SfsStoreRequestAppServiceBase<Ass
_locationAppService = locationAppService;
_itemBasicAppService = itemBasicAppService;
_productionLineAppService = productionLineAppService;
_issueJobAppService = issueJobAppService;
_transactionTypeAppService = transactionTypeAppService;
}
@ -68,14 +72,12 @@ public class AssembleIssueRequestsAppService : SfsStoreRequestAppServiceBase<Ass
public override async Task<AssembleIssueRequestsDTO> HandleAsync(Guid id)
{
var entity = await _repository.GetAsync(id).ConfigureAwait(false);
await LocalEventBus.PublishAsync(new SfsHandledEntityEventData<AssembleIssueRequests>(entity), false).ConfigureAwait(false);
return ObjectMapper.Map<AssembleIssueRequests, AssembleIssueRequestsDTO>(entity);
await Task.CompletedTask.ConfigureAwait(false);
return null;
}
[HttpPost("")]
//[Authorize(AssembleIssueRequestsPermissions.Create)]
public override async Task<AssembleIssueRequestsDTO> CreateAsync(AssembleIssueRequestsEditInput input)
public override async Task<AssembleRequestDTO> CreateAsync(AssembleRequestEditInput input)
{
foreach (var item in input.Details)
{
@ -87,31 +89,55 @@ public class AssembleIssueRequestsAppService : SfsStoreRequestAppServiceBase<Ass
foreach (var detailInput in input.Details) //赋值生产线
{
var toLocationDto = await _locationAppService.GetByCodeAsync(detailInput.ToLocationCode).ConfigureAwait(false);
var toLocationDto =
await _locationAppService.GetByCodeAsync(detailInput.ToLocationCode).ConfigureAwait(false);
CheckLocation(toLocationDto, detailInput.ToLocationCode);
var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(detailInput.ItemCode).ConfigureAwait(false);
CheckItemBasic(itemBasicDto, detailInput.ItemCode);
detailInput.ToLocationArea = toLocationDto.AreaCode;
detailInput.ToLocationGroup = toLocationDto.LocationGroupCode;
detailInput.ToWarehouseCode = toLocationDto.WarehouseCode;
detailInput.ProdLine = detailInput.ToLocationCode;
detailInput.ToLocationErpCode = toLocationDto.ErpLocationCode;
}
input.AutoSubmit = true;
input.AutoAgree = true;
input.AutoHandle = true;
input.AutoCompleteJob = false;
input.DirectCreateNote = false;
detailInput.ItemDesc1 = itemBasicDto.Desc1;
detailInput.ItemDesc2 = itemBasicDto.Desc2;
detailInput.ItemName = itemBasicDto.Name;
detailInput.Uom = itemBasicDto.BasicUom;
detailInput.StdPackQty = itemBasicDto.StdPackQty;
detailInput.Status = EnumStatus.Open;
var entity = ObjectMapper.Map<AssembleIssueRequestsEditInput, AssembleIssueRequests>(input);
//因为是刚创建的 所以发料数一定是0
detailInput.IssuedQty = 0;
}
var result = await _assembleRequestManager.CreateAsync(entity).ConfigureAwait(false);
await SetRequestAutoPropertiesAsync(input).ConfigureAwait(false);
var entity = ObjectMapper.Map<AssembleRequestEditInput, AssembleRequest>(input);
var result = await _assembleRequestManager.CreateByNumberAsync(entity).ConfigureAwait(false);
var dto = ObjectMapper.Map<AssembleIssueRequests, AssembleIssueRequestsDTO>(result);
return dto;
}
//[Authorize(AssembleIssueRequestsPermissions.Create)]
/// <summary>
/// 赋值Request业务属性
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
private async Task SetRequestAutoPropertiesAsync(AssembleRequestEditInput entity)
{
var tranType = await _transactionTypeAppService.GetByTransTypeAsync(EnumTransType.Issue, EnumTransSubType.None).ConfigureAwait(false);
Check.NotNull(tranType, "事务类型", "事务类型不存在");
entity.AutoSubmit = tranType.AutoSubmitRequest;
entity.AutoAgree = tranType.AutoAgreeRequest;
entity.AutoHandle = tranType.AutoHandleRequest;
entity.AutoCompleteJob = tranType.AutoCompleteJob;
entity.DirectCreateNote = tranType.DirectCreateNote;
}
[HttpPost("create-and-handle")]
public async Task<AssembleIssueRequestsDTO> CreateAndHandleAsync(AssembleIssueRequestsEditInput input)
{
@ -124,21 +150,6 @@ public class AssembleIssueRequestsAppService : SfsStoreRequestAppServiceBase<Ass
#endregion
/// <summary>
/// 根据类型 获取叫料申请
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
[HttpGet("list/by-type/{type}")]
public virtual async Task<List<AssembleIssueRequestsDTO>> GetListByTypeAsync(string type)
{
var entities = await _repository.GetListAsync(c => c.Type == type).ConfigureAwait(false);
var dtos = ObjectMapper.Map<List<AssembleIssueRequests>, List<AssembleIssueRequestsDTO>>(entities);
return dtos;
}
#region 导入
/// <summary>
@ -176,6 +187,7 @@ public class AssembleIssueRequestsAppService : SfsStoreRequestAppServiceBase<Ass
detail.ItemDesc2 = itemBasicDto.Desc2;
detail.ItemName = itemBasicDto.Name;
detail.Uom = itemBasicDto.BasicUom;
detail.StdPackQty = itemBasicDto.StdPackQty;
}
}
@ -198,6 +210,8 @@ public class AssembleIssueRequestsAppService : SfsStoreRequestAppServiceBase<Ass
await CheckStoreRelationAsync(model, validationRresult).ConfigureAwait(false);
}
#endregion
#region 校验
protected override async Task<bool> ValidateImportEntities(Dictionary<AssembleIssueRequests, EntityState> dict)
@ -219,36 +233,7 @@ public class AssembleIssueRequestsAppService : SfsStoreRequestAppServiceBase<Ass
return await base.ValidateImportEntities(dict).ConfigureAwait(false);
}
protected async Task<ItemBasicDTO> CheckItemBasicAsync(AssembleIssueRequestsImportInput importInput,
List<ValidationResult> validationRresult)
{
var item = await _itemBasicAppService.GetByCodeAsync(importInput.ItemCode).ConfigureAwait(false);
if (item == null)
{
validationRresult.Add(new ValidationResult($"物品代码{importInput.ItemCode}不存在", new[] { "物品代码" }));
}
else if (item.StdPackQty == 0)
{
validationRresult.Add(
new ValidationResult($"物品代码{importInput.ItemCode}的物品信息中标准包装等于0或不存在", new[] { "标准包装" }));
}
return item;
}
protected async Task<LocationDTO> CheckLocationAsync(AssembleIssueRequestsImportInput importInput,
List<ValidationResult> validationRresult)
{
var location = await _locationAppService.GetByCodeAsync(importInput.ToLocationCode).ConfigureAwait(false);
if (location == null)
{
validationRresult.Add(new ValidationResult($"目标库位{importInput.ToLocationCode}不存在", new[] { "目标库位" }));
}
return location;
}
protected async Task CheckAreaAsync(AssembleIssueRequestsImportInput importInput,
protected async Task CheckAreaAsync(AssembleRequestImportInput importInput,
List<ValidationResult> validationRresult)
{
var area = await _areaApp.GetByCodeAsync(importInput.FromLocationArea).ConfigureAwait(false);
@ -270,33 +255,55 @@ public class AssembleIssueRequestsAppService : SfsStoreRequestAppServiceBase<Ass
}
}
#endregion
#endregion
#region 校验
private void CheckItemBasic(ItemBasicDTO ItemBasicDto, string itemCode)
private void CheckItemBasic(ItemBasicDTO itemBasicDto, string itemCode)
{
if (ItemBasicDto == null)
if (itemBasicDto == null)
{
throw new UserFriendlyException($"物品代码为【{itemCode}】不存在");
}
}
private void CheckLocation(LocationDTO LocationDto, string LocationCode)
private void CheckLocation(LocationDTO locationDto, string locationCode)
{
if (LocationDto == null)
if (locationDto == null)
{
throw new UserFriendlyException($"库位代码为【{LocationCode}】不存在");
throw new UserFriendlyException($"库位代码为【{locationCode}】不存在");
}
if (LocationDto.Type != EnumLocationType.WIP)
if (locationDto.Type != EnumLocationType.WIP)
{
throw new UserFriendlyException($"库位代码【{LocationCode}】不是【{EnumLocationType.WIP.GetDisplayName()}】类型");
throw new UserFriendlyException($"库位代码【{locationCode}】不是【{EnumLocationType.WIP.GetDisplayName()}】类型");
}
}
protected async Task<ItemBasicDTO> CheckItemBasicAsync(AssembleRequestImportInput importInput,
List<ValidationResult> validationRresult)
{
var item = await _itemBasicAppService.GetByCodeAsync(importInput.ItemCode).ConfigureAwait(false);
if (item == null)
{
validationRresult.Add(new ValidationResult($"物品代码{importInput.ItemCode}不存在", new[] { "物品代码" }));
}
else if (item.StdPackQty == 0)
{
validationRresult.Add(
new ValidationResult($"物品代码{importInput.ItemCode}的物品信息中标准包装等于0或不存在", new[] { "标准包装" }));
}
return item;
}
protected async Task<LocationDTO> CheckLocationAsync(AssembleRequestImportInput importInput,
List<ValidationResult> validationRresult)
{
var location = await _locationAppService.GetByCodeAsync(importInput.ToLocationCode).ConfigureAwait(false);
if (location == null)
{
validationRresult.Add(new ValidationResult($"目标库位{importInput.ToLocationCode}不存在", new[] { "目标库位" }));
}
return location;
}
#endregion
}

411
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/CoatingMaterialRequests/CoatingMaterialRequestAppService.cs

@ -15,226 +15,107 @@ using Volo.Abp.Application.Dtos;
using Volo.Abp.Domain.Entities;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.ObjectMapping;
using Win_in.Sfs.Basedata.Application;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Event;
using Win_in.Sfs.Wms.Store.Application;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Domain.Shared;
using Win_in.Sfs.Wms.Store.Requests.MaterialRequests;
namespace Win_in.Sfs.Wms.Store.Requests.MaterialRequests.CoatingMaterialRequests;
namespace Win_in.Sfs.Wms.Store.Application;
/// <summary>
/// 喷涂叫料
/// </summary>
[Authorize]
[Route($"{StoreConsts.RootPath}coatingmaterial-request")]
[Route($"{StoreConsts.RootPath}coating-request")]
public class CoatingMaterialRequestAppService : SfsStoreRequestAppServiceBase<CoatingMaterialRequest, CoatingMaterialRequestDTO,
SfsStoreRequestInputBase, CoatingMaterialRequestEditInput, CoatingMaterialRequestDetail, CoatingMaterialRequestDetailDTO,
SfsStoreRequestInputBase, CoatingMaterialRequestImportInput>,
ICoatingMaterialRequestAppService
{
private readonly ICoatingMaterialRequestManager _materialRequestManager;
private readonly IPreparationPlanManager _preparationPlanManager;
private readonly ICoatingMaterialRequestManager _coatingMaterialRequestManager;
private readonly IItemStoreRelationAppService _itemStoreRelationApp;
private readonly IAreaAppService _areaApp;
private readonly ILocationAppService _locationAppService;
private readonly IItemBasicAppService _itemBasicAppService;
private readonly IProductionLineAppService _productionLineAppService;
private readonly IIssueJobAppService _issueJobAppService;
private readonly IProductionLineAppService _productionLineAppService;
private readonly ITransactionTypeAppService _transactionTypeAppService;
public CoatingMaterialRequestAppService(
ICoatingMaterialRequestRepository repository,
ICoatingMaterialRequestManager CoatingMaterialRequestManager,
ICoatingMaterialRequestManager coatingMaterialRequestManager,
IPreparationPlanManager preparationPlanManager,
IItemStoreRelationAppService itemStoreRelationApp,
IAreaAppService areaApp,
ILocationAppService locationAppService,
IItemBasicAppService itemBasicAppService,
IProductionLineAppService productionLineAppService,
IIssueJobAppService issueJobAppService)
: base(repository, CoatingMaterialRequestManager)
ITransactionTypeAppService transactionTypeAppService
)
: base(repository, coatingMaterialRequestManager)
{
_materialRequestManager = CoatingMaterialRequestManager;
_preparationPlanManager = preparationPlanManager;
_coatingMaterialRequestManager = coatingMaterialRequestManager;
_itemStoreRelationApp = itemStoreRelationApp;
_areaApp = areaApp;
_locationAppService = locationAppService;
_itemBasicAppService = itemBasicAppService;
_productionLineAppService = productionLineAppService;
_issueJobAppService = issueJobAppService;
_productionLineAppService = productionLineAppService;
_transactionTypeAppService = transactionTypeAppService;
}
#region 东阳使用
/// <summary>
/// 用来重写 导入数据时可以加工数据
/// </summary>
/// <param name="dictionary"></param>
/// <returns></returns>
protected override async Task<Dictionary<CoatingMaterialRequest, EntityState>> ImportProcessingEntityAsync(
Dictionary<CoatingMaterialRequest, EntityState> dictionary)
{
var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key);
foreach (var materialRequest in addList)
{
materialRequest.Worker = CurrentUser.GetUserName();
materialRequest.CreatorId = CurrentUser.Id;
if (materialRequest.Type == EnumTransSubType.Issue_Manual.GetDisplayName())
{
materialRequest.Type = EnumTransSubType.Issue_Manual.ToString();
}
foreach (var detail in materialRequest.Details)
{
var locationDto = await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false);
CheckLocation(locationDto, detail.ToLocationCode);
var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false);
CheckItemBasic(itemBasicDto, detail.ItemCode);
detail.ToLocationArea = locationDto.AreaCode;
detail.ToLocationErpCode = locationDto.ErpLocationCode;
detail.ToLocationGroup = locationDto.LocationGroupCode;
detail.ToWarehouseCode = locationDto.WarehouseCode;
detail.ItemDesc1 = itemBasicDto.Desc1;
detail.ItemDesc2 = itemBasicDto.Desc2;
detail.ItemName = itemBasicDto.Name;
detail.Uom = itemBasicDto.BasicUom;
}
}
return dictionary;
}
#region 东阳V2
public override async Task<CoatingMaterialRequestDTO> HandleAsync(Guid id)
{
var entity = await _repository.GetAsync(id).ConfigureAwait(false);
await LocalEventBus.PublishAsync(new SfsHandledEntityEventData<CoatingMaterialRequest>(entity), false).ConfigureAwait(false);
return ObjectMapper.Map<CoatingMaterialRequest, CoatingMaterialRequestDTO>(entity);
}
#region 校验
private void CheckItemBasic(ItemBasicDTO ItemBasicDto, string itemCode)
{
if (ItemBasicDto == null)
{
throw new UserFriendlyException($"物品代码为【{itemCode}】不存在");
}
}
private void CheckLocation(LocationDTO LocationDto, string LocationCode)
{
if (LocationDto == null)
{
throw new UserFriendlyException($"库位代码为【{LocationCode}】不存在");
}
if (LocationDto.Type != EnumLocationType.WIP)
{
throw new UserFriendlyException($"库位代码【{LocationCode}】不是【{EnumLocationType.WIP.GetDisplayName()}】类型");
}
await Task.CompletedTask.ConfigureAwait(false);
return null;
}
#endregion
#endregion
[HttpPost("")]
//[Authorize(CoatingMaterialRequestPermissions.Create)]
public override async Task<CoatingMaterialRequestDTO> CreateAsync(CoatingMaterialRequestEditInput input)
{
foreach (var item in input.Details)
{
if (item.Qty <= 0)
{
throw new UserFriendlyException($"{item.ItemCode} 物料的需求量必须大于 0");
}
}
foreach (var item in input.Details) //赋值生产线
{
var location = await LocationAclService.GetByCodeAsync(item.ToLocationCode).ConfigureAwait(false);
item.ProdLine = location.LocationGroupCode;
}
var entity = ObjectMapper.Map<CoatingMaterialRequestEditInput, CoatingMaterialRequest>(input);
var result = await _materialRequestManager.CreateAsync(entity).ConfigureAwait(false);
var dto = ObjectMapper.Map<CoatingMaterialRequest, CoatingMaterialRequestDTO>(result);
return dto;
}
/// <summary>
/// 创建并且执行叫料请求
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
[HttpPost("create-and-handle-api")]
//[Authorize(CoatingMaterialRequestPermissions.Create)]
public virtual async Task<CoatingMaterialRequestDTO> CreateAndHandleByAPIAsync(CoatingMaterialRequestEditInput input)
{
foreach (var item in input.Details)
{
if (item.Qty <= 0)
{
throw new UserFriendlyException($"{item.ItemCode} 物料的需求量必须大于 0");
throw new UserFriendlyException($"{item.ItemCode} 物料的需求量必须大于0");
}
}
input.AutoSubmit = true;
input.AutoAgree = true;
input.AutoHandle = true;
input.AutoCompleteJob = false;
input.DirectCreateNote = false;
foreach (var detailInput in input.Details)
foreach (var detailInput in input.Details) //赋值生产线
{
var toLocationDto = await _locationAppService.GetByCodeAsync(detailInput.ToLocationCode).ConfigureAwait(false);
var toLocationDto =
await _locationAppService.GetByCodeAsync(detailInput.ToLocationCode).ConfigureAwait(false);
CheckLocation(toLocationDto, detailInput.ToLocationCode);
var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(detailInput.ItemCode).ConfigureAwait(false);
CheckItemBasic(itemBasicDto, detailInput.ItemCode);
detailInput.ItemDesc1 = itemBasicDto.Desc1;
//var productionLineDto = await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationDto.LocationGroupCode).ConfigureAwait(false);
detailInput.ToLocationArea = toLocationDto.AreaCode;
detailInput.ToLocationGroup = toLocationDto.LocationGroupCode;
detailInput.ToWarehouseCode = toLocationDto.WarehouseCode;
detailInput.ProdLine = detailInput.ToLocationCode;
detailInput.ToLocationErpCode = toLocationDto.ErpLocationCode;
//detailInput.ToLocationCode = toLocationDto.ErpLocationCode;
//if (productionLineDto != null)
//{
// detailInput.ProdLine = productionLineDto.Code;
//}
detailInput.ItemDesc1 = itemBasicDto.Desc1;
detailInput.ItemDesc2 = itemBasicDto.Desc2;
detailInput.ItemName = itemBasicDto.Name;
detailInput.Uom = itemBasicDto.BasicUom;
detailInput.StdPackQty = itemBasicDto.StdPackQty;
detailInput.Status = EnumStatus.Open;
//因为是刚创建的 所以发料数一定是0
detailInput.IssuedQty = 0;
}
await SetRequestAutoPropertiesAsync(input).ConfigureAwait(false);
var entity = ObjectMapper.Map<CoatingMaterialRequestEditInput, CoatingMaterialRequest>(input);
foreach (var detail in entity.Details)
{
var toLocationDto = await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false);
//var productionLineDto = await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationDto.LocationGroupCode).ConfigureAwait(false);
detail.ToLocationArea = toLocationDto.AreaCode;
detail.ToLocationErpCode = toLocationDto.ErpLocationCode;
detail.ToLocationGroup = toLocationDto.LocationGroupCode;
detail.ToWarehouseCode = toLocationDto.WarehouseCode;
}
entity.UseOnTheWayLocation = false;
var result = await _materialRequestManager.CreateBynNumberAsync(entity).ConfigureAwait(false);
var result = await _coatingMaterialRequestManager.CreateByNumberAsync(entity).ConfigureAwait(false);
var dto = ObjectMapper.Map<CoatingMaterialRequest, CoatingMaterialRequestDTO>(result);
@ -242,98 +123,76 @@ public class CoatingMaterialRequestAppService : SfsStoreRequestAppServiceBase<Co
}
/// <summary>
/// 创建并且执行叫料请求
/// 赋值Request业务属性
/// </summary>
/// <param name="input"></param>
/// <param name="entity"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
[HttpPost("create-and-handle")]
//[Authorize(CoatingMaterialRequestPermissions.Create)]
public virtual async Task<CoatingMaterialRequestDTO> CreateAndHandleAsync(CoatingMaterialRequestEditInput input)
private async Task SetRequestAutoPropertiesAsync(CoatingMaterialRequestEditInput entity)
{
foreach (var item in input.Details)
{
if (item.Qty <= 0)
{
throw new UserFriendlyException($"{item.ItemCode} 物料的需求量必须大于0");
}
}
foreach (var detailInput in input.Details) //赋值生产线
{
var toLocationDto = await _locationAppService.GetByCodeAsync(detailInput.ToLocationCode).ConfigureAwait(false);
CheckLocation(toLocationDto, detailInput.ToLocationCode);
var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(detailInput.ItemCode).ConfigureAwait(false);
CheckItemBasic(itemBasicDto, detailInput.ItemCode);
var location = await LocationAclService.GetByCodeAsync(detailInput.ToLocationCode).ConfigureAwait(false);
detailInput.ProdLine = location.LocationGroupCode;
input.Worker = input.Worker;
}
var tranType = await _transactionTypeAppService.GetByTransTypeAsync(EnumTransType.Issue, EnumTransSubType.None).ConfigureAwait(false);
Check.NotNull(tranType, "事务类型", "事务类型不存在");
entity.AutoSubmit = tranType.AutoSubmitRequest;
entity.AutoAgree = tranType.AutoAgreeRequest;
entity.AutoHandle = tranType.AutoHandleRequest;
entity.AutoCompleteJob = tranType.AutoCompleteJob;
entity.DirectCreateNote = tranType.DirectCreateNote;
}
input.AutoSubmit = true;
input.AutoAgree = true;
input.AutoHandle = true;
input.AutoCompleteJob = false;
input.DirectCreateNote = false;
[HttpPost("create-and-handle")]
public async Task<CoatingMaterialRequestDTO> CreateAndHandleAsync(CoatingMaterialRequestEditInput input)
{
var coatingMaterialRequestDto = await CreateAsync(input).ConfigureAwait(false);
var entity = ObjectMapper.Map<CoatingMaterialRequestEditInput, CoatingMaterialRequest>(input);
await HandleAsync(coatingMaterialRequestDto.Id).ConfigureAwait(false);
var result = await _materialRequestManager.CreateAsync(entity).ConfigureAwait(false);
return coatingMaterialRequestDto;
}
var dto = ObjectMapper.Map<CoatingMaterialRequest, CoatingMaterialRequestDTO>(result);
#endregion
return dto;
}
#region 导入
/// <summary>
/// 根据类型获取叫料请求
/// 用来重写 导入数据时可以加工数据
/// </summary>
/// <param name="requestInput"></param>
/// <param name="type">
/// 叫料请求类型:
/// 人工拉动:Issue_Manual;
/// 线边拉动:Issue_WIP;
/// </param>
/// <param name="includeDetails"></param>
/// <param name="cancellationToken"></param>
/// <param name="dictionary"></param>
/// <returns></returns>
[HttpPost("by-type/{type}")]
public virtual async Task<PagedResultDto<CoatingMaterialRequestDTO>> GetListByTypeAsync(
SfsStoreRequestInputBase requestInput,
string type,
bool includeDetails = false,
CancellationToken cancellationToken = default)
protected override async Task<Dictionary<CoatingMaterialRequest, EntityState>> ImportProcessingEntityAsync(
Dictionary<CoatingMaterialRequest, EntityState> dictionary)
{
Expression<Func<CoatingMaterialRequest, bool>> expression = p => p.Type == type;
if (requestInput.Condition.Filters?.Count > 0)
{
expression = expression.And(requestInput.Condition.Filters.ToLambda<CoatingMaterialRequest>());
}
var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key);
return await GetPagedListAsync(expression, requestInput.SkipCount, requestInput.MaxResultCount,
requestInput.Sorting, includeDetails, cancellationToken).ConfigureAwait(false);
}
foreach (var coatingMaterialRequest in addList)
{
coatingMaterialRequest.Worker = CurrentUser.GetUserName();
coatingMaterialRequest.CreatorId = CurrentUser.Id;
if (coatingMaterialRequest.Type == EnumTransSubType.Issue_Manual.GetDisplayName())
{
coatingMaterialRequest.Type = EnumTransSubType.Issue_Manual.ToString();
}
#region 导入
foreach (var detail in coatingMaterialRequest.Details)
{
var locationDto = await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false);
CheckLocation(locationDto, detail.ToLocationCode);
//protected override async Task CheckImportInputBusinessAsync(CoatingMaterialRequestImportInput importInput, EnumImportMethod importMethod)
//{
// //await base.CheckImportInputBusinessAsync(importInput, importMethod);
var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false);
CheckItemBasic(itemBasicDto, detail.ItemCode);
// var item = await CheckItemBasicAsync(importInput);
// await CheckItemPackAsync(importInput);
// var location = await CheckLocationAsync(importInput);
// await CheckAreaAsync(importInput);
// await CheckStoreRelationAsync(importInput);
// var transactionType = await CheckTransactionTypeAsync();
detail.ToLocationArea = locationDto.AreaCode;
detail.ToLocationErpCode = locationDto.ErpLocationCode;
detail.ToLocationGroup = locationDto.LocationGroupCode;
detail.ToWarehouseCode = locationDto.WarehouseCode;
detail.ItemDesc1 = itemBasicDto.Desc1;
detail.ItemDesc2 = itemBasicDto.Desc2;
detail.ItemName = itemBasicDto.Name;
detail.Uom = itemBasicDto.BasicUom;
detail.StdPackQty = itemBasicDto.StdPackQty;
}
}
// CheckTransactionType(EnumTransInOut.In, EnumInventoryStatus.OK, transactionType, item, location);
//}
return dictionary;
}
/// <summary>
/// 导入验证
@ -351,6 +210,8 @@ public class CoatingMaterialRequestAppService : SfsStoreRequestAppServiceBase<Co
await CheckStoreRelationAsync(model, validationRresult).ConfigureAwait(false);
}
#endregion
#region 校验
protected override async Task<bool> ValidateImportEntities(Dictionary<CoatingMaterialRequest, EntityState> dict)
@ -372,6 +233,49 @@ public class CoatingMaterialRequestAppService : SfsStoreRequestAppServiceBase<Co
return await base.ValidateImportEntities(dict).ConfigureAwait(false);
}
protected async Task CheckAreaAsync(CoatingMaterialRequestImportInput importInput,
List<ValidationResult> validationRresult)
{
var area = await _areaApp.GetByCodeAsync(importInput.FromLocationArea).ConfigureAwait(false);
if (area == null)
{
validationRresult.Add(new ValidationResult($"调出库区{importInput.FromLocationArea}不存在", new[] { "调出库区" }));
}
}
protected async Task CheckStoreRelationAsync(CoatingMaterialRequestImportInput importInput,
List<ValidationResult> validationRresult)
{
var itemStoreRelation = await _itemStoreRelationApp
.GetFirstAsync(importInput.ItemCode, importInput.ToLocationCode).ConfigureAwait(false);
if (itemStoreRelation == null)
{
validationRresult.Add(new ValidationResult(
$"物品代码{importInput.ItemCode}与目标库位{importInput.ToLocationCode}不存在对应关", new[] { "物品库位对应关系" }));
}
}
private void CheckItemBasic(ItemBasicDTO itemBasicDto, string itemCode)
{
if (itemBasicDto == null)
{
throw new UserFriendlyException($"物品代码为【{itemCode}】不存在");
}
}
private void CheckLocation(LocationDTO locationDto, string locationCode)
{
if (locationDto == null)
{
throw new UserFriendlyException($"库位代码为【{locationCode}】不存在");
}
if (locationDto.Type != EnumLocationType.WIP)
{
throw new UserFriendlyException($"库位代码【{locationCode}】不是【{EnumLocationType.WIP.GetDisplayName()}】类型");
}
}
protected async Task<ItemBasicDTO> CheckItemBasicAsync(CoatingMaterialRequestImportInput importInput,
List<ValidationResult> validationRresult)
{
@ -401,44 +305,5 @@ public class CoatingMaterialRequestAppService : SfsStoreRequestAppServiceBase<Co
return location;
}
protected async Task CheckAreaAsync(CoatingMaterialRequestImportInput importInput,
List<ValidationResult> validationRresult)
{
var area = await _areaApp.GetByCodeAsync(importInput.FromLocationArea).ConfigureAwait(false);
if (area == null)
{
validationRresult.Add(new ValidationResult($"调出库区{importInput.FromLocationArea}不存在", new[] { "调出库区" }));
}
}
protected async Task CheckStoreRelationAsync(CoatingMaterialRequestImportInput importInput,
List<ValidationResult> validationRresult)
{
var itemStoreRelation = await _itemStoreRelationApp
.GetFirstAsync(importInput.ItemCode, importInput.ToLocationCode).ConfigureAwait(false);
if (itemStoreRelation == null)
{
validationRresult.Add(new ValidationResult(
$"物品代码{importInput.ItemCode}与目标库位{importInput.ToLocationCode}不存在对应关", new[] { "物品库位对应关系" }));
}
}
#endregion
#endregion
/// <summary>
/// 根据类型 获取叫料申请
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
[HttpGet("list/by-type/{type}")]
public virtual async Task<List<CoatingMaterialRequestDTO>> GetListByTypeAsync(string type)
{
var entities = await _repository.GetListAsync(c => c.Type == type).ConfigureAwait(false);
var dtos = ObjectMapper.Map<List<CoatingMaterialRequest>, List<CoatingMaterialRequestDTO>>(entities);
return dtos;
}
}

12
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/MaterialRequests/InjectionRequests/InjectionRequestAppService.cs

@ -26,7 +26,9 @@ using Win_in.Sfs.Wms.Store.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Application;
//注塑叫料
/// <summary>
/// 注塑叫料
/// </summary>
[Authorize]
[Route($"{StoreConsts.RootPath}injection-request")]
public class InjectionRequestAppService : SfsStoreRequestAppServiceBase<InjectionRequest, InjectionRequestDTO,
@ -40,7 +42,7 @@ public class InjectionRequestAppService : SfsStoreRequestAppServiceBase<Injectio
private readonly ILocationAppService _locationAppService;
private readonly IItemBasicAppService _itemBasicAppService;
private readonly IProductionLineAppService _productionLineAppService;
private readonly IInjectionJobAppService _injectionJobAppService;
private readonly ITransactionTypeAppService _transactionTypeAppService;
public InjectionRequestAppService(
@ -52,8 +54,8 @@ public class InjectionRequestAppService : SfsStoreRequestAppServiceBase<Injectio
ILocationAppService locationAppService,
IItemBasicAppService itemBasicAppService,
IProductionLineAppService productionLineAppService,
ITransactionTypeAppService transactionTypeAppService,
IInjectionJobAppService injectionJobAppService)
ITransactionTypeAppService transactionTypeAppService
)
: base(repository, injectionRequestManager)
{
_injectionRequestManager = injectionRequestManager;
@ -62,7 +64,7 @@ public class InjectionRequestAppService : SfsStoreRequestAppServiceBase<Injectio
_locationAppService = locationAppService;
_itemBasicAppService = itemBasicAppService;
_productionLineAppService = productionLineAppService;
_injectionJobAppService = injectionJobAppService;
_transactionTypeAppService = transactionTypeAppService;
}

41
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/AssembleJobs/AssembleJob.cs

@ -28,13 +28,7 @@ public class AssembleJob : SfsJobAggregateRootBase<AssembleJobDetail>
/// 要货单号
/// </summary>
[IgnoreUpdate]
public string AssembleIssueRequestsNumber { get; set; }
/// <summary>
/// 车间
/// </summary>
[IgnoreUpdate]
public string Workshop { get; set; }
public string AssembleRequestNumber { get; set; }
/// <summary>
/// 使用在途库
@ -48,37 +42,6 @@ public class AssembleJob : SfsJobAggregateRootBase<AssembleJobDetail>
/// </summary>
[IgnoreUpdate]
public override List<AssembleJobDetail> Details { get; set; } = new List<AssembleJobDetail>();
/// <summary>
/// 设置任务明细的实际库位和实际数量
/// </summary>
/// <param name="id"></param>
/// <param name="handledLocationCode"></param>
/// <param name="handledLocationErpCode"></param>
/// <param name="handledWarehouseCode"></param>
/// <param name="handledQty"></param>
/// <param name="handledBatch"></param>
/// <param name="handledContainerCode"></param>
/// <param name="handledLot"></param>
/// <param name="handledPackingCode"></param>
/// <returns></returns>
public virtual async Task BuildDetail(Guid id, string handledLocationCode, string handledLocationErpCode,
string handledWarehouseCode, decimal handledQty, string handledSupplierBatch, DateTime handledArriveDate, DateTime handledProduceDate, DateTime handledExpireDate,
string handledContainerCode, string handledLot, string handledPackingCode)
{
var detail = GetDetail(id);
detail.HandledFromLocationCode = handledLocationCode;
detail.HandledFromLocationErpCode = handledLocationErpCode;
detail.HandledFromWarehouseCode = handledWarehouseCode;
detail.HandledQty = handledQty;
detail.HandledSupplierBatch = handledSupplierBatch;
detail.HandledArriveDate = handledArriveDate;
detail.HandledProduceDate = handledProduceDate;
detail.HandledExpireDate = handledExpireDate;
detail.HandledContainerCode = handledContainerCode;
detail.HandledLot = handledLot;
detail.HandledPackingCode = handledPackingCode;
await Task.CompletedTask.ConfigureAwait(false);
}
}

479
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/AssembleJobs/AssembleJobDetail.cs

@ -1,40 +1,81 @@
using System;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Domain;
public class AssembleJobDetail : SfsJobRecommendFromDetailEntityBase, IHasToLocation
public class AssembleJobDetail : SfsDetailEntityBase
{
#region 库存基础信息
/// <summary>
/// 请求库位
/// 物品代码
/// </summary>
public string RequestLocationCode { get; set; }
public string ItemCode { get; set; }
/// <summary>
/// 物品名称
/// </summary>
public string ItemName { get; set; }
/// <summary>
/// 物品描述1
/// </summary>
public string ItemDesc1 { get; set; }
/// <summary>
/// 物品描述2
/// </summary>
public string ItemDesc2 { get; set; }
/// <summary>
/// 标包数量
/// </summary>
[Display(Name = "标包数量")]
[Column(TypeName = "decimal(18,6)")]
public decimal StdPackQty { get; set; }
/// <summary>
/// 到库位
/// 库存状态
/// </summary>
public string ToLocationCode { get; set; }
public EnumInventoryStatus Status { get; set; }
/// <summary>
/// 计量单位
/// </summary>
public string Uom { get; set; }
#endregion
#region 请求信息
/// <summary>
/// 请求库位
/// </summary>
public string RequestLocationCode { get; set; }
/// <summary>
/// 到库区
/// </summary>
public string ToLocationArea { get; set; }
public string RequestLocationArea { get; set; }
/// <summary>
/// 到库位组
/// </summary>
public string ToLocationGroup { get; set; }
public string RequestLocationGroup { get; set; }
/// <summary>
/// 到ERP库位
/// </summary>
public string ToLocationErpCode { get; set; }
public string RequestLocationErpCode { get; set; }
/// <summary>
/// 到仓库
/// </summary>
public string ToWarehouseCode { get; set; }
public string RequestWarehouseCode { get; set; }
/// <summary>
/// 在途库库位
@ -47,59 +88,435 @@ public class AssembleJobDetail : SfsJobRecommendFromDetailEntityBase, IHasToLoca
public string ProdLine { get; set; }
/// <summary>
/// 工作中心
/// 位置码
/// </summary>
public string WorkStation { get; set; }
public string PositionCode { get; set; }
/// <summary>
/// 过期时间
/// 推荐的类型
/// </summary>
public DateTime ExpiredTime { get; set; }
public EnumRecommendType RecommendType { get; set; }
/// <summary>
/// 工序
/// 需求数量
/// </summary>
public string Operation { get; set; }
public decimal RequestQty { get; set; }
#endregion
#region 推荐来源
/// <summary>
/// 配送方式
/// 推荐来源托标签
/// </summary>
public EnumDistributionType DistributionType { get; set; }
public string RecommendFromContainerCode { get; set; }
/// <summary>
/// 取整方式
/// 推荐来源箱标签
/// </summary>
public EnumTruncType TruncType { get; set; }
public string RecommendFromPackingCode { get; set; }
/// <summary>
/// 取整后数量
/// 推荐来源批次供应商批次
/// </summary>
public decimal RoundedQty { get; set; }
public string RecommendFromSupplierBatch { get; set; }
/// <summary>
/// 计划拆分规则
/// 推荐来源批次到货时间
/// </summary>
public EnumPlannedSplitRule PlannedSplitRule { get; set; }
public DateTime RecommendFromArriveDate { get; set; }
/// <summary>
/// 计划开始时间
/// 推荐来源批次生产时间
/// </summary>
public DateTime PlanBeginTime { get; set; }
public DateTime RecommendFromProduceDate { get; set; }
/// <summary>
/// 每次配送数量
/// 推荐来源批次过期时间
/// </summary>
public decimal DeliveryQty { get; set; }
public DateTime RecommendFromExpireDate { get; set; }
/// <summary>
/// 位置码
/// 推荐来源批次排序
/// </summary>
public string PositionCode { get; set; }
public string RecommendFromLot { get; set; }
/// <summary>
/// 推荐类型
/// 推荐来源库位
/// </summary>
public EnumRecommendType RecommendType { get; set; }
public string RecommendFromLocationCode { get; set; }
/// <summary>
/// 推荐来源库区
/// </summary>
public string RecommendFromLocationArea { get; set; }
/// <summary>
/// 推荐来源库位组
/// </summary>
public string RecommendFromLocationGroup { get; set; }
/// <summary>
/// 推荐来源ERP库位
/// </summary>
public string RecommendFromLocationErpCode { get; set; }
/// <summary>
/// 推荐来源仓库
/// </summary>
public string RecommendFromWarehouseCode { get; set; }
/// <summary>
/// 推荐来源数量
/// </summary>
public decimal RecommendFromQty { get; set; }
#endregion
#region 推荐目标
/// <summary>
/// 推荐目标托标签
/// </summary>
public string RecommendToContainerCode { get; set; }
/// <summary>
/// 推荐目标箱标签
/// </summary>
public string RecommendToPackingCode { get; set; }
/// <summary>
/// 推荐目标批次供应商批次
/// </summary>
public string RecommendToSupplierBatch { get; set; }
/// <summary>
/// 推荐目标批次到货时间
/// </summary>
public DateTime RecommendToArriveDate { get; set; }
/// <summary>
/// 推荐目标批次生产时间
/// </summary>
public DateTime RecommendToProduceDate { get; set; }
/// <summary>
/// 推荐目标批次过期时间
/// </summary>
public DateTime RecommendToExpireDate { get; set; }
/// <summary>
/// 推荐目标批次排序
/// </summary>
public string RecommendToLot { get; set; }
/// <summary>
/// 推荐目标库位
/// </summary>
public string RecommendToLocationCode { get; set; }
/// <summary>
/// 推荐目标库区
/// </summary>
public string RecommendToLocationArea { get; set; }
/// <summary>
/// 推荐目标库位组
/// </summary>
public string RecommendToLocationGroup { get; set; }
/// <summary>
/// 推荐目标ERP库位
/// </summary>
public string RecommendToLocationErpCode { get; set; }
/// <summary>
/// 推荐目标仓库
/// </summary>
public string RecommendToWarehouseCode { get; set; }
/// <summary>
/// 推荐目标数量
/// </summary>
public decimal RecommendToQty { get; set; }
#endregion
#region 库移来源
/// <summary>
/// 库移来源托标签
/// </summary>
public string TransferLibFromContainerCode { get; set; }
/// <summary>
/// 库移来源箱标签
/// </summary>
public string TransferLibFromPackingCode { get; set; }
/// <summary>
/// 库移来源批次供应商批次
/// </summary>
public string TransferLibFromSupplierBatch { get; set; }
/// <summary>
/// 库移来源批次到货时间
/// </summary>
public DateTime TransferLibFromArriveDate { get; set; }
/// <summary>
/// 库移来源批次生产时间
/// </summary>
public DateTime TransferLibFromProduceDate { get; set; }
/// <summary>
/// 库移来源批次过期时间
/// </summary>
public DateTime TransferLibFromExpireDate { get; set; }
/// <summary>
/// 库移来源批次排序
/// </summary>
public string TransferLibFromLot { get; set; }
/// <summary>
/// 库移来源库位
/// </summary>
public string TransferLibFromLocationCode { get; set; }
/// <summary>
/// 库移来源库区
/// </summary>
public string TransferLibFromLocationArea { get; set; }
/// <summary>
/// 库移来源库位组
/// </summary>
public string TransferLibFromLocationGroup { get; set; }
/// <summary>
/// 库移来源ERP库位
/// </summary>
public string TransferLibFromLocationErpCode { get; set; }
/// <summary>
/// 库移来源仓库
/// </summary>
public string TransferLibFromWarehouseCode { get; set; }
/// <summary>
/// 库移来源数量
/// </summary>
public decimal TransferLibFromQty { get; set; }
#endregion
#region 库移目标
/// <summary>
/// 库移目标托标签
/// </summary>
public string TransferLibToContainerCode { get; set; }
/// <summary>
/// 库移目标箱标签
/// </summary>
public string TransferLibToPackingCode { get; set; }
/// <summary>
/// 库移目标批次供应商批次
/// </summary>
public string TransferLibToSupplierBatch { get; set; }
/// <summary>
/// 库移目标批次到货时间
/// </summary>
public DateTime TransferLibToArriveDate { get; set; }
/// <summary>
/// 库移目标批次生产时间
/// </summary>
public DateTime TransferLibToProduceDate { get; set; }
/// <summary>
/// 库移目标批次过期时间
/// </summary>
public DateTime TransferLibToExpireDate { get; set; }
/// <summary>
/// 库移目标批次排序
/// </summary>
public string TransferLibToLot { get; set; }
/// <summary>
/// 库移目标库位
/// </summary>
public string TransferLibToLocationCode { get; set; }
/// <summary>
/// 库移目标库区
/// </summary>
public string TransferLibToLocationArea { get; set; }
/// <summary>
/// 库移目标库位组
/// </summary>
public string TransferLibToLocationGroup { get; set; }
/// <summary>
/// 库移目标ERP库位
/// </summary>
public string TransferLibToLocationErpCode { get; set; }
/// <summary>
/// 库移目标仓库
/// </summary>
public string TransferLibToWarehouseCode { get; set; }
/// <summary>
/// 库移目标数量
/// </summary>
public decimal TransferLibToQty { get; set; }
#endregion
#region 实际来源
/// <summary>
/// 实际目标托标签
/// </summary>
public string HandledFromContainerCode { get; set; }
/// <summary>
/// 实际箱标签
/// </summary>
public string HandledFromPackingCode { get; set; }
/// <summary>
/// 实际批次供应商批次
/// </summary>
public string HandledFromSupplierBatch { get; set; }
/// <summary>
/// 实际批次到货时间
/// </summary>
public DateTime HandledFromArriveDate { get; set; }
/// <summary>
/// 实际批次生产时间
/// </summary>
public DateTime HandledFromProduceDate { get; set; }
/// <summary>
/// 实际批次过期时间
/// </summary>
public DateTime HandledFromExpireDate { get; set; }
/// <summary>
/// 实际批次排序
/// </summary>
public string HandledFromLot { get; set; }
/// <summary>
/// 实际库位
/// </summary>
public string HandledFromLocationCode { get; set; }
/// <summary>
/// 实际库区
/// </summary>
public string HandledFromLocationArea { get; set; }
/// <summary>
/// 实际库位组
/// </summary>
public string HandledFromLocationGroup { get; set; }
/// <summary>
/// 实际ERP库位
/// </summary>
public string HandledFromLocationErpCode { get; set; }
/// <summary>
/// 实际仓库
/// </summary>
public string HandledFromWarehouseCode { get; set; }
/// <summary>
/// 实际数量
/// </summary>
public decimal HandledFromQty { get; set; }
#endregion
#region 实际目标
/// <summary>
/// 实际目标托标签
/// </summary>
public string HandledToContainerCode { get; set; }
/// <summary>
/// 实际箱标签
/// </summary>
public string HandledToPackingCode { get; set; }
/// <summary>
/// 实际批次供应商批次
/// </summary>
public string HandledToSupplierBatch { get; set; }
/// <summary>
/// 实际批次到货时间
/// </summary>
public DateTime HandledToArriveDate { get; set; }
/// <summary>
/// 实际批次生产时间
/// </summary>
public DateTime HandledToProduceDate { get; set; }
/// <summary>
/// 实际批次过期时间
/// </summary>
public DateTime HandledToExpireDate { get; set; }
/// <summary>
/// 实际批次排序
/// </summary>
public string HandledToLot { get; set; }
/// <summary>
/// 实际库位
/// </summary>
public string HandledToLocationCode { get; set; }
/// <summary>
/// 实际库区
/// </summary>
public string HandledToLocationArea { get; set; }
/// <summary>
/// 实际库位组
/// </summary>
public string HandledToLocationGroup { get; set; }
/// <summary>
/// 实际ERP库位
/// </summary>
public string HandledToLocationErpCode { get; set; }
/// <summary>
/// 实际仓库
/// </summary>
public string HandledToWarehouseCode { get; set; }
/// <summary>
/// 实际数量
/// </summary>
public decimal HandledToQty { get; set; }
#endregion
public void SetId(Guid id)
{

110
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/AssembleJobs/AssembleJobManager.cs

@ -4,19 +4,24 @@ using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Users;
using Volo.Abp.Validation;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
namespace Win_in.Sfs.Wms.Store.Domain;
public class AssembleJobManager : SfsJobManagerBase<AssembleJob, AssembleJobDetail>, IAssembleJobManager
{
private readonly IBalanceAppService _balanceAppService;
private readonly IExpectOutAppService _expectOutAppService;
public AssembleJobManager(
IAssembleJobRepository repository
) : base(repository)
IAssembleJobRepository repository, IBalanceAppService balanceAppService, IExpectOutAppService expectOutAppService) : base(repository)
{
_balanceAppService = balanceAppService;
_expectOutAppService = expectOutAppService;
}
/// <summary>
@ -30,53 +35,88 @@ public class AssembleJobManager : SfsJobManagerBase<AssembleJob, AssembleJobDeta
{
var entity = await Repository.FindAsync(input.Id).ConfigureAwait(false);
foreach (var detail in input.Details)
var inputDetail = input.Details.First();
var detail = entity.Details.First();
var expectOutDtos = await _expectOutAppService.GetListByItemCodeAndStatusAndPackingCodeAsync(detail.ItemCode, detail.HandledFromLocationCode, detail.HandledFromPackingCode, detail.Status, detail.HandledFromLot).ConfigureAwait(false);
if (expectOutDtos.Any())
{
throw new UserFriendlyException($" 箱码:{detail.HandledFromPackingCode}," +
$" 物品代码:{detail.ItemCode}," +
$" 库位代码:{detail.HandledFromLocationCode}," +
$" 状态:{detail.Status}," +
$" 批次:{detail.HandledFromLot}" +
$" 的库存被占用【预计出】");
}
//var balanceDto = await _balanceAppService.GetRealQtyByPackingCodeAndItemCodeAndLocationCodeAndStatusAsync(detail.HandledFromPackingCode, detail.ItemCode, detail.HandledFromLocationCode, detail.Status, detail.HandledFromLot).ConfigureAwait(false);
var balanceDto = await _balanceAppService.GetRealQtyByPackingCodeAndItemCodeAndLocationCodeAndStatusAsync(inputDetail.HandledFromPackingCode, inputDetail.ItemCode, inputDetail.HandledFromLocationCode, inputDetail.Status, inputDetail.HandledFromLot).ConfigureAwait(false);
if (balanceDto.Qty <= 0)
{
//发料子任务 赋值实际转移
await entity.BuildDetail(detail.Id,
detail.HandledFromLocationCode,
detail.HandledFromLocationErpCode,
detail.HandledFromWarehouseCode,
detail.HandledQty,
detail.HandledSupplierBatch,
detail.HandledArriveDate,
detail.HandledProduceDate,
detail.HandledExpireDate,
detail.HandledContainerCode,
detail.HandledLot,
detail.HandledPackingCode).ConfigureAwait(false);
throw new UserFriendlyException($" 箱码:{detail.HandledFromPackingCode}," +
$" 物品代码:{detail.ItemCode}," +
$" 库位代码:{detail.HandledFromLocationCode}," +
$" 状态:{detail.Status}," +
$" 批次:{detail.HandledFromLot}" +
$" 的可用库存不大于0,现在为{balanceDto.Qty},请检查【库存数量】和【预计出】");
}
detail.HandledFromArriveDate = inputDetail.HandledFromArriveDate;
detail.HandledFromContainerCode = inputDetail.HandledFromContainerCode;
detail.HandledFromExpireDate = inputDetail.HandledFromExpireDate;
detail.HandledFromLocationArea = inputDetail.HandledFromLocationArea;
detail.HandledFromLocationCode = inputDetail.HandledFromLocationCode;
detail.HandledFromLocationErpCode = inputDetail.HandledFromLocationErpCode;
detail.HandledFromLocationGroup = inputDetail.HandledFromLocationGroup;
detail.HandledFromLot = inputDetail.HandledFromLot;
detail.HandledFromPackingCode = inputDetail.HandledFromPackingCode;
detail.HandledFromProduceDate = inputDetail.HandledFromProduceDate;
detail.HandledFromQty = inputDetail.HandledFromQty;
detail.HandledFromSupplierBatch = inputDetail.HandledFromSupplierBatch;
detail.HandledFromWarehouseCode = inputDetail.HandledFromWarehouseCode;
detail.HandledToArriveDate = inputDetail.HandledToArriveDate;
detail.HandledToContainerCode = inputDetail.HandledToContainerCode;
detail.HandledToExpireDate = inputDetail.HandledToExpireDate;
detail.HandledToLocationArea = inputDetail.HandledToLocationArea;
detail.HandledToLocationCode = inputDetail.HandledToLocationCode;
detail.HandledToLocationErpCode = inputDetail.HandledToLocationErpCode;
detail.HandledToLocationGroup = inputDetail.HandledToLocationGroup;
detail.HandledToLot = inputDetail.HandledToLot;
detail.HandledToPackingCode = inputDetail.HandledToPackingCode;
detail.HandledToProduceDate = inputDetail.HandledToProduceDate;
detail.HandledToQty = inputDetail.HandledToQty;
detail.HandledToSupplierBatch = inputDetail.HandledToSupplierBatch;
detail.HandledToWarehouseCode = inputDetail.HandledToWarehouseCode;
detail.HandledToPackingCode = string.Empty;
detail.HandledToLot = string.Empty;
detail.HandledToContainerCode = string.Empty;
return await base.CompleteAsync(entity, user).ConfigureAwait(false);
}
public override void CheckDetails(AssembleJob entity, AbpValidationResult result)
public async Task<AssembleJob> GetAsync(Expression<Func<AssembleJob, bool>> expression)
{
var details = entity.Details;
foreach (var detail in details)
{
if (detail.HandledFromLocationCode == null)
{
result.Errors.Add(new ValidationResult($"{detail.HandledFromLocationCode} 不能为空"));
}
}
return await Repository.FindAsync(expression).ConfigureAwait(false);
}
public override async Task<List<AssembleJob>> GetWorkingListByPackingAsync(string packingCode)
{
return await Repository.GetListAsync(c => c.Details.Any(p => p.RecommendPackingCode == packingCode) && c.JobStatus != EnumJobStatus.Closed && c.JobStatus != EnumJobStatus.Cancelled, true).ConfigureAwait(false);
#region 无用
public override Task<List<AssembleJob>> GetWorkingListByPackingAsync(string packingCode)
{
throw new NotImplementedException();
}
public override async Task<List<AssembleJob>> GetWorkingListByContainerAsync(string containerCode)
public override Task<List<AssembleJob>> GetWorkingListByContainerAsync(string containerCode)
{
return await Repository.GetListAsync(c => c.Details.Any(p => p.RecommendContainerCode == containerCode) && c.JobStatus != EnumJobStatus.Closed && c.JobStatus != EnumJobStatus.Cancelled, true).ConfigureAwait(false);
throw new NotImplementedException();
}
public async Task<AssembleJob> GetAsync(Expression<Func<AssembleJob, bool>> expression)
public override void CheckDetails(AssembleJob entity, AbpValidationResult result)
{
return await Repository.FindAsync(expression).ConfigureAwait(false);
throw new NotImplementedException();
}
#endregion
}

46
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJob.cs

@ -8,9 +8,9 @@ using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Jobs.IssueJobs;
/// <summary>
/// 发料任务
/// 涂装发料任务
/// </summary>
[Display(Name = "发料任务")]
[Display(Name = "涂装发料任务")]
public class CoatingIssueJob : SfsJobAggregateRootBase<CoatingIssueJobDetail>
{
/// <summary>
@ -29,13 +29,7 @@ public class CoatingIssueJob : SfsJobAggregateRootBase<CoatingIssueJobDetail>
/// 要货单号
/// </summary>
[IgnoreUpdate]
public string MaterialRequestNumber { get; set; }
/// <summary>
/// 车间
/// </summary>
[IgnoreUpdate]
public string Workshop { get; set; }
public string MaterialRequestNumber { get; set; }
/// <summary>
/// 使用在途库
@ -48,38 +42,6 @@ public class CoatingIssueJob : SfsJobAggregateRootBase<CoatingIssueJobDetail>
/// 任务明细
/// </summary>
[IgnoreUpdate]
public override List<CoatingIssueJobDetail> Details { get; set; } = new List<CoatingIssueJobDetail>();
/// <summary>
/// 设置任务明细的实际库位和实际数量
/// </summary>
/// <param name="id"></param>
/// <param name="handledLocationCode"></param>
/// <param name="handledLocationErpCode"></param>
/// <param name="handledWarehouseCode"></param>
/// <param name="handledQty"></param>
/// <param name="handledBatch"></param>
/// <param name="handledContainerCode"></param>
/// <param name="handledLot"></param>
/// <param name="handledPackingCode"></param>
/// <returns></returns>
public virtual async Task BuildDetail(Guid id, string handledLocationCode, string handledLocationErpCode,
string handledWarehouseCode, decimal handledQty, string handledSupplierBatch, DateTime handledArriveDate, DateTime handledProduceDate, DateTime handledExpireDate,
string handledContainerCode, string handledLot, string handledPackingCode)
{
var detail = GetDetail(id);
detail.HandledFromLocationCode = handledLocationCode;
detail.HandledFromLocationErpCode = handledLocationErpCode;
detail.HandledFromWarehouseCode = handledWarehouseCode;
detail.HandledQty = handledQty;
detail.HandledSupplierBatch = handledSupplierBatch;
detail.HandledArriveDate = handledArriveDate;
detail.HandledProduceDate = handledProduceDate;
detail.HandledExpireDate = handledExpireDate;
detail.HandledContainerCode = handledContainerCode;
detail.HandledLot = handledLot;
detail.HandledPackingCode = handledPackingCode;
await Task.CompletedTask.ConfigureAwait(false);
}
public override List<CoatingIssueJobDetail> Details { get; set; } = new List<CoatingIssueJobDetail>();
}

484
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobDetail.cs

@ -1,41 +1,81 @@
using System;
using System.ComponentModel.DataAnnotations.Schema;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Jobs.IssueJobs;
namespace Win_in.Sfs.Wms.Store.Domain;
public class CoatingIssueJobDetail : SfsJobRecommendFromDetailEntityBase, IHasToLocation
public class CoatingIssueJobDetail : SfsDetailEntityBase
{
#region 库存基础信息
/// <summary>
/// 请求库位
/// 物品代码
/// </summary>
public string RequestLocationCode { get; set; }
public string ItemCode { get; set; }
/// <summary>
/// 物品名称
/// </summary>
public string ItemName { get; set; }
/// <summary>
/// 物品描述1
/// </summary>
public string ItemDesc1 { get; set; }
/// <summary>
/// 物品描述2
/// </summary>
public string ItemDesc2 { get; set; }
/// <summary>
/// 标包数量
/// </summary>
[Display(Name = "标包数量")]
[Column(TypeName = "decimal(18,6)")]
public decimal StdPackQty { get; set; }
/// <summary>
/// 到库位
/// 库存状态
/// </summary>
public string ToLocationCode { get; set; }
public EnumInventoryStatus Status { get; set; }
/// <summary>
/// 计量单位
/// </summary>
public string Uom { get; set; }
#endregion
#region 请求信息
/// <summary>
/// 请求库位
/// </summary>
public string RequestLocationCode { get; set; }
/// <summary>
/// 到库区
/// </summary>
public string ToLocationArea { get; set; }
public string RequestLocationArea { get; set; }
/// <summary>
/// 到库位组
/// </summary>
public string ToLocationGroup { get; set; }
public string RequestLocationGroup { get; set; }
/// <summary>
/// 到ERP库位
/// </summary>
public string ToLocationErpCode { get; set; }
public string RequestLocationErpCode { get; set; }
/// <summary>
/// 到仓库
/// </summary>
public string ToWarehouseCode { get; set; }
public string RequestWarehouseCode { get; set; }
/// <summary>
/// 在途库库位
@ -48,62 +88,438 @@ public class CoatingIssueJobDetail : SfsJobRecommendFromDetailEntityBase, IHasTo
public string ProdLine { get; set; }
/// <summary>
/// 工作中心
/// 位置码
/// </summary>
public string WorkStation { get; set; }
public string PositionCode { get; set; }
/// <summary>
/// 过期时间
/// 推荐的类型
/// </summary>
public DateTime ExpiredTime { get; set; }
public EnumRecommendType RecommendType { get; set; }
/// <summary>
/// 工序
/// 需求数量
/// </summary>
public string Operation { get; set; }
public decimal RequestQty { get; set; }
#endregion
#region 推荐来源
/// <summary>
/// 配送方式
/// 推荐来源托标签
/// </summary>
public EnumDistributionType DistributionType { get; set; }
public string RecommendFromContainerCode { get; set; }
/// <summary>
/// 取整方式
/// 推荐来源箱标签
/// </summary>
public EnumTruncType TruncType { get; set; }
public string RecommendFromPackingCode { get; set; }
/// <summary>
/// 取整后数量
/// 推荐来源批次供应商批次
/// </summary>
public decimal RoundedQty { get; set; }
public string RecommendFromSupplierBatch { get; set; }
/// <summary>
/// 计划拆分规则
/// 推荐来源批次到货时间
/// </summary>
public EnumPlannedSplitRule PlannedSplitRule { get; set; }
public DateTime RecommendFromArriveDate { get; set; }
/// <summary>
/// 计划开始时间
/// 推荐来源批次生产时间
/// </summary>
public DateTime PlanBeginTime { get; set; }
public DateTime RecommendFromProduceDate { get; set; }
/// <summary>
/// 每次配送数量
/// 推荐来源批次过期时间
/// </summary>
public decimal DeliveryQty { get; set; }
public DateTime RecommendFromExpireDate { get; set; }
/// <summary>
/// 位置码
/// 推荐来源批次排序
/// </summary>
public string PositionCode { get; set; }
public string RecommendFromLot { get; set; }
/// <summary>
/// 推荐类型
/// 推荐来源库位
/// </summary>
public EnumRecommendType RecommendType { get; set; }
public string RecommendFromLocationCode { get; set; }
/// <summary>
/// 推荐来源库区
/// </summary>
public string RecommendFromLocationArea { get; set; }
/// <summary>
/// 推荐来源库位组
/// </summary>
public string RecommendFromLocationGroup { get; set; }
/// <summary>
/// 推荐来源ERP库位
/// </summary>
public string RecommendFromLocationErpCode { get; set; }
/// <summary>
/// 推荐来源仓库
/// </summary>
public string RecommendFromWarehouseCode { get; set; }
/// <summary>
/// 推荐来源数量
/// </summary>
public decimal RecommendFromQty { get; set; }
#endregion
#region 推荐目标
/// <summary>
/// 推荐目标托标签
/// </summary>
public string RecommendToContainerCode { get; set; }
/// <summary>
/// 推荐目标箱标签
/// </summary>
public string RecommendToPackingCode { get; set; }
/// <summary>
/// 推荐目标批次供应商批次
/// </summary>
public string RecommendToSupplierBatch { get; set; }
/// <summary>
/// 推荐目标批次到货时间
/// </summary>
public DateTime RecommendToArriveDate { get; set; }
/// <summary>
/// 推荐目标批次生产时间
/// </summary>
public DateTime RecommendToProduceDate { get; set; }
/// <summary>
/// 推荐目标批次过期时间
/// </summary>
public DateTime RecommendToExpireDate { get; set; }
/// <summary>
/// 推荐目标批次排序
/// </summary>
public string RecommendToLot { get; set; }
/// <summary>
/// 推荐目标库位
/// </summary>
public string RecommendToLocationCode { get; set; }
/// <summary>
/// 推荐目标库区
/// </summary>
public string RecommendToLocationArea { get; set; }
/// <summary>
/// 推荐目标库位组
/// </summary>
public string RecommendToLocationGroup { get; set; }
/// <summary>
/// 推荐目标ERP库位
/// </summary>
public string RecommendToLocationErpCode { get; set; }
/// <summary>
/// 推荐目标仓库
/// </summary>
public string RecommendToWarehouseCode { get; set; }
/// <summary>
/// 推荐目标数量
/// </summary>
public decimal RecommendToQty { get; set; }
#endregion
#region 库移来源
/// <summary>
/// 库移来源托标签
/// </summary>
public string TransferLibFromContainerCode { get; set; }
/// <summary>
/// 库移来源箱标签
/// </summary>
public string TransferLibFromPackingCode { get; set; }
/// <summary>
/// 库移来源批次供应商批次
/// </summary>
public string TransferLibFromSupplierBatch { get; set; }
/// <summary>
/// 库移来源批次到货时间
/// </summary>
public DateTime TransferLibFromArriveDate { get; set; }
/// <summary>
/// 库移来源批次生产时间
/// </summary>
public DateTime TransferLibFromProduceDate { get; set; }
/// <summary>
/// 库移来源批次过期时间
/// </summary>
public DateTime TransferLibFromExpireDate { get; set; }
/// <summary>
/// 库移来源批次排序
/// </summary>
public string TransferLibFromLot { get; set; }
/// <summary>
/// 库移来源库位
/// </summary>
public string TransferLibFromLocationCode { get; set; }
/// <summary>
/// 库移来源库区
/// </summary>
public string TransferLibFromLocationArea { get; set; }
/// <summary>
/// 库移来源库位组
/// </summary>
public string TransferLibFromLocationGroup { get; set; }
/// <summary>
/// 库移来源ERP库位
/// </summary>
public string TransferLibFromLocationErpCode { get; set; }
/// <summary>
/// 库移来源仓库
/// </summary>
public string TransferLibFromWarehouseCode { get; set; }
/// <summary>
/// 库移来源数量
/// </summary>
public decimal TransferLibFromQty { get; set; }
#endregion
#region 库移目标
/// <summary>
/// 库移目标托标签
/// </summary>
public string TransferLibToContainerCode { get; set; }
/// <summary>
/// 库移目标箱标签
/// </summary>
public string TransferLibToPackingCode { get; set; }
/// <summary>
/// 库移目标批次供应商批次
/// </summary>
public string TransferLibToSupplierBatch { get; set; }
/// <summary>
/// 库移目标批次到货时间
/// </summary>
public DateTime TransferLibToArriveDate { get; set; }
/// <summary>
/// 库移目标批次生产时间
/// </summary>
public DateTime TransferLibToProduceDate { get; set; }
/// <summary>
/// 库移目标批次过期时间
/// </summary>
public DateTime TransferLibToExpireDate { get; set; }
/// <summary>
/// 库移目标批次排序
/// </summary>
public string TransferLibToLot { get; set; }
/// <summary>
/// 库移目标库位
/// </summary>
public string TransferLibToLocationCode { get; set; }
/// <summary>
/// 库移目标库区
/// </summary>
public string TransferLibToLocationArea { get; set; }
/// <summary>
/// 库移目标库位组
/// </summary>
public string TransferLibToLocationGroup { get; set; }
/// <summary>
/// 库移目标ERP库位
/// </summary>
public string TransferLibToLocationErpCode { get; set; }
/// <summary>
/// 库移目标仓库
/// </summary>
public string TransferLibToWarehouseCode { get; set; }
/// <summary>
/// 库移目标数量
/// </summary>
public decimal TransferLibToQty { get; set; }
#endregion
#region 实际来源
/// <summary>
/// 实际目标托标签
/// </summary>
public string HandledFromContainerCode { get; set; }
/// <summary>
/// 实际箱标签
/// </summary>
public string HandledFromPackingCode { get; set; }
/// <summary>
/// 实际批次供应商批次
/// </summary>
public string HandledFromSupplierBatch { get; set; }
/// <summary>
/// 实际批次到货时间
/// </summary>
public DateTime HandledFromArriveDate { get; set; }
/// <summary>
/// 实际批次生产时间
/// </summary>
public DateTime HandledFromProduceDate { get; set; }
/// <summary>
/// 实际批次过期时间
/// </summary>
public DateTime HandledFromExpireDate { get; set; }
/// <summary>
/// 实际批次排序
/// </summary>
public string HandledFromLot { get; set; }
/// <summary>
/// 实际库位
/// </summary>
public string HandledFromLocationCode { get; set; }
/// <summary>
/// 实际库区
/// </summary>
public string HandledFromLocationArea { get; set; }
/// <summary>
/// 实际库位组
/// </summary>
public string HandledFromLocationGroup { get; set; }
/// <summary>
/// 实际ERP库位
/// </summary>
public string HandledFromLocationErpCode { get; set; }
/// <summary>
/// 实际仓库
/// </summary>
public string HandledFromWarehouseCode { get; set; }
/// <summary>
/// 实际数量
/// </summary>
public decimal HandledFromQty { get; set; }
#endregion
#region 实际目标
/// <summary>
/// 实际目标托标签
/// </summary>
public string HandledToContainerCode { get; set; }
/// <summary>
/// 实际箱标签
/// </summary>
public string HandledToPackingCode { get; set; }
/// <summary>
/// 实际批次供应商批次
/// </summary>
public string HandledToSupplierBatch { get; set; }
/// <summary>
/// 实际批次到货时间
/// </summary>
public DateTime HandledToArriveDate { get; set; }
/// <summary>
/// 实际批次生产时间
/// </summary>
public DateTime HandledToProduceDate { get; set; }
/// <summary>
/// 实际批次过期时间
/// </summary>
public DateTime HandledToExpireDate { get; set; }
/// <summary>
/// 实际批次排序
/// </summary>
public string HandledToLot { get; set; }
/// <summary>
/// 实际库位
/// </summary>
public string HandledToLocationCode { get; set; }
/// <summary>
/// 实际库区
/// </summary>
public string HandledToLocationArea { get; set; }
/// <summary>
/// 实际库位组
/// </summary>
public string HandledToLocationGroup { get; set; }
/// <summary>
/// 实际ERP库位
/// </summary>
public string HandledToLocationErpCode { get; set; }
/// <summary>
/// 实际仓库
/// </summary>
public string HandledToWarehouseCode { get; set; }
/// <summary>
/// 实际数量
/// </summary>
public decimal HandledToQty { get; set; }
#endregion
public void SetId(Guid id)
{
Id = id;
this.Id = id;
}
}

139
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/CoatingIssueJobs/CoatingIssueJobManager.cs

@ -4,20 +4,28 @@ using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Users;
using Volo.Abp.Validation;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Jobs.IssueJobs;
namespace Win_in.Sfs.Wms.Store.Jobs.IssueJobs;
namespace Win_in.Sfs.Wms.Store.Domain;
public class CoatingIssueJobManager : SfsJobManagerBase<CoatingIssueJob, CoatingIssueJobDetail>, ICoatingIssueJobManager
{
private readonly IBalanceAppService _balanceAppService;
private readonly IExpectOutAppService _expectOutAppService;
private readonly ICoatingIssueJobRepository _repository;
public CoatingIssueJobManager(
ICoatingIssueJobRepository repository
) : base(repository)
ICoatingIssueJobRepository repository, IBalanceAppService balanceAppService, IExpectOutAppService expectOutAppService) : base(repository)
{
_balanceAppService = balanceAppService;
_expectOutAppService = expectOutAppService;
_repository= repository;
}
/// <summary>
@ -29,76 +37,91 @@ public class CoatingIssueJobManager : SfsJobManagerBase<CoatingIssueJob, Coating
/// <returns></returns>
public override async Task<CoatingIssueJob> CompleteAsync(CoatingIssueJob input, ICurrentUser user)
{
var entity = await Repository.FindAsync(input.Id).ConfigureAwait(false);
//var entity = await Repository.FindAsync(input.Id).ConfigureAwait(false);
var entity = await _repository.FirstOrDefaultAsync(p=>p.Id == input.Id).ConfigureAwait(false);
foreach (var detail in input.Details)
var inputDetail = input.Details.First();
var detail = entity.Details.First();
var expectOutDtos = await _expectOutAppService.GetListByItemCodeAndStatusAndPackingCodeAsync(detail.ItemCode, detail.HandledFromLocationCode, detail.HandledFromPackingCode, detail.Status, detail.HandledFromLot).ConfigureAwait(false);
if (expectOutDtos.Any())
{
//发料子任务 赋值实际转移
await entity.BuildDetail(detail.Id,
detail.HandledFromLocationCode,
detail.HandledFromLocationErpCode,
detail.HandledFromWarehouseCode,
detail.HandledQty,
detail.HandledSupplierBatch,
detail.HandledArriveDate,
detail.HandledProduceDate,
detail.HandledExpireDate,
detail.HandledContainerCode,
detail.HandledLot,
detail.HandledPackingCode).ConfigureAwait(false);
throw new UserFriendlyException($" 箱码:{detail.HandledFromPackingCode}," +
$" 物品代码:{detail.ItemCode}," +
$" 库位代码:{detail.HandledFromLocationCode}," +
$" 状态:{detail.Status}," +
$" 批次:{detail.HandledFromLot}" +
$" 的库存被占用【预计出】");
}
return await base.CompleteAsync(entity, user).ConfigureAwait(false);
}
public override void CheckDetails(CoatingIssueJob entity, AbpValidationResult result)
{
var details = entity.Details;
foreach (var detail in details)
//var balanceDto = await _balanceAppService.GetRealQtyByPackingCodeAndItemCodeAndLocationCodeAndStatusAsync(detail.HandledFromPackingCode, detail.ItemCode, detail.HandledFromLocationCode, detail.Status, detail.HandledFromLot).ConfigureAwait(false);
var balanceDto = await _balanceAppService.GetRealQtyByPackingCodeAndItemCodeAndLocationCodeAndStatusAsync(inputDetail.HandledFromPackingCode, inputDetail.ItemCode, inputDetail.HandledFromLocationCode, inputDetail.Status, inputDetail.HandledFromLot).ConfigureAwait(false);
if (balanceDto.Qty <= 0)
{
if (detail.HandledFromLocationCode == null)
{
result.Errors.Add(new ValidationResult($"{detail.HandledFromLocationCode} 不能为空"));
}
throw new UserFriendlyException($" 箱码:{detail.HandledFromPackingCode}," +
$" 物品代码:{detail.ItemCode}," +
$" 库位代码:{detail.HandledFromLocationCode}," +
$" 状态:{detail.Status}," +
$" 批次:{detail.HandledFromLot}" +
$" 的可用库存不大于0,现在为{balanceDto.Qty},请检查【库存数量】和【预计出】");
}
}
public override async Task<List<CoatingIssueJob>> GetWorkingListByPackingAsync(string packingCode)
{
return await Repository.GetListAsync(c => c.Details.Any(p => p.RecommendPackingCode == packingCode) && c.JobStatus != EnumJobStatus.Closed && c.JobStatus != EnumJobStatus.Cancelled, true).ConfigureAwait(false);
detail.HandledFromArriveDate = inputDetail.HandledFromArriveDate;
detail.HandledFromContainerCode = inputDetail.HandledFromContainerCode;
detail.HandledFromExpireDate = inputDetail.HandledFromExpireDate;
detail.HandledFromLocationArea = inputDetail.HandledFromLocationArea;
detail.HandledFromLocationCode = inputDetail.HandledFromLocationCode;
detail.HandledFromLocationErpCode = inputDetail.HandledFromLocationErpCode;
detail.HandledFromLocationGroup = inputDetail.HandledFromLocationGroup;
detail.HandledFromLot = inputDetail.HandledFromLot;
detail.HandledFromPackingCode = inputDetail.HandledFromPackingCode;
detail.HandledFromProduceDate = inputDetail.HandledFromProduceDate;
detail.HandledFromQty = inputDetail.HandledFromQty;
detail.HandledFromSupplierBatch = inputDetail.HandledFromSupplierBatch;
detail.HandledFromWarehouseCode = inputDetail.HandledFromWarehouseCode;
detail.HandledToArriveDate = inputDetail.HandledToArriveDate;
detail.HandledToContainerCode = inputDetail.HandledToContainerCode;
detail.HandledToExpireDate = inputDetail.HandledToExpireDate;
detail.HandledToLocationArea = inputDetail.HandledToLocationArea;
detail.HandledToLocationCode = inputDetail.HandledToLocationCode;
detail.HandledToLocationErpCode = inputDetail.HandledToLocationErpCode;
detail.HandledToLocationGroup = inputDetail.HandledToLocationGroup;
detail.HandledToLot = inputDetail.HandledToLot;
detail.HandledToPackingCode = inputDetail.HandledToPackingCode;
detail.HandledToProduceDate = inputDetail.HandledToProduceDate;
detail.HandledToQty = inputDetail.HandledToQty;
detail.HandledToSupplierBatch = inputDetail.HandledToSupplierBatch;
detail.HandledToWarehouseCode = inputDetail.HandledToWarehouseCode;
detail.HandledToPackingCode = string.Empty;
detail.HandledToLot = string.Empty;
detail.HandledToContainerCode = string.Empty;
return await base.CompleteAsync(entity, user).ConfigureAwait(false);
}
public override async Task<List<CoatingIssueJob>> GetWorkingListByContainerAsync(string containerCode)
public async Task<CoatingIssueJob> GetAsync(Expression<Func<CoatingIssueJob, bool>> expression)
{
return await Repository.GetListAsync(c => c.Details.Any(p => p.RecommendContainerCode == containerCode) && c.JobStatus != EnumJobStatus.Closed && c.JobStatus != EnumJobStatus.Cancelled, true).ConfigureAwait(false);
return await Repository.FindAsync(expression).ConfigureAwait(false);
}
///// <summary>
///// 临时修改 解决补料无法拿到订阅错误
///// </summary>
///// <param name="eventData"></param>
///// <returns></returns>
//public virtual async Task<List<CoatingIssueJob>> AddByEtoAsync(MaterialRequestHandledETO eventData)
//{
// var CoatingIssueJobs = await BuildCoatingIssueJobByMaterialRequestAsync(eventData);
// await Repository.InsertManyAsync(CoatingIssueJobs);
#region 无用
// var expectIns = await BuildExpectInAsync(CoatingIssueJobs);
// await _expectInAppService.AddManyAndCalculationAvailableCapacityAsync(expectIns);
public override Task<List<CoatingIssueJob>> GetWorkingListByPackingAsync(string packingCode)
{
throw new NotImplementedException();
}
// return CoatingIssueJobs;
//}
public override Task<List<CoatingIssueJob>> GetWorkingListByContainerAsync(string containerCode)
{
throw new NotImplementedException();
}
//public virtual async Task TestError()
//{
// throw new UserFriendlyException("我是测试的异常");
//}
public async Task<CoatingIssueJob> GetAsync(Expression<Func<CoatingIssueJob, bool>> expression)
public override void CheckDetails(CoatingIssueJob entity, AbpValidationResult result)
{
return await Repository.FindAsync(expression).ConfigureAwait(false);
throw new NotImplementedException();
}
#endregion
}

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/IIssueJobRepository.cs

@ -1,6 +1,6 @@
namespace Win_in.Sfs.Wms.Store.Domain;
public interface IInjectionJobRepository : ISfsJobRepositoryBase<InjectionJob>
public interface IIssueJobRepository : ISfsJobRepositoryBase<IssueJob>
{
}

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/InjectionJobs/IInjectionJobRepository.cs

@ -1,6 +1,6 @@
namespace Win_in.Sfs.Wms.Store.Domain;
public interface IIssueJobRepository : ISfsJobRepositoryBase<IssueJob>
public interface IInjectionJobRepository : ISfsJobRepositoryBase<InjectionJob>
{
}

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/InjectionJobs/InjectionJobManager.cs

@ -49,7 +49,7 @@ public class InjectionJobManager : SfsJobManagerBase<InjectionJob, InjectionJobD
$" 的库存被占用【预计出】");
}
var balanceDto=await _balanceAppService.GetRealQtyByPackingCodeAndItemCodeAndLocationCodeAndStatusAsync(detail.HandledFromPackingCode,detail.ItemCode,detail.HandledFromLocationCode,detail.Status,detail.HandledFromLot).ConfigureAwait(false);
var balanceDto=await _balanceAppService.GetRealQtyByPackingCodeAndItemCodeAndLocationCodeAndStatusAsync(inputDetail.HandledFromPackingCode, inputDetail.ItemCode, inputDetail.HandledFromLocationCode, inputDetail.Status, inputDetail.HandledFromLot).ConfigureAwait(false);
if (balanceDto.Qty <= 0)
{
throw new UserFriendlyException($" 箱码:{detail.HandledFromPackingCode}," +

7
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/IssueNotes/AssembleNotes/AssembleNote.cs

@ -17,12 +17,6 @@ public class AssembleNote : SfsStoreAggregateRootBase<AssembleNoteDetail>, IHasJ
[IgnoreUpdate]
public string JobNumber { get; set; }
/// <summary>
/// 车间
/// </summary>
[IgnoreUpdate]
public string Workshop { get; set; }
/// <summary>
/// 明细列表
/// </summary>
@ -73,5 +67,4 @@ public class AssembleNote : SfsStoreAggregateRootBase<AssembleNoteDetail>, IHasJ
}
}
}

500
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/IssueNotes/AssembleNotes/AssembleNoteDetail.cs

@ -1,43 +1,519 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Domain;
public class AssembleNoteDetail : SfsStoreRecommendFromDetailWithFromToEntityBase
public class AssembleNoteDetail : SfsStoreDetailEntityBase
{
#region 库存基础信息
/// <summary>
/// 发料时间
/// 物品代码
/// </summary>
public DateTime IssueTime { get; set; }
public string ItemCode { get; set; }
/// <summary>
/// 过期时间
/// 物品名称
/// </summary>
public DateTime ExpiredTime { get; set; }
public string ItemName { get; set; }
/// <summary>
/// 生产线
/// 物品描述1
/// </summary>
public string ProdLine { get; set; }
public string ItemDesc1 { get; set; }
/// <summary>
/// 物品描述2
/// </summary>
public string ItemDesc2 { get; set; }
/// <summary>
/// 标包数量
/// </summary>
[Display(Name = "标包数量")]
[Column(TypeName = "decimal(18,6)")]
public decimal StdPackQty { get; set; }
/// <summary>
/// 库存状态
/// </summary>
public EnumInventoryStatus Status { get; set; }
/// <summary>
/// 计量单位
/// </summary>
public string Uom { get; set; }
#endregion
#region 请求信息
/// <summary>
/// 请求库位
/// </summary>
public string RequestLocationCode { get; set; }
/// <summary>
/// 工作中心
/// 到库区
/// </summary>
public string WorkStation { get; set; }
public string RequestLocationArea { get; set; }
/// <summary>
/// 在途库库位
/// 到库位组
/// </summary>
public string RequestLocationGroup { get; set; }
/// <summary>
/// 到ERP库位
/// </summary>
public string RequestLocationErpCode { get; set; }
/// <summary>
/// 到仓库
/// </summary>
public string RequestWarehouseCode { get; set; }
/// <summary>
/// 在途库库位
/// </summary>
public string OnTheWayLocationCode { get; set; }
/// <summary>
/// 位置码
/// 生产线
/// </summary>
public string ProdLine { get; set; }
/// <summary>
/// 位置码
/// </summary>
public string PositionCode { get; set; }
/// <summary>
/// 推荐类型
/// 推荐类型
/// </summary>
public EnumRecommendType RecommendType { get; set; }
/// <summary>
/// 需求数量
/// </summary>
public decimal RequestQty { get; set; }
#endregion
#region 推荐来源
/// <summary>
/// 推荐来源托标签
/// </summary>
public string RecommendFromContainerCode { get; set; }
/// <summary>
/// 推荐来源箱标签
/// </summary>
public string RecommendFromPackingCode { get; set; }
/// <summary>
/// 推荐来源批次供应商批次
/// </summary>
public string RecommendFromSupplierBatch { get; set; }
/// <summary>
/// 推荐来源批次到货时间
/// </summary>
public DateTime RecommendFromArriveDate { get; set; }
/// <summary>
/// 推荐来源批次生产时间
/// </summary>
public DateTime RecommendFromProduceDate { get; set; }
/// <summary>
/// 推荐来源批次过期时间
/// </summary>
public DateTime RecommendFromExpireDate { get; set; }
/// <summary>
/// 推荐来源批次排序
/// </summary>
public string RecommendFromLot { get; set; }
/// <summary>
/// 推荐来源库位
/// </summary>
public string RecommendFromLocationCode { get; set; }
/// <summary>
/// 推荐来源库区
/// </summary>
public string RecommendFromLocationArea { get; set; }
/// <summary>
/// 推荐来源库位组
/// </summary>
public string RecommendFromLocationGroup { get; set; }
/// <summary>
/// 推荐来源ERP库位
/// </summary>
public string RecommendFromLocationErpCode { get; set; }
/// <summary>
/// 推荐来源仓库
/// </summary>
public string RecommendFromWarehouseCode { get; set; }
/// <summary>
/// 推荐来源数量
/// </summary>
public decimal RecommendFromQty { get; set; }
#endregion
#region 推荐目标
/// <summary>
/// 推荐目标托标签
/// </summary>
public string RecommendToContainerCode { get; set; }
/// <summary>
/// 推荐目标箱标签
/// </summary>
public string RecommendToPackingCode { get; set; }
/// <summary>
/// 推荐目标批次供应商批次
/// </summary>
public string RecommendToSupplierBatch { get; set; }
/// <summary>
/// 推荐目标批次到货时间
/// </summary>
public DateTime RecommendToArriveDate { get; set; }
/// <summary>
/// 推荐目标批次生产时间
/// </summary>
public DateTime RecommendToProduceDate { get; set; }
/// <summary>
/// 推荐目标批次过期时间
/// </summary>
public DateTime RecommendToExpireDate { get; set; }
/// <summary>
/// 推荐目标批次排序
/// </summary>
public string RecommendToLot { get; set; }
/// <summary>
/// 推荐目标库位
/// </summary>
public string RecommendToLocationCode { get; set; }
/// <summary>
/// 推荐目标库区
/// </summary>
public string RecommendToLocationArea { get; set; }
/// <summary>
/// 推荐目标库位组
/// </summary>
public string RecommendToLocationGroup { get; set; }
/// <summary>
/// 推荐目标ERP库位
/// </summary>
public string RecommendToLocationErpCode { get; set; }
/// <summary>
/// 推荐目标仓库
/// </summary>
public string RecommendToWarehouseCode { get; set; }
/// <summary>
/// 推荐目标数量
/// </summary>
public decimal RecommendToQty { get; set; }
#endregion
#region 库移来源
/// <summary>
/// 库移来源托标签
/// </summary>
public string TransferLibFromContainerCode { get; set; }
/// <summary>
/// 库移来源箱标签
/// </summary>
public string TransferLibFromPackingCode { get; set; }
/// <summary>
/// 库移来源批次供应商批次
/// </summary>
public string TransferLibFromSupplierBatch { get; set; }
/// <summary>
/// 库移来源批次到货时间
/// </summary>
public DateTime TransferLibFromArriveDate { get; set; }
/// <summary>
/// 库移来源批次生产时间
/// </summary>
public DateTime TransferLibFromProduceDate { get; set; }
/// <summary>
/// 库移来源批次过期时间
/// </summary>
public DateTime TransferLibFromExpireDate { get; set; }
/// <summary>
/// 库移来源批次排序
/// </summary>
public string TransferLibFromLot { get; set; }
/// <summary>
/// 库移来源库位
/// </summary>
public string TransferLibFromLocationCode { get; set; }
/// <summary>
/// 库移来源库区
/// </summary>
public string TransferLibFromLocationArea { get; set; }
/// <summary>
/// 库移来源库位组
/// </summary>
public string TransferLibFromLocationGroup { get; set; }
/// <summary>
/// 库移来源ERP库位
/// </summary>
public string TransferLibFromLocationErpCode { get; set; }
/// <summary>
/// 库移来源仓库
/// </summary>
public string TransferLibFromWarehouseCode { get; set; }
/// <summary>
/// 库移来源数量
/// </summary>
public decimal TransferLibFromQty { get; set; }
#endregion
#region 库移目标
/// <summary>
/// 库移目标托标签
/// </summary>
public string TransferLibToContainerCode { get; set; }
/// <summary>
/// 库移目标箱标签
/// </summary>
public string TransferLibToPackingCode { get; set; }
/// <summary>
/// 库移目标批次供应商批次
/// </summary>
public string TransferLibToSupplierBatch { get; set; }
/// <summary>
/// 库移目标批次到货时间
/// </summary>
public DateTime TransferLibToArriveDate { get; set; }
/// <summary>
/// 库移目标批次生产时间
/// </summary>
public DateTime TransferLibToProduceDate { get; set; }
/// <summary>
/// 库移目标批次过期时间
/// </summary>
public DateTime TransferLibToExpireDate { get; set; }
/// <summary>
/// 库移目标批次排序
/// </summary>
public string TransferLibToLot { get; set; }
/// <summary>
/// 库移目标库位
/// </summary>
public string TransferLibToLocationCode { get; set; }
/// <summary>
/// 库移目标库区
/// </summary>
public string TransferLibToLocationArea { get; set; }
/// <summary>
/// 库移目标库位组
/// </summary>
public string TransferLibToLocationGroup { get; set; }
/// <summary>
/// 库移目标ERP库位
/// </summary>
public string TransferLibToLocationErpCode { get; set; }
/// <summary>
/// 库移目标仓库
/// </summary>
public string TransferLibToWarehouseCode { get; set; }
/// <summary>
/// 库移目标数量
/// </summary>
public decimal TransferLibToQty { get; set; }
#endregion
#region 实际来源
/// <summary>
/// 实际目标托标签
/// </summary>
public string HandledFromContainerCode { get; set; }
/// <summary>
/// 实际箱标签
/// </summary>
public string HandledFromPackingCode { get; set; }
/// <summary>
/// 实际批次供应商批次
/// </summary>
public string HandledFromSupplierBatch { get; set; }
/// <summary>
/// 实际批次到货时间
/// </summary>
public DateTime HandledFromArriveDate { get; set; }
/// <summary>
/// 实际批次生产时间
/// </summary>
public DateTime HandledFromProduceDate { get; set; }
/// <summary>
/// 实际批次过期时间
/// </summary>
public DateTime HandledFromExpireDate { get; set; }
/// <summary>
/// 实际批次排序
/// </summary>
public string HandledFromLot { get; set; }
/// <summary>
/// 实际库位
/// </summary>
public string HandledFromLocationCode { get; set; }
/// <summary>
/// 实际库区
/// </summary>
public string HandledFromLocationArea { get; set; }
/// <summary>
/// 实际库位组
/// </summary>
public string HandledFromLocationGroup { get; set; }
/// <summary>
/// 实际ERP库位
/// </summary>
public string HandledFromLocationErpCode { get; set; }
/// <summary>
/// 实际仓库
/// </summary>
public string HandledFromWarehouseCode { get; set; }
/// <summary>
/// 实际数量
/// </summary>
public decimal HandledFromQty { get; set; }
#endregion
#region 实际目标
/// <summary>
/// 实际目标托标签
/// </summary>
public string HandledToContainerCode { get; set; }
/// <summary>
/// 实际箱标签
/// </summary>
public string HandledToPackingCode { get; set; }
/// <summary>
/// 实际批次供应商批次
/// </summary>
public string HandledToSupplierBatch { get; set; }
/// <summary>
/// 实际批次到货时间
/// </summary>
public DateTime HandledToArriveDate { get; set; }
/// <summary>
/// 实际批次生产时间
/// </summary>
public DateTime HandledToProduceDate { get; set; }
/// <summary>
/// 实际批次过期时间
/// </summary>
public DateTime HandledToExpireDate { get; set; }
/// <summary>
/// 实际批次排序
/// </summary>
public string HandledToLot { get; set; }
/// <summary>
/// 实际库位
/// </summary>
public string HandledToLocationCode { get; set; }
/// <summary>
/// 实际库区
/// </summary>
public string HandledToLocationArea { get; set; }
/// <summary>
/// 实际库位组
/// </summary>
public string HandledToLocationGroup { get; set; }
/// <summary>
/// 实际ERP库位
/// </summary>
public string HandledToLocationErpCode { get; set; }
/// <summary>
/// 实际仓库
/// </summary>
public string HandledToWarehouseCode { get; set; }
/// <summary>
/// 实际数量
/// </summary>
public decimal HandledToQty { get; set; }
#endregion
}

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/IssueNotes/CoatingIssueNotes/CoatingIssueNote.cs

@ -18,12 +18,6 @@ public class CoatingIssueNote : SfsStoreAggregateRootBase<CoatingIssueNoteDetail
[IgnoreUpdate]
public string JobNumber { get; set; }
/// <summary>
/// 车间
/// </summary>
[IgnoreUpdate]
public string Workshop { get; set; }
/// <summary>
/// 明细列表
/// </summary>

503
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/IssueNotes/CoatingIssueNotes/CoatingIssueNoteDetail.cs

@ -1,44 +1,519 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Notes.IssueNotes;
namespace Win_in.Sfs.Wms.Store.Domain;
public class CoatingIssueNoteDetail : SfsStoreRecommendFromDetailWithFromToEntityBase
public class CoatingIssueNoteDetail : SfsStoreDetailEntityBase
{
#region 库存基础信息
/// <summary>
/// 发料时间
/// 物品代码
/// </summary>
public DateTime IssueTime { get; set; }
public string ItemCode { get; set; }
/// <summary>
/// 过期时间
/// 物品名称
/// </summary>
public DateTime ExpiredTime { get; set; }
public string ItemName { get; set; }
/// <summary>
/// 生产线
/// 物品描述1
/// </summary>
public string ProdLine { get; set; }
public string ItemDesc1 { get; set; }
/// <summary>
/// 物品描述2
/// </summary>
public string ItemDesc2 { get; set; }
/// <summary>
/// 标包数量
/// </summary>
[Display(Name = "标包数量")]
[Column(TypeName = "decimal(18,6)")]
public decimal StdPackQty { get; set; }
/// <summary>
/// 库存状态
/// </summary>
public EnumInventoryStatus Status { get; set; }
/// <summary>
/// 计量单位
/// </summary>
public string Uom { get; set; }
#endregion
#region 请求信息
/// <summary>
/// 请求库位
/// </summary>
public string RequestLocationCode { get; set; }
/// <summary>
/// 工作中心
/// 到库区
/// </summary>
public string WorkStation { get; set; }
public string RequestLocationArea { get; set; }
/// <summary>
/// 在途库库位
/// 到库位组
/// </summary>
public string RequestLocationGroup { get; set; }
/// <summary>
/// 到ERP库位
/// </summary>
public string RequestLocationErpCode { get; set; }
/// <summary>
/// 到仓库
/// </summary>
public string RequestWarehouseCode { get; set; }
/// <summary>
/// 在途库库位
/// </summary>
public string OnTheWayLocationCode { get; set; }
/// <summary>
/// 位置码
/// 生产线
/// </summary>
public string ProdLine { get; set; }
/// <summary>
/// 位置码
/// </summary>
public string PositionCode { get; set; }
/// <summary>
/// 推荐类型
/// 推荐类型
/// </summary>
public EnumRecommendType RecommendType { get; set; }
/// <summary>
/// 需求数量
/// </summary>
public decimal RequestQty { get; set; }
#endregion
#region 推荐来源
/// <summary>
/// 推荐来源托标签
/// </summary>
public string RecommendFromContainerCode { get; set; }
/// <summary>
/// 推荐来源箱标签
/// </summary>
public string RecommendFromPackingCode { get; set; }
/// <summary>
/// 推荐来源批次供应商批次
/// </summary>
public string RecommendFromSupplierBatch { get; set; }
/// <summary>
/// 推荐来源批次到货时间
/// </summary>
public DateTime RecommendFromArriveDate { get; set; }
/// <summary>
/// 推荐来源批次生产时间
/// </summary>
public DateTime RecommendFromProduceDate { get; set; }
/// <summary>
/// 推荐来源批次过期时间
/// </summary>
public DateTime RecommendFromExpireDate { get; set; }
/// <summary>
/// 推荐来源批次排序
/// </summary>
public string RecommendFromLot { get; set; }
/// <summary>
/// 推荐来源库位
/// </summary>
public string RecommendFromLocationCode { get; set; }
/// <summary>
/// 推荐来源库区
/// </summary>
public string RecommendFromLocationArea { get; set; }
/// <summary>
/// 推荐来源库位组
/// </summary>
public string RecommendFromLocationGroup { get; set; }
/// <summary>
/// 推荐来源ERP库位
/// </summary>
public string RecommendFromLocationErpCode { get; set; }
/// <summary>
/// 推荐来源仓库
/// </summary>
public string RecommendFromWarehouseCode { get; set; }
/// <summary>
/// 推荐来源数量
/// </summary>
public decimal RecommendFromQty { get; set; }
#endregion
#region 推荐目标
/// <summary>
/// 推荐目标托标签
/// </summary>
public string RecommendToContainerCode { get; set; }
/// <summary>
/// 推荐目标箱标签
/// </summary>
public string RecommendToPackingCode { get; set; }
/// <summary>
/// 推荐目标批次供应商批次
/// </summary>
public string RecommendToSupplierBatch { get; set; }
/// <summary>
/// 推荐目标批次到货时间
/// </summary>
public DateTime RecommendToArriveDate { get; set; }
/// <summary>
/// 推荐目标批次生产时间
/// </summary>
public DateTime RecommendToProduceDate { get; set; }
/// <summary>
/// 推荐目标批次过期时间
/// </summary>
public DateTime RecommendToExpireDate { get; set; }
/// <summary>
/// 推荐目标批次排序
/// </summary>
public string RecommendToLot { get; set; }
/// <summary>
/// 推荐目标库位
/// </summary>
public string RecommendToLocationCode { get; set; }
/// <summary>
/// 推荐目标库区
/// </summary>
public string RecommendToLocationArea { get; set; }
/// <summary>
/// 推荐目标库位组
/// </summary>
public string RecommendToLocationGroup { get; set; }
/// <summary>
/// 推荐目标ERP库位
/// </summary>
public string RecommendToLocationErpCode { get; set; }
/// <summary>
/// 推荐目标仓库
/// </summary>
public string RecommendToWarehouseCode { get; set; }
/// <summary>
/// 推荐目标数量
/// </summary>
public decimal RecommendToQty { get; set; }
#endregion
#region 库移来源
/// <summary>
/// 库移来源托标签
/// </summary>
public string TransferLibFromContainerCode { get; set; }
/// <summary>
/// 库移来源箱标签
/// </summary>
public string TransferLibFromPackingCode { get; set; }
/// <summary>
/// 库移来源批次供应商批次
/// </summary>
public string TransferLibFromSupplierBatch { get; set; }
/// <summary>
/// 库移来源批次到货时间
/// </summary>
public DateTime TransferLibFromArriveDate { get; set; }
/// <summary>
/// 库移来源批次生产时间
/// </summary>
public DateTime TransferLibFromProduceDate { get; set; }
/// <summary>
/// 库移来源批次过期时间
/// </summary>
public DateTime TransferLibFromExpireDate { get; set; }
/// <summary>
/// 库移来源批次排序
/// </summary>
public string TransferLibFromLot { get; set; }
/// <summary>
/// 库移来源库位
/// </summary>
public string TransferLibFromLocationCode { get; set; }
/// <summary>
/// 库移来源库区
/// </summary>
public string TransferLibFromLocationArea { get; set; }
/// <summary>
/// 库移来源库位组
/// </summary>
public string TransferLibFromLocationGroup { get; set; }
/// <summary>
/// 库移来源ERP库位
/// </summary>
public string TransferLibFromLocationErpCode { get; set; }
/// <summary>
/// 库移来源仓库
/// </summary>
public string TransferLibFromWarehouseCode { get; set; }
/// <summary>
/// 库移来源数量
/// </summary>
public decimal TransferLibFromQty { get; set; }
#endregion
#region 库移目标
/// <summary>
/// 库移目标托标签
/// </summary>
public string TransferLibToContainerCode { get; set; }
/// <summary>
/// 库移目标箱标签
/// </summary>
public string TransferLibToPackingCode { get; set; }
/// <summary>
/// 库移目标批次供应商批次
/// </summary>
public string TransferLibToSupplierBatch { get; set; }
/// <summary>
/// 库移目标批次到货时间
/// </summary>
public DateTime TransferLibToArriveDate { get; set; }
/// <summary>
/// 库移目标批次生产时间
/// </summary>
public DateTime TransferLibToProduceDate { get; set; }
/// <summary>
/// 库移目标批次过期时间
/// </summary>
public DateTime TransferLibToExpireDate { get; set; }
/// <summary>
/// 库移目标批次排序
/// </summary>
public string TransferLibToLot { get; set; }
/// <summary>
/// 库移目标库位
/// </summary>
public string TransferLibToLocationCode { get; set; }
/// <summary>
/// 库移目标库区
/// </summary>
public string TransferLibToLocationArea { get; set; }
/// <summary>
/// 库移目标库位组
/// </summary>
public string TransferLibToLocationGroup { get; set; }
/// <summary>
/// 库移目标ERP库位
/// </summary>
public string TransferLibToLocationErpCode { get; set; }
/// <summary>
/// 库移目标仓库
/// </summary>
public string TransferLibToWarehouseCode { get; set; }
/// <summary>
/// 库移目标数量
/// </summary>
public decimal TransferLibToQty { get; set; }
#endregion
#region 实际来源
/// <summary>
/// 实际目标托标签
/// </summary>
public string HandledFromContainerCode { get; set; }
/// <summary>
/// 实际箱标签
/// </summary>
public string HandledFromPackingCode { get; set; }
/// <summary>
/// 实际批次供应商批次
/// </summary>
public string HandledFromSupplierBatch { get; set; }
/// <summary>
/// 实际批次到货时间
/// </summary>
public DateTime HandledFromArriveDate { get; set; }
/// <summary>
/// 实际批次生产时间
/// </summary>
public DateTime HandledFromProduceDate { get; set; }
/// <summary>
/// 实际批次过期时间
/// </summary>
public DateTime HandledFromExpireDate { get; set; }
/// <summary>
/// 实际批次排序
/// </summary>
public string HandledFromLot { get; set; }
/// <summary>
/// 实际库位
/// </summary>
public string HandledFromLocationCode { get; set; }
/// <summary>
/// 实际库区
/// </summary>
public string HandledFromLocationArea { get; set; }
/// <summary>
/// 实际库位组
/// </summary>
public string HandledFromLocationGroup { get; set; }
/// <summary>
/// 实际ERP库位
/// </summary>
public string HandledFromLocationErpCode { get; set; }
/// <summary>
/// 实际仓库
/// </summary>
public string HandledFromWarehouseCode { get; set; }
/// <summary>
/// 实际数量
/// </summary>
public decimal HandledFromQty { get; set; }
#endregion
#region 实际目标
/// <summary>
/// 实际目标托标签
/// </summary>
public string HandledToContainerCode { get; set; }
/// <summary>
/// 实际箱标签
/// </summary>
public string HandledToPackingCode { get; set; }
/// <summary>
/// 实际批次供应商批次
/// </summary>
public string HandledToSupplierBatch { get; set; }
/// <summary>
/// 实际批次到货时间
/// </summary>
public DateTime HandledToArriveDate { get; set; }
/// <summary>
/// 实际批次生产时间
/// </summary>
public DateTime HandledToProduceDate { get; set; }
/// <summary>
/// 实际批次过期时间
/// </summary>
public DateTime HandledToExpireDate { get; set; }
/// <summary>
/// 实际批次排序
/// </summary>
public string HandledToLot { get; set; }
/// <summary>
/// 实际库位
/// </summary>
public string HandledToLocationCode { get; set; }
/// <summary>
/// 实际库区
/// </summary>
public string HandledToLocationArea { get; set; }
/// <summary>
/// 实际库位组
/// </summary>
public string HandledToLocationGroup { get; set; }
/// <summary>
/// 实际ERP库位
/// </summary>
public string HandledToLocationErpCode { get; set; }
/// <summary>
/// 实际仓库
/// </summary>
public string HandledToWarehouseCode { get; set; }
/// <summary>
/// 实际数量
/// </summary>
public decimal HandledToQty { get; set; }
#endregion
}

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/AssembleRequests/AssembleRequestManager.cs

@ -34,7 +34,7 @@ public class AssembleIssueRequestsManager
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
public virtual async Task<AssembleIssueRequests> CreateBynNumberAsync(AssembleIssueRequests entity)
public virtual async Task<AssembleRequest> CreateByNumberAsync(AssembleRequest entity)
{
var number = string.IsNullOrEmpty(entity.Number) ? await GenerateNumberAsync(nameof(AssembleIssueRequests), entity.ActiveDate).ConfigureAwait(false) : entity.Number;
entity.SetIdAndNumberWithDetails(GuidGenerator, number);

3
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/AssembleRequests/IAssembleRequestManager.cs

@ -9,5 +9,6 @@ public interface IAssembleIssueRequestsManager : ISfsStoreRequestManager<Assembl
{
Task CompleteAsync(string number);
Task<AssembleIssueRequests> CreateBynNumberAsync(AssembleIssueRequests entity);
Task<AssembleRequest> CreateByNumberAsync(AssembleRequest entity);
}

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/CoatingMaterialRequests/CoatingMaterialRequestManager.cs

@ -32,7 +32,7 @@ public class CoatingMaterialRequestManager
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
public virtual async Task<CoatingMaterialRequest> CreateBynNumberAsync(CoatingMaterialRequest entity)
public virtual async Task<CoatingMaterialRequest> CreateByNumberAsync(CoatingMaterialRequest entity)
{
var number = string.IsNullOrEmpty(entity.Number) ? await GenerateNumberAsync(nameof(CoatingMaterialRequest), entity.ActiveDate).ConfigureAwait(false) : entity.Number;
entity.SetIdAndNumberWithDetails(GuidGenerator, number);

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/MaterialRequests/CoatingMaterialRequests/ICoatingMaterialRequestManager.cs

@ -10,5 +10,5 @@ public interface ICoatingMaterialRequestManager : ISfsStoreRequestManager<Coatin
{
Task CompleteAsync(string number);
Task<CoatingMaterialRequest> CreateBynNumberAsync(CoatingMaterialRequest entity);
Task<CoatingMaterialRequest> CreateByNumberAsync(CoatingMaterialRequest entity);
}

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestManager.cs

@ -14,15 +14,15 @@ public class ThirdLocationRequestManager
, IThirdLocationRequestManager
{
private readonly IThirdLocationRequestRepository _repository;
private readonly IIssueJobRepository _issueJobRepository;
public ThirdLocationRequestManager(
IThirdLocationRequestRepository repository
, IIssueJobRepository issueJobRepository
) : base(repository)
{
_repository = repository;
_issueJobRepository = issueJobRepository;
}

23
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/IssueJobs/AssembleJobs/AssembleJobDbContextModelCreatingExtensions.cs

@ -22,9 +22,10 @@ public static class AssembleJobDbContextModelCreatingExtensions
b.ConfigureJob<AssembleJob, AssembleJobDetail>();
//Properties
b.Property(q => q.RequestType).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.AssembleIssueRequestsNumber).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.Workshop).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.AssembleRequestNumber).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ProdLine).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.JobType).HasConversion<string>();
b.Property(q => q.JobStatus).HasConversion<string>();
//Relations
b.HasMany(q => q.Details).WithOne().HasForeignKey(d => d.MasterID).IsRequired();
//Indexes
@ -40,25 +41,17 @@ public static class AssembleJobDbContextModelCreatingExtensions
//Configure Sfs base properties
b.ConfigureSfsBase();
//Configure Job base properties
b.ConfigureJobRecommendFromDetail();
//b.ConfigureJobRecommendFromDetail();
//Properties
b.Property(q => q.ExpiredTime).IsRequired();
b.Property(q => q.ToLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ToLocationErpCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ToWarehouseCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ToLocationArea).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ToLocationGroup).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.RequestLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ProdLine).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.WorkStation).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.Operation).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.DistributionType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
b.Property(q => q.TruncType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
b.Property(q => q.PlannedSplitRule).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
b.Property(q => q.OnTheWayLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.PositionCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.OnTheWayLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.PositionCode).HasMaxLength(SfsPropertyConst.CodeLength).IsRequired(false);
b.Property(q => q.RecommendType).HasMaxLength(SfsPropertyConst.CodeLength).HasConversion<string>();
b.Property(q => q.Status).IsRequired().HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
//Relations
//None

21
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/IssueJobs/CoatingIssueJob/CoatingIssueJobDbContextModelCreatingExtensions.cs

@ -24,8 +24,9 @@ public static class CoatingIssueJobDbContextModelCreatingExtensions
//Properties
b.Property(q => q.RequestType).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.MaterialRequestNumber).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.Workshop).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ProdLine).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.JobType).HasConversion<string>();
b.Property(q => q.JobStatus).HasConversion<string>();
//Relations
b.HasMany(q => q.Details).WithOne().HasForeignKey(d => d.MasterID).IsRequired();
//Indexes
@ -41,25 +42,17 @@ public static class CoatingIssueJobDbContextModelCreatingExtensions
//Configure Sfs base properties
b.ConfigureSfsBase();
//Configure Job base properties
b.ConfigureJobRecommendFromDetail();
//b.ConfigureJobRecommendFromDetail();
//Properties
b.Property(q => q.ExpiredTime).IsRequired();
b.Property(q => q.ToLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ToLocationErpCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ToWarehouseCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ToLocationArea).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ToLocationGroup).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.RequestLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ProdLine).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.WorkStation).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.Operation).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.DistributionType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
b.Property(q => q.TruncType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
b.Property(q => q.PlannedSplitRule).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
b.Property(q => q.OnTheWayLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.PositionCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.OnTheWayLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.PositionCode).HasMaxLength(SfsPropertyConst.CodeLength).IsRequired(false);
b.Property(q => q.RecommendType).HasMaxLength(SfsPropertyConst.CodeLength).HasConversion<string>();
b.Property(q => q.Status).IsRequired().HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
//Relations
//None

50
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/IssueNotes/AssembleNotes/AssembleNoteDbContextModelCreatingExtensions.cs

@ -21,7 +21,6 @@ public static class AssembleNoteDbContextModelCreatingExtensions
//Properties
b.Property(q => q.RequestNumber).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.RequestType).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.Workshop).HasMaxLength(SfsPropertyConst.NameLength);
b.Property(q => q.Remark).HasMaxLength(SfsPropertyConst.RemarkLength);
//Relations
@ -32,32 +31,27 @@ public static class AssembleNoteDbContextModelCreatingExtensions
});
builder.Entity<AssembleNoteDetail>(b =>
{
//Configure table & schema name
b.ToTable(options.TablePrefix + nameof(AssembleNoteDetail), options.Schema);
//Configure ABP properties
b.ConfigureByConvention();
//Configure Sfs base properties
b.ConfigureSfsStoreBase();
//Configure Sfs store detail properties
b.ConfigureSfsStoreDetailBase();
//Properties
b.Property(q => q.IssueTime).IsRequired();
b.Property(q => q.ExpiredTime).IsRequired();
b.Property(q => q.ProdLine).HasMaxLength(SfsPropertyConst.NameLength);
b.Property(q => q.WorkStation).HasMaxLength(SfsPropertyConst.NameLength);
b.Property(q => q.OnTheWayLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.FromStatus).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
b.Property(q => q.ToStatus).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
b.Property(q => q.PositionCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.RecommendType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
//Relations
//Indexes
b.HasIndex(q => new { q.Number, q.FromPackingCode, q.FromLocationCode, q.ToLocationCode }).IsUnique();
b.HasIndex(q => new { q.FromPackingCode });
});
{
//Configure table & schema name
b.ToTable(options.TablePrefix + nameof(AssembleNoteDetail), options.Schema);
//Configure ABP properties
b.ConfigureByConvention();
//Configure Sfs base properties
b.ConfigureSfsStoreBase();
//Configure Sfs store detail properties
b.ConfigureSfsStoreDetailBase();
//Properties
b.Property(q => q.ProdLine).HasMaxLength(SfsPropertyConst.NameLength);
b.Property(q => q.OnTheWayLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.PositionCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.RecommendType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
//Relations
//Indexes
b.HasIndex(q => new { q.Number, q.HandledFromPackingCode, q.HandledFromLocationCode, q.HandledToLocationCode }).IsUnique();
b.HasIndex(q => new { q.HandledFromPackingCode });
});
}
}

50
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/IssueNotes/CoatingIssueNoteDbContextModelCreatingExtensions.cs

@ -1,6 +1,7 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.Modeling;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Notes.IssueNotes;
namespace Win_in.Sfs.Wms.Store.EntityFrameworkCore;
@ -21,7 +22,6 @@ public static class CoatingIssueNoteDbContextModelCreatingExtensions
//Properties
b.Property(q => q.RequestNumber).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.RequestType).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.Workshop).HasMaxLength(SfsPropertyConst.NameLength);
b.Property(q => q.Remark).HasMaxLength(SfsPropertyConst.RemarkLength);
//Relations
@ -32,31 +32,27 @@ public static class CoatingIssueNoteDbContextModelCreatingExtensions
});
builder.Entity<CoatingIssueNoteDetail>(b =>
{
//Configure table & schema name
b.ToTable(options.TablePrefix + nameof(CoatingIssueNoteDetail), options.Schema);
//Configure ABP properties
b.ConfigureByConvention();
//Configure Sfs base properties
b.ConfigureSfsStoreBase();
//Configure Sfs store detail properties
b.ConfigureSfsStoreDetailBase();
//Properties
b.Property(q => q.IssueTime).IsRequired();
b.Property(q => q.ExpiredTime).IsRequired();
b.Property(q => q.ProdLine).HasMaxLength(SfsPropertyConst.NameLength);
b.Property(q => q.WorkStation).HasMaxLength(SfsPropertyConst.NameLength);
b.Property(q => q.OnTheWayLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.FromStatus).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
b.Property(q => q.ToStatus).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
b.Property(q => q.RecommendType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
//Relations
//Indexes
b.HasIndex(q => new { q.Number, q.FromPackingCode, q.FromLocationCode, q.ToLocationCode }).IsUnique();
b.HasIndex(q => new { q.FromPackingCode });
});
{
//Configure table & schema name
b.ToTable(options.TablePrefix + nameof(CoatingIssueNoteDetail), options.Schema);
//Configure ABP properties
b.ConfigureByConvention();
//Configure Sfs base properties
b.ConfigureSfsStoreBase();
//Configure Sfs store detail properties
b.ConfigureSfsStoreDetailBase();
//Properties
b.Property(q => q.ProdLine).HasMaxLength(SfsPropertyConst.NameLength);
b.Property(q => q.OnTheWayLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.PositionCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.RecommendType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
//Relations
//Indexes
b.HasIndex(q => new { q.Number, q.HandledFromPackingCode, q.HandledFromLocationCode, q.HandledToLocationCode }).IsUnique();
b.HasIndex(q => new { q.HandledFromPackingCode });
});
}
}

55
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/AssembleJobAutoMapperProfile.cs

@ -23,44 +23,8 @@ public partial class StoreEventAutoMapperProfile : Profile
.Ignore(x => x.ConfirmTime);
CreateMap<AssembleJobDetail, AssembleNoteDetail>()
.ForMember(x => x.FromPackingCode, y => y.MapFrom(d => d.HandledPackingCode))
.ForMember(x => x.ToPackingCode, y => y.MapFrom(d => d.HandledPackingCode))
.ForMember(x => x.SupplierBatch, y => y.MapFrom(d => d.HandledSupplierBatch))
.ForMember(x => x.ArriveDate, y => y.MapFrom(d => d.HandledArriveDate))
.ForMember(x => x.ProduceDate, y => y.MapFrom(d => d.HandledProduceDate))
.ForMember(x => x.ExpireDate, y => y.MapFrom(d => d.HandledExpireDate))
.ForMember(x => x.FromLot, y => y.MapFrom(d => d.HandledLot))
.ForMember(x => x.ToLot, y => y.MapFrom(d => d.HandledLot))
.ForMember(x => x.ToContainerCode, y => y.MapFrom(d => d.HandledContainerCode))
.ForMember(x => x.FromContainerCode, y => y.MapFrom(d => d.HandledContainerCode))
.ForMember(x => x.FromStatus, y => y.MapFrom(d => d.Status))
.ForMember(x => x.ToStatus, y => y.MapFrom(d => d.Status))
.ForMember(x => x.Qty, y => y.MapFrom(d => d.HandledQty))
.ForMember(x => x.IssueTime, y => y.MapFrom(d => DateTime.Now))
.ForMember(x => x.FromLocationCode, y => y.MapFrom(d => d.HandledFromLocationCode))
.ForMember(x => x.FromLocationArea, y => y.MapFrom(d => d.HandledFromLocationArea))
.ForMember(x => x.FromLocationGroup, y => y.MapFrom(d => d.HandledFromLocationGroup))
.ForMember(x => x.FromLocationErpCode, y => y.MapFrom(d => d.HandledFromLocationErpCode))
.ForMember(x => x.FromWarehouseCode, y => y.MapFrom(d => d.HandledFromWarehouseCode))
.ForMember(x => x.ToLocationCode, y => y.MapFrom(d => d.ToLocationCode))
.Ignore(x => x.ToLocationArea)
.Ignore(x => x.ToLocationGroup)
.Ignore(x => x.ToLocationErpCode)
;
CreateMap<AssembleJobDetail, ExpectInEditInput>()
.MapExpectInOutFrom()
.Ignore(x => x.Worker)
.Ignore(x => x.SerialNumber)
.Ignore(x => x.ExtraProperties)
;
CreateMap<AssembleJobDetail, ExpectOutEditInput>()
.MapExpectInOutFrom()
.Ignore(x => x.Worker)
.Ignore(x => x.SerialNumber)
.Ignore(x => x.ExtraProperties);
CreateMap<AssembleJob, AssembleNoteEditInput>()
.ForMember(x => x.RequestNumber, y => y.MapFrom(d => d.AssembleIssueRequestsNumber))
.Ignore(x => x.Confirmed)
@ -68,25 +32,6 @@ public partial class StoreEventAutoMapperProfile : Profile
.Ignore(x => x.ActiveDate)
;
CreateMap<AssembleJobDetail, AssembleNoteDetailInput>()
.ForMember(x => x.Qty, y => y.MapFrom(d => d.HandledQty))
.ForMember(x => x.IssueTime, y => y.MapFrom(d => DateTime.Now))
.ForMember(x => x.FromPackingCode, y => y.MapFrom(d => d.HandledPackingCode))
.ForMember(x => x.ToPackingCode, y => y.MapFrom(d => d.HandledPackingCode))
.ForMember(x => x.FromContainerCode, y => y.MapFrom(d => d.HandledContainerCode))
.ForMember(x => x.ToContainerCode, y => y.MapFrom(d => d.HandledContainerCode))
.ForMember(x => x.FromLot, y => y.MapFrom(d => d.HandledLot))
.ForMember(x => x.ToLot, y => y.MapFrom(d => d.HandledLot))
.ForMember(x => x.SupplierBatch, y => y.MapFrom(d => d.HandledSupplierBatch))
.ForMember(x => x.ArriveDate, y => y.MapFrom(d => d.HandledArriveDate))
.ForMember(x => x.ProduceDate, y => y.MapFrom(d => d.HandledProduceDate))
.ForMember(x => x.ExpireDate, y => y.MapFrom(d => d.ExpiredTime))
.ForMember(x => x.FromLocationCode, y => y.MapFrom(d => d.HandledFromLocationCode))
.ForMember(x => x.FromLocationArea, y => y.MapFrom(d => d.HandledFromLocationArea))
.ForMember(x => x.FromLocationGroup, y => y.MapFrom(d => d.HandledFromLocationGroup))
.ForMember(x => x.FromLocationErpCode, y => y.MapFrom(d => d.HandledFromLocationErpCode))
.ForMember(x => x.FromWarehouseCode, y => y.MapFrom(d => d.HandledFromWarehouseCode))
.ForMember(x => x.FromStatus, y => y.MapFrom(d => d.Status))
.ForMember(x => x.ToStatus, y => y.MapFrom(d => d.Status))
;
}
}

55
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/CoatingIssueJobAutoMapperProfile.cs

@ -25,44 +25,8 @@ public partial class StoreEventAutoMapperProfile : Profile
.Ignore(x => x.ConfirmTime);
CreateMap<CoatingIssueJobDetail, CoatingIssueNoteDetail>()
.ForMember(x => x.FromPackingCode, y => y.MapFrom(d => d.HandledPackingCode))
.ForMember(x => x.ToPackingCode, y => y.MapFrom(d => d.HandledPackingCode))
.ForMember(x => x.SupplierBatch, y => y.MapFrom(d => d.HandledSupplierBatch))
.ForMember(x => x.ArriveDate, y => y.MapFrom(d => d.HandledArriveDate))
.ForMember(x => x.ProduceDate, y => y.MapFrom(d => d.HandledProduceDate))
.ForMember(x => x.ExpireDate, y => y.MapFrom(d => d.HandledExpireDate))
.ForMember(x => x.FromLot, y => y.MapFrom(d => d.HandledLot))
.ForMember(x => x.ToLot, y => y.MapFrom(d => d.HandledLot))
.ForMember(x => x.ToContainerCode, y => y.MapFrom(d => d.HandledContainerCode))
.ForMember(x => x.FromContainerCode, y => y.MapFrom(d => d.HandledContainerCode))
.ForMember(x => x.FromStatus, y => y.MapFrom(d => d.Status))
.ForMember(x => x.ToStatus, y => y.MapFrom(d => d.Status))
.ForMember(x => x.Qty, y => y.MapFrom(d => d.HandledQty))
.ForMember(x => x.IssueTime, y => y.MapFrom(d => DateTime.Now))
.ForMember(x => x.FromLocationCode, y => y.MapFrom(d => d.HandledFromLocationCode))
.ForMember(x => x.FromLocationArea, y => y.MapFrom(d => d.HandledFromLocationArea))
.ForMember(x => x.FromLocationGroup, y => y.MapFrom(d => d.HandledFromLocationGroup))
.ForMember(x => x.FromLocationErpCode, y => y.MapFrom(d => d.HandledFromLocationErpCode))
.ForMember(x => x.FromWarehouseCode, y => y.MapFrom(d => d.HandledFromWarehouseCode))
.ForMember(x => x.ToLocationCode, y => y.MapFrom(d => d.ToLocationCode))
.Ignore(x => x.ToLocationArea)
.Ignore(x => x.ToLocationGroup)
.Ignore(x => x.ToLocationErpCode)
;
CreateMap<CoatingIssueJobDetail, ExpectInEditInput>()
.MapExpectInOutFrom()
.Ignore(x => x.Worker)
.Ignore(x => x.SerialNumber)
.Ignore(x => x.ExtraProperties)
;
CreateMap<CoatingIssueJobDetail, ExpectOutEditInput>()
.MapExpectInOutFrom()
.Ignore(x => x.Worker)
.Ignore(x => x.SerialNumber)
.Ignore(x => x.ExtraProperties);
CreateMap<CoatingIssueJob, CoatingIssueNoteEditInput>()
.ForMember(x => x.RequestNumber, y => y.MapFrom(d => d.MaterialRequestNumber))
.Ignore(x => x.Confirmed)
@ -70,25 +34,6 @@ public partial class StoreEventAutoMapperProfile : Profile
.Ignore(x => x.ActiveDate)
;
CreateMap<CoatingIssueJobDetail, CoatingIssueNoteDetailInput>()
.ForMember(x => x.Qty, y => y.MapFrom(d => d.HandledQty))
.ForMember(x => x.IssueTime, y => y.MapFrom(d => DateTime.Now))
.ForMember(x => x.FromPackingCode, y => y.MapFrom(d =>d.HandledPackingCode))
.ForMember(x => x.ToPackingCode, y => y.MapFrom(d => d.HandledPackingCode))
.ForMember(x => x.FromContainerCode, y => y.MapFrom(d => d.HandledContainerCode))
.ForMember(x => x.ToContainerCode, y => y.MapFrom(d => d.HandledContainerCode))
.ForMember(x => x.FromLot, y => y.MapFrom(d => d.HandledLot))
.ForMember(x => x.ToLot, y => y.MapFrom(d => d.HandledLot))
.ForMember(x => x.SupplierBatch, y => y.MapFrom(d => d.HandledSupplierBatch))
.ForMember(x => x.ArriveDate, y => y.MapFrom(d => d.HandledArriveDate))
.ForMember(x => x.ProduceDate, y => y.MapFrom(d => d.HandledProduceDate))
.ForMember(x => x.ExpireDate, y => y.MapFrom(d => d.ExpiredTime))
.ForMember(x => x.FromLocationCode, y => y.MapFrom(d => d.HandledFromLocationCode))
.ForMember(x => x.FromLocationArea, y => y.MapFrom(d => d.HandledFromLocationArea))
.ForMember(x => x.FromLocationGroup, y => y.MapFrom(d => d.HandledFromLocationGroup))
.ForMember(x => x.FromLocationErpCode, y => y.MapFrom(d => d.HandledFromLocationErpCode))
.ForMember(x => x.FromWarehouseCode, y => y.MapFrom(d => d.HandledFromWarehouseCode))
.ForMember(x => x.FromStatus, y => y.MapFrom(d => d.Status))
.ForMember(x => x.ToStatus, y => y.MapFrom(d => d.Status))
;
}
}

30
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/AssembleNoteAutoMapperProfile.cs

@ -16,6 +16,36 @@ public partial class StoreEventAutoMapperProfile : Profile
.Ignore(x => x.TransType)
.Ignore(x => x.ExtraProperties)
.Ignore(x => x.TransSubType)
.ForMember(x => x.Qty, y => y.MapFrom(t => t.HandledToQty))
.ForMember(x => x.SupplierBatch, y => y.MapFrom(t => t.HandledFromSupplierBatch))
.ForMember(x => x.ArriveDate, y => y.MapFrom(t => t.HandledFromArriveDate))
.ForMember(x => x.ProduceDate, y => y.MapFrom(t => t.HandledFromProduceDate))
.ForMember(x => x.ExpireDate, y => y.MapFrom(t => t.HandledFromExpireDate))
.ForMember(x => x.FromPackingCode, y => y.MapFrom(t => t.HandledFromPackingCode))
.ForMember(x => x.FromContainerCode, y => y.MapFrom(t => t.HandledFromContainerCode))
.ForMember(x => x.FromLot, y => y.MapFrom(t => t.HandledFromLot))
.ForMember(x => x.FromStatus, y => y.MapFrom(t => t.Status))
.ForMember(x => x.FromLocationCode, y => y.MapFrom(t => t.HandledFromLocationCode))
.ForMember(x => x.FromLocationGroup, y => y.MapFrom(t => t.HandledFromLocationGroup))
.ForMember(x => x.FromLocationArea, y => y.MapFrom(t => t.HandledFromLocationArea))
.ForMember(x => x.FromLocationErpCode, y => y.MapFrom(t => t.HandledFromLocationErpCode))
.ForMember(x => x.FromWarehouseCode, y => y.MapFrom(t => t.HandledFromWarehouseCode))
.ForMember(x => x.ToLot, y => y.MapFrom(t => t.HandledToLot))
.ForMember(x => x.ToStatus, y => y.MapFrom(t => t.Status))
.ForMember(x => x.ToPackingCode, y => y.MapFrom(t => t.HandledToPackingCode))
.ForMember(x => x.ToContainerCode, y => y.MapFrom(t => t.HandledToContainerCode))
.ForMember(x => x.ToLocationCode, y => y.MapFrom(t => t.HandledToLocationCode))
.ForMember(x => x.ToLocationGroup, y => y.MapFrom(t => t.HandledToLocationGroup))
.ForMember(x => x.ToLocationArea, y => y.MapFrom(t => t.HandledToLocationArea))
.ForMember(x => x.ToLocationErpCode, y => y.MapFrom(t => t.HandledToLocationErpCode))
.ForMember(x => x.ToWarehouseCode, y => y.MapFrom(t => t.HandledToWarehouseCode))
;
}

30
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/CoatingIssueNoteAutoMapperProfile.cs

@ -17,6 +17,36 @@ public partial class StoreEventAutoMapperProfile : Profile
.Ignore(x => x.TransType)
.Ignore(x => x.ExtraProperties)
.Ignore(x => x.TransSubType)
.ForMember(x => x.Qty, y => y.MapFrom(t => t.HandledToQty))
.ForMember(x => x.SupplierBatch, y => y.MapFrom(t => t.HandledFromSupplierBatch))
.ForMember(x => x.ArriveDate, y => y.MapFrom(t => t.HandledFromArriveDate))
.ForMember(x => x.ProduceDate, y => y.MapFrom(t => t.HandledFromProduceDate))
.ForMember(x => x.ExpireDate, y => y.MapFrom(t => t.HandledFromExpireDate))
.ForMember(x => x.FromPackingCode, y => y.MapFrom(t => t.HandledFromPackingCode))
.ForMember(x => x.FromContainerCode, y => y.MapFrom(t => t.HandledFromContainerCode))
.ForMember(x => x.FromLot, y => y.MapFrom(t => t.HandledFromLot))
.ForMember(x => x.FromStatus, y => y.MapFrom(t => t.Status))
.ForMember(x => x.FromLocationCode, y => y.MapFrom(t => t.HandledFromLocationCode))
.ForMember(x => x.FromLocationGroup, y => y.MapFrom(t => t.HandledFromLocationGroup))
.ForMember(x => x.FromLocationArea, y => y.MapFrom(t => t.HandledFromLocationArea))
.ForMember(x => x.FromLocationErpCode, y => y.MapFrom(t => t.HandledFromLocationErpCode))
.ForMember(x => x.FromWarehouseCode, y => y.MapFrom(t => t.HandledFromWarehouseCode))
.ForMember(x => x.ToLot, y => y.MapFrom(t => t.HandledToLot))
.ForMember(x => x.ToStatus, y => y.MapFrom(t => t.Status))
.ForMember(x => x.ToPackingCode, y => y.MapFrom(t => t.HandledToPackingCode))
.ForMember(x => x.ToContainerCode, y => y.MapFrom(t => t.HandledToContainerCode))
.ForMember(x => x.ToLocationCode, y => y.MapFrom(t => t.HandledToLocationCode))
.ForMember(x => x.ToLocationGroup, y => y.MapFrom(t => t.HandledToLocationGroup))
.ForMember(x => x.ToLocationArea, y => y.MapFrom(t => t.HandledToLocationArea))
.ForMember(x => x.ToLocationErpCode, y => y.MapFrom(t => t.HandledToLocationErpCode))
.ForMember(x => x.ToWarehouseCode, y => y.MapFrom(t => t.HandledToWarehouseCode))
;
}

228
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/AssembleJobEventHandler.cs

@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
@ -7,25 +6,31 @@ using Volo.Abp.Uow;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Event;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Event.BusinessJob;
public class AssembleJobEventHandler :
StoreEventHandlerBase
, ILocalEventHandler<SfsCompletedEntityEventData<AssembleJob>>
, ILocalEventHandler<SfsCreatedEntityEventData<AssembleJob>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<AssembleJob>>>
{
private const EnumTransType TransType = EnumTransType.Issue;
private readonly IAssembleNoteAppService _assembleNoteAppService;
private readonly IExpectOutAppService _expectOutAppService;
private readonly ILocationAppService _locationAppService;
private readonly ITransferLibRequestAppService _transferLibRequestAppService;
public AssembleJobEventHandler(IAssembleNoteAppService assembleNoteAppService, ILocationAppService locationAppService)
public AssembleJobEventHandler(IAssembleNoteAppService assembleNoteAppService,
IExpectOutAppService expectOutAppService,
ILocationAppService locationAppService, ITransferLibRequestAppService transferLibRequestAppService)
{
_assembleNoteAppService = assembleNoteAppService;
_expectOutAppService = expectOutAppService;
_locationAppService = locationAppService;
_transferLibRequestAppService = transferLibRequestAppService;
}
/// <summary>
@ -41,8 +46,146 @@ public class AssembleJobEventHandler :
await _assembleNoteAppService.CreateAsync(assembleNote).ConfigureAwait(false);
}
/// <summary>
/// 创建后
/// </summary>
/// <param name="eventData"></param>
/// <returns></returns>
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<AssembleJob> eventData)
{
var entity = eventData.Entity;
await CreateExpectOutAsync(entity).ConfigureAwait(false);
await CreateTransferLibAsync(entity).ConfigureAwait(false);
}
/// <summary>
/// 批量创建后
/// </summary>
/// <param name="eventData"></param>
/// <returns></returns>
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<List<AssembleJob>> eventData)
{
var entitys = eventData.Entity;
foreach (var entity in entitys)
{
await CreateExpectOutAsync(entity).ConfigureAwait(false);
await CreateTransferLibAsync(entity).ConfigureAwait(false);
}
}
#region 私有
/// <summary>
/// 创建预计出
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
private async Task CreateExpectOutAsync(AssembleJob entity)
{
var expectOutEditInputs = new List<ExpectOutEditInput>();
foreach (var detail in entity.Details)
{
var inputoExpectOutEditInput = new ExpectOutEditInput();
inputoExpectOutEditInput.JobNumber = entity.Number;
inputoExpectOutEditInput.ItemCode = detail.ItemCode;
inputoExpectOutEditInput.Qty = detail.RecommendFromQty;
inputoExpectOutEditInput.LocationCode = detail.RecommendFromLocationCode;
inputoExpectOutEditInput.ArriveDate = detail.RecommendFromArriveDate;
inputoExpectOutEditInput.ContainerCode = detail.RecommendFromContainerCode;
inputoExpectOutEditInput.ExpireDate = detail.RecommendFromExpireDate;
inputoExpectOutEditInput.ItemDesc1 = detail.ItemDesc1;
inputoExpectOutEditInput.ItemDesc2 = detail.ItemDesc2;
inputoExpectOutEditInput.ItemName = detail.ItemName;
inputoExpectOutEditInput.LocationArea = detail.RecommendFromLocationArea;
inputoExpectOutEditInput.LocationGroup = detail.RecommendFromLocationGroup;
inputoExpectOutEditInput.LocationErpCode = detail.RecommendFromLocationErpCode;
inputoExpectOutEditInput.PackingCode = detail.RecommendFromPackingCode;
inputoExpectOutEditInput.Lot = detail.RecommendFromLot;
inputoExpectOutEditInput.ProduceDate = detail.RecommendFromProduceDate;
inputoExpectOutEditInput.Status = detail.Status;
inputoExpectOutEditInput.Uom = detail.Uom;
inputoExpectOutEditInput.SupplierBatch = detail.RecommendFromSupplierBatch;
inputoExpectOutEditInput.WarehouseCode = detail.RecommendFromWarehouseCode;
expectOutEditInputs.Add(inputoExpectOutEditInput);
}
await _expectOutAppService.AddManyAsync(expectOutEditInputs).ConfigureAwait(false);
await Task.CompletedTask.ConfigureAwait(false);
}
/// <summary>
/// 根据是否在 第一层 来创建 是否生成库移任务
/// </summary>
/// <returns></returns>
private async Task CreateTransferLibAsync(AssembleJob assembleJob)
{
if (!await IsMinRowAsync(assembleJob).ConfigureAwait(false))
{
foreach (var detail in assembleJob.Details)
{
var input = new TransferLibRequestEditInput();
input.CallBusinessType = nameof(IAssembleJobAppService);
input.CallJobNumber = assembleJob.Number;
input.CallRequestNumber = assembleJob.AssembleRequestNumber;
input.CallServerName = "Win_in.Sfs.Wms.Store.Application.AssembleJobAppService";
input.Type = "Transfer_Warehouse";
input.UseOnTheWayLocation = true;
var detailInput = new TransferLibRequestDetailInput();
detailInput.CallBusinessType = nameof(IAssembleJobAppService);
detailInput.CallRequestNumber = assembleJob.AssembleRequestNumber;
detailInput.CallServerName = "Win_in.Sfs.Wms.Store.Application.AssembleJobAppService";
detailInput.CallJobNumber = assembleJob.Number;
detailInput.JobStatus = EnumJobStatus.Open;
detailInput.ItemCode = detail.ItemCode;
detailInput.StdPackQty = detail.StdPackQty;
detailInput.Uom = detail.Uom;
detailInput.Status = detail.Status;
detailInput.RecommendFromQty = detail.RecommendFromQty;
detailInput.RecommendFromLot = detail.RecommendFromLot;
detailInput.RecommendFromPackingCode = detailInput.RecommendFromPackingCode;
detailInput.RecommendToLot = detail.RecommendToLot;
detailInput.RecommendFromArriveDate = detail.RecommendFromArriveDate;
detailInput.RecommendFromExpireDate = detail.RecommendFromExpireDate;
detailInput.RecommendFromProduceDate = detail.RecommendFromProduceDate;
detailInput.RecommendFromSupplierBatch = detail.RecommendFromSupplierBatch;
detailInput.RecommendFromLocationCode = detail.RecommendFromLocationCode;
detailInput.RecommendFromLocationGroup = detail.RecommendFromLocationGroup;
detailInput.RecommendFromLocationArea = detail.RecommendFromLocationArea;
detailInput.RecommendFromLocationErpCode = detail.RecommendFromLocationErpCode;
detailInput.RecommendFromWarehouseCode = detail.RecommendFromWarehouseCode;
detailInput.RecommendToQty = detail.RecommendToQty;
detailInput.RecommendToLot = detail.RecommendToLot;
detailInput.RecommendToPackingCode = detailInput.RecommendToPackingCode;
detailInput.RecommendToLot = detail.RecommendToLot;
detailInput.RecommendToArriveDate = detail.RecommendToArriveDate;
detailInput.RecommendToExpireDate = detail.RecommendToExpireDate;
detailInput.RecommendToProduceDate = detail.RecommendToProduceDate;
detailInput.RecommendToSupplierBatch = detail.RecommendToSupplierBatch;
detailInput.RecommendToLocationCode = detail.RecommendToLocationCode;
detailInput.RecommendToLocationGroup = detail.RecommendToLocationGroup;
detailInput.RecommendToLocationArea = detail.RecommendToLocationArea;
detailInput.RecommendToLocationErpCode = detail.RecommendToLocationErpCode;
detailInput.RecommendToWarehouseCode = detail.RecommendToWarehouseCode;
await _transferLibRequestAppService.CreateAsync(input).ConfigureAwait(false);
}
}
}
/// <summary>
/// 创建补料记录实体
/// </summary>
@ -52,78 +195,29 @@ public class AssembleJobEventHandler :
{
var assembleNoteCreateInput = ObjectMapper.Map<AssembleJob, AssembleNoteEditInput>(entity);
assembleNoteCreateInput.JobNumber = entity.Number;
var locationCodes = assembleNoteCreateInput.Details.Select(p => p.ToLocationCode).Distinct().ToList();
var locations = await _locationAppService.GetByCodesAsync(locationCodes).ConfigureAwait(false);
assembleNoteCreateInput.Details.RemoveAll(p => p.Qty == 0);
foreach (var detail in assembleNoteCreateInput.Details)
{
var location = locations.First(p => p.Code == detail.ToLocationCode);
await RemovePackingCodeAndContainerCodeAndLotAsync(detail, location.Type).ConfigureAwait(false); //去箱 去托 去批
detail.ToLocationArea = location.AreaCode;
detail.ToLocationGroup = location.LocationGroupCode;
detail.ToLocationErpCode = location.ErpLocationCode;
detail.ToWarehouseCode = location.WarehouseCode;
}
await Task.CompletedTask.ConfigureAwait(false);
return assembleNoteCreateInput;
}
/// <summary>
/// 去除箱码 托码 批次
/// 判断是不是在最底层 如果不是则把状态变更为等待
/// </summary>
private async Task RemovePackingCodeAndContainerCodeAndLotAsync(AssembleNoteDetailInput assembleNoteDetail,
EnumLocationType locationType)
/// <param name="assembleJob"></param>
/// <returns></returns>
private async Task<bool> IsMinRowAsync(AssembleJob assembleJob)
{
switch (locationType)
var detail = assembleJob.Details.FirstOrDefault();
var loctionDto = await _locationAppService.GetByCodeAsync(detail.RecommendFromLocationCode)
.ConfigureAwait(false);
if (loctionDto.RowCode == 1)
{
case EnumLocationType.WIP:
{
//用开关控制 发料到线边后去除箱码和托码 ???
if (await SettingManager.IsTrueAsync(StoreSettings.Issue.ToWip.IsRemovePackingCode)
.ConfigureAwait(false))
{
assembleNoteDetail.ToPackingCode = "";
}
if (await SettingManager.IsTrueAsync(StoreSettings.Issue.ToWip.IsRemoveContainerCode)
.ConfigureAwait(false))
{
assembleNoteDetail.ToContainerCode = "";
}
if (await SettingManager.IsTrueAsync(StoreSettings.Issue.ToWip.IsRemoveLot).ConfigureAwait(false))
{
assembleNoteDetail.ToLot = "";
}
break;
}
case EnumLocationType.SEMI:
{
//用开关控制 发料到后去除箱码和托码 ???
if (await SettingManager.IsTrueAsync(StoreSettings.Issue.ToSemi.IsRemovePackingCode)
.ConfigureAwait(false))
{
assembleNoteDetail.ToPackingCode = "";
}
if (await SettingManager.IsTrueAsync(StoreSettings.Issue.ToSemi.IsRemoveContainerCode)
.ConfigureAwait(false))
{
assembleNoteDetail.ToContainerCode = "";
}
if (await SettingManager.IsTrueAsync(StoreSettings.Issue.ToSemi.IsRemoveLot).ConfigureAwait(false))
{
assembleNoteDetail.ToLot = "";
}
break;
}
return true;
}
return false;
}
#endregion

240
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/CoatingIssueJobEventHandler.cs

@ -1,4 +1,3 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
@ -7,9 +6,9 @@ using Volo.Abp.Uow;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Event;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Domain.Shared;
using Win_in.Sfs.Wms.Store.Jobs.IssueJobs;
using Win_in.Sfs.Wms.Store.Notes.IssueNotes;
@ -18,16 +17,22 @@ namespace Win_in.Sfs.Wms.Store.Event.BusinessJob;
public class CoatingIssueJobEventHandler :
StoreEventHandlerBase
, ILocalEventHandler<SfsCompletedEntityEventData<CoatingIssueJob>>
, ILocalEventHandler<SfsCreatedEntityEventData<CoatingIssueJob>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<CoatingIssueJob>>>
{
private const EnumTransType TransType = EnumTransType.Issue;
private readonly ICoatingIssueNoteAppService _issueNoteAppService;
private readonly ICoatingIssueNoteAppService _coatingIssueNoteAppService;
private readonly IExpectOutAppService _expectOutAppService;
private readonly ILocationAppService _locationAppService;
private readonly ITransferLibRequestAppService _transferLibRequestAppService;
public CoatingIssueJobEventHandler(ICoatingIssueNoteAppService issueNoteAppService, ILocationAppService locationAppService)
public CoatingIssueJobEventHandler(ICoatingIssueNoteAppService coatingIssueNoteAppService,
IExpectOutAppService expectOutAppService,
ILocationAppService locationAppService, ITransferLibRequestAppService transferLibRequestAppService)
{
_issueNoteAppService = issueNoteAppService;
_coatingIssueNoteAppService = coatingIssueNoteAppService;
_expectOutAppService = expectOutAppService;
_locationAppService = locationAppService;
_transferLibRequestAppService = transferLibRequestAppService;
}
/// <summary>
@ -39,94 +44,183 @@ public class CoatingIssueJobEventHandler :
public virtual async Task HandleEventAsync(SfsCompletedEntityEventData<CoatingIssueJob> eventData)
{
var entity = eventData.Entity;
var issueNote = await BuildIssueNoteAsync(entity).ConfigureAwait(false);
await _issueNoteAppService.CreateAsync(issueNote).ConfigureAwait(false);
var coatingIssueNote = await BuildCoatingIssueNoteAsync(entity).ConfigureAwait(false);
await _coatingIssueNoteAppService.CreateAsync(coatingIssueNote).ConfigureAwait(false);
}
#region 私有
/// <summary>
/// 创建补料记录实体
/// 创建后
/// </summary>
/// <param name="entity"></param>
/// <param name="eventData"></param>
/// <returns></returns>
private async Task<CoatingIssueNoteEditInput> BuildIssueNoteAsync(CoatingIssueJob entity)
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<CoatingIssueJob> eventData)
{
var issueNoteCreateInput = ObjectMapper.Map<CoatingIssueJob, CoatingIssueNoteEditInput>(entity);
issueNoteCreateInput.JobNumber = entity.Number;
var locationCodes = issueNoteCreateInput.Details.Select(p => p.ToLocationCode).Distinct().ToList();
var locations = await _locationAppService.GetByCodesAsync(locationCodes).ConfigureAwait(false);
var entity = eventData.Entity;
issueNoteCreateInput.Details.RemoveAll(p => p.Qty == 0);
await CreateExpectOutAsync(entity).ConfigureAwait(false);
foreach (var detail in issueNoteCreateInput.Details)
await CreateTransferLibAsync(entity).ConfigureAwait(false);
}
/// <summary>
/// 批量创建后
/// </summary>
/// <param name="eventData"></param>
/// <returns></returns>
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<List<CoatingIssueJob>> eventData)
{
var entitys = eventData.Entity;
foreach (var entity in entitys)
{
var location = locations.First(p => p.Code == detail.ToLocationCode);
await RemovePackingCodeAndContainerCodeAndLotAsync(detail, location.Type).ConfigureAwait(false); //去箱 去托 去批
await CreateExpectOutAsync(entity).ConfigureAwait(false);
await CreateTransferLibAsync(entity).ConfigureAwait(false);
}
}
#region 私有
detail.ToLocationArea = location.AreaCode;
detail.ToLocationGroup = location.LocationGroupCode;
detail.ToLocationErpCode = location.ErpLocationCode;
detail.ToWarehouseCode = location.WarehouseCode;
/// <summary>
/// 创建预计出
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
private async Task CreateExpectOutAsync(CoatingIssueJob entity)
{
var expectOutEditInputs = new List<ExpectOutEditInput>();
foreach (var detail in entity.Details)
{
var inputoExpectOutEditInput = new ExpectOutEditInput();
inputoExpectOutEditInput.JobNumber = entity.Number;
inputoExpectOutEditInput.ItemCode = detail.ItemCode;
inputoExpectOutEditInput.Qty = detail.RecommendFromQty;
inputoExpectOutEditInput.LocationCode = detail.RecommendFromLocationCode;
inputoExpectOutEditInput.ArriveDate = detail.RecommendFromArriveDate;
inputoExpectOutEditInput.ContainerCode = detail.RecommendFromContainerCode;
inputoExpectOutEditInput.ExpireDate = detail.RecommendFromExpireDate;
inputoExpectOutEditInput.ItemDesc1 = detail.ItemDesc1;
inputoExpectOutEditInput.ItemDesc2 = detail.ItemDesc2;
inputoExpectOutEditInput.ItemName = detail.ItemName;
inputoExpectOutEditInput.LocationArea = detail.RecommendFromLocationArea;
inputoExpectOutEditInput.LocationGroup = detail.RecommendFromLocationGroup;
inputoExpectOutEditInput.LocationErpCode = detail.RecommendFromLocationErpCode;
inputoExpectOutEditInput.PackingCode = detail.RecommendFromPackingCode;
inputoExpectOutEditInput.Lot = detail.RecommendFromLot;
inputoExpectOutEditInput.ProduceDate = detail.RecommendFromProduceDate;
inputoExpectOutEditInput.Status = detail.Status;
inputoExpectOutEditInput.Uom = detail.Uom;
inputoExpectOutEditInput.SupplierBatch = detail.RecommendFromSupplierBatch;
inputoExpectOutEditInput.WarehouseCode = detail.RecommendFromWarehouseCode;
expectOutEditInputs.Add(inputoExpectOutEditInput);
}
return issueNoteCreateInput;
await _expectOutAppService.AddManyAsync(expectOutEditInputs).ConfigureAwait(false);
await Task.CompletedTask.ConfigureAwait(false);
}
/// <summary>
/// 去除箱码 托码 批次
/// 根据是否在 第一层 来创建 是否生成库移任务
/// </summary>
private async Task RemovePackingCodeAndContainerCodeAndLotAsync(CoatingIssueNoteDetailInput issueNoteDetail,
EnumLocationType locationType)
/// <returns></returns>
private async Task CreateTransferLibAsync(CoatingIssueJob coatingIssueJob)
{
switch (locationType)
if (!await IsMinRowAsync(coatingIssueJob).ConfigureAwait(false))
{
case EnumLocationType.WIP:
foreach (var detail in coatingIssueJob.Details)
{
//用开关控制 发料到线边后去除箱码和托码 ???
if (await SettingManager.IsTrueAsync(StoreSettings.Issue.ToWip.IsRemovePackingCode)
.ConfigureAwait(false))
{
issueNoteDetail.ToPackingCode = "";
}
if (await SettingManager.IsTrueAsync(StoreSettings.Issue.ToWip.IsRemoveContainerCode)
.ConfigureAwait(false))
{
issueNoteDetail.ToContainerCode = "";
}
if (await SettingManager.IsTrueAsync(StoreSettings.Issue.ToWip.IsRemoveLot).ConfigureAwait(false))
{
issueNoteDetail.ToLot = "";
}
break;
}
case EnumLocationType.SEMI:
{
//用开关控制 发料到后去除箱码和托码 ???
if (await SettingManager.IsTrueAsync(StoreSettings.Issue.ToSemi.IsRemovePackingCode)
.ConfigureAwait(false))
{
issueNoteDetail.ToPackingCode = "";
}
if (await SettingManager.IsTrueAsync(StoreSettings.Issue.ToSemi.IsRemoveContainerCode)
.ConfigureAwait(false))
{
issueNoteDetail.ToContainerCode = "";
}
if (await SettingManager.IsTrueAsync(StoreSettings.Issue.ToSemi.IsRemoveLot).ConfigureAwait(false))
{
issueNoteDetail.ToLot = "";
}
break;
var input = new TransferLibRequestEditInput();
input.CallBusinessType = nameof(ICoatingIssueJobAppService);
input.CallJobNumber = coatingIssueJob.Number;
input.CallRequestNumber = coatingIssueJob.MaterialRequestNumber;
input.CallServerName = "Win_in.Sfs.Wms.Store.Application.CoatingIssueJobAppService";
input.Type = "Transfer_Warehouse";
input.UseOnTheWayLocation = true;
var detailInput = new TransferLibRequestDetailInput();
detailInput.CallBusinessType = nameof(ICoatingIssueJobAppService);
detailInput.CallRequestNumber = coatingIssueJob.MaterialRequestNumber;
detailInput.CallServerName = "Win_in.Sfs.Wms.Store.Application.CoatingIssueJobAppService";
detailInput.CallJobNumber = coatingIssueJob.Number;
detailInput.JobStatus = EnumJobStatus.Open;
detailInput.ItemCode = detail.ItemCode;
detailInput.StdPackQty = detail.StdPackQty;
detailInput.Uom = detail.Uom;
detailInput.Status = detail.Status;
detailInput.RecommendFromQty = detail.RecommendFromQty;
detailInput.RecommendFromLot = detail.RecommendFromLot;
detailInput.RecommendFromPackingCode = detailInput.RecommendFromPackingCode;
detailInput.RecommendToLot = detail.RecommendToLot;
detailInput.RecommendFromArriveDate = detail.RecommendFromArriveDate;
detailInput.RecommendFromExpireDate = detail.RecommendFromExpireDate;
detailInput.RecommendFromProduceDate = detail.RecommendFromProduceDate;
detailInput.RecommendFromSupplierBatch = detail.RecommendFromSupplierBatch;
detailInput.RecommendFromLocationCode = detail.RecommendFromLocationCode;
detailInput.RecommendFromLocationGroup = detail.RecommendFromLocationGroup;
detailInput.RecommendFromLocationArea = detail.RecommendFromLocationArea;
detailInput.RecommendFromLocationErpCode = detail.RecommendFromLocationErpCode;
detailInput.RecommendFromWarehouseCode = detail.RecommendFromWarehouseCode;
detailInput.RecommendToQty = detail.RecommendToQty;
detailInput.RecommendToLot = detail.RecommendToLot;
detailInput.RecommendToPackingCode = detailInput.RecommendToPackingCode;
detailInput.RecommendToLot = detail.RecommendToLot;
detailInput.RecommendToArriveDate = detail.RecommendToArriveDate;
detailInput.RecommendToExpireDate = detail.RecommendToExpireDate;
detailInput.RecommendToProduceDate = detail.RecommendToProduceDate;
detailInput.RecommendToSupplierBatch = detail.RecommendToSupplierBatch;
detailInput.RecommendToLocationCode = detail.RecommendToLocationCode;
detailInput.RecommendToLocationGroup = detail.RecommendToLocationGroup;
detailInput.RecommendToLocationArea = detail.RecommendToLocationArea;
detailInput.RecommendToLocationErpCode = detail.RecommendToLocationErpCode;
detailInput.RecommendToWarehouseCode = detail.RecommendToWarehouseCode;
await _transferLibRequestAppService.CreateAsync(input).ConfigureAwait(false);
}
}
}
/// <summary>
/// 创建补料记录实体
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
private async Task<CoatingIssueNoteEditInput> BuildCoatingIssueNoteAsync(CoatingIssueJob entity)
{
var coatingIssueNoteCreateInput = ObjectMapper.Map<CoatingIssueJob, CoatingIssueNoteEditInput>(entity);
coatingIssueNoteCreateInput.JobNumber = entity.Number;
await Task.CompletedTask.ConfigureAwait(false);
return coatingIssueNoteCreateInput;
}
/// <summary>
/// 判断是不是在最底层 如果不是则把状态变更为等待
/// </summary>
/// <param name="coatingIssueJob"></param>
/// <returns></returns>
private async Task<bool> IsMinRowAsync(CoatingIssueJob coatingIssueJob)
{
var detail = coatingIssueJob.Details.FirstOrDefault();
var loctionDto = await _locationAppService.GetByCodeAsync(detail.RecommendFromLocationCode)
.ConfigureAwait(false);
if (loctionDto.RowCode == 1)
{
return true;
}
return false;
}
#endregion
}

395
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/AssembleRequestEventHandler.cs

@ -1,13 +1,14 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
using FluentValidation.Validators;
using Castle.Components.DictionaryAdapter;
using Volo.Abp;
using Volo.Abp.EventBus;
using Volo.Abp.SettingManagement;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
using Win_in.Sfs.Shared.Event;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Application.Contracts;
@ -18,72 +19,69 @@ namespace Win_in.Sfs.Wms.Store.Event.BusinessRequest;
public class AssembleIssueRequestsEventHandler
: StoreEventHandlerBase
, ILocalEventHandler<SfsHandledEntityEventData<AssembleIssueRequests>>
, ILocalEventHandler<SfsAbortedEntityEventData<AssembleIssueRequests>>
, ILocalEventHandler<SfsCompletedEntityEventData<AssembleIssueRequests>>
, ILocalEventHandler<SfsCreatedEntityEventData<AssembleIssueRequests>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<AssembleIssueRequests>>>
, ILocalEventHandler<SfsHandledEntityEventData<AssembleRequest>>
, ILocalEventHandler<SfsAbortedEntityEventData<AssembleRequest>>
, ILocalEventHandler<SfsCompletedEntityEventData<AssembleRequest>>
, ILocalEventHandler<SfsCreatedEntityEventData<AssembleRequest>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<AssembleRequest>>>
{
private readonly IAssembleJobAppService _assembleJobAppService;
private readonly IProductionLineAppService _productionLineAppService;
private readonly IAssembleIssueRequestsManager _assembleRequestManager;
private readonly IProductionLineItemAppService _productionLineItemAppService;
private readonly ILocationAppService _locationAppService;
private readonly IBalanceAppService _balanceAppService;
public AssembleIssueRequestsEventHandler(
IAssembleJobAppService assembleJobAppService
, IProductionLineAppService productionLineAppService
, IAssembleIssueRequestsManager assembleRequestManager
, ILocationAppService locationAppService
, IBalanceAppService balanceAppService)
public AssembleRequestEventHandler(
IAssembleJobAppService assembleJobAppService, IProductionLineAppService productionLineAppService,
ILocationAppService locationAppService,
IBalanceAppService balanceAppService, IProductionLineItemAppService productionLineItemAppService)
{
_assembleJobAppService = assembleJobAppService;
_productionLineAppService = productionLineAppService;
_assembleRequestManager = assembleRequestManager;
_locationAppService = locationAppService;
_balanceAppService = balanceAppService;
_productionLineItemAppService = productionLineItemAppService;
}
/// <summary>
/// 创建后
/// 创建后
/// </summary>
/// <param name="eventData">Event data</param>
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<AssembleIssueRequests> eventData)
{
var entity = eventData.Entity;
//if (entity.AutoSubmit)
//{
// await _assembleRequestManager.SubmitAsync(entity).ConfigureAwait(false);
//}
await Task.CompletedTask.ConfigureAwait(false);
}
/// <summary>
/// 批量创建后
/// 批量创建后
/// </summary>
/// <param name="eventData">Event data</param>
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<List<AssembleIssueRequests>> eventData)
{
var entitys = eventData.Entity;
foreach (var entity in entitys)
{
if (entity.AutoSubmit)
{
await _assembleRequestManager.SubmitAsync(entity).ConfigureAwait(false);
}
}
await Task.CompletedTask.ConfigureAwait(false);
}
/// <summary>
/// 执行后
/// 执行后
/// </summary>
/// <param name="eventData"></param>
/// <returns></returns>
public virtual async Task HandleEventAsync(SfsHandledEntityEventData<AssembleIssueRequests> eventData)
{
var entity = eventData.Entity;
var assembleJobs = await BuildAssembleJobAsync(entity).ConfigureAwait(false);
List<AssembleJobEditInput> assembleJobs = new EditableList<AssembleJobEditInput>();
switch (entity.Type)
{
case nameof(EnumIssueType.BoxQty):
assembleJobs = await CreateAssembleJobWithBoxQtyTypeAsync(entity).ConfigureAwait(false);
break;
case nameof(EnumIssueType.Qty):
assembleJobs = await CreateAssembleJobWithQtyTypeAsync(entity).ConfigureAwait(false);
break;
}
if (assembleJobs.Any())
{
await _assembleJobAppService.CreateManyAsync(assembleJobs).ConfigureAwait(false);
@ -91,17 +89,17 @@ public class AssembleIssueRequestsEventHandler
}
/// <summary>
/// 驳回后
/// 驳回后
/// </summary>
/// <param name="eventData"></param>
/// <returns></returns>
public virtual async Task HandleEventAsync(SfsAbortedEntityEventData<AssembleIssueRequests> eventData)
{
await Task.CompletedTask.ConfigureAwait(false);
}
/// <summary>
/// 完成后
/// 完成后
/// </summary>
/// <param name="eventData"></param>
/// <returns></returns>
@ -115,24 +113,33 @@ public class AssembleIssueRequestsEventHandler
#region 私有
private async Task<List<AssembleJobEditInput>> BuildAssembleJobAsync
(AssembleIssueRequests assembleRequest)
#region 按数量叫料
/// <summary>
/// 创建注塑任务
/// </summary>
/// <param name="assembleRequest"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
private async Task<List<AssembleJobEditInput>> CreateAssembleJobWithQtyTypeAsync
(AssembleRequest assembleRequest)
{
var jobs = new List<AssembleJobEditInput>();
var transactionType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.Issue, EnumTransSubType.None).ConfigureAwait(false);//库存事务
var toLocationCodes = assembleRequest.Details.Select(p => p.ToLocationCode).Distinct().ToList();//所有发送库位的集合
var toLocations = await _locationAppService.GetByCodesAsync(toLocationCodes).ConfigureAwait(false);//所有库位的集合
var toLocationCodes = assembleRequest.Details.Select(p => p.ToLocationCode).Distinct().ToList(); //所有发送库位的集合
var toLocations = await _locationAppService.GetByCodesAsync(toLocationCodes).ConfigureAwait(false); //所有库位的集合
var assembleRequestDetails = assembleRequest.Details.Where(p => p.ToBeIssuedQty > 0);//所有还没发送物品的集合
foreach (var assembleRequestDetail in assembleRequestDetails)//如果有还有剩余未叫料的数量 则创建新的任务
var assembleRequestDetails = assembleRequest.Details.Where(p => p.ToBeIssuedQty > 0); //所有还没发送物品的集合
foreach (var assembleRequestDetail in assembleRequestDetails) //如果有还有剩余未叫料的数量 则创建新的任务
{
var toLocation = toLocations.FirstOrDefault(p => p.Code == assembleRequestDetail.ToLocationCode);//判断目标库位是否存在
var toLocation =
toLocations.FirstOrDefault(p => p.Code == assembleRequestDetail.ToLocationCode); //判断目标库位是否存在
Check.NotNull(toLocation, "库位代码", $"库位 {assembleRequestDetail.ToLocationCode} 不存在");
//创建详情
var jobDetails = await BuildAssembleJobDetailInputsAsync(assembleRequest, assembleRequestDetail, transactionType, toLocation.LocationGroupCode).ConfigureAwait(false);
var jobDetails =
await CreateAssembleJobDetailInputsWithQtyTypeAsync(assembleRequest, assembleRequestDetail,
toLocation.LocationGroupCode).ConfigureAwait(false);
if (!jobDetails.Any())
{
continue;
@ -141,11 +148,13 @@ public class AssembleIssueRequestsEventHandler
var fromLocationCode = jobDetails[0].RecommendFromLocationCode;
var fromLocation = await _locationAppService.GetByCodeAsync(fromLocationCode).ConfigureAwait(false);
var job = jobs.FirstOrDefault(p => p.WorkGroupCode == fromLocation?.WorkGroupCode);
if (job == null || job.Details.Any(p => p.ToLocationCode != assembleRequestDetail.ToLocationCode))
if (job == null || job.Details.Any(p => p.RecommendToLocationCode != assembleRequestDetail.ToLocationCode))
{
job = BuildAssembleJobCreateInput(assembleRequest, fromLocation);
job = await BuildAssembleJobCreateInputWithQtyTypeAsync(assembleRequest, fromLocation)
.ConfigureAwait(false);
jobs.Add(job);
}
job.Details.AddRange(jobDetails);
if (assembleRequestDetail.ToBeIssuedQty < 0)
{
@ -164,10 +173,10 @@ public class AssembleIssueRequestsEventHandler
}
var enableMultipleCreateAssembleJob = await SettingManager.IsTrueAsync(StoreSettings.MaterialRequest.EnableMultipleCreateIssueJob).ConfigureAwait(false);
var enableMultipleCreateAssembleJob = await SettingManager
.IsTrueAsync(StoreSettings.MaterialRequest.EnableMultipleCreateIssueJob).ConfigureAwait(false);
if (enableMultipleCreateAssembleJob)
{
//assembleRequest.Partial();
}
else
@ -175,14 +184,25 @@ public class AssembleIssueRequestsEventHandler
var sb = new StringBuilder();
foreach (var openRequestDetail in openRequestDetails)
{
sb.AppendLine($"{openRequestDetail.ItemCode}请求数量 {openRequestDetail.Qty},可用库存数量 {openRequestDetail.IssuedQty}");
sb.AppendLine(
$"{openRequestDetail.ItemCode}请求数量 {openRequestDetail.Qty},可用库存数量 {openRequestDetail.IssuedQty}");
}
throw new UserFriendlyException($"{sb} 可用库存数量不足, 无法生成发料任务");
}
return jobs;
}
private AssembleJobEditInput BuildAssembleJobCreateInput(AssembleIssueRequests assembleRequest, LocationDTO fromLocation)
/// <summary>
/// 构造注塑任务
/// </summary>
/// <param name="assembleRequest"></param>
/// <param name="fromLocation"></param>
/// <returns></returns>
private async Task<AssembleJobEditInput> BuildAssembleJobCreateInputWithQtyTypeAsync(
AssembleRequest assembleRequest,
LocationDTO fromLocation)
{
AssembleJobEditInput job;
job = ObjectMapper.Map<AssembleIssueRequests, AssembleJobEditInput>(assembleRequest);
@ -190,41 +210,70 @@ public class AssembleIssueRequestsEventHandler
job.JobStatus = EnumJobStatus.Open;
job.WorkGroupCode = fromLocation.WorkGroupCode;
job.WarehouseCode = fromLocation.WarehouseCode;
job.Worker = assembleRequest.Worker;
if (string.IsNullOrEmpty(job.Worker))
{
job.Worker = "admin";
}
job.AssembleIssueRequestsNumber = assembleRequest.Number;
job.AssembleRequestNumber = assembleRequest.Number;
await Task.CompletedTask.ConfigureAwait(false);
return job;
}
private async Task<List<AssembleJobDetailInput>> BuildAssembleJobDetailInputsAsync(AssembleIssueRequests assembleRequest,
AssembleIssueRequestsDetail assembleRequestDetail, TransactionTypeDTO transactionType, string toLocationGroupCode)
/// <summary>
/// 创建注塑任务明细
/// </summary>
/// <param name="assembleRequest"></param>
/// <param name="assembleRequestDetail"></param>
/// <param name="toLocationGroupCode"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
private async Task<List<AssembleJobDetailInput>> CreateAssembleJobDetailInputsWithQtyTypeAsync(
AssembleRequest assembleRequest,
AssembleRequestDetail assembleRequestDetail, string toLocationGroupCode)
{
var jobDetails = new List<AssembleJobDetailInput>();
var input = new RecommendBalanceRequestInput()
//获取推荐库存
var productionLineDto = await _productionLineAppService
.GetByLocationCodeAsync(assembleRequestDetail.ToLocationCode).ConfigureAwait(false);
var productionLineItemDtos = await _productionLineItemAppService
.GetByProductLineCodeAsync(productionLineDto.Code).ConfigureAwait(false);
if (productionLineItemDtos == null)
{
throw new UserFriendlyException($"物品代码【{assembleRequestDetail.ItemCode}】没有对应的【生产线物品关系】");
}
var productionLineItemDto =
productionLineItemDtos.FirstOrDefault(p => p.ItemCode == assembleRequestDetail.ItemCode);
var input = new RecommendBalanceRequestInput
{
ItemCode = assembleRequestDetail.ItemCode,
Qty = assembleRequestDetail.ToBeIssuedQty,
LocationTypes = transactionType.OutLocationTypes,
Statuses = transactionType.OutInventoryStatuses,
//LocationTypes = transactionType.OutLocationTypes, productionLineItemDto.RawLocationCodeListJson
Statuses = new EditableList<EnumInventoryStatus> { EnumInventoryStatus.OK },
Locations = JsonSerializer.Deserialize<List<string>>(productionLineItemDto.RawLocationCodeListJson)
};
//获取推荐库存
var recommendList = await _balanceAppService.GetRecommendBalancesAsync(input).ConfigureAwait(false);
var recommendList = await _balanceAppService.GetRecommendBalancesByLocationsAsync(input).ConfigureAwait(false);
//没有推荐库存时 跳过此明细 不生成任务
if (recommendList.Count != 0)
{
foreach (var recommend in recommendList)
{
//拿走需求量
var detail = await BuildAssembleJobDetailAsync(assembleRequestDetail, recommend, toLocationGroupCode).ConfigureAwait(false);
var detail =
await BuildAssembleJobDetailWithQtyTypeAsync(assembleRequestDetail, recommend,
toLocationGroupCode)
.ConfigureAwait(false);
if (assembleRequest.UseOnTheWayLocation)
{
//获取在途库
var locationDto = await _locationAppService.GetFirstByTypeAsync(EnumLocationType.TRANSPORT).ConfigureAwait(false);
var locationDto = await _locationAppService.GetFirstByTypeAsync(EnumLocationType.TRANSPORT)
.ConfigureAwait(false);
detail.OnTheWayLocationCode = locationDto.Code;
}
@ -233,49 +282,231 @@ public class AssembleIssueRequestsEventHandler
assembleRequestDetail.IssuedQty += recommend.Qty;
//await _assembleRequestManager.UpdateDetailsAsync(assembleRequest).ConfigureAwait(false);
}
}
return jobDetails;
}
private async Task<AssembleJobDetailInput> BuildAssembleJobDetailAsync(AssembleIssueRequestsDetail assembleRequestDetail, BalanceDTO balance, string toLocationGroupCode)
/// <summary>
/// 构造注塑任务明细
/// </summary>
/// <param name="assembleRequestDetail"></param>
/// <param name="balance"></param>
/// <param name="toLocationGroupCode"></param>
/// <returns></returns>
private async Task<AssembleJobDetailInput> BuildAssembleJobDetailWithQtyTypeAsync(
AssembleRequestDetail assembleRequestDetail, BalanceDTO balance, string toLocationGroupCode)
{
//ProductionLineDTO prodLine = await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationGroupCode).ConfigureAwait(false);
var detail = ObjectMapper.Map<BalanceDTO, AssembleJobDetailInput>(balance);
detail.RequestLocationCode = assembleRequestDetail.ToLocationCode;
detail.RequestLocationCode = assembleRequestDetail.ToLocationCode;
detail.PositionCode = assembleRequestDetail.PositionCode;
detail.RecommendType = assembleRequestDetail.RecommendType;
detail.RecommendPackingCode = balance.PackingCode;
detail.RecommendContainerCode = balance.ContainerCode;
detail.RecommendSupplierBatch = balance.SupplierBatch;
detail.RecommendProduceDate = balance.ProduceDate;
detail.RecommendExpireDate = balance.ExpireDate;
detail.RecommendLot = balance.Lot;
detail.RecommendProduceDate = balance.ProduceDate;
detail.RecommendArriveDate = balance.ArriveDate;
detail.RecommendFromPackingCode = balance.PackingCode;
detail.RecommendFromContainerCode = balance.ContainerCode;
detail.RecommendFromSupplierBatch = balance.SupplierBatch;
detail.RecommendFromProduceDate = balance.ProduceDate;
detail.RecommendFromExpireDate = balance.ExpireDate;
detail.RecommendFromLot = balance.Lot;
detail.RecommendFromProduceDate = balance.ProduceDate;
detail.RecommendFromArriveDate = balance.ArriveDate;
detail.RecommendFromLocationArea = balance.LocationArea;
detail.RecommendFromLocationCode = balance.LocationCode;
detail.RecommendFromLocationErpCode = balance.LocationErpCode;
detail.RecommendFromLocationGroup = balance.LocationGroup;
detail.RecommendFromWarehouseCode = balance.WarehouseCode;
detail.RecommendQty = balance.Qty;
detail.RecommendFromQty = balance.Qty;
detail.Uom = balance.Uom;
detail.ToLocationCode = assembleRequestDetail.ToLocationCode;
detail.ToLocationErpCode = assembleRequestDetail.ToLocationErpCode;
detail.ToLocationArea = assembleRequestDetail.ToLocationArea;
detail.ToWarehouseCode = assembleRequestDetail.ToWarehouseCode;
detail.RecommendToLocationCode = assembleRequestDetail.ToLocationCode;
detail.RecommendToLocationErpCode = assembleRequestDetail.ToLocationErpCode;
detail.RecommendToLocationArea = assembleRequestDetail.ToLocationArea;
detail.RecommendToWarehouseCode = assembleRequestDetail.ToWarehouseCode;
//detail.ProdLine = prodLine == null ? toLocationGroupCode : prodLine.Code;
detail.ProdLine = toLocationGroupCode;
await Task.CompletedTask.ConfigureAwait(false);
return detail;
}
#endregion
#region 按箱叫料
/// <summary>
/// 创建注塑任务
/// </summary>
/// <param name="assembleRequest"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
private async Task<List<AssembleJobEditInput>> CreateAssembleJobWithBoxQtyTypeAsync
(AssembleRequest assembleRequest)
{
var inputJobs = new List<AssembleJobEditInput>();
var inputExpectOutEditInput = new ExpectOutEditInput();
//已用的库存的箱码集合
var useBalanceList = new List<string>();
var groupByItemCodeAndLocationCode =
assembleRequest.Details.GroupBy(p => new { p.ItemCode, p.ToLocationCode });
foreach (var locationCodeItemCodeGroup in groupByItemCodeAndLocationCode)
{
var inputDetails = assembleRequest.Details.Where(p =>
p.ItemCode == locationCodeItemCodeGroup.Key.ItemCode &&
p.ToLocationCode == locationCodeItemCodeGroup.Key.ToLocationCode);
var inputDetailTemplate = inputDetails.First();
//获取请求下 这个零件和这个库位一个需要多少箱
var sumBoxQty = inputDetails.Sum(p => p.BoxQty);
//获取生产线
var productionLineDto = await _productionLineAppService
.GetByLocationCodeAsync(inputDetails.First().ToLocationCode).ConfigureAwait(false);
if (productionLineDto == null)
{
throw new UserFriendlyException($"库位【{inputDetailTemplate.ToLocationCode}】没有对应的【生产线】");
}
var productLineCodeAndItemCode = await _productionLineItemAppService
.GetByProductLineCodeAndItemCodeAsync(productionLineDto.Code, inputDetailTemplate.ItemCode)
.ConfigureAwait(false);
if (productLineCodeAndItemCode == null)
{
throw new UserFriendlyException(
$"物品代码【{inputDetailTemplate.ItemCode}】在生产线【{productionLineDto.Code}】中没有对应的【生产线物品关系】");
}
//获取可用库存
var input = new RecommendBalanceRequestInput
{
ItemCode = locationCodeItemCodeGroup.Key.ItemCode,
Qty = decimal.MaxValue,
Statuses = new EditableList<EnumInventoryStatus> { EnumInventoryStatus.OK },
Locations = JsonSerializer.Deserialize<List<string>>(productLineCodeAndItemCode
.RawLocationCodeListJson)
};
var usableList = await _balanceAppService.GetUsableListAsync(input).ConfigureAwait(false);
usableList = usableList.Where(p => !useBalanceList.Contains(p.PackingCode)).ToList();
if (usableList.Any())
{
for (var i = 0; i < sumBoxQty; i++)
{
var firstUsable = usableList.First();
useBalanceList.Add(firstUsable.PackingCode);
usableList.Remove(firstUsable);
var assembleJobEditInput =
await BuildAssembleJobCreateInputWithBoxQtyTypeAsync(assembleRequest, inputDetailTemplate,
firstUsable)
.ConfigureAwait(false);
inputJobs.Add(assembleJobEditInput);
}
}
}
return inputJobs;
}
/// <summary>
/// 构造注塑任务
/// </summary>
/// <param name="assembleRequest"></param>
/// <param name="assembleRequestDetail"></param>
/// <param name="balanceDtos"></param>
/// <returns></returns>
private async Task<AssembleJobEditInput> BuildAssembleJobCreateInputWithBoxQtyTypeAsync(
AssembleRequest assembleRequest,
AssembleRequestDetail assembleRequestDetail, BalanceDTO balanceDtos)
{
var job = ObjectMapper.Map<AssembleRequest, AssembleJobEditInput>(assembleRequest);
job.JobType = EnumJobType.IssueJob;
job.JobStatus = EnumJobStatus.Open;
job.WorkGroupCode = assembleRequestDetail.ToLocationGroup;
job.WarehouseCode = assembleRequestDetail.ToWarehouseCode;
job.Worker = assembleRequest.Worker;
job.AssembleRequestNumber = assembleRequest.Number;
job.Details.Add(await BuildAssembleJobDetailWithBoxQtyTypeAsync(assembleRequestDetail, balanceDtos)
.ConfigureAwait(false));
await Task.CompletedTask.ConfigureAwait(false);
return job;
}
/// <summary>
/// 构造注塑任务明细
/// </summary>
/// <param name="assembleRequestDetail"></param>
/// <param name="balance"></param>
/// <param name="toLocationGroupCode"></param>
/// <returns></returns>
private async Task<AssembleJobDetailInput> BuildAssembleJobDetailWithBoxQtyTypeAsync(
AssembleRequestDetail assembleRequestDetail, BalanceDTO balance)
{
var detail = new AssembleJobDetailInput();
detail.RequestLocationCode = assembleRequestDetail.ToLocationCode;
detail.RequestLocationGroup = assembleRequestDetail.ToLocationGroup;
detail.RequestLocationArea = assembleRequestDetail.ToLocationArea;
detail.RequestLocationErpCode = assembleRequestDetail.ToLocationErpCode;
detail.RequestWarehouseCode = assembleRequestDetail.ToWarehouseCode;
detail.PositionCode = assembleRequestDetail.PositionCode;
detail.RecommendType = assembleRequestDetail.RecommendType;
detail.ProdLine = assembleRequestDetail.ToLocationCode;
detail.ItemCode = assembleRequestDetail.ItemCode;
detail.ItemName = assembleRequestDetail.ItemName;
detail.ItemDesc1 = assembleRequestDetail.ItemDesc1;
detail.ItemDesc2 = assembleRequestDetail.ItemDesc2;
detail.Status = EnumInventoryStatus.OK;
detail.Uom = balance.Uom;
detail.RecommendFromPackingCode = balance.PackingCode;
detail.RecommendFromContainerCode = balance.ContainerCode;
detail.RecommendFromLot = balance.Lot;
detail.RecommendFromQty = balance.Qty;
detail.RecommendFromSupplierBatch = balance.SupplierBatch;
detail.RecommendFromProduceDate = balance.ProduceDate;
detail.RecommendFromExpireDate = balance.ExpireDate;
detail.RecommendFromProduceDate = balance.ProduceDate;
detail.RecommendFromArriveDate = balance.ArriveDate;
detail.RecommendFromLocationArea = balance.LocationArea;
detail.RecommendFromLocationCode = balance.LocationCode;
detail.RecommendFromLocationErpCode = balance.LocationErpCode;
detail.RecommendFromLocationGroup = balance.LocationGroup;
detail.RecommendFromWarehouseCode = balance.WarehouseCode;
detail.RecommendToPackingCode = balance.PackingCode;
detail.RecommendToContainerCode = balance.ContainerCode;
detail.RecommendToLot = balance.Lot;
detail.RecommendToQty = balance.Qty;
detail.RecommendToSupplierBatch = balance.SupplierBatch;
detail.RecommendToProduceDate = balance.ProduceDate;
detail.RecommendToExpireDate = balance.ExpireDate;
detail.RecommendToProduceDate = balance.ProduceDate;
detail.RecommendToArriveDate = balance.ArriveDate;
detail.RecommendToLocationCode = assembleRequestDetail.ToLocationCode;
detail.RecommendToLocationErpCode = assembleRequestDetail.ToLocationErpCode;
detail.RecommendToLocationArea = assembleRequestDetail.ToLocationArea;
detail.RecommendToWarehouseCode = assembleRequestDetail.ToWarehouseCode;
detail.RecommendToLocationGroup = assembleRequestDetail.ToLocationGroup;
await Task.CompletedTask.ConfigureAwait(false);
return detail;
}
#endregion
#endregion
}

473
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/CoatingMaterialRequestEventHandler.cs

@ -1,13 +1,14 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
using FluentValidation.Validators;
using Castle.Components.DictionaryAdapter;
using Volo.Abp;
using Volo.Abp.EventBus;
using Volo.Abp.SettingManagement;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
using Win_in.Sfs.Shared.Event;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Application.Contracts;
@ -20,125 +21,127 @@ namespace Win_in.Sfs.Wms.Store.Event.BusinessRequest;
public class CoatingMaterialRequestEventHandler
: StoreEventHandlerBase
, ILocalEventHandler<SfsHandledEntityEventData<CoatingMaterialRequest>>
, ILocalEventHandler<SfsAbortedEntityEventData<CoatingMaterialRequest>>
, ILocalEventHandler<SfsCompletedEntityEventData<CoatingMaterialRequest>>
, ILocalEventHandler<SfsCreatedEntityEventData<CoatingMaterialRequest>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<CoatingMaterialRequest>>>
, ILocalEventHandler<SfsHandledEntityEventData<CoatingMaterialRequest>>
, ILocalEventHandler<SfsAbortedEntityEventData<CoatingMaterialRequest>>
, ILocalEventHandler<SfsCompletedEntityEventData<CoatingMaterialRequest>>
, ILocalEventHandler<SfsCreatedEntityEventData<CoatingMaterialRequest>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<CoatingMaterialRequest>>>
{
private readonly ICoatingIssueJobAppService _issueJobAppService;
private readonly ICoatingIssueJobAppService _coatingIssueJobAppService;
private readonly IProductionLineAppService _productionLineAppService;
private readonly ICoatingMaterialRequestManager _CoatingMaterialRequestManager;
private readonly IProductionLineItemAppService _productionLineItemAppService;
private readonly ILocationAppService _locationAppService;
private readonly IBalanceAppService _balanceAppService;
public CoatingMaterialRequestEventHandler(
ICoatingIssueJobAppService issueJobAppService
, IProductionLineAppService productionLineAppService
, ICoatingMaterialRequestManager CoatingMaterialRequestManager
, ILocationAppService locationAppService
, IBalanceAppService balanceAppService)
ICoatingIssueJobAppService coatingIssueJobAppService, IProductionLineAppService productionLineAppService,
ILocationAppService locationAppService,
IBalanceAppService balanceAppService, IProductionLineItemAppService productionLineItemAppService)
{
_issueJobAppService = issueJobAppService;
_coatingIssueJobAppService = coatingIssueJobAppService;
_productionLineAppService = productionLineAppService;
_CoatingMaterialRequestManager = CoatingMaterialRequestManager;
_locationAppService = locationAppService;
_balanceAppService = balanceAppService;
_productionLineItemAppService = productionLineItemAppService;
}
/// <summary>
/// 创建后
/// 创建后
/// </summary>
/// <param name="eventData">Event data</param>
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<CoatingMaterialRequest> eventData)
{
var entity = eventData.Entity;
//if (entity.AutoSubmit)
//{
// await _CoatingMaterialRequestManager.SubmitAsync(entity).ConfigureAwait(false);
//}
await Task.CompletedTask.ConfigureAwait(false);
}
/// <summary>
/// 批量创建后
/// 批量创建后
/// </summary>
/// <param name="eventData">Event data</param>
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<List<CoatingMaterialRequest>> eventData)
{
var entitys = eventData.Entity;
foreach (var entity in entitys)
{
if (entity.AutoSubmit)
{
await _CoatingMaterialRequestManager.SubmitAsync(entity).ConfigureAwait(false);
}
if (entity.Type == EnumMaterialRequestType.Issue_WIP.ToString())
{
await _CoatingMaterialRequestManager.SubmitAsync(entity).ConfigureAwait(false);
}
}
await Task.CompletedTask.ConfigureAwait(false);
}
/// <summary>
/// 执行后
/// 执行后
/// </summary>
/// <param name="eventData"></param>
/// <returns></returns>
public virtual async Task HandleEventAsync(SfsHandledEntityEventData<CoatingMaterialRequest> eventData)
{
var entity = eventData.Entity;
var issueJobs = await BuildIssueJobAsync(entity).ConfigureAwait(false);
if (issueJobs.Any())
List<CoatingIssueJobEditInput> coatingIssueJobs = new EditableList<CoatingIssueJobEditInput>();
switch (entity.Type)
{
case nameof(EnumIssueType.BoxQty):
coatingIssueJobs = await CreateCoatingIssueJobWithBoxQtyTypeAsync(entity).ConfigureAwait(false);
break;
case nameof(EnumIssueType.Qty):
coatingIssueJobs = await CreateCoatingIssueJobWithQtyTypeAsync(entity).ConfigureAwait(false);
break;
}
if (coatingIssueJobs.Any())
{
await _issueJobAppService.CreateManyAsync(issueJobs).ConfigureAwait(false);
await _coatingIssueJobAppService.CreateManyAsync(coatingIssueJobs).ConfigureAwait(false);
}
}
/// <summary>
/// 驳回后
/// 驳回后
/// </summary>
/// <param name="eventData"></param>
/// <returns></returns>
public virtual async Task HandleEventAsync(SfsAbortedEntityEventData<CoatingMaterialRequest> eventData)
{
var entity = eventData.Entity;
await _issueJobAppService.CancelByMaterialRequestAsync(entity.Number).ConfigureAwait(false);
await Task.CompletedTask.ConfigureAwait(false);
}
/// <summary>
/// 完成后
/// 完成后
/// </summary>
/// <param name="eventData"></param>
/// <returns></returns>
public virtual async Task HandleEventAsync(SfsCompletedEntityEventData<CoatingMaterialRequest> eventData)
{
_ = eventData.Entity;
// await _issueJobAppService.CompleteByCoatingMaterialRequestAsync(entity.Number);
// await _coatingIssueJobAppService.CompleteByCoatingMaterialRequestAsync(entity.Number);
await Task.CompletedTask.ConfigureAwait(false);
}
#region 私有
private async Task<List<CoatingIssueJobEditInput>> BuildIssueJobAsync
(CoatingMaterialRequest CoatingMaterialRequest)
#region 按数量叫料
/// <summary>
/// 创建注塑任务
/// </summary>
/// <param name="coatingMaterialRequest"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
private async Task<List<CoatingIssueJobEditInput>> CreateCoatingIssueJobWithQtyTypeAsync
(CoatingMaterialRequest coatingMaterialRequest)
{
var jobs = new List<CoatingIssueJobEditInput>();
var transactionType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.Issue, EnumTransSubType.None).ConfigureAwait(false);//库存事务
var toLocationCodes = CoatingMaterialRequest.Details.Select(p => p.ToLocationCode).Distinct().ToList();//所有发送库位的集合
var toLocations = await _locationAppService.GetByCodesAsync(toLocationCodes).ConfigureAwait(false);//所有库位的集合
var toLocationCodes = coatingMaterialRequest.Details.Select(p => p.ToLocationCode).Distinct().ToList(); //所有发送库位的集合
var toLocations = await _locationAppService.GetByCodesAsync(toLocationCodes).ConfigureAwait(false); //所有库位的集合
var CoatingMaterialRequestDetails = CoatingMaterialRequest.Details.Where(p => p.ToBeIssuedQty > 0);//所有还没发送物品的集合
foreach (var CoatingMaterialRequestDetail in CoatingMaterialRequestDetails)//如果有还有剩余未叫料的数量 则创建新的任务
var coatingMaterialRequestDetails = coatingMaterialRequest.Details.Where(p => p.ToBeIssuedQty > 0); //所有还没发送物品的集合
foreach (var coatingMaterialRequestDetail in coatingMaterialRequestDetails) //如果有还有剩余未叫料的数量 则创建新的任务
{
var toLocation = toLocations.FirstOrDefault(p => p.Code == CoatingMaterialRequestDetail.ToLocationCode);//判断目标库位是否存在
Check.NotNull(toLocation, "库位代码", $"库位 {CoatingMaterialRequestDetail.ToLocationCode} 不存在");
var toLocation =
toLocations.FirstOrDefault(p => p.Code == coatingMaterialRequestDetail.ToLocationCode); //判断目标库位是否存在
Check.NotNull(toLocation, "库位代码", $"库位 {coatingMaterialRequestDetail.ToLocationCode} 不存在");
//创建详情
var jobDetails = await BuildIssueJobDetailInputsAsync(CoatingMaterialRequest, CoatingMaterialRequestDetail, transactionType, toLocation.LocationGroupCode).ConfigureAwait(false);
var jobDetails =
await CreateCoatingIssueJobDetailInputsWithQtyTypeAsync(coatingMaterialRequest, coatingMaterialRequestDetail,
toLocation.LocationGroupCode).ConfigureAwait(false);
if (!jobDetails.Any())
{
continue;
@ -147,159 +150,365 @@ public class CoatingMaterialRequestEventHandler
var fromLocationCode = jobDetails[0].RecommendFromLocationCode;
var fromLocation = await _locationAppService.GetByCodeAsync(fromLocationCode).ConfigureAwait(false);
var job = jobs.FirstOrDefault(p => p.WorkGroupCode == fromLocation?.WorkGroupCode);
if (job == null || job.Details.Any(p => p.ToLocationCode != CoatingMaterialRequestDetail.ToLocationCode))
if (job == null || job.Details.Any(p => p.RecommendToLocationCode != coatingMaterialRequestDetail.ToLocationCode))
{
job = BuildIssueJobCreateInput(CoatingMaterialRequest, fromLocation);
job = await BuildCoatingIssueJobCreateInputWithQtyTypeAsync(coatingMaterialRequest, fromLocation)
.ConfigureAwait(false);
jobs.Add(job);
}
job.Details.AddRange(jobDetails);
if (CoatingMaterialRequestDetail.ToBeIssuedQty < 0)
if (coatingMaterialRequestDetail.ToBeIssuedQty < 0)
{
CoatingMaterialRequestDetail.Status = EnumStatus.Close;
coatingMaterialRequestDetail.Status = EnumStatus.Close;
}
}
jobs = jobs.Where(p => p.Details.Any()).ToList();
var openRequestDetails =
CoatingMaterialRequest.Details.Where(p => p.Status != EnumStatus.Close).ToList();
coatingMaterialRequest.Details.Where(p => p.Status != EnumStatus.Close).ToList();
if (!openRequestDetails.Any())
{
return jobs;
}
var enableMultipleCreateIssueJob = await SettingManager.IsTrueAsync(StoreSettings.MaterialRequest.EnableMultipleCreateIssueJob).ConfigureAwait(false);
if (enableMultipleCreateIssueJob)
var enableMultipleCreateCoatingIssueJob = await SettingManager
.IsTrueAsync(StoreSettings.MaterialRequest.EnableMultipleCreateIssueJob).ConfigureAwait(false);
if (enableMultipleCreateCoatingIssueJob)
{
CoatingMaterialRequest.Partial();
//coatingMaterialRequest.Partial();
}
else
{
var sb = new StringBuilder();
foreach (var openRequestDetail in openRequestDetails)
{
sb.AppendLine($"{openRequestDetail.ItemCode}请求数量 {openRequestDetail.Qty},可用库存数量 {openRequestDetail.IssuedQty}");
sb.AppendLine(
$"{openRequestDetail.ItemCode}请求数量 {openRequestDetail.Qty},可用库存数量 {openRequestDetail.IssuedQty}");
}
throw new UserFriendlyException($"{sb} 可用库存数量不足, 无法生成发料任务");
}
return jobs;
}
private CoatingIssueJobEditInput BuildIssueJobCreateInput(CoatingMaterialRequest CoatingMaterialRequest, LocationDTO fromLocation)
/// <summary>
/// 构造注塑任务
/// </summary>
/// <param name="coatingMaterialRequest"></param>
/// <param name="fromLocation"></param>
/// <returns></returns>
private async Task<CoatingIssueJobEditInput> BuildCoatingIssueJobCreateInputWithQtyTypeAsync(
CoatingMaterialRequest coatingMaterialRequest,
LocationDTO fromLocation)
{
CoatingIssueJobEditInput job;
job = ObjectMapper.Map<CoatingMaterialRequest,CoatingIssueJobEditInput>(CoatingMaterialRequest);
job = ObjectMapper.Map<CoatingMaterialRequest, CoatingIssueJobEditInput>(coatingMaterialRequest);
job.JobType = EnumJobType.IssueJob;
job.JobStatus = EnumJobStatus.Open;
job.WorkGroupCode = fromLocation.WorkGroupCode;
job.WarehouseCode = fromLocation.WarehouseCode;
job.Worker = CoatingMaterialRequest.Worker;
job.MaterialRequestNumber = CoatingMaterialRequest.Number;
job.Worker = coatingMaterialRequest.Worker;
if (string.IsNullOrEmpty(job.Worker))
{
job.Worker = "admin";
}
job.MaterialRequestNumber = coatingMaterialRequest.Number;
await Task.CompletedTask.ConfigureAwait(false);
return job;
}
private async Task<List<CoatingIssueJobDetailInput>> BuildIssueJobDetailInputsAsync(CoatingMaterialRequest CoatingMaterialRequest,
CoatingMaterialRequestDetail CoatingMaterialRequestDetail, TransactionTypeDTO transactionType, string toLocationGroupCode)
/// <summary>
/// 创建注塑任务明细
/// </summary>
/// <param name="coatingMaterialRequest"></param>
/// <param name="coatingMaterialRequestDetail"></param>
/// <param name="toLocationGroupCode"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
private async Task<List<CoatingIssueJobDetailInput>> CreateCoatingIssueJobDetailInputsWithQtyTypeAsync(
CoatingMaterialRequest coatingMaterialRequest,
CoatingMaterialRequestDetail coatingMaterialRequestDetail, string toLocationGroupCode)
{
var jobDetails = new List<CoatingIssueJobDetailInput>();
var input = new RecommendBalanceRequestInput()
//获取推荐库存
var productionLineDto = await _productionLineAppService
.GetByLocationCodeAsync(coatingMaterialRequestDetail.ToLocationCode).ConfigureAwait(false);
var productionLineItemDtos = await _productionLineItemAppService
.GetByProductLineCodeAsync(productionLineDto.Code).ConfigureAwait(false);
if (productionLineItemDtos == null)
{
ItemCode = CoatingMaterialRequestDetail.ItemCode,
Qty = CoatingMaterialRequestDetail.ToBeIssuedQty,
LocationTypes = transactionType.OutLocationTypes,
Statuses = transactionType.OutInventoryStatuses,
throw new UserFriendlyException($"物品代码【{coatingMaterialRequestDetail.ItemCode}】没有对应的【生产线物品关系】");
}
var productionLineItemDto =
productionLineItemDtos.FirstOrDefault(p => p.ItemCode == coatingMaterialRequestDetail.ItemCode);
var input = new RecommendBalanceRequestInput
{
ItemCode = coatingMaterialRequestDetail.ItemCode,
Qty = coatingMaterialRequestDetail.ToBeIssuedQty,
//LocationTypes = transactionType.OutLocationTypes, productionLineItemDto.RawLocationCodeListJson
Statuses = new EditableList<EnumInventoryStatus> { EnumInventoryStatus.OK },
Locations = JsonSerializer.Deserialize<List<string>>(productionLineItemDto.RawLocationCodeListJson)
};
//获取推荐库存
var recommendList = await _balanceAppService.GetRecommendBalancesAsync(input).ConfigureAwait(false);
var recommendList = await _balanceAppService.GetRecommendBalancesByLocationsAsync(input).ConfigureAwait(false);
//没有推荐库存时 跳过此明细 不生成任务
if (recommendList.Count != 0)
{
foreach (var recommend in recommendList)
{
//拿走需求量
var detail = await BuildIssueJobDetailAsync(CoatingMaterialRequestDetail, recommend, toLocationGroupCode).ConfigureAwait(false);
if (CoatingMaterialRequest.UseOnTheWayLocation)
var detail =
await BuildCoatingIssueJobDetailWithQtyTypeAsync(coatingMaterialRequestDetail, recommend,
toLocationGroupCode)
.ConfigureAwait(false);
if (coatingMaterialRequest.UseOnTheWayLocation)
{
//获取在途库
var locationDto = await _locationAppService.GetFirstByTypeAsync(EnumLocationType.TRANSPORT).ConfigureAwait(false);
var locationDto = await _locationAppService.GetFirstByTypeAsync(EnumLocationType.TRANSPORT)
.ConfigureAwait(false);
detail.OnTheWayLocationCode = locationDto.Code;
}
jobDetails.Add(detail);
CoatingMaterialRequestDetail.IssuedQty += recommend.Qty;
coatingMaterialRequestDetail.IssuedQty += recommend.Qty;
//await _coatingMaterialRequestManager.UpdateDetailsAsync(coatingMaterialRequest).ConfigureAwait(false);
}
}
return jobDetails;
}
private async Task<CoatingIssueJobDetailInput> BuildIssueJobDetailAsync(CoatingMaterialRequestDetail CoatingMaterialRequestDetail, BalanceDTO balance, string toLocationGroupCode)
/// <summary>
/// 构造注塑任务明细
/// </summary>
/// <param name="coatingMaterialRequestDetail"></param>
/// <param name="balance"></param>
/// <param name="toLocationGroupCode"></param>
/// <returns></returns>
private async Task<CoatingIssueJobDetailInput> BuildCoatingIssueJobDetailWithQtyTypeAsync(
CoatingMaterialRequestDetail coatingMaterialRequestDetail, BalanceDTO balance, string toLocationGroupCode)
{
//ProductionLineDTO prodLine = await _productionLineAppService.GetByLocationGroupCodeAsync(toLocationGroupCode).ConfigureAwait(false);
var detail = ObjectMapper.Map<BalanceDTO, CoatingIssueJobDetailInput>(balance);
detail.RequestLocationCode = CoatingMaterialRequestDetail.ToLocationCode;
detail.PositionCode = CoatingMaterialRequestDetail.PositionCode;
detail.RecommendType = CoatingMaterialRequestDetail.RecommendType;
detail.RecommendPackingCode = balance.PackingCode;
detail.RecommendContainerCode = balance.ContainerCode;
detail.RecommendSupplierBatch = balance.SupplierBatch;
detail.RecommendProduceDate = balance.ProduceDate;
detail.RecommendExpireDate = balance.ExpireDate;
detail.RecommendLot = balance.Lot;
detail.RecommendProduceDate = balance.ProduceDate;
detail.RecommendArriveDate = balance.ArriveDate;
detail.RequestLocationCode = coatingMaterialRequestDetail.ToLocationCode;
detail.PositionCode = coatingMaterialRequestDetail.PositionCode;
detail.RecommendType = coatingMaterialRequestDetail.RecommendType;
detail.RecommendFromPackingCode = balance.PackingCode;
detail.RecommendFromContainerCode = balance.ContainerCode;
detail.RecommendFromSupplierBatch = balance.SupplierBatch;
detail.RecommendFromProduceDate = balance.ProduceDate;
detail.RecommendFromExpireDate = balance.ExpireDate;
detail.RecommendFromLot = balance.Lot;
detail.RecommendFromProduceDate = balance.ProduceDate;
detail.RecommendFromArriveDate = balance.ArriveDate;
detail.RecommendFromLocationArea = balance.LocationArea;
detail.RecommendFromLocationCode = balance.LocationCode;
detail.RecommendFromLocationErpCode = balance.LocationErpCode;
detail.RecommendFromLocationGroup = balance.LocationGroup;
detail.RecommendFromWarehouseCode = balance.WarehouseCode;
detail.RecommendQty = balance.Qty;
detail.RecommendFromQty = balance.Qty;
detail.Uom = balance.Uom;
detail.ToLocationCode = CoatingMaterialRequestDetail.ToLocationCode;
detail.ToLocationErpCode = CoatingMaterialRequestDetail.ToLocationErpCode;
detail.ToLocationArea = CoatingMaterialRequestDetail.ToLocationArea;
detail.ToWarehouseCode = CoatingMaterialRequestDetail.ToWarehouseCode;
detail.ToLocationGroup = CoatingMaterialRequestDetail.ToLocationGroup;
//detail.Operation = //TODO
//detail.DistributionType =//TODO
//detail.TruncType = //TODO
//detail.RoundedQty =//TODO
//detail.PlannedSplitRule = //TODO
//detail.PlanBeginTime = //TODO
//detaiol.DeliveryQty = //TODO
// var detail = ObjectMapper.Map<CoatingMaterialRequestDetail, IssueJobDetailInput>(CoatingMaterialRequestDetail);
//
// detail.RecommendPackingCode = balance.PackingCode;
// detail.RecommendContainerCode = balance.ContainerCode;
// detail.RecommendLot = balance.Lot;
// detail.RecommendLocationCode = balance.LocationCode;
// detail.RecommendLocationArea = balance.LocationArea;
// detail.RecommendLocationGroup = balance.LocationGroup;
// detail.RecommendLocationErpCode = balance.LocationErpCode;
// detail.WarehouseCode = balance.WarehouseCode;
// detail.Status = balance.Status;
// detail.RecommendSupplierBatch = balance.SupplierBatch;
// detail.RecommendArriveDate = balance.ArriveDate;
// detail.RecommendProduceDate = balance.ProduceDate;
// detail.RecommendExpireDate = balance.ExpireDate;
// detail.RecommendQty = balance.Qty;
// detail.RecommendUom = balance.Uom;
// detail.ProdLine = prodLine == null ? toLocationGroupCode : prodLine.Code;
detail.RecommendToLocationCode = coatingMaterialRequestDetail.ToLocationCode;
detail.RecommendToLocationErpCode = coatingMaterialRequestDetail.ToLocationErpCode;
detail.RecommendToLocationArea = coatingMaterialRequestDetail.ToLocationArea;
detail.RecommendToWarehouseCode = coatingMaterialRequestDetail.ToWarehouseCode;
//detail.ProdLine = prodLine == null ? toLocationGroupCode : prodLine.Code;
detail.ProdLine = toLocationGroupCode;
await Task.CompletedTask.ConfigureAwait(false);
await Task.CompletedTask.ConfigureAwait(false);
return detail;
}
#endregion
#region 按箱叫料
/// <summary>
/// 创建注塑任务
/// </summary>
/// <param name="coatingMaterialRequest"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
private async Task<List<CoatingIssueJobEditInput>> CreateCoatingIssueJobWithBoxQtyTypeAsync
(CoatingMaterialRequest coatingMaterialRequest)
{
var inputJobs = new List<CoatingIssueJobEditInput>();
var inputExpectOutEditInput = new ExpectOutEditInput();
//已用的库存的箱码集合
var useBalanceList = new List<string>();
var groupByItemCodeAndLocationCode =
coatingMaterialRequest.Details.GroupBy(p => new { p.ItemCode, p.ToLocationCode });
foreach (var locationCodeItemCodeGroup in groupByItemCodeAndLocationCode)
{
var inputDetails = coatingMaterialRequest.Details.Where(p =>
p.ItemCode == locationCodeItemCodeGroup.Key.ItemCode &&
p.ToLocationCode == locationCodeItemCodeGroup.Key.ToLocationCode);
var inputDetailTemplate = inputDetails.First();
//获取请求下 这个零件和这个库位一个需要多少箱
var sumBoxQty = inputDetails.Sum(p => p.BoxQty);
//获取生产线
var productionLineDto = await _productionLineAppService
.GetByLocationCodeAsync(inputDetails.First().ToLocationCode).ConfigureAwait(false);
if (productionLineDto == null)
{
throw new UserFriendlyException($"库位【{inputDetailTemplate.ToLocationCode}】没有对应的【生产线】");
}
var productLineCodeAndItemCode = await _productionLineItemAppService
.GetByProductLineCodeAndItemCodeAsync(productionLineDto.Code, inputDetailTemplate.ItemCode)
.ConfigureAwait(false);
if (productLineCodeAndItemCode == null)
{
throw new UserFriendlyException(
$"物品代码【{inputDetailTemplate.ItemCode}】在生产线【{productionLineDto.Code}】中没有对应的【生产线物品关系】");
}
//获取可用库存
var input = new RecommendBalanceRequestInput
{
ItemCode = locationCodeItemCodeGroup.Key.ItemCode,
Qty = decimal.MaxValue,
Statuses = new EditableList<EnumInventoryStatus> { EnumInventoryStatus.OK },
Locations = JsonSerializer.Deserialize<List<string>>(productLineCodeAndItemCode
.RawLocationCodeListJson)
};
var usableList = await _balanceAppService.GetUsableListAsync(input).ConfigureAwait(false);
usableList = usableList.Where(p => !useBalanceList.Contains(p.PackingCode)).ToList();
if (usableList.Any())
{
for (var i = 0; i < sumBoxQty; i++)
{
var firstUsable = usableList.First();
useBalanceList.Add(firstUsable.PackingCode);
usableList.Remove(firstUsable);
var coatingIssueJobEditInput =
await BuildCoatingIssueJobCreateInputWithBoxQtyTypeAsync(coatingMaterialRequest, inputDetailTemplate,
firstUsable)
.ConfigureAwait(false);
inputJobs.Add(coatingIssueJobEditInput);
}
}
}
return inputJobs;
}
/// <summary>
/// 构造注塑任务
/// </summary>
/// <param name="coatingMaterialRequest"></param>
/// <param name="coatingMaterialRequestDetail"></param>
/// <param name="balanceDtos"></param>
/// <returns></returns>
private async Task<CoatingIssueJobEditInput> BuildCoatingIssueJobCreateInputWithBoxQtyTypeAsync(
CoatingMaterialRequest coatingMaterialRequest,
CoatingMaterialRequestDetail coatingMaterialRequestDetail, BalanceDTO balanceDtos)
{
var job = ObjectMapper.Map<CoatingMaterialRequest, CoatingIssueJobEditInput>(coatingMaterialRequest);
job.JobType = EnumJobType.IssueJob;
job.JobStatus = EnumJobStatus.Open;
job.WorkGroupCode = coatingMaterialRequestDetail.ToLocationGroup;
job.WarehouseCode = coatingMaterialRequestDetail.ToWarehouseCode;
job.Worker = coatingMaterialRequest.Worker;
job.MaterialRequestNumber = coatingMaterialRequest.Number;
job.Details.Add(await BuildCoatingIssueJobDetailWithBoxQtyTypeAsync(coatingMaterialRequestDetail, balanceDtos)
.ConfigureAwait(false));
await Task.CompletedTask.ConfigureAwait(false);
return job;
}
/// <summary>
/// 构造注塑任务明细
/// </summary>
/// <param name="coatingMaterialRequestDetail"></param>
/// <param name="balance"></param>
/// <param name="toLocationGroupCode"></param>
/// <returns></returns>
private async Task<CoatingIssueJobDetailInput> BuildCoatingIssueJobDetailWithBoxQtyTypeAsync(
CoatingMaterialRequestDetail coatingMaterialRequestDetail, BalanceDTO balance)
{
var detail = new CoatingIssueJobDetailInput();
detail.RequestLocationCode = coatingMaterialRequestDetail.ToLocationCode;
detail.RequestLocationGroup = coatingMaterialRequestDetail.ToLocationGroup;
detail.RequestLocationArea = coatingMaterialRequestDetail.ToLocationArea;
detail.RequestLocationErpCode = coatingMaterialRequestDetail.ToLocationErpCode;
detail.RequestWarehouseCode = coatingMaterialRequestDetail.ToWarehouseCode;
detail.PositionCode = coatingMaterialRequestDetail.PositionCode;
detail.RecommendType = coatingMaterialRequestDetail.RecommendType;
detail.ProdLine = coatingMaterialRequestDetail.ToLocationCode;
detail.ItemCode = coatingMaterialRequestDetail.ItemCode;
detail.ItemName = coatingMaterialRequestDetail.ItemName;
detail.ItemDesc1 = coatingMaterialRequestDetail.ItemDesc1;
detail.ItemDesc2 = coatingMaterialRequestDetail.ItemDesc2;
detail.Status = EnumInventoryStatus.OK;
detail.Uom = balance.Uom;
detail.RecommendFromPackingCode = balance.PackingCode;
detail.RecommendFromContainerCode = balance.ContainerCode;
detail.RecommendFromLot = balance.Lot;
detail.RecommendFromQty = balance.Qty;
detail.RecommendFromSupplierBatch = balance.SupplierBatch;
detail.RecommendFromProduceDate = balance.ProduceDate;
detail.RecommendFromExpireDate = balance.ExpireDate;
detail.RecommendFromProduceDate = balance.ProduceDate;
detail.RecommendFromArriveDate = balance.ArriveDate;
detail.RecommendFromLocationArea = balance.LocationArea;
detail.RecommendFromLocationCode = balance.LocationCode;
detail.RecommendFromLocationErpCode = balance.LocationErpCode;
detail.RecommendFromLocationGroup = balance.LocationGroup;
detail.RecommendFromWarehouseCode = balance.WarehouseCode;
detail.RecommendToPackingCode = balance.PackingCode;
detail.RecommendToContainerCode = balance.ContainerCode;
detail.RecommendToLot = balance.Lot;
detail.RecommendToQty = balance.Qty;
detail.RecommendToSupplierBatch = balance.SupplierBatch;
detail.RecommendToProduceDate = balance.ProduceDate;
detail.RecommendToExpireDate = balance.ExpireDate;
detail.RecommendToProduceDate = balance.ProduceDate;
detail.RecommendToArriveDate = balance.ArriveDate;
detail.RecommendToLocationCode = coatingMaterialRequestDetail.ToLocationCode;
detail.RecommendToLocationErpCode = coatingMaterialRequestDetail.ToLocationErpCode;
detail.RecommendToLocationArea = coatingMaterialRequestDetail.ToLocationArea;
detail.RecommendToWarehouseCode = coatingMaterialRequestDetail.ToWarehouseCode;
detail.RecommendToLocationGroup = coatingMaterialRequestDetail.ToLocationGroup;
await Task.CompletedTask.ConfigureAwait(false);
return detail;
}
#endregion
#endregion
}

38
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/Note/CoatingIssueNoteEventHandler.cs

@ -73,28 +73,28 @@ public class CoatingIssueNoteEventHandler
private async Task UpdateReceivedQtyMaterialRequestAsync(CoatingIssueNote entity)
{
var receiveQtyGroup = entity.Details
.GroupBy(p => new { p.ItemCode, p.ToLocationCode })
.Select(p => new { p.Key.ItemCode, p.Key.ToLocationCode, Qty = p.Sum(d => d.Qty) })
.ToList();
//var receiveQtyGroup = entity.Details
// .GroupBy(p => new { p.ItemCode, p.ToLocationCode })
// .Select(p => new { p.Key.ItemCode, p.Key.ToLocationCode, Qty = p.Sum(d => d.Qty) })
// .ToList();
var materialRequest = await _materialRequestManager.GetByNumberAsync(entity.RequestNumber).ConfigureAwait(false);
//var materialRequest = await _materialRequestManager.GetByNumberAsync(entity.RequestNumber).ConfigureAwait(false);
if (entity.RequestType != EnumMaterialRequestType.Issue_Direct.ToString())
{
//更新叫料请求的已收数量
foreach (var materialRequestDetail in materialRequest.Details)
{
var receiveQty = receiveQtyGroup.FirstOrDefault(p =>
p.ItemCode == materialRequestDetail.ItemCode &&
p.ToLocationCode == materialRequestDetail.ToLocationCode)?.Qty;
if (receiveQty != null)
{
materialRequestDetail.ReceivedQty += receiveQty.Value;
}
}
//if (entity.RequestType != EnumMaterialRequestType.Issue_Direct.ToString())
//{
// //更新叫料请求的已收数量
// foreach (var materialRequestDetail in materialRequest.Details)
// {
// var receiveQty = receiveQtyGroup.FirstOrDefault(p =>
// p.ItemCode == materialRequestDetail.ItemCode &&
// p.ToLocationCode == materialRequestDetail.ToLocationCode)?.Qty;
// if (receiveQty != null)
// {
// materialRequestDetail.ReceivedQty += receiveQty.Value;
// }
// }
}
//}
}
}

88
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/AssembleNoteEventHandler.cs

@ -0,0 +1,88 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.EventBus;
using Volo.Abp.Uow;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Event;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Event.Transaction;
namespace Win_in.Sfs.Wms.Store.Event.Transactions;
public class AssembleNoteEventHandler
: StoreInventoryEventHandlerBase
, ILocalEventHandler<SfsCreatedEntityEventData<AssembleNote>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<AssembleNote>>>
, ILocalEventHandler<SfsConfirmedEntityEventData<AssembleNote>>
{
private const EnumTransType TransType = EnumTransType.Issue;
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<AssembleNote> eventData)
{
var entity = eventData.Entity;
var transferLogs = new List<TransferLogEditInput>();
var route = entity.UseOnTheWayLocation
? EnumTransferRoute.SourceToOnTheWay
: EnumTransferRoute.SourceToDestination;
transferLogs.AddRange(await BuildTransferLogsAsync(entity).ConfigureAwait(false));
await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false);
}
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<List<AssembleNote>> eventData)
{
var entities = eventData.Entity;
var transferLogs = new List<TransferLogEditInput>();
//如果要做库存事务汇总,可以修改此处
foreach (var issueNote in entities)
{
transferLogs.AddRange(await BuildTransferLogsAsync(issueNote).ConfigureAwait(false));
}
await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false);
}
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsConfirmedEntityEventData<AssembleNote> eventData)
{
var entity = eventData.Entity;
var inputList = await BuildTransferLogsAsync(entity)
.ConfigureAwait(false);
await AddTransferLogsAsync(inputList).ConfigureAwait(false);
}
private async Task AddTransferLogsAsync(List<TransferLogEditInput> inputList)
{
var transferLogs = new List<TransferLogEditInput>();
transferLogs.AddRange(inputList);
await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false);
}
private async Task<List<TransferLogEditInput>> BuildTransferLogsAsync(AssembleNote issueNote)
{
var transferLogs = new List<TransferLogEditInput>();
foreach (var detail in issueNote.Details.Where(detail => detail.HandledToQty != 0))
{
var transferLog = ObjectMapper.Map<AssembleNoteDetail, TransferLogEditInput>(detail);
transferLog.TransSubType = EnumTransSubType.Issue_WIP;
transferLog.TransType = TransType;
transferLog.DocNumber = issueNote.Number;
transferLog.JobNumber = issueNote.JobNumber;
transferLogs.Add(transferLog);
}
await Task.CompletedTask.ConfigureAwait(false);
return transferLogs;
}
}

102
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/CoatingIssueNoteEventHandler.cs

@ -4,7 +4,6 @@ using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.EventBus;
using Volo.Abp.Uow;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Event;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
@ -16,19 +15,12 @@ namespace Win_in.Sfs.Wms.Store.Event.Transactions;
public class CoatingIssueNoteEventHandler
: StoreInventoryEventHandlerBase
, ILocalEventHandler<SfsCreatedEntityEventData<CoatingIssueNote>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<CoatingIssueNote>>>
, ILocalEventHandler<SfsConfirmedEntityEventData<CoatingIssueNote>>
, ILocalEventHandler<SfsCreatedEntityEventData<CoatingIssueNote>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<CoatingIssueNote>>>
, ILocalEventHandler<SfsConfirmedEntityEventData<CoatingIssueNote>>
{
private const EnumTransType TransType = EnumTransType.Issue;
private readonly ILocationAppService _locationAppService;
public CoatingIssueNoteEventHandler(ILocationAppService locationAppService)
{
_locationAppService = locationAppService;
}
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<CoatingIssueNote> eventData)
{
@ -37,13 +29,7 @@ public class CoatingIssueNoteEventHandler
var route = entity.UseOnTheWayLocation
? EnumTransferRoute.SourceToOnTheWay
: EnumTransferRoute.SourceToDestination;
transferLogs.AddRange(await BuildTransferLogsAsync(entity, route).ConfigureAwait(false));
//如果是mes拉动 先发到在途
if (entity.RequestType == EnumMaterialRequestType.Issue_WIP.ToString())
{
route = EnumTransferRoute.SourceToOnTheWay;
}
transferLogs.AddRange(await BuildTransferLogsAsync(entity).ConfigureAwait(false));
await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false);
}
@ -54,106 +40,50 @@ public class CoatingIssueNoteEventHandler
var entities = eventData.Entity;
var transferLogs = new List<TransferLogEditInput>();
//如果要做库存事务汇总,可以修改此处
foreach (var CoatingIssueNote in entities)
foreach (var issueNote in entities)
{
var route = CoatingIssueNote.UseOnTheWayLocation
? EnumTransferRoute.SourceToOnTheWay
: EnumTransferRoute.SourceToDestination;
transferLogs.AddRange(await BuildTransferLogsAsync(CoatingIssueNote, route).ConfigureAwait(false));
transferLogs.AddRange(await BuildTransferLogsAsync(issueNote).ConfigureAwait(false));
}
await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false);
}
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsConfirmedEntityEventData<CoatingIssueNote> eventData)
{
var entity = eventData.Entity;
var inputList = await BuildTransferLogsAsync(entity, EnumTransferRoute.OnTheWayToDestination).ConfigureAwait(false);
var inputList = await BuildTransferLogsAsync(entity)
.ConfigureAwait(false);
await AddTransferLogsAsync(inputList).ConfigureAwait(false);
}
private async Task AddTransferLogsAsync(List<TransferLogEditInput> inputList)
{
var transferLogs = new List<TransferLogEditInput>();
var transferLogs = new List<TransferLogEditInput>();
transferLogs.AddRange(inputList);
await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false);
}
private async Task<List<TransferLogEditInput>> BuildTransferLogsAsync(CoatingIssueNote CoatingIssueNote, EnumTransferRoute route)
private async Task<List<TransferLogEditInput>> BuildTransferLogsAsync(CoatingIssueNote issueNote)
{
var transferLogs = new List<TransferLogEditInput>();
foreach (var detail in CoatingIssueNote.Details.Where(detail => detail.Qty != 0))
foreach (var detail in issueNote.Details.Where(detail => detail.HandledToQty != 0))
{
var transferLog = ObjectMapper.Map<CoatingIssueNoteDetail, TransferLogEditInput>(detail);
LocationDTO fromLocationDTO = null;
LocationDTO toLocationDTO = null;
if (CoatingIssueNote.UseOnTheWayLocation)
{
var location = await _locationAppService.GetByCodeAsync(detail.OnTheWayLocationCode).ConfigureAwait(false);
switch (route)
{
case EnumTransferRoute.SourceToOnTheWay:
fromLocationDTO = await _locationAppService.GetByCodeAsync(detail.FromLocationCode).ConfigureAwait(false);
toLocationDTO = await _locationAppService.GetByCodeAsync(detail.OnTheWayLocationCode).ConfigureAwait(false);
break;
case EnumTransferRoute.OnTheWayToDestination:
fromLocationDTO = await _locationAppService.GetByCodeAsync(detail.OnTheWayLocationCode).ConfigureAwait(false);
toLocationDTO = await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false);
await RemovePackingCodeAndContainerCodeAndLotAsync(transferLog).ConfigureAwait(false);
break;
case EnumTransferRoute.SourceToDestination:
default:
throw new ArgumentOutOfRangeException(nameof(route), route, null);
}
}
else
{
fromLocationDTO = await _locationAppService.GetByCodeAsync(detail.FromLocationCode).ConfigureAwait(false);
toLocationDTO = await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false);
}
transferLog.FromLocationCode = fromLocationDTO.Code;
transferLog.FromLocationArea = fromLocationDTO.AreaCode;
transferLog.FromLocationErpCode = fromLocationDTO.ErpLocationCode;
transferLog.FromLocationGroup = fromLocationDTO.LocationGroupCode;
transferLog.ToLocationCode = toLocationDTO.Code;
transferLog.ToLocationArea = toLocationDTO.AreaCode;
transferLog.ToLocationErpCode = toLocationDTO.ErpLocationCode;
transferLog.ToLocationGroup = toLocationDTO.LocationGroupCode;
transferLog.TransSubType = Enum.Parse<EnumTransSubType>(CoatingIssueNote.RequestType);
transferLog.TransSubType = EnumTransSubType.Issue_WIP;
transferLog.TransType = TransType;
transferLog.DocNumber = CoatingIssueNote.Number;
transferLog.JobNumber = CoatingIssueNote.JobNumber;
transferLog.DocNumber = issueNote.Number;
transferLog.JobNumber = issueNote.JobNumber;
transferLogs.Add(transferLog);
}
return transferLogs;
}
private async Task RemovePackingCodeAndContainerCodeAndLotAsync(TransferLogEditInput transferLogCreateInput)
{
transferLogCreateInput.ToPackingCode = "";
transferLogCreateInput.ToLot = "";
transferLogCreateInput.ToContainerCode = "";
transferLogCreateInput.FromPackingCode = "";
transferLogCreateInput.FromLot = "";
transferLogCreateInput.FromContainerCode = "";
await Task.CompletedTask.ConfigureAwait(false);
return transferLogs;
}
}

Loading…
Cancel
Save