浏览代码

撤回修改

Hcsy 8 年之前
父节点
当前提交
885ce719ea

+ 39 - 153
UAS-MES/FunctionCode/Warehouse/Warehouse_FinishedProductOut.cs

@@ -56,7 +56,7 @@ namespace UAS_MES.Warehouse
             needMakeIn = dh.GetConfig("needMakeIn", "MESSetting").ToString();
             input.Focus();
             OperateResult.AppendText("请输入栈板进行采集\n", Color.Black, input);
-         
+
 
         }
 
@@ -249,7 +249,7 @@ namespace UAS_MES.Warehouse
                             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                             if (dt.Rows.Count > 0)
                             {
-                                if (!checkinput(dt, "栈板号",input.Text))
+                                if (!checkinput(dt, "栈板号"))
                                     return;
                                 pa_makecode = dt.Rows[0]["pa_makecode"].ToString();
                             }
@@ -262,91 +262,28 @@ namespace UAS_MES.Warehouse
                                 return;
                             //更新箱号对应的出货单号
                             dh.UpdateByCondition("package", "pa_outno = '" + pi_inoutno.Text + "'", "pa_outboxcode = '" + input.Text + "'");
-                            //.UpdateByCondition("makeserial", "ms_outno='" + pi_inoutno.Text + "'", "ms_id in (select max(ms_id)  from makeserial where ms_sncode in (select v_barcode from MES_PACKAGE_VIEW where v_outboxcode = '" + input.Text + "') and ms_outno is null GROUP BY ms_sncode)");
-                            List<string> v_barcode = new List<string>();
-                            List<string> v_makecode = new List<string>();
-                            DataTable datatable = (DataTable)dh.ExecuteSql("select v_makecode,v_barcode from MES_PACKAGE_VIEW where v_outboxcode = '" + input.Text + "'", "select");
-                            for (int i = 0; i < datatable.Rows.Count; i++)
-                            {
-                                v_barcode.Add(datatable.Rows[i]["v_barcode"].ToString());
-                                v_makecode.Add(datatable.Rows[i]["v_makecode"].ToString());
-                            }
-                            dh.BatchInsert("update makeserial set ms_outno='" + pi_inoutno.Text + "' where ms_sncode = :v_barcode and ms_makecode = :v_makecode and ms_outno is null", new string[] { "v_barcode", "v_makecode" }, v_barcode.ToArray(), v_makecode.ToArray());
                             LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode, User.UserLineCode, User.UserSourceCode, "栈板" + input.Text + "出货备货", "栈板" + input.Text + "出货备货成功", "", input.Text);
                         }
                         else if (bigboxBtn.Checked)
                         {
                             string outboxcode = dh.getFieldDataByCondition("makeserial", "ms_outboxcode", "ms_sncode = '" + input.Text + "'").ToString();
                             string pa_makecode = "";
-                            string pa_mothercode = "";
-                            string pa_id = "";
                             if (outboxcode != "")
                             {
                                 input.Text = outboxcode;
                             }
                             sql.Clear();
-                            sql.Append("select pa_id,pa_outboxcode,pa_makecode,pa_status,nvl(pa_iostatus,0) pa_iostatus,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_iostatus,0) pa_iostatus,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)
                             {
                                 pa_makecode = dt.Rows[0]["pa_makecode"].ToString();
-                                pa_mothercode = dt.Rows[0]["pa_mothercode"].ToString();
-                                pa_id = dt.Rows[0]["pa_id"].ToString();
-                                if (pa_mothercode != "")
+                                if (dt.Rows[0]["pa_mothercode"].ToString() != "")
                                 {
-                                    sql.Clear();
-                                    sql.Append("select pa_outboxcode,pa_status,pa_type,nvl(pa_iostatus,0) pa_iostatus,pa_makecode,pa_mothercode,nvl(pa_downstatus,0)pa_downstatus,pa_outno from package where pa_outboxcode='" + pa_mothercode + "'");
-                                    DataTable dtpall = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                                    if (dtpall.Rows.Count > 0)
-                                    {
-                                        if (dtpall.Rows[0]["pa_mothercode"].ToString() == "")
-                                        {
-                                            if (dtpall.Rows[0]["pa_type"].ToString() == "2")
-                                            {
-                                                if (!checkinput(dtpall, "箱号", pa_mothercode))
-                                                    return;
-                                            }
-                                            else if (dtpall.Rows[0]["pa_type"].ToString() == "3")
-                                            {
-                                                if (!checkinput(dtpall, "栈板",pa_mothercode))
-                                                    return;
-                                            }
-                                        }
-                                        else
-                                        {
-                                            sql.Clear();
-                                            sql.Append("select pa_outboxcode,pa_status,pa_type,nvl(pa_iostatus,0) pa_iostatus,pa_makecode,pa_mothercode,nvl(pa_downstatus,0)pa_downstatus,pa_outno from package where pa_outboxcode='" + dtpall.Rows[0]["pa_mothercode"].ToString() + "'");
-                                            DataTable dtpalltwo = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                                            if (dtpalltwo.Rows.Count > 0)
-                                            {
-                                                if (dtpalltwo.Rows[0]["pa_type"].ToString() == "2")
-                                                {
-                                                    if (!checkinput(dtpalltwo, "箱号", dtpall.Rows[0]["pa_mothercode"].ToString()))
-                                                        return;
-                                                }
-                                                else if (dtpalltwo.Rows[0]["pa_type"].ToString() == "3")
-                                                {
-                                                    if (!checkinput(dtpalltwo, "栈板", dtpall.Rows[0]["pa_mothercode"].ToString()))
-                                                        return;
-                                                }
-                                            }
-                                            else {
-                                                OperateResult.AppendText("箱号" + input.Text + "已装大箱或栈板" + pa_mothercode + "不存在,出货失败\n", Color.Red, input);
-                                                return;
-                                            }
-                                        }
-                                        if (needMakeIn != "0")
-                                        {
-                                            dh.UpdateByCondition("package", "pa_iostatus = 1", "pa_outboxcode = '" + input.Text + "'");
-                                        }
-                                    }
-                                    else
-                                    {
-                                        OperateResult.AppendText("箱号" + input.Text + "已装大箱或栈板" + pa_mothercode + "不存在,出货失败\n", Color.Red, input);
-                                        return;
-                                    }
+                                    OperateResult.AppendText("箱号" + input.Text + "已经装大箱或者栈板" + dt.Rows[0]["pa_mothercode"].ToString() + ",不允许单独出货\n", Color.Red, input);
+                                    return;
                                 }
-                                if (!checkinput(dt, "箱号",input.Text))
+                                if (!checkinput(dt, "箱号"))
                                     return;
                             }
                             else
@@ -358,15 +295,6 @@ namespace UAS_MES.Warehouse
                                 return;
                             //更新箱号对应的出货单号
                             dh.UpdateByCondition("package", "pa_outno = '" + pi_inoutno.Text + "'", "pa_outboxcode = '" + input.Text + "'");
-                            List<string> v_barcode = new List<string>();
-                            List<string> v_makecode = new List<string>();
-                            DataTable datatable = (DataTable)dh.ExecuteSql("select v_makecode,v_barcode from MES_PACKAGE_VIEW where v_outboxcode = '" + input.Text + "'", "select");
-                            for (int i = 0; i < datatable.Rows.Count; i++)
-                            {
-                                v_barcode.Add(datatable.Rows[i]["v_barcode"].ToString());
-                                v_makecode.Add(datatable.Rows[i]["v_makecode"].ToString());
-                            }
-                            dh.BatchInsert("update makeserial set ms_outno='" + pi_inoutno.Text + "' where ms_sncode = :v_barcode and ms_makecode = :v_makecode and ms_outno is null", new string[] { "v_barcode", "v_makecode" }, v_barcode.ToArray(), v_makecode.ToArray());
                             LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode, User.UserLineCode, User.UserSourceCode, "箱号" + input.Text + "出货备货", "箱号" + input.Text + "出货备货成功", "", input.Text);
                         }
                         else if (serBtn.Checked)
