Browse Source

打印方法修改,参数修改,外箱包装内容修改

callm 4 days ago
parent
commit
46592c180e

+ 1 - 1
UAS_MES_HYSX/DataOperate/DataHelper.cs

@@ -543,7 +543,7 @@ namespace UAS_MES_NEW.DataOperate
                 for (int i = 0; i < addpar.Length; i++)
                     command.Parameters.Add(new OracleParameter(addpar[i].ToString(), OracleDbType.Varchar2, names[i], ParameterDirection.Input));
             }
-            Console.WriteLine(SQL);
+            //Console.WriteLine(SQL);
             switch (Type.ToUpper())
             {
                 case "SELECT":

+ 6 - 6
UAS_MES_HYSX/FunctionCode/Make/Make_OutBoxSnCheck.cs

@@ -147,16 +147,16 @@ namespace UAS_MES_NEW.Make
         {
             if (e.KeyCode == Keys.Enter)
             {
-                dt = (DataTable)dh.ExecuteSql("select pd_barcode,pd_makecode pa_makecode,pa_nextstep from packagedetail left join package on pa_id=pd_paid where pd_outboxcode='" + pa_outboxcode.Text + "'", "select");
+                dt = (DataTable)dh.ExecuteSql("select pd_barcode,pd_makecode pa_makecode,pa_nextstep from packagedetail left join package on pa_id=pd_paid where pd_outboxcode='" + pa_outboxcode.Text + "' or pa_zxcode='" + pa_outboxcode.Text + "'", "select");
                 if (dt.Rows.Count > 0)
                 {
                     //CheckNum.Text = CheckRow + "/" + CheckSnDGV.Rows.Count;
                     pa_nextstep = dt.Rows[0]["pa_nextstep"].ToString();
-                    if (pa_nextstep != User.CurrentStepCode && pa_nextstep != "")
-                    {
-                        OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "的下一工序" + pa_nextstep + "不是当前岗位资源对应工序\n", Color.Red);
-                        return;
-                    }
+                    //if (pa_nextstep != User.CurrentStepCode && pa_nextstep != "")
+                    //{
+                    //    OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "的下一工序" + pa_nextstep + "不是当前岗位资源对应工序\n", Color.Red);
+                    //    return;
+                    //}
                     BaseUtil.FillDgvWithDataTable(CheckSnDGV, dt);
                     BaseUtil.SetFormValue(this.Controls, dt);
                     sncode.Focus();

+ 2 - 10
UAS_MES_HYSX/FunctionCode/Make/Make_RePrintLabel.cs

@@ -119,7 +119,7 @@ namespace UAS_MES_NEW.Make
                 if (giftBox.Checked || fuselagel.Checked)
                 {
                     //select max(ms_id)ms_id from makeserial where ms_sncode=? 
-                    ms_id = dh.getFieldDataByCondition("makeserial", "max(ms_id) ms_id", "ms_sncode='" + inputText.Text + "'").ToString();
+                    ms_id = dh.getFieldDataByCondition("makeserial", "max(ms_id) ms_id", "ms_sncode='" + inputText.Text + "' or ms_code='" + inputText.Text + "'").ToString();
                     if (ms_id == "")
                     {
                         //如果ms_id 无值或者为空,提示用户SN不存在,请输入SN
@@ -172,19 +172,11 @@ namespace UAS_MES_NEW.Make
                 //打印类型为卡通箱
                 else if (CartonBox.Checked)
                 {
-                    dt = (DataTable)dh.ExecuteSql("select ms_outboxcode from makeserial where ms_outboxcode='" + inputText.Text + "' or ms_imei2='" + inputText.Text + "' or ms_imei1='" + inputText.Text + "' order by ms_id desc", "select");
+                    dt = (DataTable)dh.ExecuteSql("select ms_outboxcode from makeserial where ms_outboxcode='" + inputText.Text + "' or ms_sncode='" + inputText.Text + "'  order by ms_id desc", "select");
                     if (dt.Rows.Count > 0)
                     {
                         inputText.Text = dt.Rows[0]["ms_outboxcode"].ToString();
                     }
-                    else
-                    {
-                        dt = (DataTable)dh.ExecuteSql("select ms_outboxcode from makeserial where ms_imei2='" + inputText.Text + "' order by ms_id desc", "select");
-                        if (dt.Rows.Count > 0)
-                        {
-                            inputText.Text = dt.Rows[0]["ms_outboxcode"].ToString();
-                        }
-                    }
                     //查询箱号是否存在
                     dt = (DataTable)dh.ExecuteSql("select pa_id,pa_prodcode pr_code,pa_makecode ms_makecode,pr_detail from package left join product on pr_code=pa_prodcode where pa_outboxcode='" + inputText.Text + "' and pa_type=1", "select");
                     if (dt.Rows.Count == 0)

+ 90 - 72
UAS_MES_HYSX/FunctionCode/Packing/Packing_PackageCollectionZX.Designer.cs

@@ -111,6 +111,8 @@
             this.pa_indate = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.pd_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.groupBoxWithBorder3 = new UAS_MES_NEW.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
+            this.StopWeight = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
+            this.StartWeight = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.RefreshWeigh = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.pr_cartonunit1 = new System.Windows.Forms.Label();
             this.pr_cartonunit = new System.Windows.Forms.Label();
@@ -118,10 +120,9 @@
             this.label4 = new System.Windows.Forms.Label();
             this.weight = new System.Windows.Forms.Label();
             this.label5 = new System.Windows.Forms.Label();
-            this.StopWeight = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
-            this.StartWeight = new UAS_MES_NEW.CustomControl.ButtonUtil.NormalButton();
             this.ComList = new System.Windows.Forms.Label();
             this.BaudRate = new System.Windows.Forms.Label();
+            this.inputweight = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.groupBoxWithBorder2.SuspendLayout();
             this.groupBoxWithBorder1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.PackageDetail)).BeginInit();
@@ -536,7 +537,7 @@
             // 
             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(532, 34);
+            this.label1.Location = new System.Drawing.Point(533, 35);
             this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(146, 41);
@@ -559,7 +560,7 @@
             this.checkweightlabel.AutoSize = true;
             this.checkweightlabel.CutLength = null;
             this.checkweightlabel.ForeColor = System.Drawing.Color.Red;
-            this.checkweightlabel.Location = new System.Drawing.Point(58, 50);
+            this.checkweightlabel.Location = new System.Drawing.Point(59, 51);
             this.checkweightlabel.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.checkweightlabel.MaximumSize = new System.Drawing.Size(400, 0);
             this.checkweightlabel.Name = "checkweightlabel";
@@ -570,7 +571,7 @@
             // 
             this.ob_nowcheckqty.AutoSize = true;
             this.ob_nowcheckqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_nowcheckqty.Location = new System.Drawing.Point(694, 178);
+            this.ob_nowcheckqty.Location = new System.Drawing.Point(695, 179);
             this.ob_nowcheckqty.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ob_nowcheckqty.Name = "ob_nowcheckqty";
             this.ob_nowcheckqty.Size = new System.Drawing.Size(0, 41);
@@ -580,7 +581,7 @@
             // 
             this.ob_batchqty.AutoSize = true;
             this.ob_batchqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_batchqty.Location = new System.Drawing.Point(694, 102);
+            this.ob_batchqty.Location = new System.Drawing.Point(695, 103);
             this.ob_batchqty.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ob_batchqty.Name = "ob_batchqty";
             this.ob_batchqty.Size = new System.Drawing.Size(0, 41);
@@ -590,7 +591,7 @@
             // 
             this.ob_nowcheckqty_label.AutoSize = true;
             this.ob_nowcheckqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_nowcheckqty_label.Location = new System.Drawing.Point(532, 178);
+            this.ob_nowcheckqty_label.Location = new System.Drawing.Point(533, 179);
             this.ob_nowcheckqty_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ob_nowcheckqty_label.Name = "ob_nowcheckqty_label";
             this.ob_nowcheckqty_label.Size = new System.Drawing.Size(146, 41);
@@ -601,7 +602,7 @@
             // 
             this.ob_batchqty_label.AutoSize = true;
             this.ob_batchqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_batchqty_label.Location = new System.Drawing.Point(532, 106);
+            this.ob_batchqty_label.Location = new System.Drawing.Point(533, 107);
             this.ob_batchqty_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ob_batchqty_label.Name = "ob_batchqty_label";
             this.ob_batchqty_label.Size = new System.Drawing.Size(146, 41);
@@ -612,7 +613,7 @@
             // 
             this.ob_checkno.AutoSize = true;
             this.ob_checkno.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ob_checkno.Location = new System.Drawing.Point(694, 34);
+            this.ob_checkno.Location = new System.Drawing.Point(695, 35);
             this.ob_checkno.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ob_checkno.Name = "ob_checkno";
             this.ob_checkno.Size = new System.Drawing.Size(0, 41);
@@ -677,7 +678,7 @@
             // 
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label3.Location = new System.Drawing.Point(18, 180);
+            this.label3.Location = new System.Drawing.Point(19, 181);
             this.label3.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(146, 41);
@@ -727,7 +728,7 @@
             // 
             this.PrintList_label.AutoSize = true;
             this.PrintList_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PrintList_label.Location = new System.Drawing.Point(18, 100);
+            this.PrintList_label.Location = new System.Drawing.Point(19, 101);
             this.PrintList_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.PrintList_label.Name = "PrintList_label";
             this.PrintList_label.Size = new System.Drawing.Size(178, 41);
@@ -738,7 +739,7 @@
             // 
             this.PrintNum_label.AutoSize = true;
             this.PrintNum_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PrintNum_label.Location = new System.Drawing.Point(484, 261);
+            this.PrintNum_label.Location = new System.Drawing.Point(485, 262);
             this.PrintNum_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.PrintNum_label.Name = "PrintNum_label";
             this.PrintNum_label.Size = new System.Drawing.Size(82, 41);
@@ -786,7 +787,7 @@
             this.LockMakeCode.AutoSize = true;
             this.LockMakeCode.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.LockMakeCode.LeaveEvent = false;
-            this.LockMakeCode.Location = new System.Drawing.Point(356, 283);
+            this.LockMakeCode.Location = new System.Drawing.Point(357, 284);
             this.LockMakeCode.Margin = new System.Windows.Forms.Padding(4);
             this.LockMakeCode.Name = "LockMakeCode";
             this.LockMakeCode.Size = new System.Drawing.Size(94, 35);
@@ -819,7 +820,7 @@
             this.locksalecode.AutoSize = true;
             this.locksalecode.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.locksalecode.ForeColor = System.Drawing.Color.Red;
-            this.locksalecode.Location = new System.Drawing.Point(586, 36);
+            this.locksalecode.Location = new System.Drawing.Point(587, 37);
             this.locksalecode.Margin = new System.Windows.Forms.Padding(6);
             this.locksalecode.Name = "locksalecode";
             this.locksalecode.Size = new System.Drawing.Size(186, 28);
@@ -831,7 +832,7 @@
             // 
             this.PreFix_label.AutoSize = true;
             this.PreFix_label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.PreFix_label.Location = new System.Drawing.Point(360, 32);
+            this.PreFix_label.Location = new System.Drawing.Point(361, 33);
             this.PreFix_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.PreFix_label.Name = "PreFix_label";
             this.PreFix_label.Size = new System.Drawing.Size(71, 36);
@@ -859,7 +860,7 @@
             // 
             this.pa_salecode_label.AutoSize = true;
             this.pa_salecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_salecode_label.Location = new System.Drawing.Point(445, 283);
+            this.pa_salecode_label.Location = new System.Drawing.Point(446, 284);
             this.pa_salecode_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pa_salecode_label.Name = "pa_salecode_label";
             this.pa_salecode_label.Size = new System.Drawing.Size(146, 41);
@@ -870,7 +871,7 @@
             // 
             this.ma_code_label.AutoSize = true;
             this.ma_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ma_code_label.Location = new System.Drawing.Point(14, 276);
+            this.ma_code_label.Location = new System.Drawing.Point(15, 277);
             this.ma_code_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ma_code_label.Name = "ma_code_label";
             this.ma_code_label.Size = new System.Drawing.Size(114, 41);
@@ -881,7 +882,7 @@
             // 
             this.ms_salecode.AutoSize = true;
             this.ms_salecode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_salecode.Location = new System.Drawing.Point(607, 283);
+            this.ms_salecode.Location = new System.Drawing.Point(608, 284);
             this.ms_salecode.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.ms_salecode.Name = "ms_salecode";
             this.ms_salecode.Size = new System.Drawing.Size(0, 41);
@@ -891,7 +892,7 @@
             // 
             this.OutBoxLength_label.AutoSize = true;
             this.OutBoxLength_label.Font = new System.Drawing.Font("微软雅黑", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OutBoxLength_label.Location = new System.Drawing.Point(164, 32);
+            this.OutBoxLength_label.Location = new System.Drawing.Point(165, 33);
             this.OutBoxLength_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.OutBoxLength_label.Name = "OutBoxLength_label";
             this.OutBoxLength_label.Size = new System.Drawing.Size(71, 36);
@@ -957,7 +958,7 @@
             this.AutoGenBoxCode.AutoSize = true;
             this.AutoGenBoxCode.Checked = true;
             this.AutoGenBoxCode.CheckState = System.Windows.Forms.CheckState.Checked;
-            this.AutoGenBoxCode.Location = new System.Drawing.Point(498, 92);
+            this.AutoGenBoxCode.Location = new System.Drawing.Point(499, 93);
             this.AutoGenBoxCode.Margin = new System.Windows.Forms.Padding(4);
             this.AutoGenBoxCode.Name = "AutoGenBoxCode";
             this.AutoGenBoxCode.Size = new System.Drawing.Size(178, 45);
@@ -970,7 +971,7 @@
             // 
             this.pa_currentqty_label.AutoSize = true;
             this.pa_currentqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_currentqty_label.Location = new System.Drawing.Point(426, 156);
+            this.pa_currentqty_label.Location = new System.Drawing.Point(427, 157);
             this.pa_currentqty_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pa_currentqty_label.Name = "pa_currentqty_label";
             this.pa_currentqty_label.Size = new System.Drawing.Size(146, 41);
@@ -981,7 +982,7 @@
             // 
             this.pr_detail_label.AutoSize = true;
             this.pr_detail_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail_label.Location = new System.Drawing.Point(422, 212);
+            this.pr_detail_label.Location = new System.Drawing.Point(423, 213);
             this.pr_detail_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pr_detail_label.Name = "pr_detail_label";
             this.pr_detail_label.Size = new System.Drawing.Size(146, 41);
@@ -1011,7 +1012,7 @@
             // 
             this.pa_currentqty.AutoSize = true;
             this.pa_currentqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_currentqty.Location = new System.Drawing.Point(582, 152);
+            this.pa_currentqty.Location = new System.Drawing.Point(583, 153);
             this.pa_currentqty.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pa_currentqty.Name = "pa_currentqty";
             this.pa_currentqty.Size = new System.Drawing.Size(0, 41);
@@ -1021,7 +1022,7 @@
             // 
             this.pr_code_label.AutoSize = true;
             this.pr_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code_label.Location = new System.Drawing.Point(14, 212);
+            this.pr_code_label.Location = new System.Drawing.Point(15, 213);
             this.pr_code_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pr_code_label.Name = "pr_code_label";
             this.pr_code_label.Size = new System.Drawing.Size(146, 41);
@@ -1032,7 +1033,7 @@
             // 
             this.pr_detail.AutoSize = true;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_detail.Location = new System.Drawing.Point(584, 212);
+            this.pr_detail.Location = new System.Drawing.Point(585, 213);
             this.pr_detail.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pr_detail.Name = "pr_detail";
             this.pr_detail.Size = new System.Drawing.Size(0, 41);
@@ -1042,7 +1043,7 @@
             // 
             this.pr_outboxinnerqty_label.AutoSize = true;
             this.pr_outboxinnerqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_outboxinnerqty_label.Location = new System.Drawing.Point(14, 150);
+            this.pr_outboxinnerqty_label.Location = new System.Drawing.Point(15, 151);
             this.pr_outboxinnerqty_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pr_outboxinnerqty_label.Name = "pr_outboxinnerqty_label";
             this.pr_outboxinnerqty_label.Size = new System.Drawing.Size(146, 41);
@@ -1053,7 +1054,7 @@
             // 
             this.pr_code.AutoSize = true;
             this.pr_code.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_code.Location = new System.Drawing.Point(186, 212);
+            this.pr_code.Location = new System.Drawing.Point(187, 213);
             this.pr_code.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pr_code.MaximumSize = new System.Drawing.Size(300, 0);
             this.pr_code.Name = "pr_code";
@@ -1065,7 +1066,7 @@
             // 
             this.pa_code_label.AutoSize = true;
             this.pa_code_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pa_code_label.Location = new System.Drawing.Point(14, 90);
+            this.pa_code_label.Location = new System.Drawing.Point(15, 91);
             this.pa_code_label.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pa_code_label.Name = "pa_code_label";
             this.pa_code_label.Size = new System.Drawing.Size(82, 41);
@@ -1204,6 +1205,7 @@
             // groupBoxWithBorder3
             // 
             this.groupBoxWithBorder3.BorderColor = System.Drawing.Color.Black;
+            this.groupBoxWithBorder3.Controls.Add(this.inputweight);
             this.groupBoxWithBorder3.Controls.Add(this.StopWeight);
             this.groupBoxWithBorder3.Controls.Add(this.StartWeight);
             this.groupBoxWithBorder3.Controls.Add(this.RefreshWeigh);
@@ -1224,6 +1226,44 @@
             this.groupBoxWithBorder3.Text = "称量信息";
             this.groupBoxWithBorder3.TextColor = System.Drawing.Color.Black;
             // 
+            // StopWeight
+            // 
+            this.StopWeight.AllPower = null;
+            this.StopWeight.BackColor = System.Drawing.Color.Transparent;
+            this.StopWeight.DownImage = ((System.Drawing.Image)(resources.GetObject("StopWeight.DownImage")));
+            this.StopWeight.Image = ((System.Drawing.Image)(resources.GetObject("StopWeight.Image")));
+            this.StopWeight.IsShowBorder = true;
+            this.StopWeight.Location = new System.Drawing.Point(309, 47);
+            this.StopWeight.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
+            this.StopWeight.MoveImage = ((System.Drawing.Image)(resources.GetObject("StopWeight.MoveImage")));
+            this.StopWeight.Name = "StopWeight";
+            this.StopWeight.NormalImage = ((System.Drawing.Image)(resources.GetObject("StopWeight.NormalImage")));
+            this.StopWeight.Power = null;
+            this.StopWeight.Size = new System.Drawing.Size(149, 48);
+            this.StopWeight.TabIndex = 187;
+            this.StopWeight.Text = "停止称量";
+            this.StopWeight.UseVisualStyleBackColor = true;
+            this.StopWeight.Click += new System.EventHandler(this.StopWeight_Click);
+            // 
+            // StartWeight
+            // 
+            this.StartWeight.AllPower = null;
+            this.StartWeight.BackColor = System.Drawing.Color.Transparent;
+            this.StartWeight.DownImage = ((System.Drawing.Image)(resources.GetObject("StartWeight.DownImage")));
+            this.StartWeight.Image = ((System.Drawing.Image)(resources.GetObject("StartWeight.Image")));
+            this.StartWeight.IsShowBorder = true;
+            this.StartWeight.Location = new System.Drawing.Point(151, 47);
+            this.StartWeight.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
+            this.StartWeight.MoveImage = ((System.Drawing.Image)(resources.GetObject("StartWeight.MoveImage")));
+            this.StartWeight.Name = "StartWeight";
+            this.StartWeight.NormalImage = ((System.Drawing.Image)(resources.GetObject("StartWeight.NormalImage")));
+            this.StartWeight.Power = null;
+            this.StartWeight.Size = new System.Drawing.Size(151, 48);
+            this.StartWeight.TabIndex = 186;
+            this.StartWeight.Text = "开始称量";
+            this.StartWeight.UseVisualStyleBackColor = true;
+            this.StartWeight.Click += new System.EventHandler(this.StartWeight_Click);
+            // 
             // RefreshWeigh
             // 
             this.RefreshWeigh.AllPower = "ifall";
@@ -1248,7 +1288,7 @@
             // 
             this.pr_cartonunit1.AutoSize = true;
             this.pr_cartonunit1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_cartonunit1.Location = new System.Drawing.Point(163, 253);
+            this.pr_cartonunit1.Location = new System.Drawing.Point(164, 254);
             this.pr_cartonunit1.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pr_cartonunit1.Name = "pr_cartonunit1";
             this.pr_cartonunit1.Size = new System.Drawing.Size(38, 41);
@@ -1261,7 +1301,7 @@
             // 
             this.pr_cartonunit.AutoSize = true;
             this.pr_cartonunit.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_cartonunit.Location = new System.Drawing.Point(101, 47);
+            this.pr_cartonunit.Location = new System.Drawing.Point(102, 48);
             this.pr_cartonunit.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pr_cartonunit.Name = "pr_cartonunit";
             this.pr_cartonunit.Size = new System.Drawing.Size(38, 41);
@@ -1273,7 +1313,7 @@
             // 
             this.pr_cartonboxgw.AutoSize = true;
             this.pr_cartonboxgw.Font = new System.Drawing.Font("微软雅黑", 25F);
-            this.pr_cartonboxgw.Location = new System.Drawing.Point(33, 327);
+            this.pr_cartonboxgw.Location = new System.Drawing.Point(34, 328);
             this.pr_cartonboxgw.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.pr_cartonboxgw.Name = "pr_cartonboxgw";
             this.pr_cartonboxgw.Size = new System.Drawing.Size(0, 88);
@@ -1283,7 +1323,7 @@
             // 
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(17, 253);
+            this.label4.Location = new System.Drawing.Point(18, 254);
             this.label4.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(146, 41);
@@ -1295,7 +1335,7 @@
             this.weight.AutoSize = true;
             this.weight.Font = new System.Drawing.Font("微软雅黑", 35F);
             this.weight.ForeColor = System.Drawing.Color.DarkGreen;
-            this.weight.Location = new System.Drawing.Point(29, 115);
+            this.weight.Location = new System.Drawing.Point(30, 116);
             this.weight.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.weight.Name = "weight";
             this.weight.Size = new System.Drawing.Size(0, 121);
@@ -1305,51 +1345,13 @@
             // 
             this.label5.AutoSize = true;
             this.label5.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label5.Location = new System.Drawing.Point(17, 47);
+            this.label5.Location = new System.Drawing.Point(18, 48);
             this.label5.Margin = new System.Windows.Forms.Padding(6, 0, 6, 0);
             this.label5.Name = "label5";
             this.label5.Size = new System.Drawing.Size(82, 41);
             this.label5.TabIndex = 179;
             this.label5.Text = "重量";
             // 
-            // StopWeight
-            // 
-            this.StopWeight.AllPower = null;
-            this.StopWeight.BackColor = System.Drawing.Color.Transparent;
-            this.StopWeight.DownImage = ((System.Drawing.Image)(resources.GetObject("StopWeight.DownImage")));
-            this.StopWeight.Image = ((System.Drawing.Image)(resources.GetObject("StopWeight.Image")));
-            this.StopWeight.IsShowBorder = true;
-            this.StopWeight.Location = new System.Drawing.Point(309, 47);
-            this.StopWeight.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
-            this.StopWeight.MoveImage = ((System.Drawing.Image)(resources.GetObject("StopWeight.MoveImage")));
-            this.StopWeight.Name = "StopWeight";
-            this.StopWeight.NormalImage = ((System.Drawing.Image)(resources.GetObject("StopWeight.NormalImage")));
-            this.StopWeight.Power = null;
-            this.StopWeight.Size = new System.Drawing.Size(149, 48);
-            this.StopWeight.TabIndex = 187;
-            this.StopWeight.Text = "停止称量";
-            this.StopWeight.UseVisualStyleBackColor = true;
-            this.StopWeight.Click += new System.EventHandler(this.StopWeight_Click);
-            // 
-            // StartWeight
-            // 
-            this.StartWeight.AllPower = null;
-            this.StartWeight.BackColor = System.Drawing.Color.Transparent;
-            this.StartWeight.DownImage = ((System.Drawing.Image)(resources.GetObject("StartWeight.DownImage")));
-            this.StartWeight.Image = ((System.Drawing.Image)(resources.GetObject("StartWeight.Image")));
-            this.StartWeight.IsShowBorder = true;
-            this.StartWeight.Location = new System.Drawing.Point(151, 47);
-            this.StartWeight.Margin = new System.Windows.Forms.Padding(6, 4, 6, 4);
-            this.StartWeight.MoveImage = ((System.Drawing.Image)(resources.GetObject("StartWeight.MoveImage")));
-            this.StartWeight.Name = "StartWeight";
-            this.StartWeight.NormalImage = ((System.Drawing.Image)(resources.GetObject("StartWeight.NormalImage")));
-            this.StartWeight.Power = null;
-            this.StartWeight.Size = new System.Drawing.Size(151, 48);
-            this.StartWeight.TabIndex = 186;
-            this.StartWeight.Text = "开始称量";
-            this.StartWeight.UseVisualStyleBackColor = true;
-            this.StartWeight.Click += new System.EventHandler(this.StartWeight_Click);
-            // 
             // ComList
             // 
             this.ComList.AutoSize = true;
@@ -1374,6 +1376,21 @@
             this.BaudRate.Text = "BaudRate";
             this.BaudRate.Visible = false;
             // 
+            // inputweight
+            // 
+            this.inputweight.AllPower = null;
+            this.inputweight.BackColor = System.Drawing.Color.White;
+            this.inputweight.ID = null;
+            this.inputweight.Location = new System.Drawing.Point(82, 154);
+            this.inputweight.Name = "inputweight";
+            this.inputweight.Power = null;
+            this.inputweight.Size = new System.Drawing.Size(298, 50);
+            this.inputweight.Str = null;
+            this.inputweight.Str1 = null;
+            this.inputweight.Str2 = null;
+            this.inputweight.TabIndex = 188;
+            this.inputweight.KeyDown += new System.Windows.Forms.KeyEventHandler(this.inputweight_KeyDown);
+            // 
             // Packing_PackageCollectionZX
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
@@ -1531,5 +1548,6 @@
         private CustomControl.ButtonUtil.NormalButton StartWeight;
         private System.Windows.Forms.Label ComList;
         private System.Windows.Forms.Label BaudRate;
+        private CustomControl.TextBoxWithIcon.EnterTextBox inputweight;
     }
 }

+ 37 - 21
UAS_MES_HYSX/FunctionCode/Packing/Packing_PackageCollectionZX.cs

@@ -110,6 +110,8 @@ namespace UAS_MES_NEW.Packing
             }
             IP.Text = BaseUtil.GetCacheData("IP").ToString();
             Port.Text = BaseUtil.GetCacheData("IPPort").ToString();
+            ComList.Text = BaseUtil.GetCacheData("PortName").ToString();
+            BaudRate.Text = BaseUtil.GetCacheData("BaudRate").ToString();
             //设置DbFind的必须的数据
             PrintNum.Text = "1";
             asc.controllInitializeSize(this);
@@ -262,11 +264,6 @@ namespace UAS_MES_NEW.Packing
             {
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
-                    //dt = (DataTable)dh.ExecuteSql("select ZD_SN from ZTEDATA where ZD_DEV_EN_NO='" + sn_code.Text + "'", "select");
-                    //if (dt.Rows.Count > 0)
-                    //{
-                    //    sn_code.Text = dt.Rows[0]["ZD_SN"].ToString();
-                    //}
                     dt = (DataTable)dh.ExecuteSql("select ms_status,ms_id,ms_makecode,ms_nextstepcode,ms_craftcode,ms_prodcode from makeserial where ms_sncode ='" + sn_code.Text + "' order by ms_id desc", "select");
                     if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage) || (dt.Rows.Count > 0 && dt.Rows[0]["ms_status"].ToString() == "2"))
                     {
@@ -288,6 +285,7 @@ namespace UAS_MES_NEW.Packing
                                 return;
                             }
                         }
