62 changed files with 1960 additions and 7 deletions
@ -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, |
||||
|
} |
@ -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, |
||||
|
} |
@ -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))); |
||||
|
|
||||
|
} |
||||
|
} |
@ -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; } |
||||
|
|
||||
|
} |
@ -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; } |
||||
|
} |
@ -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); |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,6 @@ |
|||||
|
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
public class ContainerJobCheckInput : SfsJobCheckInputBase |
||||
|
{ |
||||
|
|
||||
|
} |
@ -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; } |
||||
|
|
||||
|
} |
@ -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
|
||||
|
} |
@ -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))); |
||||
|
|
||||
|
} |
||||
|
} |
@ -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; } |
||||
|
|
||||
|
} |
@ -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; } |
||||
|
|
||||
|
} |
@ -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); |
||||
|
|
||||
|
|
||||
|
} |
@ -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; } |
||||
|
|
||||
|
} |
@ -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
|
||||
|
} |
@ -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; } |
||||
|
} |
@ -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))); |
||||
|
|
||||
|
} |
||||
|
} |
@ -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; } |
||||
|
} |
@ -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(); |
||||
|
} |
@ -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> |
||||
|
|
||||
|
{ |
||||
|
} |
@ -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; } |
||||
|
} |
@ -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
|
||||
|
} |
@ -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; } |
||||
|
|
||||
|
} |
||||
|
|
@ -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); |
||||
|
} |
||||
|
|
||||
|
} |
@ -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); |
||||
|
|
||||
|
} |
||||
|
} |
@ -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; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -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); |
||||
|
; |
||||
|
} |
||||
|
} |
@ -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; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -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); |
||||
|
|
||||
|
} |
||||
|
} |
@ -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; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
|
||||
|
} |
@ -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); |
||||
|
} |
||||
|
|
||||
|
} |
@ -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; |
||||
|
} |
||||
|
} |
@ -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); |
||||
|
} |
||||
|
} |
@ -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); |
||||
|
} |
@ -0,0 +1,6 @@ |
|||||
|
namespace Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
public interface IContainerJobRepository : ISfsJobRepositoryBase<ContainerJob> |
||||
|
{ |
||||
|
|
||||
|
} |
@ -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($"当前状态为 【已确认】 ,无法再次确认!"); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
} |
@ -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(); |
||||
|
} |
@ -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; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
@ -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); |
||||
|
} |
@ -0,0 +1,5 @@ |
|||||
|
namespace Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
public interface IContainerNoteRepository : ISfsStoreRepositoryBase<ContainerNote> |
||||
|
{ |
||||
|
} |
@ -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(); |
||||
|
} |
@ -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(); |
||||
|
|
||||
|
} |
@ -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); |
||||
|
} |
||||
|
} |
@ -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> |
||||
|
{ |
||||
|
|
||||
|
} |
@ -0,0 +1,8 @@ |
|||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
public interface IContainerRequestRepository : ISfsStoreRepositoryBase<ContainerRequest>, ISfsBulkRepositoryBase<ContainerRequest> |
||||
|
{ |
||||
|
|
||||
|
} |
@ -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();
|
||||
|
}); |
||||
|
} |
||||
|
} |
@ -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) |
||||
|
{ |
||||
|
} |
||||
|
} |
@ -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(); |
||||
|
|
||||
|
}); |
||||
|
} |
||||
|
} |
@ -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) |
||||
|
{ |
||||
|
} |
||||
|
} |
@ -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(); |
||||
|
}); |
||||
|
} |
||||
|
} |
@ -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) |
||||
|
{ |
||||
|
} |
||||
|
} |
@ -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
|
||||
|
} |
@ -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…
Reference in new issue