Browse Source

注释不必要代码,添加返工需求更新

章政 8 years ago
parent
commit
35d5c9c79a

+ 19 - 3
UAS-MES/FunctionCode/Make/Make_Repair.cs

@@ -276,7 +276,15 @@ namespace UAS_MES.Make
                     OperatResult.AppendText(">>回流工序不在回流工艺中\n", Color.Red);
                     OperatResult.AppendText(">>回流工序不在回流工艺中\n", Color.Red);
                 else
                 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_status=1", "ms_sncode='" + ms_sncode.Text + "'");
+                    string ms_ifrework = dh.getFieldDataByCondition("makeserial", "ms_ifrework", "ms_sncode='" + ms_sncode.Text + "' and ms_makecode='" + macode + "'").ToString();
+                    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 + "'");
+                    }
+                    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("makebad", "mb_status=-1", "mb_sncode='" + ms_sncode.Text + "'");
                     dh.UpdateByCondition("makebad", "mb_status=-1", "mb_sncode='" + ms_sncode.Text + "'");
                     LogicHandler.InsertMakeProcess(ms_sncode.Text, ms_makecode.Text, User.UserSourceCode, "回流工序", "完成维修回流", User.UserCode);
                     LogicHandler.InsertMakeProcess(ms_sncode.Text, ms_makecode.Text, User.UserSourceCode, "回流工序", "完成维修回流", User.UserCode);
                     OperatResult.AppendText(">>" + ms_sncode.Text + " 序列号回流成功\n", Color.Green);
                     OperatResult.AppendText(">>" + ms_sncode.Text + " 序列号回流成功\n", Color.Green);
@@ -292,7 +300,7 @@ namespace UAS_MES.Make
             if (ms_sncode.Text != "")
             if (ms_sncode.Text != "")
             {
             {
                 //判断是否有无法维修的记录
                 //判断是否有无法维修的记录
-                int ScrapNum = int.Parse(dh.getFieldDataByCondition("makebadreason left join makebad on mb_id=mbr_mbid", "count(0) cn", "mb_sncode='" + ms_sncode.Text + "'").ToString());
+                int ScrapNum = int.Parse(dh.getFieldDataByCondition("makebadreason left join makebad on mb_id=mbr_mbid", "count(0) cn", "mb_sncode='" + ms_sncode.Text + "' and mb_status=0").ToString());
                 if (ScrapNum == 0)
                 if (ScrapNum == 0)
                     OperatResult.AppendText(">>" + ms_sncode.Text + "报废必须维护不良原因\n", Color.Red);
                     OperatResult.AppendText(">>" + ms_sncode.Text + "报废必须维护不良原因\n", Color.Red);
                 else
                 else
@@ -300,7 +308,15 @@ namespace UAS_MES.Make
                     string confirm = MessageBox.Show(this.ParentForm, "此操作不可撤销,是否确认报废", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk).ToString();
                     string confirm = MessageBox.Show(this.ParentForm, "此操作不可撤销,是否确认报废", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk).ToString();
                     if (confirm == "Yes")
                     if (confirm == "Yes")
                     {
                     {
-                        dh.UpdateByCondition("makeserial", "ms_paststep = ms_paststep ||'," + User.CurrentStepCode + "',ms_status=4,ms_nextstepcode='',ms_stepcode='" + User.CurrentStepCode + "'", "ms_sncode='" + ms_sncode.Text + "' and ms_makecode='" + macode + "'");
+                        string ms_ifrework = dh.getFieldDataByCondition("makeserial", "ms_ifrework", "ms_sncode='" + ms_sncode.Text + "' and ms_makecode='" + macode + "'").ToString();
+                        if (ms_ifrework == "0")
+                        {
+                            dh.UpdateByCondition("makeserial", "ms_paststep = ms_paststep ||'," + User.CurrentStepCode + "',ms_status=4,ms_nextstepcode='',ms_stepcode='" + User.CurrentStepCode + "'", "ms_sncode='" + ms_sncode.Text + "' and ms_makecode='" + macode + "'");
+                        }
+                        else
+                        {
+                            dh.UpdateByCondition("makeserial", "ms_paststep = ms_paststep ||'," + User.CurrentStepCode + "',ms_reworkstatus= 4,ms_nextstepcode='',ms_stepcode='" + User.CurrentStepCode + "'", "ms_sncode='" + ms_sncode.Text + "' and ms_makecode='" + macode + "'");
+                        }
                         dh.UpdateByCondition("make", "MA_NGMADEQTY=nvl(MA_NGMADEQTY,0)+1", "ma_code='" + macode + "'");
                         dh.UpdateByCondition("make", "MA_NGMADEQTY=nvl(MA_NGMADEQTY,0)+1", "ma_code='" + macode + "'");
                         LogicHandler.InsertMakeProcess(ms_sncode.Text, ms_makecode.Text, User.UserSourceCode, "报废", "序列号报废", User.UserCode);
                         LogicHandler.InsertMakeProcess(ms_sncode.Text, ms_makecode.Text, User.UserSourceCode, "报废", "序列号报废", User.UserCode);
                         OperatResult.AppendText(">>报废成功\n", Color.Green);
                         OperatResult.AppendText(">>报废成功\n", Color.Green);

+ 40 - 40
UAS-MES/FunctionCode/OQC/OQC_BatchResultJudge.cs

@@ -306,46 +306,46 @@ namespace UAS_MES.OQC
             }
             }
         }
         }
 
 
