Browse Source

pda增加三方库申请列表

dev_DY_CC
周红军 11 months ago
parent
commit
bf0baef11d
  1. 37
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/ThirdLocationRequestController.cs
  2. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/DTOs/ThirdLocationJobDetailDTO.cs
  3. 8
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/Inputs/ThirdLocationJobDetailInput.cs
  4. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ThirdLocationJobs/ThirdLocationJobDetail.cs
  5. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ThirdLocationJobs/ThirdLocationJobDbContextModelCreatingExtensions.cs
  6. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/ThirdLocationJobAutoMapperProfile.cs
  7. 5
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/ThirdLocationRequestAutoMapperProfile.cs
  8. 22
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ThirdLocationRequestEventHandler.cs
  9. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ThirdLocationNoteEventHandler.cs

37
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Stores/ThirdLocationRequestController.cs

@ -1,7 +1,12 @@
using System; using System;
using System.Collections.Generic;
using System.Text.Json;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Volo.Abp.Application.Dtos;
using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc;
using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts;
namespace Win_in.Sfs.Wms.Pda.Controllers.Stores; namespace Win_in.Sfs.Wms.Pda.Controllers.Stores;
@ -49,6 +54,38 @@ public class ThirdLocationRequestController : AbpController
return Ok(result); return Ok(result);
} }
/// <summary>
/// 获取列表
/// </summary>
/// <param name="pageSize"></param>
/// <param name="pageIndex"></param>
/// <returns></returns>
[HttpGet("list")]
public virtual async Task<PagedResultDto<ThirdLocationRequestDTO>> GetListAsync(int pageSize, int pageIndex)
{
var status = new List<int>() { (int)EnumRequestStatus.Handling, (int)EnumRequestStatus.Partial };
var jsonStatus = JsonSerializer.Serialize(status);
var request = new SfsStoreRequestInputBase
{
MaxResultCount = pageSize,
SkipCount = (pageIndex - 1) * pageSize,
Sorting = $"{nameof(ThirdLocationRequestDTO.CreationTime)} ASC",
Condition = new Condition
{
Filters = new List<Filter>
{
new(nameof(ThirdLocationRequestDTO.RequestStatus),jsonStatus,"In")
}
}
};
var list = await _thirdLocationRequestAppService.GetPagedListByFilterAsync(request, true).ConfigureAwait(false);
return list;
}
/// <summary> /// <summary>
/// 取消三方库请求 /// 取消三方库请求
/// </summary> /// </summary>

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/DTOs/ThirdLocationJobDetailDTO.cs

@ -63,10 +63,10 @@ public class ThirdLocationJobDetailDTO : SfsJobRecommendFromDetailDTOBase, IHasT
public string SingleCodeJob { get; set; } public string SingleCodeJob { get; set; }
/// <summary> /// <summary>
/// 工作中心 /// 申请单件码
/// </summary> /// </summary>
[Display(Name = "工作中心")] [Display(Name = "申请单件码")]
public string WorkStation { get; set; } public string SingleCodeRequest { get; set; }
/// <summary> /// <summary>
/// 过期时间 /// 过期时间

8
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/Inputs/ThirdLocationJobDetailInput.cs

