Browse Source

条码前缀多个满足一个即可

shim 8 years ago
parent
commit
6c0af32839
1 changed files with 13 additions and 1 deletions
  1. 13 1
      UAS-MES/PublicMethod/LogicHandler.cs

+ 13 - 1
UAS-MES/PublicMethod/LogicHandler.cs

@@ -1155,7 +1155,19 @@ namespace UAS_MES.PublicMethod
                     break;
                 case "RULE":
                     int sp_length = int.Parse(iLength != "" ? iLength : "0");
-                    if (iSN.StartsWith(iPrefix) || iPrefix == "")
+                    //若有多个,以|分割
+                    string[] pres = iPrefix.Split('|');
+                    bool f = false;
+                    for (int i=0;i<pres.Length;i++)
+                    {
+                        if (pres[i] == "" ? true : iSN.StartsWith(pres[i]))
+                        {
+                            //满足其中一条即可
+                            f = true;
+                            break;
+                        }
+                    }
+                    if (f)
                     {
                         //进行长度匹配
                         if (iSN.Length == sp_length || sp_length == 0)