浏览代码

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

Hcsy 8 年之前
父节点
当前提交
518ad18862

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

@@ -162,7 +162,7 @@ namespace UAS_MES.Make
                         string sp_ifforsn = ListA.Rows[RemainIndex]["sp_ifforsn"].ToString();
                         string sp_tracekind = ListA.Rows[RemainIndex]["sp_tracekind"].ToString();
                         string sp_barcoderule = ListA.Rows[RemainIndex]["sp_barcoderule"].ToString();
-                        if (LogicHandler.CheckSNBeforeLoad(code.Text, sp_soncode, sp_barcoderule, sp_prefix, length, out ErrorMessage))
+                        if (LogicHandler.CheckSNBeforeLoad(ma_code,code.Text, sp_soncode, sp_barcoderule, sp_prefix, length, out ErrorMessage))
                         {
                             CollectData.Add(code.Text);
                             CollectDataSonCode.Add(ListA.Rows[RemainIndex]["sp_soncode"].ToString());

+ 17 - 3
UAS-MES/FunctionCode/Make/Make_ColorBoxWeigh.Designer.cs

@@ -73,6 +73,7 @@
             this.ob_nowcheckqty_label = new System.Windows.Forms.Label();
             this.ob_batchqty_label = new System.Windows.Forms.Label();
             this.SendCheck = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
+            this.ob_checkno = new System.Windows.Forms.Label();
             this.panel4.SuspendLayout();
             ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).BeginInit();
             this.groupBoxWithBorder2.SuspendLayout();
@@ -535,6 +536,7 @@
             // groupBoxWithBorder2
             // 
             this.groupBoxWithBorder2.BorderColor = System.Drawing.Color.Black;
+            this.groupBoxWithBorder2.Controls.Add(this.ob_checkno);
             this.groupBoxWithBorder2.Controls.Add(this.ob_nowcheckqty);
             this.groupBoxWithBorder2.Controls.Add(this.ob_batchqty);
             this.groupBoxWithBorder2.Controls.Add(this.ob_nowcheckqty_label);
@@ -612,6 +614,17 @@
             this.SendCheck.Text = "送检";
             this.SendCheck.UseVisualStyleBackColor = true;
             // 
+            // ob_checkno
+            // 
+            this.ob_checkno.AutoSize = true;
+            this.ob_checkno.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.ob_checkno.Location = new System.Drawing.Point(50, 111);
+            this.ob_checkno.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
+            this.ob_checkno.Name = "ob_checkno";
+            this.ob_checkno.Size = new System.Drawing.Size(0, 27);
+            this.ob_checkno.TabIndex = 179;
+            this.ob_checkno.Visible = false;
+            // 
             // Make_ColorBoxWeigh
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
@@ -657,12 +670,12 @@
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.彩盒称重_FormClosing);
             this.Load += new System.EventHandler(this.Make_ColorBoxWeigh_Load);
             this.SizeChanged += new System.EventHandler(this.彩盒称重_SizeChanged);
-            this.panel4.ResumeLayout(false);
+            this.panel4.ResumeLayout(true);
             this.panel4.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).EndInit();
-            this.groupBoxWithBorder2.ResumeLayout(false);
+            this.groupBoxWithBorder2.ResumeLayout(true);
             this.groupBoxWithBorder2.PerformLayout();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }
@@ -712,5 +725,6 @@
         private System.Windows.Forms.Label ob_nowcheckqty_label;
         private System.Windows.Forms.Label ob_batchqty_label;
         private CustomControl.ButtonUtil.NormalButton SendCheck;
+        private System.Windows.Forms.Label ob_checkno;
     }
 }

+ 145 - 59
UAS-MES/FunctionCode/Make/Make_ColorBoxWeigh.cs

@@ -35,9 +35,12 @@ namespace UAS_MES.Make
         //是否通过串口获取数据
         bool GetData = true;
 
+        string ErrorMessage;
+
         Thread InitPrint;
 
         System.DateTime[] indate;
+        private bool AutoCut;
 
         public Make_ColorBoxWeigh()
         {
@@ -75,75 +78,82 @@ namespace UAS_MES.Make
         {
             if (e.KeyCode == Keys.Enter)
             {
-                sql.Clear();
-                sql.Append("select ms_makecode,mcd_inqty,ma_qty,ma_qty-mcd_inqty as mcd_waitqty,ma_salecode,pr_detail,pr_colorboxunit,pr_code,pr_colorboxgw,");
-                sql.Append("pr_colorboxunit,pr_colorboxmaxw,pr_colorboxminw from makeserial left join make on ms_makecode=ma_code left join product on ");
-                sql.Append("ms_prodcode=pr_code left join makecraftdetail on ms_makecode=mcd_macode where ms_sncode='" + sncode.Text + "' order by ms_id desc");
-                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                if (dt.Rows.Count > 0)
+                if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
-                    //重量的临时变量
-                    string _weight = dt.Rows[0]["pr_colorboxgw"].ToString();
-                    string _maxweight = dt.Rows[0]["pr_colorboxmaxw"].ToString();
-                    string _minweight = dt.Rows[0]["pr_colorboxminw"].ToString();
-                    //赋值重量单位
-                    Weight = double.Parse(_weight == "" ? "0" : _weight);
-                    MaxWeight = double.Parse(_maxweight == "" ? "0" : _maxweight);
-                    MinWeight = double.Parse(_minweight == "" ? "0" : _minweight);
-                    BaseUtil.SetFormValue(this.Controls, dt);
-                    if (Weight - MinWeight == MaxWeight - Weight)
-                        pr_colorboxgw.Text = Weight + "±" + (MaxWeight - Weight);
-                    else
-                        pr_colorboxgw.Text = MinWeight + "-" + MaxWeight;
-                    string ErrorMessage;
-                    string oMakeCode = "";
-                    string oMsID = "";
-                    if (LogicHandler.CheckStepSNAndMacode(ms_makecode.Text, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
+                    sql.Clear();
+                    sql.Append("select ms_makecode,mcd_inqty,ma_qty,ma_qty-mcd_inqty as mcd_waitqty,ma_salecode,pr_detail,pr_colorboxunit,pr_code,pr_colorboxgw,");
+                    sql.Append("pr_colorboxunit,pr_colorboxmaxw,pr_colorboxminw from makeserial left join make on ms_makecode=ma_code left join product on ");
+                    sql.Append("ms_prodcode=pr_code left join makecraftdetail on ms_makecode=mcd_macode where ms_sncode='" + sncode.Text + "' order by ms_id desc");
+                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                    if (dt.Rows.Count > 0)
                     {
-                        string YN = dh.GetConfig("BatchNumber", "MESSetting").ToString();
-                        //表示需要验证判断md_qty 是否大于等于md_baseqty
-                        if (YN != "0")
+                        //重量的临时变量
+                        string _weight = dt.Rows[0]["pr_colorboxgw"].ToString();
+                        string _maxweight = dt.Rows[0]["pr_colorboxmaxw"].ToString();
+                        string _minweight = dt.Rows[0]["pr_colorboxminw"].ToString();
+                        string pr_colorunit = dt.Rows[0]["pr_colorboxunit"].ToString();
+                        //赋值重量单位
+                        Weight = double.Parse(_weight == "" ? "0" : _weight);
+                        MaxWeight = double.Parse(_maxweight == "" ? "0" : _maxweight);
+                        MinWeight = double.Parse(_minweight == "" ? "0" : _minweight);
+                        BaseUtil.SetFormValue(this.Controls, dt);
+                        if (Weight - MinWeight == MaxWeight - Weight)
+                            pr_colorboxgw.Text = Weight + "±" + (MaxWeight - Weight);
+                        else
+                            pr_colorboxgw.Text = MinWeight + "-" + MaxWeight;
+                        string oMakeCode = "";
+                        string oMsID = "";
+                        if (LogicHandler.CheckStepSNAndMacode(ms_makecode.Text, User.UserSourceCode, sncode.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
                         {
-                            sql.Clear();
-                            sql.Append("select wm_concat(md_prodcode) ,count(1) cn from makeprepare left join makepreparedetail ");
-                            sql.Append("on mp_id=md_mpid where mp_makecode='" + ms_makecode.Text + "' and md_qty<md_baseqty");
-                            dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                            if (dt.Rows[0]["CN"].ToString() != "0")
+                            string YN = dh.GetConfig("BatchNumber", "MESSetting").ToString();
+                            //表示需要验证判断md_qty 是否大于等于md_baseqty
+                            if (YN != "0")
                             {
-                                OperateResult.AppendText(">>物料:" + pr_code.Text + " ,岗位用料不足\n", Color.Red, sncode);
-                                return;
+                                sql.Clear();
+                                sql.Append("select wm_concat(md_prodcode) ,count(1) cn from makeprepare left join makepreparedetail ");
+                                sql.Append("on mp_id=md_mpid where mp_makecode='" + ms_makecode.Text + "' and md_qty<md_baseqty");
+                                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                                if (dt.Rows[0]["CN"].ToString() != "0")
+                                {
+                                    OperateResult.AppendText(">>物料:" + pr_code.Text + " ,岗位用料不足\n", Color.Red, sncode);
+                                    return;
+                                }
                             }
-                        }
-                        //如果未打开串口设置为0
-                        int ActualWeight = int.Parse(weight.Text == "" ? "0" : weight.Text);
-                        if ((ActualWeight >= MinWeight) && (ActualWeight <= MaxWeight))
-                        {
-                            ListViewItem lsi = new ListViewItem();
-                            lsi.SubItems.Add(sncode.Text);
-                            lsi.SubItems.Add(ActualWeight.ToString());
-                            lsi.SubItems.Add(System.DateTime.Now.ToString());
-                            WeighRecord.Items.Add(lsi);
-                            //显示最近的三个称量记录
-                            if (LogicHandler.SetStepResult(ms_makecode.Text, User.UserSourceCode, sncode.Text, "彩盒称量", "称量合格", User.UserCode, out ErrorMessage))
+                            //如果未打开串口设置为0
+                            if (pr_colorboxunit.Text == "kg")
+                                weight.Text = (float.Parse(weight.Text) / 1000).ToString();
+                            double ActualWeight = double.Parse(weight.Text == "" ? "0" : weight.Text);
+                            if ((ActualWeight >= MinWeight) && (ActualWeight <= MaxWeight))
                             {
-                                OperateResult.AppendText(">>" + sncode.Text + "重量检测检测合格\n", Color.Green);
-                                if (AutoPrint.Checked)
+                                ListViewItem lsi = new ListViewItem();
+                                lsi.SubItems.Add(sncode.Text);
+                                lsi.SubItems.Add(ActualWeight.ToString());
+                                lsi.SubItems.Add(System.DateTime.Now.ToString());
+                                WeighRecord.Items.Add(lsi);
+                                //显示最近的三个称量记录
+                                if (LogicHandler.SetStepResult(ms_makecode.Text, User.UserSourceCode, sncode.Text, "彩盒称量", "称量合格", User.UserCode, out ErrorMessage))
                                 {
-                                    OperateResult.AppendText(">>打印条码号" + sncode.Text + "\n", Color.Green);
-                                    Confirm.PerformClick();
+                                    LoadCheckQTY();
+                                    OperateResult.AppendText(">>" + sncode.Text + "重量检测检测合格\n", Color.Green);
+                                    if (AutoPrint.Checked)
+                                    {
+                                        OperateResult.AppendText(">>打印条码号" + sncode.Text + "\n", Color.Green);
+                                        Confirm.PerformClick();
+                                    }
+                                    sncode.Text = "";
                                 }
-                                sncode.Text = "";
+                                else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sncode);
                             }
-                            else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sncode);
+                            else OperateResult.AppendText(">>" + sncode.Text + "重量检测未通过\n", Color.Red);
+                            //称量是否通过都记录重量
+                            dh.ExecuteSql("update makeserial set ms_grossw='" + ActualWeight + "' where ms_sncode='" + sncode.Text + "' and ms_makecode='" + ms_makecode.Text + "'", "update");
+                            sncode.Clear();
                         }
-                        else OperateResult.AppendText(">>" + sncode.Text + "重量检测未通过\n", Color.Red);
-                        //称量是否通过都记录重量
-                        dh.ExecuteSql("update makeserial set ms_grossw='" + ActualWeight + "' where ms_sncode='" + sncode.Text + "' and ms_makecode='" + ms_makecode.Text + "'", "update");
-                        sncode.Clear();
+                        else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sncode);
                     }
-                    else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sncode);
+                    else OperateResult.AppendText(">>序列号不存在\n", Color.Red, sncode);
                 }
-                else OperateResult.AppendText(">>序列号不存在\n", Color.Red, sncode);
+                else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, sncode);
             }
         }
 
