Browse Source

Merge branch 'dev_DY_CC' of http://dev.ccwin-in.com:3000/BoXu.Zheng/WZC2 into dev_DY_CC

dev_DY_CC
郑勃旭 1 year ago
parent
commit
c6541c45ad
  1. 9
      be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/CountJobController.cs
  2. 3
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/CountJobs/CountJobAutoMapperProfile.cs
  3. 42
      be/Modules/Store/src/Win_in.Sfs.Wms.Store.Domain/Jobs/CountJobs/CountJobManager.cs

9
be/Hosts/WmsPda.Host/Win_in.Sfs.Wms.Pda.Host/Controllers/Jobs/CountJobController.cs

@ -68,11 +68,13 @@ public class CountJobController : AbpController
/// </summary>
/// <param name="pageSize"></param>
/// <param name="pageIndex"></param>
/// <param name="inventoryMode">1为有箱码2无箱码</param>
/// <returns></returns>
[HttpGet("list")]
public virtual async Task<PagedResultDto<CountJobDTO>> GetListAsync(int pageSize, int pageIndex)
public virtual async Task<PagedResultDto<CountJobDTO>> GetListAsync(int pageSize, int pageIndex,string inventoryMode)
{
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
EnumInventoryMode mode = (EnumInventoryMode)Enum.Parse(typeof(EnumInventoryMode), inventoryMode);
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false);
var jsonCodes = JsonSerializer.Serialize(wlgCodes);
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing };
@ -88,7 +90,8 @@ public class CountJobController : AbpController
Filters = new List<Filter>
{
new(nameof(CountJobDTO.WorkGroupCode),jsonCodes,"In"),
new(nameof(CountJobDTO.JobStatus),jsonStatus,"In")
new(nameof(CountJobDTO.JobStatus),jsonStatus,"In"),
new(nameof(CountJobDTO.InventoryMode),mode.ToString())
}
}
};

3
be/Modules/Store/src/Win_in.Sfs.Wms.Store.Application/Jobs/CountJobs/CountJobAutoMapperProfile.cs

@ -86,6 +86,7 @@ public partial class StoreApplicationAutoMapperProfile : Profile
.Ignore(x => x.Number)
.Ignore(x => x.Id)
;
CreateMap<CountJobDependentDetail, CountJobDetail>()
.ReverseMap();
}
}

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

@ -5,6 +5,7 @@ using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
using Volo.Abp;
using Volo.Abp.ObjectMapping;
using Volo.Abp.Users;
using Volo.Abp.Validation;
using Win_in.Sfs.Shared.Domain;
@ -117,19 +118,41 @@ public class CountJobManager : SfsJobManagerBase<CountJob, CountJobDetail>, ICou
}
private async Task SetDetailsAsync(CountJob input, CountJob entity)
{
{
foreach (var depDetail in input.DepDetails)
{
var inputDetail = input.Details.FirstOrDefault(r => r.ItemCode == depDetail.ItemCode && r.PackingCode == depDetail.PackingCode);
if (inputDetail != null)
{
inputDetail.CountQty += depDetail.CountQty;
}
else
{
var jobDetail = ObjectMapper.Map<CountJobDependentDetail, CountJobDetail>(depDetail);
var detailNumber = await GetNumber().ConfigureAwait(false);
jobDetail.SetIdAndNumber(GuidGenerator, entity.Id, detailNumber);
jobDetail.CountLabel = GuidGenerator.Create().ToString();
input.Details.Add(jobDetail);
}
var jobDepDetail = ObjectMapper.Map<CountJobDependentDetail, CountJobDependentDetail>(depDetail);
var number = entity.Number;
jobDepDetail.SetIdAndNumber(GuidGenerator, entity.Id, number);
jobDepDetail.CountLabel = GuidGenerator.Create().ToString();
entity.DepDetails.Add(jobDepDetail);
}
foreach (var detail in input.Details)
{
var entityDetail = entity.Details.FirstOrDefault(p => p.Id == detail.Id);
//新增盘点明细
if (entityDetail == null||entityDetail.Id==Guid.Empty)
if (entityDetail == null || entityDetail.Id == Guid.Empty)
{
var jobDetail = ObjectMapper.Map<CountJobDetail, CountJobDetail>(detail);
var number =await GetNumber();
jobDetail.SetIdAndNumber(GuidGenerator,entity.Id, number);
jobDetail.CountLabel = GuidGenerator.Create().ToString();
//var number =await GetNumber();
//jobDetail.SetIdAndNumber(GuidGenerator,entity.Id, number);
//jobDetail.CountLabel = GuidGenerator.Create().ToString();
//CountJobDetail jobDetail = new CountJobDetail() { };
entity.AddDetail(jobDetail);
@ -140,15 +163,6 @@ public class CountJobManager : SfsJobManagerBase<CountJob, CountJobDetail>, ICou
.ConfigureAwait(false);
}
}
foreach (var depDetail in input.DepDetails)
{
var jobDepDetail = ObjectMapper.Map<CountJobDependentDetail, CountJobDependentDetail>(depDetail);
var number = entity.Number;
jobDepDetail.SetIdAndNumber(GuidGenerator, entity.Id, number);
jobDepDetail.CountLabel = GuidGenerator.Create().ToString();
entity.DepDetails.Add(jobDepDetail);
}
}
public override void CheckDetails(CountJob entity, AbpValidationResult result)

Loading…
Cancel
Save