From 1d56579516dd80faf368fc84b3a09f4566d62bdf Mon Sep 17 00:00:00 2001
From: lvzb <35200379@qq.com>
Date: Wed, 24 Apr 2024 15:17:29 +0800
Subject: [PATCH] =?UTF-8?q?=E7=9B=98=E7=82=B9=E4=BF=AE=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Jobs/CountJobs/DTOs/CountJobDetailDTO.cs | 4 ++++
.../Jobs/CountJobs/Inputs/CountJobDetailInput.cs | 4 ++++
.../Jobs/CountJobs/CountJobAppService.cs | 6 ++++--
.../Jobs/CountJobs/CountJobManager.cs | 5 +++--
.../Plans/CountPlans/CountPlanManager.cs | 4 ++--
.../AutoMapperProfiles/Plans/CountPlanAutoMapperProfile.cs | 1 +
6 files changed, 18 insertions(+), 6 deletions(-)
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/DTOs/CountJobDetailDTO.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/DTOs/CountJobDetailDTO.cs
index 6af1900f5..3e38e5911 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/DTOs/CountJobDetailDTO.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/DTOs/CountJobDetailDTO.cs
@@ -6,6 +6,10 @@ namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class CountJobDetailDTO : SfsJobDetailDTOBase, IHasCountResult
{
+ ///
+ /// 盘点计划单号
+ ///
+ public string CountPlanNumber { get; set; }
///
/// 盘点次数
///
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/Inputs/CountJobDetailInput.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/Inputs/CountJobDetailInput.cs
index ecb2add71..f87de249d 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/Inputs/CountJobDetailInput.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/Inputs/CountJobDetailInput.cs
@@ -6,6 +6,10 @@ namespace Win_in.Sfs.Wms.Store.Application.Contracts;
public class CountJobDetailInput : SfsJobDetailInputBase, IHasCountResult
{
+ ///
+ /// 盘点计划单号
+ ///
+ public string CountPlanNumber { 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 22d302bc3..aa6121da5 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
@@ -4,7 +4,9 @@ using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
+using Microsoft.EntityFrameworkCore;
using Volo.Abp;
+using Volo.Abp.Domain.Repositories;
using Volo.Abp.Validation;
using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Application.Contracts;
@@ -115,8 +117,8 @@ public class CountJobAppService
[HttpPost("get-countjob-dependent-detail-by-plannumber")]
public virtual async Task> GetCountJobDependentDetailByPlanNumber(string countPlanNumber, int inventoryStage)
{
- var entities = await _repository.GetListAsync(p => p.JobStatus == EnumJobStatus.Done && p.CountPlanNumber == countPlanNumber && p.InventoryStage == inventoryStage, true).ConfigureAwait(false);
-
+ // var entities = await _repository.GetListAsync(p => p.JobStatus == EnumJobStatus.Doing && p.CountPlanNumber == countPlanNumber && p.InventoryStage == inventoryStage, true).ConfigureAwait(false);
+ var entities = await (await _repository.WithDetailsAsync().ConfigureAwait(false)).Where(p => p.JobStatus == EnumJobStatus.Doing && p.CountPlanNumber == countPlanNumber && p.InventoryStage == inventoryStage).AsNoTracking().ToListAsync().ConfigureAwait(false);
for (int i = entities.Count - 1; i >= 0; i--)
{
var entitie = entities[i];
diff --git a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJobManager.cs b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJobManager.cs
index b4971e30d..102df0668 100644
--- a/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJobManager.cs
+++ b/be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJobManager.cs
@@ -65,6 +65,7 @@ public class CountJobManager : SfsJobManagerBase, ICou
job.AddDetails(newDetails);
}
await _repository.UpdateManyAsync(joblist).ConfigureAwait(false);
+ await _noteRepository.DeleteAsync(r => numbers.Contains(r.CountJobNumber)).ConfigureAwait(false);
await LocalEventBus.PublishAsync(new SfsSubmittedEntityEventData>(joblist), false).ConfigureAwait(false);
return joblist;
}
@@ -74,7 +75,7 @@ public class CountJobManager : SfsJobManagerBase, ICou
CountJobDetail newDetail = new CountJobDetail();
newDetail.SetIdAndNumber(GuidGenerator, job.Id, job.Number);
newDetail.CountPlanNumber = job.CountPlanNumber;
- newDetail.CountLabel = GuidGenerator.Create().ToString();
+ newDetail.CountLabel = job.CountLabel;
newDetail.InventoryQty = job.InventoryQty;
newDetail.InventoryStage = job.InventoryStage+1;
newDetail.Uom = job.Uom;
@@ -205,7 +206,7 @@ public class CountJobManager : SfsJobManagerBase, ICou
if (entityDetail == null || entityDetail.Id == Guid.Empty)
{
- var jobDetail = ObjectMapper.Map(detail);
+ var jobDetail = ObjectMapper.Map(detail);
entity.AddDetail(jobDetail);
}
else
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 3306c2ad6..c3fc2bd91 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
@@ -293,10 +293,10 @@ public class CountPlanManager : SfsStoreRequestManagerBaser.Number==number).ConfigureAwait(false);
entity.RequestStatus = EnumRequestStatus.Handling;
+ entity.InventoryStage++;
entity.Details.ForEach(p=>
{
p.DetailStatus = EnumCountStatus.New;
-
});
}
///
@@ -348,7 +348,7 @@ public class CountPlanManager : SfsStoreRequestManagerBase x.InventoryUom)
//.Ignore(x => x.InventoryQty)
.ForMember(x => x.InventoryLocationCode, y => y.MapFrom(d => d.LocationCode))
+ .ForMember(x => x.CountPlanNumber, y => y.MapFrom(d => d.Number))
.Ignore(x => x.CountQty)
.Ignore(x => x.CountTime)
.Ignore(x => x.CountOperator)