Browse Source

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

dev_DY_CC
lvzb 12 months ago
parent
commit
1cd0fb4122
  1. 18
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SplitPackings/SplitPackingRecManager.cs
  2. 30
      be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAppService.cs
  3. 10
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAppService.cs
  4. 34515
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240522060125_Update_ThirdLocation.Designer.cs
  5. 35
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240522060125_Update_ThirdLocation.cs
  6. 16
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/StoreDbContextModelSnapshot.cs
  7. 16
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/ThirdLocationJobEventHandler.cs
  8. 60
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ThirdLocationRequestEventHandler.cs
  9. 14
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ThirdLocationNoteEventHandler.cs

18
be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SplitPackings/SplitPackingRecManager.cs

@ -200,14 +200,32 @@ public class SplitPackingRecManager : DomainService, ISplitPackingRecManager
{
var historyRec = historyQuery.Where(itm => itm.FromPackingCode == obj.FromPackingCode).OrderBy(itm => itm.CreationTime).FirstOrDefault();
if (historyRec != null)
{
if (historyRec.PurchaseInfo_PoNumber.HasValue())
{
obj.PurchaseInfo_PoNumber = historyRec.PurchaseInfo_PoNumber; //采购订单
}
if (historyRec.PurchaseInfo_AsnNumber.HasValue())
{
obj.PurchaseInfo_AsnNumber = historyRec.PurchaseInfo_AsnNumber; //供应商发货单
}
if (historyRec.ArrivalNoticNumber.HasValue())
{
obj.ArrivalNoticNumber = historyRec.ArrivalNoticNumber; //到货通知
}
if (historyRec.TaskOrderNumber.HasValue())
{
obj.TaskOrderNumber = historyRec.TaskOrderNumber; //任务单
}
if (historyRec.ReceiptRecNumber.HasValue())
{
obj.ReceiptRecNumber = historyRec.ReceiptRecNumber; //收货记录单
}
if (historyRec.PutOnShelfNumber.HasValue())
{
obj.PutOnShelfNumber = historyRec.PutOnShelfNumber; //上架单
}
}
//else
//{
// historyRec = historyQuery.Where(itm => itm.ToPackingCode == obj.ToPackingCode).OrderBy(itm => itm.CreationTime).FirstOrDefault();

30
be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAppService.cs

@ -133,6 +133,8 @@ public class InventoryLabelAppService
[UnitOfWork]
public virtual async Task<List<InventoryLabelDto>> CreateManyByNoCodeAsync(List<InventoryLabelEditInput> inputs)
{
await InsertSplitBoxRecAsync(inputs).ConfigureAwait(false); //插入拆箱记录表
var entitys = ObjectMapper.Map<List<InventoryLabelEditInput>, List<InventoryLabel>>(inputs);
await _repository.InsertManyAsync(entitys).ConfigureAwait(false);
return ObjectMapper.Map<List<InventoryLabel>, List<InventoryLabelDto>>(entitys);
@ -149,10 +151,24 @@ public class InventoryLabelAppService
[UnitOfWork]
public virtual async Task<List<InventoryLabelDto>> CreateManyByNoCode_NewAsync(List<InventoryLabelEditInput> inputs)
{
#region 插入拆箱记录表
foreach (var inputObj in inputs)
await InsertSplitBoxRecAsync(inputs).ConfigureAwait(false); //插入拆箱记录表
var entitys = ObjectMapper.Map<List<InventoryLabelEditInput>, List<InventoryLabel>>(inputs);
await _repository.InsertManyAsync(entitys).ConfigureAwait(false);
return ObjectMapper.Map<List<InventoryLabel>, List<InventoryLabelDto>>(entitys);
}
/// <summary>
/// 插入拆箱记录表
/// </summary>
/// <param name="inputs">InventoryLabelEditInput列表</param>
/// <returns></returns>
/// <exception cref="UserFriendlyException"></exception>
private async Task InsertSplitBoxRecAsync(List<InventoryLabelEditInput> inputs)
{
List<SplitPackingRecEditInput> recLst = new List<SplitPackingRecEditInput>();
foreach (var inputObj in inputs)
{
SplitPackingRecEditInput packRec = new SplitPackingRecEditInput();
packRec.OprType = OprTypeEnum.Other;
packRec.FromPackingCode = inputObj.Code;
@ -178,17 +194,13 @@ public class InventoryLabelAppService
packRec.ReceiptRecNumber = null; //收货记录单
packRec.PutOnShelfNumber = null; //上架单
recLst.Add(packRec);
}
bool bo = await _splitPackingRecAppService.BatchInsertAsync(recLst).ConfigureAwait(false);
if (bo == false)
{
throw new UserFriendlyException("调用插入拆箱记录表方法时返回假!");
}
}
#endregion
var entitys = ObjectMapper.Map<List<InventoryLabelEditInput>, List<InventoryLabel>>(inputs);
await _repository.InsertManyAsync(entitys).ConfigureAwait(false);
return ObjectMapper.Map<List<InventoryLabel>, List<InventoryLabelDto>>(entitys);
}
@ -233,6 +245,10 @@ public class InventoryLabelAppService
var createInput = ObjectMapper.Map<InventoryLabelWithoutCodeCreateInput, InventoryLabelEditInput>(input);
createInput.Code = numbers[i];
var lst = new List<InventoryLabelEditInput>();
lst.Add(createInput);
await InsertSplitBoxRecAsync(lst).ConfigureAwait(false); //插入拆箱记录表
await CheckCreatePolicyAsync().ConfigureAwait(continueOnCapturedContext: false);
var createEntity=ObjectMapper.Map<InventoryLabelEditInput, InventoryLabel>(createInput);

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

@ -6,6 +6,7 @@ using System.Linq.Expressions;
using System.Threading;
using System.Threading.Tasks;
using DocumentFormat.OpenXml.Office.PowerPoint.Y2021.M06.Main;
using DocumentFormat.OpenXml.Vml.Office;
using IdentityModel;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
@ -137,7 +138,7 @@ public class ThirdLocationRequestAppService : SfsStoreRequestAppServiceBase<Thir
}
foreach (var detailInput in input.Details) //赋值生产线
foreach (var detailInput in input.Details)
{
var toLocationDto = await _locationAppService.GetByCodeAsync(detailInput.ToLocationCode).ConfigureAwait(false);
CheckLocation(toLocationDto, detailInput.ToLocationCode);
@ -162,8 +163,9 @@ public class ThirdLocationRequestAppService : SfsStoreRequestAppServiceBase<Thir
throw new UserFriendlyException($"{detailInput.ItemCode} 物品的库存为 {realityBalance} ,库存不够");
}
detailInput.ProdLine = detailInput.ToLocationCode;
//detailInput.ProdLine = detailInput.ToLocationCode;
detailInput.ToLocationErpCode = toLocationDto.ErpLocationCode;
detailInput.IssuedQty = detailInput.Qty;
}
@ -222,7 +224,11 @@ public class ThirdLocationRequestAppService : SfsStoreRequestAppServiceBase<Thir
request.RequestStatus == EnumRequestStatus.New)
{
request.RequestStatus = EnumRequestStatus.Cancelled;
await Task.CompletedTask.ConfigureAwait(false);
await LocalEventBus.PublishAsync(new SfsCancelledEntityEventData<ThirdLocationRequest>(request), false).ConfigureAwait(false);
await _repository.UpdateAsync(request).ConfigureAwait(false);
}
else
{

34515
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240522060125_Update_ThirdLocation.Designer.cs

File diff suppressed because it is too large

35
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/20240522060125_Update_ThirdLocation.cs

@ -0,0 +1,35 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Win_in.Sfs.Wms.Store.Migrations
{
public partial class Update_ThirdLocation : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "ProdLine",
table: "Store_ThirdLocationRequest",
newName: "SingleCodeRequest");
migrationBuilder.RenameColumn(
name: "ProdLine",
table: "Job_ThirdLocationJob",
newName: "SingleCodeJob");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "SingleCodeRequest",
table: "Store_ThirdLocationRequest",
newName: "ProdLine");
migrationBuilder.RenameColumn(
name: "SingleCodeJob",
table: "Job_ThirdLocationJob",
newName: "ProdLine");
}
}
}

