Browse Source

Merge branch 'dev_DY_CC' of http://dev.ccwin-in.com:3000/BoXu.Zheng/WZC2 into dev_DY_CC

dev_DY_CC
赵新宇 1 year ago
parent
commit
e738533909
  1. 188
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ContainerJobController.cs
  2. 38
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/ContainerNoteController.cs
  3. 51
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/ContainerRequestController.cs
  4. 27
      be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/Types/EnumContainerSpecificationsType.cs
  5. 27
      be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/Types/EnumContainerType.cs
  6. 27
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ContainerJobs/ContainerJobPermissions.cs
  7. 43
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ContainerJobs/DTOs/ContainerJobDTO.cs
  8. 22
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ContainerJobs/DTOs/ContainerJobDetailDTO.cs
  9. 16
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ContainerJobs/IContainerJobAppService.cs
  10. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ContainerJobs/Inputs/ContainerJobCheckInput.cs
  11. 27
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ContainerJobs/Inputs/ContainerJobDetailInput.cs
  12. 70
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ContainerJobs/Inputs/ContainerJobEditInput.cs
  13. 27
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/ContainerNotePermissions.cs
  14. 50
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/DTOs/ContainerNoteDTO.cs
  15. 22
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/DTOs/ContainerNoteDetailDTO.cs
  16. 18
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/IContainerNoteAppService.cs
  17. 23
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/Inputs/ContainerNoteDetailInput.cs
  18. 56
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/Inputs/ContainerNoteEditInput.cs
  19. 35
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/Inputs/ContainerNoteImportInput.cs
  20. 3
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Permissions/StorePermissionDefinitionProvider.cs
  21. 27
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ContainerRequests/ContainerRequestPermissions.cs
  22. 30
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ContainerRequests/DTOs/ContainerRequestDTO.cs
  23. 23
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ContainerRequests/DTOs/ContainerRequestDetailDTO.cs
  24. 11
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ContainerRequests/IContainerRequestAppService.cs
  25. 19
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ContainerRequests/Inputs/ContainerRequestDetailInput.cs
  26. 36
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ContainerRequests/Inputs/ContainerRequestEditInput.cs
  27. 39
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ContainerRequests/Inputs/ContainerRequestImportInput.cs
  28. 65
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ContainerJobs/ContainerJobAppService.cs
  29. 30
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ContainerJobs/ContainerJobAutoMapperProfile.cs
  30. 75
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ContainerNotes/ContainerNoteAppService.cs
  31. 31
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ContainerNotes/ContainerNoteAutoMapperProfile.cs
  32. 68
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ContainerRequests/ContainerRequestAppService.cs
  33. 62
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ContainerRequests/ContainerRequestAutoMapperProfile.cs
  34. 3
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/StoreApplicationAutoMapperProfile.cs
  35. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Win_in.Sfs.Wms.Store.Application.csproj
  36. 39
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ContainerJobs/ContainerExtension.cs
  37. 78
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ContainerJobs/ContainerJob.cs
  38. 26
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ContainerJobs/ContainerJobDetail.cs
  39. 83
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ContainerJobs/ContainerJobManager.cs
  40. 10
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ContainerJobs/IContainerJobManager.cs
  41. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ContainerJobs/IContainerJobRepository.cs
  42. 75
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ContainerNotes/ContainerNote.cs
  43. 16
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ContainerNotes/ContainerNoteDetail.cs
  44. 50
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ContainerNotes/ContainerNoteManager.cs
  45. 9
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ContainerNotes/IContainerNoteManager.cs
  46. 5
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ContainerNotes/IContainerNoteRepository.cs
  47. 37
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ContainerRequests/ContainerRequest.cs
  48. 20
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ContainerRequests/ContainerRequestDetail.cs
  49. 50
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ContainerRequests/ContainerRequestManager.cs
  50. 8
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ContainerRequests/IContainerRequestManager.cs
  51. 8
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ContainerRequests/IContainerRequestRepository.cs
  52. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Win_in.Sfs.Wms.Store.Domain.csproj
  53. 3
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/IStoreDbContext.cs
  54. 56
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ContainerJobs/ContainerJobDbContextModelCreatingExtensions.cs
  55. 11
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ContainerJobs/ContainerJobEfCoreRepository.cs
  56. 56
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/ContainerNotes/ContainerNoteDbContextModelCreatingExtensions.cs
  57. 11
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/ContainerNotes/ContainerNoteEfCoreRepository.cs
  58. 53
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ContainerRequests/ContainerRequestDbContextModelCreatingExtensions.cs
  59. 11
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ContainerRequests/ContainerRequestEfCoreRepository.cs
  60. 3
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContext.cs
  61. 3
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreDbContextModelCreatingExtensions.cs
  62. 9
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreEntityFrameworkCoreModule.cs
  63. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Win_in.Sfs.Wms.Store.EntityFrameworkCore.csproj
  64. 73
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/ContainerJobEventHandler.cs
  65. 132
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ContainerRequestEventHandler.cs

188
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/ContainerJobController.cs

@ -0,0 +1,188 @@
using System;
using System.Collections.Generic;
using System.Text.Json;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc;
using Win_in.Sfs.Auth.Application.Contracts;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Application.Contracts;
namespace Win_in.Sfs.Wms.Pda.Controllers.Jobs;
/// <summary>
///
/// </summary>
[ApiController]
[Route($"{PdaHostConst.ROOT_ROUTE}job/container")]
public class ContainerJobController : AbpController
{
private readonly IContainerJobAppService _containerJobAppService;
private readonly IUserWorkGroupAppService _userWorkGroupAppService;
/// <summary>
///
/// </summary>
/// <param name="ContainerJobAppService"></param>
/// <param name="userWorkGroupAppService"></param>
public ContainerJobController(
IContainerJobAppService ContainerJobAppService
, IUserWorkGroupAppService userWorkGroupAppService)
{
_userWorkGroupAppService = userWorkGroupAppService;
_containerJobAppService = ContainerJobAppService;
}
/// <summary>
/// 获取任务详情
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpGet("{id}")]
public virtual async Task<ActionResult<ContainerJobDTO>> GetAsync(Guid id)
{
var result = await _containerJobAppService.GetAsync(id).ConfigureAwait(false);
return Ok(result);
}
/// <summary>
/// 获取列表 筛选
/// </summary>
/// <param name="sfsRequestDTO"></param>
/// <returns></returns>
[HttpPost("list")]
public virtual async Task<PagedResultDto<ContainerJobDTO>> GetListAsync(SfsJobRequestInputBase sfsRequestDTO)
{
var list = await _containerJobAppService.GetPagedListByFilterAsync(sfsRequestDTO, true).ConfigureAwait(false);
return list;
}
/// <summary>
/// 获取列表
/// </summary>
/// <param name="pageSize"></param>
/// <param name="pageIndex"></param>
/// <returns></returns>
[HttpGet("list")]
public virtual async Task<PagedResultDto<ContainerJobDTO>> GetListAsync(int pageSize, int pageIndex)
{
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
_ = JsonSerializer.Serialize(wlgCodes);
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase
{
MaxResultCount = pageSize,
SkipCount = (pageIndex - 1) * pageSize,
Sorting = $"{nameof(ContainerJobDTO.Priority)} ASC",
Condition = new Condition
{
Filters = new List<Filter>
{
// new(nameof(ContainerJobDTO.WorkGroupCode),jsonCodes,"In"),
new(nameof(ContainerJobDTO.JobStatus),jsonStatus,"In")
}
}
};
var list = await _containerJobAppService.GetPagedListByFilterAsync(request, true).ConfigureAwait(false);
return list;
}
/// <summary>
/// 根据Job Number 获取任务列表
/// </summary>
/// <param name="jobNumber"></param>
/// <returns></returns>
[HttpGet("by-number/{jobNumber}")]
public virtual async Task<ActionResult<ContainerJobDTO>> GetByNumberAsync(string jobNumber)
{
var jobDto = await _containerJobAppService.GetByNumberAsync(jobNumber).ConfigureAwait(false);
if (jobDto == null)
{
throw new UserFriendlyException($"未找到编号为 {jobNumber} 的任务");
}
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
if (!wlgCodes.Contains(jobDto.WorkGroupCode))
{
return new NotFoundObjectResult($"任务属于工作组 {jobDto.WorkGroupCode}");
}
if (jobDto.JobStatus == EnumJobStatus.Doing && jobDto.AcceptUserId != CurrentUser.Id)
{
return new NotFoundObjectResult($"任务正在被 {jobDto.AcceptUserName} 处理");
}
return jobDto;
}
/// <summary>
/// 获取任务数量
/// </summary>
/// <returns></returns>
[HttpGet("count")]
public virtual async Task<ActionResult<long>> CountAsync()
{
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes);
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsJobRequestInputBase
{
Sorting = $"{nameof(ContainerJobDTO.Priority)} ASC",
Condition = new Condition
{
Filters = new List<Filter>
{
new(nameof(ContainerJobDTO.WorkGroupCode),jsonCodes,"In"),
new(nameof(ContainerJobDTO.JobStatus),jsonStatus,"In")
}
}
};
var count = await _containerJobAppService.GetCountByFilterAsync(request).ConfigureAwait(false);
return Ok(count);
}
/// <summary>
/// 承接任务
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpPost("take/{id}")]
public virtual async Task TakeAsync(Guid id)
{
await _containerJobAppService.AcceptAsync(id).ConfigureAwait(false);
}
/// <summary>
/// 取消承接任务
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpPost("cancel-take/{id}")]
public virtual async Task CancelTakeAsync(Guid id)
{
await _containerJobAppService.CancelAcceptAsync(id).ConfigureAwait(false);
}
/// <summary>
/// 执行任务
/// </summary>
/// <param name="id"></param>
/// <param name="dto"></param>
/// <returns></returns>
[HttpPost("finish/{id}")]
public virtual async Task FinishAsync(Guid id, [FromBody] ContainerJobDTO dto)
{
await _containerJobAppService.CompleteAsync(id, dto).ConfigureAwait(false);
}
}

