|
|
@@ -7,6 +7,7 @@ using System.Linq;
|
|
|
using System.Text;
|
|
|
using System.Windows.Forms;
|
|
|
using UAS_MES.DataOperate;
|
|
|
+using UAS_MES.Entity;
|
|
|
using UAS_MES.PublicMethod;
|
|
|
|
|
|
namespace UAS_MES.Special
|
|
|
@@ -31,19 +32,26 @@ 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");
|
|
|
+ List<string> ms_sncode = new List<string>();
|
|
|
+ for (int i = 0; i < dt.Rows.Count; i++)
|
|
|
+ {
|
|
|
+ ms_sncode.Add(dt.Rows[0]["v_barcode"].ToString());
|
|
|
+ }
|
|
|
sql.Clear();
|
|
|
- sql.Append("select distinct ms_outboxcode from makeserial left join mes_package_view on v_makecode=ms_makecode and ");
|
|
|
+ sql.Append("select distinct ms_outboxcode,ms_makecode from makeserial left join mes_package_view on v_makecode=ms_makecode and ");
|
|
|
sql.Append("ms_sncode=v_barcode where v_outboxcode='" + Pallate.Text + "' and ms_outboxcode is not null");
|
|
|
//获取所有的卡通箱号
|
|
|
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 ");
|
|
|
sql.Append("from makeserial left join mes_package_view on v_makecode = ms_makecode and ms_sncode = v_barcode where ");
|
|
|
sql.Append("v_outboxcode='" + Pallate.Text + "') and pa_mothercode is not null");
|
|
|
- DataTable dt2 = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
+ DataTable dt2 = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
if (dt2.Rows.Count > 0)
|
|
|
{
|
|
|
//获取外层箱号的外箱号
|
|
|
@@ -81,7 +89,9 @@ namespace UAS_MES.Special
|
|
|
}
|
|
|
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());
|
|
|
}
|
|
|
+ LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, "", User.UserLineCode, User.UserSourceCode, "返工栈板解除", "解除成功", Pallate.Text, "");
|
|
|
OperatResult.AppendText(">>栈板" + Pallate.Text + "拆解成功\n", Color.Green, Pallate);
|
|
|
}
|
|
|
else OperatResult.AppendText(">>栈板号" + Pallate.Text + "不存在\n", Color.Red, Pallate);
|