| | |
| | | _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(); |
| | |
| | | |
| | | throw new HttpRequestException(body); |
| | | } |
| | | |
| | | _logger.LogInformation("InvokeMESService FeedbackOutbound body: " + body); |
| | | |
| | | return JsonConvert.DeserializeObject<ResponseModel>(body); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | /// <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> |
| | |
| | | business_type = outboundOrder.BusinessType, |
| | | factoryArea = outboundOrder.FactoryArea, |
| | | operationType = 1, |
| | | Operator = outboundOrder.Operator, |
| | | Operator = outboundOrder.Operator!=""? outboundOrder.Operator:App.User.UserName, |
| | | orderNo = outboundOrder.UpperOrderNo, |
| | | documentsNO = documentNo, |
| | | status = outboundOrder.OrderStatus, |
| | |
| | | .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 |