@@ -396,33 +324,8 @@ namespace UAS_MES.Warehouse
                                 }
                                 if (ms_outboxcode != "")
                                 {
-                                    //OperateResult.AppendText("序列号" + input.Text + "有外箱号,不允许单独出货\n", Color.Red, input);
-                                    //return;
-                                    string outpackcode =  dh.getFieldDataByCondition("MES_PACKAGE_VIEW", "max(v_outboxcode)", "V_BARCODE = '" + input.Text + "'").ToString();
-                                    sql.Clear();
-                                    sql.Append("select pa_outboxcode,pa_status,pa_type,nvl(pa_iostatus,0) pa_iostatus,pa_makecode,pa_mothercode,nvl(pa_downstatus,0)pa_downstatus,pa_outno from package where pa_outboxcode='" + outpackcode + "'");
-                                    DataTable dtpall = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                                    if (dtpall.Rows.Count > 0)
-                                    {
-                                        if (dtpall.Rows[0]["pa_mothercode"].ToString() == "")
-                                        {
-                                            if (dtpall.Rows[0]["pa_type"].ToString() == "2")
-                                            {
-                                                if (!checkinput(dtpall, "箱号", outpackcode))
-                                                    return;
-                                            }
-                                            else if (dtpall.Rows[0]["pa_type"].ToString() == "3")
-                                            {
-                                                if (!checkinput(dtpall, "栈板", outpackcode))
-                                                    return;
-                                            }
-                                        }
-                                    }
-                                    else
-                                    {
-                                        OperateResult.AppendText("序列号" + input.Text + "已装箱或栈板" + outpackcode + "不存在,出货失败\n", Color.Red, input);
-                                        return;
-                                    }
+                                    OperateResult.AppendText("序列号" + input.Text + "有外箱号,不允许单独出货\n", Color.Red, input);
+                                    return;
                                 }
                                 if (ms_downstatus != "0")
                                 {
@@ -447,7 +350,7 @@ namespace UAS_MES.Warehouse
                                         return;
                                     }
                                 }