+
                         //string nextstepcode = dh.getFieldDataByCondition("makeserial", "ms_nextstepcode", "ms_id='" + oMsID + "'").ToString();
                         //if (nextstepcode != "" && nextstepcode != User.CurrentStepCode)
                         //{
@@ -304,7 +302,6 @@ namespace UAS_MES_NEW.Packing
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                         string ms_makecode = "";
                         string ms_salecode_text = "";
-
                         if (dt.Rows.Count > 0)
                         {
                             string _maxweight = dt.Rows[0]["pr_colorboxmaxw"].ToString();
@@ -326,21 +323,7 @@ namespace UAS_MES_NEW.Packing
                             }
                             BaseUtil.SetFormValue(this.Controls, dt);
                         }
-                        double ActualWeight = double.Parse(weight.Text == "" ? "0" : weight.Text.Replace("kg", "").Replace("g", "").Trim());
-                        if ((ActualWeight >= MinWeight) && (ActualWeight <= MaxWeight))
-                        {
-                            OperateResult.AppendText(">>彩盒" + sn_code.Text + "重量检测检测合格\n", Color.Green);
-                            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "彩盒称重:" + weight.Text, "称量合格", sn_code.Text, "");
-                            LogicHandler.RecordProdWeight(sn_code.Text, "SN", float.Parse(ActualWeight.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
-                            dh.ExecuteSql("update makeserial set ms_grossw='" + ActualWeight + "' where ms_id='" + oMsID + "'", "update");
-                        }
-                        else
-                        {
-                            OperateResult.AppendText(">>彩盒" + sn_code.Text + "重量检测未通过\n", Color.Red);
-                            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "彩盒称重:" + weight.Text, "称量不合格", sn_code.Text, "");
-                            LogicHandler.RecordProdWeight(sn_code.Text, "SN", float.Parse(ActualWeight.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
-                            return;
-                        }
+
                         if (dt.Rows[0]["ms_outno"].ToString() != "")
                         {
                             OperateResult.AppendText(">>序列号" + sn_code.Text + "已被出货单" + dt.Rows[0]["ms_outno"].ToString() + "采集,不允许操作\n", Color.Red, sn_code);
@@ -433,6 +416,29 @@ namespace UAS_MES_NEW.Packing
                         //如果未勾选了取消录入
                         if (!Cancel.Checked)
                         {
+                            if (inputweight.Text == "")
+                            {
+                                OperateResult.AppendText("请输入重量\n", Color.Green);
+                                inputweight.Focus();
+                                return;
+                            }
+                            double ActualWeight = double.Parse(inputweight.Text == "" ? "0" : inputweight.Text.Replace("kg", "").Replace("g", "").Trim());
+                            if ((ActualWeight >= MinWeight) && (ActualWeight <= MaxWeight))
+                            {
+                                OperateResult.AppendText(">>彩盒" + sn_code.Text + "重量检测检测合格\n", Color.Green);
+                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "彩盒称重:" + inputweight.Text, "称量合格", sn_code.Text, "");
+                                LogicHandler.RecordProdWeight(sn_code.Text, "SN", float.Parse(ActualWeight.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
+                                dh.ExecuteSql("update makeserial set ms_grossw='" + ActualWeight + "' where ms_id='" + oMsID + "'", "update");
+                            }
+                            else
+                            {
+                                OperateResult.AppendText(">>彩盒" + sn_code.Text + "重量检测未通过\n", Color.Red);
+                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "彩盒称重:" + inputweight.Text, "称量不合格", sn_code.Text, "");
+                                LogicHandler.RecordProdWeight(sn_code.Text, "SN", float.Parse(ActualWeight.ToString()), "kg", User.UserLineCode, pr_code.Text, User.UserSourceCode, User.UserName);
+                                return;
+                            }
+                            inputweight.Text = "";
+
                             //判断序列号是否已经装箱
                             string ms_outboxcode = dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString();
                             if (ms_outboxcode != "")
@@ -529,6 +535,7 @@ namespace UAS_MES_NEW.Packing
                                         dh.UpdateByCondition("package", "pa_status=1,pa_packageqty=pa_currentqty,pa_totalqty=pa_currentqty", "pa_outboxcode='" + pa_outboxcode.Text + "'");
                                         OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "满箱采集完成,封箱成功\n", Color.Green);
                                         HttpServer.GetOutBoxInfo(pa_outboxcode.Text);
+                                        HttpServer.SendBoxData(pa_outboxcode.Text);
                                         pa_status.Text = "1";
                                         pa_standardqty.Text = "";
                                         if (AutoPrint.Checked)
@@ -568,6 +575,7 @@ namespace UAS_MES_NEW.Packing
                                         LoadCheckQTY();
                                     }
                                     sn_code.Clear();
+                                    sn_code.Focus();
                                 }
                                 else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sn_code);
                             }
