Browse Source

Merge branch 'dev_DY_CC' of http://dev.ccwin-in.com:3000/BoXu.Zheng/WZC2 into dev_DY_CC

dev_DY_CC
郑勃旭 12 months ago
parent
commit
ca2a14bd6c
  1. 13
      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/ThirdLocationJobDTO.cs
  3. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/Inputs/ThirdLocationJobEditInput.cs
  4. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/ThirdLocationJobPermissions.cs
  5. 7
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/DTOs/ThirdLocationRequestDTO.cs
  6. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/Inputs/ThirdLocationRequestEditInput.cs
  7. 5
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/ThirdLocationRequestPermissions.cs
  8. 13
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs
  9. 41
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAppService.cs
  10. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAutoMapperProfile.cs
  11. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/ThirdLocationJobs/ThirdLocationJob.cs
  12. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequest.cs
  13. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Jobs/ThirdLocationJobs/ThirdLocationJobDbContextModelCreatingExtensions.cs
  14. 2
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ThirdLocationRequests/ThirdLocationRequestDbContextModelCreatingExtensions.cs
  15. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Requests/ThirdLocationRequestAutoMapperProfile.cs

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

@ -1,3 +1,4 @@
using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc; using Volo.Abp.AspNetCore.Mvc;
@ -48,4 +49,16 @@ public class ThirdLocationRequestController : AbpController
return Ok(result); return Ok(result);
} }
/// <summary>
/// 取消三方库请求
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
[HttpPost("cancel/{id}")]
public virtual async Task<ActionResult<ThirdLocationRequestDTO>> CancelAsync(Guid id)
{
var result = await _thirdLocationRequestAppService.CancelAsync(id).ConfigureAwait(false);
return Ok(result);
}
} }

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

@ -17,11 +17,11 @@ public class ThirdLocationJobDTO : SfsJobDTOBase<ThirdLocationJobDetailDTO>
public string RequestType { get; set; } public string RequestType { get; set; }
/// <summary> /// <summary>
/// 生产线 /// 收货单件码
/// </summary> /// </summary>
[Display(Name = "生产线")] [Display(Name = "收货单件码")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ProdLine { get; set; } public string SingleCodeJob { get; set; }
/// <summary> /// <summary>
/// 要货申请单号 /// 要货申请单号

6
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/Inputs/ThirdLocationJobEditInput.cs

@ -67,11 +67,11 @@ public class ThirdLocationJobEditInput : SfsJobCreateUpdateInputBase, ISfsJobCre
public string Workshop { get; set; } public string Workshop { get; set; }
/// <summary> /// <summary>
/// 生产线 /// 收货单件码
/// </summary> /// </summary>
[Display(Name = "生产线")] [Display(Name = "收货单件码")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ProdLine { get; set; } public string SingleCodeJob { get; set; }
/// <summary> /// <summary>
/// 使用在途库 /// 使用在途库

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/ThirdLocationJobs/ThirdLocationJobPermissions.cs

@ -11,7 +11,7 @@ public static class ThirdLocationJobPermissions
public const string Update = Default + "." + StorePermissions.UpdateStr; public const string Update = Default + "." + StorePermissions.UpdateStr;
public const string Delete = Default + "." + StorePermissions.DeleteStr; public const string Delete = Default + "." + StorePermissions.DeleteStr;
//自动发料任务
public const string AutoThirdLocationJob = StorePermissions.GroupName + "." + nameof(AutoThirdLocationJob); public const string AutoThirdLocationJob = StorePermissions.GroupName + "." + nameof(AutoThirdLocationJob);
public static void AddThirdLocationJobPermission(this PermissionGroupDefinition permissionGroup) public static void AddThirdLocationJobPermission(this PermissionGroupDefinition permissionGroup)

7
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/DTOs/ThirdLocationRequestDTO.cs

@ -1,4 +1,5 @@
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using Win_in.Sfs.Shared.Domain.Entities;
namespace Win_in.Sfs.Wms.Store.Application.Contracts; namespace Win_in.Sfs.Wms.Store.Application.Contracts;
@ -11,10 +12,10 @@ public class ThirdLocationRequestDTO : SfsStoreRequestDTOBase<ThirdLocationReque
public string Type { get; set; } public string Type { get; set; }
/// <summary> /// <summary>
/// 生产线 /// 申请单件码
/// </summary> /// </summary>
[Display(Name = "生产线")] [IgnoreUpdate]
public string ProdLine { get; set; } public string SingleCodeRequest { get; set; }
/// <summary> /// <summary>
/// 是否使用在途库 /// 是否使用在途库

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/Inputs/ThirdLocationRequestEditInput.cs

@ -9,11 +9,11 @@ public class ThirdLocationRequestEditInput : SfsStoreRequestCreateOrUpdateInputB
#region Base #region Base
/// <summary> /// <summary>
/// 生产线 /// 申请单件码
/// </summary> /// </summary>
[Display(Name = "生产线")] [Display(Name = "生产线")]
[StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")] [StringLength(SfsEfCorePropertyConst.CodeLength, ErrorMessage = "{0}最多输入{1}个字符")]
public string ProdLine { get; set; } public string SingleCodeRequest { get; set; }
/// <summary> /// <summary>
/// 使用在途库 /// 使用在途库

5
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/ThirdLocationRequestPermissions.cs

@ -11,9 +11,6 @@ public static class ThirdLocationRequestPermissions
public const string Update = Default + "." + StorePermissions.UpdateStr; public const string Update = Default + "." + StorePermissions.UpdateStr;
public const string Delete = Default + "." + StorePermissions.DeleteStr; public const string Delete = Default + "." + StorePermissions.DeleteStr;
//自动叫料申请
public const string AutoThirdLocationRequest = StorePermissions.GroupName + "." + nameof(AutoThirdLocationRequest);
public static void AddThirdLocationRequestPermission(this PermissionGroupDefinition permissionGroup) public static void AddThirdLocationRequestPermission(this PermissionGroupDefinition permissionGroup)
{ {
var thirdLocationRequestPermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(ThirdLocationRequest))); var thirdLocationRequestPermission = permissionGroup.AddPermission(Default, StorePermissionDefinitionProvider.L(nameof(ThirdLocationRequest)));
@ -21,7 +18,5 @@ public static class ThirdLocationRequestPermissions
thirdLocationRequestPermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr)); thirdLocationRequestPermission.AddChild(Update, StorePermissionDefinitionProvider.L(StorePermissions.UpdateStr));
thirdLocationRequestPermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr)); thirdLocationRequestPermission.AddChild(Delete, StorePermissionDefinitionProvider.L(StorePermissions.DeleteStr));
permissionGroup.AddPermission(AutoThirdLocationRequest, StorePermissionDefinitionProvider.L(nameof(AutoThirdLocationRequest)));
} }
} }

