Browse Source

拆解处理修改

Hcsy 8 năm trước cách đây
mục cha
commit
346db55898

+ 53 - 13
UAS-MES/FunctionCode/Make/Make_Decompose.Designer.cs

@@ -48,9 +48,9 @@
             this.dataGridViewTextBoxColumn6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
-            this.dataGridViewImageColumn1 = new System.Windows.Forms.DataGridViewImageColumn();
             this.dataGridViewTextBoxColumn9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn10 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewImageColumn1 = new System.Windows.Forms.DataGridViewImageColumn();
             this.dataGridViewTextBoxColumn11 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn12 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn13 = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -58,6 +58,8 @@
             this.dataGridViewTextBoxColumn15 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn16 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn17 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn18 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.dataGridViewTextBoxColumn19 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.ms_wccode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.ms_craftname = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.ms_craftcode = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
@@ -70,6 +72,7 @@
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             this.dataGridViewCheckBoxColumn2 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
             this.Choose = new System.Windows.Forms.DataGridViewCheckBoxColumn();
+            this.cm_firstsn = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.cm_fsoncode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.cm_stepcode = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.cm_stepname = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -159,6 +162,7 @@
             this.LabelDataGridView.BackgroundColor = System.Drawing.SystemColors.ButtonFace;
             this.LabelDataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
             this.Choose,
+            this.cm_firstsn,
             this.cm_fsoncode,
             this.cm_stepcode,
             this.cm_stepname,
@@ -283,8 +287,10 @@
             // 
             // dataGridViewTextBoxColumn6
             // 
+            this.dataGridViewTextBoxColumn6.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
             this.dataGridViewTextBoxColumn6.DataPropertyName = "cm_barcode";
             this.dataGridViewTextBoxColumn6.HeaderText = "物料批号";
+            this.dataGridViewTextBoxColumn6.MinimumWidth = 40;
             this.dataGridViewTextBoxColumn6.Name = "dataGridViewTextBoxColumn6";
             this.dataGridViewTextBoxColumn6.ReadOnly = true;
             this.dataGridViewTextBoxColumn6.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
@@ -293,6 +299,7 @@
             // 
             // dataGridViewTextBoxColumn7
             // 
+            this.dataGridViewTextBoxColumn7.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
             this.dataGridViewTextBoxColumn7.DataPropertyName = "cm_barcode";
             this.dataGridViewTextBoxColumn7.HeaderText = "新批号";
             this.dataGridViewTextBoxColumn7.MinimumWidth = 100;
@@ -313,16 +320,6 @@
             this.dataGridViewTextBoxColumn8.Visible = false;
             this.dataGridViewTextBoxColumn8.Width = 300;
             // 
-            // dataGridViewImageColumn1
-            // 
-            this.dataGridViewImageColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
-            this.dataGridViewImageColumn1.HeaderText = "";
-            this.dataGridViewImageColumn1.Image = global::UAS_MES.Properties.Resources.plus;
-            this.dataGridViewImageColumn1.Name = "dataGridViewImageColumn1";
-            this.dataGridViewImageColumn1.Resizable = System.Windows.Forms.DataGridViewTriState.True;
-            this.dataGridViewImageColumn1.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
-            this.dataGridViewImageColumn1.Width = 20;
-            // 
             // dataGridViewTextBoxColumn9
             // 
             this.dataGridViewTextBoxColumn9.DataPropertyName = "cm_maid";
@@ -342,6 +339,17 @@
             this.dataGridViewTextBoxColumn10.ReadOnly = true;
             this.dataGridViewTextBoxColumn10.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
             this.dataGridViewTextBoxColumn10.Visible = false;
+            this.dataGridViewTextBoxColumn10.Width = 80;
+            // 
+            // dataGridViewImageColumn1
+            // 
+            this.dataGridViewImageColumn1.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.None;
+            this.dataGridViewImageColumn1.HeaderText = "";
+            this.dataGridViewImageColumn1.Image = global::UAS_MES.Properties.Resources.plus;
+            this.dataGridViewImageColumn1.Name = "dataGridViewImageColumn1";
+            this.dataGridViewImageColumn1.Resizable = System.Windows.Forms.DataGridViewTriState.True;
+            this.dataGridViewImageColumn1.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
+            this.dataGridViewImageColumn1.Width = 20;
             // 
             // dataGridViewTextBoxColumn11
             // 
