|
|
@@ -35,6 +35,8 @@ namespace UAS_MES.Warehouse
|
|
|
|
|
|
Warehouse_NewPiInOut newpi;
|
|
|
|
|
|
+ string needMakeIn;
|
|
|
+
|
|
|
public Warehouse_FinishedProductOut()
|
|
|
{
|
|
|
InitializeComponent();
|
|
|
@@ -53,6 +55,7 @@ namespace UAS_MES.Warehouse
|
|
|
dh = new DataHelper();
|
|
|
|
|
|
asc.controllInitializeSize(this);
|
|
|
+ needMakeIn = dh.GetConfig("needMakeIn", "MESSetting").ToString();
|
|
|
}
|
|
|
|
|
|
private void Pi_inoutno_DbChange(object sender, EventArgs e)
|
|
|
@@ -195,7 +198,8 @@ namespace UAS_MES.Warehouse
|
|
|
else
|
|
|
{
|
|
|
List<String> ExeSQL = new List<string>();
|
|
|
- ExeSQL.Add("update package set pa_status=2 where exists (select 1 from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_outboxcode=pa_outboxcode and ((pim_type='PALLET' AND PA_TYPE=3) OR (PIM_TYPE='BOX' AND PA_TYPE IN(1,2)))) AND PA_OUTNO='" + pi_inoutno.Text + "'");
|
|
|
+ ExeSQL.Add("update package set pa_iostatus=2 where exists (select 1 from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_outboxcode=pa_outboxcode and ((pim_type='PALLET' AND PA_TYPE=3) OR (PIM_TYPE='BOX' AND PA_TYPE IN(1,2)))) AND PA_OUTNO='" + pi_inoutno.Text + "'");
|
|
|
+ ExeSQL.Add("update makeserial set ms_iostatus=2 where ms_outno='" + pi_inoutno.Text + "' and exists(select 1 from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_mac=ms_sncode and pim_inorout='OUT')");
|
|
|
ExeSQL.Add("update prodinout set pi_pdastatus='已出库' where pi_inoutno='" + pi_inoutno.Text + "'");
|
|
|
ExeSQL.Add("insert into messagelog(ml_id,ml_date,ml_man,ml_content,ml_result,ml_search)values(messagelog_seq.nextval,sysdate,'" + User.UserName + "','确认出货','确认出货成功','ProdInOut!Sale|pi_id=" + pi_id.Text + "')");
|
|
|
dh.ExecuteSQLTran(ExeSQL.ToArray());
|
|
|
@@ -237,7 +241,7 @@ namespace UAS_MES.Warehouse
|
|
|
if (palletBtn.Checked)
|
|
|
{
|
|
|
sql.Clear();
|
|
|
- sql.Append("select pa_outboxcode,pa_status,nvl(pa_downstatus,0)pa_downstatus,pa_outno from package where pa_outboxcode='" + input.Text + "' and pa_type=3");
|
|
|
+ sql.Append("select pa_outboxcode,pa_status,pa_iostatus,pa_makecode,nvl(pa_downstatus,0)pa_downstatus,pa_outno from package where pa_outboxcode='" + input.Text + "' and pa_type=3");
|
|
|
dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
@@ -253,6 +257,7 @@ namespace UAS_MES.Warehouse
|
|
|
return;
|
|
|
//更新箱号对应的出货单号
|
|
|
dh.UpdateByCondition("package", "pa_outno = '" + pi_inoutno.Text + "'", "pa_outboxcode = '" + input.Text + "'");
|
|
|
+ LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, dt.Rows[0]["pa_makecode"].ToString(), User.UserLineCode, User.UserSourceCode, "栈板" + input.Text + "出货备货", "栈板" + input.Text + "出货备货成功", "", "栈板号" + input.Text + "");
|
|
|
}
|
|
|
else if (bigboxBtn.Checked)
|
|
|
{
|
|
|
@@ -262,7 +267,7 @@ namespace UAS_MES.Warehouse
|
|
|
input.Text = outboxcode;
|
|
|
}
|
|
|
sql.Clear();
|
|
|
- sql.Append("select pa_outboxcode,pa_status,nvl(pa_downstatus,0)pa_downstatus,pa_outno, pa_mothercode from package where pa_outboxcode='" + input.Text + "' and pa_type in(1,2)");
|
|
|
+ sql.Append("select pa_outboxcode,pa_makecode,pa_status,nvl(pa_downstatus,0)pa_downstatus,pa_outno, pa_mothercode from package where pa_outboxcode='" + input.Text + "' and pa_type in(1,2)");
|
|
|
dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
@@ -283,6 +288,7 @@ namespace UAS_MES.Warehouse
|
|
|
return;
|
|
|
//更新箱号对应的出货单号
|
|
|
dh.UpdateByCondition("package", "pa_outno = '" + pi_inoutno.Text + "'", "pa_outboxcode = '" + input.Text + "'");
|
|
|
+ LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, dt.Rows[0]["pa_makecode"].ToString(), User.UserLineCode, User.UserSourceCode, "箱号" + input.Text + "出货备货", "箱号" + input.Text + "出货备货成功", "", "箱号" + input.Text + "");
|
|
|
}
|
|
|
else if (serBtn.Checked)
|
|
|
{
|
|
|
@@ -295,26 +301,51 @@ namespace UAS_MES.Warehouse
|
|
|
else
|
|
|
{
|
|
|
sql.Clear();
|
|
|
- sql.Append("select ms_status,nvl(ms_downstatus,0)ms_downstatus,ms_outboxcode,nvl(ms_iostatus,1)ms_iostatus,ms_prodcode,ms_salecode from makeserial where ms_id='" + ms_id + "'");
|
|
|
+ sql.Append("select ms_status,ms_outno,ms_makecode,nvl(ms_downstatus,0)ms_downstatus,ms_outboxcode,nvl(ms_iostatus,0)ms_iostatus,ms_prodcode,ms_salecode from makeserial where ms_id='" + ms_id + "'");
|
|
|
dtms = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
- if (dtms.Rows[0]["ms_status"].ToString() != "2")
|
|
|
+ string ms_downstatus = dtms.Rows[0]["ms_downstatus"].ToString();
|
|
|
+ string ms_status = dtms.Rows[0]["ms_status"].ToString();
|
|
|
+ string ms_outboxcode = dtms.Rows[0]["ms_outboxcode"].ToString();
|
|
|
+ string ms_iostatus = dtms.Rows[0]["ms_iostatus"].ToString();
|
|
|
+ string ms_outno = dtms.Rows[0]["ms_outno"].ToString();
|
|
|
+ string ms_prodcode = dtms.Rows[0]["ms_prodcode"].ToString();
|
|
|
+ string ms_makecode = dtms.Rows[0]["ms_makecode"].ToString();
|
|
|
+ if (ms_status != "2")
|
|
|
{
|
|
|
OperateResult.AppendText("序列号" + input.Text + "未完工,不允许出货\n", Color.Red, input);
|
|
|
return;
|
|
|
}
|
|
|
- if (dtms.Rows[0]["ms_outboxcode"].ToString() != "")
|
|
|
+ if (ms_outboxcode != "")
|
|
|
{
|
|
|
OperateResult.AppendText("序列号" + input.Text + "有外箱号,不允许单独出货\n", Color.Red, input);
|
|
|
return;
|
|
|
}
|
|
|
- if (dtms.Rows[0]["ms_downstatus"].ToString() != "0")
|
|
|
+ if (ms_downstatus != "0")
|
|
|
{
|
|
|
OperateResult.AppendText("序列号" + input.Text + "处于下地状态,不允许出货\n", Color.Red, input);
|
|
|
return;
|
|
|
}
|
|
|
- if (dtms.Rows[0]["ms_iostatus"].ToString() != "1" && dtms.Rows[0]["ms_iostatus"].ToString() != "0")
|
|
|
+ if (needMakeIn != "0")
|
|
|
+ {
|
|
|
+ if (ms_iostatus != "1")
|
|
|
+ {
|
|
|
+ OperateResult.AppendText("序列号" + input.Text + "必须完工入库才允许出库\n", Color.Red, input);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (ms_iostatus == "2")
|
|
|
+ {
|
|
|
+ OperateResult.AppendText("序列号" + input.Text + "已出库,出库单号:" + ms_outno + "\n", Color.Red, input);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (ms_iostatus == "3")
|
|
|
+ {
|
|
|
+ OperateResult.AppendText("序列号" + input.Text + "出入库状态异常\n", Color.Red, input);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (ms_outno != "")
|
|
|
{
|
|
|
- OperateResult.AppendText("序列号" + input.Text + "已经被出货单:" + dh.getFieldDataByCondition("makeserial left JOIN prodiomac on pim_mac=ms_sncode", "pim_inoutno", "ms_id='" + ms_id + "' order by pim_indate desc").ToString() + "出货\n", Color.Red, input);
|
|
|
+ OperateResult.AppendText("序列号" + input.Text + "已经被出货单:" + ms_outno + "采集\n", Color.Red, input);
|
|
|
return;
|
|
|
}
|
|
|
if (dta.Rows[0]["pi_type"].ToString() == "按订单出货")
|
|
|
@@ -339,6 +370,7 @@ namespace UAS_MES.Warehouse
|
|
|
{
|
|
|
updatesn(ms_id);
|
|
|
}
|
|
|
+ LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode, User.UserLineCode, User.UserSourceCode, "序列号" + input.Text + "出货备货", "序列号" + input.Text + "出货备货成功", "序列号" + input.Text + "", "");
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
@@ -384,17 +416,37 @@ namespace UAS_MES.Warehouse
|
|
|
if (palletBtn.Checked)
|
|
|
{
|
|
|
sql.Clear();
|
|
|
- sql.Append("select * from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_outboxcode='" + input.Text + "' and pim_type='PALLET'");
|
|
|
+ sql.Append("select pa_id,pa_outboxcode,pa_status,nvl(pa_downstatus,0)pa_downstatus, ");
|
|
|
+ sql.Append("pa_outno, nvl(pa_iostatus,0) pa_iostatus,pa_makecode from package ");
|
|
|
+ sql.Append("where pa_outboxcode='" + input.Text + "' and pa_type=3");
|
|
|
dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
- dh.ExecuteSql("delete from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_outboxcode='" + input.Text + "' and pim_type='PALLET'", "delete");
|
|
|
+ string pa_iostatus = dt.Rows[0]["pa_iostatus"].ToString();
|
|
|
+ string pa_outno = dt.Rows[0]["pa_outno"].ToString();
|
|
|
+ if (pa_iostatus != "0" && pa_iostatus != "1")
|
|
|
+ {
|
|
|
+ OperateResult.AppendText("栈板号" + input.Text + "不是备货状态,无法取消备货\n", Color.Red, input);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (pa_outno == "")
|
|
|
+ {
|
|
|
+ OperateResult.AppendText("栈板号" + input.Text + "无所属出货单号\n", Color.Red, input);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (pa_outno != pi_inoutno.Text)
|
|
|
+ {
|
|
|
+ OperateResult.AppendText("栈板号" + input.Text + "所属出货单号" + pa_outno + "与当前所选出货单号" + pi_inoutno.Text + "\n", Color.Red, input);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ dh.ExecuteSql("delete from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_outboxcode='" + input.Text + "' and pim_type='PALLET' and pim_inorout='OUT' AND pim_class='出货'", "delete");
|
|
|
dh.UpdateByCondition("package", "pa_outno=''", "pa_outboxcode='" + input.Text + "'");
|
|
|
OperateResult.AppendText("栈板号" + input.Text + "取消备货成功\n", Color.Black, input);
|
|
|
+ LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, dt.Rows[0]["pa_makecode"].ToString(), User.UserLineCode, User.UserSourceCode, "栈板" + input.Text + "取消出货备货", "栈板" + input.Text + "取消出货备货成功", "", "栈板号" + input.Text + "");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- OperateResult.AppendText("栈板号" + input.Text + "不在备货数据中\n", Color.Red, input);
|
|
|
+ OperateResult.AppendText("栈板号" + input.Text + "不存在,请重新输入\n", Color.Red, input);
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
@@ -406,13 +458,39 @@ namespace UAS_MES.Warehouse
|
|
|
input.Text = outboxcode;
|
|
|
}
|
|
|
sql.Clear();
|
|
|
- sql.Append("select * from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_outboxcode='" + input.Text + "' and pim_type='BOX'");
|
|
|
+ sql.Append("select pa_id,pa_outboxcode,pa_status,nvl(pa_downstatus,0)pa_downstatus, ");
|
|
|
+ sql.Append("pa_outno,nvl(pa_iostatus,0) pa_iostatus,pa_makecode,pa_mothercode from package ");
|
|
|
+ sql.Append("where pa_outboxcode='" + input.Text + "' and pa_type in (1,2)");
|
|
|
dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
- dh.ExecuteSql("delete from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_outboxcode='" + input.Text + "' and pim_type='BOX'", "delete");
|
|
|
+ string pa_iostatus = dt.Rows[0]["pa_iostatus"].ToString();
|
|
|
+ string pa_outno = dt.Rows[0]["pa_outno"].ToString();
|
|
|
+ string pa_mothercode = dt.Rows[0]["pa_mothercode"].ToString();
|
|
|
+ if (pa_iostatus != "0" && pa_iostatus != "1")
|
|
|
+ {
|
|
|
+ OperateResult.AppendText("箱号" + input.Text + "不是备货状态,无法取消备货\n", Color.Red, input);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (pa_outno == "")
|
|
|
+ {
|
|
|
+ OperateResult.AppendText("箱号" + input.Text + "无所属出货单号\n", Color.Red, input);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (pa_outno != pi_inoutno.Text)
|
|
|
+ {
|
|
|
+ OperateResult.AppendText("箱号" + input.Text + "所属出货单号" + pa_outno + "与当前所选出货单号" + pi_inoutno.Text + "\n", Color.Red, input);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (pa_mothercode != "")
|
|
|
+ {
|
|
|
+ OperateResult.AppendText("箱号" + input.Text + "已经装大箱或栈板:" + pa_mothercode + ",不允许单独操作\n", Color.Red, input);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ dh.ExecuteSql("delete from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_outboxcode='" + input.Text + "' and pim_type='BOX' and pim_inorout='OUT' AND pim_class='出货'", "delete");
|
|
|
dh.UpdateByCondition("package", "pa_outno=''", "pa_outboxcode='" + input.Text + "'");
|
|
|
OperateResult.AppendText("箱号" + input.Text + "取消备货成功\n", Color.Black, input);
|
|
|
+ LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, dt.Rows[0]["pa_makecode"].ToString(), User.UserLineCode, User.UserSourceCode, "箱号" + input.Text + "取消出货备货", "箱号" + input.Text + "取消出货备货成功", "", "箱号" + input.Text + "");
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -422,22 +500,46 @@ namespace UAS_MES.Warehouse
|
|
|
}
|
|
|
else if (serBtn.Checked)
|
|
|
{
|
|
|
+ string ms_id = dh.getFieldDataByCondition("makeserial", "max(ms_id)ms_id", "ms_sncode='" + input.Text + "'").ToString();
|
|
|
+ if (ms_id == "")
|
|
|
+ {
|
|
|
+ OperateResult.AppendText("序列号" + input.Text + "不存在,请重新输入\n", Color.Red, input);
|
|
|
+ return;
|
|
|
+ }
|
|
|
sql.Clear();
|
|
|
- sql.Append("select pim_type,pim_outboxcode,pim_prodcode from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_mac='" + input.Text + "'");
|
|
|
+ sql.Append("select ms_status,nvl(ms_downstatus,0)ms_downstatus,ms_outboxcode,ms_makecode ");
|
|
|
+ sql.Append("nvl(ms_iostatus,0)ms_iostatus,ms_prodcode,ms_outno from makeserial where ms_id='" + ms_id + "'");
|
|
|
dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
|
|
|
if (dt.Rows.Count > 0)
|
|
|
{
|
|
|
- if (dt.Rows[0]["pim_type"].ToString() != "" && dt.Rows[0]["pim_outboxcode"].ToString() != "")
|
|
|
+ string ms_outboxcode = dt.Rows[0]["ms_outboxcode"].ToString();
|
|
|
+ string ms_outno = dt.Rows[0]["ms_outno"].ToString();
|
|
|
+ string ms_iostatus = dt.Rows[0]["ms_iostatus"].ToString();
|
|
|
+ string ms_makecode = dt.Rows[0]["ms_makecode"].ToString();
|
|
|
+ if (ms_iostatus != "0" && ms_iostatus != "1")
|
|
|
+ {
|
|
|
+ OperateResult.AppendText("序列号号" + input.Text + "不是备货状态,无法取消备货\n", Color.Red, input);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (ms_outno == "")
|
|
|
+ {
|
|
|
+ OperateResult.AppendText("序列号" + input.Text + "无所属出货单号\n", Color.Red, input);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (ms_outno != pi_inoutno.Text)
|
|
|
{
|
|
|
- OperateResult.AppendText("序列号" + input.Text + "已通过箱号或栈板号" + dt.Rows[0]["pim_outboxcode"].ToString() + "备货,无法单独取消\n", Color.Red, input);
|
|
|
+ OperateResult.AppendText("序列号" + input.Text + "所属出货单号" + ms_outno + "与当前所选出货单号" + pi_inoutno.Text + "\n", Color.Red, input);
|
|
|
return;
|
|
|
}
|
|
|
- else
|
|
|
+ if (ms_outboxcode != "")
|
|
|
{
|
|
|
- dh.ExecuteSql("delete from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_mac='" + input.Text + "'", "delete");
|
|
|
- dh.UpdateByCondition("makeserial", "ms_iostatus=1", "ms_sncode='" + input.Text + "' and ms_prodcode='" + dt.Rows[0]["pim_prodcode"].ToString() + "' and ms_iostatus=2");
|
|
|
- OperateResult.AppendText("序列号" + input.Text + "取消备货成功\n", Color.Black, input);
|
|
|
+ OperateResult.AppendText("箱号" + input.Text + "已经装大箱:" + ms_outboxcode + ",不允许单独操作\n", Color.Red, input);
|
|
|
+ return;
|
|
|
}
|
|
|
+ dh.ExecuteSql("delete from prodiomac where pim_id =(select max(pim_id) from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_mac='" + input.Text + "' and pim_inorout='IN' and pim_class='完工入库')", "delete");
|
|
|
+ dh.UpdateByCondition("makeserial", "ms_iostatus=1 , ms_outno = ''", "ms_id = '" + ms_id + "'");
|
|
|
+ LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode, User.UserLineCode, User.UserSourceCode, "序列号" + input.Text + "取消出货备货", "序列号" + input.Text + "取消出货备货成功", "序列号" + input.Text + "", "");
|
|
|
+ OperateResult.AppendText("序列号" + input.Text + "取消备货成功\n", Color.Black, input);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
@@ -466,10 +568,11 @@ namespace UAS_MES.Warehouse
|
|
|
{
|
|
|
//更新操作
|
|
|
sql.Clear();
|
|
|
- sql.Append("insert into prodiomac(pim_id,pim_inoutno,pim_piid,pim_prodcode,pim_mac,pim_indate,pim_inman,pim_type)");
|
|
|
- sql.Append("values(prodiomac_seq.nextval,'" + pi_inoutno.Text + "','" + pi_id.Text + "','" + dtms.Rows[0]["ms_prodcode"].ToString() + "','" + input.Text + "',sysdate,'" + User.UserCode + "',' ')");
|
|
|
+ sql.Append("insert into prodiomac(pim_id,pim_inoutno,pim_piid,pim_prodcode,pim_mac,pim_indate,pim_inman,pim_type,pim_inorout,pim_class)");
|
|
|
+ sql.Append("values(prodiomac_seq.nextval,'" + pi_inoutno.Text + "','" + pi_id.Text + "','" + dtms.Rows[0]["ms_prodcode"].ToString() + "','" + input.Text + "',sysdate,'" + User.UserCode + "',' ','OUT','出货')");
|
|
|
dh.ExecuteSql(sql.GetString(), "insert");
|
|
|
- dh.UpdateByCondition("makeserial", "ms_iostatus=2", " ms_id='" + ms_id + "'");
|
|
|
+ dh.UpdateByCondition("makeserial", "ms_outno='" + pi_inoutno.Text + "'", " ms_id='" + ms_id + "'");
|
|
|
+
|
|
|
}
|
|
|
|
|
|
//插入prodiomac表
|
|
|
@@ -485,8 +588,8 @@ namespace UAS_MES.Warehouse
|
|
|
pib_type = "BOX";
|
|
|
}
|
|
|
sql.Clear();
|
|
|
- sql.Append("insert into prodiomac(pim_id,pim_inoutno,pim_piid,pim_prodcode,pim_mac,pim_indate,pim_inman,pim_type,pim_outboxcode)");
|
|
|
- sql.Append("select prodiomac_seq.nextval,'" + pi_inoutno.Text + "','" + pi_id.Text + "',v_prodcode,v_barcode,sysdate,'" + User.UserCode + "','" + pib_type + "','" + input.Text + "' from mes_package_view where v_outboxcode='" + input.Text + "'");
|
|
|
+ sql.Append("insert into prodiomac(pim_id,pim_inoutno,pim_piid,pim_prodcode,pim_mac,pim_indate,pim_inman,pim_type,pim_outboxcode,pim_inorout,pim_class)");
|
|
|
+ sql.Append("select prodiomac_seq.nextval,'" + pi_inoutno.Text + "','" + pi_id.Text + "',v_prodcode,v_barcode,sysdate,'" + User.UserCode + "','" + pib_type + "','" + input.Text + "','OUT','出货' from mes_package_view where v_outboxcode='" + input.Text + "'");
|
|
|
dh.ExecuteSql(sql.GetString(), "insert");
|
|
|
}
|
|
|
|
|
|
@@ -525,6 +628,7 @@ namespace UAS_MES.Warehouse
|
|
|
insertprodiomac(type);
|
|
|
return true;
|
|
|
}
|
|
|
+
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
@@ -535,7 +639,7 @@ namespace UAS_MES.Warehouse
|
|
|
OperateResult.AppendText(type + input.Text + "已经被出货单:" + dt.Rows[0]["pa_outno"].ToString() + "采集,请重新输入\n", Color.Red, input);
|
|
|
return false;
|
|
|
}
|
|
|
- if (dt.Rows[0]["pa_status"].ToString() == "0")
|
|
|
+ if (dt.Rows[0]["pa_status"].ToString() != "1")
|
|
|
{
|
|
|
OperateResult.AppendText(type + input.Text + "未封装,请重新输入\n", Color.Red, input);
|
|
|
return false;
|
|
|
@@ -545,11 +649,34 @@ namespace UAS_MES.Warehouse
|
|
|
OperateResult.AppendText(type + input.Text + "已出库,请重新输入\n", Color.Red, input);
|
|
|
return false;
|
|
|
}
|
|
|
+ if (needMakeIn != "0")
|
|
|
+ {
|
|
|
+ if (dt.Rows[0]["pa_iostatus"].ToString() != "1")
|
|
|
+ {
|
|
|
+ OperateResult.AppendText(type + input.Text + "必须完工入库才允许出库\n", Color.Red, input);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
if (dt.Rows[0]["pa_downstatus"].ToString() != "0")
|
|
|
{
|
|
|
OperateResult.AppendText(type + input.Text + "处于下地状态,若需出货,请先取消下地\n", Color.Red, input);
|
|
|
return false;
|
|
|
}
|
|
|
+ if (dt.Rows[0]["pa_iostatus"].ToString() == "2")
|
|
|
+ {
|
|
|
+ OperateResult.AppendText(type + input.Text + "已经出货\n", Color.Red, input);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (dt.Rows[0]["pa_iostatus"].ToString() == "3")
|
|
|
+ {
|
|
|
+ OperateResult.AppendText(type + input.Text + "处于销售退货状态\n", Color.Red, input);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (dt.Rows[0]["pa_outno"].ToString() != "")
|
|
|
+ {
|
|
|
+ OperateResult.AppendText(type + input.Text + "已经被出货单" + dt.Rows[0]["pa_outno"].ToString() + "采集\n", Color.Red, input);
|
|
|
+ return false;
|
|
|
+ }
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
@@ -571,7 +698,7 @@ namespace UAS_MES.Warehouse
|
|
|
return;
|
|
|
}
|
|
|
List<String> ExeSQL = new List<string>();
|
|
|
- ExeSQL.Add("update makeserial set ms_iostatus=1 where exists (select 1 from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_mac=ms_sncode and pim_prodcode=ms_prodcode and nvl(pim_outboxcode,' ')=' ') and ms_status=2");
|
|
|
+ ExeSQL.Add("update makeserial set ms_outno = '' where exists (select 1 from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_mac=ms_sncode and pim_prodcode=ms_prodcode and nvl(pim_outboxcode,' ')=' ') and ms_status=2");
|
|
|
ExeSQL.Add("update package set pa_outno = '' where exists (select 1 from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_outboxcode=pa_outboxcode and ((pim_type='PALLET' AND PA_TYPE=3) OR (PIM_TYPE='BOX' AND PA_TYPE IN(1,2)))) AND PA_OUTNO='" + pi_inoutno.Text + "'");
|
|
|
ExeSQL.Add("delete from prodiomac where pim_inoutno='" + pi_inoutno.Text + "'");
|
|
|
ExeSQL.Add("update prodinout set pi_pdastatus='未备货' where pi_inoutno='" + pi_inoutno.Text + "'");
|