38
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/ContainerNoteController.cs

@ -0,0 +1,38 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc;
using Win_in.Sfs.Wms.Store.Application.Contracts;
namespace Win_in.Sfs.Wms.Pda.Controllers.Stores;
/// <summary>
///
/// </summary>
[ApiController]
[Route($"{PdaHostConst.ROOT_ROUTE}store/container")]
public class ContainerNoteController : AbpController
{
private readonly IContainerNoteAppService _containerNoteAppService;
/// <summary>
///
/// </summary>
/// <param name="containerNoteAppService"></param>
public ContainerNoteController(IContainerNoteAppService containerNoteAppService)
{
_containerNoteAppService = containerNoteAppService;
}
/// <summary>
/// 创建器具转移记录
/// </summary>
/// <param name="input">CreateInput</param>
/// <returns></returns>
[HttpPost("")]
public virtual async Task CreateAsync(ContainerNoteEditInput input)
{
await _containerNoteAppService.CreateAsync(input).ConfigureAwait(false);
}
}

51
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/ContainerRequestController.cs

@ -0,0 +1,51 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc;
using Win_in.Sfs.Wms.Store.Application.Contracts;
namespace Win_in.Sfs.Wms.Pda.Controllers.Stores;
/// <summary>
///空器具呼叫请求
/// </summary>
[ApiController]
[Route($"{PdaHostConst.ROOT_ROUTE}store/container-request")]
public class ContainerRequestController : AbpController
{
private readonly IContainerRequestAppService _containerRequestAppService;
/// <summary>
///
/// </summary>
/// <param name="ContainerRequestAppService"></param>
public ContainerRequestController(IContainerRequestAppService ContainerRequestAppService)
{
_containerRequestAppService = ContainerRequestAppService;
}
/// <summary>
/// 空器具申请
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("")]
public virtual async Task CreateAsync(ContainerRequestEditInput input)
{
_ = await _containerRequestAppService.CreateAsync(input).ConfigureAwait(false);
}
/// <summary>
/// 根据number获取空器具申请详情
/// </summary>
/// <param name="number"></param>
/// <returns></returns>
[HttpGet("{number}")]
public virtual async Task<ActionResult<ContainerRequestDTO>> GetAsync(string number)
{
var result = await _containerRequestAppService.GetByNumberAsync(number).ConfigureAwait(false);
return Ok(result);
}
}

27
be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/Types/EnumContainerSpecificationsType.cs

@ -0,0 +1,27 @@
using System.ComponentModel.DataAnnotations;
namespace Win_in.Sfs.Shared.Domain.Shared;
/// <summary>
/// 器具规格
/// </summary>
public enum EnumContainerSpecificationsType
{
/// <summary>
/// 空枚举
/// </summary>
[Display(Name = "空枚举")]
None = 0,
/// <summary>
/// 大器具
/// </summary>
[Display(Name = "大器具")]
BigContainer = 1,
/// <summary>
/// 小器具
/// </summary>
[Display(Name = "小器具")]
SmallContainer = 2,
}

27
be/Modules/Shared/src/Win_in.Sfs.Shared.Domain.Shared/Enums/Store/Types/EnumContainerType.cs

@ -0,0 +1,27 @@
using System.ComponentModel.DataAnnotations;
namespace Win_in.Sfs.Shared.Domain.Shared;
/// <summary>
/// 器具类型
/// </summary>
public enum EnumContainerType
{
/// <summary>
/// 空枚举
/// </summary>
[Display(Name = "空枚举")]
None = 0,
/// <summary>
/// 内物流
/// </summary>
[Display(Name = "内物流")]
InLogistics = 1,
/// <summary>
/// 外物流
/// </summary>
[Display(Name = "外物流")]
OutLogistics = 2,
}

27
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ContainerJobs/ContainerJobPermissions.cs

@ -0,0 +1,27 @@
using Volo.Abp.Authorization.Permissions;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public static class ContainerJobPermissions
{
public const string Default = StorePermissions.GroupName + "." + nameof(ContainerJob);
public const string Create = Default + "." + StorePermissions.CreateStr;
public const string Update = Default + "." + StorePermissions.UpdateStr;
public const string Delete = Default + "." + StorePermissions.DeleteStr;
//自动发料任务
public const string AutoContainerJob = StorePermissions.GroupName + "." + nameof(AutoContainerJob);
public static void AddContainerJobPermission(this PermissionGroupDefinition permissionGroup)
{
var ContainerJobPermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(ContainerJob)));
ContainerJobPermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr));
ContainerJobPermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr));
ContainerJobPermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr));
permissionGroup.AddPermission(AutoContainerJob, StorePermissionDefinitionProvider.L(nameof(AutoContainerJob)));
}
}

43
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ContainerJobs/DTOs/ContainerJobDTO.cs

