Browse Source

注塑功能更新

dev_DY_CC
周红军 12 months ago
parent
commit
64e2e99a84
  1. 30
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/InjectionPlanJobController.cs
  2. 10
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/InjectionPlanNoteController.cs
  3. 38
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/InjectionPlanJobs/DTOs/InjectionPlanJobDTO.cs
  4. 520
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/InjectionPlanJobs/DTOs/InjectionPlanJobDetailDTO.cs
  5. 14
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/InjectionPlanJobs/IInjectionPlanJobAppService.cs
  6. 23
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/InjectionPlanJobs/InjectionPlanJobPermissions.cs
  7. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/InjectionPlanJobs/Inputs/InjectionPlanJobCheckInput.cs
  8. 520
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/InjectionPlanJobs/Inputs/InjectionPlanJobDetailInput.cs
  9. 66
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/InjectionPlanJobs/Inputs/InjectionPlanJobEditInput.cs
  10. 12
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/InjectionJobs/DTOs/InjectionIssueJobDTO.cs
  11. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/InjectionJobs/DTOs/InjectionIssueJobDetailDTO.cs
  12. 23
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/InjectionJobs/IInjectionIssueJobAppService.cs
  13. 13
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/InjectionJobs/InjectionIssueJobPermissions.cs
  14. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/InjectionJobs/Inputs/InjectionIssueJobDetailInput.cs
  15. 30
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/InjectionJobs/Inputs/InjectionIssueJobEditInput.cs
  16. 47
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/InjectionPlanNotes/DTOs/InjectionPlanNoteDTO.cs
  17. 520
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/InjectionPlanNotes/DTOs/InjectionPlanNoteDetailDTO.cs
  18. 24
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/InjectionPlanNotes/IInjectionPlanNoteAppService.cs
  19. 21
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/InjectionPlanNotes/InjectionPlanNotePermissions.cs
  20. 520
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/InjectionPlanNotes/Inputs/InjectionPlanNoteDetailInput.cs
  21. 56
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/InjectionPlanNotes/Inputs/InjectionPlanNoteEditInput.cs
  22. 34
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/InjectionPlanNotes/Inputs/InjectionPlanNoteImportInput.cs
  23. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/InjectionIssueNotes/DTOs/InjectionIssueNoteDTO.cs
  24. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/InjectionIssueNotes/DTOs/InjectionIssueNoteDetailDTO.cs
  25. 12
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/InjectionIssueNotes/IInjectionIssueNoteAppService.cs
  26. 18
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/InjectionIssueNotes/InjectionIssueNotePermissions.cs
  27. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/InjectionIssueNotes/Inputs/InjectionIssueNoteDetailInput.cs
  28. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/InjectionIssueNotes/Inputs/InjectionIssueNoteEditInput.cs
  29. 8
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/InjectionIssueNotes/Inputs/InjectionIssueNoteImportInput.cs
  30. 36
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/InjectionPlanRequests/DTOs/InjectionPlanRequestDTO.cs
  31. 99
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/InjectionPlanRequests/DTOs/InjectionPlanRequestDetailDTO.cs
  32. 21
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/InjectionPlanRequests/IInjectionPlanRequestAppService.cs
  33. 22
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/InjectionPlanRequests/InjectionPlanRequestPermissions.cs
  34. 91
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/InjectionPlanRequests/Inputs/InjectionPlanRequestDetailInput.cs
  35. 26
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/InjectionPlanRequests/Inputs/InjectionPlanRequestEditInput.cs
  36. 48
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/InjectionPlanRequests/Inputs/InjectionPlanRequestImportInput.cs
  37. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/IssueRequest/InjectionIssueRequests/DTOs/InjectionIssueRequestDTO.cs
  38. 13
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/IssueRequest/InjectionIssueRequests/IInjectionIssueRequestAppService.cs
  39. 13
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/IssueRequest/InjectionIssueRequests/InjectionIssueRequestPermissions.cs
  40. 14
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/IssueRequest/InjectionIssueRequests/Inputs/InjectionIssueRequestEditInput.cs
  41. 12
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/IssueRequest/InjectionIssueRequests/Inputs/InjectionIssueRequestImportInput.cs
  42. 187
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InjectionPlanJobs/InjectionPlanJobAppService.cs
  43. 31
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InjectionPlanJobs/InjectionPlanJobAutoMapperProfile.cs
  44. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs
  45. 568
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobAppService.cs
  46. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobAutoMapperProfile.cs
  47. 112
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/InjectionPlanNotes/InjectionPlanNoteAppService.cs
  48. 31
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/InjectionPlanNotes/InjectionPlanNoteAutoMapperProfile.cs
  49. 68
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/IssueNotes/InjectionIssueNotes/InjectionIssueNoteAppService.cs
  50. 214
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/InjectionPlanRequests/InjectionPlanRequestAppService.cs
  51. 65
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/InjectionPlanRequests/InjectionPlanRequestAutoMapperProfile.cs
  52. 327
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/IssuelRequests/InjectionIssueRequests/InjectionIssueRequestAppService.cs
  53. 10
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/InjectionPlanJobs/IInjectionPlanJobManager.cs
  54. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/InjectionPlanJobs/IInjectionPlanJobRepository.cs
  55. 44
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/InjectionPlanJobs/InjectionPlanJob.cs
  56. 531
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/InjectionPlanJobs/InjectionPlanJobDetail.cs
  57. 121
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/InjectionPlanJobs/InjectionPlanJobManager.cs
  58. 22
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJob.cs
  59. 201
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobDetail.cs
  60. 7
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobManager.cs
  61. 10
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/InjectionPlanNotes/IInjectionPlanNoteManager.cs
  62. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/InjectionPlanNotes/IInjectionPlanNoteRepository.cs
  63. 72
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/InjectionPlanNotes/InjectionPlanNote.cs
  64. 520
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/InjectionPlanNotes/InjectionPlanNoteDetail.cs
  65. 42
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/InjectionPlanNotes/InjectionPlanNoteManager.cs
  66. 9
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/IssueNotes/InjectionIssueNotes/InjectionIssueNote.cs
  67. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/IssueNotes/InjectionIssueNotes/InjectionIssueNoteDetail.cs
  68. 13
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/InjectionPlanRequests/IInjectionPlanRequestManager.cs
  69. 9
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/InjectionPlanRequests/IInjectionPlanRequestRepository.cs
  70. 24
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/InjectionPlanRequests/InjectionPlanRequest.cs
  71. 101
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/InjectionPlanRequests/InjectionPlanRequestDetail.cs
  72. 77
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/InjectionPlanRequests/InjectionPlanRequestManager.cs
  73. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/IssueRequests/InjectionIssueRequests/IInjectionIssueRequestManager.cs
  74. 11
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/IssueRequests/InjectionIssueRequests/InjectionIssueRequest.cs
  75. 34
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/IssueRequests/InjectionIssueRequests/InjectionIssueRequestDetail.cs
  76. 30
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/IssueRequests/InjectionIssueRequests/InjectionIssueRequestManager.cs
  77. 3
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/IStoreDbContext.cs
  78. 61
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/InjectionPlanJobs/InjectionPlanJobDbContextModelCreatingExtensions.cs
  79. 11
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/InjectionPlanJobs/InjectionPlanJobEfCoreRepository.cs
  80. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobDbContextModelCreatingExtensions.cs
  81. 32171
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240515012138_Update_CoatingIssue.Designer.cs
  82. 67
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240515012138_Update_CoatingIssue.cs
  83. 1257
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/StoreDbContextModelSnapshot.cs
  84. 56
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/InjectionPlanNotes/InjectionPlanNoteDbContextModelCreatingExtensions.cs
  85. 11
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/InjectionPlanNotes/InjectionPlanNoteEfCoreRepository.cs
  86. 44
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/IssueNotes/InjectionIssueNotes/InjectionIssueNoteDbContextModelCreatingExtensions.cs
  87. 61
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/InjectionPlanRequests/InjectionPlanRequestDbContextModelCreatingExtensions.cs
  88. 11
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/InjectionPlanRequests/InjectionPlanRequestEfCoreRepository.cs
  89. 0
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/IssueRequests/InjectionIssueRequests/InjectionIssueRequestDbContextModelCreatingExtensions.cs
  90. 0
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/IssueRequests/InjectionIssueRequests/InjectionIssueRequestEfCoreRepository.cs
  91. 3
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContext.cs
  92. 3
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContextModelCreatingExtensions.cs
  93. 13
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/InjectionIssueJobAutoMapperProfile.cs
  94. 37
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/InjectionPlanJobAutoMapperProfile.cs
  95. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/InjectionNoteAutoMapperProfile.cs
  96. 51
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/InjectionPlanNoteAutoMapperProfile.cs
  97. 5
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/InjectionIssueRequestAutoMapperProfile.cs
  98. 35
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/InjectionPlanRequestAutoMapperProfile.cs
  99. 166
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/InjectionIssueJobEventHandler.cs
  100. 224
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/InjectionPlanJobEventHandler.cs

30
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/InjectionJobController.cs → be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/InjectionPlanJobController.cs

@ -18,13 +18,13 @@ using Win_in.Sfs.Wms.Store.Application.Contracts;
namespace Win_in.Sfs.Wms.Pda.Controllers.Jobs;
/// <summary>
/// 注塑叫料任务
/// 注塑计划任务
/// </summary>
[ApiController]
[Route($"{PdaHostConst.ROOT_ROUTE}job/injection")]
public class InjectionIssueJobController : AbpController
[Route($"{PdaHostConst.ROOT_ROUTE}job/injection-plan")]
public class InjectionPlanJobController : AbpController
{
private readonly IInjectionIssueJobAppService _injectionJobAppService;
private readonly IInjectionPlanJobAppService _injectionJobAppService;
private readonly IUserWorkGroupAppService _userWorkGroupAppService;
@ -35,8 +35,8 @@ public class InjectionIssueJobController : AbpController
/// </summary>
/// <param name="injectionJobAppService"></param>
/// <param name="userWorkGroupAppService"></param>
public InjectionIssueJobController(
IInjectionIssueJobAppService injectionJobAppService,
public InjectionPlanJobController(
IInjectionPlanJobAppService injectionJobAppService,
IDictAppService dictApp
, IUserWorkGroupAppService userWorkGroupAppService)
{
@ -52,7 +52,7 @@ public class InjectionIssueJobController : AbpController
/// <returns></returns>
[HttpGet("{id}")]
public virtual async Task<ActionResult<InjectionIssueJobDTO>> GetAsync(Guid id)
public virtual async Task<ActionResult<InjectionPlanJobDTO>> GetAsync(Guid id)
{
var result = await _injectionJobAppService.GetAsync(id).ConfigureAwait(false);
return Ok(result);
@ -64,7 +64,7 @@ public class InjectionIssueJobController : AbpController
/// <param name="sfsRequestDTO"></param>
/// <returns></returns>
[HttpPost("list")]
public virtual async Task<PagedResultDto<InjectionIssueJobDTO>> GetListAsync(SfsJobRequestInputBase sfsRequestDTO)
public virtual async Task<PagedResultDto<InjectionPlanJobDTO>> GetListAsync(SfsJobRequestInputBase sfsRequestDTO)
{
var list = await _injectionJobAppService.GetPagedListByFilterAsync(sfsRequestDTO, true).ConfigureAwait(false);
return list;
@ -77,7 +77,7 @@ public class InjectionIssueJobController : AbpController
/// <param name="pageIndex"></param>
/// <returns></returns>
[HttpGet("list")]
public virtual async Task<PagedResultDto<InjectionIssueJobDTO>> GetListAsync(int pageSize, int pageIndex)
public virtual async Task<PagedResultDto<InjectionPlanJobDTO>> GetListAsync(int pageSize, int pageIndex)
{
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status);
@ -86,7 +86,7 @@ public class InjectionIssueJobController : AbpController
{
MaxResultCount = pageSize,
SkipCount = (pageIndex - 1) * pageSize,
Sorting = $"{nameof(InjectionIssueJobDTO.CreationTime)} ASC",
Sorting = $"{nameof(InjectionPlanJobDTO.CreationTime)} ASC",
Condition = new Condition
{
Filters = new List<Filter>
@ -109,7 +109,7 @@ public class InjectionIssueJobController : AbpController
/// <param name="jobNumber"></param>
/// <returns></returns>
[HttpGet("by-number/{jobNumber}")]
public virtual async Task<ActionResult<InjectionIssueJobDTO>> GetByNumberAsync(string jobNumber)
public virtual async Task<ActionResult<InjectionPlanJobDTO>> GetByNumberAsync(string jobNumber)
{
var jobDto = await _injectionJobAppService.GetByNumberAsync(jobNumber).ConfigureAwait(false);
if (jobDto == null)
@ -143,13 +143,13 @@ public class InjectionIssueJobController : AbpController
var request = new SfsJobRequestInputBase
{
Sorting = $"{nameof(InjectionIssueJobDTO.Priority)} ASC",
Sorting = $"{nameof(InjectionPlanJobDTO.Priority)} ASC",
Condition = new Condition
{
Filters = new List<Filter>
{
new(nameof(InjectionIssueJobDTO.WorkGroupCode),jsonCodes,"In"),
new(nameof(InjectionIssueJobDTO.JobStatus),jsonStatus,"In")
new(nameof(InjectionPlanJobDTO.WorkGroupCode),jsonCodes,"In"),
new(nameof(InjectionPlanJobDTO.JobStatus),jsonStatus,"In")
}
}
};
@ -188,7 +188,7 @@ public class InjectionIssueJobController : AbpController
/// <param name="dto"></param>
/// <returns></returns>
[HttpPost("finish/{id}")]
public virtual async Task FinishAsync(Guid id, [FromBody] InjectionIssueJobDTO dto)
public virtual async Task FinishAsync(Guid id, [FromBody] InjectionPlanJobDTO dto)
{
await _injectionJobAppService.CompleteAsync(id, dto).ConfigureAwait(false);
}

10
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/InjectionNoteController.cs → be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/InjectionPlanNoteController.cs

@ -6,12 +6,12 @@ using Win_in.Sfs.Wms.Store.Application.Contracts;
namespace Win_in.Sfs.Wms.Pda.Controllers.Stores;
/// <summary>
/// 注塑叫料记录
/// 注塑计划记录
/// </summary>
[ApiController]
[Route($"{PdaHostConst.ROOT_ROUTE}store/injection-note")]
[Route($"{PdaHostConst.ROOT_ROUTE}store/injection-plan-note")]
public class InjectionIssueNoteController : AbpController
public class InjectionPlanNoteController : AbpController
{
private readonly IInjectionIssueNoteAppService _injectionNoteAppService;
@ -19,13 +19,13 @@ public class InjectionIssueNoteController : AbpController
///
/// </summary>
/// <param name="injectionNoteAppService"></param>
public InjectionIssueNoteController(IInjectionIssueNoteAppService injectionNoteAppService)
public InjectionPlanNoteController(IInjectionIssueNoteAppService injectionNoteAppService)
{
_injectionNoteAppService = injectionNoteAppService;
}
/// <summary>
/// 创建注塑叫料记录
/// 创建注塑计划记录
/// </summary>
/// <param name="input">CreateInput</param>
/// <returns></returns>

38
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/InjectionPlanJobs/DTOs/InjectionPlanJobDTO.cs

@ -0,0 +1,38 @@
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
/// <summary>
/// 注塑计划任务
/// </summary>
[Display(Name = "注塑计划任务")]
public class InjectionPlanJobDTO : SfsJobDTOBase<InjectionPlanJobDetailDTO>
{
/// <summary>
/// 叫料类型
/// </summary>
[Display(Name = "叫料类型")]
public EnumIssueRequestType IssueRequestType { get; set; }
/// <summary>
/// 生产线
/// </summary>
[Display(Name = "生产线")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ProdLine { get; set; }
/// <summary>
/// 要货单号
/// </summary>
[Display(Name = "要货单号")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string InjectionPlanRequestNumber { get; set; }
/// <summary>
/// 使用在途库
/// </summary>
[Display(Name = "使用在途库")]
public bool UseOnTheWayLocation { get; set; }
}

520
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/InjectionPlanJobs/DTOs/InjectionPlanJobDetailDTO.cs

@ -0,0 +1,520 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class InjectionPlanJobDetailDTO : SfsDetailDTOBase
{
#region 库存基础信息
/// <summary>
/// 物品代码
/// </summary>
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>
public string Uom { get; set; }
#endregion
#region 请求信息
/// <summary>
/// 请求库位
/// </summary>
public string RequestLocationCode { get; set; }
/// <summary>
/// 到库区
/// </summary>
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
}

14
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/InjectionPlanJobs/IInjectionPlanJobAppService.cs

@ -0,0 +1,14 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public interface IInjectionPlanJobAppService
: ISfsJobAppServiceBase<InjectionPlanJobDTO, SfsJobRequestInputBase, InjectionPlanJobCheckInput, InjectionPlanJobEditInput>
{
Task CancelByMaterialRequestAsync(string injectionNumber);
Task<List<InjectionPlanJobDTO>> GetByRequestNumberAsync(string requestNumber);
}

23
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/InjectionPlanJobs/InjectionPlanJobPermissions.cs

@ -0,0 +1,23 @@
using Volo.Abp.Authorization.Permissions;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public static class InjectionPlanJobPermissions
{
public const string Default = StorePermissions.GroupName + "." + nameof(InjectionPlanJob);
public const string Create = Default + "." + StorePermissions.CreateStr;
public const string Update = Default + "." + StorePermissions.UpdateStr;
public const string Delete = Default + "." + StorePermissions.DeleteStr;
public static void AddInjectionPlanJobPermission(this PermissionGroupDefinition permissionGroup)
{
var injectionPlanJobPermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(InjectionPlanJob)));
injectionPlanJobPermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr));
injectionPlanJobPermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr));
injectionPlanJobPermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr));
}
}

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/InjectionPlanJobs/Inputs/InjectionPlanJobCheckInput.cs

@ -0,0 +1,6 @@
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class InjectionPlanJobCheckInput : SfsJobCheckInputBase
{
}

520
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/InjectionPlanJobs/Inputs/InjectionPlanJobDetailInput.cs

@ -0,0 +1,520 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class InjectionPlanJobDetailInput : SfsDetailInputBase
{
#region 库存基础信息
/// <summary>
/// 物品代码
/// </summary>
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>
public string Uom { get; set; }
#endregion
#region 请求信息
/// <summary>
/// 请求库位
/// </summary>
public string RequestLocationCode { get; set; }
/// <summary>
/// 到库区
/// </summary>
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
}

66
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/InjectionPlanJobs/Inputs/InjectionPlanJobEditInput.cs

@ -0,0 +1,66 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class InjectionPlanJobEditInput : SfsJobCreateUpdateInputBase, ISfsJobCreateInput<InjectionPlanJobDetailInput>
{
/// <summary>
/// 上游任务编号
/// </summary>
[Display(Name = "上游任务编号")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string UpStreamJobNumber { get; set; }
/// <summary>
/// 要货单号
/// </summary>
[Display(Name = "要货单号")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string InjectionPlanRequestNumber { get; set; }
/// <summary>
/// 任务类型
/// </summary>
[Display(Name = "任务类型")]
[Required(ErrorMessage = "{0}是必填项")]
public EnumJobType JobType { get; set; }
/// <summary>
/// 是否自动完成
/// </summary>
[Display(Name = "是否自动完成")]
[Required(ErrorMessage = "{0}是必填项")]
public bool IsAutoComplete { get; set; }
/// <summary>
/// 过期时间
/// </summary>
[Display(Name = "过期时间")]
[Required(ErrorMessage = "{0}是必填项")]
public DateTime ExpiredTime { get; set; }
/// <summary>
/// 任务明细
/// </summary>
[Display(Name = "任务明细")]
[Required(ErrorMessage = "{0}是必填项")]
public List<InjectionPlanJobDetailInput> Details { get; set; } = new();
/// <summary>
/// 使用在途库
/// </summary>
[Display(Name = "使用在途库")]
public bool UseOnTheWayLocation { get; set; }
/// <summary>
/// 叫料类型
/// </summary>
[Display(Name = "叫料类型")]
public EnumIssueRequestType IssueRequestType { get; set; }
}

12
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/InjectionJobs/DTOs/InjectionIssueJobDTO.cs

@ -1,21 +1,21 @@
using System.ComponentModel.DataAnnotations;
using Microsoft.EntityFrameworkCore;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
/// <summary>
/// 注塑发料任务
/// 注塑叫料任务
/// </summary>
[Display(Name = "注塑料任务")]
[Display(Name = "注塑料任务")]
public class InjectionIssueJobDTO : SfsJobDTOBase<InjectionIssueJobDetailDTO>
{
/// <summary>
/// 叫料类型
/// 叫料类型
/// </summary>
[Display(Name = "叫料类型")]
public EnumIssueRequestType IssueRequestType { get; set; }
/// <summary>
/// 生产线
/// </summary>
@ -28,11 +28,13 @@ public class InjectionIssueJobDTO : SfsJobDTOBase<InjectionIssueJobDetailDTO>
/// </summary>
[Display(Name = "要货单号")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string InjectionIssueRequestNumber { get; set; }
public string InjectionRequestNumber { get; set; }
/// <summary>
/// 使用在途库
/// </summary>
[Display(Name = "使用在途库")]
public bool UseOnTheWayLocation { get; set; }
public EnumIssueSendType EnumIssueSendType { get; set; }
}

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/InjectionJobs/DTOs/InjectionIssueJobDetailDTO.cs

@ -3,7 +3,6 @@ using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;

23
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/InjectionJobs/IInjectionIssueJobAppService.cs

@ -1,14 +1,27 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public interface IInjectionIssueJobAppService
: ISfsJobAppServiceBase<InjectionIssueJobDTO, SfsJobRequestInputBase, InjectionIssueJobCheckInput, InjectionIssueJobEditInput>
: ISfsJobAppServiceBase<InjectionIssueJobDTO, SfsJobRequestInputBase, InjectionIssueJobCheckInput,
InjectionIssueJobEditInput>
{
Task CancelByMaterialRequestAsync(string injectionNumber);
Task<List<InjectionIssueJobDTO>> GetByRequestNumberAsync(string requestNumber);
/// <summary>
/// 执行任务明细
/// </summary>
/// <returns></returns>
Task ExecuteDetailAsync(Guid masterId, Guid detailId, InjectionIssueJobDetailDTO issueJobDetailDto);
Task CompleteAsync(Guid id);
/// <summary>
/// 请求点了完成,任务全部都完成
/// </summary>
/// <param name="requestNumber"></param>
/// <returns></returns>
Task CompleteByRequestNumberAsync(string requestNumber);
}

13
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/InjectionJobs/InjectionIssueJobPermissions.cs

@ -11,17 +11,12 @@ public static class InjectionIssueJobPermissions
public const string Update = Default + "." + StorePermissions.UpdateStr;
public const string Delete = Default + "." + StorePermissions.DeleteStr;
//自动发料任务
public const string AutoInjectionIssueJob = StorePermissions.GroupName + "." + nameof(AutoInjectionIssueJob);
public static void AddInjectionIssueJobPermission(this PermissionGroupDefinition permissionGroup)
{
var InjectionIssueJobPermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(InjectionIssueJob)));
InjectionIssueJobPermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr));
InjectionIssueJobPermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr));
InjectionIssueJobPermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr));
permissionGroup.AddPermission(AutoInjectionIssueJob, StorePermissionDefinitionProvider.L(nameof(AutoInjectionIssueJob)));
var injectionIssueJobPermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(InjectionIssueJob)));
injectionIssueJobPermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr));
injectionIssueJobPermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr));
injectionIssueJobPermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr));
}
}

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/InjectionJobs/Inputs/InjectionIssueJobDetailInput.cs