@@ -161,8 +171,6 @@ namespace UAS_MES.Make
                             try
                             {
                                 weight.Text = Regex.Replace(serialPort1.ReadLine(), "\\D+", "");
-                                if (pr_colorboxunit.Text == "kg")
-                                weight.Text = (float.Parse(weight.Text) / 1000).ToString();
                             }
                             catch (Exception)
                             {
@@ -251,6 +259,7 @@ namespace UAS_MES.Make
 
         private void pr_code_TextChanged(object sender, EventArgs e)
         {
+            LoadCheckQTY();
             dt = (DataTable)dh.ExecuteSql("select pl_labelcode||':'||pl_labelname pl_laname,pl_labelname,pl_labelcode,pl_labelurl,pl_indate from productlabel where pl_prodcode='" + pr_code.Text + "' order by pl_isdefault desc ", "select");
             PrintLabel.DataSource = dt;
             PrintLabel.DisplayMember = "pl_laname";
@@ -269,5 +278,82 @@ namespace UAS_MES.Make
             DataTable dt = (DataTable)dh.ExecuteSql("select mcd_inqty,ma_qty-mcd_inqty mcd_waitqty from make left join makecraftdetail on mcd_macode=ma_code where ma_code='" + ms_makecode.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'", "select");
             BaseUtil.SetFormValue(Controls, dt);
         }
+
+        private void SendCheck_Click(object sender, EventArgs e)
+        {
+            sql.Clear();
+            sql.Append("update oqcbatch set ob_status='UNCHECK' where ob_checkno ='" + ob_checkno.Text + "'");
+            dh.ExecuteSql(sql.GetString(), "select");
+            ob_nowcheckqty.Text = "";
+            ob_batchqty.Text = "";
+            ob_nowcheckqty.ForeColor = Color.Black;
+            SendCheck.Enabled = false;
+            OperateResult.AppendText(">>批次" + ob_checkno.Text + "送检成功\n", Color.Green);
+            LogicHandler.InsertMakeProcess(sncode.Text, ms_makecode.Text, User.UserSourceCode, "手动送检", "手动送检成功", User.UserCode);
+            //记录操作日志
+            LogicHandler.DoCommandLog(User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "手动送检", "手动送检成功", "", ob_checkno.Text);
+            ob_checkno.Text = "";
+        }
+
+        private void LoadCheckQTY()
+        {
+            sql.Clear();
+            string condition = "";
+            int nowcheckqty = int.Parse(ob_nowcheckqty.Text == "" ? "0" : ob_nowcheckqty.Text);
+            int batchqty = int.Parse(ob_batchqty.Text == "" ? "0" : ob_batchqty.Text);
+            if (nowcheckqty + 1 == batchqty && AutoCut)
+            {
+                condition = "and ob_status='UNCHECK' and ob_checkno='" + ob_checkno.Text + "'";
+            }
+            else
+            {
+                condition = "and ob_status='ENTERING' ";
+            }
+            sql.Append("select ob_batchqty,ob_nowcheckqty,ob_checkno from oqcbatch where ");
+            sql.Append("ob_linecode='" + User.UserLineCode + "' and ob_prodcode='" + pr_code.Text + "' and ");
+            sql.Append("ob_stepcode='" + User.CurrentStepCode + "' " + condition);
+            DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+            if (dt.Rows.Count > 0)
+            {
+                ob_batchqty.Text = dt.Rows[0]["ob_batchqty"].ToString();
+                ob_nowcheckqty.Text = dt.Rows[0]["ob_nowcheckqty"].ToString();
+                ob_checkno.Text = dt.Rows[0]["ob_checkno"].ToString();
+                nowcheckqty = int.Parse(ob_nowcheckqty.Text == "" ? "0" : ob_nowcheckqty.Text);
+                batchqty = int.Parse(ob_batchqty.Text == "" ? "0" : ob_batchqty.Text);
+                if (nowcheckqty == batchqty)
+                {
+                    ob_nowcheckqty.ForeColor = Color.Red;
+                    OperateResult.AppendText(">>当前采集数量已达到送检数量\n", Color.Red);
+                }
+            }
+            else
+            {
+                ob_batchqty.Text = "";
+                ob_nowcheckqty.Text = "";
+                ob_checkno.Text = "";
+                SendCheck.Enabled = false;
+            }
+            if (ob_batchqty.Text != "")
+            {
+                SendCheck.Enabled = true;
+            }
+            else
+            {
+                SendCheck.Enabled = false;
+            }
+        }
+
+        private void ob_checkno_TextChanged(object sender, EventArgs e)
+        {
+            if (ob_checkno.Text != "")
+            {
+                string Cut = dh.getFieldDataByCondition("product left join oqcbatch on ob_prodcode=pr_code", "pr_ifautocutcheckno", "ob_checkno='" + ob_checkno.Text + "'").ToString();
+                if (Cut == "" || Cut == "0")
+                    AutoCut = false;
+                else
+                    AutoCut = true;
+                SendCheck.Enabled = true;
+            }
+        }
     }
 }