16
be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Migrations/StoreDbContextModelSnapshot.cs

@ -27042,10 +27042,6 @@ namespace Win_in.Sfs.Wms.Store.Migrations
.HasColumnType("int")
.HasDefaultValue(0);
b.Property<string>("ProdLine")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("Remark")
.HasMaxLength(3072)
.HasColumnType("nvarchar(3072)")
@ -27059,6 +27055,10 @@ namespace Win_in.Sfs.Wms.Store.Migrations
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("SingleCodeJob")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<Guid?>("TenantId")
.HasColumnType("uniqueidentifier")
.HasColumnName("TenantId");
@ -27830,10 +27830,6 @@ namespace Win_in.Sfs.Wms.Store.Migrations
.HasColumnType("nvarchar(64)")
.HasColumnName("Number");
b.Property<string>("ProdLine")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("Remark")
.HasMaxLength(3072)
.HasColumnType("nvarchar(3072)")
@ -27844,6 +27840,10 @@ namespace Win_in.Sfs.Wms.Store.Migrations
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("SingleCodeRequest")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<Guid?>("TenantId")
.HasColumnType("uniqueidentifier")
.HasColumnName("TenantId");

16
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Jobs/ThirdLocationJobEventHandler.cs

@ -15,7 +15,7 @@ namespace Win_in.Sfs.Wms.Store.Event.BusinessJob;
public class ThirdLocationJobEventHandler :
StoreEventHandlerBase
, ILocalEventHandler<SfsCompletedEntityEventData<ThirdLocationJob>>
, ILocalEventHandler<SfsCompletedEntityEventData<ThirdLocationJob>>,ILocalEventHandler<SfsCancelledEntityEventData<ThirdLocationJob>>
{
private const EnumTransType TransType = EnumTransType.Issue;
@ -90,6 +90,20 @@ public class ThirdLocationJobEventHandler :
return thirdLocationNoteCreateInput;
}
/// <summary>
/// 取消后
/// </summary>
/// <param name="eventData"></param>
/// <returns></returns>
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsCancelledEntityEventData<ThirdLocationJob> eventData)
{
var entity = eventData.Entity;
}
/// <summary>
/// 去除箱码 托码 批次
/// </summary>

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

