| | |
| | | using WIDESEA_DTO.WMS; |
| | | using WIDESEA_Model.Models; |
| | | using WIDESEA_StorageBasicRepository; |
| | | using WIDESEA_StorageOutOrderRepository; |
| | | |
| | | namespace WIDESEA_StoragIntegrationServices |
| | | { |
| | | public partial class MESService |
| | | { |
| | | /// <summary> |
| | | /// æ¶è£
å·¥åä¿¡æ¯ |
| | | /// MESæ¨éæ¶è£
å·¥å |
| | | /// </summary> |
| | | /// <param name="json"></param> |
| | | /// <returns></returns> |
| | |
| | | try |
| | | { |
| | | if (string.IsNullOrEmpty(json.ToString())) throw new Exception("请æ±åæ°ä¸ºç©º"); |
| | | Console.WriteLine(json); |
| | | var result = JsonConvert.DeserializeObject<List<pushWorkOrderInfo>>(json.ToString()); |
| | | |
| | | var result = JsonConvert.DeserializeObject<pushWorkOrderInfo>(json.ToString()); |
| | | var paintingOrderInfos = new List<Dt_PaintingOrderInfo>(); |
| | | foreach (var item in result) |
| | | { |
| | | //var paintingInfo = _paintingOrderInfoRepository.QueryFirst(x => x.workOrderNo == item.workOrderNo && x.workOrderType == item.workOrderType); |
| | | //if (null != paintingInfo) |
| | | //{ |
| | | // paintingInfo.pvi = item.pvi; |
| | | // paintingInfo.carBodyCharacteristic = item.carBodyCharacteristic; |
| | | // paintingInfo.twoToneCharacteristic = item.twoToneCharacteristic; |
| | | // paintingInfo.pbMaterial = item.pbMaterial; |
| | | |
| | | var palletStockInfos = _palletStockInfoRepository.QueryData(x => x.OrderID == result.workOrderNo); |
| | | |
| | | |
| | | |
| | | |
| | | // _paintingOrderInfoRepository.UpdateData(paintingInfo); |
| | | //} |
| | | //else |
| | | //{ |
| | | Dt_PaintingOrderInfo paintingOrderInfo = new Dt_PaintingOrderInfo() |
| | | { |
| | | biwMaterial = item.biwMaterial, |
| | | carBodyCharacteristic = item.carBodyCharacteristic, |
| | | config1 = item.config1, |
| | | config3 = item.config3, |
| | | CreateDate = DateTime.Now, |
| | | Creater = "System", |
| | | pbMaterial = item.pbMaterial, |
| | | plantCode = item.plantCode, |
| | | pvi = item.pvi, |
| | | sequenceNo = item.sequenceNo, |
| | | skylightCharacteristic = item.skylightCharacteristic, |
| | | twoToneCharacteristic = item.twoToneCharacteristic, |
| | | vehicleCharacteristic = item.vehicleCharacteristic, |
| | | workOrderNo = item.workOrderNo, |
| | | workOrderSendStatus = item.workOrderSendStatus, |
| | | splitStrategy = item.splitStrategy, |
| | | workOrderType = item.workOrderType, |
| | | workshopCode = item.workshopCode, |
| | | }; |
| | | paintingOrderInfos.Add(paintingOrderInfo); |
| | | } |
| | | _paintingOrderInfoRepository.AddData(paintingOrderInfos); |
| | | //} |
| | | |
| | | LogFactory.GetLog("æ¶è£
å·¥åä¿¡æ¯").Info(true, $"\r\r--------------------------------------"); |
| | | LogFactory.GetLog("æ¶è£
å·¥åä¿¡æ¯").Info(true, result.ToJsonString()); |
| | |
| | | catch (Exception ex) |
| | | { |
| | | LogFactory.GetLog("æ¶è£
å·¥åä¿¡æ¯").Info(true, $"\r\r--------------------------------------"); |
| | | LogFactory.GetLog("æ¶è£
å·¥åä¿¡æ¯").Info(true, ex.Message); |
| | | LogFactory.GetLog("æ¶è£
å·¥åä¿¡æ¯").Info(true, $"æ¶è£
工忥æ¶å¼å¸¸:{ex.Message}"); |
| | | return content.Error(ex.Message); |
| | | } |
| | | } |