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

修改完工的序列号装箱的BUG

章政 8 жил өмнө
parent
commit
d2ff2646d2

+ 6 - 1
UAS-MES/FunctionCode/Make/Make_PackageCollection.cs

@@ -140,8 +140,13 @@ namespace UAS_MES.Make
             {
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
-                    if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage) || dh.CheckExist("makeserial", "ms_sncode='" + sn_code.Text + "' and ms_status=2"))
+                    dt = (DataTable)dh.ExecuteSql("select ms_id from makeserial where ms_sncode ='" + sn_code.Text + "' and ms_status=2 order by ms_id desc", "select");
+                    if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage) || (dt.Rows.Count > 0))
                     {
+                        if (oMsID == "" || oMsID == "null")
+                        {
+                            oMsID = dt.Rows[0]["ms_id"].ToString();
+                        }
                         //获取序列号信息
                         sql.Clear();
                         sql.Append("select pr_code,ms_makecode,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,pr_code,pr_detail,");

+ 6 - 1
UAS-MES/FunctionCode/Make/Make_PackageCollectionWeigh.cs

@@ -217,8 +217,13 @@ namespace UAS_MES.Make
             {
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
-                    if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage) || dh.CheckExist("makeserial", "ms_sncode='" + sn_code.Text + "' and ms_status=2"))
+                    dt = (DataTable)dh.ExecuteSql("select ms_id from makeserial where ms_sncode ='" + sn_code.Text + "' and ms_status=2 order by ms_id desc", "select");
+                    if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage) || (dt.Rows.Count > 0))
                     {
+                        if (oMsID == "" || oMsID == "null")
+                        {
+                            oMsID = dt.Rows[0]["ms_id"].ToString();
+                        }
                         sql.Clear();
                         sql.Append("select ms_makecode,pr_code,nvl(pa_downstatus,0) pa_downstatus,pa_sccode,pa_checkno,pr_packrule,pr_code,pr_detail,");
                         sql.Append("nvl(pr_outboxinnerqty,0)pr_outboxinnerqty from makeserial left join product on ms_prodcode=pr_code left join packagedetail ");

+ 6 - 1
UAS-MES/FunctionCode/Make/Make_SpecialCartonPack.cs

@@ -222,8 +222,13 @@ namespace UAS_MES.Make
             {
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
-                    if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage) || dh.CheckExist("makeserial", "ms_sncode='" + sn_code.Text + "' and ms_status=2"))
+                    dt = (DataTable)dh.ExecuteSql("select ms_id from makeserial where ms_sncode ='" + sn_code.Text + "' and ms_status=2 order by ms_id desc", "select");
+                    if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sn_code.Text, User.UserCode, out oMakeCode, out oMsID, out ErrorMessage) || dt.Rows.Count > 0)
                     {
+                        if (oMsID == "" || oMsID == "null")
+                        {
+                            oMsID = dt.Rows[0]["ms_id"].ToString();
+                        }
                         if (pa_outboxcode.Text == "")
                         {
                             LoadData();

+ 1 - 1
UAS-MES/PublicMethod/Print.cs

@@ -4,8 +4,8 @@ using System.Data;
 using System.Text;
 using System.IO;
 using UAS_MES.Entity;
-using System.Windows;
 using System.Text.RegularExpressions;
+using System.Windows.Forms;
 
 namespace UAS_MES.PublicMethod
 {