Browse Source

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

Hcsy 8 years ago
parent
commit
e0448f2199

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_ColorBoxLoadPrint.cs

@@ -216,7 +216,7 @@ namespace UAS_MES.Make
                         if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, out ErrorMessage))
                         {
                             //判断采集的条码和本次采集的也不能重复
-                            if (CollectData.Contains(code.Text))
+                            if (CollectData.Contains(code.Text) && sp_ifrepeat != "-1")
                             {
                                 OperateResult.AppendText(">>条码" + code.Text + "已经上料\n", Color.Red, code);
                                 return;

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_FeedingCollection.cs

@@ -150,7 +150,7 @@ namespace UAS_MES.Make
                             if (LogicHandler.CheckSNBeforeLoad(ma_code.Text, code.Text, sp_fsoncode, sp_soncode, sp_barcoderule, sp_prefix, length, sp_ifrepeat, out ErrorMessage))
                             {
                                 //判断采集的条码和本次采集的也不能重复
-                                if (CollectData.Contains(code.Text))
+                                if (CollectData.Contains(code.Text) && sp_ifrepeat != "-1")
                                 {
                                     OperateResult.AppendText(">>条码" + code.Text + "已经上料\n", Color.Red, code);
                                     return;

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

@@ -631,7 +631,7 @@ namespace UAS_MES.PublicMethod
                 sql.Append(",SP_SCCODE,SP_STEPCODE,SP_LINECODE,SP_WCCODE,SP_MAKECODE,SP_SNCODE,SP_YMD,SP_HM,SP_IFNG,SP_PRODCODE");
                 sql.Append(",SP_DATE,SP_CRAFTCODE,sp_inman)  select STEPPASSED_SEq.NEXTVAL,'" + cd_ifmidinput + "','" + cd_ifmidfinish + "',");
                 sql.Append("ms_ifrework,case when ms_ifrework=-1 then 0 when ms_stepcode='" + CurrentStep + "' then 0 when " + ifpast + ">0 ");
-                sql.Append("then -1 else 0 end,0,ms_checkno,'良品','" + iSourceCode + "','" + CurrentStep + "','" + LineCode + "',ms_makecode,ms_sncode,");
+                sql.Append("then -1 else 0 end,ms_checkno,'良品','" + iSourceCode + "','" + CurrentStep + "','" + LineCode + "',ms_wccode,ms_makecode,ms_sncode,");
                 sql.Append("to_char(sysdate,'yyyymmdd'),to_char(sysdate,'hh24miss'),0,ms_prodcode,SYSDATE,ms_craftcode,'" + iUserCode + "' ");
                 sql.Append("from mes_package_view left join makeserial on ms_sncode=v_barcode and ms_makecode=v_makecode where v_outboxcode='" + iOutBoxCode + "'");
                 ExeSQL.Add(sql.ToString());

+ 10 - 10
UAS_CustomerInterface/MesHelper.cs

@@ -37,7 +37,7 @@ namespace UAS.MES
     [ProgId("DllService.MESHelper")]
     public class MESHelper : IMESHelper
     {
-        //用于拼接SQL 
+        //用于拼接SQL
         StringBuilder sql = new StringBuilder();
         //用于存放批量执行的SQL
         List<string> sqls = new List<string>();
@@ -76,7 +76,7 @@ namespace UAS.MES
             oMsid = param[5];
             oErrMessage = param[6];
             DataTable dt = null;
-            if (oMsid == "" || oMsid == null || oMsid == "null")
+            if (oMsid == "" || oMsid == null || oMsid == "null" || oMsid == "0")
             {
                 sql.Clear();
                 sql.Append("select max(ms_id) from makeserial  where ms_sncode in (select '" + iSN + "' from dual union select sn from makesnrelation where ");
@@ -84,7 +84,7 @@ namespace UAS.MES
                 dt = (DataTable)ExecuteSql(sql.ToString(), "select");
                 oMsid = dt.Rows[0][0].ToString();
             }
-            dt = (DataTable)ExecuteSql("select ms_status,ms_stepcode,ms_nextstepcode from makeserial where ms_id='" + oMsid + "'","select");
+            dt = (DataTable)ExecuteSql("select ms_status,ms_stepcode,ms_nextstepcode from makeserial where ms_id='" + oMsid + "'", "select");
             string ms_status = "";
             string ms_stepcode = "";
             string ms_nextstepcode = "";
@@ -95,11 +95,11 @@ namespace UAS.MES
                 ms_nextstepcode = dt.Rows[0]["ms_nextstepcode"].ToString();
             }
             string stepcode = GetStepCodeBySource(iResCode);
-            if (ms_nextstepcode != "" && ms_nextstepcode != stepcode)
-            {
-                oErrMessage = "序列号下一工序" + ms_nextstepcode + ",前岗位资源不允许采集";
-                return false;
-            }
+            //if (ms_nextstepcode != "" && ms_nextstepcode != stepcode)
+            //{
+            //    oErrMessage = "序列号下一工序" + ms_nextstepcode + ",前岗位资源不允许采集";
+            //    return false;
+            //} 
             if (oErrMessage == "" || oErrMessage == null || oErrMessage == "null" || (ms_status == "3" && stepcode == ms_stepcode))
             {
                 if (ms_status == "3")
@@ -475,7 +475,7 @@ namespace UAS.MES
         }
 
         [Description("执行过站")]
-        public bool SetStepFinish(string iMakeCode, string iSourceCode, string iSN, string iMPKind, string iResult, string iUserCode, string iErrCode, out string oErrMessage)
+        private bool SetStepFinish(string iMakeCode, string iSourceCode, string iSN, string iMPKind, string iResult, string iUserCode, string iErrCode, out string oErrMessage)
         {
             if (iSN == "")
             {
@@ -498,6 +498,7 @@ namespace UAS.MES
                     }
                     else
                     {
+                        UpdateByCondition("makebad", "mb_status=-1", "mb_sncode='" + iSN + "' and mb_makecode='" + iMakeCode + "' and mb_stepcode='" + CurrentStep + "' and mb_status=0");
                         string[] BadCode = iErrCode.Split(',');
                         sql.Length = 0;
                         sql.Append("insert into makebad(mb_id,mb_makecode,mb_mscode,mb_sncode,mb_inman,mb_indate,mb_stepcode");
@@ -511,7 +512,6 @@ namespace UAS.MES
                             InsertSQL.Add(sql.ToString().Replace(":bc_code", "'" + BadCode[i] + "'"));
                         }
                         ExecuteSQLTran(InsertSQL.ToArray());
-                        oErrMessage = "测试NG,请重新测试或者判定为不良";
                         //将不良的序列号的状态码设为3
                         ExecuteSql("update makeserial set ms_status='3' where ms_sncode='" + iSN + "' and ms_makecode='" + iMakeCode + "'", "update");
                     }

+ 67 - 1
UAS_MesInterface(4.0)/MesHelper.cs

@@ -13,7 +13,7 @@ namespace BenQGuru.eMES.DLLService
     [InterfaceType(ComInterfaceType.InterfaceIsDual)]
     public interface IMESHelper
     {
-        [DispId(12)]
+        [DispId(14)]
         bool CheckRoutePassed(string iSN, string iResCode, out string oErrMessage);
         bool GetRcardMOInfo(string iSN, out string oMoCode, out string oErrMessage);
         bool CheckUserAndResourcePassed(string iUserCode, string iResCode, string iPassWord, out string oErrMessage);
@@ -26,6 +26,8 @@ namespace BenQGuru.eMES.DLLService
         bool SetMobileData(string iTSN, string iSN, string iSourceCode, string iOperator, string iResult, string iErrCode, string flag, out string oErrorMessage);
         bool SetPcbaData(string iSN, string iResCode, string iOperator, string iResult, string iErrCode, out string oErrMessage);
         bool GoMo(string iMO, string iSN, string iResCode, out string oErrMessage);
+        bool GetSoftVersion(string iSN, out string oSoftVersion, out string oErrMessage);
+        bool GetProductRelation(string iSN, out string oWIFI, out string oBT, out string IMEI1, out string IMEI2, out string IMEI3, out string oNetCode, out string oMEID, out string oErrMessage);
     }
 
     [Guid("41EAB546-6EF4-464A-895A-9C34013A5D8C")]
@@ -114,6 +116,70 @@ namespace BenQGuru.eMES.DLLService
             }
         }
 
+        [Description("获取工单软件版本")]
+        public bool GetSoftVersion(string iSN, out string oSoftVersion, out string oErrMessage)
+        {
+            string oMakeCode = "";
+            oErrMessage = "";
+            GetRcardMOInfo(iSN, out oMakeCode, out oErrMessage);
+            oSoftVersion = getFieldDataByCondition("make", "ma_softversion", "ma_code='" + oMakeCode + "'").ToString();
+            return true;
+        }
+
+        [Description("获取SN关联采集信息")]
+        public bool GetProductRelation(string iSN, out string oWIFI, out string oBT, out string oIMEI1, out string oIMEI2, out string oIMEI3, out string oNetCode, out string oMEID, out string oErrMessage)
+        {
+            oWIFI = "";
+            oBT = "";
+            oIMEI1 = "";
+            oIMEI2 = "";
+            oIMEI3 = "";
+            oNetCode = "";
+            oMEID = "";
+            string oMakeCode = "";
+            if (GetRcardMOInfo(iSN, out oMakeCode, out oErrMessage))
+            {
+                DataTable dt = (DataTable)ExecuteSql("select mal_mac,mal_bt from makeaddresslist where mal_makecode='" + oMakeCode + "' and rownum=1 ", "select");
+                if (dt.Rows.Count > 0)
+                {
+                    if (dt.Rows[0]["mal_mac"].ToString() != "")
+                    {
+                        oWIFI = "Required";
+                    }
+                    if (dt.Rows[0]["mal_bt"].ToString() != "")
+                    {
+                        oBT = "Required";
+                    }
+                }
+                dt = (DataTable)ExecuteSql("select mil_imei1,mil_imei2,mil_imei3,mil_netcode,mil_meid from makeimeilist where mil_makecode='" + oMakeCode + "' and rownum=1", "select");
+                if (dt.Rows.Count > 0)
+                {
+                    if (dt.Rows[0]["mil_imei1"].ToString() != "")
+                    {
+                        oIMEI1 = "Required";
+                    }
+                    if (dt.Rows[0]["mil_imei2"].ToString() != "")
+                    {
+                        oIMEI2 = "Required";
+                    }
+                    if (dt.Rows[0]["mil_imei3"].ToString() != "")
+                    {
+                        oIMEI3 = "Required";
+                    }
+                    if (dt.Rows[0]["mil_netcode"].ToString() != "")
+                    {
+                        oNetCode = "Required";
+                    }
+                    if (dt.Rows[0]["mil_meid"].ToString() != "")
+                    {
+                        oMEID = "Required";
+                    }
+                }
+                return true;
+            }
+            else return false;
+        }
+
         /// <summary>
         /// 验证用户身份信息和岗位资源
         /// </summary>