Эх сурвалжийг харах

Merge branch 'master' of ssh://10.10.100.21/source/mes-client

caosy 6 жил өмнө
parent
commit
8ca91b211d

+ 15 - 0
UAS-出货标签管理(贸易版)/CustomerRule.Designer.cs

@@ -36,6 +36,7 @@
             this.label1 = new System.Windows.Forms.Label();
             this.label2 = new System.Windows.Forms.Label();
             this.ButtonSaveScanGroup = new UAS_LabelMachine.CustomControl.NormalButton();
+            this.cu_print_midprod = new System.Windows.Forms.CheckBox();
             this.SuspendLayout();
             // 
             // cu_print_midspec
@@ -109,11 +110,24 @@
             this.ButtonSaveScanGroup.UseVisualStyleBackColor = true;
             this.ButtonSaveScanGroup.Click += new System.EventHandler(this.ButtonSaveScanGroup_Click);
             // 
+            // cu_print_midprod
+            // 
+            this.cu_print_midprod.AutoSize = true;
+            this.cu_print_midprod.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.cu_print_midprod.Location = new System.Drawing.Point(548, 191);
+            this.cu_print_midprod.Name = "cu_print_midprod";
+            this.cu_print_midprod.Size = new System.Drawing.Size(125, 25);
+            this.cu_print_midprod.TabIndex = 52;
+            this.cu_print_midprod.Tag = "PN";
+            this.cu_print_midprod.Text = "区分客户料号";
+            this.cu_print_midprod.UseVisualStyleBackColor = true;
+            // 
             // CustomerRule
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1082, 634);
+            this.Controls.Add(this.cu_print_midprod);
             this.Controls.Add(this.label2);
             this.Controls.Add(this.label1);
             this.Controls.Add(this.Customer);
@@ -138,5 +152,6 @@
         private System.Windows.Forms.TextBox Customer;
         private System.Windows.Forms.Label label1;
         private System.Windows.Forms.Label label2;
+        private System.Windows.Forms.CheckBox cu_print_midprod;
     }
 }

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

@@ -63,8 +63,9 @@ namespace UAS_LabelMachine
         private void ButtonSaveScanGroup_Click(object sender, EventArgs e)
         {
             sql.Clear();
-            sql.Append("update customer set cu_print_midspec='" + (cu_print_midspec.Checked ? -1 : 0) + "',");
-            sql.Append("cu_print_midpo='" + (cu_print_midpo.Checked ? -1 : 0) + "' ");
+            sql.Append("update customer set cu_print_midspec='" + (cu_print_midspec.Checked ? -1 : 0) + "',"); 
+            sql.Append("cu_print_midpo='" + (cu_print_midpo.Checked ? -1 : 0) + "',");
+            sql.Append("cu_print_midprod='" + (cu_print_midprod.Checked ? -1 : 0) + "' ");
             sql.Append("where cu_code='" + CUCODE + "'");
             dh.ExecuteSql(sql.ToString(), "update");
             MessageBox.Show("保存成功!", "提示");

+ 14 - 0
UAS-出货标签管理(贸易版)/PublicMethod/LogicHandler.cs

@@ -19,5 +19,19 @@ namespace UAS_LabelMachine.PublicMethod
             oDatecode = param[8];
             oLotno = param[9];
         }
+
+        public static void GetTimeFromDatecode(string iDatecode, string iCustcode, out string oYear, out string oMonth, out string oDay, out string oDate)
+        {
+            oYear = "0";
+            oMonth = "0";
+            oDay = "0";
+            oDate = "19000101";
+            string[] param = new string[] { iDatecode, iCustcode, oYear, oMonth, oDay, oDate };
+            dh.CallProcedure("GETTIMEFROMDATECODE", ref param);
+            oYear = param[2];
+            oMonth = param[3];
+            oDay = param[4];
+            oDate = param[5];
+        }
     }
 }

+ 239 - 216
UAS-出货标签管理(贸易版)/UAS_出货标签管理.Designer.cs

@@ -99,6 +99,7 @@
             this.toolStripMenuItem5 = new System.Windows.Forms.ToolStripMenuItem();
             this.toolStripMenuItem6 = new System.Windows.Forms.ToolStripMenuItem();
             this.下载模板ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.客户合并规则ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.ImportExcel = new System.Windows.Forms.OpenFileDialog();
             this.pi_class = new System.Windows.Forms.Label();
             this.cu_code = new UAS_LabelMachine.CustomControl.SearchTextBox();
@@ -130,29 +131,6 @@
             this.sg_code = new UAS_LabelMachine.CustomControl.SearchTextBox();
             this.MessageLog = new UAS_LabelMachine.CustomControl.RichText.RichTextAutoBottom();
             this.LabelInf = new UAS_LabelMachine.CustomControl.DataGridViewWithSerialNum();
-            this.Choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.pib_ifpick = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.pib_ifprint = new System.Windows.Forms.DataGridViewCheckBoxColumn();
-            this.pib_id1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_pdno = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_orispeccode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_brand = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_madein = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_zxbzs = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_unit = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_lotno = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_datecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_datecode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_qty = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_custbarcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_pocode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_custprodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pd_custprodspec = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_spec = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_outboxcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pib_outboxcode2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pi_inoutno = new UAS_LabelMachine.CustomControl.BlurSearch();
             this.SingleLabel = new UAS_LabelMachine.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
             this.label8 = new System.Windows.Forms.Label();
@@ -191,7 +169,31 @@
             this.OutBoxLabelPrint = new System.Windows.Forms.Button();
             this.OutBoxLabelAutoPrint = new System.Windows.Forms.CheckBox();
             this.OutBoxCombox = new System.Windows.Forms.ComboBox();
-            this.客户合并规则ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+            this.Choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.pib_ifpick = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.pib_ifprint = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.pib_id1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_pdno = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_orispeccode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_brand = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_madein = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_zxbzs = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_unit = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_lotno = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_datecode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_year = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_month = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_day = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_qty = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_barcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_custbarcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_pocode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_custprodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pd_custprodspec = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_spec = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_outboxcode1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pib_outboxcode2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             ((System.ComponentModel.ISupportInitialize)(this.Si_ItemDGV)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.MidSource)).BeginInit();
             this.Menu.SuspendLayout();