@@ -1222,5 +1230,13 @@ namespace UAS_MES_NEW.Packing
                 thread.Abort();
             }
         }
+
+        private void inputweight_KeyDown(object sender, KeyEventArgs e)
+        {
+            if (e.KeyCode == Keys.Enter)
+            {
+                barcode_KeyDown(sender, e);
+            }
+        }
     }
 }

+ 2 - 2
UAS_MES_HYSX/FunctionCode/Packing/Packing_PackageCollectionZX.resx

@@ -481,7 +481,7 @@
         RudN65tdA8sHzg46DF645Xrr8m2v29fvrLwzMBQydHc4cnjkLvvu5L2key/vZ9yff7DpIfph4SOpR+WP
         lR7X/aj3Y+uI5ciZUdfRvidBTx6Mscae/5T+04fx/Kfkp+UTqhONk2aTp6fcp24+W/1s/Hnq8/npgp+l
         f65+ofviu18cf+mbWTUz/pL/cuHX4lfyr468Xva6e9Z/9vGb5Dfzc4Vv5d8efcd41/s+7P3EfOYH7IeK
-        j3ofuz55f3q4kLyw8Bv3hPP74uYdwgAAAAlwSFlzAAALDgAACw4BQL7hQQAACdNJREFUeF7t3dtOW4cW
+        j3ofuz55f3q4kLyw8Bv3hPP74uYdwgAAAAlwSFlzAAALDQAACw0B7QfALAAACdNJREFUeF7t3dtOW4cW
         heFe9VUibakv1/eoVGk/TFedps2hnCGAjTnYnAlgbGNzJpUqza2xgL2zmSlL4oqV8V98Fx2q190/YxwC
         30XEdwA8pQGAjzQA8JEGAD7SAMBHGgD4SAMAH2kA4CMNAHykAYCPNADwkQYAPtIAwEcaAPhIAwAfaQDg
         Iw0AfKQBgI80APCRBgA+0gDARxoA+EgDAB9pAOAjDQB8pAGAjzQA8JEGAD7SAMBHGgD4SAMAH2kA4CMN
