| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsEnumDto; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsStores; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.Util; |
| | | using CMS.Plugin.HIAWms.Domain.WmsAreas; |
| | | using CMS.Plugin.HIAWms.Domain.WmsStores; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using static CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsAreas.WmsAreaCreateOrUpdateDtoBase; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Implements |
| | | { |
| | |
| | | /// </summary> |
| | | public class WmsEnumAppService : CMSPluginAppService, IWmsEnumAppService |
| | | { |
| | | private readonly IWmsStoreRepository _storeRepository; |
| | | private readonly IWmsAreaRepository _wmsAreaRepository; |
| | | |
| | | public WmsEnumAppService(IWmsStoreRepository storeRepository, IWmsAreaRepository wmsAreaRepository) |
| | | { |
| | | _storeRepository = storeRepository; |
| | | _wmsAreaRepository = wmsAreaRepository; |
| | | } |
| | | |
| | | public List<EnumItem> GetEnumDataList(WmsEnumInput enumInput) |
| | | { |
| | | return EnumHelper.GetEnumItems(enumInput.EnumName); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 获取仓库列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public async Task<List<WmsStoreForAreaOutpur>> GetStreList() |
| | | { |
| | | var list = await _storeRepository.GetListForSelectAsync(); |
| | | if (list == null || list.Count <= 0) { return new List<WmsStoreForAreaOutpur>(); } |
| | | |
| | | var result = list.Select(x => new WmsStoreForAreaOutpur |
| | | { |
| | | StoreCode = x.StoreCode, |
| | | StoreName = x.StoreName, |
| | | }).ToList(); |
| | | return result; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 库区列表 |
| | | /// </summary> |
| | | /// <returns></returns> |
| | | public async Task<List<AreaForListOuptut>> GetAreaListAsync() |
| | | { |
| | | var list = await _wmsAreaRepository.GetListForSelectAsync(); |
| | | if (list == null || list.Count <= 0) { return new List<AreaForListOuptut>(); } |
| | | var result = list.Select(x=>new AreaForListOuptut |
| | | { |
| | | AreaName = x.AreaName, |
| | | AreaNo = x.AreaNo, |
| | | }).ToList(); |
| | | |
| | | return result; |
| | | } |
| | | } |
| | | } |