@ -0,0 +1,43 @@
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Entities;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
/// <summary>
/// 器具呼叫任务
/// </summary>
[Display(Name = "器具呼叫任务")]
public class ContainerJobDTO : SfsJobDTOBase<ContainerJobDetailDTO>
{
/// <summary>
/// 器具呼叫号码
/// </summary>
[Display(Name = "器具呼叫号码")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ContainerRequestNumber { get; set; }
/// <summary>
/// 呼叫库位代码
/// </summary>
[Display(Name = "呼叫库位代码")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string RequestLocationCode { get; set; }
/// <summary>
/// 器具类型
/// </summary>
[Display(Name = "器具类型")]
[StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")]
public EnumContainerType ContainerType { get; set; }
/// <summary>
/// 器具规格
/// </summary>
[Display(Name = "器具规格")]
[StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")]
public EnumContainerSpecificationsType SpecificationsType { get; set; }
}

22
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ContainerJobs/DTOs/ContainerJobDetailDTO.cs

@ -0,0 +1,22 @@
using System;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Entities;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class ContainerJobDetailDTO : SfsJobRecommendFromDetailDTOBase
{
/// <summary>
/// 呼叫库位代码
/// </summary>
[Display(Name = "呼叫库位代码")]
public string ToLocationCode { get; set; }
/// <summary>
/// 来源库位代码
/// </summary>
[Display(Name = "来源库位代码")]
public string FromLocationCode { get; set; }
}

16
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ContainerJobs/IContainerJobAppService.cs

@ -0,0 +1,16 @@
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 IContainerJobAppService
: ISfsJobAppServiceBase<ContainerJobDTO, SfsJobRequestInputBase, ContainerJobCheckInput, ContainerJobEditInput>
{
Task<List<ContainerJobDTO>> GetByRequestNumberAsync(string requestNumber);
}

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ContainerJobs/Inputs/ContainerJobCheckInput.cs

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

27
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ContainerJobs/Inputs/ContainerJobDetailInput.cs

@ -0,0 +1,27 @@
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 ContainerJobDetailInput : SfsJobRecommendFromDetailInputBase
{
/// <summary>
/// 呼叫库位代码
/// </summary>
[Display(Name = "呼叫库位代码")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ToLocationCode { get; set; }
/// <summary>
/// 来源库位代码
/// </summary>
[Display(Name = "来源库位代码")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string FromLocationCode { get; set; }
}

70
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ContainerJobs/Inputs/ContainerJobEditInput.cs

@ -0,0 +1,70 @@
using System;
using System.Collections.Generic;
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 ContainerJobEditInput : SfsJobCreateUpdateInputBase, ISfsJobCreateInput<ContainerJobDetailInput>
{
#region Create
/// <summary>
/// 器具呼叫号码
/// </summary>
[Display(Name = "器具呼叫号码")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
[Required(ErrorMessage = "{0}是必填项")]
public string ContainerRequestNumber { get; set; }
/// <summary>
/// 呼叫库位代码
/// </summary>
[Display(Name = "呼叫库位代码")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string RequestLocationCode { get; set; }
/// <summary>
/// 器具类型
/// </summary>
[Display(Name = "器具类型")]
[StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")]
public EnumContainerType ContainerType { get; set; }
/// <summary>
/// 器具规格
/// </summary>
[Display(Name = "器具规格")]
[StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")]
public EnumContainerSpecificationsType SpecificationsType { get; set; }
/// <summary>
/// 上游任务编号
/// </summary>
[Display(Name = "上游任务编号")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string UpStreamJobNumber { 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 List<ContainerJobDetailInput> Details { get; set; } = new();
#endregion
}

27
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/ContainerNotePermissions.cs

@ -0,0 +1,27 @@
using Volo.Abp.Authorization.Permissions;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public static class ContainerNotePermissions
{
public const string Default = StorePermissions.GroupName + "." + nameof(ContainerNote);
public const string Create = Default + "." + StorePermissions.CreateStr;
public const string Update = Default + "." + StorePermissions.UpdateStr;
public const string Delete = Default + "." + StorePermissions.DeleteStr;
//器具呼叫记录
public const string ContainerNote = StorePermissions.GroupName + "." + nameof(ContainerNote);
public static void AddContainerNotePermission(this PermissionGroupDefinition permissionGroup)
{
var ContainerNotePermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(ContainerNote)));
ContainerNotePermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr));
ContainerNotePermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr));
ContainerNotePermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr));
permissionGroup.AddPermission(ContainerNote, StorePermissionDefinitionProvider.L(nameof(ContainerNote)));
}
}

50
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/DTOs/ContainerNoteDTO.cs

@ -0,0 +1,50 @@
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 ContainerNoteDTO : SfsStoreDTOBase<ContainerNoteDetailDTO>, IHasJobNumber
{
/// <summary>
/// 任务ID
/// </summary>
[Display(Name = "任务ID")]
public string JobNumber { get; set; }
/// <summary>
/// 呼叫库位代码
/// </summary>
[Display(Name = "呼叫库位代码")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string RequestLocationCode { get; set; }
/// <summary>
/// 器具类型
/// </summary>
[Display(Name = "器具类型")]
[StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")]
public EnumContainerType ContainerType { get; set; }
/// <summary>
/// 器具规格
/// </summary>
[Display(Name = "器具规格")]
[StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")]
public EnumContainerSpecificationsType SpecificationsType { get; set; }
/// <summary>
/// 已确认
/// </summary>
[Display(Name = "已确认")]
public bool Confirmed { get; set; }
/// <summary>
/// 确认时间
/// </summary>
[Display(Name = "确认时间")]
public DateTime? ConfirmTime { get; set; }
}

22
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/DTOs/ContainerNoteDetailDTO.cs

@ -0,0 +1,22 @@
using System;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class ContainerNoteDetailDTO : SfsStoreRecommendFromDetailWithFromToDTOBase
{
/// <summary>
/// 呼叫库位代码
/// </summary>
[Display(Name = "呼叫库位代码")]
public string ToLocationCode { get; set; }
/// <summary>
/// 来源库位代码
/// </summary>
[Display(Name = "来源库位代码")]
public string FromLocationCode { get; set; }
}

18
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/IContainerNoteAppService.cs

@ -0,0 +1,18 @@
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 IContainerNoteAppService : ISfsStoreMasterReadOnlyAppServiceBase<ContainerNoteDTO, SfsStoreRequestInputBase, ContainerNoteDetailDTO, SfsStoreRequestInputBase>
{
Task<ContainerNoteDTO> CreateAsync(ContainerNoteEditInput input);
Task<ContainerNoteDTO> ConfirmAsync(Guid id);
Task<ContainerNoteDTO> ConfirmAsync(string number);
}

23
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/Inputs/ContainerNoteDetailInput.cs

@ -0,0 +1,23 @@
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 ContainerNoteDetailInput : SfsStoreRecommendFromDetailWithFromToInputBase
{
/// <summary>
/// 呼叫库位代码
/// </summary>
[Display(Name = "呼叫库位代码")]
public string ToLocationCode { get; set; }
/// <summary>
/// 来源库位代码
/// </summary>
[Display(Name = "来源库位代码")]
public string FromLocationCode { get; set; }
}

56
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/Inputs/ContainerNoteEditInput.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;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class ContainerNoteEditInput : SfsStoreCreateOrUpdateInputBase
{
#region Base
/// <summary>
/// 已确认
/// </summary>
[Display(Name = "已确认")]
public bool Confirmed { get; set; }
#endregion
#region Create
/// <summary>
/// 任务ID
/// </summary>
[Display(Name = "任务ID")]
[Required(ErrorMessage = "{0}是必填项")]
public string JobNumber { get; set; }
/// <summary>
/// 呼叫库位代码
/// </summary>
[Display(Name = "呼叫库位代码")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string RequestLocationCode { get; set; }
/// <summary>
/// 器具类型
/// </summary>
[Display(Name = "器具类型")]
[StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")]
public EnumContainerType ContainerType { get; set; }
/// <summary>
/// 器具规格
/// </summary>
[Display(Name = "器具规格")]
[StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")]
public EnumContainerSpecificationsType SpecificationsType { get; set; }
/// <summary>
/// 明细列表
/// </summary>
[Display(Name = "明细列表")]
public List<ContainerNoteDetailInput> Details { get; set; }
#endregion
}

35
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Notes/ContainerNotes/Inputs/ContainerNoteImportInput.cs

@ -0,0 +1,35 @@
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Domain;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class ContainerNoteImportInput : SfsStoreImportInputBase, IHasJobNumber
{
/// <summary>
/// 任务ID
/// </summary>
[Display(Name = "任务ID")]
public string JobNumber { get; set; }
/// <summary>
/// 呼叫库位代码
/// </summary>
[Display(Name = "呼叫库位代码")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string RequestLocationCode { get; set; }
/// <summary>
/// 器具类型
/// </summary>
[Display(Name = "器具类型")]
[StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")]
public EnumContainerType ContainerType { get; set; }
/// <summary>
/// 器具规格
/// </summary>
[Display(Name = "器具规格")]
[StringLength(SfsEfCorePropertyConst.NameLength, ErrorMessage = "{0}最多输入{1}个字符")]
public EnumContainerSpecificationsType SpecificationsType { get; set; }
}

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

@ -26,7 +26,9 @@ public class StorePermissionDefinitionProvider : PermissionDefinitionProvider
storeGroup.AddPurchaseReturnNotePermission();
storeGroup.AddPutawayNotePermission();
storeGroup.AddMaterialRequestPermission();
storeGroup.AddContainerRequestPermission();
storeGroup.AddIssueNotePermission();
storeGroup.AddContainerNotePermission();
storeGroup.AddUnplannedReceiptNotePermission();
storeGroup.AddUnplannedIssueNotePermission();
storeGroup.AddIsolationNotePermission();
@ -88,6 +90,7 @@ public class StorePermissionDefinitionProvider : PermissionDefinitionProvider
storeGroup.AddInspectJobPermission();
storeGroup.AddPutawayJobPermission();
storeGroup.AddIssueJobPermission();
storeGroup.AddContainerJobPermission();
storeGroup.AddDeliverJobPermission();
storeGroup.AddPurchaseReturnJobPermission();
storeGroup.AddProductReceiveJobPermission();

27
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ContainerRequests/ContainerRequestPermissions.cs

@ -0,0 +1,27 @@
using Volo.Abp.Authorization.Permissions;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public static class ContainerRequestPermissions
{
public const string Default = StorePermissions.GroupName + "." + nameof(ContainerRequest);
public const string Create = Default + "." + StorePermissions.CreateStr;
public const string Update = Default + "." + StorePermissions.UpdateStr;
public const string Delete = Default + "." + StorePermissions.DeleteStr;
//器具呼叫申请
public const string AutoContainerRequest = StorePermissions.GroupName + "." + nameof(AutoContainerRequest);
public static void AddContainerRequestPermission(this PermissionGroupDefinition permissionGroup)
{
var ContainerRequestPermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(ContainerRequest)));
ContainerRequestPermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr));
ContainerRequestPermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr));
ContainerRequestPermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr));
permissionGroup.AddPermission(AutoContainerRequest, StorePermissionDefinitionProvider.L(nameof(AutoContainerRequest)));
}
}

30
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ContainerRequests/DTOs/ContainerRequestDTO.cs

@ -0,0 +1,30 @@
using System;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain.Entities;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
/// <summary>
/// 器具呼叫DTO
/// </summary>
public class ContainerRequestDTO : SfsStoreRequestDTOBase<ContainerRequestDetailDTO>
{
/// <summary>
/// 呼叫库位代码
/// </summary>
[Display(Name = "呼叫库位代码")]
public string RequestLocationCode { get; set; }
/// <summary>
/// 器具类型
/// </summary>
[Display(Name = "器具类型")]
public EnumContainerType ContainerType { get; set; }
/// <summary>
/// 器具规格
/// </summary>
[Display(Name = "器具规格")]
public EnumContainerSpecificationsType SpecificationsType { get; set; }
}

23
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ContainerRequests/DTOs/ContainerRequestDetailDTO.cs

@ -0,0 +1,23 @@
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Data;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
/// <summary>
/// 器具呼叫明细DTO
/// </summary>
public class ContainerRequestDetailDTO : SfsStoreDetailWithQtyDTOBase, IHasExtraProperties
{
/// <summary>
/// 呼叫库位
/// </summary>
[Display(Name = "呼叫库位")]
public string ToLocationCode { get; set; }
/// <summary>
/// 扩展属性
/// </summary>
[Display(Name = "扩展属性")]
public ExtraPropertyDictionary ExtraProperties { set; get; } = new ExtraPropertyDictionary();
}

11
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ContainerRequests/IContainerRequestAppService.cs

@ -0,0 +1,11 @@
using System.Threading.Tasks;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public interface IContainerRequestAppService
: ISfsStoreRequestMasterAppServiceBase
<ContainerRequestDTO, SfsStoreRequestInputBase, ContainerRequestEditInput, ContainerRequestDetailDTO, SfsStoreRequestInputBase>
{
}

19
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ContainerRequests/Inputs/ContainerRequestDetailInput.cs

@ -0,0 +1,19 @@
using System.ComponentModel.DataAnnotations;
using Volo.Abp.Data;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class ContainerRequestDetailInput : SfsStoreDetailWithQtyInputBase, IHasExtraProperties
{
/// <summary>
/// 呼叫库位
/// </summary>
[Display(Name = "呼叫库位")]
public string ToLocationCode { get; set; }
/// <summary>
/// 扩展属性
/// </summary>
[Display(Name = "扩展属性")]
public ExtraPropertyDictionary ExtraProperties { set; get; }
}

36
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ContainerRequests/Inputs/ContainerRequestEditInput.cs

@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
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;
/// <summary>
/// 新增和更新基础DTO
/// </summary>
public class ContainerRequestEditInput : SfsStoreRequestCreateOrUpdateInputBase
{
#region Base
[Display(Name = "呼叫库位代码")]
[Required(ErrorMessage = "{0}是必填项")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string RequestLocationCode { get; set; }
#endregion
#region Create
[Display(Name = "器具类型")]
[Required(ErrorMessage = "{0}是必填项")]
public EnumContainerType ContainerType { get; set; }
[Display(Name = "器具规格")]
[Required(ErrorMessage = "{0}是必填项")]
public EnumContainerSpecificationsType SpecificationsType { get; set; }
[Display(Name = "明细列表")]
public List<ContainerRequestDetailInput> Details { get; set; }
#endregion
}

39
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ContainerRequests/Inputs/ContainerRequestImportInput.cs

@ -0,0 +1,39 @@
using System;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class ContainerRequestImportInput : SfsStoreImportInputBase
{
/// <summary>
/// 呼叫库位代码
/// </summary>
[Display(Name = "呼叫库位代码")]
[Required(ErrorMessage = "{0}是必填项")]
[ImporterHeader(Name = "呼叫库位代码")]
[ExporterHeader(DisplayName = "呼叫库位代码")]
public string RequestLocationCode { get; set; }
/// <summary>
/// 器具类型
/// </summary>
[Display(Name = "器具类型")]
[Required(ErrorMessage = "{0}是必填项")]
[ImporterHeader(Name = "器具类型")]
[ExporterHeader(DisplayName = "器具类型")]
public EnumContainerType ContainerType { get; set; }
/// <summary>
/// 器具规格
/// </summary>
[Display(Name = "器具规格")]
[Required(ErrorMessage = "{0}是必填项")]
[ImporterHeader(Name = "器具规格")]
[ExporterHeader(DisplayName = "器具规格")]
public EnumContainerSpecificationsType SpecificationsType { get; set; }
}

65
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ContainerJobs/ContainerJobAppService.cs

@ -0,0 +1,65 @@
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.ObjectMapping;
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;
namespace Win_in.Sfs.Wms.Store.Application;
[Authorize]
[Route($"{StoreConsts.RootPath}container-job")]
public class ContainerJobAppService
: SfsJobAppServiceBase<ContainerJob, ContainerJobDetail, ContainerJobDTO, SfsJobRequestInputBase, ContainerJobCheckInput, ContainerJobEditInput>,
IContainerJobAppService
{
private readonly IContainerJobManager _ContainerJobManager;
public ContainerJobAppService(
IContainerJobRepository repository, IContainerJobManager ContainerJobManager
) : base(repository, ContainerJobManager)
{
_ContainerJobManager = ContainerJobManager;
}
/// <summary>
/// 根据库位 检查是否存在任务
/// </summary>
/// <param name="itemCode"></param>
/// <param name="locationCode"></param>
/// <returns></returns>
/// <exception cref="NotImplementedException"></exception>
[Authorize]
[HttpGet("check-job-exist")]
public virtual async Task<List<ContainerJobDTO>> CheckJobExistByItemCodeAndLocationCode(string itemCode,
string locationCode)
{
var entities = await _repository.GetListAsync(c =>
c.Details.Any(p =>
(p.ItemCode == itemCode && p.RecommendFromLocationCode == locationCode) ||
(p.ItemCode == itemCode && p.ToLocationCode == locationCode))
&& (c.JobStatus == EnumJobStatus.Open || c.JobStatus == EnumJobStatus.Doing), true).ConfigureAwait(false);
var dtos = ObjectMapper.Map<List<ContainerJob>, List<ContainerJobDTO>>(entities);
return dtos;
}
[HttpPost("by-request-number/{requestNumber}")]
public virtual async Task<List<ContainerJobDTO>> GetByRequestNumberAsync(string requestNumber)
{
var entitys = await _repository.GetListAsync(p => p.ContainerRequestNumber == requestNumber).ConfigureAwait(false);
return ObjectMapper.Map<List<ContainerJob>, List<ContainerJobDTO>>(entitys);
}
}

30
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/ContainerJobs/ContainerJobAutoMapperProfile.cs

@ -0,0 +1,30 @@
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 ContainerJobAutoMapperProfile()
{
CreateMap<ContainerJob, ContainerJobDTO>();
CreateMap<ContainerJobDTO, ContainerJob>();
CreateMap<ContainerJobDetail, ContainerJobDetailDTO>()
;
CreateMap<ContainerJobDetailDTO, ContainerJobDetail>()
;
CreateMap<ContainerJobDetailInput, ContainerJobDetail>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.MasterID)
.Ignore(x => x.TenantId)
.Ignore(x => x.Number)
.Ignore(x => x.Id);
}
}

75
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ContainerNotes/ContainerNoteAppService.cs

@ -0,0 +1,75 @@
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.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;
[Authorize]
[Route($"{StoreConsts.RootPath}container-note")]
public class ContainerNoteAppService :
SfsStoreWithDetailsAppServiceBase<ContainerNote, ContainerNoteDTO, SfsStoreRequestInputBase, ContainerNoteEditInput, ContainerNoteDetail,
ContainerNoteDetailDTO, SfsStoreRequestInputBase, ContainerNoteImportInput>,
IContainerNoteAppService
{
private readonly IContainerNoteManager _ContainerNoteManager;
public ContainerNoteAppService(
IContainerNoteRepository repository,
IContainerNoteManager ContainerNoteManager
) : base(repository)
{
_ContainerNoteManager = ContainerNoteManager;
}
[HttpPost("")]
//[Authorize(ContainerNotePermissions.Create)]
public override async Task<ContainerNoteDTO> CreateAsync(ContainerNoteEditInput input)
{
var entity = ObjectMapper.Map<ContainerNoteEditInput, ContainerNote>(input);
await _ContainerNoteManager.CreateAsync(entity).ConfigureAwait(false);
var dto = ObjectMapper.Map<ContainerNote, ContainerNoteDTO>(entity);
return dto;
}
/// <summary>
/// 确认对应的记录单
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpPost("confirm/{id}")]
public virtual async Task<ContainerNoteDTO> ConfirmAsync(Guid id)
{
var ContainerNote= await _repository.GetAsync(id).ConfigureAwait(false);
ContainerNote.Confirmed = true;
ContainerNote=await _repository.UpdateAsync(ContainerNote).ConfigureAwait(false);
await LocalEventBus.PublishAsync(new SfsConfirmedEntityEventData<ContainerNote>(ContainerNote), false).ConfigureAwait(false);
return ObjectMapper.Map<ContainerNote, ContainerNoteDTO>(ContainerNote);
}
[HttpPost("confirm-by-number/{number}")]
public virtual async Task<ContainerNoteDTO> ConfirmAsync(string number)
{
var entity = await _repository.FindAsync(p => p.Number == number).ConfigureAwait(false);
Check.NotNull(entity, nameof(ContainerNote));
var result = await _ContainerNoteManager.ConfirmAsync(entity.Id).ConfigureAwait(false);
var dto = ObjectMapper.Map<ContainerNote, ContainerNoteDTO>(result);
return dto;
}
}

31
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/ContainerNotes/ContainerNoteAutoMapperProfile.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 ContainerNoteAutoMapperProfile()
{
CreateMap<ContainerNote, ContainerNoteDTO>()
.ReverseMap();
CreateMap<ContainerNoteDetail, ContainerNoteDetailDTO>();
CreateMap<ContainerNoteDetailInput, ContainerNoteDetail>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.MasterID)
.Ignore(x => x.TenantId)
.Ignore(x => x.Number)
.Ignore(x => x.Id);
CreateMap<ContainerNoteEditInput, ContainerNote>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.TenantId)
.Ignore(x => x.Number)
.Ignore(x => x.Id);
;
}
}