@ -71,14 +71,14 @@ public class ThirdLocationJobDetailInput : SfsJobRecommendFromDetailInputBase, I
/// </summary> /// </summary>
[Display(Name = "收货单件码")] [Display(Name = "收货单件码")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string SingleCodeJob { get; set; } public string SingleCodeJob { get; set; }
/// <summary> /// <summary>
/// 工作中心 /// 申请单件码
/// </summary> /// </summary>
[Display(Name = "工作中心")] [Display(Name = "申请单件码")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string WorkStation { get; set; } public string SingleCodeRequest { get; set; }
/// <summary> /// <summary>
/// 过期时间 /// 过期时间

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ThirdLocationJobs/ThirdLocationJobDetail.cs

@ -52,9 +52,9 @@ public class ThirdLocationJobDetail : SfsJobRecommendFromDetailEntityBase, IHasT
public string SingleCodeJob { get; set; } public string SingleCodeJob { get; set; }
/// <summary> /// <summary>
/// 工作中心 /// 申请单件码
/// </summary> /// </summary>
public string WorkStation { get; set; } public string SingleCodeRequest { get; set; }
/// <summary> /// <summary>
/// 过期时间 /// 过期时间

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ThirdLocationJobs/ThirdLocationJobDbContextModelCreatingExtensions.cs

@ -51,7 +51,7 @@ public static class ThirdLocationJobDbContextModelCreatingExtensions
b.Property(q => q.FromLocationCode).HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.FromLocationCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.FromLocationArea).HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.FromLocationArea).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.SingleCodeJob).HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.SingleCodeJob).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.WorkStation).HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.SingleCodeRequest).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.Operation).HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.Operation).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.DistributionType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>(); b.Property(q => q.DistributionType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
b.Property(q => q.TruncType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>(); b.Property(q => q.TruncType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Jobs/ThirdLocationJobAutoMapperProfile.cs

@ -89,6 +89,7 @@ public partial class StoreEventAutoMapperProfile : Profile
.ForMember(x => x.FromStatus, y => y.MapFrom(d => d.Status)) .ForMember(x => x.FromStatus, y => y.MapFrom(d => d.Status))
.ForMember(x => x.ToStatus, y => y.MapFrom(d => d.Status)) .ForMember(x => x.ToStatus, y => y.MapFrom(d => d.Status))
.Ignore(x => x.ProdLine) .Ignore(x => x.ProdLine)
.Ignore(x => x.WorkStation)
; ;
} }
} }

5
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/ThirdLocationRequestAutoMapperProfile.cs

@ -61,6 +61,7 @@ public partial class StoreEventAutoMapperProfile : Profile
CreateMap<ThirdLocationRequestDetail, ThirdLocationJobDetailInput>() CreateMap<ThirdLocationRequestDetail, ThirdLocationJobDetailInput>()
.ForMember(x => x.FromLocationCode, y => y.MapFrom(d => d.FromLocationCode)) .ForMember(x => x.FromLocationCode, y => y.MapFrom(d => d.FromLocationCode))
.ForMember(x => x.SingleCodeRequest, y => y.MapFrom(d => d.SingleCodeRequest))
.Ignore(x => x.SingleCodeJob) .Ignore(x => x.SingleCodeJob)
.Ignore(x => x.RecommendFromLocationArea) .Ignore(x => x.RecommendFromLocationArea)
.Ignore(x => x.RecommendFromLocationGroup) .Ignore(x => x.RecommendFromLocationGroup)
@ -128,7 +129,7 @@ public partial class StoreEventAutoMapperProfile : Profile
.Ignore(x => x.FromLocationCode) .Ignore(x => x.FromLocationCode)
.Ignore(x => x.ToLocationCode) .Ignore(x => x.ToLocationCode)
.Ignore(x => x.SingleCodeJob) .Ignore(x => x.SingleCodeJob)
.Ignore(x => x.WorkStation) .Ignore(x => x.SingleCodeRequest)
.Ignore(x => x.HandledContainerCode) .Ignore(x => x.HandledContainerCode)
.Ignore(x => x.HandledExpireDate) .Ignore(x => x.HandledExpireDate)
.Ignore(x => x.HandledFromLocationCode) .Ignore(x => x.HandledFromLocationCode)
@ -152,7 +153,7 @@ public partial class StoreEventAutoMapperProfile : Profile
.Ignore(x => x.FromLocationCode) .Ignore(x => x.FromLocationCode)
.Ignore(x => x.ToLocationCode) .Ignore(x => x.ToLocationCode)
.Ignore(x => x.SingleCodeJob) .Ignore(x => x.SingleCodeJob)
.Ignore(x => x.WorkStation) .Ignore(x => x.SingleCodeRequest)
.Ignore(x => x.PositionCode) .Ignore(x => x.PositionCode)
.Ignore(x => x.RecommendType) .Ignore(x => x.RecommendType)
.Ignore(x => x.FromLocationArea) .Ignore(x => x.FromLocationArea)

22
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ThirdLocationRequestEventHandler.cs

