diff --git a/ServicesCenter/WCF/OpcServerHost/OpcDeal/ParaInit.cs b/ServicesCenter/WCF/OpcServerHost/OpcDeal/ParaInit.cs index e6b7b78..14d2566 100644 --- a/ServicesCenter/WCF/OpcServerHost/OpcDeal/ParaInit.cs +++ b/ServicesCenter/WCF/OpcServerHost/OpcDeal/ParaInit.cs @@ -17,6 +17,7 @@ using QMFrameWork.Data; using QMAPP.FJC.Entity.Operation; using OpcServerHost.WebServiceForOpc; using QMAPP.FJC.Entity.QT; +using System.Text; namespace OpcServerHost.Init { @@ -746,11 +747,20 @@ namespace OpcServerHost.Init if (result != null) { - parameter.PARAVALUE = result; + ASCIIEncoding asciiEncoding = new ASCIIEncoding(); + var product_str = result.ToString().Replace("[","").Replace("]", "").Split('.'); + var count = Convert.ToInt32(product_str[1]) - 1; + var productCode = ""; + for (int c = 0; c <= count; c++) + { + byte[] byteArray = new byte[] { Convert.ToByte(product_str[c + 2]) }; + productCode += asciiEncoding.GetString(byteArray); + } + parameter.PARAVALUE = productCode; } Console.WriteLine(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "Get Barcode " + " " + parameter.MACHINECODDE + ":" + parameter.MOLDNUMBER + ":" + parameter.COLUMNCODE + " " + ((result == null) ? " " : result.ToString()), currentPC.MACHINECODDE); - WriteLog.Write(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "Get Barcode " + ":" + parameter.COLUMNCODE + " " + ((result == null) ? " " : result.ToString()), currentPC.MACHINECODDE); + WriteLog.Write(System.DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "Get Barcode " + ":" + parameter.PARAVALUE + " " + ((result == null) ? " " : result.ToString()), currentPC.MACHINECODDE); getParaList.Add(parameter);