zs
2025-04-30 44709668c91a392dd0c346d6a15b07144ebf41ea
库位条件查询
已修改4个文件
35 ■■■■ 文件已修改
HIAWms/server/src/CMS.Plugin.HIAWms.Application.Contracts/Dtos/WmsStores/GetWmsStoresInput.cs 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HIAWms/server/src/CMS.Plugin.HIAWms.Application/Implements/WmsStoreAppService.cs 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HIAWms/server/src/CMS.Plugin.HIAWms.Domain/WmsStores/IWmsStoreRepository.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HIAWms/server/src/CMS.Plugin.HIAWms.EntityFrameworkCore/Repositories/EfCoreWmsStoreRepository.cs 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
HIAWms/server/src/CMS.Plugin.HIAWms.Application.Contracts/Dtos/WmsStores/GetWmsStoresInput.cs
@@ -16,4 +16,14 @@
    /// Gets or sets the name.
    /// </summary>
    public string Name { get; set; }
    /// <summary>
    /// 仓库代码
    /// </summary>
    public string? StoreCode { get; set; }
    /// <summary>
    /// 仓库名称
    /// </summary>
    public string? StoreName { get; set; }
}
HIAWms/server/src/CMS.Plugin.HIAWms.Application/Implements/WmsStoreAppService.cs
@@ -7,6 +7,7 @@
using Volo.Abp.Application.Dtos;
using Volo.Abp.Data;
using Volo.Abp.ObjectExtending;
using CMS.Plugin.HIAWms.Domain.Shared.Util;
namespace CMS.Plugin.HIAWms.Application.Implements;
@@ -41,8 +42,9 @@
        }
        var specification = new WmsStoreSpecification(input.Name);
        var count = await _wmsstoreRepository.GetCountAsync(input.Filter, specification);
        var list = await _wmsstoreRepository.GetListAsync(input.Sorting, input.MaxResultCount,  input.SkipCount, input.Filter, specification);
        var store = ObjectMapper.Map<GetWmsStoresInput, WmsStore>(input);
        var count = await _wmsstoreRepository.GetCountAsync(store,input.Filter, specification);
        var list = await _wmsstoreRepository.GetListAsync(store,input.Sorting, input.MaxResultCount,  input.SkipCount, input.Filter, specification);
        return new PagedResultDto<WmsStoreDto>(count, ObjectMapper.Map<List<WmsStore>, List<WmsStoreDto>>(list));
    }
@@ -150,7 +152,7 @@
    /// <inheritdoc />
    public virtual async Task AdjustSortAsync(Guid id, int sort)
    {
        var list = await _wmsstoreRepository.GetListAsync(nameof(WmsStore.Sort));
        var list = await _wmsstoreRepository.GetListAsync(null,nameof(WmsStore.Sort));
        if (list != null && list.Any())
        {
            var initSort = 1;
@@ -283,12 +285,13 @@
        }
        var specification = new WmsStoreSpecification(input.Name);
        var list = await _wmsstoreRepository.GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification, includeDetails: true);
        var store = ObjectMapper.Map<GetWmsStoresInput, WmsStore>(input);
        var list = await _wmsstoreRepository.GetListAsync(store, input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification, includeDetails: true);
        var result = ObjectMapper.Map<List<WmsStore>, List<WmsStoreDto>>(list);
        var sheets = new Dictionary<string, object>
        {
            ["配置"] = result.Select(x => x.GetExportData()).ToList(),
            ["配置"] = ExportHelper.ConvertListToExportData(result),
        };
        var fileName = result.Count > 1 ? "WmsStore列表" : result.Count == 1 ? result.First()?.StoreCode : "WmsStore模版";
HIAWms/server/src/CMS.Plugin.HIAWms.Domain/WmsStores/IWmsStoreRepository.cs
@@ -41,7 +41,7 @@
    /// <param name="includeDetails">if set to <c>true</c> [include details].</param>
    /// <param name="cancellationToken">The cancellation token.</param>
    /// <returns></returns>
    Task<List<WmsStore>> GetListAsync(string sorting = null, int maxResultCount = int.MaxValue,  int skipCount = 0, string filter = null, Specification<WmsStore> specification = null, bool includeDetails = false, CancellationToken cancellationToken = default);
    Task<List<WmsStore>> GetListAsync(WmsStore? store, string sorting = null, int maxResultCount = int.MaxValue,  int skipCount = 0, string filter = null, Specification<WmsStore> specification = null, bool includeDetails = false, CancellationToken cancellationToken = default);
    /// <summary>
    /// Gets the count asynchronous.
@@ -50,5 +50,5 @@
    /// <param name="specification">The specification.</param>
    /// <param name="cancellationToken">The cancellation token.</param>
    /// <returns></returns>
    Task<long> GetCountAsync(string filter = null, Specification<WmsStore> specification = null, CancellationToken cancellationToken = default);
    Task<long> GetCountAsync(WmsStore? store, string filter = null, Specification<WmsStore> specification = null, CancellationToken cancellationToken = default);
}
HIAWms/server/src/CMS.Plugin.HIAWms.EntityFrameworkCore/Repositories/EfCoreWmsStoreRepository.cs
@@ -52,7 +52,7 @@
    }
    /// <inheritdoc />
    public async Task<List<WmsStore>> GetListAsync(string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, string filter = null, Specification<WmsStore> specification = null, bool includeDetails = false, CancellationToken cancellationToken = default)
    public async Task<List<WmsStore>> GetListAsync(WmsStore? store, string sorting = null, int maxResultCount = int.MaxValue, int skipCount = 0, string filter = null, Specification<WmsStore> specification = null, bool includeDetails = false, CancellationToken cancellationToken = default)
    {
        specification ??= new WmsStoreSpecification();
        return await (await GetDbSetAsync())
@@ -60,19 +60,23 @@
            .Where(specification.ToExpression())
            .Where(x => !x.IsDeleted)
            .WhereIf(!filter.IsNullOrWhiteSpace(), u => u.StoreCode.Contains(filter))
            .WhereIf(!string.IsNullOrEmpty(store.StoreCode),u=>u.StoreCode.Contains(store.StoreCode))
            .WhereIf(!string.IsNullOrEmpty(store.StoreName),u=>u.StoreName.Contains(store.StoreName))
            .OrderBy(sorting.IsNullOrEmpty() ? nameof(WmsStore.Sort) : sorting)
            .PageBy(skipCount, maxResultCount)
            .ToListAsync(GetCancellationToken(cancellationToken));
    }
    /// <inheritdoc />
    public async Task<long> GetCountAsync(string filter = null, Specification<WmsStore> specification = null, CancellationToken cancellationToken = default)
    public async Task<long> GetCountAsync(WmsStore? store, string filter = null, Specification<WmsStore> specification = null, CancellationToken cancellationToken = default)
    {
        specification ??= new WmsStoreSpecification();
        return await (await GetQueryableAsync())
            .Where(specification.ToExpression())
            .Where(x => !x.IsDeleted)
            .WhereIf(!filter.IsNullOrWhiteSpace(), u => u.StoreCode.Contains(filter))
            .WhereIf(!string.IsNullOrEmpty(store.StoreCode), u => u.StoreCode.Contains(store.StoreCode))
            .WhereIf(!string.IsNullOrEmpty(store.StoreName), u => u.StoreName.Contains(store.StoreName))
            .CountAsync(cancellationToken: GetCancellationToken(cancellationToken));
    }