13
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Notes/TransferNotes/TransferNoteAppService.cs

@ -11,6 +11,7 @@ using Volo.Abp.Application.Dtos;
using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Basedata.Domain.Shared; using Win_in.Sfs.Basedata.Domain.Shared;
using Win_in.Sfs.Basedata.SplitPackings.Commons; using Win_in.Sfs.Basedata.SplitPackings.Commons;
using Win_in.Sfs.Label.Application.Contracts;
using Win_in.Sfs.Shared.Domain; using Win_in.Sfs.Shared.Domain;
using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Inventory.Application.Contracts; using Win_in.Sfs.Wms.Inventory.Application.Contracts;
@ -40,7 +41,7 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
private readonly IIssueJobAppService _issueJobAppService; //发料 private readonly IIssueJobAppService _issueJobAppService; //发料
private readonly IExpectOutAppService _expectOutAppService; // private readonly IExpectOutAppService _expectOutAppService; //
private readonly IInventoryLabelAppService _inventoryLabelAppService;
@ -55,6 +56,7 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
IPurchaseReceiptRequestAppService purchaseReceiptRequestAppService, IPurchaseReceiptRequestAppService purchaseReceiptRequestAppService,
IInspectJobAppService inspectJobAppService, IInspectJobAppService inspectJobAppService,
IIssueJobAppService issueJobAppService, IIssueJobAppService issueJobAppService,
IInventoryLabelAppService inventoryLabelAppService,
IExpectOutAppService expectOutAppService) : base(repository) IExpectOutAppService expectOutAppService) : base(repository)
{ {
_transferNoteManager = transferNoteManager; _transferNoteManager = transferNoteManager;
@ -65,6 +67,7 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
_purchaseReceiptRequestAppService = purchaseReceiptRequestAppService; _purchaseReceiptRequestAppService = purchaseReceiptRequestAppService;
_inspectJobAppService = inspectJobAppService; _inspectJobAppService = inspectJobAppService;
_issueJobAppService = issueJobAppService; _issueJobAppService = issueJobAppService;
_inventoryLabelAppService = inventoryLabelAppService;
_expectOutAppService = expectOutAppService; _expectOutAppService = expectOutAppService;
} }
@ -415,6 +418,7 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
foreach (var inputDetail in transferNoteEditInput.Details) foreach (var inputDetail in transferNoteEditInput.Details)
{ {
SplitPackingRecEditInput packRec = new SplitPackingRecEditInput(); SplitPackingRecEditInput packRec = new SplitPackingRecEditInput();
packRec.OprType = OprTypeEnum.SplitBox; packRec.OprType = OprTypeEnum.SplitBox;
packRec.FromPackingCode = inputDetail.FromPackingCode; packRec.FromPackingCode = inputDetail.FromPackingCode;
//packRec.FromTopPackingCode = inputDetail.; //packRec.FromTopPackingCode = inputDetail.;
@ -444,6 +448,13 @@ public class TransferNoteAppService : SfsStoreWithDetailsAppServiceBase
packRec.FromQty = updateJobDetailInput.FromQty; packRec.FromQty = updateJobDetailInput.FromQty;
packRec.ToQty = updateJobDetailInput.ToQty; packRec.ToQty = updateJobDetailInput.ToQty;
} }
//根据箱码在inventoryLabel取采购订单、供应商发货单
var inventoryLabelDto = await _inventoryLabelAppService.GetByCodeAsync(inputDetail.FromPackingCode).ConfigureAwait(false);
if (inventoryLabelDto != null)
{
packRec.PurchaseInfo_PoNumber = inventoryLabelDto.PoNumber;
packRec.PurchaseInfo_AsnNumber = inventoryLabelDto.AsnNumber;
}
recLst.Add(packRec); recLst.Add(packRec);
} }
var ret = await _splitPackingRecAppService.BatchInsertAsync(recLst).ConfigureAwait(false); var ret = await _splitPackingRecAppService.BatchInsertAsync(recLst).ConfigureAwait(false);

