章政 8 жил өмнө
parent
commit
7cb1aa6c4c

+ 16 - 1
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.Designer.cs

@@ -44,6 +44,7 @@
             this.unload = new System.Windows.Forms.RadioButton();
             this.code_label = new System.Windows.Forms.Label();
             this.PrintNum = new System.Windows.Forms.NumericUpDown();
+            this.ma_bomversion = new UAS_MES.CustomControl.ValueLabel.ValueLabel();
             this.code = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.Printer = new UAS_MES.CustomControl.ComBoxWithFocus.PrinterCombox();
             this.mcd_remainqty = new UAS_MES.CustomControl.ValueLabel.ValueNumLabel(this.components);
@@ -218,6 +219,18 @@
             0,
             0});
             // 
+            // ma_bomversion
+            // 
+            this.ma_bomversion.AutoSize = true;
+            this.ma_bomversion.CutLength = null;
+            this.ma_bomversion.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ma_bomversion.Location = new System.Drawing.Point(772, 187);
+            this.ma_bomversion.MaximumSize = new System.Drawing.Size(150, 0);
+            this.ma_bomversion.Name = "ma_bomversion";
+            this.ma_bomversion.Size = new System.Drawing.Size(0, 21);
+            this.ma_bomversion.TabIndex = 169;
+            this.ma_bomversion.Visible = false;
+            // 
             // code
             // 
             this.code.AllPower = null;
@@ -310,6 +323,7 @@
             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(969, 452);
+            this.Controls.Add(this.ma_bomversion);
             this.Controls.Add(this.PrintNum);
             this.Controls.Add(this.code_label);
             this.Controls.Add(this.code);
@@ -336,7 +350,7 @@
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
             this.Name = "Make_ColorBoxLoadPrint";
             this.Tag = "Make!ColorBoxLoadPrint";
-            this.Text = "标签打印";
+            this.Text = "s";
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.标签打印_FormClosing);
             this.Load += new System.EventHandler(this.标签打印_Load);
             this.SizeChanged += new System.EventHandler(this.标签打印_SizeChanged);
@@ -370,5 +384,6 @@
         private CustomControl.TextBoxWithIcon.EnterTextBox code;
         private System.Windows.Forms.Label code_label;
         private System.Windows.Forms.NumericUpDown PrintNum;
+        private CustomControl.ValueLabel.ValueLabel ma_bomversion;
     }
 }

+ 7 - 7
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.cs

