callm 4 дней назад
Родитель
Сommit
051f35ac95

+ 0 - 1
UAS_MES_YDCY/DataOperate/DataHelper.cs

@@ -56,7 +56,6 @@ namespace UAS_MES_NEW.DataOperate
             DataTable dt = new DataTable();
             DataTable dt = new DataTable();
             string sql = "select " + Field + " from " + TableName + " where " + Condition;
             string sql = "select " + Field + " from " + TableName + " where " + Condition;
             command = new OracleCommand(sql, connection);
             command = new OracleCommand(sql, connection);
-            Console.WriteLine(sql);
             Reconnect(command);
             Reconnect(command);
             OracleDataAdapter ad = new OracleDataAdapter();
             OracleDataAdapter ad = new OracleDataAdapter();
             ad.SelectCommand = command;
             ad.SelectCommand = command;

+ 35 - 20
UAS_MES_YDCY/FunctionCode/Warehouse/Warehouse_FinishedProductOutSumNEW.Designer.cs

@@ -34,6 +34,7 @@
             this.pi_titile_label = new System.Windows.Forms.Label();
             this.pi_titile_label = new System.Windows.Forms.Label();
             this.pi_title = new System.Windows.Forms.Label();
             this.pi_title = new System.Windows.Forms.Label();
             this.panel1 = new System.Windows.Forms.Panel();
             this.panel1 = new System.Windows.Forms.Panel();
+            this.CombineCust = new System.Windows.Forms.RadioButton();
             this.Baurate = new System.Windows.Forms.Label();
             this.Baurate = new System.Windows.Forms.Label();
             this.ComList = new System.Windows.Forms.Label();
             this.ComList = new System.Windows.Forms.Label();
             this.sumpalletweight = new System.Windows.Forms.Label();
             this.sumpalletweight = new System.Windows.Forms.Label();
@@ -48,6 +49,7 @@
             this.label8 = new System.Windows.Forms.Label();
             this.label8 = new System.Windows.Forms.Label();
             this.label6 = new System.Windows.Forms.Label();
             this.label6 = new System.Windows.Forms.Label();
             this.label4 = new System.Windows.Forms.Label();
             this.label4 = new System.Windows.Forms.Label();
+            this.Combine = new System.Windows.Forms.RadioButton();
             this.palletBtn = new System.Windows.Forms.RadioButton();
             this.palletBtn = new System.Windows.Forms.RadioButton();
             this.bigboxBtn = new System.Windows.Forms.RadioButton();
             this.bigboxBtn = new System.Windows.Forms.RadioButton();
             this.pi_id = new System.Windows.Forms.Label();
             this.pi_id = new System.Windows.Forms.Label();
@@ -83,7 +85,6 @@
             this.pi_inoutno = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.pi_inoutno = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SearchTextBox();
             this.PrinterList_label = new System.Windows.Forms.Label();
             this.PrinterList_label = new System.Windows.Forms.Label();
             this.PrinterList = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.PrinterCombox();
             this.PrinterList = new UAS_MES_NEW.CustomControl.ComBoxWithFocus.PrinterCombox();
-            this.Combine = new System.Windows.Forms.RadioButton();
             this.AutoOutBoxCode = new System.Windows.Forms.CheckBox();
             this.AutoOutBoxCode = new System.Windows.Forms.CheckBox();
             this.pa_outboxcode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
             this.pa_outboxcode = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.SnCollectionBox();
             this.pa_outboxcode_label = new System.Windows.Forms.Label();
             this.pa_outboxcode_label = new System.Windows.Forms.Label();
@@ -109,7 +110,7 @@
             this.label13 = new System.Windows.Forms.Label();
             this.label13 = new System.Windows.Forms.Label();
             this.label14 = new System.Windows.Forms.Label();
             this.label14 = new System.Windows.Forms.Label();
             this.pi_boxnum = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.pi_boxnum = new UAS_MES_NEW.CustomControl.TextBoxWithIcon.EnterTextBox();
-            this.CombineCust = new System.Windows.Forms.RadioButton();
+            this.NoComBine = new System.Windows.Forms.RadioButton();
             this.panel1.SuspendLayout();
             this.panel1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.bindingSource)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.bindingSource)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.Prodiodetail)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.Prodiodetail)).BeginInit();
