| | |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Dtos.WmsMaterials; |
| | | using CMS.Plugin.HIAWms.Application.Contracts.Services; |
| | | using CMS.Plugin.HIAWms.Domain.WmsMaterials; |
| | | using CMS.Plugin.HIAWms.Domain.Shared; |
| | | using CMS.Plugin.HIAWms.Domain.Shared.WmsMaterials; |
| | | using CMS.Plugin.HIAWms.Domain.WmsMaterials; |
| | | using CmsQueryExtensions; |
| | | using Volo.Abp; |
| | | using Volo.Abp.Application.Dtos; |
| | | using Volo.Abp.Data; |
| | | using Volo.Abp.ObjectExtending; |
| | | using Volo.Abp.ObjectMapping; |
| | | |
| | | namespace CMS.Plugin.HIAWms.Application.Implements; |
| | | |
| | |
| | | } |
| | | |
| | | var specification = new WmsMaterialSpecification(input.Name); |
| | | var count = await _wmsmaterialRepository.GetCountAsync(input.Filter, specification); |
| | | var list = await _wmsmaterialRepository.GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification); |
| | | var material = ObjectMapper.Map<GetWmsMaterialsInput, WmsMaterial>(input); |
| | | var count = await _wmsmaterialRepository.GetCountAsync(material,input.Filter, specification); |
| | | |
| | | var list = await _wmsmaterialRepository.GetListAsync(material,input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification); |
| | | |
| | | return new PagedResultDto<WmsMaterialDto>(count, ObjectMapper.Map<List<WmsMaterial>, List<WmsMaterialDto>>(list)); |
| | | } |
| | |
| | | |
| | | var maxSort = await _wmsmaterialRepository.GetMaxSortAsync(); |
| | | var sort = input.Sort ?? maxSort; |
| | | var wmsmaterial = new WmsMaterial |
| | | { |
| | | |
| | | }; |
| | | var wmsmaterial = ObjectMapper.Map<WmsMaterialCreateDto, WmsMaterial>(input); |
| | | wmsmaterial.Sort = sort; |
| | | input.MapExtraPropertiesTo(wmsmaterial, MappingPropertyDefinitionChecks.None); |
| | | |
| | | await _wmsmaterialRepository.InsertAsync(wmsmaterial); |
| | |
| | | wmsmaterial.SetConcurrencyStampIfNotNull(input.ConcurrencyStamp); |
| | | input.MapExtraPropertiesTo(wmsmaterial, MappingPropertyDefinitionChecks.None); |
| | | |
| | | wmsmaterial.MaterialCode = input.MaterialCode; |
| | | wmsmaterial.MaterialName = input.MaterialName; |
| | | wmsmaterial.PurchaseType = input.PurchaseType; |
| | | wmsmaterial.MaterialType = input.MaterialType; |
| | | wmsmaterial.PrimaryUnit = input.PrimaryUnit; |
| | | wmsmaterial.Standard = input.Standard; |
| | | wmsmaterial.OuterDiameter = input.OuterDiameter; |
| | | wmsmaterial.WallThickness = input.WallThickness; |
| | | wmsmaterial.MaterialQuality = input.MaterialQuality; |
| | | wmsmaterial.Length = input.Length; |
| | | wmsmaterial.IsMainBranch = input.IsMainBranch; |
| | | wmsmaterial.Factory = input.Factory; |
| | | wmsmaterial.MaterialModel = input.MaterialModel; |
| | | wmsmaterial.Certification = input.Certification; |
| | | |
| | | await _wmsmaterialRepository.UpdateAsync(wmsmaterial); |
| | | |
| | |
| | | /// <inheritdoc /> |
| | | public virtual async Task AdjustSortAsync(Guid id, int sort) |
| | | { |
| | | var list = await _wmsmaterialRepository.GetListAsync(nameof(WmsMaterial.Sort)); |
| | | var list = await _wmsmaterialRepository.GetListAsync(null, nameof(WmsMaterial.Sort)); |
| | | if (list != null && list.Any()) |
| | | { |
| | | var initSort = 1; |
| | |
| | | { |
| | | MaterialCode = wmsmaterial.MaterialCode, |
| | | MaterialName = wmsmaterial.MaterialName, |
| | | PurchaseType = wmsmaterial.PurchaseType, |
| | | MaterialType = wmsmaterial.MaterialType, |
| | | PrimaryUnit = wmsmaterial.PrimaryUnit, |
| | | Standard = wmsmaterial.Standard, |
| | | OuterDiameter = wmsmaterial.OuterDiameter, |
| | | WallThickness = wmsmaterial.WallThickness, |
| | | MaterialQuality = wmsmaterial.MaterialQuality, |
| | | Length = wmsmaterial.Length, |
| | | IsMainBranch = wmsmaterial.IsMainBranch, |
| | | Factory = wmsmaterial.Factory, |
| | | Certification = wmsmaterial.Certification, |
| | | Remark = wmsmaterial.Remark, |
| | | }; |
| | | |
| | |
| | | { |
| | | MaterialCode = wmsmaterial.MaterialCode, |
| | | MaterialName = wmsmaterial.MaterialName, |
| | | PurchaseType = wmsmaterial.PurchaseType, |
| | | MaterialType = wmsmaterial.MaterialType, |
| | | PrimaryUnit = wmsmaterial.PrimaryUnit, |
| | | Standard = wmsmaterial.Standard, |
| | | OuterDiameter = wmsmaterial.OuterDiameter, |
| | | WallThickness = wmsmaterial.WallThickness, |
| | | MaterialQuality = wmsmaterial.MaterialQuality, |
| | | Length = wmsmaterial.Length, |
| | | IsMainBranch = wmsmaterial.IsMainBranch, |
| | | Factory = wmsmaterial.Factory, |
| | | Certification = wmsmaterial.Certification, |
| | | Remark = wmsmaterial.Remark, |
| | | }; |
| | | |
| | |
| | | } |
| | | |
| | | var specification = new WmsMaterialSpecification(input.Name); |
| | | var list = await _wmsmaterialRepository.GetListAsync(input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification, includeDetails: true); |
| | | |
| | | var material = ObjectMapper.Map<GetWmsMaterialsInput, WmsMaterial>(input); |
| | | var list = await _wmsmaterialRepository.GetListAsync(material,input.Sorting, input.MaxResultCount, input.SkipCount, input.Filter, specification, includeDetails: true); |
| | | var result = ObjectMapper.Map<List<WmsMaterial>, List<WmsMaterialDto>>(list); |
| | | |
| | | var sheets = new Dictionary<string, object> |
| | | { |
| | | ["配置"] = result.Select(x => x.GetExportData()).ToList(), |
| | | ["配置"] = ExportHelper.ConvertListToExportData(result), |
| | | }; |
| | | |
| | | var fileName = result.Count > 1 ? "WmsMaterial列表" : result.Count == 1 ? result.First()?.MaterialCode : "WmsMaterial模版"; |
| | | var fileName = result.Count > 1 ? "WmsMaterial列表" : result.Count == 1 ? result[0]?.MaterialCode : "WmsMaterial模版"; |
| | | return (sheets, fileName); |
| | | } |
| | | |