-                           
+
                                 if (ms_outno != "")
                                 {
                                     OperateResult.AppendText("序列号" + input.Text + "已经被出货单:" + ms_outno + "采集\n", Color.Red, input);
@@ -545,16 +448,6 @@ namespace UAS_MES.Warehouse
                                     OperateResult.AppendText("栈板号" + input.Text + "所属出货单号" + pa_outno + "与当前所选出货单号" + pi_inoutno.Text + "\n", Color.Red, input);
                                     return;
                                 }
-                               
-                                List<string> pim_mac = new List<string>();
-                                List<string> pim_prodcode = new List<string>();
-                                DataTable datatable = (DataTable)dh.ExecuteSql("select pim_prodcode,pim_mac from  prodiomac where pim_outboxcode = '" + input.Text + "' and pim_type='PALLET' and pim_inorout='OUT'  AND pim_class='出货'", "select");
-                                for (int i = 0; i < datatable.Rows.Count; i++)
-                                {
-                                    pim_mac.Add(datatable.Rows[i]["pim_mac"].ToString());
-                                    pim_prodcode.Add(datatable.Rows[i]["pim_prodcode"].ToString());
-                                }
-                                dh.BatchInsert("update makeserial set ms_outno='' where ms_sncode = :pim_mac and ms_prodcode = :pim_prodcode and ms_outno = '" + pi_inoutno.Text + "'", new string[] { "pim_mac", "pim_prodcode" }, pim_mac.ToArray(), pim_prodcode.ToArray());
                                 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);
@@ -599,22 +492,13 @@ namespace UAS_MES.Warehouse
                                     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.UpdateByCondition("package", "pa_outno=''", "pa_outboxcode='" + input.Text + "'");
-                                List<string> pim_mac = new List<string>();
-                                List<string> pim_prodcode = new List<string>();
-                                DataTable datatable = (DataTable)dh.ExecuteSql("select pim_prodcode,pim_mac from  prodiomac where pim_outboxcode = '" + input.Text + "' and pim_type='BOX' and pim_inorout='OUT'  AND pim_class='出货'", "select");
-                                for (int i = 0; i < datatable.Rows.Count; i++)
+                                if (pa_mothercode != "")
                                 {
-                                    pim_mac.Add(datatable.Rows[i]["pim_mac"].ToString());
-                                    pim_prodcode.Add(datatable.Rows[i]["pim_prodcode"].ToString());
+                                    OperateResult.AppendText("箱号" + input.Text + "已经装大箱或栈板:" + pa_mothercode + ",不允许单独操作\n", Color.Red, input);
+                                    return;
                                 }
-                                dh.BatchInsert("update makeserial set ms_outno='' where ms_sncode = :pim_mac and ms_prodcode = :pim_prodcode and ms_outno = '" + pi_inoutno.Text + "'", new string[] { "pim_mac", "pim_prodcode" }, pim_mac.ToArray(), pim_prodcode.ToArray());
                                 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, pa_makecode, User.UserLineCode, User.UserSourceCode, "箱号" + input.Text + "取消出货备货", "箱号" + input.Text + "取消出货备货成功", "", input.Text);
                             }