68
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ContainerRequests/ContainerRequestAppService.cs

@ -0,0 +1,68 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Volo.Abp;
using Volo.Abp.Application.Dtos;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Application.Contracts;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Inventory.Application.Contracts;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Wms.Store.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Application;
[Authorize]
[Route($"{StoreConsts.RootPath}container-request")]
public class ContainerRequestAppService :
SfsStoreRequestAppServiceBase
<ContainerRequest, ContainerRequestDTO, SfsStoreRequestInputBase, ContainerRequestEditInput, ContainerRequestDetail, ContainerRequestDetailDTO, SfsStoreRequestInputBase, ContainerRequestImportInput>,
IContainerRequestAppService
{
private readonly IContainerRequestManager _containerRequestManager;
private readonly IAreaAppService _areaApp;
private readonly ICustomerAppService _customerApp;
private readonly ICustomerAddressAppService _customerAddressApp;
public ContainerRequestAppService(
IContainerRequestRepository repository
, IContainerRequestManager containerRequestManager
, IAreaAppService areaApp
, ICustomerAppService customerApp
, ICustomerAddressAppService customerAddressApp)
: base(repository, containerRequestManager)
{
_containerRequestManager = containerRequestManager;
_areaApp = areaApp;
_customerApp = customerApp;
_customerAddressApp = customerAddressApp;
}
/// <summary>
/// 【创建】器具呼叫申请
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
[HttpPost("")]
public override async Task<ContainerRequestDTO> CreateAsync(ContainerRequestEditInput input)
{
var entity = ObjectMapper.Map<ContainerRequestEditInput, ContainerRequest>(input);
await _containerRequestManager.CreateAsync(entity).ConfigureAwait(false);
var dto = ObjectMapper.Map<ContainerRequest, ContainerRequestDTO>(entity);
return dto;
}
}