@@ -817,6 +819,12 @@
             this.下载模板ToolStripMenuItem.Size = new System.Drawing.Size(148, 22);
             this.下载模板ToolStripMenuItem.Text = "下载模板";
             // 
+            // 客户合并规则ToolStripMenuItem
+            // 
+            this.客户合并规则ToolStripMenuItem.Name = "客户合并规则ToolStripMenuItem";
+            this.客户合并规则ToolStripMenuItem.Size = new System.Drawing.Size(148, 22);
+            this.客户合并规则ToolStripMenuItem.Text = "客户合并规则";
+            // 
             // ImportExcel
             // 
             this.ImportExcel.FileName = "ImportExcel";
@@ -1194,13 +1202,15 @@
             this.pib_pdno,
             this.pib_prodcode,
             this.pr_orispeccode,
-            this.pib_brand,
+            this.pr_brand,
             this.pib_madein,
             this.pr_zxbzs,
             this.pr_unit,
             this.pib_lotno,
             this.pib_datecode,
-            this.pib_datecode1,
+            this.pib_year,
+            this.pib_month,
+            this.pib_day,
             this.pib_qty,
             this.pib_barcode,
             this.pib_custbarcode,
@@ -1222,189 +1232,6 @@
             this.LabelInf.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.LabelInf_CellValueChanged);
             this.LabelInf.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.LabelInf_DataError);
             // 
-            // Choose
-            // 
-            this.Choose.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.Choose.HeaderText = "勾选";
-            this.Choose.Name = "Choose";
-            this.Choose.Resizable = System.Windows.Forms.DataGridViewTriState.True;
-            this.Choose.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
-            this.Choose.Width = 55;
-            // 
-            // pib_ifpick
-            // 
-            this.pib_ifpick.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.pib_ifpick.DataPropertyName = "pib_ifpick";
-            this.pib_ifpick.HeaderText = "已采集";
-            this.pib_ifpick.Name = "pib_ifpick";
-            this.pib_ifpick.Width = 60;
-            // 
-            // pib_ifprint
-            // 
-            this.pib_ifprint.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.pib_ifprint.DataPropertyName = "pib_ifprint";
-            this.pib_ifprint.HeaderText = "已打印";
-            this.pib_ifprint.Name = "pib_ifprint";
-            this.pib_ifprint.Width = 60;
-            // 
-            // pib_id1
-            // 
-            this.pib_id1.DataPropertyName = "pib_id";
-            this.pib_id1.HeaderText = "pib_id";
-            this.pib_id1.Name = "pib_id1";
-            this.pib_id1.Visible = false;
-            this.pib_id1.Width = 66;
-            // 
-            // pib_pdno
-            // 
-            this.pib_pdno.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.pib_pdno.DataPropertyName = "pib_pdno";
-            this.pib_pdno.HeaderText = "明细序号";
-            this.pib_pdno.Name = "pib_pdno";
-            this.pib_pdno.ReadOnly = true;
-            this.pib_pdno.Width = 96;
-            // 
-            // pib_prodcode
-            // 
-            this.pib_prodcode.DataPropertyName = "pib_prodcode";
-            this.pib_prodcode.HeaderText = "物料编号";
-            this.pib_prodcode.Name = "pib_prodcode";
-            this.pib_prodcode.ReadOnly = true;
-            this.pib_prodcode.Width = 78;
-            // 
-            // pr_orispeccode
-            // 
-            this.pr_orispeccode.DataPropertyName = "pr_orispeccode";
-            this.pr_orispeccode.HeaderText = "MPN";
-            this.pr_orispeccode.Name = "pr_orispeccode";
-            this.pr_orispeccode.ReadOnly = true;
-            this.pr_orispeccode.Width = 48;
-            // 
-            // pib_brand
-            // 
-            this.pib_brand.DataPropertyName = "pib_brand";
-            this.pib_brand.HeaderText = "品牌";
-            this.pib_brand.Name = "pib_brand";
-            this.pib_brand.ReadOnly = true;
-            this.pib_brand.Width = 54;
-            // 
-            // pib_madein
-            // 
-            this.pib_madein.DataPropertyName = "pib_madein";
-            this.pib_madein.HeaderText = "产地";
-            this.pib_madein.Name = "pib_madein";
-            this.pib_madein.Width = 54;
-            // 
-            // pr_zxbzs
-            // 
-            this.pr_zxbzs.DataPropertyName = "pr_zxbzs";
-            this.pr_zxbzs.HeaderText = "最小包装数";
-            this.pr_zxbzs.Name = "pr_zxbzs";
-            this.pr_zxbzs.Visible = false;
-            this.pr_zxbzs.Width = 90;
-            // 
-            // pr_unit
-            // 
-            this.pr_unit.DataPropertyName = "pr_unit";
-            this.pr_unit.HeaderText = "单位";
-            this.pr_unit.Name = "pr_unit";
-            this.pr_unit.Visible = false;
-            this.pr_unit.Width = 54;
-            // 
-            // pib_lotno
-            // 
-            this.pib_lotno.DataPropertyName = "pib_lotno";
-            this.pib_lotno.HeaderText = "LotNo";
-            this.pib_lotno.Name = "pib_lotno";
-            this.pib_lotno.Width = 60;
-            // 
-            // pib_datecode
-            // 
-            this.pib_datecode.DataPropertyName = "pib_datecode";
-            this.pib_datecode.HeaderText = "DateCode";
-            this.pib_datecode.Name = "pib_datecode";
-            this.pib_datecode.Width = 78;
-            // 
-            // pib_datecode1
-            // 
-            this.pib_datecode1.DataPropertyName = "pib_datecode1";
-            this.pib_datecode1.HeaderText = "DateCode1";
-            this.pib_datecode1.Name = "pib_datecode1";
-            this.pib_datecode1.Visible = false;
-            this.pib_datecode1.Width = 84;
-            // 
-            // pib_qty
-            // 
-            this.pib_qty.DataPropertyName = "pib_qty";
-            this.pib_qty.HeaderText = "数量";
-            this.pib_qty.Name = "pib_qty";
-            this.pib_qty.ReadOnly = true;
-            this.pib_qty.Width = 54;
-            // 
-            // pib_barcode
-            // 
-            this.pib_barcode.DataPropertyName = "pib_barcode";
-            this.pib_barcode.HeaderText = "唯一条码";
-            this.pib_barcode.Name = "pib_barcode";
-            this.pib_barcode.ReadOnly = true;
-            this.pib_barcode.Width = 78;
-            // 
-            // pib_custbarcode
-            // 
-            this.pib_custbarcode.DataPropertyName = "pib_custbarcode";
-            this.pib_custbarcode.HeaderText = "客户条码";
-            this.pib_custbarcode.Name = "pib_custbarcode";
-            this.pib_custbarcode.ReadOnly = true;
-            this.pib_custbarcode.Width = 78;
-            // 
-            // pd_pocode
-            // 
-            this.pd_pocode.DataPropertyName = "pd_pocode";
-            this.pd_pocode.HeaderText = "客户PO";
-            this.pd_pocode.Name = "pd_pocode";
-            this.pd_pocode.ReadOnly = true;
-            this.pd_pocode.Width = 66;
-            // 
-            // pd_custprodcode
-            // 
-            this.pd_custprodcode.DataPropertyName = "pd_custprodcode";
-            this.pd_custprodcode.HeaderText = "客户料号";
-            this.pd_custprodcode.Name = "pd_custprodcode";
-            this.pd_custprodcode.ReadOnly = true;
-            this.pd_custprodcode.Width = 78;
-            // 
-            // pd_custprodspec
-            // 
-            this.pd_custprodspec.DataPropertyName = "pd_custprodspec";
-            this.pd_custprodspec.HeaderText = "客户型号";
-            this.pd_custprodspec.Name = "pd_custprodspec";
-            this.pd_custprodspec.ReadOnly = true;
-            this.pd_custprodspec.Width = 78;
-            // 
-            // pr_spec
-            // 
-            this.pr_spec.DataPropertyName = "pr_spec";
-            this.pr_spec.HeaderText = "规格";
-            this.pr_spec.Name = "pr_spec";
-            this.pr_spec.Visible = false;
-            this.pr_spec.Width = 54;
-            // 
-            // pib_outboxcode1
-            // 
-            this.pib_outboxcode1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.pib_outboxcode1.DataPropertyName = "pib_outboxcode1";
-            this.pib_outboxcode1.HeaderText = "中盒号";
-            this.pib_outboxcode1.Name = "pib_outboxcode1";
-            this.pib_outboxcode1.Width = 90;
-            // 
-            // pib_outboxcode2
-            // 
-            this.pib_outboxcode2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.pib_outboxcode2.DataPropertyName = "pib_outboxcode2";
-            this.pib_outboxcode2.HeaderText = "外箱号";
-            this.pib_outboxcode2.Name = "pib_outboxcode2";
-            this.pib_outboxcode2.Width = 90;
-            // 
             // pi_inoutno
             // 
             this.pi_inoutno.Condition = null;
