66 changed files with 43370 additions and 3 deletions
@ -0,0 +1,188 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text.Json; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Volo.Abp; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
using Volo.Abp.AspNetCore.Mvc; |
||||
|
using Win_in.Sfs.Auth.Application.Contracts; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Pda.Controllers.Jobs.IssueJobs; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 备件叫料PDA任务
|
||||
|
/// </summary>
|
||||
|
[ApiController] |
||||
|
[Route($"{PdaHostConst.ROOT_ROUTE}job/spare-part-issue")] |
||||
|
public class SparePartIssueJobsController : AbpController |
||||
|
{ |
||||
|
private readonly ISparePartIssueJobAppService _sparePartIssueJobAppService; |
||||
|
|
||||
|
private readonly IUserWorkGroupAppService _userWorkGroupAppService; |
||||
|
|
||||
|
public SparePartIssueJobsController(ISparePartIssueJobAppService sparePartIssueJobAppService, IUserWorkGroupAppService userWorkGroupAppService) |
||||
|
{ |
||||
|
_sparePartIssueJobAppService = sparePartIssueJobAppService; |
||||
|
_userWorkGroupAppService = userWorkGroupAppService; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 获取列表
|
||||
|
/// </summary>
|
||||
|
/// <param name="pageSize"></param>
|
||||
|
/// <param name="pageIndex"></param>
|
||||
|
/// <param name="isFinished"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost("list")] |
||||
|
public virtual async Task<PagedResultDto<SparePartIssueJobDTO>> GetListAsync(int pageSize, int pageIndex, |
||||
|
bool isFinished) |
||||
|
{ |
||||
|
var status = new List<int>(); |
||||
|
if (isFinished) |
||||
|
{ |
||||
|
status.Add((int)EnumJobStatus.Done); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
status.Add((int)EnumJobStatus.Open); |
||||
|
status.Add((int)EnumJobStatus.Wait); |
||||
|
status.Add((int)EnumJobStatus.Doing); |
||||
|
status.Add((int)EnumJobStatus.Partial); |
||||
|
} |
||||
|
|
||||
|
var jsonStatus = JsonSerializer.Serialize(status); |
||||
|
|
||||
|
var request = new SfsJobRequestInputBase |
||||
|
{ |
||||
|
MaxResultCount = pageSize, |
||||
|
SkipCount = (pageIndex - 1) * pageSize, |
||||
|
Sorting = $"{nameof(ContainerJobDTO.CreationTime)} ASC", |
||||
|
Condition = new Condition |
||||
|
{ |
||||
|
Filters = new List<Filter> { new(nameof(ContainerJobDTO.JobStatus), jsonStatus, "In") } |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
var list = await _sparePartIssueJobAppService.GetPagedListByFilterAsync(request, true).ConfigureAwait(false); |
||||
|
|
||||
|
return list; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 承接任务
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost("take/{id}")] |
||||
|
public virtual async Task TakeAsync(Guid id) |
||||
|
{ |
||||
|
await _sparePartIssueJobAppService.AcceptAsync(id).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 取消承接任务
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost("cancel-take/{id}")] |
||||
|
public virtual async Task CancelTakeAsync(Guid id) |
||||
|
{ |
||||
|
await _sparePartIssueJobAppService.CancelAcceptAsync(id).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 执行任务明细
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost("ExecuteDetail/{masterId}")] |
||||
|
public async Task ExecuteDetailAsync(Guid masterId, Guid detailId, SparePartIssueJobDetailDTO issueJobDetailDto) |
||||
|
{ |
||||
|
await _sparePartIssueJobAppService.ExecuteDetailAsync(masterId, detailId, issueJobDetailDto).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 获取任务数量
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpGet("count")] |
||||
|
public virtual async Task<ActionResult<long>> CountAsync() |
||||
|
{ |
||||
|
var status = new List<int> |
||||
|
{ |
||||
|
(int)EnumJobStatus.Open, (int)EnumJobStatus.Doing, (int)EnumJobStatus.Partial, (int)EnumJobStatus.Wait |
||||
|
}; |
||||
|
var jsonStatus = JsonSerializer.Serialize(status); |
||||
|
|
||||
|
var request = new SfsJobRequestInputBase |
||||
|
{ |
||||
|
Sorting = $"{nameof(InspectJobDTO.Priority)} ASC", |
||||
|
Condition = new Condition |
||||
|
{ |
||||
|
Filters = new List<Filter> |
||||
|
{ |
||||
|
//new(nameof(InspectJobDTO.WorkGroupCode),jsonCodes,"In"),
|
||||
|
new(nameof(InspectJobDTO.JobStatus), jsonStatus, "In") |
||||
|
} |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
var count = await _sparePartIssueJobAppService.GetCountByFilterAsync(request).ConfigureAwait(false); |
||||
|
|
||||
|
return Ok(count); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 获取任务详情
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpGet("{id}")] |
||||
|
public virtual async Task<ActionResult<SparePartIssueJobDTO>> GetAsync(Guid id) |
||||
|
{ |
||||
|
var result = await _sparePartIssueJobAppService.GetAsync(id).ConfigureAwait(false); |
||||
|
return Ok(result); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 根据Job Number 获取盘点任务列表
|
||||
|
/// </summary>
|
||||
|
/// <param name="jobNumber"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpGet("by-number/{jobNumber}")] |
||||
|
public virtual async Task<ActionResult<SparePartIssueJobDTO>> GetByNumberAsync(string jobNumber) |
||||
|
{ |
||||
|
var jobDto = await _sparePartIssueJobAppService.GetByNumberAsync(jobNumber).ConfigureAwait(false); |
||||
|
if (jobDto == null) |
||||
|
{ |
||||
|
throw new UserFriendlyException($"未找到编号为 {jobNumber} 的任务"); |
||||
|
} |
||||
|
|
||||
|
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); |
||||
|
if (!wlgCodes.Contains(jobDto.WorkGroupCode)) |
||||
|
{ |
||||
|
return new NotFoundObjectResult($"任务属于工作组 {jobDto.WorkGroupCode}"); |
||||
|
} |
||||
|
|
||||
|
if (jobDto.JobStatus == EnumJobStatus.Doing && jobDto.AcceptUserId != CurrentUser.Id) |
||||
|
{ |
||||
|
return new NotFoundObjectResult($"任务正在被 {jobDto.AcceptUserName} 处理"); |
||||
|
} |
||||
|
|
||||
|
return jobDto; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <param name="requestNumber"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost("by-request-number/{requestNumber}")] |
||||
|
public virtual async Task<List<SparePartIssueJobDTO>> GetByRequestNumberAsync(string requestNumber) |
||||
|
{ |
||||
|
return await _sparePartIssueJobAppService.GetByRequestNumberAsync(requestNumber).ConfigureAwait(false); |
||||
|
} |
||||
|
} |
@ -0,0 +1,135 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Text.Json; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Volo.Abp; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
using Volo.Abp.AspNetCore.Mvc; |
||||
|
using Win_in.Sfs.Auth.Application.Contracts; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Pda.Controllers.Stores; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 备件叫料请求
|
||||
|
/// </summary>
|
||||
|
[ApiController] |
||||
|
[Route($"{PdaHostConst.ROOT_ROUTE}store/spare-part-request")] |
||||
|
public class SparePartRequestController : AbpController |
||||
|
{ |
||||
|
private readonly ISparePartIssueRequestAppService _sparePartIssueRequestAppService; |
||||
|
|
||||
|
private readonly IUserWorkGroupAppService _userWorkGroupAppService; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// </summary>
|
||||
|
/// <param name="sparePartIssueRequestAppService"></param>
|
||||
|
public SparePartRequestController(ISparePartIssueRequestAppService sparePartIssueRequestAppService, |
||||
|
IUserWorkGroupAppService userWorkGroupAppService) |
||||
|
{ |
||||
|
_sparePartIssueRequestAppService = sparePartIssueRequestAppService; |
||||
|
_userWorkGroupAppService = userWorkGroupAppService; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 备件叫料申请
|
||||
|
/// </summary>
|
||||
|
/// <param name="input"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost("")] |
||||
|
public virtual async Task CreateAsync(SparePartIssueRequestEditInput input) |
||||
|
{ |
||||
|
await _sparePartIssueRequestAppService.CreateAndHandleAsync(input).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// </summary>
|
||||
|
/// <param name="pageSize"></param>
|
||||
|
/// <param name="pageIndex"></param>
|
||||
|
/// <param name="isFinished"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost("list")] |
||||
|
public virtual async Task<PagedResultDto<SparePartIssueRequestDTO>> GetListAsync(int pageSize, int pageIndex, |
||||
|
bool isFinished) |
||||
|
{ |
||||
|
var status = new List<int>(); |
||||
|
if (isFinished) |
||||
|
{ |
||||
|
status.Add((int)EnumRequestStatus.Completed); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
status.Add((int)EnumRequestStatus.Partial); |
||||
|
status.Add((int)EnumRequestStatus.Handling); |
||||
|
status.Add((int)EnumRequestStatus.New); |
||||
|
} |
||||
|
|
||||
|
var jsonStatus = JsonSerializer.Serialize(status); |
||||
|
|
||||
|
var request = new SfsStoreRequestInputBase |
||||
|
{ |
||||
|
MaxResultCount = pageSize, |
||||
|
SkipCount = (pageIndex - 1) * pageSize, |
||||
|
Sorting = $"{nameof(SparePartIssueRequestDTO.CreationTime)} ASC", |
||||
|
Condition = new Condition |
||||
|
{ |
||||
|
Filters = new List<Filter> { new(nameof(SparePartIssueRequestDTO.RequestStatus), jsonStatus, "In") } |
||||
|
} |
||||
|
}; |
||||
|
|
||||
|
var list = await _sparePartIssueRequestAppService.GetPagedListByFilterAsync(request, true).ConfigureAwait(false); |
||||
|
|
||||
|
return list; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
[HttpPost("handle/{id}")] |
||||
|
public virtual async Task HandleAsync(Guid id) |
||||
|
{ |
||||
|
await _sparePartIssueRequestAppService.HandleAsync(id).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 根据Job Number 获取盘点任务列表
|
||||
|
/// </summary>
|
||||
|
/// <param name="requestNumber"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpGet("by-number/{requestNumber}")] |
||||
|
public virtual async Task<ActionResult<SparePartIssueRequestDTO>> GetByNumberAsync(string requestNumber) |
||||
|
{ |
||||
|
var jobDto = await _sparePartIssueRequestAppService.GetByNumberAsync(requestNumber).ConfigureAwait(false); |
||||
|
if (jobDto == null) |
||||
|
{ |
||||
|
throw new UserFriendlyException($"未找到编号为 {requestNumber} 的请求"); |
||||
|
} |
||||
|
|
||||
|
return jobDto; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 获取任务详情
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpGet("{id}")] |
||||
|
public virtual async Task<ActionResult<SparePartIssueRequestDTO>> GetAsync(Guid id) |
||||
|
{ |
||||
|
var result = await _sparePartIssueRequestAppService.GetAsync(id).ConfigureAwait(false); |
||||
|
return Ok(result); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
///
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost("IsHasNewJob")] |
||||
|
public virtual async Task<string> IsHasNewJobAsync(string requestNumber, List<string> jobNumber) |
||||
|
{ |
||||
|
return await _sparePartIssueRequestAppService.IsHasNewJobAsync(requestNumber, jobNumber).ConfigureAwait(false); |
||||
|
} |
||||
|
} |
@ -0,0 +1,40 @@ |
|||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 备件叫料任务
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "备件叫料任务")] |
||||
|
public class SparePartIssueJobDTO : SfsJobDTOBase<SparePartIssueJobDetailDTO> |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 叫料类型
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "叫料类型")] |
||||
|
public EnumIssueRequestType IssueRequestType { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 生产线
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "生产线")] |
||||
|
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] |
||||
|
public string ProdLine { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 要货单号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "要货单号")] |
||||
|
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] |
||||
|
public string SparePartRequestNumber { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 使用在途库
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "使用在途库")] |
||||
|
public bool UseOnTheWayLocation { get; set; } |
||||
|
|
||||
|
public EnumIssueSendType EnumIssueSendType { get; set; } |
||||
|
} |
@ -0,0 +1,519 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
using Win_in.Sfs.Shared.Application.Contracts; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
public class SparePartIssueJobDetailDTO : SfsDetailDTOBase |
||||
|
{ |
||||
|
#region 库存基础信息
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 物品代码
|
||||
|
/// </summary>
|
||||
|
public string ItemCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 物品名称
|
||||
|
/// </summary>
|
||||
|
public string ItemName { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 物品描述1
|
||||
|
/// </summary>
|
||||
|
public string ItemDesc1 { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 物品描述2
|
||||
|
/// </summary>
|
||||
|
public string ItemDesc2 { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 标包数量
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "标包数量")] |
||||
|
[Column(TypeName = "decimal(18,6)")] |
||||
|
public decimal StdPackQty { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库存状态
|
||||
|
/// </summary>
|
||||
|
public EnumInventoryStatus Status { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 计量单位
|
||||
|
/// </summary>
|
||||
|
public string Uom { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 请求信息
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 请求库位
|
||||
|
/// </summary>
|
||||
|
public string RequestLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 到库区
|
||||
|
/// </summary>
|
||||
|
public string RequestLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 到库位组
|
||||
|
/// </summary>
|
||||
|
public string RequestLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 到ERP库位
|
||||
|
/// </summary>
|
||||
|
public string RequestLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 到仓库
|
||||
|
/// </summary>
|
||||
|
public string RequestWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 在途库库位
|
||||
|
/// </summary>
|
||||
|
public string OnTheWayLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 生产线
|
||||
|
/// </summary>
|
||||
|
public string ProdLine { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 位置码
|
||||
|
/// </summary>
|
||||
|
public string PositionCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐的类型
|
||||
|
/// </summary>
|
||||
|
public EnumRecommendType RecommendType { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 需求数量
|
||||
|
/// </summary>
|
||||
|
public decimal RequestQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 推荐来源
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源托标签
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源箱标签
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendFromArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendFromProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendFromExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次排序
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源库位
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源库区
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源库位组
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源ERP库位
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源仓库
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源数量
|
||||
|
/// </summary>
|
||||
|
public decimal RecommendFromQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 推荐目标
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标托标签
|
||||
|
/// </summary>
|
||||
|
public string RecommendToContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标箱标签
|
||||
|
/// </summary>
|
||||
|
public string RecommendToPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string RecommendToSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendToArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendToProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendToExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次排序
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标库位
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标库区
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标库位组
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标ERP库位
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标仓库
|
||||
|
/// </summary>
|
||||
|
public string RecommendToWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标数量
|
||||
|
/// </summary>
|
||||
|
public decimal RecommendToQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 库移来源
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源托标签
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源箱标签
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibFromArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibFromProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibFromExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次排序
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源库位
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源库区
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源库位组
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源ERP库位
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源仓库
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源数量
|
||||
|
/// </summary>
|
||||
|
public decimal TransferLibFromQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 库移目标
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标托标签
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标箱标签
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibToArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibToProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibToExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次排序
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标库位
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标库区
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标库位组
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标ERP库位
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标仓库
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标数量
|
||||
|
/// </summary>
|
||||
|
public decimal TransferLibToQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 实际来源
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际目标托标签
|
||||
|
/// </summary>
|
||||
|
public string HandledFromContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际箱标签
|
||||
|
/// </summary>
|
||||
|
public string HandledFromPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string HandledFromSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledFromArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledFromProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledFromExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次排序
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库位
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库区
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库位组
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际ERP库位
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际仓库
|
||||
|
/// </summary>
|
||||
|
public string HandledFromWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际数量
|
||||
|
/// </summary>
|
||||
|
public decimal HandledFromQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 实际目标
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际目标托标签
|
||||
|
/// </summary>
|
||||
|
public string HandledToContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际箱标签
|
||||
|
/// </summary>
|
||||
|
public string HandledToPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string HandledToSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledToArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledToProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledToExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次排序
|
||||
|
/// </summary>
|
||||
|
public string HandledToLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库位
|
||||
|
/// </summary>
|
||||
|
public string HandledToLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库区
|
||||
|
/// </summary>
|
||||
|
public string HandledToLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库位组
|
||||
|
/// </summary>
|
||||
|
public string HandledToLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际ERP库位
|
||||
|
/// </summary>
|
||||
|
public string HandledToLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际仓库
|
||||
|
/// </summary>
|
||||
|
public string HandledToWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际数量
|
||||
|
/// </summary>
|
||||
|
public decimal HandledToQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
} |
@ -0,0 +1,27 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
public interface ISparePartIssueJobAppService |
||||
|
: ISfsJobAppServiceBase<SparePartIssueJobDTO, SfsJobRequestInputBase, SparePartIssueJobCheckInput, |
||||
|
SparePartIssueJobEditInput> |
||||
|
{ |
||||
|
Task<List<SparePartIssueJobDTO>> GetByRequestNumberAsync(string requestNumber); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 执行任务明细
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
Task ExecuteDetailAsync(Guid masterId, Guid detailId, SparePartIssueJobDetailDTO issueJobDetailDto); |
||||
|
|
||||
|
Task CompleteAsync(Guid id); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 请求点了完成,任务全部都完成
|
||||
|
/// </summary>
|
||||
|
/// <param name="requestNumber"></param>
|
||||
|
/// <returns></returns>
|
||||
|
Task CompleteByRequestNumberAsync(string requestNumber); |
||||
|
} |
@ -0,0 +1,6 @@ |
|||||
|
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
public class SparePartIssueJobCheckInput : SfsJobCheckInputBase |
||||
|
{ |
||||
|
|
||||
|
} |
@ -0,0 +1,519 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
using Win_in.Sfs.Shared.Application.Contracts; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
public class SparePartIssueJobDetailInput : SfsDetailInputBase |
||||
|
{ |
||||
|
#region 库存基础信息
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 物品代码
|
||||
|
/// </summary>
|
||||
|
public string ItemCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 物品名称
|
||||
|
/// </summary>
|
||||
|
public string ItemName { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 物品描述1
|
||||
|
/// </summary>
|
||||
|
public string ItemDesc1 { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 物品描述2
|
||||
|
/// </summary>
|
||||
|
public string ItemDesc2 { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 标包数量
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "标包数量")] |
||||
|
[Column(TypeName = "decimal(18,6)")] |
||||
|
public decimal StdPackQty { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库存状态
|
||||
|
/// </summary>
|
||||
|
public EnumInventoryStatus Status { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 计量单位
|
||||
|
/// </summary>
|
||||
|
public string Uom { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 请求信息
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 请求库位
|
||||
|
/// </summary>
|
||||
|
public string RequestLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 到库区
|
||||
|
/// </summary>
|
||||
|
public string RequestLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 到库位组
|
||||
|
/// </summary>
|
||||
|
public string RequestLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 到ERP库位
|
||||
|
/// </summary>
|
||||
|
public string RequestLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 到仓库
|
||||
|
/// </summary>
|
||||
|
public string RequestWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 在途库库位
|
||||
|
/// </summary>
|
||||
|
public string OnTheWayLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 生产线
|
||||
|
/// </summary>
|
||||
|
public string ProdLine { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 位置码
|
||||
|
/// </summary>
|
||||
|
public string PositionCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐的类型
|
||||
|
/// </summary>
|
||||
|
public EnumRecommendType RecommendType { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 需求数量
|
||||
|
/// </summary>
|
||||
|
public decimal RequestQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 推荐来源
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源托标签
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源箱标签
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendFromArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendFromProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendFromExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次排序
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源库位
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源库区
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源库位组
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源ERP库位
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源仓库
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源数量
|
||||
|
/// </summary>
|
||||
|
public decimal RecommendFromQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 推荐目标
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标托标签
|
||||
|
/// </summary>
|
||||
|
public string RecommendToContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标箱标签
|
||||
|
/// </summary>
|
||||
|
public string RecommendToPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string RecommendToSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendToArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendToProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendToExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次排序
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标库位
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标库区
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标库位组
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标ERP库位
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标仓库
|
||||
|
/// </summary>
|
||||
|
public string RecommendToWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标数量
|
||||
|
/// </summary>
|
||||
|
public decimal RecommendToQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 库移来源
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源托标签
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源箱标签
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibFromArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibFromProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibFromExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次排序
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源库位
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源库区
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源库位组
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源ERP库位
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源仓库
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源数量
|
||||
|
/// </summary>
|
||||
|
public decimal TransferLibFromQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 库移目标
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标托标签
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标箱标签
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibToArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibToProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibToExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次排序
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标库位
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标库区
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标库位组
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标ERP库位
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标仓库
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标数量
|
||||
|
/// </summary>
|
||||
|
public decimal TransferLibToQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 实际来源
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际目标托标签
|
||||
|
/// </summary>
|
||||
|
public string HandledFromContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际箱标签
|
||||
|
/// </summary>
|
||||
|
public string HandledFromPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string HandledFromSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledFromArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledFromProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledFromExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次排序
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库位
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库区
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库位组
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际ERP库位
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际仓库
|
||||
|
/// </summary>
|
||||
|
public string HandledFromWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际数量
|
||||
|
/// </summary>
|
||||
|
public decimal HandledFromQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 实际目标
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际目标托标签
|
||||
|
/// </summary>
|
||||
|
public string HandledToContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际箱标签
|
||||
|
/// </summary>
|
||||
|
public string HandledToPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string HandledToSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledToArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledToProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledToExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次排序
|
||||
|
/// </summary>
|
||||
|
public string HandledToLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库位
|
||||
|
/// </summary>
|
||||
|
public string HandledToLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库区
|
||||
|
/// </summary>
|
||||
|
public string HandledToLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库位组
|
||||
|
/// </summary>
|
||||
|
public string HandledToLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际ERP库位
|
||||
|
/// </summary>
|
||||
|
public string HandledToLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际仓库
|
||||
|
/// </summary>
|
||||
|
public string HandledToWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际数量
|
||||
|
/// </summary>
|
||||
|
public decimal HandledToQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
} |
@ -0,0 +1,70 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
public class SparePartIssueJobEditInput : SfsJobCreateUpdateInputBase, ISfsJobCreateInput<SparePartIssueJobDetailInput> |
||||
|
{ |
||||
|
#region Create
|
||||
|
/// <summary>
|
||||
|
/// 上游任务编号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "上游任务编号")] |
||||
|
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] |
||||
|
public string UpStreamJobNumber { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 要货单号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "要货单号")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] |
||||
|
public string SparePartRequestNumber { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 叫料类型
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "叫料类型")] |
||||
|
public EnumIssueRequestType IssueRequestType { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 任务类型
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "任务类型")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
public EnumJobType JobType { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 是否自动完成
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "是否自动完成")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
public bool IsAutoComplete { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 过期时间
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "过期时间")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
public DateTime ExpiredTime { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 任务明细
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "任务明细")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
public List<SparePartIssueJobDetailInput> Details { get; set; } = new(); |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 使用在途库
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "使用在途库")] |
||||
|
public bool UseOnTheWayLocation { get; set; } |
||||
|
|
||||
|
public EnumIssueSendType EnumIssueSendType { get; set; } |
||||
|
#endregion
|
||||
|
} |
@ -0,0 +1,23 @@ |
|||||
|
using Volo.Abp.Authorization.Permissions; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
public static class SparePartIssueJobPermissions |
||||
|
{ |
||||
|
|
||||
|
public const string Default = StorePermissions.GroupName + "." + nameof(SparePartIssueJob); |
||||
|
public const string Create = Default + "." + StorePermissions.CreateStr; |
||||
|
public const string Update = Default + "." + StorePermissions.UpdateStr; |
||||
|
public const string Delete = Default + "." + StorePermissions.DeleteStr; |
||||
|
|
||||
|
|
||||
|
public static void AddSparePartIssueJobPermission(this PermissionGroupDefinition permissionGroup) |
||||
|
{ |
||||
|
var sparePartIssueJobPermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(SparePartIssueJob))); |
||||
|
sparePartIssueJobPermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr)); |
||||
|
sparePartIssueJobPermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr)); |
||||
|
sparePartIssueJobPermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr)); |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,48 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
public class SparePartIssueNoteDTO : SfsStoreDTOBase<SparePartIssueNoteDetailDTO>, IHasJobNumber, IHasRequestNumber |
||||
|
{ |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 任务ID
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "任务ID")] |
||||
|
public string JobNumber { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 请求代码
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "请求代码")] |
||||
|
public string RequestNumber { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 叫料类型
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "叫料类型")] |
||||
|
public EnumIssueRequestType IssueRequestType { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 使用在途库
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "使用在途库")] |
||||
|
public bool UseOnTheWayLocation { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 已确认
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "已确认")] |
||||
|
public bool Confirmed { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 确认时间
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "确认时间")] |
||||
|
public DateTime? ConfirmTime { get; set; } |
||||
|
|
||||
|
public EnumIssueSendType EnumIssueSendType { get; set; } |
||||
|
} |
@ -0,0 +1,519 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
using Win_in.Sfs.Shared.Application.Contracts; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
public class SparePartIssueNoteDetailDTO : SfsDetailDTOBase |
||||
|
{ |
||||
|
#region 库存基础信息
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 物品代码
|
||||
|
/// </summary>
|
||||
|
public string ItemCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 物品名称
|
||||
|
/// </summary>
|
||||
|
public string ItemName { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 物品描述1
|
||||
|
/// </summary>
|
||||
|
public string ItemDesc1 { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 物品描述2
|
||||
|
/// </summary>
|
||||
|
public string ItemDesc2 { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 标包数量
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "标包数量")] |
||||
|
[Column(TypeName = "decimal(18,6)")] |
||||
|
public decimal StdPackQty { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库存状态
|
||||
|
/// </summary>
|
||||
|
public EnumInventoryStatus Status { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 计量单位
|
||||
|
/// </summary>
|
||||
|
public string Uom { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 请求信息
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 请求库位
|
||||
|
/// </summary>
|
||||
|
public string RequestLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 到库区
|
||||
|
/// </summary>
|
||||
|
public string RequestLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 到库位组
|
||||
|
/// </summary>
|
||||
|
public string RequestLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 到ERP库位
|
||||
|
/// </summary>
|
||||
|
public string RequestLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 到仓库
|
||||
|
/// </summary>
|
||||
|
public string RequestWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 在途库库位
|
||||
|
/// </summary>
|
||||
|
public string OnTheWayLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 生产线
|
||||
|
/// </summary>
|
||||
|
public string ProdLine { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 位置码
|
||||
|
/// </summary>
|
||||
|
public string PositionCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐的类型
|
||||
|
/// </summary>
|
||||
|
public EnumRecommendType RecommendType { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 需求数量
|
||||
|
/// </summary>
|
||||
|
public decimal RequestQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 推荐来源
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源托标签
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源箱标签
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendFromArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendFromProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendFromExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次排序
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源库位
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源库区
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源库位组
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源ERP库位
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源仓库
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源数量
|
||||
|
/// </summary>
|
||||
|
public decimal RecommendFromQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 推荐目标
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标托标签
|
||||
|
/// </summary>
|
||||
|
public string RecommendToContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标箱标签
|
||||
|
/// </summary>
|
||||
|
public string RecommendToPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string RecommendToSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendToArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendToProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendToExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次排序
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标库位
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标库区
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标库位组
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标ERP库位
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标仓库
|
||||
|
/// </summary>
|
||||
|
public string RecommendToWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标数量
|
||||
|
/// </summary>
|
||||
|
public decimal RecommendToQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 库移来源
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源托标签
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源箱标签
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibFromArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibFromProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibFromExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次排序
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源库位
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源库区
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源库位组
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源ERP库位
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源仓库
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源数量
|
||||
|
/// </summary>
|
||||
|
public decimal TransferLibFromQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 库移目标
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标托标签
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标箱标签
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibToArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibToProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibToExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次排序
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标库位
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标库区
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标库位组
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标ERP库位
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标仓库
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标数量
|
||||
|
/// </summary>
|
||||
|
public decimal TransferLibToQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 实际来源
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际目标托标签
|
||||
|
/// </summary>
|
||||
|
public string HandledFromContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际箱标签
|
||||
|
/// </summary>
|
||||
|
public string HandledFromPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string HandledFromSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledFromArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledFromProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledFromExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次排序
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库位
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库区
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库位组
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际ERP库位
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际仓库
|
||||
|
/// </summary>
|
||||
|
public string HandledFromWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际数量
|
||||
|
/// </summary>
|
||||
|
public decimal HandledFromQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 实际目标
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际目标托标签
|
||||
|
/// </summary>
|
||||
|
public string HandledToContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际箱标签
|
||||
|
/// </summary>
|
||||
|
public string HandledToPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string HandledToSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledToArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledToProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledToExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次排序
|
||||
|
/// </summary>
|
||||
|
public string HandledToLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库位
|
||||
|
/// </summary>
|
||||
|
public string HandledToLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库区
|
||||
|
/// </summary>
|
||||
|
public string HandledToLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库位组
|
||||
|
/// </summary>
|
||||
|
public string HandledToLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际ERP库位
|
||||
|
/// </summary>
|
||||
|
public string HandledToLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际仓库
|
||||
|
/// </summary>
|
||||
|
public string HandledToWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际数量
|
||||
|
/// </summary>
|
||||
|
public decimal HandledToQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
} |
@ -0,0 +1,14 @@ |
|||||
|
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 ISparePartIssueNoteAppService : ISfsStoreMasterReadOnlyAppServiceBase<SparePartIssueNoteDTO, SfsStoreRequestInputBase, SparePartIssueNoteDetailDTO, SfsStoreRequestInputBase> |
||||
|
{ |
||||
|
Task<SparePartIssueNoteDTO> CreateAsync(SparePartIssueNoteEditInput input); |
||||
|
|
||||
|
Task<SparePartIssueNoteDTO> ConfirmAsync(Guid id); |
||||
|
} |
@ -0,0 +1,519 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
using Win_in.Sfs.Shared.Application.Contracts; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
public class SparePartIssueNoteDetailInput : SfsDetailInputBase |
||||
|
{ |
||||
|
#region 库存基础信息
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 物品代码
|
||||
|
/// </summary>
|
||||
|
public string ItemCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 物品名称
|
||||
|
/// </summary>
|
||||
|
public string ItemName { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 物品描述1
|
||||
|
/// </summary>
|
||||
|
public string ItemDesc1 { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 物品描述2
|
||||
|
/// </summary>
|
||||
|
public string ItemDesc2 { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 标包数量
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "标包数量")] |
||||
|
[Column(TypeName = "decimal(18,6)")] |
||||
|
public decimal StdPackQty { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库存状态
|
||||
|
/// </summary>
|
||||
|
public EnumInventoryStatus Status { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 计量单位
|
||||
|
/// </summary>
|
||||
|
public string Uom { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 请求信息
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 请求库位
|
||||
|
/// </summary>
|
||||
|
public string RequestLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 到库区
|
||||
|
/// </summary>
|
||||
|
public string RequestLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 到库位组
|
||||
|
/// </summary>
|
||||
|
public string RequestLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 到ERP库位
|
||||
|
/// </summary>
|
||||
|
public string RequestLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 到仓库
|
||||
|
/// </summary>
|
||||
|
public string RequestWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 在途库库位
|
||||
|
/// </summary>
|
||||
|
public string OnTheWayLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 生产线
|
||||
|
/// </summary>
|
||||
|
public string ProdLine { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 位置码
|
||||
|
/// </summary>
|
||||
|
public string PositionCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐的类型
|
||||
|
/// </summary>
|
||||
|
public EnumRecommendType RecommendType { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 需求数量
|
||||
|
/// </summary>
|
||||
|
public decimal RequestQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 推荐来源
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源托标签
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源箱标签
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendFromArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendFromProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendFromExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次排序
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源库位
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源库区
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源库位组
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源ERP库位
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源仓库
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源数量
|
||||
|
/// </summary>
|
||||
|
public decimal RecommendFromQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 推荐目标
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标托标签
|
||||
|
/// </summary>
|
||||
|
public string RecommendToContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标箱标签
|
||||
|
/// </summary>
|
||||
|
public string RecommendToPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string RecommendToSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendToArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendToProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendToExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次排序
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标库位
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标库区
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标库位组
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标ERP库位
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标仓库
|
||||
|
/// </summary>
|
||||
|
public string RecommendToWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标数量
|
||||
|
/// </summary>
|
||||
|
public decimal RecommendToQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 库移来源
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源托标签
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源箱标签
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibFromArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibFromProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibFromExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次排序
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源库位
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源库区
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源库位组
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源ERP库位
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源仓库
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源数量
|
||||
|
/// </summary>
|
||||
|
public decimal TransferLibFromQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 库移目标
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标托标签
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标箱标签
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibToArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibToProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibToExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次排序
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标库位
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标库区
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标库位组
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标ERP库位
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标仓库
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标数量
|
||||
|
/// </summary>
|
||||
|
public decimal TransferLibToQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 实际来源
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际目标托标签
|
||||
|
/// </summary>
|
||||
|
public string HandledFromContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际箱标签
|
||||
|
/// </summary>
|
||||
|
public string HandledFromPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string HandledFromSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledFromArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledFromProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledFromExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次排序
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库位
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库区
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库位组
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际ERP库位
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际仓库
|
||||
|
/// </summary>
|
||||
|
public string HandledFromWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际数量
|
||||
|
/// </summary>
|
||||
|
public decimal HandledFromQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 实际目标
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际目标托标签
|
||||
|
/// </summary>
|
||||
|
public string HandledToContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际箱标签
|
||||
|
/// </summary>
|
||||
|
public string HandledToPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string HandledToSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledToArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledToProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledToExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次排序
|
||||
|
/// </summary>
|
||||
|
public string HandledToLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库位
|
||||
|
/// </summary>
|
||||
|
public string HandledToLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库区
|
||||
|
/// </summary>
|
||||
|
public string HandledToLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库位组
|
||||
|
/// </summary>
|
||||
|
public string HandledToLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际ERP库位
|
||||
|
/// </summary>
|
||||
|
public string HandledToLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际仓库
|
||||
|
/// </summary>
|
||||
|
public string HandledToWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际数量
|
||||
|
/// </summary>
|
||||
|
public decimal HandledToQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
} |
@ -0,0 +1,58 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
public class SparePartIssueNoteEditInput : SfsStoreCreateOrUpdateInputBase |
||||
|
{ |
||||
|
#region Base
|
||||
|
/// <summary>
|
||||
|
/// 已确认
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "已确认")] |
||||
|
public bool Confirmed { get; set; } |
||||
|
#endregion
|
||||
|
|
||||
|
#region Create
|
||||
|
/// <summary>
|
||||
|
/// 发料记录号
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "发料记录号")] |
||||
|
public string Number { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 任务ID
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "任务ID")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
public string JobNumber { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 明细列表
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "明细列表")] |
||||
|
public List<SparePartIssueNoteDetailInput> Details { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 请求号码
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "请求号码")] |
||||
|
public string RequestNumber { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 叫料类型
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "叫料类型")] |
||||
|
public EnumIssueRequestType IssueRequestType { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 使用在途库
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "使用在途库")] |
||||
|
public bool UseOnTheWayLocation { get; set; } |
||||
|
|
||||
|
public EnumIssueSendType EnumIssueSendType { get; set; } |
||||
|
#endregion
|
||||
|
} |
@ -0,0 +1,36 @@ |
|||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
public class SparePartIssueNoteImportInput : SfsStoreImportInputBase, IHasJobNumber, IHasRequestNumber |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 任务ID
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "任务ID")] |
||||
|
public string JobNumber { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 车间
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "车间")] |
||||
|
public string Workshop { get; set; } |
||||
|
|
||||
|
public string RequestNumber { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 叫料类型
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "叫料类型")] |
||||
|
public EnumIssueRequestType IssueRequestType { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 使用在途库
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "使用在途库")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
public bool UseOnTheWayLocation { get; set; } |
||||
|
|
||||
|
public EnumIssueSendType EnumIssueSendType { get; set; } |
||||
|
} |
@ -0,0 +1,20 @@ |
|||||
|
using Volo.Abp.Authorization.Permissions; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
public static class SparePartIssueNotePermissions |
||||
|
{ |
||||
|
public const string Default = StorePermissions.GroupName + "." + nameof(SparePartIssueNote); |
||||
|
public const string Create = Default + "." + StorePermissions.CreateStr; |
||||
|
public const string Update = Default + "." + StorePermissions.UpdateStr; |
||||
|
public const string Delete = Default + "." + StorePermissions.DeleteStr; |
||||
|
|
||||
|
public static void AddSparePartIssueNotePermission(this PermissionGroupDefinition permissionGroup) |
||||
|
{ |
||||
|
var sparePartIssueNotePermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(SparePartIssueNote))); |
||||
|
sparePartIssueNotePermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr)); |
||||
|
sparePartIssueNotePermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr)); |
||||
|
sparePartIssueNotePermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr)); |
||||
|
} |
||||
|
} |
@ -0,0 +1,34 @@ |
|||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
public class SparePartIssueRequestDTO : SfsStoreRequestDTOBase<SparePartIssueRequestDetailDTO>, IHasNumber |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 叫料类型
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "叫料类型")] |
||||
|
public EnumIssueRequestType IssueRequestType { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 是否使用在途库
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "是否使用在途库")] |
||||
|
public bool IsUseOnTheWayLocation { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 可用来源库位Json集合
|
||||
|
/// </summary>
|
||||
|
public string FromLocationCodeJsonList { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 叫料库位
|
||||
|
/// </summary>
|
||||
|
public string ToLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 目标ERP储位
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "目标ERP储位")] |
||||
|
public string ToLocationErpCode { get; set; } |
||||
|
} |
@ -0,0 +1,99 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
public class SparePartIssueRequestDetailDTO : SfsStoreDetailWithQtyDTOBase |
||||
|
{ |
||||
|
#region 目标库位信息
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 目标库位
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "目标库位")] |
||||
|
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] |
||||
|
public string ToLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 目标库区
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "目标库区")] |
||||
|
public string ToLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 目标库位组
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "目标库位组")] |
||||
|
public string ToLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 目标ERP储位
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "目标ERP储位")] |
||||
|
public string ToLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 目标仓库
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "目标仓库")] |
||||
|
public string ToWarehouseCode { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 生产线
|
||||
|
/// </summary>
|
||||
|
public string ProdLine { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 已发数量
|
||||
|
/// </summary>
|
||||
|
public decimal IssuedQty { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 已收数量
|
||||
|
/// </summary>
|
||||
|
public decimal ReceivedQty { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 明细状态
|
||||
|
/// </summary>
|
||||
|
public EnumStatus Status { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 请求未发 还未发送的数量
|
||||
|
/// </summary>
|
||||
|
[NotMapped] |
||||
|
public decimal ToBeIssuedQty => Qty - IssuedQty; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 已发未收
|
||||
|
/// </summary>
|
||||
|
[NotMapped] |
||||
|
public decimal ToBeReceivedQty => IssuedQty - ReceivedQty; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 请求未收
|
||||
|
/// </summary>
|
||||
|
[NotMapped] |
||||
|
public decimal NotFinishQty => Qty - ReceivedQty; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 位置码
|
||||
|
/// </summary>
|
||||
|
public string PositionCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐类型
|
||||
|
/// </summary>
|
||||
|
public EnumRecommendType RecommendType { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 需求箱数量
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "需求箱数量")] |
||||
|
public decimal BoxQty { get; set; } |
||||
|
} |
@ -0,0 +1,16 @@ |
|||||
|
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 ISparePartIssueRequestAppService |
||||
|
: ISfsStoreRequestMasterAppServiceBase<SparePartIssueRequestDTO, SfsStoreRequestInputBase, SparePartIssueRequestEditInput, SparePartIssueRequestDetailDTO, SfsStoreRequestInputBase> |
||||
|
|
||||
|
{ |
||||
|
Task<SparePartIssueRequestDTO> CreateAndHandleAsync(SparePartIssueRequestEditInput input); |
||||
|
Task UpdateStatusCompletedAsync(string number); |
||||
|
Task<string> IsHasNewJobAsync(string requestNumber,List<string> jobNumber); |
||||
|
} |
@ -0,0 +1,91 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
public class SparePartIssueRequestDetailInput : SfsStoreDetailWithQtyInputBase |
||||
|
{ |
||||
|
#region 目标库位信息
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 目标库位
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "目标库位")] |
||||
|
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] |
||||
|
public string ToLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 目标库区
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "目标库区")] |
||||
|
public string ToLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 目标库位组
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "目标库位组")] |
||||
|
public string ToLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 目标ERP储位
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "目标ERP储位")] |
||||
|
public string ToLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 目标仓库
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "目标仓库")] |
||||
|
public string ToWarehouseCode { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 生产线
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "生产线")] |
||||
|
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] |
||||
|
public string ProdLine { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 状态
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "状态")] |
||||
|
public EnumRequestStatus RequestStatus { get; set; } = EnumRequestStatus.New; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 已发数量
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "已发数量")] |
||||
|
public decimal IssuedQty { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 已收数量
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "已收数量")] |
||||
|
public decimal ReceivedQty { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 明细状态
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "明细状态")] |
||||
|
public EnumStatus Status { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 位置码
|
||||
|
/// </summary>
|
||||
|
public string PositionCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐类型
|
||||
|
/// </summary>
|
||||
|
public EnumRecommendType RecommendType { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 需求箱数量
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "需求箱数量")] |
||||
|
public decimal BoxQty { get; set; } |
||||
|
} |
@ -0,0 +1,34 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
public class SparePartIssueRequestEditInput : SfsStoreRequestCreateOrUpdateInputBase |
||||
|
{ |
||||
|
#region Base
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 叫料类型
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "叫料类型")] |
||||
|
public EnumIssueRequestType IssueRequestType { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 使用在途库
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "使用在途库")] |
||||
|
public bool UseOnTheWayLocation { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 明细列表
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "明细列表")] |
||||
|
public List<SparePartIssueRequestDetailInput> Details { get; set; } = new List<SparePartIssueRequestDetailInput>(); |
||||
|
#endregion
|
||||
|
|
||||
|
#region Create
|
||||
|
|
||||
|
#endregion
|
||||
|
} |
@ -0,0 +1,50 @@ |
|||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Win_in.Sfs.Shared.Application.Contracts; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
[Display(Name = "叫料申请")] |
||||
|
public class SparePartIssueRequestImportInput : SfsStoreImportInputBase |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 叫料类型
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "叫料类型")] |
||||
|
public EnumIssueRequestType IssueRequestType { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 物品代码
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "物品代码")] |
||||
|
[Required] |
||||
|
public string ItemCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 目标库位
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "目标库位")] |
||||
|
[Required] |
||||
|
public string ToLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 来源库区
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "调出库区")] |
||||
|
[Required] |
||||
|
public string FromLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 数量
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "数量")] |
||||
|
[Required(ErrorMessage = "{0}是必填项")] |
||||
|
public decimal Qty { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 备注
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "备注")] |
||||
|
public string Remark { get; set; } |
||||
|
} |
@ -0,0 +1,22 @@ |
|||||
|
using Volo.Abp.Authorization.Permissions; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
|
||||
|
public static class SparePartIssueRequestPermissions |
||||
|
{ |
||||
|
|
||||
|
public const string Default = StorePermissions.GroupName + "." + nameof(SparePartIssueRequest); |
||||
|
public const string Create = Default + "." + StorePermissions.CreateStr; |
||||
|
public const string Update = Default + "." + StorePermissions.UpdateStr; |
||||
|
public const string Delete = Default + "." + StorePermissions.DeleteStr; |
||||
|
|
||||
|
public static void AddSparePartIssueRequestPermission(this PermissionGroupDefinition permissionGroup) |
||||
|
{ |
||||
|
var sparePartIssueRequestPermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(SparePartIssueRequest))); |
||||
|
sparePartIssueRequestPermission.AddChild(Create, StorePermissionDefinitionProvider.L(StorePermissions.CreateStr)); |
||||
|
sparePartIssueRequestPermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr)); |
||||
|
sparePartIssueRequestPermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr)); |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,597 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Net.Http; |
||||
|
using System.Net.Http.Headers; |
||||
|
using System.Text; |
||||
|
using System.Text.Json; |
||||
|
using System.Threading.Tasks; |
||||
|
using Castle.Components.DictionaryAdapter; |
||||
|
using Microsoft.AspNetCore.Authorization; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Microsoft.Extensions.Options; |
||||
|
using MyNamespace; |
||||
|
using Volo.Abp; |
||||
|
using Win_in.Sfs.Basedata.Application.Contracts; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store; |
||||
|
using Win_in.Sfs.Wms.Inventory.Application.Contracts; |
||||
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
using Win_in.Sfs.Wms.Store.Domain.Shared; |
||||
|
using Win_in.Sfs.Wms.Store.Jobs.IssueJobs.proxy; |
||||
|
using Win_in.Sfs.Wms.Store.Notes; |
||||
|
using Win_in.Sfs.Wms.Store.Options; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application; |
||||
|
|
||||
|
[Authorize] |
||||
|
[Route($"{StoreConsts.RootPath}spare-part-issue-job")] |
||||
|
public class SparePartIssueJobAppService |
||||
|
: SfsJobAppServiceBase<SparePartIssueJob, SparePartIssueJobDetail, SparePartIssueJobDTO, SfsJobRequestInputBase, |
||||
|
SparePartIssueJobCheckInput, SparePartIssueJobEditInput>, |
||||
|
ISparePartIssueJobAppService, ITransferLibCallback |
||||
|
{ |
||||
|
private readonly ISparePartIssueJobManager _sparePartIssueJobManager; |
||||
|
private readonly ILocationAppService _locationAppService; |
||||
|
private readonly ISparePartIssueNoteAppService _sparePartIssueNoteAppService; |
||||
|
private readonly IExpectOutAppService _expectOutAppService; |
||||
|
private readonly IHttpClientFactory _httpClientFactory; |
||||
|
private readonly ITransferLibRequestAppService _transferLibRequestAppService; |
||||
|
private readonly IOptions<RestoOptions> _options; |
||||
|
|
||||
|
protected ISparePartIssueRequestAppService SparePartIssueRequestAppService => |
||||
|
LazyServiceProvider.LazyGetRequiredService<ISparePartIssueRequestAppService>(); |
||||
|
|
||||
|
public SparePartIssueJobAppService( |
||||
|
ISparePartIssueJobRepository repository, ISparePartIssueJobManager sparePartIssueJobManager, |
||||
|
ILocationAppService locationAppService, |
||||
|
ISparePartIssueNoteAppService sparePartIssueNoteAppService, IExpectOutAppService expectOutAppService |
||||
|
, IHttpClientFactory httpClientFactory |
||||
|
, IOptions<RestoOptions> options, ITransferLibRequestAppService transferLibRequestAppService) : base( |
||||
|
repository, sparePartIssueJobManager) |
||||
|
{ |
||||
|
_sparePartIssueJobManager = sparePartIssueJobManager; |
||||
|
_locationAppService = locationAppService; |
||||
|
_sparePartIssueNoteAppService = sparePartIssueNoteAppService; |
||||
|
_expectOutAppService = expectOutAppService; |
||||
|
_httpClientFactory = httpClientFactory; |
||||
|
_options = options; |
||||
|
_transferLibRequestAppService = transferLibRequestAppService; |
||||
|
} |
||||
|
|
||||
|
[HttpPost("add-many")] |
||||
|
public override async Task<List<SparePartIssueJobDTO>> CreateManyAsync(List<SparePartIssueJobEditInput> inputs) |
||||
|
{ |
||||
|
foreach (var input in inputs) |
||||
|
{ |
||||
|
await CheckMinRowAndSetStatusAsync(input).ConfigureAwait(false); |
||||
|
await CheckDimensionalStorehouseAsync(input).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
var sparePartIssueJobDtos = await base.CreateManyAsync(inputs).ConfigureAwait(false); |
||||
|
foreach (var sparePartIssueJobDto in sparePartIssueJobDtos) |
||||
|
{ |
||||
|
await CheckDimensionalStorehouseAsync(sparePartIssueJobDto).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
return sparePartIssueJobDtos; |
||||
|
} |
||||
|
|
||||
|
[HttpPost("")] |
||||
|
public override async Task<SparePartIssueJobDTO> CreateAsync(SparePartIssueJobEditInput input) |
||||
|
{ |
||||
|
await CheckMinRowAndSetStatusAsync(input).ConfigureAwait(false); |
||||
|
await CheckDimensionalStorehouseAsync(input).ConfigureAwait(false); |
||||
|
|
||||
|
var sparePartIssueJobDto = await base.CreateAsync(input).ConfigureAwait(false); |
||||
|
await CheckDimensionalStorehouseAsync(sparePartIssueJobDto).ConfigureAwait(false); |
||||
|
|
||||
|
return sparePartIssueJobDto; |
||||
|
} |
||||
|
|
||||
|
[HttpPost("invalid")] |
||||
|
public override async Task CancelAsync(Guid id) |
||||
|
{ |
||||
|
var sparePartJob = await _repository.GetAsync(id).ConfigureAwait(false); |
||||
|
if (sparePartJob == null) |
||||
|
{ |
||||
|
throw new UserFriendlyException($"未找到ID为 {id} 的任务"); |
||||
|
} |
||||
|
|
||||
|
if (sparePartJob.JobStatus == EnumJobStatus.Open || |
||||
|
sparePartJob.JobStatus == EnumJobStatus.Partial || |
||||
|
sparePartJob.JobStatus == EnumJobStatus.Wait|| |
||||
|
sparePartJob.JobStatus == EnumJobStatus.Doing) |
||||
|
{ |
||||
|
await _expectOutAppService.RemoveByNumberAsync(sparePartJob.Number).ConfigureAwait(false); |
||||
|
await _transferLibRequestAppService.CancelByCallRequestNumberAsync(sparePartJob.SparePartRequestNumber) |
||||
|
.ConfigureAwait(false); |
||||
|
|
||||
|
sparePartJob.JobStatus = EnumJobStatus.Cancelled; |
||||
|
await _repository.UpdateAsync(sparePartJob).ConfigureAwait(false); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
throw new UserFriendlyException($"任务状态不是" + |
||||
|
$"{EnumJobStatus.Open.GetDisplayName()}、" + |
||||
|
$"{EnumJobStatus.Partial.GetDisplayName()}、" + |
||||
|
$"{EnumJobStatus.Doing.GetDisplayName()}、" + |
||||
|
$"{EnumJobStatus.Wait.GetDisplayName()}"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
[HttpPost("by-request-number/{requestNumber}")] |
||||
|
public virtual async Task<List<SparePartIssueJobDTO>> GetByRequestNumberAsync(string requestNumber) |
||||
|
{ |
||||
|
var entitys = await _repository.GetListAsync(p => p.SparePartRequestNumber == requestNumber) |
||||
|
.ConfigureAwait(false); |
||||
|
return ObjectMapper.Map<List<SparePartIssueJob>, List<SparePartIssueJobDTO>>(entitys); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移回调
|
||||
|
/// </summary>
|
||||
|
/// <param name="dto"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost("Do-Call-Back")] |
||||
|
public async Task DoTransferLibCallbackAsync(TransferLibJobDTO dto) |
||||
|
{ |
||||
|
var job = await _repository.FindAsync(p => p.Number == dto.CallJobNumber).ConfigureAwait(false); |
||||
|
|
||||
|
if (job.JobStatus != EnumJobStatus.Wait) |
||||
|
{ |
||||
|
throw new UserFriendlyException($"任务状态不是{EnumJobStatus.Wait.GetDisplayName()}"); |
||||
|
} |
||||
|
|
||||
|
var transferLibNoteDetail = dto.Details.First(); |
||||
|
|
||||
|
var jobDetail = job.Details.First(); |
||||
|
|
||||
|
job.JobStatus = EnumJobStatus.Open; |
||||
|
|
||||
|
jobDetail.TransferLibFromArriveDate = transferLibNoteDetail.HandledFromArriveDate; |
||||
|
jobDetail.TransferLibFromContainerCode = transferLibNoteDetail.HandledFromContainerCode; |
||||
|
jobDetail.TransferLibFromExpireDate = transferLibNoteDetail.HandledFromExpireDate; |
||||
|
jobDetail.TransferLibFromLocationArea = transferLibNoteDetail.HandledFromLocationArea; |
||||
|
jobDetail.TransferLibFromLocationCode = transferLibNoteDetail.HandledFromLocationCode; |
||||
|
jobDetail.TransferLibFromLocationErpCode = transferLibNoteDetail.HandledFromLocationErpCode; |
||||
|
jobDetail.TransferLibFromLocationGroup = transferLibNoteDetail.HandledFromLocationGroup; |
||||
|
jobDetail.TransferLibFromLot = transferLibNoteDetail.HandledFromLot; |
||||
|
jobDetail.TransferLibFromPackingCode = transferLibNoteDetail.HandledFromPackingCode; |
||||
|
jobDetail.TransferLibFromProduceDate = transferLibNoteDetail.HandledFromProduceDate; |
||||
|
jobDetail.TransferLibFromQty = transferLibNoteDetail.HandledFromQty; |
||||
|
jobDetail.TransferLibFromSupplierBatch = transferLibNoteDetail.HandledFromSupplierBatch; |
||||
|
jobDetail.TransferLibFromWarehouseCode = transferLibNoteDetail.HandledFromWarehouseCode; |
||||
|
|
||||
|
jobDetail.TransferLibToArriveDate = transferLibNoteDetail.HandledToArriveDate; |
||||
|
jobDetail.TransferLibToContainerCode = transferLibNoteDetail.HandledToContainerCode; |
||||
|
jobDetail.TransferLibToExpireDate = transferLibNoteDetail.HandledToExpireDate; |
||||
|
jobDetail.TransferLibToLocationArea = transferLibNoteDetail.HandledToLocationArea; |
||||
|
jobDetail.TransferLibToLocationCode = transferLibNoteDetail.HandledToLocationCode; |
||||
|
jobDetail.TransferLibToLocationErpCode = transferLibNoteDetail.HandledToLocationErpCode; |
||||
|
jobDetail.TransferLibToLocationGroup = transferLibNoteDetail.HandledToLocationGroup; |
||||
|
jobDetail.TransferLibToLot = transferLibNoteDetail.HandledToLot; |
||||
|
jobDetail.TransferLibToPackingCode = transferLibNoteDetail.HandledToPackingCode; |
||||
|
jobDetail.TransferLibToProduceDate = transferLibNoteDetail.HandledToProduceDate; |
||||
|
jobDetail.TransferLibToQty = transferLibNoteDetail.HandledToQty; |
||||
|
jobDetail.TransferLibToSupplierBatch = transferLibNoteDetail.HandledToSupplierBatch; |
||||
|
jobDetail.TransferLibToWarehouseCode = transferLibNoteDetail.HandledToWarehouseCode; |
||||
|
|
||||
|
await _repository.UpdateAsync(job).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 执行任务明细
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost("ExecuteDetail/{masterId}")] |
||||
|
public async Task ExecuteDetailAsync(Guid masterId, Guid detailId, SparePartIssueJobDetailDTO issueJobDetailDto) |
||||
|
{ |
||||
|
var sparePartIssueJob = await _repository.GetAsync(masterId).ConfigureAwait(false); |
||||
|
sparePartIssueJob.JobStatus = EnumJobStatus.Doing; |
||||
|
|
||||
|
var sparePartIssueJobDto = ObjectMapper.Map<SparePartIssueJob, SparePartIssueJobDTO>(sparePartIssueJob); |
||||
|
sparePartIssueJobDto.Details = new List<SparePartIssueJobDetailDTO> { issueJobDetailDto }; |
||||
|
var sparePartIssueNoteEditInput = await BuildSparePartIssueNoteAsync(sparePartIssueJobDto).ConfigureAwait(false); |
||||
|
await _sparePartIssueNoteAppService.CreateAsync(sparePartIssueNoteEditInput).ConfigureAwait(false); |
||||
|
|
||||
|
var issueJobDetail = ObjectMapper.Map<SparePartIssueJobDetailDTO, SparePartIssueJobDetail>(issueJobDetailDto); |
||||
|
var entityDetail = sparePartIssueJob.Details.Find(p => p.Id == detailId); |
||||
|
issueJobDetail.HandledFromQty = entityDetail.HandledFromQty; |
||||
|
issueJobDetail.HandledToQty = entityDetail.HandledToQty; |
||||
|
|
||||
|
issueJobDetail.HandledToQty += issueJobDetailDto.HandledToQty; |
||||
|
issueJobDetail.HandledFromQty += issueJobDetailDto.HandledFromQty; |
||||
|
sparePartIssueJob.Details = new EditableList<SparePartIssueJobDetail> { issueJobDetail }; |
||||
|
|
||||
|
if (sparePartIssueJob.EnumIssueSendType == EnumIssueSendType.BoxQtyType) //按箱叫料 因为任务只有1箱 所以可以直接完成
|
||||
|
{ |
||||
|
if (issueJobDetailDto.RecommendToPackingCode != issueJobDetailDto.HandledToPackingCode) |
||||
|
{ |
||||
|
await CheckPackingCodeIsUserAsync(issueJobDetailDto.HandledToPackingCode, sparePartIssueJob.Number).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
await UpdateRequestAndjobStatusDoneAsync(sparePartIssueJob, issueJobDetailDto, issueJobDetailDto.HandledToQty) |
||||
|
.ConfigureAwait(false); |
||||
|
await _expectOutAppService.RemoveByNumberAsync(sparePartIssueJob.Number).ConfigureAwait(false); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
var detail = sparePartIssueJob.Details.First(p => p.Id == issueJobDetailDto.Id); |
||||
|
if (issueJobDetail.HandledToQty >= detail.RequestQty) |
||||
|
{ |
||||
|
await UpdateRequestAndjobStatusDoneAsync(sparePartIssueJob, issueJobDetailDto, |
||||
|
issueJobDetailDto.HandledToQty).ConfigureAwait(false); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
await RemoveExpectOutAsync(sparePartIssueJob, issueJobDetailDto, issueJobDetailDto.HandledToQty) |
||||
|
.ConfigureAwait(false); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
await _repository.UpdateAsync(sparePartIssueJob).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 完成任务
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost("Complete/{id}")] |
||||
|
public async Task CompleteAsync(Guid id) |
||||
|
{ |
||||
|
var sparePartIssueJob = await _repository.FindAsync(id).ConfigureAwait(false); |
||||
|
|
||||
|
sparePartIssueJob.JobStatus = EnumJobStatus.Done; |
||||
|
|
||||
|
await _expectOutAppService.RemoveByNumberAsync(sparePartIssueJob.Number).ConfigureAwait(false); |
||||
|
|
||||
|
await SparePartIssueRequestAppService.UpdateStatusCompletedAsync(sparePartIssueJob.SparePartRequestNumber) |
||||
|
.ConfigureAwait(false); |
||||
|
await _transferLibRequestAppService.CancelByCallRequestNumberAsync(sparePartIssueJob.SparePartRequestNumber) |
||||
|
.ConfigureAwait(false); |
||||
|
|
||||
|
await _repository.UpdateAsync(sparePartIssueJob).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 请求点了完成,任务全部都完成
|
||||
|
/// </summary>
|
||||
|
/// <param name="requestNumber"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost("complete-by-request/{requestNumber}")] |
||||
|
public async Task CompleteByRequestNumberAsync(string requestNumber) |
||||
|
{ |
||||
|
var sparePartIssueJobs = await _repository.GetListAsync(p => p.SparePartRequestNumber == requestNumber) |
||||
|
.ConfigureAwait(false); |
||||
|
|
||||
|
foreach (var sparePartIssueJob in sparePartIssueJobs) |
||||
|
{ |
||||
|
sparePartIssueJob.JobStatus = EnumJobStatus.Done; |
||||
|
await _repository.UpdateAsync(sparePartIssueJob).ConfigureAwait(false); |
||||
|
await _expectOutAppService.RemoveByNumberAsync(sparePartIssueJob.Number).ConfigureAwait(false); |
||||
|
await _transferLibRequestAppService.CancelByCallRequestNumberAsync(sparePartIssueJob.SparePartRequestNumber) |
||||
|
.ConfigureAwait(false); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
#region 立库
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 立体库同步
|
||||
|
/// </summary>
|
||||
|
/// <param name="input"></param>
|
||||
|
/// <param name="pLoc"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost("sync-issue-job-stereo")] |
||||
|
public async Task<ReusltObject> SyncIssueJobStereoAsync(List<SparePartIssueJobDTO> input, string pLoc) |
||||
|
{ |
||||
|
var ret = new ReusltObject(); |
||||
|
ret.Code = "1"; |
||||
|
ret.Message = "操作成功"; |
||||
|
ret.OperateTime = DateTime.Now.ToString("yyyy-MM-dd"); |
||||
|
try |
||||
|
{ |
||||
|
var IssueJobToRestoDetailDTOs = new List<IssueJobToRestoDetailDTO>(); |
||||
|
var main = new IssueJobToRestoDTO(); |
||||
|
main.OperatorName = CurrentUser.UserName; |
||||
|
foreach (var job in input) |
||||
|
{ |
||||
|
foreach (var jobitem in job.Details) |
||||
|
{ |
||||
|
IssueJobToRestoDetailDTOs.Add(new IssueJobToRestoDetailDTO |
||||
|
{ |
||||
|
Count = jobitem.HandledToQty, |
||||
|
ProductNo = jobitem.ItemCode, |
||||
|
NeedSite = pLoc, |
||||
|
WorkNo = job.Number, |
||||
|
TaskNo = job.Number |
||||
|
}); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
main.Details = IssueJobToRestoDetailDTOs; |
||||
|
var httpclient = _httpClientFactory.CreateClient(); |
||||
|
#if DEBUG
|
||||
|
|
||||
|
var json = JsonSerializer.Serialize(main); |
||||
|
_options.Value.Address = "http://localhost:59094/"; //测试地址
|
||||
|
_options.Value.Token = ""; //测试token
|
||||
|
_options.Value.UserName = ""; //测试用户名
|
||||
|
_options.Value.Password = ""; //测试密码
|
||||
|
|
||||
|
#endif
|
||||
|
if (!string.IsNullOrEmpty(_options.Value.Token)) |
||||
|
{ |
||||
|
var token = _options.Value.Token; |
||||
|
httpclient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token); |
||||
|
} |
||||
|
|
||||
|
if (!string.IsNullOrEmpty(_options.Value.UserName) && !string.IsNullOrEmpty(_options.Value.Password)) |
||||
|
{ |
||||
|
var username = _options.Value.UserName; |
||||
|
var password = _options.Value.Password; |
||||
|
httpclient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", |
||||
|
Convert.ToBase64String(Encoding.ASCII.GetBytes($"{username}:{password}"))); |
||||
|
} |
||||
|
|
||||
|
var client = new IssueJobToRestoClient(_options.Value.Address, httpclient); |
||||
|
ret = await client.SyncIssueJobStereoAsync(main).ConfigureAwait(false); |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
ret = new ReusltObject(); |
||||
|
ret.Code = "2"; |
||||
|
ret.Message = ex.Message; |
||||
|
ret.OperateTime = DateTime.Now.ToString("yyyy-MM-dd"); |
||||
|
} |
||||
|
|
||||
|
return ret; |
||||
|
} |
||||
|
|
||||
|
[HttpPost("receive-issue-job-stereo")] |
||||
|
public virtual async Task<ReusltObject> SyncReciveIssueJobStereoAsync(IssueRequestFromRestoDTO input) |
||||
|
{ |
||||
|
#if DEBUG
|
||||
|
var json = JsonSerializer.Serialize(input); |
||||
|
#endif
|
||||
|
var errors = new List<string>(); |
||||
|
var ret = new ReusltObject { Code = "1", OperateTime = DateTime.Now.ToString("yyyy-MM-dd"), Message = "操作成功" }; |
||||
|
try |
||||
|
{ |
||||
|
if (input.Jobs.Count > 0) |
||||
|
{ |
||||
|
var jobs = input.Jobs; |
||||
|
var numbers = jobs.Select(p => p.JobNumber); |
||||
|
var query = _repository.WithDetails() |
||||
|
.Where(p => numbers.Contains(p.Number)); |
||||
|
var entities = query.ToList(); |
||||
|
var dtos = ObjectMapper.Map<List<SparePartIssueJob>, List<SparePartIssueJobDTO>>(entities); |
||||
|
if (input.Jobs.Count == entities.Count) |
||||
|
{ |
||||
|
errors.Add("立体库提交出库任务和WMS任务不符,请核对! \n"); |
||||
|
} |
||||
|
|
||||
|
foreach (var itm in dtos) |
||||
|
{ |
||||
|
var first = jobs.FirstOrDefault(p => p.JobNumber == itm.Number); |
||||
|
var itmDetails = itm.Details.ToList(); |
||||
|
var details = new List<SparePartIssueJobDetailDTO>(); |
||||
|
foreach (var detail in first.Details) |
||||
|
{ |
||||
|
var entity = itmDetails.FirstOrDefault(p => p.ItemCode == detail.ItemCode); |
||||
|
var dto = new SparePartIssueJobDetailDTO(); |
||||
|
dto.HandledFromLocationCode = entity.HandledFromLocationCode; |
||||
|
dto.HandledToLocationCode = entity.HandledToLocationCode; |
||||
|
dto.ItemCode = detail.ItemCode; |
||||
|
dto.RecommendFromQty = detail.Qty; |
||||
|
dto.RecommendToQty = detail.Qty; |
||||
|
dto.HandledFromQty = detail.Qty; |
||||
|
dto.HandledToQty = detail.Qty; |
||||
|
dto.Status = entity.Status; |
||||
|
details.Add(dto); |
||||
|
} |
||||
|
|
||||
|
itm.Details = details; |
||||
|
await CompleteAsync(itm.Id, itm).ConfigureAwait(false); |
||||
|
} |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
errors.Add("立体库确认单据里无数据! \n"); |
||||
|
} |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
ret = new ReusltObject |
||||
|
{ |
||||
|
Code = "2", OperateTime = DateTime.Now.ToString("yyyy-MM-dd"), Message = ex.Message |
||||
|
}; |
||||
|
return ret; |
||||
|
} |
||||
|
|
||||
|
if (errors.Count > 0) |
||||
|
{ |
||||
|
ret = new ReusltObject |
||||
|
{ |
||||
|
Code = "2", |
||||
|
OperateTime = DateTime.Now.ToString("yyyy-MM-dd"), |
||||
|
Message = string.Join(",", errors.ToArray()) |
||||
|
}; |
||||
|
} |
||||
|
|
||||
|
return ret; |
||||
|
} |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 私有
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 创建补料记录实体
|
||||
|
/// </summary>
|
||||
|
/// <param name="sparePartIssueJobDto"></param>
|
||||
|
/// <returns></returns>
|
||||
|
private async Task<SparePartIssueNoteEditInput> BuildSparePartIssueNoteAsync(SparePartIssueJobDTO sparePartIssueJobDto) |
||||
|
{ |
||||
|
var sparePartIssueNoteCreateInput = |
||||
|
ObjectMapper.Map<SparePartIssueJobDTO, SparePartIssueNoteEditInput>(sparePartIssueJobDto); |
||||
|
sparePartIssueNoteCreateInput.JobNumber = sparePartIssueJobDto.Number; |
||||
|
|
||||
|
await Task.CompletedTask.ConfigureAwait(false); |
||||
|
|
||||
|
return sparePartIssueNoteCreateInput; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 判断是不是在最底层 如果不是则把状态变更为等待 并把库移推荐的From和To赋值
|
||||
|
/// </summary>
|
||||
|
/// <param name="input"></param>
|
||||
|
/// <returns></returns>
|
||||
|
private async Task CheckMinRowAndSetStatusAsync(SparePartIssueJobEditInput input) |
||||
|
{ |
||||
|
var jobDetailInputdetail = input.Details.FirstOrDefault(); |
||||
|
|
||||
|
var loctionDto = await _locationAppService.GetByCodeAsync(jobDetailInputdetail.RecommendFromLocationCode) |
||||
|
.ConfigureAwait(false); |
||||
|
|
||||
|
if (loctionDto.Type == EnumLocationType.RAW && loctionDto.RowCode != 1) |
||||
|
{ |
||||
|
input.JobStatus = EnumJobStatus.Wait; |
||||
|
} |
||||
|
else if (loctionDto.Type == EnumLocationType.RAW && loctionDto.RowCode == 1) |
||||
|
{ |
||||
|
jobDetailInputdetail.TransferLibFromArriveDate = jobDetailInputdetail.RecommendFromArriveDate; |
||||
|
jobDetailInputdetail.TransferLibFromContainerCode = jobDetailInputdetail.RecommendFromContainerCode; |
||||
|
jobDetailInputdetail.TransferLibFromExpireDate = jobDetailInputdetail.RecommendFromExpireDate; |
||||
|
jobDetailInputdetail.TransferLibFromLocationArea = jobDetailInputdetail.RecommendFromLocationArea; |
||||
|
jobDetailInputdetail.TransferLibFromLocationCode = jobDetailInputdetail.RecommendFromLocationCode; |
||||
|
jobDetailInputdetail.TransferLibFromLocationErpCode = jobDetailInputdetail.RecommendFromLocationErpCode; |
||||
|
jobDetailInputdetail.TransferLibFromLocationGroup = jobDetailInputdetail.RecommendFromLocationGroup; |
||||
|
jobDetailInputdetail.TransferLibFromLot = jobDetailInputdetail.RecommendFromLot; |
||||
|
jobDetailInputdetail.TransferLibFromPackingCode = jobDetailInputdetail.RecommendFromPackingCode; |
||||
|
jobDetailInputdetail.TransferLibFromProduceDate = jobDetailInputdetail.RecommendFromProduceDate; |
||||
|
jobDetailInputdetail.TransferLibFromQty = jobDetailInputdetail.RecommendFromQty; |
||||
|
jobDetailInputdetail.TransferLibFromSupplierBatch = jobDetailInputdetail.RecommendFromSupplierBatch; |
||||
|
jobDetailInputdetail.TransferLibFromWarehouseCode = jobDetailInputdetail.RecommendFromWarehouseCode; |
||||
|
|
||||
|
jobDetailInputdetail.TransferLibToArriveDate = jobDetailInputdetail.RecommendToArriveDate; |
||||
|
jobDetailInputdetail.TransferLibToContainerCode = jobDetailInputdetail.RecommendToContainerCode; |
||||
|
jobDetailInputdetail.TransferLibToExpireDate = jobDetailInputdetail.RecommendToExpireDate; |
||||
|
jobDetailInputdetail.TransferLibToLot = jobDetailInputdetail.RecommendToLot; |
||||
|
jobDetailInputdetail.TransferLibToPackingCode = jobDetailInputdetail.RecommendToPackingCode; |
||||
|
jobDetailInputdetail.TransferLibToProduceDate = jobDetailInputdetail.RecommendToProduceDate; |
||||
|
jobDetailInputdetail.TransferLibToQty = jobDetailInputdetail.RecommendToQty; |
||||
|
jobDetailInputdetail.TransferLibToSupplierBatch = jobDetailInputdetail.RecommendToSupplierBatch; |
||||
|
jobDetailInputdetail.TransferLibToWarehouseCode = jobDetailInputdetail.TransferLibFromWarehouseCode; |
||||
|
jobDetailInputdetail.TransferLibToLocationArea = jobDetailInputdetail.TransferLibFromLocationArea; |
||||
|
jobDetailInputdetail.TransferLibToLocationCode = jobDetailInputdetail.TransferLibFromLocationCode; |
||||
|
jobDetailInputdetail.TransferLibToLocationErpCode = jobDetailInputdetail.TransferLibFromLocationErpCode; |
||||
|
jobDetailInputdetail.TransferLibToLocationGroup = jobDetailInputdetail.TransferLibFromLocationGroup; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 判断是不是在立体库
|
||||
|
/// </summary>
|
||||
|
/// <param name="input"></param>
|
||||
|
/// <returns></returns>
|
||||
|
private async Task CheckDimensionalStorehouseAsync(SparePartIssueJobEditInput input) |
||||
|
{ |
||||
|
var jobDetailInputdetail = input.Details.FirstOrDefault(); |
||||
|
|
||||
|
var loctionDto = await _locationAppService.GetByCodeAsync(jobDetailInputdetail.RecommendFromLocationCode) |
||||
|
.ConfigureAwait(false); |
||||
|
|
||||
|
if (loctionDto.Type == EnumLocationType.DimensionalStorehouse) |
||||
|
{ |
||||
|
input.JobStatus = EnumJobStatus.Wait; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 判断是不是在立体库
|
||||
|
/// </summary>
|
||||
|
/// <param name="sparePartIssueJobDto"></param>
|
||||
|
/// <returns></returns>
|
||||
|
private async Task CheckDimensionalStorehouseAsync(SparePartIssueJobDTO sparePartIssueJobDto) |
||||
|
{ |
||||
|
var jobDetailInputdetail = sparePartIssueJobDto.Details.FirstOrDefault(); |
||||
|
|
||||
|
var loctionDto = await _locationAppService.GetByCodeAsync(jobDetailInputdetail.RecommendFromLocationCode) |
||||
|
.ConfigureAwait(false); |
||||
|
|
||||
|
if (loctionDto.Type == EnumLocationType.DimensionalStorehouse) |
||||
|
{ |
||||
|
//TODO 立体库
|
||||
|
var ret = await SyncIssueJobStereoAsync(new List<SparePartIssueJobDTO> { sparePartIssueJobDto }, |
||||
|
loctionDto.Code).ConfigureAwait(false); |
||||
|
if (ret.Code != "1") |
||||
|
{ |
||||
|
throw new UserFriendlyException($"调用立体库不成功!原因:{ret.Message}"); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 修改当前任务状态 和 该任务的请求状态
|
||||
|
/// </summary>
|
||||
|
/// <param name="sparePartIssueJob"></param>
|
||||
|
/// <param name="sparePartIssueJobDetailDto"></param>
|
||||
|
/// <param name="handledToQty"></param>
|
||||
|
/// <returns></returns>
|
||||
|
/// <exception cref="UserFriendlyException"></exception>
|
||||
|
private async Task UpdateRequestAndjobStatusDoneAsync(SparePartIssueJob sparePartIssueJob, |
||||
|
SparePartIssueJobDetailDTO sparePartIssueJobDetailDto, decimal handledToQty) |
||||
|
{ |
||||
|
if (sparePartIssueJob.JobStatus is EnumJobStatus.Closed or EnumJobStatus.Cancelled or EnumJobStatus.None |
||||
|
or EnumJobStatus.Done) //需要考虑下 多次提交的问题 所以不判断 进行中
|
||||
|
{ |
||||
|
throw new UserFriendlyException( |
||||
|
$"任务状态错误:编号为【{sparePartIssueJob.Number}】的任务状态为【{sparePartIssueJob.JobStatus.GetDisplayName()}】"); |
||||
|
} |
||||
|
|
||||
|
sparePartIssueJob.JobStatus = EnumJobStatus.Done; |
||||
|
|
||||
|
await RemoveExpectOutAsync(sparePartIssueJob, sparePartIssueJobDetailDto, handledToQty).ConfigureAwait(false); |
||||
|
|
||||
|
//await _expectOutAppService.RemoveByNumberAsync(sparePartIssueJob.Number).ConfigureAwait(false);
|
||||
|
|
||||
|
await SparePartIssueRequestAppService.UpdateStatusCompletedAsync(sparePartIssueJob.SparePartRequestNumber) |
||||
|
.ConfigureAwait(false); |
||||
|
|
||||
|
await Task.CompletedTask.ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 判断实际TO的箱码是否被占用
|
||||
|
/// </summary>
|
||||
|
/// <param name="packingCode"></param>
|
||||
|
/// <param name="jobNumber"></param>
|
||||
|
/// <returns></returns>
|
||||
|
/// <exception cref="UserFriendlyException"></exception>
|
||||
|
private async Task CheckPackingCodeIsUserAsync(string packingCode,string jobNumber) |
||||
|
{ |
||||
|
var list = await _expectOutAppService.GetListByPackingCodeAsync(packingCode).ConfigureAwait(false); |
||||
|
list=list.Where(p => p.JobNumber != jobNumber).ToList(); |
||||
|
if (list.Any()) |
||||
|
{ |
||||
|
throw new UserFriendlyException($"任务号【{list.First().JobNumber}】的任务,已占用【{packingCode}】箱码的库存。"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private async Task RemoveExpectOutAsync(SparePartIssueJob sparePartIssueJob, |
||||
|
SparePartIssueJobDetailDTO sparePartIssueJobDetailDto, |
||||
|
decimal handledToQty) |
||||
|
{ |
||||
|
await _expectOutAppService.RemoveByNumberAndInventoryAsync(sparePartIssueJob.Number, |
||||
|
sparePartIssueJobDetailDto.ItemCode, |
||||
|
sparePartIssueJobDetailDto.HandledToLocationCode, sparePartIssueJobDetailDto.HandledToPackingCode, |
||||
|
sparePartIssueJobDetailDto.Status, sparePartIssueJobDetailDto.HandledToLot, |
||||
|
handledToQty).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
#endregion
|
||||
|
} |
@ -0,0 +1,29 @@ |
|||||
|
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 SparePartIssueJobAutoMapperProfile() |
||||
|
{ |
||||
|
CreateMap<SparePartIssueJob, SparePartIssueJobDTO>() |
||||
|
.ReverseMap(); |
||||
|
|
||||
|
CreateMap<SparePartIssueJobDetail, SparePartIssueJobDetailDTO>() |
||||
|
; |
||||
|
|
||||
|
CreateMap<SparePartIssueJobDetailDTO, SparePartIssueJobDetail>() |
||||
|
; |
||||
|
|
||||
|
CreateMap<SparePartIssueJobDetailInput, SparePartIssueJobDetail>() |
||||
|
.IgnoreAuditedObjectProperties() |
||||
|
.Ignore(x => x.MasterID) |
||||
|
.Ignore(x => x.TenantId) |
||||
|
.Ignore(x => x.Number) |
||||
|
.Ignore(x => x.Id); |
||||
|
|
||||
|
} |
||||
|
} |
@ -0,0 +1,62 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Linq.Expressions; |
||||
|
using System.Threading; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.AspNetCore.Authorization; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using Volo.Abp; |
||||
|
using Volo.Abp.Application.Dtos; |
||||
|
using Volo.Abp.Domain.Entities; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Event; |
||||
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
using Win_in.Sfs.Wms.Store.Domain.Shared; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application; |
||||
|
|
||||
|
[Authorize] |
||||
|
[Route($"{StoreConsts.RootPath}spare-part-issue-note")] |
||||
|
public class SparePartIssueNoteAppService : |
||||
|
SfsStoreWithDetailsAppServiceBase<SparePartIssueNote, SparePartIssueNoteDTO, SfsStoreRequestInputBase, SparePartIssueNoteEditInput, SparePartIssueNoteDetail, |
||||
|
SparePartIssueNoteDetailDTO, SfsStoreRequestInputBase, SparePartIssueNoteImportInput>, |
||||
|
ISparePartIssueNoteAppService |
||||
|
{ |
||||
|
private readonly ISparePartIssueNoteManager _sparePartIssueNoteManager; |
||||
|
|
||||
|
public SparePartIssueNoteAppService( |
||||
|
ISparePartIssueNoteRepository repository, |
||||
|
ISparePartIssueNoteManager sparePartIssueNoteManager |
||||
|
) : base(repository) |
||||
|
{ |
||||
|
_sparePartIssueNoteManager = sparePartIssueNoteManager; |
||||
|
} |
||||
|
|
||||
|
[HttpPost("")] |
||||
|
//[Authorize(SparePartIssueNotePermissions.Create)]
|
||||
|
public override async Task<SparePartIssueNoteDTO> CreateAsync(SparePartIssueNoteEditInput input) |
||||
|
{ |
||||
|
var entity = ObjectMapper.Map<SparePartIssueNoteEditInput, SparePartIssueNote>(input); |
||||
|
await _sparePartIssueNoteManager.CreateAsync(entity).ConfigureAwait(false); |
||||
|
var dto = ObjectMapper.Map<SparePartIssueNote, SparePartIssueNoteDTO>(entity); |
||||
|
return dto; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 确认对应的记录单
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[HttpPost("confirm/{id}")] |
||||
|
public virtual async Task<SparePartIssueNoteDTO> ConfirmAsync(Guid id) |
||||
|
{ |
||||
|
var sparePartIssueNote= await _repository.GetAsync(id).ConfigureAwait(false); |
||||
|
sparePartIssueNote.Confirmed = true; |
||||
|
sparePartIssueNote=await _repository.UpdateAsync(sparePartIssueNote).ConfigureAwait(false); |
||||
|
await LocalEventBus.PublishAsync(new SfsConfirmedEntityEventData<SparePartIssueNote>(sparePartIssueNote), false).ConfigureAwait(false); |
||||
|
return ObjectMapper.Map<SparePartIssueNote, SparePartIssueNoteDTO>(sparePartIssueNote); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,31 @@ |
|||||
|
using AutoMapper; |
||||
|
using Volo.Abp.AutoMapper; |
||||
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application; |
||||
|
|
||||
|
public partial class StoreApplicationAutoMapperProfile : Profile |
||||
|
{ |
||||
|
private void SparePartIssueNoteAutoMapperProfile() |
||||
|
{ |
||||
|
CreateMap<SparePartIssueNote, SparePartIssueNoteDTO>() |
||||
|
.ReverseMap(); |
||||
|
|
||||
|
CreateMap<SparePartIssueNoteDetail, SparePartIssueNoteDetailDTO>(); |
||||
|
|
||||
|
CreateMap<SparePartIssueNoteDetailInput, SparePartIssueNoteDetail>() |
||||
|
.IgnoreAuditedObjectProperties() |
||||
|
.Ignore(x => x.MasterID) |
||||
|
.Ignore(x => x.TenantId) |
||||
|
.Ignore(x => x.Number) |
||||
|
.Ignore(x => x.Id); |
||||
|
|
||||
|
CreateMap<SparePartIssueNoteEditInput, SparePartIssueNote>() |
||||
|
.IgnoreAuditedObjectProperties() |
||||
|
.Ignore(x => x.TenantId) |
||||
|
.Ignore(x => x.Number) |
||||
|
.Ignore(x => x.Id); |
||||
|
; |
||||
|
} |
||||
|
} |
@ -0,0 +1,392 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
using Castle.Components.DictionaryAdapter; |
||||
|
using Microsoft.AspNetCore.Authorization; |
||||
|
using Microsoft.AspNetCore.Mvc; |
||||
|
using NUglify.Helpers; |
||||
|
using Volo.Abp; |
||||
|
using Win_in.Sfs.Basedata.Application.Contracts; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
using Win_in.Sfs.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}spare-part-issue-request")] |
||||
|
public class SparePartIssueRequestAppService : SfsStoreRequestAppServiceBase<SparePartIssueRequest, SparePartIssueRequestDTO, |
||||
|
SfsStoreRequestInputBase, SparePartIssueRequestEditInput, SparePartIssueRequestDetail, SparePartIssueRequestDetailDTO, |
||||
|
SfsStoreRequestInputBase, SparePartIssueRequestImportInput>, |
||||
|
ISparePartIssueRequestAppService |
||||
|
{ |
||||
|
private readonly ISparePartIssueRequestManager _sparePartIssueRequestManager; |
||||
|
private readonly ILocationAppService _locationAppService; |
||||
|
private readonly IItemBasicAppService _itemBasicAppService; |
||||
|
private readonly IProductionLineAppService _productionLineAppService; |
||||
|
private readonly ISparePartIssueJobAppService _sparePartIssueJobAppService; |
||||
|
private readonly ITransactionTypeAppService _transactionTypeAppService; |
||||
|
|
||||
|
public SparePartIssueRequestAppService( |
||||
|
ISparePartIssueRequestRepository repository, |
||||
|
ISparePartIssueRequestManager sparePartIssueRequestManager, |
||||
|
ILocationAppService locationAppService, |
||||
|
IItemBasicAppService itemBasicAppService, |
||||
|
IProductionLineAppService productionLineAppService, |
||||
|
ITransactionTypeAppService transactionTypeAppService, |
||||
|
ISparePartIssueJobAppService sparePartIssueJobAppService) |
||||
|
: base(repository, sparePartIssueRequestManager) |
||||
|
{ |
||||
|
_sparePartIssueRequestManager = sparePartIssueRequestManager; |
||||
|
_locationAppService = locationAppService; |
||||
|
_itemBasicAppService = itemBasicAppService; |
||||
|
_productionLineAppService = productionLineAppService; |
||||
|
_transactionTypeAppService = transactionTypeAppService; |
||||
|
_sparePartIssueJobAppService = sparePartIssueJobAppService; |
||||
|
} |
||||
|
|
||||
|
public override async Task<SparePartIssueRequestDTO> HandleAsync(Guid id) |
||||
|
{ |
||||
|
return await base.HandleAsync(id).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
public override async Task<SparePartIssueRequestDTO> CancelAsync(Guid id) |
||||
|
{ |
||||
|
var request = await _repository.GetAsync(id).ConfigureAwait(false); |
||||
|
|
||||
|
var list = await _sparePartIssueJobAppService.GetByRequestNumberAsync(request.Number).ConfigureAwait(false); |
||||
|
if (list.Any()) |
||||
|
{ |
||||
|
foreach (var sparePartIssueJobDto in list) |
||||
|
{ |
||||
|
if (sparePartIssueJobDto.JobStatus == EnumJobStatus.Open || |
||||
|
sparePartIssueJobDto.JobStatus == EnumJobStatus.Partial || |
||||
|
sparePartIssueJobDto.JobStatus == EnumJobStatus.Doing || |
||||
|
sparePartIssueJobDto.JobStatus == EnumJobStatus.Wait) |
||||
|
{ |
||||
|
await _sparePartIssueJobAppService.CancelAsync(sparePartIssueJobDto.Id).ConfigureAwait(false); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
if (request.RequestStatus == EnumRequestStatus.Partial || request.RequestStatus == EnumRequestStatus.Handling || |
||||
|
request.RequestStatus == EnumRequestStatus.New) |
||||
|
{ |
||||
|
request.RequestStatus = EnumRequestStatus.Cancelled; |
||||
|
await _repository.UpdateAsync(request).ConfigureAwait(false); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
throw new UserFriendlyException($"【{request.RequestStatus.GetDisplayName()}】状态不允许取消"); |
||||
|
} |
||||
|
|
||||
|
return ObjectMapper.Map<SparePartIssueRequest, SparePartIssueRequestDTO>(request); |
||||
|
} |
||||
|
|
||||
|
public override async Task<SparePartIssueRequestDTO> CompleteAsync(Guid id) |
||||
|
{ |
||||
|
var sparePartIssueRequest = await _repository.GetAsync(id).ConfigureAwait(false); |
||||
|
if (sparePartIssueRequest.RequestStatus == EnumRequestStatus.Handling || |
||||
|
sparePartIssueRequest.RequestStatus == EnumRequestStatus.Partial || |
||||
|
sparePartIssueRequest.RequestStatus == EnumRequestStatus.New) |
||||
|
{ |
||||
|
sparePartIssueRequest.RequestStatus = EnumRequestStatus.Completed; |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
throw new UserFriendlyException($"【{sparePartIssueRequest.RequestStatus.GetDisplayName()}】状态不允许完成"); |
||||
|
} |
||||
|
|
||||
|
await _sparePartIssueJobAppService.CompleteByRequestNumberAsync(sparePartIssueRequest.Number).ConfigureAwait(false); |
||||
|
|
||||
|
return ObjectMapper.Map<SparePartIssueRequest, SparePartIssueRequestDTO>(await _repository |
||||
|
.UpdateAsync(sparePartIssueRequest) |
||||
|
.ConfigureAwait(false)); |
||||
|
} |
||||
|
|
||||
|
[HttpPost("")] |
||||
|
public override async Task<SparePartIssueRequestDTO> CreateAsync(SparePartIssueRequestEditInput input) |
||||
|
{ |
||||
|
foreach (var item in input.Details) |
||||
|
{ |
||||
|
if (item.Qty <= 0) |
||||
|
{ |
||||
|
throw new UserFriendlyException($"{item.ItemCode} 物料的需求量必须大于0"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
foreach (var detailInput in input.Details) |
||||
|
{ |
||||
|
var toLocationDto = |
||||
|
await _locationAppService.GetByCodeAsync(detailInput.ToLocationCode).ConfigureAwait(false); |
||||
|
CheckLocation(toLocationDto, detailInput.ToLocationCode); |
||||
|
var itemBasicDto = await _itemBasicAppService.GetByCodeAsync(detailInput.ItemCode).ConfigureAwait(false); |
||||
|
CheckItemBasic(itemBasicDto, detailInput.ItemCode); |
||||
|
var productionLineDto = await _productionLineAppService.GetByLocationCodeAsync(detailInput.ToLocationCode) |
||||
|
.ConfigureAwait(false); |
||||
|
CheckProductionLine(productionLineDto, detailInput.ProdLine); |
||||
|
|
||||
|
detailInput.ProdLine = productionLineDto.Code; |
||||
|
|
||||
|
detailInput.ToLocationArea = toLocationDto.AreaCode; |
||||
|
detailInput.ToLocationGroup = toLocationDto.LocationGroupCode; |
||||
|
detailInput.ToWarehouseCode = toLocationDto.WarehouseCode; |
||||
|
detailInput.ToLocationErpCode = toLocationDto.ErpLocationCode; |
||||
|
|
||||
|
detailInput.ItemDesc1 = itemBasicDto.Desc1; |
||||
|
detailInput.ItemDesc2 = itemBasicDto.Desc2; |
||||
|
detailInput.ItemName = itemBasicDto.Name; |
||||
|
detailInput.Uom = itemBasicDto.BasicUom; |
||||
|
detailInput.StdPackQty = itemBasicDto.StdPackQty; |
||||
|
detailInput.Status = EnumStatus.Open; |
||||
|
|
||||
|
//因为是刚创建的 所以发料数一定是0
|
||||
|
detailInput.IssuedQty = 0; |
||||
|
detailInput.RecommendType = EnumRecommendType.KITTING; |
||||
|
} |
||||
|
|
||||
|
await SetRequestAutoPropertiesAsync(input).ConfigureAwait(false); |
||||
|
var entity = ObjectMapper.Map<SparePartIssueRequestEditInput, SparePartIssueRequest>(input); |
||||
|
|
||||
|
var result = await _sparePartIssueRequestManager.CreateByNumberAsync(entity).ConfigureAwait(false); |
||||
|
|
||||
|
var dto = ObjectMapper.Map<SparePartIssueRequest, SparePartIssueRequestDTO>(result); |
||||
|
|
||||
|
return dto; |
||||
|
} |
||||
|
|
||||
|
[HttpPost("create-and-handle")] |
||||
|
public async Task<SparePartIssueRequestDTO> CreateAndHandleAsync(SparePartIssueRequestEditInput input) |
||||
|
{ |
||||
|
var sparePartIssueRequestDto = await CreateAsync(input).ConfigureAwait(false); |
||||
|
|
||||
|
//await HandleAsync(sparePartIssueRequestDto.Id).ConfigureAwait(false);
|
||||
|
|
||||
|
return sparePartIssueRequestDto; |
||||
|
} |
||||
|
|
||||
|
[HttpPost("UpdateStatusCompleted")] |
||||
|
public async Task UpdateStatusCompletedAsync(string number) |
||||
|
{ |
||||
|
var sparePartIssueRequest = await _repository.FindAsync(p => p.Number == number).ConfigureAwait(false); |
||||
|
|
||||
|
await UpdateSparePartIssueRequestDetailQtyAsync(sparePartIssueRequest, new EditableList<SparePartIssueJobDTO>()) |
||||
|
.ConfigureAwait(false); |
||||
|
|
||||
|
var sparePartIssueJobDtos = await _sparePartIssueJobAppService.GetByRequestNumberAsync(sparePartIssueRequest.Number) |
||||
|
.ConfigureAwait(false); |
||||
|
|
||||
|
if (sparePartIssueJobDtos.Any(p => |
||||
|
p.JobStatus == EnumJobStatus.Open || p.JobStatus == EnumJobStatus.Doing || |
||||
|
p.JobStatus == EnumJobStatus.Partial)) |
||||
|
{ |
||||
|
return; |
||||
|
} |
||||
|
|
||||
|
foreach (var detail in sparePartIssueRequest.Details) |
||||
|
{ |
||||
|
if (detail.Qty >= detail.IssuedQty) |
||||
|
{ |
||||
|
return; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
CheckStatus(EnumRequestStatus.Completed, sparePartIssueRequest.RequestStatus); |
||||
|
sparePartIssueRequest.RequestStatus = EnumRequestStatus.Completed; |
||||
|
await _repository.UpdateAsync(sparePartIssueRequest).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
[HttpPost("IsHasNewJob")] |
||||
|
public async Task<string> IsHasNewJobAsync(string requestNumber, List<string> jobNumber) |
||||
|
{ |
||||
|
var joblIssueJobDtos = |
||||
|
await _sparePartIssueJobAppService.GetByRequestNumberAsync(requestNumber).ConfigureAwait(false); |
||||
|
if (joblIssueJobDtos != null && joblIssueJobDtos.Any()) |
||||
|
{ |
||||
|
var jobNumberList = joblIssueJobDtos.Select(p => p.Number); |
||||
|
|
||||
|
var difference = jobNumberList.Except(jobNumber); |
||||
|
if (difference.Any()) |
||||
|
{ |
||||
|
var result = "已生成任务号"; |
||||
|
difference.ForEach(p => result += "【" + p + "】"); |
||||
|
result += "的任务"; |
||||
|
return result; |
||||
|
} |
||||
|
|
||||
|
return "无任务生成,请检查库存"; |
||||
|
} |
||||
|
|
||||
|
return "无任务生成,请检查库存"; |
||||
|
} |
||||
|
|
||||
|
#region 私有
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 赋值Request业务属性
|
||||
|
/// </summary>
|
||||
|
/// <param name="entity"></param>
|
||||
|
/// <returns></returns>
|
||||
|
private async Task SetRequestAutoPropertiesAsync(SparePartIssueRequestEditInput entity) |
||||
|
{ |
||||
|
var tranType = await _transactionTypeAppService.GetByTransTypeAsync(EnumTransType.Issue, EnumTransSubType.None) |
||||
|
.ConfigureAwait(false); |
||||
|
Check.NotNull(tranType, "事务类型", "事务类型不存在"); |
||||
|
entity.AutoSubmit = tranType.AutoSubmitRequest; |
||||
|
entity.AutoAgree = tranType.AutoAgreeRequest; |
||||
|
entity.AutoHandle = tranType.AutoHandleRequest; |
||||
|
entity.AutoCompleteJob = tranType.AutoCompleteJob; |
||||
|
entity.DirectCreateNote = tranType.DirectCreateNote; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 修改请求的 已发 已收数量
|
||||
|
/// </summary>
|
||||
|
/// <param name="sparePartIssueRequest"></param>
|
||||
|
/// <param name="addSparePartIssueJobDtos"></param>
|
||||
|
/// <returns></returns>
|
||||
|
private async Task UpdateSparePartIssueRequestDetailQtyAsync(SparePartIssueRequest sparePartIssueRequest, |
||||
|
List<SparePartIssueJobDTO> addSparePartIssueJobDtos) |
||||
|
{ |
||||
|
//原有任务
|
||||
|
var existSparePartIssueJobDtos = await _sparePartIssueJobAppService |
||||
|
.GetByRequestNumberAsync(sparePartIssueRequest.Number) |
||||
|
.ConfigureAwait(false); |
||||
|
|
||||
|
//新增的任务和已有的任务总和
|
||||
|
var allSparePartIssueJobDtos = new List<SparePartIssueJobDTO>(); |
||||
|
allSparePartIssueJobDtos.AddRange(addSparePartIssueJobDtos); |
||||
|
allSparePartIssueJobDtos.AddRange(existSparePartIssueJobDtos); |
||||
|
|
||||
|
var groupByItemCodeLocationCode = sparePartIssueRequest.Details.GroupBy(p => |
||||
|
new { p.ItemCode, p.ToLocationCode }); |
||||
|
foreach (var group in groupByItemCodeLocationCode) |
||||
|
{ |
||||
|
foreach (var requestDetail in group) |
||||
|
{ |
||||
|
//所有已发数量
|
||||
|
decimal allIssuedQty = 0; |
||||
|
|
||||
|
//所有已发数量
|
||||
|
decimal allReceivedQty = 0; |
||||
|
|
||||
|
foreach (var allSparePartIssueJobDto in allSparePartIssueJobDtos) |
||||
|
{ |
||||
|
var jobDetailDtos = allSparePartIssueJobDto.Details.Where(p => |
||||
|
p.ItemCode == group.Key.ItemCode && p.RequestLocationCode == group.Key.ToLocationCode); |
||||
|
//所有已发数量
|
||||
|
allIssuedQty += jobDetailDtos.Sum(p => p.RequestQty); |
||||
|
//所有已发数量
|
||||
|
allReceivedQty += jobDetailDtos.Sum(p => p.HandledToQty); |
||||
|
} |
||||
|
|
||||
|
requestDetail.IssuedQty = allIssuedQty; |
||||
|
requestDetail.ReceivedQty = allReceivedQty; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
await _repository.UpdateAsync(sparePartIssueRequest).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 校验
|
||||
|
|
||||
|
private void CheckStatus(EnumRequestStatus targetStatus, EnumRequestStatus nowStatus) |
||||
|
{ |
||||
|
var validSourceStatuses = new List<EnumRequestStatus>(); |
||||
|
switch (targetStatus) |
||||
|
{ |
||||
|
case EnumRequestStatus.None: |
||||
|
break; |
||||
|
case EnumRequestStatus.New: |
||||
|
break; |
||||
|
case EnumRequestStatus.Reviewing: |
||||
|
validSourceStatuses = new List<EnumRequestStatus> { EnumRequestStatus.New }; |
||||
|
break; |
||||
|
case EnumRequestStatus.Refused: |
||||
|
validSourceStatuses = new List<EnumRequestStatus> { EnumRequestStatus.Reviewing }; |
||||
|
break; |
||||
|
case EnumRequestStatus.Agreed: |
||||
|
validSourceStatuses = new List<EnumRequestStatus> { EnumRequestStatus.Reviewing }; |
||||
|
break; |
||||
|
case EnumRequestStatus.Handling: |
||||
|
validSourceStatuses = new List<EnumRequestStatus> |
||||
|
{ |
||||
|
EnumRequestStatus.Agreed, EnumRequestStatus.Partial |
||||
|
}; |
||||
|
break; |
||||
|
case EnumRequestStatus.Completed: |
||||
|
validSourceStatuses = new List<EnumRequestStatus> |
||||
|
{ |
||||
|
EnumRequestStatus.Handling, EnumRequestStatus.Partial |
||||
|
}; |
||||
|
break; |
||||
|
case EnumRequestStatus.Cancelled: |
||||
|
validSourceStatuses = new List<EnumRequestStatus> |
||||
|
{ |
||||
|
EnumRequestStatus.New, EnumRequestStatus.Reviewing, EnumRequestStatus.Agreed |
||||
|
}; |
||||
|
break; |
||||
|
case EnumRequestStatus.Abort: |
||||
|
validSourceStatuses = new List<EnumRequestStatus> |
||||
|
{ |
||||
|
EnumRequestStatus.Handling, EnumRequestStatus.Partial |
||||
|
}; |
||||
|
break; |
||||
|
case EnumRequestStatus.Partial: |
||||
|
{ |
||||
|
validSourceStatuses = new List<EnumRequestStatus> |
||||
|
{ |
||||
|
EnumRequestStatus.Handling, EnumRequestStatus.Partial |
||||
|
}; |
||||
|
break; |
||||
|
} |
||||
|
default: |
||||
|
throw new ArgumentOutOfRangeException(nameof(targetStatus), targetStatus, null); |
||||
|
} |
||||
|
|
||||
|
if (!validSourceStatuses.Contains(nowStatus)) |
||||
|
{ |
||||
|
throw new UserFriendlyException( |
||||
|
$"当前状态为 {nowStatus.GetDisplayName()} ,无法变更为 {targetStatus.GetDisplayName()}"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private void CheckItemBasic(ItemBasicDTO itemBasicDto, string itemCode) |
||||
|
{ |
||||
|
if (itemBasicDto == null) |
||||
|
{ |
||||
|
throw new UserFriendlyException($"物品代码为【{itemCode}】不存在"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private void CheckLocation(LocationDTO locationDto, string locationCode) |
||||
|
{ |
||||
|
if (locationDto == null) |
||||
|
{ |
||||
|
throw new UserFriendlyException($"库位代码为【{locationCode}】不存在"); |
||||
|
} |
||||
|
|
||||
|
if (locationDto.Type != EnumLocationType.WIP) |
||||
|
{ |
||||
|
throw new UserFriendlyException( |
||||
|
$"库位代码【{locationCode}】不是【{EnumLocationType.WIP.GetDisplayName()}】类型"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
private void CheckProductionLine(ProductionLineDTO productionLineDto, string productionCode) |
||||
|
{ |
||||
|
if (productionLineDto == null) |
||||
|
{ |
||||
|
throw new UserFriendlyException($"未找到生产线【{productionCode}】"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
#endregion
|
||||
|
} |
@ -0,0 +1,65 @@ |
|||||
|
using AutoMapper; |
||||
|
using Volo.Abp.AutoMapper; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Application; |
||||
|
|
||||
|
public partial class StoreApplicationAutoMapperProfile : Profile |
||||
|
{ |
||||
|
private void SparePartIssueRequestAutoMapperProfile() |
||||
|
{ |
||||
|
CreateMap<SparePartIssueRequest, SparePartIssueRequestDTO>() |
||||
|
.ReverseMap(); |
||||
|
|
||||
|
CreateMap<SparePartIssueRequestDetail, SparePartIssueRequestDetailDTO>() |
||||
|
.ReverseMap(); |
||||
|
|
||||
|
CreateMap<SparePartIssueRequestDetailInput, SparePartIssueRequestDetail>() |
||||
|
.IgnoreAuditedObjectProperties() |
||||
|
.Ignore(x => x.MasterID) |
||||
|
.Ignore(x => x.TenantId) |
||||
|
.Ignore(x => x.Number) |
||||
|
.Ignore(x => x.Id); |
||||
|
|
||||
|
CreateMap<SparePartIssueRequestImportInput, SparePartIssueRequest>() |
||||
|
.IgnoreAuditedObjectProperties() |
||||
|
.Ignore(x => x.UseOnTheWayLocation) |
||||
|
.Ignore(x => x.Details) |
||||
|
.Ignore(x => x.Remark) |
||||
|
.Ignore(x => x.TenantId) |
||||
|
.Ignore(x => x.Number) |
||||
|
.Ignore(x => x.RequestStatus) |
||||
|
.Ignore(x => x.ConcurrencyStamp) |
||||
|
.Ignore(x => x.ExtraProperties) |
||||
|
.Ignore(x => x.ActiveDate) |
||||
|
.Ignore(x => x.Remark); |
||||
|
|
||||
|
CreateMap<SparePartIssueRequestImportInput, SparePartIssueRequestDetail>() |
||||
|
.IgnoreAuditedObjectProperties() |
||||
|
.ForMember(x => x.Status, y => y.MapFrom(t => EnumStatus.Open)) |
||||
|
.Ignore(x => x.ToLocationErpCode) |
||||
|
.Ignore(x => x.ToWarehouseCode) |
||||
|
.Ignore(x => x.ToLocationArea) |
||||
|
.Ignore(x => x.ToLocationGroup) |
||||
|
.Ignore(x => x.ItemName).Ignore(x => x.ItemDesc1).Ignore(x => x.ItemDesc2) |
||||
|
.Ignore(x => x.ProdLine) |
||||
|
.Ignore(x => x.IssuedQty) |
||||
|
.Ignore(x => x.ReceivedQty) |
||||
|
.Ignore(x => x.ToBeIssuedQty) |
||||
|
.Ignore(x => x.ToBeReceivedQty) |
||||
|
.Ignore(x => x.NotFinishQty) |
||||
|
.Ignore(x => x.StdPackQty) |
||||
|
.Ignore(x => x.Uom) |
||||
|
.Ignore(x => x.TenantId) |
||||
|
.Ignore(x => x.MasterID) |
||||
|
.Ignore(x => x.Number) |
||||
|
.Ignore(x => x.Id) |
||||
|
.Ignore(x => x.Remark); |
||||
|
CreateMap<SparePartIssueRequestEditInput, SparePartIssueRequest>() |
||||
|
.IgnoreAuditedObjectProperties() |
||||
|
.Ignore(x => x.RequestStatus) |
||||
|
.Ignore(x => x.ConcurrencyStamp).Ignore(x => x.Id); |
||||
|
} |
||||
|
} |
@ -0,0 +1,10 @@ |
|||||
|
using System; |
||||
|
using System.Linq.Expressions; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
public interface ISparePartIssueJobManager : IJobManager<SparePartIssueJob> |
||||
|
{ |
||||
|
Task<SparePartIssueJob> GetAsync(Expression<Func<SparePartIssueJob, bool>> expression); |
||||
|
} |
@ -0,0 +1,6 @@ |
|||||
|
namespace Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
public interface ISparePartIssueJobRepository : ISfsJobRepositoryBase<SparePartIssueJob> |
||||
|
{ |
||||
|
|
||||
|
} |
@ -0,0 +1,44 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.Threading.Tasks; |
||||
|
using Win_in.Sfs.Shared.Domain.Entities; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 备件发料任务
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "备件发料任务")] |
||||
|
public class SparePartIssueJob : SfsJobAggregateRootBase<SparePartIssueJobDetail> |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 叫料类型
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "叫料类型")] |
||||
|
public EnumIssueRequestType IssueRequestType { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 生产线
|
||||
|
/// </summary>
|
||||
|
public string ProdLine { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 要料单号
|
||||
|
/// </summary>
|
||||
|
public string SparePartRequestNumber { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 使用在途库
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "使用在途库")] |
||||
|
public bool UseOnTheWayLocation { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 任务明细
|
||||
|
/// </summary>
|
||||
|
public override List<SparePartIssueJobDetail> Details { get; set; } = new List<SparePartIssueJobDetail>(); |
||||
|
|
||||
|
public EnumIssueSendType EnumIssueSendType { get; set; } |
||||
|
} |
@ -0,0 +1,524 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
public class SparePartIssueJobDetail : SfsDetailEntityBase |
||||
|
{ |
||||
|
#region 库存基础信息
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 物品代码
|
||||
|
/// </summary>
|
||||
|
public string ItemCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 物品名称
|
||||
|
/// </summary>
|
||||
|
public string ItemName { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 物品描述1
|
||||
|
/// </summary>
|
||||
|
public string ItemDesc1 { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 物品描述2
|
||||
|
/// </summary>
|
||||
|
public string ItemDesc2 { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 标包数量
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "标包数量")] |
||||
|
[Column(TypeName = "decimal(18,6)")] |
||||
|
public decimal StdPackQty { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库存状态
|
||||
|
/// </summary>
|
||||
|
public EnumInventoryStatus Status { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 计量单位
|
||||
|
/// </summary>
|
||||
|
public string Uom { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 请求信息
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 请求库位
|
||||
|
/// </summary>
|
||||
|
public string RequestLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 到库区
|
||||
|
/// </summary>
|
||||
|
public string RequestLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 到库位组
|
||||
|
/// </summary>
|
||||
|
public string RequestLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 到ERP库位
|
||||
|
/// </summary>
|
||||
|
public string RequestLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 到仓库
|
||||
|
/// </summary>
|
||||
|
public string RequestWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 在途库库位
|
||||
|
/// </summary>
|
||||
|
public string OnTheWayLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 生产线
|
||||
|
/// </summary>
|
||||
|
public string ProdLine { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 位置码
|
||||
|
/// </summary>
|
||||
|
public string PositionCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐的类型
|
||||
|
/// </summary>
|
||||
|
public EnumRecommendType RecommendType { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 需求数量
|
||||
|
/// </summary>
|
||||
|
public decimal RequestQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 推荐来源
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源托标签
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源箱标签
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendFromArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendFromProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendFromExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次排序
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源库位
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源库区
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源库位组
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源ERP库位
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源仓库
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源数量
|
||||
|
/// </summary>
|
||||
|
public decimal RecommendFromQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 推荐目标
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标托标签
|
||||
|
/// </summary>
|
||||
|
public string RecommendToContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标箱标签
|
||||
|
/// </summary>
|
||||
|
public string RecommendToPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string RecommendToSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendToArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendToProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendToExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次排序
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标库位
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标库区
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标库位组
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标ERP库位
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标仓库
|
||||
|
/// </summary>
|
||||
|
public string RecommendToWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标数量
|
||||
|
/// </summary>
|
||||
|
public decimal RecommendToQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 库移来源
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源托标签
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源箱标签
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibFromArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibFromProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibFromExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次排序
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源库位
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源库区
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源库位组
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源ERP库位
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源仓库
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源数量
|
||||
|
/// </summary>
|
||||
|
public decimal TransferLibFromQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 库移目标
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标托标签
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标箱标签
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibToArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibToProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibToExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次排序
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标库位
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标库区
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标库位组
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标ERP库位
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标仓库
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标数量
|
||||
|
/// </summary>
|
||||
|
public decimal TransferLibToQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 实际来源
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际目标托标签
|
||||
|
/// </summary>
|
||||
|
public string HandledFromContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际箱标签
|
||||
|
/// </summary>
|
||||
|
public string HandledFromPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string HandledFromSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledFromArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledFromProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledFromExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次排序
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库位
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库区
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库位组
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际ERP库位
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际仓库
|
||||
|
/// </summary>
|
||||
|
public string HandledFromWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际数量
|
||||
|
/// </summary>
|
||||
|
public decimal HandledFromQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 实际目标
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际目标托标签
|
||||
|
/// </summary>
|
||||
|
public string HandledToContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际箱标签
|
||||
|
/// </summary>
|
||||
|
public string HandledToPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string HandledToSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledToArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledToProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledToExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次排序
|
||||
|
/// </summary>
|
||||
|
public string HandledToLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库位
|
||||
|
/// </summary>
|
||||
|
public string HandledToLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库区
|
||||
|
/// </summary>
|
||||
|
public string HandledToLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库位组
|
||||
|
/// </summary>
|
||||
|
public string HandledToLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际ERP库位
|
||||
|
/// </summary>
|
||||
|
public string HandledToLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际仓库
|
||||
|
/// </summary>
|
||||
|
public string HandledToWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际数量
|
||||
|
/// </summary>
|
||||
|
public decimal HandledToQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
public void SetId(Guid id) |
||||
|
{ |
||||
|
this.Id = id; |
||||
|
} |
||||
|
} |
@ -0,0 +1,124 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.Linq; |
||||
|
using System.Linq.Expressions; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp; |
||||
|
using Volo.Abp.Domain.Repositories; |
||||
|
using Volo.Abp.Users; |
||||
|
using Volo.Abp.Validation; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
using Win_in.Sfs.Wms.Inventory.Application.Contracts; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
public class SparePartIssueJobManager : SfsJobManagerBase<SparePartIssueJob, SparePartIssueJobDetail>, ISparePartIssueJobManager |
||||
|
{ |
||||
|
private readonly IBalanceAppService _balanceAppService; |
||||
|
private readonly IExpectOutAppService _expectOutAppService; |
||||
|
|
||||
|
public SparePartIssueJobManager( |
||||
|
ISparePartIssueJobRepository repository, |
||||
|
IBalanceAppService balanceAppService, |
||||
|
IExpectOutAppService expectOutAppService) : base(repository) |
||||
|
{ |
||||
|
_balanceAppService = balanceAppService; |
||||
|
_expectOutAppService = expectOutAppService; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 执行任务 发料任务
|
||||
|
/// </summary>
|
||||
|
/// <param name="id"></param>
|
||||
|
/// <param name="input"></param>
|
||||
|
/// <param name="user"></param>
|
||||
|
/// <returns></returns>
|
||||
|
public override async Task<SparePartIssueJob> CompleteAsync(SparePartIssueJob input, ICurrentUser user) |
||||
|
{ |
||||
|
var entity = await Repository.FindAsync(input.Id).ConfigureAwait(false); |
||||
|
|
||||
|
var inputDetail = input.Details.First(); |
||||
|
var detail = entity.Details.First(); |
||||
|
|
||||
|
var expectOutDtos = await _expectOutAppService.GetListByItemCodeAndStatusAndPackingCodeAsync(detail.ItemCode, detail.HandledFromLocationCode, detail.HandledFromPackingCode, detail.Status, detail.HandledFromLot).ConfigureAwait(false); |
||||
|
if (expectOutDtos.Any()) |
||||
|
{ |
||||
|
throw new UserFriendlyException($" 箱码:{detail.HandledFromPackingCode}," + |
||||
|
$" 物品代码:{detail.ItemCode}," + |
||||
|
$" 库位代码:{detail.HandledFromLocationCode}," + |
||||
|
$" 状态:{detail.Status}," + |
||||
|
$" 批次:{detail.HandledFromLot}" + |
||||
|
$" 的库存被占用【预计出】"); |
||||
|
} |
||||
|
|
||||
|
var balanceDto=await _balanceAppService.GetRealQtyByPackingCodeAndItemCodeAndLocationCodeAndStatusAsync(inputDetail.HandledFromPackingCode, inputDetail.ItemCode, inputDetail.HandledFromLocationCode, inputDetail.Status, inputDetail.HandledFromLot).ConfigureAwait(false); |
||||
|
if (balanceDto.Qty <= 0) |
||||
|
{ |
||||
|
throw new UserFriendlyException($" 箱码:{detail.HandledFromPackingCode}," + |
||||
|
$" 物品代码:{detail.ItemCode}," + |
||||
|
$" 库位代码:{detail.HandledFromLocationCode}," + |
||||
|
$" 状态:{detail.Status}," + |
||||
|
$" 批次:{detail.HandledFromLot}" + |
||||
|
$" 的可用库存不大于0,现在为{balanceDto.Qty},请检查【库存数量】和【预计出】"); |
||||
|
} |
||||
|
|
||||
|
detail.HandledFromArriveDate = inputDetail.HandledFromArriveDate; |
||||
|
detail.HandledFromContainerCode = inputDetail.HandledFromContainerCode; |
||||
|
detail.HandledFromExpireDate = inputDetail.HandledFromExpireDate; |
||||
|
detail.HandledFromLocationArea = inputDetail.HandledFromLocationArea; |
||||
|
detail.HandledFromLocationCode = inputDetail.HandledFromLocationCode; |
||||
|
detail.HandledFromLocationErpCode = inputDetail.HandledFromLocationErpCode; |
||||
|
detail.HandledFromLocationGroup = inputDetail.HandledFromLocationGroup; |
||||
|
detail.HandledFromLot = inputDetail.HandledFromLot; |
||||
|
detail.HandledFromPackingCode = inputDetail.HandledFromPackingCode; |
||||
|
detail.HandledFromProduceDate = inputDetail.HandledFromProduceDate; |
||||
|
detail.HandledFromQty = inputDetail.HandledFromQty; |
||||
|
detail.HandledFromSupplierBatch = inputDetail.HandledFromSupplierBatch; |
||||
|
detail.HandledFromWarehouseCode = inputDetail.HandledFromWarehouseCode; |
||||
|
|
||||
|
detail.HandledToArriveDate = inputDetail.HandledToArriveDate; |
||||
|
detail.HandledToContainerCode = inputDetail.HandledToContainerCode; |
||||
|
detail.HandledToExpireDate = inputDetail.HandledToExpireDate; |
||||
|
detail.HandledToLocationArea = inputDetail.HandledToLocationArea; |
||||
|
detail.HandledToLocationCode = inputDetail.HandledToLocationCode; |
||||
|
detail.HandledToLocationErpCode = inputDetail.HandledToLocationErpCode; |
||||
|
detail.HandledToLocationGroup = inputDetail.HandledToLocationGroup; |
||||
|
detail.HandledToLot = inputDetail.HandledToLot; |
||||
|
detail.HandledToPackingCode = inputDetail.HandledToPackingCode; |
||||
|
detail.HandledToProduceDate = inputDetail.HandledToProduceDate; |
||||
|
detail.HandledToQty = inputDetail.HandledToQty; |
||||
|
detail.HandledToSupplierBatch = inputDetail.HandledToSupplierBatch; |
||||
|
detail.HandledToWarehouseCode = inputDetail.HandledToWarehouseCode; |
||||
|
|
||||
|
detail.HandledToPackingCode = string.Empty; |
||||
|
detail.HandledToLot = string.Empty; |
||||
|
detail.HandledToContainerCode = string.Empty; |
||||
|
|
||||
|
return await base.CompleteAsync(entity, user).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
public async Task<SparePartIssueJob> GetAsync(Expression<Func<SparePartIssueJob, bool>> expression) |
||||
|
{ |
||||
|
return await Repository.FindAsync(expression).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
#region 无用
|
||||
|
|
||||
|
public override Task<List<SparePartIssueJob>> GetWorkingListByPackingAsync(string packingCode) |
||||
|
{ |
||||
|
throw new NotImplementedException(); |
||||
|
} |
||||
|
|
||||
|
public override Task<List<SparePartIssueJob>> GetWorkingListByContainerAsync(string containerCode) |
||||
|
{ |
||||
|
throw new NotImplementedException(); |
||||
|
} |
||||
|
|
||||
|
public override void CheckDetails(SparePartIssueJob entity, AbpValidationResult result) |
||||
|
{ |
||||
|
throw new NotImplementedException(); |
||||
|
} |
||||
|
|
||||
|
#endregion
|
||||
|
} |
@ -0,0 +1,10 @@ |
|||||
|
using System; |
||||
|
using System.Threading.Tasks; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
public interface ISparePartIssueNoteManager : ISfsStoreManager<SparePartIssueNote, SparePartIssueNoteDetail> |
||||
|
{ |
||||
|
Task<SparePartIssueNote> ConfirmAsync(Guid id); |
||||
|
|
||||
|
} |
@ -0,0 +1,6 @@ |
|||||
|
namespace Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
public interface ISparePartIssueNoteRepository : ISfsStoreRepositoryBase<SparePartIssueNote> |
||||
|
{ |
||||
|
|
||||
|
} |
@ -0,0 +1,69 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Volo.Abp; |
||||
|
using Win_in.Sfs.Shared.Domain.Entities; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 备件叫料记录
|
||||
|
/// </summary>
|
||||
|
public class SparePartIssueNote : SfsStoreAggregateRootBase<SparePartIssueNoteDetail>, IHasJobNumber, IHasRequestNumber |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 任务ID
|
||||
|
/// </summary>
|
||||
|
[IgnoreUpdate] |
||||
|
public string JobNumber { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 明细列表
|
||||
|
/// </summary>
|
||||
|
public override List<SparePartIssueNoteDetail> Details { get; set; } = new List<SparePartIssueNoteDetail>(); |
||||
|
|
||||
|
public string RequestNumber { get; set; } |
||||
|
/// <summary>
|
||||
|
/// 叫料类型
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "叫料类型")] |
||||
|
public EnumIssueRequestType IssueRequestType { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 使用在途库
|
||||
|
/// </summary>
|
||||
|
public bool UseOnTheWayLocation { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 确认时间
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "确认时间")] |
||||
|
public DateTime? ConfirmTime { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 已确认
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "已确认")] |
||||
|
public bool Confirmed { get; set; } |
||||
|
|
||||
|
public EnumIssueSendType EnumIssueSendType { 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,519 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
public class SparePartIssueNoteDetail : SfsStoreDetailEntityBase |
||||
|
{ |
||||
|
#region 库存基础信息
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 物品代码
|
||||
|
/// </summary>
|
||||
|
public string ItemCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 物品名称
|
||||
|
/// </summary>
|
||||
|
public string ItemName { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 物品描述1
|
||||
|
/// </summary>
|
||||
|
public string ItemDesc1 { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 物品描述2
|
||||
|
/// </summary>
|
||||
|
public string ItemDesc2 { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 标包数量
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "标包数量")] |
||||
|
[Column(TypeName = "decimal(18,6)")] |
||||
|
public decimal StdPackQty { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库存状态
|
||||
|
/// </summary>
|
||||
|
public EnumInventoryStatus Status { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 计量单位
|
||||
|
/// </summary>
|
||||
|
public string Uom { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 请求信息
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 请求库位
|
||||
|
/// </summary>
|
||||
|
public string RequestLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 到库区
|
||||
|
/// </summary>
|
||||
|
public string RequestLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 到库位组
|
||||
|
/// </summary>
|
||||
|
public string RequestLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 到ERP库位
|
||||
|
/// </summary>
|
||||
|
public string RequestLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 到仓库
|
||||
|
/// </summary>
|
||||
|
public string RequestWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 在途库库位
|
||||
|
/// </summary>
|
||||
|
public string OnTheWayLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 生产线
|
||||
|
/// </summary>
|
||||
|
public string ProdLine { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 位置码
|
||||
|
/// </summary>
|
||||
|
public string PositionCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐的类型
|
||||
|
/// </summary>
|
||||
|
public EnumRecommendType RecommendType { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 需求数量
|
||||
|
/// </summary>
|
||||
|
public decimal RequestQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 推荐来源
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源托标签
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源箱标签
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendFromArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendFromProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendFromExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源批次排序
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源库位
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源库区
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源库位组
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源ERP库位
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源仓库
|
||||
|
/// </summary>
|
||||
|
public string RecommendFromWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐来源数量
|
||||
|
/// </summary>
|
||||
|
public decimal RecommendFromQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 推荐目标
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标托标签
|
||||
|
/// </summary>
|
||||
|
public string RecommendToContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标箱标签
|
||||
|
/// </summary>
|
||||
|
public string RecommendToPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string RecommendToSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendToArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendToProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime RecommendToExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标批次排序
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标库位
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标库区
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标库位组
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标ERP库位
|
||||
|
/// </summary>
|
||||
|
public string RecommendToLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标仓库
|
||||
|
/// </summary>
|
||||
|
public string RecommendToWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐目标数量
|
||||
|
/// </summary>
|
||||
|
public decimal RecommendToQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 库移来源
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源托标签
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源箱标签
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibFromArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibFromProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibFromExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源批次排序
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源库位
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源库区
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源库位组
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源ERP库位
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源仓库
|
||||
|
/// </summary>
|
||||
|
public string TransferLibFromWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移来源数量
|
||||
|
/// </summary>
|
||||
|
public decimal TransferLibFromQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 库移目标
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标托标签
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标箱标签
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibToArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibToProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime TransferLibToExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标批次排序
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标库位
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标库区
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标库位组
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标ERP库位
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标仓库
|
||||
|
/// </summary>
|
||||
|
public string TransferLibToWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 库移目标数量
|
||||
|
/// </summary>
|
||||
|
public decimal TransferLibToQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 实际来源
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际目标托标签
|
||||
|
/// </summary>
|
||||
|
public string HandledFromContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际箱标签
|
||||
|
/// </summary>
|
||||
|
public string HandledFromPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string HandledFromSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledFromArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledFromProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledFromExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次排序
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库位
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库区
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库位组
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际ERP库位
|
||||
|
/// </summary>
|
||||
|
public string HandledFromLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际仓库
|
||||
|
/// </summary>
|
||||
|
public string HandledFromWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际数量
|
||||
|
/// </summary>
|
||||
|
public decimal HandledFromQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 实际目标
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际目标托标签
|
||||
|
/// </summary>
|
||||
|
public string HandledToContainerCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际箱标签
|
||||
|
/// </summary>
|
||||
|
public string HandledToPackingCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次供应商批次
|
||||
|
/// </summary>
|
||||
|
public string HandledToSupplierBatch { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次到货时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledToArriveDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次生产时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledToProduceDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次过期时间
|
||||
|
/// </summary>
|
||||
|
public DateTime HandledToExpireDate { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际批次排序
|
||||
|
/// </summary>
|
||||
|
public string HandledToLot { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库位
|
||||
|
/// </summary>
|
||||
|
public string HandledToLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库区
|
||||
|
/// </summary>
|
||||
|
public string HandledToLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际库位组
|
||||
|
/// </summary>
|
||||
|
public string HandledToLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际ERP库位
|
||||
|
/// </summary>
|
||||
|
public string HandledToLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际仓库
|
||||
|
/// </summary>
|
||||
|
public string HandledToWarehouseCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 实际数量
|
||||
|
/// </summary>
|
||||
|
public decimal HandledToQty { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
} |
@ -0,0 +1,42 @@ |
|||||
|
using System; |
||||
|
using System.Threading.Tasks; |
||||
|
using Microsoft.Extensions.Logging; |
||||
|
using Volo.Abp; |
||||
|
using Volo.Abp.Uow; |
||||
|
using Win_in.Sfs.Shared.Event; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
public class SparePartIssueNoteManager : SfsStoreManagerBase<SparePartIssueNote, SparePartIssueNoteDetail>, ISparePartIssueNoteManager |
||||
|
{ |
||||
|
|
||||
|
public SparePartIssueNoteManager( |
||||
|
ISparePartIssueNoteRepository repository |
||||
|
) : base(repository) |
||||
|
{ |
||||
|
} |
||||
|
|
||||
|
[UnitOfWork] |
||||
|
public virtual async Task<SparePartIssueNote> 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(SparePartIssueNote entity) |
||||
|
{ |
||||
|
try |
||||
|
{ |
||||
|
await LocalEventBus.PublishAsync(new SfsConfirmedEntityEventData<SparePartIssueNote>(entity), false).ConfigureAwait(false); |
||||
|
} |
||||
|
catch (Exception ex) |
||||
|
{ |
||||
|
Logger.LogDebug($"{nameof(SparePartIssueNote)} Confirmed Event:{ex.Message}", null); |
||||
|
Console.WriteLine(ex.Source); |
||||
|
throw; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,9 @@ |
|||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
public interface ISparePartIssueRequestRepository : ISfsStoreRepositoryBase<SparePartIssueRequest>, |
||||
|
ISfsBulkRepositoryBase<SparePartIssueRequest> |
||||
|
{ |
||||
|
|
||||
|
} |
@ -0,0 +1,13 @@ |
|||||
|
using System.Threading.Tasks; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
public interface ISparePartIssueRequestManager : ISfsStoreRequestManager<SparePartIssueRequest, SparePartIssueRequestDetail>, |
||||
|
IBulkImportService<SparePartIssueRequest> |
||||
|
{ |
||||
|
|
||||
|
Task CompleteAsync(string number); |
||||
|
|
||||
|
Task<SparePartIssueRequest> CreateByNumberAsync(SparePartIssueRequest entity); |
||||
|
} |
@ -0,0 +1,24 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using Win_in.Sfs.Shared.Domain.Entities; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 备件叫料申请
|
||||
|
/// </summary>
|
||||
|
public class SparePartIssueRequest : SfsStoreRequestAggregateRootBase<SparePartIssueRequestDetail> |
||||
|
{ |
||||
|
/// <summary>
|
||||
|
/// 叫料类型
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "叫料类型")] |
||||
|
public EnumIssueRequestType IssueRequestType { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 使用在途库
|
||||
|
/// </summary>
|
||||
|
public bool UseOnTheWayLocation { get; set; } |
||||
|
|
||||
|
} |
@ -0,0 +1,103 @@ |
|||||
|
using System; |
||||
|
using System.ComponentModel.DataAnnotations; |
||||
|
using System.ComponentModel.DataAnnotations.Schema; |
||||
|
using Win_in.Sfs.Shared.Domain; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 备件叫料申请明细
|
||||
|
/// </summary>
|
||||
|
public class SparePartIssueRequestDetail : SfsStoreDetailWithQtyEntityBase, IHasToLocation |
||||
|
{ |
||||
|
#region 目标库位信息
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 目标库位
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "目标库位")] |
||||
|
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] |
||||
|
public string ToLocationCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 目标库区
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "目标库区")] |
||||
|
public string ToLocationArea { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 目标库位组
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "目标库位组")] |
||||
|
public string ToLocationGroup { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 目标ERP储位
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "目标ERP储位")] |
||||
|
public string ToLocationErpCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 目标仓库
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "目标仓库")] |
||||
|
public string ToWarehouseCode { get; set; } |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 生产线
|
||||
|
/// </summary>
|
||||
|
public string ProdLine { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 已发数量
|
||||
|
/// </summary>
|
||||
|
public decimal IssuedQty { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 已收数量
|
||||
|
/// </summary>
|
||||
|
public decimal ReceivedQty { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 明细状态
|
||||
|
/// </summary>
|
||||
|
public EnumStatus Status { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 请求未发 还未发送的数量
|
||||
|
/// </summary>
|
||||
|
[NotMapped] |
||||
|
public decimal ToBeIssuedQty => Qty - IssuedQty; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 已发未收
|
||||
|
/// </summary>
|
||||
|
[NotMapped] |
||||
|
public decimal ToBeReceivedQty => IssuedQty - ReceivedQty; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 请求未收
|
||||
|
/// </summary>
|
||||
|
[NotMapped] |
||||
|
public decimal NotFinishQty => Qty - ReceivedQty; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 位置码
|
||||
|
/// </summary>
|
||||
|
public string PositionCode { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 推荐类型
|
||||
|
/// </summary>
|
||||
|
public EnumRecommendType RecommendType { get; set; } |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 需求箱数量
|
||||
|
/// </summary>
|
||||
|
[Display(Name = "需求箱数量")] |
||||
|
public decimal BoxQty { get; set; } |
||||
|
} |
@ -0,0 +1,55 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
using Win_in.Sfs.Shared.Event; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
public class SparePartIssueRequestManager |
||||
|
: SfsStoreRequestManagerBase<SparePartIssueRequest, SparePartIssueRequestDetail> |
||||
|
, ISparePartIssueRequestManager |
||||
|
{ |
||||
|
private readonly ISparePartIssueRequestRepository _repository; |
||||
|
|
||||
|
public SparePartIssueRequestManager( |
||||
|
ISparePartIssueRequestRepository repository |
||||
|
) : base(repository) |
||||
|
{ |
||||
|
_repository = repository; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 创建 同时 直接赋值Number 为了返回Number
|
||||
|
/// </summary>
|
||||
|
/// <param name="entity"></param>
|
||||
|
/// <returns></returns>
|
||||
|
public virtual async Task<SparePartIssueRequest> CreateByNumberAsync(SparePartIssueRequest entity) |
||||
|
{ |
||||
|
var number = string.IsNullOrEmpty(entity.Number) |
||||
|
? await GenerateNumberAsync(nameof(SparePartIssueRequest), entity.ActiveDate).ConfigureAwait(false) |
||||
|
: entity.Number; |
||||
|
entity.SetIdAndNumberWithDetails(GuidGenerator, number); |
||||
|
entity.Submit(); |
||||
|
entity.Agree(); |
||||
|
entity.RequestStatus = EnumRequestStatus.Partial; |
||||
|
await LocalEventBus.PublishAsync(new SfsHandledEntityEventData<SparePartIssueRequest>(entity),false) |
||||
|
.ConfigureAwait(false); |
||||
|
await _repository.InsertAsync(entity).ConfigureAwait(false); |
||||
|
return entity; |
||||
|
} |
||||
|
|
||||
|
public virtual async Task CompleteAsync(string number) |
||||
|
{ |
||||
|
var entity = await GetByNumberAsync(number).ConfigureAwait(false); |
||||
|
if (entity != null && !entity.Details.Any(p => p.ToBeIssuedQty > 0)) |
||||
|
{ |
||||
|
await CompleteAsync(entity).ConfigureAwait(false); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
public Task ImportDataAsync(List<SparePartIssueRequest> entities, List<SparePartIssueRequest> deleteEntities = null) |
||||
|
{ |
||||
|
throw new System.NotImplementedException(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,61 @@ |
|||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Volo.Abp.EntityFrameworkCore.Modeling; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
using Win_in.Sfs.Shared.EntityFrameworkCore; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.EntityFrameworkCore; |
||||
|
|
||||
|
public static class SparePartIssueJobDbContextModelCreatingExtensions |
||||
|
{ |
||||
|
public static void ConfigureSparePartIssueJob(this ModelBuilder builder, StoreModelBuilderConfigurationOptions options) |
||||
|
{ |
||||
|
builder.Entity<SparePartIssueJob>(b => |
||||
|
{ |
||||
|
//Configure table & schema name
|
||||
|
b.ToTable(StoreDbProperties.JobDbTablePrefix + nameof(SparePartIssueJob), options.Schema); |
||||
|
//Configure ABP properties
|
||||
|
b.ConfigureByConvention(); |
||||
|
//Configure Sfs base properties
|
||||
|
b.ConfigureSfsBase(); |
||||
|
//Configure Job base properties
|
||||
|
b.ConfigureJob<SparePartIssueJob, SparePartIssueJobDetail>(); |
||||
|
//Properties
|
||||
|
b.Property(q => q.SparePartRequestNumber).HasMaxLength(SfsPropertyConst.CodeLength); |
||||
|
b.Property(q => q.ProdLine).HasMaxLength(SfsPropertyConst.CodeLength); |
||||
|
b.Property(q => q.JobType).HasConversion<string>(); |
||||
|
b.Property(q => q.JobStatus).HasConversion<string>(); |
||||
|
//Relations
|
||||
|
b.HasMany(q => q.Details).WithOne().HasForeignKey(d => d.MasterID).IsRequired(); |
||||
|
//Indexes
|
||||
|
b.HasIndex(q => new { q.Number }).IsUnique(); |
||||
|
}); |
||||
|
|
||||
|
builder.Entity<SparePartIssueJobDetail>(b => |
||||
|
{ |
||||
|
//Configure table & schema name
|
||||
|
b.ToTable(StoreDbProperties.JobDbTablePrefix + nameof(SparePartIssueJobDetail), options.Schema); |
||||
|
//Configure ABP properties
|
||||
|
b.ConfigureByConvention(); |
||||
|
//Configure Sfs base properties
|
||||
|
b.ConfigureSfsBase(); |
||||
|
//Configure Job base properties
|
||||
|
//b.ConfigureJobRecommendFromDetail();
|
||||
|
//Properties
|
||||
|
|
||||
|
b.Property(q => q.RequestLocationCode).HasMaxLength(SfsPropertyConst.CodeLength); |
||||
|
b.Property(q => q.ProdLine).HasMaxLength(SfsPropertyConst.CodeLength); |
||||
|
b.Property(q => q.OnTheWayLocationCode).HasMaxLength(SfsPropertyConst.CodeLength); |
||||
|
b.Property(q => q.PositionCode).HasMaxLength(SfsPropertyConst.CodeLength); |
||||
|
b.Property(q => q.OnTheWayLocationCode).HasMaxLength(SfsPropertyConst.CodeLength); |
||||
|
b.Property(q => q.PositionCode).HasMaxLength(SfsPropertyConst.CodeLength).IsRequired(false); |
||||
|
b.Property(q => q.RecommendType).HasMaxLength(SfsPropertyConst.CodeLength).HasConversion<string>(); |
||||
|
b.Property(q => q.Status).IsRequired().HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>(); |
||||
|
//Relations
|
||||
|
//None
|
||||
|
|
||||
|
//Indexes
|
||||
|
//b.HasIndex(q => new { q.PackingCode }).IsUnique();
|
||||
|
}); |
||||
|
} |
||||
|
} |
@ -0,0 +1,11 @@ |
|||||
|
using Volo.Abp.EntityFrameworkCore; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.EntityFrameworkCore; |
||||
|
|
||||
|
public class SparePartIssueJobEfCoreRepository : SfsJobEfCoreRepositoryBase<StoreDbContext, SparePartIssueJob>, ISparePartIssueJobRepository |
||||
|
{ |
||||
|
public SparePartIssueJobEfCoreRepository(IDbContextProvider<StoreDbContext> dbContextProvider) : base(dbContextProvider) |
||||
|
{ |
||||
|
} |
||||
|
} |
File diff suppressed because it is too large
@ -0,0 +1,474 @@ |
|||||
|
using System; |
||||
|
using Microsoft.EntityFrameworkCore.Migrations; |
||||
|
|
||||
|
#nullable disable |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Migrations |
||||
|
{ |
||||
|
public partial class Update_SparePartIssue : Migration |
||||
|
{ |
||||
|
protected override void Up(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "Job_SparePartIssueJob", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
IssueRequestType = table.Column<int>(type: "int", nullable: false), |
||||
|
ProdLine = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
||||
|
SparePartRequestNumber = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
||||
|
UseOnTheWayLocation = table.Column<bool>(type: "bit", nullable: false), |
||||
|
EnumIssueSendType = table.Column<int>(type: "int", 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), |
||||
|
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_SparePartIssueJob", x => x.Id); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "Store_SparePartIssueNote", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
JobNumber = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
||||
|
RequestNumber = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
||||
|
IssueRequestType = table.Column<int>(type: "int", 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), |
||||
|
EnumIssueSendType = table.Column<int>(type: "int", 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_SparePartIssueNote", x => x.Id); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "Store_SparePartIssueRequest", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
IssueRequestType = table.Column<int>(type: "int", nullable: false), |
||||
|
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_SparePartIssueRequest", x => x.Id); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "Job_SparePartIssueJobDetail", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
ItemCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
ItemName = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
ItemDesc1 = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
ItemDesc2 = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
StdPackQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false), |
||||
|
Status = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
||||
|
Uom = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RequestLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
||||
|
RequestLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RequestLocationGroup = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RequestLocationErpCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RequestWarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
OnTheWayLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
||||
|
ProdLine = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
||||
|
PositionCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
||||
|
RecommendType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
||||
|
RequestQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false), |
||||
|
RecommendFromContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendFromPackingCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendFromSupplierBatch = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendFromArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
RecommendFromProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
RecommendFromExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
RecommendFromLot = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendFromLocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendFromLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendFromLocationGroup = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendFromLocationErpCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendFromWarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendFromQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false), |
||||
|
RecommendToContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendToPackingCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendToSupplierBatch = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendToArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
RecommendToProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
RecommendToExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
RecommendToLot = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendToLocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendToLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendToLocationGroup = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendToLocationErpCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendToWarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendToQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false), |
||||
|
TransferLibFromContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibFromPackingCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibFromSupplierBatch = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibFromArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
TransferLibFromProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
TransferLibFromExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
TransferLibFromLot = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibFromLocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibFromLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibFromLocationGroup = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibFromLocationErpCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibFromWarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibFromQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false), |
||||
|
TransferLibToContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibToPackingCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibToSupplierBatch = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibToArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
TransferLibToProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
TransferLibToExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
TransferLibToLot = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibToLocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibToLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibToLocationGroup = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibToLocationErpCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibToWarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibToQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false), |
||||
|
HandledFromContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledFromPackingCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledFromSupplierBatch = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledFromArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
HandledFromProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
HandledFromExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
HandledFromLot = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledFromLocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledFromLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledFromLocationGroup = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledFromLocationErpCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledFromWarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledFromQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false), |
||||
|
HandledToContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledToPackingCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledToSupplierBatch = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledToArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
HandledToProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
HandledToExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
HandledToLot = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledToLocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledToLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledToLocationGroup = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledToLocationErpCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledToWarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledToQty = table.Column<decimal>(type: "decimal(18,6)", 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) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_Job_SparePartIssueJobDetail", x => x.Id); |
||||
|
table.ForeignKey( |
||||
|
name: "FK_Job_SparePartIssueJobDetail_Job_SparePartIssueJob_MasterID", |
||||
|
column: x => x.MasterID, |
||||
|
principalTable: "Job_SparePartIssueJob", |
||||
|
principalColumn: "Id", |
||||
|
onDelete: ReferentialAction.Cascade); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "Store_SparePartIssueNoteDetail", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
ItemCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
||||
|
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), |
||||
|
StdPackQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false), |
||||
|
Status = table.Column<int>(type: "int", nullable: false), |
||||
|
Uom = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RequestLocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RequestLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RequestLocationGroup = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RequestLocationErpCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RequestWarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
OnTheWayLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
||||
|
ProdLine = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
||||
|
PositionCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
||||
|
RecommendType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
||||
|
RequestQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false), |
||||
|
RecommendFromContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendFromPackingCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendFromSupplierBatch = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendFromArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
RecommendFromProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
RecommendFromExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
RecommendFromLot = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendFromLocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendFromLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendFromLocationGroup = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendFromLocationErpCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendFromWarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendFromQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false), |
||||
|
RecommendToContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendToPackingCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendToSupplierBatch = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendToArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
RecommendToProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
RecommendToExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
RecommendToLot = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendToLocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendToLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendToLocationGroup = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendToLocationErpCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendToWarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
RecommendToQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false), |
||||
|
TransferLibFromContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibFromPackingCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibFromSupplierBatch = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibFromArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
TransferLibFromProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
TransferLibFromExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
TransferLibFromLot = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibFromLocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibFromLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibFromLocationGroup = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibFromLocationErpCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibFromWarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibFromQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false), |
||||
|
TransferLibToContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibToPackingCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibToSupplierBatch = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibToArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
TransferLibToProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
TransferLibToExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
TransferLibToLot = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibToLocationCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibToLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibToLocationGroup = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibToLocationErpCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibToWarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
TransferLibToQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false), |
||||
|
HandledFromContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledFromPackingCode = table.Column<string>(type: "nvarchar(450)", nullable: true), |
||||
|
HandledFromSupplierBatch = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledFromArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
HandledFromProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
HandledFromExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
HandledFromLot = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledFromLocationCode = table.Column<string>(type: "nvarchar(450)", nullable: true), |
||||
|
HandledFromLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledFromLocationGroup = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledFromLocationErpCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledFromWarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledFromQty = table.Column<decimal>(type: "decimal(18,6)", nullable: false), |
||||
|
HandledToContainerCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledToPackingCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledToSupplierBatch = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledToArriveDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
HandledToProduceDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
HandledToExpireDate = table.Column<DateTime>(type: "datetime2", nullable: false), |
||||
|
HandledToLot = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledToLocationCode = table.Column<string>(type: "nvarchar(450)", nullable: true), |
||||
|
HandledToLocationArea = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledToLocationGroup = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledToLocationErpCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledToWarehouseCode = table.Column<string>(type: "nvarchar(max)", nullable: true), |
||||
|
HandledToQty = table.Column<decimal>(type: "decimal(18,6)", 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) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_Store_SparePartIssueNoteDetail", x => x.Id); |
||||
|
table.ForeignKey( |
||||
|
name: "FK_Store_SparePartIssueNoteDetail_Store_SparePartIssueNote_MasterID", |
||||
|
column: x => x.MasterID, |
||||
|
principalTable: "Store_SparePartIssueNote", |
||||
|
principalColumn: "Id", |
||||
|
onDelete: ReferentialAction.Cascade); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateTable( |
||||
|
name: "Store_SparePartIssueRequestDetail", |
||||
|
columns: table => new |
||||
|
{ |
||||
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false), |
||||
|
ToLocationCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
||||
|
ToLocationArea = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
||||
|
ToLocationGroup = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
||||
|
ToLocationErpCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
||||
|
ToWarehouseCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
||||
|
ProdLine = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
||||
|
IssuedQty = table.Column<decimal>(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false), |
||||
|
ReceivedQty = table.Column<decimal>(type: "decimal(18,6)", precision: 18, scale: 6, nullable: false), |
||||
|
Status = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
||||
|
PositionCode = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: true), |
||||
|
RecommendType = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false), |
||||
|
BoxQty = table.Column<decimal>(type: "decimal(18,6)", 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) |
||||
|
}, |
||||
|
constraints: table => |
||||
|
{ |
||||
|
table.PrimaryKey("PK_Store_SparePartIssueRequestDetail", x => x.Id); |
||||
|
table.ForeignKey( |
||||
|
name: "FK_Store_SparePartIssueRequestDetail_Store_SparePartIssueRequest_MasterID", |
||||
|
column: x => x.MasterID, |
||||
|
principalTable: "Store_SparePartIssueRequest", |
||||
|
principalColumn: "Id", |
||||
|
onDelete: ReferentialAction.Cascade); |
||||
|
}); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_Job_SparePartIssueJob_Number", |
||||
|
table: "Job_SparePartIssueJob", |
||||
|
column: "Number", |
||||
|
unique: true); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_Job_SparePartIssueJobDetail_MasterID", |
||||
|
table: "Job_SparePartIssueJobDetail", |
||||
|
column: "MasterID"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_Store_SparePartIssueNote_Number", |
||||
|
table: "Store_SparePartIssueNote", |
||||
|
column: "Number", |
||||
|
unique: true); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_Store_SparePartIssueNoteDetail_HandledFromPackingCode", |
||||
|
table: "Store_SparePartIssueNoteDetail", |
||||
|
column: "HandledFromPackingCode"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_Store_SparePartIssueNoteDetail_MasterID", |
||||
|
table: "Store_SparePartIssueNoteDetail", |
||||
|
column: "MasterID"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_Store_SparePartIssueNoteDetail_Number_HandledFromPackingCode_HandledFromLocationCode_HandledToLocationCode", |
||||
|
table: "Store_SparePartIssueNoteDetail", |
||||
|
columns: new[] { "Number", "HandledFromPackingCode", "HandledFromLocationCode", "HandledToLocationCode" }, |
||||
|
unique: true, |
||||
|
filter: "[HandledFromPackingCode] IS NOT NULL AND [HandledFromLocationCode] IS NOT NULL AND [HandledToLocationCode] IS NOT NULL"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_Store_SparePartIssueRequest_Number", |
||||
|
table: "Store_SparePartIssueRequest", |
||||
|
column: "Number", |
||||
|
unique: true); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_Store_SparePartIssueRequestDetail_ItemCode", |
||||
|
table: "Store_SparePartIssueRequestDetail", |
||||
|
column: "ItemCode"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_Store_SparePartIssueRequestDetail_MasterID", |
||||
|
table: "Store_SparePartIssueRequestDetail", |
||||
|
column: "MasterID"); |
||||
|
|
||||
|
migrationBuilder.CreateIndex( |
||||
|
name: "IX_Store_SparePartIssueRequestDetail_Number_ItemCode_ToLocationCode", |
||||
|
table: "Store_SparePartIssueRequestDetail", |
||||
|
columns: new[] { "Number", "ItemCode", "ToLocationCode" }, |
||||
|
unique: true); |
||||
|
} |
||||
|
|
||||
|
protected override void Down(MigrationBuilder migrationBuilder) |
||||
|
{ |
||||
|
migrationBuilder.DropTable( |
||||
|
name: "Job_SparePartIssueJobDetail"); |
||||
|
|
||||
|
migrationBuilder.DropTable( |
||||
|
name: "Store_SparePartIssueNoteDetail"); |
||||
|
|
||||
|
migrationBuilder.DropTable( |
||||
|
name: "Store_SparePartIssueRequestDetail"); |
||||
|
|
||||
|
migrationBuilder.DropTable( |
||||
|
name: "Job_SparePartIssueJob"); |
||||
|
|
||||
|
migrationBuilder.DropTable( |
||||
|
name: "Store_SparePartIssueNote"); |
||||
|
|
||||
|
migrationBuilder.DropTable( |
||||
|
name: "Store_SparePartIssueRequest"); |
||||
|
} |
||||
|
} |
||||
|
} |
File diff suppressed because it is too large
@ -0,0 +1,56 @@ |
|||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Volo.Abp.EntityFrameworkCore.Modeling; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.EntityFrameworkCore; |
||||
|
|
||||
|
public static class SparePartIssueNoteDbContextModelCreatingExtensions |
||||
|
{ |
||||
|
public static void ConfigureSparePartIssueNote(this ModelBuilder builder, StoreModelBuilderConfigurationOptions options) |
||||
|
{ |
||||
|
builder.Entity<SparePartIssueNote>(b => |
||||
|
{ |
||||
|
//Configure table & schema name
|
||||
|
b.ToTable(options.TablePrefix + nameof(SparePartIssueNote), options.Schema); |
||||
|
//Configure ABP properties
|
||||
|
b.ConfigureByConvention(); |
||||
|
//Configure Sfs base properties
|
||||
|
b.ConfigureSfsStoreBase(); |
||||
|
|
||||
|
//Properties
|
||||
|
b.Property(q => q.RequestNumber).HasMaxLength(SfsPropertyConst.CodeLength); |
||||
|
b.Property(q => q.Remark).HasMaxLength(SfsPropertyConst.RemarkLength); |
||||
|
|
||||
|
//Relations
|
||||
|
b.HasMany(q => q.Details).WithOne().HasForeignKey(d => d.MasterID).IsRequired(); |
||||
|
|
||||
|
//Indexes
|
||||
|
b.HasIndex(q => new { q.Number }).IsUnique(); |
||||
|
}); |
||||
|
|
||||
|
builder.Entity<SparePartIssueNoteDetail>(b => |
||||
|
{ |
||||
|
//Configure table & schema name
|
||||
|
b.ToTable(options.TablePrefix + nameof(SparePartIssueNoteDetail), options.Schema); |
||||
|
//Configure ABP properties
|
||||
|
b.ConfigureByConvention(); |
||||
|
//Configure Sfs base properties
|
||||
|
b.ConfigureSfsStoreBase(); |
||||
|
//Configure Sfs store detail properties
|
||||
|
b.ConfigureSfsStoreDetailBase(); |
||||
|
|
||||
|
//Properties
|
||||
|
b.Property(q => q.ProdLine).HasMaxLength(SfsPropertyConst.NameLength); |
||||
|
b.Property(q => q.OnTheWayLocationCode).HasMaxLength(SfsPropertyConst.CodeLength); |
||||
|
b.Property(q => q.PositionCode).HasMaxLength(SfsPropertyConst.CodeLength); |
||||
|
b.Property(q => q.RecommendType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>(); |
||||
|
|
||||
|
//Relations
|
||||
|
|
||||
|
//Indexes
|
||||
|
b.HasIndex(q => new { q.Number, q.HandledFromPackingCode, q.HandledFromLocationCode, q.HandledToLocationCode }).IsUnique(); |
||||
|
b.HasIndex(q => new { q.HandledFromPackingCode }); |
||||
|
}); |
||||
|
} |
||||
|
} |
@ -0,0 +1,11 @@ |
|||||
|
using Volo.Abp.EntityFrameworkCore; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.EntityFrameworkCore; |
||||
|
|
||||
|
public class SparePartIssueNoteEfCoreRepository : SfsStoreEfCoreRepositoryBase<StoreDbContext, SparePartIssueNote>, ISparePartIssueNoteRepository |
||||
|
{ |
||||
|
public SparePartIssueNoteEfCoreRepository(IDbContextProvider<StoreDbContext> dbContextProvider) : base(dbContextProvider) |
||||
|
{ |
||||
|
} |
||||
|
} |
@ -0,0 +1,61 @@ |
|||||
|
using Microsoft.EntityFrameworkCore; |
||||
|
using Volo.Abp.EntityFrameworkCore.Modeling; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.EntityFrameworkCore; |
||||
|
|
||||
|
public static class SparePartIssueRequestDbContextModelCreatingExtensions |
||||
|
{ |
||||
|
public static void ConfigureSparePartIssueRequest(this ModelBuilder builder, StoreModelBuilderConfigurationOptions options) |
||||
|
{ |
||||
|
builder.Entity<SparePartIssueRequest>(b => |
||||
|
{ |
||||
|
//Configure table & schema name
|
||||
|
b.ToTable(options.TablePrefix + nameof(SparePartIssueRequest), options.Schema); |
||||
|
//Configure ABP properties
|
||||
|
b.ConfigureByConvention(); |
||||
|
//Configure Sfs base properties
|
||||
|
b.ConfigureSfsStoreBase(); |
||||
|
|
||||
|
//Properties
|
||||
|
b.Property(q => q.RequestStatus).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>(); |
||||
|
|
||||
|
//Relations
|
||||
|
b.HasMany(q => q.Details).WithOne().HasForeignKey(d => d.MasterID).IsRequired(); |
||||
|
|
||||
|
//Indexes
|
||||
|
b.HasIndex(q => new { q.Number }).IsUnique(); |
||||
|
}); |
||||
|
|
||||
|
builder.Entity<SparePartIssueRequestDetail>(b => |
||||
|
{ |
||||
|
//Configure table & schema name
|
||||
|
b.ToTable(options.TablePrefix + nameof(SparePartIssueRequestDetail), options.Schema); |
||||
|
//Configure ABP properties
|
||||
|
b.ConfigureByConvention(); |
||||
|
//Configure Sfs base properties
|
||||
|
b.ConfigureSfsStoreBase(); |
||||
|
//Configure Sfs store detail properties
|
||||
|
b.ConfigureSfsStoreDetailBase(); |
||||
|
//Properties
|
||||
|
b.Property(q => q.ToLocationCode).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength); |
||||
|
b.Property(q => q.ToLocationErpCode).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength); |
||||
|
b.Property(q => q.ToWarehouseCode).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength); |
||||
|
b.Property(q => q.ToLocationArea).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength); |
||||
|
b.Property(q => q.ToLocationGroup).IsRequired().HasMaxLength(SfsPropertyConst.CodeLength); |
||||
|
b.Property(q => q.ProdLine).HasMaxLength(SfsPropertyConst.CodeLength); |
||||
|
b.Property(q => q.IssuedQty).HasPrecision(18, 6); |
||||
|
b.Property(q => q.ReceivedQty).HasPrecision(18, 6); |
||||
|
b.Property(q => q.Status).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>(); |
||||
|
b.Property(q => q.PositionCode).HasMaxLength(SfsPropertyConst.CodeLength); |
||||
|
b.Property(q => q.RecommendType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>(); |
||||
|
|
||||
|
//Relations
|
||||
|
|
||||
|
//Indexes
|
||||
|
b.HasIndex(q => new { q.Number, q.ItemCode, q.ToLocationCode }).IsUnique(); |
||||
|
b.HasIndex(q => new { q.ItemCode }); |
||||
|
}); |
||||
|
} |
||||
|
} |
@ -0,0 +1,11 @@ |
|||||
|
using Volo.Abp.EntityFrameworkCore; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.EntityFrameworkCore; |
||||
|
|
||||
|
public class SparePartIssueRequestEfCoreRepository : SfsStoreEfCoreRepositoryBase<StoreDbContext, SparePartIssueRequest>, ISparePartIssueRequestRepository |
||||
|
{ |
||||
|
public SparePartIssueRequestEfCoreRepository(IDbContextProvider<StoreDbContext> dbContextProvider) : base(dbContextProvider) |
||||
|
{ |
||||
|
} |
||||
|
} |
@ -0,0 +1,46 @@ |
|||||
|
using System; |
||||
|
using AutoMapper; |
||||
|
using Volo.Abp.AutoMapper; |
||||
|
using Win_in.Sfs.Shared.Application; |
||||
|
using Win_in.Sfs.Wms.Inventory.Application.Contracts; |
||||
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Event; |
||||
|
|
||||
|
public partial class StoreEventAutoMapperProfile : Profile |
||||
|
{ |
||||
|
private void SparePartIssueJobAutoMapperProfile() |
||||
|
{ |
||||
|
|
||||
|
CreateMap<SparePartIssueJob, SparePartIssueNote>() |
||||
|
.ForMember(x => x.JobNumber, y => y.MapFrom(d => d.Number)) |
||||
|
.ForMember(x => x.RequestNumber, y => y.MapFrom(d => d.SparePartRequestNumber)) |
||||
|
.ForMember(x => x.ActiveDate, y => y.MapFrom(d => DateTime.Now)) |
||||
|
.ForMember(x => x.Worker, y => y.MapFrom(d => d.CompleteUserName)) |
||||
|
.Ignore(x => x.Confirmed) |
||||
|
.Ignore(x => x.Number) |
||||
|
.Ignore(x => x.ConfirmTime); |
||||
|
|
||||
|
CreateMap<SparePartIssueJobDetail, SparePartIssueNoteDetail>() |
||||
|
; |
||||
|
|
||||
|
CreateMap<SparePartIssueJob, SparePartIssueNoteEditInput>() |
||||
|
.ForMember(x => x.RequestNumber, y => y.MapFrom(d => d.SparePartRequestNumber)) |
||||
|
.Ignore(x => x.Confirmed) |
||||
|
.Ignore(x => x.JobNumber) |
||||
|
.Ignore(x => x.ActiveDate) |
||||
|
; |
||||
|
CreateMap<SparePartIssueJobDetail, SparePartIssueNoteDetailInput>() |
||||
|
; |
||||
|
|
||||
|
CreateMap<SparePartIssueJobDTO, SparePartIssueNoteEditInput>() |
||||
|
.ForMember(x => x.RequestNumber, y => y.MapFrom(d => d.SparePartRequestNumber)) |
||||
|
.Ignore(x => x.Confirmed) |
||||
|
.Ignore(x => x.JobNumber) |
||||
|
.Ignore(x => x.ActiveDate) |
||||
|
; |
||||
|
CreateMap<SparePartIssueJobDetailDTO, SparePartIssueNoteDetailInput>() |
||||
|
; |
||||
|
} |
||||
|
} |
@ -0,0 +1,51 @@ |
|||||
|
using AutoMapper; |
||||
|
using Volo.Abp.AutoMapper; |
||||
|
using Win_in.Sfs.Wms.Inventory.Application.Contracts; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Event; |
||||
|
|
||||
|
public partial class StoreEventAutoMapperProfile : Profile |
||||
|
{ |
||||
|
private void SparePartIssueNoteAutoMapperProfile() |
||||
|
{ |
||||
|
CreateMap<SparePartIssueNoteDetail, TransferLogEditInput>() |
||||
|
.Ignore(x => x.DocNumber) |
||||
|
.Ignore(x => x.JobNumber) |
||||
|
.Ignore(x => x.Worker) |
||||
|
.Ignore(x => x.TransType) |
||||
|
.Ignore(x => x.ExtraProperties) |
||||
|
.Ignore(x => x.TransSubType) |
||||
|
|
||||
|
.ForMember(x => x.Qty, y => y.MapFrom(t => t.HandledToQty)) |
||||
|
.ForMember(x => x.SupplierBatch, y => y.MapFrom(t => t.HandledFromSupplierBatch)) |
||||
|
.ForMember(x => x.ArriveDate, y => y.MapFrom(t => t.HandledFromArriveDate)) |
||||
|
.ForMember(x => x.ProduceDate, y => y.MapFrom(t => t.HandledFromProduceDate)) |
||||
|
.ForMember(x => x.ExpireDate, y => y.MapFrom(t => t.HandledFromExpireDate)) |
||||
|
|
||||
|
.ForMember(x => x.FromPackingCode, y => y.MapFrom(t => t.HandledFromPackingCode)) |
||||
|
.ForMember(x => x.FromContainerCode, y => y.MapFrom(t => t.HandledFromContainerCode)) |
||||
|
|
||||
|
.ForMember(x => x.FromLot, y => y.MapFrom(t => t.HandledFromLot)) |
||||
|
.ForMember(x => x.FromStatus, y => y.MapFrom(t => t.Status)) |
||||
|
|
||||
|
.ForMember(x => x.FromLocationCode, y => y.MapFrom(t => t.HandledFromLocationCode)) |
||||
|
.ForMember(x => x.FromLocationGroup, y => y.MapFrom(t => t.HandledFromLocationGroup)) |
||||
|
.ForMember(x => x.FromLocationArea, y => y.MapFrom(t => t.HandledFromLocationArea)) |
||||
|
.ForMember(x => x.FromLocationErpCode, y => y.MapFrom(t => t.HandledFromLocationErpCode)) |
||||
|
.ForMember(x => x.FromWarehouseCode, y => y.MapFrom(t => t.HandledFromWarehouseCode)) |
||||
|
|
||||
|
.ForMember(x => x.ToLot, y => y.MapFrom(t => t.HandledToLot)) |
||||
|
.ForMember(x => x.ToStatus, y => y.MapFrom(t => t.Status)) |
||||
|
.ForMember(x => x.ToPackingCode, y => y.MapFrom(t => t.HandledToPackingCode)) |
||||
|
.ForMember(x => x.ToContainerCode, y => y.MapFrom(t => t.HandledToContainerCode)) |
||||
|
|
||||
|
.ForMember(x => x.ToLocationCode, y => y.MapFrom(t => t.HandledToLocationCode)) |
||||
|
.ForMember(x => x.ToLocationGroup, y => y.MapFrom(t => t.HandledToLocationGroup)) |
||||
|
.ForMember(x => x.ToLocationArea, y => y.MapFrom(t => t.HandledToLocationArea)) |
||||
|
.ForMember(x => x.ToLocationErpCode, y => y.MapFrom(t => t.HandledToLocationErpCode)) |
||||
|
.ForMember(x => x.ToWarehouseCode, y => y.MapFrom(t => t.HandledToWarehouseCode)) |
||||
|
|
||||
|
; |
||||
|
} |
||||
|
} |
@ -0,0 +1,36 @@ |
|||||
|
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 SparePartIssueRequestAutoMapperProfile() |
||||
|
{ |
||||
|
CreateMap<SparePartIssueRequest, SparePartIssueJobEditInput>() |
||||
|
.ForMember(x => x.SparePartRequestNumber, y => y.MapFrom(d => d.Number)) |
||||
|
.Ignore(x => x.WarehouseCode) |
||||
|
.Ignore(x => x.UpStreamJobNumber) |
||||
|
.Ignore(x => x.JobType) |
||||
|
.Ignore(x => x.IsAutoComplete) |
||||
|
.Ignore(x => x.ExpiredTime) |
||||
|
.Ignore(x => x.JobDescription) |
||||
|
.Ignore(x => x.JobStatus) |
||||
|
.Ignore(x => x.WorkGroupCode) |
||||
|
.Ignore(x => x.Priority) |
||||
|
.Ignore(x => x.PriorityIncrement) |
||||
|
.Ignore(x => x.AcceptUserId) |
||||
|
.Ignore(x => x.AcceptTime) |
||||
|
.Ignore(x => x.AcceptUserName) |
||||
|
.Ignore(x => x.CompleteUserId) |
||||
|
.Ignore(x => x.CompleteUserName) |
||||
|
.Ignore(x => x.CompleteTime) |
||||
|
.Ignore(x => x.Details) |
||||
|
.Ignore(x => x.EnumIssueSendType) |
||||
|
; |
||||
|
} |
||||
|
} |
@ -0,0 +1,235 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
using Castle.Components.DictionaryAdapter; |
||||
|
using Volo.Abp; |
||||
|
using Volo.Abp.EventBus; |
||||
|
using Volo.Abp.Uow; |
||||
|
using Win_in.Sfs.Basedata.Application.Contracts; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
using Win_in.Sfs.Shared.Event; |
||||
|
using Win_in.Sfs.Wms.Inventory.Application.Contracts; |
||||
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Event.BusinessJob; |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 备件
|
||||
|
/// </summary>
|
||||
|
public class SparePartIssueJobEventHandler : |
||||
|
StoreEventHandlerBase |
||||
|
, ILocalEventHandler<SfsCompletedEntityEventData<SparePartIssueJob>> |
||||
|
, ILocalEventHandler<SfsCreatedEntityEventData<SparePartIssueJob>> |
||||
|
, ILocalEventHandler<SfsCreatedEntityEventData<List<SparePartIssueJob>>> |
||||
|
{ |
||||
|
private readonly IExpectOutAppService _expectOutAppService; |
||||
|
private readonly ILocationAppService _locationAppService; |
||||
|
private readonly ITransferLibRequestAppService _transferLibRequestAppService; |
||||
|
|
||||
|
public SparePartIssueJobEventHandler(IExpectOutAppService expectOutAppService, |
||||
|
ILocationAppService locationAppService, ITransferLibRequestAppService transferLibRequestAppService) |
||||
|
{ |
||||
|
_expectOutAppService = expectOutAppService; |
||||
|
_locationAppService = locationAppService; |
||||
|
_transferLibRequestAppService = transferLibRequestAppService; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 执行后
|
||||
|
/// </summary>
|
||||
|
/// <param name="eventData"></param>
|
||||
|
/// <returns></returns>
|
||||
|
[UnitOfWork] |
||||
|
public virtual async Task HandleEventAsync(SfsCompletedEntityEventData<SparePartIssueJob> eventData) |
||||
|
{ |
||||
|
await Task.CompletedTask.ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 创建后
|
||||
|
/// </summary>
|
||||
|
/// <param name="eventData"></param>
|
||||
|
/// <returns></returns>
|
||||
|
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<SparePartIssueJob> eventData) |
||||
|
{ |
||||
|
var entity = eventData.Entity; |
||||
|
|
||||
|
await CreateExpectOutAsync(entity).ConfigureAwait(false); |
||||
|
|
||||
|
await CreateTransferLibAsync(entity).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 批量创建后
|
||||
|
/// </summary>
|
||||
|
/// <param name="eventData"></param>
|
||||
|
/// <returns></returns>
|
||||
|
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<List<SparePartIssueJob>> eventData) |
||||
|
{ |
||||
|
var entitys = eventData.Entity; |
||||
|
|
||||
|
foreach (var entity in entitys) |
||||
|
{ |
||||
|
await CreateExpectOutAsync(entity).ConfigureAwait(false); |
||||
|
|
||||
|
await CreateTransferLibAsync(entity).ConfigureAwait(false); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
#region 私有
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 创建预计出
|
||||
|
/// </summary>
|
||||
|
/// <param name="entity"></param>
|
||||
|
/// <returns></returns>
|
||||
|
private async Task CreateExpectOutAsync(SparePartIssueJob entity) |
||||
|
{ |
||||
|
var expectOutEditInputs = new List<ExpectOutEditInput>(); |
||||
|
foreach (var detail in entity.Details) |
||||
|
{ |
||||
|
var inputoExpectOutEditInput = new ExpectOutEditInput(); |
||||
|
inputoExpectOutEditInput.JobNumber = entity.Number; |
||||
|
inputoExpectOutEditInput.ItemCode = detail.ItemCode; |
||||
|
inputoExpectOutEditInput.Qty = detail.RecommendFromQty; |
||||
|
inputoExpectOutEditInput.LocationCode = detail.RecommendFromLocationCode; |
||||
|
inputoExpectOutEditInput.ArriveDate = detail.RecommendFromArriveDate; |
||||
|
inputoExpectOutEditInput.ContainerCode = detail.RecommendFromContainerCode; |
||||
|
inputoExpectOutEditInput.ExpireDate = detail.RecommendFromExpireDate; |
||||
|
inputoExpectOutEditInput.ItemDesc1 = detail.ItemDesc1; |
||||
|
inputoExpectOutEditInput.ItemDesc2 = detail.ItemDesc2; |
||||
|
inputoExpectOutEditInput.ItemName = detail.ItemName; |
||||
|
inputoExpectOutEditInput.LocationArea = detail.RecommendFromLocationArea; |
||||
|
inputoExpectOutEditInput.LocationGroup = detail.RecommendFromLocationGroup; |
||||
|
inputoExpectOutEditInput.LocationErpCode = detail.RecommendFromLocationErpCode; |
||||
|
inputoExpectOutEditInput.PackingCode = detail.RecommendFromPackingCode; |
||||
|
inputoExpectOutEditInput.Lot = detail.RecommendFromLot; |
||||
|
inputoExpectOutEditInput.ProduceDate = detail.RecommendFromProduceDate; |
||||
|
inputoExpectOutEditInput.Status = detail.Status; |
||||
|
inputoExpectOutEditInput.Uom = detail.Uom; |
||||
|
inputoExpectOutEditInput.SupplierBatch = detail.RecommendFromSupplierBatch; |
||||
|
inputoExpectOutEditInput.WarehouseCode = detail.RecommendFromWarehouseCode; |
||||
|
|
||||
|
expectOutEditInputs.Add(inputoExpectOutEditInput); |
||||
|
} |
||||
|
|
||||
|
await _expectOutAppService.AddManyAsync(expectOutEditInputs).ConfigureAwait(false); |
||||
|
|
||||
|
await Task.CompletedTask.ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 根据是否在 第一层 来创建 是否生成库移任务
|
||||
|
/// </summary>
|
||||
|
/// <returns></returns>
|
||||
|
private async Task CreateTransferLibAsync(SparePartIssueJob sparePartIssueJob) |
||||
|
{ |
||||
|
foreach (var detail in sparePartIssueJob.Details) |
||||
|
{ |
||||
|
var locationDto = await _locationAppService.GetByCodeAsync(detail.RecommendFromLocationCode) |
||||
|
.ConfigureAwait(false); |
||||
|
var locationList = await _locationAppService.GetListByGroupsAsync( |
||||
|
new List<string> { detail.RecommendFromLocationGroup }).ConfigureAwait(false); |
||||
|
var locationListSort = locationList.OrderBy(p => p.RowCode); |
||||
|
|
||||
|
var locationDtoRowOne = new LocationDTO(); |
||||
|
if (locationListSort.Any()) |
||||
|
{ |
||||
|
locationDtoRowOne = locationListSort.FirstOrDefault(); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
locationDtoRowOne = await _locationAppService.GetFirstRowOneAsync().ConfigureAwait(false); |
||||
|
if (locationDtoRowOne == null) |
||||
|
{ |
||||
|
throw new UserFriendlyException("没有找到1层的库位"); |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
|
||||
|
if (locationDto.Type == EnumLocationType.RAW) |
||||
|
{ |
||||
|
if (!await IsMinRowAsync(sparePartIssueJob).ConfigureAwait(false)) |
||||
|
{ |
||||
|
var input = new TransferLibRequestEditInput(); |
||||
|
input.CallBusinessType = nameof(ISparePartIssueJobAppService); |
||||
|
input.CallJobNumber = sparePartIssueJob.Number; |
||||
|
input.CallRequestNumber = sparePartIssueJob.SparePartRequestNumber; |
||||
|
input.CallServerName = "Win_in.Sfs.Wms.Store.Application.SparePartIssueJobAppService"; |
||||
|
input.Type = "Transfer_Warehouse"; |
||||
|
input.UseOnTheWayLocation = true; |
||||
|
|
||||
|
var detailInput = new TransferLibRequestDetailInput(); |
||||
|
detailInput.CallBusinessType = nameof(ISparePartIssueJobAppService); |
||||
|
detailInput.CallRequestNumber = sparePartIssueJob.SparePartRequestNumber; |
||||
|
detailInput.CallServerName = "Win_in.Sfs.Wms.Store.Application.SparePartIssueJobAppService"; |
||||
|
detailInput.CallJobNumber = sparePartIssueJob.Number; |
||||
|
|
||||
|
detailInput.JobStatus = EnumJobStatus.Open; |
||||
|
detailInput.ItemCode = detail.ItemCode; |
||||
|
detailInput.StdPackQty = detail.StdPackQty; |
||||
|
detailInput.Uom = detail.Uom; |
||||
|
detailInput.Status = detail.Status; |
||||
|
|
||||
|
detailInput.RecommendFromQty = detail.RecommendFromQty; |
||||
|
detailInput.RecommendFromLot = detail.RecommendFromLot; |
||||
|
detailInput.RecommendFromPackingCode = detail.RecommendFromPackingCode; |
||||
|
detailInput.RecommendToLot = detail.RecommendToLot; |
||||
|
|
||||
|
detailInput.RecommendFromArriveDate = detail.RecommendFromArriveDate; |
||||
|
detailInput.RecommendFromExpireDate = detail.RecommendFromExpireDate; |
||||
|
detailInput.RecommendFromProduceDate = detail.RecommendFromProduceDate; |
||||
|
detailInput.RecommendFromSupplierBatch = detail.RecommendFromSupplierBatch; |
||||
|
|
||||
|
detailInput.RecommendFromLocationCode = detail.RecommendFromLocationCode; |
||||
|
detailInput.RecommendFromLocationGroup = detail.RecommendFromLocationGroup; |
||||
|
detailInput.RecommendFromLocationArea = detail.RecommendFromLocationArea; |
||||
|
detailInput.RecommendFromLocationErpCode = detail.RecommendFromLocationErpCode; |
||||
|
detailInput.RecommendFromWarehouseCode = detail.RecommendFromWarehouseCode; |
||||
|
|
||||
|
detailInput.RecommendToQty = detail.RecommendToQty; |
||||
|
detailInput.RecommendToLot = detail.RecommendToLot; |
||||
|
detailInput.RecommendToPackingCode = detail.RecommendToPackingCode; |
||||
|
detailInput.RecommendToLot = detail.RecommendToLot; |
||||
|
|
||||
|
detailInput.RecommendToArriveDate = detail.RecommendToArriveDate; |
||||
|
detailInput.RecommendToExpireDate = detail.RecommendToExpireDate; |
||||
|
detailInput.RecommendToProduceDate = detail.RecommendToProduceDate; |
||||
|
detailInput.RecommendToSupplierBatch = detail.RecommendToSupplierBatch; |
||||
|
|
||||
|
detailInput.RecommendToLocationCode = locationDtoRowOne.Code; |
||||
|
detailInput.RecommendToLocationGroup = locationDtoRowOne.LocationGroupCode; |
||||
|
detailInput.RecommendToLocationArea = locationDtoRowOne.AreaCode; |
||||
|
detailInput.RecommendToLocationErpCode = locationDtoRowOne.ErpLocationCode; |
||||
|
detailInput.RecommendToWarehouseCode = locationDtoRowOne.WarehouseCode; |
||||
|
|
||||
|
input.Details = new EditableList<TransferLibRequestDetailInput> { detailInput }; |
||||
|
|
||||
|
await _transferLibRequestAppService.CreateAsync(input).ConfigureAwait(false); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 判断是不是在最底层 如果不是则把状态变更为等待
|
||||
|
/// </summary>
|
||||
|
/// <param name="sparePartIssueJob"></param>
|
||||
|
/// <returns></returns>
|
||||
|
private async Task<bool> IsMinRowAsync(SparePartIssueJob sparePartIssueJob) |
||||
|
{ |
||||
|
var detail = sparePartIssueJob.Details.FirstOrDefault(); |
||||
|
|
||||
|
var locationDto = await _locationAppService.GetByCodeAsync(detail.RecommendFromLocationCode) |
||||
|
.ConfigureAwait(false); |
||||
|
if (locationDto.Type == EnumLocationType.RAW && locationDto.RowCode == 1) |
||||
|
{ |
||||
|
return true; |
||||
|
} |
||||
|
|
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
#endregion
|
||||
|
} |
@ -0,0 +1,688 @@ |
|||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Text.Json; |
||||
|
using System.Threading.Tasks; |
||||
|
using AutoMapper; |
||||
|
using Castle.Components.DictionaryAdapter; |
||||
|
using Volo.Abp; |
||||
|
using Volo.Abp.AutoMapper; |
||||
|
using Volo.Abp.EventBus; |
||||
|
using Win_in.Sfs.Basedata.Application.Contracts; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared.Enums.Store; |
||||
|
using Win_in.Sfs.Shared.Event; |
||||
|
using Win_in.Sfs.Wms.Inventory.Application.Contracts; |
||||
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Event.BusinessRequest; |
||||
|
|
||||
|
public class SparePartIssueRequestEventHandler |
||||
|
: StoreEventHandlerBase |
||||
|
, ILocalEventHandler<SfsHandledEntityEventData<SparePartIssueRequest>> |
||||
|
, ILocalEventHandler<SfsAbortedEntityEventData<SparePartIssueRequest>> |
||||
|
, ILocalEventHandler<SfsCompletedEntityEventData<SparePartIssueRequest>> |
||||
|
, ILocalEventHandler<SfsCreatedEntityEventData<SparePartIssueRequest>> |
||||
|
, ILocalEventHandler<SfsCreatedEntityEventData<List<SparePartIssueRequest>>> |
||||
|
{ |
||||
|
private readonly ISparePartIssueJobAppService _sparePartIssueJobAppService; |
||||
|
private readonly IProductionLineAppService _productionLineAppService; |
||||
|
private readonly IProductionLineItemAppService _productionLineItemAppService; |
||||
|
private readonly ILocationAppService _locationAppService; |
||||
|
private readonly IBalanceAppService _balanceAppService; |
||||
|
private IMapper _mapper; |
||||
|
|
||||
|
public SparePartIssueRequestEventHandler( |
||||
|
ISparePartIssueJobAppService sparePartIssueJobAppService, IProductionLineAppService productionLineAppService, |
||||
|
ILocationAppService locationAppService, |
||||
|
IBalanceAppService balanceAppService, IProductionLineItemAppService productionLineItemAppService |
||||
|
) |
||||
|
{ |
||||
|
_sparePartIssueJobAppService = sparePartIssueJobAppService; |
||||
|
_productionLineAppService = productionLineAppService; |
||||
|
_locationAppService = locationAppService; |
||||
|
_balanceAppService = balanceAppService; |
||||
|
_productionLineItemAppService = productionLineItemAppService; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 创建后
|
||||
|
/// </summary>
|
||||
|
/// <param name="eventData">Event data</param>
|
||||
|
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<SparePartIssueRequest> eventData) |
||||
|
{ |
||||
|
var entity = eventData.Entity; |
||||
|
|
||||
|
await CreateAllSparePartIssueJobAsync(entity).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 批量创建后
|
||||
|
/// </summary>
|
||||
|
/// <param name="eventData">Event data</param>
|
||||
|
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<List<SparePartIssueRequest>> eventData) |
||||
|
{ |
||||
|
await Task.CompletedTask.ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 执行后
|
||||
|
/// </summary>
|
||||
|
/// <param name="eventData"></param>
|
||||
|
/// <returns></returns>
|
||||
|
public virtual async Task HandleEventAsync(SfsHandledEntityEventData<SparePartIssueRequest> eventData) |
||||
|
{ |
||||
|
var entity = eventData.Entity; |
||||
|
|
||||
|
await CreateAllSparePartIssueJobAsync(entity).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 驳回后
|
||||
|
/// </summary>
|
||||
|
/// <param name="eventData"></param>
|
||||
|
/// <returns></returns>
|
||||
|
public virtual async Task HandleEventAsync(SfsAbortedEntityEventData<SparePartIssueRequest> eventData) |
||||
|
{ |
||||
|
await Task.CompletedTask.ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 完成后
|
||||
|
/// </summary>
|
||||
|
/// <param name="eventData"></param>
|
||||
|
/// <returns></returns>
|
||||
|
public virtual async Task HandleEventAsync(SfsCompletedEntityEventData<SparePartIssueRequest> eventData) |
||||
|
{ |
||||
|
_ = eventData.Entity; |
||||
|
// await _sparePartIssueJobAppService.CompleteBySparePartIssueRequestAsync(entity.Number);
|
||||
|
|
||||
|
await Task.CompletedTask.ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
#region 私有
|
||||
|
|
||||
|
#region 按数量叫料
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 创建注塑任务-按数量
|
||||
|
/// </summary>
|
||||
|
/// <param name="sparePartIssueRequest"></param>
|
||||
|
/// <param name="sparePartIssueRequestDetails"></param>
|
||||
|
/// <param name="recommendbalanceDtos"></param>
|
||||
|
/// <param name="useBalanceList"></param>
|
||||
|
/// <returns></returns>
|
||||
|
/// <exception cref="UserFriendlyException"></exception>
|
||||
|
private async Task<List<SparePartIssueJobEditInput>> CreateSparePartIssueJobWithQtyTypeAsync |
||||
|
(SparePartIssueRequest sparePartIssueRequest, List<SparePartIssueRequestDetail> sparePartIssueRequestDetails, |
||||
|
List<BalanceDTO> recommendbalanceDtos, |
||||
|
List<BalanceDTO> useBalanceList) |
||||
|
{ |
||||
|
var jobs = new List<SparePartIssueJobEditInput>(); |
||||
|
//用来临时存放所有未生成任务的发料集合 如果生成完了再这里去掉
|
||||
|
var tempDetailDtos = |
||||
|
ObjectMapper.Map<List<SparePartIssueRequestDetail>, List<SparePartIssueRequestDetailDTO>>( |
||||
|
sparePartIssueRequestDetails); |
||||
|
|
||||
|
var sparePartIssueJobDetailInputs = new List<SparePartIssueJobDetailInput>(); |
||||
|
|
||||
|
if (recommendbalanceDtos != null && recommendbalanceDtos.Count > 0) |
||||
|
{ |
||||
|
var queue = new Queue<BalanceDTO>(recommendbalanceDtos); |
||||
|
while (queue.TryDequeue(out var balanceDto)) |
||||
|
{ |
||||
|
var next = false; |
||||
|
|
||||
|
var temp = tempDetailDtos.ToList(); |
||||
|
|
||||
|
foreach (var tempDetailDto in tempDetailDtos) |
||||
|
{ |
||||
|
//未发送的数量
|
||||
|
tempDetailDto.Qty = tempDetailDto.Qty - tempDetailDto.IssuedQty; |
||||
|
|
||||
|
if (tempDetailDto.Qty > balanceDto.Qty) //需求量大于 这条推荐库存的余额
|
||||
|
{ |
||||
|
tempDetailDto.Qty -= balanceDto.Qty; |
||||
|
} |
||||
|
else if (tempDetailDto.Qty <= balanceDto.Qty) |
||||
|
{ |
||||
|
temp.Remove(tempDetailDto); |
||||
|
balanceDto.Qty = tempDetailDto.Qty; |
||||
|
} |
||||
|
|
||||
|
sparePartIssueJobDetailInputs.Add( |
||||
|
await BuildSparePartIssueJobDetailWithQtyTypeAsync(tempDetailDto, balanceDto) |
||||
|
.ConfigureAwait(false)); |
||||
|
useBalanceList.Add(balanceDto); |
||||
|
|
||||
|
if (balanceDto.Qty <= 0) |
||||
|
{ |
||||
|
next = true; |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
tempDetailDtos = temp; |
||||
|
|
||||
|
if (next) |
||||
|
{ |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
if (sparePartIssueJobDetailInputs.Any()) |
||||
|
{ |
||||
|
var sparePartIssueJobEditInput = await BuildSparePartIssueJobCreateInputWithQtyTypeAsync(sparePartIssueRequest, |
||||
|
sparePartIssueRequestDetails.First()).ConfigureAwait(false); |
||||
|
sparePartIssueJobEditInput.Details = sparePartIssueJobDetailInputs; |
||||
|
jobs.Add(sparePartIssueJobEditInput); |
||||
|
} |
||||
|
|
||||
|
return jobs; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 构造注塑任务-按数量
|
||||
|
/// </summary>
|
||||
|
/// <param name="sparePartIssueRequest"></param>
|
||||
|
/// <param name="requestDetailInput"></param>
|
||||
|
/// <returns></returns>
|
||||
|
private async Task<SparePartIssueJobEditInput> BuildSparePartIssueJobCreateInputWithQtyTypeAsync( |
||||
|
SparePartIssueRequest sparePartIssueRequest, SparePartIssueRequestDetail requestDetailInput) |
||||
|
{ |
||||
|
var job = ObjectMapper.Map<SparePartIssueRequest, SparePartIssueJobEditInput>(sparePartIssueRequest); |
||||
|
job.JobType = EnumJobType.IssueJob; |
||||
|
job.JobStatus = EnumJobStatus.Open; |
||||
|
job.WorkGroupCode = requestDetailInput.ToLocationGroup; |
||||
|
job.WarehouseCode = requestDetailInput.ToWarehouseCode; |
||||
|
job.Worker = sparePartIssueRequest.Worker; |
||||
|
job.SparePartRequestNumber = sparePartIssueRequest.Number; |
||||
|
job.EnumIssueSendType = EnumIssueSendType.QtyType; |
||||
|
|
||||
|
await Task.CompletedTask.ConfigureAwait(false); |
||||
|
|
||||
|
return job; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 构造注塑任务明细-按数量
|
||||
|
/// </summary>
|
||||
|
/// <param name="sparePartIssueRequestDetail"></param>
|
||||
|
/// <param name="balance"></param>
|
||||
|
/// <returns></returns>
|
||||
|
private async Task<SparePartIssueJobDetailInput> BuildSparePartIssueJobDetailWithQtyTypeAsync( |
||||
|
SparePartIssueRequestDetailDTO sparePartIssueRequestDetail, BalanceDTO balance) |
||||
|
{ |
||||
|
var detail = new SparePartIssueJobDetailInput(); |
||||
|
detail.RequestLocationCode = sparePartIssueRequestDetail.ToLocationCode; |
||||
|
detail.PositionCode = sparePartIssueRequestDetail.PositionCode; |
||||
|
detail.RecommendType = sparePartIssueRequestDetail.RecommendType; |
||||
|
detail.Uom = balance.Uom; |
||||
|
detail.ItemCode = balance.ItemCode; |
||||
|
detail.ItemDesc2 = balance.ItemDesc2; |
||||
|
detail.ItemDesc1 = balance.ItemDesc1; |
||||
|
detail.ItemName = balance.ItemName; |
||||
|
detail.ProdLine = sparePartIssueRequestDetail.ProdLine; |
||||
|
detail.RequestQty = balance.Qty; |
||||
|
detail.StdPackQty = sparePartIssueRequestDetail.StdPackQty; |
||||
|
detail.Status = balance.Status; |
||||
|
|
||||
|
detail.RequestLocationErpCode = sparePartIssueRequestDetail.ToLocationErpCode; |
||||
|
detail.RequestLocationArea = sparePartIssueRequestDetail.ToLocationArea; |
||||
|
detail.RequestWarehouseCode = sparePartIssueRequestDetail.ToWarehouseCode; |
||||
|
detail.RequestLocationGroup = sparePartIssueRequestDetail.ToLocationGroup; |
||||
|
detail.RequestLocationCode = sparePartIssueRequestDetail.ToLocationCode; |
||||
|
|
||||
|
detail.RecommendFromPackingCode = balance.PackingCode; |
||||
|
detail.RecommendFromContainerCode = balance.ContainerCode; |
||||
|
detail.RecommendFromSupplierBatch = balance.SupplierBatch; |
||||
|
detail.RecommendFromProduceDate = balance.ProduceDate; |
||||
|
detail.RecommendFromExpireDate = balance.ExpireDate; |
||||
|
detail.RecommendFromLot = balance.Lot; |
||||
|
detail.RecommendFromProduceDate = balance.ProduceDate; |
||||
|
detail.RecommendFromArriveDate = balance.ArriveDate; |
||||
|
detail.RecommendFromQty = balance.Qty; |
||||
|
detail.RecommendFromContainerCode = balance.ContainerCode; |
||||
|
detail.RecommendFromPackingCode = balance.PackingCode; |
||||
|
|
||||
|
detail.RecommendToPackingCode = balance.PackingCode; |
||||
|
detail.RecommendToContainerCode = balance.ContainerCode; |
||||
|
detail.RecommendToSupplierBatch = balance.SupplierBatch; |
||||
|
detail.RecommendToProduceDate = balance.ProduceDate; |
||||
|
detail.RecommendToExpireDate = balance.ExpireDate; |
||||
|
detail.RecommendToLot = balance.Lot; |
||||
|
detail.RecommendToProduceDate = balance.ProduceDate; |
||||
|
detail.RecommendToArriveDate = balance.ArriveDate; |
||||
|
detail.RecommendToQty = balance.Qty; |
||||
|
detail.RecommendToContainerCode = balance.ContainerCode; |
||||
|
detail.RecommendToPackingCode = balance.PackingCode; |
||||
|
|
||||
|
detail.RecommendFromLocationArea = balance.LocationArea; |
||||
|
detail.RecommendFromLocationCode = balance.LocationCode; |
||||
|
detail.RecommendFromLocationErpCode = balance.LocationErpCode; |
||||
|
detail.RecommendFromLocationGroup = balance.LocationGroup; |
||||
|
detail.RecommendFromWarehouseCode = balance.WarehouseCode; |
||||
|
|
||||
|
detail.RecommendToLocationCode = sparePartIssueRequestDetail.ToLocationCode; |
||||
|
detail.RecommendToLocationErpCode = sparePartIssueRequestDetail.ToLocationErpCode; |
||||
|
detail.RecommendToLocationArea = sparePartIssueRequestDetail.ToLocationArea; |
||||
|
detail.RecommendToWarehouseCode = sparePartIssueRequestDetail.ToWarehouseCode; |
||||
|
detail.RecommendToLocationGroup = sparePartIssueRequestDetail.ToLocationGroup; |
||||
|
|
||||
|
detail.TransferLibFromPackingCode = balance.PackingCode; |
||||
|
detail.TransferLibFromContainerCode = balance.ContainerCode; |
||||
|
detail.TransferLibFromSupplierBatch = balance.SupplierBatch; |
||||
|
detail.TransferLibFromProduceDate = balance.ProduceDate; |
||||
|
detail.TransferLibFromExpireDate = balance.ExpireDate; |
||||
|
detail.TransferLibFromLot = balance.Lot; |
||||
|
detail.TransferLibFromProduceDate = balance.ProduceDate; |
||||
|
detail.TransferLibFromArriveDate = balance.ArriveDate; |
||||
|
detail.TransferLibFromQty = balance.Qty; |
||||
|
detail.TransferLibFromContainerCode = balance.ContainerCode; |
||||
|
detail.TransferLibFromPackingCode = balance.PackingCode; |
||||
|
|
||||
|
detail.TransferLibToPackingCode = balance.PackingCode; |
||||
|
detail.TransferLibToContainerCode = balance.ContainerCode; |
||||
|
detail.TransferLibToSupplierBatch = balance.SupplierBatch; |
||||
|
detail.TransferLibToProduceDate = balance.ProduceDate; |
||||
|
detail.TransferLibToExpireDate = balance.ExpireDate; |
||||
|
detail.TransferLibToLot = balance.Lot; |
||||
|
detail.TransferLibToProduceDate = balance.ProduceDate; |
||||
|
detail.TransferLibToArriveDate = balance.ArriveDate; |
||||
|
detail.TransferLibToQty = balance.Qty; |
||||
|
detail.TransferLibToPackingCode = balance.PackingCode; |
||||
|
|
||||
|
detail.TransferLibFromLocationArea = balance.LocationArea; |
||||
|
detail.TransferLibFromLocationCode = balance.LocationCode; |
||||
|
detail.TransferLibFromLocationErpCode = balance.LocationErpCode; |
||||
|
detail.TransferLibFromLocationGroup = balance.LocationGroup; |
||||
|
detail.TransferLibFromWarehouseCode = balance.WarehouseCode; |
||||
|
|
||||
|
detail.TransferLibToLocationCode = sparePartIssueRequestDetail.ToLocationCode; |
||||
|
detail.TransferLibToLocationErpCode = sparePartIssueRequestDetail.ToLocationErpCode; |
||||
|
detail.TransferLibToLocationArea = sparePartIssueRequestDetail.ToLocationArea; |
||||
|
detail.TransferLibToWarehouseCode = sparePartIssueRequestDetail.ToWarehouseCode; |
||||
|
detail.TransferLibToLocationGroup = sparePartIssueRequestDetail.ToLocationGroup; |
||||
|
|
||||
|
await Task.CompletedTask.ConfigureAwait(false); |
||||
|
return detail; |
||||
|
} |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#region 按箱叫料
|
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 创建注塑任务 按箱叫料-按箱
|
||||
|
/// </summary>
|
||||
|
/// <param name="sparePartIssueRequest"></param>
|
||||
|
/// <param name="sparePartIssueRequestDetailList"></param>
|
||||
|
/// <param name="recommendbalanceDtos"></param>
|
||||
|
/// <param name="useBalanceList"></param>
|
||||
|
/// <returns></returns>
|
||||
|
/// <exception cref="UserFriendlyException"></exception>
|
||||
|
private async Task<List<SparePartIssueJobEditInput>> CreateSparePartIssueJobWithBoxQtyTypeAsync |
||||
|
( |
||||
|
SparePartIssueRequest sparePartIssueRequest, |
||||
|
List<SparePartIssueRequestDetail> sparePartIssueRequestDetailList, |
||||
|
List<SortBalance> recommendbalanceDtos, |
||||
|
List<BalanceDTO> useBalanceList) |
||||
|
{ |
||||
|
var inputJobs = new List<SparePartIssueJobEditInput>(); |
||||
|
|
||||
|
var jobs = await _sparePartIssueJobAppService.GetByRequestNumberAsync(sparePartIssueRequest.Number) |
||||
|
.ConfigureAwait(false); |
||||
|
|
||||
|
foreach (var detail in sparePartIssueRequestDetailList) |
||||
|
{ |
||||
|
//当前零件的集合
|
||||
|
var inputDetails = sparePartIssueRequestDetailList; |
||||
|
//获取请求下 这个零件和这个库位一个需要多少箱
|
||||
|
var sumBoxQty = inputDetails.Sum(p => p.BoxQty - jobs.Count); |
||||
|
//获取生产线
|
||||
|
var productionLineDto = await _productionLineAppService |
||||
|
.GetByLocationCodeAsync(inputDetails.First().ToLocationCode).ConfigureAwait(false); |
||||
|
|
||||
|
var productLineCodeAndItemCode = await _productionLineItemAppService |
||||
|
.GetByProductLineCodeAndItemCodeAsync(productionLineDto.Code, detail.ItemCode) |
||||
|
.ConfigureAwait(false); |
||||
|
if (productLineCodeAndItemCode == null) |
||||
|
{ |
||||
|
throw new UserFriendlyException( |
||||
|
$"物品代码【{detail.ItemCode}】在生产线【{productionLineDto.Code}】中没有对应的【生产线物品关系】"); |
||||
|
} |
||||
|
|
||||
|
//可用库存
|
||||
|
var usableList = recommendbalanceDtos; |
||||
|
usableList = usableList.Where(p => !useBalanceList.Select(p => p.PackingCode).Contains(p.PackingCode)) |
||||
|
.ToList(); |
||||
|
if (usableList.Any()) |
||||
|
{ |
||||
|
for (var i = 0; i < sumBoxQty; i++) |
||||
|
{ |
||||
|
if (usableList.Any()) |
||||
|
{ |
||||
|
var firstUsable = usableList.First(); |
||||
|
useBalanceList.Add(firstUsable); |
||||
|
usableList.Remove(firstUsable); |
||||
|
|
||||
|
var sparePartIssueJobEditInput = |
||||
|
await BuildSparePartIssueJobCreateInputWithBoxQtyTypeAsync(sparePartIssueRequest, |
||||
|
detail, firstUsable) |
||||
|
.ConfigureAwait(false); |
||||
|
|
||||
|
inputJobs.Add(sparePartIssueJobEditInput); |
||||
|
} |
||||
|
else |
||||
|
{ |
||||
|
break; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
return inputJobs; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 构造注塑任务-按箱
|
||||
|
/// </summary>
|
||||
|
/// <param name="sparePartIssueRequest"></param>
|
||||
|
/// <param name="sparePartIssueRequestDetail"></param>
|
||||
|
/// <param name="balanceDtos"></param>
|
||||
|
/// <returns></returns>
|
||||
|
private async Task<SparePartIssueJobEditInput> BuildSparePartIssueJobCreateInputWithBoxQtyTypeAsync( |
||||
|
SparePartIssueRequest sparePartIssueRequest, |
||||
|
SparePartIssueRequestDetail sparePartIssueRequestDetail, BalanceDTO balanceDtos) |
||||
|
{ |
||||
|
var job = ObjectMapper.Map<SparePartIssueRequest, SparePartIssueJobEditInput>(sparePartIssueRequest); |
||||
|
job.JobType = EnumJobType.IssueJob; |
||||
|
job.JobStatus = EnumJobStatus.Open; |
||||
|
job.WorkGroupCode = sparePartIssueRequestDetail.ToLocationGroup; |
||||
|
job.WarehouseCode = sparePartIssueRequestDetail.ToWarehouseCode; |
||||
|
job.Worker = sparePartIssueRequest.Worker; |
||||
|
job.SparePartRequestNumber = sparePartIssueRequest.Number; |
||||
|
job.EnumIssueSendType = EnumIssueSendType.BoxQtyType; |
||||
|
|
||||
|
job.Details.Add(await BuildSparePartIssueJobDetailWithBoxQtyTypeAsync(sparePartIssueRequestDetail, balanceDtos) |
||||
|
.ConfigureAwait(false)); |
||||
|
|
||||
|
await Task.CompletedTask.ConfigureAwait(false); |
||||
|
|
||||
|
return job; |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 构造注塑任务明细-按箱
|
||||
|
/// </summary>
|
||||
|
/// <param name="sparePartIssueRequestDetail"></param>
|
||||
|
/// <param name="balance"></param>
|
||||
|
/// <returns></returns>
|
||||
|
private async Task<SparePartIssueJobDetailInput> BuildSparePartIssueJobDetailWithBoxQtyTypeAsync( |
||||
|
SparePartIssueRequestDetail sparePartIssueRequestDetail, BalanceDTO balance) |
||||
|
{ |
||||
|
var detail = new SparePartIssueJobDetailInput(); |
||||
|
detail.RequestLocationCode = sparePartIssueRequestDetail.ToLocationCode; |
||||
|
detail.RequestLocationGroup = sparePartIssueRequestDetail.ToLocationGroup; |
||||
|
detail.RequestLocationArea = sparePartIssueRequestDetail.ToLocationArea; |
||||
|
detail.RequestLocationErpCode = sparePartIssueRequestDetail.ToLocationErpCode; |
||||
|
detail.RequestWarehouseCode = sparePartIssueRequestDetail.ToWarehouseCode; |
||||
|
detail.RequestQty = 1; |
||||
|
|
||||
|
detail.PositionCode = sparePartIssueRequestDetail.PositionCode; |
||||
|
detail.RecommendType = sparePartIssueRequestDetail.RecommendType; |
||||
|
detail.ProdLine = sparePartIssueRequestDetail.ToLocationCode; |
||||
|
|
||||
|
detail.ItemCode = sparePartIssueRequestDetail.ItemCode; |
||||
|
detail.ItemName = sparePartIssueRequestDetail.ItemName; |
||||
|
detail.ItemDesc1 = sparePartIssueRequestDetail.ItemDesc1; |
||||
|
detail.ItemDesc2 = sparePartIssueRequestDetail.ItemDesc2; |
||||
|
|
||||
|
detail.Status = EnumInventoryStatus.OK; |
||||
|
detail.Uom = balance.Uom; |
||||
|
|
||||
|
detail.RecommendFromPackingCode = balance.PackingCode; |
||||
|
detail.RecommendFromContainerCode = balance.ContainerCode; |
||||
|
detail.RecommendFromLot = balance.Lot; |
||||
|
|
||||
|
detail.RecommendFromQty = balance.Qty; |
||||
|
|
||||
|
detail.RecommendFromSupplierBatch = balance.SupplierBatch; |
||||
|
detail.RecommendFromProduceDate = balance.ProduceDate; |
||||
|
detail.RecommendFromExpireDate = balance.ExpireDate; |
||||
|
detail.RecommendFromProduceDate = balance.ProduceDate; |
||||
|
detail.RecommendFromArriveDate = balance.ArriveDate; |
||||
|
|
||||
|
detail.RecommendFromLocationArea = balance.LocationArea; |
||||
|
detail.RecommendFromLocationCode = balance.LocationCode; |
||||
|
detail.RecommendFromLocationErpCode = balance.LocationErpCode; |
||||
|
detail.RecommendFromLocationGroup = balance.LocationGroup; |
||||
|
detail.RecommendFromWarehouseCode = balance.WarehouseCode; |
||||
|
|
||||
|
detail.RecommendToPackingCode = balance.PackingCode; |
||||
|
detail.RecommendToContainerCode = balance.ContainerCode; |
||||
|
detail.RecommendToLot = balance.Lot; |
||||
|
|
||||
|
detail.RecommendToQty = balance.Qty; |
||||
|
|
||||
|
detail.RecommendToSupplierBatch = balance.SupplierBatch; |
||||
|
detail.RecommendToProduceDate = balance.ProduceDate; |
||||
|
detail.RecommendToExpireDate = balance.ExpireDate; |
||||
|
detail.RecommendToProduceDate = balance.ProduceDate; |
||||
|
detail.RecommendToArriveDate = balance.ArriveDate; |
||||
|
|
||||
|
detail.RecommendToLocationCode = sparePartIssueRequestDetail.ToLocationCode; |
||||
|
detail.RecommendToLocationErpCode = sparePartIssueRequestDetail.ToLocationErpCode; |
||||
|
detail.RecommendToLocationArea = sparePartIssueRequestDetail.ToLocationArea; |
||||
|
detail.RecommendToWarehouseCode = sparePartIssueRequestDetail.ToWarehouseCode; |
||||
|
detail.RecommendToLocationGroup = sparePartIssueRequestDetail.ToLocationGroup; |
||||
|
|
||||
|
await Task.CompletedTask.ConfigureAwait(false); |
||||
|
return detail; |
||||
|
} |
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
#endregion
|
||||
|
|
||||
|
//创建任务
|
||||
|
private async Task<List<SparePartIssueJobDTO>> CreateAllSparePartIssueJobAsync( |
||||
|
SparePartIssueRequest sparePartIssueRequest) |
||||
|
{ |
||||
|
var sparePartIssueJobEditInputs = new List<SparePartIssueJobEditInput>(); |
||||
|
|
||||
|
//已用的库存的集合
|
||||
|
var useBalanceList = new List<BalanceDTO>(); |
||||
|
|
||||
|
foreach (var groupbyItemCodeAndProdLine in sparePartIssueRequest.Details.GroupBy(p => |
||||
|
new { p.ItemCode })) |
||||
|
{ |
||||
|
foreach (var sparePartIssueRequestDetail in groupbyItemCodeAndProdLine) |
||||
|
{ |
||||
|
var productionLineItemDto = await _productionLineItemAppService.GetByProductLineCodeAndItemCodeAsync( |
||||
|
sparePartIssueRequestDetail.ProdLine, |
||||
|
groupbyItemCodeAndProdLine.Key.ItemCode).ConfigureAwait(false); |
||||
|
|
||||
|
if (productionLineItemDto == null) |
||||
|
{ |
||||
|
throw new UserFriendlyException( |
||||
|
$"未在生产线【{sparePartIssueRequestDetail.ProdLine}】物品【{groupbyItemCodeAndProdLine.Key.ItemCode}】的关系,请查看【生产线物品关系】"); |
||||
|
} |
||||
|
|
||||
|
//原料
|
||||
|
if (!string.IsNullOrEmpty(productionLineItemDto.RawLocationCodeListJson)) //因为一个零件 要不是原料 要不是半成品
|
||||
|
{ |
||||
|
var usableLocationCode = |
||||
|
JsonSerializer.Deserialize<List<string>>(productionLineItemDto.RawLocationCodeListJson); |
||||
|
if (usableLocationCode.Any()) |
||||
|
{ |
||||
|
//获取可用库存
|
||||
|
var input = new RecommendBalanceRequestInput |
||||
|
{ |
||||
|
ItemCode = sparePartIssueRequestDetail.ItemCode, |
||||
|
Qty = decimal.MaxValue, |
||||
|
Statuses = new EditableList<EnumInventoryStatus> { EnumInventoryStatus.OK }, |
||||
|
Locations = |
||||
|
JsonSerializer.Deserialize<List<string>>(productionLineItemDto.RawLocationCodeListJson), |
||||
|
IsPackingCode = true |
||||
|
}; |
||||
|
var usableList = await _balanceAppService.GetUsableListAsync(input).ConfigureAwait(false); |
||||
|
var sortByFifoAsync = await SortByFifoAsync(usableList).ConfigureAwait(false); |
||||
|
|
||||
|
//因为是按箱叫料 先把值赋值给箱数量上
|
||||
|
sparePartIssueRequestDetail.BoxQty = sparePartIssueRequestDetail.Qty; |
||||
|
|
||||
|
if (usableList.Any()) |
||||
|
{ |
||||
|
//因为是原料所以按箱叫料
|
||||
|
sparePartIssueJobEditInputs.AddRange( |
||||
|
await CreateSparePartIssueJobWithBoxQtyTypeAsync(sparePartIssueRequest, |
||||
|
new EditableList<SparePartIssueRequestDetail> { sparePartIssueRequestDetail }, |
||||
|
sortByFifoAsync, |
||||
|
useBalanceList).ConfigureAwait(false)); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
//半成品
|
||||
|
if (!string.IsNullOrEmpty(productionLineItemDto.ProductLocationCodeListJson)) //因为一个零件 要不是原料 要不是半成品
|
||||
|
{ |
||||
|
var usableLocationCode = |
||||
|
JsonSerializer.Deserialize<List<string>>(productionLineItemDto.ProductLocationCodeListJson); |
||||
|
if (usableLocationCode.Any()) |
||||
|
{ |
||||
|
//获取可用库存
|
||||
|
var input = new RecommendBalanceRequestInput |
||||
|
{ |
||||
|
ItemCode = groupbyItemCodeAndProdLine.Key.ItemCode, |
||||
|
Qty = sparePartIssueRequestDetail.Qty, |
||||
|
Statuses = new EditableList<EnumInventoryStatus> { EnumInventoryStatus.OK }, |
||||
|
Locations = |
||||
|
JsonSerializer.Deserialize<List<string>>(productionLineItemDto |
||||
|
.ProductLocationCodeListJson), |
||||
|
IsPackingCode = false |
||||
|
}; |
||||
|
var usableList = await _balanceAppService.GetUsableListAsync(input).ConfigureAwait(false); |
||||
|
var temp = usableList.ToList(); |
||||
|
|
||||
|
foreach (var balanceDto in usableList) //计算已经用过的库存
|
||||
|
{ |
||||
|
var useBalanceDto = useBalanceList.Where(p => |
||||
|
p.ItemCode == balanceDto.ItemCode && p.LocationCode == balanceDto.LocationCode && |
||||
|
p.Lot == balanceDto.Lot && p.Status == balanceDto.Status && |
||||
|
p.PackingCode == balanceDto.PackingCode); |
||||
|
if (useBalanceDto.Any()) //如果不为NULL,就是用过了的库存 需要减去使用量
|
||||
|
{ |
||||
|
balanceDto.Qty -= useBalanceDto.Sum(p => p.Qty); |
||||
|
if (balanceDto.Qty <= 0) |
||||
|
{ |
||||
|
temp.Remove(balanceDto); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
sparePartIssueJobEditInputs.AddRange( |
||||
|
await CreateSparePartIssueJobWithQtyTypeAsync(sparePartIssueRequest, |
||||
|
new List<SparePartIssueRequestDetail> { sparePartIssueRequestDetail }, temp, |
||||
|
useBalanceList).ConfigureAwait(false)); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
if (sparePartIssueJobEditInputs.Count > 0) //有库存 可以创建任务
|
||||
|
{ |
||||
|
//新增任务
|
||||
|
var addSparePartIssueJobDtos = await _sparePartIssueJobAppService.CreateManyAsync(sparePartIssueJobEditInputs) |
||||
|
.ConfigureAwait(false); |
||||
|
|
||||
|
await UpdateSparePartIssueRequestDetailQtyAsync(sparePartIssueRequest, addSparePartIssueJobDtos) |
||||
|
.ConfigureAwait(false); |
||||
|
|
||||
|
return addSparePartIssueJobDtos; |
||||
|
} |
||||
|
|
||||
|
return new List<SparePartIssueJobDTO>(); |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 修改请求的 已发 已收数量
|
||||
|
/// </summary>
|
||||
|
/// <param name="sparePartIssueRequest"></param>
|
||||
|
/// <param name="addSparePartIssueJobDtos"></param>
|
||||
|
/// <returns></returns>
|
||||
|
private async Task UpdateSparePartIssueRequestDetailQtyAsync(SparePartIssueRequest sparePartIssueRequest, |
||||
|
List<SparePartIssueJobDTO> addSparePartIssueJobDtos) |
||||
|
{ |
||||
|
//原有任务
|
||||
|
var existSparePartIssueJobDtos = await _sparePartIssueJobAppService |
||||
|
.GetByRequestNumberAsync(sparePartIssueRequest.Number) |
||||
|
.ConfigureAwait(false); |
||||
|
|
||||
|
//新增的任务和已有的任务总和
|
||||
|
var allSparePartIssueJobDtos = new List<SparePartIssueJobDTO>(); |
||||
|
allSparePartIssueJobDtos.AddRange(addSparePartIssueJobDtos); |
||||
|
allSparePartIssueJobDtos.AddRange(existSparePartIssueJobDtos); |
||||
|
|
||||
|
var groupByItemCodeLocationCode = sparePartIssueRequest.Details.GroupBy(p => |
||||
|
new { p.ItemCode, p.ToLocationCode }); |
||||
|
foreach (var group in groupByItemCodeLocationCode) |
||||
|
{ |
||||
|
foreach (var requestDetail in group) |
||||
|
{ |
||||
|
//所有已发数量
|
||||
|
decimal allIssuedQty = 0; |
||||
|
|
||||
|
//所有已发数量
|
||||
|
decimal allReceivedQty = 0; |
||||
|
|
||||
|
foreach (var allSparePartIssueJobDto in allSparePartIssueJobDtos) |
||||
|
{ |
||||
|
var jobDetailDtos = allSparePartIssueJobDto.Details.Where(p => |
||||
|
p.ItemCode == group.Key.ItemCode && p.RequestLocationCode == group.Key.ToLocationCode); |
||||
|
//所有已发数量
|
||||
|
allIssuedQty += jobDetailDtos.Sum(p => p.RequestQty); |
||||
|
//所有已发数量
|
||||
|
allReceivedQty += jobDetailDtos.Sum(p => p.HandledToQty); |
||||
|
} |
||||
|
|
||||
|
requestDetail.IssuedQty = allIssuedQty; |
||||
|
requestDetail.ReceivedQty = allReceivedQty; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
/// <summary>
|
||||
|
/// 排序规则 1.批次正序 2.底层 3.到货日期正序 4.数量倒序(整箱优先) 5.库位正序 6.箱码正序
|
||||
|
/// </summary>
|
||||
|
/// <param name="balances"></param>
|
||||
|
/// <returns></returns>
|
||||
|
public async Task<List<SortBalance>> SortByFifoAsync(List<BalanceDTO> balances) |
||||
|
{ |
||||
|
var config = new MapperConfiguration(cfg => |
||||
|
{ |
||||
|
cfg.CreateMap<BalanceDTO, SortBalance>() |
||||
|
.Ignore(x => x.LocationRow); |
||||
|
}); |
||||
|
_mapper = new Mapper(config); |
||||
|
|
||||
|
var resultBalances = _mapper.Map<List<BalanceDTO>, List<SortBalance>>(balances); |
||||
|
foreach (var resultBalance in resultBalances) |
||||
|
{ |
||||
|
var locationDto = |
||||
|
await _locationAppService.GetByCodeAsync(resultBalance.LocationCode).ConfigureAwait(false); |
||||
|
resultBalance.LocationRow = locationDto.RowCode; |
||||
|
} |
||||
|
|
||||
|
resultBalances = resultBalances |
||||
|
.OrderBy(p => p.Lot) |
||||
|
.ThenBy(p => p.LocationRow) |
||||
|
.ThenBy(p => p.PutInTime) |
||||
|
.ThenBy(p => p.Qty) //2023-9-14 苑静雯 从小数开始发料
|
||||
|
.ThenBy(p => p.LocationCode) |
||||
|
.ThenBy(p => p.PackingCode) |
||||
|
.ToList(); |
||||
|
|
||||
|
return resultBalances; |
||||
|
} |
||||
|
} |
@ -0,0 +1,92 @@ |
|||||
|
using System; |
||||
|
using System.Collections.Generic; |
||||
|
using System.Linq; |
||||
|
using System.Threading.Tasks; |
||||
|
using Volo.Abp.EventBus; |
||||
|
using Volo.Abp.Uow; |
||||
|
using Win_in.Sfs.Shared.Domain.Shared; |
||||
|
using Win_in.Sfs.Shared.Event; |
||||
|
using Win_in.Sfs.Wms.Inventory.Application.Contracts; |
||||
|
using Win_in.Sfs.Wms.Store.Domain; |
||||
|
using Win_in.Sfs.Wms.Store.Event.Transaction; |
||||
|
|
||||
|
namespace Win_in.Sfs.Wms.Store.Event.Transactions; |
||||
|
|
||||
|
public class SparePartIssueNoteEventHandler |
||||
|
: StoreInventoryEventHandlerBase |
||||
|
, ILocalEventHandler<SfsCreatedEntityEventData<SparePartIssueNote>> |
||||
|
, ILocalEventHandler<SfsCreatedEntityEventData<List<SparePartIssueNote>>> |
||||
|
, ILocalEventHandler<SfsConfirmedEntityEventData<SparePartIssueNote>> |
||||
|
{ |
||||
|
private const EnumTransType TransType = EnumTransType.Issue; |
||||
|
|
||||
|
[UnitOfWork] |
||||
|
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<SparePartIssueNote> eventData) |
||||
|
{ |
||||
|
var entity = eventData.Entity; |
||||
|
var transferLogs = new List<TransferLogEditInput>(); |
||||
|
var route = entity.UseOnTheWayLocation |
||||
|
? EnumTransferRoute.SourceToOnTheWay |
||||
|
: EnumTransferRoute.SourceToDestination; |
||||
|
transferLogs.AddRange(await BuildTransferLogsAsync(entity).ConfigureAwait(false)); |
||||
|
|
||||
|
await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
[UnitOfWork] |
||||
|
public virtual async Task HandleEventAsync(SfsCreatedEntityEventData<List<SparePartIssueNote>> eventData) |
||||
|
{ |
||||
|
var entities = eventData.Entity; |
||||
|
var transferLogs = new List<TransferLogEditInput>(); |
||||
|
//如果要做库存事务汇总,可以修改此处
|
||||
|
foreach (var issueNote in entities) |
||||
|
{ |
||||
|
transferLogs.AddRange(await BuildTransferLogsAsync(issueNote).ConfigureAwait(false)); |
||||
|
} |
||||
|
|
||||
|
await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
[UnitOfWork] |
||||
|
public virtual async Task HandleEventAsync(SfsConfirmedEntityEventData<SparePartIssueNote> eventData) |
||||
|
{ |
||||
|
var entity = eventData.Entity; |
||||
|
|
||||
|
var inputList = await BuildTransferLogsAsync(entity) |
||||
|
.ConfigureAwait(false); |
||||
|
await AddTransferLogsAsync(inputList).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
private async Task AddTransferLogsAsync(List<TransferLogEditInput> inputList) |
||||
|
{ |
||||
|
var transferLogs = new List<TransferLogEditInput>(); |
||||
|
|
||||
|
transferLogs.AddRange(inputList); |
||||
|
|
||||
|
await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false); |
||||
|
} |
||||
|
|
||||
|
private async Task<List<TransferLogEditInput>> BuildTransferLogsAsync(SparePartIssueNote issueNote) |
||||
|
{ |
||||
|
var transferLogs = new List<TransferLogEditInput>(); |
||||
|
foreach (var detail in issueNote.Details.Where(detail => detail.HandledToQty != 0)) |
||||
|
{ |
||||
|
var transferLog = ObjectMapper.Map<SparePartIssueNoteDetail, TransferLogEditInput>(detail); |
||||
|
|
||||
|
transferLog.TransSubType = EnumTransSubType.Issue_WIP; |
||||
|
transferLog.TransType = TransType; |
||||
|
transferLog.DocNumber = issueNote.Number; |
||||
|
transferLog.JobNumber = issueNote.JobNumber; |
||||
|
|
||||
|
transferLog.ToContainerCode = string.Empty; |
||||
|
transferLog.ToPackingCode = string.Empty; |
||||
|
transferLog.ToLot = string.Empty; |
||||
|
|
||||
|
transferLogs.Add(transferLog); |
||||
|
} |
||||
|
|
||||
|
await Task.CompletedTask.ConfigureAwait(false); |
||||
|
|
||||
|
return transferLogs; |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue