Browse Source

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

Hcsy 8 years ago
parent
commit
f976cf41d8
2 changed files with 6 additions and 420 deletions
  1. 3 418
      MES接口/LogicHandler.cs
  2. 3 2
      UAS-MES/FunctionCode/Make/Make_TestCollection.cs

+ 3 - 418
MES接口/LogicHandler.cs

@@ -41,101 +41,6 @@ namespace MES_Interface
                 return false;
         }
 
-        /// <summary>
-        /// 判断工单是否已经下放
-        /// </summary>
-        /// <param name="iMaCode"></param>
-        /// <returns></returns>
-        public bool CheckMakeStatus(string iMaCode, out string ErrorMessage)
-        {
-            string ma_statuscode = dh.getFieldDataByCondition(" make ", "ma_statuscode", "ma_code='" + iMaCode + "' ").ToString();
-            ErrorMessage = "";
-            if (ma_statuscode == "")
-            {
-                ErrorMessage = "工单号" + iMaCode + "不存在";
-                return false;
-            }
-            if (ma_statuscode == "STARTED")
-                return true;
-            else
-            {
-                ErrorMessage = "工单必须是已下放状态";
-                return false;
-            }
-        }
-
-
-        /// <summary>
-        /// 判断下一工序是否是送检工序
-        /// </summary>
-        /// <returns></returns>
-        public bool CheckNextStepIfQC(string iSnCode, string iMakeCode, string iStepCode, string iCraftCode, string iUserName, out string oErrorMessage)
-        {
-            oErrorMessage = "";
-            string IfQC = dh.getFieldDataByCondition("craft left join  craftdetail on cd_crid=cr_id", "cd_ifoqc", "cr_code='" + iCraftCode + "' and cd_stepcode='" + iStepCode + "'").ToString();
-            if (IfQC != "0" && IfQC != "")
-            {
-                DataTable dt = dh.getFieldsDataByCondition("make left join product on ma_prodcode=pr_code", new string[] { "ma_nowcheckqty", "pr_qcbatchqty", "ma_checkno", "ma_prodcode", "pr_qualmethod" }, "ma_code='" + iMakeCode + "'");
-                if (dt.Rows.Count > 0)
-                {
-                    string ma_nowcheckqty = dt.Rows[0]["ma_nowcheckqty"].ToString();
-                    string pr_qcbatchqty = dt.Rows[0]["pr_qcbatchqty"].ToString();
-                    string ma_checkno = dt.Rows[0]["ma_checkno"].ToString();
-                    string ma_prodcode = dt.Rows[0]["ma_prodcode"].ToString();
-                    string pr_qualmethod = dt.Rows[0]["pr_qualmethod"].ToString();
-                    if (pr_qcbatchqty != "" && pr_qcbatchqty != "0")
-                    {
-                        //当前批次的送检批数量大于物料资料中的抽检批数或者当前批次编号为空
-                        string checkno = "";
-                        if (int.Parse(ma_nowcheckqty == "" ? "0" : ma_nowcheckqty) >= int.Parse(pr_qcbatchqty) || ma_checkno == "")
-                        {
-                            //原有的抽检批次插入OQCBatch
-                            string ob_id = dh.GetSEQ("OQCBatch_SEQ");
-                            checkno = dh.GetSerialNumberByCaller("Make!CheckQC");
-                            sql.Clear();
-                            sql.Append("insert into OQCBatch  (ob_id, ob_checkno,ob_makecode,ob_source,ob_indate,ob_checkman,ob_batchqty,ob_status,ob_prodcode,ob_projectcode)");
-                            sql.Append(" values('" + ob_id + "','" + checkno + "','" + iMakeCode + "', '工序',sysdate, '" + iUserName + "','" + ma_nowcheckqty + "','UNCHECK','" + ma_prodcode + "','" + pr_qualmethod + "')");
-                            sqls.Add(sql.ToString());
-                            sqls.Add("update makeserial set ms_checkno='" + checkno + "' where ms_makecode='" + iMakeCode + "' and ms_sncode='" + iSnCode + "'");
-                            sqls.Add("update make set ma_checkno='" + checkno + "',ma_nowcheckqty=1 where ma_code='" + iMakeCode + "'");
-                        }
-                        else
-                        {
-                            sqls.Add("update makeserial set ms_checkno='" + ma_checkno + "' where ms_makecode='" + iMakeCode + "' and ms_sncode='" + iSnCode + "'");
-                            sqls.Add("update make set ma_nowcheckqty= ma_nowcheckqty+1  where ma_code='" + iMakeCode + "'");
-                        }
-                        dh.ExecuteSQLTran(sqls.ToArray());
-                        sqls.Clear();
-                        //如果制造单的ma_checkno没有值则新加入一个值
-                        string checkno1 = checkno == "" ? ma_checkno : checkno;
-                        string obd_obid = dh.getFieldDataByCondition("oqcbatch", "ob_id", "ob_checkno='" + checkno1 + "'").ToString();
-                        //插入抽检批次明细表
-                        sql.Clear();
-                        sql.Append("insert into OQCBatchDetail (obd_id,obd_obid,obd_sncode,obd_outboxcode,obd_makecode,obd_checkno,obd_builddate) ");
-                        sql.Append("select OQCBatchDetail_SEQ.nextval,'" + obd_obid + "',ms_sncode,ms_outboxcode,ms_makecode,ms_checkno,");
-                        sql.Append("sysdate from makeserial where  ms_sncode='" + iSnCode + "' and ms_makecode='" + iMakeCode + "'");
-                        dh.ExecuteSql(sql.ToString(), "insert");
-                        return true;
-                    }
-                    else
-                    {
-                        oErrorMessage = "请维护物料资料的抽检批数";
-                        return false;
-                    }
-                }
-                else
-                {
-                    oErrorMessage = "制造单号不存在";
-                    return false;
-                }
-            }
-            else
-            {
-                oErrorMessage = "当前工序的下一工序不是OQC检测";
-                return false;
-            }
-        }
-
         /// <summary>
         /// 验证用户身份信息
         /// </summary>
@@ -157,14 +62,6 @@ namespace MES_Interface
             }
         }
 
-        /// <summary>
-        /// 记录登陆信息
-        /// </summary>
-        public void RecordLogInfo(string iUserCode, string iUserName, string iVersion, string iType, string iIP)
-        {
-            dh.ExecuteSql("insert into LogInfo(id,sip,usname,indate,uscode,versioncode,terminaltype) values (LogInfo_seq.nextval,'" + iIP + "','" + iUserName + "',sysdate,'" + iUserCode + "','" + iVersion + "','" + iType + "')", "insert");
-        }
-
         /// <summary>
         /// 验证用户身份信息和岗位资源
         /// </summary>
@@ -428,7 +325,6 @@ namespace MES_Interface
             }
         }
 
-
         /// <summary>
         /// 记录操作日志
         /// </summary>
@@ -437,7 +333,7 @@ namespace MES_Interface
         /// <param name="iMPKind"></param>
         /// <param name="result"></param>
         /// <param name="iUserCode"></param>
-        public void InsertMakeProcess(string iSnCode, string iMakeCode, string iSourceCode, string iMPKind, string result, string iUserCode)
+        private void InsertMakeProcess(string iSnCode, string iMakeCode, string iSourceCode, string iMPKind, string result, string iUserCode)
         {
             string CurrentStep = "";
             string LineCode = "";
@@ -453,22 +349,6 @@ namespace MES_Interface
             dh.ExecuteSql(sql.ToString(), "insert");
         }
 