@@ -657,14 +541,14 @@ namespace UAS_MES.Warehouse
                                     OperateResult.AppendText("序列号" + input.Text + "所属出货单号" + ms_outno + "与当前所选出货单号" + pi_inoutno.Text + "\n", Color.Red, input);
                                     return;
                                 }
-                                //if (ms_outboxcode != "")
-                                //{
-                                //    OperateResult.AppendText("箱号" + input.Text + "已经装大箱:" + ms_outboxcode + ",不允许单独操作\n", Color.Red, input);
-                                //    return;
-                                //}
+                                if (ms_outboxcode != "")
+                                {
+                                    OperateResult.AppendText("箱号" + input.Text + "已经装大箱:" + ms_outboxcode + ",不允许单独操作\n", Color.Red, input);
+                                    return;
+                                }
                                 dh.ExecuteSql("delete from prodiomac where pim_id in (select pim_id from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_mac='" + input.Text + "' and pim_inorout='OUT' and pim_class='出货')", "delete");
                                 dh.UpdateByCondition("makeserial", " ms_outno = ''", "ms_id = '" + ms_id + "'");
-                                LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode, User.UserLineCode, User.UserSourceCode, "序列号" + input.Text + "取消出货备货", "序列号" + input.Text + "取消出货备货成功",  input.Text, "");
+                                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
@@ -715,7 +599,7 @@ 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,pim_outboxcode,pim_inorout,pim_class)");
-            sql.Append("select prodiomac_seq.nextval,'" + pi_inoutno.Text + "','" + pi_id.Text + "',v_prodcode,ms_sncode,sysdate,'" + User.UserCode + "','" + pib_type + "','" + input.Text + "','OUT','出货' from mes_package_view left join makeserial on ms_sncode=v_barcode and ms_makecode=v_makecode where v_outboxcode='" + input.Text + "' and ms_outno is null");
+            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");
         }
 
@@ -735,16 +619,16 @@ namespace UAS_MES.Warehouse
                 sql.Clear();
                 sql.Append("select ms_prodcode,ms_salecode,cn  from (select ms_prodcode,ms_salecode,count(1)cn from mes_package_view left join makeserial on ms_sncode=v_barcode and ms_makecode=v_makecode  where v_outboxcode='" + input.Text + "' ");
                 sql.Append(" group by ms_prodcode,ms_salecode) left join (select pd_ordercode,pd_prodcode,outqty-nvl((select count(1) from prodiomac where pim_inoutno='" + pi_inoutno.Text + "' and pim_prodcode=pd_prodcode),0)ungetqty");
-                sql.Append("  from (select pd_ordercode,pd_prodcode,sum(pd_outqty)outqty from prodiodetail where pd_piid=" + pi_id.Text + " group by pd_prodcode,pd_ordercode)) on ms_prodcode=pd_prodcode where nvl(pd_prodcode,' ')<>' ' and ms_salecode<>pd_ordercode and ms_outno is null and or(ms_salecode=pd_ordercode and cn>nvl(ungetqty,0))");
+                sql.Append("  from (select pd_ordercode,pd_prodcode,sum(pd_outqty)outqty from prodiodetail where pd_piid=" + pi_id.Text + " group by pd_prodcode,pd_ordercode)) on ms_prodcode=pd_prodcode where nvl(pd_prodcode,' ')<>' ' and ms_salecode<>pd_ordercode or(ms_salecode=pd_ordercode and cn>nvl(ungetqty,0))");
                 DataTable dtAA = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
-                if (dtAA.Rows.Count>0)
+                if (dtAA.Rows.Count > 0)
                 {
                     string badmessgae = "";
                     for (int i = 0; i < dtAA.Rows.Count; i++)
                     {
                         badmessgae += "物料号:" + dtAA.Rows[i]["ms_prodcode"].ToString() + ",订单号:" + dtAA.Rows[i]["ms_salecode"].ToString() + ",数量:" + dtAA.Rows[i]["cn"].ToString() + "\n";
                     }
-                    OperateResult.AppendText(type + input.Text + "内的序列号中的物料+订单不在出货单中或者所装的序列号的数量大于剩余出货数,"+badmessgae, Color.Red, input);
+                    OperateResult.AppendText(type + input.Text + "内的序列号中的物料+订单不在出货单中或者所装的序列号的数量大于剩余出货数," + badmessgae, Color.Red, input);
                     return false;
                 }
                 else