62
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ContainerRequests/ContainerRequestAutoMapperProfile.cs

@ -0,0 +1,62 @@
using AutoMapper;
using Volo.Abp.AutoMapper;
using Volo.Abp.Data;
using Win_in.Sfs.Wms.Store.Application.Contracts;
using Win_in.Sfs.Wms.Store.Domain;
namespace Win_in.Sfs.Wms.Store.Application;
using Win_in.Sfs.Shared.Domain.Shared;
public partial class StoreApplicationAutoMapperProfile : Profile
{
private void ContainerRequestAutoMapperProfile()
{
CreateMap<ContainerRequest, ContainerRequestDTO>()
.ReverseMap();
CreateMap<ContainerRequestDetail, ContainerRequestDetailDTO>()
.ReverseMap();
CreateMap<ContainerRequestEditInput, ContainerRequest>();
CreateMap<ContainerRequestDetailInput, ContainerRequestDetail>()
.IgnoreAuditedObjectProperties()
.Ignore(x => x.MasterID)
.Ignore(x => x.TenantId)
.Ignore(x => x.Number)
.Ignore(x => x.Id);
CreateMap<ContainerRequestImportInput, ContainerRequest>()
.Ignore(x => x.ActiveDate)
.Ignore(x => x.Details)
.Ignore(x => x.TenantId)
.Ignore(x => x.LastModificationTime)
.Ignore(x => x.LastModifierId)
.Ignore(x => x.CreationTime)
.Ignore(x => x.CreatorId)
.Ignore(x => x.ExtraProperties)
.Ignore(x => x.ConcurrencyStamp)
.Ignore(x => x.Number)
.Ignore(x => x.RequestStatus)
.Ignore(x => x.Remark);
CreateMap<ContainerRequestImportInput, ContainerRequestDetail>()
.Ignore(x => x.Number)
.Ignore(X => X.StdPackQty)
.Ignore(x => x.Uom)
.Ignore(x => x.ItemName).Ignore(x => x.ItemDesc1).Ignore(x => x.ItemDesc2)
.Ignore(x => x.Remark)
.Ignore(x => x.MasterID)
.Ignore(x => x.LastModificationTime)
.Ignore(x => x.LastModifierId)
.Ignore(x => x.CreationTime)
.Ignore(x => x.CreatorId)
.Ignore(x => x.TenantId)
.Ignore(x => x.Id)
.Ignore(x => x.ExtraProperties)
.Ignore(x => x.Remark);
}
}

3
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/StoreApplicationAutoMapperProfile.cs

@ -10,6 +10,7 @@ public partial class StoreApplicationAutoMapperProfile : Profile
PurchaseReceiptRequestAutoMapperProfile();
DeliverRequestAutoMapperProfile();
ContainerRequestAutoMapperProfile();
InspectRequestAutoMapperProfile();
ItemTransformRequestAutoMapperProfile();
MaterialRequestAutoMapperProfile();
@ -59,6 +60,7 @@ public partial class StoreApplicationAutoMapperProfile : Profile
InventoryTransferNoteMapperProfile();
IsolationNoteAutoMapperProfile();
IssueNoteAutoMapperProfile();
ContainerNoteAutoMapperProfile();
ItemTransformNoteAutoMapperProfile();
JisDeliverNoteAutoMapperProfile();
JisProductReceiptNoteAutoMapperProfile();
@ -90,6 +92,7 @@ public partial class StoreApplicationAutoMapperProfile : Profile
DeliverJobAutoMapperProfile();
InspectJobAutoMapperProfile();
IssueJobAutoMapperProfile();
ContainerJobAutoMapperProfile();
JisDeliverJobAutoMapperProfile();
ProductReceiveJobAutoMapperProfile();
ProductRecycleJobAutoMapperProfile();

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Win_in.Sfs.Wms.Store.Application.csproj

@ -29,9 +29,7 @@
</ItemGroup>
<ItemGroup>
<Folder Include="Notes" />
<Folder Include="Plans" />
<Folder Include="Requests" />
</ItemGroup>
<ItemGroup>

39
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ContainerJobs/ContainerExtension.cs

@ -0,0 +1,39 @@
using Volo.Abp.Timing;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Domain;
public static class ContainerExtension
{
public static ContainerJob Init(this ContainerJob job)
{
job.JobType = EnumJobType.IssueJob;
job.JobStatus = EnumJobStatus.Open;
return job;
}
public static ContainerJob SetWorkGroup(this ContainerJob job, string warehouseCode, string workGroupCode, string groupCode)
{
job.WorkGroupCode = workGroupCode;
job.WarehouseCode = warehouseCode;
return job;
}
public static ContainerJob SetWorker(this ContainerJob job, string worker)
{
job.Worker = worker;
return job;
}
public static ContainerJob SetPriority(this ContainerJob job, IClock clock)
{
job.Priority = PriorityHelper.GetPriority(clock);
job.PriorityIncrement = 1;
return job;
}
}

78
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ContainerJobs/ContainerJob.cs

@ -0,0 +1,78 @@
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;
namespace Win_in.Sfs.Wms.Store.Domain;
/// <summary>
/// 器具呼叫任务
/// </summary>
[Display(Name = "器具呼叫任务")]
public class ContainerJob : SfsJobAggregateRootBase<ContainerJobDetail>
{
/// <summary>
/// 器具呼叫号码
/// </summary>
[IgnoreUpdate]
public string ContainerRequestNumber { get; set; }
/// <summary>
/// 呼叫库位代码
/// </summary>
[IgnoreUpdate]
public string RequestLocationCode { get; set; }
/// <summary>
/// 器具类型
/// </summary>
[IgnoreUpdate]
public EnumContainerType ContainerType { get; set; }
/// <summary>
/// 器具规格
/// </summary>
[IgnoreUpdate]
public EnumContainerSpecificationsType SpecificationsType { get; set; }
/// <summary>
/// 任务明细
/// </summary>
[IgnoreUpdate]
public override List<ContainerJobDetail> Details { get; set; } = new List<ContainerJobDetail>();
/// <summary>
/// 设置任务明细的实际库位和实际数量
/// </summary>
/// <param name="id"></param>
/// <param name="handledLocationCode"></param>
/// <param name="handledLocationErpCode"></param>
/// <param name="handledWarehouseCode"></param>
/// <param name="handledQty"></param>
/// <param name="handledBatch"></param>
/// <param name="handledContainerCode"></param>
/// <param name="handledLot"></param>
/// <param name="handledPackingCode"></param>
/// <returns></returns>
public virtual async Task BuildDetail(Guid id, string handledLocationCode, string handledLocationErpCode,
string handledWarehouseCode, decimal handledQty, string handledSupplierBatch, DateTime handledArriveDate, DateTime handledProduceDate, DateTime handledExpireDate,
string handledContainerCode, string handledLot, string handledPackingCode)
{
var detail = GetDetail(id);
detail.HandledFromLocationCode = handledLocationCode;
detail.HandledFromLocationErpCode = handledLocationErpCode;
detail.HandledFromWarehouseCode = handledWarehouseCode;
detail.HandledQty = handledQty;
detail.HandledSupplierBatch = handledSupplierBatch;
detail.HandledArriveDate = handledArriveDate;
detail.HandledProduceDate = handledProduceDate;
detail.HandledExpireDate = handledExpireDate;
detail.HandledContainerCode = handledContainerCode;
detail.HandledLot = handledLot;
detail.HandledPackingCode = handledPackingCode;
await Task.CompletedTask.ConfigureAwait(false);
}
}

26
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ContainerJobs/ContainerJobDetail.cs

@ -0,0 +1,26 @@
using System;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Entities;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Domain;
public class ContainerJobDetail : SfsJobRecommendFromDetailEntityBase
{
/// <summary>
/// 呼叫库位代码
/// </summary>
[IgnoreUpdate]
public string ToLocationCode { get; set; }
/// <summary>
/// 来源库位代码
/// </summary>
[IgnoreUpdate]
public string FromLocationCode { get; set; }
public void SetId(Guid id)
{
this.Id = id;
}
}

83
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ContainerJobs/ContainerJobManager.cs

