|
|
@@ -189,7 +189,7 @@ namespace UAS_MES_NEW.OQC
|
|
|
}
|
|
|
StringBuilder sql = new StringBuilder();
|
|
|
sql.Append("update craftmaterial set cm_status=-1,CM_DROPMAN='" + User.UserName + "' where cm_stepcode in (select cd_stepcode from craft left join ");
|
|
|
- sql.Append("craftdetail on cd_crid = cr_id where cr_prodcode = '" + ms_prodcode + "' and cd_detno >= " + stepno + ") ");
|
|
|
+ sql.Append("craftdetail on cd_crid = cr_id where cr_prodcode = '" + ms_prodcode.Text + "' and cd_detno >= " + stepno + ") ");
|
|
|
sql.Append("and cm_sncode='" + ms_sncode.Text + "' and cm_makecode='" + oMakeCode + "'");
|
|
|
dh.ExecuteSql(sql.ToString(), "update");
|
|
|
dh.ExecuteSql("update makeserial set MS_IFQCCHECK=0,ms_nextstepcode='" + pcd_okretuenstep + "' where ms_id='" + oMSID + "'", "select");
|
|
|
@@ -206,9 +206,26 @@ namespace UAS_MES_NEW.OQC
|
|
|
dh.ExecuteSql("delete from steppassed where sp_sncode='" + ms_sncode.Text + "' and sp_makecode='" + oMakeCode + "'", "delete");
|
|
|
dh.ExecuteSql("update craftmaterial set cm_status=-1 where cm_sncode='" + ms_sncode.Text + "' and cm_makecode='" + oMakeCode + "'", "update");
|
|
|
dh.ExecuteSql("update makecraftdetail set mcd_inqty=mcd_inqty-1,mcd_outqty=mcd_outqty-1,mcd_okqty=mcd_okqty-1 where mcd_macode='" + oMakeCode + "' and instr((select ms_paststep from makeserial where ms_id='" + oMSID + "'),mcd_stepcode)>0 ", "update");
|
|
|
- string ms_id = dh.getFieldDataByCondition("makeserial", "max(ms_id)", "ms_sncode='" + ms_sncode.Text + "'").ToString();
|
|
|
//dh.ExecuteSql("update makeserial set ms_nextmacode='',ms_nextstepcode='" + pcd_ngretuenstep + "',ms_status=1 where ms_id='" + ms_id + "'", "update");
|
|
|
- dh.ExecuteSql("update makeserial set ms_nextmacode='',ms_nextstepcode='"+ pcd_okretuenstep + "',ms_status=1 where ms_id='" + ms_id + "'", "update");
|
|
|
+ dt = (DataTable)dh.ExecuteSql("select ms_id,ms_craftcode,ms_prodcode,ms_makecode from makeserial where ms_sncode='" + ms_sncode.Text + "' order by ms_id", "select");
|
|
|
+ if (dt.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ string ms_id = dt.Rows[0]["ms_id"].ToString();
|
|
|
+ string ms_prodcode = dt.Rows[0]["ms_prodcode"].ToString();
|
|
|
+ string ms_makecode = dt.Rows[0]["ms_makecode"].ToString();
|
|
|
+ dh.ExecuteSql("update makeserial set ms_nextmacode='',ms_nextstepcode='" + pcd_okretuenstep + "',ms_status=1 where ms_id='" + ms_id + "'", "update");
|
|
|
+ string stepno = dh.getFieldDataByCondition("makeserial left join craft on cr_code=ms_craftcode and ms_prodcode=cr_prodcode left join craftdetail on cd_crid=cr_id", "cd_stepno", "ms_id='" + ms_id + "' and cd_stepcode='" + pcd_okretuenstep + "'").ToString();
|
|
|
+ if (stepno == "")
|
|
|
+ {
|
|
|
+ stepno = "100";
|
|
|
+ }
|
|
|
+ StringBuilder sql = new StringBuilder();
|
|
|
+ sql.Append("update craftmaterial set cm_status=-1,CM_DROPMAN='" + User.UserName + "' where cm_stepcode in (select cd_stepcode from craft left join ");
|
|
|
+ sql.Append("craftdetail on cd_crid = cr_id where cr_prodcode = '" + ms_prodcode + "' and cd_detno >= " + stepno + ") ");
|
|
|
+ sql.Append("and cm_sncode='" + ms_sncode.Text + "' and cm_makecode='" + ms_makecode + "'");
|
|
|
+ dh.ExecuteSql(sql.ToString(), "update");
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
dh.ExecuteSql("update makeserial set MS_IFQCCHECK=0 where ms_id='" + oMSID + "'", "select");
|
|
|
@@ -251,20 +268,20 @@ namespace UAS_MES_NEW.OQC
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
string ms_craftcode=dt.Rows[0]["ms_craftcode"].ToString();
|
|
|
- if (pcd_okretuenstep == "")
|
|
|
+ if (pcd_ngretuenstep == "")
|
|
|
{
|
|
|
OperateResult.AppendText(">>回流工序为空,不允许回流\n", Color.Red, ms_sncode);
|
|
|
return;
|
|
|
}
|
|
|
if (pcd_ngretuenstep != "")
|
|
|
{
|
|
|
- string stepno = dh.getFieldDataByCondition("craft left join craftdetail on cd_crid=cr_id", "cd_stepno", "cr_prodcode='" + ms_prodcode.Text + "' and cr_code='" + ms_craftcode + "' and cd_stepcode='" + pcd_okretuenstep + "'").ToString();
|
|
|
+ string stepno = dh.getFieldDataByCondition("craft left join craftdetail on cd_crid=cr_id", "cd_stepno", "cr_prodcode='" + ms_prodcode.Text + "' and cr_code='" + ms_craftcode + "' and cd_stepcode='" + pcd_ngretuenstep + "'").ToString();
|
|
|
if (stepno == "") {
|
|
|
stepno = "100";
|
|
|
}
|
|
|
StringBuilder sql = new StringBuilder();
|
|
|
sql.Append("update craftmaterial set cm_status=-1,CM_DROPMAN='" + User.UserName + "' where cm_stepcode in (select cd_stepcode from craft left join ");
|
|
|
- sql.Append("craftdetail on cd_crid = cr_id where cr_prodcode = '" + ms_prodcode + "' and cd_detno >= " + stepno + ") ");
|
|
|
+ sql.Append("craftdetail on cd_crid = cr_id where cr_prodcode = '" + ms_prodcode.Text + "' and cd_detno >= " + stepno + ") ");
|
|
|
sql.Append("and cm_sncode='" + ms_sncode.Text + "' and cm_makecode='" + oMakeCode + "'");
|
|
|
dh.ExecuteSql(sql.ToString(), "update");
|
|
|
dh.ExecuteSql("update makeserial set MS_IFQCCHECK=0,ms_nextstepcode='" + pcd_ngretuenstep + "' where ms_id='" + oMSID + "'", "select");
|
|
|
@@ -281,8 +298,25 @@ namespace UAS_MES_NEW.OQC
|
|
|
dh.ExecuteSql("delete from steppassed where sp_sncode='" + ms_sncode.Text + "' and sp_makecode='" + oMakeCode + "'", "delete");
|
|
|
dh.ExecuteSql("update craftmaterial set cm_status=-1 where cm_sncode='" + ms_sncode.Text + "' and cm_makecode='" + oMakeCode + "'", "update");
|
|
|
dh.ExecuteSql("update makecraftdetail set mcd_inqty=mcd_inqty-1,mcd_outqty=mcd_outqty-1,mcd_okqty=mcd_okqty-1 where mcd_macode='" + oMakeCode + "' and instr((select ms_paststep from makeserial where ms_id='" + oMSID + "'),mcd_stepcode)>0 ", "update");
|
|
|
- string ms_id = dh.getFieldDataByCondition("makeserial", "max(ms_id)", "ms_sncode='" + ms_sncode.Text + "'").ToString();
|
|
|
- dh.ExecuteSql("update makeserial set ms_nextmacode='',ms_nextstepcode='',ms_status=3 where ms_id='" + ms_id + "'", "update");
|
|
|
+ dt = (DataTable)dh.ExecuteSql("select ms_id,ms_craftcode,ms_prodcode,ms_makecode from makeserial where ms_sncode='" + ms_sncode.Text + "' order by ms_id", "select");
|
|
|
+ if (dt.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ string ms_id = dt.Rows[0]["ms_id"].ToString();
|
|
|
+ string ms_prodcode = dt.Rows[0]["ms_prodcode"].ToString();
|
|
|
+ string ms_makecode = dt.Rows[0]["ms_makecode"].ToString();
|
|
|
+ dh.ExecuteSql("update makeserial set ms_nextmacode='',ms_nextstepcode='',ms_status=3 where ms_id='" + ms_id + "'", "update");
|
|
|
+ string stepno = dh.getFieldDataByCondition("makeserial left join craft on cr_code=ms_craftcode and ms_prodcode=cr_prodcode left join craftdetail on cd_crid=cr_id", "cd_stepno", "ms_id='" + ms_id + "' and cd_stepcode='" + pcd_okretuenstep + "'").ToString();
|
|
|
+ if (stepno == "")
|
|
|
+ {
|
|
|
+ stepno = "100";
|
|
|
+ }
|
|
|
+ StringBuilder sql = new StringBuilder();
|
|
|
+ sql.Append("update craftmaterial set cm_status=-1,CM_DROPMAN='" + User.UserName + "' where cm_stepcode in (select cd_stepcode from craft left join ");
|
|
|
+ sql.Append("craftdetail on cd_crid = cr_id where cr_prodcode = '" + ms_prodcode + "' and cd_detno >= " + stepno + ") ");
|
|
|
+ sql.Append("and cm_sncode='" + ms_sncode.Text + "' and cm_makecode='" + ms_makecode + "'");
|
|
|
+ dh.ExecuteSql(sql.ToString(), "update");
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "采集不良品", "采集不良品成功", ms_sncode.Text, "");
|