@ -3,7 +3,6 @@ using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;

30
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/IssueJobs/InjectionJobs/Inputs/InjectionIssueJobEditInput.cs

@ -9,58 +9,62 @@ namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class InjectionIssueJobEditInput : SfsJobCreateUpdateInputBase, ISfsJobCreateInput<InjectionIssueJobDetailInput>
{
#region Create
/// <summary>
/// 上游任务编号
/// 上游任务编号
/// </summary>
[Display(Name = "上游任务编号")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string UpStreamJobNumber { get; set; }
/// <summary>
/// 要货单号
/// 要货单号
/// </summary>
[Display(Name = "要货单号")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string InjectionIssueRequestNumber { get; set; }
public string InjectionRequestNumber { get; set; }
/// <summary>
/// 任务类型
/// 叫料类型
/// </summary>
[Display(Name = "叫料类型")]
public EnumIssueRequestType IssueRequestType { get; set; }
/// <summary>
/// 任务类型
/// </summary>
[Display(Name = "任务类型")]
[Required(ErrorMessage = "{0}是必填项")]
public EnumJobType JobType { get; set; }
/// <summary>
/// 是否自动完成
/// 是否自动完成
/// </summary>
[Display(Name = "是否自动完成")]
[Required(ErrorMessage = "{0}是必填项")]
public bool IsAutoComplete { get; set; }
/// <summary>
/// 过期时间
/// 过期时间
/// </summary>
[Display(Name = "过期时间")]
[Required(ErrorMessage = "{0}是必填项")]
public DateTime ExpiredTime { get; set; }
/// <summary>
/// 任务明细
/// 任务明细
/// </summary>
[Display(Name = "任务明细")]
[Required(ErrorMessage = "{0}是必填项")]
public List<InjectionIssueJobDetailInput> Details { get; set; } = new();
/// <summary>
/// 使用在途库
/// 使用在途库
/// </summary>
[Display(Name = "使用在途库")]
public bool UseOnTheWayLocation { get; set; }
/// <summary>
/// 叫料类型
/// </summary>
[Display(Name = "叫料类型")]
public EnumIssueRequestType IssueRequestType { get; set; }
public EnumIssueSendType EnumIssueSendType { get; set; }
#endregion
}

47
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/InjectionPlanNotes/DTOs/InjectionPlanNoteDTO.cs

@ -0,0 +1,47 @@
using System;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class InjectionPlanNoteDTO : SfsStoreDTOBase<InjectionPlanNoteDetailDTO>, IHasJobNumber, IHasRequestNumber
{
/// <summary>
/// 任务ID
/// </summary>
[Display(Name = "任务ID")]
public string JobNumber { get; set; }
/// <summary>
/// 请求代码
/// </summary>
[Display(Name = "请求代码")]
public string RequestNumber { get; set; }
/// <summary>
/// 叫料类型
/// </summary>
[Display(Name = "叫料类型")]
public EnumIssueRequestType IssueRequestType { get; set; }
/// <summary>
/// 使用在途库
/// </summary>
[Display(Name = "使用在途库")]
public bool UseOnTheWayLocation { get; set; }
/// <summary>
/// 已确认
/// </summary>
[Display(Name = "已确认")]
public bool Confirmed { get; set; }
/// <summary>
/// 确认时间
/// </summary>
[Display(Name = "确认时间")]
public DateTime? ConfirmTime { get; set; }
}

520
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/InjectionPlanNotes/DTOs/InjectionPlanNoteDetailDTO.cs

@ -0,0 +1,520 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class InjectionPlanNoteDetailDTO : SfsDetailDTOBase
{
#region 库存基础信息
/// <summary>
/// 物品代码
/// </summary>
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>
public string Uom { get; set; }
#endregion
#region 请求信息
/// <summary>
/// 请求库位
/// </summary>
public string RequestLocationCode { get; set; }
/// <summary>
/// 到库区
/// </summary>
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
}

24
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/InjectionPlanNotes/IInjectionPlanNoteAppService.cs

@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public interface IInjectionPlanNoteAppService : ISfsStoreMasterReadOnlyAppServiceBase<InjectionPlanNoteDTO,
SfsStoreRequestInputBase, InjectionPlanNoteDetailDTO, SfsStoreRequestInputBase>
{
Task<InjectionPlanNoteDTO> CreateAsync(InjectionPlanNoteEditInput input);
Task<InjectionPlanNoteDTO> ConfirmAsync(Guid id);
Task<InjectionPlanNoteDTO> ConfirmAsync(string number);
Task<List<InjectionPlanNoteDTO>> GetListUnConfirmedByTypeAsync(EnumIssueRequestType issueRequestType);
Task<PagedResultDto<InjectionPlanNoteDTO>> GetListByTypeAsync(SfsStoreRequestInputBase requestInput,
EnumIssueRequestType issueRequestType, bool includeDetails = false,
CancellationToken cancellationToken = default);
}

21
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/InjectionPlanNotes/InjectionPlanNotePermissions.cs

@ -0,0 +1,21 @@
using Volo.Abp.Authorization.Permissions;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public static class InjectionPlanNotePermissions
{
public const string Default = StorePermissions.GroupName + "." + nameof(InjectionPlanNote);
public const string Create = Default + "." + StorePermissions.CreateStr;
public const string Update = Default + "." + StorePermissions.UpdateStr;
public const string Delete = Default + "." + StorePermissions.DeleteStr;
public static void AddInjectionPlanNotePermission(this PermissionGroupDefinition permissionGroup)
{
var injectionPlanNotePermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(InjectionPlanNote)));
injectionPlanNotePermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr));
injectionPlanNotePermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr));
injectionPlanNotePermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr));
}
}

520
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/InjectionPlanNotes/Inputs/InjectionPlanNoteDetailInput.cs

@ -0,0 +1,520 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class InjectionPlanNoteDetailInput : SfsDetailInputBase
{
#region 库存基础信息
/// <summary>
/// 物品代码
/// </summary>
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>
public string Uom { get; set; }
#endregion
#region 请求信息
/// <summary>
/// 请求库位
/// </summary>
public string RequestLocationCode { get; set; }
/// <summary>
/// 到库区
/// </summary>
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
}

56
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/InjectionPlanNotes/Inputs/InjectionPlanNoteEditInput.cs

@ -0,0 +1,56 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class InjectionPlanNoteEditInput : SfsStoreCreateOrUpdateInputBase
{
#region Base
/// <summary>
/// 已确认
/// </summary>
[Display(Name = "已确认")]
public bool Confirmed { get; set; }
#endregion
#region Create
/// <summary>
/// 发料记录号
/// </summary>
[Display(Name = "发料记录号")]
public string Number { get; set; }
/// <summary>
/// 任务ID
/// </summary>
[Display(Name = "任务ID")]
[Required(ErrorMessage = "{0}是必填项")]
public string JobNumber { get; set; }
/// <summary>
/// 明细列表
/// </summary>
[Display(Name = "明细列表")]
public List<InjectionPlanNoteDetailInput> Details { get; set; }
/// <summary>
/// 请求号码
/// </summary>
[Display(Name = "请求号码")]
public string RequestNumber { get; set; }
/// <summary>
/// 叫料类型
/// </summary>
[Display(Name = "叫料类型")]
public EnumIssueRequestType IssueRequestType { get; set; }
/// <summary>
/// 使用在途库
/// </summary>
[Display(Name = "使用在途库")]
public bool UseOnTheWayLocation { get; set; }
#endregion
}

34
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/InjectionPlanNotes/Inputs/InjectionPlanNoteImportInput.cs

@ -0,0 +1,34 @@
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class InjectionPlanNoteImportInput : SfsStoreImportInputBase, IHasJobNumber, IHasRequestNumber
{
/// <summary>
/// 任务ID
/// </summary>
[Display(Name = "任务ID")]
public string JobNumber { get; set; }
/// <summary>
/// 车间
/// </summary>
[Display(Name = "车间")]
public string Workshop { get; set; }
public string RequestNumber { get; set; }
/// <summary>
/// 叫料类型
/// </summary>
[Display(Name = "叫料类型")]
public EnumIssueRequestType IssueRequestType { get; set; }
/// <summary>
/// 使用在途库
/// </summary>
[Display(Name = "使用在途库")]
[Required(ErrorMessage = "{0}是必填项")]
public bool UseOnTheWayLocation { get; set; }
}

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/InjectionIssueNotes/DTOs/InjectionIssueNoteDTO.cs

@ -44,4 +44,5 @@ public class InjectionIssueNoteDTO : SfsStoreDTOBase<InjectionIssueNoteDetailDTO
[Display(Name = "确认时间")]
public DateTime? ConfirmTime { get; set; }
public EnumIssueSendType EnumIssueSendType { get; set; }
}

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/InjectionIssueNotes/DTOs/InjectionIssueNoteDetailDTO.cs

@ -3,7 +3,6 @@ using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;

12
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/InjectionIssueNotes/IInjectionIssueNoteAppService.cs

@ -3,22 +3,12 @@ using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public interface IInjectionIssueNoteAppService : ISfsStoreMasterReadOnlyAppServiceBase<InjectionIssueNoteDTO,
SfsStoreRequestInputBase, InjectionIssueNoteDetailDTO, SfsStoreRequestInputBase>
public interface IInjectionIssueNoteAppService : ISfsStoreMasterReadOnlyAppServiceBase<InjectionIssueNoteDTO, SfsStoreRequestInputBase, InjectionIssueNoteDetailDTO, SfsStoreRequestInputBase>
{
Task<InjectionIssueNoteDTO> CreateAsync(InjectionIssueNoteEditInput input);
Task<InjectionIssueNoteDTO> ConfirmAsync(Guid id);
Task<InjectionIssueNoteDTO> ConfirmAsync(string number);
Task<List<InjectionIssueNoteDTO>> GetListUnConfirmedByTypeAsync(EnumIssueRequestType issueRequestType);
Task<PagedResultDto<InjectionIssueNoteDTO>> GetListByTypeAsync(SfsStoreRequestInputBase requestInput,
EnumIssueRequestType issueRequestType, bool includeDetails = false,
CancellationToken cancellationToken = default);
}

18
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/InjectionIssueNotes/InjectionIssueNotePermissions.cs

@ -5,26 +5,16 @@ namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public static class InjectionIssueNotePermissions
{
public const string Default = StorePermissions.GroupName + "." + nameof(InjectionIssueNote);
public const string Create = Default + "." + StorePermissions.CreateStr;
public const string Update = Default + "." + StorePermissions.UpdateStr;
public const string Delete = Default + "." + StorePermissions.DeleteStr;
//自动发料记录
public const string AutoInjectionIssueNote = StorePermissions.GroupName + "." + nameof(AutoInjectionIssueNote);
//直接发料
public const string DirectInjectionIssueNote = StorePermissions.GroupName + "." + nameof(DirectInjectionIssueNote);
public static void AddInjectionIssueNotePermission(this PermissionGroupDefinition permissionGroup)
{
var injectionNotePermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(InjectionIssueNote)));
injectionNotePermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr));
injectionNotePermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr));
injectionNotePermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr));
permissionGroup.AddPermission(AutoInjectionIssueNote, StorePermissionDefinitionProvider.L(nameof(AutoInjectionIssueNote)));
permissionGroup.AddPermission(DirectInjectionIssueNote, StorePermissionDefinitionProvider.L(nameof(DirectInjectionIssueNote)));
var injectionIssueNotePermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(InjectionIssueNote)));
injectionIssueNotePermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr));
injectionIssueNotePermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr));
injectionIssueNotePermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr));
}
}

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/InjectionIssueNotes/Inputs/InjectionIssueNoteDetailInput.cs

@ -3,7 +3,6 @@ using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/InjectionIssueNotes/Inputs/InjectionIssueNoteEditInput.cs

@ -52,5 +52,7 @@ public class InjectionIssueNoteEditInput : SfsStoreCreateOrUpdateInputBase
/// </summary>
[Display(Name = "使用在途库")]
public bool UseOnTheWayLocation { get; set; }
public EnumIssueSendType EnumIssueSendType { get; set; }
#endregion
}

8
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/IssueNotes/InjectionIssueNotes/Inputs/InjectionIssueNoteImportInput.cs

@ -6,13 +6,13 @@ namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class InjectionIssueNoteImportInput : SfsStoreImportInputBase, IHasJobNumber, IHasRequestNumber
{
/// <summary>
/// 任务ID
/// 任务ID
/// </summary>
[Display(Name = "任务ID")]
public string JobNumber { get; set; }
/// <summary>
/// 车间
/// 车间
/// </summary>
[Display(Name = "车间")]
public string Workshop { get; set; }
@ -26,9 +26,11 @@ public class InjectionIssueNoteImportInput : SfsStoreImportInputBase, IHasJobNum
public EnumIssueRequestType IssueRequestType { get; set; }
/// <summary>
/// 使用在途库
/// 使用在途库
/// </summary>
[Display(Name = "使用在途库")]
[Required(ErrorMessage = "{0}是必填项")]
public bool UseOnTheWayLocation { get; set; }
public EnumIssueSendType EnumIssueSendType { get; set; }
}

36
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/InjectionPlanRequests/DTOs/InjectionPlanRequestDTO.cs

@ -0,0 +1,36 @@
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain.Entities;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class InjectionPlanRequestDTO : SfsStoreRequestDTOBase<InjectionPlanRequestDetailDTO>, IHasNumber
{
/// <summary>
/// 叫料类型
/// </summary>
[Display(Name = "叫料类型")]
public EnumIssueRequestType IssueRequestType { get; set; }
/// <summary>
/// 是否使用在途库
/// </summary>
[Display(Name = "是否使用在途库")]
public bool IsUseOnTheWayLocation { get; set; }
/// <summary>
/// 可用来源库位Json集合
/// </summary>
public string FromLocationCodeJsonList { get; set; }
/// <summary>
/// 叫料库位
/// </summary>
public string ToLocationCode { get; set; }
/// <summary>
/// 目标ERP储位
/// </summary>
[Display(Name = "目标ERP储位")]
public string ToLocationErpCode { get; set; }
}

99
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/InjectionPlanRequests/DTOs/InjectionPlanRequestDetailDTO.cs

@ -0,0 +1,99 @@
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.Application.Contracts;
public class InjectionPlanRequestDetailDTO : SfsStoreDetailWithQtyDTOBase
{
#region 目标库位信息
/// <summary>
/// 目标库位
/// </summary>
[Display(Name = "目标库位")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ToLocationCode { get; set; }
/// <summary>
/// 目标库区
/// </summary>
[Display(Name = "目标库区")]
public string ToLocationArea { get; set; }
/// <summary>
/// 目标库位组
/// </summary>
[Display(Name = "目标库位组")]
public string ToLocationGroup { get; set; }
/// <summary>
/// 目标ERP储位
/// </summary>
[Display(Name = "目标ERP储位")]
public string ToLocationErpCode { get; set; }
/// <summary>
/// 目标仓库
/// </summary>
[Display(Name = "目标仓库")]
public string ToWarehouseCode { get; set; }
#endregion
/// <summary>
/// 生产线
/// </summary>
public string ProdLine { get; set; }
/// <summary>
/// 已发数量
/// </summary>
public decimal IssuedQty { get; set; }
/// <summary>
/// 已收数量
/// </summary>
public decimal ReceivedQty { get; set; }
/// <summary>
/// 明细状态
/// </summary>
public EnumStatus Status { get; set; }
/// <summary>
/// 请求未发 还未发送的数量
/// </summary>
[NotMapped]
public decimal ToBeIssuedQty => Qty - IssuedQty;
/// <summary>
/// 已发未收
/// </summary>
[NotMapped]
public decimal ToBeReceivedQty => IssuedQty - ReceivedQty;
/// <summary>
/// 请求未收
/// </summary>
[NotMapped]
public decimal NotFinishQty => Qty - ReceivedQty;
/// <summary>
/// 位置码
/// </summary>
public string PositionCode { get; set; }
/// <summary>
/// 推荐类型
/// </summary>
public EnumRecommendType RecommendType { get; set; }
/// <summary>
/// 需求箱数量
/// </summary>
[Display(Name = "需求箱数量")]
public decimal BoxQty { get; set; }
}

21
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/InjectionPlanRequests/IInjectionPlanRequestAppService.cs

@ -0,0 +1,21 @@
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Win_in.Sfs.Basedata.Application.Contracts;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public interface IInjectionPlanRequestAppService
: ISfsStoreRequestMasterAppServiceBase<InjectionPlanRequestDTO, SfsStoreRequestInputBase, InjectionPlanRequestEditInput, InjectionPlanRequestDetailDTO, SfsStoreRequestInputBase>
{
/// <summary>
/// 获取物品类别列表
/// </summary>
/// <returns></returns>
Task<List<ItemBasicDTO>> GetItemCategoryListAsync();
Task<List<UnCompletedRequestDto>> GetUnCompletedRequestAsync(List<UnCompletedRequestDto> p_list);
}

22
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/InjectionPlanRequests/InjectionPlanRequestPermissions.cs

@ -0,0 +1,22 @@
using Volo.Abp.Authorization.Permissions;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public static class InjectionPlanRequestPermissions
{
public const string Default = StorePermissions.GroupName + "." + nameof(InjectionPlanRequest);
public const string Create = Default + "." + StorePermissions.CreateStr;
public const string Update = Default + "." + StorePermissions.UpdateStr;
public const string Delete = Default + "." + StorePermissions.DeleteStr;
public static void AddInjectionPlanRequestPermission(this PermissionGroupDefinition permissionGroup)
{
var injectionPlanRequestPermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(InjectionPlanRequest)));
injectionPlanRequestPermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr));
injectionPlanRequestPermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr));
injectionPlanRequestPermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr));
}
}

91
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/InjectionPlanRequests/Inputs/InjectionPlanRequestDetailInput.cs

