public InterfaceReturnInfo GetSapMaintainPart(List <BFDASapPartInfo> partInfos) { ///回传文本 InterfaceReturnInfo retInfo = new InterfaceReturnInfo(); return(retInfo); }
public InterfaceReturnInfo GetAsnOrder(List <BFDASrmVmiDeliveryNoteInfo> bFDASrmVmiDeliveryNoteInfos) { /////接口代码 string interfaceCode = "LES-SRM-006"; ///回传文本 InterfaceReturnInfo retInfo = new InterfaceReturnInfo(); ///开始执行时间 DateTime executeStartTime = DateTime.Now; if (bFDASrmVmiDeliveryNoteInfos.Count == 0) { string errorCode = "0x00000463"; ///错误消息 retInfo.MessageContent = GetMessage(ref errorCode); retInfo.ErrorCode = errorCode; ///ESB.RESULT 0标识成功,1代表错误 retInfo.ExecuteResult = (int)ResultsDescribed.Failure; return(retInfo); } ///日志ID Guid logFid = Guid.NewGuid(); ///中间表处理集合 BFDASrmAsnRunsheetBLL bll = new BFDASrmAsnRunsheetBLL(); try { ///转报文 string msgContent = JsonHelper.ToJson(bFDASrmVmiDeliveryNoteInfos); ///获取传值内容,写在本地txt文本中 Log.WriteLogToFile("|WMS-LES-006 物料送货单 日志记录| \r\n" + msgContent.ToString() + "\r\n|Count|" + bFDASrmVmiDeliveryNoteInfos.Count.ToString().Length + "; End|", AppDomain.CurrentDomain.BaseDirectory + @"\Log\", DateTime.Now.ToString("yyyyMMddHHmm")); ///获取关键词 string keyValue = bll.GetKeyValues(bFDASrmVmiDeliveryNoteInfos); ///LOG日志 string logSql = BLL.LES.CommonBLL.GetCreateInboundLogSql("SRM", logFid, interfaceCode, keyValue, msgContent, string.Empty, string.Empty, loginUser, executeStartTime); ///添加到中间表 int dataCnt = bll.InsertListToCentreTable(bFDASrmVmiDeliveryNoteInfos, logFid, logSql); ///1成功、0失败 retInfo.ExecuteResult = (int)ResultsDescribed.Succeed; ///错误编码 retInfo.ErrorCode = string.Empty; ///描述信息 string successCode = "1x00000051";///传输成功 retInfo.MessageContent = GetMessage(ref successCode); } catch (Exception ex) { ///ESB.RESULT 0标识成功,1代表错误 retInfo.ExecuteResult = (int)ResultsDescribed.Failure; ///错误代码 string errorCode = ex.Message; ///错误消息 retInfo.MessageContent = GetMessage(ref errorCode); retInfo.ErrorCode = errorCode; /// Log.WriteLogToFile(interfaceCode + "|" + retInfo.MessageContent + "|" + retInfo.ErrorCode, AppDomain.CurrentDomain.BaseDirectory + @"\ERROR\", DateTime.Now.ToString("yyyyMMdd")); } return(retInfo); }
public InterfaceReturnInfo GetBarcodes(List <BFDAVmiBarcodeInfo> list) { /////接口代码 string interfaceCode = "WMS-LES-007"; ///回传文本 InterfaceReturnInfo retInfo = new InterfaceReturnInfo(); ///消息体 string msgContent = JsonHelper.ToJson(list); msgContent = msgContent.Replace("'", "''"); ///过滤掉容易引发错误的单引号 Log.WriteLogToFile(msgContent + "End|", AppDomain.CurrentDomain.BaseDirectory + @"\Log\", DateTime.Now.ToString("yyyyMMddHHmm")); ///开始执行时间 DateTime executeStartTime = DateTime.Now; try { ///LOG_FID Guid logFid = Guid.NewGuid(); ///箱标签操作类 BFDAVmiWmsBarcodeBLL bll = new BFDAVmiWmsBarcodeBLL(); ///关键字 ,号分隔 string keyValue = bll.GetKeyValues(list); ///执行SQL返回数量 int dataCnt = 0; ///用分布式事务处理联动的修改 using (TransactionScope trans = new TransactionScope()) { ///LOG日志 string logSql = BLL.LES.CommonBLL.GetCreateInboundLogSql("VMI", logFid, interfaceCode, keyValue, msgContent, string.Empty, string.Empty, loginUser, executeStartTime); ///添加到中间表 dataCnt = bll.InsertListToCentreTable(list, logFid, logSql); trans.Complete(); } ///1成功、0失败 retInfo.ExecuteResult = (int)ResultsDescribed.Succeed; ///错误编码 retInfo.ErrorCode = string.Empty; ///描述信息 string successCode = "1x00000051";///传输成功 retInfo.MessageContent = GetMessage(ref successCode); } catch (Exception ex) { Log.WriteLogToFile(interfaceCode + "|" + ex.Message + "|异常来源" + ex.Source + "|异常方法:" + ex.TargetSite + "|详细:" + ex.StackTrace, AppDomain.CurrentDomain.BaseDirectory + @"\ERROR\", DateTime.Now.ToString("yyyyMMdd")); ///1成功、0失败 retInfo.ExecuteResult = (int)ResultsDescribed.Failure;; /// string errorCode = ex.Message; ///错误消息 retInfo.MessageContent = GetMessage(ref errorCode); ///错误代码 retInfo.ErrorCode = errorCode; } return(retInfo); }
public InterfaceReturnInfo GetMaterialDeliveryList(List <BFDASapPartInfo> partInfos) { ///回传文本 InterfaceReturnInfo retInfo = new InterfaceReturnInfo(); ///消息体 return(retInfo); }
public InterfaceReturnInfo GetAsnOrder(List <BFDAVmiAsnRunsheetInfo> list) { /////接口代码 string interfaceCode = "WMS-LES-006"; ///开始执行时间 DateTime executeStartTime = DateTime.Now; ///日志ID Guid logFid = Guid.NewGuid(); ///中间表处理集合 BFDAVmiAsnRunsheetBLL bll = new BFDAVmiAsnRunsheetBLL(); InterfaceReturnInfo retInfo = new InterfaceReturnInfo(); try { ///转报文 string msgContent = JsonHelper.ToJson(list); ///获取传值内容,写在本地txt文本中 Log.WriteLogToFile("|WMS-LES-006 VMI.WMS.物料送货单 日志记录| \r\n" + msgContent.ToString() + "\r\n|Count|" + list.Count.ToString().Length + "; End|", AppDomain.CurrentDomain.BaseDirectory + @"\Log\", DateTime.Now.ToString("yyyyMMddHHmm")); ///关键词 string keyValue = bll.GetKeyValues(list); ///数据执行条数 int dataCnt = 0; ///分布式事务 执行写入数据库操作. using (TransactionScope tran = new TransactionScope()) { ///LOG日志 string logSql = BLL.LES.CommonBLL.GetCreateInboundLogSql("VMI", logFid, interfaceCode, keyValue, msgContent, string.Empty, string.Empty, loginUser, executeStartTime); ///添加到中间表 dataCnt = bll.InsertListToCentreTable(list, logFid, logSql); tran.Complete(); } ///1成功、0失败 retInfo.ExecuteResult = (int)ResultsDescribed.Succeed; ///错误编码 retInfo.ErrorCode = string.Empty; string successCode = "1x00000051";///传输成功 //描述信息 retInfo.MessageContent = GetMessage(ref successCode); } catch (Exception ex) { Log.WriteLogToFile(interfaceCode + "|" + retInfo.MessageContent + "|" + retInfo.ErrorCode, AppDomain.CurrentDomain.BaseDirectory + @"\ERROR\", DateTime.Now.ToString("yyyyMMdd")); ///1成功、0失败 retInfo.ExecuteResult = (int)ResultsDescribed.Failure;; /// string errorCode = ex.Message; ///错误消息 retInfo.MessageContent = GetMessage(ref errorCode); ///错误代码 retInfo.ErrorCode = errorCode; } return(retInfo); }
public InterfaceReturnInfo SetOnroadToStock(List <BFDAVmiTransitToInventoryInfo> list) { /////接口代码 string interfaceCode = "WMS-LES-013"; ///回传文本 InterfaceReturnInfo retInfo = new InterfaceReturnInfo(); BFDAVmiTransitToInventoryBLL bll = new BFDAVmiTransitToInventoryBLL(); ///开始执行时间 DateTime executeStartTime = DateTime.Now; ///LOG_FID Guid logFid = Guid.NewGuid(); try { ///转报文 string msgContent = JsonHelper.ToJson(list); ///获取传值内容,写在本地txt文本中 Log.WriteLogToFile(msgContent.ToString(), AppDomain.CurrentDomain.BaseDirectory + @"\Log\", DateTime.Now.ToString("yyyyMMddHHmm")); ///关键词 string keyValue = bll.GetKeyValues(list); ///次数 int dataCnt = 0; ///分布式事务 执行写入数据库操作. using (TransactionScope tran = new TransactionScope()) { ///LOG日志 string logSql = BLL.LES.CommonBLL.GetCreateInboundLogSql("VMI", logFid, interfaceCode, keyValue, msgContent, string.Empty, string.Empty, loginUser, executeStartTime); ///添加到中间表 dataCnt = bll.InsertListToCentreTable(list, logFid, logSql); tran.Complete(); } ///1成功、0失败 retInfo.ExecuteResult = (int)ResultsDescribed.Succeed; ///错误编码 retInfo.ErrorCode = string.Empty; ///描述信息 string successCode = "1x00000051";///传输成功 retInfo.MessageContent = GetMessage(ref successCode); } catch (Exception ex) { Log.WriteLogToFile(interfaceCode + "|" + retInfo.MessageContent + "|" + retInfo.ErrorCode, AppDomain.CurrentDomain.BaseDirectory + @"\ERROR\", DateTime.Now.ToString("yyyyMMdd")); ///1成功、0失败 retInfo.ExecuteResult = (int)ResultsDescribed.Failure;; /// string errorCode = ex.Message; ///错误消息 retInfo.MessageContent = GetMessage(ref errorCode); ///错误代码 retInfo.ErrorCode = errorCode; } return(retInfo); }
public InterfaceReturnInfo GetVmiPackageOutbound(List <BFDAApplianceOutputInfo> list) { /////接口代码 string interfaceCode = "WMS-LES-016"; ///回传文本 InterfaceReturnInfo retInfo = new InterfaceReturnInfo(); try { ///转报文 string msgContent = new XmlWrapper().ObjectToXml(list); ///获取传值内容,写在本地txt文本中 Log.WriteLogToFile("|WMS-LES-016 VMI.WMS.VMI器具出库 日志记录| \r\n" + msgContent.ToString() + "\r\n|Count|" + list.Count.ToString().Length + "; End|", AppDomain.CurrentDomain.BaseDirectory + @"\Log\", DateTime.Now.ToString("yyyyMMddHHmm")); /// //string keyValue = bll.GetKeyValues(list); /// ///分布式事务 执行写入数据库操作. using (TransactionScope tran = new TransactionScope()) { ///LOG日志 // string logSql = BLL.LES.CommonBLL.GetCreateInboundLogSql("SRM",, logFid, interfaceCode, keyValue, msgContent, string.Empty, string.Empty, loginUser, executeStartTime); ///添加到中间表 //dataCnt = bll.InsertListToCentreTable(list, logFid, logSql); tran.Complete(); } ///1成功、0失败 retInfo.ExecuteResult = (int)ResultsDescribed.Succeed; ///错误编码 retInfo.ErrorCode = string.Empty; ///描述信息 string successCode = "1x00000051";///传输成功 retInfo.MessageContent = GetMessage(ref successCode); } catch (Exception ex) { Log.WriteLogToFile(interfaceCode + "|" + retInfo.MessageContent + "|" + retInfo.ErrorCode, AppDomain.CurrentDomain.BaseDirectory + @"\ERROR\", DateTime.Now.ToString("yyyyMMdd")); ///1成功、0失败 retInfo.ExecuteResult = (int)ResultsDescribed.Failure;; /// string errorCode = ex.Message; ///错误消息 retInfo.MessageContent = GetMessage(ref errorCode); ///错误代码 retInfo.ErrorCode = errorCode; } return(retInfo); }
/// <summary> /// LES-MES-005 断点替换信息 /// </summary> /// <param name="logFid"></param> public static ExecuteResultConstants SendQmisAsnPullSheet(Guid logFid, InterfaceConfigInfo interfaceConfigInfo, ref string errorCode, ref string errorMsg, out string msgContent) { msgContent = string.Empty; InterfaceReturnInfo interfaceReturnInfo = new InterfaceReturnInfo(); Log.WriteLogToFile("The logFid|" + logFid, AppDomain.CurrentDomain.BaseDirectory + @"\log\", DateTime.Now.ToString("yyyyMMddHHmm")); List <MesBreakpointReplacementRecordInfo> qmiInfos = new MesBreakpointReplacementRecordBLL().GetList("[LOG_FID] = N'" + logFid + "' and [PROCESS_FLAG] = " + (int)ProcessFlagConstants.Untreated + "", string.Empty); if (qmiInfos.Count == 0) { errorCode = "MC:0x00000212";///经检测,传递数据为空,请确认 return(ExecuteResultConstants.Exception); } ReplacementRecord[] replacementRecord = new ReplacementRecord[qmiInfos.Count]; for (int i = 0; i < qmiInfos.Count; i++) { ReplacementRecord replacement = new ReplacementRecord(); replacement.ORDERNO = qmiInfos[i].Orderno; replacement.OLDPARTNO = qmiInfos[i].Oldpartno; replacement.NEWPARTNO = qmiInfos[i].Newpartno; replacement.OLDSUPPLIER = qmiInfos[i].Oldsupplier; replacement.NEWSUPPLIER = qmiInfos[i].Newsupplier; replacement.OLDSTATION = qmiInfos[i].Oldstation; replacement.NEWSTATION = qmiInfos[i].Newstation; replacement.OLDQTY = qmiInfos[i].Oldqty.GetValueOrDefault(); replacement.NEWQTY = qmiInfos[i].Newqty.GetValueOrDefault(); replacement.REPLACETIME = qmiInfos[i].Replacetime.GetValueOrDefault(); replacementRecord[i] = replacement; } ///发送内容 msgContent = new XmlWrapper().ObjectToXml(replacementRecord, false); LESMESlocal.LESWebServiceSoapClient client = new LESWebServiceSoapClient(); client.Endpoint.Address = new EndpointAddress(interfaceConfigInfo.CallUrl); InterfaceCallbackInfo backinfo = client.GetReplacementRecord(replacementRecord); Log.WriteLogToFile("返回结果:errorCode:" + errorCode + "; msgContent:" + errorMsg, AppDomain.CurrentDomain.BaseDirectory + @"\log\", DateTime.Now.ToString("yyyyMMddHHmm")); if (backinfo.RESULT == 0) { errorCode = backinfo.MSGNO; errorMsg = backinfo.MSG; return(ExecuteResultConstants.Error); } return(ExecuteResultConstants.Success); }
public InterfaceReturnInfo GetSapMaintainPart(List <BFDASapPartInfo> partInfos) { ///接口代码 string interfaceCode = "SAP-LES-001"; ///回传文本 InterfaceReturnInfo retInfo = new InterfaceReturnInfo(); if (partInfos.Count() == 0) { string errorCode = "0x00000463"; ///错误消息 retInfo.MessageContent = GetMessage(ref errorCode); retInfo.ErrorCode = errorCode; ///ESB.RESULT 0标识成功,1代表错误 retInfo.ExecuteResult = (int)ResultsDescribed.Failure; return(retInfo); } ///消息体 string msgContent = JsonHelper.ToJson(partInfos); Log.WriteLogToFile(logFlag, interfaceCode + "-MsgContent:|" + msgContent, AppDomain.CurrentDomain.BaseDirectory + @"\log\", DateTime.Now.ToString("yyyyMMdd")); ///开始执行时间 DateTime executeStartTime = DateTime.Now; try { ///LOG_FID Guid logFid = Guid.NewGuid(); /// BFDASapPartBLL bll = new BFDASapPartBLL(); ///关键字 ,号分隔 string keyValue = bll.GetKeyValues(partInfos); /// int dataCnt = 0; ///用分布式事务处理联动的修改 using (TransactionScope trans = new TransactionScope()) { ///LOG日志 string logSql = BLL.LES.CommonBLL.GetCreateInboundLogSql("SAP", logFid, interfaceCode, keyValue, msgContent, string.Empty, string.Empty, loginUser, executeStartTime); ///添加到中间表 dataCnt = bll.InsertListToCentreTable(partInfos, logFid, logSql); trans.Complete(); } ///提示代码 retInfo.ErrorCode = string.Empty; ///错误消息 string successCode = "1x00000051";///传输成功 retInfo.MessageContent = GetMessage(ref successCode); ///ESB.RESULT 0标识成功,1代表错误 retInfo.ExecuteResult = (int)ResultsDescribed.Succeed; } catch (Exception ex) { Log.WriteLogToFile(interfaceCode + "|" + ex.Message, AppDomain.CurrentDomain.BaseDirectory + @"\ERROR\", DateTime.Now.ToString("yyyyMMdd")); ///错误代码 string errorCode = ex.Message; ///错误消息 retInfo.MessageContent = GetMessage(ref errorCode); ///错误码 retInfo.ErrorCode = errorCode; ///ESB.RESULT 0标识成功,1代表错误 retInfo.ExecuteResult = (int)ResultsDescribed.Failure; } return(retInfo); }