@@ -349,6 +357,7 @@
             this.dataGridViewTextBoxColumn11.HeaderText = "";
             this.dataGridViewTextBoxColumn11.MinimumWidth = 300;
             this.dataGridViewTextBoxColumn11.Name = "dataGridViewTextBoxColumn11";
+            this.dataGridViewTextBoxColumn11.ReadOnly = true;
             this.dataGridViewTextBoxColumn11.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
             this.dataGridViewTextBoxColumn11.Visible = false;
             this.dataGridViewTextBoxColumn11.Width = 300;
@@ -357,15 +366,22 @@
             // 
             this.dataGridViewTextBoxColumn12.DataPropertyName = "cm_makecode";
             this.dataGridViewTextBoxColumn12.HeaderText = "";
+            this.dataGridViewTextBoxColumn12.MinimumWidth = 300;
             this.dataGridViewTextBoxColumn12.Name = "dataGridViewTextBoxColumn12";
+            this.dataGridViewTextBoxColumn12.ReadOnly = true;
+            this.dataGridViewTextBoxColumn12.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
             this.dataGridViewTextBoxColumn12.Visible = false;
+            this.dataGridViewTextBoxColumn12.Width = 300;
             // 
             // dataGridViewTextBoxColumn13
             // 
             this.dataGridViewTextBoxColumn13.DataPropertyName = "cm_makecode";
             this.dataGridViewTextBoxColumn13.HeaderText = "";
+            this.dataGridViewTextBoxColumn13.MinimumWidth = 300;
             this.dataGridViewTextBoxColumn13.Name = "dataGridViewTextBoxColumn13";
+            this.dataGridViewTextBoxColumn13.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
             this.dataGridViewTextBoxColumn13.Visible = false;
+            this.dataGridViewTextBoxColumn13.Width = 300;
             // 
             // dataGridViewTextBoxColumn14
             // 
@@ -395,6 +411,20 @@
             this.dataGridViewTextBoxColumn17.Name = "dataGridViewTextBoxColumn17";
             this.dataGridViewTextBoxColumn17.Visible = false;
             // 
+            // dataGridViewTextBoxColumn18
+            // 
+            this.dataGridViewTextBoxColumn18.DataPropertyName = "cm_makecode";
+            this.dataGridViewTextBoxColumn18.HeaderText = "";
+            this.dataGridViewTextBoxColumn18.Name = "dataGridViewTextBoxColumn18";
+            this.dataGridViewTextBoxColumn18.Visible = false;
+            // 
+            // dataGridViewTextBoxColumn19
+            // 
+            this.dataGridViewTextBoxColumn19.DataPropertyName = "cm_makecode";
+            this.dataGridViewTextBoxColumn19.HeaderText = "";
+            this.dataGridViewTextBoxColumn19.Name = "dataGridViewTextBoxColumn19";
+            this.dataGridViewTextBoxColumn19.Visible = false;
+            // 
             // ms_wccode
             // 
             this.ms_wccode.AutoSize = true;
@@ -534,6 +564,13 @@
             this.Choose.Name = "Choose";
             this.Choose.Width = 80;
             // 
+            // cm_firstsn
+            // 
+            this.cm_firstsn.DataPropertyName = "cm_firstsn";
+            this.cm_firstsn.HeaderText = "";
+            this.cm_firstsn.Name = "cm_firstsn";
+            this.cm_firstsn.Visible = false;
+            // 
             // cm_fsoncode
             // 
             this.cm_fsoncode.DataPropertyName = "cm_fsoncode";
@@ -756,7 +793,11 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn13;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn14;
         private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn15;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn16;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn17;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn18;
         private System.Windows.Forms.DataGridViewCheckBoxColumn Choose;
+        private System.Windows.Forms.DataGridViewTextBoxColumn cm_firstsn;
         private System.Windows.Forms.DataGridViewTextBoxColumn cm_fsoncode;
         private System.Windows.Forms.DataGridViewTextBoxColumn cm_stepcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn cm_stepname;