@@ -1876,11 +1703,205 @@
             this.OutBoxCombox.TabIndex = 78;
             this.OutBoxCombox.SelectedIndexChanged += new System.EventHandler(this.OutBoxCombox_SelectedIndexChanged);
             // 
-            // 客户合并规则ToolStripMenuItem
+            // Choose
             // 
-            this.客户合并规则ToolStripMenuItem.Name = "客户合并规则ToolStripMenuItem";
-            this.客户合并规则ToolStripMenuItem.Size = new System.Drawing.Size(148, 22);
-            this.客户合并规则ToolStripMenuItem.Text = "客户合并规则";
+            this.Choose.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.Choose.HeaderText = "勾选";
+            this.Choose.Name = "Choose";
+            this.Choose.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+            this.Choose.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
+            this.Choose.Width = 55;
+            // 
+            // pib_ifpick
+            // 
+            this.pib_ifpick.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pib_ifpick.DataPropertyName = "pib_ifpick";
+            this.pib_ifpick.HeaderText = "已采集";
+            this.pib_ifpick.Name = "pib_ifpick";
+            this.pib_ifpick.Width = 60;
+            // 
+            // pib_ifprint
+            // 
+            this.pib_ifprint.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pib_ifprint.DataPropertyName = "pib_ifprint";
+            this.pib_ifprint.HeaderText = "已打印";
+            this.pib_ifprint.Name = "pib_ifprint";
+            this.pib_ifprint.Width = 60;
+            // 
+            // pib_id1
+            // 
+            this.pib_id1.DataPropertyName = "pib_id";
+            this.pib_id1.HeaderText = "pib_id";
+            this.pib_id1.Name = "pib_id1";
+            this.pib_id1.Visible = false;
+            this.pib_id1.Width = 66;
+            // 
+            // pib_pdno
+            // 
+            this.pib_pdno.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pib_pdno.DataPropertyName = "pib_pdno";
+            this.pib_pdno.HeaderText = "明细序号";
+            this.pib_pdno.Name = "pib_pdno";
+            this.pib_pdno.ReadOnly = true;
+            this.pib_pdno.Width = 96;
+            // 
+            // pib_prodcode
+            // 
+            this.pib_prodcode.DataPropertyName = "pib_prodcode";
+            this.pib_prodcode.HeaderText = "物料编号";
+            this.pib_prodcode.Name = "pib_prodcode";
+            this.pib_prodcode.ReadOnly = true;
+            this.pib_prodcode.Width = 78;
+            // 
+            // pr_orispeccode
+            // 
+            this.pr_orispeccode.DataPropertyName = "pr_orispeccode";
+            this.pr_orispeccode.HeaderText = "MPN";
+            this.pr_orispeccode.Name = "pr_orispeccode";
+            this.pr_orispeccode.ReadOnly = true;
+            this.pr_orispeccode.Width = 48;
+            // 
+            // pr_brand
+            // 
+            this.pr_brand.DataPropertyName = "pr_brand";
+            this.pr_brand.HeaderText = "品牌";
+            this.pr_brand.Name = "pr_brand";
+            this.pr_brand.ReadOnly = true;
+            this.pr_brand.Width = 54;
+            // 
+            // pib_madein
+            // 
+            this.pib_madein.DataPropertyName = "pib_madein";
+            this.pib_madein.HeaderText = "产地";
+            this.pib_madein.Name = "pib_madein";
+            this.pib_madein.Width = 54;
+            // 
+            // pr_zxbzs
+            // 
+            this.pr_zxbzs.DataPropertyName = "pr_zxbzs";
+            this.pr_zxbzs.HeaderText = "最小包装数";
+            this.pr_zxbzs.Name = "pr_zxbzs";
+            this.pr_zxbzs.Visible = false;
+            this.pr_zxbzs.Width = 90;
+            // 
+            // pr_unit
+            // 
+            this.pr_unit.DataPropertyName = "pr_unit";
+            this.pr_unit.HeaderText = "单位";
+            this.pr_unit.Name = "pr_unit";
+            this.pr_unit.Visible = false;
+            this.pr_unit.Width = 54;
+            // 
+            // pib_lotno
+            // 
+            this.pib_lotno.DataPropertyName = "pib_lotno";
+            this.pib_lotno.HeaderText = "LotNo";
+            this.pib_lotno.Name = "pib_lotno";
+            this.pib_lotno.Width = 60;
+            // 
+            // pib_datecode
+            // 
+            this.pib_datecode.DataPropertyName = "pib_datecode";
+            this.pib_datecode.HeaderText = "DateCode";
+            this.pib_datecode.Name = "pib_datecode";
+            this.pib_datecode.Width = 78;
+            // 
+            // pib_year
+            // 
+            this.pib_year.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+            this.pib_year.DataPropertyName = "pib_year";
+            this.pib_year.HeaderText = "年";
+            this.pib_year.Name = "pib_year";
+            this.pib_year.Width = 42;
+            // 
+            // pib_month
+            // 
+            this.pib_month.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pib_month.DataPropertyName = "pib_month";
+            this.pib_month.HeaderText = "月";
+            this.pib_month.Name = "pib_month";
+            this.pib_month.Width = 42;
+            // 
+            // pib_day
+            // 
+            this.pib_day.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pib_day.DataPropertyName = "pib_day";
+            this.pib_day.HeaderText = "日";
+            this.pib_day.Name = "pib_day";
+            this.pib_day.Width = 42;
+            // 
+            // pib_qty
+            // 
+            this.pib_qty.DataPropertyName = "pib_qty";
+            this.pib_qty.HeaderText = "数量";
+            this.pib_qty.Name = "pib_qty";
+            this.pib_qty.ReadOnly = true;
+            this.pib_qty.Width = 54;
+            // 
+            // pib_barcode
+            // 
+            this.pib_barcode.DataPropertyName = "pib_barcode";
+            this.pib_barcode.HeaderText = "唯一条码";
+            this.pib_barcode.Name = "pib_barcode";
+            this.pib_barcode.ReadOnly = true;
+            this.pib_barcode.Width = 78;
+            // 
+            // pib_custbarcode
+            // 
+            this.pib_custbarcode.DataPropertyName = "pib_custbarcode";
+            this.pib_custbarcode.HeaderText = "客户条码";
+            this.pib_custbarcode.Name = "pib_custbarcode";
+            this.pib_custbarcode.ReadOnly = true;
+            this.pib_custbarcode.Width = 78;
+            // 
+            // pd_pocode
+            // 
+            this.pd_pocode.DataPropertyName = "pd_pocode";
+            this.pd_pocode.HeaderText = "客户PO";
+            this.pd_pocode.Name = "pd_pocode";
+            this.pd_pocode.ReadOnly = true;
+            this.pd_pocode.Width = 66;
+            // 
+            // pd_custprodcode
+            // 
+            this.pd_custprodcode.DataPropertyName = "pd_custprodcode";
+            this.pd_custprodcode.HeaderText = "客户料号";
+            this.pd_custprodcode.Name = "pd_custprodcode";
+            this.pd_custprodcode.ReadOnly = true;
+            this.pd_custprodcode.Width = 78;
+            // 
+            // pd_custprodspec
+            // 
+            this.pd_custprodspec.DataPropertyName = "pd_custprodspec";
+            this.pd_custprodspec.HeaderText = "客户型号";
+            this.pd_custprodspec.Name = "pd_custprodspec";
+            this.pd_custprodspec.ReadOnly = true;
+            this.pd_custprodspec.Visible = false;
+            this.pd_custprodspec.Width = 78;
+            // 
+            // pr_spec
+            // 
+            this.pr_spec.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.DisplayedCells;
+            this.pr_spec.DataPropertyName = "pr_spec";
+            this.pr_spec.HeaderText = "规格";
+            this.pr_spec.Name = "pr_spec";
+            this.pr_spec.Width = 54;
+            // 
+            // pib_outboxcode1
+            // 
+            this.pib_outboxcode1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pib_outboxcode1.DataPropertyName = "pib_outboxcode1";
+            this.pib_outboxcode1.HeaderText = "中盒号";
+            this.pib_outboxcode1.Name = "pib_outboxcode1";
+            this.pib_outboxcode1.Width = 90;
+            // 
+            // pib_outboxcode2
+            // 
+            this.pib_outboxcode2.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.pib_outboxcode2.DataPropertyName = "pib_outboxcode2";
+            this.pib_outboxcode2.HeaderText = "外箱号";
+            this.pib_outboxcode2.Name = "pib_outboxcode2";
+            this.pib_outboxcode2.Width = 90;
             // 
             // UAS_出货标签打印
             // 
