Przeglądaj źródła

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

Hcsy 8 lat temu
rodzic
commit
03ff55a85c

+ 37 - 33
UAS-MES/FunctionCode/Make/Make_BigBoxCollection.cs

@@ -135,45 +135,49 @@ namespace UAS_MES.Make
                     //如果未装满的话
                     if (packageqty < pa_stanqty)
                     {
-                        dt = (DataTable)dh.ExecuteSql("select nvl(pa_type,1) pa_type,pa_mothercode from package where pa_outboxcode='"+outboxcode.Text+"'", "select");
+                        dt = (DataTable)dh.ExecuteSql("select nvl(pa_status,1) pa_status,pa_mothercode from package where pa_outboxcode='" + outboxcode.Text + "' and pa_type=1", "select");
                         //采集的卡通箱号存在
-                        if (dt.Rows.Count>0)
+                        if (dt.Rows.Count > 0)
                         {
-                            //判断是否已经装箱
-                            if (dt.Rows[0]["pa_mothercode"].ToString()=="")
+                            if (dt.Rows[0]["pa_status"].ToString() != "1")
                             {
-                                //插入大箱明细
-                                sql.Clear();
-                                sql.Append("insert into packagedetail(pd_id, pd_paid, pd_outboxcode,pd_innerboxcode, pd_innerqty)");
-                                sql.Append("select packagedetail_seq.nextval,'" + pa_id + "','" + bigoutboxcode.Text + "','" + outboxcode.Text + "'");
-                                sql.Append(",pa_packageqty from package where pa_outboxcode='" + outboxcode.Text + "'");
-                                dh.ExecuteSql(sql.GetString(), "insert");
-                                //箱内计数+1
-                                dh.UpdateByCondition("package", "PA_CURRENTQTY=PA_CURRENTQTY+1,PA_PACKAGEQTY=PA_PACKAGEQTY+1,PA_TOTALQTY=(select sum(pd_innerqty) from packagedetail left join package on pa_id=pd_paid where pa_outboxcode='" + bigoutboxcode.Text + "')", "pa_outboxcode='" + bigoutboxcode.Text + "' and pa_type=2");
-                                //更新采集的子箱记录母箱号
-                                dh.UpdateByCondition("package", "pa_mothercode='" + bigoutboxcode.Text + "'", "pa_outboxcode='" + outboxcode.Text + "'");
-                                if (dh.getFieldDataByCondition("package", "pa_makecode", "pa_outboxcode='" + bigoutboxcode.Text + "'").ToString() == "")
+                                //判断是否已经装箱
+                                if (dt.Rows[0]["pa_mothercode"].ToString() == "")
                                 {
-                                    string carton_macode = dh.getFieldDataByCondition("package", "pa_makecode", "pa_outboxcode='" + outboxcode.Text + "'").ToString();
-                                    pa_makecode.Text = carton_macode;
-                                    dh.ExecuteSql("update package set pa_makecode='" + carton_macode + "' where pa_outboxcode='" + bigoutboxcode.Text + "'", "update");
-                                }
-                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserSourceCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "大箱采集", "卡通箱" + outboxcode.Text + "采集成功", outboxcode.Text, "");
-                                OperateResult.AppendText(">>卡通箱号" + outboxcode.Text + "采集成功!\n", Color.Green, outboxcode);
-                                LoadGridData();
-                                LoadCollectNum();
-                                //判断明细和箱内的件数的差是不是1,如果只相差1则表示此时已经采集慢了
-                                if (packageqty + 1 == pa_stanqty)
-                                {
-                                    if (AutoPrint.Checked)
+                                    //插入大箱明细
+                                    sql.Clear();
+                                    sql.Append("insert into packagedetail(pd_id, pd_paid, pd_outboxcode,pd_innerboxcode, pd_innerqty)");
+                                    sql.Append("select packagedetail_seq.nextval,'" + pa_id + "','" + bigoutboxcode.Text + "','" + outboxcode.Text + "'");
+                                    sql.Append(",pa_packageqty from package where pa_outboxcode='" + outboxcode.Text + "'");
+                                    dh.ExecuteSql(sql.GetString(), "insert");
+                                    //箱内计数+1
+                                    dh.UpdateByCondition("package", "PA_CURRENTQTY=PA_CURRENTQTY+1,PA_PACKAGEQTY=PA_PACKAGEQTY+1,PA_TOTALQTY=(select sum(pd_innerqty) from packagedetail left join package on pa_id=pd_paid where pa_outboxcode='" + bigoutboxcode.Text + "')", "pa_outboxcode='" + bigoutboxcode.Text + "' and pa_type=2");
+                                    //更新采集的子箱记录母箱号
+                                    dh.UpdateByCondition("package", "pa_mothercode='" + bigoutboxcode.Text + "'", "pa_outboxcode='" + outboxcode.Text + "'");
+                                    if (dh.getFieldDataByCondition("package", "pa_makecode", "pa_outboxcode='" + bigoutboxcode.Text + "'").ToString() == "")
+                                    {
+                                        string carton_macode = dh.getFieldDataByCondition("package", "pa_makecode", "pa_outboxcode='" + outboxcode.Text + "'").ToString();
+                                        pa_makecode.Text = carton_macode;
+                                        dh.ExecuteSql("update package set pa_makecode='" + carton_macode + "' where pa_outboxcode='" + bigoutboxcode.Text + "'", "update");
+                                    }
+                                    LogicHandler.DoCommandLog(Tag.ToString(), User.UserSourceCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "大箱采集", "卡通箱" + outboxcode.Text + "采集成功", outboxcode.Text, "");
+                                    OperateResult.AppendText(">>卡通箱号" + outboxcode.Text + "采集成功!\n", Color.Green, outboxcode);
+                                    LoadGridData();
+                                    LoadCollectNum();
+                                    //判断明细和箱内的件数的差是不是1,如果只相差1则表示此时已经采集慢了
+                                    if (packageqty + 1 == pa_stanqty)
                                     {
-                                        OperateResult.AppendText(">>箱已装满,自动打印!\n", Color.Green);
-                                        Printlab.PerformClick();
+                                        if (AutoPrint.Checked)
+                                        {
+                                            OperateResult.AppendText(">>箱已装满,自动打印!\n", Color.Green);
+                                            Printlab.PerformClick();
+                                        }
+                                        OperateResult.AppendText(">>大箱" + bigoutboxcode.Text + "已采集满\n", Color.Green);
                                     }
-                                    OperateResult.AppendText(">>大箱" + bigoutboxcode.Text + "已采集满\n", Color.Green);
                                 }
+                                else OperateResult.AppendText(">>卡通箱号" + outboxcode.Text + "已采集\n", Color.Red, outboxcode);
                             }
-                            else OperateResult.AppendText(">>卡通箱号" + outboxcode.Text + "已采集\n", Color.Red, outboxcode);
+                            else OperateResult.AppendText(">>卡通箱号" + outboxcode.Text + "尚未封箱\n", Color.Red, outboxcode);
                         }
                         else OperateResult.AppendText(">>卡通箱号" + outboxcode.Text + "不存在\n", Color.Red, outboxcode);
                     }
