|
|
@@ -454,6 +454,15 @@ namespace UAS_MES.PublicMethod
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
+ public static void DoCommandLog(string iUserCode,string iMakeCode,string iLineCode,string iSourceCode,string iOperate,string iResult,string iSncode,string iCheckno)
|
|
|
+ {
|
|
|
+ sql.Clear();
|
|
|
+ sql.Append("insert into commandlog(cl_id,cl_man,cl_date,cl_linecode,cl_sourcecode,cl_makecode,cl_operate,");
|
|
|
+ sql.Append("cl_result,cl_sncode,cl_code) values(commandlog_seq.nextval,'"+iUserCode+"',sysdate,'"+ iLineCode + "',");
|
|
|
+ sql.Append("'"+ iSourceCode + "','"+iMakeCode+"','"+iOperate+"','"+iResult+"','"+iSncode+"','"+ iCheckno + "')");
|
|
|
+ dh.ExecuteSql(sql.ToString(), "insert");
|
|
|
+ }
|
|
|
+
|
|
|
/// <summary>
|
|
|
/// 分配Mac地址和BT地址
|
|
|
/// </summary>
|
|
|
@@ -733,7 +742,7 @@ namespace UAS_MES.PublicMethod
|
|
|
break;
|
|
|
case "OQCPLANMAINTAIN":
|
|
|
sql.Clear();
|
|
|
- sql.Append("select ob_prodcode,ob_id,ob_checkno,ob_projectcode,ob_nowcheckqty,ob_source,ob_remark,");
|
|
|
+ sql.Append("select ob_prodcode,ob_maxngacceptqty,ob_id,ob_checkno,ob_projectcode,ob_nowcheckqty,ob_source,ob_remark,");
|
|
|
sql.Append("ob_status,pr_id,pr_detail,pr_kind,pr_manutype,pr_qualmethod,nvl(ob_aqlcode,pr_aql)ob_aqlcode from OQCBatch left join product on ");
|
|
|
sql.Append("pr_code=ob_prodcode where ob_checkno='" + iCheckNo + "'");
|
|
|
Form = (DataTable)dh.ExecuteSql(sql.ToString(), "select");
|
|
|
@@ -1030,8 +1039,27 @@ namespace UAS_MES.PublicMethod
|
|
|
//之前保存的不良就不再调用
|
|
|
if (ms_status != "3")
|
|
|
{
|
|
|
- dh.UpdateByCondition("makeserial", "ms_paststep = ms_paststep ||'," + StepCode + "',ms_status=3", "ms_sncode='" + iSnCode + "'");
|
|
|
- SetStepFinish(iMakeCode, iSourceCode, iSnCode, "不良采集", iResult, iUserCode, out oErrorMessage);
|
|
|
+ DataTable dt = dh.getFieldsDataByCondition("makeserial", new string[] { "ms_stepcode", "nvl(ms_ifrework,0)ms_ifrework" }, "ms_sncode='" + iSnCode + "'");
|
|
|
+ if (dt.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ 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;
|
|
|
}
|
|
|
@@ -1219,55 +1247,55 @@ namespace UAS_MES.PublicMethod
|
|
|
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>
|
|
|
/// 设置良品采集结果,iResult含有“批次通过”按抽检批次通过
|