Hcsy 8 years ago
parent
commit
19d1637a92

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.cs

@@ -205,7 +205,7 @@ namespace UAS_MES.Make
                 {
                 {
                     dh.ExecuteSql("update package set pa_printcount=pa_printcount+1 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
                     dh.ExecuteSql("update package set pa_printcount=pa_printcount+1 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
                     doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text);
                     doc = lbl.Documents.Open(ftpOperater.DownLoadTo + PrintLabel.Text);
-                    if (Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), oMakeCode, pr_code.Text, "卡通箱标", "0", out ErrorMessage))
+                    if (Print.CodeSoft(Tag.ToString(), doc, PrintLabel.Text, PrintLabel.SelectedValue.ToString(), PrintList.Text, pa_outboxcode.Text, int.Parse(PrintNum.Text), oMakeCode == "" ? pa_makecode.Text : oMakeCode, pr_code.Text, "卡通箱标", "0", out ErrorMessage))
                     {
                     {
                         OperateResult.AppendText(">>开始打印箱号" + pa_outboxcode.Text + "\n", Color.Black);
                         OperateResult.AppendText(">>开始打印箱号" + pa_outboxcode.Text + "\n", Color.Black);
                     }
                     }

+ 10 - 1
UAS-MES/PublicMethod/Print.cs

@@ -20,10 +20,19 @@ namespace UAS_MES.PublicMethod
 
 
         public Print() { }
         public Print() { }
 
 
+
         public static bool CodeSoft(string iCaller, Document doc, string LabelName, string LaID, string PrinterName, string SnCode, int PrintNum, string MakeCode, string ProdCode, string LabelType, string IfRePrint, out string ErrorMessage)
         public static bool CodeSoft(string iCaller, Document doc, string LabelName, string LaID, string PrinterName, string SnCode, int PrintNum, string MakeCode, string ProdCode, string LabelType, string IfRePrint, out string ErrorMessage)
         {
         {
             ErrorMessage = "";
             ErrorMessage = "";
-            DataTable dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_makecode='" + MakeCode + "' and lpl_type='" + LabelType + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
+            DataTable dt = new DataTable();
+            if (LabelType == "卡通箱标" || LabelType == "大箱标" || LabelType == "栈板标")
+            {
+                dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_type='" + LabelType + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
+            }
+            else
+            {
+                dt = (DataTable)dh.ExecuteSql("select lpl_id from labelprintlog where lpl_value='" + SnCode + "' and lpl_makecode='" + MakeCode + "' and lpl_type='" + LabelType + "' and lpl_stepcode='" + User.CurrentStepCode + "'", "select");
+            }
             //如果已经打印过了,则不允许再打印
             //如果已经打印过了,则不允许再打印
             if (dt.Rows.Count > 0)
             if (dt.Rows.Count > 0)
             {
             {