@@ -220,7 +224,7 @@ namespace UAS_MES.Make
 
         private void NewPallet_Click(object sender, EventArgs e)
         {
-            NewBigBox = new Make_NewBigBox("PACKAGE", pa_makecode.Text);
+            NewBigBox = new Make_NewBigBox("BIGBOX", pa_makecode.Text);
             NewBigBox.Controls["Confirm"].Click += Make_BigBoxCollection_Click;
             BaseUtil.SetFormCenter(NewBigBox);
             NewBigBox.ShowDialog();
@@ -268,7 +272,7 @@ namespace UAS_MES.Make
             {
                 OperateResult.AppendText(">>" + bigoutboxcode.Text + "装箱成功\n", Color.Green);
                 LogicHandler.DoCommandLog(Tag.ToString(), User.UserSourceCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "大箱采集", "装箱" + bigoutboxcode.Text + "成功", outboxcode.Text, "");
-                bigoutboxcode.Text = LogicHandler.GetOutBoxCode("PACKAGE", "", pa_prodcode.Text, User.UserCode);
+                bigoutboxcode.Text = LogicHandler.GetOutBoxCode("BIGBOX", "", pa_prodcode.Text, User.UserCode);
                 sql.Clear();
                 sql.Append("insert into package (pa_id,pa_outboxcode,pa_makecode,pa_indate,pa_packageqty,pa_type,pa_prodcode,pa_level,PA_STATUS,pa_standardqty)values");
                 sql.Append("(package_seq.nextval,'" + bigoutboxcode.Text + "','" + pa_makecode.Text + "',sysdate,'0',2,'" + pa_prodcode.Text + "',0,'','" + pa_standardqty.Text + "')");

+ 17 - 0
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.Designer.cs

@@ -55,7 +55,9 @@
             this.ma_craftcode = new System.Windows.Forms.Label();
             this.ma_code = new UAS_MES.CustomControl.TextBoxWithIcon.MaCodeSearchTextBox();
             this.Lock = new UAS_MES.CustomControl.CustomCheckBox.LockCheckBox();
+            this.ClearSn_code = new System.Windows.Forms.PictureBox();
             ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).BeginInit();
+            ((System.ComponentModel.ISupportInitialize)(this.ClearSn_code)).BeginInit();
             this.SuspendLayout();
             // 
             // ms_makecode_label
@@ -364,11 +366,24 @@
             this.Lock.Text = "锁定";
             this.Lock.UseVisualStyleBackColor = true;
             // 
+            // ClearSn_code
+            // 
+            this.ClearSn_code.Cursor = System.Windows.Forms.Cursors.Hand;
+            this.ClearSn_code.Image = global::UAS_MES.Properties.Resources.bindingNavigatorDeleteItem_Image;
+            this.ClearSn_code.Location = new System.Drawing.Point(583, 535);
+            this.ClearSn_code.Margin = new System.Windows.Forms.Padding(4);
+            this.ClearSn_code.Name = "ClearSn_code";
+            this.ClearSn_code.Size = new System.Drawing.Size(21, 20);
+            this.ClearSn_code.TabIndex = 173;
+            this.ClearSn_code.TabStop = false;
+            this.ClearSn_code.Click += new System.EventHandler(this.ClearSn_code_Click);
+            // 
             // Make_ColorBoxLoadPrint
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
             this.ClientSize = new System.Drawing.Size(1292, 565);
+            this.Controls.Add(this.ClearSn_code);
             this.Controls.Add(this.Lock);
             this.Controls.Add(this.ma_code);
             this.Controls.Add(this.ma_craftcode);
@@ -404,6 +419,7 @@
             this.Load += new System.EventHandler(this.标签打印_Load);
             this.SizeChanged += new System.EventHandler(this.标签打印_SizeChanged);
             ((System.ComponentModel.ISupportInitialize)(this.PrintNum)).EndInit();
+            ((System.ComponentModel.ISupportInitialize)(this.ClearSn_code)).EndInit();
             this.ResumeLayout(false);
             this.PerformLayout();
 
@@ -436,5 +452,6 @@
         private System.Windows.Forms.Label ma_craftcode;
         private CustomControl.TextBoxWithIcon.MaCodeSearchTextBox ma_code;
         private CustomControl.CustomCheckBox.LockCheckBox Lock;
+        private System.Windows.Forms.PictureBox ClearSn_code;
     }
 }