@@ -81,7 +81,7 @@ namespace UAS_MES.Make
                         if (LogicHandler.CheckStepSNAndMacode(ms_makecode.Text, User.UserSourceCode, code.Text, User.UserCode, out ma_code, out Msid, out ErrorMessage) || ListA.Rows.Count > 0)
                         {
                             sql.Clear();
-                            sql.Append("select ms_makecode,ms_sncode,ma_qty,pr_detail,pr_code from makeserial left join make on ");
+                            sql.Append("select ms_makecode,ms_sncode,ma_qty,pr_detail,pr_code,ma_bomversion from makeserial left join make on ");
                             sql.Append("ms_makecode=ma_code left join product on ms_prodcode=pr_code where ms_sncode=:sncode");
                             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select", code.Text);
                             if (dt.Rows.Count > 0)
@@ -90,7 +90,7 @@ namespace UAS_MES.Make
                                 LoadCollectNum();
                                 if (PrintLabel.SelectedValue == null)
                                 {
-                                    OperateResult.AppendText(">>产品编号:" + pr_code.Text + "未维护机身标签\n", Color.Red);
+                                    OperateResult.AppendText(">>产品编号:" + pr_code.Text + "未维护彩盒标签\n", Color.Red);
                                     return;
                                 }
                                 ms_sncode.Text = code.Text;
@@ -101,7 +101,7 @@ namespace UAS_MES.Make
                                 OperateResult.AppendText(">>开始执行上料工序\n");
                                 //判断当前工序是否是上料工序cd_ifinput或者是否是测试工序cd_iftest
                                 sql.Clear();
-                                sql.Append("select cr_code,cd_stepcode,cd_ifinput,cd_iftest from makeserial left join  craft on ms_craftcode=cr_code left join craftdetail on cd_crid=cr_id and ");
+                                sql.Append("select cr_code,cd_stepcode,cd_ifinput,cd_iftest,ma_bomversion from makeserial left join  craft on ms_craftcode=cr_code left join craftdetail on cd_crid=cr_id and ");
                                 sql.Append("cd_stepcode=ms_nextstepcode where ms_sncode='" + code.Text + "' and ms_makecode='" + ms_makecode.Text + "'");
                                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                                 if (dt.Rows.Count > 0)
@@ -113,9 +113,9 @@ namespace UAS_MES.Make
                                         sql.Clear();
                                         sql.Append("select sp_id,sp_description,sp_soncode,pr_detail,pr_spec,sp_repcode,pr_id,sp_type,");
                                         sql.Append("'未采集' sp_ifpick ,sp_prefix,sp_length,sp_regex,sp_regex,sp_ifforsn from stepproduct ");
-                                        sql.Append("left join product on pr_code=sp_soncode  where sp_craftcode='" + dt.Rows[0]["cr_code"].ToString() + "' and sp_stepcode='" + dt.Rows[0]["cd_stepcode"].ToString() + "' ");
-                                        sql.Append("And sp_mothercode='" + pr_code.Text + "' and ((sp_type='物料' and pr_tracekind<>2)or sp_type<>'物料') ");
-                                        sql.Append("order by SP_DETNO asc");
+                                        sql.Append("left join product on pr_code=sp_soncode  where sp_craftcode='" + dt.Rows[0]["cr_code"].ToString() + "' ");
+                                        sql.Append("and sp_bomversion='" + ma_bomversion.Text + "' and sp_stepcode='" + dt.Rows[0]["cd_stepcode"].ToString() + "' And sp_mothercode='" + pr_code.Text + "' and ");
+                                        sql.Append("((sp_type='物料' and pr_tracekind<>2)or sp_type<>'物料') order by SP_DETNO asc");
                                         ListA = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                                         //获取对应 产品的机身标的打印模板
                                         if (ListA.Rows.Count > 0)
@@ -225,7 +225,7 @@ namespace UAS_MES.Make
 
         private void pr_code_TextChanged(object sender, EventArgs e)
         {
-            dt = (DataTable)dh.ExecuteSql("select pl_labelname,pl_labelcode,pl_indate,pl_labelurl from productlabel where pl_prodcode='" + pr_code.Text + "' order by pl_isdefault desc", "select");
+            dt = (DataTable)dh.ExecuteSql("select pl_labelname,pl_labelcode,pl_indate,pl_labelurl from productlabel where pl_prodcode='" + pr_code.Text + "' and pl_labeltype='彩盒标' order by pl_isdefault desc", "select");
             PrintLabel.DataSource = dt;
             PrintLabel.DisplayMember = "pl_labelname";
             PrintLabel.ValueMember = "pl_labelcode";

+ 5 - 11
UAS-MES/FunctionCode/Make/Make_FeedingCollection.cs

@@ -23,14 +23,10 @@ namespace UAS_MES.Make
         string nextstepcode;
         //完工状态
         string ms_status;
-        //流程码
-        string ms_code;
-        //工序名称
-        string stepname;
         //工艺路线编号
         string ms_craftcode;
-        //管控类型
-
+        //Bom版本
+        string ma_bomversion;
         string ErrorMessage="";
 
         //用于提醒的序列B
@@ -121,7 +117,6 @@ namespace UAS_MES.Make
                                 make_prodcode = dt.Rows[0]["ms_prodcode"].ToString();
                                 nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
                                 ms_status = dt.Rows[0]["ms_status"].ToString();
-                                ms_code = dt.Rows[0]["ms_code"].ToString();
                             }
                             //勾选了前一工单
                             if (iflastsn.Checked)
@@ -398,7 +393,7 @@ namespace UAS_MES.Make
         {
             //将录入框的值给序列号
             sql.Clear();
-            sql.Append("select ma_prodcode,ma_qty,ma_code,pr_detail,ms_status,ms_id,ms_craftcode,ms_nextstepcode");
+            sql.Append("select ma_prodcode,ma_bomversion,ma_qty,ma_code,pr_detail,ms_status,ms_id,ms_craftcode,ms_nextstepcode");
             sql.Append(",ms_prodcode,ms_makecode,ms_code,ms_stepname  from makeserial left join make on ma_code=ms_makecode ");
             sql.Append("left join product on ms_prodcode=pr_code where ms_sncode='" + code.Text + "'");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
@@ -407,11 +402,10 @@ namespace UAS_MES.Make
                 ms_id = dt.Rows[0]["ms_id"].ToString();
                 ms_craftcode = dt.Rows[0]["ms_craftcode"].ToString();
                 make_code = dt.Rows[0]["ma_code"].ToString();
+                ma_bomversion = dt.Rows[0]["ma_bomversion"].ToString();
                 make_prodcode = dt.Rows[0]["ms_prodcode"].ToString();
                 nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
-                ms_code = dt.Rows[0]["ms_code"].ToString();
                 ms_status = dt.Rows[0]["ms_status"].ToString();
-                stepname = dt.Rows[0]["ms_stepname"].ToString();
                 BaseUtil.SetFormValue(this.Controls, dt);
                 bool ifFirst;
                 if (LogicHandler.CheckCurrentStepAndIfFirst(code.Text, ma_code.Text, User.UserSourceCode, Tag.ToString(), out ifFirst, out ErrorMessage))
@@ -425,7 +419,7 @@ namespace UAS_MES.Make
                         sql.Clear();
                         sql.Append("select sp_id,sp_prefix,sp_ifuseregex,sp_ifforsn,sp_length,sp_description,sp_soncode,pr_tracekind,pr_detail,pr_spec,sp_repcode,pr_id,");
                         sql.Append("sp_type,case when (sp_type='物料' and sp_soncode=pr_code) then '已采集' else '未采集' end sp_ifpick ,sp_prefix,");
-                        sql.Append("sp_length,sp_regex,sp_ifforsn from stepproduct left join product on pr_code=sp_soncode where ");
+                        sql.Append("sp_length,sp_regex,sp_ifforsn from stepproduct left join product on pr_code=sp_soncode where sp_bomversion='"+ma_bomversion+"' and ");
                         sql.Append("sp_craftcode='" + ms_craftcode + "' and sp_stepcode='" + User.CurrentStepCode + "' And sp_mothercode ='" + make_prodcode + "' ");
                         sql.Append("and((sp_type = '物料' and( pr_tracekind <> 2 or pr_tracekind is null))or sp_type <> '物料') order by SP_DETNO asc");
                         dt1 = (DataTable)dh.ExecuteSql(sql.GetString(), "select");