@@ -612,7 +612,7 @@
         RudN65tdA8sHzg46DF645Xrr8m2v29fvrLwzMBQydHc4cnjkLvvu5L2key/vZ9yff7DpIfph4SOpR+WP
         lR7X/aj3Y+uI5ciZUdfRvidBTx6Mscae/5T+04fx/Kfkp+UTqhONk2aTp6fcp24+W/1s/Hnq8/npgp+l
         f65+ofviu18cf+mbWTUz/pL/cuHX4lfyr468Xva6e9Z/9vGb5Dfzc4Vv5d8efcd41/s+7P3EfOYH7IeK
-        j3ofuz55f3q4kLyw8Bv3hPP74uYdwgAAAAlwSFlzAAALDgAACw4BQL7hQQAACdNJREFUeF7t3dtOW4cW
+        j3ofuz55f3q4kLyw8Bv3hPP74uYdwgAAAAlwSFlzAAALDQAACw0B7QfALAAACdNJREFUeF7t3dtOW4cW
         heFe9VUibakv1/eoVGk/TFedps2hnCGAjTnYnAlgbGNzJpUqza2xgL2zmSlL4oqV8V98Fx2q190/YxwC
         30XEdwA8pQGAjzQA8JEGAD7SAMBHGgD4SAMAH2kA4CMNAHykAYCPNADwkQYAPtIAwEcaAPhIAwAfaQDg
         Iw0AfKQBgI80APCRBgA+0gDARxoA+EgDAB9pAOAjDQB8pAGAjzQA8JEGAD7SAMBHGgD4SAMAH2kA4CMN