+ 8 - 0
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.cs

@@ -270,5 +270,13 @@ namespace UAS_MES.Make
         {
             BaseUtil.ClosePrint(lbl);
         }
+
+        private void ClearSn_code_Click(object sender, EventArgs e)
+        {
+            BaseUtil.CleanDataTableData(ListA);
+            RemainIndex = 0;
+            code.Clear();
+            OperateResult.AppendText(">>请重新采集序列号\n");
+        }
     }
 }

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

@@ -252,6 +252,7 @@ namespace UAS_MES.Make
                                         LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "装箱采集", "采集成功", sn_code.Text, "");
                                         //满箱更新状态为1
                                         LoadData();
+                                        LoadGridData();
                                         if (int.Parse(pa_currentqty.Text == "" ? "0" : pa_currentqty.Text) == pr_outboxinnerqty.Value)
                                         {
                                             dh.UpdateByCondition("package", "pa_status=1,pa_packageqty=pa_currentqty", "pa_outboxcode='" + pa_outboxcode.Text + "'");
@@ -260,7 +261,6 @@ namespace UAS_MES.Make
                                             if (AutoPrint.Checked)
                                                 Print_Click(new object(), new EventArgs());
                                         }
-                                        LoadGridData();
                                         sn_code.Clear();
                                     }
                                     else OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red);

+ 22 - 18
UAS-MES/FunctionCode/Make/Make_PalletCollection.cs

@@ -122,32 +122,36 @@ namespace UAS_MES.Make
                         Packing_Click(new object(), new EventArgs());
                     }
                     //如果未装满的话
