| | |
| | | /// </summary> |
| | | public partial class MESService |
| | | { |
| | | /// <summary> |
| | | /// BDC请æ±çè£
ç¹å¾ä¿¡æ¯ |
| | | /// </summary> |
| | | /// <param name="rfidPrint">RFID</param> |
| | | /// <param name="vin">VINå·</param> |
| | | /// <param name="stationNo">ç«å°è¯·æ±ç¹ä½</param> |
| | | /// <returns></returns> |
| | | public WebResponseContent issuedCharacter(string rfidPrint, string vin, string stationNo) |
| | | public WebResponseContent issuedCharacter(string rfidPrint, string stationNo, string palletCode) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | IssuedCharacterInfo characterInfo = new IssuedCharacterInfo() |
| | | { |
| | | plantCode = "1022", |
| | | plantCode = "1052", |
| | | rfidPrint = rfidPrint, |
| | | vin = vin, |
| | | vin = null, |
| | | messageTime = DateTime.Now |
| | | }; |
| | | |
| | |
| | | } |
| | | var wmsIpAddress = wmsBase + ipAddress; |
| | | |
| | | var MESrespon = HttpHelper.Post(wmsIpAddress, characterInfo.ToJson()); |
| | | |
| | | IssuedCharacterRespon characterRespon = JsonConvert.DeserializeObject<IssuedCharacterRespon>(MESrespon); |
| | | if (!characterRespon.success) |
| | | var MESrespon = HttpHelper.PostAsync(wmsIpAddress, characterInfo.ToJson(), contentType, headers).Result; |
| | | Console.WriteLine(MESrespon); |
| | | WebResponseContent webResponse = JsonConvert.DeserializeObject<WebResponseContent>(MESrespon.ToString()); |
| | | if (webResponse.Code != 200) |
| | | { |
| | | throw new Exception($"{characterRespon}"); |
| | | throw new Exception($"{webResponse.msg}"); |
| | | } |
| | | |
| | | Dt_CarBody CarBody = new Dt_CarBody() |
| | | IssuedCharacterRespon characterRespon = JsonConvert.DeserializeObject<IssuedCharacterRespon>(webResponse.Data.ToJson()); |
| | | |
| | | Dt_CarBodyInfo CarBody = new Dt_CarBodyInfo() |
| | | { |
| | | BodyStatus = "", |
| | | CarType = 1, |
| | | biwInPassTime = Convert.ToDateTime(characterRespon.biwInPassTime), |
| | | biwMaterialCode = characterRespon.biwMaterialCode, |
| | | skylightCharacteristic = characterRespon.skylightCharacteristic, |
| | | vehicleCharacteristic = characterRespon.vehicleCharacteristic, |
| | | workOrderNo = characterRespon.workOrderNo, |
| | | workOrderType = characterRespon.workOrderType, |
| | | BodyStatus = 1, |
| | | CarType = stationNo == "EL01RB01" ? 2 : 1, |
| | | CreateDate = DateTime.Now, |
| | | Creater = "system", |
| | | Creater = "System", |
| | | Description = "", |
| | | PalletCode = rfidPrint, |
| | | PVI = characterRespon.rfidPrint |
| | | PalletCode = palletCode, |
| | | PVI = characterRespon.pvi, |
| | | RFID = rfidPrint |
| | | }; |
| | | |
| | | _carBodyRepository.AddData(CarBody); |
| | | return content; |
| | | |
| | | LogFactory.GetLog("请æ±çè£
ç¹å¾ä¿¡æ¯").Info(true, $"\r\r--------------------------------------"); |
| | | LogFactory.GetLog("请æ±çè£
ç¹å¾ä¿¡æ¯").Info(true, $"å·¥ä½å·:{stationNo},RFID:{rfidPrint},ååºä¿¡æ¯:{webResponse.ToJson()}"); |
| | | |
| | | |
| | | return content.OK("è·åçè£
ç½è½¦èº«ä¿¡æ¯æå"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogFactory.GetLog("请æ±çè£
ç¹å¾ä¿¡æ¯").Info(true, $"请æ±çè£
ç¹å¾ä¿¡æ¯å¼å¸¸RFID:{rfidPrint}å¼å¸¸ä¿¡æ¯:{ex.Message}"); |
| | | return content.Error($"请æ±çè£
ç¹å¾ä¿¡æ¯å¼å¸¸ï¼:{ex.Message}"); |
| | | } |
| | | } |