Эх сурвалжийг харах

卡通箱转移装入大箱后禁止转移

Hcsy 8 жил өмнө
parent
commit
b5c190d7e3

+ 17 - 2
UAS-MES/FunctionCode/Packing/Packing_CartonTransfer.cs

@@ -38,6 +38,7 @@ namespace UAS_MES.Packing
         string new_pa_salecode;
         string new_pa_checkno;
         string new_ob_result;
+        string new_pa_mothercode;
 
         public Packing_CartonTransfer()
         {
@@ -113,15 +114,21 @@ namespace UAS_MES.Packing
                     if (ms_outboxcode != "")
                     {
                         sql.Clear();
-                        sql.Append("select pa_id,pa_checkno,PA_CURRENTQTY pa_qty,PA_PACKTYPE,nvl(PA_DOWNSTATUS,0) PA_DOWNSTATUS,pa_prodcode  pa_macode,pa_salecode,pa_level,pa_custcode,pa_type,pa_packtype from package where pa_outboxcode='" + ms_outboxcode + "'");
+                        sql.Append("select pa_id,pa_checkno,PA_CURRENTQTY pa_qty,PA_PACKTYPE,nvl(PA_DOWNSTATUS,0) PA_DOWNSTATUS,pa_prodcode  pa_macode,pa_salecode,pa_level,pa_custcode,pa_type,pa_packtype,pa_mothercode from package where pa_outboxcode='" + ms_outboxcode + "'");
                         dtbar = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                         if (dtbar.Rows.Count > 0)
                         {
+                            string pa_mothercode = dtbar.Rows[0]["pa_mothercode"].ToString();
                             string PA_PACKTYPE = dtbar.Rows[0]["PA_PACKTYPE"].ToString();
                             string pa_checkno = dtbar.Rows[0]["pa_checkno"].ToString();
                             string PA_DOWNSTATUS = dtbar.Rows[0]["PA_DOWNSTATUS"].ToString();
                             string old_pa_id = dtbar.Rows[0]["pa_id"].ToString();
                             string ob_result = dh.getFieldDataByCondition("oqcbatch", "ob_result", "ob_checkno = '" + pa_checkno + "'").ToString();
+                            if (pa_mothercode != "")
+                            {
+                                OperateResult.AppendText(">>原箱" + ms_outboxcode + "已装入大箱,不允许转移\n", Color.Red, sn_code);
+                                return;
+                            }
                             if (PA_DOWNSTATUS == "0")
                             {
                                 BaseUtil.SetFormValue(this.Controls, dtbar);
@@ -304,7 +311,7 @@ namespace UAS_MES.Packing
         private Boolean CheckBoxCode()
         {
             sql.Clear();
-            sql.Append("select pa_id,pa_outboxcode,pa_checkno,pa_standardqty,nvl(pa_currentqty,0) pa_currentqty,pa_packtype,pa_prodcode,nvl(pa_downstatus,0) pa_downstatus,pa_salecode from package where pa_outboxcode='" + pa_outboxcode.Text + "'");
+            sql.Append("select pa_id,pa_outboxcode,pa_checkno,pa_standardqty,nvl(pa_currentqty,0) pa_currentqty,pa_packtype,pa_prodcode,nvl(pa_downstatus,0) pa_downstatus,pa_salecode,pa_mothercode from package where pa_outboxcode='" + pa_outboxcode.Text + "'");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             if (dt.Rows.Count > 0)
             {
@@ -315,6 +322,7 @@ namespace UAS_MES.Packing
                 new_pa_prodcode = dt.Rows[0]["pa_prodcode"].ToString();
                 new_pa_salecode = dt.Rows[0]["pa_salecode"].ToString();
                 new_pa_checkno = dt.Rows[0]["pa_checkno"].ToString();
+                new_pa_mothercode = dt.Rows[0]["pa_mothercode"].ToString();
                 new_ob_result = dh.getFieldDataByCondition("oqcbatch", "ob_result", "ob_checkno = '" + new_pa_checkno + "'").ToString();
                 if (new_pa_downstatus != "0")
                 {
@@ -331,6 +339,13 @@ namespace UAS_MES.Packing
                     pa_outboxcode.Focus();
                     return false;
                 }
+                else if (new_pa_mothercode != "")
+                {
+                    OperateResult.AppendText(">>目标箱号" + pa_outboxcode.Text + "装入大箱\n", Color.Red, pa_outboxcode);
+                    OperateResult.AppendText(">>请输入目标箱号\n", Color.Black);
+                    pa_outboxcode.Focus();
+                    return false;
+                }
                 BaseUtil.SetFormValue(this.Controls, dt);
                 return true;
             }