| | |
| | | throw new UserFriendlyException("物料信息不存在"); |
| | | } |
| | | var container = await _wmscontainerRepository.FindByNameAsync(input.ContainerNo); |
| | | if (container == null) |
| | | { |
| | | throw new UserFriendlyException("托盘信息不存在"); |
| | | } |
| | | //if (container == null) |
| | | //{ |
| | | // throw new UserFriendlyException("托盘信息不存在"); |
| | | //} |
| | | |
| | | var wmsmaterialstock = ObjectMapper.Map<WmsMaterialStockCreateDto, WmsMaterialStock>(input); |
| | | input.MapExtraPropertiesTo(wmsmaterialstock, MappingPropertyDefinitionChecks.None); |
| | |
| | | wmsmaterialstock.MaterialName = material.MaterialName; |
| | | |
| | | wmsmaterialstock.ContainerStatus = Domain.Shared.Enums.ContainerStatusEnum.KUWEI; |
| | | wmsmaterialstock.ContainerType = container.ContainerType; |
| | | wmsmaterialstock.ContainerType = container == null ? Domain.Shared.Enums.ContainerTypeEnum.XUNI : container.ContainerType; |
| | | wmsmaterialstock.StorageTypeNo = Domain.Shared.Enums.PlaceTypeEnum.XUNIKUWEI; |
| | | wmsmaterialstock.PlaceStatus = Domain.Shared.Enums.PlaceStatusEnum.DAIRU; |
| | | if (!string.IsNullOrEmpty(input.PlaceNo)) |
| | |
| | | |
| | | await _wmsmaterialstockRepository.InsertManyAsync(stockList); |
| | | |
| | | |
| | | if (container == null) |
| | | { |
| | | container = new WmsContainer |
| | | { |
| | | ContainerNo = input.ContainerNo, |
| | | ContainerType = Domain.Shared.Enums.ContainerTypeEnum.XUNI, |
| | | ContainerStatus = Domain.Shared.Enums.ContainerStatusEnum.KUWEI, |
| | | }; |
| | | var result = await _wmscontainerRepository.InsertAsync(container); |
| | | } |
| | | else |
| | | { |
| | | container.ContainerStatus = Domain.Shared.Enums.ContainerStatusEnum.KUWEI; |
| | | |
| | | await _wmscontainerRepository.UpdateAsync(container); |
| | | } |
| | | |
| | | //if (input.Sort.HasValue && wmsmaterialstock.Sort != maxSort) |
| | | //{ |