-                    dt = (DataTable)dh.ExecuteSql("select pa_mothercode from package where pa_outboxcode='" + outboxcode.Text + "' and nvl(pa_type,2)=2", "select");
+                    dt = (DataTable)dh.ExecuteSql("select pa_mothercode,nvl(pa_status,0) pa_status from package where pa_outboxcode='" + outboxcode.Text + "' and pa_type=2", "select");
                     if (dt.Rows.Count > 0)
                     {
                         //判断是否已经装箱
                         if (dt.Rows[0]["pa_mothercode"].ToString() == "")
                         {
-                            sql.Clear();
-                            sql.Append("insert into packagedetail(pd_id, pd_paid, pd_outboxcode, pd_innerboxcode, pd_innerqty)");
-                            sql.Append("select packagedetail_seq.nextval,'" + pa_id + "','" + palletcode.Text + "','" + outboxcode.Text + "' ");
-                            sql.Append(",(select nvl(sum(pd_innerqty),0) from packagedetail left join package on pa_id=pd_paid where pa_outboxcode=");
-                            sql.Append("'" + outboxcode.Text + "') from package where pa_outboxcode='" + outboxcode.Text + "'");
-                            dh.ExecuteSql(sql.GetString(), "insert");
-                            dh.UpdateByCondition("package", "PA_CURRENTQTY=nvl(PA_CURRENTQTY,0)+1,PA_PACKAGEQTY=nvl(PA_PACKAGEQTY,0)+1,PA_TOTALQTY=(select sum(pd_innerqty) from packagedetail left join package on pa_id=pd_paid where pa_outboxcode='" + palletcode.Text + "')", "pa_outboxcode='" + palletcode.Text + "' and pa_type=3");
-                            //更新大箱的栈板号
-                            dh.UpdateByCondition("package", "pa_mothercode='" + palletcode.Text + "'", "pa_outboxcode='" + outboxcode.Text + "'");
-                            LoadCollectNum();
-                            if (dh.getFieldDataByCondition("package", "pa_makecode", "pa_outboxcode='" + palletcode.Text + "'").ToString() == "")
+                            if (dt.Rows[0]["pa_status"].ToString() != "1")
                             {
-                                string carton_macode = dh.getFieldDataByCondition("package", "pa_makecode", "pa_outboxcode='" + outboxcode.Text + "'").ToString();
-                                pa_makecode.Text = carton_macode;
-                                dh.ExecuteSql("update package set pa_makecode='" + carton_macode + "' where pa_outboxcode='" + palletcode.Text + "'", "update");
+                                sql.Clear();
+                                sql.Append("insert into packagedetail(pd_id, pd_paid, pd_outboxcode, pd_innerboxcode, pd_innerqty)");
+                                sql.Append("select packagedetail_seq.nextval,'" + pa_id + "','" + palletcode.Text + "','" + outboxcode.Text + "' ");
+                                sql.Append(",(select nvl(sum(pd_innerqty),0) from packagedetail left join package on pa_id=pd_paid where pa_outboxcode=");
+                                sql.Append("'" + outboxcode.Text + "') from package where pa_outboxcode='" + outboxcode.Text + "'");
+                                dh.ExecuteSql(sql.GetString(), "insert");
+                                dh.UpdateByCondition("package", "PA_CURRENTQTY=nvl(PA_CURRENTQTY,0)+1,PA_PACKAGEQTY=nvl(PA_PACKAGEQTY,0)+1,PA_TOTALQTY=(select sum(pd_innerqty) from packagedetail left join package on pa_id=pd_paid where pa_outboxcode='" + palletcode.Text + "')", "pa_outboxcode='" + palletcode.Text + "' and pa_type=3");
+                                //更新大箱的栈板号
+                                dh.UpdateByCondition("package", "pa_mothercode='" + palletcode.Text + "'", "pa_outboxcode='" + outboxcode.Text + "'");
+                                LoadCollectNum();
+                                if (dh.getFieldDataByCondition("package", "pa_makecode", "pa_outboxcode='" + palletcode.Text + "'").ToString() == "")
+                                {
+                                    string carton_macode = dh.getFieldDataByCondition("package", "pa_makecode", "pa_outboxcode='" + outboxcode.Text + "'").ToString();
+                                    pa_makecode.Text = carton_macode;
+                                    dh.ExecuteSql("update package set pa_makecode='" + carton_macode + "' where pa_outboxcode='" + palletcode.Text + "'", "update");
+                                }
+                                OperateResult.AppendText(">>箱号" + outboxcode.Text + "采集成功!\n", Color.Green, outboxcode);
+                                LoadGridData();
                             }
-                            OperateResult.AppendText(">>箱号" + outboxcode.Text + "采集成功!\n", Color.Green, outboxcode);
-                            LoadGridData();
+                            else OperateResult.AppendText(">>箱号" + outboxcode.Text + "已采集\n", Color.Red, outboxcode);
                         }
-                        else OperateResult.AppendText(">>箱号" + outboxcode.Text + "已采集\n", Color.Red, outboxcode);
+                        else OperateResult.AppendText(">>箱号" + outboxcode.Text + "尚未封箱\n", Color.Red, outboxcode);
                     }
                     else OperateResult.AppendText(">>箱号" + outboxcode.Text + "不存在\n", Color.Red, outboxcode);
                 }