-        /// <summary>
-        /// 记录一般操作日志
-        /// </summary>
-        /// <param name="inMan"></param>
-        /// <param name="Content"></param>
-        /// <param name="Result"></param>
-        /// <param name="Search"></param>
-        /// <param name="Code"></param>
-        public void InsertMessageLog(string inMan, string Content, string Result, string Search, string Code)
-        {
-            sql.Clear();
-            sql.Append("insert into messagelog (ml_id,ml_date,ml_man,ml_content,ml_result,ml_search,code) ");
-            sql.Append("values (messagelog_seq.nextval,sysdate,'" + inMan + "','" + Content + "','" + Result + "','" + Search + "','" + Code + "')");
-            dh.ExecuteSql(sql.ToString(), "insert");
-        }
-
         /// <summary>
         /// 保存Mac地址和BT地址
         /// </summary>
@@ -492,7 +372,7 @@ namespace MES_Interface
                 return false;
         }
 
-        public bool SetStepFinish(string iMakeCode, string iSourceCode, string iSN, string iMPKind, string iResult, string iUserCode, out string oErrorMessage)
+        private bool SetStepFinish(string iMakeCode, string iSourceCode, string iSN, string iMPKind, string iResult, string iUserCode, out string oErrorMessage)
         {
             oErrorMessage = "";
             string StepCode = dh.getFieldDataByCondition("Makeserial", "ms_stepcode", "ms_sncode='" + iSN + "'").ToString();
@@ -524,7 +404,7 @@ namespace MES_Interface
             return SetStepFinish(iMakeCode, iSourceCode, iSN, iMPKind, iResult, iUserCode, out oErrorMessage);
         }
 
-        public bool CS_SetFinish(string iMakeCode, string iSourceCode, string iSN, string iUserCode, out string oErrorMessage)
+        private bool CS_SetFinish(string iMakeCode, string iSourceCode, string iSN, string iUserCode, out string oErrorMessage)
         {
             oErrorMessage = "";
             string[] param = new string[] { iMakeCode, iSourceCode, iSN, iUserCode, oErrorMessage };
@@ -596,301 +476,6 @@ namespace MES_Interface
                 return false;
         }
 
