| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsPlaces; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | using CMS.Plugin.HIAWms.Domain.WmsPlaces; |
| | | using CMS.Plugin.HIAWms.Domain.Shared; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.WmsPlaces; |
| | | using CMS.Plugin.HIAWms.Domain.WmsPlaces; |
| | | using CmsQueryExtensions; |
| | | using System.Text.RegularExpressions; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Application.Dtos; |
| | | using Volo.Abp.Data; |
| | |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public virtual async Task<PagedResultDto<WmsPlaceDto>> GetListAsync(GetWmsPlacesInput input) |
| | | public virtual async Task<PagedResultDto<WmsPlaceDto>> GetListAsync(GetWmsMaterialInfoInput input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | |
| | | } |
| | | |
| | | var specification = new WmsPlaceSpecification(input.Name); |
| | | var count = await _wmsplaceRepository.GetCountAsync(input.Filter, specification); |
| | | var list = await _wmsplaceRepository.GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification); |
| | | var place = ObjectMapper.Map<GetWmsMaterialInfoInput, WmsPlace>(input); |
| | | var count = await _wmsplaceRepository.GetCountAsync(place,input.Filter, specification); |
| | | var list = await _wmsplaceRepository.GetListAsync(place, input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification); |
| | | |
| | | return new PagedResultDto<WmsPlaceDto>(count, ObjectMapper.Map<List<WmsPlace>, List<WmsPlaceDto>>(list)); |
| | | } |
| | |
| | | /// <inheritdoc /> |
| | | public virtual async Task AdjustSortAsync(Guid id, int sort) |
| | | { |
| | | var list = await _wmsplaceRepository.GetListAsync(nameof(WmsPlace.Sort)); |
| | | var list = await _wmsplaceRepository.GetListAsync(null,nameof(WmsPlace.Sort)); |
| | | if (list != null && list.Any()) |
| | | { |
| | | var initSort = 1; |
| | |
| | | } |
| | | |
| | | /// <inheritdoc /> |
| | | public async Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetWmsPlacesInput input) |
| | | public async Task<(Dictionary<string, object> Sheets, string FileName)> ExportAsync(GetWmsMaterialInfoInput input) |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | |
| | |
| | | } |
| | | |
| | | var specification = new WmsPlaceSpecification(input.Name); |
| | | var list = await _wmsplaceRepository.GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification, includeDetails: true); |
| | | var place = ObjectMapper.Map<GetWmsMaterialInfoInput, WmsPlace>(input); |
| | | var list = await _wmsplaceRepository.GetListAsync(place, input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification, includeDetails: true); |
| | | var result = ObjectMapper.Map<List<WmsPlace>, List<WmsPlaceDto>>(list); |
| | | |
| | | var sheets = new Dictionary<string, object> |
| | | { |
| | | ["配置"] = result.Select(x => x.GetExportData()).ToList(), |
| | | ["配置"] = ExportHelper.ConvertListToExportData(result), |
| | | }; |
| | | |
| | | var fileName = result.Count > 1 ? "WmsPlace列表" : result.Count == 1 ? result.First()?.PlaceNo : "WmsPlace模版"; |
| | |
| | | { |
| | | Check.NotNull(input, nameof(input)); |
| | | Check.NotNullOrWhiteSpace(input.PlaceNo, "编号", WmsPlaceConsts.MaxCodeLength); |
| | | string pattern = @"^\d+-\d+$"; |
| | | if (input.StorageTypeNo == Domain.Shared.Enums.PlaceTypeEnum.YUANLIAOKUWEI && !Regex.IsMatch(input.PlaceNo, pattern)) |
| | | { |
| | | throw new UserFriendlyException("库位编号格式错误"); |
| | | } |
| | | Check.Length(input.Remark, "备注", WmsPlaceConsts.MaxRemarkLength); |
| | | return Task.CompletedTask; |
| | | } |