|
@@ -519,16 +519,24 @@ namespace UAS_MES.PublicMethod
|
|
|
|
|
|
public static void CartonBoxStepPass(string iMakeCode, string iSourceCode, string iCartonBox, string iUserCode, string iResult, out string oErrorMessage)
|
|
|
{
|
|
|
- DataTable dt = (DataTable)dh.ExecuteSql("select ms_status,V_BARCODE,V_MAKECODE from mes_package_view left join makeserial on V_MAKECODE=ms_makecode and v_barcode = ms_sncode where V_OUTBOXCODE='" + iCartonBox + "'", "select");
|
|
|
+ DataTable dt = (DataTable)dh.ExecuteSql("select ms_status,V_BARCODE,V_MAKECODE,ms_craftcode,ms_prodcode from mes_package_view left join makeserial on V_MAKECODE=ms_makecode and v_barcode = ms_sncode where V_OUTBOXCODE='" + iCartonBox + "'", "select");
|
|
|
+ //获取当前资源的工序
|
|
|
+ string stepcode = dh.getFieldDataByCondition("source", "sc_stepcode", "sc_code='" + iSourceCode + "'").ToString();
|
|
|
+ string Prcode = dt.Rows[0]["ms_prodcode"].ToString();
|
|
|
+ string Craftcode = dt.Rows[0]["ms_craftcode"].ToString();
|
|
|
+ string ifoqc = dh.getFieldDataByCondition("craft left join craftdetail on cd_crid=cr_id", "nvl(cd_ifoqc) cd_ifoqc", "cr_prodcode='" + Prcode + "' and cr_code='" + Craftcode + "' and cd_stepcode='" + stepcode + "'").ToString();
|
|
|
oErrorMessage = "";
|
|
|
- for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
+ if (ifoqc == "0")
|
|
|
{
|
|
|
- string ms_status = dt.Rows[i]["ms_status"].ToString();
|
|
|
- string sn = dt.Rows[i]["V_BARCODE"].ToString();
|
|
|
- string makecode = dt.Rows[i]["V_MAKECODE"].ToString();
|
|
|
- if (ms_status != "2")
|
|
|
+ for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
{
|
|
|
- CS_SetResult(makecode, iSourceCode, sn, iUserCode, iResult, out oErrorMessage);
|
|
|
+ string ms_status = dt.Rows[i]["ms_status"].ToString();
|
|
|
+ string sn = dt.Rows[i]["V_BARCODE"].ToString();
|
|
|
+ string makecode = dt.Rows[i]["V_MAKECODE"].ToString();
|
|
|
+ if (ms_status != "2")
|
|
|
+ {
|
|
|
+ CS_SetResult(makecode, iSourceCode, sn, iUserCode, iResult, out oErrorMessage);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -639,7 +647,7 @@ namespace UAS_MES.PublicMethod
|
|
|
GetStepCodeAndNameAndLineBySource(iSourceCode, ref CurrentStep, ref CurrentStepName, ref LineCode);
|
|
|
//更新工序会上一执行步骤
|
|
|
sql.Clear();
|
|
|
- sql.Append("merge into makeserial using mes_package_view on (v_outboxcode='"+ iOutBoxCode + "' and ms_sncode=");
|
|
|
+ sql.Append("merge into makeserial using mes_package_view on (v_outboxcode='" + iOutBoxCode + "' and ms_sncode=");
|
|
|
sql.Append("v_barcode and ms_makecode=v_makecode) when matched then update set ms_nextstepcode=ms_stepcode");
|
|
|
sql.Append(",ms_status=1,ms_sccode='" + iSourceCode + "' ");
|
|
|
ExeSQL.Add(sql.ToString());
|
|
@@ -1315,14 +1323,14 @@ namespace UAS_MES.PublicMethod
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
- public static void RecordProdWeight(string iSN, string iType,float iWeight, string iUnit, string iLineCode, string iPrCode, string iSource, string iUser)
|
|
|
+ public static void RecordProdWeight(string iSN, string iType, float iWeight, string iUnit, string iLineCode, string iPrCode, string iSource, string iUser)
|
|
|
{
|
|
|
//记录重量
|
|
|
sql.Clear();
|
|
|
sql.Append("insert into weightlog(wl_id,wl_type,wl_scancode,wl_weight,wl_unit,wl_linecode,");
|
|
|
sql.Append("wl_prodcode,wl_sccode,wl_indate,wl_inman) values (weightlog_seq.nextval,:wl_type,:wl_scancode,");
|
|
|
sql.Append(":wl_weight,:wl_unit,:wl_linecode,:wl_prodcode,:wl_sccode,sysdate,:wl_inman)");
|
|
|
- dh.ExecuteSql(sql.ToString(), "insert", iType , iSN , iWeight ,iUnit ,iLineCode , iPrCode , iSource , iUser);
|
|
|
+ dh.ExecuteSql(sql.ToString(), "insert", iType, iSN, iWeight, iUnit, iLineCode, iPrCode, iSource, iUser);
|
|
|
}
|
|
|
|
|
|
|