@@ -151,6 +152,7 @@
             // panel1
             // panel1
             // 
             // 
             this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
             this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+            this.panel1.Controls.Add(this.NoComBine);
             this.panel1.Controls.Add(this.CombineCust);
             this.panel1.Controls.Add(this.CombineCust);
             this.panel1.Controls.Add(this.Baurate);
             this.panel1.Controls.Add(this.Baurate);
             this.panel1.Controls.Add(this.ComList);
             this.panel1.Controls.Add(this.ComList);
@@ -173,6 +175,16 @@
             this.panel1.Size = new System.Drawing.Size(523, 377);
             this.panel1.Size = new System.Drawing.Size(523, 377);
             this.panel1.TabIndex = 217;
             this.panel1.TabIndex = 217;
             // 
             // 
+            // CombineCust
+            // 
+            this.CombineCust.AutoSize = true;
+            this.CombineCust.Location = new System.Drawing.Point(310, 321);
+            this.CombineCust.Name = "CombineCust";
+            this.CombineCust.Size = new System.Drawing.Size(185, 28);
+            this.CombineCust.TabIndex = 274;
+            this.CombineCust.Text = "合并客户料号";
+            this.CombineCust.UseVisualStyleBackColor = true;
+            // 
             // Baurate
             // Baurate
             // 
             // 
             this.Baurate.AutoSize = true;
             this.Baurate.AutoSize = true;
@@ -330,6 +342,16 @@
             this.label4.TabIndex = 218;
             this.label4.TabIndex = 218;
             this.label4.Text = "出货数量";
             this.label4.Text = "出货数量";
             // 
             // 
+            // Combine
+            // 
+            this.Combine.AutoSize = true;
+            this.Combine.Location = new System.Drawing.Point(158, 321);
+            this.Combine.Name = "Combine";
+            this.Combine.Size = new System.Drawing.Size(137, 28);
+            this.Combine.TabIndex = 250;
+            this.Combine.Text = "合并明细";
+            this.Combine.UseVisualStyleBackColor = true;
+            // 
             // palletBtn
             // palletBtn
             // 
             // 
             this.palletBtn.AutoSize = true;
             this.palletBtn.AutoSize = true;
@@ -735,16 +757,6 @@
             this.PrinterList.Size = new System.Drawing.Size(219, 40);
             this.PrinterList.Size = new System.Drawing.Size(219, 40);
             this.PrinterList.TabIndex = 248;
             this.PrinterList.TabIndex = 248;
             // 
             // 
-            // Combine
-            // 
-            this.Combine.AutoSize = true;
-            this.Combine.Location = new System.Drawing.Point(38, 321);
-            this.Combine.Name = "Combine";
-            this.Combine.Size = new System.Drawing.Size(137, 28);
-            this.Combine.TabIndex = 250;
-            this.Combine.Text = "合并明细";
-            this.Combine.UseVisualStyleBackColor = true;
-            // 
             // AutoOutBoxCode
             // AutoOutBoxCode
             // 
             // 
             this.AutoOutBoxCode.AutoSize = true;
             this.AutoOutBoxCode.AutoSize = true;
@@ -1064,15 +1076,17 @@
             this.pi_boxnum.TabIndex = 273;
             this.pi_boxnum.TabIndex = 273;
             this.pi_boxnum.KeyDown += new System.Windows.Forms.KeyEventHandler(this.pi_boxnum_KeyDown);
             this.pi_boxnum.KeyDown += new System.Windows.Forms.KeyEventHandler(this.pi_boxnum_KeyDown);
             // 
             // 
-            // CombineCust
+            // NoComBine
             // 
             // 
-            this.CombineCust.AutoSize = true;
-            this.CombineCust.Location = new System.Drawing.Point(182, 321);
-            this.CombineCust.Name = "CombineCust";
-            this.CombineCust.Size = new System.Drawing.Size(185, 28);
-            this.CombineCust.TabIndex = 274;
-            this.CombineCust.Text = "合并客户料号";
-            this.CombineCust.UseVisualStyleBackColor = true;
+            this.NoComBine.AutoSize = true;
+            this.NoComBine.Checked = true;
+            this.NoComBine.Location = new System.Drawing.Point(27, 321);
+            this.NoComBine.Name = "NoComBine";
+            this.NoComBine.Size = new System.Drawing.Size(113, 28);
+            this.NoComBine.TabIndex = 275;
+            this.NoComBine.TabStop = true;
+            this.NoComBine.Text = "不合并";
+            this.NoComBine.UseVisualStyleBackColor = true;
             // 
             // 
             // Warehouse_FinishedProductOutSumNEW
             // Warehouse_FinishedProductOutSumNEW
             // 
             // 
