Browse Source

优化测试项

callm 1 week ago
parent
commit
dabef79e23
1 changed files with 24 additions and 8 deletions
  1. 24 8
      UAS_MES_JH/FunctionCode/Make/Make_TestCollectionqrcode.cs

+ 24 - 8
UAS_MES_JH/FunctionCode/Make/Make_TestCollectionqrcode.cs

@@ -23,6 +23,7 @@ using UAS_MES_NEW.PublicForm;
 using System.Security.Cryptography;
 using System.Net;
 using static NPOI.HSSF.Util.HSSFColor;
+using NPOI.SS.Formula.Functions;
 
 namespace UAS_MES_NEW.Make
 {
@@ -230,6 +231,13 @@ namespace UAS_MES_NEW.Make
                             OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, ms_sncode);
                             return;
                         }
+                        string nextstepcode = dh.getFieldDataByCondition("makeserial", "ms_nextstepcode", "ms_id='" + oMSID + "'").ToString();
+                        if (nextstepcode != User.CurrentStepCode)
+                        {
+                            string stname = dh.getFieldDataByCondition("step", "st_name", "st_code='" + nextstepcode + "'").ToString();
+                            OperateResult.AppendText("<<序列号:" + ms_sncode.Text + "下一工序是" + stname + ",不是当前岗位的工序\n", Color.Red, ms_sncode);
+                            return;
+                        }
                         if (ma_code.Text != oMakeCode && oMakeCode != null)
                         {
                             dt = (DataTable)dh.ExecuteSql("select ma_code,ma_prodcode,ma_softversion,ma_salecode,pr_spec,nvl(pr_sendchecktype,'LineCode')pr_sendchecktype,ma_qty from make left join product on ma_prodcode=pr_code where ma_code='" + oMakeCode + "'", "select");
@@ -280,15 +288,23 @@ namespace UAS_MES_NEW.Make
                             OperateResult.AppendText("<<序列号:" + ms_sncode.Text + " MMI2信息异常\n", Color.Red);
                             return;
                         }
-                        if (dh.CheckExist("product", "pr_code  = '" + ma_prodcode.Text + "' and pr_volume = -1 ") && !bt.Contains("UNKNOWN"))
+                        if (dh.CheckExist("product", "pr_code  = '" + ma_prodcode.Text + "' and pr_volume = -1 "))
                         {
-                            OperateResult.AppendText("<<序列号:" + ms_sncode.Text + " BT信息异常\n", Color.Red);
-                            return;
+                            bool shouldNotIntercept = !string.IsNullOrEmpty(bt) && bt.Contains("UNKNOWN");
+                            if (!shouldNotIntercept)  // 若不满足不拦截条件,则拦截
+                            {
+                                OperateResult.AppendText("<<序列号:" + ms_sncode.Text + " BT信息异常\n", Color.Red);
+                                return;
+                            }
                         }
-                        if (dh.CheckExist("product", "pr_code  = '" + ma_prodcode.Text + "' and pr_height = -1 ") && !mac.Contains("UNKNOWN"))
+                        if (dh.CheckExist("product", "pr_code  = '" + ma_prodcode.Text + "' and pr_height = -1 ") )
                         {
-                            OperateResult.AppendText("<<序列号:" + ms_sncode.Text + " WIFI信息异常\n", Color.Red);
-                            return;
+                            bool shouldNotIntercept = !string.IsNullOrEmpty(bt) && mac.Contains("UNKNOWN");
+                            if (!shouldNotIntercept)  // 若不满足不拦截条件,则拦截
+                            {
+                                OperateResult.AppendText("<<序列号:" + ms_sncode.Text + " BT信息异常\n", Color.Red);
+                                return;
+                            }
                         }
                         if (dh.CheckExist("product", "pr_code  = '" + ma_prodcode.Text + "' and pr_palletheight = -1 ") && othid.Contains("UNKNOWN"))
                         {
@@ -303,7 +319,7 @@ namespace UAS_MES_NEW.Make
                         }
 
                         listmac = dh.getFieldDataByCondition("makeserial", "ms_sncode", "ms_mac='" + mac + "' and  ms_sncode <>'" + ms_sncode.Text + "'").ToString();
-                        if (listmac != "")
+                        if (listmac != ""&& dh.CheckExist("product", "pr_code  = '" + ma_prodcode.Text + "' and pr_palletheight = -1 "))
                         {
                             OperateResult.AppendText("<<序列号:" + listmac + " 已使用MAC:[" + mac + "]\n", Color.Red);
                             return;
@@ -317,7 +333,7 @@ namespace UAS_MES_NEW.Make
                         }
 
                         listbt = dh.getFieldDataByCondition("makeserial", "ms_sncode", "ms_mac='" + bt + "' and ms_sncode <>'" + ms_sncode.Text + "'").ToString();
-                        if (listbt != "")
+                        if (listbt != ""&& dh.CheckExist("product", "pr_code  = '" + ma_prodcode.Text + "' and pr_volume = -1 "))
                         {
                             OperateResult.AppendText("<<序列号:" + listbt + " 已使用BT:[" + bt + "]\n", Color.Red);
                             return;