+ 5 - 15
UAS_MES_HYSX/FunctionCode/Packing/Packing_PalletCollectionZX.cs

@@ -89,7 +89,7 @@ namespace UAS_MES_NEW.Packing
                 LoadGridData();
                 sql.Clear();
                 sql.Append("select pa_makecode,pa_id,pa_status,nvl(pa_standardqty,PR_PALLETQTY)pa_standardqty,pa_prodcode,pa_packageqty,pa_totalqty,pa_salecode,pa_currentqty,pr_code pa_prodcode,pa_outboxcode,pa_totalqty,pa_custcode ");
-                sql.Append("from package left join packagedetail on pa_id =pd_paid left join product on pr_code=pd_prodcode where pa_outboxcode='" + pa_outboxcode.Text + "' and pa_type =3");
+                sql.Append("from package left join packagedetail on pa_id =pd_paid left join product on pr_code=pd_prodcode where pa_outboxcode='" + pa_outboxcode.Text + "' or pa_zxcode='" + pa_outboxcode.Text + "' and pa_type =3");
                 DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                 if (dt.Rows.Count > 0)
                 {
@@ -127,21 +127,10 @@ namespace UAS_MES_NEW.Packing
                     {
                         outboxcode.Text = dt.Rows[0]["ms_outboxcode"].ToString();
                     }
-                    else
+                    dt = (DataTable)dh.ExecuteSql("select pa_outboxcode from package where pa_zxcode='" + outboxcode.Text + "'", "select");
+                    if (dt.Rows.Count > 0)
                     {
-                        dt = (DataTable)dh.ExecuteSql("select ms_outboxcode from makeserial where ms_imei1='" + outboxcode.Text + "'", "select");
-                        if (dt.Rows.Count > 0)
-                        {
-                            outboxcode.Text = dt.Rows[0]["ms_outboxcode"].ToString();
-                        }
-                        else
-                        {
-                            dt = (DataTable)dh.ExecuteSql("select ms_outboxcode from makeserial where ms_imei2='" + outboxcode.Text + "'", "select");
-                            if (dt.Rows.Count > 0)
-                            {
-                                outboxcode.Text = dt.Rows[0]["ms_outboxcode"].ToString();
-                            }
-                        }
+                        outboxcode.Text = dt.Rows[0]["pa_outboxcode"].ToString();
                     }
                     sql.Clear();
                     sql.Append("select nvl(pa_iostatus,0)pa_iostatus,pa_outno,pa_makecode, pd_makecode,nvl(pa_downstatus,0)pa_downstatus,pa_salecode pd_salecode,pr_packrule,pa_id,pa_prodcode pd_prodcode,pa_status,pa_mothercode,pa_nextstep  ");
@@ -542,6 +531,7 @@ namespace UAS_MES_NEW.Packing
                         string Seal = MessageBox.Show(this.ParentForm, "是否确认封栈板?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
                         if (Seal == "Yes")
                         {
+                            HttpServer.GetPalletInfo(pa_outboxcode.Text);
                             OperateResult.AppendText(">>栈板号" + pa_outboxcode.Text + "装栈板成功\n", Color.Green);
                             LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "栈板采集", "封栈板" + pa_outboxcode.Text + "成功", outboxcode.Text, "");
                             dh.ExecuteSql("update package set pa_status=1 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");

+ 34 - 18
UAS_MES_HYSX/PublicMethod/HttpServer.cs

@@ -322,12 +322,14 @@ namespace UAS_MES_NEW.PublicMethod
         //获取SN的EN号,彩盒标机身标一个工站一起打印,需要SN单个获取
         public static string GetEN(string iSN)
         {
-            DataTable dt = (DataTable)dh.ExecuteSql("select PO_SN,ms_id,ma_custpo,ms_makecode,pr_prefix,PREFIX_EN_NO,PREFIX_BIG_BOX,pr_prebigxbox,pr_regcode from makeserial left join product on ms_prodcode=pr_code left join make on ma_code=ms_makecode left join ZTE_ORDER on ma_custpo=BATCH_NO where (ms_sncode ='" + iSN + "' or ms_firstsn='" + iSN + "') and RESERVE9='" + User.UserLineCode + "' order by ms_id desc", "select");
+            DataTable dt = (DataTable)dh.ExecuteSql("select nvl(noType,0)noType,nvl(packing_num,0)packing_num,PO_SN,ms_id,pr_outboxinnerqty,ma_custpo,ms_makecode,pr_prefix,PREFIX_EN_NO,PREFIX_BIG_BOX,pr_prebigxbox,pr_regcode from makeserial left join product on ms_prodcode=pr_code left join make on ma_code=ms_makecode left join ZTE_ORDER on ma_custpo=BATCH_NO where (ms_sncode ='" + iSN + "' or ms_firstsn='" + iSN + "') and RESERVE9='" + User.UserLineCode + "' order by ms_id desc", "select");
             string prefix = "";
             string regcode = "";
             string makecode = "";
             string prebigxbox = "";
+            int packing_num = 0;
             string po = "";
+            int noType = 0;
             string ms_id = "";
             if (dt.Rows.Count > 0)
             {
@@ -335,7 +337,9 @@ namespace UAS_MES_NEW.PublicMethod
                 regcode = dt.Rows[0]["pr_regcode"].ToString();
                 makecode = dt.Rows[0]["ms_makecode"].ToString();
                 prebigxbox = dt.Rows[0]["PREFIX_BIG_BOX"].ToString();
+                packing_num = int.Parse(dt.Rows[0]["packing_num"].ToString());
                 po = dt.Rows[0]["PO_SN"].ToString();
+                noType = int.Parse(dt.Rows[0]["noType"].ToString());
                 ms_id = dt.Rows[0]["ms_id"].ToString();
             }
             if (po == "")
@@ -353,7 +357,8 @@ namespace UAS_MES_NEW.PublicMethod
             obj.reg_code = regcode;
             obj.prefix_en_no = prefix;
             obj.prefix_big_box = prebigxbox;
-            obj.packing_num = 6;
+            obj.packing_num = packing_num;
+            obj.noType = noType;
             obj.isn = iSN;
 
 
@@ -377,6 +382,10 @@ namespace UAS_MES_NEW.PublicMethod
             {
                 dh.ExecuteSql("delete from ZTEDATA where zd_sn='" + iSN + "' and zd_makecode='" + makecode + "' and zd_type='彩盒机身标'", "delete");
             }
+            if (dev_en_no == "")
+            {
+                BaseUtil.ShowError("未获取到EN号");
+            }
             //dh.ExecuteSql("update makeserial set ms_sncode='" + dev_en_no + "' where ms_id='" + ms_id + "'", "update");
             dh.ExecuteSql("insert into ZTEDATA(ZD_ID,ZD_D_SN,zd_WholeDeviceCode,ZD_DEV_EN_NO,ZD_SN, ZD_MAKECODE, ZD_TYPE, ZD_VALUE,zd_mac,ZD_MAC_START, ZD_MAC_END,ZD_RESERVE3,zd_enno,zd_devicetype,zd_regcode)" +
                 "values(ZTEDATA_seq.nextval,'" + SN + "','" + WholeDeviceCode + "','" + dev_en_no + "','" + iSN + "','" + makecode + "','彩盒机身标','','" + mac + "','" + mac_start + "','" + mac_end + "','" + reserve3 + "','" + en_no + "','" + device_type + "','" + reg_code + "')", "insert");
@@ -484,7 +493,7 @@ namespace UAS_MES_NEW.PublicMethod
             }
             JObject deviceObj = JObject.Parse(returnstr);
             string pallet_no = deviceObj["pallet_no"].ToString();
-            string palltecode = deviceObj["pallet_no"].ToString();
+            string palltecode = deviceObj["palletNo"].ToString();
             dh.ExecuteSql("update package set pa_zxcode ='" + palltecode + "',pa_detno='" + pallet_no + "' where pa_outboxcode='" + iBox + "'", "update");
             dh.ExecuteSql("insert into EISDATA(ED_ID, ED_DATA, ED_INDATE, ED_TYPE)values(EISDATA_seq.nextval,'" + returnstr + "',sysdate,'GetPalletInfo')", "insert");
         }
@@ -566,7 +575,7 @@ namespace UAS_MES_NEW.PublicMethod
                 HashType = "SHA256",
                 HashKey = ComputeSha256Hash(sn)
             });