+ 43 - 6
UAS-MES/FunctionCode/Make/Make_CustomLabelPrint.cs

@@ -47,6 +47,8 @@ namespace UAS_MES.Make
         StringBuilder sb = new StringBuilder();
 
         bool canPrint = false;
+
+        string[] inputValues;//存放用户输入的参数值
         public Make_CustomLabelPrint()
         {
             InitializeComponent();
@@ -138,9 +140,11 @@ namespace UAS_MES.Make
                 }
                 else
                 {
-                    if (doc==null) {
-                        OperateResult.AppendText(">>无可用标签\n", Color.Red,inputText);
-                        return;
+                    //下标为1的时候实例化存值的数组
+                    if (currentIndex==1) {
+                        inputValues = new string[paramsInfo.Rows.Count];
+                        sb = new StringBuilder();
+                        doc = lbl.Documents.Open(ftpOperater.DownLoadTo + listA.Rows[PrintLabel.SelectedIndex]["pl_labelname"].ToString());
                     }
                     //将值赋到doc对应的变量
                     for (int i = 0; i < doc.Variables.FormVariables.Count; i++)
@@ -161,6 +165,7 @@ namespace UAS_MES.Make
                                 doc.Variables.FormVariables.Item(i + 1).Value = dh.GetLabelParam(sql).ToString();
                                 sb.AppendLine("打印参数【" + doc.Variables.FormVariables.Item(i + 1).Name + "】赋值," + "取值SQL:" + sql + ",取到值" + doc.Variables.FormVariables.Item(i + 1).Value);
                             }
+                            inputValues[currentIndex - 1] = doc.Variables.FormVariables.Item(i + 1).Value;
                         }
                     }
                     if (currentIndex == paramsInfo.Rows.Count)
@@ -182,7 +187,6 @@ namespace UAS_MES.Make
                         //重置currenIndex为1
                         currentIndex = 1;
                         OperateResult.AppendText(">>请输入自定义模板的" + paramsInfo.Rows[0]["lp_name"].ToString() + "\n", Color.Black);
-                        doc=lbl.Documents.Open(ftpOperater.DownLoadTo + listA.Rows[PrintLabel.SelectedIndex]["pl_labelname"].ToString());
                     }
                     else
                     {
@@ -223,7 +227,7 @@ namespace UAS_MES.Make
                 {
                     doc.Close();
                 }
-                doc = lbl.Documents.Open(ftpOperater.DownLoadTo + listA.Rows[PrintLabel.SelectedIndex]["pl_labelname"].ToString());
+                //doc = lbl.Documents.Open(ftpOperater.DownLoadTo + listA.Rows[PrintLabel.SelectedIndex]["pl_labelname"].ToString());
                 currentIndex = 1;
                 //聚焦输入框
                 inputText.Focus();
@@ -259,7 +263,40 @@ namespace UAS_MES.Make
 
         private void printButton_Click(object sender, EventArgs e)
         {
-
+            if (canPrint)
+            {
+                doc = lbl.Documents.Open(ftpOperater.DownLoadTo + listA.Rows[PrintLabel.SelectedIndex]["pl_labelname"].ToString());
+                sb = new StringBuilder();
+                //将值赋到doc对应的变量
+                for (int i = 0; i < doc.Variables.FormVariables.Count; i++)
+                {
+                    for (int j = 0; j < paramsInfo.Rows.Count; j++)
+                    {
+                        //找到对应的变量名
+                        if (doc.Variables.FormVariables.Item(i + 1).Name == paramsInfo.Rows[j]["lp_name"].ToString())
+                        {
+                            //直接赋值
+                            doc.Variables.FormVariables.Item(i + 1).Value = inputValues[j];
+                        }
+                    }
+                }
+                //打印
+                LogManager.DoLog(sb.ToString());
+                //保存本次赋值进行打印
+                doc.Save();
+                doc.Printer.SwitchTo(Printer.Text);
+                doc.PrintDocument(int.Parse(printNum.Text));
+                doc.Close();
+                //讲文件最后写入时间改成数据库中拿到的时间
+                info = new FileInfo(ftpOperater.DownLoadTo + PrintLabel.Text.Split(':')[1]);
+                info.LastWriteTime = indate[PrintLabel.SelectedIndex];
+                //打印成功
+                OperateResult.AppendText("<<打印成功\n", Color.Green);
+            }
+            else
+            {
+                OperateResult.AppendText("<<标签参数未全部输入完成\n", Color.Red);
+            }
         }
     }
 }

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

@@ -258,7 +258,7 @@ namespace UAS_MES.Make
                             string sp_prefix = dtbar.Rows[0]["sp_prefix"].ToString();
                             string length = dtbar.Rows[0]["sp_length"].ToString();
                             string sp_barcoderule = dtbar.Rows[0]["sp_barcoderule"].ToString();