@ -0,0 +1,91 @@
using System;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class InjectionPlanRequestDetailInput : SfsStoreDetailWithQtyInputBase
{
#region 目标库位信息
/// <summary>
/// 目标库位
/// </summary>
[Display(Name = "目标库位")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ToLocationCode { get; set; }
/// <summary>
/// 目标库区
/// </summary>
[Display(Name = "目标库区")]
public string ToLocationArea { get; set; }
/// <summary>
/// 目标库位组
/// </summary>
[Display(Name = "目标库位组")]
public string ToLocationGroup { get; set; }
/// <summary>
/// 目标ERP储位
/// </summary>
[Display(Name = "目标ERP储位")]
public string ToLocationErpCode { get; set; }
/// <summary>
/// 目标仓库
/// </summary>
[Display(Name = "目标仓库")]
public string ToWarehouseCode { get; set; }
#endregion
/// <summary>
/// 生产线
/// </summary>
[Display(Name = "生产线")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ProdLine { get; set; }
/// <summary>
/// 状态
/// </summary>
[Display(Name = "状态")]
public EnumRequestStatus RequestStatus { get; set; } = EnumRequestStatus.New;
/// <summary>
/// 已发数量
/// </summary>
[Display(Name = "已发数量")]
public decimal IssuedQty { get; set; }
/// <summary>
/// 已收数量
/// </summary>
[Display(Name = "已收数量")]
public decimal ReceivedQty { get; set; }
/// <summary>
/// 明细状态
/// </summary>
[Display(Name = "明细状态")]
public EnumStatus Status { get; set; }
/// <summary>
/// 位置码
/// </summary>
public string PositionCode { get; set; }
/// <summary>
/// 推荐类型
/// </summary>
public EnumRecommendType RecommendType { get; set; }
/// <summary>
/// 需求箱数量
/// </summary>
[Display(Name = "需求箱数量")]
public decimal BoxQty { get; set; }
}

26
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/InjectionPlanRequests/Inputs/InjectionPlanRequestEditInput.cs

@ -0,0 +1,26 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class InjectionPlanRequestEditInput : SfsStoreRequestCreateOrUpdateInputBase
{
/// <summary>
/// 叫料类型
/// </summary>
[Display(Name = "叫料类型")]
public EnumIssueRequestType IssueRequestType { get; set; }
/// <summary>
/// 使用在途库
/// </summary>
[Display(Name = "使用在途库")]
public bool UseOnTheWayLocation { get; set; }
/// <summary>
/// 明细列表
/// </summary>
[Display(Name = "明细列表")]
public List<InjectionPlanRequestDetailInput> Details { get; set; } = new();
}

48
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/InjectionPlanRequests/Inputs/InjectionPlanRequestImportInput.cs

@ -0,0 +1,48 @@
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
[Display(Name = "叫料申请")]
public class InjectionPlanRequestImportInput : SfsStoreImportInputBase
{
/// <summary>
/// 叫料类型
/// </summary>
[Display(Name = "叫料类型")]
public EnumIssueRequestType IssueRequestType { get; set; }
/// <summary>
/// 物品代码
/// </summary>
[Display(Name = "物品代码")]
[Required]
public string ItemCode { get; set; }
/// <summary>
/// 目标库位
/// </summary>
[Display(Name = "目标库位")]
[Required]
public string ToLocationCode { get; set; }
/// <summary>
/// 来源库区
/// </summary>
[Display(Name = "调出库区")]
[Required]
public string FromLocationArea { get; set; }
/// <summary>
/// 数量
/// </summary>
[Display(Name = "数量")]
[Required(ErrorMessage = "{0}是必填项")]
public decimal Qty { get; set; }
/// <summary>
/// 备注
/// </summary>
[Display(Name = "备注")]
public string Remark { get; set; }
}

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/IssueRequest/InjectionIssueRequests/DTOs/InjectionIssueRequestDTO.cs

@ -1,5 +1,4 @@
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain.Entities;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
@ -7,11 +6,10 @@ namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class InjectionIssueRequestDTO : SfsStoreRequestDTOBase<InjectionIssueRequestDetailDTO>, IHasNumber
{
/// <summary>
/// 叫料类型
/// 叫料类型
/// </summary>
[Display(Name = "叫料类型")]
public EnumIssueRequestType IssueRequestType { get; set; }
/// <summary>
/// 是否使用在途库
/// </summary>

13
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/IssueRequest/InjectionIssueRequests/IInjectionIssueRequestAppService.cs

@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Win_in.Sfs.Basedata.Application.Contracts;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
@ -10,12 +10,7 @@ public interface IInjectionIssueRequestAppService
: ISfsStoreRequestMasterAppServiceBase<InjectionIssueRequestDTO, SfsStoreRequestInputBase, InjectionIssueRequestEditInput, InjectionIssueRequestDetailDTO, SfsStoreRequestInputBase>
{
/// <summary>
/// 获取物品类别列表
/// </summary>
/// <returns></returns>
Task<List<ItemBasicDTO>> GetItemCategoryListAsync();
Task<List<UnCompletedRequestDto>> GetUnCompletedRequestAsync(List<UnCompletedRequestDto> p_list);
Task<InjectionIssueRequestDTO> CreateAndHandleAsync(InjectionIssueRequestEditInput input);
Task UpdateStatusCompletedAsync(string number);
Task<string> IsHasNewJobAsync(string requestNumber, List<string> jobNumber);
}

13
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/IssueRequest/InjectionIssueRequests/InjectionIssueRequestPermissions.cs

@ -11,17 +11,12 @@ public static class InjectionIssueRequestPermissions
public const string Update = Default + "." + StorePermissions.UpdateStr;
public const string Delete = Default + "." + StorePermissions.DeleteStr;
//自动叫料申请
public const string AutoInjectionIssueRequest = StorePermissions.GroupName + "." + nameof(AutoInjectionIssueRequest);
public static void AddInjectionIssueRequestPermission(this PermissionGroupDefinition permissionGroup)
{
var InjectionIssueRequestPermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(InjectionIssueRequest)));
InjectionIssueRequestPermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr));
InjectionIssueRequestPermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr));
InjectionIssueRequestPermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr));
permissionGroup.AddPermission(AutoInjectionIssueRequest, StorePermissionDefinitionProvider.L(nameof(AutoInjectionIssueRequest)));
var injectionIssueRequestPermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(InjectionIssueRequest)));
injectionIssueRequestPermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr));
injectionIssueRequestPermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr));
injectionIssueRequestPermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr));
}
}

14
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/IssueRequest/InjectionIssueRequests/Inputs/InjectionIssueRequestEditInput.cs

@ -1,11 +1,14 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class InjectionIssueRequestEditInput : SfsStoreRequestCreateOrUpdateInputBase
{
#region Base
/// <summary>
/// 叫料类型
/// </summary>
@ -13,14 +16,19 @@ public class InjectionIssueRequestEditInput : SfsStoreRequestCreateOrUpdateInput
public EnumIssueRequestType IssueRequestType { get; set; }
/// <summary>
/// 使用在途库
/// 使用在途库
/// </summary>
[Display(Name = "使用在途库")]
public bool UseOnTheWayLocation { get; set; }
/// <summary>
/// 明细列表
/// 明细列表
/// </summary>
[Display(Name = "明细列表")]
public List<InjectionIssueRequestDetailInput> Details { get; set; } = new();
public List<InjectionIssueRequestDetailInput> Details { get; set; } = new List<InjectionIssueRequestDetailInput>();
#endregion
#region Create
#endregion
}

12
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/IssueRequest/InjectionIssueRequests/Inputs/InjectionIssueRequestImportInput.cs

@ -1,4 +1,6 @@
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
@ -13,35 +15,35 @@ public class InjectionIssueRequestImportInput : SfsStoreImportInputBase
public EnumIssueRequestType IssueRequestType { get; set; }
/// <summary>
/// 物品代码
/// 物品代码
/// </summary>
[Display(Name = "物品代码")]
[Required]
public string ItemCode { get; set; }
/// <summary>
/// 目标库位
/// 目标库位
/// </summary>
[Display(Name = "目标库位")]
[Required]
public string ToLocationCode { get; set; }
/// <summary>
/// 来源库区
/// 来源库区
/// </summary>
[Display(Name = "调出库区")]
[Required]
public string FromLocationArea { get; set; }
/// <summary>
/// 数量
/// 数量
/// </summary>
[Display(Name = "数量")]
[Required(ErrorMessage = "{0}是必填项")]
public decimal Qty { get; set; }
/// <summary>
/// 备注
/// 备注
/// </summary>
[Display(Name = "备注")]
public string Remark { get; set; }

187
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InjectionPlanJobs/InjectionPlanJobAppService.cs

@ -0,0 +1,187 @@
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 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;
/// <summary>
/// 注塑计划任务
/// </summary>
[Authorize]
[Route($"{StoreConsts.RootPath}injection-plan-job")]
public class InjectionPlanJobAppService
: SfsJobAppServiceBase<InjectionPlanJob, InjectionPlanJobDetail, InjectionPlanJobDTO, SfsJobRequestInputBase,
InjectionPlanJobCheckInput, InjectionPlanJobEditInput>,
IInjectionPlanJobAppService, ITransferLibCallback
{
private readonly IInjectionPlanJobManager _injectionJobManager;
private readonly ILocationAppService _locationAppService;
private readonly ITransferLibJobAppService _transferLibJobAppService;
public InjectionPlanJobAppService(
IInjectionPlanJobRepository repository, IInjectionPlanJobManager injectionJobManager,
ILocationAppService locationAppService, ITransferLibJobAppService transferLibJobAppService) : base(repository, injectionJobManager)
{
_injectionJobManager = injectionJobManager;
_locationAppService = locationAppService;
_transferLibJobAppService = transferLibJobAppService;
}
[HttpPost("add-many")]
public override async Task<List<InjectionPlanJobDTO>> CreateManyAsync(List<InjectionPlanJobEditInput> inputs)
{
foreach (var input in inputs)
{
await CheckMinRowAndSetStatusAsync(input).ConfigureAwait(false);
}
return await base.CreateManyAsync(inputs).ConfigureAwait(false);
}
[HttpPost("")]
public override async Task<InjectionPlanJobDTO> CreateAsync(InjectionPlanJobEditInput input)
{
await CheckMinRowAndSetStatusAsync(input).ConfigureAwait(false);
return await base.CreateAsync(input).ConfigureAwait(false);
}
/// <summary>
/// 判断是不是在最底层 如果不是则把状态变更为等待 并把库移推荐的From和To赋值
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
private async Task CheckMinRowAndSetStatusAsync(InjectionPlanJobEditInput input)
{
var jobDetailInputdetail = input.Details.FirstOrDefault();
var loctionDto = await _locationAppService.GetByCodeAsync(jobDetailInputdetail.RecommendFromLocationCode)
.ConfigureAwait(false);
if (loctionDto.Type == EnumLocationType.RAW && 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/{injectionNumber}")]
public virtual async Task CancelByMaterialRequestAsync(string injectionNumber)
{
var entities = await _repository.GetListAsync(p => p.InjectionPlanRequestNumber == injectionNumber)
.ConfigureAwait(false);
foreach (var entity in entities)
{
await _injectionJobManager.CancelAsync(entity).ConfigureAwait(false);
}
}
[HttpPost("invalid")]
public override async Task CancelAsync(Guid id)
{
var injectionJob = await _repository.GetAsync(id).ConfigureAwait(false);
if (injectionJob == null)
{
throw new UserFriendlyException($"未找到ID为 {id} 的任务");
}
await _injectionJobManager.CancelAsync(injectionJob).ConfigureAwait(false);
}
[HttpPost("by-request-number/{requestNumber}")]
public virtual async Task<List<InjectionPlanJobDTO>> GetByRequestNumberAsync(string requestNumber)
{
var entitys = await _repository.GetListAsync(p => p.InjectionPlanRequestNumber == requestNumber)
.ConfigureAwait(false);
return ObjectMapper.Map<List<InjectionPlanJob>, List<InjectionPlanJobDTO>>(entitys);
}
[HttpPost("Do-Call-Back")]
public async Task DoTransferLibCallbackAsync(TransferLibJobDTO dto)
{
var job = await _repository.FindAsync(p => p.Number == dto.CallJobNumber).ConfigureAwait(false);
var transferLibJobDto= await _transferLibJobAppService.GetByNumberAsync(dto.Number).ConfigureAwait(false);
var transferLibNoteDetail= dto.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;
}
}

31
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/InjectionPlanJobs/InjectionPlanJobAutoMapperProfile.cs

@ -0,0 +1,31 @@
using AutoMapper;
using Volo.Abp.AutoMapper;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Application;
public partial class StoreApplicationAutoMapperProfile : Profile
{
private void InjectionPlanJobAutoMapperProfile()
{
CreateMap<InjectionPlanJob, InjectionPlanJobDTO>()
.ReverseMap();
//CreateMap<InjectionPlanJobDTO, InjectionPlanJob>();
CreateMap<InjectionPlanJobDetail, InjectionPlanJobDetailDTO>()
;
CreateMap<InjectionPlanJobDetailDTO, InjectionPlanJobDetail>()
;
CreateMap<InjectionPlanJobDetailInput, InjectionPlanJobDetail>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.MasterID)
.Ignore(x => x.TenantId)
.Ignore(x => x.Number)
.Ignore(x => x.Id);
}
}

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/AssembleIssueJobs/AssembleIssueJobAppService.cs

@ -30,7 +30,7 @@ using Win_in.Sfs.Wms.Store.Options;
namespace Win_in.Sfs.Wms.Store.Application;
[Authorize]
[Route($"{StoreConsts.RootPath}assemble-job")]
[Route($"{StoreConsts.RootPath}assemble-issue-job")]
public class AssembleIssueJobAppService
: SfsJobAppServiceBase<AssembleIssueJob, AssembleIssueJobDetail, AssembleIssueJobDTO, SfsJobRequestInputBase,
AssembleIssueJobCheckInput, AssembleIssueJobEditInput>,

568
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobAppService.cs

@ -1,29 +1,30 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Linq.Expressions;
using System.Threading;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;
using System.Text.Json;
using System.Threading.Tasks;
using Castle.Components.DictionaryAdapter;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using MyNamespace;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
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.Shared.Domain.Shared.Enums.Store;
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.proxy;
using Win_in.Sfs.Wms.Store.Notes;
using Win_in.Sfs.Wms.Store.Options;
namespace Win_in.Sfs.Wms.Store.Application;
/// <summary>
/// 注塑发料任务
/// </summary>
[Authorize]
[Route($"{StoreConsts.RootPath}injection-issue-job")]
public class InjectionIssueJobAppService
@ -31,17 +32,32 @@ public class InjectionIssueJobAppService
InjectionIssueJobCheckInput, InjectionIssueJobEditInput>,
IInjectionIssueJobAppService, ITransferLibCallback
{
private readonly IInjectionIssueJobManager _injectionJobManager;
private readonly IInjectionIssueJobManager _injectionIssueJobManager;
private readonly ILocationAppService _locationAppService;
private readonly ITransferLibJobAppService _transferLibJobAppService;
private readonly IInjectionIssueNoteAppService _injectionIssueNoteAppService;
private readonly IExpectOutAppService _expectOutAppService;
private readonly IHttpClientFactory _httpClientFactory;
private readonly ITransferLibRequestAppService _transferLibRequestAppService;
private readonly IOptions<RestoOptions> _options;
protected IInjectionIssueRequestAppService InjectionIssueRequestAppService =>
LazyServiceProvider.LazyGetRequiredService<IInjectionIssueRequestAppService>();
public InjectionIssueJobAppService(
IInjectionIssueJobRepository repository, IInjectionIssueJobManager injectionJobManager,
ILocationAppService locationAppService, ITransferLibJobAppService transferLibJobAppService) : base(repository, injectionJobManager)
IInjectionIssueJobRepository repository, IInjectionIssueJobManager injectionIssueJobManager,
ILocationAppService locationAppService,
IInjectionIssueNoteAppService injectionIssueNoteAppService, IExpectOutAppService expectOutAppService
, IHttpClientFactory httpClientFactory
, IOptions<RestoOptions> options, ITransferLibRequestAppService transferLibRequestAppService) : base(
repository, injectionIssueJobManager)
{
_injectionJobManager = injectionJobManager;
_injectionIssueJobManager = injectionIssueJobManager;
_locationAppService = locationAppService;
_transferLibJobAppService = transferLibJobAppService;
_injectionIssueNoteAppService = injectionIssueNoteAppService;
_expectOutAppService = expectOutAppService;
_httpClientFactory = httpClientFactory;
_options = options;
_transferLibRequestAppService = transferLibRequestAppService;
}
[HttpPost("add-many")]
@ -50,17 +66,385 @@ public class InjectionIssueJobAppService
foreach (var input in inputs)
{
await CheckMinRowAndSetStatusAsync(input).ConfigureAwait(false);
await CheckDimensionalStorehouseAsync(input).ConfigureAwait(false);
}
var injectionIssueJobDtos = await base.CreateManyAsync(inputs).ConfigureAwait(false);
foreach (var injectionIssueJobDto in injectionIssueJobDtos)
{
await CheckDimensionalStorehouseAsync(injectionIssueJobDto).ConfigureAwait(false);
}
return await base.CreateManyAsync(inputs).ConfigureAwait(false);
return injectionIssueJobDtos;
}
[HttpPost("")]
public override async Task<InjectionIssueJobDTO> CreateAsync(InjectionIssueJobEditInput input)
{
await CheckMinRowAndSetStatusAsync(input).ConfigureAwait(false);
await CheckDimensionalStorehouseAsync(input).ConfigureAwait(false);
var injectionIssueJobDto = await base.CreateAsync(input).ConfigureAwait(false);
await CheckDimensionalStorehouseAsync(injectionIssueJobDto).ConfigureAwait(false);
return injectionIssueJobDto;
}
[HttpPost("invalid")]
public override async Task CancelAsync(Guid id)
{
var injectionJob = await _repository.GetAsync(id).ConfigureAwait(false);
if (injectionJob == null)
{
throw new UserFriendlyException($"未找到ID为 {id} 的任务");
}
if (injectionJob.JobStatus == EnumJobStatus.Open ||
injectionJob.JobStatus == EnumJobStatus.Partial ||
injectionJob.JobStatus == EnumJobStatus.Wait ||
injectionJob.JobStatus == EnumJobStatus.Doing)
{
await _expectOutAppService.RemoveByNumberAsync(injectionJob.Number).ConfigureAwait(false);
await _transferLibRequestAppService.CancelByCallRequestNumberAsync(injectionJob.InjectionRequestNumber)
.ConfigureAwait(false);
injectionJob.JobStatus = EnumJobStatus.Cancelled;
await _repository.UpdateAsync(injectionJob).ConfigureAwait(false);
}
else
{
throw new UserFriendlyException($"任务状态不是" +
$"{EnumJobStatus.Open.GetDisplayName()}、" +
$"{EnumJobStatus.Partial.GetDisplayName()}、" +
$"{EnumJobStatus.Doing.GetDisplayName()}、" +
$"{EnumJobStatus.Wait.GetDisplayName()}");
}
}
[HttpPost("by-request-number/{requestNumber}")]
public virtual async Task<List<InjectionIssueJobDTO>> GetByRequestNumberAsync(string requestNumber)
{
var entitys = await _repository.GetListAsync(p => p.InjectionRequestNumber == requestNumber)
.ConfigureAwait(false);
return ObjectMapper.Map<List<InjectionIssueJob>, List<InjectionIssueJobDTO>>(entitys);
}
/// <summary>
/// 库移回调
/// </summary>
/// <param name="dto"></param>
/// <returns></returns>
[HttpPost("Do-Call-Back")]
public async Task DoTransferLibCallbackAsync(TransferLibJobDTO dto)
{
var job = await _repository.FindAsync(p => p.Number == dto.CallJobNumber).ConfigureAwait(false);
if (job.JobStatus != EnumJobStatus.Wait)
{
throw new UserFriendlyException($"任务状态不是{EnumJobStatus.Wait.GetDisplayName()}");
}
var transferLibNoteDetail = dto.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);
}
/// <summary>
/// 执行任务明细
/// </summary>
/// <returns></returns>
[HttpPost("ExecuteDetail/{masterId}")]
public async Task ExecuteDetailAsync(Guid masterId, Guid detailId, InjectionIssueJobDetailDTO issueJobDetailDto)
{
var injectionIssueJob = await _repository.GetAsync(masterId).ConfigureAwait(false);
injectionIssueJob.JobStatus = EnumJobStatus.Doing;
var injectionIssueJobDto = ObjectMapper.Map<InjectionIssueJob, InjectionIssueJobDTO>(injectionIssueJob);
injectionIssueJobDto.Details = new List<InjectionIssueJobDetailDTO> { issueJobDetailDto };
var injectionIssueNoteEditInput = await BuildInjectionIssueNoteAsync(injectionIssueJobDto).ConfigureAwait(false);
await _injectionIssueNoteAppService.CreateAsync(injectionIssueNoteEditInput).ConfigureAwait(false);
var issueJobDetail = ObjectMapper.Map<InjectionIssueJobDetailDTO, InjectionIssueJobDetail>(issueJobDetailDto);
var entityDetail = injectionIssueJob.Details.Find(p => p.Id == detailId);
issueJobDetail.HandledFromQty = entityDetail.HandledFromQty;
issueJobDetail.HandledToQty = entityDetail.HandledToQty;
issueJobDetail.HandledToQty += issueJobDetailDto.HandledToQty;
issueJobDetail.HandledFromQty += issueJobDetailDto.HandledFromQty;
injectionIssueJob.Details = new EditableList<InjectionIssueJobDetail> { issueJobDetail };
if (injectionIssueJob.EnumIssueSendType == EnumIssueSendType.BoxQtyType) //按箱叫料 因为任务只有1箱 所以可以直接完成
{
if (issueJobDetailDto.RecommendToPackingCode != issueJobDetailDto.HandledToPackingCode)
{
await CheckPackingCodeIsUserAsync(issueJobDetailDto.HandledToPackingCode, injectionIssueJob.Number).ConfigureAwait(false);
}
await UpdateRequestAndjobStatusDoneAsync(injectionIssueJob, issueJobDetailDto, issueJobDetailDto.HandledToQty)
.ConfigureAwait(false);
await _expectOutAppService.RemoveByNumberAsync(injectionIssueJob.Number).ConfigureAwait(false);
}
else
{
var detail = injectionIssueJob.Details.First(p => p.Id == issueJobDetailDto.Id);
if (issueJobDetail.HandledToQty >= detail.RequestQty)
{
await UpdateRequestAndjobStatusDoneAsync(injectionIssueJob, issueJobDetailDto,
issueJobDetailDto.HandledToQty).ConfigureAwait(false);
}
else
{
await RemoveExpectOutAsync(injectionIssueJob, issueJobDetailDto, issueJobDetailDto.HandledToQty)
.ConfigureAwait(false);
}
}
await _repository.UpdateAsync(injectionIssueJob).ConfigureAwait(false);
}
/// <summary>
/// 完成任务
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpPost("Complete/{id}")]
public async Task CompleteAsync(Guid id)
{
var injectionIssueJob = await _repository.FindAsync(id).ConfigureAwait(false);
injectionIssueJob.JobStatus = EnumJobStatus.Done;
await _expectOutAppService.RemoveByNumberAsync(injectionIssueJob.Number).ConfigureAwait(false);
await InjectionIssueRequestAppService.UpdateStatusCompletedAsync(injectionIssueJob.InjectionRequestNumber)
.ConfigureAwait(false);
await _transferLibRequestAppService.CancelByCallRequestNumberAsync(injectionIssueJob.InjectionRequestNumber)
.ConfigureAwait(false);
await _repository.UpdateAsync(injectionIssueJob).ConfigureAwait(false);
}
/// <summary>
/// 请求点了完成,任务全部都完成
/// </summary>
/// <param name="requestNumber"></param>
/// <returns></returns>
[HttpPost("complete-by-request/{requestNumber}")]
public async Task CompleteByRequestNumberAsync(string requestNumber)
{
var injectionIssueJobs = await _repository.GetListAsync(p => p.InjectionRequestNumber == requestNumber)
.ConfigureAwait(false);
foreach (var injectionIssueJob in injectionIssueJobs)
{
injectionIssueJob.JobStatus = EnumJobStatus.Done;
await _repository.UpdateAsync(injectionIssueJob).ConfigureAwait(false);
await _expectOutAppService.RemoveByNumberAsync(injectionIssueJob.Number).ConfigureAwait(false);
await _transferLibRequestAppService.CancelByCallRequestNumberAsync(injectionIssueJob.InjectionRequestNumber)
.ConfigureAwait(false);
}
}
#region 立库
/// <summary>
/// 立体库同步
/// </summary>
/// <param name="input"></param>
/// <param name="p_loc"></param>
/// <returns></returns>
[HttpPost("sync-issue-job-stereo")]
public async Task<ReusltObject> SyncIssueJobStereoAsync(List<InjectionIssueJobDTO> input, string p_loc)
{
var ret = new ReusltObject();
ret.Code = "1";
ret.Message = "操作成功";
ret.OperateTime = DateTime.Now.ToString("yyyy-MM-dd");
try
{
var IssueJobToRestoDetailDTOs = new List<IssueJobToRestoDetailDTO>();
var main = new IssueJobToRestoDTO();
main.OperatorName = CurrentUser.UserName;
foreach (var job in input)
{
foreach (var jobitem in job.Details)
{
IssueJobToRestoDetailDTOs.Add(new IssueJobToRestoDetailDTO
{
Count = jobitem.HandledToQty,
ProductNo = jobitem.ItemCode,
NeedSite = p_loc,
WorkNo = job.Number,
TaskNo = job.Number
});
}
}
main.Details = IssueJobToRestoDetailDTOs;
var httpclient = _httpClientFactory.CreateClient();
#if DEBUG
var json = JsonSerializer.Serialize(main);
_options.Value.Address = "http://localhost:59094/"; //测试地址
_options.Value.Token = ""; //测试token
_options.Value.UserName = ""; //测试用户名
_options.Value.Password = ""; //测试密码
#endif
if (!string.IsNullOrEmpty(_options.Value.Token))
{
var token = _options.Value.Token;
httpclient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
}
if (!string.IsNullOrEmpty(_options.Value.UserName) && !string.IsNullOrEmpty(_options.Value.Password))
{
var username = _options.Value.UserName;
var password = _options.Value.Password;
httpclient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic",
Convert.ToBase64String(Encoding.ASCII.GetBytes($"{username}:{password}")));
}
var client = new IssueJobToRestoClient(_options.Value.Address, httpclient);
ret = await client.SyncIssueJobStereoAsync(main).ConfigureAwait(false);
}
catch (Exception ex)
{
ret = new ReusltObject();
ret.Code = "2";
ret.Message = ex.Message;
ret.OperateTime = DateTime.Now.ToString("yyyy-MM-dd");
}
return ret;
}
[HttpPost("receive-issue-job-stereo")]
public virtual async Task<ReusltObject> SyncReciveIssueJobStereoAsync(IssueRequestFromRestoDTO input)
{
#if DEBUG
var json = JsonSerializer.Serialize(input);
#endif
var errors = new List<string>();
var ret = new ReusltObject { Code = "1", OperateTime = DateTime.Now.ToString("yyyy-MM-dd"), Message = "操作成功" };
try
{
if (input.Jobs.Count > 0)
{
var jobs = input.Jobs;
var numbers = jobs.Select(p => p.JobNumber);
var query = _repository.WithDetails()
.Where(p => numbers.Contains(p.Number));
var entities = query.ToList();
var dtos = ObjectMapper.Map<List<InjectionIssueJob>, List<InjectionIssueJobDTO>>(entities);
if (input.Jobs.Count == entities.Count)
{
errors.Add("立体库提交出库任务和WMS任务不符,请核对! \n");
}
foreach (var itm in dtos)
{
var first = jobs.FirstOrDefault(p => p.JobNumber == itm.Number);
var itmDetails = itm.Details.ToList();
var details = new List<InjectionIssueJobDetailDTO>();
foreach (var detail in first.Details)
{
var entity = itmDetails.FirstOrDefault(p => p.ItemCode == detail.ItemCode);
var dto = new InjectionIssueJobDetailDTO();
dto.HandledFromLocationCode = entity.HandledFromLocationCode;
dto.HandledToLocationCode = entity.HandledToLocationCode;
dto.ItemCode = detail.ItemCode;
dto.RecommendFromQty = detail.Qty;
dto.RecommendToQty = detail.Qty;
dto.HandledFromQty = detail.Qty;
dto.HandledToQty = detail.Qty;
dto.Status = entity.Status;
details.Add(dto);
}
itm.Details = details;
await CompleteAsync(itm.Id, itm).ConfigureAwait(false);
}
}
else
{
errors.Add("立体库确认单据里无数据! \n");
}
}
catch (Exception ex)
{
ret = new ReusltObject
{
Code = "2",
OperateTime = DateTime.Now.ToString("yyyy-MM-dd"),
Message = ex.Message
};
return ret;
}
if (errors.Count > 0)
{
ret = new ReusltObject
{
Code = "2",
OperateTime = DateTime.Now.ToString("yyyy-MM-dd"),
Message = string.Join(",", errors.ToArray())
};
}
return await base.CreateAsync(input).ConfigureAwait(false);
return ret;
}
#endregion
#region 私有
/// <summary>
/// 创建补料记录实体
/// </summary>
/// <param name="injectionIssueJobDto"></param>
/// <returns></returns>
private async Task<InjectionIssueNoteEditInput> BuildInjectionIssueNoteAsync(InjectionIssueJobDTO injectionIssueJobDto)
{
var injectionIssueNoteCreateInput =
ObjectMapper.Map<InjectionIssueJobDTO, InjectionIssueNoteEditInput>(injectionIssueJobDto);
injectionIssueNoteCreateInput.JobNumber = injectionIssueJobDto.Number;
await Task.CompletedTask.ConfigureAwait(false);
return injectionIssueNoteCreateInput;
}
/// <summary>
@ -78,7 +462,9 @@ public class InjectionIssueJobAppService
if (loctionDto.Type == EnumLocationType.RAW && loctionDto.RowCode != 1)
{
input.JobStatus = EnumJobStatus.Wait;
}
else if (loctionDto.Type == EnumLocationType.RAW && loctionDto.RowCode == 1)
{
jobDetailInputdetail.TransferLibFromArriveDate = jobDetailInputdetail.RecommendFromArriveDate;
jobDetailInputdetail.TransferLibFromContainerCode = jobDetailInputdetail.RecommendFromContainerCode;
jobDetailInputdetail.TransferLibFromExpireDate = jobDetailInputdetail.RecommendFromExpireDate;
@ -96,92 +482,118 @@ public class InjectionIssueJobAppService
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;
jobDetailInputdetail.TransferLibToWarehouseCode = jobDetailInputdetail.TransferLibFromWarehouseCode;
jobDetailInputdetail.TransferLibToLocationArea = jobDetailInputdetail.TransferLibFromLocationArea;
jobDetailInputdetail.TransferLibToLocationCode = jobDetailInputdetail.TransferLibFromLocationCode;
jobDetailInputdetail.TransferLibToLocationErpCode = jobDetailInputdetail.TransferLibFromLocationErpCode;
jobDetailInputdetail.TransferLibToLocationGroup = jobDetailInputdetail.TransferLibFromLocationGroup;
}
}
[HttpPost("cancel-by-request/{injectionNumber}")]
public virtual async Task CancelByMaterialRequestAsync(string injectionNumber)
/// <summary>
/// 判断是不是在立体库
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
private async Task CheckDimensionalStorehouseAsync(InjectionIssueJobEditInput input)
{
var entities = await _repository.GetListAsync(p => p.InjectionIssueRequestNumber == injectionNumber)
var jobDetailInputdetail = input.Details.FirstOrDefault();
var loctionDto = await _locationAppService.GetByCodeAsync(jobDetailInputdetail.RecommendFromLocationCode)
.ConfigureAwait(false);
foreach (var entity in entities)
{
await _injectionJobManager.CancelAsync(entity).ConfigureAwait(false);
}
}
[HttpPost("invalid")]
public override async Task CancelAsync(Guid id)
{
var injectionJob = await _repository.GetAsync(id).ConfigureAwait(false);
if (injectionJob == null)
if (loctionDto.Type == EnumLocationType.DimensionalStorehouse)
{
throw new UserFriendlyException($"未找到ID为 {id} 的任务");
input.JobStatus = EnumJobStatus.Wait;
}
await _injectionJobManager.CancelAsync(injectionJob).ConfigureAwait(false);
}
[HttpPost("by-request-number/{requestNumber}")]
public virtual async Task<List<InjectionIssueJobDTO>> GetByRequestNumberAsync(string requestNumber)
/// <summary>
/// 判断是不是在立体库
/// </summary>
/// <param name="injectionIssueJobDto"></param>
/// <returns></returns>
private async Task CheckDimensionalStorehouseAsync(InjectionIssueJobDTO injectionIssueJobDto)
{
var entitys = await _repository.GetListAsync(p => p.InjectionIssueRequestNumber == requestNumber)
var jobDetailInputdetail = injectionIssueJobDto.Details.FirstOrDefault();
var loctionDto = await _locationAppService.GetByCodeAsync(jobDetailInputdetail.RecommendFromLocationCode)
.ConfigureAwait(false);
return ObjectMapper.Map<List<InjectionIssueJob>, List<InjectionIssueJobDTO>>(entitys);
if (loctionDto.Type == EnumLocationType.DimensionalStorehouse)
{
//TODO 立体库
var ret = await SyncIssueJobStereoAsync(new List<InjectionIssueJobDTO> { injectionIssueJobDto },
loctionDto.Code).ConfigureAwait(false);
if (ret.Code != "1")
{
throw new UserFriendlyException($"调用立体库不成功!原因:{ret.Message}");
}
}
}
[HttpPost("Do-Call-Back")]
public async Task DoTransferLibCallbackAsync(TransferLibJobDTO dto)
/// <summary>
/// 修改当前任务状态 和 该任务的请求状态
/// </summary>
/// <param name="injectionIssueJob"></param>
/// <param name="injectionIssueJobDetailDto"></param>
/// <param name="handledToQty"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
private async Task UpdateRequestAndjobStatusDoneAsync(InjectionIssueJob injectionIssueJob,
InjectionIssueJobDetailDTO injectionIssueJobDetailDto, decimal handledToQty)
{
var job = await _repository.FindAsync(p => p.Number == dto.CallJobNumber).ConfigureAwait(false);
if (injectionIssueJob.JobStatus is EnumJobStatus.Closed or EnumJobStatus.Cancelled or EnumJobStatus.None
or EnumJobStatus.Done) //需要考虑下 多次提交的问题 所以不判断 进行中
{
throw new UserFriendlyException(
$"任务状态错误:编号为【{injectionIssueJob.Number}】的任务状态为【{injectionIssueJob.JobStatus.GetDisplayName()}】");
}
var transferLibJobDto= await _transferLibJobAppService.GetByNumberAsync(dto.Number).ConfigureAwait(false);
injectionIssueJob.JobStatus = EnumJobStatus.Done;
var transferLibNoteDetail= dto.Details.First();
await RemoveExpectOutAsync(injectionIssueJob, injectionIssueJobDetailDto, handledToQty).ConfigureAwait(false);
var jobDetail = job.Details.First();
job.JobStatus = EnumJobStatus.Open;
//await _expectOutAppService.RemoveByNumberAsync(injectionIssueJob.Number).ConfigureAwait(false);
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;
await InjectionIssueRequestAppService.UpdateStatusCompletedAsync(injectionIssueJob.InjectionRequestNumber)
.ConfigureAwait(false);
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 Task.CompletedTask.ConfigureAwait(false);
}
await _repository.UpdateAsync(job).ConfigureAwait(false);
/// <summary>
/// 判断实际TO的箱码是否被占用
/// </summary>
/// <param name="packingCode"></param>
/// <param name="jobNumber"></param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
private async Task CheckPackingCodeIsUserAsync(string packingCode, string jobNumber)
{
var list = await _expectOutAppService.GetListByPackingCodeAsync(packingCode).ConfigureAwait(false);
list = list.Where(p => p.JobNumber != jobNumber).ToList();
if (list.Any())
{
throw new UserFriendlyException($"任务号【{list.First().JobNumber}】的任务,已占用【{packingCode}】箱码的库存。");
}
}
return;
private async Task RemoveExpectOutAsync(InjectionIssueJob injectionIssueJob,
InjectionIssueJobDetailDTO injectionIssueJobDetailDto,
decimal handledToQty)
{
await _expectOutAppService.RemoveByNumberAndInventoryAsync(injectionIssueJob.Number,
injectionIssueJobDetailDto.ItemCode,
injectionIssueJobDetailDto.HandledToLocationCode, injectionIssueJobDetailDto.HandledToPackingCode,
injectionIssueJobDetailDto.Status, injectionIssueJobDetailDto.HandledToLot,
handledToQty).ConfigureAwait(false);
}
#endregion
}

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobAutoMapperProfile.cs

