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. 30
      be/Modules/BaseData/src/Win_in.Sfs.Basedata.Domain/SplitPackings/SplitPackingRecManager.cs
  2. 38
      be/Modules/Label/src/Win_in.Sfs.Label.Application/InventoryLabels/InventoryLabelAppService.cs
  3. 12
      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. 16
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ThirdLocationNoteEventHandler.cs

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

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

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

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

12
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;
using System.Threading.Tasks; using System.Threading.Tasks;
using DocumentFormat.OpenXml.Office.PowerPoint.Y2021.M06.Main; using DocumentFormat.OpenXml.Office.PowerPoint.Y2021.M06.Main;
using DocumentFormat.OpenXml.Vml.Office;
using IdentityModel; using IdentityModel;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; 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); var toLocationDto = await _locationAppService.GetByCodeAsync(detailInput.ToLocationCode).ConfigureAwait(false);
CheckLocation(toLocationDto, detailInput.ToLocationCode); CheckLocation(toLocationDto, detailInput.ToLocationCode);
@ -162,9 +163,10 @@ public class ThirdLocationRequestAppService : SfsStoreRequestAppServiceBase<Thir
throw new UserFriendlyException($"{detailInput.ItemCode} 物品的库存为 {realityBalance} ,库存不够"); throw new UserFriendlyException($"{detailInput.ItemCode} 物品的库存为 {realityBalance} ,库存不够");
} }
detailInput.ProdLine = detailInput.ToLocationCode; //detailInput.ProdLine = detailInput.ToLocationCode;
detailInput.ToLocationErpCode = toLocationDto.ErpLocationCode; detailInput.ToLocationErpCode = toLocationDto.ErpLocationCode;
detailInput.IssuedQty = detailInput.Qty;
} }
@ -222,7 +224,11 @@ public class ThirdLocationRequestAppService : SfsStoreRequestAppServiceBase<Thir
request.RequestStatus == EnumRequestStatus.New) request.RequestStatus == EnumRequestStatus.New)
{ {
request.RequestStatus = EnumRequestStatus.Cancelled; 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); await _repository.UpdateAsync(request).ConfigureAwait(false);
} }
else 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") .HasColumnType("int")
.HasDefaultValue(0); .HasDefaultValue(0);
b.Property<string>("ProdLine")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("Remark") b.Property<string>("Remark")
.HasMaxLength(3072) .HasMaxLength(3072)
.HasColumnType("nvarchar(3072)") .HasColumnType("nvarchar(3072)")
@ -27059,6 +27055,10 @@ namespace Win_in.Sfs.Wms.Store.Migrations
.HasMaxLength(64) .HasMaxLength(64)
.HasColumnType("nvarchar(64)"); .HasColumnType("nvarchar(64)");
b.Property<string>("SingleCodeJob")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<Guid?>("TenantId") b.Property<Guid?>("TenantId")
.HasColumnType("uniqueidentifier") .HasColumnType("uniqueidentifier")
.HasColumnName("TenantId"); .HasColumnName("TenantId");
@ -27830,10 +27830,6 @@ namespace Win_in.Sfs.Wms.Store.Migrations
.HasColumnType("nvarchar(64)") .HasColumnType("nvarchar(64)")
.HasColumnName("Number"); .HasColumnName("Number");
b.Property<string>("ProdLine")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<string>("Remark") b.Property<string>("Remark")
.HasMaxLength(3072) .HasMaxLength(3072)
.HasColumnType("nvarchar(3072)") .HasColumnType("nvarchar(3072)")
@ -27844,6 +27840,10 @@ namespace Win_in.Sfs.Wms.Store.Migrations
.HasMaxLength(64) .HasMaxLength(64)
.HasColumnType("nvarchar(64)"); .HasColumnType("nvarchar(64)");
b.Property<string>("SingleCodeRequest")
.HasMaxLength(64)
.HasColumnType("nvarchar(64)");
b.Property<Guid?>("TenantId") b.Property<Guid?>("TenantId")
.HasColumnType("uniqueidentifier") .HasColumnType("uniqueidentifier")
.HasColumnName("TenantId"); .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 : public class ThirdLocationJobEventHandler :
StoreEventHandlerBase StoreEventHandlerBase
, ILocalEventHandler<SfsCompletedEntityEventData<ThirdLocationJob>> , ILocalEventHandler<SfsCompletedEntityEventData<ThirdLocationJob>>,ILocalEventHandler<SfsCancelledEntityEventData<ThirdLocationJob>>
{ {
private const EnumTransType TransType = EnumTransType.Issue; private const EnumTransType TransType = EnumTransType.Issue;
@ -90,6 +90,20 @@ public class ThirdLocationJobEventHandler :
return thirdLocationNoteCreateInput; 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>
/// 去除箱码 托码 批次 /// 去除箱码 托码 批次
/// </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;
using Volo.Abp.EventBus; using Volo.Abp.EventBus;
using Volo.Abp.SettingManagement; using Volo.Abp.SettingManagement;
using Volo.Abp.Uow;
using Win_in.Sfs.Basedata.Application.Contracts; using Win_in.Sfs.Basedata.Application.Contracts;
using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Shared.Event; using Win_in.Sfs.Shared.Event;
@ -25,6 +26,7 @@ public class ThirdLocationRequestEventHandler
, ILocalEventHandler<SfsAbortedEntityEventData<ThirdLocationRequest>> , ILocalEventHandler<SfsAbortedEntityEventData<ThirdLocationRequest>>
, ILocalEventHandler<SfsCompletedEntityEventData<ThirdLocationRequest>> , ILocalEventHandler<SfsCompletedEntityEventData<ThirdLocationRequest>>
, ILocalEventHandler<SfsCreatedEntityEventData<ThirdLocationRequest>> , ILocalEventHandler<SfsCreatedEntityEventData<ThirdLocationRequest>>
, ILocalEventHandler<SfsCancelledEntityEventData<ThirdLocationRequest>>
, ILocalEventHandler<SfsCreatedEntityEventData<List<ThirdLocationRequest>>> , ILocalEventHandler<SfsCreatedEntityEventData<List<ThirdLocationRequest>>>
{ {
private readonly IThirdLocationJobAppService _thirdLocationJobAppService; private readonly IThirdLocationJobAppService _thirdLocationJobAppService;
@ -105,7 +107,6 @@ public class ThirdLocationRequestEventHandler
: 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);
} }
@ -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> /// <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>
/// 完成后 /// 完成后
/// </summary> /// </summary>

16
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) 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; item.ReceivedQty = entity.Details[0].HandledQty;
} }
await _thirdLocationRequestManager.CompleteAsync(entities[0]).ConfigureAwait(false); 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