Browse Source

Merge branch 'master' of ssh://10.10.100.21/source/mes-client

章政 8 years ago
parent
commit
3de95eb911

+ 3 - 3
UAS-MES/FunctionCode/Make/Make_PalletCollection.cs

@@ -88,6 +88,7 @@ namespace UAS_MES.Make
         {
             if (e.KeyCode == Keys.Enter)
             {
+                LoadGridData();
                 sql.Clear();
                 sql.Append("select pa_makecode,pa_id,pa_status,nvl(pa_standardqty,PR_PALLETQTY)pa_standardqty,pa_prodcode,pa_packageqty,pa_totalqty,pa_salecode,pa_currentqty,pr_code pa_prodcode,pa_outboxcode,pa_totalqty,pa_custcode ");
                 sql.Append("from package left join packagedetail on pa_id =pd_paid left join product on pr_code=pd_prodcode where pa_outboxcode='" + pa_outboxcode.Text + "' and pa_type =3");
@@ -97,7 +98,6 @@ namespace UAS_MES.Make
                     BaseUtil.SetFormValue(Controls, dt);
                     pa_id = dt.Rows[0]["pa_id"].ToString();
                 }
-                LoadGridData();
                 if (CheckOutBoxLength())
                 {
                     if (pa_standardqty.Text == "")
@@ -287,7 +287,7 @@ namespace UAS_MES.Make
                                     LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, "", User.UserLineCode, User.UserSourceCode, "栈板采集", "栈板" + pa_outboxcode.Text + "采集箱" + outboxcode.Text + "成功", pa_outboxcode.Text, "");
                                     OperateResult.AppendText(">>箱号" + outboxcode.Text + "采集成功!\n", Color.Green, outboxcode);
                                     LoadCollectNum();
-                                    LoadGridData();
+                                    palletcode_KeyDown(sender, e);
                                     if (pa_standardqty.Text == pa_totalqty.Text)
                                     {
                                         dh.ExecuteSql("update package set pa_status=1 where pa_outboxcode='" + pa_outboxcode.Text + "'", "update");
@@ -333,7 +333,7 @@ namespace UAS_MES.Make
                                 dh.ExecuteSQLTran(SQLS.ToArray());
                                 OperateResult.AppendText(">>箱号" + outboxcode.Text + "取消采集成功\n", Color.Green);
                                 LoadCollectNum();
-                                LoadGridData();
+                                palletcode_KeyDown(sender, e);
                                 outboxcode.Clear();
                             }
                             else OperateResult.AppendText(">>栈板" + pa_outboxcode.Text + "已入库,不允许取消采集\n", Color.Red);

+ 18 - 5
UAS-MES/FunctionCode/Make/Make_SeqProgramTransform.cs

@@ -395,12 +395,25 @@ namespace UAS_MES.Make
                     imeif = code.Text;
                 }
             }
-            //如果前缀和长度都满足的话
-            if ((ListA.Rows[step - 2]["psr_length"].ToString() == "0" ? false : code.Text.Length != int.Parse(ListA.Rows[step - 2]["psr_length"].ToString())))
+            if (code.Text.Length > 40)
             {
-                OperateResult.AppendText("<<" + ListA.Rows[step - 2]["psr_type"] + "长度需为"+ ListA.Rows[step - 2]["psr_length"].ToString() + "校验不通过,请重新输入\n", Color.Red);
-                OperateResult.AppendText(">>请重新输入" + ListA.Rows[step - 2]["psr_type"] + "\n", Color.Black, code);
-                return false;
+                //如果前缀和长度都满足的话
+                if ((ListA.Rows[step - 2]["psr_length"].ToString() == "0" ? false : code.Text.Substring(0,40).Length != int.Parse(ListA.Rows[step - 2]["psr_length"].ToString())))
+                {
+                    OperateResult.AppendText("<<" + ListA.Rows[step - 2]["psr_type"] + "长度需为" + ListA.Rows[step - 2]["psr_length"].ToString() + "校验不通过,请重新输入\n", Color.Red);
+                    OperateResult.AppendText(">>请重新输入" + ListA.Rows[step - 2]["psr_type"] + "\n", Color.Black, code);
+                    return false;
+                }
+            }
+            else
+            {
+                //如果前缀和长度都满足的话
+                if ((ListA.Rows[step - 2]["psr_length"].ToString() == "0" ? false : code.Text.Length != int.Parse(ListA.Rows[step - 2]["psr_length"].ToString())))
+                {
+                    OperateResult.AppendText("<<" + ListA.Rows[step - 2]["psr_type"] + "长度需为" + ListA.Rows[step - 2]["psr_length"].ToString() + "校验不通过,请重新输入\n", Color.Red);
+                    OperateResult.AppendText(">>请重新输入" + ListA.Rows[step - 2]["psr_type"] + "\n", Color.Black, code);
+                    return false;
+                }
             }
             //以|符号分割前缀
             string[] preFixs = ListA.Rows[step - 2]["psr_prefix"].ToString().Split('|');