Browse Source

泽天出货标签打印,新标签样式查询料号规则调整

caosy 6 months ago
parent
commit
0559b516ed
1 changed files with 17 additions and 4 deletions
  1. 17 4
      UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

+ 17 - 4
UAS-出货标签管理(泽天)/UAS_出货标签管理.cs

@@ -281,6 +281,7 @@ namespace UAS_LabelMachine
 
 
                 SplitData2 = Input.Text.Split(System.Convert.ToChar(29));//< GS >
                 SplitData2 = Input.Text.Split(System.Convert.ToChar(29));//< GS >
                 SplitData2 = Regex.Split(Input.Text, "<GS>", RegexOptions.IgnoreCase);
                 SplitData2 = Regex.Split(Input.Text, "<GS>", RegexOptions.IgnoreCase);
+                String qty;
                 for (int i = 0; i < SplitData2.Length; i++)
                 for (int i = 0; i < SplitData2.Length; i++)
                 {
                 {
                     Console.WriteLine(SplitData2[i]);
                     Console.WriteLine(SplitData2[i]);
@@ -298,13 +299,25 @@ namespace UAS_LabelMachine
                 }
                 }
                 else
                 else
                 {
                 {
-                    if (dh.CheckExist("product", "pr_code = '" + SplitData2[2].Substring(3, SplitData2[2].Length - 3) + "-" + SplitData2[2].Substring(SplitData2[2].Length - 3, 3) + "'"))
+
+                    String qtycheck = SplitData2[3].Substring(1, SplitData2[3].Length - 1).Split('/')[0];
+
+                    try
+                    {
+                        qty = SplitData2[3].Substring(1, SplitData2[3].Length - 1).Split('/')[1];
+                    }
+                    catch
+                    {
+                        qty = SplitData2[3].Substring(1, SplitData2[3].Length - 1).Split('/')[0];
+                    }
+
+                    if (dh.CheckExist("product", "pr_code = '" + SplitData2[2].Substring(3, SplitData2[2].Length - 3) + "-" + SplitData2[1].Substring(SplitData2[1].Length - 3, 3) + "'"))
                     {
                     {
                         Data.Add("PRCODE", SplitData2[2].Substring(3, SplitData2[2].Length - 3) + "-" + SplitData2[1].Substring(SplitData2[1].Length - 3, 3));
                         Data.Add("PRCODE", SplitData2[2].Substring(3, SplitData2[2].Length - 3) + "-" + SplitData2[1].Substring(SplitData2[1].Length - 3, 3));
                     }
                     }
-                    else if (dh.CheckExist("product", "pr_specvalue = '" + SplitData2[2].Substring(3, SplitData2[2].Length - 3) + "' and pr_nexbzs_user = '" + SplitData2[3].Substring(1, SplitData2[3].Length - 1) + "' "))
+                    else if (dh.CheckExist("product", "pr_specvalue = '" + SplitData2[2].Substring(3, SplitData2[2].Length - 3) + "' and pr_nexbzs_user = '" + qtycheck + "' "))
                     {
                     {
-                        Data.Add("PRCODE", dh.getFieldDataByCondition("product", "pr_code", "pr_specvalue = '" + SplitData2[2].Substring(3, SplitData2[2].Length - 3) + "' and pr_nexbzs_user = '" + SplitData2[3].Substring(1, SplitData2[3].Length - 1) + "'").ToString());
+                        Data.Add("PRCODE", dh.getFieldDataByCondition("product", "pr_code", "pr_specvalue = '" + SplitData2[2].Substring(3, SplitData2[2].Length - 3) + "' and pr_nexbzs_user = '" + qtycheck + "'").ToString());
                     }
                     }
                     else
                     else
                     {
                     {
@@ -312,7 +325,7 @@ namespace UAS_LabelMachine
                     }
                     }
                 }
                 }
 
 
-                Data.Add("QTY", SplitData2[3].Substring(1, SplitData2[3].Length - 1));
+                Data.Add("QTY", qty);
 
 
                 Data.Add("DATECODE", SplitData2[4].Substring(2, SplitData2[4].Length - 2));
                 Data.Add("DATECODE", SplitData2[4].Substring(2, SplitData2[4].Length - 2));