@@ -763,49 +647,51 @@ namespace UAS_MES.Warehouse
             return true;
         }
 
-        private Boolean checkinput(DataTable dt, string type,string inputmessage)
+        private Boolean checkinput(DataTable dt, string type)
         {
+            if (dt.Rows[0]["pa_outno"].ToString() != "")
+            {
+                OperateResult.AppendText(type + input.Text + "已经被出货单:" + dt.Rows[0]["pa_outno"].ToString() + "采集,请重新输入\n", Color.Red, input);
+                return false;
+            }
             if (dt.Rows[0]["pa_status"].ToString() != "1")
             {
-                OperateResult.AppendText(type + inputmessage + "未封装,请重新输入\n", Color.Red, input);
+                OperateResult.AppendText(type + input.Text + "未封装,请重新输入\n", Color.Red, input);
                 return false;
             }
             else if (dt.Rows[0]["pa_status"].ToString() == "2")
             {
-                OperateResult.AppendText(type + inputmessage + "已出库,请重新输入\n", Color.Red, input);
+                OperateResult.AppendText(type + input.Text + "已出库,请重新输入\n", Color.Red, input);
                 return false;
             }
             if (dt.Rows[0]["pa_iostatus"].ToString() == "2")
             {
-                OperateResult.AppendText(type + inputmessage + "已经出货\n", Color.Red, input);
+                OperateResult.AppendText(type + input.Text + "已经出货\n", Color.Red, input);
                 return false;
             }
             if (dt.Rows[0]["pa_iostatus"].ToString() == "3")
             {
-                OperateResult.AppendText(type + inputmessage + "处于销售退货状态\n", Color.Red, input);
+                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 + inputmessage + "必须完工入库才允许出库\n", Color.Red, input);
+                    OperateResult.AppendText(type + input.Text + "必须完工入库才允许出库\n", Color.Red, input);
                     return false;
                 }
             }
             if (dt.Rows[0]["pa_downstatus"].ToString() != "0")
             {
-                OperateResult.AppendText(type + inputmessage + "处于下地状态,若需出货,请先取消下地\n", Color.Red, input);
+                OperateResult.AppendText(type + input.Text + "处于下地状态,若需出货,请先取消下地\n", Color.Red, input);
                 return false;
             }
 
-            if (input.Text == inputmessage)
+            if (dt.Rows[0]["pa_outno"].ToString() != "")
             {
-                if (dt.Rows[0]["pa_outno"].ToString() != "")
-                {
-                    OperateResult.AppendText(type + inputmessage + "已经被出货单" + dt.Rows[0]["pa_outno"].ToString() + "采集\n", Color.Red, input);
-                    return false;
-                }
+                OperateResult.AppendText(type + input.Text + "已经被出货单" + dt.Rows[0]["pa_outno"].ToString() + "采集\n", Color.Red, input);
+                return false;
             }
             return true;
         }

+ 8 - 27
UAS-MES/FunctionCode/Warehouse/Warehouse_ProductMakeIn.cs

@@ -207,7 +207,7 @@ namespace UAS_MES.Warehouse
                             }
                             DeleteData();
                             deleteprodiomac(pa_id, pa_makecode, "PALLET");
-                            OperateResult.AppendText("栈板" + input.Text + "取消完工入库成功\n", Color.Green,input);
+                            OperateResult.AppendText("栈板" + input.Text + "取消完工入库成功\n", Color.Green, input);
                         }
                         else
                         {
@@ -252,7 +252,7 @@ namespace UAS_MES.Warehouse
                             }
                             DeleteData();
                             deleteprodiomac(pa_id, pa_makecode, "BOX");
-                            OperateResult.AppendText("箱号" + input.Text + "取消完工入库成功\n", Color.Green,input);
+                            OperateResult.AppendText("箱号" + input.Text + "取消完工入库成功\n", Color.Green, input);
                         }
                         else
                         {
@@ -301,8 +301,8 @@ namespace UAS_MES.Warehouse
                             sql.Append(" pim_mac='" + input.Text + "' and pim_inorout='IN' AND pim_class='完工入库' )");
                             dh.ExecuteSql(sql.GetString(), "delete");
                             dh.UpdateByCondition("makeserial", "ms_iostatus=0", " 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.Green,input);
+                            LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode, User.UserLineCode, User.UserSourceCode, "序列号" + input.Text + "取消完工入库", "序列号" + input.Text + "取消完工入库成功", input.Text, "");
+                            OperateResult.AppendText("序列号" + input.Text + "取消完工入库成功\n", Color.Green, input);
                         }
                     }
                     else