@ -12,8 +12,6 @@ public partial class StoreApplicationAutoMapperProfile : Profile
CreateMap<InjectionIssueJob, InjectionIssueJobDTO>()
.ReverseMap();
//CreateMap<InjectionIssueJobDTO, InjectionIssueJob>();
CreateMap<InjectionIssueJobDetail, InjectionIssueJobDetailDTO>()
;

112
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/InjectionPlanNotes/InjectionPlanNoteAppService.cs

@ -0,0 +1,112 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Domain.Entities;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
using Win_in.Sfs.Shared.Event;
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.Application;
/// <summary>
/// 注塑计划记录
/// </summary>
[Authorize]
[Route($"{StoreConsts.RootPath}injection-plan-note")]
public class InjectionPlanNoteAppService :
SfsStoreWithDetailsAppServiceBase<InjectionPlanNote, InjectionPlanNoteDTO, SfsStoreRequestInputBase, InjectionPlanNoteEditInput, InjectionPlanNoteDetail,
InjectionPlanNoteDetailDTO, SfsStoreRequestInputBase, InjectionPlanNoteImportInput>,
IInjectionPlanNoteAppService
{
private readonly IInjectionPlanNoteManager _injectionNoteManager;
public InjectionPlanNoteAppService(
IInjectionPlanNoteRepository repository,
IInjectionPlanNoteManager injectionNoteManager
) : base(repository)
{
_injectionNoteManager = injectionNoteManager;
}
[HttpPost("")]
//[Authorize(InjectionPlanNotePermissions.Create)]
public override async Task<InjectionPlanNoteDTO> CreateAsync(InjectionPlanNoteEditInput input)
{
var entity = ObjectMapper.Map<InjectionPlanNoteEditInput, InjectionPlanNote>(input);
await _injectionNoteManager.CreateAsync(entity).ConfigureAwait(false);
var dto = ObjectMapper.Map<InjectionPlanNote, InjectionPlanNoteDTO>(entity);
return dto;
}
/// <summary>
/// 确认对应的记录单
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpPost("confirm/{id}")]
public virtual async Task<InjectionPlanNoteDTO> ConfirmAsync(Guid id)
{
var injectionNote= await _repository.GetAsync(id).ConfigureAwait(false);
injectionNote.Confirmed = true;
injectionNote=await _repository.UpdateAsync(injectionNote).ConfigureAwait(false);
await LocalEventBus.PublishAsync(new SfsConfirmedEntityEventData<InjectionPlanNote>(injectionNote), false).ConfigureAwait(false);
return ObjectMapper.Map<InjectionPlanNote, InjectionPlanNoteDTO>(injectionNote);
}
[HttpPost("confirm-by-number/{number}")]
public virtual async Task<InjectionPlanNoteDTO> ConfirmAsync(string number)
{
var entity = await _repository.FindAsync(p => p.Number == number).ConfigureAwait(false);
Check.NotNull(entity, nameof(InjectionPlanNote));
var result = await _injectionNoteManager.ConfirmAsync(entity.Id).ConfigureAwait(false);
var dto = ObjectMapper.Map<InjectionPlanNote, InjectionPlanNoteDTO>(result);
return dto;
}
/// <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<InjectionPlanNoteDTO>> GetListByTypeAsync(SfsStoreRequestInputBase requestInput,
EnumIssueRequestType issueRequestType, bool includeDetails = false, CancellationToken cancellationToken = default)
{
Expression<Func<InjectionPlanNote, bool>> expression = p => p.IssueRequestType == issueRequestType;
if (requestInput.Condition.Filters?.Count > 0)
{
expression = expression.And(requestInput.Condition.Filters.ToLambda<InjectionPlanNote>());
}
return await GetPagedListAsync(expression, requestInput.SkipCount, requestInput.MaxResultCount,
requestInput.Sorting, includeDetails, cancellationToken).ConfigureAwait(false);
}
[HttpPost("list-by-type-and-un-confirmed")]
public virtual async Task<List<InjectionPlanNoteDTO>> GetListUnConfirmedByTypeAsync(EnumIssueRequestType issueRequestType)
{
var entities = await _repository.GetListAsync(c => !c.Confirmed && c.IssueRequestType == issueRequestType)
.ConfigureAwait(false);
var dtos = ObjectMapper.Map<List<InjectionPlanNote>, List<InjectionPlanNoteDTO>>(entities);
return dtos;
}
}

31
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/InjectionPlanNotes/InjectionPlanNoteAutoMapperProfile.cs

@ -0,0 +1,31 @@
using AutoMapper;
using Volo.Abp.AutoMapper;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Application;
public partial class StoreApplicationAutoMapperProfile : Profile
{
private void InjectionPlanNoteAutoMapperProfile()
{
CreateMap<InjectionPlanNote, InjectionPlanNoteDTO>()
.ReverseMap();
CreateMap<InjectionPlanNoteDetail, InjectionPlanNoteDetailDTO>();
CreateMap<InjectionPlanNoteDetailInput, InjectionPlanNoteDetail>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.MasterID)
.Ignore(x => x.TenantId)
.Ignore(x => x.Number)
.Ignore(x => x.Id);
CreateMap<InjectionPlanNoteEditInput, InjectionPlanNote>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.TenantId)
.Ignore(x => x.Number)
.Ignore(x => x.Id);
;
}
}

68
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/IssueNotes/InjectionIssueNotes/InjectionIssueNoteAppService.cs

@ -10,7 +10,6 @@ using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.Domain.Entities;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
using Win_in.Sfs.Shared.Event;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
@ -18,9 +17,6 @@ using Win_in.Sfs.Wms.Store.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Application;
/// <summary>
/// 注塑发料记录
/// </summary>
[Authorize]
[Route($"{StoreConsts.RootPath}injection-issue-note")]
public class InjectionIssueNoteAppService :
@ -28,14 +24,14 @@ public class InjectionIssueNoteAppService :
InjectionIssueNoteDetailDTO, SfsStoreRequestInputBase, InjectionIssueNoteImportInput>,
IInjectionIssueNoteAppService
{
private readonly IInjectionIssueNoteManager _injectionNoteManager;
private readonly IInjectionIssueNoteManager _injectionIssueNoteManager;
public InjectionIssueNoteAppService(
IInjectionIssueNoteRepository repository,
IInjectionIssueNoteManager injectionNoteManager
IInjectionIssueNoteManager injectionIssueNoteManager
) : base(repository)
{
_injectionNoteManager = injectionNoteManager;
_injectionIssueNoteManager = injectionIssueNoteManager;
}
[HttpPost("")]
@ -43,7 +39,7 @@ public class InjectionIssueNoteAppService :
public override async Task<InjectionIssueNoteDTO> CreateAsync(InjectionIssueNoteEditInput input)
{
var entity = ObjectMapper.Map<InjectionIssueNoteEditInput, InjectionIssueNote>(input);
await _injectionNoteManager.CreateAsync(entity).ConfigureAwait(false);
await _injectionIssueNoteManager.CreateAsync(entity).ConfigureAwait(false);
var dto = ObjectMapper.Map<InjectionIssueNote, InjectionIssueNoteDTO>(entity);
return dto;
}
@ -56,57 +52,11 @@ public class InjectionIssueNoteAppService :
[HttpPost("confirm/{id}")]
public virtual async Task<InjectionIssueNoteDTO> ConfirmAsync(Guid id)
{
var injectionNote= await _repository.GetAsync(id).ConfigureAwait(false);
injectionNote.Confirmed = true;
injectionNote=await _repository.UpdateAsync(injectionNote).ConfigureAwait(false);
await LocalEventBus.PublishAsync(new SfsConfirmedEntityEventData<InjectionIssueNote>(injectionNote), false).ConfigureAwait(false);
return ObjectMapper.Map<InjectionIssueNote, InjectionIssueNoteDTO>(injectionNote);
var injectionIssueNote = await _repository.GetAsync(id).ConfigureAwait(false);
injectionIssueNote.Confirmed = true;
injectionIssueNote = await _repository.UpdateAsync(injectionIssueNote).ConfigureAwait(false);
await LocalEventBus.PublishAsync(new SfsConfirmedEntityEventData<InjectionIssueNote>(injectionIssueNote), false).ConfigureAwait(false);
return ObjectMapper.Map<InjectionIssueNote, InjectionIssueNoteDTO>(injectionIssueNote);
}
[HttpPost("confirm-by-number/{number}")]
public virtual async Task<InjectionIssueNoteDTO> ConfirmAsync(string number)
{
var entity = await _repository.FindAsync(p => p.Number == number).ConfigureAwait(false);
Check.NotNull(entity, nameof(InjectionIssueNote));
var result = await _injectionNoteManager.ConfirmAsync(entity.Id).ConfigureAwait(false);
var dto = ObjectMapper.Map<InjectionIssueNote, InjectionIssueNoteDTO>(result);
return dto;
}
/// <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<InjectionIssueNoteDTO>> GetListByTypeAsync(SfsStoreRequestInputBase requestInput,
EnumIssueRequestType issueRequestType, bool includeDetails = false, CancellationToken cancellationToken = default)
{
Expression<Func<InjectionIssueNote, bool>> expression = p => p.IssueRequestType == issueRequestType;
if (requestInput.Condition.Filters?.Count > 0)
{
expression = expression.And(requestInput.Condition.Filters.ToLambda<InjectionIssueNote>());
}
return await GetPagedListAsync(expression, requestInput.SkipCount, requestInput.MaxResultCount,
requestInput.Sorting, includeDetails, cancellationToken).ConfigureAwait(false);
}
[HttpPost("list-by-type-and-un-confirmed")]
public virtual async Task<List<InjectionIssueNoteDTO>> GetListUnConfirmedByTypeAsync(EnumIssueRequestType issueRequestType)
{
var entities = await _repository.GetListAsync(c => !c.Confirmed && c.IssueRequestType == issueRequestType)
.ConfigureAwait(false);
var dtos = ObjectMapper.Map<List<InjectionIssueNote>, List<InjectionIssueNoteDTO>>(entities);
return dtos;
}
}

