Browse Source

添加参数用到LotNo和DateCode未赋值的提醒

章政 5 years ago
parent
commit
b64d5707e4

+ 3 - 1
UAS-出货标签管理(贸易版)/Entity/SystemInf.cs

@@ -7,8 +7,10 @@ namespace UAS_LabelMachine.Entity
 {
     class SystemInf
     {
-       public static DataHelper dh;
+        public static DataHelper dh;
 
         public static SqliteDBHelper sdh;
+
+        public static bool CheckDcAndLotNo = false;
     }
 }

+ 40 - 9
UAS-出货标签管理(贸易版)/PublicMethod/Print.cs

@@ -5,6 +5,7 @@ using System.Collections.Generic;
 using System.Data;
 using System.Linq;
 using System.Text;
+using System.Windows.Forms;
 using UAS_LabelMachine.Entity;
 
 namespace UAS_LabelMachine.PublicMethod
@@ -204,9 +205,19 @@ namespace UAS_LabelMachine.PublicMethod
                     }
                     if (SingleFormat.SubStrings[j].Value == "")
                     {
-                        dr1 = UAS_出货标签打印.Attach.Select("lp_name='" + SingleFormat.SubStrings[j].Name + "'");
-                        if (dr1.Length > 0)
-                            SingleFormat.SubStrings[j].Value = dr1[0]["lp_sql"].ToString();
+                        DataRow[] dr2 = UAS_出货标签打印.Attach.Select("lp_name='" + SingleFormat.SubStrings[j].Name + "'");
+                        if (dr2.Length > 0)
+                            SingleFormat.SubStrings[j].Value = dr2[0]["lp_sql"].ToString();
+                    }
+                    //启用了校验Dc和LotNo不为空的设置
+                    if (SystemInf.CheckDcAndLotNo && dr1.Length > 0 && SingleFormat.SubStrings[j].Value == "")
+                    {
+                        //如果SQL用到了DC和LotNo字段
+                        if ((dr1[0]["lp_sql"].ToString().Contains("pib_lotno") || dr1[0]["lp_sql"].ToString().Contains("pib_datecode")))
+                        {
+                            MessageBox.Show("标签含有DC或者LotNo参数未赋值,请采集数据");
+                            return;
+                        }
                     }
                 }
                 try
@@ -263,9 +274,19 @@ namespace UAS_LabelMachine.PublicMethod
                     }
                     if (MidFormat.SubStrings[j].Value == "")
                     {
-                        dr1 = UAS_出货标签打印.Attach.Select("lp_name='" + MidFormat.SubStrings[j].Name + "'");
-                        if (dr1.Length > 0)
-                            MidFormat.SubStrings[j].Value = dr1[0]["lp_sql"].ToString();
+                        DataRow[] dr2 = UAS_出货标签打印.Attach.Select("lp_name='" + MidFormat.SubStrings[j].Name + "'");
+                        if (dr2.Length > 0)
+                            MidFormat.SubStrings[j].Value = dr2[0]["lp_sql"].ToString();
+                    }
+                    //启用了校验Dc和LotNo不为空的设置
+                    if (SystemInf.CheckDcAndLotNo && dr1.Length > 0 && MidFormat.SubStrings[j].Value == "")
+                    {
+                        //如果SQL用到了DC和LotNo字段
+                        if ((dr1[0]["lp_sql"].ToString().Contains("pib_lotno") || dr1[0]["lp_sql"].ToString().Contains("pib_datecode")))
+                        {
+                            MessageBox.Show("标签含有DC或者LotNo参数未赋值,请采集数据");
+                            return;
+                        }
                     }
                 }
                 try
@@ -328,9 +349,19 @@ namespace UAS_LabelMachine.PublicMethod
                         }
                         if (OutFormat.SubStrings[j].Value == "")
                         {
-                            dr1 = UAS_出货标签打印.Attach.Select("lp_name='" + OutFormat.SubStrings[j].Name + "'");
-                            if (dr1.Length > 0)
-                                OutFormat.SubStrings[j].Value = dr1[0]["lp_sql"].ToString();
+                            DataRow[] dr2 = UAS_出货标签打印.Attach.Select("lp_name='" + OutFormat.SubStrings[j].Name + "'");
+                            if (dr2.Length > 0)
+                                OutFormat.SubStrings[j].Value = dr2[0]["lp_sql"].ToString();
+                        }
+                        //启用了校验Dc和LotNo不为空的设置
+                        if (SystemInf.CheckDcAndLotNo && dr1.Length > 0 && OutFormat.SubStrings[j].Value == "")
+                        {
+                            //如果SQL用到了DC和LotNo字段
+                            if ((dr1[0]["lp_sql"].ToString().Contains("pib_lotno") || dr1[0]["lp_sql"].ToString().Contains("pib_datecode")))
+                            {
+                                MessageBox.Show("标签含有DC或者LotNo参数未赋值,请采集数据");
+                                return;
+                            }
                         }
                     }
                     try

