Browse Source

笔记本信息核对功能

callm 1 year ago
parent
commit
1ddf0c58d8

+ 74 - 18
UAS_MES_PW/FunctionCode/Make/Make_CollectElec.cs

@@ -70,6 +70,11 @@ namespace UAS_MES_NEW.Make
                     KEY.Text = arr[3];
                     KEY.Text = arr[3];
                     MAC.Text = arr[4];
                     MAC.Text = arr[4];
                     IMEI.Text = arr[5];
                     IMEI.Text = arr[5];
+                    if (dh.CheckExist("wincheck", "WC_SNCODE<>'" + TSN.Text + "' and ( WC_PSN='" + PSN.Text + "' or WC_PKID='" + PKID.Text + "' or WC_KEY='" + KEY.Text + "' or WC_MAC='" + IMEI.Text + "' or  WC_IMEI='" + IMEI.Text + "')"))
+                    {
+                        OperateResult.AppendText(">>包含重复信息\n", Color.Red);
+                        return;
+                    }
                     sncode.Text = TSN.Text;
                     sncode.Text = TSN.Text;
                     if (sncode.Text == "")
                     if (sncode.Text == "")
                     {
                     {
@@ -97,7 +102,7 @@ namespace UAS_MES_NEW.Make
                             sql.Append(" ms_prodcode = pr_code where ms_id  = '" + oMsID + "'");
                             sql.Append(" ms_prodcode = pr_code where ms_id  = '" + oMsID + "'");
                             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                             BaseUtil.SetFormValue(this.Controls, dt);
                             BaseUtil.SetFormValue(this.Controls, dt);
-                            OperateResult.AppendText(">>请输入电量\n", Color.Black);
+                            OperateResult.AppendText(">>请输入核对参数\n", Color.Black);
                             sn_code = sncode.Text;
                             sn_code = sncode.Text;
                             sncode.Text = "";
                             sncode.Text = "";
                             isnetcode = true;
                             isnetcode = true;
@@ -117,9 +122,16 @@ namespace UAS_MES_NEW.Make
                             if (TSN.Text == sncode.Text)
                             if (TSN.Text == sncode.Text)
                             {
                             {
                                 TSN_CHECK.Text = sncode.Text;
                                 TSN_CHECK.Text = sncode.Text;
-                                if (CheckInfoPass())
                                 {
                                 {
                                     OperateResult.AppendText(">>TSN核对成功\n", Color.Green);
                                     OperateResult.AppendText(">>TSN核对成功\n", Color.Green);
+                                    if (CheckInfoPass())
+                                    {
+                                        dh.ExecuteSql("insert into wincheck(WC_ID, WC_SNCODE, WC_PSN, WC_PKID, WC_KEY, WC_MAC, WC_IMEI) values(wincheck_seq.nextval,'" + TSN.Text + "','" + PSN.Text + "','" + PKID.Text + "','" + KEY.Text + "','" + MAC.Text + "','" + IMEI.Text + "')", "insert");
+                                        isnetcode = false;
+                                        sncode.Text = "";
+                                        sncode.Focus();
+                                        return;
+                                    }
                                     return;
                                     return;
                                 }
                                 }
                             }
                             }
@@ -137,9 +149,16 @@ namespace UAS_MES_NEW.Make
                             if (PSN.Text == sncode.Text)
                             if (PSN.Text == sncode.Text)
                             {
                             {
                                 PSN_CHECK.Text = sncode.Text;
                                 PSN_CHECK.Text = sncode.Text;
-                                if (CheckInfoPass())
                                 {
                                 {
                                     OperateResult.AppendText(">>PSN核对成功\n", Color.Green);
                                     OperateResult.AppendText(">>PSN核对成功\n", Color.Green);
+                                    if (CheckInfoPass())
+                                    {
+                                        dh.ExecuteSql("insert into wincheck(WC_ID, WC_SNCODE, WC_PSN, WC_PKID, WC_KEY, WC_MAC, WC_IMEI) values(wincheck_seq.nextval,'" + TSN.Text + "','" + PSN.Text + "','" + PKID.Text + "','" + KEY.Text + "','" + MAC.Text + "','" + IMEI.Text + "')", "insert");
+                                        isnetcode = false;
+                                        sncode.Text = "";
+                                        sncode.Focus();
+                                        return;
+                                    }
                                     return;
                                     return;
                                 }
                                 }
                             }
                             }
@@ -157,9 +176,16 @@ namespace UAS_MES_NEW.Make
                             if (PKID.Text == sncode.Text)
                             if (PKID.Text == sncode.Text)
                             {
                             {
                                 PKID_CHECK.Text = sncode.Text;
                                 PKID_CHECK.Text = sncode.Text;
-                                if (CheckInfoPass())
                                 {
                                 {
                                     OperateResult.AppendText(">>PKID核对成功\n", Color.Green);
                                     OperateResult.AppendText(">>PKID核对成功\n", Color.Green);
+                                    if (CheckInfoPass())
+                                    {
+                                        dh.ExecuteSql("insert into wincheck(WC_ID, WC_SNCODE, WC_PSN, WC_PKID, WC_KEY, WC_MAC, WC_IMEI) values(wincheck_seq.nextval,'" + TSN.Text + "','" + PSN.Text + "','" + PKID.Text + "','" + KEY.Text + "','" + MAC.Text + "','" + IMEI.Text + "')", "insert");
+                                        isnetcode = false;
+                                        sncode.Text = "";
+                                        sncode.Focus();
+                                        return;
+                                    }
                                     return;
                                     return;
                                 }
                                 }
                             }
                             }
@@ -177,9 +203,16 @@ namespace UAS_MES_NEW.Make
                             if (KEY.Text == sncode.Text)
                             if (KEY.Text == sncode.Text)
                             {
                             {
                                 KEY_CHECK.Text = sncode.Text;
                                 KEY_CHECK.Text = sncode.Text;
-                                if (CheckInfoPass())
                                 {
                                 {
                                     OperateResult.AppendText(">>KEY核对成功\n", Color.Green);
                                     OperateResult.AppendText(">>KEY核对成功\n", Color.Green);
+                                    if (CheckInfoPass())
+                                    {
+                                        dh.ExecuteSql("insert into wincheck(WC_ID, WC_SNCODE, WC_PSN, WC_PKID, WC_KEY, WC_MAC, WC_IMEI) values(wincheck_seq.nextval,'" + TSN.Text + "','" + PSN.Text + "','" + PKID.Text + "','" + KEY.Text + "','" + MAC.Text + "','" + IMEI.Text + "')", "insert");
+                                        isnetcode = false;
+                                        sncode.Text = "";
+                                        sncode.Focus();
+                                        return;
+                                    }
                                     return;
                                     return;
                                 }
                                 }
                             }
                             }
@@ -197,9 +230,16 @@ namespace UAS_MES_NEW.Make
                             if (MAC.Text == sncode.Text)
                             if (MAC.Text == sncode.Text)
                             {
                             {
                                 MAC_CHECK.Text = sncode.Text;
                                 MAC_CHECK.Text = sncode.Text;
-                                if (CheckInfoPass())
                                 {
                                 {
                                     OperateResult.AppendText(">>MAC核对成功\n", Color.Green);
                                     OperateResult.AppendText(">>MAC核对成功\n", Color.Green);
+                                    if (CheckInfoPass())
+                                    {
+                                        dh.ExecuteSql("insert into wincheck(WC_ID, WC_SNCODE, WC_PSN, WC_PKID, WC_KEY, WC_MAC, WC_IMEI) values(wincheck_seq.nextval,'" + TSN.Text + "','" + PSN.Text + "','" + PKID.Text + "','" + KEY.Text + "','" + MAC.Text + "','" + IMEI.Text + "')", "insert");
+                                        isnetcode = false;
+                                        sncode.Text = "";
+                                        sncode.Focus();
+                                        return;
+                                    }
                                     return;
                                     return;
                                 }
                                 }
                             }
                             }
@@ -217,9 +257,16 @@ namespace UAS_MES_NEW.Make
                             if (IMEI.Text == sncode.Text)
                             if (IMEI.Text == sncode.Text)
                             {
                             {
                                 IMEI_CHECK.Text = sncode.Text;
                                 IMEI_CHECK.Text = sncode.Text;
-                                if (CheckInfoPass())
                                 {
                                 {
                                     OperateResult.AppendText(">>IMEI核对成功\n", Color.Green);
                                     OperateResult.AppendText(">>IMEI核对成功\n", Color.Green);
+                                    if (CheckInfoPass())
+                                    {
+                                        dh.ExecuteSql("insert into wincheck(WC_ID, WC_SNCODE, WC_PSN, WC_PKID, WC_KEY, WC_MAC, WC_IMEI) values(wincheck_seq.nextval,'" + TSN.Text + "','" + PSN.Text + "','" + PKID.Text + "','" + KEY.Text + "','" + MAC.Text + "','" + IMEI.Text + "')", "insert");
+                                        isnetcode = false;
+                                        sncode.Text = "";
+                                        sncode.Focus();
+                                        return;
+                                    }
                                     return;
                                     return;
                                 }
                                 }
                             }
                             }
@@ -230,47 +277,50 @@ namespace UAS_MES_NEW.Make
                             }
                             }
                         }
                         }
                     }
                     }