41
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAppService.cs

@ -47,9 +47,11 @@ public class ThirdLocationRequestAppService : SfsStoreRequestAppServiceBase<Thir
private readonly ITransactionTypeAppService _transactionTypeAppService; private readonly ITransactionTypeAppService _transactionTypeAppService;
private readonly IExpectOutAppService _expectOutAppService; private readonly IExpectOutAppService _expectOutAppService;
private readonly IBalanceAppService _balanceAppService; private readonly IBalanceAppService _balanceAppService;
private readonly IThirdLocationJobAppService _thirdLocationJobAppService;
public ThirdLocationRequestAppService( public ThirdLocationRequestAppService(
IThirdLocationRequestRepository repository, IThirdLocationRequestRepository repository,
IThirdLocationJobAppService thirdLocationJobAppService,
IThirdLocationRequestManager thirdLocationRequestManager, IThirdLocationRequestManager thirdLocationRequestManager,
IPreparationPlanManager preparationPlanManager, IPreparationPlanManager preparationPlanManager,
IItemStoreRelationAppService itemStoreRelationApp, IItemStoreRelationAppService itemStoreRelationApp,
@ -73,6 +75,7 @@ public class ThirdLocationRequestAppService : SfsStoreRequestAppServiceBase<Thir
_transactionTypeAppService = transactionTypeAppService; _transactionTypeAppService = transactionTypeAppService;
_expectOutAppService= expectOutAppService; _expectOutAppService= expectOutAppService;
_balanceAppService= balanceAppService; _balanceAppService= balanceAppService;
_thirdLocationJobAppService= thirdLocationJobAppService;
} }
@ -191,6 +194,44 @@ public class ThirdLocationRequestAppService : SfsStoreRequestAppServiceBase<Thir
return dto; return dto;
} }
/// <summary>
/// 用来重写 取消请求
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
public override async Task<ThirdLocationRequestDTO> CancelAsync(Guid id)
{
var request = await _repository.GetAsync(id).ConfigureAwait(false);
var list = await _thirdLocationJobAppService.GetByRequestNumberAsync(request.Number).ConfigureAwait(false);
if (list.Any())
{
foreach (var thirdLocationJobDto in list)
{
if (thirdLocationJobDto.JobStatus == EnumJobStatus.Open ||
thirdLocationJobDto.JobStatus == EnumJobStatus.Partial ||
thirdLocationJobDto.JobStatus == EnumJobStatus.Doing ||
thirdLocationJobDto.JobStatus == EnumJobStatus.Wait)
{
await _thirdLocationJobAppService.CancelAsync(thirdLocationJobDto.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<ThirdLocationRequest, ThirdLocationRequestDTO>(request);
}
/// <summary> /// <summary>
/// 赋值Request业务属性 /// 赋值Request业务属性
/// </summary> /// </summary>

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAutoMapperProfile.cs

@ -29,7 +29,7 @@ public partial class StoreApplicationAutoMapperProfile : Profile
CreateMap<ThirdLocationRequestImportInput, ThirdLocationRequest>() CreateMap<ThirdLocationRequestImportInput, ThirdLocationRequest>()
.IgnoreAuditedObjectProperties() .IgnoreAuditedObjectProperties()
.ForMember(x => x.Type, y => y.MapFrom(t => t.Type.ToString())) .ForMember(x => x.Type, y => y.MapFrom(t => t.Type.ToString()))
.Ignore(x => x.ProdLine) .Ignore(x => x.SingleCodeRequest)
.Ignore(x => x.UseOnTheWayLocation) .Ignore(x => x.UseOnTheWayLocation)
.Ignore(x => x.Details) .Ignore(x => x.Details)
.Ignore(x => x.Remark) .Ignore(x => x.Remark)

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

@ -19,10 +19,10 @@ public class ThirdLocationJob : SfsJobAggregateRootBase<ThirdLocationJobDetail>
public string RequestType { get; set; } public string RequestType { get; set; }
/// <summary> /// <summary>
/// 生产线 /// 收货单件码
/// </summary> /// </summary>
[IgnoreUpdate] [IgnoreUpdate]
public string ProdLine { get; set; } public string SingleCodeJob { get; set; }
/// <summary> /// <summary>
/// 请求单号 /// 请求单号

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequest.cs

@ -17,10 +17,10 @@ public class ThirdLocationRequest : SfsStoreRequestAggregateRootBase<ThirdLocati
public string Type { get; set; } public string Type { get; set; }
/// <summary> /// <summary>
/// 生产线 /// 申请单件码
/// </summary> /// </summary>
[IgnoreUpdate] [IgnoreUpdate]
public string ProdLine { get; set; } public string SingleCodeRequest { get; set; }
/// <summary> /// <summary>
/// 使用在途库 /// 使用在途库

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

@ -24,7 +24,7 @@ public static class ThirdLocationJobDbContextModelCreatingExtensions
b.Property(q => q.RequestType).HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.RequestType).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.RequestNumber).HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.RequestNumber).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.Workshop).HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.Workshop).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ProdLine).HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.SingleCodeJob).HasMaxLength(SfsPropertyConst.CodeLength);
//Relations //Relations
b.HasMany(q => q.Details).WithOne().HasForeignKey(d => d.MasterID).IsRequired(); b.HasMany(q => q.Details).WithOne().HasForeignKey(d => d.MasterID).IsRequired();
//Indexes //Indexes