-        //记录操作日志
-        private void DoLog(string Kind, string Result, string Type)
-        {
-            LogicHandler.InsertMessageLog(User.UserName, Kind, Result, "OQCBATCH|ob_id=" + ob_id.Text + "", ob_checkno.Text);
-            if (ob_source.Text == "工序")
-            {
-                //如果是撤销操作则更新回上一工序
-                if (Type == "撤销")
-                {
-                    List<string> sql = new List<string>();
-                    //该序列号的批次数量
-                    string batchqty = dh.getFieldDataByCondition("oqcbatch", "ob_nowcheckqty", "ob_checkno='" + ob_checkno.Text + "'").ToString();
-                    //撤销时如果没有下一工序表示工单已经完工了,此时撤销需要将完工数减掉一个批次
-                    if (dh.getFieldDataByCondition("makeserial", "ms_nextstepcode", "ms_sncode='" + ms_sncode.Text + "'").ToString() == "")
-                    {
-                        sql.Add("update make set ma_madeqty=ma_madeqty-" + batchqty + " where ma_code='" + ob_makecode.Text + "'");
-                    }
-                    //获取上一步执行的工序
-                    string PastCode = dh.getFieldDataByCondition("makeserial", "SUBSTR(ms_paststep,0,INSTR(ms_paststep,',', -1, 1)-1) ms_paststep", "ms_checkno='" + ob_checkno.Text + "' and ms_status<>3").ToString();
-                    string[] LastStepCode = PastCode.Split(',');
-                    sql.Add("update makeserial set ms_paststep=(select distinct SUBSTR(ms_paststep,0,INSTR(ms_paststep,',', -1, 1)-1)  from makeserial where ms_checkno='" + ob_checkno.Text + "' and ms_status<>3 and rownum=1) where ms_checkno='" + ob_checkno.Text + "' and ms_status<>3 ");
-                    sql.Add("update makeserial set ms_stepcode='" + LastStepCode[LastStepCode.Length - 1] + "',ms_nextstepcode='" + User.CurrentStepCode + "',ms_status=1 where ms_checkno='" + ob_checkno.Text + "'");
-                    sql.Add("update makecraftdetail set mcd_inqty=mcd_inqty-" + batchqty + ",mcd_outqty = mcd_outqty - " + batchqty + ",mcd_okqty = mcd_okqty -" + batchqty + " where mcd_macode='" + ob_makecode.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
-                    dh.ExecuteSQLTran(sql.ToArray());
-                }
-                else if (Type == "通过")
-                {
-                    //更新下一工序
-                    LogicHandler.UpdateOQCMessage(ms_sncode.Text, ob_checkno.Text, ob_makecode.Text, Kind, User.UserSourceCode, User.UserName, Result, out ErrorMessage);
-                    sql.Clear();
-                    sql.Append("insert into MakeProcess(mp_id,mp_makecode,mp_maid, mp_mscode,mp_sncode,mp_stepcode,mp_stepname,");
-                    sql.Append("mp_craftcode,mp_craftname,mp_kind,mp_result,mp_indate,mp_inman,mp_wccode,mp_linecode,mp_sourcecode,mp_snstatus,mp_sncheckno,mp_snoutboxcode)");
-                    sql.Append("select MakeProcess_seq.nextval, ma_code,ma_id,ms_code,ms_sncode,st_code,st_name,");
-                    sql.Append("ma_craftcode,ma_craftname,'" + Kind + "','" + Result + "',sysdate,'" + User.UserCode + "',ma_wccode,'" + User.UserLineCode + "','" + User.UserSourceCode + "',");
-                    sql.Append("ms_status,ms_checkno,ms_outboxcode from make left join makeserial on ms_makecode=ma_code left join step on st_code=ms_stepcode ");
-                    sql.Append("where  ms_checkno='" + ob_checkno.Text + "' and st_code='" + User.CurrentStepCode + "'");
-                    dh.ExecuteSql(sql.GetString(), "insert");
-                }
-            }
-        }
+        ////记录操作日志
+        //private void DoLog(string Kind, string Result, string Type)
+        //{
+        //    LogicHandler.InsertMessageLog(User.UserName, Kind, Result, "OQCBATCH|ob_id=" + ob_id.Text + "", ob_checkno.Text);
+        //    if (ob_source.Text == "工序")
+        //    {
+        //        //如果是撤销操作则更新回上一工序
+        //        if (Type == "撤销")
+        //        {
+        //            List<string> sql = new List<string>();
+        //            //该序列号的批次数量
+        //            string batchqty = dh.getFieldDataByCondition("oqcbatch", "ob_nowcheckqty", "ob_checkno='" + ob_checkno.Text + "'").ToString();
+        //            //撤销时如果没有下一工序表示工单已经完工了,此时撤销需要将完工数减掉一个批次
+        //            if (dh.getFieldDataByCondition("makeserial", "ms_nextstepcode", "ms_sncode='" + ms_sncode.Text + "'").ToString() == "")
+        //            {
+        //                sql.Add("update make set ma_madeqty=ma_madeqty-" + batchqty + " where ma_code='" + ob_makecode.Text + "'");
+        //            }
+        //            //获取上一步执行的工序
+        //            string PastCode = dh.getFieldDataByCondition("makeserial", "SUBSTR(ms_paststep,0,INSTR(ms_paststep,',', -1, 1)-1) ms_paststep", "ms_checkno='" + ob_checkno.Text + "' and ms_status<>3").ToString();
+        //            string[] LastStepCode = PastCode.Split(',');
+        //            sql.Add("update makeserial set ms_paststep=(select distinct SUBSTR(ms_paststep,0,INSTR(ms_paststep,',', -1, 1)-1)  from makeserial where ms_checkno='" + ob_checkno.Text + "' and ms_status<>3 and rownum=1) where ms_checkno='" + ob_checkno.Text + "' and ms_status<>3 ");
+        //            sql.Add("update makeserial set ms_stepcode='" + LastStepCode[LastStepCode.Length - 1] + "',ms_nextstepcode='" + User.CurrentStepCode + "',ms_status=1 where ms_checkno='" + ob_checkno.Text + "'");
+        //            sql.Add("update makecraftdetail set mcd_inqty=mcd_inqty-" + batchqty + ",mcd_outqty = mcd_outqty - " + batchqty + ",mcd_okqty = mcd_okqty -" + batchqty + " where mcd_macode='" + ob_makecode.Text + "' and mcd_stepcode='" + User.CurrentStepCode + "'");
+        //            dh.ExecuteSQLTran(sql.ToArray());
+        //        }
+        //        else if (Type == "通过")
+        //        {
+        //            //更新下一工序
+        //            LogicHandler.UpdateOQCMessage(ms_sncode.Text, ob_checkno.Text, ob_makecode.Text, Kind, User.UserSourceCode, User.UserName, Result, out ErrorMessage);
+        //            sql.Clear();
+        //            sql.Append("insert into MakeProcess(mp_id,mp_makecode,mp_maid, mp_mscode,mp_sncode,mp_stepcode,mp_stepname,");
+        //            sql.Append("mp_craftcode,mp_craftname,mp_kind,mp_result,mp_indate,mp_inman,mp_wccode,mp_linecode,mp_sourcecode,mp_snstatus,mp_sncheckno,mp_snoutboxcode)");
+        //            sql.Append("select MakeProcess_seq.nextval, ma_code,ma_id,ms_code,ms_sncode,st_code,st_name,");
+        //            sql.Append("ma_craftcode,ma_craftname,'" + Kind + "','" + Result + "',sysdate,'" + User.UserCode + "',ma_wccode,'" + User.UserLineCode + "','" + User.UserSourceCode + "',");
+        //            sql.Append("ms_status,ms_checkno,ms_outboxcode from make left join makeserial on ms_makecode=ma_code left join step on st_code=ms_stepcode ");
+        //            sql.Append("where  ms_checkno='" + ob_checkno.Text + "' and st_code='" + User.CurrentStepCode + "'");
+        //            dh.ExecuteSql(sql.GetString(), "insert");
+        //        }
+        //    }
+        //}
 
 
         private void 抽检批维护_SizeChanged(object sender, EventArgs e)
         private void 抽检批维护_SizeChanged(object sender, EventArgs e)
         {
         {

+ 0 - 2
UAS-MES/FunctionCode/OQC/OQC_SamplingDataCollection.Designer.cs

@@ -462,7 +462,6 @@
             this.WaitChooseDGV.RowTemplate.Height = 23;
             this.WaitChooseDGV.RowTemplate.Height = 23;
             this.WaitChooseDGV.Size = new System.Drawing.Size(357, 320);
             this.WaitChooseDGV.Size = new System.Drawing.Size(357, 320);
             this.WaitChooseDGV.TabIndex = 204;
             this.WaitChooseDGV.TabIndex = 204;
-            this.WaitChooseDGV.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.WaitChooseDGV_CellContentClick);
             this.WaitChooseDGV.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.WaitChooseDGV_DataError);
             this.WaitChooseDGV.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.WaitChooseDGV_DataError);
             // 
             // 
             // ChooseAll
             // ChooseAll
