Forráskód Böngészése

Merge repos.ubtob.net:usoft/mes-client

callm 5 napja
szülő
commit
6b59e5d1bc

+ 29 - 3
UAS_MES_HYSX/FunctionCode/Make/Make_ListenSocket.cs

@@ -129,7 +129,32 @@ namespace UAS_MES_NEW.Make
                     JObject dataObj = JObject.Parse(dataString);
                     string serial = dataObj["Serial"].ToString();
 
-                    ShowMsg(1, $"第{currCount}次接收,客户端:{e.ClientId}, {name}类型信息, 序列号: {serial}");
+                    string mesSuc = "0", mesMsg = "";
+                    SQL.Clear();
+                    SQL.Append($@"select * from makeprocess where mp_sncode = '{serial}' and mp_stepcode = '{User.CurrentStepCode}'"); // 本站过站记录
+                    dt = (DataTable)dh.ExecuteSql(SQL.ToString(), "select");
+                    if (dt.Rows.Count > 0)
+                    {
+                        mesSuc = "1";
+                        mesMsg = "已重复过站";
+
+                        SQL.Clear();
+                        SQL.Append($@"select * from makeserial where ms_sncode = '{serial}' and ms_nextstepcode = '{User.CurrentStepCode}'"); // 站位回退可烧录
+                        dt = (DataTable)dh.ExecuteSql(SQL.ToString(), "select");
+                        if (dt.Rows.Count > 0)
+                        {
+                            mesSuc = "0";
+                            mesMsg = "";
+                        }
+                    }
+                    else
+                    {
+                        mesSuc = "0";
+                    }
+
+                    //ShowMsg(1, $"第{currCount}次接收,客户端:{e.ClientId}, {name}类型信息, 序列号: {serial}");
+                    ShowMsg(1, $"第{currCount}次接收,客户端:{e.ClientId}, {name}类型信息({e.Message})");
+
                     if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, serial, User.UserCode, out omakeCode, out oMsid, out oErrorMessage))
                     {
                         if (LogicHandler.SetStepResult(omakeCode, User.UserSourceCode, serial, "产测软件对接", "OK", User.UserCode, out oErrorMessage))
@@ -137,7 +162,7 @@ namespace UAS_MES_NEW.Make
                             LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, omakeCode, User.UserLineCode, User.UserSourceCode, "产测软件对接", "产测软件对接成功", serial, "");
 
                             ShowMsg(1, $"序列号: {serial} 过站处理成功");
-                            FirstStepPaseJSON(e.ClientId, currCount, serial, "0", "");
+                            FirstStepPaseJSON(e.ClientId, currCount, serial, mesSuc, mesMsg);
                         }
                         else
                         {
@@ -643,7 +668,8 @@ namespace UAS_MES_NEW.Make
                         new { ClientId = clientId, ClientSocket = clientSocket });
 
                     string result2 = BitConverter.ToString(packet).Replace("-", " ");
-                    return $"OK,发送成功,JSON长度: {jsonMessage.Length}, 报文总字节: {packet.Length} 到 {clientId},({result2})({jsonMessage})";
+                    //return $"OK,发送成功,JSON长度: {jsonMessage.Length}, 报文总字节: {packet.Length} 到 {clientId},({result2})({jsonMessage})";
+                    return $"OK,发送成功,JSON长度: {jsonMessage.Length}, 报文总字节: {packet.Length} 到 {clientId},({jsonMessage})";
 
                     //byte[] jsonBytes = Encoding.Unicode.GetBytes(jsonMessage);
                     //clientSocket.BeginSend(jsonBytes, 0, jsonBytes.Length, SocketFlags.None,

+ 1 - 0
UAS_MES_JWS/FunctionCode/Packing/Packing_PackageCollection_T.cs

@@ -893,6 +893,7 @@ namespace UAS_MES_NEW.Packing
                                 }
                                 //更新序列号状态
                                 //SQLS1.Add("update makeserial set ms_status=1,ms_outboxcode='',ms_nextstepcode= (case when ms_nextstepcode='" + User.CurrentStepCode + "' then ms_nextstepcode else ms_stepcode end ),ms_paststep=replace(ms_paststep,'," + User.CurrentStepCode + "','') where ms_outboxcode='" + pa_outboxcode.Text + "'");
+                                SQLS1.Add("update makeserial set ms_status=1,ms_outboxcode='',ms_paststep=replace(ms_paststep,'," + User.CurrentStepCode + "','') where ms_outboxcode='" + pa_outboxcode.Text + "'");
                                 //抽检批次不为空的时候进行移除
                                 dh.ExecuteSQLTran(SQLS1.ToArray());
                                 string prcode = dh.getFieldDataByCondition("packagedetail", "pd_prodcode", "pd_outboxcode = '" + pa_outboxcode.Text + "'").ToString();