@@ -313,7 +313,7 @@ namespace UAS_MES.Warehouse
 
                 }
                 getqty.Text = ((DataTable)bindingSource1.DataSource).Rows.Count.ToString();
-             
+
             }
         }
 
@@ -373,16 +373,7 @@ namespace UAS_MES.Warehouse
             }
             else
                 type = "栈板";
-            //dh.UpdateByCondition("makeserial", "ms_iostatus=1", "ms_id in (select max(ms_id)  from makeserial where ms_sncode in (select v_barcode from MES_PACKAGE_VIEW where v_outboxcode = '"+input.Text+"') GROUP BY ms_sncode)");
-            List<string> v_barcode = new List<string>();
-            List<string> v_makecode = new List<string>();
-            DataTable datatable =  (DataTable)dh.ExecuteSql("select v_makecode,v_barcode from MES_PACKAGE_VIEW where v_outboxcode = '" + input.Text + "'","select");
-            for (int i = 0; i < datatable.Rows.Count; i++)
-            {
-                v_barcode.Add(datatable.Rows[i]["v_barcode"].ToString());
-                v_makecode.Add(datatable.Rows[i]["v_makecode"].ToString());
-            }
-            dh.BatchInsert("update makeserial set ms_iostatus=1 where ms_sncode = :v_barcode and ms_makecode = :v_makecode",new string[] { "v_barcode", "v_makecode" },v_barcode.ToArray(),v_makecode.ToArray());
+
             LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode, User.UserLineCode, User.UserSourceCode, type + "号" + input.Text + "完工入库", type + "号" + input.Text + "完工入库成功", "", input.Text);
             return;
         }
@@ -424,8 +415,8 @@ namespace UAS_MES.Warehouse
                 sql.Clear();
                 sql.Append("select pim_id,pim_outboxcode,pim_mac,pim_prodcode,pr_detail,pr_spec from prodiomac ");
                 sql.Append("left join product on pr_code=pim_prodcode where pim_outboxcode='" + input.Text + "' and pim_inorout='IN' AND pim_class='完工入库'");
-                DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select"); 
-                BaseUtil.FillDgvWithDataTable(InOutDetailDGV,BaseUtil.DataTableMerge((DataTable)bindingSource1.DataSource,dt, "pim_id"));
+                DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+                BaseUtil.FillDgvWithDataTable(InOutDetailDGV, BaseUtil.DataTableMerge((DataTable)bindingSource1.DataSource, dt, "pim_id"));
             }
             else
             {
@@ -445,17 +436,7 @@ namespace UAS_MES.Warehouse
             sql.Append(" pim_outboxcode='" + input.Text + "' and pim_type='" + type + "' and pim_inorout='IN' AND pim_class='完工入库' )");
             dh.ExecuteSql(sql.GetString(), "delete");
             dh.UpdateByCondition("package", "pa_iostatus=0", "pa_id='" + pa_id + "'");
-            List<string> v_barcode = new List<string>();
-            List<string> v_makecode = new List<string>();
-            DataTable datatable = (DataTable)dh.ExecuteSql("select v_makecode,v_barcode from MES_PACKAGE_VIEW where v_outboxcode = '" + input.Text + "'", "select");
-            for (int i = 0; i < datatable.Rows.Count; i++)
-            {
-                v_barcode.Add(datatable.Rows[i]["v_barcode"].ToString());
-                v_makecode.Add(datatable.Rows[i]["v_makecode"].ToString());
-            }
-            dh.BatchInsert("update makeserial set ms_iostatus=0 where ms_sncode = :v_barcode and ms_makecode = :v_makecode", new string[] { "v_barcode", "v_makecode" }, v_barcode.ToArray(), v_makecode.ToArray());
             LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, pa_makecode, User.UserLineCode, User.UserSourceCode, type + "号" + input.Text + "取消完工入库", type + "号" + input.Text + "取消完工入库成功", "", input.Text);
-            //dh.UpdateByCondition("makeserial", "ms_iostatus=0", "ms_id in (select max(ms_id)  from makeserial where ms_sncode in (select v_barcode from MES_PACKAGE_VIEW where v_outboxcode = '" + input.Text + "') GROUP BY ms_sncode)");
             return;
         }