|
|
@ -1,14 +1,18 @@ |
|
|
|
using System; |
|
|
|
using System.Collections.Generic; |
|
|
|
using System.Linq; |
|
|
|
using System.Text.Json; |
|
|
|
using System.Threading.Tasks; |
|
|
|
using Microsoft.AspNetCore.Mvc; |
|
|
|
using Polly.Caching; |
|
|
|
using Volo.Abp; |
|
|
|
using Volo.Abp.Application.Dtos; |
|
|
|
using Volo.Abp.AspNetCore.Mvc; |
|
|
|
using Win_in.Sfs.Auth.Application.Contracts; |
|
|
|
using Win_in.Sfs.Basedata.Application.Contracts; |
|
|
|
using Win_in.Sfs.Shared.Domain; |
|
|
|
using Win_in.Sfs.Shared.Domain.Shared; |
|
|
|
using Win_in.Sfs.Wms.Inventory.Application.Contracts; |
|
|
|
using Win_in.Sfs.Wms.Store.Application.Contracts; |
|
|
|
|
|
|
|
namespace Win_in.Sfs.Wms.Pda.Controllers.Jobs; |
|
|
@ -24,17 +28,21 @@ public class ContainerJobController : AbpController |
|
|
|
|
|
|
|
private readonly IUserWorkGroupAppService _userWorkGroupAppService; |
|
|
|
|
|
|
|
private readonly IDictAppService _dictApp; |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
///
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="ContainerJobAppService"></param>
|
|
|
|
/// <param name="userWorkGroupAppService"></param>
|
|
|
|
public ContainerJobController( |
|
|
|
IContainerJobAppService ContainerJobAppService |
|
|
|
IContainerJobAppService containerJobAppService, |
|
|
|
IDictAppService dictApp |
|
|
|
, IUserWorkGroupAppService userWorkGroupAppService) |
|
|
|
{ |
|
|
|
_userWorkGroupAppService = userWorkGroupAppService; |
|
|
|
_containerJobAppService = ContainerJobAppService; |
|
|
|
_containerJobAppService = containerJobAppService; |
|
|
|
_dictApp=dictApp; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
@ -69,30 +77,47 @@ public class ContainerJobController : AbpController |
|
|
|
/// <param name="pageIndex"></param>
|
|
|
|
/// <returns></returns>
|
|
|
|
[HttpGet("list")] |
|
|
|
public virtual async Task<PagedResultDto<ContainerJobDTO>> GetListAsync(int pageSize, int pageIndex) |
|
|
|
public virtual async Task<PagedResultDto<ContainerJobDTO>> GetListAsync(int pageSize, int pageIndex, bool isFinished) |
|
|
|
{ |
|
|
|
var wlgCodes = await _userWorkGroupAppService.GetCodsOfCurrentUserAsync().ConfigureAwait(false); |
|
|
|
_ = JsonSerializer.Serialize(wlgCodes); |
|
|
|
var dtos = await _dictApp.GetByCodeAsync("ContainerSpecificationsType").ConfigureAwait(false); |
|
|
|
|
|
|
|
var status = new List<int>() { (int)EnumJobStatus.Open, (int)EnumJobStatus.Doing }; |
|
|
|
var status = new List<int>(); |
|
|
|
if(isFinished==true) |
|
|
|
{ |
|
|
|
status.Add((int)EnumJobStatus.Done); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
status.Add((int)EnumJobStatus.Open); |
|
|
|
} |
|
|
|
var jsonStatus = JsonSerializer.Serialize(status); |
|
|
|
|
|
|
|
var request = new SfsJobRequestInputBase |
|
|
|
{ |
|
|
|
MaxResultCount = pageSize, |
|
|
|
SkipCount = (pageIndex - 1) * pageSize, |
|
|
|
Sorting = $"{nameof(ContainerJobDTO.Priority)} ASC", |
|
|
|
Sorting = $"{nameof(ContainerJobDTO.CreationTime)} ASC", |
|
|
|
Condition = new Condition |
|
|
|
{ |
|
|
|
Filters = new List<Filter> |
|
|
|
{ |
|
|
|
// new(nameof(ContainerJobDTO.WorkGroupCode),jsonCodes,"In"),
|
|
|
|
{ |
|
|
|
new(nameof(ContainerJobDTO.JobStatus),jsonStatus,"In") |
|
|
|
} |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
var list = await _containerJobAppService.GetPagedListByFilterAsync(request, true).ConfigureAwait(false); |
|
|
|
foreach (var item in list.Items) |
|
|
|
{ |
|
|
|
if(!string.IsNullOrEmpty(item.SpecificationsType)) |
|
|
|
{ |
|
|
|
var dictName= dtos.Items.FirstOrDefault(t => t.Code == item.SpecificationsType); |
|
|
|
item.SpecificationsTypeName = dictName.Name; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return list; |
|
|
|
} |
|
|
|
|
|
|
|