67 changed files with 17733 additions and 39657 deletions
@ -0,0 +1,187 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.AspNetCore.Mvc; |
|||
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.Stores; |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
[ApiController] |
|||
[Route($"{PdaHostConst.ROOT_ROUTE}store/transferlib-note")] |
|||
|
|||
public class TransferLibNoteController : AbpController |
|||
{ |
|||
private readonly ITransferLibNoteAppService _transferLibNoteAppService; |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="transferLibNoteAppService"></param>
|
|||
public TransferLibNoteController(ITransferLibNoteAppService transferLibNoteAppService) |
|||
{ |
|||
_transferLibNoteAppService = transferLibNoteAppService; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 获取盘点任务详情
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
[HttpGet("{id}")] |
|||
|
|||
public virtual async Task<ActionResult<TransferLibNoteDTO>> GetAsync(Guid id) |
|||
{ |
|||
var result = await _transferLibNoteAppService.GetAsync(id).ConfigureAwait(false); |
|||
return Ok(result); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 获取列表 筛选
|
|||
/// </summary>
|
|||
/// <param name="sfsRequestDTO"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("list")] |
|||
public virtual async Task<PagedResultDto<TransferLibNoteDTO>> GetListAsync(SfsStoreRequestInputBase sfsRequestDTO) |
|||
{ |
|||
var list = await _transferLibNoteAppService.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<TransferLibNoteDTO>> GetListAsync(int pageSize, int pageIndex) |
|||
{ |
|||
|
|||
var request = new SfsStoreRequestInputBase |
|||
{ |
|||
MaxResultCount = pageSize, |
|||
SkipCount = (pageIndex - 1) * pageSize, |
|||
Sorting = $"{nameof(TransferLibNoteDTO.Number)} ASC", |
|||
Condition = new Condition |
|||
{ |
|||
Filters = new List<Filter> |
|||
{ |
|||
new(nameof(TransferLibNoteDTO.Type),EnumTransSubType.Transfer_Area.ToString(),"=="), |
|||
new(nameof(TransferLibNoteDTO.Confirmed),"false","==") |
|||
} |
|||
} |
|||
}; |
|||
|
|||
var list = await _transferLibNoteAppService.GetPagedListByFilterAsync(request, true).ConfigureAwait(false); |
|||
return list; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 获取任务数量
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[HttpGet("count")] |
|||
public virtual async Task<ActionResult<long>> CountAsync() |
|||
{ |
|||
var request = new SfsStoreRequestInputBase |
|||
{ |
|||
Sorting = $"{nameof(TransferLibNoteDTO.Number)} ASC", |
|||
Condition = new Condition |
|||
{ |
|||
Filters = new List<Filter> |
|||
{ |
|||
new(nameof(TransferLibNoteDTO.Type),EnumTransSubType.Transfer_Area.ToString(),"=="), |
|||
new(nameof(TransferLibNoteDTO.Confirmed),"false","==") |
|||
} |
|||
} |
|||
}; |
|||
|
|||
var count = await _transferLibNoteAppService.GetCountByFilterAsync(request).ConfigureAwait(false); |
|||
|
|||
return Ok(count); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 根据number获取要料详情
|
|||
/// </summary>
|
|||
/// <param name="number"></param>
|
|||
/// <returns></returns>
|
|||
[HttpGet("{number}")] |
|||
|
|||
public virtual async Task<ActionResult<TransferLibNoteDTO>> GetAsync(string number) |
|||
{ |
|||
var result = await _transferLibNoteAppService.GetByNumberAsync(number).ConfigureAwait(false); |
|||
return Ok(result); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 完成对应的请求
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("complete/{id}")] |
|||
|
|||
public virtual async Task<TransferLibNoteDTO> CompleteAsync(Guid id) |
|||
{ |
|||
var entity = await _transferLibNoteAppService.ConfirmAsync(id).ConfigureAwait(false); |
|||
return entity; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 库存转移
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("")] |
|||
public virtual async Task<TransferLibNoteDTO> Create(TransferLibNoteEditInput input) |
|||
{ |
|||
return await _transferLibNoteAppService.CreateAsync(input).ConfigureAwait(false); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 拆箱
|
|||
/// </summary>
|
|||
/// <param name="transferLibNoteEditInput"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("split-packing")] |
|||
public async Task<TransferLibNoteDTO> SplitPackingAsync(TransferLibNoteEditInput transferLibNoteEditInput) |
|||
{ |
|||
return await _transferLibNoteAppService.SplitPackingAsync(transferLibNoteEditInput).ConfigureAwait(false); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 采购收货拆箱,同时更新、插入PurchaseReceipt任务表、申请表
|
|||
/// </summary>
|
|||
/// <param name="transferLibNoteEditInput"></param>
|
|||
/// <param name="updateJobDetailInput"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("split-packing-purchase-receipt")] |
|||
public async Task<bool> SplitPacking_PurchaseReceiptAsync(TransferLibNoteEditInput transferLibNoteEditInput, [FromQuery] SplitPacking_UpdateJobDetailInput updateJobDetailInput) |
|||
{ |
|||
var ret = await _transferLibNoteAppService.SplitPacking_PurchaseReceiptAsync(transferLibNoteEditInput, updateJobDetailInput).ConfigureAwait(false); |
|||
return ret; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 发料拆箱,同时更新、插入Inspect任务表(没有找到申请表//??)
|
|||
/// </summary>
|
|||
/// <param name="transferLibNoteEditInput"></param>
|
|||
/// <param name="updateJobDetailInput"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("split-packing-issue")] |
|||
public async Task<TransferLibNoteDTO> SplitPacking_IssueAsync(TransferLibNoteEditInput transferLibNoteEditInput, [FromQuery] SplitPacking_UpdateJobDetailInput updateJobDetailInput) |
|||
{ |
|||
var ret = await _transferLibNoteAppService.SplitPacking_IssueAsync(transferLibNoteEditInput, updateJobDetailInput).ConfigureAwait(false); |
|||
return ret; |
|||
} |
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,136 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.AspNetCore.Mvc; |
|||
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.Stores; |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
[ApiController] |
|||
[Route($"{PdaHostConst.ROOT_ROUTE}store/transferlib-request")] |
|||
|
|||
public class TransferLibRequestController : AbpController |
|||
{ |
|||
private readonly ITransferLibRequestAppService _transferLibRequestAppService; |
|||
|
|||
/// <summary>
|
|||
///
|
|||
/// </summary>
|
|||
/// <param name="transferLibRequestAppService"></param>
|
|||
public TransferLibRequestController(ITransferLibRequestAppService transferLibRequestAppService) |
|||
{ |
|||
_transferLibRequestAppService = transferLibRequestAppService; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 获取盘点任务详情
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
[HttpGet("{id}")] |
|||
|
|||
public virtual async Task<ActionResult<TransferLibRequestDTO>> GetAsync(Guid id) |
|||
{ |
|||
var result = await _transferLibRequestAppService.GetAsync(id).ConfigureAwait(false); |
|||
return Ok(result); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 获取列表 筛选
|
|||
/// </summary>
|
|||
/// <param name="sfsRequestDTO"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("list")] |
|||
public virtual async Task<PagedResultDto<TransferLibRequestDTO>> GetListAsync(SfsStoreRequestInputBase sfsRequestDTO) |
|||
{ |
|||
var list = await _transferLibRequestAppService.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<TransferLibRequestDTO>> GetListAsync(int pageSize, int pageIndex) |
|||
{ |
|||
|
|||
var request = new SfsStoreRequestInputBase |
|||
{ |
|||
MaxResultCount = pageSize, |
|||
SkipCount = (pageIndex - 1) * pageSize, |
|||
Sorting = $"{nameof(TransferLibRequestDTO.Number)} ASC", |
|||
Condition = new Condition |
|||
{ |
|||
Filters = new List<Filter> |
|||
{ |
|||
new(nameof(TransferLibRequestDTO.Type),EnumTransSubType.Transfer_Area.ToString(),"=="), |
|||
new(nameof(TransferLibRequestDTO.RequestStatus),EnumRequestStatus.New.ToString(),"==") |
|||
} |
|||
} |
|||
}; |
|||
|
|||
var list = await _transferLibRequestAppService.GetPagedListByFilterAsync(request, true).ConfigureAwait(false); |
|||
return list; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 获取任务数量
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[HttpGet("count")] |
|||
public virtual async Task<ActionResult<long>> CountAsync() |
|||
{ |
|||
var request = new SfsStoreRequestInputBase |
|||
{ |
|||
Sorting = $"{nameof(TransferLibRequestDTO.Number)} ASC", |
|||
Condition = new Condition |
|||
{ |
|||
Filters = new List<Filter> |
|||
{ |
|||
new(nameof(TransferLibRequestDTO.Type),EnumTransSubType.Transfer_Area.ToString(),"=="), |
|||
new(nameof(TransferLibRequestDTO.RequestStatus),EnumRequestStatus.New.ToString(),"==") |
|||
} |
|||
} |
|||
}; |
|||
|
|||
var count = await _transferLibRequestAppService.GetCountByFilterAsync(request).ConfigureAwait(false); |
|||
|
|||
return Ok(count); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 根据number获取要料详情
|
|||
/// </summary>
|
|||
/// <param name="number"></param>
|
|||
/// <returns></returns>
|
|||
[HttpGet("{number}")] |
|||
|
|||
public virtual async Task<ActionResult<TransferLibRequestDTO>> GetAsync(string number) |
|||
{ |
|||
var result = await _transferLibRequestAppService.GetByNumberAsync(number).ConfigureAwait(false); |
|||
return Ok(result); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 完成对应的请求
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("complete/{id}")] |
|||
|
|||
public virtual async Task<TransferLibRequestDTO> CompleteAsync(Guid id) |
|||
{ |
|||
var entity = await _transferLibRequestAppService.CompleteAsync(id).ConfigureAwait(false); |
|||
return entity; |
|||
} |
|||
} |
@ -0,0 +1,50 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
/// <summary>
|
|||
/// 非生产领料任务
|
|||
/// </summary>
|
|||
[Display(Name = "非生产领料任务")] |
|||
public class TransferLibJobDTO : SfsJobDTOBase<TransferLibJobDetailDTO>, IHasNumber |
|||
{ |
|||
/// <summary>
|
|||
/// 调拨申请单号
|
|||
/// </summary>
|
|||
[Display(Name = "调拨申请单号")] |
|||
public string RequestNumber { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 任务ID
|
|||
/// </summary>
|
|||
[Display(Name = "任务ID")] |
|||
public string JobNumber { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 调拨类型
|
|||
/// </summary>
|
|||
[Display(Name = "调拨类型")] |
|||
public string Type { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 使用中间库
|
|||
/// </summary>
|
|||
[Display(Name = "使用中间库")] |
|||
public bool UseOnTheWayLocation { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 已确认
|
|||
/// </summary>
|
|||
[Display(Name = "已确认")] |
|||
public bool Confirmed { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 确认时间
|
|||
/// </summary>
|
|||
[Display(Name = "确认时间")] |
|||
public DateTime? ConfirmTime { get; set; } |
|||
|
|||
} |
@ -0,0 +1,25 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
public class TransferLibJobDetailDTO : SfsStoreDetailWithFromToDTOBase |
|||
{ |
|||
/// <summary>
|
|||
/// 在途库地址
|
|||
/// </summary>
|
|||
[Display(Name = "在途库地址")] |
|||
public string OnTheWayLocationCode { get; set; } |
|||
/// <summary>
|
|||
/// 原因
|
|||
/// </summary>
|
|||
[Display(Name = "原因")] |
|||
public string Reason { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 执行任务状态
|
|||
/// </summary>
|
|||
public EnumJobStatus JobStatus { get; set; } |
|||
|
|||
} |
@ -0,0 +1,7 @@ |
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
public interface ITransferLibJobAppService |
|||
: ISfsJobAppServiceBase<TransferLibJobDTO, SfsJobRequestInputBase, TransferLibJobCheckInput, TransferLibJobEditInput> |
|||
{ |
|||
|
|||
} |
@ -0,0 +1,6 @@ |
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
public class TransferLibJobCheckInput : SfsJobCheckInputBase |
|||
{ |
|||
|
|||
} |
@ -0,0 +1,29 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Volo.Abp.Data; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
public class TransferLibJobDetailInput : SfsStoreDetailWithFromToInputBase |
|||
{ |
|||
/// <summary>
|
|||
/// 在途库地址
|
|||
/// </summary>
|
|||
[Display(Name = "在途库地址")] |
|||
public string OnTheWayLocationCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 原因
|
|||
/// </summary>
|
|||
[Display(Name = "原因")] |
|||
[StringLength(SfsEfCorePropertyConst.RemarkLength, ErrorMessage = "{0}最多输入{1}个字符")] |
|||
public string Reason { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 执行任务状态
|
|||
/// </summary>
|
|||
public EnumJobStatus JobStatus { get; set; } |
|||
|
|||
} |
@ -0,0 +1,62 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
public class TransferLibJobEditInput : SfsJobCreateUpdateInputBase, ISfsJobCreateInput<TransferLibJobDetailInput> |
|||
{ |
|||
#region Base
|
|||
/// <summary>
|
|||
/// 已确认
|
|||
/// </summary>
|
|||
[Display(Name = "已确认")] |
|||
public bool Confirmed { get; set; } |
|||
#endregion
|
|||
|
|||
#region Update
|
|||
/// <summary>
|
|||
/// 确认时间
|
|||
/// </summary>
|
|||
[Display(Name = "确认时间")] |
|||
public DateTime? ConfirmTime { get; set; } |
|||
#endregion
|
|||
|
|||
/// <summary>
|
|||
/// 调拨申请单号
|
|||
/// </summary>
|
|||
[Display(Name = "调拨申请单号")] |
|||
public string RequestNumber { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 任务ID
|
|||
/// </summary>
|
|||
[Display(Name = "任务ID")] |
|||
public string JobNumber { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 调拨类型
|
|||
/// </summary>
|
|||
[Display(Name = "调拨类型")] |
|||
public string Type { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 使用中间库
|
|||
/// </summary>
|
|||
[Display(Name = "使用中间库")] |
|||
public bool UseOnTheWayLocation { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 任务明细
|
|||
/// </summary>
|
|||
[Display(Name = "任务明细")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public List<TransferLibJobDetailInput> Details { get; set; } |
|||
public string UpStreamJobNumber { get; set; } |
|||
public EnumJobType JobType { get; set; } |
|||
public bool IsAutoComplete { get; set; } |
|||
} |
@ -0,0 +1,21 @@ |
|||
using Volo.Abp.Authorization.Permissions; |
|||
using Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
public static class TransferLibJobPermissions |
|||
{ |
|||
|
|||
public const string Default = StorePermissions.GroupName + "." + nameof(TransferLibJob); |
|||
public const string Create = Default + "." + StorePermissions.CreateStr; |
|||
public const string Update = Default + "." + StorePermissions.UpdateStr; |
|||
public const string Delete = Default + "." + StorePermissions.DeleteStr; |
|||
|
|||
public static void AddTransferLibJobPermission(this PermissionGroupDefinition permissionGroup) |
|||
{ |
|||
var IssueJobPermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(TransferLibJob))); |
|||
IssueJobPermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr)); |
|||
IssueJobPermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr)); |
|||
IssueJobPermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr)); |
|||
} |
|||
} |
@ -0,0 +1,47 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
/// <summary>
|
|||
/// 库存转移记录-实体DTO
|
|||
/// </summary>
|
|||
public class TransferLibNoteDTO : SfsStoreDTOBase<TransferLibNoteDetailDTO>, IHasNumber |
|||
{ |
|||
/// <summary>
|
|||
/// 调拨申请单号
|
|||
/// </summary>
|
|||
[Display(Name = "调拨申请单号")] |
|||
public string RequestNumber { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 任务ID
|
|||
/// </summary>
|
|||
[Display(Name = "任务ID")] |
|||
public string JobNumber { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 调拨类型
|
|||
/// </summary>
|
|||
[Display(Name = "调拨类型")] |
|||
public string Type { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 使用中间库
|
|||
/// </summary>
|
|||
[Display(Name = "使用中间库")] |
|||
public bool UseOnTheWayLocation { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 已确认
|
|||
/// </summary>
|
|||
[Display(Name = "已确认")] |
|||
public bool Confirmed { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 确认时间
|
|||
/// </summary>
|
|||
[Display(Name = "确认时间")] |
|||
public DateTime? ConfirmTime { get; set; } |
|||
|
|||
} |
@ -0,0 +1,28 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
/// <summary>
|
|||
/// 库存转移记录-明细表
|
|||
/// </summary>
|
|||
public class TransferLibNoteDetailDTO : SfsStoreDetailWithFromToDTOBase |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 在途库地址
|
|||
/// </summary>
|
|||
[Display(Name = "在途库地址")] |
|||
public string OnTheWayLocationCode { get; set; } |
|||
/// <summary>
|
|||
/// 原因
|
|||
/// </summary>
|
|||
[Display(Name = "原因")] |
|||
public string Reason { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 执行任务状态
|
|||
/// </summary>
|
|||
public EnumJobStatus JobStatus { get; set; } |
|||
|
|||
} |
@ -0,0 +1,90 @@ |
|||
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 ITransferLibNoteAppService : |
|||
ISfsStoreMasterReadOnlyAppServiceBase<TransferLibNoteDTO, SfsStoreRequestInputBase, TransferLibNoteDetailDTO, SfsStoreRequestInputBase> |
|||
{ |
|||
Task<TransferLibNoteDTO> CreateAsync(TransferLibNoteEditInput input); |
|||
|
|||
Task<PagedResultDto<TransferLibNoteDTO>> GetWipTransferListAsync(SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false, |
|||
CancellationToken cancellationToken = default); |
|||
|
|||
Task<PagedResultDto<TransferLibNoteDTO>> GetAreaTransferListAsync(SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false, |
|||
CancellationToken cancellationToken = default); |
|||
|
|||
Task<PagedResultDto<TransferLibNoteDTO>> GetCustomerTransferListAsync(SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false, |
|||
CancellationToken cancellationToken = default); |
|||
|
|||
Task<PagedResultDto<TransferLibNoteDTO>> GetListForDiffERPLocAsync( |
|||
SfsStoreRequestInputBase sfsRequestDTO, |
|||
bool includeDetails = false, |
|||
CancellationToken cancellationToken = default); |
|||
|
|||
Task<PagedResultDto<TransferLibNoteDTO>> GetInsideTransferListAsync( |
|||
SfsStoreRequestInputBase sfsRequestDTO, |
|||
bool includeDetails = false, |
|||
CancellationToken cancellationToken = default); |
|||
|
|||
Task<TransferLibNoteDTO> ConfirmAsync(Guid id); |
|||
|
|||
/// <summary>
|
|||
/// 库存转移
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
Task<List<TransferLibNoteDTO>> CreateManyAsync(List<TransferLibNoteEditInput> input); |
|||
|
|||
/// <summary>
|
|||
/// 拆箱
|
|||
/// </summary>
|
|||
/// <param name="transferLibNoteEditInput"></param>
|
|||
/// <returns></returns>
|
|||
Task<TransferLibNoteDTO> SplitPackingAsync(TransferLibNoteEditInput transferLibNoteEditInput); |
|||
|
|||
/// <summary>
|
|||
/// 按条件获取拆箱的分页列表
|
|||
/// request sample
|
|||
/// {
|
|||
/// "maxResultCount": 1000,
|
|||
/// "skipCount": 0,
|
|||
/// "sorting": "",
|
|||
/// "condition": { "filters": []}
|
|||
/// }
|
|||
/// </summary>
|
|||
/// <param name="sfsRequestDTO"></param>
|
|||
/// <param name="includeDetails"></param>
|
|||
/// <param name="cancellationToken"></param>
|
|||
/// <returns></returns>
|
|||
Task<PagedResultDto<TransferLibNoteDTO>> GetSplitPackingTransferListAsync( |
|||
SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false, |
|||
CancellationToken cancellationToken = default); |
|||
|
|||
/// <summary>
|
|||
/// 采购收货拆箱,同时更新、插入PurchaseReceipt任务表、申请表
|
|||
/// </summary>
|
|||
/// <param name="transferLibNoteEditInput"></param>
|
|||
/// <param name="updateJobDetailInput"></param>
|
|||
/// <returns></returns>
|
|||
Task<bool> SplitPacking_PurchaseReceiptAsync(TransferLibNoteEditInput transferLibNoteEditInput, SplitPacking_UpdateJobDetailInput updateJobDetailInput); |
|||
|
|||
/// <summary>
|
|||
/// 质检拆箱,同时更新、插入Inspect任务表(不更新申请表)
|
|||
/// </summary>
|
|||
/// <param name="transferLibNoteEditInput"></param>
|
|||
/// <param name="updateJobDetailInput"></param>
|
|||
/// <returns></returns>
|
|||
Task<TransferLibNoteDTO> SplitPacking_InspectAsync(TransferLibNoteEditInput transferLibNoteEditInput, SplitPacking_UpdateJobDetailInput updateJobDetailInput); |
|||
|
|||
/// <summary>
|
|||
/// 发料拆箱,同时更新、插入Inspect任务表(没有找到申请表//??)
|
|||
/// </summary>
|
|||
/// <param name="transferLibNoteEditInput"></param>
|
|||
/// <param name="updateJobDetailInput"></param>
|
|||
/// <returns></returns>
|
|||
Task<TransferLibNoteDTO> SplitPacking_IssueAsync(TransferLibNoteEditInput transferLibNoteEditInput, SplitPacking_UpdateJobDetailInput updateJobDetailInput); |
|||
} |
@ -0,0 +1,32 @@ |
|||
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>
|
|||
/// 库存转移记录-明细表
|
|||
/// </summary>
|
|||
public class TransferLibNoteDetailInput : SfsStoreDetailWithFromToInputBase |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 在途库地址
|
|||
/// </summary>
|
|||
[Display(Name = "在途库地址")] |
|||
public string OnTheWayLocationCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 原因
|
|||
/// </summary>
|
|||
[Display(Name = "原因")] |
|||
[StringLength(SfsEfCorePropertyConst.RemarkLength, ErrorMessage = "{0}最多输入{1}个字符")] |
|||
public string Reason { get; set; } |
|||
/// <summary>
|
|||
/// 执行任务状态
|
|||
/// </summary>
|
|||
public EnumJobStatus JobStatus { get; set; } |
|||
|
|||
|
|||
|
|||
} |
@ -0,0 +1,55 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
/// <summary>
|
|||
/// 新增和更新基础DTO
|
|||
/// </summary>
|
|||
public class TransferLibNoteEditInput : SfsStoreCreateOrUpdateInputBase, IHasNumber |
|||
{ |
|||
#region Base
|
|||
/// <summary>
|
|||
/// 已确认
|
|||
/// </summary>
|
|||
[Display(Name = "已确认")] |
|||
public bool Confirmed { get; set; } |
|||
#endregion
|
|||
|
|||
#region Update
|
|||
/// <summary>
|
|||
/// 确认时间
|
|||
/// </summary>
|
|||
[Display(Name = "确认时间")] |
|||
public DateTime? ConfirmTime { get; set; } |
|||
#endregion
|
|||
|
|||
/// <summary>
|
|||
/// 调拨申请单号
|
|||
/// </summary>
|
|||
[Display(Name = "调拨申请单号")] |
|||
public string RequestNumber { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 任务ID
|
|||
/// </summary>
|
|||
[Display(Name = "任务ID")] |
|||
public string JobNumber { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 调拨类型
|
|||
/// </summary>
|
|||
[Display(Name = "调拨类型")] |
|||
public string Type { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 使用中间库
|
|||
/// </summary>
|
|||
[Display(Name = "使用中间库")] |
|||
public bool UseOnTheWayLocation { get; set; } |
|||
|
|||
[Display(Name = "详情")] |
|||
public List<TransferLibNoteDetailInput> Details { get; set; } = new List<TransferLibNoteDetailInput>(); |
|||
public string Number { get; set; } |
|||
} |
@ -0,0 +1,85 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using DocumentFormat.OpenXml.Drawing; |
|||
using Win_in.Sfs.Shared.Application.Contracts; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
public class TransferLibNoteImportInput : SfsStoreImportInputBase |
|||
{ |
|||
/// <summary>
|
|||
/// 调拨类型
|
|||
/// </summary>
|
|||
[Display(Name = "调拨类型")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
[ImporterHeader(Name = "调拨类型")] |
|||
[ExporterHeader(DisplayName = "调拨类型")] |
|||
[ValueMapping("区域内调拨(储位内移库)", EnumTransSubType.Transfer_Inside)] |
|||
public string Type { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 使用中间库
|
|||
/// </summary>
|
|||
[Display(Name = "使用中间库")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public bool UseOnTheWayLocation { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 在途库地址
|
|||
/// </summary>
|
|||
[Display(Name = "在途库地址")] |
|||
[ImporterHeader(IsIgnore = true)] |
|||
public string OnTheWayLocationCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 已确认
|
|||
/// </summary>
|
|||
[Display(Name = "已确认")] |
|||
[ImporterHeader(IsIgnore = true)] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public bool Confirmed { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 物料号
|
|||
/// </summary>
|
|||
[Display(Name = "物料号")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string ItemCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 调拨数量
|
|||
/// </summary>
|
|||
[Display(Name = "调拨数量")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public decimal Qty { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 调出库位
|
|||
/// </summary>
|
|||
[Display(Name = "调出库位")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string FromLocationCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 调入库位
|
|||
/// </summary>
|
|||
[Display(Name = "调入库位")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string ToLocationCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 箱码
|
|||
/// </summary>
|
|||
[Display(Name = "箱码")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string PackingCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 状态
|
|||
/// </summary>
|
|||
[Display(Name = "状态")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public EnumInventoryStatus Status { get; set; } |
|||
|
|||
} |
@ -0,0 +1,41 @@ |
|||
using Volo.Abp.Authorization.Permissions; |
|||
using Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
public static class TransferLibNotePermissions |
|||
{ |
|||
public const string Default = StorePermissions.GroupName + "." + nameof(TransferLibNote); |
|||
public const string Create = Default + "." + StorePermissions.CreateStr; |
|||
public const string Update = Default + "." + StorePermissions.UpdateStr; |
|||
public const string Delete = Default + "." + StorePermissions.DeleteStr; |
|||
|
|||
//线边调拨记录
|
|||
public const string WipTransferLibNote = StorePermissions.GroupName + "." + nameof(WipTransferLibNote); |
|||
//线边调拨记录确认
|
|||
public const string WipTransferLibNoteConfirm = StorePermissions.GroupName + "." + nameof(WipTransferLibNoteConfirm); |
|||
//客户调拨记录
|
|||
public const string CustomerTransferLibNote = StorePermissions.GroupName + "." + nameof(CustomerTransferLibNote); |
|||
//客户调拨记录确认
|
|||
public const string CustomerTransferLibNoteConfirm = StorePermissions.GroupName + "." + nameof(CustomerTransferLibNoteConfirm); |
|||
//库区间调拨记录
|
|||
public const string BetweenAreaTransferLibNote = StorePermissions.GroupName + "." + nameof(BetweenAreaTransferLibNote); |
|||
//库区内调拨记录
|
|||
public const string WithinAreaTransferLibNote = StorePermissions.GroupName + "." + nameof(WithinAreaTransferLibNote); |
|||
|
|||
public static void AddTransferLibNotePermission(this PermissionGroupDefinition permissionGroup) |
|||
{ |
|||
var transferLibNotePermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(TransferLibNote))); |
|||
transferLibNotePermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr)); |
|||
transferLibNotePermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr)); |
|||
transferLibNotePermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr)); |
|||
|
|||
permissionGroup.AddPermission(WipTransferLibNote, StorePermissionDefinitionProvider.L(nameof(WipTransferLibNote))); |
|||
permissionGroup.AddPermission(WipTransferLibNoteConfirm, StorePermissionDefinitionProvider.L(nameof(WipTransferLibNoteConfirm))); |
|||
permissionGroup.AddPermission(CustomerTransferLibNote, StorePermissionDefinitionProvider.L(nameof(CustomerTransferLibNote))); |
|||
permissionGroup.AddPermission(CustomerTransferLibNoteConfirm, StorePermissionDefinitionProvider.L(nameof(CustomerTransferLibNoteConfirm))); |
|||
permissionGroup.AddPermission(BetweenAreaTransferLibNote, StorePermissionDefinitionProvider.L(nameof(BetweenAreaTransferLibNote))); |
|||
permissionGroup.AddPermission(WithinAreaTransferLibNote, StorePermissionDefinitionProvider.L(nameof(WithinAreaTransferLibNote))); |
|||
|
|||
} |
|||
} |
@ -0,0 +1,23 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
/// <summary>
|
|||
/// 库存转移记录-实体DTO
|
|||
/// </summary>
|
|||
public class TransferLibRequestDTO : SfsStoreRequestDTOBase<TransferLibRequestDetailDTO>, IHasNumber |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 调拨类型
|
|||
/// </summary>
|
|||
[Display(Name = "调拨类型")] |
|||
public string Type { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 使用中间库
|
|||
/// </summary>
|
|||
[Display(Name = "使用中间库")] |
|||
public bool UseOnTheWayLocation { get; set; } |
|||
|
|||
} |
@ -0,0 +1,23 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
/// <summary>
|
|||
/// 库存转移记录-明细表
|
|||
/// </summary>
|
|||
public class TransferLibRequestDetailDTO : SfsStoreDetailWithFromToDTOBase |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 原因
|
|||
/// </summary>
|
|||
[Display(Name = "原因")] |
|||
public string Reason { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 执行任务状态
|
|||
/// </summary>
|
|||
public EnumJobStatus JobStatus { get; set; } |
|||
|
|||
} |
@ -0,0 +1,20 @@ |
|||
using System.Threading; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
public interface ITransferLibRequestAppService |
|||
: ISfsStoreRequestMasterAppServiceBase<TransferLibRequestDTO, SfsStoreRequestInputBase, TransferLibRequestEditInput, TransferLibRequestDetailDTO, SfsStoreRequestInputBase> |
|||
{ |
|||
|
|||
Task<PagedResultDto<TransferLibRequestDTO>> GetListForWipAsync(SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false, |
|||
CancellationToken cancellationToken = default); |
|||
|
|||
Task<PagedResultDto<TransferLibRequestDTO>> GetListForERPLocAsync(SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false, |
|||
CancellationToken cancellationToken = default); |
|||
|
|||
Task<PagedResultDto<TransferLibRequestDTO>> GetListForCustomAsync(SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false, |
|||
CancellationToken cancellationToken = default); |
|||
|
|||
} |
@ -0,0 +1,25 @@ |
|||
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>
|
|||
/// 库存转移记录-明细表
|
|||
/// </summary>
|
|||
public class TransferLibRequestDetailInput : SfsStoreDetailWithFromToInputBase |
|||
{ |
|||
/// <summary>
|
|||
/// 原因
|
|||
/// </summary>
|
|||
[Display(Name = "原因")] |
|||
[StringLength(SfsEfCorePropertyConst.RemarkLength, ErrorMessage = "{0}最多输入{1}个字符")] |
|||
public string Reason { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 执行任务状态
|
|||
/// </summary>
|
|||
public EnumJobStatus JobStatus { get; set; } |
|||
|
|||
|
|||
} |
@ -0,0 +1,40 @@ |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
/// <summary>
|
|||
/// 新增和更新基础DTO
|
|||
/// </summary>
|
|||
public class TransferLibRequestEditInput : SfsStoreRequestCreateOrUpdateInputBase |
|||
{ |
|||
#region Base
|
|||
/// <summary>
|
|||
/// 调拨类型
|
|||
/// </summary>
|
|||
[Display(Name = "调拨类型")] |
|||
public string Type { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 使用中间库
|
|||
/// </summary>
|
|||
[Display(Name = "使用中间库")] |
|||
public bool UseOnTheWayLocation { get; set; } |
|||
#endregion
|
|||
|
|||
#region Create
|
|||
/// <summary>
|
|||
/// 转移记录单号
|
|||
/// </summary>
|
|||
[Display(Name = "转移记录单号")] |
|||
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] |
|||
public string Number { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 明细列表
|
|||
/// </summary>
|
|||
[Display(Name = "明细列表")] |
|||
public List<TransferLibRequestDetailInput> Details { get; set; } |
|||
#endregion
|
|||
} |
@ -0,0 +1,75 @@ |
|||
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 TransferLibRequestImportInput : SfsStoreImportInputBase |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 调拨类型
|
|||
/// </summary>
|
|||
[Display(Name = "调拨类型")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
[ImporterHeader(Name = "调拨类型")] |
|||
[ExporterHeader(DisplayName = "调拨类型")] |
|||
[ValueMapping("区域间调拨(储位调拨)", EnumTransSubType.Transfer_Area)] |
|||
[ValueMapping("线边调拨(线边仓调拨)", EnumTransSubType.Transfer_WIP)] |
|||
[ValueMapping("客户库位调拨(客户储位调拨)", EnumTransSubType.Transfer_Customer)] |
|||
public string Type { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 使用中间库
|
|||
/// </summary>
|
|||
[Display(Name = "使用中间库")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public bool UseOnTheWayLocation { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 在途库地址
|
|||
/// </summary>
|
|||
[Display(Name = "在途库地址")] |
|||
public string OnTheWayLocationCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 物料号
|
|||
/// </summary>
|
|||
[Display(Name = "物料号")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string ItemCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 调拨数量
|
|||
/// </summary>
|
|||
[Display(Name = "调拨数量")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public decimal Qty { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 调出库位
|
|||
/// </summary>
|
|||
[Display(Name = "调出库位")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string FromLocationCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 调入库位
|
|||
/// </summary>
|
|||
[Display(Name = "调入库位")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public string ToLocationCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 箱码
|
|||
/// </summary>
|
|||
[Display(Name = "箱码")] |
|||
public string PackingCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 状态
|
|||
/// </summary>
|
|||
[Display(Name = "状态")] |
|||
[Required(ErrorMessage = "{0}是必填项")] |
|||
public EnumInventoryStatus Status { get; set; } |
|||
} |
@ -0,0 +1,29 @@ |
|||
using Volo.Abp.Authorization.Permissions; |
|||
using Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
|
|||
public static class TransferLibRequestPermissions |
|||
{ |
|||
public const string Default = StorePermissions.GroupName + "." + nameof(TransferLibRequest); |
|||
public const string Create = Default + "." + StorePermissions.CreateStr; |
|||
public const string Update = Default + "." + StorePermissions.UpdateStr; |
|||
public const string Delete = Default + "." + StorePermissions.DeleteStr; |
|||
|
|||
//线边调拨记录
|
|||
public const string WipTransferLibRequest = StorePermissions.GroupName + "." + nameof(WipTransferLibRequest); |
|||
//客户调拨记录
|
|||
public const string CustomerTransferLibRequest = StorePermissions.GroupName + "." + nameof(CustomerTransferLibRequest); |
|||
|
|||
public static void AddTransferLibRequestPermission(this PermissionGroupDefinition permissionGroup) |
|||
{ |
|||
var transferLibRequestPermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(TransferLibRequest))); |
|||
transferLibRequestPermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr)); |
|||
transferLibRequestPermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr)); |
|||
transferLibRequestPermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr)); |
|||
|
|||
permissionGroup.AddPermission(WipTransferLibRequest, StorePermissionDefinitionProvider.L(nameof(WipTransferLibRequest))); |
|||
permissionGroup.AddPermission(CustomerTransferLibRequest, StorePermissionDefinitionProvider.L(nameof(CustomerTransferLibRequest))); |
|||
|
|||
} |
|||
} |
@ -0,0 +1,21 @@ |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
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}transfer-lib-job")] |
|||
|
|||
public class TransferLibJobAppService |
|||
: SfsJobAppServiceBase<TransferLibJob, TransferLibJobDetail, TransferLibJobDTO, SfsJobRequestInputBase, TransferLibJobCheckInput, TransferLibJobEditInput>, |
|||
ITransferLibJobAppService |
|||
{ |
|||
public TransferLibJobAppService( |
|||
ITransferLibJobRepository repository, ITransferLibJobManager TransferLibJobManager |
|||
) : base(repository, TransferLibJobManager) |
|||
{ |
|||
} |
|||
} |
@ -0,0 +1,25 @@ |
|||
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 TransferLibJobAutoMapperProfile() |
|||
{ |
|||
CreateMap<TransferLibJob, TransferLibJobDTO>() |
|||
.ReverseMap(); |
|||
|
|||
CreateMap<TransferLibJobDetail, TransferLibJobDetailDTO>() |
|||
.ReverseMap(); |
|||
|
|||
CreateMap<TransferLibJobDetailInput, TransferLibJobDetail>() |
|||
.IgnoreAuditedObjectProperties() |
|||
.Ignore(x => x.MasterID) |
|||
.Ignore(x => x.TenantId) |
|||
.Ignore(x => x.Number) |
|||
.Ignore(x => x.Id); |
|||
} |
|||
} |
@ -0,0 +1,512 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
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.Basedata.Domain.Shared; |
|||
using Win_in.Sfs.Basedata.SplitPackings.Commons; |
|||
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; |
|||
|
|||
/// <summary>
|
|||
/// 调拨转移记录
|
|||
/// </summary>
|
|||
[Authorize] |
|||
[Route($"{StoreConsts.RootPath}transferlib-note")] |
|||
public class TransferLibNoteAppService : SfsStoreWithDetailsAppServiceBase |
|||
<TransferLibNote, TransferLibNoteDTO, SfsStoreRequestInputBase, TransferLibNoteEditInput, TransferLibNoteDetail, |
|||
TransferLibNoteDetailDTO, SfsStoreRequestInputBase, TransferLibNoteImportInput>, |
|||
ITransferLibNoteAppService |
|||
{ |
|||
private readonly ITransferLibNoteManager _transferLibNoteManager; |
|||
private readonly IBalanceAppService _balanceAppService; |
|||
private readonly ILocationAppService _locationAppService; |
|||
private readonly ISplitPackingRecAppService _splitPackingRecAppService; |
|||
private readonly IPurchaseReceiptJobAppService _purchaseReceiptJobAppService; |
|||
private readonly IPurchaseReceiptRequestAppService _purchaseReceiptRequestAppService; //采购收货
|
|||
private readonly IInspectJobAppService _inspectJobAppService; //质检
|
|||
private readonly IIssueJobAppService _issueJobAppService; //发料
|
|||
|
|||
private readonly IExpectOutAppService _expectOutAppService; //
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
public TransferLibNoteAppService( |
|||
ITransferLibNoteRepository repository, |
|||
ITransferLibNoteManager transferLibNoteManager, |
|||
IBalanceAppService balanceAppService, |
|||
ILocationAppService locationAppService, |
|||
ISplitPackingRecAppService splitPackingRecAppService, |
|||
IPurchaseReceiptJobAppService purchaseReceiptJobAppService, |
|||
IPurchaseReceiptRequestAppService purchaseReceiptRequestAppService, |
|||
IInspectJobAppService inspectJobAppService, |
|||
IIssueJobAppService issueJobAppService, |
|||
IExpectOutAppService expectOutAppService) : base(repository) |
|||
{ |
|||
_transferLibNoteManager = transferLibNoteManager; |
|||
_balanceAppService = balanceAppService; |
|||
_locationAppService = locationAppService; |
|||
_splitPackingRecAppService = splitPackingRecAppService; |
|||
_purchaseReceiptJobAppService = purchaseReceiptJobAppService; |
|||
_purchaseReceiptRequestAppService = purchaseReceiptRequestAppService; |
|||
_inspectJobAppService = inspectJobAppService; |
|||
_issueJobAppService = issueJobAppService; |
|||
_expectOutAppService = expectOutAppService; |
|||
} |
|||
|
|||
#region 东阳使用
|
|||
|
|||
/// <summary>
|
|||
/// 用来重写 导入数据时可以加工数据
|
|||
/// </summary>
|
|||
/// <param name="dictionary"></param>
|
|||
/// <returns></returns>
|
|||
protected override async Task<Dictionary<TransferLibNote, EntityState>> ImportProcessingEntityAsync( |
|||
Dictionary<TransferLibNote, EntityState> dictionary) |
|||
{ |
|||
var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key); |
|||
|
|||
foreach (var transferLibNote in addList) |
|||
{ |
|||
if (transferLibNote.Type == EnumTransSubType.Transfer_Inside.GetDisplayName()) //储位内调拨
|
|||
{ |
|||
transferLibNote.Type = EnumTransSubType.Transfer_Inside.ToString();//重点 需要转换
|
|||
foreach (var detail in transferLibNote.Details) |
|||
{ |
|||
var balanceDto = await _balanceAppService.GetByItemLocationAndPackingAsync(detail.FromPackingCode, |
|||
detail.ItemCode, detail.FromLocationCode).ConfigureAwait(false); |
|||
var toLocationDto = await _locationAppService.GetByCodeAsync(detail.ToLocationCode).ConfigureAwait(false); |
|||
var fromLocationDto = await _locationAppService.GetByCodeAsync(detail.FromLocationCode).ConfigureAwait(false); |
|||
|
|||
CheckLocation(toLocationDto, detail); |
|||
CheckFromLocation(fromLocationDto, detail); |
|||
if (toLocationDto.Type != fromLocationDto.Type) |
|||
{ |
|||
throw new UserFriendlyException($"来源库位与目标库位类型不一致"); |
|||
} |
|||
|
|||
detail.OnTheWayLocationCode = bool.FalseString; |
|||
detail.ItemCode=balanceDto.ItemCode; |
|||
detail.ArriveDate=balanceDto.ArriveDate; |
|||
detail.ItemDesc1=balanceDto.ItemDesc1; |
|||
detail.ItemDesc2=balanceDto.ItemDesc2; |
|||
detail.ItemName=balanceDto.ItemName; |
|||
detail.ProduceDate=balanceDto.ProduceDate; |
|||
detail.Qty=balanceDto.Qty; |
|||
detail.Uom=balanceDto.Uom; |
|||
detail.ExpireDate=balanceDto.ExpireDate; |
|||
detail.StdPackQty=balanceDto.StdPackQty; |
|||
detail.SupplierBatch=balanceDto.SupplierBatch; |
|||
|
|||
detail.FromLocationArea = balanceDto.LocationArea; |
|||
detail.FromContainerCode = balanceDto.ContainerCode; |
|||
detail.FromLocationErpCode = balanceDto.LocationErpCode; |
|||
detail.FromLocationGroup = balanceDto.LocationGroup; |
|||
detail.FromPackingCode = balanceDto.PackingCode; |
|||
detail.FromLocationArea = balanceDto.LocationArea; |
|||
detail.FromStatus = balanceDto.Status; |
|||
detail.FromWarehouseCode = balanceDto.WarehouseCode; |
|||
detail.FromLot = balanceDto.Lot; |
|||
|
|||
detail.ToLocationArea = toLocationDto.AreaCode; |
|||
detail.ToLocationErpCode = toLocationDto.ErpLocationCode; |
|||
detail.ToLocationGroup = toLocationDto.LocationGroupCode; |
|||
detail.ToWarehouseCode = toLocationDto.WarehouseCode; |
|||
detail.ToContainerCode = balanceDto.ContainerCode; |
|||
detail.ToPackingCode = balanceDto.PackingCode; |
|||
detail.ToLocationArea = balanceDto.LocationArea; |
|||
detail.ToStatus = balanceDto.Status; |
|||
detail.ToLot = balanceDto.Lot; |
|||
} |
|||
} |
|||
} |
|||
|
|||
return dictionary; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 拆箱
|
|||
/// </summary>
|
|||
/// <param name="transferLibNoteEditInput"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("split-packing")] |
|||
public async Task<TransferLibNoteDTO> SplitPackingAsync(TransferLibNoteEditInput transferLibNoteEditInput) |
|||
{ |
|||
//插入拆箱记录表
|
|||
await WriteSplitPackingRec(transferLibNoteEditInput).ConfigureAwait(false); |
|||
//更新库存
|
|||
transferLibNoteEditInput.Type = EnumTransSubType.Transfer_SplitPacking.ToString(); |
|||
return await CreateAsync(transferLibNoteEditInput).ConfigureAwait(false); |
|||
} |
|||
|
|||
#region 校验
|
|||
private void CheckLocation(LocationDTO locationDto, TransferLibNoteDetail detail) |
|||
{ |
|||
if (locationDto == null) |
|||
{ |
|||
throw new UserFriendlyException($"库位代码为【{detail.ToLocationCode}】不存在"); |
|||
} |
|||
} |
|||
private void CheckFromLocation(LocationDTO locationDto, TransferLibNoteDetail detail) |
|||
{ |
|||
if (locationDto == null) |
|||
{ |
|||
throw new UserFriendlyException($"库位代码为【{detail.FromLocationCode}】不存在"); |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
/// <summary>
|
|||
/// 按条件获取拆箱的分页列表
|
|||
/// request sample
|
|||
/// {
|
|||
/// "maxResultCount": 1000,
|
|||
/// "skipCount": 0,
|
|||
/// "sorting": "",
|
|||
/// "condition": { "filters": []}
|
|||
/// }
|
|||
/// </summary>
|
|||
/// <param name="sfsRequestDTO"></param>
|
|||
/// <param name="includeDetails"></param>
|
|||
/// <param name="cancellationToken"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("get-split-packing-list")] |
|||
public virtual async Task<PagedResultDto<TransferLibNoteDTO>> GetSplitPackingTransferListAsync( |
|||
SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false, |
|||
CancellationToken cancellationToken = default) |
|||
{ |
|||
return await GetSubTypeListAsync(sfsRequestDTO, EnumTransSubType.Transfer_SplitPacking, includeDetails, |
|||
cancellationToken).ConfigureAwait(false); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 按条件获取线边调拨的分页列表
|
|||
/// request sample
|
|||
/// {
|
|||
/// "maxResultCount": 1000,
|
|||
/// "skipCount": 0,
|
|||
/// "sorting": "",
|
|||
/// "condition": { "filters": []}
|
|||
/// }
|
|||
/// </summary>
|
|||
/// <param name="sfsRequestDTO"></param>
|
|||
/// <param name="includeDetails"></param>
|
|||
/// <param name="cancellationToken"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("get-wip-list")] |
|||
public virtual async Task<PagedResultDto<TransferLibNoteDTO>> GetWipTransferListAsync( |
|||
SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false, |
|||
CancellationToken cancellationToken = default) |
|||
{ |
|||
return await GetSubTypeListAsync(sfsRequestDTO, EnumTransSubType.Transfer_WIP, includeDetails, |
|||
cancellationToken).ConfigureAwait(false); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 按条件获取储位间调拨的分页列表
|
|||
/// request sample
|
|||
/// {
|
|||
/// "maxResultCount": 1000,
|
|||
/// "skipCount": 0,
|
|||
/// "sorting": "",
|
|||
/// "condition": { "filters": []}
|
|||
/// }
|
|||
/// </summary>
|
|||
/// <param name="sfsRequestDTO"></param>
|
|||
/// <param name="includeDetails"></param>
|
|||
/// <param name="cancellationToken"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("get-erp-loc-list")] |
|||
public virtual async Task<PagedResultDto<TransferLibNoteDTO>> GetAreaTransferListAsync( |
|||
SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false, |
|||
CancellationToken cancellationToken = default) |
|||
{ |
|||
return await GetSubTypeListAsync(sfsRequestDTO, EnumTransSubType.Transfer_Area, includeDetails, |
|||
cancellationToken).ConfigureAwait(false); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 按条件获取储位内移库的分页列表
|
|||
/// request sample
|
|||
/// {
|
|||
/// "maxResultCount": 1000,
|
|||
/// "skipCount": 0,
|
|||
/// "sorting": "",
|
|||
/// "condition": { "filters": []}
|
|||
/// }
|
|||
/// </summary>
|
|||
/// <param name="sfsRequestDTO"></param>
|
|||
/// <param name="includeDetails"></param>
|
|||
/// <param name="cancellationToken"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("get-inside-list")] |
|||
public virtual async Task<PagedResultDto<TransferLibNoteDTO>> GetInsideTransferListAsync( |
|||
SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false, |
|||
CancellationToken cancellationToken = default) |
|||
{ |
|||
return await GetSubTypeListAsync(sfsRequestDTO, EnumTransSubType.Transfer_Inside, includeDetails, |
|||
cancellationToken).ConfigureAwait(false); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 按条件获取客户储位间调拨的分页列表
|
|||
/// request sample
|
|||
/// {
|
|||
/// "maxResultCount": 1000,
|
|||
/// "skipCount": 0,
|
|||
/// "sorting": "",
|
|||
/// "condition": { "filters": []}
|
|||
/// }
|
|||
/// </summary>
|
|||
/// <param name="sfsRequestDTO"></param>
|
|||
/// <param name="includeDetails"></param>
|
|||
/// <param name="cancellationToken"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("get-custom-loc-list")] |
|||
public virtual async Task<PagedResultDto<TransferLibNoteDTO>> GetCustomerTransferListAsync( |
|||
SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false, |
|||
CancellationToken cancellationToken = default) |
|||
{ |
|||
return await GetSubTypeListAsync(sfsRequestDTO, EnumTransSubType.Transfer_Customer, includeDetails, |
|||
cancellationToken).ConfigureAwait(false); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 按条件获取储位间调拨的分页列表
|
|||
/// request sample
|
|||
/// {
|
|||
/// "maxResultCount": 1000,
|
|||
/// "skipCount": 0,
|
|||
/// "sorting": "",
|
|||
/// "condition": { "filters": []}
|
|||
/// }
|
|||
/// </summary>
|
|||
/// <param name="sfsRequestDTO"></param>
|
|||
/// <param name="includeDetails"></param>
|
|||
/// <param name="cancellationToken"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("get-diff-erp-loc-list")] |
|||
public virtual async Task<PagedResultDto<TransferLibNoteDTO>> GetListForDiffERPLocAsync( |
|||
SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false, |
|||
CancellationToken cancellationToken = default) |
|||
{ |
|||
return await GetSubTypeListAsync(sfsRequestDTO, EnumTransSubType.Transfer_Warehouse, includeDetails, |
|||
cancellationToken).ConfigureAwait(false); |
|||
} |
|||
|
|||
private async Task<PagedResultDto<TransferLibNoteDTO>> GetSubTypeListAsync(SfsStoreRequestInputBase sfsRequestDTO, |
|||
EnumTransSubType type, bool includeDetails = false, |
|||
CancellationToken cancellationToken = default) |
|||
{ |
|||
sfsRequestDTO.Condition.Filters.Add(new Filter |
|||
{ |
|||
Action = "==", |
|||
Column = "Type", |
|||
Logic = EnumFilterLogic.And.ToString(), |
|||
Value = type.ToString() |
|||
}); |
|||
|
|||
var expression = sfsRequestDTO.Condition.Filters?.Count > 0 |
|||
? sfsRequestDTO.Condition.Filters.ToLambda<TransferLibNote>() |
|||
: p => true; |
|||
|
|||
return await GetPagedListAsync(expression, sfsRequestDTO.SkipCount, sfsRequestDTO.MaxResultCount, |
|||
sfsRequestDTO.Sorting, includeDetails, cancellationToken).ConfigureAwait(false); |
|||
} |
|||
|
|||
#endregion
|
|||
|
|||
/// <summary>
|
|||
/// 库存转移
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("")] |
|||
public override async Task<TransferLibNoteDTO> CreateAsync(TransferLibNoteEditInput input) |
|||
{ |
|||
var entity = ObjectMapper.Map<TransferLibNoteEditInput, TransferLibNote>(input); |
|||
|
|||
entity=await _transferLibNoteManager.CreateAsync(entity).ConfigureAwait(false); |
|||
|
|||
var dto = ObjectMapper.Map<TransferLibNote, TransferLibNoteDTO>(entity); |
|||
|
|||
return dto; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 【批量】 库存转移
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("create-many")] |
|||
public async Task<List<TransferLibNoteDTO>> CreateManyAsync(List<TransferLibNoteEditInput> input) |
|||
{ |
|||
var entitys = ObjectMapper.Map<List<TransferLibNoteEditInput>, List<TransferLibNote>>(input); |
|||
|
|||
var resultEntity = new List<TransferLibNote>(); |
|||
|
|||
foreach (var entity in entitys) |
|||
{ |
|||
resultEntity.Add(await _transferLibNoteManager.CreateAsync(entity).ConfigureAwait(false)); |
|||
_ = ObjectMapper.Map<TransferLibNote, TransferLibNoteDTO>(entity); |
|||
} |
|||
|
|||
return ObjectMapper.Map<List<TransferLibNote>, List<TransferLibNoteDTO>>(resultEntity); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 确认对应的记录单
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("confirm/{id}")] |
|||
public virtual async Task<TransferLibNoteDTO> ConfirmAsync(Guid id) |
|||
{ |
|||
var entity = await _transferLibNoteManager.ConfirmAsync(id).ConfigureAwait(false); |
|||
var dto = ObjectMapper.Map<TransferLibNote, TransferLibNoteDTO>(entity); |
|||
return dto; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 插入拆箱记录表
|
|||
/// </summary>
|
|||
/// <param name="transferLibNoteEditInput"></param>
|
|||
/// <returns></returns>
|
|||
private async Task<bool> WriteSplitPackingRec(TransferLibNoteEditInput transferLibNoteEditInput) |
|||
{ |
|||
List<SplitPackingRecEditInput> recLst = new List<SplitPackingRecEditInput>(); |
|||
foreach (var inputDetail in transferLibNoteEditInput.Details) |
|||
{ |
|||
SplitPackingRecEditInput packRec = new SplitPackingRecEditInput(); |
|||
packRec.OprType = OprTypeEnum.SplitBox; |
|||
packRec.FromPackingCode = inputDetail.FromPackingCode; |
|||
//packRec.FromTopPackingCode = inputDetail.;
|
|||
packRec.FromStdPackQty = inputDetail.StdPackQty; |
|||
packRec.FromUom = inputDetail.Uom; |
|||
packRec.FromQty = inputDetail.Qty; |
|||
packRec.ToPackingCode = inputDetail.ToPackingCode; |
|||
//packRec.ToTopPackingCode = inputDetail.;
|
|||
packRec.ToStdPackQty = inputDetail.StdPackQty; |
|||
packRec.ToUom = inputDetail.Uom; |
|||
packRec.ToQty = inputDetail.Qty; |
|||
packRec.ItemCode = inputDetail.ItemCode; |
|||
packRec.ItemName = inputDetail.ItemName; |
|||
packRec.ItemDesc1 = inputDetail.ItemDesc1; |
|||
packRec.ItemDesc2 = inputDetail.ItemDesc2; |
|||
packRec.FromLot = inputDetail.FromLot; |
|||
packRec.ToLot = inputDetail.ToLot; |
|||
//packRec.PurchaseInfo_PoNumber = inputDetail.; // 采购订单
|
|||
//packRec.PurchaseInfo_AsnNumber = inputDetail.; //供应商发货单
|
|||
//packRec.ArrivalNoticNumber = inputDetail.; //到货通知
|
|||
//packRec.TaskOrderNumber = inputDetail.; //任务单
|
|||
//packRec.ReceiptRecNumber = inputDetail.; //收货记录单
|
|||
//packRec.PutOnShelfNumber = inputDetail.; //上架单
|
|||
recLst.Add(packRec); |
|||
} |
|||
var ret = await _splitPackingRecAppService.BatchInsertAsync(recLst).ConfigureAwait(false); |
|||
return ret; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 采购收货拆箱,同时更新、插入PurchaseReceipt任务表、申请表
|
|||
/// </summary>
|
|||
/// <param name="transferLibNoteEditInput"></param>
|
|||
/// <param name="updateJobDetailInput"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("split-packing-purchase-receipt")] |
|||
public async Task<bool> SplitPacking_PurchaseReceiptAsync(TransferLibNoteEditInput transferLibNoteEditInput, [FromQuery] SplitPacking_UpdateJobDetailInput updateJobDetailInput) |
|||
{ |
|||
var jobRet = await _purchaseReceiptJobAppService.SaveDetail_SplitPackingAsync(updateJobDetailInput).ConfigureAwait(false); |
|||
var requestRet = await _purchaseReceiptRequestAppService.SaveDetail_SplitPackingAsync(updateJobDetailInput, jobRet.PurchaseReceiptRequestNumber).ConfigureAwait(false); |
|||
bool ret = await WriteSplitPackingRec(transferLibNoteEditInput).ConfigureAwait(false); //采购收货-目检-拆箱时,还没有入库,不涉及库存操作
|
|||
return ret; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 质检拆箱,同时更新、插入Inspect任务表(不更新申请表)
|
|||
/// </summary>
|
|||
/// <param name="transferLibNoteEditInput"></param>
|
|||
/// <param name="updateJobDetailInput"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("split-packing-inspect")] |
|||
public async Task<TransferLibNoteDTO> SplitPacking_InspectAsync(TransferLibNoteEditInput transferLibNoteEditInput, [FromQuery] SplitPacking_UpdateJobDetailInput updateJobDetailInput) |
|||
{ |
|||
//SplitPacking_UpdateDetailInput newInput = new SplitPacking_UpdateDetailInput();
|
|||
//newInput.Number = updateJobDetailInput.Number;
|
|||
//newInput.FromPackingCode = updateJobDetailInput.FromPackingCode;
|
|||
//newInput.FromQty = updateJobDetailInput.FromQty;
|
|||
//newInput.ToPackingCode = updateJobDetailInput.ToPackingCode;
|
|||
//newInput.ToQty = updateJobDetailInput.ToQty;
|
|||
//newInput.FromLocationCode = transferLibNoteEditInput.Details[0].FromLocationCode;
|
|||
//newInput.ToLocationCode = transferLibNoteEditInput.Details[0].ToLocationCode;
|
|||
//var expectOutRet = await _expectOutAppService.SaveDetail_SplitPackingAsync(newInput).ConfigureAwait(false);
|
|||
var jobRet = await _inspectJobAppService.SaveDetail_SplitPackingAsync(updateJobDetailInput).ConfigureAwait(false); |
|||
var ret = await SplitPackingAsync(transferLibNoteEditInput).ConfigureAwait(false); //库存操作
|
|||
return ret; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 发料拆箱,同时更新、插入Inspect任务表(没有找到申请表//??)
|
|||
/// </summary>
|
|||
/// <param name="transferLibNoteEditInput"></param>
|
|||
/// <param name="updateJobDetailInput"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("split-packing-issue")] |
|||
public async Task<TransferLibNoteDTO> SplitPacking_IssueAsync(TransferLibNoteEditInput transferLibNoteEditInput, [FromQuery] SplitPacking_UpdateJobDetailInput updateJobDetailInput) |
|||
{ |
|||
SplitPacking_UpdateDetailInput newInput = new SplitPacking_UpdateDetailInput(); |
|||
newInput.Number = updateJobDetailInput.Number; |
|||
newInput.FromPackingCode = updateJobDetailInput.FromPackingCode; |
|||
newInput.FromQty = updateJobDetailInput.FromQty; |
|||
newInput.ToPackingCode = updateJobDetailInput.ToPackingCode; |
|||
newInput.ToQty = updateJobDetailInput.ToQty; |
|||
newInput.FromLocationCode = transferLibNoteEditInput.Details[0].FromLocationCode; |
|||
newInput.ToLocationCode = transferLibNoteEditInput.Details[0].ToLocationCode; |
|||
var expectOutRet = await _expectOutAppService.SaveDetail_SplitPackingAsync(newInput).ConfigureAwait(false); |
|||
var jobRet = await _issueJobAppService.SaveDetail_SplitPackingAsync(updateJobDetailInput).ConfigureAwait(false); |
|||
var ret = await SplitPackingAsync(transferLibNoteEditInput).ConfigureAwait(false); //库存操作
|
|||
return ret; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 拆箱,预计出表存在数据时不允许办理
|
|||
/// </summary>
|
|||
/// <param name="transferLibNoteEditInput"></param>
|
|||
/// <param name="updateJobDetailInputBase"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("split-packing-check-expect-out")] |
|||
public async Task<TransferLibNoteDTO> SplitPackingCheckExpectOutAsync(TransferLibNoteEditInput transferLibNoteEditInput, [FromQuery] SplitPacking_UpdateJobDetailInputBase updateJobDetailInputBase) |
|||
{ |
|||
var detailObj = transferLibNoteEditInput.Details[0]; |
|||
SplitPacking_UpdateDetailInput newInput = new SplitPacking_UpdateDetailInput(); |
|||
newInput.Number = updateJobDetailInputBase.Number; |
|||
newInput.FromPackingCode = detailObj.FromPackingCode; |
|||
newInput.FromQty = detailObj.Qty; |
|||
newInput.ToPackingCode = detailObj.ToPackingCode; |
|||
newInput.ToQty = detailObj.Qty; |
|||
newInput.FromLocationCode = detailObj.FromLocationCode; |
|||
newInput.ToLocationCode = detailObj.ToLocationCode; |
|||
var expectOutLst = await _expectOutAppService.GetListByJobNumberAsync(newInput).ConfigureAwait(false); |
|||
if (expectOutLst.Count > 0) |
|||
{ |
|||
throw new UserFriendlyException($"预计出表存在数据,不允许办理拆箱:JobNumber={newInput.Number}|PackingCode={newInput.FromPackingCode}|Qty={newInput.FromQty}|LocationCode={newInput.FromLocationCode}"); |
|||
} |
|||
var ret = await SplitPackingAsync(transferLibNoteEditInput).ConfigureAwait(false); |
|||
return ret; |
|||
|
|||
} |
|||
} |
@ -0,0 +1,79 @@ |
|||
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 TransferLibNoteMapperProfile() |
|||
{ |
|||
CreateMap<TransferLibNote, TransferLibNoteDTO>() |
|||
.ReverseMap(); |
|||
|
|||
CreateMap<TransferLibNoteEditInput, TransferLibNote>() |
|||
.IgnoreAuditedObjectProperties() |
|||
; |
|||
|
|||
CreateMap<TransferLibNoteDetailInput, TransferLibNoteDetail>() |
|||
.IgnoreAuditedObjectProperties() |
|||
; |
|||
|
|||
CreateMap<TransferLibNoteDetailDTO, TransferLibNoteDetail>(); |
|||
|
|||
CreateMap<TransferLibNoteDetail, TransferLibNoteDetailDTO>(); |
|||
|
|||
CreateMap<TransferLibNoteDetailInput, TransferLibNoteDetail>() |
|||
.IgnoreAuditedObjectProperties() |
|||
.Ignore(x => x.MasterID) |
|||
.Ignore(x => x.TenantId) |
|||
.Ignore(x => x.Number) |
|||
.Ignore(x => x.Id); |
|||
|
|||
CreateMap<TransferLibNoteImportInput, TransferLibNote>() |
|||
.IgnoreAuditedObjectProperties() |
|||
.Ignore(x => x.ConfirmTime) |
|||
.Ignore(x => x.RequestNumber) |
|||
.Ignore(x => x.JobNumber) |
|||
.Ignore(x => x.ActiveDate) |
|||
.Ignore(x => x.Remark) |
|||
.Ignore(x => x.ExtraProperties) |
|||
.Ignore(x => x.ConcurrencyStamp) |
|||
.Ignore(x => x.Details) |
|||
.Ignore(x => x.TenantId) |
|||
.Ignore(x => x.Number) |
|||
.Ignore(x => x.Id); |
|||
|
|||
CreateMap<TransferLibNoteImportInput, TransferLibNoteDetail>() |
|||
.IgnoreAuditedObjectProperties() |
|||
.ForMember(x => x.ToPackingCode, y => y.MapFrom(d => d.PackingCode)) |
|||
.ForMember(x => x.FromPackingCode, y => y.MapFrom(d => d.PackingCode)) |
|||
.ForMember(x => x.FromStatus, y => y.MapFrom(d => d.Status)) |
|||
.ForMember(x => x.ToStatus, y => y.MapFrom(d => d.Status)) |
|||
.Ignore(x => x.FromLocationGroup) |
|||
.Ignore(x => x.FromLocationArea) |
|||
.Ignore(x => x.FromLocationErpCode) |
|||
.Ignore(x => x.FromWarehouseCode) |
|||
.Ignore(x => x.ToLocationArea) |
|||
.Ignore(x => x.ToLocationGroup) |
|||
.Ignore(x => x.ToLocationErpCode) |
|||
.Ignore(x => x.ToWarehouseCode) |
|||
.Ignore(x => x.Reason) |
|||
.Ignore(x => x.SupplierBatch).Ignore(x => x.ArriveDate).Ignore(x => x.ProduceDate).Ignore(x => x.ExpireDate) |
|||
.Ignore(x => x.Remark) |
|||
.Ignore(x => x.ItemName) |
|||
.Ignore(x => x.ItemDesc1) |
|||
.Ignore(x => x.ItemDesc2) |
|||
.Ignore(x => x.FromContainerCode) |
|||
.Ignore(x => x.ToContainerCode) |
|||
.Ignore(x => x.FromLot) |
|||
.Ignore(x => x.ToLot) |
|||
.Ignore(x => x.StdPackQty) |
|||
.Ignore(x => x.Uom) |
|||
.Ignore(x => x.MasterID) |
|||
.Ignore(x => x.TenantId) |
|||
.Ignore(x => x.Number) |
|||
.Ignore(x => x.Id); |
|||
} |
|||
} |
@ -0,0 +1,384 @@ |
|||
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; |
|||
|
|||
/// <summary>
|
|||
/// 调拨转移记录
|
|||
/// </summary>
|
|||
[Authorize] |
|||
[Route($"{StoreConsts.RootPath}transferlib-request")] |
|||
public class TransferLibRequestAppService : SfsStoreRequestAppServiceBase |
|||
<TransferLibRequest, |
|||
TransferLibRequestDTO, |
|||
SfsStoreRequestInputBase, |
|||
TransferLibRequestEditInput, |
|||
TransferLibRequestDetail, |
|||
TransferLibRequestDetailDTO, |
|||
SfsStoreRequestInputBase, |
|||
TransferLibRequestImportInput>, |
|||
ITransferLibRequestAppService |
|||
{ |
|||
private readonly ITransferLibRequestManager _transferLibRequestManager; |
|||
private readonly IBalanceAppService _balanceAppService; |
|||
private readonly ILocationAppService _locationAppService; |
|||
|
|||
public TransferLibRequestAppService( |
|||
ITransferLibRequestRepository repository, |
|||
ITransferLibRequestManager transferLibRequestManager, |
|||
IBalanceAppService balanceAppService, |
|||
ILocationAppService locationAppService) : base(repository, transferLibRequestManager) |
|||
{ |
|||
_transferLibRequestManager = transferLibRequestManager; |
|||
_balanceAppService = balanceAppService; |
|||
_locationAppService = locationAppService; |
|||
} |
|||
|
|||
#region 东阳使用
|
|||
|
|||
/// <summary>
|
|||
/// 用来重写 导入数据时可以加工数据
|
|||
/// </summary>
|
|||
/// <param name="dictionary"></param>
|
|||
/// <returns></returns>
|
|||
protected override async Task<Dictionary<TransferLibRequest, EntityState>> ImportProcessingEntityAsync( |
|||
Dictionary<TransferLibRequest, EntityState> dictionary) |
|||
{ |
|||
var addList = dictionary.Where(p => p.Value == EntityState.Added).Select(p => p.Key); |
|||
|
|||
foreach (var transferLibRequest in addList) |
|||
{ |
|||
EnumTransSubType enumTransSubType = EnumTransSubType.None; |
|||
|
|||
//储位
|
|||
if (transferLibRequest.Type == EnumTransSubType.Transfer_Area.GetDisplayName()) |
|||
{ |
|||
transferLibRequest.Type = EnumTransSubType.Transfer_Area.ToString(); //重点 需要转换
|
|||
enumTransSubType = EnumTransSubType.Transfer_Area; |
|||
transferLibRequest.UseOnTheWayLocation = false; |
|||
} |
|||
//储位内
|
|||
if (transferLibRequest.Type == EnumTransSubType.Transfer_Inside.GetDisplayName()) |
|||
{ |
|||
transferLibRequest.Type = EnumTransSubType.Transfer_Inside.ToString(); //重点 需要转换
|
|||
enumTransSubType = EnumTransSubType.Transfer_Inside; |
|||
transferLibRequest.UseOnTheWayLocation = false; |
|||
} |
|||
|
|||
//库间
|
|||
if (transferLibRequest.Type == EnumTransSubType.Transfer_Warehouse.GetDisplayName()) |
|||
{ |
|||
transferLibRequest.Type = EnumTransSubType.Transfer_Warehouse.ToString(); //重点 需要转换
|
|||
enumTransSubType = EnumTransSubType.Transfer_Warehouse; |
|||
transferLibRequest.UseOnTheWayLocation = true; |
|||
} |
|||
//客户储位
|
|||
if (transferLibRequest.Type == EnumTransSubType.Transfer_Customer.GetDisplayName()) |
|||
{ |
|||
transferLibRequest.Type = EnumTransSubType.Transfer_Customer.ToString(); //重点 需要转换
|
|||
enumTransSubType = EnumTransSubType.Transfer_Customer; |
|||
transferLibRequest.UseOnTheWayLocation = true; |
|||
} |
|||
//线边调拨
|
|||
if (transferLibRequest.Type == EnumTransSubType.Transfer_WIP.GetDisplayName()) |
|||
{ |
|||
transferLibRequest.Type = EnumTransSubType.Transfer_WIP.ToString(); //重点 需要转换
|
|||
enumTransSubType = EnumTransSubType.Transfer_WIP; |
|||
transferLibRequest.UseOnTheWayLocation = true; |
|||
} |
|||
|
|||
foreach (var detail in transferLibRequest.Details) |
|||
{ |
|||
var balanceDto = await _balanceAppService.GetByItemLocationAndPackingAsync(detail.FromPackingCode, |
|||
detail.ItemCode, detail.FromLocationCode).ConfigureAwait(false); |
|||
var toLocationDto = await _locationAppService.GetByCodeAsync(detail.ToLocationCode) |
|||
.ConfigureAwait(false); |
|||
var fromLocationDto = await _locationAppService.GetByCodeAsync(detail.FromLocationCode) |
|||
.ConfigureAwait(false); |
|||
|
|||
CheckLocation(toLocationDto, detail.ToLocationCode); |
|||
CheckLocation(fromLocationDto, detail.FromLocationCode); |
|||
if (toLocationDto.Type != fromLocationDto.Type) |
|||
{ |
|||
throw new UserFriendlyException($"来源库位与目标库位类型不一致"); |
|||
} |
|||
|
|||
detail.ItemCode = balanceDto.ItemCode; |
|||
detail.ArriveDate = balanceDto.ArriveDate; |
|||
detail.ItemDesc1 = balanceDto.ItemDesc1; |
|||
detail.ItemDesc2 = balanceDto.ItemDesc2; |
|||
detail.ItemName = balanceDto.ItemName; |
|||
detail.ProduceDate = balanceDto.ProduceDate; |
|||
detail.Qty = detail.Qty; |
|||
detail.Uom = balanceDto.Uom; |
|||
detail.ExpireDate = balanceDto.ExpireDate; |
|||
detail.StdPackQty = balanceDto.StdPackQty; |
|||
detail.SupplierBatch = balanceDto.SupplierBatch; |
|||
|
|||
detail.FromLocationArea = balanceDto.LocationArea; |
|||
detail.FromContainerCode = balanceDto.ContainerCode; |
|||
detail.FromLocationErpCode = balanceDto.LocationErpCode; |
|||
detail.FromLocationGroup = balanceDto.LocationGroup; |
|||
detail.FromPackingCode = balanceDto.PackingCode; |
|||
detail.FromLocationArea = balanceDto.LocationArea; |
|||
detail.FromStatus = balanceDto.Status; |
|||
detail.FromWarehouseCode = balanceDto.WarehouseCode; |
|||
detail.FromLot = balanceDto.Lot; |
|||
|
|||
detail.ToLocationArea = toLocationDto.AreaCode; |
|||
detail.ToLocationErpCode = toLocationDto.ErpLocationCode; |
|||
detail.ToLocationGroup = toLocationDto.LocationGroupCode; |
|||
detail.ToWarehouseCode = toLocationDto.WarehouseCode; |
|||
detail.ToContainerCode = balanceDto.ContainerCode; |
|||
detail.ToPackingCode = balanceDto.PackingCode; |
|||
detail.ToLocationArea = balanceDto.LocationArea; |
|||
detail.ToStatus = balanceDto.Status; |
|||
detail.ToLot = balanceDto.Lot; |
|||
} |
|||
|
|||
await SetEntityPropertiesAsync(transferLibRequest, enumTransSubType) |
|||
.ConfigureAwait(false); |
|||
} |
|||
|
|||
return dictionary; |
|||
} |
|||
|
|||
#region 校验
|
|||
private void CheckLocation(LocationDTO locationDTO, string locationCode) |
|||
{ |
|||
if (locationDTO == null) |
|||
{ |
|||
throw new UserFriendlyException($"库位代码为【{locationCode}】不存在"); |
|||
} |
|||
} |
|||
#endregion
|
|||
|
|||
private async Task SetEntityPropertiesAsync(TransferLibRequest entity, EnumTransSubType subType) |
|||
{ |
|||
var tranType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.Transfer, subType) |
|||
.ConfigureAwait(false); |
|||
Check.NotNull(tranType, "事务类型", "事务类型不存在"); |
|||
entity.Worker = CurrentUser.GetUserName(); |
|||
|
|||
entity.AutoCompleteJob = tranType.AutoCompleteJob; |
|||
entity.AutoSubmit = tranType.AutoSubmitRequest; |
|||
entity.AutoAgree = tranType.AutoAgreeRequest; |
|||
entity.AutoHandle = tranType.AutoHandleRequest; |
|||
entity.DirectCreateNote = tranType.DirectCreateNote; |
|||
} |
|||
|
|||
#region 查询相关
|
|||
|
|||
/// <summary>
|
|||
/// 按条件获取【客户储位间调拨】的分页列表
|
|||
/// request sample
|
|||
/// {
|
|||
/// "maxResultCount": 1000,
|
|||
/// "skipCount": 0,
|
|||
/// "sorting": "",
|
|||
/// "condition": { "filters": []}
|
|||
/// }
|
|||
/// </summary>
|
|||
/// <param name="sfsRequestDTO"></param>
|
|||
/// <param name="includeDetails"></param>
|
|||
/// <param name="cancellationToken"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("get-custom-loc-list")] |
|||
public virtual async Task<PagedResultDto<TransferLibRequestDTO>> GetListForCustomAsync( |
|||
SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false, |
|||
CancellationToken cancellationToken = default) |
|||
{ |
|||
return await GetListForOtherBaseAsync(sfsRequestDTO, EnumTransSubType.Transfer_Customer, includeDetails, |
|||
cancellationToken).ConfigureAwait(false); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 按条件获取【储位间调拨】的分页列表
|
|||
/// request sample
|
|||
/// {
|
|||
/// "maxResultCount": 1000,
|
|||
/// "skipCount": 0,
|
|||
/// "sorting": "",
|
|||
/// "condition": { "filters": []}
|
|||
/// }
|
|||
/// </summary>
|
|||
/// <param name="sfsRequestDTO"></param>
|
|||
/// <param name="includeDetails"></param>
|
|||
/// <param name="cancellationToken"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("get-erp-loc-list")] |
|||
public virtual async Task<PagedResultDto<TransferLibRequestDTO>> GetListForERPLocAsync( |
|||
SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false, |
|||
CancellationToken cancellationToken = default) |
|||
{ |
|||
return await GetListForOtherBaseAsync(sfsRequestDTO, EnumTransSubType.Transfer_Area, includeDetails, |
|||
cancellationToken).ConfigureAwait(false); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 按条件获取【储位内移库】的分页列表
|
|||
/// request sample
|
|||
/// {
|
|||
/// "maxResultCount": 1000,
|
|||
/// "skipCount": 0,
|
|||
/// "sorting": "",
|
|||
/// "condition": { "filters": []}
|
|||
/// }
|
|||
/// </summary>
|
|||
/// <param name="sfsRequestDTO"></param>
|
|||
/// <param name="includeDetails"></param>
|
|||
/// <param name="cancellationToken"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("get-custom-inside-list")] |
|||
public virtual async Task<PagedResultDto<TransferLibRequestDTO>> GetListForInsideAsync( |
|||
SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false, |
|||
CancellationToken cancellationToken = default) |
|||
{ |
|||
return await GetListForOtherBaseAsync(sfsRequestDTO, EnumTransSubType.Transfer_Inside, includeDetails, |
|||
cancellationToken).ConfigureAwait(false); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 按条件获取【线边调拨】的分页列表
|
|||
/// request sample
|
|||
/// {
|
|||
/// "maxResultCount": 1000,
|
|||
/// "skipCount": 0,
|
|||
/// "sorting": "",
|
|||
/// "condition": { "filters": []}
|
|||
/// }
|
|||
/// </summary>
|
|||
/// <param name="sfsRequestDTO"></param>
|
|||
/// <param name="includeDetails"></param>
|
|||
/// <param name="cancellationToken"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("get-wip-list")] |
|||
public virtual async Task<PagedResultDto<TransferLibRequestDTO>> GetListForWipAsync( |
|||
SfsStoreRequestInputBase sfsRequestDTO, bool includeDetails = false, |
|||
CancellationToken cancellationToken = default) |
|||
{ |
|||
return await GetListForOtherBaseAsync(sfsRequestDTO, EnumTransSubType.Transfer_WIP, includeDetails, |
|||
cancellationToken).ConfigureAwait(false); |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 按条件获取分页列表
|
|||
/// </summary>
|
|||
/// <param name="sfsRequestDTO"></param>
|
|||
/// <param name="type"></param>
|
|||
/// <param name="includeDetails"></param>
|
|||
/// <param name="cancellationToken"></param>
|
|||
/// <returns></returns>
|
|||
private async Task<PagedResultDto<TransferLibRequestDTO>> GetListForOtherBaseAsync( |
|||
SfsStoreRequestInputBase sfsRequestDTO, EnumTransSubType type, bool includeDetails = false, |
|||
CancellationToken cancellationToken = default) |
|||
{ |
|||
sfsRequestDTO.Condition.Filters.Add(new Filter |
|||
{ |
|||
Action = "==", Column = "Type", Logic = EnumFilterLogic.And.ToString(), Value = type.ToString() |
|||
}); |
|||
|
|||
var expression = sfsRequestDTO.Condition.Filters?.Count > 0 |
|||
? sfsRequestDTO.Condition.Filters.ToLambda<TransferLibRequest>() |
|||
: p => true; |
|||
|
|||
return await GetPagedListAsync(expression, sfsRequestDTO.SkipCount, sfsRequestDTO.MaxResultCount, |
|||
sfsRequestDTO.Sorting, includeDetails, cancellationToken).ConfigureAwait(false); |
|||
} |
|||
|
|||
#endregion
|
|||
|
|||
#endregion
|
|||
|
|||
|
|||
/// <summary>
|
|||
/// 【创建】库移请求
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("")] |
|||
public override async Task<TransferLibRequestDTO> CreateAsync(TransferLibRequestEditInput input) |
|||
{ |
|||
var entity = ObjectMapper.Map<TransferLibRequestEditInput, TransferLibRequest>(input); |
|||
|
|||
var subType = Enum.Parse<EnumTransSubType>(input.Type); |
|||
var tranType = await TransactionTypeAclService.GetByTransTypeAsync(EnumTransType.Transfer, subType) |
|||
.ConfigureAwait(false); |
|||
entity.Type = ((int)subType).ToString(); |
|||
entity.AutoCompleteJob = tranType.AutoCompleteJob; |
|||
entity.AutoSubmit = tranType.AutoSubmitRequest; |
|||
entity.AutoAgree = tranType.AutoAgreeRequest; |
|||
entity.AutoHandle = tranType.AutoHandleRequest; |
|||
entity.DirectCreateNote = tranType.DirectCreateNote; |
|||
|
|||
await _transferLibRequestManager.CreateAsync(entity).ConfigureAwait(false); |
|||
|
|||
var dto = ObjectMapper.Map<TransferLibRequest, TransferLibRequestDTO>(entity); |
|||
|
|||
return dto; |
|||
} |
|||
|
|||
protected async Task CheckFromLocationAsync(string locationCode, List<ValidationResult> validationRresult) |
|||
{ |
|||
var location = await LocationAclService.GetByCodeAsync(locationCode).ConfigureAwait(false); |
|||
if (location == null) |
|||
{ |
|||
validationRresult.Add("来源库位代码", $"来源库位代码{locationCode}不存在"); |
|||
} |
|||
} |
|||
|
|||
protected virtual async Task CheckImportInputBusinessAsync(TransferLibRequestImportInput importInput, |
|||
EnumImportMethod importMethod, List<ValidationResult> validationRresult) |
|||
{ |
|||
ChecktQty(importInput, validationRresult); |
|||
await CheckItemBasicAsync(importInput, validationRresult).ConfigureAwait(false); |
|||
|
|||
await CheckFromLocationAsync(importInput.FromLocationCode, validationRresult).ConfigureAwait(false); |
|||
await CheckToLocationAsync(importInput.ToLocationCode, validationRresult).ConfigureAwait(false); |
|||
} |
|||
|
|||
protected async Task CheckItemBasicAsync(TransferLibRequestImportInput importInput, |
|||
List<ValidationResult> validationRresult) |
|||
{ |
|||
var item = await ItemBasicAclService.GetByCodeAsync(importInput.ItemCode).ConfigureAwait(false); |
|||
if (item == null) |
|||
{ |
|||
validationRresult.Add("物品代码", $"物品代码{importInput.ItemCode}不存在"); |
|||
} |
|||
|
|||
if (importInput.Qty <= 0) |
|||
{ |
|||
validationRresult.Add("调整数量", $"调整数量{importInput.Qty}必须大于0"); |
|||
} |
|||
} |
|||
|
|||
protected async Task CheckToLocationAsync(string locationCode, List<ValidationResult> validationRresult) |
|||
{ |
|||
var location = await LocationAclService.GetByCodeAsync(locationCode).ConfigureAwait(false); |
|||
if (location == null) |
|||
{ |
|||
validationRresult.Add("目标库位代码", $"目标库位代码{locationCode}不存在"); |
|||
} |
|||
} |
|||
|
|||
protected void ChecktQty(TransferLibRequestImportInput importInput, List<ValidationResult> validationRresult) |
|||
{ |
|||
} |
|||
} |
@ -0,0 +1,69 @@ |
|||
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 TransferLibRequestMapperProfile() |
|||
{ |
|||
CreateMap<TransferLibRequest, TransferLibRequestDTO>() |
|||
.ReverseMap(); |
|||
|
|||
CreateMap<TransferLibRequestDetailDTO, TransferLibRequestDetail>(); |
|||
|
|||
CreateMap<TransferLibRequestDetail, TransferLibRequestDetailDTO>(); |
|||
|
|||
CreateMap<TransferLibRequestDetailInput, TransferLibRequestDetail>() |
|||
.IgnoreAuditedObjectProperties() |
|||
.Ignore(x => x.MasterID) |
|||
.Ignore(x => x.TenantId) |
|||
.Ignore(x => x.Number) |
|||
.Ignore(x => x.Id); |
|||
|
|||
CreateMap<TransferLibRequestImportInput, TransferLibRequest>() |
|||
.IgnoreAuditedObjectProperties() |
|||
.Ignore(x => x.ActiveDate) |
|||
.Ignore(x => x.Remark) |
|||
.Ignore(x => x.ExtraProperties) |
|||
.Ignore(x => x.ConcurrencyStamp) |
|||
.Ignore(x => x.RequestStatus) |
|||
.Ignore(x => x.Details) |
|||
.Ignore(x => x.TenantId) |
|||
.Ignore(x => x.Number) |
|||
.Ignore(x => x.Id); |
|||
|
|||
CreateMap<TransferLibRequestImportInput, TransferLibRequestDetail>() |
|||
.IgnoreAuditedObjectProperties() |
|||
.ForMember(x => x.ToPackingCode, y => y.MapFrom(d => d.PackingCode ?? string.Empty)) |
|||
.ForMember(x => x.FromPackingCode, y => y.MapFrom(d => d.PackingCode ?? string.Empty)) |
|||
.ForMember(x => x.FromStatus, y => y.MapFrom(d => d.Status)) |
|||
.ForMember(x => x.ToStatus, y => y.MapFrom(d => d.Status)) |
|||
.Ignore(x => x.FromLocationGroup) |
|||
.Ignore(x => x.FromLocationArea) |
|||
.Ignore(x => x.FromLocationErpCode) |
|||
.Ignore(x => x.FromWarehouseCode) |
|||
.Ignore(x => x.ToLocationArea) |
|||
.Ignore(x => x.ToLocationGroup) |
|||
.Ignore(x => x.ToLocationErpCode) |
|||
.Ignore(x => x.ToWarehouseCode) |
|||
.Ignore(x => x.Reason) |
|||
.Ignore(x => x.SupplierBatch).Ignore(x => x.ArriveDate).Ignore(x => x.ProduceDate).Ignore(x => x.ExpireDate) |
|||
.Ignore(x => x.Remark) |
|||
.Ignore(x => x.ItemName) |
|||
.Ignore(x => x.ItemDesc1) |
|||
.Ignore(x => x.ItemDesc2) |
|||
.Ignore(x => x.FromContainerCode) |
|||
.Ignore(x => x.ToContainerCode) |
|||
.Ignore(x => x.FromLot) |
|||
.Ignore(x => x.ToLot) |
|||
.Ignore(x => x.StdPackQty) |
|||
.Ignore(x => x.Uom) |
|||
.Ignore(x => x.MasterID) |
|||
.Ignore(x => x.TenantId) |
|||
.Ignore(x => x.Number) |
|||
.Ignore(x => x.Id); |
|||
} |
|||
} |
@ -0,0 +1,11 @@ |
|||
using System; |
|||
using System.Linq.Expressions; |
|||
using System.Threading.Tasks; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
public interface ITransferLibJobManager : IJobManager<TransferLibJob> |
|||
{ |
|||
Task<TransferLibJob> GetAsync(Expression<Func<TransferLibJob, bool>> expression); |
|||
Task UpdateAsync(TransferLibJob issueJob); |
|||
} |
@ -0,0 +1,6 @@ |
|||
namespace Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
public interface ITransferLibJobRepository : ISfsJobRepositoryBase<TransferLibJob> |
|||
{ |
|||
|
|||
} |
@ -0,0 +1,61 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Data; |
|||
using Win_in.Sfs.Shared.Domain.Entities; |
|||
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
/// <summary>
|
|||
/// 计划外出库任务
|
|||
/// </summary>
|
|||
[Display(Name = "计划外出库任务")] |
|||
public class TransferLibJob : SfsJobAggregateRootBase<TransferLibJobDetail> |
|||
{ |
|||
/// <summary>
|
|||
/// 申请单号
|
|||
/// </summary>
|
|||
[IgnoreUpdate] |
|||
public string RequestNumber { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 任务单号
|
|||
/// </summary>
|
|||
[IgnoreUpdate] |
|||
public string JobNumber { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 调拨类型
|
|||
/// </summary>
|
|||
[Display(Name = "调拨类型")] |
|||
[Required(ErrorMessage = "调拨类型不能为空")] |
|||
public string Type { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 使用中间库
|
|||
/// </summary>
|
|||
[Display(Name = "使用中间库")] |
|||
public bool UseOnTheWayLocation { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 确认时间
|
|||
/// </summary>
|
|||
[Display(Name = "确认时间")] |
|||
[IgnoreUpdate] |
|||
public DateTime? ConfirmTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 已确认
|
|||
/// </summary>
|
|||
[Display(Name = "已确认")] |
|||
public bool Confirmed { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 任务明细
|
|||
/// </summary>
|
|||
[IgnoreUpdate] |
|||
public override List<TransferLibJobDetail> Details { get; set; } = new List<TransferLibJobDetail>(); |
|||
|
|||
} |
@ -0,0 +1,25 @@ |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Volo.Abp.Data; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
public class TransferLibJobDetail : SfsStoreDetailWithFromToEntityBase |
|||
{ |
|||
/// <summary>
|
|||
/// 中间库地址
|
|||
/// </summary>
|
|||
public string OnTheWayLocationCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 原因
|
|||
/// </summary>
|
|||
public string Reason { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 执行任务状态
|
|||
/// </summary>
|
|||
public EnumJobStatus JobStatus { get; set; } |
|||
|
|||
} |
@ -0,0 +1,46 @@ |
|||
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 TransferLibJobManager : SfsJobManagerBase<TransferLibJob, TransferLibJobDetail>, ITransferLibJobManager |
|||
{ |
|||
|
|||
public TransferLibJobManager( |
|||
ITransferLibJobRepository repository |
|||
) : base(repository) |
|||
{ |
|||
} |
|||
|
|||
public override void CheckDetails(TransferLibJob entity, AbpValidationResult result) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
public async Task<TransferLibJob> GetAsync(Expression<Func<TransferLibJob, bool>> expression) |
|||
{ |
|||
return await Repository.FindAsync(expression).ConfigureAwait(false); |
|||
} |
|||
|
|||
public override Task<List<TransferLibJob>> GetWorkingListByContainerAsync(string containerCode) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
public override Task<List<TransferLibJob>> GetWorkingListByPackingAsync(string packingCode) |
|||
{ |
|||
throw new NotImplementedException(); |
|||
} |
|||
|
|||
public async Task UpdateAsync(TransferLibJob TransferLibJob) |
|||
{ |
|||
await Repository.UpdateAsync(TransferLibJob).ConfigureAwait(false); |
|||
} |
|||
} |
@ -0,0 +1,10 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using Win_in.Sfs.Shared.Domain; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
public interface ITransferLibNoteManager : ISfsStoreManager<TransferLibNote, TransferLibNoteDetail>, IBulkImportService<TransferLibNote> |
|||
{ |
|||
Task<TransferLibNote> ConfirmAsync(Guid id); |
|||
} |
@ -0,0 +1,8 @@ |
|||
using Win_in.Sfs.Shared.Domain; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
public interface ITransferLibNoteRepository : ISfsStoreRepositoryBase<TransferLibNote>, ISfsBulkRepositoryBase<TransferLibNote> |
|||
{ |
|||
|
|||
} |
@ -0,0 +1,75 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Volo.Abp; |
|||
using Win_in.Sfs.Shared.Domain.Entities; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
/// <summary>
|
|||
/// 调拨转移记录
|
|||
/// </summary>
|
|||
public class TransferLibNote : SfsStoreAggregateRootBase<TransferLibNoteDetail>, IHasJobNumber |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 申请单号
|
|||
/// </summary>
|
|||
[IgnoreUpdate] |
|||
public string RequestNumber { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 任务单号
|
|||
/// </summary>
|
|||
[IgnoreUpdate] |
|||
public string JobNumber { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 调拨类型
|
|||
/// </summary>
|
|||
[Display(Name = "调拨类型")] |
|||
[Required(ErrorMessage = "调拨类型不能为空")] |
|||
public string Type { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 使用中间库
|
|||
/// </summary>
|
|||
[Display(Name = "使用中间库")] |
|||
public bool UseOnTheWayLocation { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 确认时间
|
|||
/// </summary>
|
|||
[Display(Name = "确认时间")] |
|||
[IgnoreUpdate] |
|||
public DateTime? ConfirmTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 明细列表
|
|||
/// </summary>
|
|||
[IgnoreUpdate] |
|||
public override List<TransferLibNoteDetail> Details { get; set; } = new List<TransferLibNoteDetail>(); |
|||
|
|||
/// <summary>
|
|||
/// 已确认
|
|||
/// </summary>
|
|||
[Display(Name = "已确认")] |
|||
public bool Confirmed { get; set; } |
|||
|
|||
public void Confirm(DateTime confirmTime) |
|||
{ |
|||
|
|||
CheckStatus(Confirmed); |
|||
Confirmed = true; |
|||
ConfirmTime = confirmTime; |
|||
} |
|||
|
|||
private static void CheckStatus(bool confirmed) |
|||
{ |
|||
if (confirmed) |
|||
{ |
|||
throw new UserFriendlyException($"当前状态为 【已确认】 ,无法再次确认!"); |
|||
} |
|||
|
|||
} |
|||
} |
@ -0,0 +1,26 @@ |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
/// <summary>
|
|||
/// 库存转移记录-明细表
|
|||
/// </summary>
|
|||
public class TransferLibNoteDetail : SfsStoreDetailWithFromToEntityBase |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 中间库地址
|
|||
/// </summary>
|
|||
public string OnTheWayLocationCode { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 原因
|
|||
/// </summary>
|
|||
public string Reason { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 执行任务状态
|
|||
/// </summary>
|
|||
public EnumJobStatus JobStatus { get; set; } |
|||
|
|||
} |
@ -0,0 +1,115 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
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 TransferLibNoteManager : SfsStoreManagerBase<TransferLibNote, TransferLibNoteDetail>, ITransferLibNoteManager |
|||
{ |
|||
|
|||
private readonly ITransferLibNoteRepository _repository; |
|||
|
|||
public TransferLibNoteManager( |
|||
ITransferLibNoteRepository repository |
|||
) : base(repository) |
|||
{ |
|||
_repository = repository; |
|||
} |
|||
|
|||
[UnitOfWork] |
|||
public virtual async Task<TransferLibNote> 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(TransferLibNote entity) |
|||
{ |
|||
try |
|||
{ |
|||
await LocalEventBus.PublishAsync(new SfsConfirmedEntityEventData<TransferLibNote>(entity), false).ConfigureAwait(false); |
|||
} |
|||
catch (Exception ex) |
|||
{ |
|||
Logger.LogDebug($"{nameof(TransferLibNote)} Confirmed Event:{ex.Message}", null); |
|||
Console.WriteLine(ex.Source); |
|||
throw; |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 执行导入
|
|||
/// </summary>
|
|||
public virtual async Task ImportDataAsync(List<TransferLibNote> mergeEntities, List<TransferLibNote> deleteEntities = null) |
|||
{ |
|||
if (deleteEntities != null && deleteEntities.Count > 0) |
|||
{ |
|||
await _repository.BulkDeleteAsync(deleteEntities).ConfigureAwait(false); |
|||
} |
|||
|
|||
foreach (var entity in mergeEntities) |
|||
{ |
|||
entity.SetIdAndNumberWithDetails(GuidGenerator, await GenerateNumberAsync(nameof(TransferLibNote), Clock.Now).ConfigureAwait(false)); |
|||
} |
|||
|
|||
await _repository.BulkMergeAsync(mergeEntities).ConfigureAwait(false); |
|||
|
|||
var insertDetails = new List<TransferLibNoteDetail>(); |
|||
|
|||
foreach (var item in mergeEntities) |
|||
{ |
|||
await SetDetailAsync(item.Details).ConfigureAwait(false); |
|||
|
|||
insertDetails.AddRange(item.Details); |
|||
} |
|||
|
|||
await _repository.BulkInsertAsync(insertDetails).ConfigureAwait(false); |
|||
} |
|||
|
|||
private async Task SetDetailAsync(List<TransferLibNoteDetail> details) |
|||
{ |
|||
foreach (var detail in details) |
|||
{ |
|||
var item = await ItemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); |
|||
Check.NotNull(item, "物品代码", $"物品 {detail.ItemCode} 不存在"); |
|||
|
|||
if (item != null) |
|||
{ |
|||
detail.ItemName = item.Name; |
|||
detail.ItemDesc1 = item.Desc1; |
|||
detail.ItemDesc2 = item.Desc2; |
|||
} |
|||
|
|||
var balance = await BalanceAppService.GetByItemLocationPackingAndStatusAsync(detail.FromPackingCode, detail.ItemCode, detail.FromLocationCode, detail.FromStatus).ConfigureAwait(false); |
|||
|
|||
Check.NotNull(balance, "库存", $"不存在箱码为{detail.FromPackingCode},零件编码为{detail.ItemCode},库位为{detail.FromLocationCode},状态为{detail.FromStatus}的库存!"); |
|||
|
|||
detail.SupplierBatch = balance.SupplierBatch; |
|||
detail.ArriveDate = balance.ArriveDate; |
|||
detail.ProduceDate = balance.ProduceDate; |
|||
detail.ExpireDate = balance.ExpireDate; |
|||
|
|||
//通过箱码和库位获取库存信息
|
|||
detail.FromStatus = balance.Status; |
|||
|
|||
detail.FromLot = balance.Lot; |
|||
detail.FromWarehouseCode = balance.WarehouseCode; |
|||
detail.FromContainerCode = balance.ContainerCode; |
|||
|
|||
detail.ToLot = balance.Lot; |
|||
detail.ToWarehouseCode = balance.WarehouseCode; |
|||
detail.ToContainerCode = balance.ContainerCode; |
|||
|
|||
detail.ToStatus = balance.Status; |
|||
|
|||
} |
|||
} |
|||
|
|||
} |
@ -0,0 +1,8 @@ |
|||
using Win_in.Sfs.Shared.Domain; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
public interface ITransferLibRequestManager : ISfsStoreRequestManager<TransferLibRequest, TransferLibRequestDetail>, IBulkImportService<TransferLibRequest> |
|||
{ |
|||
|
|||
} |
@ -0,0 +1,8 @@ |
|||
using Win_in.Sfs.Shared.Domain; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
public interface ITransferLibRequestRepository : ISfsStoreRepositoryBase<TransferLibRequest>, ISfsBulkRepositoryBase<TransferLibRequest> |
|||
{ |
|||
|
|||
} |
@ -0,0 +1,31 @@ |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using Win_in.Sfs.Shared.Domain.Entities; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
/// <summary>
|
|||
/// 调拨申请
|
|||
/// </summary>
|
|||
public class TransferLibRequest : SfsStoreRequestAggregateRootBase<TransferLibRequestDetail> |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 调拨类型
|
|||
/// </summary>
|
|||
[Display(Name = "调拨类型")] |
|||
public string Type { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 使用中间库
|
|||
/// </summary>
|
|||
[Display(Name = "使用中间库")] |
|||
public bool UseOnTheWayLocation { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 明细列表
|
|||
/// </summary>
|
|||
[IgnoreUpdate] |
|||
public override List<TransferLibRequestDetail> Details { get; set; } = new List<TransferLibRequestDetail>(); |
|||
|
|||
} |
@ -0,0 +1,24 @@ |
|||
using System.Text.Json; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
public class TransferLibRequestDetail : SfsStoreDetailWithFromToEntityBase |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 原因代码
|
|||
/// </summary>
|
|||
public string Reason { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 执行任务状态
|
|||
/// </summary>
|
|||
public EnumJobStatus JobStatus { get; set; } |
|||
|
|||
public override string ToString() |
|||
{ |
|||
return JsonSerializer.Serialize(this); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,75 @@ |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
public class TransferLibRequestManager : SfsStoreRequestManagerBase<TransferLibRequest, TransferLibRequestDetail>, ITransferLibRequestManager |
|||
{ |
|||
private readonly ITransferLibRequestRepository _repository; |
|||
|
|||
public TransferLibRequestManager( |
|||
ITransferLibRequestRepository repository |
|||
) : base(repository) |
|||
{ |
|||
_repository = repository; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 执行导入
|
|||
/// </summary>
|
|||
public virtual async Task ImportDataAsync(List<TransferLibRequest> transferLibRequests, List<TransferLibRequest> deleteEntities = null) |
|||
{ |
|||
if (deleteEntities != null && deleteEntities.Count > 0) |
|||
{ |
|||
await _repository.BulkDeleteAsync(deleteEntities).ConfigureAwait(false); |
|||
} |
|||
|
|||
_ = new List<TransferLibRequestDetail>(); |
|||
|
|||
foreach (var item in transferLibRequests) |
|||
{ |
|||
await BuildDetailAsync(item.Details).ConfigureAwait(false); |
|||
} |
|||
|
|||
await CreateManyAsync(transferLibRequests).ConfigureAwait(false); |
|||
} |
|||
|
|||
private async Task BuildDetailAsync(List<TransferLibRequestDetail> details) |
|||
{ |
|||
foreach (var detail in details) |
|||
{ |
|||
var item = await ItemBasicAppService.GetByCodeAsync(detail.ItemCode).ConfigureAwait(false); |
|||
Check.NotNull(item, "物品代码", $"物品 {detail.ItemCode} 不存在"); |
|||
|
|||
if (item != null) |
|||
{ |
|||
detail.ItemName = item.Name; |
|||
detail.ItemDesc1 = item.Desc1; |
|||
detail.ItemDesc2 = item.Desc2; |
|||
} |
|||
|
|||
var balance = await BalanceAppService.GetByItemLocationPackingAndStatusAsync(detail.FromPackingCode, detail.ItemCode, detail.FromLocationCode, detail.FromStatus).ConfigureAwait(false); |
|||
|
|||
Check.NotNull(balance, "库存", $"不存在箱码为{detail.FromPackingCode},零件编码为{detail.ItemCode},库位为{detail.FromLocationCode},状态为{detail.FromStatus}的库存!"); |
|||
|
|||
detail.SupplierBatch = balance.SupplierBatch; |
|||
detail.ArriveDate = balance.ArriveDate; |
|||
detail.ProduceDate = balance.ProduceDate; |
|||
detail.ExpireDate = balance.ExpireDate; |
|||
|
|||
//通过箱码和库位获取库存信息
|
|||
detail.FromStatus = balance.Status; |
|||
|
|||
detail.FromLot = balance.Lot; |
|||
detail.FromWarehouseCode = balance.WarehouseCode; |
|||
detail.FromContainerCode = balance.ContainerCode; |
|||
|
|||
detail.ToLot = balance.Lot; |
|||
detail.ToWarehouseCode = balance.WarehouseCode; |
|||
detail.ToContainerCode = balance.ContainerCode; |
|||
|
|||
detail.ToStatus = balance.Status; |
|||
} |
|||
} |
|||
} |
@ -0,0 +1,52 @@ |
|||
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 TransferLibJobDbContextModelCreatingExtensions |
|||
{ |
|||
public static void ConfigureTransferLibJob(this ModelBuilder builder, StoreModelBuilderConfigurationOptions options) |
|||
{ |
|||
builder.Entity<TransferLibJob>(b => |
|||
{ |
|||
//Configure table & schema name
|
|||
b.ToTable(StoreDbProperties.JobDbTablePrefix + nameof(TransferLibJob), options.Schema); |
|||
//Configure ABP properties
|
|||
b.ConfigureByConvention(); |
|||
//Configure Sfs base properties
|
|||
b.ConfigureSfsBase(); |
|||
//Configure Job base properties
|
|||
b.ConfigureJob<TransferLibJob, TransferLibJobDetail>(); |
|||
//Properties
|
|||
//b.Property(q => q.DeptCode).HasMaxLength(SfsPropertyConst.CodeLength);
|
|||
//b.Property(q => q.DeptName).HasMaxLength(SfsPropertyConst.NameLength);
|
|||
//b.Property(q => q.TransferLibRequestNumber).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<TransferLibJobDetail>(b => |
|||
{ |
|||
//Configure table & schema name
|
|||
b.ToTable(StoreDbProperties.JobDbTablePrefix + nameof(TransferLibJobDetail), options.Schema); |
|||
//Configure ABP properties
|
|||
b.ConfigureByConvention(); |
|||
//Configure Sfs base properties
|
|||
b.ConfigureSfsBase(); |
|||
//Configure Job base properties
|
|||
//b.ConfigureJobRecommendFromDetail();
|
|||
//Properties
|
|||
|
|||
//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 TransferLibJobEfCoreRepository : SfsJobEfCoreRepositoryBase<StoreDbContext, TransferLibJob>, ITransferLibJobRepository |
|||
{ |
|||
public TransferLibJobEfCoreRepository(IDbContextProvider<StoreDbContext> dbContextProvider) : base(dbContextProvider) |
|||
{ |
|||
} |
|||
} |
File diff suppressed because it is too large
File diff suppressed because it is too large
@ -1,19 +0,0 @@ |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Migrations |
|||
{ |
|||
public partial class @base : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
|
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
|
|||
} |
|||
} |
|||
} |
File diff suppressed because it is too large
@ -0,0 +1,361 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Migrations |
|||
{ |
|||
public partial class transferLib : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
|
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "Job_TransferLibJob", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
RequestNumber = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
JobNumber = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
Type = table.Column<string>(type: "nvarchar(max)", nullable: false), |
|||
UseOnTheWayLocation = table.Column<bool>(type: "bit", nullable: false), |
|||
ConfirmTime = table.Column<DateTime>(type: "datetime2", nullable: true), |
|||
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true), |
|||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), |
|||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true), |
|||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true), |
|||
Worker = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
Number = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
UpStreamJobNumber = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
JobDescription = table.Column<string>(type: "nvarchar(1024)", maxLength: 1024, nullable: true), |
|||
JobType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
JobStatus = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
Priority = table.Column<int>(type: "int", nullable: false, defaultValue: 0), |
|||
PriorityIncrement = table.Column<int>(type: "int", nullable: false, defaultValue: 0), |
|||
WorkGroupCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
IsAutoComplete = table.Column<bool>(type: "bit", nullable: false, defaultValue: false), |
|||
AcceptUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
AcceptUserName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
AcceptTime = table.Column<DateTime>(type: "datetime2", nullable: true), |
|||
CompleteUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
CompleteUserName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
CompleteTime = table.Column<DateTime>(type: "datetime2", nullable: true), |
|||
WarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_Job_TransferLibJob", x => x.Id); |
|||
}); |
|||
|
|||
|
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "Store_TransferLibNote", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
RequestNumber = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
JobNumber = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
Type = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
UseOnTheWayLocation = table.Column<bool>(type: "bit", nullable: false), |
|||
ConfirmTime = table.Column<DateTime>(type: "datetime2", nullable: true), |
|||
Confirmed = table.Column<bool>(type: "bit", nullable: false), |
|||
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true), |
|||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), |
|||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true), |
|||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true), |
|||
Worker = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
Number = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
ActiveDate = table.Column<DateTime>(type: "datetime2", nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_Store_TransferLibNote", x => x.Id); |
|||
}); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "Store_TransferLibRequest", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
Type = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
UseOnTheWayLocation = table.Column<bool>(type: "bit", nullable: false), |
|||
ExtraProperties = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
ConcurrencyStamp = table.Column<string>(type: "nvarchar(40)", maxLength: 40, nullable: true), |
|||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), |
|||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true), |
|||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true), |
|||
Worker = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
Number = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
ActiveDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
|||
AutoSubmit = table.Column<bool>(type: "bit", nullable: false), |
|||
AutoAgree = table.Column<bool>(type: "bit", nullable: false), |
|||
AutoHandle = table.Column<bool>(type: "bit", nullable: false), |
|||
AutoCompleteJob = table.Column<bool>(type: "bit", nullable: false), |
|||
DirectCreateNote = table.Column<bool>(type: "bit", nullable: false), |
|||
RequestStatus = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_Store_TransferLibRequest", x => x.Id); |
|||
}); |
|||
|
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "Job_TransferLibJobDetail", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
OnTheWayLocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
Reason = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
JobStatus = table.Column<int>(type: "int", nullable: false), |
|||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), |
|||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true), |
|||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
MasterID = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
Number = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true), |
|||
ItemName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
ItemDesc1 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
ItemDesc2 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
ItemCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
Uom = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
Qty = table.Column<decimal>(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false), |
|||
StdPackQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false), |
|||
FromPackingCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
ToPackingCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
FromContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
ToContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
FromLot = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
ToLot = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
SupplierBatch = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
ArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
|||
ProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
|||
ExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
|||
FromLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
FromLocationArea = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
FromLocationGroup = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
FromLocationErpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
FromWarehouseCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
FromStatus = table.Column<int>(type: "int", nullable: false), |
|||
ToLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
ToLocationArea = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
ToLocationGroup = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
ToLocationErpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
ToWarehouseCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
ToStatus = table.Column<int>(type: "int", nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_Job_TransferLibJobDetail", x => x.Id); |
|||
table.ForeignKey( |
|||
name: "FK_Job_TransferLibJobDetail_Job_TransferLibJob_MasterID", |
|||
column: x => x.MasterID, |
|||
principalTable: "Job_TransferLibJob", |
|||
principalColumn: "Id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}); |
|||
|
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "Store_TransferLibNoteDetail", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
OnTheWayLocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
Reason = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
JobStatus = table.Column<int>(type: "int", nullable: false), |
|||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), |
|||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true), |
|||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
MasterID = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
Number = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true), |
|||
ItemName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
ItemDesc1 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
ItemDesc2 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
ItemCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
Uom = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
Qty = table.Column<decimal>(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false), |
|||
StdPackQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false), |
|||
FromPackingCode = table.Column<string>(type: "nvarchar(450)", nullable: true), |
|||
ToPackingCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
FromContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
ToContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
FromLot = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
ToLot = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
SupplierBatch = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
ArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
|||
ProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
|||
ExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
|||
FromLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
FromLocationArea = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
FromLocationGroup = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
FromLocationErpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
FromWarehouseCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
FromStatus = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
ToLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
ToLocationArea = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
ToLocationGroup = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
ToLocationErpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
ToWarehouseCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
ToStatus = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_Store_TransferLibNoteDetail", x => x.Id); |
|||
table.ForeignKey( |
|||
name: "FK_Store_TransferLibNoteDetail_Store_TransferLibNote_MasterID", |
|||
column: x => x.MasterID, |
|||
principalTable: "Store_TransferLibNote", |
|||
principalColumn: "Id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}); |
|||
|
|||
migrationBuilder.CreateTable( |
|||
name: "Store_TransferLibRequestDetail", |
|||
columns: table => new |
|||
{ |
|||
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
Reason = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
JobStatus = table.Column<int>(type: "int", nullable: false), |
|||
CreationTime = table.Column<DateTime>(type: "datetime2", nullable: false), |
|||
CreatorId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
LastModificationTime = table.Column<DateTime>(type: "datetime2", nullable: true), |
|||
LastModifierId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
MasterID = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
|||
TenantId = table.Column<Guid>(type: "uniqueidentifier", nullable: true), |
|||
Number = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
Remark = table.Column<string>(type: "nvarchar(3072)", maxLength: 3072, nullable: true), |
|||
ItemName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
ItemDesc1 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
ItemDesc2 = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
ItemCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
Uom = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
Qty = table.Column<decimal>(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false), |
|||
StdPackQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false), |
|||
FromPackingCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
ToPackingCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
FromContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
ToContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
FromLot = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
ToLot = table.Column<string>(type: "nvarchar(max)", nullable: true), |
|||
SupplierBatch = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
ArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
|||
ProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
|||
ExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
|||
FromLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
FromLocationArea = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
FromLocationGroup = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
FromLocationErpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
FromWarehouseCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
FromStatus = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
ToLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
ToLocationArea = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
ToLocationGroup = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
|||
ToLocationErpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
ToWarehouseCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
|||
ToStatus = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false) |
|||
}, |
|||
constraints: table => |
|||
{ |
|||
table.PrimaryKey("PK_Store_TransferLibRequestDetail", x => x.Id); |
|||
table.ForeignKey( |
|||
name: "FK_Store_TransferLibRequestDetail_Store_TransferLibRequest_MasterID", |
|||
column: x => x.MasterID, |
|||
principalTable: "Store_TransferLibRequest", |
|||
principalColumn: "Id", |
|||
onDelete: ReferentialAction.Cascade); |
|||
}); |
|||
|
|||
|
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_Job_TransferLibJob_Number", |
|||
table: "Job_TransferLibJob", |
|||
column: "Number", |
|||
unique: true); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_Job_TransferLibJobDetail_MasterID", |
|||
table: "Job_TransferLibJobDetail", |
|||
column: "MasterID"); |
|||
|
|||
|
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_Store_TransferLibNote_Number", |
|||
table: "Store_TransferLibNote", |
|||
column: "Number", |
|||
unique: true); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_Store_TransferLibNoteDetail_MasterID", |
|||
table: "Store_TransferLibNoteDetail", |
|||
column: "MasterID"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_Store_TransferLibNoteDetail_Number_FromPackingCode_FromLocationCode_ToLocationCode_FromStatus_ToStatus", |
|||
table: "Store_TransferLibNoteDetail", |
|||
columns: new[] { "Number", "FromPackingCode", "FromLocationCode", "ToLocationCode", "FromStatus", "ToStatus" }, |
|||
unique: true, |
|||
filter: "[FromPackingCode] IS NOT NULL"); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_Store_TransferLibRequest_Number", |
|||
table: "Store_TransferLibRequest", |
|||
column: "Number", |
|||
unique: true); |
|||
|
|||
migrationBuilder.CreateIndex( |
|||
name: "IX_Store_TransferLibRequestDetail_MasterID", |
|||
table: "Store_TransferLibRequestDetail", |
|||
column: "MasterID"); |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "Job_TransferLibJobDetail"); |
|||
|
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "Store_TransferLibNoteDetail"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "Store_TransferLibRequestDetail"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "Job_ContainerJob"); |
|||
|
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "Job_TransferLibJob"); |
|||
|
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "Store_TransferLibNote"); |
|||
|
|||
migrationBuilder.DropTable( |
|||
name: "Store_TransferLibRequest"); |
|||
|
|||
} |
|||
} |
|||
} |
File diff suppressed because it is too large
@ -0,0 +1,52 @@ |
|||
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 TransferLibNoteDbContextModelCreatingExtensions |
|||
{ |
|||
public static void ConfigureTransferLibNote(this ModelBuilder builder, StoreModelBuilderConfigurationOptions options) |
|||
{ |
|||
builder.Entity<TransferLibNote>(b => |
|||
{ |
|||
//Configure table & schema name
|
|||
b.ToTable(options.TablePrefix + nameof(TransferLibNote), options.Schema); |
|||
//Configure ABP properties
|
|||
b.ConfigureByConvention(); |
|||
//Configure Sfs base properties
|
|||
b.ConfigureSfsStoreBase(); |
|||
//Properties
|
|||
b.Property(q => q.Type).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<TransferLibNoteDetail>(b => |
|||
{ |
|||
//Configure table & schema name
|
|||
b.ToTable(options.TablePrefix + nameof(TransferLibNoteDetail), 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.Reason).HasMaxLength(SfsPropertyConst.CodeLength); |
|||
b.Property(q => q.FromStatus).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>(); |
|||
b.Property(q => q.ToStatus).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>(); |
|||
|
|||
//Relations
|
|||
|
|||
//Indexes
|
|||
b.HasIndex(q => new { q.Number, q.FromPackingCode, q.FromLocationCode, q.ToLocationCode, q.FromStatus, q.ToStatus }).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 TransferLibNoteEfCoreRepository : SfsStoreEfCoreRepositoryBase<StoreDbContext, TransferLibNote>, ITransferLibNoteRepository |
|||
{ |
|||
public TransferLibNoteEfCoreRepository(IDbContextProvider<StoreDbContext> dbContextProvider) : base(dbContextProvider) |
|||
{ |
|||
} |
|||
} |
@ -0,0 +1,52 @@ |
|||
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 TransferLibRequestDbContextModelCreatingExtensions |
|||
{ |
|||
public static void ConfigureTransferLibRequest(this ModelBuilder builder, StoreModelBuilderConfigurationOptions options) |
|||
{ |
|||
builder.Entity<TransferLibRequest>(b => |
|||
{ |
|||
//Configure table & schema name
|
|||
b.ToTable(options.TablePrefix + nameof(TransferLibRequest), options.Schema); |
|||
//Configure ABP properties
|
|||
b.ConfigureByConvention(); |
|||
//Configure Sfs base properties
|
|||
b.ConfigureSfsStoreBase(); |
|||
//Properties
|
|||
b.Property(q => q.Type).HasMaxLength(SfsPropertyConst.CodeLength); |
|||
b.Property(q => q.RequestStatus).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>(); |
|||
|
|||
//Relations
|
|||
b.HasMany(q => q.Details).WithOne().HasForeignKey(d => d.MasterID).IsRequired(); |
|||
|
|||
//Indexes
|
|||
b.HasIndex(q => new { q.Number }).IsUnique(); |
|||
}); |
|||
|
|||
builder.Entity<TransferLibRequestDetail>(b => |
|||
{ |
|||
//Configure table & schema name
|
|||
b.ToTable(options.TablePrefix + nameof(TransferLibRequestDetail), 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.FromStatus).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>(); |
|||
b.Property(q => q.ToStatus).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>(); |
|||
|
|||
//Relations
|
|||
|
|||
//Indexes
|
|||
|
|||
}); |
|||
} |
|||
} |
@ -0,0 +1,11 @@ |
|||
using Volo.Abp.EntityFrameworkCore; |
|||
using Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.EntityFrameworkCore; |
|||
|
|||
public class TransferLibRequestEfCoreRepository : SfsStoreEfCoreRepositoryBase<StoreDbContext, TransferLibRequest>, ITransferLibRequestRepository |
|||
{ |
|||
public TransferLibRequestEfCoreRepository(IDbContextProvider<StoreDbContext> dbContextProvider) : base(dbContextProvider) |
|||
{ |
|||
} |
|||
} |
@ -0,0 +1,27 @@ |
|||
using System; |
|||
using AutoMapper; |
|||
using Volo.Abp.AutoMapper; |
|||
using Win_in.Sfs.Shared.Application; |
|||
using Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
using Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Event; |
|||
|
|||
public partial class StoreEventAutoMapperProfile : Profile |
|||
{ |
|||
private void TransferLibJobAutoMapperProfile() |
|||
{ |
|||
CreateMap<TransferLibJob, TransferLibNoteEditInput>() |
|||
.ForMember(x => x.JobNumber, y => y.MapFrom(d => d.Number)) |
|||
.ForMember(x => x.Worker, y => y.MapFrom(d => d.CompleteUserName)) |
|||
.ForMember(x => x.ActiveDate, y => y.MapFrom(d => DateTime.Now)) |
|||
.Ignore(x => x.Number) |
|||
.Ignore(x => x.Confirmed) |
|||
; |
|||
|
|||
CreateMap<TransferLibJobDetail, TransferLibNoteDetailInput>() |
|||
//.MapNormalFromHandledFrom()
|
|||
//.MapExtraProperties()
|
|||
; |
|||
} |
|||
} |
@ -0,0 +1,34 @@ |
|||
using AutoMapper; |
|||
using Volo.Abp.AutoMapper; |
|||
using Win_in.Sfs.Shared.Application; |
|||
using Win_in.Sfs.Wms.Inventory.Application.Contracts; |
|||
using Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
using Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Event; |
|||
|
|||
public partial class StoreEventAutoMapperProfile : Profile |
|||
{ |
|||
private void TransferLibNoteAutoMapperProfile() |
|||
{ |
|||
CreateMap<UnplannedIssueNoteDetail, TransactionEditInput>() |
|||
|
|||
.MapNegativeQty() |
|||
.ForMember(dest => dest.DocNumber, opts => opts.MapFrom(src => src.Number)) |
|||
.Ignore(x => x.DocNumber) |
|||
.Ignore(x => x.JobNumber) |
|||
.Ignore(x => x.Worker) |
|||
.Ignore(x => x.ManageType) |
|||
.Ignore(x => x.TransType) |
|||
.Ignore(x => x.TransSubType) |
|||
.Ignore(x => x.TransInOut) |
|||
.Ignore(x => x.ExtraProperties) |
|||
; |
|||
; |
|||
CreateMap<UnplannedIssueNote, UnplannedIssueNoteDTO>() |
|||
.ReverseMap(); |
|||
CreateMap<UnplannedIssueNoteDetail, UnplannedIssueNoteDetailDTO>() |
|||
.ReverseMap(); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,24 @@ |
|||
using AutoMapper; |
|||
using Volo.Abp.AutoMapper; |
|||
using Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Event; |
|||
|
|||
public partial class StoreEventAutoMapperProfile : Profile |
|||
{ |
|||
private void TransferLibRequestAutoMapperProfile() |
|||
{ |
|||
CreateMap<TransferLibRequest, TransferLibNote>() |
|||
.IgnoreAuditedObjectProperties() |
|||
.ForMember(x => x.RequestNumber, y => y.MapFrom(d => d.Number)) |
|||
.ForMember(x => x.Confirmed, y => y.MapFrom(d => !d.UseOnTheWayLocation)) |
|||
.Ignore(x => x.ConfirmTime) |
|||
.Ignore(x => x.JobNumber) |
|||
.Ignore(x => x.Number) |
|||
.Ignore(x => x.Id); |
|||
|
|||
CreateMap<TransferLibRequestDetail, TransferLibNoteDetail>() |
|||
.Ignore(x => x.OnTheWayLocationCode); |
|||
|
|||
} |
|||
} |
@ -0,0 +1,84 @@ |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.EventBus; |
|||
using Volo.Abp.Uow; |
|||
using Win_in.Sfs.Shared.Domain.Shared; |
|||
using Win_in.Sfs.Shared.Event; |
|||
using Win_in.Sfs.Wms.Store.Application.Contracts; |
|||
using Win_in.Sfs.Wms.Store.Domain; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Event.BusinessJob; |
|||
|
|||
public class TransferLibJobEventHandler : |
|||
StoreEventHandlerBase |
|||
, ILocalEventHandler<SfsCreatedEntityEventData<TransferLibJob>> |
|||
, ILocalEventHandler<SfsCompletedEntityEventData<TransferLibJob>> |
|||
{ |
|||
private readonly ITransferLibNoteAppService _noteApp; |
|||
|
|||
public TransferLibJobEventHandler( |
|||
ITransferLibNoteAppService noteApp |
|||
) |
|||
{ |
|||
_noteApp = noteApp; |
|||
} |
|||
|
|||
[UnitOfWork] |
|||
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<TransferLibJob> eventData) |
|||
{ |
|||
var entity = eventData.Entity; |
|||
|
|||
if (!entity.IsAutoComplete) |
|||
{ |
|||
return; |
|||
} |
|||
|
|||
entity.CompleteTime = Clock.Now; |
|||
entity.JobStatus = EnumJobStatus.Done; |
|||
|
|||
foreach (var detail in eventData.Entity.Details) |
|||
{ |
|||
//detail.SetHandledFromRecommend();
|
|||
} |
|||
|
|||
var note = BuildTransferLibNoteCreateInput(entity); |
|||
await _noteApp.CreateAsync(note).ConfigureAwait(false); |
|||
|
|||
} |
|||
|
|||
[UnitOfWork] |
|||
public virtual async Task HandleEventAsync(SfsCompletedEntityEventData<TransferLibJob> eventData) |
|||
{ |
|||
var entity = eventData.Entity; |
|||
var note = BuildTransferLibNoteCreateInput(entity); |
|||
await _noteApp.CreateAsync(note).ConfigureAwait(false); |
|||
|
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 创建补料记录实体
|
|||
/// </summary>
|
|||
/// <param name="entity"></param>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
private TransferLibNoteEditInput BuildTransferLibNoteCreateInput(TransferLibJob entity) |
|||
{ |
|||
var createInput = ObjectMapper.Map<TransferLibJob, TransferLibNoteEditInput>(entity); |
|||
createInput.Details.RemoveAll(p => p.Qty == 0); |
|||
|
|||
/* |
|||
createInput.Details = new List<TransferLibNoteDetailInput>(); |
|||
|
|||
foreach (var inputDetail in entity.Details) |
|||
{ |
|||
var detail = ObjectMapper.Map<TransferLibJobDetail, TransferLibNoteDetailInput>(inputDetail); |
|||
|
|||
detail.ExtraProperties = inputDetail.ExtraProperties; |
|||
|
|||
createInput.Details.Add(detail); |
|||
} |
|||
*/ |
|||
|
|||
return createInput; |
|||
} |
|||
|
|||
} |
@ -0,0 +1,145 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using DocumentFormat.OpenXml.Bibliography; |
|||
using Volo.Abp.EventBus; |
|||
using Volo.Abp.EventBus.Local; |
|||
using Volo.Abp.SettingManagement; |
|||
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.Domain; |
|||
using Win_in.Sfs.Wms.Store.Domain.Shared; |
|||
|
|||
namespace Win_in.Sfs.Wms.Store.Event.BusinessRequest; |
|||
|
|||
public class TransferLibRequestEventHandler |
|||
: StoreEventHandlerBase |
|||
, ILocalEventHandler<SfsCreatedEntityEventData<TransferLibRequest>> |
|||
, ILocalEventHandler<SfsCreatedEntityEventData<List<TransferLibRequest>>> |
|||
, ILocalEventHandler<SfsHandledEntityEventData<TransferLibRequest>> |
|||
//, ILocalEventHandler<SfsSubmittedEntityEventData<TransferLibRequest>>
|
|||
//, ILocalEventHandler<SfsAgreedEntityEventData<TransferLibRequest>>
|
|||
|
|||
{ |
|||
private readonly ITransferLibNoteManager _transferLibNoteManager; |
|||
private readonly ILocationAppService _locationAppService; |
|||
private readonly ITransferLibRequestManager _transferLibRequestManager; |
|||
protected ILocalEventBus LocalEventBus => LazyServiceProvider.LazyGetRequiredService<ILocalEventBus>(); |
|||
|
|||
public TransferLibRequestEventHandler( |
|||
ITransferLibNoteManager transferLibNoteManager, ILocationAppService locationAppService, ITransferLibRequestManager transferLibRequestManager) |
|||
{ |
|||
_transferLibNoteManager = transferLibNoteManager; |
|||
_locationAppService = locationAppService; |
|||
_transferLibRequestManager = transferLibRequestManager; |
|||
} |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 库存转移 审批通过 后
|
|||
/// </summary>
|
|||
/// <param name="eventData"></param>
|
|||
/// <returns></returns>
|
|||
/// <exception cref="System.NotImplementedException"></exception>
|
|||
[UnitOfWork] |
|||
public async Task HandleEventAsync(SfsHandledEntityEventData<TransferLibRequest> eventData) |
|||
{ |
|||
var entity = eventData.Entity; |
|||
var enumTransSubType = Enum.Parse<EnumTransSubType>(entity.Type); |
|||
|
|||
if (entity.DirectCreateNote) |
|||
{ |
|||
var input = ObjectMapper.Map<TransferLibRequest, TransferLibNote>(entity); |
|||
|
|||
//获取在途库
|
|||
var locationDto = await _locationAppService.GetFirstByTypeAsync(EnumLocationType.TRANSPORT) |
|||
.ConfigureAwait(false); |
|||
|
|||
var transferOnTheWayLocation = |
|||
await SettingManager.GetOrNullGlobalAsync(StoreSettings.Common.TransferOnTheWayLocation) |
|||
.ConfigureAwait(false); |
|||
|
|||
input.Details.ForEach(p => { p.OnTheWayLocationCode = locationDto.Code; }); |
|||
|
|||
await _transferLibNoteManager.CreateAsync(input).ConfigureAwait(false); |
|||
} |
|||
|
|||
switch (enumTransSubType) |
|||
{ |
|||
case EnumTransSubType.Transfer_Inside: |
|||
case EnumTransSubType.Transfer_Area: |
|||
break; |
|||
case EnumTransSubType.Transfer_Warehouse: |
|||
case EnumTransSubType.Transfer_Customer: |
|||
case EnumTransSubType.Transfer_WIP: |
|||
// entity.Handle();
|
|||
entity.Complete(); |
|||
break; |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 库移创建后
|
|||
/// </summary>
|
|||
/// <param name="eventData">Event data</param>
|
|||
[UnitOfWork] |
|||
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<TransferLibRequest> eventData) |
|||
{ |
|||
var entity = eventData.Entity; |
|||
if (entity.AutoSubmit) |
|||
{ |
|||
await _transferLibRequestManager.SubmitAsync(entity).ConfigureAwait(false); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 库移批量创建后
|
|||
/// </summary>
|
|||
/// <param name="eventData">Event data</param>
|
|||
[UnitOfWork] |
|||
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<List<TransferLibRequest>> eventData) |
|||
{ |
|||
var entitys = eventData.Entity; |
|||
foreach (var entity in entitys) |
|||
{ |
|||
if (entity.AutoSubmit) |
|||
{ |
|||
await _transferLibRequestManager.SubmitAsync(entity).ConfigureAwait(false); |
|||
} |
|||
} |
|||
} |
|||
|
|||
///// <summary>
|
|||
///// 提交后
|
|||
///// </summary>
|
|||
///// <param name="eventData">Event data</param>
|
|||
//[UnitOfWork]
|
|||
//public virtual async Task HandleEventAsync(SfsSubmittedEntityEventData<TransferLibRequest> eventData)
|
|||
//{
|
|||
// var entity = eventData.Entity;
|
|||
// if (entity.AutoAgree)
|
|||
// {
|
|||
// entity.Agree();
|
|||
// await LocalEventBus.PublishAsync(new SfsAgreedEntityEventData<TransferLibRequest>(entity), false)
|
|||
// .ConfigureAwait(false);
|
|||
// }
|
|||
//}
|
|||
|
|||
///// <summary>
|
|||
///// 审批后
|
|||
///// </summary>
|
|||
///// <param name="eventData">Event data</param>
|
|||
//[UnitOfWork]
|
|||
//public virtual async Task HandleEventAsync(SfsAgreedEntityEventData<TransferLibRequest> eventData)
|
|||
//{
|
|||
// var entity = eventData.Entity;
|
|||
// if (entity.AutoHandle)
|
|||
// {
|
|||
// entity.Handle();
|
|||
// await LocalEventBus.PublishAsync(new SfsHandledEntityEventData<TransferLibRequest>(entity), false)
|
|||
// .ConfigureAwait(false);
|
|||
// }
|
|||
//}
|
|||
} |
Loading…
Reference in new issue