Sfoglia il codice sorgente

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

章政 8 anni fa
parent
commit
d566b676e4

+ 75 - 58
UAS-MES/FunctionCode/Warehouse/Warehouse_FinishedProductOut.Designer.cs

@@ -41,7 +41,6 @@
             this.palletBtn = new System.Windows.Forms.RadioButton();
             this.serBtn = new System.Windows.Forms.RadioButton();
             this.bigboxBtn = new System.Windows.Forms.RadioButton();
-            this.input = new UAS_MES.CustomControl.TextBoxWithIcon.SnCollectionBox();
             this.pi_id = new System.Windows.Forms.Label();
             this.pi_type = new System.Windows.Forms.Label();
             this.bindingSource = new System.Windows.Forms.BindingSource(this.components);
@@ -49,12 +48,8 @@
             this.pi_type_check = new UAS_MES.CustomControl.CustomCheckBox.CustomCheckBox();
             this.Clean = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.cancel = new UAS_MES.CustomControl.CustomCheckBox.CustomCheckBox();
+            this.input = new UAS_MES.CustomControl.TextBoxWithIcon.SnCollectionBox();
             this.InOutDetailDGV = new UAS_MES.CustomControl.DataGrid_View.DataGridViewWithSerialNum();
-            this.pim_outboxcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pim_mac = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pim_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_detail = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.pr_spec = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.boxqty = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.getqty = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.ungetqty = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
@@ -63,6 +58,12 @@
             this.NewProdInOut = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.ProdDetail = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.pi_inoutno = new UAS_MES.CustomControl.TextBoxWithIcon.SearchTextBox();
+            this.pim_outboxcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pim_mac = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pim_prodcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_detail = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.pr_spec = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.lnk = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.panel1.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.bindingSource)).BeginInit();
             ((System.ComponentModel.ISupportInitialize)(this.InOutDetailDGV)).BeginInit();
@@ -195,15 +196,6 @@
             this.bigboxBtn.UseVisualStyleBackColor = true;
             this.bigboxBtn.Click += new System.EventHandler(this.serBtn_Click);
             // 
-            // input
-            // 
-            this.input.Location = new System.Drawing.Point(9, 475);
-            this.input.Margin = new System.Windows.Forms.Padding(2);
-            this.input.Name = "input";
-            this.input.Size = new System.Drawing.Size(125, 21);
-            this.input.TabIndex = 222;
-            this.input.KeyDown += new System.Windows.Forms.KeyEventHandler(this.input_KeyDown);
-            // 
             // pi_id
             // 
             this.pi_id.AutoSize = true;
@@ -279,6 +271,22 @@
             this.cancel.Text = "取消";
             this.cancel.UseVisualStyleBackColor = true;
             // 
+            // input
+            // 
+            this.input.AllPower = null;
+            this.input.BackColor = System.Drawing.Color.White;
+            this.input.ID = null;
+            this.input.Location = new System.Drawing.Point(9, 475);
+            this.input.Margin = new System.Windows.Forms.Padding(2);
+            this.input.Name = "input";
+            this.input.Power = null;
+            this.input.Size = new System.Drawing.Size(125, 21);
+            this.input.Str = null;
+            this.input.Str1 = null;
+            this.input.Str2 = null;
+            this.input.TabIndex = 222;
+            this.input.KeyDown += new System.Windows.Forms.KeyEventHandler(this.input_KeyDown);
+            // 
             // InOutDetailDGV
             // 
             this.InOutDetailDGV.AllowUserToAddRows = false;
@@ -288,7 +296,8 @@
             this.pim_mac,
             this.pim_prodcode,
             this.pr_detail,
-            this.pr_spec});
+            this.pr_spec,
+            this.lnk});
             this.InOutDetailDGV.EnableContentClick = true;
             this.InOutDetailDGV.Location = new System.Drawing.Point(9, 66);
             this.InOutDetailDGV.Margin = new System.Windows.Forms.Padding(2);
@@ -297,43 +306,6 @@
             this.InOutDetailDGV.Size = new System.Drawing.Size(544, 357);
             this.InOutDetailDGV.TabIndex = 218;
             // 
-            // pim_outboxcode
-            // 
-            this.pim_outboxcode.DataPropertyName = "pim_outboxcode";
-            this.pim_outboxcode.HeaderText = "栈板/箱号";
-            this.pim_outboxcode.MinimumWidth = 120;
-            this.pim_outboxcode.Name = "pim_outboxcode";
-            this.pim_outboxcode.ReadOnly = true;
-            this.pim_outboxcode.Width = 120;
-            // 
-            // pim_mac
-            // 
-            this.pim_mac.DataPropertyName = "pim_mac";
-            this.pim_mac.HeaderText = "SN号";
-            this.pim_mac.Name = "pim_mac";
-            this.pim_mac.ReadOnly = true;
-            // 
-            // pim_prodcode
-            // 
-            this.pim_prodcode.DataPropertyName = "pim_prodcode";
-            this.pim_prodcode.HeaderText = "产品代码";
-            this.pim_prodcode.Name = "pim_prodcode";
-            this.pim_prodcode.ReadOnly = true;
-            // 
-            // pr_detail
-            // 
-            this.pr_detail.DataPropertyName = "pr_detail";
-            this.pr_detail.HeaderText = "名称";
-            this.pr_detail.Name = "pr_detail";
-            this.pr_detail.ReadOnly = true;
-            // 
-            // pr_spec
-            // 
-            this.pr_spec.DataPropertyName = "pr_spec";
-            this.pr_spec.HeaderText = "规格";
-            this.pr_spec.Name = "pr_spec";
-            this.pr_spec.ReadOnly = true;
-            // 
             // boxqty
             // 
             this.boxqty.AutoSize = true;
