16 changed files with 272 additions and 15 deletions
@ -0,0 +1,20 @@ |
|||
using Volo.Abp.Authorization.Permissions; |
|||
using Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
public static class ProductRecyclePermissions |
|||
{ |
|||
public const string Default = StorePermissions.GroupName + "." + nameof(ProductRecycleJob); |
|||
public const string Create = Default + "." + StorePermissions.CreateStr; |
|||
public const string Update = Default + "." + StorePermissions.UpdateStr; |
|||
public const string Delete = Default + "." + StorePermissions.DeleteStr; |
|||
|
|||
public static void AddProductRecycleJobPermission(this PermissionGroupDefinition permissionGroup) |
|||
{ |
|||
var productRecycleJobPermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(ProductRecycleJob))); |
|||
productRecycleJobPermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr)); |
|||
productRecycleJobPermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr)); |
|||
productRecycleJobPermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr)); |
|||
} |
|||
} |
@ -0,0 +1,10 @@ |
|||
using System; |
|||
using System.Linq.Expressions; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
public interface IProductRecycleJobManager : IJobManager<ProductRecycleJob> |
|||
{ |
|||
Task<ProductRecycleJob> GetAsync(Expression<Func<ProductRecycleJob, bool>> expression); |
|||
} |
@ -0,0 +1,6 @@ |
|||
namespace Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
public interface IProductRecycleJobRepository : ISfsJobRepositoryBase<ProductRecycleJob> |
|||
{ |
|||
|
|||
} |
@ -0,0 +1,21 @@ |
|||
using Volo.Abp.Timing; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
public static class ProductRecycleExtension |
|||
{ |
|||
public static ProductRecycleJob SetWorkGroup(this ProductRecycleJob job, string warehouseCode, string workGroupCode) |
|||
{ |
|||
job.WorkGroupCode = workGroupCode; |
|||
job.WarehouseCode = warehouseCode; |
|||
return job; |
|||
} |
|||
|
|||
public static ProductRecycleJob SetPriority(this ProductRecycleJob job, IClock clock) |
|||
{ |
|||
job.Priority = PriorityHelper.GetPriority(clock); |
|||
job.PriorityIncrement = 1; |
|||
return job; |
|||
} |
|||
} |
@ -0,0 +1,66 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.Threading.Tasks; |
|||
using Win_in.Sfs.Shared.Domain.Entities; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
/// <summary>
|
|||
/// 产品退拆任务
|
|||
/// </summary>
|
|||
[Display(Name = "产品退拆任务")] |
|||
public class ProductRecycleJob : SfsJobAggregateRootBase<ProductRecycleJobDetail> |
|||
{ |
|||
/// <summary>
|
|||
/// 车间
|
|||
/// </summary>
|
|||
[Display(Name = "车间")] |
|||
public string Workshop { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 班次
|
|||
/// </summary>
|
|||
[Display(Name = "班次")] |
|||
public string Shift { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 明细列表
|
|||
/// </summary>
|
|||
[IgnoreUpdate] |
|||
public override List<ProductRecycleJobDetail> Details { get; set; } = new List<ProductRecycleJobDetail>(); |
|||
|
|||
/// <summary>
|
|||
/// 设置任务明细的实际库位和实际数量
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <param name="handledLocationCode"></param>
|
|||
/// <param name="handledLocationErpCode"></param>
|
|||
/// <param name="handledQty"></param>
|
|||
/// <param name="handledWarehouseCode"></param>
|
|||
/// <param name="handledBatch"></param>
|
|||
/// <param name="handledContainerCode"></param>
|
|||
/// <param name="handledLot"></param>
|
|||
/// <param name="handledPackingCode"></param>
|
|||
/// <param name="locationCode"></param>
|
|||
/// <param name="qty"></param>
|
|||
/// <returns></returns>
|
|||
public virtual async Task SetDetail(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.HandledToLocationCode = handledLocationCode; |
|||
detail.HandledToLocationErpCode = handledLocationErpCode; |
|||
detail.HandledToWarehouseCode = 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,88 @@ |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Volo.Abp.Data; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
public class ProductRecycleJobDetail : SfsJobRecommendToDetailEntityBase |
|||
{ |
|||
/// <summary>
|
|||
/// Bom版本
|
|||
/// </summary>
|
|||
public string BomVersion { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 库位代码
|
|||
/// </summary>
|
|||
public string LocationCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 库区
|
|||
/// </summary>
|
|||
public string LocationArea { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 库位组
|
|||
/// </summary>
|
|||
public string LocationGroup { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// ERP库位代码
|
|||
/// </summary>
|
|||
public string LocationErpCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 原料库位代码
|
|||
/// </summary>
|
|||
public string RawLocationCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 原料库区
|
|||
/// </summary>
|
|||
public string RawLocationArea { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 原料库位组
|
|||
/// </summary>
|
|||
public string RawLocationGroup { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 原料ERP库位
|
|||
/// </summary>
|
|||
public string RawLocationErpCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 原料仓库
|
|||
/// </summary>
|
|||
public string RawWarehouseCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 计量单位
|
|||
/// </summary>
|
|||
[Display(Name = "计量单位")] |
|||
[MaxLength(SfsPropertyConst.CodeLength)] |
|||
public string Uom { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 数量
|
|||
/// </summary>
|
|||
[Display(Name = "数量")] |
|||
[Column(TypeName = "decimal(18,6)")] |
|||
public decimal Qty { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 扩展属性
|
|||
/// </summary>
|
|||
public ExtraPropertyDictionary ExtraProperties { get; } = new ExtraPropertyDictionary(); |
|||
|
|||
/// <summary>
|
|||
/// 库存状态
|
|||
/// </summary>
|
|||
public EnumInventoryStatus Status { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 仓库代码
|
|||
/// </summary>
|
|||
public string WarehouseCode { get; set; } |
|||
} |
@ -0,0 +1,10 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Jobs.ProductRecycleJobs; |
|||
internal class ProductRecycleJobManager |
|||
{ |
|||
} |
Loading…
Reference in new issue