From cb9ac524a3e33b979f54eb56623027b4c0c76284 Mon Sep 17 00:00:00 2001
From: zhouhongjun <565221961@qq.com>
Date: Fri, 12 Apr 2024 10:55:56 +0800
Subject: [PATCH] =?UTF-8?q?=E5=8F=96=E6=B6=88=E7=94=B3=E8=AF=B7=E6=98=8E?=
=?UTF-8?q?=E7=BB=86=E7=8A=B6=E6=80=81=E5=AD=97=E6=AE=B5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../PublishProfiles/FolderProfile1.pubxml | 6 +-
.../DTOs/ThirdLocationRequestDetailDTO.cs | 7 +-
.../Inputs/ThirdLocationRequestDetailInput.cs | 7 +-
.../ThirdLocationRequestAutoMapperProfile.cs | 3 +-
.../ThirdLocationRequestDetail.cs | 5 +-
.../ThirdLocationRequestManager.cs | 77 ++++++++++---------
...RequestDbContextModelCreatingExtensions.cs | 3 +-
.../ThirdLocationRequestEventHandler.cs | 32 +-------
.../ThirdLocationNoteEventHandler.cs | 11 ++-
9 files changed, 62 insertions(+), 89 deletions(-)
diff --git a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Properties/PublishProfiles/FolderProfile1.pubxml b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Properties/PublishProfiles/FolderProfile1.pubxml
index 36847ea03..2cc64724c 100644
--- a/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Properties/PublishProfiles/FolderProfile1.pubxml
+++ b/be/Hosts/Wms.Host/Win_in.Sfs.Wms.Store.HttpApi.Host/Properties/PublishProfiles/FolderProfile1.pubxml
@@ -10,8 +10,12 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
Release
Any CPU
FileSystem
- bin\Release\net6.0\publish\
+ D:\发布\WMS\store
FileSystem
<_TargetId>Folder
+
+ net6.0
+ 488eeada-cfed-4016-9884-7a1dcbe5eb9c
+ false
\ No newline at end of file
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/DTOs/ThirdLocationRequestDetailDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/DTOs/ThirdLocationRequestDetailDTO.cs
index 92b149911..7b205cdaa 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/DTOs/ThirdLocationRequestDetailDTO.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/DTOs/ThirdLocationRequestDetailDTO.cs
@@ -43,12 +43,7 @@ public class ThirdLocationRequestDetailDTO : SfsStoreDetailWithQtyDTOBase
///
[Display(Name = "已收数量")]
public decimal ReceivedQty { get; set; }
-
- ///
- /// 明细状态
- ///
- [Display(Name = "明细状态")]
- public EnumStatus Status { get; set; }
+
///
/// 请求未发
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/Inputs/ThirdLocationRequestDetailInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/Inputs/ThirdLocationRequestDetailInput.cs
index b6294d8cd..aec149364 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/Inputs/ThirdLocationRequestDetailInput.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Requests/ThirdLocationRequests/Inputs/ThirdLocationRequestDetailInput.cs
@@ -71,12 +71,7 @@ public class ThirdLocationRequestDetailInput : SfsStoreDetailWithQtyInputBase
///
[Display(Name = "已收数量")]
public decimal ReceivedQty { get; set; }
-
- ///
- /// 明细状态
- ///
- [Display(Name = "明细状态")]
- public EnumStatus Status { get; set; }
+
///
/// 位置码
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAutoMapperProfile.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAutoMapperProfile.cs
index 856be3ddf..e8965b174 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAutoMapperProfile.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Requests/ThirdLocationRequests/ThirdLocationRequestAutoMapperProfile.cs
@@ -42,8 +42,7 @@ public partial class StoreApplicationAutoMapperProfile : Profile
.Ignore(x => x.Remark);
CreateMap()
- .IgnoreAuditedObjectProperties()
- .ForMember(x => x.Status, y => y.MapFrom(t => EnumStatus.Open))
+ .IgnoreAuditedObjectProperties()
.Ignore(x => x.ToLocationErpCode)
.Ignore(x => x.ToWarehouseCode)
.Ignore(x => x.ToLocationArea)
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestDetail.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestDetail.cs
index f3f221923..dbea45ed9 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestDetail.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestDetail.cs
@@ -77,10 +77,7 @@ public class ThirdLocationRequestDetail : SfsStoreDetailWithQtyEntityBase, IHasT
///
public decimal ReceivedQty { get; set; }
- ///
- /// 明细状态
- ///
- public EnumStatus Status { get; set; }
+
///
/// 请求未发 还未发送的数量
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestManager.cs
index c9d45a6dc..1586bfcf3 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestManager.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Requests/ThirdLocationRequests/ThirdLocationRequestManager.cs
@@ -73,48 +73,49 @@ public class ThirdLocationRequestManager
private void SetMaterialRequestDetailStatus(ThirdLocationRequestDetail detail)
{
- if (detail.ReceivedQty >= detail.Qty)//执行的时候 实际收料 多余 要料数
- {
- detail.Status = EnumStatus.Close;
- }
- else
- {
- detail.Status = EnumStatus.Open;
- }
+ //if (detail.ReceivedQty >= detail.Qty)//执行的时候 实际收料 多余 要料数
+ //{
+ // detail.Status = EnumStatus.Close;
+ //}
+ //else
+ //{
+ // detail.Status = EnumStatus.Open;
+ //}
}
private async Task SetMaterialRequestStatusAsync(ThirdLocationRequest materialRequest)
{
- if (materialRequest.Details.All(p => p.Status == EnumStatus.Close))
- {
- materialRequest.RequestStatus = EnumRequestStatus.Completed;
- }
- else
- {
- var issueJobs = await _issueJobRepository.GetListAsync(t => t.MaterialRequestNumber == materialRequest.Number).ConfigureAwait(false);
- if (issueJobs.Count > 0)
- {
- if (issueJobs.All(t => t.JobStatus is EnumJobStatus.Done or EnumJobStatus.Closed or EnumJobStatus.Cancelled))
- {
- if (materialRequest.Details.All(p => p.ReceivedQty >= p.Qty))
- {
- materialRequest.RequestStatus = EnumRequestStatus.Completed;
- }
- else
- {
- materialRequest.RequestStatus = EnumRequestStatus.Partial;
- }
- }
- else
- {
- materialRequest.RequestStatus = EnumRequestStatus.Partial;
- }
- }
- else
- {
- materialRequest.RequestStatus = EnumRequestStatus.Partial;
- }
- }
+ //if (materialRequest.Details.All(p => p.Status == EnumStatus.Close))
+ //{
+ // materialRequest.RequestStatus = EnumRequestStatus.Completed;
+ //}
+ //else
+ //{
+ // var issueJobs = await _issueJobRepository.GetListAsync(t => t.MaterialRequestNumber == materialRequest.Number).ConfigureAwait(false);
+ // if (issueJobs.Count > 0)
+ // {
+ // if (issueJobs.All(t => t.JobStatus is EnumJobStatus.Done or EnumJobStatus.Closed or EnumJobStatus.Cancelled))
+ // {
+ // if (materialRequest.Details.All(p => p.ReceivedQty >= p.Qty))
+ // {
+ // materialRequest.RequestStatus = EnumRequestStatus.Completed;
+ // }
+ // else
+ // {
+ // materialRequest.RequestStatus = EnumRequestStatus.Partial;
+ // }
+ // }
+ // else
+ // {
+ // materialRequest.RequestStatus = EnumRequestStatus.Partial;
+ // }
+ // }
+ // else
+ // {
+ // materialRequest.RequestStatus = EnumRequestStatus.Partial;
+ // }
+ //}
+
}
public virtual async Task CompleteAsync(string number)
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ThirdLocationRequests/ThirdLocationRequestDbContextModelCreatingExtensions.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ThirdLocationRequests/ThirdLocationRequestDbContextModelCreatingExtensions.cs
index f6a4a922f..ea0364046 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ThirdLocationRequests/ThirdLocationRequestDbContextModelCreatingExtensions.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.EntityFrameworkCore/Requests/ThirdLocationRequests/ThirdLocationRequestDbContextModelCreatingExtensions.cs
@@ -53,8 +53,7 @@ public static class ThirdLocationRequestDbContextModelCreatingExtensions
b.Property(q => q.ProdLine).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.WorkStation).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();
+ b.Property(q => q.ReceivedQty).HasPrecision(18, 6);
b.Property(q => q.PositionCode).HasMaxLength(SfsPropertyConst.CodeLength);
b.Property(q => q.RecommendType).HasMaxLength(SfsPropertyConst.NameLength).HasConversion();
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ThirdLocationRequestEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ThirdLocationRequestEventHandler.cs
index ec4586e0c..d5d1702be 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ThirdLocationRequestEventHandler.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Requests/ThirdLocationRequestEventHandler.cs
@@ -256,38 +256,12 @@ public class ThirdLocationRequestEventHandler
jobs.Add(job);
}
job.Details.AddRange(jobDetails);
- if (thirdLocationRequestDetail.ToBeIssuedQty < 0)
- {
- thirdLocationRequestDetail.Status = EnumStatus.Close;
- }
+
}
jobs = jobs.Where(p => p.Details.Any()).ToList();
-
- var openRequestDetails =
- thirdLocationRequest.Details.Where(p => p.Status != EnumStatus.Close).ToList();
-
- if (!openRequestDetails.Any())
- {
- return jobs;
- }
-
-
- var enableMultipleCreateThirdLocationJob = await SettingManager.IsTrueAsync(StoreSettings.MaterialRequest.EnableMultipleCreateIssueJob).ConfigureAwait(false);
- if (enableMultipleCreateThirdLocationJob)
- {
-
- //thirdLocationRequest.Partial();
- }
- else
- {
- var sb = new StringBuilder();
- foreach (var openRequestDetail in openRequestDetails)
- {
- sb.AppendLine($"{openRequestDetail.ItemCode}请求数量 {openRequestDetail.Qty},可用库存数量 {openRequestDetail.IssuedQty}");
- }
- throw new UserFriendlyException($"{sb} 可用库存数量不足, 无法生成发料任务");
- }
+
+
return jobs;
}
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ThirdLocationNoteEventHandler.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ThirdLocationNoteEventHandler.cs
index 2199cfc75..c46ab6697 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ThirdLocationNoteEventHandler.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/Transactions/ThirdLocationNoteEventHandler.cs
@@ -22,10 +22,13 @@ public class ThirdLocationNoteEventHandler
private const EnumTransType TransType = EnumTransType.TransferLib;
private readonly ILocationAppService _locationAppService;
+ private readonly IThirdLocationRequestManager _thirdLocationRequestManager;
- public ThirdLocationNoteEventHandler(ILocationAppService locationAppService)
+ public ThirdLocationNoteEventHandler(ILocationAppService locationAppService
+ , IThirdLocationRequestManager thirdLocationRequestManager)
{
_locationAppService = locationAppService;
+ _thirdLocationRequestManager = thirdLocationRequestManager;
}
[UnitOfWork]
@@ -39,6 +42,12 @@ public class ThirdLocationNoteEventHandler
await TransferLogAppService.AddManyAsync(transferLogs).ConfigureAwait(false);
+
+ if (!string.IsNullOrEmpty(entity.RequestNumber))
+ {
+ var thirdLocationRequest = await _thirdLocationRequestManager.GetByNumberAsync(entity.RequestNumber).ConfigureAwait(false);
+ await _thirdLocationRequestManager.CompleteAsync(thirdLocationRequest).ConfigureAwait(false);
+ }
}
[UnitOfWork]