-            dt = (DataTable)dh.ExecuteSql("select pd_barcode,replace(ZD_MAC_START,'-','')ZD_MAC_START from packagedetail left join ztedata on pd_barcode=ZD_DEV_EN_NO and pd_makecode=zd_makecode where pd_outboxcode='" + iBox + "' and zd_type='BOX'", "select");
+            dt = (DataTable)dh.ExecuteSql("select pd_barcode,replace(ZD_MAC_START,'-','')ZD_MAC_START from packagedetail left join ztedata on pd_barcode=ZD_DEV_EN_NO and pd_makecode=zd_makecode where pd_outboxcode='" + iBox + "' and zd_type='BOX' order by pd_barcode", "select");
             DataTable dt1 = (DataTable)dh.ExecuteSql("select pid_sql,pid_item,pid_value,pid_valuetype from productitem left join productitemdetail on pid_piid=pi_id where pi_prodcode='" + pr_code + "'", "select");
             for (int i = 0; i < dt.Rows.Count; i++)
             {
@@ -632,28 +641,35 @@ namespace UAS_MES_NEW.PublicMethod
                 string json = JsonConvert.SerializeObject(root, Formatting.Indented);
                 var content = new StringContent(json, Encoding.UTF8, "application/json");
                 await Console.Out.WriteLineAsync(json);
-
-                var response = await client.PostAsync("https://172.30.30.10:29001/api/mds-web-outservice/v1/api/rest/mds/saveFmKeyHashcodeInfoBatch", content);
-                if (response.IsSuccessStatusCode)
+                try
                 {
-                    string returnstr = await response.Content.ReadAsStringAsync();
-                    JObject deviceObj = JObject.Parse(returnstr);
-                    string code = deviceObj["code"]["code"].ToString();
-                    string msg = deviceObj["code"]["msg"].ToString();
-                    if (code == "0000")
+                    var response = await client.PostAsync("https://172.30.30.10:29001/api/mds-web-outservice/v1/api/rest/mds/saveFmKeyHashcodeInfoBatch", content);
+                    if (response.IsSuccessStatusCode)
                     {
-                        dh.ExecuteSql("update packagedetail set pd_issuccess=-1 where pd_outboxcode='" + iBox + "'", "update");
-                        MessageBox.Show(ZD_BIG_BOX_NO + "上传星云成功");
+                        string returnstr = await response.Content.ReadAsStringAsync();
+                        JObject deviceObj = JObject.Parse(returnstr);
+                        string code = deviceObj["code"]["code"].ToString();
+                        string msg = deviceObj["code"]["msg"].ToString();
+                        if (code == "0000")
+                        {
+                            dh.ExecuteSql("update packagedetail set pd_issuccess=-1 where pd_outboxcode='" + iBox + "'", "update");
+                            dh.ExecuteSql("update package set pa_issuccess=-1 where pa_outboxcode='" + iBox + "'", "update");
+                            //MessageBox.Show(ZD_BIG_BOX_NO + "上传星云成功");
+                        }
+                        else
+                        {
+                            dh.ExecuteSql("insert into EISDATA(ED_ID, ED_DATA, ED_INDATE, ED_TYPE)values(EISDATA_seq.nextval,'" + msg + "',sysdate,'SendBoxData')", "insert");
+                            MessageBox.Show(msg);
+                        }
                     }
                     else
                     {
-                        dh.ExecuteSql("insert into EISDATA(ED_ID, ED_DATA, ED_INDATE, ED_TYPE)values(EISDATA_seq.nextval,'" + msg + "',sysdate,'SendBoxData')", "insert");
-                        MessageBox.Show(msg);
+                        BaseUtil.ShowError(response.StatusCode.ToString());
                     }
                 }
-                else
+                catch (Exception ex)
                 {
-                    BaseUtil.ShowError(response.StatusCode.ToString());
+                    dh.ExecuteSql("insert into EISDATA(ED_ID, ED_DATA, ED_INDATE, ED_TYPE)values(EISDATA_seq.nextval,'" + ex.Message + "',sysdate,'SendBoxData')", "insert");
                 }
             }
         }