-                    isnetcode = false;
-                    sncode.Text = "";
-                    sncode.Focus();
                 }
                 }
             }
             }
         }
         }
 
 
         private bool CheckInfoPass()
         private bool CheckInfoPass()
         {
         {
-            bool CheckPass = true;
             if (CheckTSN.Checked)
             if (CheckTSN.Checked)
             {
             {
                 if (TSN.Text != TSN_CHECK.Text)
                 if (TSN.Text != TSN_CHECK.Text)
-                    CheckPass = false;
+                {
+                    return false;
+                }
             }
             }
             if (CheckPSN.Checked)
             if (CheckPSN.Checked)
             {
             {
                 if (PSN.Text != PSN_CHECK.Text)
                 if (PSN.Text != PSN_CHECK.Text)
-                    CheckPass = false;
+                    return false;
             }
             }
             if (CheckPKID.Checked)
             if (CheckPKID.Checked)
             {
             {
                 if (PKID.Text != PKID_CHECK.Text)
                 if (PKID.Text != PKID_CHECK.Text)
-                    CheckPass = false;
+                    return false;
             }
             }
             if (CheckKey.Checked)
             if (CheckKey.Checked)
             {
             {
                 if (KEY.Text != KEY_CHECK.Text)
                 if (KEY.Text != KEY_CHECK.Text)
-                    CheckPass = false;
+                    return false;
             }
             }
             if (CheckMac.Checked)
             if (CheckMac.Checked)
             {
             {
                 if (MAC.Text != MAC_CHECK.Text)
                 if (MAC.Text != MAC_CHECK.Text)
-                    CheckPass = false;
+                    return false;
             }
             }
             if (CheckImei.Checked)
             if (CheckImei.Checked)
             {
             {
                 if (IMEI.Text != IMEI_CHECK.Text)
                 if (IMEI.Text != IMEI_CHECK.Text)
-                    CheckPass = false;
+                    return false;
+            }
+            string ErrorMessage2;
+            if (!LogicHandler.SetStepResult(ms_makecode.Text, User.UserSourceCode, TSN.Text, "核对标签信息", "核对成功", User.UserCode, out ErrorMessage2))
+            {
+                OperateResult.AppendText(">>" + ErrorMessage2 + "\n", Color.Red);
             }
             }
-            return CheckPass;
+            return true;
         }
         }
 
 
         private void Make_CollectNetCode_SizeChanged(object sender, EventArgs e)
         private void Make_CollectNetCode_SizeChanged(object sender, EventArgs e)
