|
|
@@ -87,23 +87,25 @@ namespace UAS_MES_NEW.Special
|
|
|
OperateResult.AppendText("工单号" + ma_code1.Text + "不存在\n");
|
|
|
return;
|
|
|
}
|
|
|
- //if (dh.getFieldDataByCondition("make", "ma_prodcode", "ma_code='" + ma_code.Text + "'").ToString() != dh.getFieldDataByCondition("make", "ma_prodcode", "ma_code='" + ma_code1.Text + "'").ToString())
|
|
|
- //{
|
|
|
- // OperateResult.AppendText("工单号产品编号不对应,不允许切换\n");
|
|
|
- // return;
|
|
|
- //}
|
|
|
- List<string> sqls = new List<string>();
|
|
|
- sqls.Add("update CRAFTMATERIAL set cm_makecode='" + ma_code1.Text + "' where cm_makecode= '" + ma_code.Text + "'");
|
|
|
- sqls.Add("update steppassed set sp_makecode='" + ma_code1.Text + "' where sp_makecode= '" + ma_code.Text + "'");
|
|
|
- sqls.Add("update makeserial set ms_makecode='" + ma_code1.Text + "' where ms_makecode= '" + ma_code.Text + "'");
|
|
|
- sqls.Add("update makeprocess set mp_makecode='" + ma_code1.Text + "' where mp_makecode= '" + ma_code.Text + "'");
|
|
|
- sqls.Add("update commandlog set cl_makecode='" + ma_code1.Text + "' where cl_makecode= '" + ma_code.Text + "'");
|
|
|
- sqls.Add("update makebad set mb_makecode='" + ma_code1.Text + "' where mb_makecode= '" + ma_code.Text + "'");
|
|
|
- sqls.Add("update labelprintlog set lpl_makecode='" + ma_code1.Text + "' where lpl_makecode= '" + ma_code.Text + "'");
|
|
|
- sqls.Add("update package set pa_makecode='" + ma_code1.Text + "' where pa_makecode= '" + ma_code.Text + "'");
|
|
|
- sqls.Add("update packagedetail set pd_makecode='" + ma_code1.Text + "' where pd_makecode= '" + ma_code.Text + "'");
|
|
|
- sqls.Add("update make set ma_inqty=(select count(1) from makeserial where ms_makecode='"+ma_code1.Text+"') and ma_code='"+ma_code1.Text+"'");
|
|
|
- sqls.Add("update make set ma_endqty=(select count(1) from makeserial where ms_makecode='" + ma_code1.Text+"' and ms_status=2) and ma_code='"+ma_code1.Text+"'");
|
|
|
+ if (dh.getFieldDataByCondition("make", "ma_prodcode", "ma_code='" + ma_code.Text + "'").ToString() != dh.getFieldDataByCondition("make", "ma_prodcode", "ma_code='" + ma_code1.Text + "'").ToString())
|
|
|
+ {
|
|
|
+ OperateResult.AppendText("工单号产品编号不对应,不允许切换\n");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ List<string> sqls = new List<string>
|
|
|
+ {
|
|
|
+ "update CRAFTMATERIAL set cm_makecode='" + ma_code1.Text + "' where cm_makecode= '" + ma_code.Text + "' and cm_sncode in (select ms_sncode from makeserial where ms_boxcode='"+boxcode.Text+"')",
|
|
|
+ "update steppassed set sp_makecode='" + ma_code1.Text + "' where sp_makecode= '" + ma_code.Text + "' and sp_sncode in in (select ms_sncode from makeserial where ms_boxcode='"+boxcode.Text+"')",
|
|
|
+ "update makeserial set ms_makecode='" + ma_code1.Text + "' where ms_makecode= '" + ma_code.Text + "' and ms_boxcode='"+boxcode.Text+"'",
|
|
|
+ "update makeprocess set mp_makecode='" + ma_code1.Text + "' where mp_makecode= '" + ma_code.Text + "' and mp_sncode in (select ms_sncode from makeserial where ms_boxcode='\"+boxcode.Text+\"')",
|
|
|
+ "update commandlog set cl_makecode='" + ma_code1.Text + "' where cl_makecode= '" + ma_code.Text + "' and cl_sncode in (select ms_sncode from makeserial where ms_boxcode='\"+boxcode.Text+\"')",
|
|
|
+ "update makebad set mb_makecode='" + ma_code1.Text + "' where mb_makecode= '" + ma_code.Text + "' and mb_sncode in (select ms_sncode from makeserial where ms_boxcode='\"+boxcode.Text+\"')",
|
|
|
+ "update labelprintlog set lpl_makecode='" + ma_code1.Text + "' where lpl_makecode= '" + ma_code.Text + "' and lpl_value in (select ms_sncode from makeserial where ms_boxcode='\"+boxcode.Text+\"')",
|
|
|
+ "update package set pa_makecode='" + ma_code1.Text + "' where pa_makecode= '" + ma_code.Text + "' ",
|
|
|
+ "update packagedetail set pd_makecode='" + ma_code1.Text + "' where pd_makecode= '" + ma_code.Text + "' and pd_barcode in (select ms_sncode from makeserial where ms_boxcode='"+boxcode.Text+"') ",
|
|
|
+ "update make set ma_inqty=(select count(1) from makeserial where ms_makecode='" + ma_code1.Text + "') and ma_code='" + ma_code1.Text + "'",
|
|
|
+ "update make set ma_endqty=(select count(1) from makeserial where ms_makecode='" + ma_code1.Text + "' and ms_status=2) and ma_code='" + ma_code1.Text + "'"
|
|
|
+ };
|
|
|
dh.ExecuteSQLTran(sqls.ToArray());
|
|
|
OperateResult.AppendText("工单号切换成功\n");
|
|
|
LogicHandler.DoCommandLog("", User.UserName, ma_code.Text, User.UserLineCode, User.UserSourceCode, "工单变更", "工单变更" + ma_code.Text + "切换到" + ma_code1.Text, "", "");
|