+ 2 - 1
UAS-出货标签管理(贸易版)/UAS_出货标签管理.cs

@@ -245,6 +245,7 @@ namespace UAS_LabelMachine
             asc.controllInitializeSize(this);
             asc.controlAutoSize(this);
             string Code = dh.GetConfig("PrintMethod", "CodeOrBar").ToString();
+            SystemInf.CheckDcAndLotNo = dh.GetConfig("PrintCheck", "CheckDcAndLotNo").ToString() == "" ? false : true;
             if (Code == "")
             {
                 try
@@ -2548,7 +2549,7 @@ namespace UAS_LabelMachine
                         {
                             ////使用该出货单明细行数量,并且数量置为0
                             pd_outqty = outsumqty[pr_spec][pd_pdno];
-                        }   
+                        }
                         string pib_barcode = dh.getFieldDataByCondition("prodiobarcode", "max(pib_barcode)", "PIB_INOUTNO='" + pi_inoutno.Text + "'").ToString();
                         if (pd_outqty % zxbzs != 0)
                         {

+ 32 - 23
UAS-出货标签管理(贸易版)/生成条码.Designer.cs

@@ -35,6 +35,8 @@
             this.pr_kind_label = new System.Windows.Forms.Label();
             this.pr_kind = new System.Windows.Forms.ComboBox();
             this.MidCapacity_label = new System.Windows.Forms.Label();
+            this.label1 = new System.Windows.Forms.Label();
+            this.ResetSerialNum = new UAS_LabelMachine.CustomControl.NormalButton();
             this.SetMidCapacity = new UAS_LabelMachine.CustomControl.NormalButton();
             this.MidCapacity = new UAS_LabelMachine.CustomControl.NumOnlyTextBox();
             this.ChooseAll = new UAS_LabelMachine.CustomControl.ChooseAllButton();
@@ -42,8 +44,6 @@
             this.Screen = new UAS_LabelMachine.CustomControl.NormalButton();
             this.ProdIoInfDGV = new UAS_LabelMachine.CustomControl.DataGridViewWithSerialNum();
             this.pi_inoutno = new UAS_LabelMachine.CustomControl.EnterTextBox();
-            this.ResetSerialNum = new UAS_LabelMachine.CustomControl.NormalButton();
-            this.label1 = new System.Windows.Forms.Label();
             this.Choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             this.pd_orderdetno = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pd_pdno = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -53,6 +53,7 @@
             this.pr_detail = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pd_ordercode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pr_orispeccode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_pocode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pr_brand = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pr_unit = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pd_totalqty = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -127,6 +128,27 @@
             this.MidCapacity_label.TabIndex = 158;
             this.MidCapacity_label.Text = "中盘容量";
             // 
+            // label1
+            // 
+            this.label1.AutoSize = true;
+            this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.label1.Location = new System.Drawing.Point(795, 81);
+            this.label1.Name = "label1";
+            this.label1.Size = new System.Drawing.Size(146, 21);
+            this.label1.TabIndex = 162;
+            this.label1.Text = "尾数用 , (逗号)分割";
+            // 
+            // ResetSerialNum
+            // 
+            this.ResetSerialNum.Image = ((System.Drawing.Image)(resources.GetObject("ResetSerialNum.Image")));
+            this.ResetSerialNum.Location = new System.Drawing.Point(604, 78);
+            this.ResetSerialNum.Name = "ResetSerialNum";
+            this.ResetSerialNum.Size = new System.Drawing.Size(64, 24);
+            this.ResetSerialNum.TabIndex = 161;
+            this.ResetSerialNum.Text = "流水重置";
+            this.ResetSerialNum.UseVisualStyleBackColor = true;
+            this.ResetSerialNum.Click += new System.EventHandler(this.ResetSerialNum_Click);
+            // 
             // SetMidCapacity
             // 
             this.SetMidCapacity.Image = ((System.Drawing.Image)(resources.GetObject("SetMidCapacity.Image")));
@@ -195,6 +217,7 @@
             this.pr_detail,
             this.pd_ordercode,
             this.pr_orispeccode,
+            this.pd_pocode,
             this.pr_brand,
             this.pr_unit,
             this.pd_totalqty,
@@ -226,27 +249,6 @@
             this.pi_inoutno.Tag = "cu_name";
             this.pi_inoutno.KeyDown += new System.Windows.Forms.KeyEventHandler(this.bi_inoutno_KeyDown);
             // 
-            // ResetSerialNum
-            // 
-            this.ResetSerialNum.Image = ((System.Drawing.Image)(resources.GetObject("ResetSerialNum.Image")));
-            this.ResetSerialNum.Location = new System.Drawing.Point(604, 78);
-            this.ResetSerialNum.Name = "ResetSerialNum";
-            this.ResetSerialNum.Size = new System.Drawing.Size(64, 24);
-            this.ResetSerialNum.TabIndex = 161;
-            this.ResetSerialNum.Text = "流水重置";
-            this.ResetSerialNum.UseVisualStyleBackColor = true;
-            this.ResetSerialNum.Click += new System.EventHandler(this.ResetSerialNum_Click);
-            // 
-            // label1
-            // 
-            this.label1.AutoSize = true;
-            this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(795, 81);
-            this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(146, 21);
-            this.label1.TabIndex = 162;
-            this.label1.Text = "尾数用 , (逗号)分割";
-            // 
             // Choose
             // 
             this.Choose.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
@@ -320,6 +322,12 @@
             this.pr_orispeccode.ReadOnly = true;
             this.pr_orispeccode.Width = 54;
             // 
+            // pd_pocode
+            // 
+            this.pd_pocode.DataPropertyName = "pd_pocode";
+            this.pd_pocode.HeaderText = "客户PO";
+            this.pd_pocode.Name = "pd_pocode";
+            // 
             // pr_brand
             // 
             this.pr_brand.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
@@ -449,6 +457,7 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_detail;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_ordercode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_orispeccode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pd_pocode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_brand;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_unit;
         private System.Windows.Forms.DataGridViewTextBoxColumn pd_totalqty;

+ 3 - 3
UAS-出货标签管理(贸易版)/生成条码.cs

@@ -506,7 +506,7 @@ namespace UAS_LabelMachine
                     string cu_print_midprod = custrule.Rows[0]["cu_print_midprod"].ToString();
                     if (cu_print_midspec == "-1")
                     {
-                        condition += ",pd_vespec_user";
+                        condition += ",pd_vespecprint_user";
                     }
                     if (cu_print_midpo == "-1")
                     {
@@ -522,9 +522,9 @@ namespace UAS_LabelMachine
                     case "出货单":
                         sql.Clear();
                         sql.Append("select pd_piid,pd_id,pr_id,pr_brand,pr_orispeccode,pr_madein,pr_unit,pr_detail,pr_spec,pr_zxbzs,outqty pd_totalqty,pd_pocode,pd_ordercode,pd_orderdetno,pd_pdno,pd_prodcode,pd_custprodcode,");
-                        sql.Append("pd_piclass,pd_qty from (select pd_piid,pd_id,pr_id,pr_brand,nvl(pd_vespec_user,pr_orispeccode)pr_orispeccode,pr_madein,pr_unit,pr_detail,pr_spec,pr_zxbzs,outqty,pd_pocode,pd_ordercode,pd_orderdetno,pd_pdno,");
+                        sql.Append("pd_piclass,pd_qty from (select pd_piid,pd_id,pr_id,pr_brand,nvl(nvl(pd_vespecprint_user,pd_vespec_user),pr_orispeccode)pr_orispeccode,pr_madein,pr_unit,pr_detail,pr_spec,pr_zxbzs,outqty,pd_pocode,pd_ordercode,pd_orderdetno,pd_pdno,");
                         sql.Append("pd_prodcode,pd_custprodcode,pd_piclass,outqty-nvl((select sum(nvl(pib_qty,0)) from PRODIOBARCODE where PIB_PIID=pd_piid and pib_pdno=pd_pdno ),0)pd_qty ");
-                        sql.Append("from (select pd_piid,min(pd_id)pd_id,max(pd_vespec_user)pd_vespec_user,sum(pd_outqty)outqty,min(pd_pocode)pd_pocode,min(pd_ordercode)pd_ordercode,min(pd_orderdetno)pd_orderdetno,min(pd_pdno)pd_pdno,max(pd_custprodcode)pd_custprodcode,max(pd_prodcode)pd_prodcode,max(pd_piclass)pd_piclass ");
+                        sql.Append("from (select pd_piid,min(pd_id)pd_id,max(pd_vespec_user)pd_vespec_user,max(pd_vespecprint_user)pd_vespecprint_user,sum(pd_outqty)outqty,min(pd_pocode)pd_pocode,min(pd_ordercode)pd_ordercode,min(pd_orderdetno)pd_orderdetno,min(pd_pdno)pd_pdno,max(pd_custprodcode)pd_custprodcode,max(pd_prodcode)pd_prodcode,max(pd_piclass)pd_piclass ");
                         sql.Append("from prodiodetail group by pd_piid" + condition + ")T left join product ");
                         sql.Append("on pr_code=pd_prodcode)  where  pd_piid='" + pi_id + "' order by pd_pdno");
                         break;

+ 15 - 12
UAS-出货标签管理(贸易版)/生成条码.resx

@@ -118,6 +118,18 @@
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
   <assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
+  <data name="ResetSerialNum.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+    <value>
+        R0lGODlhUgAXAIQAAK/G1qjB1dzn6bTK2MfZ46rE1arD1/D4+/n//d/o7/X6/ez1/K7D1tLj6+Pt9ubx
+        877S3fT09DxZeQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBF
+        Mi4wAwEBAAAh+QQAAAAAACwAAAAAUgAXAAAI/wAlCBxIsKDBgwgTKlzIsGCEhxAjSpxIsaLFixgzPhQY
+        AYHHjyBDihxJsqTJkygjcFTAsqXLlzBjypxJs6ZNlRIiHNjJs6fPn0CDCh1KtCjOCAuSKl3KtKnTp1Cj
+        Sp169IHVq1izat3KtavXr2Crgh1LtqzZrUcdqF3Ltq3bt3Djyp1L92iCu3jz6t3Lt6/fv4ADHxVAuLDh
+        w4gTK17MuLHjow0iS55MubLly5gza958lIHnz6BDix5NurTp06iPGljNurXr17Bjy55Nu/bRALhz697N
+        u7fv38CDCz9aoLjx48iTK1/OvLnz50cBSJ9Ovbr169iza9/O/eiA7+DDi0EfT768+fPo0x+FwL69+/fw
+        48ufT7++/fX28+vfzz/+UQIABijggAQWaOCBCCao4FEaNejggxBG1NCEFFZoIUIBAQA7
+</value>
+  </data>
   <data name="SetMidCapacity.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         R0lGODlhUgAXAIQAAK/G1qjB1dzn6bTK2MfZ46rE1arD1/D4+/n//d/o7/X6/ez1/K7D1tLj6+Pt9ubx
@@ -181,6 +193,9 @@
   <metadata name="pr_orispeccode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="pd_pocode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="pr_brand.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
@@ -208,16 +223,4 @@
   <metadata name="mid_remain.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <data name="ResetSerialNum.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-    <value>
-        R0lGODlhUgAXAIQAAK/G1qjB1dzn6bTK2MfZ46rE1arD1/D4+/n//d/o7/X6/ez1/K7D1tLj6+Pt9ubx
-        877S3fT09DxZeQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH/C05FVFNDQVBF
-        Mi4wAwEBAAAh+QQAAAAAACwAAAAAUgAXAAAI/wAlCBxIsKDBgwgTKlzIsGCEhxAjSpxIsaLFixgzPhQY
-        AYHHjyBDihxJsqTJkygjcFTAsqXLlzBjypxJs6ZNlRIiHNjJs6fPn0CDCh1KtCjOCAuSKl3KtKnTp1Cj
-        Sp169IHVq1izat3KtavXr2Crgh1LtqzZrUcdqF3Ltq3bt3Djyp1L92iCu3jz6t3Lt6/fv4ADHxVAuLDh
-        w4gTK17MuLHjow0iS55MubLly5gza958lIHnz6BDix5NurTp06iPGljNurXr17Bjy55Nu/bRALhz697N
-        u7fv38CDCz9aoLjx48iTK1/OvLnz50cBSJ9Ovbr169iza9/O/eiA7+DDi0EfT768+fPo0x+FwL69+/fw
-        48ufT7++/fX28+vfzz/+UQIABijggAQWaOCBCCao4FEaNejggxBG1NCEFFZoIUIBAQA7
-</value>
-  </data>
 </root>