+ 3 - 2
UAS-MES/FunctionCode/Make/Make_PositionStock.Designer.cs

@@ -178,6 +178,7 @@
             this.ma_craftcode.Name = "ma_craftcode";
             this.ma_craftcode.Size = new System.Drawing.Size(199, 23);
             this.ma_craftcode.TabIndex = 185;
+            this.ma_craftcode.SelectedIndexChanged += new System.EventHandler(this.ma_craftcode_SelectedIndexChanged);
             // 
             // Lock
             // 
@@ -476,10 +477,10 @@
             this.Text = "岗位备料";
             this.Load += new System.EventHandler(this.岗位备料_Load);
             this.SizeChanged += new System.EventHandler(this.岗位备料_SizeChanged);
-            this.panel2.ResumeLayout(false);
+            this.panel2.ResumeLayout(true);
             this.panel2.PerformLayout();
             ((System.ComponentModel.ISupportInitialize)(this.BatchProductDGV)).EndInit();
-            this.ResumeLayout(false);
+            this.ResumeLayout(true);
             this.PerformLayout();
 
         }

+ 5 - 0
UAS-MES/FunctionCode/Make/Make_PositionStock.cs

@@ -291,5 +291,10 @@ namespace UAS_MES.Make
                     e.Value = Properties.Resources.bindingNavigatorDeleteItem_Image;
             }
         }
+
+        private void ma_craftcode_SelectedIndexChanged(object sender, EventArgs e)
+        {
+            Screen.PerformClick();
+        }
     }
 }

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

@@ -101,7 +101,7 @@ namespace UAS_MES.Make
                 OperateResult.AppendText(">>请输入SN\n", Color.Black);
                 clearAll();
             }
-            else if (btn.Name == "CartonBox" || btn.Checked)
+            else if (btn.Name == "CartonBox" && btn.Checked)
             {
                 OperateResult.AppendText(">>请输入卡通箱号\n", Color.Black);
                 clearAll();

+ 4 - 4
UAS-MES/FunctionCode/Make/Make_Repair.cs

@@ -352,7 +352,7 @@ namespace UAS_MES.Make
             }
             if (ifrework != "0" && reworkstatus == "0")
             {
-                if (dh.getRowCount("Makebad", "mb_sncode='" + ms_sncode.Text + "' and mb_status=0") == 0)
+                if (dh.getRowCount("Makebad", "mb_sncode='" + ms_sncode.Text + "' and mb_makecode='"+ms_makecode.Text+"' and mb_status=0") == 0)
                 {
                     OperatResult.AppendText(">>维修必须维护不良代码\n", Color.Red);
                     return;
@@ -402,11 +402,11 @@ namespace UAS_MES.Make
                             return;
                         }
                         if (ms_ifrework == "0")
-                            dh.UpdateByCondition("makeserial", "ms_paststep = ms_paststep ||'," + User.CurrentStepCode + "',ms_nextstepcode='" + cd_stepcode.Text + "',ms_craftcode='" + cr_code.Text + "',ms_stepcode='" + User.CurrentStepCode + "',ms_status=1", "ms_sncode='" + ms_sncode.Text + "'");
+                            dh.UpdateByCondition("makeserial", "ms_paststep = ms_paststep ||'," + User.CurrentStepCode + "',ms_nextstepcode='" + cd_stepcode.Text + "',ms_craftcode='" + cr_code.Text + "',ms_stepcode='" + User.CurrentStepCode + "',ms_status=1", "ms_id='" +msid + "'");
                         else
-                            dh.UpdateByCondition("makeserial", "ms_paststep = ms_paststep ||'," + User.CurrentStepCode + "',ms_nextstepcode='" + cd_stepcode.Text + "',ms_craftcode='" + cr_code.Text + "',ms_stepcode='" + User.CurrentStepCode + "',ms_reworkstatus=1", "ms_sncode='" + ms_sncode.Text + "'");
+                            dh.UpdateByCondition("makeserial", "ms_paststep = ms_paststep ||'," + User.CurrentStepCode + "',ms_nextstepcode='" + cd_stepcode.Text + "',ms_craftcode='" + cr_code.Text + "',ms_stepcode='" + User.CurrentStepCode + "',ms_reworkstatus=1", "ms_id='" + msid + "'");
                     }
