| | |
| | | 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; |
| | | |
| | |
| | | } |
| | | |
| | | var specification = new WmsAreaSpecification(input.Name); |
| | | var count = await _wmsareaRepository.GetCountAsync(input.Filter, specification); |
| | | var list = await _wmsareaRepository.GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification); |
| | | var area = ObjectMapper.Map<GetWmsAreasInput, WmsArea>(input); |
| | | var count = await _wmsareaRepository.GetCountAsync(area,input.Filter, specification); |
| | | var list = await _wmsareaRepository.GetListAsync(area,input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification); |
| | | |
| | | return new PagedResultDto<WmsAreaDto>(count, ObjectMapper.Map<List<WmsArea>, List<WmsAreaDto>>(list)); |
| | | } |
| | |
| | | |
| | | var maxSort = await _wmsareaRepository.GetMaxSortAsync(); |
| | | var sort = input.Sort ?? maxSort; |
| | | var wmsarea = new WmsArea |
| | | { |
| | | |
| | | }; |
| | | var wmsarea = ObjectMapper.Map<WmsAreaCreateDto, WmsArea>(input); |
| | | wmsarea.Sort = sort; |
| | | input.MapExtraPropertiesTo(wmsarea, MappingPropertyDefinitionChecks.None); |
| | | |
| | | await _wmsareaRepository.InsertAsync(wmsarea); |
| | |
| | | wmsarea.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp); |
| | | input.MapExtraPropertiesTo(wmsarea, MappingPropertyDefinitionChecks.None); |
| | | |
| | | wmsarea.AreaNo = input.AreaNo; |
| | | wmsarea.AreaName = input.AreaName; |
| | | wmsarea.AreaDesc = input.AreaDesc; |
| | | wmsarea.AreaStatus = input.AreaStatus; |
| | | wmsarea.AreaType = input.AreaType; |
| | | wmsarea.StoreCode = input.StoreCode; |
| | | wmsarea.StoreName = input.StoreName; |
| | | |
| | | await _wmsareaRepository.UpdateAsync(wmsarea); |
| | | |
| | |
| | | /// <inheritdoc /> |
| | | public virtual async Task AdjustSortAsync(Guid id, int sort) |
| | | { |
| | | var list = await _wmsareaRepository.GetListAsync(nameof(WmsArea.Sort)); |
| | | var list = await _wmsareaRepository.GetListAsync(null,nameof(WmsArea.Sort)); |
| | | if (list != null && list.Any()) |
| | | { |
| | | var initSort = 1; |
| | |
| | | { |
| | | var wmsareaUpdateDto = new WmsAreaUpdateDto |
| | | { |
| | | AreaNo = wmsarea.AreaNo, |
| | | AreaName = wmsarea.AreaName, |
| | | AreaDesc = wmsarea.AreaDesc, |
| | | AreaStatus = wmsarea.AreaStatus, |
| | | AreaType = wmsarea.AreaType, |
| | | StoreCode = wmsarea.StoreCode, |
| | | StoreName = wmsarea.StoreName, |
| | | Remark = wmsarea.Remark, |
| | | }; |
| | | |
| | |
| | | { |
| | | var wmsareaCreateDto = new WmsAreaCreateDto |
| | | { |
| | | AreaNo = wmsarea.AreaNo, |
| | | AreaName = wmsarea.AreaName, |
| | | AreaDesc = wmsarea.AreaDesc, |
| | | AreaStatus = wmsarea.AreaStatus, |
| | | AreaType = wmsarea.AreaType, |
| | | StoreCode = wmsarea.StoreCode, |
| | | StoreName = wmsarea.StoreName, |
| | | Remark = wmsarea.Remark, |
| | | }; |
| | | |
| | |
| | | } |
| | | |
| | | var specification = new WmsAreaSpecification(input.Name); |
| | | var list = await _wmsareaRepository.GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification, includeDetails: true); |
| | | var area = ObjectMapper.Map<GetWmsAreasInput, WmsArea>(input); |
| | | var list = await _wmsareaRepository.GetListAsync(area,input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification, includeDetails: true); |
| | | var result = ObjectMapper.Map<List<WmsArea>, List<WmsAreaDto>>(list); |
| | | |
| | | var sheets = new Dictionary<string, object> |
| | | { |
| | | ["配置"] = result.Select(x => x.GetExportData()).ToList(), |
| | | ["配置"] = ExportHelper.ConvertListToExportData(result), |
| | | }; |
| | | |
| | | var fileName = result.Count > 1 ? "WmsArea列表" : result.Count == 1 ? result.First()?.AreaName : "WmsArea模版"; |