-        /// <summary>
-        /// 执行不良信息采集
-        /// </summary>
-        /// <param name="iSnCode"></param>
-        /// <param name="iMakeCode"></param>
-        /// <param name="iUserCode"></param>
-        /// <param name="iSourceCode"></param>
-        /// <param name="iBadCode"></param>
-        /// <param name="iBadRemark"></param>
-        /// <param name="oErrorMessage"></param>
-        /// <returns></returns>
-        public bool SetTestNGDetail(string iSnCode, string iMakeCode, string iUserCode, string iSourceCode, string iResult, string[] iBadGroupCode, string[] iBadCode, string[] iBadRemark, out string oErrorMessage)
-        {
-            oErrorMessage = "";
-            string StepCode = "";
-            string StepName = "";
-            if (iResult == "" || iResult == null)
-                iResult = "检查未通过";
-            GetStepCodeAndNameBySource(iSourceCode, ref StepCode, ref StepName);
-            string ms_status = dh.getFieldDataByCondition("makeserial", "ms_status", "ms_sncode='" + iSnCode + "'").ToString();
-            sql.Clear();
-            sql.Append("insert into makebad(mb_id,mb_makecode,mb_mscode,mb_sncode,mb_inman,mb_indate,mb_stepcode");
-            sql.Append(",mb_sourcecode,mb_badcode,mb_bgcode,mb_badtable,mb_soncode,mb_status,mb_badremark)");
-            sql.Append("select makebad_seq.nextval,ma_code,ms_code,ms_sncode,'" + iUserCode + "',sysdate,'" + StepCode + "',ms_sourcecode,:bc_code,:bg_code,'',");
-            sql.Append("sp_soncode,'0',:bc_remark from make left join makeSerial on ms_makecode=ma_code left join stepProduct on ");
-            sql.Append("sp_mothercode=ma_prodcode and sp_stepcode=ms_nextstepcode where ms_sncode='" + iSnCode + "'");
-            dh.BatchInsert(sql.ToString(), new string[] { "bc_code", "bg_code", "bc_remark" }, iBadCode, iBadGroupCode, iBadRemark);
-            //更新序列号已经采集的工序 ms_paststep 已采集数据,更新下一工序
-            dh.UpdateByCondition("makeserial", "ms_paststep = ms_paststep ||'," + StepCode + "',ms_status=3,ms_badtimes=ms_badtimes+1", "ms_sncode='" + iSnCode + "'");
-            //如果存在送检批号则进行删除
-            if (dh.CheckExist("oqcbatchdetail", "obd_sncode='" + iSnCode + "'"))
-            {
-                string checkno = dh.getFieldDataByCondition("oqcbatchdetail", "obd_checkno", "obd_sncode='" + iSnCode + "'").ToString();
-                dh.ExecuteSql("delete from oqcbatchdetail where obd_sncode='" + iSnCode + "'", "delete");
-                dh.ExecuteSql("update oqcbatch set ob_nowcheckqty=ob_nowcheckqty-1 where ob_checkno='" + checkno + "'", "update");
-            }
-            //之前保存的不良就不再调用
-            if (ms_status != "3")
-                SetStepFinish(iMakeCode, iSourceCode, iSnCode, "不良采集", iResult, iUserCode, out oErrorMessage);
-            return true;
-        }
-
-        /// <summary>
-        /// 判断是否扣料工序,执行扣料,执行上料表记录
-        /// </summary>
-        /// <param name="iSnCode"></param>
-        /// <param name="iMakeCode"></param>
-        /// <param name="iUserName"></param>
-        /// <param name="iSourceCode"></param>
-        public bool SetCollectionFinish(string iSnCode, string iMakeCode, string iUserName, string iSourceCode, out string oErrorMessage)
-        {
-            string StepCode = "";
-            string StepName = "";
-            string LineCode = "";
-            oErrorMessage = "";
-            GetStepCodeAndNameAndLineBySource(iSourceCode, ref StepCode, ref StepName, ref LineCode);
-            if (StepCode == "" && StepName == "")
-            {
-                oErrorMessage = "当前岗位资源找不到对应工序,请先进行维护";
-                return false;
-            }
-            sql.Clear();
-            sql.Append("select nvl(cd_ifreduce,0) cd_ifreduce from craft left join craftdetail on cd_crid=cr_id ");
-            sql.Append("where cr_code=(select ma_craftcode  from makeserial left join make on ma_code = ms_makecode ");
-            sql.Append("where ms_sncode = '" + iSnCode + "') and cd_stepcode='" + StepCode + "'");
-            DataTable dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
-            sql.Clear();
-            if (dt.Rows.Count > 0)
-            {
-                string cd_ifreduce = dt.Rows[0][0].ToString();
-                if (cd_ifreduce == "-1")
-                {
-                    sql.Clear();
-                    sql.Append("select dsl_location,dsl_table,max(dsl_baseqty) baseqty from devsmtlocation where dsl_makecode='" + iMakeCode + "' and ");
-                    sql.Append("dsl_linecode='" + LineCode + "' and dsl_status=0 and dsl_remainqty>0 and dsl_invalidtime is null group by dsl_location,dsl_table");
-                    dt = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
-                    for (int i = 0; i < dt.Rows.Count; i++)
-                    {
-                        sql.Clear();
-                        sql.Append("select dsl_id,dsl_remainqty from devsmtlocation where dsl_makecode='" + iMakeCode + "' and dsl_linecode='" + LineCode + "' ");
-                        sql.Append("and dsl_status=0 and dsl_remainqty>0 and dsl_invalidtime is null and rownum<3 order by dsl_id asc ");
-                        DataTable dt1 = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
-                        for (int j = 0; j < dt1.Rows.Count; j++)
-                        {
-                            //外层循环的值dt
-                            double baseqty = (double)dt.Rows[i]["baseqty"];
-                            //内层循环的值dt1
-                            double dsl_remainqty = (double)dt1.Rows[j]["dsl_remainqty"];
-                            string dsl_id = dt1.Rows[j]["dsl_id"].ToString();
-                            if (baseqty > 0)
-                            {
-                                if (dsl_remainqty <= baseqty)
-                                {
-                                    sql.Clear();
-                                    sql.Append("update devsmtlocation set dsl_remainqty=0,dsl_invalidtime =sysdate, dsl_validtime =(case when dsl_validtime ");
-                                    sql.Append("is null then sysdate else  dsl_validtime end),dsl_status=-1 where dsl_id=" + dsl_id);
-                                    dh.ExecuteSql(sql.ToString(), "update");
-                                    baseqty -= dsl_remainqty;
-                                }
-                                else
-                                {
-                                    sql.Clear();
-                                    sql.Append("update devsmtlocation set dsl_remainqty=dsl_remainqty-NVL(dsl_baseqty,0),DSL_INVALIDTIME=(case when");
-                                    sql.Append("dsl_validtime is null then sysdate else dsl_validtime end) where dsl_id=" + dsl_id);
-                                    dh.ExecuteSql(sql.ToString(), "update");
-                                    baseqty = 0;
-                                }
-                            }
-                            else
-                                dh.ExecuteSql("update devsmtlocation set DSL_INVALIDTIME=sysdate where dsl_id=" + dsl_id, "update");
-                        }
-                    }
-                    sql.Clear();
-                    sql.Append("insert into ReduceStepRecord (rsd_id,rsd_macode,rsd_maprodcode,rsd_table,rsd_sncode,rsd_linecode,rsd_sourcecode) select ");
-                    sql.Append("ReduceStepRecord_SEQ.nextval,'" + iMakeCode + "',ma_prodcode,'','" + iSnCode + "','" + LineCode + "','" + iSourceCode + "' ");
-                    sql.Append("from make where ma_code='" + iMakeCode + "'");
-                    dh.ExecuteSql(sql.ToString(), "insert");
-                }
-                return true;
-            }
-            else
-            {
-                return false;
-            }
-        }
-
-        /// <summary>
-        /// 上料采集
-        /// </summary>
-        /// <param name="iSnCode"></param>
-        /// <param name="iMakeCode"></param>
-        /// <param name="iBarcode"></param>
-        /// <param name="iSonCode"></param>
-        /// <param name="iSourceCode"></param>
-        /// <param name="iUserName"></param>
-        /// <param name="iSonID"></param>
-        /// <param name="iType"></param>
-        /// <param name="oErrorMessage"></param>
-        /// <returns></returns>
-        public bool SetMaterialUp(string iSnCode, string iMakeCode, string iBarcode, string iSonCode, string iSourceCode, string iUserName, string iSonID, out string oErrorMessage)
-        {
-            oErrorMessage = "";
-            string StepCode = "";
-            string StepName = "";
-            string iRemainQty = dh.getFieldDataByCondition("barcode", "bar_remain", "bar_code='" + iBarcode + "'").ToString();
-            GetStepCodeAndNameBySource(iSourceCode, ref StepCode, ref StepName);
-            DataTable dt = (DataTable)dh.ExecuteSql("select cm_id from craftmaterial  where cm_sncode='" + iSnCode + "' and cm_barcode='" + iBarcode + "' and cm_soncode='" + iSonCode + "'", "select");
-            if (dt.Rows.Count > 0)
-            {
-                oErrorMessage = "条码已经上料";
-                return false;
-            }
-            else
-            {
-                sql.Clear();
-                sql.Append("insert into Craftmaterial (cm_id ,cm_makecode,cm_maid,cm_maprodcode, cm_soncode, cm_mscode, cm_sncode, cm_stepcode, cm_stepname,");
-                sql.Append("cm_craftcode,cm_craftname,cm_barcode,cm_inqty,cm_indate,cm_inman,cm_linecode,cm_wccode,cm_sourcecode,cm_spid)");
-                sql.Append("select Craftmaterial_seq.nextval, ma_code, ma_id, ma_prodcode, sp_soncode,ms_code,ms_sncode,mcd_stepcode,");
-                sql.Append("mcd_stepname,ma_craftcode,ma_craftname,'" + iBarcode + "',1,sysdate,'" + iUserName + "',ma_linecode,ma_wccode,");
-                sql.Append("'" + iSourceCode + "','" + iSonID + "' from make left join makecraftdetail on mcd_macode=ma_code  left join stepproduct on sp_stepcode=mcd_stepcode ");
-                sql.Append("and sp_craftcode=ma_craftcode and sp_mothercode = ma_prodcode left join makeserial on ms_makecode=ma_code ");
-                sql.Append("where ma_code='" + iMakeCode + "'and sp_id=" + iSonID + " and mcd_stepcode = '" + StepCode + "' and ms_sncode='" + iSnCode + "'");
-                dh.ExecuteSql(sql.ToString(), "insert");
-                return true;
-            }
-        }
-
-        /// <summary>
-        /// 执行下料操作
-        /// </summary>
-        /// <param name="iSnCode"></param>
-        /// <param name="iBarCode"></param>
-        /// <param name="iCurrentStep"></param>
-        /// <param name="iUserName"></param>
-        /// <param name="oErrorMessage"></param>
-        /// <returns></returns>
-        public bool SetMaterialDown(string iSnCode, string iBarCode, string iSourceCode, string iCurrentStep, string iUserName, out string oErrorMessage)
-        {
-            //序列号不为空的时候
-            oErrorMessage = "";
-            DataTable dt;
-            //对序列号进行验证
-            dt = (DataTable)dh.ExecuteSql("select  ms_status,ms_stepcode,ms_nextstepcode  from  makeserial  where  ms_sncode='" + iBarCode + "'", "select");
-            if (dt.Rows.Count > 0)
-            {
-                string ms_status = dt.Rows[0]["ms_status"].ToString();
-                string ms_stepcode = dt.Rows[0]["ms_stepcode"].ToString();
-                string ms_nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
-                if (ms_status == "1" && ms_stepcode != iCurrentStep)
-                    oErrorMessage = "当前工序不是" + iCurrentStep + "\n";
-                else if (ms_status == "0" && ms_stepcode != iCurrentStep)
-                    oErrorMessage = "当前工序不是" + iCurrentStep + "";
-                else if (ms_status == "2" && ms_nextstepcode != iCurrentStep)
-                    oErrorMessage = "该序列号已经包装";
-                else
-                {
-                    dt = (DataTable)dh.ExecuteSql("select * from craftmaterial where cm_sncode='" + iSnCode + "'", "select");
-                    if (dt.Rows.Count > 0)
-                        oErrorMessage = "请采集需要下料的序列号";
-                    else
-                        oErrorMessage = "该序列号未上料,无需下料";
-                }
-            }
-
-            if (oErrorMessage == "")
-            {
-                dt = (DataTable)dh.ExecuteSql("select cm_id,cm_stepcode,ms_makecode,cm_mccode from craftmaterial left join makeserial on cm_makecode=ms_makecode and cm_sncode=ms_sncode where ms_sncode='" + iSnCode + "' and cm_barcode='" + iBarCode + "'", "select");
-                if (dt.Rows.Count > 0)
-                {
-                    string cm_id = dt.Rows[0]["cm_id"].ToString();
-                    string ms_macode = dt.Rows[0]["ms_makecode"].ToString();
-                    string cm_stepcode = dt.Rows[0]["cm_stepcode"].ToString();
-                    string cm_mccode = dt.Rows[0]["cm_mccode"].ToString();
-                    dh.ExecuteSql("delete from Craftmaterial where cm_id=" + cm_id, "delete");
-                    InsertMakeProcess(ms_macode, iSnCode, iSourceCode, "下料操作", "下料成功", iUserName);
-                    int count = dh.getRowCount("craftMaterial", "cm_mccode='" + cm_mccode + "' and cm_stepcode='" + cm_stepcode + "' and cm_sncode='" + iSnCode + "'");
-                    if (count == 0)
-                        dh.UpdateByCondition("makecraftdetail ", "mcd_inqty=mcd_inqty-1,mcd_outqty=mcd_outqty-1,mcd_okqty = mcd_okqty - 1", "mcd_mccode='" + cm_mccode + "' and mcd_stepcode='" + cm_stepcode + "'");
-                }
-                return true;
-            }
-            else
-                return false;
-        }
-
-        public 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);
-            //查询批次和批数量
-            int batchqty = 0;
-            DataTable dt = (DataTable)dh.ExecuteSql("select count(ms_checkno) count,ms_checkno from makeserial where ms_checkno='" + iCheckno + "' group by ms_checkno", "select");
-            if (dt.Rows.Count > 0)
-            {
-                batchqty = int.Parse(dt.Rows[0]["count"].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("批次通过") && dt.Rows.Count > 0)
-            {
-                //更新执行的数量
-                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 + "'");
-            }
-            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_sncode='" + iSnCode + "' and ms_makecode='" + iMakeCode + "'");
-            }
-            //更新序列号已经采集的工序 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 + "'");
-                }
-                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_sncode='" + iSnCode + "'");
-                }
-                dh.ExecuteSQLTran(sqls.ToArray());
-                sqls.Clear();
-            }
-            return true;
-        }
-
-        /// <summary>
-        /// 设置良品采集结果,iResult含有“批次通过”按抽检批次通过
-        /// </summary>
-        /// <param name="iSnCode"></param>
-        /// <param name="iMakeCode"></param>
-        /// <param name="iSourceCode"></param>
-        /// <param name="iUserName"></param>
-        /// <param name="iResult"></param>
-        /// <param name="oErrorMessage"></param>
-        /// <returns></returns>
-        public bool UpdateMakeMessage(string iSnCode, string iMakeCode, string iMPKind, string iSourceCode, string iUserCode, string iResult, out string oErrorMessage)
-        {
-            return SetStepFinish(iMakeCode, iSourceCode, iSnCode, iMPKind, iResult, iUserCode, out oErrorMessage);
-        }
-
         /// <summary>
         /// 获取执行步骤代码,名称和线别
         /// </summary>