@ -8,6 +8,7 @@ using IdentityServer4.Models;
using Volo.Abp;
using Volo.Abp.EventBus;
using Volo.Abp.SettingManagement;
using Volo.Abp.Uow;
using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Event;
@ -25,6 +26,7 @@ public class ThirdLocationRequestEventHandler
, ILocalEventHandler<SfsAbortedEntityEventData<ThirdLocationRequest>>
, ILocalEventHandler<SfsCompletedEntityEventData<ThirdLocationRequest>>
, ILocalEventHandler<SfsCreatedEntityEventData<ThirdLocationRequest>>
, ILocalEventHandler<SfsCancelledEntityEventData<ThirdLocationRequest>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<ThirdLocationRequest>>>
{
private readonly IThirdLocationJobAppService _thirdLocationJobAppService;
@ -105,7 +107,6 @@ public class ThirdLocationRequestEventHandler
: EnumTransferRoute.SourceToDestination;
transferLogs.AddRange(await BuildTransferLogsAsync(entity, route).ConfigureAwait(false));
await _transferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false);
}
@ -198,6 +199,46 @@ public class ThirdLocationRequestEventHandler
}
private async Task<List<TransferLogEditInput>> BuildCancelTransferLogsAsync(ThirdLocationRequest thirdLocationRequest)
{
var transferLogs = new List<TransferLogEditInput>();
foreach (var detail in thirdLocationRequest.Details.Where(detail => detail.Qty != 0))
{
var transferLog = ObjectMapper.Map<ThirdLocationRequestDetail, TransferLogEditInput>(detail);
LocationDTO fromLocationDTO = null;
LocationDTO toLocationDTO = null;
fromLocationDTO = await _locationAppService.GetByCodeAsync(detail.OnTheWayLocationCode).ConfigureAwait(false);
toLocationDTO = await _locationAppService.GetByCodeAsync(detail.FromLocationCode).ConfigureAwait(false);
transferLog.FromLocationCode = fromLocationDTO.Code;
transferLog.FromLocationArea = fromLocationDTO.AreaCode;
transferLog.FromLocationErpCode = fromLocationDTO.ErpLocationCode;
transferLog.FromLocationGroup = fromLocationDTO.LocationGroupCode;
transferLog.FromWarehouseCode = fromLocationDTO.WarehouseCode;
transferLog.ToLocationCode = toLocationDTO.Code;
transferLog.ToLocationArea = toLocationDTO.AreaCode;
transferLog.ToLocationErpCode = toLocationDTO.ErpLocationCode;
transferLog.ToLocationGroup = toLocationDTO.LocationGroupCode;
transferLog.ToWarehouseCode = toLocationDTO.WarehouseCode;
transferLog.TransSubType = Enum.Parse<EnumTransSubType>(thirdLocationRequest.Type);
transferLog.TransType = TransType;
transferLog.DocNumber = thirdLocationRequest.Number;
transferLog.JobNumber = "";
transferLog.FromPackingCode = "";
transferLog.FromLot = "";
transferLog.ToPackingCode = "";
transferLog.ToLot = "";
transferLog.FromStatus = EnumInventoryStatus.OK;
transferLog.ToStatus = EnumInventoryStatus.OK;
transferLogs.Add(transferLog);
}
return transferLogs;
}
/// <summary>
/// 驳回后
@ -209,6 +250,23 @@ public class ThirdLocationRequestEventHandler
}
/// <summary>
/// 取消后
/// </summary>
/// <param name="eventData"></param>
/// <returns></returns>
[UnitOfWork]
public virtual async Task HandleEventAsync(SfsCancelledEntityEventData<ThirdLocationRequest> eventData)
{
var entity = eventData.Entity;
var transferLogs = new List<TransferLogEditInput>();
transferLogs.AddRange(await BuildCancelTransferLogsAsync(entity).ConfigureAwait(false));
await _transferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false);
}
/// <summary>
/// 完成后
/// </summary>

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

@ -56,10 +56,22 @@ public class ThirdLocationNoteEventHandler
{
foreach (var item in entities[0].Details)
{
item.IssuedQty = entity.Details[0].RecommendQty;
//item.IssuedQty = entity.Details[0].RecommendQty;
item.ReceivedQty = entity.Details[0].HandledQty;
}
foreach(var item in entity.Details)
{
if(item.Qty == item.HandledQty)
{
await _thirdLocationRequestManager.CompleteAsync(entities[0]).ConfigureAwait(false);
}
else
{
await _thirdLocationRequestManager.UpdateAsync(entities[0]).ConfigureAwait(false);
}
}
}

Loading…
Cancel
Save