+ 33 - 19
UAS_MES_HYSX/PublicMethod/Print.cs

@@ -10,6 +10,7 @@ using Seagull.BarTender.Print;
 using System.Net;
 using System;
 using System.Linq;
+using BarTender;
 
 namespace UAS_MES_NEW.PublicMethod
 {
@@ -112,7 +113,7 @@ namespace UAS_MES_NEW.PublicMethod
         }
 
 
-        public static bool CodeSoft(string iCaller, ref ApplicationClass lbl, 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, ref LabelManager2.ApplicationClass lbl, string LabelName, string LaID, string PrinterName, string SnCode, int PrintNum, string MakeCode, string ProdCode, string LabelType, string IfRePrint, out string ErrorMessage)
         {
             ErrorMessage = "";
             DataTable dt = new DataTable();
@@ -148,7 +149,7 @@ namespace UAS_MES_NEW.PublicMethod
             if (filechangetime != filelastwritetime)
             {
                 lbl.Quit();
-                lbl = new ApplicationClass();
+                lbl = new LabelManager2.ApplicationClass();
                 BaseUtil.WriteLbl();
                 filechangetime = PrintFile.LastWriteTime.ToString("yyyy-MM-dd HH:mm:ss");
                 string update = "la_lastwritetime = to_date((regexp_substr('" + filechangetime + "','\\d+.+\\d+')),'yyyy-mm-dd hh24:mi:ss')";
@@ -167,7 +168,7 @@ namespace UAS_MES_NEW.PublicMethod
                 try
                 {
                     Regex ConnoteA = new Regex("{\\w+}");
-                    foreach (Match mch in ConnoteA.Matches(sql))
+                    foreach (System.Text.RegularExpressions.Match mch in ConnoteA.Matches(sql))
                     {
                         string x = mch.Value.Trim();
                         sql = sql.Replace(x, "'" + SnCode + "'");
@@ -579,6 +580,7 @@ namespace UAS_MES_NEW.PublicMethod
                 MessageBox.Show("标签文件打开失败");
                 return false;
             }
+            Console.WriteLine("清空参数开始" + System.DateTime.Now.ToString("yyyy-mm-dd hh:mm:ss:ffffff"));
             try
             {
                 for (int k = 0; k < doc2.NamedSubStrings.Count; k++)
@@ -590,13 +592,15 @@ namespace UAS_MES_NEW.PublicMethod
             {
                 LogManager.DoLog(ex.Message + ex.StackTrace);
             }
-            //string ParamValue = format.SubStrings.GetAll("#", "$");
-            //string[] paramname = ParamValue.Split('$');
-            //for (int i = 0; i < paramname.Length; i++)
-            //{
-            //    paramname[i] = paramname[i].Split('#')[0];
-            //}
+            Console.WriteLine("清空参数结束" + System.DateTime.Now.ToString("yyyy-mm-dd hh:mm:ss:ffffff"));
+            string ParamValue = doc2.NamedSubStrings.GetAll("#", "$").ToUpper();
+            string[] paramname = ParamValue.Split('$');
+            for (int i = 0; i < paramname.Length; i++)
+            {
+                paramname[i] = paramname[i].Split('#')[0];
+            }
             //执行全部的SQL
+            Console.WriteLine("参数赋值开始" + System.DateTime.Now.ToString("yyyy-mm-dd hh:mm:ss:ffffff"));
             for (int i = 0; i < dt.Rows.Count; i++)
             {
                 string sql = dt.Rows[i]["lp_sql"].ToString();
@@ -617,22 +621,31 @@ namespace UAS_MES_NEW.PublicMethod
                         int LoopTime = Param.Rows.Count > 200 ? 200 : Param.Rows.Count;
                         for (int j = 0; j < LoopTime; j++)
                         {
-                            for (int k = 0; k < doc2.NamedSubStrings.Count; k++)
+                            if (paramname.Contains(dt.Rows[i]["lp_name"].ToString().ToUpper()))
                             {
-                                if (j == 0 & doc2.NamedSubStrings.Item(k + 1).Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper())
+                                if (doc2.NamedSubStrings.Item(dt.Rows[i]["lp_name"].ToString()).Name != null)
                                 {
-                                    doc2.SetNamedSubStringValue(doc2.NamedSubStrings.Item(k + 1).Name, Param.Rows[0][0].ToString());
+                                    doc2.SetNamedSubStringValue(dt.Rows[i]["lp_name"].ToString(), Param.Rows[0][0].ToString());
                                 }
-                                //使用SN开头的参数赋值SN1,SN2,SN3等参数
-                                //if (j != 0 & doc2.NamedSubStrings.Item(k + 1).Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper() + (j))
-                                //{
-                                //    doc2.SetNamedSubStringValue(doc2.NamedSubStrings.Item(k + 1).Name, Param.Rows[j][0].ToString());
-                                //}
-                                if (doc2.NamedSubStrings.Item(k + 1).Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper() + (j + 1))
+                            }
+                            if (paramname.Contains(dt.Rows[i]["lp_name"].ToString().ToUpper() + (j + 1)))
+                            {
+                                if (doc2.NamedSubStrings.Item(dt.Rows[i]["lp_name"].ToString() + (j + 1)).Name != null)
                                 {
-                                    doc2.SetNamedSubStringValue(doc2.NamedSubStrings.Item(k + 1).Name, Param.Rows[j][0].ToString());
+                                    doc2.SetNamedSubStringValue(dt.Rows[i]["lp_name"].ToString() + (j + 1), Param.Rows[j][0].ToString());
                                 }
                             }
+                            //for (int k = 0; k < doc2.NamedSubStrings.Count; k++)
+                            //{
+                            //    if (j == 0 & doc2.NamedSubStrings.Item(k + 1).Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper())
+                            //    {
+                            //        doc2.SetNamedSubStringValue(doc2.NamedSubStrings.Item(k + 1).Name, Param.Rows[0][0].ToString());
+                            //    }
+                            //    if (doc2.NamedSubStrings.Item(k + 1).Name.ToUpper() == dt.Rows[i]["lp_name"].ToString().ToUpper() + (j + 1))
+                            //    {
+                            //        doc2.SetNamedSubStringValue(doc2.NamedSubStrings.Item(k + 1).Name, Param.Rows[j][0].ToString());
+                            //    }
+                            //}
                         }
                     }
                 }
@@ -641,6 +654,7 @@ namespace UAS_MES_NEW.PublicMethod
                     MessageBox.Show("SQL维护不正确");
                 }
             }
+            Console.WriteLine("参数赋值结束" + System.DateTime.Now.ToString("yyyy-mm-dd hh:mm:ss:ffffff"));
             LogManager.DoLog(sb.ToString());
             //保存本次赋值进行打印a
             doc2.PrintSetup.IdenticalCopiesOfLabel = PrintNum;