@@ -551,7 +550,6 @@
             this.CheckTypeDGV.RowTemplate.Height = 23;
             this.CheckTypeDGV.RowTemplate.Height = 23;
             this.CheckTypeDGV.Size = new System.Drawing.Size(589, 415);
             this.CheckTypeDGV.Size = new System.Drawing.Size(589, 415);
             this.CheckTypeDGV.TabIndex = 198;
             this.CheckTypeDGV.TabIndex = 198;
-            this.CheckTypeDGV.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.CheckTypeDGV_CellContentClick);
             this.CheckTypeDGV.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.CheckTypeDGV_CellValueChanged);
             this.CheckTypeDGV.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.CheckTypeDGV_CellValueChanged);
             this.CheckTypeDGV.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.CheckTypeDGV_DataError);
             this.CheckTypeDGV.DataError += new System.Windows.Forms.DataGridViewDataErrorEventHandler(this.CheckTypeDGV_DataError);
             // 
             // 

+ 0 - 9
UAS-MES/FunctionCode/OQC/OQC_SamplingDataCollection.cs

@@ -429,15 +429,6 @@ namespace UAS_MES.OQC
 
 
         private void WaitChooseDGV_DataError(object sender, DataGridViewDataErrorEventArgs e) { }
         private void WaitChooseDGV_DataError(object sender, DataGridViewDataErrorEventArgs e) { }
 
 