@@ -2099,6 +2120,7 @@
         private System.Windows.Forms.CheckBox cu_print_outdc;
         private System.Windows.Forms.CheckBox cu_print_outlotno;
         private System.Windows.Forms.CheckBox cu_print_outpo;
+        private System.Windows.Forms.ToolStripMenuItem 客户合并规则ToolStripMenuItem;
         private System.Windows.Forms.DataGridViewCheckBoxColumn Choose;
         private System.Windows.Forms.DataGridViewCheckBoxColumn pib_ifpick;
         private System.Windows.Forms.DataGridViewCheckBoxColumn pib_ifprint;
@@ -2106,13 +2128,15 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_pdno;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_prodcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_orispeccode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pib_brand;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pr_brand;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_madein;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_zxbzs;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_unit;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_lotno;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_datecode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pib_datecode1;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pib_year;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pib_month;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pib_day;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_qty;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_barcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_custbarcode;
@@ -2122,6 +2146,5 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_spec;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pib_outboxcode2;
-        private System.Windows.Forms.ToolStripMenuItem 客户合并规则ToolStripMenuItem;
     }
 }

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

@@ -509,19 +509,26 @@ namespace UAS_LabelMachine
                     //如果按盒号采集,所有的此盒的均更新为
                     DataTable dt = (DataTable)LabelInf.DataSource;
                     StringBuilder pibid1 = new StringBuilder();