214
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/InjectionPlanRequests/InjectionPlanRequestAppService.cs

@ -0,0 +1,214 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
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.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.Application;
/// <summary>
/// 注塑计划申请
/// </summary>
[Authorize]
[Route($"{StoreConsts.RootPath}injection-plan-request")]
public class InjectionPlanRequestAppService : SfsStoreRequestAppServiceBase<InjectionPlanRequest,
InjectionPlanRequestDTO,
SfsStoreRequestInputBase, InjectionPlanRequestEditInput, InjectionPlanRequestDetail,
InjectionPlanRequestDetailDTO,
SfsStoreRequestInputBase, InjectionPlanRequestImportInput>,
IInjectionPlanRequestAppService
{
private readonly IInjectionPlanRequestManager _injectionRequestManager;
private readonly ILocationAppService _locationAppService;
private readonly IItemBasicAppService _itemBasicAppService;
private readonly IItemContainerAppService _itemContainerAppService;
private readonly ITransactionTypeAppService _transactionTypeAppService;
public InjectionPlanRequestAppService(
IInjectionPlanRequestRepository repository,
IInjectionPlanRequestManager injectionRequestManager,
ILocationAppService locationAppService,
IItemBasicAppService itemBasicAppService,
IItemContainerAppService itemContainerAppService,
ITransactionTypeAppService transactionTypeAppService
)
: base(repository, injectionRequestManager)
{
_injectionRequestManager = injectionRequestManager;
_locationAppService = locationAppService;
_itemBasicAppService = itemBasicAppService;
_itemContainerAppService = itemContainerAppService;
_transactionTypeAppService = transactionTypeAppService;
}
public override async Task<InjectionPlanRequestDTO> HandleAsync(Guid id)
{
await Task.CompletedTask.ConfigureAwait(false);
return null;
}
[HttpPost("")]
public override async Task<InjectionPlanRequestDTO> CreateAsync(InjectionPlanRequestEditInput input)
{
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);
detailInput.ToLocationArea = toLocationDto.AreaCode;
detailInput.ToLocationGroup = toLocationDto.LocationGroupCode;
detailInput.ToWarehouseCode = toLocationDto.WarehouseCode;
detailInput.ProdLine = detailInput.ToLocationCode;
detailInput.ToLocationErpCode = toLocationDto.ErpLocationCode;
detailInput.ItemDesc1 = itemBasicDto.Desc1;
detailInput.ItemDesc2 = itemBasicDto.Desc2;
detailInput.ItemName = itemBasicDto.Name;
var itemContainerDto = await _itemContainerAppService.GetListByItemCodeAsync(detailInput.ItemCode)
.ConfigureAwait(false);
if (itemContainerDto.Count > 0)
{
detailInput.Uom = itemContainerDto[0].BasicUom;
detailInput.Qty = itemContainerDto[0].Qty;
detailInput.StdPackQty = itemBasicDto.StdPackQty;
}
else
{
detailInput.Uom = itemBasicDto.BasicUom;
detailInput.StdPackQty = itemBasicDto.StdPackQty;
detailInput.Qty = itemBasicDto.StdPackQty;
}
detailInput.Status = EnumStatus.Open;
//因为是刚创建的 所以发料数一定是0
detailInput.IssuedQty = 0;
}
await SetRequestAutoPropertiesAsync(input).ConfigureAwait(false);
var entity = ObjectMapper.Map<InjectionPlanRequestEditInput, InjectionPlanRequest>(input);
var result = await _injectionRequestManager.CreateByNumberAsync(entity).ConfigureAwait(false);
var dto = ObjectMapper.Map<InjectionPlanRequest, InjectionPlanRequestDTO>(result);
return dto;
}
/// <summary>
/// 赋值Request业务属性
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
private async Task SetRequestAutoPropertiesAsync(InjectionPlanRequestEditInput 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<InjectionPlanRequestDTO> CreateAndHandleAsync(InjectionPlanRequestEditInput input)
{
var injectionRequestDto = await CreateAsync(input).ConfigureAwait(false);
await HandleAsync(injectionRequestDto.Id).ConfigureAwait(false);
return injectionRequestDto;
}
/// <summary>
/// 获取物品类别列表
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
[HttpGet("list/item-category")]
public virtual async Task<List<ItemBasicDTO>> GetItemCategoryListAsync()
{
var entities = await _itemBasicAppService.GetCategoryListAsync().ConfigureAwait(false);
return entities;
}
/// <summary>
/// 获取已完成的叫料单数量
/// </summary>
/// <returns></returns>
[HttpPost("get-uncompleted-request")]
public async Task<List<UnCompletedRequestDto>> GetUnCompletedRequestAsync(List<UnCompletedRequestDto> p_list)
{
var returnList = new List<UnCompletedRequestDto>();
//枚举类型查不到改成SQL查询
var list = await _repository.GetListAsync(p =>
p.RequestStatus != EnumRequestStatus.Completed && p.IssueRequestType == EnumIssueRequestType.Vision)
.ConfigureAwait(false);
foreach (var itm in list)
{
var query = from detail in itm.Details
join citm in p_list on new
{
detail.ItemCode, locCode = detail.ToLocationCode, areaCode = detail.PositionCode
} equals
new { citm.ItemCode, locCode = citm.LocCode, areaCode = citm.PositionCode }
select new UnCompletedRequestDto
{
ItemCode = detail.ItemCode, LocCode = detail.ToLocationCode, PositionCode = detail.PositionCode
};
returnList.AddRange(query.ToList());
}
return returnList;
}
#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()}】类型");
}
}
#endregion
}

65
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/InjectionPlanRequests/InjectionPlanRequestAutoMapperProfile.cs

@ -0,0 +1,65 @@
using AutoMapper;
using Volo.Abp.AutoMapper;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Application;
public partial class StoreApplicationAutoMapperProfile : Profile
{
private void InjectionPlanRequestAutoMapperProfile()
{
CreateMap<InjectionPlanRequest, InjectionPlanRequestDTO>()
.ReverseMap();
CreateMap<InjectionPlanRequestDetail, InjectionPlanRequestDetailDTO>()
.ReverseMap();
CreateMap<InjectionPlanRequestDetailInput, InjectionPlanRequestDetail>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.MasterID)
.Ignore(x => x.TenantId)
.Ignore(x => x.Number)
.Ignore(x => x.Id);
CreateMap<InjectionPlanRequestImportInput, InjectionPlanRequest>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.UseOnTheWayLocation)
.Ignore(x => x.Details)
.Ignore(x => x.Remark)
.Ignore(x => x.TenantId)
.Ignore(x => x.Number)
.Ignore(x => x.RequestStatus)
.Ignore(x => x.ConcurrencyStamp)
.Ignore(x => x.ExtraProperties)
.Ignore(x => x.ActiveDate)
.Ignore(x => x.Remark);
CreateMap<InjectionPlanRequestImportInput, InjectionPlanRequestDetail>()
.IgnoreAuditedObjectProperties()
.ForMember(x => x.Status, y => y.MapFrom(t => EnumStatus.Open))
.Ignore(x => x.ToLocationErpCode)
.Ignore(x => x.ToWarehouseCode)
.Ignore(x => x.ToLocationArea)
.Ignore(x => x.ToLocationGroup)
.Ignore(x => x.ItemName).Ignore(x => x.ItemDesc1).Ignore(x => x.ItemDesc2)
.Ignore(x => x.ProdLine)
.Ignore(x => x.IssuedQty)
.Ignore(x => x.ReceivedQty)
.Ignore(x => x.ToBeIssuedQty)
.Ignore(x => x.ToBeReceivedQty)
.Ignore(x => x.NotFinishQty)
.Ignore(x => x.StdPackQty)
.Ignore(x => x.Uom)
.Ignore(x => x.TenantId)
.Ignore(x => x.MasterID)
.Ignore(x => x.Number)
.Ignore(x => x.Id)
.Ignore(x => x.Remark);
CreateMap<InjectionPlanRequestEditInput, InjectionPlanRequest>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.RequestStatus)
.Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id);
}
}

327
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/IssuelRequests/InjectionIssueRequests/InjectionIssueRequestAppService.cs

@ -2,12 +2,13 @@ using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Castle.Components.DictionaryAdapter;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using NUglify.Helpers;
using Volo.Abp;
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.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Domain.Shared;
@ -15,45 +16,51 @@ using Win_in.Sfs.Wms.Store.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Application;
/// <summary>
/// 注塑发料申请
/// 注塑叫料申请
/// </summary>
[Authorize]
[Route($"{StoreConsts.RootPath}injection-issue-request")]
public class InjectionIssueRequestAppService : SfsStoreRequestAppServiceBase<InjectionIssueRequest,
InjectionIssueRequestDTO,
SfsStoreRequestInputBase, InjectionIssueRequestEditInput, InjectionIssueRequestDetail,
InjectionIssueRequestDetailDTO,
public class InjectionIssueRequestAppService : SfsStoreRequestAppServiceBase<InjectionIssueRequest, InjectionIssueRequestDTO,
SfsStoreRequestInputBase, InjectionIssueRequestEditInput, InjectionIssueRequestDetail, InjectionIssueRequestDetailDTO,
SfsStoreRequestInputBase, InjectionIssueRequestImportInput>,
IInjectionIssueRequestAppService
{
private readonly IInjectionIssueRequestManager _injectionRequestManager;
private readonly IInjectionIssueRequestManager _injectionIssueRequestManager;
private readonly IItemStoreRelationAppService _itemStoreRelationApp;
private readonly IAreaAppService _areaApp;
private readonly ILocationAppService _locationAppService;
private readonly IItemBasicAppService _itemBasicAppService;
private readonly IItemContainerAppService _itemContainerAppService;
private readonly IProductionLineAppService _productionLineAppService;
private readonly IInjectionIssueJobAppService _injectionIssueJobAppService;
private readonly ITransactionTypeAppService _transactionTypeAppService;
public InjectionIssueRequestAppService(
IInjectionIssueRequestRepository repository,
IInjectionIssueRequestManager injectionRequestManager,
IInjectionIssueRequestManager injectionIssueRequestManager,
IPreparationPlanManager preparationPlanManager,
IItemStoreRelationAppService itemStoreRelationApp,
IAreaAppService areaApp,
ILocationAppService locationAppService,
IItemBasicAppService itemBasicAppService,
IItemContainerAppService itemContainerAppService,
ITransactionTypeAppService transactionTypeAppService
)
: base(repository, injectionRequestManager)
IProductionLineAppService productionLineAppService,
ITransactionTypeAppService transactionTypeAppService, IInjectionIssueJobAppService injectionIssueJobAppService)
: base(repository, injectionIssueRequestManager)
{
_injectionRequestManager = injectionRequestManager;
_injectionIssueRequestManager = injectionIssueRequestManager;
_itemStoreRelationApp = itemStoreRelationApp;
_areaApp = areaApp;
_locationAppService = locationAppService;
_itemBasicAppService = itemBasicAppService;
_itemContainerAppService = itemContainerAppService;
_productionLineAppService = productionLineAppService;
_transactionTypeAppService = transactionTypeAppService;
_injectionIssueJobAppService = injectionIssueJobAppService;
}
public override async Task<InjectionIssueRequestDTO> HandleAsync(Guid id)
{
await Task.CompletedTask.ConfigureAwait(false);
return null;
return await base.HandleAsync(id).ConfigureAwait(false);
}
[HttpPost("")]
@ -67,49 +74,40 @@ public class InjectionIssueRequestAppService : SfsStoreRequestAppServiceBase<Inj
}
}
foreach (var detailInput in input.Details) //赋值生产线
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 productionLineDto = await _productionLineAppService.GetByLocationCodeAsync(detailInput.ToLocationCode)
.ConfigureAwait(false);
CheckProductionLine(productionLineDto, detailInput.ProdLine);
detailInput.ProdLine = productionLineDto.Code;
detailInput.ToLocationArea = toLocationDto.AreaCode;
detailInput.ToLocationGroup = toLocationDto.LocationGroupCode;
detailInput.ToWarehouseCode = toLocationDto.WarehouseCode;
detailInput.ProdLine = detailInput.ToLocationCode;
detailInput.ToLocationErpCode = toLocationDto.ErpLocationCode;
detailInput.ItemDesc1 = itemBasicDto.Desc1;
detailInput.ItemDesc2 = itemBasicDto.Desc2;
detailInput.ItemName = itemBasicDto.Name;
var itemContainerDto = await _itemContainerAppService.GetListByItemCodeAsync(detailInput.ItemCode)
.ConfigureAwait(false);
if (itemContainerDto.Count > 0)
{
detailInput.Uom = itemContainerDto[0].BasicUom;
detailInput.Qty = itemContainerDto[0].Qty;
detailInput.StdPackQty = itemBasicDto.StdPackQty;
}
else
{
detailInput.Uom = itemBasicDto.BasicUom;
detailInput.StdPackQty = itemBasicDto.StdPackQty;
detailInput.Qty = itemBasicDto.StdPackQty;
}
detailInput.Uom = itemBasicDto.BasicUom;
detailInput.StdPackQty = itemBasicDto.StdPackQty;
detailInput.Status = EnumStatus.Open;
//因为是刚创建的 所以发料数一定是0
detailInput.IssuedQty = 0;
detailInput.RecommendType = EnumRecommendType.KITTING;
}
await SetRequestAutoPropertiesAsync(input).ConfigureAwait(false);
var entity = ObjectMapper.Map<InjectionIssueRequestEditInput, InjectionIssueRequest>(input);
var result = await _injectionRequestManager.CreateByNumberAsync(entity).ConfigureAwait(false);
var result = await _injectionIssueRequestManager.CreateByNumberAsync(entity).ConfigureAwait(false);
var dto = ObjectMapper.Map<InjectionIssueRequest, InjectionIssueRequestDTO>(result);
@ -136,59 +134,239 @@ public class InjectionIssueRequestAppService : SfsStoreRequestAppServiceBase<Inj
[HttpPost("create-and-handle")]
public async Task<InjectionIssueRequestDTO> CreateAndHandleAsync(InjectionIssueRequestEditInput input)
{
var injectionRequestDto = await CreateAsync(input).ConfigureAwait(false);
var injectionIssueRequestDto = await CreateAsync(input).ConfigureAwait(false);
await HandleAsync(injectionRequestDto.Id).ConfigureAwait(false);
//await HandleAsync(injectionIssueRequestDto.Id).ConfigureAwait(false);
return injectionRequestDto;
return injectionIssueRequestDto;
}
/// <summary>
/// 获取物品类别列表
/// </summary>
/// <param name="type"></param>
/// <returns></returns>
[HttpGet("list/item-category")]
public virtual async Task<List<ItemBasicDTO>> GetItemCategoryListAsync()
public override async Task<InjectionIssueRequestDTO> CancelAsync(Guid id)
{
var entities = await _itemBasicAppService.GetCategoryListAsync().ConfigureAwait(false);
var request = await _repository.GetAsync(id).ConfigureAwait(false);
var list = await _injectionIssueJobAppService.GetByRequestNumberAsync(request.Number).ConfigureAwait(false);
if (list.Any())
{
foreach (var injectionIssueJobDto in list)
{
if (injectionIssueJobDto.JobStatus == EnumJobStatus.Open ||
injectionIssueJobDto.JobStatus == EnumJobStatus.Partial ||
injectionIssueJobDto.JobStatus == EnumJobStatus.Doing ||
injectionIssueJobDto.JobStatus == EnumJobStatus.Wait)
{
await _injectionIssueJobAppService.CancelAsync(injectionIssueJobDto.Id).ConfigureAwait(false);
}
}
}
if (request.RequestStatus == EnumRequestStatus.Partial || request.RequestStatus == EnumRequestStatus.Handling ||
request.RequestStatus == EnumRequestStatus.New)
{
request.RequestStatus = EnumRequestStatus.Cancelled;
await _repository.UpdateAsync(request).ConfigureAwait(false);
}
else
{
throw new UserFriendlyException($"【{request.RequestStatus.GetDisplayName()}】状态不允许取消");
}
return entities;
return ObjectMapper.Map<InjectionIssueRequest, InjectionIssueRequestDTO>(request);
}
[HttpPost("UpdateStatusCompleted")]
public async Task UpdateStatusCompletedAsync(string number)
{
var injectionIssueRequest = await _repository.FindAsync(p => p.Number == number).ConfigureAwait(false);
await UpdateInjectionIssueRequestDetailQtyAsync(injectionIssueRequest, new EditableList<InjectionIssueJobDTO>())
.ConfigureAwait(false);
var injectionIssueJobDtos = await _injectionIssueJobAppService.GetByRequestNumberAsync(injectionIssueRequest.Number)
.ConfigureAwait(false);
if (injectionIssueJobDtos.Any(p =>
p.JobStatus == EnumJobStatus.Open || p.JobStatus == EnumJobStatus.Doing ||
p.JobStatus == EnumJobStatus.Partial))
{
return;
}
var flag = true;
foreach (var detail in injectionIssueRequest.Details)
{
if (detail.Qty >= detail.IssuedQty)
{
flag = false;
return;
}
}
if (flag)
{
CheckStatus(EnumRequestStatus.Completed, injectionIssueRequest.RequestStatus);
injectionIssueRequest.RequestStatus = EnumRequestStatus.Completed;
await _repository.UpdateAsync(injectionIssueRequest).ConfigureAwait(false);
}
}
/// <summary>
/// 获取已完成的叫料单数量
/// 修改请求的 已发 已收数量
/// </summary>
/// <param name="injectionIssueRequest"></param>
/// <param name="addInjectionIssueJobDtos"></param>
/// <returns></returns>
[HttpPost("get-uncompleted-request")]
public async Task<List<UnCompletedRequestDto>> GetUnCompletedRequestAsync(List<UnCompletedRequestDto> p_list)
private async Task UpdateInjectionIssueRequestDetailQtyAsync(InjectionIssueRequest injectionIssueRequest,
List<InjectionIssueJobDTO> addInjectionIssueJobDtos)
{
var returnList = new List<UnCompletedRequestDto>();
//枚举类型查不到改成SQL查询
var list = await _repository.GetListAsync(p =>
p.RequestStatus != EnumRequestStatus.Completed && p.IssueRequestType == EnumIssueRequestType.Vision)
//原有任务
var existInjectionIssueJobDtos = await _injectionIssueJobAppService
.GetByRequestNumberAsync(injectionIssueRequest.Number)
.ConfigureAwait(false);
foreach (var itm in list)
{
var query = from detail in itm.Details
join citm in p_list on new
{
detail.ItemCode, locCode = detail.ToLocationCode, areaCode = detail.PositionCode
} equals
new { citm.ItemCode, locCode = citm.LocCode, areaCode = citm.PositionCode }
select new UnCompletedRequestDto
//新增的任务和已有的任务总和
var allInjectionIssueJobDtos = new List<InjectionIssueJobDTO>();
allInjectionIssueJobDtos.AddRange(addInjectionIssueJobDtos);
allInjectionIssueJobDtos.AddRange(existInjectionIssueJobDtos);
var groupByItemCodeLocationCode = injectionIssueRequest.Details.GroupBy(p =>
new { p.ItemCode, p.ToLocationCode });
foreach (var group in groupByItemCodeLocationCode)
{
foreach (var requestDetail in group)
{
//所有已发数量
decimal allIssuedQty = 0;
//所有已发数量
decimal allReceivedQty = 0;
foreach (var allInjectionIssueJobDto in allInjectionIssueJobDtos)
{
ItemCode = detail.ItemCode, LocCode = detail.ToLocationCode, PositionCode = detail.PositionCode
};
var jobDetailDtos = allInjectionIssueJobDto.Details.Where(p =>
p.ItemCode == group.Key.ItemCode && p.RequestLocationCode == group.Key.ToLocationCode);
//所有已发数量
allIssuedQty += jobDetailDtos.Sum(p => p.RequestQty);
//所有已发数量
allReceivedQty += jobDetailDtos.Sum(p => p.HandledToQty);
}
requestDetail.IssuedQty += allIssuedQty;
requestDetail.ReceivedQty += allReceivedQty;
}
}
await _repository.UpdateAsync(injectionIssueRequest).ConfigureAwait(false);
}
[HttpPost("IsHasNewJob")]
public async Task<string> IsHasNewJobAsync(string requestNumber, List<string> jobNumber)
{
var joblIssueJobDtos =
await _injectionIssueJobAppService.GetByRequestNumberAsync(requestNumber).ConfigureAwait(false);
if (joblIssueJobDtos != null && joblIssueJobDtos.Any())
{
var jobNumberList = joblIssueJobDtos.Select(p => p.Number);
var difference = jobNumberList.Except(jobNumber);
if (difference.Any())
{
var result = "已生成任务号";
difference.ForEach(p => result += "【" + p + "】");
result += "的任务";
return result;
}
return "无任务生成,请检查库存";
}
return "无任务生成,请检查库存";
}
returnList.AddRange(query.ToList());
public override async Task<InjectionIssueRequestDTO> CompleteAsync(Guid id)
{
var injectionIssueRequest = await _repository.GetAsync(id).ConfigureAwait(false);
if (injectionIssueRequest.RequestStatus == EnumRequestStatus.Handling ||
injectionIssueRequest.RequestStatus == EnumRequestStatus.Partial ||
injectionIssueRequest.RequestStatus == EnumRequestStatus.New)
{
injectionIssueRequest.RequestStatus = EnumRequestStatus.Completed;
}
else
{
throw new UserFriendlyException($"【{injectionIssueRequest.RequestStatus.GetDisplayName()}】状态不允许完成");
}
return returnList;
await _injectionIssueJobAppService.CompleteByRequestNumberAsync(injectionIssueRequest.Number).ConfigureAwait(false);
return ObjectMapper.Map<InjectionIssueRequest, InjectionIssueRequestDTO>(await _repository.UpdateAsync(injectionIssueRequest)
.ConfigureAwait(false));
}
#region 校验
private void CheckStatus(EnumRequestStatus targetStatus, EnumRequestStatus nowStatus)
{
var validSourceStatuses = new List<EnumRequestStatus>();
switch (targetStatus)
{
case EnumRequestStatus.None:
break;
case EnumRequestStatus.New:
break;
case EnumRequestStatus.Reviewing:
validSourceStatuses = new List<EnumRequestStatus> { EnumRequestStatus.New };
break;
case EnumRequestStatus.Refused:
validSourceStatuses = new List<EnumRequestStatus> { EnumRequestStatus.Reviewing };
break;
case EnumRequestStatus.Agreed:
validSourceStatuses = new List<EnumRequestStatus> { EnumRequestStatus.Reviewing };
break;
case EnumRequestStatus.Handling:
validSourceStatuses = new List<EnumRequestStatus>
{
EnumRequestStatus.Agreed, EnumRequestStatus.Partial
};
break;
case EnumRequestStatus.Completed:
validSourceStatuses = new List<EnumRequestStatus>
{
EnumRequestStatus.Handling, EnumRequestStatus.Partial
};
break;
case EnumRequestStatus.Cancelled:
validSourceStatuses = new List<EnumRequestStatus>
{
EnumRequestStatus.New, EnumRequestStatus.Reviewing, EnumRequestStatus.Agreed
};
break;
case EnumRequestStatus.Abort:
validSourceStatuses = new List<EnumRequestStatus>
{
EnumRequestStatus.Handling, EnumRequestStatus.Partial
};
break;
case EnumRequestStatus.Partial:
{
validSourceStatuses = new List<EnumRequestStatus>
{
EnumRequestStatus.Handling, EnumRequestStatus.Partial
};
break;
}
default:
throw new ArgumentOutOfRangeException(nameof(targetStatus), targetStatus, null);
}
if (!validSourceStatuses.Contains(nowStatus))
{
throw new UserFriendlyException(
$"当前状态为 {nowStatus.GetDisplayName()} ,无法变更为 {targetStatus.GetDisplayName()}");
}
}
private void CheckItemBasic(ItemBasicDTO itemBasicDto, string itemCode)
{
if (itemBasicDto == null)
@ -204,9 +382,18 @@ public class InjectionIssueRequestAppService : SfsStoreRequestAppServiceBase<Inj
throw new UserFriendlyException($"库位代码为【{locationCode}】不存在");
}
if (locationDto.Type != EnumLocationType.WIP)
if (locationDto.Type != EnumLocationType.KittingWip)
{
throw new UserFriendlyException(
$"库位代码【{locationCode}】不是【{EnumLocationType.KittingWip.GetDisplayName()}】类型");
}
}
private void CheckProductionLine(ProductionLineDTO productionLineDto, string productionCode)
{
if (productionLineDto == null)
{
throw new UserFriendlyException($"库位代码【{locationCode}】不是【{EnumLocationType.WIP.GetDisplayName()}】类型");
throw new UserFriendlyException($"未找到生产线【{productionCode}】");
}
}

