|
|
@@ -373,14 +373,22 @@ namespace UAS_MES.Make
|
|
|
{
|
|
|
if (bigoutboxcode.Text != "")
|
|
|
{
|
|
|
- if (dh.CheckExist("package", "pa_outboxcode='" + bigoutboxcode.Text + "' and nvl(pa_status,0)=0"))
|
|
|
+ sql.Clear();
|
|
|
+ sql.Append("select nvl(pa_status,0) pa_status from packagedetail left join package ");
|
|
|
+ sql.Append("on pa_id=pd_paid where pd_outboxcode='" + bigoutboxcode.Text + "'");
|
|
|
+ DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
+ if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
- OperateResult.AppendText(">>" + bigoutboxcode.Text + "封箱成功\n", Color.Green);
|
|
|
- LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "大箱采集", "装箱" + bigoutboxcode.Text + "成功", outboxcode.Text, "");
|
|
|
- dh.ExecuteSql("update package set pa_status=1 where pa_outboxcode='" + bigoutboxcode.Text + "'", "update");
|
|
|
- pa_status.Text = "1";
|
|
|
+ if (dt.Rows[0]["pa_status"].ToString() == "0")
|
|
|
+ {
|
|
|
+ OperateResult.AppendText(">>大箱号" + bigoutboxcode.Text + "装大箱成功\n", Color.Green);
|
|
|
+ LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "大箱采集", "装箱" + bigoutboxcode.Text + "成功", outboxcode.Text, "");
|
|
|
+ dh.ExecuteSql("update package set pa_status=1 where pa_outboxcode='" + bigoutboxcode.Text + "'", "update");
|
|
|
+ pa_status.Text = "1";
|
|
|
+ }
|
|
|
+ else OperateResult.AppendText(">>大箱号" + bigoutboxcode.Text + "已封大箱\n", Color.Red);
|
|
|
}
|
|
|
- else OperateResult.AppendText(">>箱号" + bigoutboxcode.Text + "错误或者已封箱\n", Color.Red);
|
|
|
+ else OperateResult.AppendText(">>大箱号" + bigoutboxcode.Text + "未采集内容\n", Color.Red);
|
|
|
}
|
|
|
else OperateResult.AppendText(">>大箱号不能为空\n", Color.Red);
|
|
|
}
|