@ -0,0 +1,83 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
using Volo.Abp.Users;
using Volo.Abp.Validation;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Domain;
public class ContainerJobManager : SfsJobManagerBase<ContainerJob, ContainerJobDetail>, IContainerJobManager
{
public ContainerJobManager(
IContainerJobRepository repository
) : base(repository)
{
}
/// <summary>
/// 执行任务
/// </summary>
/// <param name="id"></param>
/// <param name="input"></param>
/// <param name="user"></param>
/// <returns></returns>
public override async Task<ContainerJob> CompleteAsync(ContainerJob input, ICurrentUser user)
{
var entity = await Repository.FindAsync(input.Id).ConfigureAwait(false);
foreach (var detail in input.Details)
{
//发料子任务 赋值实际转移
await entity.BuildDetail(detail.Id,
detail.HandledFromLocationCode,
detail.HandledFromLocationErpCode,
detail.HandledFromWarehouseCode,
detail.HandledQty,
detail.HandledSupplierBatch,
detail.HandledArriveDate,
detail.HandledProduceDate,
detail.HandledExpireDate,
detail.HandledContainerCode,
detail.HandledLot,
detail.HandledPackingCode).ConfigureAwait(false);
}
return await base.CompleteAsync(entity, user).ConfigureAwait(false);
}
public override void CheckDetails(ContainerJob entity, AbpValidationResult result)
{
var details = entity.Details;
foreach (var detail in details)
{
if (detail.HandledFromLocationCode == null)
{
result.Errors.Add(new ValidationResult($"{detail.HandledFromLocationCode} 不能为空"));
}
}
}
public override async Task<List<ContainerJob>> GetWorkingListByPackingAsync(string packingCode)
{
return await Repository.GetListAsync(c => c.Details.Any(p => p.RecommendPackingCode == packingCode) && c.JobStatus != EnumJobStatus.Closed && c.JobStatus != EnumJobStatus.Cancelled, true).ConfigureAwait(false);
}
public override async Task<List<ContainerJob>> GetWorkingListByContainerAsync(string containerCode)
{
return await Repository.GetListAsync(c => c.Details.Any(p => p.RecommendContainerCode == containerCode) && c.JobStatus != EnumJobStatus.Closed && c.JobStatus != EnumJobStatus.Cancelled, true).ConfigureAwait(false);
}
public async Task<ContainerJob> GetAsync(Expression<Func<ContainerJob, bool>> expression)
{
return await Repository.FindAsync(expression).ConfigureAwait(false);
}
}

10
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ContainerJobs/IContainerJobManager.cs

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

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ContainerJobs/IContainerJobRepository.cs

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

75
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ContainerNotes/ContainerNote.cs

@ -0,0 +1,75 @@
using System;
using System.Collections.Generic;
using DocumentFormat.OpenXml.Wordprocessing;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain.Entities;
using Win_in.Sfs.Shared.Domain.Shared;
using Volo.Abp;
namespace Win_in.Sfs.Wms.Store.Domain;
/// <summary>
/// 器具呼叫记录
/// </summary>
public class ContainerNote : SfsStoreAggregateRootBase<ContainerNoteDetail>, IHasJobNumber
{
/// <summary>
/// 任务ID
/// </summary>
[IgnoreUpdate]
public string JobNumber { get; set; }
/// <summary>
/// 呼叫库位代码
/// </summary>
[IgnoreUpdate]
public string RequestLocationCode { get; set; }
/// <summary>
/// 器具类型
/// </summary>
[IgnoreUpdate]
public EnumContainerType ContainerType { get; set; }
/// <summary>
/// 器具规格
/// </summary>
[IgnoreUpdate]
public EnumContainerSpecificationsType SpecificationsType { get; set; }
/// <summary>
/// 已确认
/// </summary>
[Display(Name = "已确认")]
public bool Confirmed { get; set; }
/// <summary>
/// 确认时间
/// </summary>
[Display(Name = "确认时间")]
public DateTime? ConfirmTime { get; set; }
/// <summary>
/// 任务明细
/// </summary>
[IgnoreUpdate]
public override List<ContainerNoteDetail> Details { get; set; } = new();
public void Confirm(DateTime confirmTime)
{
CheckStatus(Confirmed);
Confirmed = true;
ConfirmTime = confirmTime;
}
private static void CheckStatus(bool confirmed)
{
if (confirmed)
{
throw new UserFriendlyException($"当前状态为 【已确认】 ,无法再次确认!");
}
}
}

16
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ContainerNotes/ContainerNoteDetail.cs

@ -0,0 +1,16 @@
using Volo.Abp.Data;
namespace Win_in.Sfs.Wms.Store.Domain;
public class ContainerNoteDetail : SfsStoreRecommendFromDetailWithFromToEntityBase, IHasExtraProperties
{
/// <summary>
/// 呼叫库位
/// </summary>
public string ToLocationCode { get; set; }
/// <summary>
/// 扩展属性
/// </summary>
public ExtraPropertyDictionary ExtraProperties { get; set; } = new ExtraPropertyDictionary();
}

50
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ContainerNotes/ContainerNoteManager.cs

@ -0,0 +1,50 @@
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 ContainerNoteManager : SfsStoreManagerBase<ContainerNote, ContainerNoteDetail>, IContainerNoteManager
{
public ContainerNoteManager(
IContainerNoteRepository repository
) : base(repository)
{
}
public override async Task<ContainerNote> CreateAsync(ContainerNote ContainerNote)
{
ContainerNote = await base.CreateAsync(ContainerNote).ConfigureAwait(false);
return ContainerNote;
}
[UnitOfWork]
public virtual async Task<ContainerNote> 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(ContainerNote entity)
{
try
{
await LocalEventBus.PublishAsync(new SfsConfirmedEntityEventData<ContainerNote>(entity), false).ConfigureAwait(false);
}
catch (Exception ex)
{
Logger.LogDebug($"{nameof(ContainerNote)} Confirmed Event:{ex.Message}", null);
Console.WriteLine(ex.Source);
throw;
}
}
}

9
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ContainerNotes/IContainerNoteManager.cs

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

5
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Notes/ContainerNotes/IContainerNoteRepository.cs

@ -0,0 +1,5 @@
namespace Win_in.Sfs.Wms.Store.Domain;
public interface IContainerNoteRepository : ISfsStoreRepositoryBase<ContainerNote>
{
}

37
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ContainerRequests/ContainerRequest.cs

@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain.Entities;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Domain;
/// <summary>
/// 器具呼叫申请
/// </summary>
public class ContainerRequest : SfsStoreRequestAggregateRootBase<ContainerRequestDetail>
{
/// <summary>
/// 呼叫库位代码
/// </summary>
[IgnoreUpdate]
public string RequestLocationCode { get; set; }
/// <summary>
/// 器具类型
/// </summary>
[IgnoreUpdate]
public EnumContainerType ContainerType { get; set; }
/// <summary>
/// 器具规格
/// </summary>
[IgnoreUpdate]
public EnumContainerSpecificationsType SpecificationsType { get; set; }
/// <summary>
/// 任务明细
/// </summary>
[IgnoreUpdate]
public override List<ContainerRequestDetail> Details { get; set; } = new();
}

20
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ContainerRequests/ContainerRequestDetail.cs

@ -0,0 +1,20 @@
using Volo.Abp.Data;
namespace Win_in.Sfs.Wms.Store.Domain;
/// <summary>
/// 器具呼叫申请明细表
/// </summary>
public class ContainerRequestDetail : SfsStoreDetailWithQtyEntityBase, IHasExtraProperties
{
/// <summary>
/// 呼叫库位
/// </summary>
public string ToLocationCode { get; set; }
/// <summary>
/// 扩展属性
/// </summary>
public ExtraPropertyDictionary ExtraProperties { get; set; } = new ExtraPropertyDictionary();
}

50
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ContainerRequests/ContainerRequestManager.cs

@ -0,0 +1,50 @@
using System.Collections.Generic;
using System.Threading.Tasks;
using Volo.Abp.Uow;
using Win_in.Sfs.Shared.Domain.Shared;
namespace Win_in.Sfs.Wms.Store.Domain;
public class ContainerRequestManager : SfsStoreRequestManagerBase<ContainerRequest, ContainerRequestDetail>, IContainerRequestManager
{
public readonly IContainerRequestRepository _repository;
public ContainerRequestManager(
IContainerRequestRepository repository
)
: base(repository)
{
_repository = repository;
}
public override async Task<List<ContainerRequest>> CreateManyAsync(List<ContainerRequest> entities)
{
var results = new List<ContainerRequest>();
foreach (var entity in entities)
{
entity.SetIdAndNumberWithDetails(GuidGenerator, await GenerateNumberAsync(typeof(ContainerRequest).Name, entity.ActiveDate).ConfigureAwait(false));
ContainerRequest result;
if (entity.AutoSubmit)
{
result = await SubmitAsync(entity).ConfigureAwait(false);
}
else
{
result = await Repository.InsertAsync(entity).ConfigureAwait(false);
}
results.Add(result);
}
return entities;
}
/// <summary>
/// 执行导入
/// </summary>
public virtual async Task ImportDataAsync(List<ContainerRequest> mergeEntities, List<ContainerRequest> deleteEntities = null)
{
if (deleteEntities != null && deleteEntities.Count > 0)
{
await _repository.BulkDeleteAsync(deleteEntities).ConfigureAwait(false);
}
await CreateManyAsync(mergeEntities).ConfigureAwait(false);
}
}

8
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ContainerRequests/IContainerRequestManager.cs

@ -0,0 +1,8 @@
namespace Win_in.Sfs.Wms.Store.Domain;
using Win_in.Sfs.Shared.Domain;
public interface IContainerRequestManager : ISfsStoreRequestManager<ContainerRequest, ContainerRequestDetail>, IBulkImportService<ContainerRequest>
{
}

8
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ContainerRequests/IContainerRequestRepository.cs

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

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Win_in.Sfs.Wms.Store.Domain.csproj

@ -38,10 +38,8 @@
</ItemGroup>
<ItemGroup>
<Folder Include="Notes" />
<Folder Include="Orders" />
<Folder Include="Plans" />
<Folder Include="Requests" />
</ItemGroup>
<ItemGroup>

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