10
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/InjectionPlanJobs/IInjectionPlanJobManager.cs

@ -0,0 +1,10 @@
using System;
using System.Linq.Expressions;
using System.Threading.Tasks;
namespace Win_in.Sfs.Wms.Store.Domain;
public interface IInjectionPlanJobManager : IJobManager<InjectionPlanJob>
{
Task<InjectionPlanJob> GetAsync(Expression<Func<InjectionPlanJob, bool>> expression);
}

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/InjectionPlanJobs/IInjectionPlanJobRepository.cs

@ -0,0 +1,6 @@
namespace Win_in.Sfs.Wms.Store.Domain;
public interface IInjectionPlanJobRepository : ISfsJobRepositoryBase<InjectionPlanJob>
{
}

44
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/InjectionPlanJobs/InjectionPlanJob.cs

@ -0,0 +1,44 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain.Entities;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Domain;
/// <summary>
/// 注塑计划任务
/// </summary>
[Display(Name = "注塑计划任务")]
public class InjectionPlanJob : SfsJobAggregateRootBase<InjectionPlanJobDetail>
{
/// <summary>
/// 叫料类型
/// </summary>
[Display(Name = "叫料类型")]
public EnumIssueRequestType IssueRequestType { get; set; }
/// <summary>
/// 生产线
/// </summary>
[IgnoreUpdate]
public string ProdLine { get; set; }
/// <summary>
/// 注塑要料单号
/// </summary>
[IgnoreUpdate]
public string InjectionPlanRequestNumber { get; set; }
/// <summary>
/// 使用在途库
/// </summary>
[Display(Name = "使用在途库")]
[IgnoreUpdate]
public bool UseOnTheWayLocation { get; set; }
/// <summary>
/// 任务明细
/// </summary>
[IgnoreUpdate]
public override List<InjectionPlanJobDetail> Details { get; set; } = new();
}

531
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/InjectionPlanJobs/InjectionPlanJobDetail.cs

@ -0,0 +1,531 @@
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.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Domain;
public class InjectionPlanJobDetail : SfsDetailEntityBase
{
#region 库存基础信息
/// <summary>
/// 物品代码
/// </summary>
[Display(Name = "物品代码")]
public string ItemCode { get; set; }
/// <summary>
/// 物品名称
/// </summary>
[Display(Name = "物品名称")]
public string ItemName { get; set; }
/// <summary>
/// 物品描述1
/// </summary>
[Display(Name = "物品描述1")]
public string ItemDesc1 { get; set; }
/// <summary>
/// 物品描述2
/// </summary>
[Display(Name = "物品描述2")]
public string ItemDesc2 { get; set; }
/// <summary>
/// 标包数量
/// </summary>
[Display(Name = "标包数量")]
[Column(TypeName = "decimal(18,6)")]
public decimal StdPackQty { get; set; }
/// <summary>
/// 库存状态
/// </summary>
[Display(Name = "库存状态")]
public EnumInventoryStatus Status { get; set; }
/// <summary>
/// 计量单位
/// </summary>
[Display(Name = "计量单位")]
public string Uom { get; set; }
#endregion
#region 请求信息
/// <summary>
/// 请求库位
/// </summary>
public string RequestLocationCode { get; set; }
/// <summary>
/// 到库区
/// </summary>
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
public void SetId(Guid id)
{
Id = id;
}
}

121
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/InjectionPlanJobs/InjectionPlanJobManager.cs

@ -0,0 +1,121 @@
using System;
using System.Collections.Generic;
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 InjectionPlanJobManager : SfsJobManagerBase<InjectionPlanJob, InjectionPlanJobDetail>, IInjectionPlanJobManager
{
private readonly IBalanceAppService _balanceAppService;
private readonly IExpectOutAppService _expectOutAppService;
public InjectionPlanJobManager(
IInjectionPlanJobRepository repository, IBalanceAppService balanceAppService, IExpectOutAppService expectOutAppService) : base(repository)
{
_balanceAppService = balanceAppService;
_expectOutAppService = expectOutAppService;
}
/// <summary>
/// 执行任务 发料任务
/// </summary>
/// <param name="id"></param>
/// <param name="input"></param>
/// <param name="user"></param>
/// <returns></returns>
public override async Task<InjectionPlanJob> CompleteAsync(InjectionPlanJob input, ICurrentUser user)
{
var entity = await Repository.FindAsync(input.Id).ConfigureAwait(false);
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(inputDetail.HandledFromPackingCode, inputDetail.ItemCode, inputDetail.HandledFromLocationCode, inputDetail.Status, inputDetail.HandledFromLot).ConfigureAwait(false);
if (balanceDto.Qty <= 0)
{
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 async Task<InjectionPlanJob> GetAsync(Expression<Func<InjectionPlanJob, bool>> expression)
{
return await Repository.FindAsync(expression).ConfigureAwait(false);
}
#region 无用
public override Task<List<InjectionPlanJob>> GetWorkingListByPackingAsync(string packingCode)
{
throw new NotImplementedException();
}
public override Task<List<InjectionPlanJob>> GetWorkingListByContainerAsync(string containerCode)
{
throw new NotImplementedException();
}
public override void CheckDetails(InjectionPlanJob entity, AbpValidationResult result)
{
throw new NotImplementedException();
}
#endregion
}

22
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJob.cs

@ -1,12 +1,14 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Threading.Tasks;
using Win_in.Sfs.Shared.Domain.Entities;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Domain;
/// <summary>
/// 注塑发料任务
/// 注塑发料任务
/// </summary>
[Display(Name = "注塑发料任务")]
public class InjectionIssueJob : SfsJobAggregateRootBase<InjectionIssueJobDetail>
@ -18,27 +20,25 @@ public class InjectionIssueJob : SfsJobAggregateRootBase<InjectionIssueJobDetail
public EnumIssueRequestType IssueRequestType { get; set; }
/// <summary>
/// 生产线
/// 生产线
/// </summary>
[IgnoreUpdate]
public string ProdLine { get; set; }
/// <summary>
/// 注塑要料单号
/// 要料单号
/// </summary>
[IgnoreUpdate]
public string InjectionIssueRequestNumber { get; set; }
public string InjectionRequestNumber { get; set; }
/// <summary>
/// 使用在途库
/// 使用在途库
/// </summary>
[Display(Name = "使用在途库")]
[IgnoreUpdate]
public bool UseOnTheWayLocation { get; set; }
/// <summary>
/// 任务明细
/// 任务明细
/// </summary>
[IgnoreUpdate]
public override List<InjectionIssueJobDetail> Details { get; set; } = new();
public override List<InjectionIssueJobDetail> Details { get; set; } = new List<InjectionIssueJobDetail>();
public EnumIssueSendType EnumIssueSendType { get; set; }
}

201
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobDetail.cs

@ -1,9 +1,8 @@
using System;
using System.ComponentModel.DataAnnotations;
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.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Domain;
@ -12,46 +11,40 @@ public class InjectionIssueJobDetail : SfsDetailEntityBase
#region 库存基础信息
/// <summary>
/// 物品代码
/// 物品代码
/// </summary>
[Display(Name = "物品代码")]
public string ItemCode { get; set; }
/// <summary>
/// 物品名称
/// 物品名称
/// </summary>
[Display(Name = "物品名称")]
public string ItemName { get; set; }
/// <summary>
/// 物品描述1
/// 物品描述1
/// </summary>
[Display(Name = "物品描述1")]
public string ItemDesc1 { get; set; }
/// <summary>
/// 物品描述2
/// 物品描述2
/// </summary>
[Display(Name = "物品描述2")]
public string ItemDesc2 { get; set; }
/// <summary>
/// 标包数量
/// 标包数量
/// </summary>
[Display(Name = "标包数量")]
[Column(TypeName = "decimal(18,6)")]
public decimal StdPackQty { get; set; }
/// <summary>
/// 库存状态
/// 库存状态
/// </summary>
[Display(Name = "库存状态")]
public EnumInventoryStatus Status { get; set; }
/// <summary>
/// 计量单位
/// 计量单位
/// </summary>
[Display(Name = "计量单位")]
public string Uom { get; set; }
#endregion
@ -59,52 +52,52 @@ public class InjectionIssueJobDetail : SfsDetailEntityBase
#region 请求信息
/// <summary>
/// 请求库位
/// 请求库位
/// </summary>
public string RequestLocationCode { get; set; }
/// <summary>
/// 到库区
/// 到库区
/// </summary>
public string RequestLocationArea { get; set; }
/// <summary>
/// 到库位组
/// 到库位组
/// </summary>
public string RequestLocationGroup { get; set; }
/// <summary>
/// 到ERP库位
/// 到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; }
@ -113,67 +106,67 @@ public class InjectionIssueJobDetail : SfsDetailEntityBase
#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库位
/// 推荐来源ERP库位
/// </summary>
public string RecommendFromLocationErpCode { get; set; }
/// <summary>
/// 推荐来源仓库
/// 推荐来源仓库
/// </summary>
public string RecommendFromWarehouseCode { get; set; }
/// <summary>
/// 推荐来源数量
/// 推荐来源数量
/// </summary>
public decimal RecommendFromQty { get; set; }
@ -182,67 +175,67 @@ public class InjectionIssueJobDetail : SfsDetailEntityBase
#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库位
/// 推荐目标ERP库位
/// </summary>
public string RecommendToLocationErpCode { get; set; }
/// <summary>
/// 推荐目标仓库
/// 推荐目标仓库
/// </summary>
public string RecommendToWarehouseCode { get; set; }
/// <summary>
/// 推荐目标数量
/// 推荐目标数量
/// </summary>
public decimal RecommendToQty { get; set; }
@ -251,67 +244,67 @@ public class InjectionIssueJobDetail : SfsDetailEntityBase
#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库位
/// 库移来源ERP库位
/// </summary>
public string TransferLibFromLocationErpCode { get; set; }
/// <summary>
/// 库移来源仓库
/// 库移来源仓库
/// </summary>
public string TransferLibFromWarehouseCode { get; set; }
/// <summary>
/// 库移来源数量
/// 库移来源数量
/// </summary>
public decimal TransferLibFromQty { get; set; }
@ -320,67 +313,67 @@ public class InjectionIssueJobDetail : SfsDetailEntityBase
#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库位
/// 库移目标ERP库位
/// </summary>
public string TransferLibToLocationErpCode { get; set; }
/// <summary>
/// 库移目标仓库
/// 库移目标仓库
/// </summary>
public string TransferLibToWarehouseCode { get; set; }
/// <summary>
/// 库移目标数量
/// 库移目标数量
/// </summary>
public decimal TransferLibToQty { get; set; }
@ -389,67 +382,67 @@ public class InjectionIssueJobDetail : SfsDetailEntityBase
#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库位
/// 实际ERP库位
/// </summary>
public string HandledFromLocationErpCode { get; set; }
/// <summary>
/// 实际仓库
/// 实际仓库
/// </summary>
public string HandledFromWarehouseCode { get; set; }
/// <summary>
/// 实际数量
/// 实际数量
/// </summary>
public decimal HandledFromQty { get; set; }
@ -458,67 +451,67 @@ public class InjectionIssueJobDetail : SfsDetailEntityBase
#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库位
/// 实际ERP库位
/// </summary>
public string HandledToLocationErpCode { get; set; }
/// <summary>
/// 实际仓库
/// 实际仓库
/// </summary>
public string HandledToWarehouseCode { get; set; }
/// <summary>
/// 实际数量
/// 实际数量
/// </summary>
public decimal HandledToQty { get; set; }
@ -526,6 +519,6 @@ public class InjectionIssueJobDetail : SfsDetailEntityBase
public void SetId(Guid id)
{
Id = id;
this.Id = id;
}
}

7
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobManager.cs

@ -5,6 +5,7 @@ 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;
@ -18,7 +19,9 @@ public class InjectionIssueJobManager : SfsJobManagerBase<InjectionIssueJob, Inj
private readonly IExpectOutAppService _expectOutAppService;
public InjectionIssueJobManager(
IInjectionIssueJobRepository repository, IBalanceAppService balanceAppService, IExpectOutAppService expectOutAppService) : base(repository)
IInjectionIssueJobRepository repository,
IBalanceAppService balanceAppService,
IExpectOutAppService expectOutAppService) : base(repository)
{
_balanceAppService = balanceAppService;
_expectOutAppService = expectOutAppService;
@ -49,7 +52,7 @@ public class InjectionIssueJobManager : SfsJobManagerBase<InjectionIssueJob, Inj
$" 的库存被占用【预计出】");
}
var balanceDto=await _balanceAppService.GetRealQtyByPackingCodeAndItemCodeAndLocationCodeAndStatusAsync(inputDetail.HandledFromPackingCode, inputDetail.ItemCode, inputDetail.HandledFromLocationCode, inputDetail.Status, inputDetail.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}," +

10
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/InjectionPlanNotes/IInjectionPlanNoteManager.cs

@ -0,0 +1,10 @@
using System;
using System.Threading.Tasks;
namespace Win_in.Sfs.Wms.Store.Domain;
public interface IInjectionPlanNoteManager : ISfsStoreManager<InjectionPlanNote, InjectionPlanNoteDetail>
{
Task<InjectionPlanNote> ConfirmAsync(Guid id);
}

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/InjectionPlanNotes/IInjectionPlanNoteRepository.cs

@ -0,0 +1,6 @@
namespace Win_in.Sfs.Wms.Store.Domain;
public interface IInjectionPlanNoteRepository : ISfsStoreRepositoryBase<InjectionPlanNote>
{
}

72
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/InjectionPlanNotes/InjectionPlanNote.cs

@ -0,0 +1,72 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Volo.Abp;
using Win_in.Sfs.Shared.Domain.Entities;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Domain;
/// <summary>
/// 注塑计划记录
/// </summary>
public class InjectionPlanNote : SfsStoreAggregateRootBase<InjectionPlanNoteDetail>, IHasJobNumber, IHasRequestNumber
{
/// <summary>
/// 任务ID
/// </summary>
[IgnoreUpdate]
public string JobNumber { get; set; }
/// <summary>
/// 明细列表
/// </summary>
[IgnoreUpdate]
public override List<InjectionPlanNoteDetail> Details { get; set; } = new List<InjectionPlanNoteDetail>();
[IgnoreUpdate]
public string RequestNumber { get; set; }
/// <summary>
/// 叫料类型
/// </summary>
[Display(Name = "叫料类型")]
public EnumIssueRequestType IssueRequestType { get; set; }
/// <summary>
/// 使用在途库
/// </summary>
[IgnoreUpdate]
public bool UseOnTheWayLocation { get; set; }
/// <summary>
/// 确认时间
/// </summary>
[Display(Name = "确认时间")]
[IgnoreUpdate]
public DateTime? ConfirmTime { get; set; }
/// <summary>
/// 已确认
/// </summary>
[Display(Name = "已确认")]
public bool Confirmed { get; set; }
public void Confirm(DateTime confirmTime)
{
CheckStatus(Confirmed);
Confirmed = true;
ConfirmTime = confirmTime;
}
private static void CheckStatus(bool confirmed)
{
if (confirmed)
{
throw new UserFriendlyException($"当前状态为 【已确认】 ,无法再次确认!");
}
}
}

520
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/InjectionPlanNotes/InjectionPlanNoteDetail.cs

@ -0,0 +1,520 @@
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.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Domain;
public class InjectionPlanNoteDetail : SfsStoreDetailEntityBase
{
#region 库存基础信息
/// <summary>
/// 物品代码
/// </summary>
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>
public string Uom { get; set; }
#endregion
#region 请求信息
/// <summary>
/// 请求库位
/// </summary>
public string RequestLocationCode { get; set; }
/// <summary>
/// 到库区
/// </summary>
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
}

42
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/InjectionPlanNotes/InjectionPlanNoteManager.cs

@ -0,0 +1,42 @@
using System;
using System.Threading.Tasks;
using Microsoft.Extensions.Logging;
using Volo.Abp;
using Volo.Abp.Uow;
using Win_in.Sfs.Shared.Event;
namespace Win_in.Sfs.Wms.Store.Domain;
public class InjectionPlanNoteManager : SfsStoreManagerBase<InjectionPlanNote, InjectionPlanNoteDetail>, IInjectionPlanNoteManager
{
public InjectionPlanNoteManager(
IInjectionPlanNoteRepository repository
) : base(repository)
{
}
[UnitOfWork]
public virtual async Task<InjectionPlanNote> ConfirmAsync(Guid id)
{
var entity = await Repository.FindAsync(id).ConfigureAwait(false);
Check.NotNull(entity, EntityClassName);
entity.Confirm(Clock.Now);
await PublishConfirmedAsync(entity).ConfigureAwait(false);
return await Repository.UpdateAsync(entity).ConfigureAwait(false);
}
private async Task PublishConfirmedAsync(InjectionPlanNote entity)
{
try
{
await LocalEventBus.PublishAsync(new SfsConfirmedEntityEventData<InjectionPlanNote>(entity), false).ConfigureAwait(false);
}
catch (Exception ex)
{
Logger.LogDebug($"{nameof(InjectionPlanNote)} Confirmed Event:{ex.Message}", null);
Console.WriteLine(ex.Source);
throw;
}
}
}

9
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/IssueNotes/InjectionIssueNotes/InjectionIssueNote.cs