-        private void WaitChooseDGV_CellContentClick(object sender, DataGridViewCellEventArgs e)
-        {
-
-        }
-
-        private void CheckTypeDGV_CellContentClick(object sender, DataGridViewCellEventArgs e)
-        {
-        }
-
         private void bccode_KeyDown(object sender, KeyEventArgs e)
         private void bccode_KeyDown(object sender, KeyEventArgs e)
         {
         {
             if (e.KeyCode == Keys.Enter)
             if (e.KeyCode == Keys.Enter)

+ 68 - 59
UAS-MES/PublicMethod/LogicHandler.cs

@@ -1030,17 +1030,26 @@ namespace UAS_MES.PublicMethod
             //之前保存的不良就不再调用
             //之前保存的不良就不再调用
             if (ms_status != "3")
             if (ms_status != "3")
             {
             {
-                string ms_stepcode = dh.getFieldDataByCondition("makeserial", "ms_stepcode", "ms_sncode='" + iSnCode + "'").ToString();
-                Console.WriteLine(ms_stepcode);
-                Console.WriteLine(StepCode);
-                if (ms_stepcode == StepCode)
-                {
-                    dh.UpdateByCondition("makeserial", "ms_status=3", "ms_sncode='" + iSnCode + "'");
-                }
-                else
+                DataTable dt = dh.getFieldsDataByCondition("makeserial", new string[] { "ms_stepcode", "ms_ifrework" }, "ms_sncode='" + iSnCode + "'");
+                if (dt.Rows.Count > 0)
                 {
                 {
-                    dh.UpdateByCondition("makeserial", "ms_paststep = ms_paststep ||'," + StepCode + "',ms_status=3", "ms_sncode='" + iSnCode + "'");
-                    SetStepFinish(iMakeCode, iSourceCode, iSnCode, "不良采集", iResult, iUserCode, out oErrorMessage);
+                    string ifrework = dt.Rows[0]["ms_ifrework"].ToString();
+                    string ms_stepcode = dt.Rows[0]["ms_stepcode"].ToString();
+                    if (ms_stepcode == StepCode)
+                    {
+                        if (ifrework == "0")
+                            dh.UpdateByCondition("makeserial", "ms_status=3", "ms_sncode='" + iSnCode + "'");
+                        else
+                            dh.UpdateByCondition("makeserial", "ms_reworkstatus=3", "ms_sncode='" + iSnCode + "'");
+                    }
+                    else
+                    {
+                        if (ifrework == "0")
+                            dh.UpdateByCondition("makeserial", "ms_paststep = ms_paststep ||'," + StepCode + "',ms_status=3", "ms_sncode='" + iSnCode + "'");
+                        else 
+                            dh.UpdateByCondition("makeserial", "ms_paststep = ms_paststep ||'," + StepCode + "',ms_reworkstatus=3", "ms_sncode='" + iSnCode + "'");
+                        SetStepFinish(iMakeCode, iSourceCode, iSnCode, "不良采集", iResult, iUserCode, out oErrorMessage);
+                    }
                 }
                 }
             }
             }
             return true;
             return true;
@@ -1229,55 +1238,55 @@ namespace UAS_MES.PublicMethod
                 return false;
                 return false;
         }
         }
 
 