@@ -1225,5 +1239,6 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn2;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_detail1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_detail1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_spec1;
         private System.Windows.Forms.DataGridViewTextBoxColumn pr_spec1;
+        private System.Windows.Forms.RadioButton NoComBine;
     }
     }
 }
 }

+ 37 - 8
UAS_MES_YDCY/FunctionCode/Warehouse/Warehouse_FinishedProductOutSumNEW.cs

@@ -405,8 +405,8 @@ namespace UAS_MES_NEW.Warehouse
                             else
                             else
                             {
                             {
                                 sql.Clear();
                                 sql.Clear();
-                                sql.Append("select cn,outqty,outqty-nvl((select count(1) from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_pdid='" + PDID + "'),0)ungetqty from");
-                                sql.Append("(select nvl(sum(pd_outqty),0) outqty  ,count(1)cn from prodiodetail where pd_piid=" + pi_id.Text + " and pd_id='" + PDID + "')");
+                                sql.Append("select cn,outqty,outqty-nvl((select count(1) from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_pdid='" + PDID + "' and pim_prodcode='" + dtms.Rows[0]["ma_prodcode"].ToString() + "'),0)ungetqty from");
+                                sql.Append("(select nvl(sum(pd_outqty),0) outqty  ,count(1)cn from prodiodetail where pd_piid=" + pi_id.Text + " and pd_id='" + PDID + "' and pd_prodcode='" + dtms.Rows[0]["ma_prodcode"].ToString() + "')");
                                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                                 if (dt.Rows[0]["cn"].ToString() == "0")
                                 if (dt.Rows[0]["cn"].ToString() == "0")
                                 {
                                 {
@@ -425,6 +425,16 @@ namespace UAS_MES_NEW.Warehouse
                                 }
                                 }
                             }
                             }
                             int palletnum = int.Parse(dh.getFieldDataByCondition("prodiomac", " count(distinct pim_outboxcode)", "pim_inoutno='" + pi_inoutno.Text + "' and PIM_TYPE='PALLET' ").ToString());
                             int palletnum = int.Parse(dh.getFieldDataByCondition("prodiomac", " count(distinct pim_outboxcode)", "pim_inoutno='" + pi_inoutno.Text + "' and PIM_TYPE='PALLET' ").ToString());