-                            if (!LogicHandler.CheckSNBeforeLoad(LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString(), sp_soncode, sp_barcoderule, sp_prefix, length, out ErrorMessage))
+                            if (!LogicHandler.CheckSNBeforeLoad("",LabelDataGridView.Rows[i].Cells["New_BarCode"].Value.ToString(), sp_soncode, sp_barcoderule, sp_prefix, length, out ErrorMessage))
                             {
                                 OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                                 LoadData(sncode_1, sender, new KeyEventArgs(Keys.Enter));

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

@@ -35,6 +35,9 @@ namespace UAS_MES.Make
         //提醒序列的索引
         int RemainIndex = 0;
 
+        string oMakeCode = "";
+        string oMsid = "";
+
         DataHelper dh;
         LogStringBuilder sql = new LogStringBuilder();
         DataTable DBFind;
@@ -103,9 +106,7 @@ namespace UAS_MES.Make
         {
             if (e.KeyCode == Keys.Enter)
             {
-                string ErrorMessage = "";
-                string oMakeCode = "";
-                string oMsid = "";
+             
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
                     if (Loading.Checked)
@@ -215,7 +216,7 @@ namespace UAS_MES.Make
                             string sp_ifforsn = dt1.Rows[RemainIndex]["sp_ifforsn"].ToString();
                             string sp_tracekind = dt1.Rows[RemainIndex]["sp_tracekind"].ToString();
                             string sp_barcoderule = dt1.Rows[RemainIndex]["sp_barcoderule"].ToString();
-                            if(LogicHandler.CheckSNBeforeLoad(code.Text,sp_soncode,sp_barcoderule,sp_prefix,length,out ErrorMessage))
+                            if(LogicHandler.CheckSNBeforeLoad(oMakeCode,code.Text,sp_soncode,sp_barcoderule,sp_prefix,length,out ErrorMessage))
                                 Save_OtherCode(sp_soncode, make_code, sn_code.Text, sp_id);
                             else
                                 OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, code);

+ 98 - 94
UAS-MES/FunctionCode/Make/Make_PackageCollection.cs

@@ -181,128 +181,132 @@ namespace UAS_MES.Make
             //当用户输入回车键的时候
             if (e.KeyCode == Keys.Enter)
             {
-                if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
+                if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
-                    if (pa_outboxcode.Text == "")
+                    if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
                     {
-                        if (dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString() != "")
+                        if (pa_outboxcode.Text == "")
                         {
-                            LoadData();
-                            LoadGridData();
-                        }
-                        else
-                        {
-                            LoadData();
-                            pa_outboxcode.GeneratePaCode_Click(new object(), new EventArgs());
-                        }
-                    }
-                    //按工单核对装箱
-                    switch (pr_packrule.Text)
-                    {
-                        case "M":
-                            if (dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_id='" + oMsID + "'").ToString() != ms_makecode.Text)
+                            if (dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString() != "")
                             {
-                                OperateResult.AppendText(">>序列号" + sn_code.Text + "所属工单和当前箱号工单不相等\n", Color.Red, sn_code);
-                                return;
+                                LoadData();
+                                LoadGridData();
                             }
-                            break;
-                        case "S":
-                            if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
+                            else
                             {
-                                sql.Clear();
-                                sql.Append("select 1 from package left join make on pa_salecode=ma_salecode left join makeserial ");
-                                sql.Append("on ma_code=ms_makecode where pa_outboxcode='" + pa_outboxcode.Text + "' and ms_id='" + oMsID + "'");
-                                DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                                if (dt.Rows.Count == 0)
+                                LoadData();
+                                pa_outboxcode.GeneratePaCode_Click(new object(), new EventArgs());
+                            }
+                        }
+                        //按工单核对装箱
+                        switch (pr_packrule.Text)
+                        {
+                            case "M":
+                                if (dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_id='" + oMsID + "'").ToString() != ms_makecode.Text)
                                 {
-                                    OperateResult.AppendText(">>序列号" + sn_code.Text + "所属订单号和当前箱号订单不相等\n", Color.Red, sn_code);
+                                    OperateResult.AppendText(">>序列号" + sn_code.Text + "所属工单和当前箱号工单不相等\n", Color.Red, sn_code);
                                     return;
                                 }
-                            }
-                            break;
-                        case "P":
-                            if (dh.getFieldDataByCondition("makeserial", "ms_prodcode", "ms_id='" + oMsID + "'").ToString() != pr_code.Text)
-                            {
-                                OperateResult.AppendText(">>序列号" + sn_code.Text + "对应物料和该箱所装物料不同\n", Color.Red, sn_code);
-                                return;
-                            }
-                            break;
-                        default:
-                            break;
-                    }
-                    //判断箱内总数必须大于0
-                    if (pr_outboxinnerqty.Text == "" || pr_outboxinnerqty.Text == "0")
-                    {
-                        OperateResult.AppendText(">>箱内容量必须大于0\n", Color.Red);
-                        return;
-                    }
-                    //如果未勾选了取消录入
-                    if (!Cancel.Checked)
-                    {
-                        //判断序列号是否已经装箱
-                        if (dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString() != "")
+                                break;
+                            case "S":
+                                if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
+                                {
+                                    sql.Clear();
+                                    sql.Append("select 1 from package left join make on pa_salecode=ma_salecode left join makeserial ");
+                                    sql.Append("on ma_code=ms_makecode where pa_outboxcode='" + pa_outboxcode.Text + "' and ms_id='" + oMsID + "'");
+                                    DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                                    if (dt.Rows.Count == 0)
+                                    {
+                                        OperateResult.AppendText(">>序列号" + sn_code.Text + "所属订单号和当前箱号订单不相等\n", Color.Red, sn_code);
+                                        return;
+                                    }
+                                }
+                                break;
+                            case "P":
+                                if (dh.getFieldDataByCondition("makeserial", "ms_prodcode", "ms_id='" + oMsID + "'").ToString() != pr_code.Text)
+                                {
+                                    OperateResult.AppendText(">>序列号" + sn_code.Text + "对应物料和该箱所装物料不同\n", Color.Red, sn_code);
+                                    return;
+                                }
+                                break;
+                            default:
+                                break;
+                        }
+                        //判断箱内总数必须大于0
+                        if (pr_outboxinnerqty.Text == "" || pr_outboxinnerqty.Text == "0")
                         {
-                            OperateResult.AppendText(">>序列号" + sn_code.Text + "已经装箱!\n", Color.Red, sn_code);
+                            OperateResult.AppendText(">>箱内容量必须大于0\n", Color.Red);
+                            return;
                         }
-                        else
+                        //如果未勾选了取消录入
+                        if (!Cancel.Checked)
                         {
-                            //满箱之后采集下一个之前自动清除内容,生成新的箱号
-                            if ((AutoGenBoxCode.Checked && pa_currentqty.Text != "" && pr_outboxinnerqty.Text == pa_currentqty.Text) || pa_status.Text == "1")
-                            {
-                                pa_currentqty.Text = "";
-                                pa_outboxcode.Text = "";
-                                pa_status.Text = "0";
-                                BaseUtil.CleanDGVData(PackageDetail);
-                                pa_outboxcode.GeneratePaCode_Click(new object(), new EventArgs());
-                            }
-                            //箱号不存在的情况
-                            if (!dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
+                            //判断序列号是否已经装箱
+                            if (dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString() != "")
                             {
-                                //插入Package主表箱号信息
-                                sql.Clear();
-                                sql.Append("insert into package (pa_id,pa_outboxcode,pa_packageqty,pa_totalqty,pa_status,pa_indate,pa_makecode,pa_prodcode,pa_salecode,");
-                                sql.Append("pa_custcode,pa_type,pa_packtype) select package_seq.nextval,'" + pa_outboxcode.Text + "',0," + pr_outboxinnerqty.Text + ",0,");
-                                sql.Append("sysdate,'" + oMakeCode + "', ma_prodcode,ma_salecode,ma_custcode,1,'" + pr_packrule.Text + "' from make where ma_code = '" + oMakeCode + "'");
-                                dh.ExecuteSql(sql.GetString(), "insert");
-                                OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "采集成功!\n", Color.Green);
-                                InsertDetail();
+                                OperateResult.AppendText(">>序列号" + sn_code.Text + "已经装箱!\n", Color.Red, sn_code);
                             }
                             else
                             {
-                                if (dh.getRowCount("makeserial", "ms_sncode='" + sn_code.Text + "'") > 0)
+                                //满箱之后采集下一个之前自动清除内容,生成新的箱号
+                                if ((AutoGenBoxCode.Checked && pa_currentqty.Text != "" && pr_outboxinnerqty.Text == pa_currentqty.Text) || pa_status.Text == "1")
+                                {
+                                    pa_currentqty.Text = "";
+                                    pa_outboxcode.Text = "";
+                                    pa_status.Text = "0";
+                                    BaseUtil.CleanDGVData(PackageDetail);
+                                    pa_outboxcode.GeneratePaCode_Click(new object(), new EventArgs());
+                                }
+                                //箱号不存在的情况
+                                if (!dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
+                                {
+                                    //插入Package主表箱号信息
+                                    sql.Clear();
+                                    sql.Append("insert into package (pa_id,pa_outboxcode,pa_packageqty,pa_totalqty,pa_status,pa_indate,pa_makecode,pa_prodcode,pa_salecode,");
+                                    sql.Append("pa_custcode,pa_type,pa_packtype) select package_seq.nextval,'" + pa_outboxcode.Text + "',0," + pr_outboxinnerqty.Text + ",0,");
+                                    sql.Append("sysdate,'" + oMakeCode + "', ma_prodcode,ma_salecode,ma_custcode,1,'" + pr_packrule.Text + "' from make where ma_code = '" + oMakeCode + "'");
+                                    dh.ExecuteSql(sql.GetString(), "insert");
+                                    OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "采集成功!\n", Color.Green);
                                     InsertDetail();
+                                }
                                 else
-                                    OperateResult.AppendText(">>序列号" + sn_code.Text + "不存在\n", Color.Red, sn_code);
+                                {
+                                    if (dh.getRowCount("makeserial", "ms_sncode='" + sn_code.Text + "'") > 0)
+                                        InsertDetail();
+                                    else
+                                        OperateResult.AppendText(">>序列号" + sn_code.Text + "不存在\n", Color.Red, sn_code);
+                                }
                             }
                         }
-                    }
-                    //勾选了取消箱号先验证箱号存不存在,存在的话移除掉,重新加载一次数据
-                    else
-                    {
-                        if (dh.getFieldDataByCondition("package", "pa_status", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString() != "1")
+                        //勾选了取消箱号先验证箱号存不存在,存在的话移除掉,重新加载一次数据
+                        else
                         {
-                            string outboxcode = dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString();
-                            if (outboxcode != "")
+                            if (dh.getFieldDataByCondition("package", "pa_status", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString() != "1")
                             {
-                                if (outboxcode == pa_outboxcode.Text)
+                                string outboxcode = dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString();
+                                if (outboxcode != "")
                                 {
-                                    //删除明细行的数据
-                                    dh.ExecuteSql("delete from packagedetail where pd_barcode='" + sn_code.Text + "' and pd_paid=(select pa_id from package where pa_outboxcode='" + pa_outboxcode.Text + "')", "delete");
-                                    //更新已装数 
-                                    dh.UpdateByCondition("Package", "pa_packageqty=pa_packageqty-1,pa_currentqty=pa_currentqty-1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                                    //清除序列号箱号
-                                    dh.UpdateByCondition("makeserial", "ms_outboxcode=''", "ms_id='" + oMsID + "'");
-                                    OperateResult.AppendText(">>已从该箱中移除序列号" + sn_code.Text + "\n", Color.Green);
-                                    LoadGridData();
+                                    if (outboxcode == pa_outboxcode.Text)
+                                    {
+                                        //删除明细行的数据
+                                        dh.ExecuteSql("delete from packagedetail where pd_barcode='" + sn_code.Text + "' and pd_paid=(select pa_id from package where pa_outboxcode='" + pa_outboxcode.Text + "')", "delete");
+                                        //更新已装数 
+                                        dh.UpdateByCondition("Package", "pa_packageqty=pa_packageqty-1,pa_currentqty=pa_currentqty-1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                                        //清除序列号箱号
+                                        dh.UpdateByCondition("makeserial", "ms_outboxcode=''", "ms_id='" + oMsID + "'");
+                                        OperateResult.AppendText(">>已从该箱中移除序列号" + sn_code.Text + "\n", Color.Green);
+                                        LoadGridData();
+                                    }
+                                    else OperateResult.AppendText(">>序列号" + sn_code.Text + "不在箱" + pa_outboxcode.Text + "内\n", Color.Red);
                                 }
-                                else OperateResult.AppendText(">>序列号" + sn_code.Text + "不在箱" + pa_outboxcode.Text + "内\n", Color.Red);
+                                else OperateResult.AppendText(">>序列号" + sn_code.Text + "尚未装箱\n", Color.Red);
                             }
-                            else OperateResult.AppendText(">>序列号" + sn_code.Text + "尚未装箱\n", Color.Red);
+                            else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "已经封箱,不允许取消采集\n", Color.Red);
                         }
-                        else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "已经封箱,不允许取消采集\n", Color.Red);
                     }
+                    else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                 }
-                else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
+                else OperateResult.AppendText(">>"+ErrorMessage+"\n", Color.Red);
             }
         }
 

+ 2 - 2
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.Designer.cs

@@ -693,7 +693,7 @@
             // 
             this.pr_cartonunit.AutoSize = true;
             this.pr_cartonunit.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.pr_cartonunit.Location = new System.Drawing.Point(86, 45);
+            this.pr_cartonunit.Location = new System.Drawing.Point(85, 45);
             this.pr_cartonunit.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.pr_cartonunit.Name = "pr_cartonunit";
             this.pr_cartonunit.Size = new System.Drawing.Size(25, 27);
@@ -714,7 +714,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(36, 172);
+            this.label4.Location = new System.Drawing.Point(30, 172);
             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);

+ 98 - 94
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.cs

@@ -251,126 +251,130 @@ namespace UAS_MES.Make
             //当用户输入回车键的时候
             if (e.KeyCode == Keys.Enter)
             {
-                if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
+                if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
-                    if (pa_outboxcode.Text == "")
+                    if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage))
                     {
-                        if (dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString() != "")
+                        if (pa_outboxcode.Text == "")
                         {
-                            LoadData();
-                            LoadGridData();
-                        }
-                        else
-                        {
-                            LoadData();
-                            pa_outboxcode.GeneratePaCode_Click(new object(), new EventArgs());
-                        }
-                    }
-                    //按工单核对装箱
-                    switch (pr_packrule.Text)
-                    {
-                        case "M":
-                            if (dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_id='" + oMsID + "'").ToString() != ms_makecode.Text)
+                            if (dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString() != "")
                             {
-                                OperateResult.AppendText(">>序列号" + sn_code.Text + "所属工单和当前箱号工单不相等\n", Color.Red, sn_code);
-                                return;
+                                LoadData();
+                                LoadGridData();
                             }
-                            break;
-                        case "S":
-                            if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
+                            else
                             {
-                                sql.Clear();
-                                sql.Append("select 1 from package left join make on pa_salecode=ma_salecode left join makeserial ");
-                                sql.Append("on ma_code=ms_makecode where pa_outboxcode='" + pa_outboxcode.Text + "' and ms_id='" + oMsID + "'");
-                                DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                                if (dt.Rows.Count == 0)
+                                LoadData();
+                                pa_outboxcode.GeneratePaCode_Click(new object(), new EventArgs());
+                            }
+                        }
+                        //按工单核对装箱
+                        switch (pr_packrule.Text)
+                        {
+                            case "M":
+                                if (dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_id='" + oMsID + "'").ToString() != ms_makecode.Text)
                                 {
-                                    OperateResult.AppendText(">>序列号" + sn_code.Text + "所属订单号和当前箱号订单不相等\n", Color.Red, sn_code);
+                                    OperateResult.AppendText(">>序列号" + sn_code.Text + "所属工单和当前箱号工单不相等\n", Color.Red, sn_code);
                                     return;
                                 }
-                            }
-                            break;
-                        case "":
-                            if (dh.getFieldDataByCondition("makeserial", "ms_prodcode", "ms_id='" + oMsID + "'").ToString() != pr_code.Text)
-                            {
-                                OperateResult.AppendText(">>序列号" + sn_code.Text + "对应物料和该箱所装物料不同\n", Color.Red, sn_code);
-                                return;
-                            }
-                            break;
-                        default:
-                            break;
-                    }
-                    //判断箱内总数必须大于0
-                    if (pr_outboxinnerqty.Text == "" || pr_outboxinnerqty.Text == "0")
-                    {
-                        OperateResult.AppendText(">>箱内容量必须大于0\n", Color.Red);
-                        return;
-                    }
-                    //如果未勾选了取消录入
-                    if (!Cancel.Checked)
-                    {
-                        //判断序列号是否已经装箱
-                        if (dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString() != "")
+                                break;
+                            case "S":
+                                if (dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
+                                {
+                                    sql.Clear();
+                                    sql.Append("select 1 from package left join make on pa_salecode=ma_salecode left join makeserial ");
+                                    sql.Append("on ma_code=ms_makecode where pa_outboxcode='" + pa_outboxcode.Text + "' and ms_id='" + oMsID + "'");
+                                    DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                                    if (dt.Rows.Count == 0)
+                                    {
+                                        OperateResult.AppendText(">>序列号" + sn_code.Text + "所属订单号和当前箱号订单不相等\n", Color.Red, sn_code);
+                                        return;
+                                    }
+                                }
+                                break;
+                            case "":
+                                if (dh.getFieldDataByCondition("makeserial", "ms_prodcode", "ms_id='" + oMsID + "'").ToString() != pr_code.Text)
+                                {
+                                    OperateResult.AppendText(">>序列号" + sn_code.Text + "对应物料和该箱所装物料不同\n", Color.Red, sn_code);
+                                    return;
+                                }
+                                break;
+                            default:
+                                break;
+                        }
+                        //判断箱内总数必须大于0
+                        if (pr_outboxinnerqty.Text == "" || pr_outboxinnerqty.Text == "0")
                         {
-                            OperateResult.AppendText(">>序列号" + sn_code.Text + "已经装箱!\n", Color.Red, sn_code);
+                            OperateResult.AppendText(">>箱内容量必须大于0\n", Color.Red);
+                            return;
                         }
-                        else
+                        //如果未勾选了取消录入
+                        if (!Cancel.Checked)
                         {
-                            //满箱之后采集下一个之前自动清除内容,生成新的箱号
-                            if ((AutoGenBoxCode.Checked && pa_currentqty.Text != "" && pr_outboxinnerqty.Text == pa_currentqty.Text) || pa_status.Text == "1")
-                            {
-                                pa_currentqty.Text = "";
-                                pa_outboxcode.Text = "";
-                                pa_status.Text = "0";
-                                BaseUtil.CleanDGVData(PackageDetail);
-                                pa_outboxcode.GeneratePaCode_Click(new object(), new EventArgs());
-                            }
-                            //箱号不存在的情况
-                            if (!dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
+                            //判断序列号是否已经装箱
+                            if (dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString() != "")
                             {
-                                //插入Package主表箱号信息
-                                sql.Clear();
-                                sql.Append("insert into package (pa_id,pa_outboxcode,pa_packageqty,pa_totalqty,pa_status,pa_indate,pa_makecode,pa_prodcode,pa_salecode,");
-                                sql.Append("pa_custcode,pa_type,pa_packtype) select package_seq.nextval,'" + pa_outboxcode.Text + "',0," + pr_outboxinnerqty.Text + ",0,");
-                                sql.Append("sysdate,'" + ms_makecode.Text + "', ma_prodcode,ma_salecode,ma_custcode,1,'" + pr_packrule.Text + "' from make where ma_code = '" + ms_makecode.Text + "'");
-                                dh.ExecuteSql(sql.GetString(), "insert");
-                                OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "采集成功!\n", Color.Green);
-                                InsertDetail();
+                                OperateResult.AppendText(">>序列号" + sn_code.Text + "已经装箱!\n", Color.Red, sn_code);
                             }
                             else
                             {
-                                if (dh.getRowCount("makeserial", "ms_sncode='" + sn_code.Text + "'") > 0)
+                                //满箱之后采集下一个之前自动清除内容,生成新的箱号
+                                if ((AutoGenBoxCode.Checked && pa_currentqty.Text != "" && pr_outboxinnerqty.Text == pa_currentqty.Text) || pa_status.Text == "1")
+                                {
+                                    pa_currentqty.Text = "";
+                                    pa_outboxcode.Text = "";
+                                    pa_status.Text = "0";
+                                    BaseUtil.CleanDGVData(PackageDetail);
+                                    pa_outboxcode.GeneratePaCode_Click(new object(), new EventArgs());
+                                }
+                                //箱号不存在的情况
+                                if (!dh.CheckExist("package", "pa_outboxcode='" + pa_outboxcode.Text + "'"))
+                                {
+                                    //插入Package主表箱号信息
+                                    sql.Clear();
+                                    sql.Append("insert into package (pa_id,pa_outboxcode,pa_packageqty,pa_totalqty,pa_status,pa_indate,pa_makecode,pa_prodcode,pa_salecode,");
+                                    sql.Append("pa_custcode,pa_type,pa_packtype) select package_seq.nextval,'" + pa_outboxcode.Text + "',0," + pr_outboxinnerqty.Text + ",0,");
+                                    sql.Append("sysdate,'" + ms_makecode.Text + "', ma_prodcode,ma_salecode,ma_custcode,1,'" + pr_packrule.Text + "' from make where ma_code = '" + ms_makecode.Text + "'");
+                                    dh.ExecuteSql(sql.GetString(), "insert");
+                                    OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "采集成功!\n", Color.Green);
                                     InsertDetail();
+                                }
                                 else
-                                    OperateResult.AppendText(">>序列号" + sn_code.Text + "不存在\n", Color.Red, sn_code);
+                                {
+                                    if (dh.getRowCount("makeserial", "ms_sncode='" + sn_code.Text + "'") > 0)
+                                        InsertDetail();
+                                    else
+                                        OperateResult.AppendText(">>序列号" + sn_code.Text + "不存在\n", Color.Red, sn_code);
+                                }
                             }
                         }
-                    }
-                    //勾选了取消箱号先验证箱号存不存在,存在的话移除掉,重新加载一次数据
-                    else
-                    {
-                        if (dh.getFieldDataByCondition("package", "pa_status", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString() != "1")
+                        //勾选了取消箱号先验证箱号存不存在,存在的话移除掉,重新加载一次数据
+                        else
                         {
-                            string outboxcode = dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString();
-                            if (outboxcode != "")
+                            if (dh.getFieldDataByCondition("package", "pa_status", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString() != "1")
                             {
-                                if (outboxcode == pa_outboxcode.Text)
+                                string outboxcode = dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_id='" + oMsID + "'").ToString();
+                                if (outboxcode != "")
                                 {
-                                    //删除明细行的数据
-                                    dh.ExecuteSql("delete from packagedetail where pd_barcode='" + sn_code.Text + "' and pd_paid=(select pa_id from package where pa_outboxcode='" + pa_outboxcode.Text + "')", "delete");
-                                    //更新已装数 
-                                    dh.UpdateByCondition("Package", "pa_packageqty=pa_packageqty-1,pa_currentqty=pa_currentqty-1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                                    //清除序列号箱号
-                                    dh.UpdateByCondition("makeserial", "ms_outboxcode=''", "ms_id='" + oMsID + "'");
-                                    OperateResult.AppendText(">>已从该箱中移除序列号" + sn_code.Text + "\n", Color.Green, sn_code);
-                                    LoadGridData();
+                                    if (outboxcode == pa_outboxcode.Text)
+                                    {
+                                        //删除明细行的数据
+                                        dh.ExecuteSql("delete from packagedetail where pd_barcode='" + sn_code.Text + "' and pd_paid=(select pa_id from package where pa_outboxcode='" + pa_outboxcode.Text + "')", "delete");
+                                        //更新已装数 
+                                        dh.UpdateByCondition("Package", "pa_packageqty=pa_packageqty-1,pa_currentqty=pa_currentqty-1", "pa_outboxcode='" + pa_outboxcode.Text + "'");
+                                        //清除序列号箱号
+                                        dh.UpdateByCondition("makeserial", "ms_outboxcode=''", "ms_id='" + oMsID + "'");
+                                        OperateResult.AppendText(">>已从该箱中移除序列号" + sn_code.Text + "\n", Color.Green, sn_code);
+                                        LoadGridData();
+                                    }
+                                    else OperateResult.AppendText(">>序列号" + sn_code.Text + "不在箱" + pa_outboxcode.Text + "内\n", Color.Red, sn_code);
                                 }
-                                else OperateResult.AppendText(">>序列号" + sn_code.Text + "不在箱" + pa_outboxcode.Text + "内\n", Color.Red, sn_code);
+                                else OperateResult.AppendText(">>序列号" + sn_code.Text + "尚未装箱\n", Color.Red);
                             }
-                            else OperateResult.AppendText(">>序列号" + sn_code.Text + "尚未装箱\n", Color.Red);
+                            else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "已经封箱,不允许取消采集\n", Color.Red);
                         }
-                        else OperateResult.AppendText(">>箱号" + pa_outboxcode.Text + "已经封箱,不允许取消采集\n", Color.Red);
                     }
+                    else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
                 }
                 else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);
             }
