Эх сурвалжийг харах

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

Hcsy 8 жил өмнө
parent
commit
3b6b866a26

+ 29 - 14
UAS-MES/FunctionCode/Make/Make_ColorBoxLabelPrint.Designer.cs

@@ -50,6 +50,7 @@
             this.sncode = new UAS_MES.CustomControl.TextBoxWithIcon.SnCollectionBox();
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             this.CheckTSN = new System.Windows.Forms.CheckBox();
+            this.NoteForChange = new System.Windows.Forms.CheckBox();
             this.SuspendLayout();
             // 
             // PrintLabel
@@ -89,7 +90,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(861, 40);
+            this.pr_detail_label.Location = new System.Drawing.Point(861, 53);
             this.pr_detail_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail_label.Name = "pr_detail_label";
             this.pr_detail_label.Size = new System.Drawing.Size(92, 27);
@@ -113,7 +114,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(861, 98);
+            this.label4.Location = new System.Drawing.Point(861, 111);
             this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label4.Name = "label4";
             this.label4.Size = new System.Drawing.Size(92, 27);
@@ -124,7 +125,7 @@
             // 
             this.mcd_remainqty_label.AutoSize = true;
             this.mcd_remainqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty_label.Location = new System.Drawing.Point(500, 92);
+            this.mcd_remainqty_label.Location = new System.Drawing.Point(500, 105);
             this.mcd_remainqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_remainqty_label.Name = "mcd_remainqty_label";
             this.mcd_remainqty_label.Size = new System.Drawing.Size(72, 27);
@@ -135,7 +136,7 @@
             // 
             this.mcd_okqty_label.AutoSize = true;
             this.mcd_okqty_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty_label.Location = new System.Drawing.Point(16, 92);
+            this.mcd_okqty_label.Location = new System.Drawing.Point(16, 105);
             this.mcd_okqty_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_okqty_label.Name = "mcd_okqty_label";
             this.mcd_okqty_label.Size = new System.Drawing.Size(92, 27);
@@ -146,7 +147,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(500, 39);
+            this.pr_code_label.Location = new System.Drawing.Point(500, 52);
             this.pr_code_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_code_label.Name = "pr_code_label";
             this.pr_code_label.Size = new System.Drawing.Size(92, 27);
@@ -157,7 +158,7 @@
             // 
             this.ms_makecode_label.AutoSize = true;
             this.ms_makecode_label.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.ms_makecode_label.Location = new System.Drawing.Point(13, 39);
+            this.ms_makecode_label.Location = new System.Drawing.Point(13, 52);
             this.ms_makecode_label.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.ms_makecode_label.Name = "ms_makecode_label";
             this.ms_makecode_label.Size = new System.Drawing.Size(92, 27);
@@ -169,7 +170,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(325, 39);
+            this.LockMakeCode.Location = new System.Drawing.Point(332, 52);
             this.LockMakeCode.Margin = new System.Windows.Forms.Padding(4);
             this.LockMakeCode.Name = "LockMakeCode";
             this.LockMakeCode.Size = new System.Drawing.Size(61, 24);
@@ -184,14 +185,14 @@
             this.ma_code.Condition = null;
             this.ma_code.DBTitle = null;
             this.ma_code.FormName = null;
-            this.ma_code.Location = new System.Drawing.Point(120, 39);
+            this.ma_code.Location = new System.Drawing.Point(120, 52);
             this.ma_code.Margin = new System.Windows.Forms.Padding(4);
             this.ma_code.Name = "ma_code";
             this.ma_code.Power = null;
             this.ma_code.ReturnData = null;
             this.ma_code.SelectField = null;
             this.ma_code.SetValueField = null;
-            this.ma_code.Size = new System.Drawing.Size(199, 31);
+            this.ma_code.Size = new System.Drawing.Size(199, 26);
             this.ma_code.TabIndex = 184;
             this.ma_code.TableName = null;
             this.ma_code.TextBoxEnable = true;
@@ -209,7 +210,7 @@
             // 
             this.mcd_remainqty.AutoSize = true;
             this.mcd_remainqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_remainqty.Location = new System.Drawing.Point(617, 92);
+            this.mcd_remainqty.Location = new System.Drawing.Point(617, 105);
             this.mcd_remainqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_remainqty.Name = "mcd_remainqty";
             this.mcd_remainqty.Size = new System.Drawing.Size(24, 27);
@@ -220,7 +221,7 @@
             // 
             this.mcd_okqty.AutoSize = true;
             this.mcd_okqty.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.mcd_okqty.Location = new System.Drawing.Point(115, 92);
+            this.mcd_okqty.Location = new System.Drawing.Point(115, 105);
             this.mcd_okqty.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.mcd_okqty.Name = "mcd_okqty";
             this.mcd_okqty.Size = new System.Drawing.Size(24, 27);