@@ -776,7 +817,6 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn cm_maprodcode;
         private System.Windows.Forms.DataGridViewTextBoxColumn cm_sncode;
         private System.Windows.Forms.DataGridViewTextBoxColumn cm_makecode;
-        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn16;
-        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn17;
+        private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn19;
     }
 }

+ 11 - 11
UAS-MES/FunctionCode/Make/Make_Decompose.cs

@@ -105,10 +105,10 @@ namespace UAS_MES.Make
         {
             sncode_1 = sncode;
             sql.Clear();
-            sql.Append("select cm_craftcode,cm_craftname,cm_makecode,cm_sncode,cm_stepcode,cm_stepname,cm_maprodcode,cm_fsoncode,cm_maid,cm_soncode,pr_detail,cm_materialtype,");
+            sql.Append("select cm_craftcode,cm_craftname,cm_firstsn,cm_makecode,cm_sncode,cm_stepcode,cm_stepname,cm_maprodcode,cm_fsoncode,cm_maid,cm_soncode,pr_detail,cm_materialtype,");
             sql.Append("max(cm_status) cm_status,max(cm_id) cm_id from craftmaterial left join product on pr_code=cm_soncode where(cm_sncode  in (select sn from makesnrelation ");
             sql.Append("where firstsn='"+ sncode_1 + "')  or cm_sncode in ( select firstsn from makesnrelation where sn = '" + sncode_1 + "')");
-            sql.Append("or cm_sncode = '" + sncode_1 + "') group by cm_craftcode,cm_stepcode,cm_stepname,cm_makecode,cm_sncode,cm_maprodcode,cm_maid,cm_soncode,pr_detail,cm_materialtype,cm_craftname,cm_fsoncode ORDER BY cm_status DESC");
+            sql.Append("or cm_sncode = '" + sncode_1 + "') group by cm_craftcode,cm_firstsn,cm_stepcode,cm_stepname,cm_makecode,cm_sncode,cm_maprodcode,cm_maid,cm_soncode,pr_detail,cm_materialtype,cm_craftname,cm_fsoncode ORDER BY cm_status DESC");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             if (dt.Rows.Count > 0)
             {
@@ -298,9 +298,9 @@ namespace UAS_MES.Make
 
                             //此物料上线状态更新为-1,代表被拆解
                             sql.Clear();
-                            sql.Append("update craftmaterial set cm_status=-1,cm_dropman='" + User.UserName + "',");
-                            sql.Append("cm_dropdate =sysdate,cm_dropstep='" + User.CurrentStepName + "',");
-                            sql.Append("cm_dropsccode='" + User.CurrentStepCode + "' where cm_id='" + LabelDataGridView.Rows[i].Cells["cm_id"].Value + "'");
+                            sql.Append("update craftmaterial set cm_status=-1,cm_dropman='" + User.UserCode + "',");
+                            sql.Append("cm_dropdate =sysdate,cm_dropstep='" + User.CurrentStepCode + "',");
+                            sql.Append("cm_dropsccode='" + User.UserSourceCode + "' where cm_id='" + LabelDataGridView.Rows[i].Cells["cm_id"].Value + "'");
                             dh.ExecuteSql(sql.GetString(), "update");
 
                             //将新批号绑定到序列号中
@@ -308,11 +308,11 @@ namespace UAS_MES.Make
                             string sp_id = dt.Rows[0]["sp_id"].ToString();
                             sql.Clear();
                             sql.Append("insert into craftmaterial (cm_id, cm_makecode,cm_maid,cm_maprodcode,cm_soncode,cm_mscode,cm_sncode,cm_stepcode,cm_stepname,");
-                            sql.Append("cm_craftcode,cm_craftname,cm_barcode,cm_inqty,cm_indate,cm_inman,cm_linecode,cm_wccode,cm_sourcecode,cm_spid, cm_materialtype,cm_status,cm_fsoncode)");
+                            sql.Append("cm_craftcode,cm_craftname,cm_barcode,cm_inqty,cm_indate,cm_inman,cm_linecode,cm_wccode,cm_sourcecode,cm_spid, cm_materialtype,cm_status,cm_fsoncode,cm_firstsn)");
                             sql.Append("values(Craftmaterial_seq.nextval,'" + LabelDataGridView.Rows[i].Cells["cm_makecode"].Value + "','" + LabelDataGridView.Rows[i].Cells["cm_maid"].Value + "','" + ms_prodcode.Text + "','" + LabelDataGridView.Rows[i].Cells["cm_soncode"].Value + "'");
                             sql.Append(",'" + LabelDataGridView.Rows[i].Cells["cm_sncode"].Value + "','" + LabelDataGridView.Rows[i].Cells["cm_sncode"].Value + "','" + LabelDataGridView.Rows[i].Cells["cm_stepcode"].Value + "','" + LabelDataGridView.Rows[i].Cells["cm_stepname"].Value + "',");
-                            sql.Append("'" + LabelDataGridView.Rows[i].Cells["cm_craftcode"].Value + "','" + LabelDataGridView.Rows[i].Cells["cm_craftname"].Value + "','" + LabelDataGridView.Rows[i].Cells["New_BarCode"].Value + "',1,sysdate,'" + User.UserName + "','" + User.UserLineCode + "','" + ms_wccode.Text + "',");
-                            sql.Append("'" + User.UserSourceCode + "','" + sp_id + "','" + LabelDataGridView.Rows[i].Cells["cm_materialtype"].Value + "','0','"+ LabelDataGridView.Rows[i].Cells["cm_fsoncode"].Value + "')");
+                            sql.Append("'" + LabelDataGridView.Rows[i].Cells["cm_craftcode"].Value + "','" + LabelDataGridView.Rows[i].Cells["cm_craftname"].Value + "','" + LabelDataGridView.Rows[i].Cells["New_BarCode"].Value + "',1,sysdate,'" + User.UserCode + "','" + User.UserLineCode + "','" + ms_wccode.Text + "',");
+                            sql.Append("'" + User.UserSourceCode + "','" + sp_id + "','" + LabelDataGridView.Rows[i].Cells["cm_materialtype"].Value + "','0','"+ LabelDataGridView.Rows[i].Cells["cm_fsoncode"].Value + "','"+ LabelDataGridView.Rows[i].Cells["cm_firstsn"].Value + "')");
                             dh.ExecuteSql(sql.GetString(), "insert");
                             dh.ExecuteSql("update makeserial set ms_nextmacode='" + ms_makecode.Text + "' where ms_id=(select max(ms_id) from makeserial where ms_sncode='" + LabelDataGridView.Rows[i].Cells["New_BarCode"].Value + "' and ms_makecode<>'" + ms_makecode.Text + "')", "update");
                             OperateResult.AppendText("物料" + LabelDataGridView.Rows[i].Cells["cm_barcode"].Value + "拆解换料成功\n", Color.Green);
@@ -353,9 +353,9 @@ namespace UAS_MES.Make
 
                             //craftmaterial解除相应物料绑定
                             sql.Clear();
-                            sql.Append("update craftmaterial set cm_status=-1,cm_dropman='" + User.UserName + "',");
-                            sql.Append("cm_dropdate =sysdate,cm_dropstep='" + User.CurrentStepName + "',");
-                            sql.Append("cm_dropsccode='" + User.CurrentStepCode + "' where cm_id='" + LabelDataGridView.Rows[i].Cells["cm_id"].Value + "'");
+                            sql.Append("update craftmaterial set cm_status=-1,cm_dropman='" + User.UserCode + "',");
+                            sql.Append("cm_dropdate =sysdate,cm_dropstep='" + User.CurrentStepCode + "',");
+                            sql.Append("cm_dropsccode='" + User.UserSourceCode + "' where cm_id='" + LabelDataGridView.Rows[i].Cells["cm_id"].Value + "'");
                             dh.ExecuteSql(sql.GetString(), "update");
 
                             //更新序列号信息

+ 3 - 0
UAS-MES/FunctionCode/Make/Make_Decompose.resx

@@ -117,6 +117,9 @@
   <resheader name="writer">
     <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </resheader>
+  <metadata name="cm_firstsn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="cm_fsoncode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>