|
|
@@ -281,7 +281,7 @@ namespace UAS_MES.Make
|
|
|
return;
|
|
|
}
|
|
|
sql.Clear();
|
|
|
- sql.Append("select nvl(pa_iostatus,0)pa_iostatus,pa_outno,pa_mothercode from package where pa_outboxcode='" + pa_outboxcode.Text + "'");
|
|
|
+ sql.Append("select nvl(pa_iostatus,0)pa_iostatus,pa_outno,pa_mothercode,pa_type from package where pa_outboxcode='" + pa_outboxcode.Text + "'");
|
|
|
dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
string MotherBoxCode = "";
|
|
|
if (dt.Rows.Count > 0)
|
|
|
@@ -367,10 +367,29 @@ namespace UAS_MES.Make
|
|
|
LoadGridData();
|
|
|
LoadCheckQTY();
|
|
|
dh.ExecuteSql("update packagedetail set pd_innerqty=(select pa_packageqty from package where pa_outboxcode='" + pa_outboxcode.Text + "') where pd_innerboxcode='" + pa_outboxcode.Text + "'", "update");
|
|
|
- //如果母箱号不为空,需要更新总数
|
|
|
if (MotherBoxCode != "")
|
|
|
{
|
|
|
- dh.ExecuteSql("update package set PA_TOTALQTY=(select sum(pd_innerqty) from packagedetail left join package on pa_id=pd_paid where pa_outboxcode='" + MotherBoxCode + "') where pa_outboxcode='" + MotherBoxCode + "' and pa_type=3", "update");
|
|
|
+ dt = (DataTable)dh.ExecuteSql("select pa_mothercode,pa_type from package where pa_outboxcode='" + MotherBoxCode + "'", "select");
|
|
|
+ //如果母箱号不为空,需要更新总数
|
|
|
+ if (dt.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ if (dt.Rows[0]["pa_type"].ToString() == "2")
|
|
|
+ {
|
|
|
+ string MotherCode2 = dt.Rows[0]["pa_mothercode"].ToString();
|
|
|
+ //更新大箱数量
|
|
|
+ dh.ExecuteSql("update package set PA_TOTALQTY=(select sum(pd_innerqty) from packagedetail left join package on pa_id=pd_paid where pa_outboxcode='" + MotherBoxCode + "') where pa_outboxcode='" + MotherBoxCode + "'", "update");
|
|
|
+ //外层有栈板则更新栈板数量
|
|
|
+ if (MotherCode2 != "")
|
|
|
+ {
|
|
|
+ dh.ExecuteSql("update packagedetail set pd_innerqty=(select sum(pd_innerqty) from packagedetail where pd_outboxcode='" + MotherBoxCode + "') where pd_innerboxcode='" + MotherBoxCode + "'", "update");
|
|
|
+ dh.ExecuteSql("update package set PA_TOTALQTY=(select sum(pd_innerqty) from packagedetail left join package on pa_id=pd_paid where pa_outboxcode='" + MotherCode2 + "') where pa_outboxcode='" + MotherCode2 + "'", "update");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (dt.Rows[0]["pa_type"] == "3")
|
|
|
+ {
|
|
|
+ dh.ExecuteSql("update package set PA_TOTALQTY=(select sum(pd_innerqty) from packagedetail left join package on pa_id=pd_paid where pa_outboxcode='" + MotherBoxCode + "') where pa_outboxcode='" + MotherBoxCode + "'", "update");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
//采集完后如果是第一个装的序列号,把序列号的NextStepCode赋值给箱号
|
|
|
if (pa_currentqty.Text == "1")
|
|
|
@@ -429,7 +448,26 @@ namespace UAS_MES.Make
|
|
|
//如果母箱号不为空,需要更新总数
|
|
|
if (MotherBoxCode != "")
|
|
|
{
|
|
|
- dh.ExecuteSql("update package set PA_TOTALQTY=(select sum(pd_innerqty) from packagedetail left join package on pa_id=pd_paid where pa_outboxcode='" + MotherBoxCode + "') where pa_outboxcode='" + MotherBoxCode + "' and pa_type=3", "update");
|
|
|
+ DataTable dt = (DataTable)dh.ExecuteSql("select pa_mothercode,pa_type from package where pa_outboxcode='" + MotherBoxCode + "'", "select");
|
|
|
+ if (dt.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ if (dt.Rows[0]["pa_type"].ToString() == "2")
|
|
|
+ {
|
|
|
+ string MotherCode2 = dt.Rows[0]["pa_mothercode"].ToString();
|
|
|
+ //更新大箱数量
|
|
|
+ dh.ExecuteSql("update package set PA_TOTALQTY=(select sum(pd_innerqty) from packagedetail left join package on pa_id=pd_paid where pa_outboxcode='" + MotherBoxCode + "') where pa_outboxcode='" + MotherBoxCode + "'", "update");
|
|
|
+ //外层有栈板则更新栈板数量
|
|
|
+ if (MotherCode2 != "")
|
|
|
+ {
|
|
|
+ dh.ExecuteSql("update packagedetail set pd_innerqty=(select sum(pd_innerqty) from packagedetail where pd_outboxcode='" + MotherBoxCode + "') where pd_innerboxcode='" + MotherBoxCode + "'", "update");
|
|
|
+ dh.ExecuteSql("update package set PA_TOTALQTY=(select sum(pd_innerqty) from packagedetail left join package on pa_id=pd_paid where pa_outboxcode='" + MotherCode2 + "') where pa_outboxcode='" + MotherCode2 + "'", "update");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (dt.Rows[0]["pa_type"] == "3")
|
|
|
+ {
|
|
|
+ dh.ExecuteSql("update package set PA_TOTALQTY=(select sum(pd_innerqty) from packagedetail left join package on pa_id=pd_paid where pa_outboxcode='" + MotherBoxCode + "') where pa_outboxcode='" + MotherBoxCode + "'", "update");
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, oMakeCode, User.UserLineCode, User.UserSourceCode, "卡通箱采集", "卡通箱" + pa_outboxcode.Text + "取消采集成功", sn_code.Text, "");
|
|
|
LoadGridData();
|