@@ -291,6 +341,12 @@ namespace UAS_MES_NEW.Make
                 OperateResult.AppendText(">>清除完成,清重新输入SN号\n", Color.Green);
                 OperateResult.AppendText(">>清除完成,清重新输入SN号\n", Color.Green);
                 isnetcode = false;
                 isnetcode = false;
                 sncode.Focus();
                 sncode.Focus();
+                TSN.Clear();
+                PSN.Clear();
+                PKID.Clear();
+                IMEI.Clear();
+                MAC.Clear();
+                KEY.Clear();
             }
             }
         }
         }
     }
     }

+ 2 - 1
UAS_MES_PW/FunctionCode/Make/Make_ImeiCheck.cs

@@ -79,7 +79,8 @@ namespace UAS_MES_NEW.Make
                     //判断序列号下一工序(CHECKSTEPSNANDMACODE)
                     //判断序列号下一工序(CHECKSTEPSNANDMACODE)
                     if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, SN, User.UserCode, out omakeCode, out oMsid, out oErrorMessage))
                     if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, SN, User.UserCode, out omakeCode, out oMsid, out oErrorMessage))
                     {
                     {
-                        if (!LogicHandler.CheckSeeWoSN(SN, out oErrorMessage))
+                        object data = dh.GetConfig("CheckSN", "sys");
+                        if (!LogicHandler.CheckSeeWoSN(SN, out oErrorMessage) && data.ToString() == "1")
                         {
                         {
                             OperateResult.AppendText(">>条码" + sncode.Text + "已激活\n");
                             OperateResult.AppendText(">>条码" + sncode.Text + "已激活\n");
                             return;
                             return;

+ 5 - 4
UAS_MES_PW/FunctionCode/Make/Make_LabelCheck.cs

@@ -83,10 +83,11 @@ namespace UAS_MES_NEW.Make
                     //判断序列号下一工序(CHECKSTEPSNANDMACODE)
                     //判断序列号下一工序(CHECKSTEPSNANDMACODE)
                     if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sncode.Text, User.UserCode, out omakeCode, out oMsid, out oErrorMessage))
                     if (LogicHandler.CheckStepSNAndMacode("", User.UserSourceCode, sncode.Text, User.UserCode, out omakeCode, out oMsid, out oErrorMessage))
                     {
                     {
-                        if (!LogicHandler.CheckSeeWoSN(sncode.Text, out oErrorMessage))
-                        {
-
-                        }
+                        //if (!LogicHandler.CheckSeeWoSN(sncode.Text, out oErrorMessage))
+                        //{
+                        //    OperateResult.AppendText(">>" + oErrorMessage + "\n", Color.Red, sncode);
+                        //    return;
+                        //}
                         //调用  SETSTEPRESULT ,获取返回的工单号,
                         //调用  SETSTEPRESULT ,获取返回的工单号,
                         if (LogicHandler.SetStepResult(omakeCode, User.UserSourceCode, sncode.Text, "标签核对", "OK", User.UserCode, out oErrorMessage))
                         if (LogicHandler.SetStepResult(omakeCode, User.UserSourceCode, sncode.Text, "标签核对", "OK", User.UserCode, out oErrorMessage))
                         {
                         {

+ 1 - 0
UAS_MES_PW/UAS_MES_PW.csproj

@@ -1191,6 +1191,7 @@
     <Compile Include="PublicMethod\ReadDataFromSerialPort.cs" />
     <Compile Include="PublicMethod\ReadDataFromSerialPort.cs" />
     <EmbeddedResource Include="CustomControl\AccordionMenu\AccordionMenu.resx">
     <EmbeddedResource Include="CustomControl\AccordionMenu\AccordionMenu.resx">
       <DependentUpon>AccordionMenu.cs</DependentUpon>
       <DependentUpon>AccordionMenu.cs</DependentUpon>
+      <SubType>Designer</SubType>
     </EmbeddedResource>
     </EmbeddedResource>
     <EmbeddedResource Include="CustomControl\AccordionMenu\NavagationBar.resx">
     <EmbeddedResource Include="CustomControl\AccordionMenu\NavagationBar.resx">
       <DependentUpon>NavagationBar.cs</DependentUpon>
       <DependentUpon>NavagationBar.cs</DependentUpon>