@@ -232,7 +233,7 @@
             this.pr_code.AutoSize = true;
             this.pr_code.CutLength = null;
             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(617, 40);
+            this.pr_code.Location = new System.Drawing.Point(617, 53);
             this.pr_code.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_code.MaximumSize = new System.Drawing.Size(200, 0);
             this.pr_code.Name = "pr_code";
@@ -245,7 +246,7 @@
             this.pr_detail.AutoSize = true;
             this.pr_detail.CutLength = null;
             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(979, 39);
+            this.pr_detail.Location = new System.Drawing.Point(979, 52);
             this.pr_detail.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_detail.MaximumSize = new System.Drawing.Size(200, 0);
             this.pr_detail.Name = "pr_detail";
@@ -258,7 +259,7 @@
             this.PrintNum.BackColor = System.Drawing.Color.White;
             this.PrintNum.Enabled = false;
             this.PrintNum.ID = null;
-            this.PrintNum.Location = new System.Drawing.Point(979, 98);
+            this.PrintNum.Location = new System.Drawing.Point(979, 111);
             this.PrintNum.Margin = new System.Windows.Forms.Padding(4);
             this.PrintNum.Name = "PrintNum";
             this.PrintNum.Negative = false;
@@ -314,11 +315,24 @@
             this.CheckTSN.UseVisualStyleBackColor = true;
             this.CheckTSN.CheckedChanged += new System.EventHandler(this.CheckTSN_CheckedChanged);
             // 
+            // NoteForChange
+            // 
+            this.NoteForChange.AutoSize = true;
+            this.NoteForChange.Checked = true;
+            this.NoteForChange.CheckState = System.Windows.Forms.CheckState.Checked;
+            this.NoteForChange.Location = new System.Drawing.Point(120, 21);
+            this.NoteForChange.Name = "NoteForChange";
+            this.NoteForChange.Size = new System.Drawing.Size(119, 19);
+            this.NoteForChange.TabIndex = 187;
+            this.NoteForChange.Text = "切换工单提醒";
+            this.NoteForChange.UseVisualStyleBackColor = true;
+            // 
             // Make_ColorBoxLabelPrint
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1251, 600);
+            this.Controls.Add(this.NoteForChange);
             this.Controls.Add(this.CheckTSN);
             this.Controls.Add(this.LockMakeCode);
             this.Controls.Add(this.ma_code);
@@ -377,5 +391,6 @@
         private CustomControl.TextBoxWithIcon.MaCodeSearchTextBox ma_code;
         private CustomControl.CustomCheckBox.LockCheckBox LockMakeCode;
         private System.Windows.Forms.CheckBox CheckTSN;
+        private System.Windows.Forms.CheckBox NoteForChange;
     }
 }

+ 50 - 17
UAS-MES/FunctionCode/Make/Make_ColorBoxLabelPrint.cs

@@ -53,7 +53,6 @@ namespace UAS_MES.Make
 
         private void Make_ColorBoxLabelPrint_Load(object sender, EventArgs e)
         {
-
             sncode.Focus();
             asc.controllInitializeSize(this);
             InitPrint = new Thread(InPrint);
@@ -117,8 +116,6 @@ namespace UAS_MES.Make
                     }
                     OperateResult.AppendText(">>" + sncode.Text + "\n", Color.Black);
                     sql.Clear();
-                    //sql.Append("select max(ms_id) ms_id from makeserial where ms_sncode ='"+sncode.Text+"' or exists (select 1 from");
-                    //sql.Append(" makesnrelation where beforesn= '"+ sncode.Text + "'and ms_makecode=makecode)");
                     sql.Append("select max(ms_id) ms_id from makeserial where ms_beforesn = '" + sncode.Text + "'");
                     dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                     if (dt.Rows[0][0].ToString() != "")
@@ -144,7 +141,7 @@ namespace UAS_MES.Make
                 if (CheckTSN.Checked == true && ms_id != null)
                 {
                     sql.Clear();
-                    sql.Append("select * from makeserial where ms_id='" + ms_id + "'  and  ms_sncode= '" + sncode.Text + "' ");
+                    sql.Append("select ms_id from makeserial where ms_id='" + ms_id + "'");
                     dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                     if (dt.Rows.Count > 0)
                     {
@@ -159,20 +156,58 @@ namespace UAS_MES.Make
                     }
                 }
                 string oMsID;
-                string ErrorMessage2;
+                string ErrorMessage;
                 string oMakeCode;
-                if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage2))
+                if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
                     //判断界面工单是否为空时的序列号是否自动归属工单
                     string oStatus = "";