@ -18,6 +18,7 @@ public interface IStoreDbContext : IEfCoreDbContext
public DbSet<TransferRequest> TransferRequests { get; }
public DbSet<ProductReceiptRequest> ProductReceiptRequests { get; }
public DbSet<MaterialRequest> MaterialRequests { get; }
public DbSet<ContainerRequest> ContainerRequests { get; }
public DbSet<DeliverRequest> DeliverRequests { get; }
public DbSet<InspectRequest> InspectRequests { get; }
public DbSet<PutawayRequest> PutawayRequest { get; }
@ -68,6 +69,7 @@ public interface IStoreDbContext : IEfCoreDbContext
public DbSet<InventoryTransferNote> InventoryTransferNotes { get; }
public DbSet<WarehouseTransferNote> WarehouseTransferNotes { get; }
public DbSet<IssueNote> IssueNotes { get; }
public DbSet<ContainerNote> ContainerNotes { get; }
public DbSet<UnplannedReceiptNote> UnplannedReceiptNotes { get; }
public DbSet<UnplannedIssueNote> UnplannedIssueNotes { get; }
public DbSet<IsolationNote> IsolationNotes { get; }
@ -92,6 +94,7 @@ public interface IStoreDbContext : IEfCoreDbContext
public DbSet<InspectJob> InspectJobs { get; }
public DbSet<PutawayJob> PutawayJobs { get; }
public DbSet<IssueJob> IssueJobs { get; }
public DbSet<ContainerJob> ContainerJobs { get; }
public DbSet<DeliverJob> DeliverJobs { get; }
public DbSet<JisDeliverJob> JisDeliverJobs { get; }
public DbSet<PurchaseReturnJob> PurchaseReturnJobs { get; }

56
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ContainerJobs/ContainerJobDbContextModelCreatingExtensions.cs

@ -0,0 +1,56 @@
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 ContainerJobDbContextModelCreatingExtensions
{
public static void ConfigureContainerJob(this ModelBuilder builder, StoreModelBuilderConfigurationOptions options)
{
builder.Entity<ContainerJob>(b =>
{
//Configure table & schema name
b.ToTable(StoreDbProperties.JobDbTablePrefix + nameof(ContainerJob), options.Schema);
//Configure ABP properties
b.ConfigureByConvention();
//Configure Sfs base properties
b.ConfigureSfsBase();
//Configure Job base properties
b.ConfigureJob<ContainerJob, ContainerJobDetail>();
//Properties
b.Property(q => q.ContainerRequestNumber).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ContainerType).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.RequestLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.SpecificationsType).HasMaxLength(SfsPropertyConst.CodeLength);
//Relations
b.HasMany(q => q.Details).WithOne().HasForeignKey(d => d.MasterID).IsRequired();
//Indexes
b.HasIndex(q => new { q.Number }).IsUnique();
});
builder.Entity<ContainerJobDetail>(b =>
{
//Configure table & schema name
b.ToTable(StoreDbProperties.JobDbTablePrefix + nameof(ContainerJobDetail), options.Schema);
//Configure ABP properties
b.ConfigureByConvention();
//Configure Sfs base properties
b.ConfigureSfsBase();
//Configure Job base properties
b.ConfigureJobRecommendFromDetail();
//Properties
b.Property(q => q.ToLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.FromLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
//Relations
//None
//Indexes
//b.HasIndex(q => new { q.PackingCode }).IsUnique();
});
}
}

11
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ContainerJobs/ContainerJobEfCoreRepository.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 ContainerJobEfCoreRepository : SfsJobEfCoreRepositoryBase<StoreDbContext, ContainerJob>, IContainerJobRepository
{
public ContainerJobEfCoreRepository(IDbContextProvider<StoreDbContext> dbContextProvider) : base(dbContextProvider)
{
}
}

56
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/ContainerNotes/ContainerNoteDbContextModelCreatingExtensions.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 ContainerNoteDbContextModelCreatingExtensions
{
public static void ConfigureContainerNote(this ModelBuilder builder, StoreModelBuilderConfigurationOptions options)
{
builder.Entity<ContainerNote>(b =>
{
//Configure table & schema name
b.ToTable(options.TablePrefix + nameof(ContainerNote), options.Schema);
//Configure ABP properties
b.ConfigureByConvention();
//Configure Sfs base properties
b.ConfigureSfsStoreBase();
//Properties
b.Property(q => q.JobNumber).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ContainerType).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.RequestLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.SpecificationsType).HasMaxLength(SfsPropertyConst.CodeLength);
//Relations
b.HasMany(q => q.Details).WithOne().HasForeignKey(d => d.MasterID).IsRequired();
//Indexes
b.HasIndex(q => new { q.Number }).IsUnique();
});
builder.Entity<ContainerNoteDetail>(b =>
{
//Configure table & schema name
b.ToTable(options.TablePrefix + nameof(ContainerNoteDetail), 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).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.FromLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
//Relations
//Indexes
b.HasIndex(q => new { q.Number }).IsUnique();
});
}
}

11
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Notes/ContainerNotes/ContainerNoteEfCoreRepository.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 ContainerNoteEfCoreRepository : SfsStoreEfCoreRepositoryBase<StoreDbContext, ContainerNote>, IContainerNoteRepository
{
public ContainerNoteEfCoreRepository(IDbContextProvider<StoreDbContext> dbContextProvider) : base(dbContextProvider)
{
}
}

53
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ContainerRequests/ContainerRequestDbContextModelCreatingExtensions.cs