@@ -457,6 +429,50 @@
             this.pi_inoutno.TableName = null;
             this.pi_inoutno.TextBoxEnable = true;
             // 
+            // pim_outboxcode
+            // 
+            this.pim_outboxcode.DataPropertyName = "pim_outboxcode";
+            this.pim_outboxcode.HeaderText = "栈板/箱号";
+            this.pim_outboxcode.MinimumWidth = 120;
+            this.pim_outboxcode.Name = "pim_outboxcode";
+            this.pim_outboxcode.ReadOnly = true;
+            this.pim_outboxcode.Width = 120;
+            // 
+            // pim_mac
+            // 
+            this.pim_mac.DataPropertyName = "pim_mac";
+            this.pim_mac.HeaderText = "SN号";
+            this.pim_mac.Name = "pim_mac";
+            this.pim_mac.ReadOnly = true;
+            // 
+            // pim_prodcode
+            // 
+            this.pim_prodcode.DataPropertyName = "pim_prodcode";
+            this.pim_prodcode.HeaderText = "产品代码";
+            this.pim_prodcode.Name = "pim_prodcode";
+            this.pim_prodcode.ReadOnly = true;
+            // 
+            // pr_detail
+            // 
+            this.pr_detail.DataPropertyName = "pr_detail";
+            this.pr_detail.HeaderText = "名称";
+            this.pr_detail.Name = "pr_detail";
+            this.pr_detail.ReadOnly = true;
+            // 
+            // pr_spec
+            // 
+            this.pr_spec.DataPropertyName = "pr_spec";
+            this.pr_spec.HeaderText = "规格";
+            this.pr_spec.Name = "pr_spec";
+            this.pr_spec.ReadOnly = true;
+            // 
+            // lnk
+            // 
+            this.lnk.HeaderText = "";
+            this.lnk.MinimumWidth = 2;
+            this.lnk.Name = "lnk";
+            this.lnk.Width = 2;
+            // 
             // Warehouse_FinishedProductOut
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
@@ -522,15 +538,16 @@
         private CustomControl.RichText.RichTextAutoBottom OperateResult;
         private System.Windows.Forms.Label pi_id;
         private System.Windows.Forms.Label pi_type;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pim_outboxcode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pim_mac;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pim_prodcode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pr_detail;
-        private System.Windows.Forms.DataGridViewTextBoxColumn pr_spec;
         private CustomControl.ValueLabel.ValueLabel outqty;
         private CustomControl.ValueLabel.ValueLabel ungetqty;
         private CustomControl.ValueLabel.ValueLabel getqty;
         private CustomControl.ValueLabel.ValueLabel boxqty;
         private System.Windows.Forms.BindingSource bindingSource;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pim_outboxcode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pim_mac;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pim_prodcode;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pr_detail;
+        private System.Windows.Forms.DataGridViewTextBoxColumn pr_spec;
+        private System.Windows.Forms.DataGridViewTextBoxColumn lnk;
     }
 }

+ 6 - 6
UAS-MES/FunctionCode/Warehouse/Warehouse_FinishedProductOut.cs

@@ -97,7 +97,7 @@ namespace UAS_MES.Warehouse
                     sql.Append("select pim_type,pim_outboxcode from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and NVL(PIM_OUTBOXCODE,' ')<>' ' AND pim_type ='BOX' GROUP BY pim_outboxcode,pim_type");
                     DataTable dtout = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                     boxqtycount += dtout.Rows.Count;
-                    boxqtycount += int.Parse(dh.getFieldDataByCondition("package", "count(1)", " pa_mothercode in (select pim_outboxcode from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and NVL(PIM_OUTBOXCODE,' ')<>' ' AND  pim_type ='PALLET' GROUP BY pim_outboxcode) and pa_outno is null").ToString());
+                    boxqtycount += int.Parse(dh.getFieldDataByCondition("package left join PACKAGEDETAIL on pd_outboxcode = pa_outboxcode left join prodiomac on pim_mac =pd_barcode and pim_prodcode = pd_prodcode and pa_mothercode = pim_outboxcode", "count(DISTINCT pa_outboxcode)", " pim_inoutno='" + pi_inoutno.Text + "' and NVL(PIM_OUTBOXCODE,' ')<>' ' AND  pim_type ='PALLET'").ToString());
                     boxqty.Text = boxqtycount.ToString();
                 }
                 pi_type_check.Checked = true;