+                            if (pa_standardqty.Text == "")
+                            {
+                                OperateResult.AppendText("请输入栈板容量\n", Color.Red, input);
+                                return;
+                            }
+                            if (pi_palletnum.Text == "")
+                            {
+                                OperateResult.AppendText("请输入栈板数量\n", Color.Red, input);
+                                return;
+                            }
                             if (palletnum >= int.Parse(pi_palletnum.Text))
                             if (palletnum >= int.Parse(pi_palletnum.Text))
                             {
                             {
                                 OperateResult.AppendText("当前栈板数量" + palletnum + ",超出设置栈板数" + pi_palletnum.Text + "\n", Color.Red, input);
                                 OperateResult.AppendText("当前栈板数量" + palletnum + ",超出设置栈板数" + pi_palletnum.Text + "\n", Color.Red, input);
@@ -513,6 +523,20 @@ namespace UAS_MES_NEW.Warehouse
                             }
                             }
                             if (CombineCust.Checked)
                             if (CombineCust.Checked)
                             {
                             {
+                                sql.Clear();
+                                sql.Append("select cn,outqty,outqty-nvl((select count(1) from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_prodcode='" + dtms.Rows[0]["ma_prodcode"].ToString() + "'),0)ungetqty from");
+                                sql.Append("(select nvl(sum(pd_outqty),0) outqty  ,count(1)cn from prodiodetail where pd_piid=" + pi_id.Text + " and pd_prodcode='" + dtms.Rows[0]["ma_prodcode"].ToString() + "')");
+                                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                                if (dt.Rows[0]["cn"].ToString() == "0")
+                                {
+                                    OperateResult.AppendText("序列号" + input.Text + "所属产品:" + dtms.Rows[0]["ma_prodcode"].ToString() + ",不在出货单" + pi_inoutno.Text + "中\n", Color.Red, input);
+                                    return;
+                                }
+                                if (int.Parse(dt.Rows[0]["ungetqty"].ToString()) < int.Parse(PA_TOTALQTY))
+                                {
+                                    OperateResult.AppendText("当前栈板数量" + PA_TOTALQTY + ",超出待采集数量\n", Color.Red, input);
+                                    return;
+                                }
                                 sql.Clear();
                                 sql.Clear();
                                 sql.Append("select cn,outqty,outqty-nvl((select count(1) from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_custprodcode='" + dtms.Rows[0]["ma_custprodcode"].ToString() + "'),0)ungetqty from");
                                 sql.Append("select cn,outqty,outqty-nvl((select count(1) from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_custprodcode='" + dtms.Rows[0]["ma_custprodcode"].ToString() + "'),0)ungetqty from");
                                 sql.Append("(select nvl(sum(pd_outqty),0) outqty  ,count(1)cn from prodiodetail where pd_piid=" + pi_id.Text + "  and pd_custprod='" + dtms.Rows[0]["ma_custprodcode"].ToString() + "')");
                                 sql.Append("(select nvl(sum(pd_outqty),0) outqty  ,count(1)cn from prodiodetail where pd_piid=" + pi_id.Text + "  and pd_custprod='" + dtms.Rows[0]["ma_custprodcode"].ToString() + "')");
@@ -536,8 +560,8 @@ namespace UAS_MES_NEW.Warehouse
                             else
                             else
                             {
                             {
                                 sql.Clear();
                                 sql.Clear();
-                                sql.Append("select cn,outqty,outqty-nvl((select count(1) from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_pdid='" + PDID + "'),0)ungetqty from");
-                                sql.Append("(select nvl(sum(pd_outqty),0) outqty  ,count(1)cn from prodiodetail where pd_piid=" + pi_id.Text + " and pd_id='" + PDID + "')");
+                                sql.Append("select cn,outqty,outqty-nvl((select count(1) from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_pdid='" + PDID + "' and pim_prodcode='" + dtms.Rows[0]["ma_prodcode"].ToString() + "'),0)ungetqty from");
+                                sql.Append("(select nvl(sum(pd_outqty),0) outqty  ,count(1)cn from prodiodetail where pd_piid=" + pi_id.Text + " and pd_id='" + PDID + "' and pd_prodcode='" + dtms.Rows[0]["ma_prodcode"].ToString() + "')");
                                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                                 if (dt.Rows[0]["cn"].ToString() == "0")
                                 if (dt.Rows[0]["cn"].ToString() == "0")
                                 {
                                 {
@@ -549,6 +573,7 @@ namespace UAS_MES_NEW.Warehouse
                                     OperateResult.AppendText("出货单产品" + dtms.Rows[0]["ma_prodcode"].ToString() + "已经完成出货采集\n", Color.Red, input);
                                     OperateResult.AppendText("出货单产品" + dtms.Rows[0]["ma_prodcode"].ToString() + "已经完成出货采集\n", Color.Red, input);
                                     return;
                                     return;
                                 }
                                 }
+
                                 if (int.Parse(dt.Rows[0]["ungetqty"].ToString()) < int.Parse(PA_TOTALQTY))
                                 if (int.Parse(dt.Rows[0]["ungetqty"].ToString()) < int.Parse(PA_TOTALQTY))
                                 {
                                 {
                                     OperateResult.AppendText("当前栈板数量" + PA_TOTALQTY + ",超出待采集数量\n", Color.Red, input);
                                     OperateResult.AppendText("当前栈板数量" + PA_TOTALQTY + ",超出待采集数量\n", Color.Red, input);
@@ -571,6 +596,10 @@ namespace UAS_MES_NEW.Warehouse
                                                 "(" + pa_id + ",'" + pa_outboxcode.Text + "',case when nvl('" + pr_packrule + "',' ')<>'MIX' then '" + pa_prodcode + "' ELSE''END,3,0,0,case when '" + pr_packrule + "'='MAKE' THEN '" + pa_makecode + "' ELSE '' END, 0,SYSDATE,case when '" + pr_packrule + "'='SALE' " +
                                                 "(" + pa_id + ",'" + pa_outboxcode.Text + "',case when nvl('" + pr_packrule + "',' ')<>'MIX' then '" + pa_prodcode + "' ELSE''END,3,0,0,case when '" + pr_packrule + "'='MAKE' THEN '" + pa_makecode + "' ELSE '' END, 0,SYSDATE,case when '" + pr_packrule + "'='SALE' " +
                                                  "then '" + pa_salecode + "' else ''end,3,0,'" + pr_packrule + "','" + pa_standardqty.Text + "','" + User.UserSourceCode + "','" + pi_inoutno.Text + "')", "insert");
                                                  "then '" + pa_salecode + "' else ''end,3,0,'" + pr_packrule + "','" + pa_standardqty.Text + "','" + User.UserSourceCode + "','" + pi_inoutno.Text + "')", "insert");
                                 }
                                 }
+                                else
+                                {
+                                    dh.ExecuteSql("update package set pa_outno='" + pi_inoutno.Text + "' where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
+                                }
                                 sql.Clear();
                                 sql.Clear();
                                 sql.Append("insert into packagedetail(pd_id, pd_paid, pd_outboxcode,pd_makecode,pd_prodcode,pd_innerboxcode, pd_innerqty,pd_builddate)");
                                 sql.Append("insert into packagedetail(pd_id, pd_paid, pd_outboxcode,pd_makecode,pd_prodcode,pd_innerboxcode, pd_innerqty,pd_builddate)");
                                 sql.Append("select packagedetail_seq.nextval,'" + pa_id + "','" + pa_outboxcode.Text + "','" + pa_makecode + "','" + pa_prodcode + "','" + input.Text + "' ");
                                 sql.Append("select packagedetail_seq.nextval,'" + pa_id + "','" + pa_outboxcode.Text + "','" + pa_makecode + "','" + pa_prodcode + "','" + input.Text + "' ");
@@ -716,7 +745,7 @@ namespace UAS_MES_NEW.Warehouse
                                     pim_mac.Add(datatable.Rows[i]["pim_mac"].ToString());
                                     pim_mac.Add(datatable.Rows[i]["pim_mac"].ToString());
                                     pim_prodcode.Add(datatable.Rows[i]["pim_prodcode"].ToString());
                                     pim_prodcode.Add(datatable.Rows[i]["pim_prodcode"].ToString());
                                 }
                                 }
-                                dh.BatchInsert("update makeserial set ms_outno='' where ms_sncode = :pim_mac and ms_prodcode = :pim_prodcode and ms_outno = '" + pi_inoutno.Text + "'", new string[] { "pim_mac", "pim_prodcode" }, pim_mac.ToArray(), pim_prodcode.ToArray());
+                                dh.BatchInsert("update makeserial set ms_outno='' where ms_sncode = :pim_mac and ms_outno = '" + pi_inoutno.Text + "'", new string[] { "pim_mac" }, pim_mac.ToArray());
                                 dh.ExecuteSql("delete from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_outboxcode='" + input.Text + "' and pim_type='PALLET' and pim_inorout='OUT'  AND pim_class='出货'", "delete");
                                 dh.ExecuteSql("delete from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_outboxcode='" + input.Text + "' and pim_type='PALLET' and pim_inorout='OUT'  AND pim_class='出货'", "delete");
                                 dh.UpdateByCondition("package", "pa_outno=''", "pa_outboxcode='" + input.Text + "'");
                                 dh.UpdateByCondition("package", "pa_outno=''", "pa_outboxcode='" + input.Text + "'");
                                 OperateResult.AppendText("栈板号" + input.Text + "取消备货成功\n", Color.Black, input);
                                 OperateResult.AppendText("栈板号" + input.Text + "取消备货成功\n", Color.Black, input);
@@ -775,7 +804,7 @@ namespace UAS_MES_NEW.Warehouse
                                     pim_mac.Add(datatable.Rows[i]["pim_mac"].ToString());
                                     pim_mac.Add(datatable.Rows[i]["pim_mac"].ToString());
                                     pim_prodcode.Add(datatable.Rows[i]["pim_prodcode"].ToString());
                                     pim_prodcode.Add(datatable.Rows[i]["pim_prodcode"].ToString());
                                 }
                                 }