@@ -441,7 +445,7 @@ namespace UAS_MES.Make
                 LogicHandler.DoCommandLog(User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "手动送检", "手动送检成功", "", ob_checkno.Text);
                 ob_checkno.Text = "";
             }
-            else OperateResult.AppendText(">>必须封箱才能送检\n",Color.Red);
+            else OperateResult.AppendText(">>必须封箱才能送检\n", Color.Red);
 
 
         }

+ 15 - 0
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.resx

@@ -209,6 +209,21 @@
   <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_barcode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pa_outboxcode1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pd_innerqty.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
+  <metadata name="pa_indate.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>
   <data name="SendCheck.DownImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
     <value>
         iVBORw0KGgoAAAANSUhEUgAAAEUAAAAWCAYAAACWl1FwAAAABGdBTUEAALGPC/xhBQAAABl0RVh0U29m

+ 49 - 44
UAS-MES/FunctionCode/Make/Make_RePrintLabel.Designer.cs

@@ -43,24 +43,24 @@
             this.label8 = new System.Windows.Forms.Label();
             this.label9 = new System.Windows.Forms.Label();
             this.label10 = new System.Windows.Forms.Label();
-            this.panel1 = new System.Windows.Forms.Panel();
             this.inputValue = new System.Windows.Forms.Label();
             this.pr_code = new System.Windows.Forms.Label();
             this.ms_makecode = new System.Windows.Forms.Label();
             this.pr_detail = new System.Windows.Forms.Label();