@ -0,0 +1,53 @@
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 ContainerRequestDbContextModelCreatingExtensions
{
public static void ConfigureContainerRequest(this ModelBuilder builder, StoreModelBuilderConfigurationOptions options)
{
builder.Entity<ContainerRequest>(b =>
{
//Configure table & schema name
b.ToTable(options.TablePrefix + nameof(ContainerRequest), options.Schema);
//Configure ABP properties
b.ConfigureByConvention();
//Configure Sfs base properties
b.ConfigureSfsStoreBase();
//Properties
b.Property(q => q.RequestLocationCode).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ContainerType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
b.Property(q => q.SpecificationsType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
b.Property(q => q.RequestStatus).IsRequired().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<DeliverRequestDetail>(b =>
{
//Configure table & schema name
b.ToTable(options.TablePrefix + nameof(ContainerRequestDetail), options.Schema);
//Configure ABP properties
b.ConfigureByConvention();
//Configure Sfs base properties
b.ConfigureSfsStoreBase();
//Configure Sfs store detail properties
b.ConfigureSfsStoreDetailBase();
//Properties
//Relations
//Indexes
b.HasIndex(q => new { q.Number }).IsUnique();
});
}
}

11
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ContainerRequests/ContainerRequestEfCoreRepository.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 ContainerRequestEfCoreRepository : SfsStoreEfCoreRepositoryBase<StoreDbContext, ContainerRequest>, IContainerRequestRepository
{
public ContainerRequestEfCoreRepository(IDbContextProvider<StoreDbContext> dbContextProvider) : base(dbContextProvider)
{
}
}

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

@ -18,6 +18,7 @@ public class StoreDbContext : AbpDbContext<StoreDbContext>, IStoreDbContext
public DbSet<TransferRequest> TransferRequests { get; set; }
public DbSet<ProductReceiptRequest> ProductReceiptRequests { get; set; }
public DbSet<MaterialRequest> MaterialRequests { get; set; }
public DbSet<ContainerRequest> ContainerRequests { get; set; }
public DbSet<DeliverRequest> DeliverRequests { get; set; }
public DbSet<InspectRequest> InspectRequests { get; set; }
public DbSet<PutawayRequest> PutawayRequest { get; set; }
@ -68,6 +69,7 @@ public class StoreDbContext : AbpDbContext<StoreDbContext>, IStoreDbContext
public DbSet<InventoryTransferNote> InventoryTransferNotes { get; set; }
public DbSet<WarehouseTransferNote> WarehouseTransferNotes { get; set; }
public DbSet<IssueNote> IssueNotes { get; set; }
public DbSet<ContainerNote> ContainerNotes { get; set; }
public DbSet<UnplannedReceiptNote> UnplannedReceiptNotes { get; set; }
public DbSet<UnplannedIssueNote> UnplannedIssueNotes { get; set; }
public DbSet<IsolationNote> IsolationNotes { get; set; }
@ -92,6 +94,7 @@ public class StoreDbContext : AbpDbContext<StoreDbContext>, IStoreDbContext
public DbSet<InspectJob> InspectJobs { get; set; }
public DbSet<PutawayJob> PutawayJobs { get; set; }
public DbSet<IssueJob> IssueJobs { get; set; }
public DbSet<ContainerJob> ContainerJobs { get; set; }
public DbSet<DeliverJob> DeliverJobs { get; set; }
public DbSet<JisDeliverJob> JisDeliverJobs { get; set; }
public DbSet<PurchaseReturnJob> PurchaseReturnJobs { get; set; }

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

@ -55,6 +55,7 @@ public static class StoreDbContextModelCreatingExtensions
builder.ConfigurePurchaseReceiptRequest(options);
builder.ConfigureMaterialRequest(options);
builder.ConfigureDeliverRequest(options);
builder.ConfigureContainerRequest(options);
builder.ConfigureInspectRequest(options);
builder.ConfigureUnplannedIssueRequest(options);
builder.ConfigureUnplannedReceiptRequest(options);
@ -86,6 +87,7 @@ public static class StoreDbContextModelCreatingExtensions
builder.ConfigureInventoryTransferNote(options);
builder.ConfigureWarehouseTransferNote(options);
builder.ConfigureIssueNote(options);
builder.ConfigureContainerNote(options);
builder.ConfigureUnplannedReceiptNote(options);
builder.ConfigureUnplannedIssueNote(options);
builder.ConfigureIsolationNote(options);
@ -111,6 +113,7 @@ public static class StoreDbContextModelCreatingExtensions
builder.ConfigureInspectJob(options);
builder.ConfigurePutawayJob(options);
builder.ConfigureIssueJob(options);
builder.ConfigureContainerJob(options);
builder.ConfigureDeliverJob(options);
builder.ConfigureJisDeliverJob(options);
builder.ConfigurePurchaseReturnJob(options);

9
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/StoreEntityFrameworkCoreModule.cs

@ -55,6 +55,7 @@ public class StoreEntityFrameworkCoreModule : AbpModule
context.Services.AddTransient<IPurchaseReceiptRequestRepository, PurchaseReceiptRequestEfCoreRepository>();
context.Services.AddTransient<IMaterialRequestRepository, MaterialRequestEfCoreRepository>();
context.Services.AddTransient<IDeliverRequestRepository, DeliverRequestEfCoreRepository>();
context.Services.AddTransient<IContainerRequestRepository, ContainerRequestEfCoreRepository>();
context.Services.AddTransient<IInspectRequestRepository, InspectRequestEfCoreRepository>();
context.Services.AddTransient<IProductionReturnRequestRepository, ProductionReturnRequestEfCoreRepository>();
context.Services.AddTransient<IUnplannedIssueRequestRepository, UnplannedIssueRequestEfCoreRepository>();
@ -87,6 +88,7 @@ public class StoreEntityFrameworkCoreModule : AbpModule
context.Services.AddTransient<IInventoryTransferNoteRepository, InventoryTransferNoteEfCoreRepository>();
context.Services.AddTransient<IWarehouseTransferNoteRepository, WarehouseTransferNoteEfCoreRepository>();
context.Services.AddTransient<IIssueNoteRepository, IssueNoteEfCoreRepository>();
context.Services.AddTransient<IContainerNoteRepository, ContainerNoteEfCoreRepository>();
context.Services.AddTransient<IUnplannedReceiptNoteRepository, UnplannedReceiptNoteEfCoreRepository>();
context.Services.AddTransient<IUnplannedIssueNoteRepository, UnplannedIssueNoteEfCoreRepository>();
context.Services.AddTransient<IIsolationNoteRepository, IsolationNoteEfCoreRepository>();
@ -112,6 +114,7 @@ public class StoreEntityFrameworkCoreModule : AbpModule
context.Services.AddTransient<IInspectJobRepository, InspectJobEfCoreRepository>();
context.Services.AddTransient<IPutawayJobRepository, PutawayJobEfCoreRepository>();
context.Services.AddTransient<IIssueJobRepository, IssueJobEfCoreRepository>();
context.Services.AddTransient<IContainerJobRepository, ContainerJobEfCoreRepository>();
context.Services.AddTransient<IDeliverJobRepository, DeliverJobEfCoreRepository>();
context.Services.AddTransient<IJisDeliverJobRepository, JisDeliverJobEfCoreRepository>();
context.Services.AddTransient<IPurchaseReturnJobRepository, PurchaseReturnJobEfCoreRepository>();
@ -171,6 +174,8 @@ public class StoreEntityFrameworkCoreModule : AbpModule
orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details));
options.Entity<MaterialRequest>(orderOptions =>
orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details));
options.Entity<ContainerRequest>(orderOptions =>
orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details));
options.Entity<PurchaseReceiptRequest>(orderOptions =>
orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details));
options.Entity<InspectRequest>(orderOptions =>
@ -217,6 +222,8 @@ public class StoreEntityFrameworkCoreModule : AbpModule
orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details));
options.Entity<IssueNote>(orderOptions =>
orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details));
options.Entity<ContainerNote>(orderOptions =>
orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details));
options.Entity<ScrapNote>(orderOptions =>
orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details));
options.Entity<IsolationNote>(orderOptions =>
@ -286,6 +293,8 @@ public class StoreEntityFrameworkCoreModule : AbpModule
orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details));
options.Entity<IssueJob>(orderOptions =>
orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details));
options.Entity<ContainerJob>(orderOptions =>
orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details));
options.Entity<PutawayJob>(orderOptions =>
orderOptions.DefaultWithDetailsFunc = query => query.Include(o => o.Details));
options.Entity<PurchaseReceiptJob>(orderOptions =>

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Win_in.Sfs.Wms.Store.EntityFrameworkCore.csproj

@ -39,10 +39,8 @@
<ItemGroup>
<Folder Include="Migrations\" />
<Folder Include="Notes" />
<Folder Include="Orders" />
<Folder Include="Plans" />
<Folder Include="Requests" />
</ItemGroup>
</Project>

73
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/ContainerJobEventHandler.cs

@ -0,0 +1,73 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp.EventBus;
using Volo.Abp.Uow;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
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.Event.BusinessJob;
public class ContainerJobEventHandler :
StoreEventHandlerBase
, ILocalEventHandler<SfsCompletedEntityEventData<ContainerJob>>
{
private readonly IContainerNoteAppService _ContainerNoteAppService;
private readonly ILocationAppService _locationAppService;
public ContainerJobEventHandler(IContainerNoteAppService ContainerNoteAppService, ILocationAppService locationAppService)
{
_ContainerNoteAppService = ContainerNoteAppService;
_locationAppService = locationAppService;
}
/// <summary>
/// 执行后
/// </summary>
/// <param name="eventData"></param>
/// <returns></returns>
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsCompletedEntityEventData<ContainerJob> eventData)
{
var entity = eventData.Entity;
var ContainerNote = await BuildContainerNoteAsync(entity).ConfigureAwait(false);
await _ContainerNoteAppService.CreateAsync(ContainerNote).ConfigureAwait(false);
}
#region 私有
/// <summary>
/// 创建记录实体
/// </summary>
/// <param name="entity"></param>
/// <returns></returns>
private async Task<ContainerNoteEditInput> BuildContainerNoteAsync(ContainerJob entity)
{
var ContainerNoteCreateInput = ObjectMapper.Map<ContainerJob, ContainerNoteEditInput>(entity);
ContainerNoteCreateInput.JobNumber = entity.Number;
var locationCodes = ContainerNoteCreateInput.Details.Select(p => p.ToLocationCode).Distinct().ToList();
var locations = await _locationAppService.GetByCodesAsync(locationCodes).ConfigureAwait(false);
ContainerNoteCreateInput.Details.RemoveAll(p => p.Qty == 0);
foreach (var detail in ContainerNoteCreateInput.Details)
{
var location = locations.First(p => p.Code == detail.ToLocationCode);
detail.ToLocationArea = location.AreaCode;
detail.ToLocationGroup = location.LocationGroupCode;
detail.ToLocationErpCode = location.ErpLocationCode;
detail.ToWarehouseCode = location.WarehouseCode;
}
return ContainerNoteCreateInput;
}
#endregion
}

132
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ContainerRequestEventHandler.cs

@ -0,0 +1,132 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Volo.Abp;
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.BusinessRequest;
public class ContainerRequestEventHandler
: StoreEventHandlerBase
, ILocalEventHandler<SfsHandledEntityEventData<ContainerRequest>>
, ILocalEventHandler<SfsAbortedEntityEventData<ContainerRequest>>
, ILocalEventHandler<SfsCreatedEntityEventData<ContainerRequest>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<ContainerRequest>>>
{
private readonly IContainerJobAppService _ContainerJobApp;
private readonly IContainerRequestManager _containerRequestManager;
public ContainerRequestEventHandler(
IContainerJobAppService ContainerJobApp
, IContainerRequestManager containerRequestManager)
{
_ContainerJobApp = ContainerJobApp;
_containerRequestManager = containerRequestManager;
}
/// <summary>
/// 创建后
/// </summary>
/// <param name="eventData">Event data</param>
[UnitOfWork]
public async Task HandleEventAsync(SfsCreatedEntityEventData<ContainerRequest> eventData)
{
var entity = eventData.Entity;
if (entity.AutoSubmit)
{
await _containerRequestManager.SubmitAsync(entity).ConfigureAwait(false);
}
}
/// <summary>
/// 批量创建后
/// </summary>
/// <param name="eventData">Event data</param>
[UnitOfWork]
public async Task HandleEventAsync(SfsCreatedEntityEventData<List<ContainerRequest>> eventData)
{
var entitys = eventData.Entity;
foreach (var entity in entitys)
{
if (entity.AutoSubmit)
{
await _containerRequestManager.SubmitAsync(entity).ConfigureAwait(false);
}
}
}
/// <summary>
/// 审批后
/// </summary>
/// <param name="eventData"></param>
/// <returns></returns>
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsAbortedEntityEventData<ContainerRequest> eventData)
{
var entity = eventData.Entity;
//东阳特殊逻辑
if (!entity.DirectCreateNote)
{
}
}
/// <summary>
/// 执行后
/// </summary>
/// <param name="eventData"></param>
/// <returns></returns>
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsHandledEntityEventData<ContainerRequest> eventData)
{
var entity = eventData.Entity;
//东阳特殊逻辑
if (entity.DirectCreateNote)
{
}
else
{
var ContainerJobCreateInputs = await BuildContainerJobsAsync(entity).ConfigureAwait(false);
await _ContainerJobApp.CreateManyAsync(ContainerJobCreateInputs).ConfigureAwait(false);
}
}
#region 私有
private async Task<List<ContainerJobEditInput>> BuildContainerJobsAsync(ContainerRequest request)
{
var createInput = ObjectMapper.Map<ContainerRequest, ContainerJobEditInput>(request);
createInput.Details = new List<ContainerJobDetailInput>();
return new List<ContainerJobEditInput> { createInput };
}
#endregion
}
Loading…
Cancel
Save