+                    string year = "0";
+                    string month = "0";
+                    string day = "0";
+                    string date = "";
+                    string lotno = LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString();
+                    string datecode = LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value.ToString();
+                    string pr_brand = LabelInf.Rows[CurrentRowIndex].Cells["pr_brand"].Value.ToString();
+                    LogicHandler.GetTimeFromDatecode(datecode, pr_brand, out year, out month, out day, out date);
                     if (CollectionUnit.Text == "盒")
                     {
-                        string lotno = "";
-                        string datecode = "";
                         for (int i = 0; i < LabelInf.RowCount; i++)
                         {
                             if (LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString() == LabelInf.Rows[CurrentRowIndex].Cells["pib_outboxcode1"].Value.ToString())
                             {
-                                lotno = LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString();
-                                datecode = LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value.ToString();
                                 string pibid = LabelInf.Rows[i].Cells["pib_id1"].Value.ToString();
                                 dt.Rows[i]["pib_lotno"] = lotno;
                                 dt.Rows[i]["pib_datecode"] = datecode;
+                                dt.Rows[i]["pib_year"] = year;
+                                dt.Rows[i]["pib_month"] = month;
+                                dt.Rows[i]["pib_day"] = day;
                                 LabelInf.Rows[i].Cells["pib_ifpick"].Value = true;
                                 LabelInf.Rows[i].Cells["Choose"].Value = true;
                                 pibid1.Append(pibid + ",");
@@ -538,19 +545,18 @@ namespace UAS_LabelMachine
                             }
                         }
                         pibid1.Append("1");
-                        sdh.ExecuteSql("update prodiobarcode set pib_ifpick=-1,pib_lotno='" + lotno + "',pib_datecode='" + pib_datecode + "' where pib_id in (" + pibid1 + ")", "update");
+                        sdh.ExecuteSql("update prodiobarcode set pib_ifpick=-1,pib_lotno='" + lotno + "',pib_datecode='" + datecode + "',pib_year='" + year + "',pib_month='" + month + "',pib_day='" + day + "' where pib_id in (" + pibid1 + ")", "update");
                     }
                     else if (CollectionUnit.Text == "全部")
                     {
-                        string lotno = "";
-                        string datecode = "";
                         for (int i = 0; i < LabelInf.RowCount; i++)
                         {
-                            lotno = LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString();
-                            datecode = LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value.ToString();
                             string pibid = LabelInf.Rows[i].Cells["pib_id1"].Value.ToString();
                             dt.Rows[i]["pib_lotno"] = lotno;
                             dt.Rows[i]["pib_datecode"] = datecode;
+                            dt.Rows[i]["pib_year"] = year;
+                            dt.Rows[i]["pib_month"] = month;
+                            dt.Rows[i]["pib_day"] = day;
                             CurrentRowIndex = i;
                             LabelInf.Refresh();
                             LabelInf.Rows[i].Cells["pib_ifpick"].Value = true;
@@ -560,15 +566,16 @@ namespace UAS_LabelMachine
                             SetOutBoxCode2(true);
                         }
                         pibid1.Append("1");
-                        sdh.ExecuteSql("update prodiobarcode set pib_ifpick=-1,pib_lotno='" + lotno + "',pib_datecode='" + pib_datecode + "' where pib_id in (" + pibid1 + ")", "update");
+                        sdh.ExecuteSql("update prodiobarcode set pib_ifpick=-1,pib_lotno='" + lotno + "',pib_datecode='" + datecode + "',pib_year='" + year + "',pib_month='" + month + "',pib_day='" + day + "' where pib_id in (" + pibid1 + ")", "update");
                     }
                     else
                     {
-                        string lotno = LabelInf.Rows[CurrentRowIndex].Cells["pib_lotno"].Value.ToString();
-                        string datecode = LabelInf.Rows[CurrentRowIndex].Cells["pib_datecode"].Value.ToString();
                         LabelInf.Rows[CurrentRowIndex].Cells["pib_ifpick"].Value = true;
                         LabelInf.Rows[CurrentRowIndex].Cells["Choose"].Value = true;
-                        sdh.ExecuteSql("update prodiobarcode set pib_ifpick=-1,pib_lotno='" + lotno + "',pib_datecode='" + pib_datecode + "' where pib_id in (" + pibid1 + ")", "update");
+                        LabelInf.Rows[CurrentRowIndex].Cells["pib_year"].Value = year;
+                        LabelInf.Rows[CurrentRowIndex].Cells["pib_month"].Value = month;
+                        LabelInf.Rows[CurrentRowIndex].Cells["pib_day"].Value = day;
+                        sdh.ExecuteSql("update prodiobarcode set pib_ifpick=-1,pib_lotno='" + lotno + "',pib_datecode='" + datecode + "',pib_year='" + year + "',pib_month='" + month + "',pib_day='" + day + "' where pib_id in (" + pibid1 + ")", "update");
                         LabelInf.Invalidate();
                         //勾选了单盘自动打印
                         if (SingleLabelAutoPrint.Checked)
@@ -746,7 +753,7 @@ namespace UAS_LabelMachine
                         length--;
                         break;
                     case "品牌":
-                        cell = LabelInf.Rows[CurrentRowIndex].Cells["pib_brand"];
+                        cell = LabelInf.Rows[CurrentRowIndex].Cells["pr_brand"];
                         Matchstr = MatchStr(item.Value, "品牌");
                         //如果采集的数量不相等的话
                         if (cell.Value.ToString() != Matchstr)
@@ -807,7 +814,13 @@ namespace UAS_LabelMachine
             }
             if (DateCode != "")
             {
-                sql.Append(",pib_datecode='" + DateCode + "' ");
+                string year = "";
+                string month = "";
+                string day = "";
+                string date = "";
+                string pr_brand = LabelInf.Rows[CurrentRowIndex].Cells["pr_brand"].Value.ToString();
+                LogicHandler.GetTimeFromDatecode(DateCode, pr_brand, out year, out month, out day, out date);
+                sql.Append(",pib_datecode='" + DateCode + "',pib_year='" + year + "',pib_month='" + month + "',pib_day='" + day + "' ");
             }
             sql.Append("where pib_id='" + pib_id + "'");
             sdh.ExecuteSql(sql.ToString(), "update");