-                                dh.BatchInsert("update makeserial set ms_outno='' where ms_sncode = :pim_mac and ms_prodcode = :pim_prodcode and ms_outno = '" + pi_inoutno.Text + "'", new string[] { "pim_mac", "pim_prodcode" }, pim_mac.ToArray(), pim_prodcode.ToArray());
+                                dh.BatchInsert("update makeserial set ms_outno='' where ms_sncode = :pim_mac and ms_outno = '" + pi_inoutno.Text + "'", new string[] { "pim_mac" }, pim_mac.ToArray());
                                 dh.ExecuteSql("delete from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_outboxcode='" + input.Text + "' and pim_type='BOX' and pim_inorout='OUT'  AND pim_class='出货'", "delete");
                                 dh.ExecuteSql("delete from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_outboxcode='" + input.Text + "' and pim_type='BOX' and pim_inorout='OUT'  AND pim_class='出货'", "delete");
                                 OperateResult.AppendText("箱号" + input.Text + "取消备货成功\n", Color.Black, input);
                                 OperateResult.AppendText("箱号" + input.Text + "取消备货成功\n", Color.Black, input);
                                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode, User.UserLineCode, User.UserSourceCode, "箱号" + input.Text + "取消出货备货", "箱号" + input.Text + "取消出货备货成功", input.Text, "");
                                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode, User.UserLineCode, User.UserSourceCode, "箱号" + input.Text + "取消出货备货", "箱号" + input.Text + "取消出货备货成功", input.Text, "");