+            this.SN = new System.Windows.Forms.RadioButton();
             this.rePrintCheck = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             this.normalButton1 = new UAS_MES.CustomControl.ButtonUtil.NormalButton();
             this.printNum = new UAS_MES.CustomControl.TextBoxWithIcon.NumOnlyTextBox();
             this.inputText = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.Printer = new UAS_MES.CustomControl.ComBoxWithFocus.PrinterCombox();
-            this.panel1.SuspendLayout();
             this.SuspendLayout();
             // 
             // label1
             // 
             this.label1.AutoSize = true;
-            this.label1.Location = new System.Drawing.Point(3, 10);
+            this.label1.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.label1.Location = new System.Drawing.Point(38, 16);
             this.label1.Name = "label1";
             this.label1.Size = new System.Drawing.Size(110, 31);
             this.label1.TabIndex = 0;
@@ -70,7 +70,8 @@
             // 
             this.giftBox.AutoSize = true;
             this.giftBox.Checked = true;
-            this.giftBox.Location = new System.Drawing.Point(200, 6);
+            this.giftBox.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.giftBox.Location = new System.Drawing.Point(235, 16);
             this.giftBox.Name = "giftBox";
             this.giftBox.Size = new System.Drawing.Size(135, 35);
             this.giftBox.TabIndex = 1;
@@ -82,7 +83,8 @@
             // CartonBox
             // 
             this.CartonBox.AutoSize = true;
-            this.CartonBox.Location = new System.Drawing.Point(457, 8);
+            this.CartonBox.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.CartonBox.Location = new System.Drawing.Point(492, 14);
             this.CartonBox.Name = "CartonBox";
             this.CartonBox.Size = new System.Drawing.Size(164, 35);
             this.CartonBox.TabIndex = 2;
@@ -93,7 +95,8 @@
             // fuselagel
             // 
             this.fuselagel.AutoSize = true;
-            this.fuselagel.Location = new System.Drawing.Point(739, 8);
+            this.fuselagel.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.fuselagel.Location = new System.Drawing.Point(732, 12);
             this.fuselagel.Name = "fuselagel";
             this.fuselagel.Size = new System.Drawing.Size(159, 35);
             this.fuselagel.TabIndex = 3;