-        public static bool UpdateOQCMessage(string iSnCode, string iCheckno, string iMakeCode, string iMPKind, string iSourceCode, string iUserCode, string iResult, out string oErrorMessage)
-        {
-            oErrorMessage = "";
-            string StepCode = "";
-            string StepName = "";
-            string LineCode = "";
-            if (iResult == "" || iResult == null)
-            {
-                iResult = "测试合格";
-            }
-            GetStepCodeAndNameAndLineBySource(iSourceCode, ref StepCode, ref StepName, ref LineCode);
-            //查询批次和批数量
-            string batchqty = dh.getFieldDataByCondition("oqcbatch", "ob_nowcheckqty", "ob_checkno='" + iCheckno + "'").ToString();
-            string nextstepcode = dh.getFieldDataByCondition("make left join craft on ma_craftcode=cr_code and ma_prodcode=cr_prodcode left join craftdetail on cr_id = cd_crid", "cd_nextstepcode", "ma_code='" + iMakeCode + "' and cd_stepcode='" + StepCode + "'").ToString();
-            if (iResult.Contains("批次通过"))
-            {
-                //更新执行的数量
-                sqls.Add("update makecraftdetail set mcd_inqty=mcd_inqty+" + batchqty + ",mcd_outqty = mcd_outqty + " + batchqty + ",mcd_okqty = mcd_okqty + " + batchqty + " where mcd_macode='" + iMakeCode + "' and mcd_stepcode='" + StepCode + "' ");
-                //更新makeSerial 的下一工序
-                sqls.Add("update makeserial set ms_paststep = ms_paststep || '," + StepCode + "',ms_stepcode='" + StepCode + "',ms_nextstepcode='" + nextstepcode + "' where ms_checkno='" + iCheckno + "' and ms_status<>3");
-            }
-            else
-            {
-                //更新执行的数量
-                sqls.Add("update makecraftdetail set mcd_inqty=mcd_inqty+1,mcd_outqty = mcd_outqty + 1,mcd_okqty = mcd_okqty + 1 where mcd_macode='" + iMakeCode + "' and mcd_stepcode='" + StepCode + "' ");
-                //更新makeSerial 的下一工序
-                sqls.Add("update makeserial set ms_paststep = ms_paststep || '," + StepCode + "',ms_stepcode='" + StepCode + "',ms_nextstepcode='" + nextstepcode + "' where ms_checkno='" + iCheckno + "' and ms_status<>3");
-            }
-            //更新序列号已经采集的工序 ms_paststep 已采集数据,更新下一工序
-            dh.ExecuteSQLTran(sqls.ToArray());
-            sqls.Clear();
-            //检测下道工序是否存在,不存在 更新状态为已完成
-            if (nextstepcode == null || nextstepcode == "")
-            {
-                if (iResult.Contains("批次通过"))
-                {
-                    sqls.Add("update make set ma_madeqty=ma_madeqty+" + batchqty + " where ma_code='" + iMakeCode + "'");
-                    sqls.Add("update makeserial set ms_status=2 where ms_checkno='" + iCheckno + "' and ms_status<>3");
-                }
-                else
-                {
-                    sqls.Add("update make set ma_madeqty=ma_madeqty+1  where ma_code='" + iMakeCode + "'");
-                    sqls.Add("update makeserial set ms_status=2 where ms_checkno='" + iCheckno + "' and ms_status<>3");
-                }
-                dh.ExecuteSQLTran(sqls.ToArray());
-                sqls.Clear();
-            }
-            return true;
-        }
+        //public static bool UpdateOQCMessage(string iSnCode, string iCheckno, string iMakeCode, string iMPKind, string iSourceCode, string iUserCode, string iResult, out string oErrorMessage)
+        //{
+        //    oErrorMessage = "";
+        //    string StepCode = "";
+        //    string StepName = "";
+        //    string LineCode = "";
+        //    if (iResult == "" || iResult == null)
+        //    {
+        //        iResult = "测试合格";
+        //    }
+        //    GetStepCodeAndNameAndLineBySource(iSourceCode, ref StepCode, ref StepName, ref LineCode);
+        //    //查询批次和批数量
+        //    string batchqty = dh.getFieldDataByCondition("oqcbatch", "ob_nowcheckqty", "ob_checkno='" + iCheckno + "'").ToString();
+        //    string nextstepcode = dh.getFieldDataByCondition("make left join craft on ma_craftcode=cr_code and ma_prodcode=cr_prodcode left join craftdetail on cr_id = cd_crid", "cd_nextstepcode", "ma_code='" + iMakeCode + "' and cd_stepcode='" + StepCode + "'").ToString();
+        //    if (iResult.Contains("批次通过"))
+        //    {
+        //        //更新执行的数量
+        //        sqls.Add("update makecraftdetail set mcd_inqty=mcd_inqty+" + batchqty + ",mcd_outqty = mcd_outqty + " + batchqty + ",mcd_okqty = mcd_okqty + " + batchqty + " where mcd_macode='" + iMakeCode + "' and mcd_stepcode='" + StepCode + "' ");
+        //        //更新makeSerial 的下一工序
+        //        sqls.Add("update makeserial set ms_paststep = ms_paststep || '," + StepCode + "',ms_stepcode='" + StepCode + "',ms_nextstepcode='" + nextstepcode + "' where ms_checkno='" + iCheckno + "' and ms_status<>3");
+        //    }
+        //    else
+        //    {
+        //        //更新执行的数量
+        //        sqls.Add("update makecraftdetail set mcd_inqty=mcd_inqty+1,mcd_outqty = mcd_outqty + 1,mcd_okqty = mcd_okqty + 1 where mcd_macode='" + iMakeCode + "' and mcd_stepcode='" + StepCode + "' ");
+        //        //更新makeSerial 的下一工序
+        //        sqls.Add("update makeserial set ms_paststep = ms_paststep || '," + StepCode + "',ms_stepcode='" + StepCode + "',ms_nextstepcode='" + nextstepcode + "' where ms_checkno='" + iCheckno + "' and ms_status<>3");
+        //    }
+        //    //更新序列号已经采集的工序 ms_paststep 已采集数据,更新下一工序
+        //    dh.ExecuteSQLTran(sqls.ToArray());
+        //    sqls.Clear();
+        //    //检测下道工序是否存在,不存在 更新状态为已完成
+        //    if (nextstepcode == null || nextstepcode == "")
+        //    {
+        //        if (iResult.Contains("批次通过"))
+        //        {
+        //            sqls.Add("update make set ma_madeqty=ma_madeqty+" + batchqty + " where ma_code='" + iMakeCode + "'");
+        //            sqls.Add("update makeserial set ms_status=2 where ms_checkno='" + iCheckno + "' and ms_status<>3");
+        //        }
+        //        else
+        //        {
+        //            sqls.Add("update make set ma_madeqty=ma_madeqty+1  where ma_code='" + iMakeCode + "'");
+        //            sqls.Add("update makeserial set ms_status=2 where ms_checkno='" + iCheckno + "' and ms_status<>3");
+        //        }
+        //        dh.ExecuteSQLTran(sqls.ToArray());
+        //        sqls.Clear();
+        //    }
+        //    return true;
+        //}
 
 
         /// <summary>
         /// <summary>
         /// 设置良品采集结果,iResult含有“批次通过”按抽检批次通过
         /// 设置良品采集结果,iResult含有“批次通过”按抽检批次通过