-                    dh.UpdateByCondition("makebad", "mb_status=-1", "mb_sncode='" + ms_sncode.Text + "'");
+                    dh.UpdateByCondition("makebad", "mb_status=-1", "mb_sncode='" + ms_sncode.Text + "' and mb_makecode='" + ms_makecode.Text + "'");
                     LogicHandler.InsertMakeProcess(ms_sncode.Text, ms_makecode.Text, User.UserSourceCode, "回流工序", "完成维修回流", User.UserCode);
                     LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, macode, User.UserLineCode, User.UserSourceCode, "回流工序", "完成维修回流", ms_sncode.Text, ms_checkno.Text);
                     OperatResult.AppendText(">>" + ms_sncode.Text + " 序列号回流成功\n", Color.Green);

+ 1 - 1
UAS-MES/Main.cs

@@ -159,7 +159,7 @@ namespace UAS_MES
             {
                 ApplicationClass lbl = new ApplicationClass();
                 SystemInf.EnablePrint = true;
-                BaseUtil.WriteLbl(lbl);
+                lbl.Quit();
             }
             catch (Exception)
             {

+ 0 - 205
UAS-MES/PublicMethod/LogicHandler.cs

@@ -17,180 +17,6 @@ namespace UAS_MES.PublicMethod
         //用于存放批量执行的SQL
         static List<string> sqls = new List<string>();
 
-        /// <summary>
-        /// 检测当前工序是否正确,如果是第一道工序则进行插入MakeSerial表
-        /// </summary>
-        /// <param name="iSnCode"></param>
-        /// <param name="iMakeCode"></param>
-        /// <param name="iSourceCode"></param>
-        /// <param name="oErrorMessage"></param>
-        /// <returns></returns>
-        public static bool CheckCurrentStepAndIfFirst(string iSnCode, string iMakeCode, string iSourceCode, string iCaller, out bool oIfFirst, out string oErrorMessage)
-        {
-            oErrorMessage = "";
-            oIfFirst = false;
-            if (iSnCode == "")
-            {
-                oErrorMessage = "序列号不能为空值";
-                return false;
-            }
-            string StepCode = "";
-            string StepName = "";
-            string LineCode = "";
-            //如果传入的工单为空的话
-            if (iMakeCode == "")
-                if (!GetMakeInfo(iSnCode, out iMakeCode, out oErrorMessage))
-                    return false;
-
-            string cd_ifinput = "";
-            string cr_code = "";
-            //获取岗位资源对应的工序编号和名称
-            GetStepCodeAndNameAndLineBySource(iSourceCode, ref StepCode, ref StepName, ref LineCode);
-            string fo_class = dh.getFieldDataByCondition("cs_form", "fo_class", "fo_caller='" + iCaller + "'").ToString();
-            if (fo_class != "")
-            {
-                DataTable dt1 = dh.getFieldsDataByCondition("makeserial", new string[] { "ms_makecode", "ms_status" }, "ms_sncode='" + iSnCode + "'");
-                if (dt1.Rows.Count > 0)
-                {
-                    string macode = dt1.Rows[0]["ms_makecode"].ToString();
-                    if (macode == "")
-                    {
-                        oErrorMessage = "序列号" + iSnCode + "未绑定工单";
-                        return false;
-                    }
-                    if (dt1.Rows[0]["ms_status"].ToString() == "2")
-                    {
-                        oErrorMessage = "序列号" + iSnCode + "对应工单已完工";
-                        return false;
-                    }
-                    if (macode != iMakeCode)
-                    {
-                        oErrorMessage = "该序列号已绑定到工单" + macode;
-                        return false;
-                    }
-                }
-                sql.Clear();
-                sql.Append("select " + fo_class + ",cd_ifinput ifinput,cr_code from  make left join craft on cr_code=ma_craftcode left join craftdetail on cd_crid=cr_id ");
-                sql.Append("where ma_code='" + iMakeCode + "' and cd_stepcode='" + StepCode + "'");
-                //获取的行号不等于0,存在记录检测通过
-                dt1 = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
-                if (dt1.Rows.Count > 0)
-                {
-                    cd_ifinput = dt1.Rows[0]["ifinput"].ToString();
-                    cr_code = dt1.Rows[0]["cr_code"].ToString();
-                    if (dt1.Rows[0][fo_class].ToString() != "-1")
-                    {
-                        //返回具体的工单信息
-                        string serial = "";
-                        switch (fo_class)
-                        {
-                            case "cd_ifinput":
-                                serial = "上料采集";
-                                break;
-                            case "cd_ifoqc":
-                                serial = "OQC";
-                                break;
-                            case "cd_ifpack":
-                                serial = "包装采集";
-                                break;
-                            case "cd_ifsnchange":
-                                serial = "序列转换";
-                                break;
-                            case "cd_iftest":
-                                serial = "测试采集";
-                                break;
-                            default:
-                                break;
-                        }
-                        oErrorMessage = "当前岗位对应的工序不是" + serial + "工序";
-                        return false;
-                    }
-                }
-                else
-                {
-                    oErrorMessage = "当前岗位资源对应的工序不属于工单号" + iMakeCode;
-                    return false;
-                }
-            }
-            if (!CheckMakeStatus(iMakeCode, out oErrorMessage))
-            {
-                return false;
-            }
-            //验证当前执行的工序是否正确
-            DataTable dt = (DataTable)dh.ExecuteSql("select ms_nextstepcode,ms_stepcode from makeserial where ms_sncode='" + iSnCode + "' and ms_makecode='" + iMakeCode + "'", "select");
-            if (dt.Rows.Count > 0)
-            {
-                string CurrentStep = dt.Rows[0]["ms_nextstepcode"].ToString();
-                string LastStepCode = dt.Rows[0]["ms_stepcode"].ToString();
-                if (CurrentStep != "")
-                {
-                    //工序不等于上一工序和本工序
-                    if (CurrentStep != StepCode && LastStepCode != StepCode)
-                    {
-                        oErrorMessage = "序列号" + iSnCode + "的当前工序是" + CurrentStep + ",当前岗位的工序是" + StepName;
-                        return false;
-                    }
-                }
-                else
-                {
-                    oErrorMessage = "序列号" + iSnCode + "无可继续执行工序(已完工或者序列号不存在)";
-                    return false;
-                }
-            }
-            //判断是否是第一道工序
-            dt = (DataTable)dh.ExecuteSql("select  min(mcd_detno) detno from makecraftdetail where mcd_macode='" + iMakeCode + "'", "select");
-            string detno = dt.Rows[0]["detno"].ToString();
-            //判断当前最小的执行顺序是否有记录
-            if (dh.getRowCount("makecraftdetail", "mcd_stepcode='" + StepCode + "' and mcd_macode='" + iMakeCode + "' and mcd_detno ='" + detno + "'") > 0)
-            {
-                if (!dh.CheckExist("MakeSerial", "ms_sncode='" + iSnCode + "'"))
-                {
-                    //判断当前工单的数量是否已经超出了完工数量
-                    int ma_qty = int.Parse(dh.getFieldDataByCondition("make", "ma_qty", "ma_code='" + iMakeCode + "'").ToString());
-                    //查询除了报废的之外的记录数量
-                    int ms_sncodecount = int.Parse(dh.getFieldDataByCondition("makeserial", "count(ms_sncode)", "ms_makecode='" + iMakeCode + "' and ms_status<>3").ToString());
-                    //如果MakeSerial表的记录数已经达到了工单数量
-                    if (ma_qty > ms_sncodecount)
-                    {
-                        sql.Clear();
-                        sql.Append("Insert into MakeSerial (ms_id, ms_code, ms_sncode ,ms_prodcode, ms_indate,");
-                        sql.Append("ms_wccode,ms_craftcode,ms_craftname,ms_nextstepcode,ms_status,ms_makecode) select MAKESERIAL_SEQ.NEXTVAL,");
-                        sql.Append("'" + iSnCode + "','" + iSnCode + "',ma_prodcode,sysdate,ma_wccode,ma_craftcode,ma_craftname,'" + StepCode + "',1,ma_code ");
-                        sql.Append("from make left join makecraftdetail on ma_code =mcd_macode where ma_code='" + iMakeCode + "' and mcd_stepcode='" + StepCode + "'");
-                        dh.ExecuteSql(sql.ToString(), "insert");
-                        oErrorMessage = "获取序列号" + iSnCode + "成功,";
-                        oIfFirst = true;
-                    }
-                    else
-                    {
-                        oErrorMessage = "当前生产数量已达到完工数量";
-                        return false;
-                    }
-                }
-            }
-            //判断岗位备料是否足够
-            string Yes_No = dh.GetConfig("BatchNumber", "MESSetting").ToString();
-            if (cd_ifinput != "0")
-            {
-                sql.Clear();
-                sql.Append("select wm_concat(mss_prodcode) code,count(1) cn from (select sum(nvl(mss_remain,0))remain,mss_prodcode,max(mss_baseqty) mss_baseqty ");
-                sql.Append("from makesourcestock where mss_makecode='" + iMakeCode + "' and mss_stepcode='" + StepCode + "' ");
-                sql.Append("and mss_linecode='" + LineCode + "' group by mss_prodcode)T where T.remain<mss_baseqty and rownum<20");
-                dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
-                //如果配置的是Yes
-                if (Yes_No != "0")
-                {
-                    //如果批次料不足
-                    if (dt.Rows.Count > 0 && int.Parse(dt.Rows[0]["cn"].ToString()) > 0)
-                    {
-                        oErrorMessage += "批次物料:" + iSnCode + "," + dt.Rows[0]["code"] + "岗位备料不足";
-                        return false;
-                    }
-                }
-            }
-            return true;
-        }
-
         /// <summary>
         /// 检测当前的岗位资源对应的工序
         /// </summary>
@@ -238,37 +64,6 @@ namespace UAS_MES.PublicMethod
             }
         }
 