@@ -817,8 +846,8 @@ namespace UAS_MES_NEW.Warehouse
             }
             }
             sql.Clear();
             sql.Clear();
             sql.Append("insert into prodiomac(pim_id,pim_inoutno,pim_piid,pim_prodcode,pim_mac,pim_indate,pim_inman,pim_type,pim_outboxcode,pim_inorout,pim_class,pim_custpo,pim_custdetno,pim_pdid,pim_custprodcode)");
             sql.Append("insert into prodiomac(pim_id,pim_inoutno,pim_piid,pim_prodcode,pim_mac,pim_indate,pim_inman,pim_type,pim_outboxcode,pim_inorout,pim_class,pim_custpo,pim_custdetno,pim_pdid,pim_custprodcode)");
-            sql.Append("select prodiomac_seq.nextval,'" + pi_inoutno.Text + "','" + pi_id.Text + "',v_prodcode,ms_sncode,sysdate,'" + User.UserCode + "','" + pib_type + "','" + iBox + "','OUT','出货','" + custpo + "','" + custpodetno + "','" + PDID + "',ma_custprodcode " +
-                " from mes_package_view left join makeserial on ms_sncode=v_barcode and ms_makecode=v_makecode left join make on ma_code=ms_makecode where v_outboxcode='" + iBox + "' and ms_outno is null");
+            sql.Append("select prodiomac_seq.nextval,'" + pi_inoutno.Text + "','" + pi_id.Text + "',ms_prodcode,ms_sncode,sysdate,'" + User.UserCode + "','" + pib_type + "','" + iBox + "','OUT','出货','" + custpo + "','" + custpodetno + "','" + PDID + "',ma_custprodcode " +
+                " from mes_package_view left join makeserial on ms_sncode=v_barcode and ms_makecode=v_makecode left join make on ma_code=ms_makecode where v_outboxcode='" + iBox + "' and  (v_prodcode,ms_sncode) not in (select PIM_PRODCODE, PIM_MAC from prodiomac)");
             dh.ExecuteSql(sql.GetString(), "insert");
             dh.ExecuteSql(sql.GetString(), "insert");
         }
         }
 
 

+ 45 - 0
UAS_MES_YDCY/FunctionCode/Warehouse/Warehouse_FinishedProductOutSumNEW.resx

@@ -279,6 +279,33 @@
   <metadata name="pr_spec1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   <metadata name="pr_spec1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
     <value>True</value>
   </metadata>
   </metadata>
+  <metadata name="pd_pdno.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pd_cartons.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pd_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pd_prodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pd_custpo.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pd_custpodetno.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="dataGridViewTextBoxColumn2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pr_detail1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pr_spec1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <data name="Clean.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
   <data name="Clean.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
         iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
@@ -335,6 +362,24 @@
   <metadata name="blank.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   <metadata name="blank.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
     <value>True</value>
   </metadata>
   </metadata>
+  <metadata name="pa_mothercode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="PA_TOTALQTY.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pa_prodcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pr_detail.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pr_spec.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="blank.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <data name="StartWeight.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
   <data name="StartWeight.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m
         iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m