|
|
@@ -32,11 +32,13 @@ namespace UAS_MES.Special
|
|
|
{
|
|
|
if (dh.CheckExist("package", "pa_outboxcode='" + Pallate.Text + "' and pa_type=3"))
|
|
|
{
|
|
|
- DataTable dt = (DataTable)dh.ExecuteSql("select v_barcode from mes_package_view where v_outboxcode='" + Pallate.Text + "'", "select");
|
|
|
+ DataTable dt = (DataTable)dh.ExecuteSql("select v_makecode,v_barcode from mes_package_view where v_outboxcode='" + Pallate.Text + "'", "select");
|
|
|
List<string> ms_sncode = new List<string>();
|
|
|
+ List<string> v_makecode = new List<string>();
|
|
|
for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
{
|
|
|
ms_sncode.Add(dt.Rows[i]["v_barcode"].ToString());
|
|
|
+ v_makecode.Add(dt.Rows[i]["v_makecode"].ToString());
|
|
|
}
|
|
|
sql.Clear();
|
|
|
sql.Append("select distinct ms_outboxcode,ms_makecode from makeserial left join mes_package_view on v_makecode=ms_makecode and ");
|
|
|
@@ -45,7 +47,6 @@ namespace UAS_MES.Special
|
|
|
DataTable dt1 = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
if (dt1.Rows.Count > 0)
|
|
|
{
|
|
|
- string ms_makecode = dt1.Rows[0]["ms_makecode"].ToString();
|
|
|
//获取卡通箱的外层箱号
|
|
|
sql.Clear();
|
|
|
sql.Append("select distinct pa_mothercode from package where pa_outboxcode in(select distinct ms_outboxcode ");
|
|
|
@@ -95,7 +96,7 @@ namespace UAS_MES.Special
|
|
|
dh.BatchInsert("insert into PACKAGEBACKUPDETAIL select * from packagedetail where pd_outboxcode=:outboxcode", new string[] { "outboxcode" }, outboxcode.ToArray());
|
|
|
dh.BatchInsert("delete from packagedetail where pd_outboxcode=:outboxcode", new string[] { "outboxcode" }, outboxcode.ToArray());
|
|
|
dh.BatchInsert("delete from package where pa_outboxcode=:outboxcode", new string[] { "outboxcode" }, outboxcode.ToArray());
|
|
|
- dh.BatchInsert("update makeserial set ms_outboxcode='' where ms_sncode=:ms_sncode and ms_makecode='" + ms_makecode + "' ", new string[] { "ms_sncode" }, ms_sncode.ToArray());
|
|
|
+ dh.BatchInsert("update makeserial set ms_outboxcode='' where ms_sncode=:ms_sncode and ms_makecode=:ms_makecode", new string[] { "ms_sncode","ms_makecode" }, ms_sncode.ToArray(),v_makecode.ToArray());
|
|
|
}
|
|
|
LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, "", User.UserLineCode, User.UserSourceCode, "返工栈板解除", "解除成功", Pallate.Text, "");
|
|
|
OperatResult.AppendText(">>栈板" + Pallate.Text + "拆解成功\n", Color.Green, Pallate);
|