瀏覽代碼

Merge branch 'master' of ssh://10.10.101.21/source/mes-client

章政 8 年之前
父節點
當前提交
cfd40e23ea

+ 1 - 0
UAS-MES/FunctionCode/Make/Make_BigBoxWeight.cs

@@ -255,6 +255,7 @@ namespace UAS_MES.Make
                 SystemInf.OpenPort.Remove(serialPort1.PortName);
                 thread.Interrupt();
             }
+            thread.Abort();
         }
 
         private void PrintLabel_SelectedValueChanged(object sender, EventArgs e)

+ 1 - 0
UAS-MES/FunctionCode/Make/Make_CartonBoxWeigh.cs

@@ -237,6 +237,7 @@ namespace UAS_MES.Make
                 SystemInf.OpenPort.Remove(serialPort1.PortName);
                 thread.Interrupt();
             }
+            thread.Abort();
         }
 
         private void StartWeight_Click(object sender, EventArgs e)

+ 2 - 12
UAS-MES/FunctionCode/Make/Make_CollectBTMAC.cs

@@ -90,19 +90,9 @@ namespace UAS_MES.Make
                         }
                         if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage2))
                         {
-                            //判断界面工单是否为空时的序列号是否自动归属工单
-                            string oStatus = "";
-                            if (!LogicHandler.GetMakeInfo(sncode.Text, out oMakeCode, out oStatus, out ErrorMessage2))
-                            {
-                                if (ms_makecode.Text == "")
-                                {
-                                    OperateResult.AppendText(">>" + ErrorMessage2 + "\n", Color.Red, sncode);
-                                    return;
-                                }
-                            }
-                            OperateResult.AppendText("<<" + sncode.Text + "\n", Color.Black);
+                             OperateResult.AppendText("<<" + sncode.Text + "\n", Color.Black);
                             // 获取工单归属工单下一工序是否正确
-                            if (LogicHandler.CheckStepSNAndMacode(ms_makecode.Text == "" ? oMakeCode : ms_makecode.Text, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage2))
+                            if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage2))
                             {
                                 sql.Clear();
                                 sql.Append("select ma_code as ms_makecode,nvl(mcd_okqty,0),ma_prodcode,pr_detail,");

+ 1 - 0
UAS-MES/FunctionCode/Make/Make_ColorBoxWeigh.cs

@@ -234,6 +234,7 @@ namespace UAS_MES.Make
                 thread.Interrupt();
                 thread.Join();
             }
+            thread.Abort();
         }
 
         private void Confirm_Click(object sender, EventArgs e)

+ 1 - 0
UAS-MES/FunctionCode/Make/Make_PalletWeigh.cs

@@ -269,6 +269,7 @@ namespace UAS_MES.Make
                 SystemInf.OpenPort.Remove(serialPort1.PortName);
                 thread.Interrupt();
             }
+            thread.Abort();
         }
         private void recordResult(string palletcode, string weigh, string time)
         {

+ 1 - 0
UAS-MES/FunctionCode/Make/Make_SpecialCartonPack.cs

@@ -339,6 +339,7 @@ namespace UAS_MES.Make
                 SystemInf.OpenPort.Remove(serialPort1.PortName);
                 thread.Interrupt();
             }
+            thread.Abort();
             dh.Dispose();
         }
 

+ 17 - 3
UAS-MES/FunctionCode/Make/Make_UpdateCollectCode.cs

@@ -25,6 +25,8 @@ namespace UAS_MES.Make
 
         DataTable info;
 
+        DataTable macRange;
+
         int step = 0;
 
         List<CheckBox> list = new List<CheckBox>();//记录勾选的控件
@@ -159,10 +161,22 @@ namespace UAS_MES.Make
                             else
                             {
                                 //判断是否有合同号MAC范围
-                                if (dh.CheckExist("SaleMacBTRange", "sr_sacode='" + dt.Rows[0]["ms_salecode"].ToString() + "' and sr_type='" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + "'"))
+                                //if (dh.CheckExist("SaleMacBTRange", "sr_sacode='" + dt.Rows[0]["ms_salecode"].ToString() + "' and sr_type='" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + "'"))
+                                //{
+                                //    //有范围的情况下看是否在范围内
+                                //    if (!dh.CheckExist("SaleMacBTRange", "sr_sacode='" + dt.Rows[0]["ms_salecode"].ToString() + "' and  sr_type='" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + "' AND  '" + inputValue.Text.Replace(":", "").Replace("-", "") + "' between sr_startcode and sr_endcode"))
+                                //    {
+                                //        OperateResult.AppendText("<<" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + ":" + inputValue.Text + "错误,不在合同防呆范围内\n", Color.Red, inputValue);
+                                //        OperateResult.AppendText(">>请采集" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + "\n", Color.Black);
+                                //        return;
+                                //    }
+                                //}
+                                sql.Clear();
+                                sql.Append("select sr_startcode,sr_endcode from SaleMacBTRange where sr_sacode = '" + dt.Rows[0]["ms_salecode"].ToString() + "' and sr_type = '"+ ((CheckBox)list[step - 1]).Text.Split('/')[0] + "'");
+                                macRange = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                                if (macRange.Rows.Count > 0)
                                 {
-                                    //有范围的情况下看是否在范围内
-                                    if (!dh.CheckExist("SaleMacBTRange", "sr_sacode='" + dt.Rows[0]["ms_salecode"].ToString() + "' and  sr_type='" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + "' AND  '" + inputValue.Text + "' between sr_startcode and sr_endcode"))
+                                    if (!(macRange.Rows[0]["sr_startcode"].ToString().Replace(":", "").Replace("-", "").CompareTo(inputValue.Text.Replace(":", "").Replace("-", "")) <= 0 && macRange.Rows[0]["sr_endcode"].ToString().Replace(":", "").Replace("-", "").CompareTo(inputValue.Text.Replace(":", "").Replace("-", "")) >= 0))
                                     {
                                         OperateResult.AppendText("<<" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + ":" + inputValue.Text + "错误,不在合同防呆范围内\n", Color.Red, inputValue);
                                         OperateResult.AppendText(">>请采集" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + "\n", Color.Black);

+ 1 - 0
UAS-MES/FunctionCode/SystemSetting/SystemSetting_ScaleTest.cs

@@ -96,6 +96,7 @@ namespace UAS_MES.SystemSetting
             StopTest.PerformClick();
             try { ReadData = false; }
             catch (Exception) { }
+            thread.Abort();
         }
 
         private void StopTest_Click(object sender, EventArgs e)