@@ -105,7 +108,7 @@
             // 
             this.label.AutoSize = true;
             this.label.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label.Location = new System.Drawing.Point(37, 61);
+            this.label.Location = new System.Drawing.Point(38, 52);
             this.label.Name = "label";
             this.label.Size = new System.Drawing.Size(86, 31);
             this.label.TabIndex = 4;
@@ -115,7 +118,7 @@
             // 
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label3.Location = new System.Drawing.Point(545, 61);
+            this.label3.Location = new System.Drawing.Point(546, 52);
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(110, 31);
             this.label3.TabIndex = 5;
@@ -125,7 +128,7 @@
             // 
             this.label111.AutoSize = true;
             this.label111.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label111.Location = new System.Drawing.Point(37, 102);
+            this.label111.Location = new System.Drawing.Point(38, 93);
             this.label111.Name = "label111";
             this.label111.Size = new System.Drawing.Size(110, 31);
             this.label111.TabIndex = 6;
@@ -135,7 +138,7 @@
             // 
             this.label5.AutoSize = true;
             this.label5.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label5.Location = new System.Drawing.Point(545, 102);
+            this.label5.Location = new System.Drawing.Point(546, 93);
             this.label5.Name = "label5";
             this.label5.Size = new System.Drawing.Size(62, 31);
             this.label5.TabIndex = 7;
@@ -145,7 +148,7 @@
             // 
             this.PrintLabel.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
             this.PrintLabel.FormattingEnabled = true;
-            this.PrintLabel.Location = new System.Drawing.Point(187, 196);
+            this.PrintLabel.Location = new System.Drawing.Point(188, 187);
             this.PrintLabel.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.PrintLabel.Name = "PrintLabel";
             this.PrintLabel.Size = new System.Drawing.Size(222, 26);
@@ -155,7 +158,7 @@
             // 
             this.label6.AutoSize = true;
             this.label6.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label6.Location = new System.Drawing.Point(37, 144);
+            this.label6.Location = new System.Drawing.Point(38, 135);
             this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label6.Name = "label6";
             this.label6.Size = new System.Drawing.Size(134, 31);
@@ -166,7 +169,7 @@
             // 
             this.label7.AutoSize = true;
             this.label7.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label7.Location = new System.Drawing.Point(37, 191);
+            this.label7.Location = new System.Drawing.Point(38, 182);
             this.label7.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
             this.label7.Name = "label7";
             this.label7.Size = new System.Drawing.Size(110, 31);
@@ -177,7 +180,7 @@
             // 
             this.label8.AutoSize = true;
             this.label8.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label8.Location = new System.Drawing.Point(37, 242);
+            this.label8.Location = new System.Drawing.Point(38, 233);
             this.label8.Name = "label8";
             this.label8.Size = new System.Drawing.Size(86, 31);
             this.label8.TabIndex = 190;
@@ -187,7 +190,7 @@
             // 
             this.label9.AutoSize = true;
             this.label9.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label9.Location = new System.Drawing.Point(37, 293);
+            this.label9.Location = new System.Drawing.Point(38, 284);
             this.label9.Name = "label9";
             this.label9.Size = new System.Drawing.Size(62, 31);
             this.label9.TabIndex = 192;
@@ -197,30 +200,17 @@
             // 
             this.label10.AutoSize = true;
             this.label10.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label10.Location = new System.Drawing.Point(46, 600);
+            this.label10.Location = new System.Drawing.Point(49, 587);
             this.label10.Name = "label10";
             this.label10.Size = new System.Drawing.Size(110, 31);
             this.label10.TabIndex = 196;
             this.label10.Text = "补打核对";
             // 
-            // panel1
-            // 
-            this.panel1.BackColor = System.Drawing.SystemColors.ButtonHighlight;
-            this.panel1.Controls.Add(this.giftBox);
-            this.panel1.Controls.Add(this.label1);
-            this.panel1.Controls.Add(this.CartonBox);
-            this.panel1.Controls.Add(this.fuselagel);
-            this.panel1.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.panel1.Location = new System.Drawing.Point(43, 12);
-            this.panel1.Name = "panel1";
-            this.panel1.Size = new System.Drawing.Size(1057, 46);
-            this.panel1.TabIndex = 198;
-            // 
             // inputValue
             // 
             this.inputValue.AutoSize = true;
             this.inputValue.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.inputValue.Location = new System.Drawing.Point(181, 61);
+            this.inputValue.Location = new System.Drawing.Point(182, 52);
             this.inputValue.Name = "inputValue";
             this.inputValue.Size = new System.Drawing.Size(0, 31);
             this.inputValue.TabIndex = 199;
@@ -229,7 +219,7 @@
             // 
             this.pr_code.AutoSize = true;
             this.pr_code.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.pr_code.Location = new System.Drawing.Point(181, 102);
+            this.pr_code.Location = new System.Drawing.Point(182, 93);
             this.pr_code.Name = "pr_code";
             this.pr_code.Size = new System.Drawing.Size(0, 31);
             this.pr_code.TabIndex = 200;
@@ -239,7 +229,7 @@
             // 
             this.ms_makecode.AutoSize = true;
             this.ms_makecode.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.ms_makecode.Location = new System.Drawing.Point(655, 61);
+            this.ms_makecode.Location = new System.Drawing.Point(656, 52);
             this.ms_makecode.Name = "ms_makecode";
             this.ms_makecode.Size = new System.Drawing.Size(0, 31);
             this.ms_makecode.TabIndex = 201;
@@ -248,17 +238,30 @@
             // 
             this.pr_detail.AutoSize = true;
             this.pr_detail.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.pr_detail.Location = new System.Drawing.Point(655, 102);
+            this.pr_detail.Location = new System.Drawing.Point(656, 93);
             this.pr_detail.Name = "pr_detail";
             this.pr_detail.Size = new System.Drawing.Size(0, 31);
             this.pr_detail.TabIndex = 202;
             // 
+            // SN
+            // 
+            this.SN.AutoSize = true;
+            this.SN.Font = new System.Drawing.Font("微软雅黑", 12F);
+            this.SN.Location = new System.Drawing.Point(955, 10);
+            this.SN.Name = "SN";
+            this.SN.Size = new System.Drawing.Size(145, 35);
+            this.SN.TabIndex = 203;
+            this.SN.TabStop = true;
+            this.SN.Text = "SN标打印";
+            this.SN.UseVisualStyleBackColor = true;
+            this.SN.CheckedChanged += new System.EventHandler(this.SN_CheckedChanged);
+            // 
             // rePrintCheck
             // 
             this.rePrintCheck.AllPower = null;
             this.rePrintCheck.BackColor = System.Drawing.Color.White;
             this.rePrintCheck.ID = null;
-            this.rePrintCheck.Location = new System.Drawing.Point(221, 600);
+            this.rePrintCheck.Location = new System.Drawing.Point(224, 587);
             this.rePrintCheck.Name = "rePrintCheck";
             this.rePrintCheck.Power = null;
             this.rePrintCheck.Size = new System.Drawing.Size(242, 28);
@@ -271,7 +274,7 @@
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OperateResult.Location = new System.Drawing.Point(43, 332);
+            this.OperateResult.Location = new System.Drawing.Point(44, 323);
             this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
             this.OperateResult.Name = "OperateResult";
             this.OperateResult.Size = new System.Drawing.Size(1144, 246);
@@ -285,7 +288,7 @@
             this.normalButton1.DownImage = ((System.Drawing.Image)(resources.GetObject("normalButton1.DownImage")));
             this.normalButton1.Image = null;
             this.normalButton1.IsShowBorder = true;
-            this.normalButton1.Location = new System.Drawing.Point(549, 296);
+            this.normalButton1.Location = new System.Drawing.Point(550, 287);
             this.normalButton1.MoveImage = ((System.Drawing.Image)(resources.GetObject("normalButton1.MoveImage")));
             this.normalButton1.Name = "normalButton1";
             this.normalButton1.NormalImage = ((System.Drawing.Image)(resources.GetObject("normalButton1.NormalImage")));
@@ -301,7 +304,7 @@
             this.printNum.AllPower = null;
             this.printNum.BackColor = System.Drawing.Color.White;
             this.printNum.ID = null;
-            this.printNum.Location = new System.Drawing.Point(187, 296);
+            this.printNum.Location = new System.Drawing.Point(188, 287);
             this.printNum.Name = "printNum";
             this.printNum.Negative = false;
             this.printNum.Power = null;
@@ -317,7 +320,7 @@
             this.inputText.AllPower = null;
             this.inputText.BackColor = System.Drawing.Color.White;
             this.inputText.ID = null;
