瀏覽代碼

获取工单添加状态参数

章政 8 年之前
父節點
當前提交
72f03d788b

+ 3 - 2
UAS-MES/FunctionCode/Make/Make_CollectBTMAC.cs

@@ -91,7 +91,8 @@ namespace UAS_MES.Make
                         if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage2))
                         {
                             //判断界面工单是否为空时的序列号是否自动归属工单
-                            if (!LogicHandler.GetMakeInfo(sncode.Text, out oMakeCode, out ErrorMessage2))
+                            string oStatus = "";
+                            if (!LogicHandler.GetMakeInfo(sncode.Text, out oMakeCode, out oStatus, out ErrorMessage2))
                             {
                                 if (ms_makecode.Text == "")
                                 {
@@ -272,7 +273,7 @@ namespace UAS_MES.Make
                             //提示正确返回时传递的信息
                             if (ErrorMessage.Contains("AFTERSUCCESS"))
                                 OperateResult.AppendText(">>" + ErrorMessage + "\n");
-                            dh.BatchInsert("update  makeserial set ms_mac = :mac,ms_bt =:bt where ms_id = :oMsId",new String[] { "mac", "bt", "oMsId" },new string[] { sncode.Text }, new string[] { ms_bt }, new string[] { oMsID.ToString() });
+                            dh.BatchInsert("update  makeserial set ms_mac = :mac,ms_bt =:bt where ms_id = :oMsId", new String[] { "mac", "bt", "oMsId" }, new string[] { sncode.Text }, new string[] { ms_bt }, new string[] { oMsID.ToString() });
                             OperateResult.AppendText(">>BT/MAC采集完成,执行更新\n", Color.Green);
                             LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "BT/MAC采集", "采集成功", sn_code, "");
                             sql.Clear();

+ 3 - 2
UAS-MES/FunctionCode/Make/Make_CollectNetCode.cs

@@ -61,7 +61,8 @@ namespace UAS_MES.Make
                     if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage2))
                     {
                         //判断界面工单是否为空时的序列号是否自动归属工单
-                        if (!LogicHandler.GetMakeInfo(sncode.Text, out oMakeCode, out ErrorMessage2))
+                        string oStatus = "";
+                        if (!LogicHandler.GetMakeInfo(sncode.Text, out oMakeCode, out oStatus, out ErrorMessage2))
                         {
                             if (ms_makecode.Text == "")
                             {
@@ -144,7 +145,7 @@ namespace UAS_MES.Make
                             if (ErrorMessage.Contains("AFTERSUCCESS"))
                                 OperateResult.AppendText(">>" + ErrorMessage + "\n");
                             //dh.UpdateByCondition("makeserial", "ms_netcode = '" + sncode.Text + "'", "ms_id = '" + oMsID + "'");
-                            dh.BatchInsert("update  makeserial set ms_netcode = :netcode where ms_id = :oMsId", new String[] {  "netcode", "oMsId" }, new string[] { sncode.Text }, new string[] { oMsID.ToString() });
+                            dh.BatchInsert("update  makeserial set ms_netcode = :netcode where ms_id = :oMsId", new String[] { "netcode", "oMsId" }, new string[] { sncode.Text }, new string[] { oMsID.ToString() });
                             OperateResult.AppendText(">>网标采集完成,执行更新\n", Color.Green);
                             LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, ms_makecode.Text, User.UserLineCode, User.UserSourceCode, "网标采集", "采集成功", sn_code, "");
                             sql.Clear();

+ 2 - 1
UAS-MES/FunctionCode/Make/Make_ColorBoxLabelPrint.cs

@@ -166,7 +166,8 @@ namespace UAS_MES.Make
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage2))
                 {
                     //判断界面工单是否为空时的序列号是否自动归属工单
-                    if (!LogicHandler.GetMakeInfo(sncode.Text, out oMakeCode, out ErrorMessage2))
+                    string oStatus = "";
+                    if (!LogicHandler.GetMakeInfo(sncode.Text, out oMakeCode, out oStatus, out ErrorMessage2))
                     {
                         if (ma_code.Text == "")
                         {

+ 2 - 1
UAS-MES/FunctionCode/Make/Make_FuselageLabelPrint.cs

@@ -83,7 +83,8 @@ namespace UAS_MES.Make
                     //定义临时变量
                     string oMakeCode = "";
                     string oMsId = "";
-                    if (!LogicHandler.GetMakeInfo(sncode.Text, out oMakeCode, out oErrorMessage))
+                    string oStatus = "";
+                    if (!LogicHandler.GetMakeInfo(sncode.Text, out oMakeCode, out oStatus, out oErrorMessage))
                     {
                         OperateResult.AppendText(">>" + oErrorMessage + "\n", Color.Red);
                         OperateResult.AppendText(">>请输入序列号\n", Color.Black, sncode);

+ 2 - 1
UAS-MES/FunctionCode/Make/Make_Repair.cs

@@ -188,7 +188,8 @@ namespace UAS_MES.Make
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
                     BadInf_1.Clear();
-                    if (LogicHandler.GetMakeInfo(GetSNCode.Text, out macode, out ErrorMessage))
+                    string oStatus = "";
+                    if (LogicHandler.GetMakeInfo(GetSNCode.Text, out macode,out oStatus, out ErrorMessage))
                     {
                         //验证makeserial或者ms_firstsn表序列号是否存在
                         sql.Clear();

+ 6 - 4
UAS-MES/FunctionCode/Make/Make_TestCollection.cs

@@ -165,8 +165,9 @@ namespace UAS_MES.Make
                 ChoosedList.Clear();
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
-                    LogicHandler.GetMakeInfo(ms_sncode.Text, out oMakeCode, out ErrorMessage);
-                    if (LogicHandler.CheckStepSNAndMacode(ma_code.Text != oMakeCode && oMakeCode != "" ? oMakeCode : ma_code.Text, User.UserSourceCode, ms_sncode.Text, User.UserCode, out oMakeCode, out oMSID, out ErrorMessage))
+                    string oStatus = "";
+                    LogicHandler.GetMakeInfo(ms_sncode.Text, out oMakeCode, out oStatus, out ErrorMessage);
+                    if (LogicHandler.CheckStepSNAndMacode(ma_code.Text != oMakeCode && oMakeCode != "" && oStatus != "2" ? oMakeCode : ma_code.Text, User.UserSourceCode, ms_sncode.Text, User.UserCode, out oMakeCode, out oMSID, out ErrorMessage))
                     {
                         if (ma_code.Text != oMakeCode && oMakeCode != null)
                         {
@@ -225,7 +226,7 @@ namespace UAS_MES.Make
             sql.Append("select bg_code||':'||bg_name bg_name,bg_code from badgroup left join (select pb_badgroup,pr_kind ");
             sql.Append("from product left join productkind on pk_name=pr_kind ");
             sql.Append("left join productbadgroup on pk_code=PB_KINDCODE where pr_code='" + ma_prodcode.Text + "')");
-            sql.Append("on pb_badgroup=bg_code order by case when bg_code='"+User.DefaultBadGroup+"' then 0 else 1 end");
+            sql.Append("on pb_badgroup=bg_code order by case when bg_code='" + User.DefaultBadGroup + "' then 0 else 1 end");
             DataTable dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
             bc_groupcode.DisplayMember = "bg_name";
             bc_groupcode.ValueMember = "bg_code";
@@ -391,7 +392,8 @@ namespace UAS_MES.Make
                 if (LogicHandler.CheckStepAttribute(Tag.ToString(), User.UserSourceCode, out ErrorMessage))
                 {
                     //判断界面工单是否为空时的序列号是否自动归属工单
-                    if (!LogicHandler.GetMakeInfo(ms_sncode.Text, out oMakeCode, out ErrorMessage))
+                    string oStatus = "";
+                    if (!LogicHandler.GetMakeInfo(ms_sncode.Text, out oMakeCode, out oStatus, out ErrorMessage))
                     {
                         if (ma_code.Text == "")
                         {

+ 8 - 2
UAS-MES/PublicMethod/LogicHandler.cs

@@ -289,12 +289,18 @@ namespace UAS_MES.PublicMethod
         /// <param name="oMakeCode"></param>
         /// <param name="oErrorMessage"></param>
         /// <returns></returns>
-        public static bool GetMakeInfo(string iSnCode, out string oMakeCode, out string oErrorMessage)
+        public static bool GetMakeInfo(string iSnCode, out string oMakeCode, out string oStatus, out string oErrorMessage)
         {
             //取MakeProcess表中的执行记录ID最大的一个工单的号码
             oMakeCode = "";
             oErrorMessage = "";
-            oMakeCode = dh.getFieldDataByCondition("MakeSerial", "ms_makecode", "ms_id=(select max(ms_id) from makeserial where ms_sncode='" + iSnCode + "' and ms_status=1)").ToString();
+            oStatus = "";
+            DataTable dt = dh.getFieldsDataByCondition("MakeSerial", new string[] { "ms_makecode", "ms_status" }, "ms_id=(select max(ms_id) from makeserial where ms_sncode='" + iSnCode + "')");
+            if (dt.Rows.Count > 0)
+            {
+                oMakeCode = dt.Rows[0]["ms_makecode"].ToString();
+                oStatus = dt.Rows[0]["ms_status"].ToString();
+            }
             if (oMakeCode != "")
                 return true;
             else