+                    bool NoteAlready = false;
+                    LogicHandler.GetMakeInfo(sncode.Text, out oMakeCode, out oStatus, out ErrorMessage);
+                    if (NoteForChange.Checked)
+                    {
+                        if (ma_code.Text != oMakeCode && oMakeCode != "" && ma_code.Text != "" && oStatus != "2")
+                        {
+                            string ChangeMakeCode = MessageBox.Show(this.ParentForm, "序列号所属工单不同,是否切换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+                            //如果选择不切换赋值当前界面工单
+                            if (ChangeMakeCode != "Yes")
+                            {
+                                oMakeCode = ma_code.Text;
+                            }
+                            else
+                            {
+                                NoteAlready = true;
+                            }
+                        }
+                        else
+                        {
+                            oMakeCode = ma_code.Text;
+                        }
+                    }
                     // 获取工单归属工单下一工序是否正确
-                    if (LogicHandler.CheckStepSNAndMacode(ma_code.Text, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage2))
+                    if (LogicHandler.CheckStepSNAndMacode(oMakeCode, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
                     {
+                        if (NoteForChange.Checked && !NoteAlready)
+                        {
+                            if (oMakeCode != ma_code.Text && ma_code.Text != "")
+                            {
+                                string ChangeMakeCode = MessageBox.Show(this.ParentForm, "序列号所属工单不同,是否切换?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
+                                //如果选择不切换赋值当前界面工单
+                                if (ChangeMakeCode == "Yes")
+                                {
+                                    ma_code.Text = oMakeCode;
+                                }
+                                else
+                                {
+                                    OperateResult.AppendText(">>请重新采集序列号\n", Color.Red, sncode);
+                                    return;
+                                }
+                            }
+                        }
                         //获取工单的其他信息
                         sql.Clear();
-                        sql.Append("select ma_code,nvl(mcd_okqty,0) mcd_okqty,nvl(ma_unlimitin,0)ma_unlimitin,ma_prodcode as pr_code ,pr_detail,");
-                        sql.Append("pr_spec,ma_qty - nvl(mcd_inqty, 0) mcd_remainqty from make left join makecraftdetail on ");
-                        sql.Append("mcd_maid=ma_id left join product on pr_code=ma_prodcode where ma_code='" + (oMakeCode == "null" ? ma_code.Text : oMakeCode) + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
+                        sql.Append("select ma_code,nvl(ma_unlimitin,0)ma_unlimitin,pr_code,pr_detail,pr_spec from  ");
+                        sql.Append("make left join product on pr_code=ma_prodcode where ma_code='" + oMakeCode + "'");
                         dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                         if (dt.Rows.Count > 0)
                         {
@@ -190,8 +225,7 @@ namespace UAS_MES.Make
                                     OperateResult.AppendText(">>请重新选择标签模板\n", Color.Green);
                                     return;
                                 }
-                                else
-                                    pr_change = false;
+                                else pr_change = false;
                             }
                         }
                         else
@@ -200,7 +234,6 @@ namespace UAS_MES.Make
                             sncode.Focus();
                             return;
                         }
-                        string ErrorMessage = "";
                         string result = "";
                         if (int.Parse(mcd_remainqty.Text) <= 0 && dt.Rows[0]["ma_unlimitin"].ToString() == "0")
                         {
@@ -225,7 +258,7 @@ namespace UAS_MES.Make
                                     return;
                                 }
                                 //更新至下一步工序
-                                if (LogicHandler.SetStepResult((oMakeCode == "null" ? ma_code.Text : oMakeCode), User.UserSourceCode, sncode.Text, "彩盒打印", "彩盒打印成功", User.UserCode, out ErrorMessage2))
+                                if (LogicHandler.SetStepResult(oMakeCode, User.UserSourceCode, sncode.Text, "彩盒打印", "彩盒打印成功", User.UserCode, out ErrorMessage))
                                 {
                                     //提示正确返回时传递的信息
                                     if (ErrorMessage.Contains("AFTERSUCCESS"))
@@ -244,7 +277,7 @@ namespace UAS_MES.Make
                                 }
                                 else
                                 {
-                                    OperateResult.AppendText(">>" + ErrorMessage2 + "\n", Color.Red, sncode);
+                                    OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sncode);
                                     ms_id = null;
                                     sncode.Focus();
                                 }
@@ -265,7 +298,7 @@ namespace UAS_MES.Make
                     }
                     else
                     {
-                        OperateResult.AppendText(ErrorMessage2 + "\n", Color.Red, sncode);
+                        OperateResult.AppendText(ErrorMessage + "\n", Color.Red, sncode);
                         if (CheckTSN.Checked == true)
                         {
                             OperateResult.AppendText(">>请输入TSN\n", Color.Black);
@@ -277,7 +310,7 @@ namespace UAS_MES.Make
                 }
                 else
                 {
-                    OperateResult.AppendText(ErrorMessage2 + "\n", Color.Red, sncode);
+                    OperateResult.AppendText(ErrorMessage + "\n", Color.Red, sncode);
                     if (CheckTSN.Checked == true)
                     {
                         OperateResult.AppendText(">>请输入TSN\n", Color.Black);