| | |
| | | _client.DefaultRequestHeaders.Clear(); |
| | | _client.DefaultRequestHeaders.Add("Accept", "application/json"); |
| | | |
| | | _logger.LogInformation("InvokeMESService FeedbackOutbound : " + json); |
| | | _logger.LogInformation("InvokeMESService FeedbackOutbound : "+ model.orderNo +" , " + json); |
| | | |
| | | var response = await _client.PostAsync("AldMaterialOutbound/MaterialOutbound", content); |
| | | string body = await response.Content.ReadAsStringAsync(); |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// åå¤åä¼ æ°æ® |
| | | /// </summary> |
| | | private TransferDataDto PrepareTransferData(List<Dt_PickingRecord> pickingRecords) |
| | | { |
| | | var transferData = new TransferDataDto |
| | | { |
| | | TransferTime = DateTime.Now, |
| | | Items = new List<TransferItemDto>() |
| | | }; |
| | | |
| | | // æç©æåç» |
| | | var materialGroups = pickingRecords |
| | | .GroupBy(x => x.MaterielCode) |
| | | .ToList(); |
| | | |
| | | foreach (var group in materialGroups) |
| | | { |
| | | var item = new TransferItemDto |
| | | { |
| | | MaterialCode = group.Key, |
| | | TotalQuantity = group.Sum(x => x.PickQuantity), |
| | | Locations = new List<LocationInfoDto>() |
| | | }; |
| | | |
| | | // æè´§ä½åç» |
| | | var locationGroups = group |
| | | .GroupBy(x => x.LocationCode) |
| | | .ToList(); |
| | | |
| | | foreach (var locationGroup in locationGroups) |
| | | { |
| | | var location = new LocationInfoDto |
| | | { |
| | | LocationCode = locationGroup.Key, |
| | | Quantity = locationGroup.Sum(x => x.PickQuantity), |
| | | Barcodes = locationGroup.Select(x => new BarcodeInfoDto |
| | | { |
| | | Barcode = x.Barcode, |
| | | Quantity = x.PickQuantity |
| | | }).ToList() |
| | | }; |
| | | |
| | | item.Locations.Add(location); |
| | | } |
| | | |
| | | transferData.Items.Add(item); |
| | | } |
| | | |
| | | return transferData; |
| | | } |
| | | |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | |
| | | materialCode = detail.MaterielCode, |
| | | lineNo = detail.lineNo, |
| | | warehouseCode = detail.WarehouseCode, |
| | | qty = 0, |
| | | qty = detail.BarcodeQty, |
| | | currentDeliveryQty = 0, |
| | | unit = detail.BarcodeUnit, |
| | | barcodes = new List<WIDESEA_DTO.Outbound.BarcodesModel>() |
| | |
| | | else |
| | | { |
| | | barModel.qty = item.PickQuantity; |
| | | } |
| | | detailModel.qty += barModel.qty; |
| | | } |
| | | detailModel.currentDeliveryQty += barModel.qty; |
| | | detailModel.barcodes.Add(barModel); |
| | | } |
| | |
| | | feedModel.details.Add(detailModel); |
| | | } |
| | | |
| | | feedModel.details = feedModel.details.GroupBy(item => new { item.materialCode, item.lineNo, item.warehouseCode, item.unit }).Select(group => new FeedbackOutboundDetailsModel |
| | | feedModel.details = feedModel.details.GroupBy(item => new { item.materialCode, item.lineNo, item.warehouseCode, item.unit,item.qty }).Select(group => new FeedbackOutboundDetailsModel |
| | | { |
| | | materialCode = group.Key.materialCode, |
| | | lineNo = group.Key.lineNo, |
| | | warehouseCode = group.Key.warehouseCode, |
| | | qty = group.Sum(x => x.qty), |
| | | qty = group.Key.qty, |
| | | currentDeliveryQty = group.Sum(x => x.currentDeliveryQty), |
| | | unit = group.Key.unit, |
| | | barcodes = group.SelectMany(x => x.barcodes.GroupBy(o => new { o.barcode, o.supplyCode, o.batchNo, o.unit }).Select(row => new WIDESEA_DTO.Outbound.BarcodesModel |
| | |
| | | .Where(x => x.OrderNo == orderNo) |
| | | .ExecuteCommandAsync(); |
| | | |
| | | await _pickingRecoreRepository.Db.Updateable<Dt_PickingRecord>() |
| | | .SetColumns(x => x.ReturnToMESStatus == 1) |
| | | .Where(x => x.OrderNo == orderNo) |
| | | .ExecuteCommandAsync(); |
| | | |
| | | return WebResponseContent.Instance.OK("åä¼ MESæå"); |
| | | } |
| | | else |