+ 3 - 2
UAS-MES/FunctionCode/Make/Make_TestCollection.cs

@@ -321,7 +321,7 @@ namespace UAS_MES.Make
                     LastSncode = ms_sncode.Text;
                     OperateResult.AppendText(">>" + ms_sncode.Text + "已采集为良品\n", Color.Green, ms_sncode);
                     //记录操作日志
-                    LogicHandler.DoCommandLog(User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "采集良品", "采集良品成功", ms_sncode.Text, ob_checkno.Text);
+                    LogicHandler.DoCommandLog(User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "采集良品", "采集良品成功", LastSncode, ob_checkno.Text);
                 }
                 else
                     OperateResult.AppendText(">>" + ErrorMessage + "\n", Color.Red, ms_sncode);
@@ -418,9 +418,10 @@ namespace UAS_MES.Make
                 if (LogicHandler.SetTestNGDetail(ms_sncode.Text, ma_code.Text, User.UserCode, User.UserSourceCode, "检查未通过", bgcode, bccode, bcremark, out ErrorMessage))
                 {
                     LastSncode = ms_sncode.Text;
-                    OperateResult.AppendText(">>" + ms_sncode.Text + "已采集为不良\n", Color.Green, ms_sncode);
+                    OperateResult.AppendText(">>" + ms_sncode.Text + "已采集为不良\n", Color.Green);
                     //记录操作日志
                     LogicHandler.DoCommandLog(User.UserCode, ma_code.Text, User.UserLineCode, User.UserSourceCode, "采集不良", "采集不良成功", ms_sncode.Text, ob_checkno.Text);
+                    ms_sncode.Text = "";
                     //清除不良信息
                     bc_code.Text = "";
                     ChoosedRejectList.Items.Clear();