| | |
| | | public class ToMesService |
| | | { |
| | | //http://172.21.1.117/barcode/Webservice/WebService_ZY/WebServiceZY.asmx; |
| | | public static string POSTURL = "http://172.21.1.117/barcode/Webservice/WebService_ZY/Service_EQP.asmx"; |
| | | //public static string POSTURL = "http://172.21.1.117/barcode/Webservice/WebService_ZY/Service_EQP.asmx"; |
| | | //public static string POSTURL = "http://172.21.7.109/barcode/Webservice/Service_EQP.asmx"; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | public static string POSTURL = "http://192.168.22.83/barcode/Webservice/Service_EQP.asmx"; |
| | | /// <summary> |
| | | /// è·åè½´æ¿ä¿¡æ¯æ¥å£ |
| | | /// </summary> |
| | | /// <param name="saveModel">è½´æ¿æ¡ç </param> |
| | | /// <param name="saveModel">è½´æ¿æ¡ç </param> 20251217-0025 |
| | | /// <returns></returns> |
| | | public static WebResponseContent Mes_GetBearingInfo(SaveModel saveModel) |
| | | { |
| | |
| | | xmlEntity = XMLSerializationTool.DeserializeXmlToObject<getInfoByJournalXMLEntity>(resultString); |
| | | if (xmlEntity.FLAG == "S") |
| | | { |
| | | Data zzjAVG = xmlEntity.Datas.Data.Where(r => r.name == "左轴é¢å¹³åå¼").OrderByDescending(r => r.time).FirstOrDefault(); |
| | | //Data zzjAVG = xmlEntity.Datas.Data.Where(r => r.name == "左轴é¢å¹³åå¼").OrderByDescending(r => r.time).FirstOrDefault(); |
| | | //if (null != zzjAVG) queryZCInfo.zzjAVG = decimal.Parse(zzjAVG.value).ToString("N3"); |
| | | //Data zzjAVG = xmlEntity.Datas.Data.Where(r => r.name == "左轴é¢ç´å¾").OrderByDescending(r => r.time).FirstOrDefault(); |
| | | //if (null != zzjAVG) queryZCInfo.zzjAVG = decimal.Parse(zzjAVG.value).ToString("N3"); |
| | | |
| | | //Data yzjAVG = xmlEntity.Datas.Data.Where(r => r.name == "å³è½´é¢ç´å¾").OrderByDescending(r => r.time).FirstOrDefault(); |
| | | //if (null != yzjAVG) queryZCInfo.yzjAVG = decimal.Parse(yzjAVG.value).ToString("N3"); |
| | | |
| | | //Data zfcbAVG = xmlEntity.Datas.Data.Where(r => r.name == "å·¦é²å°æ¿åº§ç´å¾").OrderByDescending(r => r.time).FirstOrDefault(); |
| | | //if (null != zfcbAVG) queryZCInfo.zfcbAVG = decimal.Parse(zfcbAVG.value).ToString("N3"); |
| | | |
| | | //Data yfcbAVG = xmlEntity.Datas.Data.Where(r => r.name == "å³é²å°æ¿åº§ç´å¾").OrderByDescending(r => r.time).FirstOrDefault(); |
| | | //if (null != yfcbAVG) queryZCInfo.yfcbAVG = decimal.Parse(yfcbAVG.value).ToString("N3"); |
| | | |
| | | |
| | | Data zzjAVG = xmlEntity.Datas.Data.Where(r => r.name == "è½´å·ç«¯è½´é¢ç´å¾").OrderByDescending(r => r.time).FirstOrDefault(); |
| | | if (null != zzjAVG) queryZCInfo.zzjAVG = decimal.Parse(zzjAVG.value).ToString("N3"); |
| | | |
| | | Data yzjAVG = xmlEntity.Datas.Data.Where(r => r.name == "å³è½´é¢å¹³åå¼").OrderByDescending(r => r.time).FirstOrDefault(); |
| | | Data yzjAVG = xmlEntity.Datas.Data.Where(r => r.name == "éè½´å·ç«¯è½´é¢ç´å¾").OrderByDescending(r => r.time).FirstOrDefault(); |
| | | if (null != yzjAVG) queryZCInfo.yzjAVG = decimal.Parse(yzjAVG.value).ToString("N3"); |
| | | |
| | | Data zfcbAVG = xmlEntity.Datas.Data.Where(r => r.name == "å·¦é²å°æ¿åº§å¹³åå¼").OrderByDescending(r => r.time).FirstOrDefault(); |
| | | Data zfcbAVG = xmlEntity.Datas.Data.Where(r => r.name == "è½´å·ç«¯é²å°æ¿åº§ç´å¾").OrderByDescending(r => r.time).FirstOrDefault(); |
| | | if (null != zfcbAVG) queryZCInfo.zfcbAVG = decimal.Parse(zfcbAVG.value).ToString("N3"); |
| | | |
| | | Data yfcbAVG = xmlEntity.Datas.Data.Where(r => r.name == "å³é²å°æ¿åº§å¹³åå¼").OrderByDescending(r => r.time).FirstOrDefault(); |
| | | Data yfcbAVG = xmlEntity.Datas.Data.Where(r => r.name == "éè½´å·ç«¯é²å°æ¿åº§ç´å¾").OrderByDescending(r => r.time).FirstOrDefault(); |
| | | if (null != yfcbAVG) queryZCInfo.yfcbAVG = decimal.Parse(yfcbAVG.value).ToString("N3"); |
| | | |
| | | Data zydAVG = xmlEntity.Datas.Data.Where(r => r.name == "左油档平åå¼").OrderByDescending(r => r.time).FirstOrDefault(); |
| | | if (null != zydAVG) queryZCInfo.zydAVG = decimal.Parse(zydAVG.value).ToString("N3"); |
| | | //Data zydAVG = xmlEntity.Datas.Data.Where(r => r.name == "左油档ç´å¾").OrderByDescending(r => r.time).FirstOrDefault(); |
| | | //if (null != zydAVG) queryZCInfo.zydAVG = decimal.Parse(zydAVG.value).ToString("N3"); |
| | | |
| | | Data yydAVG = xmlEntity.Datas.Data.Where(r => r.name == "峿²¹æ¡£å¹³åå¼").OrderByDescending(r => r.time).FirstOrDefault(); |
| | | if (null != yydAVG) queryZCInfo.yydAVG = decimal.Parse(yydAVG.value).ToString("N3"); |
| | | //Data yydAVG = xmlEntity.Datas.Data.Where(r => r.name == "峿²¹æ¡£ç´å¾").OrderByDescending(r => r.time).FirstOrDefault(); |
| | | //if (null != yydAVG) queryZCInfo.yydAVG = decimal.Parse(yydAVG.value).ToString("N3"); |
| | | |
| | | Data materiel = xmlEntity.Datas.Data.Where(r => r.name == "车å").OrderByDescending(r => r.time).FirstOrDefault(); |
| | | if (null != materiel) queryZCInfo.materiel = materiel.value; |
| | |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | EndpointAddress address = new EndpointAddress("http://172.21.1.117/barcode/Webservice/WebService_ZY/Service_EQP.asmx"); |
| | | //EndpointAddress address = new EndpointAddress("http://172.21.1.117/barcode/Webservice/WebService_ZY/Service_EQP.asmx"); |
| | | //EndpointAddress address = new EndpointAddress(" http://172.21.1.117/barcode/Webservice/WebService_ZY/WebServiceZY.asmx"); |
| | | EndpointAddress address = new EndpointAddress(POSTURL); |
| | | ErpWebService.Service_EQPSoapClient client = new ErpWebService.Service_EQPSoapClient(new BasicHttpBinding(), address); |
| | | Task<ErpWebService.WheelsetMatchResponse> res = client.WheelsetMatchAsync("", "", ""); |
| | | string resultString = res.Result.Body.WheelsetMatchResult; |
| | |
| | | } |
| | | return content; |
| | | } |
| | | |
| | | |
| | | public WebResponseContent UploadMES2(SaveModel saveModel) |
| | | { |
| | | WebResponseContent content = new WebResponseContent(); |
| | | try |
| | | { |
| | | foreach (var item in saveModel.DelKeys) |
| | | { |
| | | string resultString = string.Empty; |
| | | string recordData = string.Empty; |
| | | try |
| | | { |
| | | dt_selectionRecord selects = dt_selectionRecordRepository.Instance.FindFirst(r => r.record_id == Guid.Parse(item.ToString())); |
| | | string json = JsonConvert.SerializeObject(selects, Newtonsoft.Json.Formatting.Indented); |
| | | if (null == selects) |
| | | return content.Error("æªæ¾å°éé
è®°å½."); |
| | | recordData = json; |
| | | EndpointAddress address = new EndpointAddress(ToMesService.POSTURL); |
| | | ErpWebService.Service_EQPSoapClient client = new ErpWebService.Service_EQPSoapClient(new BasicHttpBinding(), address); |
| | | Task<ErpWebService.ReportToSCEResponse> res = client.ReportToSCEAsync(selects.record_materielNumber, json); |
| | | // resultString = res.Result.Body.ReportToSCEResult; |
| | | } |
| | | catch |
| | | { |
| | | |
| | | } |
| | | finally |
| | | { |
| | | LogRecord.WriteLog((int)LogEnum.Mes, $"{UserContext.Current.UserTrueName}ä¸ä¼ MESåæ°:{recordData},ç»æï¼{resultString}"); |
| | | } |
| | | } |
| | | content.OK(); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | content.Error("ä¸ä¼ 失败:" + ex.Message); |
| | | } |
| | | finally |
| | | { |
| | | |
| | | } |
| | | return content; |
| | | } |
| | | } |
| | | public class MeasureInfo |
| | | { |