-        /// <summary>
-        /// 判断当前工序是否是第一道工序
-        /// </summary>
-        /// <param name="iSnCode"></param>
-        /// <param name="iMakecode"></param>
-        /// <param name="iSourceCode"></param>
-        /// <returns></returns>
-        public static bool CheckIfFirstMakeSerial(string iSnCode, string iMakecode, string iSourceCode)
-        {
-            //选取当前的最小的执行顺序
-            string CurrentStep = GetStepCodeBySource(iSourceCode);
-            DataTable dt = (DataTable)dh.ExecuteSql("select  min(mcd_detno) detno from makecraftdetail where mcd_macode='" + iMakecode + "'", "select");
-            string detno = dt.Rows[0]["detno"].ToString();
-            //判断当前最小的执行顺序是否有记录
-            if (dh.getRowCount("makecraftdetail", "mcd_stepcode='" + CurrentStep + "' and mcd_macode='" + iMakecode + "' and mcd_detno ='" + detno + "'") > 0)
-            {
-                if (!dh.CheckExist("MakeSerial", "ms_sncode='" + iSnCode + "' and ms_makecode='" + iMakecode + "'"))
-                {
-                    sql.Clear();
-                    sql.Append("Insert into MakeSerial (ms_id, ms_code, ms_sncode ,ms_prodcode, ms_indate,");
-                    sql.Append("ms_wccode,ms_craftcode,ms_craftname,ms_nextstepcode,ms_status,ms_makecode) select MAKESERIAL_SEQ.NEXTVAL,");
-                    sql.Append("'" + iSnCode + "','" + iSnCode + "',ma_prodcode,sysdate,ma_wccode,ma_craftcode,ma_craftname,'" + CurrentStep + "',0,ma_code ");
-                    sql.Append("from make left join makecraftdetail on ma_code =mcd_macode where ma_code='" + iMakecode + "' and mcd_stepcode='" + CurrentStep + "'");
-                    dh.ExecuteSql(sql.ToString(), "insert");
-                }
-                return true;
-            }
-            else
-                return false;
-        }
-
         public static void GetSerialNumByCaller(string iCaller, out string SerialNum)
         {
             SerialNum = "";