diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/Inputs/CountJobImportInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/Inputs/CountJobImportInput.cs
index f6a3f05b5..75b1e526a 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/Inputs/CountJobImportInput.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/Inputs/CountJobImportInput.cs
@@ -30,7 +30,7 @@ public class CountJobImportInput : SfsStoreImportInputBase
/// 箱码
///
[Display(Name = "箱码")]
- public string PackingCode { get; set; }
+ public string PackingCode { get; set; } = "";
///
/// 库存状态
@@ -43,7 +43,7 @@ public class CountJobImportInput : SfsStoreImportInputBase
/// 批次
///
[Display(Name = "批次")]
- public string Lot { get; set; }
+ public string Lot { get; set; } = "";
///
/// 盘点数量
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/CountJobs/CountJobAppService.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/CountJobs/CountJobAppService.cs
index f644c244f..754c7856b 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/CountJobs/CountJobAppService.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/CountJobs/CountJobAppService.cs
@@ -206,19 +206,24 @@ public class CountJobAppService
}
protected async Task CheckPackingCodeAsync(CountJobImportInput importInput, List validationRresult, string locationCode)
{
- var item = await _balanceAppService.GetByPackingCodeAsync(importInput.PackingCode).ConfigureAwait(false);
- if (item != null)
+ if (!string.IsNullOrEmpty(importInput.PackingCode))
{
- if (item.LocationCode != locationCode)
+ var item = await _balanceAppService.GetByPackingCodeAsync(importInput.PackingCode).ConfigureAwait(false);
+ if (item != null)
{
- validationRresult.Add(new ValidationResult($"箱码已经在库位{item.LocationCode}存在不能盘点", new[] { "箱码" }));
- }
- if(item.Lot!= importInput.Lot)
- {
- validationRresult.Add(new ValidationResult($"批次与库存中批次{item.Lot}不匹配不能盘点", new[] { "批次" }));
+ if (item.LocationCode != locationCode)
+ {
+ validationRresult.Add(new ValidationResult($"箱码已经在库位{item.LocationCode}存在不能盘点", new[] { "箱码" }));
+ }
+ if (item.Lot != importInput.Lot)
+ {
+ validationRresult.Add(new ValidationResult($"批次与库存中批次{item.Lot}不匹配不能盘点", new[] { "批次" }));
+ }
}
+ return item;
}
- return item;
+
+ return null;
}
protected void CheckJobNumberAsync(CountJobImportInput importInput, List validationRresult,string jobNumber)
{
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/CountPlans/CountPlanManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/CountPlans/CountPlanManager.cs
index c3fc2bd91..f60603fae 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/CountPlans/CountPlanManager.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/CountPlans/CountPlanManager.cs
@@ -321,7 +321,8 @@ public class CountPlanManager : SfsStoreRequestManagerBase p.CountLabel == planDetail.CountLabel);
+ //var entityDetail = entity.Details.FirstOrDefault(p => p.CountLabel == planDetail.CountLabel);
+ var entityDetail = entity.Details.FirstOrDefault(p => p.ItemCode == planDetail.ItemCode && p.PackingCode == planDetail.PackingCode&& p.Lot == planDetail.Lot &&p.LocationCode == planDetail.LocationCode);
if (entityDetail == null)
{
entityDetail = ObjectMapper.Map(planDetail);