|
|
@@ -46,6 +46,8 @@ namespace UAS_MES.Make
|
|
|
|
|
|
string firstsn = "";
|
|
|
|
|
|
+ string ms_stepcode = "";
|
|
|
+
|
|
|
DataTable Dbfind;
|
|
|
|
|
|
public Make_Repair()
|
|
|
@@ -189,18 +191,19 @@ namespace UAS_MES.Make
|
|
|
{
|
|
|
BadInf_1.Clear();
|
|
|
string oStatus = "";
|
|
|
- if (LogicHandler.GetMakeInfo(GetSNCode.Text, out macode,out oStatus, out ErrorMessage))
|
|
|
+ if (LogicHandler.GetMakeInfo(GetSNCode.Text, out macode, out oStatus, out ErrorMessage))
|
|
|
{
|
|
|
//验证makeserial或者ms_firstsn表序列号是否存在
|
|
|
sql.Clear();
|
|
|
- sql.Append("select max(ms_id) ms_id,ms_makecode,ms_firstsn,ms_prodcode,ms_sncode,pr_detail,ms_stepcode,ms_craftcode,ms_checkno,ms_ifrework,ms_reworkcheckno ");
|
|
|
+ sql.Append("select max(ms_id) ms_id,ms_makecode,ms_stepcode,ms_firstsn,ms_prodcode,ms_sncode,pr_detail,ms_stepcode,ms_craftcode,ms_checkno,ms_ifrework,ms_reworkcheckno ");
|
|
|
sql.Append("from makeserial left join product on pr_code=ms_prodcode where ms_makecode ='" + macode + "' and(ms_sncode");
|
|
|
sql.Append("='" + GetSNCode.Text + "' or ms_firstsn in (select firstsn from makesnrelation where ");
|
|
|
- sql.Append("sn='" + GetSNCode.Text + "')) group by ms_makecode,ms_prodcode,ms_sncode,pr_detail,ms_firstsn,ms_stepcode,ms_craftcode,ms_checkno,ms_ifrework,ms_reworkcheckno");
|
|
|
+ sql.Append("sn='" + GetSNCode.Text + "')) group by ms_makecode,ms_stepcode,ms_prodcode,ms_sncode,pr_detail,ms_firstsn,ms_stepcode,ms_craftcode,ms_checkno,ms_ifrework,ms_reworkcheckno");
|
|
|
dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
msid = dt.Rows[0]["ms_id"].ToString();
|
|
|
+ ms_stepcode = dt.Rows[0]["ms_stepcode"].ToString();
|
|
|
BaseUtil.SetFormValue(this.Controls, dt);
|
|
|
//判断是否当前工单途程的上料记录
|
|
|
firstsn = dt.Rows[0]["ms_firstsn"].ToString();
|
|
|
@@ -392,9 +395,9 @@ namespace UAS_MES.Make
|
|
|
return;
|
|
|
}
|
|
|
//如果岗位资源对应工序的版面不为空的时候
|
|
|
- if (dh.getFieldDataByCondition("makeserial left join step on ms_stepcode=st_code", "st_table", "ms_id='" + msid+ "'").ToString() != "")
|
|
|
+ if (dh.getFieldDataByCondition("makeserial left join step on ms_stepcode=st_code", "st_table", "ms_id='" + msid + "'").ToString() != "")
|
|
|
{
|
|
|
- if (!dh.CheckExist("makebadrsloc", "mbl_mbrid='" + mbr_id + "' and mbl_makecode='"+ms_makecode.Text+"' and mbl_sncode='" + GetSNCode.Text + "' "))
|
|
|
+ if (!dh.CheckExist("makebadrsloc", "mbl_mbrid='" + mbr_id + "' and mbl_makecode='" + ms_makecode.Text + "' and mbl_sncode='" + GetSNCode.Text + "' "))
|
|
|
{
|
|
|
OperatResult.AppendText(">>工序存在版面必须维护不良位置\n", Color.Red);
|
|
|
return;
|
|
|
@@ -403,7 +406,7 @@ namespace UAS_MES.Make
|
|
|
//查询拆解的物料
|
|
|
sql.Clear();
|
|
|
sql.Append("select distinct cm_soncode from craftmaterial where (cm_sncode='" + firstsn + "' or cm_sncode ");
|
|
|
- sql.Append("in (select sn from makesnrelation where firstsn='" + firstsn + "')) and cm_craftcode<>'"+cr_code.Text+"' and cm_status=-1 ");
|
|
|
+ sql.Append("in (select sn from makesnrelation where firstsn='" + firstsn + "')) and cm_craftcode<>'" + cr_code.Text + "' and cm_status=-1 ");
|
|
|
dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
//如果含有序列号物料有被拆解过
|
|
|
if (dt.Rows.Count > 0)
|
|
|
@@ -502,6 +505,7 @@ namespace UAS_MES.Make
|
|
|
dh.ExecuteSQLTran(sqls.ToArray());
|
|
|
}
|
|
|
}
|
|
|
+ dh.UpdateByCondition("makecraftdetail", "mcd_inqty=mcd_inqty-1,mcd_outqty=mcd_outqty-1", "mcd_macode='" + ms_makecode.Text + "' and mcd_stepcode='" + ms_stepcode + "'");
|
|
|
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.DoCommandLog(Tag.ToString(), User.UserCode, macode, User.UserLineCode, User.UserSourceCode, "报废", "序列号报废", ms_sncode.Text, ms_checkno.Text);
|