@@ -115,7 +115,7 @@ namespace UAS_MES.Warehouse
                     sql.Append("select pim_type,pim_outboxcode from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and NVL(PIM_OUTBOXCODE,' ')<>' ' AND pim_type ='BOX' GROUP BY pim_outboxcode,pim_type");
                     DataTable dtout = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                     boxqtycount += dtout.Rows.Count;
-                    boxqtycount += int.Parse(dh.getFieldDataByCondition("package", "count(1)", " pa_mothercode in (select pim_outboxcode from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and NVL(PIM_OUTBOXCODE,' ')<>' ' AND  pim_type ='PALLET' GROUP BY pim_outboxcode) and pa_outno is null").ToString());
+                    boxqtycount += int.Parse(dh.getFieldDataByCondition("package left join PACKAGEDETAIL on pd_outboxcode = pa_outboxcode left join prodiomac on pim_mac =pd_barcode and pim_prodcode = pd_prodcode and pa_mothercode = pim_outboxcode", "count(DISTINCT pa_outboxcode)", " pim_inoutno='" + pi_inoutno.Text + "' and NVL(PIM_OUTBOXCODE,' ')<>' ' AND  pim_type ='PALLET'").ToString());
                     boxqty.Text = boxqtycount.ToString();
                 }
                 pi_type_check.Checked = false;
@@ -129,7 +129,7 @@ namespace UAS_MES.Warehouse
         {
             sql.Clear();
             sql.Append("select pim_outboxcode,pim_mac,pim_prodcode,pr_detail,pr_spec from prodiomac ");
-            sql.Append("left join product on pr_code=pim_prodcode where pim_inoutno='" + pi_inoutno.Text + "'");
+            sql.Append("left join product on pr_code=pim_prodcode where pim_inoutno='" + pi_inoutno.Text + "' order by pim_id asc");
             DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             BaseUtil.FillDgvWithDataTable(InOutDetailDGV, dt);
         }
@@ -747,8 +747,8 @@ namespace UAS_MES.Warehouse
             {
                 sql.Clear();
                 sql.Append("select ms_prodcode,ms_salecode,cn  from (select ms_prodcode,ms_salecode,count(1)cn from mes_package_view left join makeserial on ms_sncode=v_barcode and ms_makecode=v_makecode  where v_outboxcode='" + input.Text + "' ");
-                sql.Append(" group by ms_prodcode,ms_salecode) left join (select pd_ordercode,pd_prodcode,outqty-nvl((select count(1) from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_prodcode=pd_prodcode),0)ungetqty");
-                sql.Append("  from (select pd_ordercode,pd_prodcode,sum(pd_outqty)outqty from prodiodetail where pd_piid=" + pi_id.Text + " group by pd_prodcode,pd_ordercode)) on ms_prodcode=pd_prodcode where nvl(pd_prodcode,' ')<>' ' and ms_salecode<>pd_ordercode and ms_outno is null and or(ms_salecode=pd_ordercode and cn>nvl(ungetqty,0))");
+                sql.Append("and ms_outno is null group by ms_prodcode,ms_salecode) left join (select pd_ordercode,pd_prodcode,outqty-nvl((select count(1) from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_prodcode=pd_prodcode),0)ungetqty");
+                sql.Append(" from (select pd_ordercode,pd_prodcode,sum(pd_outqty)outqty from prodiodetail where pd_piid=" + pi_id.Text + " group by pd_prodcode,pd_ordercode)) on ms_prodcode=pd_prodcode and ms_salecode=pd_ordercode where nvl(pd_prodcode,' ')<>' ' or nvl(pd_ordercode,' ')<>' ' or( cn>nvl(ungetqty,0))");
                 DataTable dtAA = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                 if (dtAA.Rows.Count > 0)
                 {
@@ -841,7 +841,7 @@ namespace UAS_MES.Warehouse
                     return;
                 }
                 List<String> ExeSQL = new List<string>();
-                ExeSQL.Add("update makeserial set ms_outno = '' where exists (select 1 from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_mac=ms_sncode and pim_prodcode=ms_prodcode and nvl(pim_outboxcode,' ')=' ') and ms_status=2");
+                ExeSQL.Add("update makeserial set ms_outno = '' where exists (select 1 from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_mac=ms_sncode and pim_prodcode=ms_prodcode ) and ms_status=2");
                 ExeSQL.Add("update package set pa_outno = '' where exists (select 1 from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_outboxcode=pa_outboxcode and ((pim_type='PALLET' AND PA_TYPE=3) OR (PIM_TYPE='BOX' AND PA_TYPE IN(1,2)))) AND PA_OUTNO='" + pi_inoutno.Text + "'");
                 ExeSQL.Add("delete from prodiomac where pim_inoutno='" + pi_inoutno.Text + "'");
                 ExeSQL.Add("update prodinout set pi_pdastatus='未备货' where pi_inoutno='" + pi_inoutno.Text + "'");

+ 3 - 0
UAS-MES/FunctionCode/Warehouse/Warehouse_FinishedProductOut.resx

@@ -174,6 +174,9 @@
   <metadata name="pr_spec.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="lnk.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <data name="ConfirmOut.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m