@ -8,7 +8,7 @@ using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Domain;
/// <summary>
/// 注塑料记录
/// 注塑料记录
/// </summary>
public class InjectionIssueNote : SfsStoreAggregateRootBase<InjectionIssueNoteDetail>, IHasJobNumber, IHasRequestNumber
{
@ -21,12 +21,9 @@ public class InjectionIssueNote : SfsStoreAggregateRootBase<InjectionIssueNoteDe
/// <summary>
/// 明细列表
/// </summary>
[IgnoreUpdate]
public override List<InjectionIssueNoteDetail> Details { get; set; } = new List<InjectionIssueNoteDetail>();
[IgnoreUpdate]
public string RequestNumber { get; set; }
/// <summary>
/// 叫料类型
/// </summary>
@ -36,14 +33,12 @@ public class InjectionIssueNote : SfsStoreAggregateRootBase<InjectionIssueNoteDe
/// <summary>
/// 使用在途库
/// </summary>
[IgnoreUpdate]
public bool UseOnTheWayLocation { get; set; }
/// <summary>
/// 确认时间
/// </summary>
[Display(Name = "确认时间")]
[IgnoreUpdate]
public DateTime? ConfirmTime { get; set; }
/// <summary>
@ -52,6 +47,8 @@ public class InjectionIssueNote : SfsStoreAggregateRootBase<InjectionIssueNoteDe
[Display(Name = "已确认")]
public bool Confirmed { get; set; }
public EnumIssueSendType EnumIssueSendType { get; set; }
public void Confirm(DateTime confirmTime)
{

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/IssueNotes/InjectionIssueNotes/InjectionIssueNoteDetail.cs

@ -3,7 +3,6 @@ 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.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Domain;

13
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/InjectionPlanRequests/IInjectionPlanRequestManager.cs

@ -0,0 +1,13 @@
using System.Threading.Tasks;
using Win_in.Sfs.Shared.Domain;
namespace Win_in.Sfs.Wms.Store.Domain;
public interface IInjectionPlanRequestManager : ISfsStoreRequestManager<InjectionPlanRequest, InjectionPlanRequestDetail>,
IBulkImportService<InjectionPlanRequest>
{
Task CompleteAsync(string number);
Task<InjectionPlanRequest> CreateByNumberAsync(InjectionPlanRequest entity);
}

9
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/InjectionPlanRequests/IInjectionPlanRequestRepository.cs

@ -0,0 +1,9 @@
using Win_in.Sfs.Shared.Domain;
namespace Win_in.Sfs.Wms.Store.Domain;
public interface IInjectionPlanRequestRepository : ISfsStoreRepositoryBase<InjectionPlanRequest>,
ISfsBulkRepositoryBase<InjectionPlanRequest>
{
}

24
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/InjectionPlanRequests/InjectionPlanRequest.cs

@ -0,0 +1,24 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain.Entities;
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Domain;
/// <summary>
/// 注塑计划申请
/// </summary>
public class InjectionPlanRequest : SfsStoreRequestAggregateRootBase<InjectionPlanRequestDetail>
{
/// <summary>
/// 叫料类型
/// </summary>
[Display(Name = "叫料类型")]
public EnumIssueRequestType IssueRequestType { get; set; }
/// <summary>
/// 使用在途库
/// </summary>
public bool UseOnTheWayLocation { get; set; }
}

101
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/InjectionPlanRequests/InjectionPlanRequestDetail.cs

@ -0,0 +1,101 @@
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;
/// <summary>
/// 注塑计划申请明细
/// </summary>
public class InjectionPlanRequestDetail : SfsStoreDetailWithQtyEntityBase, IHasToLocation
{
#region 目标库位信息
/// <summary>
/// 目标库位
/// </summary>
[Display(Name = "目标库位")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ToLocationCode { get; set; }
/// <summary>
/// 目标库区
/// </summary>
[Display(Name = "目标库区")]
public string ToLocationArea { get; set; }
/// <summary>
/// 目标库位组
/// </summary>
[Display(Name = "目标库位组")]
public string ToLocationGroup { get; set; }
/// <summary>
/// 目标ERP储位
/// </summary>
[Display(Name = "目标ERP储位")]
public string ToLocationErpCode { get; set; }
/// <summary>
/// 目标仓库
/// </summary>
[Display(Name = "目标仓库")]
public string ToWarehouseCode { get; set; }
#endregion
/// <summary>
/// 生产线
/// </summary>
public string ProdLine { get; set; }
/// <summary>
/// 已发数量
/// </summary>
public decimal IssuedQty { get; set; }
/// <summary>
/// 已收数量
/// </summary>
public decimal ReceivedQty { get; set; }
/// <summary>
/// 明细状态
/// </summary>
public EnumStatus Status { get; set; }
/// <summary>
/// 请求未发 还未发送的数量
/// </summary>
[NotMapped]
public decimal ToBeIssuedQty => Qty - IssuedQty;
/// <summary>
/// 已发未收
/// </summary>
[NotMapped]
public decimal ToBeReceivedQty => IssuedQty - ReceivedQty;
/// <summary>
/// 请求未收
/// </summary>
[NotMapped]
public decimal NotFinishQty => Qty - ReceivedQty;
/// <summary>
/// 位置码
/// </summary>
public string PositionCode { get; set; }
/// <summary>
/// 推荐类型
/// </summary>
public EnumRecommendType RecommendType { get; set; }
/// <summary>
/// 需求箱数量
/// </summary>
[Display(Name = "需求箱数量")]
public decimal BoxQty { get; set; }
}

77
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/InjectionPlanRequests/InjectionPlanRequestManager.cs

@ -0,0 +1,77 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Event;
namespace Win_in.Sfs.Wms.Store.Domain;
public class InjectionPlanRequestManager
: SfsStoreRequestManagerBase<InjectionPlanRequest, InjectionPlanRequestDetail>
, IInjectionPlanRequestManager
{
private readonly IInjectionPlanRequestRepository _repository;
private readonly IInjectionPlanJobRepository _injectionJobRepository;
public InjectionPlanRequestManager(
IInjectionPlanRequestRepository repository
, IInjectionPlanJobRepository injectionJobRepository
) : base(repository)
{
_repository = repository;
_injectionJobRepository = injectionJobRepository;
}
#region 东阳V2
#endregion
/// <summary>
/// 创建 同时 直接赋值Number 为了返回Number
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
public virtual async Task<InjectionPlanRequest> CreateByNumberAsync(InjectionPlanRequest entity)
{
var number = string.IsNullOrEmpty(entity.Number)
? await GenerateNumberAsync(nameof(InjectionPlanRequest), entity.ActiveDate).ConfigureAwait(false)
: entity.Number;
entity.SetIdAndNumberWithDetails(GuidGenerator, number);
entity.Submit();
entity.Agree();
entity.RequestStatus = EnumRequestStatus.Partial;
await LocalEventBus.PublishAsync(new SfsHandledEntityEventData<InjectionPlanRequest>(entity),false)
.ConfigureAwait(false);
await _repository.InsertAsync(entity).ConfigureAwait(false);
return entity;
}
public virtual async Task CompleteAsync(string number)
{
var entity = await GetByNumberAsync(number).ConfigureAwait(false);
if (entity != null && !entity.Details.Any(p => p.ToBeIssuedQty > 0))
{
await CompleteAsync(entity).ConfigureAwait(false);
}
}
#region 导入
/// <summary>
/// 执行导入
/// </summary>
public virtual async Task ImportDataAsync(List<InjectionPlanRequest> mergeEntities,
List<InjectionPlanRequest> deleteEntities = null)
{
if (deleteEntities != null && deleteEntities.Count > 0)
{
await _repository.BulkDeleteAsync(deleteEntities).ConfigureAwait(false);
}
await CreateManyAsync(mergeEntities).ConfigureAwait(false);
}
#endregion
}

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/IssueRequests/InjectionIssueRequests/IInjectionIssueRequestManager.cs

@ -5,7 +5,7 @@ namespace Win_in.Sfs.Wms.Store.Domain;
public interface IInjectionIssueRequestManager : ISfsStoreRequestManager<InjectionIssueRequest, InjectionIssueRequestDetail>,
IBulkImportService<InjectionIssueRequest>
{
{
Task CompleteAsync(string number);

11
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/IssueRequests/InjectionIssueRequests/InjectionIssueRequest.cs

@ -6,7 +6,7 @@ using Win_in.Sfs.Shared.Domain.Shared.Enums.Store;
namespace Win_in.Sfs.Wms.Store.Domain;
/// <summary>
/// 注塑申请
/// 注塑叫料申请
/// </summary>
public class InjectionIssueRequest : SfsStoreRequestAggregateRootBase<InjectionIssueRequestDetail>
{
@ -17,13 +17,8 @@ public class InjectionIssueRequest : SfsStoreRequestAggregateRootBase<InjectionI
public EnumIssueRequestType IssueRequestType { get; set; }
/// <summary>
/// 使用在途库
/// 使用在途库
/// </summary>
public bool UseOnTheWayLocation { get; set; }
/// <summary>
/// 明细列表
/// </summary>
[IgnoreUpdate]
public override List<InjectionIssueRequestDetail> Details { get; set; } = new();
}

34
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/IssueRequests/InjectionIssueRequests/InjectionIssueRequestDetail.cs

@ -1,3 +1,4 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Win_in.Sfs.Shared.Domain;
@ -6,95 +7,96 @@ using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Domain;
/// <summary>
/// 注塑叫料申请明细
/// 注塑叫料申请明细
/// </summary>
public class InjectionIssueRequestDetail : SfsStoreDetailWithQtyEntityBase, IHasToLocation
{
#region 目标库位信息
/// <summary>
/// 目标库位
/// 目标库位
/// </summary>
[Display(Name = "目标库位")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ToLocationCode { get; set; }
/// <summary>
/// 目标库区
/// 目标库区
/// </summary>
[Display(Name = "目标库区")]
public string ToLocationArea { get; set; }
/// <summary>
/// 目标库位组
/// 目标库位组
/// </summary>
[Display(Name = "目标库位组")]
public string ToLocationGroup { get; set; }
/// <summary>
/// 目标ERP储位
/// 目标ERP储位
/// </summary>
[Display(Name = "目标ERP储位")]
public string ToLocationErpCode { get; set; }
/// <summary>
/// 目标仓库
/// 目标仓库
/// </summary>
[Display(Name = "目标仓库")]
public string ToWarehouseCode { get; set; }
#endregion
/// <summary>
/// 生产线
/// 生产线
/// </summary>
public string ProdLine { get; set; }
/// <summary>
/// 已发数量
/// 已发数量
/// </summary>
public decimal IssuedQty { get; set; }
/// <summary>
/// 已收数量
/// 已收数量
/// </summary>
public decimal ReceivedQty { get; set; }
/// <summary>
/// 明细状态
/// 明细状态
/// </summary>
public EnumStatus Status { get; set; }
/// <summary>
/// 请求未发 还未发送的数量
/// 请求未发 还未发送的数量
/// </summary>
[NotMapped]
public decimal ToBeIssuedQty => Qty - IssuedQty;
/// <summary>
/// 已发未收
/// 已发未收
/// </summary>
[NotMapped]
public decimal ToBeReceivedQty => IssuedQty - ReceivedQty;
/// <summary>
/// 请求未收
/// 请求未收
/// </summary>
[NotMapped]
public decimal NotFinishQty => Qty - ReceivedQty;
/// <summary>
/// 位置码
/// 位置码
/// </summary>
public string PositionCode { get; set; }
/// <summary>
/// 推荐类型
/// 推荐类型
/// </summary>
public EnumRecommendType RecommendType { get; set; }
/// <summary>
/// 需求箱数量
/// 需求箱数量
/// </summary>
[Display(Name = "需求箱数量")]
public decimal BoxQty { get; set; }

30
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/IssueRequests/InjectionIssueRequests/InjectionIssueRequestManager.cs

@ -11,22 +11,14 @@ public class InjectionIssueRequestManager
, IInjectionIssueRequestManager
{
private readonly IInjectionIssueRequestRepository _repository;
private readonly IInjectionIssueJobRepository _injectionJobRepository;
public InjectionIssueRequestManager(
IInjectionIssueRequestRepository repository
, IInjectionIssueJobRepository injectionJobRepository
) : base(repository)
{
_repository = repository;
_injectionJobRepository = injectionJobRepository;
}
#region 东阳V2
#endregion
/// <summary>
/// 创建 同时 直接赋值Number 为了返回Number
/// </summary>
@ -41,12 +33,12 @@ public class InjectionIssueRequestManager
entity.Submit();
entity.Agree();
entity.RequestStatus = EnumRequestStatus.Partial;
await LocalEventBus.PublishAsync(new SfsHandledEntityEventData<InjectionIssueRequest>(entity),false)
await LocalEventBus.PublishAsync(new SfsHandledEntityEventData<InjectionIssueRequest>(entity), false)
.ConfigureAwait(false);
await _repository.InsertAsync(entity).ConfigureAwait(false);
return entity;
}
public virtual async Task CompleteAsync(string number)
{
var entity = await GetByNumberAsync(number).ConfigureAwait(false);
@ -56,22 +48,8 @@ public class InjectionIssueRequestManager
}
}
#region 导入
/// <summary>
/// 执行导入
/// </summary>
public virtual async Task ImportDataAsync(List<InjectionIssueRequest> mergeEntities,
List<InjectionIssueRequest> deleteEntities = null)
public Task ImportDataAsync(List<InjectionIssueRequest> entities, List<InjectionIssueRequest> deleteEntities = null)
{
if (deleteEntities != null && deleteEntities.Count > 0)
{
await _repository.BulkDeleteAsync(deleteEntities).ConfigureAwait(false);
}
await CreateManyAsync(mergeEntities).ConfigureAwait(false);
throw new System.NotImplementedException();
}
#endregion
}

3
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/IStoreDbContext.cs

@ -21,6 +21,7 @@ public interface IStoreDbContext : IEfCoreDbContext
public DbSet<ProductReceiptRequest> ProductReceiptRequests { get; }
public DbSet<MaterialRequest> MaterialRequests { get; }
public DbSet<InjectionIssueRequest> InjectionIssueRequests { get; }
public DbSet<InjectionPlanRequest> InjectionPlanRequests { get; }
public DbSet<KittingIssueRequest> KittingIssueRequests { get; }
public DbSet<CoatingIssueRequest> CoatingIssueRequests { get; }
public DbSet<AssembleIssueRequest> AssembleIssueRequest { get; }
@ -83,6 +84,7 @@ public interface IStoreDbContext : IEfCoreDbContext
public DbSet<WarehouseTransferNote> WarehouseTransferNotes { get; }
public DbSet<IssueNote> IssueNotes { get; }
public DbSet<InjectionIssueNote> InjectionIssueNotes { get; }
public DbSet<InjectionPlanNote> InjectionPlanNotes { get; }
public DbSet<AssembleIssueNote> AssembleIssueNotes { get; }
public DbSet<KittingIssueNote> KittingIssueNotes { get; }
public DbSet<CoatingIssueNote> CoatingIssueNotes { get; }
@ -116,6 +118,7 @@ public interface IStoreDbContext : IEfCoreDbContext
public DbSet<PutawayJob> PutawayJobs { get; }
public DbSet<IssueJob> IssueJobs { get; }
public DbSet<InjectionIssueJob> InjectionIssueJobs { get; }
public DbSet<InjectionPlanJob> InjectionPlanJobs { get; }
public DbSet<AssembleIssueJob> AssembleIssueJobs { get; }
public DbSet<KittingIssueJob> KittingIssueJobs { get; }
public DbSet<CoatingIssueJob> CoatingIssueJobs { get; }

61
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/InjectionPlanJobs/InjectionPlanJobDbContextModelCreatingExtensions.cs

@ -0,0 +1,61 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.Modeling;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.EntityFrameworkCore;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.EntityFrameworkCore;
public static class InjectionPlanJobDbContextModelCreatingExtensions
{
public static void ConfigureInjectionPlanJob(this ModelBuilder builder, StoreModelBuilderConfigurationOptions options)
{
builder.Entity<InjectionPlanJob>(b =>
{
//Configure table & schema name
b.ToTable(StoreDbProperties.JobDbTablePrefix + nameof(InjectionPlanJob), options.Schema);
//Configure ABP properties
b.ConfigureByConvention();
//Configure Sfs base properties
b.ConfigureSfsBase();
//Configure Job base properties
b.ConfigureJob<InjectionPlanJob, InjectionPlanJobDetail>();
//Properties
b.Property(q => q.InjectionPlanRequestNumber).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
b.HasIndex(q => new { q.Number }).IsUnique();
});
builder.Entity<InjectionPlanJobDetail>(b =>
{
//Configure table & schema name
b.ToTable(StoreDbProperties.JobDbTablePrefix + nameof(InjectionPlanJobDetail), options.Schema);
//Configure ABP properties
b.ConfigureByConvention();
//Configure Sfs base properties
b.ConfigureSfsBase();
//Configure Job base properties
//b.ConfigureJobRecommendFromDetail();
//Properties
b.Property(q => q.RequestLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ProdLine).HasMaxLength(SfsPropertyConst.CodeLength);
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
//Indexes
//b.HasIndex(q => new { q.PackingCode }).IsUnique();
});
}
}

11
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/InjectionPlanJobs/InjectionPlanJobEfCoreRepository.cs

@ -0,0 +1,11 @@
using Volo.Abp.EntityFrameworkCore;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.EntityFrameworkCore;
public class InjectionPlanJobEfCoreRepository : SfsJobEfCoreRepositoryBase<StoreDbContext, InjectionPlanJob>, IInjectionPlanJobRepository
{
public InjectionPlanJobEfCoreRepository(IDbContextProvider<StoreDbContext> dbContextProvider) : base(dbContextProvider)
{
}
}

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/IssueJobs/InjectionIssueJobs/InjectionIssueJobDbContextModelCreatingExtensions.cs

@ -21,7 +21,7 @@ public static class InjectionIssueJobDbContextModelCreatingExtensions
//Configure Job base properties
b.ConfigureJob<InjectionIssueJob, InjectionIssueJobDetail>();
//Properties
b.Property(q => q.InjectionIssueRequestNumber).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.InjectionRequestNumber).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>();
@ -42,7 +42,7 @@ public static class InjectionIssueJobDbContextModelCreatingExtensions
//Configure Job base properties
//b.ConfigureJobRecommendFromDetail();
//Properties
b.Property(q => q.RequestLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ProdLine).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.OnTheWayLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);

32171
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240515012138_Update_CoatingIssue.Designer.cs

File diff suppressed because it is too large

67
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240515012138_Update_CoatingIssue.cs

@ -0,0 +1,67 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Win_in.Sfs.Wms.Store.Migrations
{
public partial class Update_CoatingIssue : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "MaterialRequestNumber",
table: "Job_CoatingIssueJob",
newName: "CoatingRequestNumber");
migrationBuilder.AlterColumn<string>(
name: "PositionCode",
table: "Store_CoatingIssueRequestDetail",
type: "nvarchar(64)",
maxLength: 64,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldNullable: true);
migrationBuilder.AddColumn<int>(
name: "EnumIssueSendType",
table: "Store_CoatingIssueNote",
type: "int",
nullable: false,
defaultValue: 0);
migrationBuilder.AddColumn<int>(
name: "EnumIssueSendType",
table: "Job_CoatingIssueJob",
type: "int",
nullable: false,
defaultValue: 0);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "EnumIssueSendType",
table: "Store_CoatingIssueNote");
migrationBuilder.DropColumn(
name: "EnumIssueSendType",
table: "Job_CoatingIssueJob");
migrationBuilder.RenameColumn(
name: "CoatingRequestNumber",
table: "Job_CoatingIssueJob",
newName: "MaterialRequestNumber");
migrationBuilder.AlterColumn<string>(
name: "PositionCode",
table: "Store_CoatingIssueRequestDetail",
type: "nvarchar(max)",
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(64)",
oldMaxLength: 64,
oldNullable: true);
}
}
}

1257
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/StoreDbContextModelSnapshot.cs

File diff suppressed because it is too large

56
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/InjectionPlanNotes/InjectionPlanNoteDbContextModelCreatingExtensions.cs

@ -0,0 +1,56 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.Modeling;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.EntityFrameworkCore;
public static class InjectionPlanNoteDbContextModelCreatingExtensions
{
public static void ConfigureInjectionPlanNote(this ModelBuilder builder, StoreModelBuilderConfigurationOptions options)
{
builder.Entity<InjectionPlanNote>(b =>
{
//Configure table & schema name
b.ToTable(options.TablePrefix + nameof(InjectionPlanNote), options.Schema);
//Configure ABP properties
b.ConfigureByConvention();
//Configure Sfs base properties
b.ConfigureSfsStoreBase();
//Properties
b.Property(q => q.RequestNumber).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.Remark).HasMaxLength(SfsPropertyConst.RemarkLength);
//Relations
b.HasMany(q => q.Details).WithOne().HasForeignKey(d => d.MasterID).IsRequired();
//Indexes
b.HasIndex(q => new { q.Number }).IsUnique();
});
builder.Entity<InjectionPlanNoteDetail>(b =>
{
//Configure table & schema name
b.ToTable(options.TablePrefix + nameof(InjectionPlanNoteDetail), 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 });
});
}
}

11
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/InjectionPlanNotes/InjectionPlanNoteEfCoreRepository.cs

@ -0,0 +1,11 @@
using Volo.Abp.EntityFrameworkCore;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.EntityFrameworkCore;
public class InjectionPlanNoteEfCoreRepository : SfsStoreEfCoreRepositoryBase<StoreDbContext, InjectionPlanNote>, IInjectionPlanNoteRepository
{
public InjectionPlanNoteEfCoreRepository(IDbContextProvider<StoreDbContext> dbContextProvider) : base(dbContextProvider)
{
}
}

44
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/IssueNotes/InjectionIssueNotes/InjectionIssueNoteDbContextModelCreatingExtensions.cs

@ -30,27 +30,27 @@ public static class InjectionIssueNoteDbContextModelCreatingExtensions
});
builder.Entity<InjectionIssueNoteDetail>(b =>
{
//Configure table & schema name
b.ToTable(options.TablePrefix + nameof(InjectionIssueNoteDetail), 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 });
});
{
//Configure table & schema name
b.ToTable(options.TablePrefix + nameof(InjectionIssueNoteDetail), 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 });
});
}
}

61
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/InjectionPlanRequests/InjectionPlanRequestDbContextModelCreatingExtensions.cs

@ -0,0 +1,61 @@
using Microsoft.EntityFrameworkCore;
using Volo.Abp.EntityFrameworkCore.Modeling;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.EntityFrameworkCore;
public static class InjectionPlanRequestDbContextModelCreatingExtensions
{
public static void ConfigureInjectionPlanRequest(this ModelBuilder builder, StoreModelBuilderConfigurationOptions options)
{
builder.Entity<InjectionPlanRequest>(b =>
{
//Configure table & schema name
b.ToTable(options.TablePrefix + nameof(InjectionPlanRequest), options.Schema);
//Configure ABP properties
b.ConfigureByConvention();
//Configure Sfs base properties
b.ConfigureSfsStoreBase();
//Properties
b.Property(q => q.RequestStatus).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
//Relations
b.HasMany(q => q.Details).WithOne().HasForeignKey(d => d.MasterID).IsRequired();
//Indexes
b.HasIndex(q => new { q.Number }).IsUnique();
});
builder.Entity<InjectionPlanRequestDetail>(b =>
{
//Configure table & schema name
b.ToTable(options.TablePrefix + nameof(InjectionPlanRequestDetail), 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.ToLocationCode).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ToLocationErpCode).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ToWarehouseCode).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ToLocationArea).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ToLocationGroup).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ProdLine).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.IssuedQty).HasPrecision(18, 6);
b.Property(q => q.ReceivedQty).HasPrecision(18, 6);
b.Property(q => q.Status).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.ItemCode, q.ToLocationCode }).IsUnique();
b.HasIndex(q => new { q.ItemCode });
});
}
}