@@ -1326,7 +1339,7 @@ namespace UAS_LabelMachine
                 MidBoxArgument.Clear();
                 List<int> MidOutBoxCode = new List<int>();
                 List<int> MidOutBoxCodeIndex = new List<int>();
-                for (int i = (begin == 0 ? 0 : begin); i <= (end == 0 ? LabelInf.Rows.Count - 1 : end); i++)
+                for (int i = (begin == 0 ? 0 : begin); i <= (end - begin); i++)
                 {
                     if (!MidIDAndOutboxcode.ContainsValue(LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString()))
                         MidIDAndOutboxcode.Add(LabelInf.Rows[i].Cells["pib_id1"].Value.ToString(), LabelInf.Rows[i].Cells["pib_outboxcode1"].Value.ToString());
@@ -1597,7 +1610,7 @@ namespace UAS_LabelMachine
             TotalCount.Text = LabelInf.RowCount.ToString();
             if (LabelInf.RowCount > 0)
             {
-                Brand = LabelInf.Rows[0].Cells["pib_brand"].FormattedValue.ToString();
+                Brand = LabelInf.Rows[0].Cells["pr_brand"].FormattedValue.ToString();
                 if (Brand != "")
                     sg_code.Text = dh.getFieldDataByCondition("scangroup", "sg_code", "sg_brand='" + Brand + "'").ToString();
                 SetOutBoxCapacity(LabelInf.Rows[0].Cells["pib_prodcode"].Value.ToString());
@@ -1641,7 +1654,7 @@ namespace UAS_LabelMachine
             bool mouseOver = e.CellBounds.Contains(this.PointToClient(Cursor.Position));
             if (e.ColumnIndex > 0)
             {
-                if (LabelInf.Columns[e.ColumnIndex].Name == "pib_madein" || LabelInf.Columns[e.ColumnIndex].Name == "pib_lotno" || LabelInf.Columns[e.ColumnIndex].Name == "pib_datecode" || LabelInf.Columns[e.ColumnIndex].Name == "pib_outboxcode1" || LabelInf.Columns[e.ColumnIndex].Name == "pib_outboxcode2" || LabelInf.Columns[e.ColumnIndex].Name == "pib_brand")
+                if (LabelInf.Columns[e.ColumnIndex].Name == "pib_madein" || LabelInf.Columns[e.ColumnIndex].Name == "pib_lotno" || LabelInf.Columns[e.ColumnIndex].Name == "pib_datecode" || LabelInf.Columns[e.ColumnIndex].Name == "pib_outboxcode1" || LabelInf.Columns[e.ColumnIndex].Name == "pib_outboxcode2" || LabelInf.Columns[e.ColumnIndex].Name == "pr_brand")
                 {
                     SolidBrush solidBrush = new SolidBrush(Color.FromArgb(51, 153, 255));
                     e.Graphics.FillRectangle(mouseOver ? solidBrush : Brushes.LightSeaGreen, e.CellBounds);
@@ -2183,12 +2196,12 @@ namespace UAS_LabelMachine
                         MidDoc.Close();
                     if (OutBoxDoc != null)
                         OutBoxDoc.Close();
-                    if (SingleFormat != null)
-                        SingleFormat.Close(SaveOptions.DoNotSaveChanges);
-                    if (MidFormat != null)
-                        MidFormat.Close(SaveOptions.DoNotSaveChanges);
-                    if (OutFormat != null)
-                        OutFormat.Close(SaveOptions.DoNotSaveChanges);
+                    //if (SingleFormat != null)
+                    //    SingleFormat.Close(SaveOptions.DoNotSaveChanges);
+                    //if (MidFormat != null)
+                    //    MidFormat.Close(SaveOptions.DoNotSaveChanges);
+                    //if (OutFormat != null)
+                    //    OutFormat.Close(SaveOptions.DoNotSaveChanges);
                     form1.FormClosed += LabelFormClose;
                     form1.ShowDialog();
                     break;
@@ -2642,15 +2655,18 @@ namespace UAS_LabelMachine
         {
             Button setvalue = sender as Button;
             string pdno = LabelInf.Rows[rowindex].Cells["pib_pdno"].Value.ToString();
+            string pr_brand = LabelInf.Rows[rowindex].Cells["pr_brand"].Value.ToString();
             string datecode = setvalue.FindForm().Controls["datecode"].Text;
             string lotno = setvalue.FindForm().Controls["lotno"].Text;
             string nums = setvalue.FindForm().Controls["Nums"].Text;
             string year = "0";
             string month = "0";
             string day = "0";
+            string date = "";
             string sql = "update prodiobarcode set pib_autoset=-1,pib_ifrecheck=-1,pib_ifpick=-1,pib_ifmodify=-1,pib_lotno='" + lotno + "',pib_datecode='" + datecode + "',pib_year='" + year + "',pib_month='" + month + "',pib_day='" + day + "' where pib_id in (select pib_id from prodiobarcode where  pib_inoutno='" + pi_inoutno.Text + "' and pib_pdno=" + pdno;
             if (datecode != "")
             {
+                LogicHandler.GetTimeFromDatecode(datecode, pr_brand, out year, out month, out day, out date);
                 sql += "  and (pib_datecode='' or pib_datecode is null) ";
             }
             if (lotno != "")
@@ -2674,16 +2690,19 @@ namespace UAS_LabelMachine
         {
             Button setvalueandprint = sender as Button;
             string pdno = LabelInf.Rows[rowindex].Cells["pib_pdno"].Value.ToString();
+            string pr_brand = LabelInf.Rows[rowindex].Cells["pr_brand"].Value.ToString();
             string datecode = setvalueandprint.FindForm().Controls["datecode"].Text;
             string lotno = setvalueandprint.FindForm().Controls["lotno"].Text;
             string nums = setvalueandprint.FindForm().Controls["Nums"].Text;
             string year = "0";
             string month = "0";
             string day = "0";
+            string date = "";
             string sql = "update prodiobarcode set pib_autoset=-1,pib_ifrecheck=-1,pib_ifpick=-1,pib_ifmodify=-1,pib_ifprint=-1,pib_lotno='" + lotno + "',pib_datecode='" + datecode + "',pib_year='" + year + "',pib_month='" + month + "',pib_day='" + day + "' where pib_id in (select pib_id from prodiobarcode where  pib_inoutno='" + pi_inoutno.Text + "' and pib_pdno=" + pdno;
             string PrintSQL = "select pib_id from prodiobarcode where pib_inoutno='" + pi_inoutno.Text + "' and pib_pdno=" + pdno;
             if (datecode != "")
             {
+                LogicHandler.GetTimeFromDatecode(datecode, pr_brand, out year, out month, out day, out date);
                 sql += " and (pib_datecode='' or pib_datecode is null) ";
                 PrintSQL += " and (pib_datecode='' or pib_datecode is null) ";
             }

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

@@ -162,7 +162,13 @@
   <metadata name="pr_unit.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="pib_datecode1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+  <metadata name="pib_year.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pib_month.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pib_day.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
   <metadata name="pib_custbarcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">

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

@@ -493,7 +493,7 @@ namespace UAS_LabelMachine
             CustCode = dh.getFieldDataByCondition("ProdInOut", "pi_cardcode", "pi_inoutno='" + pi_inoutno.Text + "'").ToString();
             //用于存放每一项的明细的数据
             dt = (DataTable)dh.ExecuteSql("select pi_class,pi_id from prodinout where pi_inoutno='" + pi_inoutno.Text + "'", "select");
-            DataTable custrule = (DataTable)dh.ExecuteSql("select CU_PRINT_MIDSPEC,CU_PRINT_MIDPO from customer where cu_code='" + CustCode + "'", "select");
+            DataTable custrule = (DataTable)dh.ExecuteSql("select CU_PRINT_MIDSPEC,CU_PRINT_MIDPO,cu_print_midprod from customer where cu_code='" + CustCode + "'", "select");
             if (dt.Rows.Count > 0)
             {
                 pi_id = dt.Rows[0]["pi_id"].ToString();
@@ -503,27 +503,28 @@ namespace UAS_LabelMachine
                 {
                     string CU_PRINT_MIDSPEC = custrule.Rows[0]["CU_PRINT_MIDSPEC"].ToString();
                     string CU_PRINT_MIDPO = custrule.Rows[0]["CU_PRINT_MIDPO"].ToString();
-                    if (CU_PRINT_MIDSPEC == "-1" && CU_PRINT_MIDPO == "-1")
+                    string cu_print_midprod = custrule.Rows[0]["cu_print_midprod"].ToString();
+                    if (CU_PRINT_MIDSPEC == "-1")
                     {
-                        condition = ",pd_vespec_user,pd_pocode";
+                        condition += ",pd_vespec_user";
                     }
-                    if (CU_PRINT_MIDSPEC != "-1" && CU_PRINT_MIDPO == "-1")
+                    if (CU_PRINT_MIDPO == "-1")
                     {
-                        condition = ",pd_pocode";
+                        condition += ",pd_pocode";
                     }
-                    if (CU_PRINT_MIDSPEC == "-1" && CU_PRINT_MIDPO != "-1")
+                    if (cu_print_midprod == "-1")
                     {
-                        condition = ",pd_vespec_user";
+                        condition += ",pd_custprodcode";
                     }
                 }
                 switch (pi_class.Text)
                 {
                     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,");
+                        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_prodcode,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_prodcode)pd_prodcode,max(pd_piclass)pd_piclass ");
+                        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 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;

+ 31 - 21
UAS-出货标签管理/PublicMethod/DataHelper.cs

@@ -11,16 +11,16 @@ namespace UAS_LabelMachine
     public class DataHelper
     {
 
-        //富为外网地址
-        private readonly string ConnectionStrings = "Data Source=richwellgroup.com.cn/orcl;User ID=DATACENTER;PassWord=select!#%*(";
-        //富为ERP地址
-        public static readonly string ERPAddesss = "http://richwellgroup.com.cn:8099/ERP/";
-        //富为FTP
-        public static readonly string FTPAdress = "ftp://richwellgroup.com.cn|printuser|printuser";
-        //Oracle端口
-        public static readonly string OraclePort = "1521";
-        //需要显示的账套
-        public static readonly string Masters = "JDTSY,FW_JDT,N_DATACENTER,FY_TEST,JD_TEST,XY_TEST,FW_TEST,DATACENTER,FW,XY,FY";
+        ////富为外网地址
+        //private readonly string ConnectionStrings = "Data Source=richwellgroup.com.cn/orcl;User ID=DATACENTER;PassWord=select!#%*(";
+        ////富为ERP地址
+        //public static readonly string ERPAddesss = "http://richwellgroup.com.cn:8099/ERP/";
+        ////富为FTP
+        //public static readonly string FTPAdress = "ftp://richwellgroup.com.cn|printuser|printuser";
+        ////Oracle端口
+        //public static readonly string OraclePort = "1521";
+        ////需要显示的账套
+        //public static readonly string Masters = "JDTSY,FW_JDT,N_DATACENTER,FY_TEST,JD_TEST,XY_TEST,FW_TEST,DATACENTER,FW,XY,FY";
 
         ////高登地址
         //private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=DATACENTER;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=183.238.39.179)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
@@ -34,16 +34,19 @@ namespace UAS_LabelMachine
         ////需要显示的账套
         //public static readonly string Masters = "GOLDEN";
 
-        ////怡海能达外网地址
-        //private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=DATACENTER;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=sz.hi-mantech.com)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
-        ////怡海能达ERP地址
-        //public static readonly string ERPAddesss = "http://sz.hi-mantech.com:8099/ERP/";
-        ////怡海能达FTP
-        //public static readonly string FTPAdress = "ftp://sz.hi-mantech.com:46688|yhndftp|Stga28ytG8";
-        ////Oracle端口
-        //public static readonly string OraclePort = "1521";
-        ////需要显示的账套
-        //public static readonly string Masters = "YHND_SZ,YHND_HK,DATACENTER,YITOA_ZX,T_YHND_HK";
+        //怡海能达外网地址
+        private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=DATACENTER;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=sz.hi-mantech.com)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+
+        private readonly string InnerConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=DATACENTER;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.1.200)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
+
+        //怡海能达ERP地址
+        public static readonly string ERPAddesss = "http://sz.hi-mantech.com:8099/ERP/";
+        //怡海能达FTP
+        public static readonly string FTPAdress = "ftp://sz.hi-mantech.com:46688|yhndftp|Stga28ytG8";
+        //Oracle端口
+        public static readonly string OraclePort = "1521";
+        //需要显示的账套
+        public static readonly string Masters = "YHND_SZ,YHND_HK,DATACENTER,YITOA_ZX,T_YHND_HK";
 
         ////华商龙外网地址
         //private readonly string ConnectionStrings = "Connection Timeout=0;Pooling=false;Password=select!#%*(;User ID=YITOA_DATACENTER;Pooling=false;Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=218.18.115.198)(PORT=1523)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=orcl)));";
@@ -84,7 +87,14 @@ namespace UAS_LabelMachine
                 if (DBConnectionString == null || DBConnectionString == ConnectionStrings)
                 {
                     DBConnectionString = ConnectionStrings;
-                    connection = new OracleConnection(ConnectionStrings);
+                    try
+                    {
+                        connection = new OracleConnection(ConnectionStrings);
+                    }
+                    catch (Exception)
+                    {
+                        connection = new OracleConnection(InnerConnectionStrings);
+                    }
                 }
                 else
                 {

+ 6 - 6
UAS-出货标签管理/UAS_出货标签管理.cs

@@ -1046,8 +1046,8 @@ namespace UAS_LabelMachine
             ComBoxClickChangeLabelDoc = false;
             Attach = (DataTable)dh.ExecuteSql("select lap_param lp_name,lap_value lp_sql  from LabelAttachPARAMETER where lap_custcode='" + cu_code.Text + "'", "select");
             sql.Clear();
-            sql.Append("select to_char(nvl(cl_date,sysdate),'YYYY-MM-DD HH24:Mi:SS') cl_date,cl_labelname,cl_isdefault,la_id||'#'||cl_labelurl||'#'||to_char(cl_date,'YYYY-MM-DD HH24:Mi:SS')  la_id,cl_custcode from customerlabel left join prodinout on pi_cardcode=cl_custcode ");
-            sql.Append("left join customer on cu_code=cl_custcode left join label on la_code=CL_LABELCODE where ");
+            sql.Append("select to_char(nvl(cl_date,sysdate),'YYYY-MM-DD HH24:Mi:SS') cl_date,cl_labelname,cl_isdefault,la_id||'#'||cl_labelurl||'#'|| ");
+            sql.Append("to_char(cl_date,'YYYY-MM-DD HH24:Mi:SS') la_id,cl_custcode from customerlabel left join label on la_code=CL_LABELCODE  where ");
             sql.Append("(cl_custcode='" + cu_code.Text + "' or cl_custcode is null) and cl_labeltype='单盘' order by cl_custcode");
             dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
             SingleLabelCombox.DisplayMember = "cl_labelname";
@@ -1075,8 +1075,8 @@ namespace UAS_LabelMachine
                 }
             }
             sql.Clear();
-            sql.Append("select to_char(nvl(cl_date,sysdate),'YYYY-MM-DD HH24:Mi:SS') cl_date,cl_labelname,cl_isdefault,la_id||'#'||cl_labelurl||'#'||to_char(cl_date,'YYYY-MM-DD HH24:Mi:SS')  la_id,cl_custcode from customerlabel left join prodinout on pi_cardcode=cl_custcode ");
-            sql.Append("left join customer on cu_code=cl_custcode left join label on la_code=CL_LABELCODE where ");
+            sql.Append("select to_char(nvl(cl_date,sysdate),'YYYY-MM-DD HH24:Mi:SS') cl_date,cl_labelname,cl_isdefault,la_id||'#'||cl_labelurl||'#'|| ");
+            sql.Append("to_char(cl_date,'YYYY-MM-DD HH24:Mi:SS') la_id,cl_custcode from customerlabel left join label on la_code=CL_LABELCODE  where ");
             sql.Append("(cl_custcode='" + cu_code.Text + "' or cl_custcode is null) and cl_labeltype='中盒' order by cl_custcode");
             dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
             MidLabelCombox.DisplayMember = "cl_labelname";
@@ -1101,8 +1101,8 @@ namespace UAS_LabelMachine
             }
             //缓存中盒参数
             sql.Clear();
-            sql.Append("select to_char(nvl(cl_date,sysdate),'YYYY-MM-DD HH24:Mi:SS') cl_date,cl_labelname,cl_isdefault,la_id||'#'||cl_labelurl||'#'||to_char(cl_date,'YYYY-MM-DD HH24:Mi:SS')  la_id,cl_custcode from customerlabel left join prodinout on pi_cardcode=cl_custcode ");
-            sql.Append("left join customer on cu_code=cl_custcode left join label on la_code=CL_LABELCODE where ");
+            sql.Append("select to_char(nvl(cl_date,sysdate),'YYYY-MM-DD HH24:Mi:SS') cl_date,cl_labelname,cl_isdefault,la_id||'#'||cl_labelurl||'#'|| ");
+            sql.Append("to_char(cl_date,'YYYY-MM-DD HH24:Mi:SS') la_id,cl_custcode from customerlabel left join label on la_code=CL_LABELCODE where ");
             sql.Append("(cl_custcode='" + cu_code.Text + "' or cl_custcode is null) and cl_labeltype='外箱' order by cl_custcode");
             dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
             OutBoxCombox.DisplayMember = "cl_labelname";