Browse Source

盘点修改

dev_DY_CC
lvzb 1 year ago
parent
commit
1d56579516
  1. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/DTOs/CountJobDetailDTO.cs
  2. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application.Contracts/Jobs/CountJobs/Inputs/CountJobDetailInput.cs
  3. 6
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/CountJobs/CountJobAppService.cs
  4. 3
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJobManager.cs
  5. 4
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/CountPlans/CountPlanManager.cs
  6. 1
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Plans/CountPlanAutoMapperProfile.cs

4
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 class CountJobDetailDTO : SfsJobDetailDTOBase, IHasCountResult
{ {
/// <summary>
/// 盘点计划单号
/// </summary>
public string CountPlanNumber { get; set; }
/// <summary> /// <summary>
/// 盘点次数 /// 盘点次数
/// </summary> /// </summary>

4
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 class CountJobDetailInput : SfsJobDetailInputBase, IHasCountResult
{ {
/// <summary>
/// 盘点计划单号
/// </summary>
public string CountPlanNumber { get; set; }
/// <summary> /// <summary>
/// 盘点次数 /// 盘点次数
/// </summary> /// </summary>

6
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 System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using Volo.Abp; using Volo.Abp;
using Volo.Abp.Domain.Repositories;
using Volo.Abp.Validation; using Volo.Abp.Validation;
using Win_in.Sfs.Shared.Domain.Shared; using Win_in.Sfs.Shared.Domain.Shared;
using Win_in.Sfs.Wms.Store.Application.Contracts; using Win_in.Sfs.Wms.Store.Application.Contracts;
@ -115,8 +117,8 @@ public class CountJobAppService
[HttpPost("get-countjob-dependent-detail-by-plannumber")] [HttpPost("get-countjob-dependent-detail-by-plannumber")]
public virtual async Task<List<CountJob>> GetCountJobDependentDetailByPlanNumber(string countPlanNumber, int inventoryStage) public virtual async Task<List<CountJob>> 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--) for (int i = entities.Count - 1; i >= 0; i--)
{ {
var entitie = entities[i]; var entitie = entities[i];

3
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJobManager.cs

@ -65,6 +65,7 @@ public class CountJobManager : SfsJobManagerBase<CountJob, CountJobDetail>, ICou
job.AddDetails(newDetails); job.AddDetails(newDetails);
} }
await _repository.UpdateManyAsync(joblist).ConfigureAwait(false); await _repository.UpdateManyAsync(joblist).ConfigureAwait(false);
await _noteRepository.DeleteAsync(r => numbers.Contains(r.CountJobNumber)).ConfigureAwait(false);
await LocalEventBus.PublishAsync(new SfsSubmittedEntityEventData<List<CountJob>>(joblist), false).ConfigureAwait(false); await LocalEventBus.PublishAsync(new SfsSubmittedEntityEventData<List<CountJob>>(joblist), false).ConfigureAwait(false);
return joblist; return joblist;
} }
@ -74,7 +75,7 @@ public class CountJobManager : SfsJobManagerBase<CountJob, CountJobDetail>, ICou
CountJobDetail newDetail = new CountJobDetail(); CountJobDetail newDetail = new CountJobDetail();
newDetail.SetIdAndNumber(GuidGenerator, job.Id, job.Number); newDetail.SetIdAndNumber(GuidGenerator, job.Id, job.Number);
newDetail.CountPlanNumber = job.CountPlanNumber; newDetail.CountPlanNumber = job.CountPlanNumber;
newDetail.CountLabel = GuidGenerator.Create().ToString(); newDetail.CountLabel = job.CountLabel;
newDetail.InventoryQty = job.InventoryQty; newDetail.InventoryQty = job.InventoryQty;
newDetail.InventoryStage = job.InventoryStage+1; newDetail.InventoryStage = job.InventoryStage+1;
newDetail.Uom = job.Uom; newDetail.Uom = job.Uom;

4
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Plans/CountPlans/CountPlanManager.cs

@ -293,10 +293,10 @@ public class CountPlanManager : SfsStoreRequestManagerBase<CountPlan, CountPlanD
{ {
var entity = await Repository.GetAsync(r=>r.Number==number).ConfigureAwait(false); var entity = await Repository.GetAsync(r=>r.Number==number).ConfigureAwait(false);
entity.RequestStatus = EnumRequestStatus.Handling; entity.RequestStatus = EnumRequestStatus.Handling;
entity.InventoryStage++;
entity.Details.ForEach(p=> entity.Details.ForEach(p=>
{ {
p.DetailStatus = EnumCountStatus.New; p.DetailStatus = EnumCountStatus.New;
}); });
} }
/// <summary> /// <summary>
@ -348,7 +348,7 @@ public class CountPlanManager : SfsStoreRequestManagerBase<CountPlan, CountPlanD
entity.AddDetail(entityDetail); entity.AddDetail(entityDetail);
entityDetail.FinalCountQty = planDetail.FinalCountQty; //赋值终盘数量 entityDetail.FinalCountQty = planDetail.FinalCountQty; //赋值终盘数量
// entityDetail.DetailStatus = EnumCountStatus.Completed; //赋值明细状态已完成 entityDetail.DetailStatus = EnumCountStatus.Completed; //赋值明细状态已完成
} }
await Repository.UpdateAsync(entity).ConfigureAwait(false); await Repository.UpdateAsync(entity).ConfigureAwait(false);

1
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Event/AutoMapperProfiles/Plans/CountPlanAutoMapperProfile.cs

@ -38,6 +38,7 @@ public partial class StoreEventAutoMapperProfile : Profile
//.Ignore(x => x.InventoryUom) //.Ignore(x => x.InventoryUom)
//.Ignore(x => x.InventoryQty) //.Ignore(x => x.InventoryQty)
.ForMember(x => x.InventoryLocationCode, y => y.MapFrom(d => d.LocationCode)) .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.CountQty)
.Ignore(x => x.CountTime) .Ignore(x => x.CountTime)
.Ignore(x => x.CountOperator) .Ignore(x => x.CountOperator)

Loading…
Cancel
Save