11
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/InjectionPlanRequests/InjectionPlanRequestEfCoreRepository.cs

@ -0,0 +1,11 @@
using Volo.Abp.EntityFrameworkCore;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.EntityFrameworkCore;
public class InjectionPlanRequestEfCoreRepository : SfsStoreEfCoreRepositoryBase<StoreDbContext, InjectionPlanRequest>, IInjectionPlanRequestRepository
{
public InjectionPlanRequestEfCoreRepository(IDbContextProvider<StoreDbContext> dbContextProvider) : base(dbContextProvider)
{
}
}

0
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/IssueRequests/InjectionRequests/InjectionIssueRequestDbContextModelCreatingExtensions.cs → be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/IssueRequests/InjectionIssueRequests/InjectionIssueRequestDbContextModelCreatingExtensions.cs

0
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/IssueRequests/InjectionRequests/InjectionIssueRequestEfCoreRepository.cs → be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/IssueRequests/InjectionIssueRequests/InjectionIssueRequestEfCoreRepository.cs

3
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContext.cs

@ -22,6 +22,7 @@ public class StoreDbContext : AbpDbContext<StoreDbContext>, IStoreDbContext
public DbSet<ProductReceiptRequest> ProductReceiptRequests { get; set; }
public DbSet<MaterialRequest> MaterialRequests { get; set; }
public DbSet<InjectionIssueRequest> InjectionIssueRequests { get; set; }
public DbSet<InjectionPlanRequest> InjectionPlanRequests { get; set; }
public DbSet<KittingIssueRequest> KittingIssueRequests { get; set; }
public DbSet<CoatingIssueRequest> CoatingIssueRequests { get; set; }
public DbSet<AssembleIssueRequest> AssembleIssueRequest { get; set; }
@ -83,6 +84,7 @@ public class StoreDbContext : AbpDbContext<StoreDbContext>, IStoreDbContext
public DbSet<WarehouseTransferNote> WarehouseTransferNotes { get; set; }
public DbSet<IssueNote> IssueNotes { get; set; }
public DbSet<InjectionIssueNote> InjectionIssueNotes { get; set; }
public DbSet<InjectionPlanNote> InjectionPlanNotes { get; set; }
public DbSet<AssembleIssueNote> AssembleIssueNotes { get; set; }
public DbSet<KittingIssueNote> KittingIssueNotes { get; set; }
public DbSet<CoatingIssueNote> CoatingIssueNotes { get; set; }
@ -113,6 +115,7 @@ public class StoreDbContext : AbpDbContext<StoreDbContext>, IStoreDbContext
public DbSet<PutawayJob> PutawayJobs { get; set; }
public DbSet<IssueJob> IssueJobs { get; set; }
public DbSet<InjectionIssueJob> InjectionIssueJobs { get; set; }
public DbSet<InjectionPlanJob> InjectionPlanJobs { get; set; }
public DbSet<AssembleIssueJob> AssembleIssueJobs { get; set; }
public DbSet<KittingIssueJob> KittingIssueJobs { get; set; }
public DbSet<CoatingIssueJob> CoatingIssueJobs { get; set; }

3
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContextModelCreatingExtensions.cs

@ -48,6 +48,7 @@ public static class StoreDbContextModelCreatingExtensions
builder.ConfigurePurchaseReceiptRequest(options);
builder.ConfigureMaterialRequest(options);
builder.ConfigureInjectionIssueRequest(options);
builder.ConfigureInjectionPlanRequest(options);
builder.ConfigureKittingIssueRequest(options);
builder.ConfigureCoatingIssueRequest(options);
builder.ConfigureAssembleIssueRequest(options);
@ -87,6 +88,7 @@ public static class StoreDbContextModelCreatingExtensions
builder.ConfigureWarehouseTransferNote(options);
builder.ConfigureIssueNote(options);
builder.ConfigureInjectionIssueNote(options);
builder.ConfigureInjectionPlanNote(options);
builder.ConfigureAssembleIssueNote(options);
builder.ConfigureKittingIssueNote(options);
builder.ConfigureCoatingIssueNote(options);
@ -122,6 +124,7 @@ public static class StoreDbContextModelCreatingExtensions
builder.ConfigurePutawayJob(options);
builder.ConfigureIssueJob(options);
builder.ConfigureInjectionIssueJob(options);
builder.ConfigureInjectionPlanJob(options);
builder.ConfigureAssembleIssueJob(options);
builder.ConfigureKittingIssueJob(options);
builder.ConfigureCoatingIssueJob(options);

13
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/InjectionJobAutoMapperProfile.cs → be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/InjectionIssueJobAutoMapperProfile.cs

@ -15,7 +15,7 @@ public partial class StoreEventAutoMapperProfile : Profile
CreateMap<InjectionIssueJob, InjectionIssueNote>()
.ForMember(x => x.JobNumber, y => y.MapFrom(d => d.Number))
.ForMember(x => x.RequestNumber, y => y.MapFrom(d => d.InjectionIssueRequestNumber))
.ForMember(x => x.RequestNumber, y => y.MapFrom(d => d.InjectionRequestNumber))
.ForMember(x => x.ActiveDate, y => y.MapFrom(d => DateTime.Now))
.ForMember(x => x.Worker, y => y.MapFrom(d => d.CompleteUserName))
.Ignore(x => x.Confirmed)
@ -26,12 +26,21 @@ public partial class StoreEventAutoMapperProfile : Profile
;
CreateMap<InjectionIssueJob, InjectionIssueNoteEditInput>()
.ForMember(x => x.RequestNumber, y => y.MapFrom(d => d.InjectionIssueRequestNumber))
.ForMember(x => x.RequestNumber, y => y.MapFrom(d => d.InjectionRequestNumber))
.Ignore(x => x.Confirmed)
.Ignore(x => x.JobNumber)
.Ignore(x => x.ActiveDate)
;
CreateMap<InjectionIssueJobDetail, InjectionIssueNoteDetailInput>()
;
CreateMap<InjectionIssueJobDTO, InjectionIssueNoteEditInput>()
.ForMember(x => x.RequestNumber, y => y.MapFrom(d => d.InjectionRequestNumber))
.Ignore(x => x.Confirmed)
.Ignore(x => x.JobNumber)
.Ignore(x => x.ActiveDate)
;
CreateMap<InjectionIssueJobDetailDTO, InjectionIssueNoteDetailInput>()
;
}
}

37
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/InjectionPlanJobAutoMapperProfile.cs

@ -0,0 +1,37 @@
using System;
using AutoMapper;
using Volo.Abp.AutoMapper;
using Win_in.Sfs.Shared.Application;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Event;
public partial class StoreEventAutoMapperProfile : Profile
{
private void InjectionPlanJobAutoMapperProfile()
{
CreateMap<InjectionPlanJob, InjectionPlanNote>()
.ForMember(x => x.JobNumber, y => y.MapFrom(d => d.Number))
.ForMember(x => x.RequestNumber, y => y.MapFrom(d => d.InjectionPlanRequestNumber))
.ForMember(x => x.ActiveDate, y => y.MapFrom(d => DateTime.Now))
.ForMember(x => x.Worker, y => y.MapFrom(d => d.CompleteUserName))
.Ignore(x => x.Confirmed)
.Ignore(x => x.Number)
.Ignore(x => x.ConfirmTime);
CreateMap<InjectionPlanJobDetail, InjectionPlanNoteDetail>()
;
CreateMap<InjectionPlanJob, InjectionPlanNoteEditInput>()
.ForMember(x => x.RequestNumber, y => y.MapFrom(d => d.InjectionPlanRequestNumber))
.Ignore(x => x.Confirmed)
.Ignore(x => x.JobNumber)
.Ignore(x => x.ActiveDate)
;
CreateMap<InjectionPlanJobDetail, InjectionPlanNoteDetailInput>()
;
}
}

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/InjectionNoteAutoMapperProfile.cs

@ -45,7 +45,7 @@ public partial class StoreEventAutoMapperProfile : Profile
.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))
;
}
}

51
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Notes/InjectionPlanNoteAutoMapperProfile.cs

@ -0,0 +1,51 @@
using AutoMapper;
using Volo.Abp.AutoMapper;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Event;
public partial class StoreEventAutoMapperProfile : Profile
{
private void InjectionPlanNoteAutoMapperProfile()
{
CreateMap<InjectionPlanNoteDetail, TransferLogEditInput>()
.Ignore(x => x.DocNumber)
.Ignore(x => x.JobNumber)
.Ignore(x => x.Worker)
.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))
;
}
}

5
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/InjectionRequestAutoMapperProfile.cs → be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/InjectionIssueRequestAutoMapperProfile.cs

@ -12,8 +12,8 @@ public partial class StoreEventAutoMapperProfile : Profile
private void InjectionIssueRequestAutoMapperProfile()
{
CreateMap<InjectionIssueRequest, InjectionIssueJobEditInput>()
.ForMember(x => x.InjectionIssueRequestNumber, y => y.MapFrom(d => d.Number))
.Ignore(x => x.WarehouseCode)
.ForMember(x => x.InjectionRequestNumber, y => y.MapFrom(d => d.Number))
.Ignore(x => x.WarehouseCode)
.Ignore(x => x.UpStreamJobNumber)
.Ignore(x => x.JobType)
.Ignore(x => x.IsAutoComplete)
@ -30,6 +30,7 @@ public partial class StoreEventAutoMapperProfile : Profile
.Ignore(x => x.CompleteUserName)
.Ignore(x => x.CompleteTime)
.Ignore(x => x.Details)
.Ignore(x => x.EnumIssueSendType)
;
}
}

35
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/InjectionPlanRequestAutoMapperProfile.cs

@ -0,0 +1,35 @@
using AutoMapper;
using Volo.Abp.AutoMapper;
using Win_in.Sfs.Shared.Application;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Event;
public partial class StoreEventAutoMapperProfile : Profile
{
private void InjectionPlanRequestAutoMapperProfile()
{
CreateMap<InjectionPlanRequest, InjectionPlanJobEditInput>()
.ForMember(x => x.InjectionPlanRequestNumber, y => y.MapFrom(d => d.Number))
.Ignore(x => x.WarehouseCode)
.Ignore(x => x.UpStreamJobNumber)
.Ignore(x => x.JobType)
.Ignore(x => x.IsAutoComplete)
.Ignore(x => x.ExpiredTime)
.Ignore(x => x.JobDescription)
.Ignore(x => x.JobStatus)
.Ignore(x => x.WorkGroupCode)
.Ignore(x => x.Priority)
.Ignore(x => x.PriorityIncrement)
.Ignore(x => x.AcceptUserId)
.Ignore(x => x.AcceptTime)
.Ignore(x => x.AcceptUserName)
.Ignore(x => x.CompleteUserId)
.Ignore(x => x.CompleteUserName)
.Ignore(x => x.CompleteTime)
.Ignore(x => x.Details)
;
}
}

166
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/InjectionIssueJobEventHandler.cs

@ -1,6 +1,8 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Castle.Components.DictionaryAdapter;
using Volo.Abp;
using Volo.Abp.EventBus;
using Volo.Abp.Uow;
using Win_in.Sfs.Basedata.Application.Contracts;
@ -18,16 +20,16 @@ public class InjectionIssueJobEventHandler :
, ILocalEventHandler<SfsCreatedEntityEventData<InjectionIssueJob>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<InjectionIssueJob>>>
{
private readonly IInjectionIssueNoteAppService _injectionNoteAppService;
private readonly IInjectionIssueNoteAppService _injectionIssueNoteAppService;
private readonly IExpectOutAppService _expectOutAppService;
private readonly ILocationAppService _locationAppService;
private readonly ITransferLibRequestAppService _transferLibRequestAppService;
public InjectionIssueJobEventHandler(IInjectionIssueNoteAppService injectionNoteAppService,
public InjectionIssueJobEventHandler(IInjectionIssueNoteAppService injectionIssueNoteAppService,
IExpectOutAppService expectOutAppService,
ILocationAppService locationAppService, ITransferLibRequestAppService transferLibRequestAppService)
{
_injectionNoteAppService = injectionNoteAppService;
_injectionIssueNoteAppService = injectionIssueNoteAppService;
_expectOutAppService = expectOutAppService;
_locationAppService = locationAppService;
_transferLibRequestAppService = transferLibRequestAppService;
@ -41,9 +43,7 @@ public class InjectionIssueJobEventHandler :
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsCompletedEntityEventData<InjectionIssueJob> eventData)
{
var entity = eventData.Entity;
var injectionNote = await BuildInjectionIssueNoteAsync(entity).ConfigureAwait(false);
await _injectionNoteAppService.CreateAsync(injectionNote).ConfigureAwait(false);
await Task.CompletedTask.ConfigureAwait(false);
}
/// <summary>
@ -123,65 +123,91 @@ public class InjectionIssueJobEventHandler :
/// 根据是否在 第一层 来创建 是否生成库移任务
/// </summary>
/// <returns></returns>
private async Task CreateTransferLibAsync(InjectionIssueJob injectionJob)
private async Task CreateTransferLibAsync(InjectionIssueJob injectionIssueJob)
{
if (!await IsMinRowAsync(injectionJob).ConfigureAwait(false))
foreach (var detail in injectionIssueJob.Details)
{
foreach (var detail in injectionJob.Details)
var locationDto = await _locationAppService.GetByCodeAsync(detail.RecommendFromLocationCode)
.ConfigureAwait(false);
var locationList = await _locationAppService.GetListByGroupsAsync(
new List<string> { detail.RecommendFromLocationGroup }).ConfigureAwait(false);
var locationListSort = locationList.OrderBy(p => p.RowCode);
var locationDtoRowOne = new LocationDTO();
if (locationListSort.Any())
{
locationDtoRowOne = locationListSort.FirstOrDefault();
}
else
{
locationDtoRowOne = await _locationAppService.GetFirstRowOneAsync().ConfigureAwait(false);
if (locationDtoRowOne == null)
{
throw new UserFriendlyException("没有找到1层的库位");
}
}
if (locationDto.Type == EnumLocationType.RAW)
{
var input = new TransferLibRequestEditInput();
input.CallBusinessType = nameof(IInjectionIssueJobAppService);
input.CallJobNumber = injectionJob.Number;
input.CallRequestNumber = injectionJob.InjectionIssueRequestNumber;
input.CallServerName = "Win_in.Sfs.Wms.Store.Application.InjectionIssueJobAppService";
input.Type = "Transfer_Warehouse";
input.UseOnTheWayLocation = true;
var detailInput = new TransferLibRequestDetailInput();
detailInput.CallBusinessType = nameof(IInjectionIssueJobAppService);
detailInput.CallRequestNumber = injectionJob.InjectionIssueRequestNumber;
detailInput.CallServerName = "Win_in.Sfs.Wms.Store.Application.InjectionIssueJobAppService";
detailInput.CallJobNumber = injectionJob.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);
if (!await IsMinRowAsync(injectionIssueJob).ConfigureAwait(false))
{
var input = new TransferLibRequestEditInput();
input.CallBusinessType = nameof(IInjectionIssueJobAppService);
input.CallJobNumber = injectionIssueJob.Number;
input.CallRequestNumber = injectionIssueJob.InjectionRequestNumber;
input.CallServerName = "Win_in.Sfs.Wms.Store.Application.InjectionIssueJobAppService";
input.Type = "Transfer_Warehouse";
input.UseOnTheWayLocation = true;
var detailInput = new TransferLibRequestDetailInput();
detailInput.CallBusinessType = nameof(IInjectionIssueJobAppService);
detailInput.CallRequestNumber = injectionIssueJob.InjectionRequestNumber;
detailInput.CallServerName = "Win_in.Sfs.Wms.Store.Application.InjectionIssueJobAppService";
detailInput.CallJobNumber = injectionIssueJob.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 = detail.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 = detail.RecommendToPackingCode;
detailInput.RecommendToLot = detail.RecommendToLot;
detailInput.RecommendToArriveDate = detail.RecommendToArriveDate;
detailInput.RecommendToExpireDate = detail.RecommendToExpireDate;
detailInput.RecommendToProduceDate = detail.RecommendToProduceDate;
detailInput.RecommendToSupplierBatch = detail.RecommendToSupplierBatch;
detailInput.RecommendToLocationCode = locationDtoRowOne.Code;
detailInput.RecommendToLocationGroup = locationDtoRowOne.LocationGroupCode;
detailInput.RecommendToLocationArea = locationDtoRowOne.AreaCode;
detailInput.RecommendToLocationErpCode = locationDtoRowOne.ErpLocationCode;
detailInput.RecommendToWarehouseCode = locationDtoRowOne.WarehouseCode;
input.Details = new EditableList<TransferLibRequestDetailInput> { detailInput };
await _transferLibRequestAppService.CreateAsync(input).ConfigureAwait(false);
}
}
}
}
@ -193,26 +219,26 @@ public class InjectionIssueJobEventHandler :
/// <returns></returns>
private async Task<InjectionIssueNoteEditInput> BuildInjectionIssueNoteAsync(InjectionIssueJob entity)
{
var injectionNoteCreateInput = ObjectMapper.Map<InjectionIssueJob, InjectionIssueNoteEditInput>(entity);
injectionNoteCreateInput.JobNumber = entity.Number;
var injectionIssueNoteCreateInput = ObjectMapper.Map<InjectionIssueJob, InjectionIssueNoteEditInput>(entity);
injectionIssueNoteCreateInput.JobNumber = entity.Number;
await Task.CompletedTask.ConfigureAwait(false);
return injectionNoteCreateInput;
return injectionIssueNoteCreateInput;
}
/// <summary>
/// 判断是不是在最底层 如果不是则把状态变更为等待
/// </summary>
/// <param name="injectionJob"></param>
/// <param name="injectionIssueJob"></param>
/// <returns></returns>
private async Task<bool> IsMinRowAsync(InjectionIssueJob injectionJob)
private async Task<bool> IsMinRowAsync(InjectionIssueJob injectionIssueJob)
{
var detail = injectionJob.Details.FirstOrDefault();
var detail = injectionIssueJob.Details.FirstOrDefault();
var loctionDto = await _locationAppService.GetByCodeAsync(detail.RecommendFromLocationCode)
var locationDto = await _locationAppService.GetByCodeAsync(detail.RecommendFromLocationCode)
.ConfigureAwait(false);
if (loctionDto.RowCode == 1)
if (locationDto.Type == EnumLocationType.RAW && locationDto.RowCode == 1)
{
return true;
}

224
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/InjectionPlanJobEventHandler.cs

@ -0,0 +1,224 @@
using System.Collections.Generic;
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;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Event.BusinessJob;
public class InjectionPlanJobEventHandler :
StoreEventHandlerBase
, ILocalEventHandler<SfsCompletedEntityEventData<InjectionPlanJob>>
, ILocalEventHandler<SfsCreatedEntityEventData<InjectionPlanJob>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<InjectionPlanJob>>>
{
private readonly IInjectionPlanNoteAppService _injectionNoteAppService;
private readonly IExpectOutAppService _expectOutAppService;
private readonly ILocationAppService _locationAppService;
private readonly ITransferLibRequestAppService _transferLibRequestAppService;
public InjectionPlanJobEventHandler(IInjectionPlanNoteAppService injectionNoteAppService,
IExpectOutAppService expectOutAppService,
ILocationAppService locationAppService, ITransferLibRequestAppService transferLibRequestAppService)
{
_injectionNoteAppService = injectionNoteAppService;
_expectOutAppService = expectOutAppService;
_locationAppService = locationAppService;
_transferLibRequestAppService = transferLibRequestAppService;
}
/// <summary>
/// 执行后
/// </summary>
/// <param name="eventData"></param>
/// <returns></returns>
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsCompletedEntityEventData<InjectionPlanJob> eventData)
{
var entity = eventData.Entity;
var injectionNote = await BuildInjectionPlanNoteAsync(entity).ConfigureAwait(false);
await _injectionNoteAppService.CreateAsync(injectionNote).ConfigureAwait(false);
}
/// <summary>
/// 创建后
/// </summary>
/// <param name="eventData"></param>
/// <returns></returns>
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<InjectionPlanJob> 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<InjectionPlanJob>> 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(InjectionPlanJob 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(InjectionPlanJob injectionJob)
{
if (!await IsMinRowAsync(injectionJob).ConfigureAwait(false))
{
foreach (var detail in injectionJob.Details)
{
var input = new TransferLibRequestEditInput();
input.CallBusinessType = nameof(IInjectionPlanJobAppService);
input.CallJobNumber = injectionJob.Number;
input.CallRequestNumber = injectionJob.InjectionPlanRequestNumber;
input.CallServerName = "Win_in.Sfs.Wms.Store.Application.InjectionPlanJobAppService";
input.Type = "Transfer_Warehouse";
input.UseOnTheWayLocation = true;
var detailInput = new TransferLibRequestDetailInput();
detailInput.CallBusinessType = nameof(IInjectionPlanJobAppService);
detailInput.CallRequestNumber = injectionJob.InjectionPlanRequestNumber;
detailInput.CallServerName = "Win_in.Sfs.Wms.Store.Application.InjectionPlanJobAppService";
detailInput.CallJobNumber = injectionJob.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<InjectionPlanNoteEditInput> BuildInjectionPlanNoteAsync(InjectionPlanJob entity)
{
var injectionNoteCreateInput = ObjectMapper.Map<InjectionPlanJob, InjectionPlanNoteEditInput>(entity);
injectionNoteCreateInput.JobNumber = entity.Number;
await Task.CompletedTask.ConfigureAwait(false);
return injectionNoteCreateInput;
}
/// <summary>
/// 判断是不是在最底层 如果不是则把状态变更为等待
/// </summary>
/// <param name="injectionJob"></param>
/// <returns></returns>
private async Task<bool> IsMinRowAsync(InjectionPlanJob injectionJob)
{
var detail = injectionJob.Details.FirstOrDefault();
var loctionDto = await _locationAppService.GetByCodeAsync(detail.RecommendFromLocationCode)
.ConfigureAwait(false);
if (loctionDto.RowCode == 1)
{
return true;
}
return false;
}
#endregion
}

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save