|
|
@@ -113,14 +113,8 @@ namespace UAS_MES.Make
|
|
|
OperateResult.AppendText(">>卡通箱号不能为空\n", Color.Red);
|
|
|
return;
|
|
|
}
|
|
|
- string pallteiostatus = dh.getFieldDataByCondition("package", "nvl(pa_iostatus,0)", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString();
|
|
|
- if (pallteiostatus != "" && pallteiostatus != "0")
|
|
|
- {
|
|
|
- OperateResult.AppendText(">>大箱" + pa_outboxcode.Text + "已入库不允许采集\n", Color.Red, outboxcode);
|
|
|
- return;
|
|
|
- }
|
|
|
sql.Clear();
|
|
|
- sql.Append("select nvl(pa_iostatus,0)pa_iostatus,pa_makecode pd_makecode,nvl(pa_downstatus,0)pa_downstatus,pa_salecode pd_salecode,");
|
|
|
+ sql.Append("select nvl(pa_iostatus,0)pa_iostatus,pa_outno,pa_makecode pd_makecode,nvl(pa_downstatus,0)pa_downstatus,pa_salecode pd_salecode,");
|
|
|
sql.Append("pr_packrule,pa_id,pa_prodcode pd_prodcode,pa_status,pa_mothercode,pa_nextstep from packagedetail left ");
|
|
|
sql.Append("join package on pd_paid=pa_id left join product on pd_prodcode=pr_code where pd_outboxcode='" + outboxcode.Text + "'");
|
|
|
dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
@@ -133,6 +127,11 @@ namespace UAS_MES.Make
|
|
|
OperateResult.AppendText(">>箱号" + outboxcode.Text + "下地状态不允许采集\n", Color.Red, outboxcode);
|
|
|
return;
|
|
|
}
|
|
|
+ if (dt.Rows[0]["pa_outno"].ToString() != "")
|
|
|
+ {
|
|
|
+ OperateResult.AppendText(">>箱号" + outboxcode.Text + "已被出货单" + dt.Rows[0]["pa_outno"].ToString() + "采集,不允许操作\n", Color.Red, outboxcode);
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (dt.Rows[0]["pa_iostatus"].ToString() != "0")
|
|
|
{
|
|
|
OperateResult.AppendText(">>箱号" + outboxcode.Text + "已入库不允许采集\n", Color.Red, outboxcode);
|
|
|
@@ -153,23 +152,41 @@ namespace UAS_MES.Make
|
|
|
OperateResult.AppendText(">>卡通箱号" + outboxcode.Text + "的下一工序不是当前岗位资源对应工序,下一工序为" + pa_nextstep + "\n", Color.Red, outboxcode);
|
|
|
return;
|
|
|
}
|
|
|
- //未空表示线外
|
|
|
+ sql.Clear();
|
|
|
+ sql.Append("select nvl(pa_iostatus,0) pa_iostatus,pa_outno,pa_mothercode from package where pa_outboxcode='" + pa_outboxcode.Text + "'");
|
|
|
+ dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
+ if (dt.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ if (dt.Rows[0]["pa_mothercode"].ToString() != "")
|
|
|
+ {
|
|
|
+ OperateResult.AppendText(">>大箱" + pa_outboxcode.Text + "已被栈板" + dt.Rows[0]["pa_mothercode"].ToString() + "采集,不允许操作\n", Color.Red);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (dt.Rows[0]["pa_outno"].ToString() != "")
|
|
|
+ {
|
|
|
+ OperateResult.AppendText(">>大箱" + pa_outboxcode.Text + "已被出货单" + dt.Rows[0]["pa_outno"].ToString() + "采集,不允许操作\n", Color.Red);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (dt.Rows[0]["pa_iostatus"].ToString() != "0")
|
|
|
+ {
|
|
|
+ OperateResult.AppendText(">>大箱" + pa_outboxcode.Text + "处于入库状态,不允许操作\n", Color.Red);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //为空表示线外
|
|
|
if (pa_nextstep == "")
|
|
|
{
|
|
|
//判断线外,必须已完工并且未入库
|
|
|
dt = (DataTable)dh.ExecuteSql("select wm_concat(ms_sncode) from mes_package_view left join makeserial on v_makecode=ms_makecode and ms_sncode=v_barcode where v_outboxcode='" + outboxcode.Text + "' and ms_status<>2", "select");
|
|
|
- if (dt.Rows[0][0].ToString() == "")
|
|
|
- {
|
|
|
- //判断箱未入库
|
|
|
- dt = (DataTable)dh.ExecuteSql("select count(1) from package where pa_outboxcode='" + outboxcode.Text + "' and nvl(pa_iostatus,0)<>0", "select");
|
|
|
- if (dt.Rows[0][0].ToString() != "0")
|
|
|
- {
|
|
|
- OperateResult.AppendText(">>序列号" + dt.Rows[0][0].ToString() + "已入库,不允许装箱\n", Color.Red);
|
|
|
- return;
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
+ if (dt.Rows[0][0].ToString() != "")
|
|
|
{
|
|
|
+ ////判断箱未入库
|
|
|
+ //dt = (DataTable)dh.ExecuteSql("select count(1) from package where pa_outboxcode='" + outboxcode.Text + "' and nvl(pa_iostatus,0)<>0", "select");
|
|
|
+ //if (dt.Rows[0][0].ToString() != "0")
|
|
|
+ //{
|
|
|
+ // OperateResult.AppendText(">>卡通箱" + outboxcode.Text + "已入库,不允许装箱\n", Color.Red);
|
|
|
+ // return;
|
|
|
+ //}
|
|
|
OperateResult.AppendText(">>序列号" + dt.Rows[0][0].ToString() + "尚未完工\n", Color.Red);
|
|
|
return;
|
|
|
}
|
|
|
@@ -403,6 +420,22 @@ namespace UAS_MES.Make
|
|
|
string Delete = MessageBox.Show(this.ParentForm, "是否确认拆箱?", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString();
|
|
|
if (Delete == "Yes")
|
|
|
{
|
|
|
+ sql.Clear();
|
|
|
+ sql.Append("select nvl(pa_iostatus,0) pa_iostatus,pa_outno from package where pa_outboxcode='" + pa_outboxcode.Text + "'");
|
|
|
+ dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
+ if (dt.Rows.Count > 0)
|
|
|
+ {
|
|
|
+ if (dt.Rows[0]["pa_outno"].ToString() != "")
|
|
|
+ {
|
|
|
+ OperateResult.AppendText(">>大箱" + pa_outboxcode.Text + "已被出货单" + dt.Rows[0]["pa_outno"].ToString() + "采集,不允许操作\n", Color.Red);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (dt.Rows[0]["pa_iostatus"].ToString() != "0")
|
|
|
+ {
|
|
|
+ OperateResult.AppendText(">>大箱" + pa_outboxcode.Text + "处于入库状态,不允许操作\n", Color.Red);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
if (dh.getFieldDataByCondition("package", "pa_nextstep", "pa_mothercode='" + pa_outboxcode.Text + "'").ToString() != "")
|
|
|
LogicHandler.OutBoxDrawStepPass(pa_outboxcode.Text, pa_makecode.Text, User.UserSourceCode);
|
|
|
else
|