-            this.inputText.Location = new System.Drawing.Point(187, 242);
+            this.inputText.Location = new System.Drawing.Point(188, 233);
             this.inputText.Name = "inputText";
             this.inputText.Power = null;
             this.inputText.Size = new System.Drawing.Size(222, 28);
@@ -329,7 +332,7 @@
             // 
             // Printer
             // 
-            this.Printer.Location = new System.Drawing.Point(187, 144);
+            this.Printer.Location = new System.Drawing.Point(188, 135);
             this.Printer.Margin = new System.Windows.Forms.Padding(6);
             this.Printer.Name = "Printer";
             this.Printer.Size = new System.Drawing.Size(222, 37);
@@ -339,12 +342,16 @@
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(1227, 653);
+            this.ClientSize = new System.Drawing.Size(1227, 644);
+            this.Controls.Add(this.SN);
+            this.Controls.Add(this.giftBox);
             this.Controls.Add(this.pr_detail);
+            this.Controls.Add(this.label1);
+            this.Controls.Add(this.CartonBox);
             this.Controls.Add(this.ms_makecode);
+            this.Controls.Add(this.fuselagel);
             this.Controls.Add(this.pr_code);
             this.Controls.Add(this.inputValue);
-            this.Controls.Add(this.panel1);
             this.Controls.Add(this.rePrintCheck);
             this.Controls.Add(this.label10);
             this.Controls.Add(this.OperateResult);
@@ -368,8 +375,6 @@
             this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Make_RePrintLabel_FormClosing);
             this.Load += new System.EventHandler(this.Make_RePrintLabel_Load);
             this.SizeChanged += new System.EventHandler(this.Make_RePrintLabel_SizeChanged);
-            this.panel1.ResumeLayout(false);
-            this.panel1.PerformLayout();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -397,10 +402,10 @@
         private CustomControl.RichText.RichTextAutoBottom OperateResult;
         private System.Windows.Forms.Label label10;
         private CustomControl.TextBoxWithIcon.EnterTextBox rePrintCheck;
-        private System.Windows.Forms.Panel panel1;
         private System.Windows.Forms.Label inputValue;
         private System.Windows.Forms.Label pr_code;
         private System.Windows.Forms.Label ms_makecode;
         private System.Windows.Forms.Label pr_detail;
+        private System.Windows.Forms.RadioButton SN;
     }
 }

+ 10 - 2
UAS-MES/FunctionCode/Make/Make_RePrintLabel.cs

@@ -114,6 +114,14 @@ namespace UAS_MES.Make
                 clearAll();
             }
         }
+        private void SN_CheckedChanged(object sender, EventArgs e)
+        {
+            if (SN.Checked)
+            {
+                OperateResult.AppendText(">>请输入SN\n", Color.Black);
+                clearAll();
+            }
+        }
         private void inputText_KeyDown(object sender, KeyEventArgs e)
         {
             //按下enter键
@@ -226,6 +234,7 @@ namespace UAS_MES.Make
                 }
                 //判定通过进行打印
                 //按照打印张数打印
+                OperateResult.AppendText("<<打印成功\n", Color.Green);
                 Print.CodeSoft(lbl, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), indate[PrintLabel.SelectedIndex]);
                 //打印成功,记录日志commandlog , cl_operate彩盒或者机身标补打印,cl_result补打印成功
                 LogicHandler.DoCommandLog(User.UserCode, "", User.UserLineCode, User.UserSourceCode, giftBox.Checked?"彩盒标补打印":"机身标补打印", "补打印成功", inputValue.Text, "");
@@ -248,6 +257,7 @@ namespace UAS_MES.Make
                     return;
                 }
                 //判断通过,打印
+                OperateResult.AppendText("<<打印成功\n", Color.Green);
                 Print.CodeSoft(lbl, PrintLabel.Text.Split(':')[1], PrintLabel.SelectedValue.ToString(), Printer.Text, inputValue.Text, int.Parse(printNum.Text), indate[PrintLabel.SelectedIndex]);
                 //打印成功,记录日志commandlog , cl_operate彩盒或者机身标补打印,cl_result补打印成功
                 LogicHandler.DoCommandLog(User.UserCode, "", User.UserLineCode, User.UserSourceCode, "卡通箱标签补打印,箱号:"+ inputValue.Text, "补打印成功","", "");
@@ -405,7 +415,5 @@ namespace UAS_MES.Make
             pr_detail.Text = "";
             TSN = "";
         }
-
-       
     }
 }

+ 14 - 4
UAS_MesDllService(4.0)/MESHelper.cs

@@ -1,7 +1,7 @@
-using Oracle.ManagedDataAccess.Client;
-using System;
+using System;
 using System.Collections.Generic;
 using System.Data;
+using System.Data.OracleClient;
 using System.Runtime.InteropServices;
 using System.Text;
 
@@ -25,6 +25,7 @@ namespace BenQGuru.eMES.DLLService
         bool SetMobileData(string iTSN, string iSN, string iSourceCode, string iMPKind, string iResult, string iErrCode, string flag, out string oErrorMessage);
         bool SetPcbaData(string iSN, string iResCode, string iOperator, string iResult, string iErrCode, out string oErrMessage);
         bool GoMo(string iMO, string iSN, string iResCode, out string oErrMessage);
+        string Test(string Test);
     }
 
     [Guid("41EAB546-6EF4-464A-895A-9C34013A5D8C")]
@@ -913,8 +914,8 @@ namespace BenQGuru.eMES.DLLService
             command.CommandType = CommandType.StoredProcedure;
             for (int i = 0; i < param.Length; i++)
             {
-                //command.Parameters.Add(new OracleParameter(ParamName[i], OracleType.VarChar, 200, ParameterDirection.InputOutput, "", DataRowVersion.Default, true, param[i]));
-                command.Parameters.Add(new OracleParameter(ParamName[i], OracleDbType.Varchar2, 200, param[i], ParameterDirection.InputOutput));
+                command.Parameters.Add(new OracleParameter(ParamName[i], OracleType.VarChar, 200, ParameterDirection.InputOutput, "", DataRowVersion.Default, true, param[i]));
+                //command.Parameters.Add(new OracleParameter(ParamName[i], OracleDbType.Varchar2, 200, param[i], ParameterDirection.InputOutput));
             }
             try
             {
@@ -958,5 +959,14 @@ namespace BenQGuru.eMES.DLLService
                 cmd.Connection.Open();
             }
         }
+
+        public string Test(string Test)
+        {
+            connection = new OracleConnection(ConnectionStrings);
+            connection.Open();
+            command = new OracleCommand("insert into AAAAA(Table_name) values('eqrekjhfbkjbd')",connection);
+            command.ExecuteNonQuery();
+            return connection.ServerVersion;
+        }
     }
 }

二进制
UAS_MesDllService(4.0)/tool/Oracle.DataAccess.dll


二进制
UAS_MesDllService(4.0)/tool/Oracle.ManagedDataAccess.dll


+ 6 - 0
UAS_MesInterface/MESHelper.cs

@@ -25,6 +25,7 @@ namespace BenQGuru.eMES.DLLService
         bool SetMobileData(string iTSN, string iSN, string iSourceCode, string iMPKind, string iResult, string iErrCode, string flag, out string oErrorMessage);
         bool SetPcbaData(string iSN, string iResCode, string iOperator, string iResult, string iErrCode, out string oErrMessage);
         bool GoMo(string iMO, string iSN, string iResCode, out string oErrMessage);
+        int Add(int a, int b);
     }
 
     [Guid("41EAB546-6EF4-464A-895A-9C34013A5D8C")]
@@ -959,5 +960,10 @@ namespace BenQGuru.eMES.DLLService
                 cmd.Connection.Open();
             }
         }
+
+        public int Add(int a, int b)
+        {
+            return a + b;
+        }
     }
 }

+ 0 - 7
UAS_MesInterface/UAS_MesDllService(3.5).csproj

@@ -41,13 +41,6 @@
     <AssemblyOriginatorKeyFile>key.snk</AssemblyOriginatorKeyFile>
   </PropertyGroup>
   <ItemGroup>
-    <Reference Include="Oracle.DataAccess, Version=2.112.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=AMD64">
-      <SpecificVersion>False</SpecificVersion>
-      <HintPath>tool\Oracle.DataAccess.dll</HintPath>
-    </Reference>
-    <Reference Include="Oracle.ManagedDataAccess">
-      <HintPath>tool\Oracle.ManagedDataAccess.dll</HintPath>
-    </Reference>
     <Reference Include="System" />
     <Reference Include="System.Core" />
     <Reference Include="System.Data.OracleClient" />