2
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ThirdLocationRequests/ThirdLocationRequestDbContextModelCreatingExtensions.cs

@ -20,7 +20,7 @@ public static class ThirdLocationRequestDbContextModelCreatingExtensions
//Properties //Properties
b.Property(q => q.Type).HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.Type).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.ProdLine).HasMaxLength(SfsPropertyConst.CodeLength); b.Property(q => q.SingleCodeRequest).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.RequestStatus).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>(); b.Property(q => q.RequestStatus).HasMaxLength(SfsPropertyConst.NameLength).HasConversion<string>();
//Relations //Relations

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

@ -38,6 +38,7 @@ public partial class StoreEventAutoMapperProfile : Profile
CreateMap<ThirdLocationRequest, ThirdLocationJobEditInput>() CreateMap<ThirdLocationRequest, ThirdLocationJobEditInput>()
.ForMember(x => x.RequestNumber, y => y.MapFrom(d => d.Number)) .ForMember(x => x.RequestNumber, y => y.MapFrom(d => d.Number))
.ForMember(x => x.RequestType, y => y.MapFrom(d => d.Type)) .ForMember(x => x.RequestType, y => y.MapFrom(d => d.Type))
.Ignore(x => x.SingleCodeJob)
.Ignore(x => x.WarehouseCode) .Ignore(x => x.WarehouseCode)
.Ignore(x => x.Workshop) .Ignore(x => x.Workshop)
.Ignore(x => x.UpStreamJobNumber) .Ignore(x => x.UpStreamJobNumber)

Loading…
Cancel
Save