@ -98,16 +98,16 @@ public class ThirdLocationRequestEventHandler
if (thirdLocationJobs.Any()) if (thirdLocationJobs.Any())
{ {
await _thirdLocationJobAppService.CreateManyAsync(thirdLocationJobs).ConfigureAwait(false); await _thirdLocationJobAppService.CreateManyAsync(thirdLocationJobs).ConfigureAwait(false);
}
//来源库位更新为在途库位 //来源库位更新为在途库位
var transferLogs = new List<TransferLogEditInput>(); var transferLogs = new List<TransferLogEditInput>();
var route = entity.UseOnTheWayLocation var route = entity.UseOnTheWayLocation
? EnumTransferRoute.SourceToOnTheWay ? EnumTransferRoute.SourceToOnTheWay
: EnumTransferRoute.SourceToDestination; : EnumTransferRoute.SourceToDestination;
transferLogs.AddRange(await BuildTransferLogsAsync(entity, route).ConfigureAwait(false)); transferLogs.AddRange(await BuildTransferLogsAsync(entity, route).ConfigureAwait(false));
await _transferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false); await _transferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false);
}
} }
@ -292,8 +292,8 @@ public class ThirdLocationRequestEventHandler
var toLocationCodes = thirdLocationRequest.Details.Select(p => p.ToLocationCode).Distinct().ToList();//所有发送库位的集合 var toLocationCodes = thirdLocationRequest.Details.Select(p => p.ToLocationCode).Distinct().ToList();//所有发送库位的集合
var toLocations = await _locationAppService.GetByCodesAsync(toLocationCodes).ConfigureAwait(false);//所有库位的集合 var toLocations = await _locationAppService.GetByCodesAsync(toLocationCodes).ConfigureAwait(false);//所有库位的集合
var thirdLocationRequestDetails = thirdLocationRequest.Details.Where(p => p.ToBeIssuedQty > 0);//所有还没发送物品的集合 var thirdLocationRequestDetails = thirdLocationRequest.Details;
foreach (var thirdLocationRequestDetail in thirdLocationRequestDetails)//如果有还有剩余未叫料的数量 则创建新的任务 foreach (var thirdLocationRequestDetail in thirdLocationRequestDetails)
{ {
var toLocation = toLocations.FirstOrDefault(p => p.Code == thirdLocationRequestDetail.ToLocationCode);//判断目标库位是否存在 var toLocation = toLocations.FirstOrDefault(p => p.Code == thirdLocationRequestDetail.ToLocationCode);//判断目标库位是否存在
Check.NotNull(toLocation, "库位代码", $"库位 {thirdLocationRequestDetail.ToLocationCode} 不存在"); Check.NotNull(toLocation, "库位代码", $"库位 {thirdLocationRequestDetail.ToLocationCode} 不存在");
@ -384,7 +384,7 @@ public class ThirdLocationRequestEventHandler
var detail = ObjectMapper.Map<BalanceDTO, ThirdLocationJobDetailInput>(balance); var detail = ObjectMapper.Map<BalanceDTO, ThirdLocationJobDetailInput>(balance);
detail.WorkStation = thirdLocationRequestDetail.WorkStation; detail.SingleCodeRequest = thirdLocationRequestDetail.SingleCodeRequest;
detail.ExpiredTime = thirdLocationRequestDetail.ExpiredTime; detail.ExpiredTime = thirdLocationRequestDetail.ExpiredTime;
detail.PositionCode = thirdLocationRequestDetail.PositionCode; detail.PositionCode = thirdLocationRequestDetail.PositionCode;
detail.RecommendType = thirdLocationRequestDetail.RecommendType; detail.RecommendType = thirdLocationRequestDetail.RecommendType;

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ThirdLocationNoteEventHandler.cs

@ -82,6 +82,7 @@ public class ThirdLocationNoteEventHandler
} }
else else
{ {
requestEntities[0].RequestStatus = EnumRequestStatus.Partial;
await _thirdLocationRequestManager.UpdateAsync(requestEntities[0]).ConfigureAwait(false); await _thirdLocationRequestManager.UpdateAsync(requestEntities[0]).ConfigureAwait(false);
} }

Loading…
Cancel
Save