Jelajahi Sumber

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

Hcsy 7 tahun lalu
induk
melakukan
e88fae6397

+ 0 - 1
UAS-MES/FunctionCode/Make/Make_PalletCollection.Designer.cs

@@ -519,7 +519,6 @@
             this.pa_standardqty.Str2 = null;
             this.pa_standardqty.TabIndex = 184;
             this.pa_standardqty.KeyDown += new System.Windows.Forms.KeyEventHandler(this.pa_standardqty_KeyDown);
-            this.pa_standardqty.Leave += new System.EventHandler(this.pa_standardqty_Leave);
             // 
             // Cancel
             // 

+ 2 - 6
UAS-MES/FunctionCode/Make/Make_PalletCollection.cs

@@ -444,14 +444,10 @@ namespace UAS_MES.Make
             if (e.KeyCode == Keys.Enter)
             {
                 ResetPackageQTY();
+                outboxcode.Focus();
             }
         }
 
-        private void pa_standardqty_Leave(object sender, EventArgs e)
-        {
-            ResetPackageQTY();
-        }
-
         private void ResetPackageQTY()
         {
             if (pa_outboxcode.Text != "")
@@ -463,7 +459,7 @@ namespace UAS_MES.Make
                     if (int.Parse(pa_standardqty.Text) >= int.Parse(total))
                     {
                         dh.UpdateByCondition("package", "pa_standardqty='" + pa_standardqty.Text + "'", "pa_outboxcode='" + pa_outboxcode.Text + "'");
-                        OperateResult.AppendText(">>修改容量成功,已修改为" + pa_standardqty.Text + "\n", Color.Green);
+                        OperateResult.AppendText(">>栈板" + pa_outboxcode.Text + "修改容量成功,已修改为" + pa_standardqty.Text + "\n", Color.Green);
                         return;
                     }
                     else OperateResult.AppendText(">>容量不能小于已装数量\n", Color.Red);

+ 17 - 17
UAS-MES/FunctionCode/Make/Make_SeqProgramTransform.cs

@@ -206,7 +206,7 @@ namespace UAS_MES.Make
                                 //没有勾选,只能修改一次
                                 //核对TSN是否正确
                                 //string beforesn = dh.getFieldDataByCondition("makeserial", "ms_beforesn", "ms_sncode='" + code.Text + "'").ToString().Trim();
-                                if (dh.CheckExist("makeserial", "ms_sncode='" + code.Text + "' and ms_id='" + oMsid + "' and ms_beforesn is null"))
+                                if (dh.CheckExist("makeserial", "ms_id='" + oMsid + "' and ms_sncode='" + code.Text + "' and ms_beforesn is null"))
                                 {
                                     step = 1;
 
@@ -221,7 +221,7 @@ namespace UAS_MES.Make
                                 //不为空,进行过转换。不勾选修改结果,就不能再修改
                                 {
                                     //修改转换结果时,输入两次SN直接过站
-                                    if (dh.CheckExist("MakeSerial", "ms_sncode='" + code.Text + "' and ms_id='" + oMsid + "' and ms_beforesn is not null"))
+                                    if (dh.CheckExist("MakeSerial", "ms_id='" + oMsid + "' and ms_sncode='" + code.Text + "' and ms_beforesn is not null"))
                                     {
                                         step = 1;
                                         TSN = code.Text;
@@ -245,7 +245,7 @@ namespace UAS_MES.Make
                             //判断工单是否导入了序列号清单
                             if (dh.CheckExist("makesnlist", "msl_makecode='" + ms_macode.Text + "' and msl_type='after'"))
                             {
-                                if (!dh.CheckExist("makesnlist", "msl_makecode='" + ms_macode.Text + "' and msl_sncode='" + code.Text + "'  and msl_type='after'"))
+                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + code.Text + "' and  msl_makecode='" + ms_macode.Text + "' and msl_type='after'"))
                                 {
                                     //有序列号清单,输入的序列号却不在范围内
                                     OperateResult.AppendText(">>SN号" + code.Text + "错误,不在工单设定的转换后序列号清单中\n", Color.Red, code);
@@ -297,7 +297,7 @@ namespace UAS_MES.Make
                                 return;
                             }
                             //开始录入SN
-                            if ((ChangeResult.Checked && dh.CheckExist("makeserial", "ms_sncode='" + code.Text + "' and ms_id='" + oMsid + "'")) || !dh.CheckExist("makeserial", "ms_sncode='" + code.Text + "'") || (!ChangeResult.Checked && (TSN == code.Text)))
+                            if ((ChangeResult.Checked && dh.CheckExist("makeserial", " ms_id='" + oMsid + "' and  ms_sncode='" + code.Text + "'")) || !dh.CheckExist("makeserial", "ms_sncode='" + code.Text + "'") || (!ChangeResult.Checked && (TSN == code.Text)))
                             {
                                 //SN校验成功,合法,记录下SN
                                 SN = code.Text;
@@ -440,7 +440,7 @@ namespace UAS_MES.Make
                 case "IMEI1":
                 case "IMEI2":
                 case "IMEI3":
-                    if (!ChangeResult.Checked && checkExist("ms_status in (1,2,3) and nvl(ms_nextmacode,' ')=' ' and  (ms_imei1='" + code.Text + "' or ms_imei2 = '" + code.Text + "' or ms_imei3 = '" + code.Text + "')")
+                    if (!ChangeResult.Checked && checkExist("(ms_imei1='" + code.Text + "' or ms_imei2 = '" + code.Text + "' or ms_imei3 = '" + code.Text + "') and  ms_status in (1,2,3) and nvl(ms_nextmacode,' ')=' '")
                         || ChangeResult.Checked && checkExist("ms_status in (1,2,3) and nvl(ms_nextmacode,' ')=' ' and  (ms_imei1='" + code.Text + "' or ms_imei2 = '" + code.Text + "' or ms_imei3 = '" + code.Text + "') and ms_id <> '" + oMsid + "'"))
                     {
                         OperateResult.AppendText(">>" + type + ":" + code.Text + "错误,不允许重复\n", Color.Red);
@@ -486,8 +486,8 @@ namespace UAS_MES.Make
                         }
                     }
                     //验证是否已被使用
-                    if (!ChangeResult.Checked && checkExist("ms_status in (1,2,3) and nvl(ms_nextmacode,' ')=' ' and  MS_" + type + "='" + macOrBt + "'")
-                        || ChangeResult.Checked && checkExist("ms_status in (1,2,3) and nvl(ms_nextmacode,' ')=' ' and  MS_" + type + "='" + macOrBt + "' and ms_id <> '" + oMsid + "'"))
+                    if (!ChangeResult.Checked && checkExist("MS_" + type + "='" + macOrBt + "' and  ms_status in (1,2,3) and nvl(ms_nextmacode,' ')=' '")
+                        || ChangeResult.Checked && checkExist("MS_" + type + "='" + macOrBt + "' and  ms_status in (1,2,3) and nvl(ms_nextmacode,' ')=' '  and ms_id <> '" + oMsid + "'"))
                     {
                         OperateResult.AppendText(">>" + ListA.Rows[step - 2]["psr_type"].ToString() + ":" + code.Text + "错误,不允许重复\n", Color.Red);
                         OperateResult.AppendText(">>请输入" + ListA.Rows[step - 2]["psr_type"].ToString() + "\n", Color.Black, code);
@@ -510,8 +510,8 @@ namespace UAS_MES.Make
                     toSi.Append("si_" + type + " = '" + macOrBt + "',");
                     break;
                 case "NETCODE":
-                    if (!ChangeResult.Checked && checkExist("ms_status in (1,2,3) and nvl(ms_nextmacode,' ')=' ' and  MS_" + type + "='" + code.Text + "'")
-                        || ChangeResult.Checked && checkExist("ms_status in (1,2,3) and nvl(ms_nextmacode,' ')=' ' and  MS_" + type + "='" + code.Text + "' and ms_id <> '" + oMsid + "'"))
+                    if (!ChangeResult.Checked && checkExist("MS_" + type + "='" + code.Text + "' and  ms_status in (1,2,3) and nvl(ms_nextmacode,' ')=' '")
+                        || ChangeResult.Checked && checkExist("MS_" + type + "='" + code.Text + "' and  ms_status in (1,2,3) and nvl(ms_nextmacode,' ')=' ' and ms_id <> '" + oMsid + "'"))
                     {
                         OperateResult.AppendText(">>" + ListA.Rows[step - 2]["psr_type"].ToString() + ":" + code.Text + "错误,不允许重复\n", Color.Red);
                         OperateResult.AppendText(">>请输入" + ListA.Rows[step - 2]["psr_type"].ToString() + "\n", Color.Black, code);
@@ -548,14 +548,14 @@ namespace UAS_MES.Make
             {
                 //校验已经完成,此时要再次校验之前的SN和关联采集信息
                 //再次校验SN
-                if ((ChangeResult.Checked && dh.CheckExist("makeserial", "ms_sncode='" + SN + "' and ms_id='" + oMsid + "'")) || !dh.CheckExist("makeserial", "ms_sncode='" + SN + "'") || (!ChangeResult.Checked && (TSN == SN)))
+                if ((ChangeResult.Checked && dh.CheckExist("makeserial", "ms_id='" + oMsid + "' and  ms_sncode='" + SN + "'")) || !dh.CheckExist("makeserial", "ms_sncode='" + SN + "'") || (!ChangeResult.Checked && (TSN == SN)))
                 {
                     bool flag = true;
                     //遍历判断已采集的信息是否已存在
                     foreach (DictionaryEntry de in hs)
                     {
-                        if (!ChangeResult.Checked && dh.CheckExist("makeserial", "ms_status in (1,2,3) and nvl(ms_nextmacode,' ')=' ' and  MS_" + (de.Key.ToString() == "WIFI" ? "MAC" : de.Key) + "='" + de.Value + "'")
-                            || (ChangeResult.Checked && dh.CheckExist("makeserial", "ms_status in (1,2,3) and nvl(ms_nextmacode,' ')=' ' and  MS_" + (de.Key.ToString() == "WIFI" ? "MAC" : de.Key) + "='" + de.Value + "' and ms_id <> '" + oMsid + "'")))
+                        if (!ChangeResult.Checked && dh.CheckExist("makeserial", "MS_" + (de.Key.ToString() == "WIFI" ? "MAC" : de.Key) + "='" + de.Value + "' and  ms_status in (1,2,3) and nvl(ms_nextmacode,' ')=' '")
+                            || (ChangeResult.Checked && dh.CheckExist("makeserial", "MS_" + (de.Key.ToString() == "WIFI" ? "MAC" : de.Key) + "='" + de.Value + "' and  ms_status in (1,2,3) and nvl(ms_nextmacode,' ')=' ' and ms_id <> '" + oMsid + "'")))
                         {
                             flag = false;
                             OperateResult.AppendText(">>" + de.Key + "已被使用,请重新输入TSN,重新转换\n", Color.Red);
@@ -587,17 +587,17 @@ namespace UAS_MES.Make
                         if (ChangeResult.Checked)
                         {
                             //查询ms_firstsn
-                            firstsn = dh.getFieldDataByCondition("makeserial", "ms_firstsn", "ms_beforesn='" + TSN + "' and ms_id='" + oMsid + "'").ToString();
+                            firstsn = dh.getFieldDataByCondition("makeserial", "ms_firstsn", "ms_id='" + oMsid + "' and  ms_beforesn='" + TSN + "'").ToString();
                             //记录本次修改,存入makesnrelation表中
-                            updateSql = "update makeserial set ms_sncode='" + SN + "'," + s1.Remove(s1.Length - 1, 1).ToString() + " where ms_beforesn='" + TSN + "' and ms_id='" + oMsid + "'";
+                            updateSql = "update makeserial set ms_sncode='" + SN + "'," + s1.Remove(s1.Length - 1, 1).ToString() + " where ms_id='" + oMsid + "' and  ms_beforesn='" + TSN + "'";
                         }
                         //未勾选修改转换结果
                         else
                         {
                             //查询ms_firstsn
-                            firstsn = dh.getFieldDataByCondition("makeserial", "ms_firstsn", "ms_sncode='" + TSN + "' and ms_id='" + oMsid + "'").ToString();
+                            firstsn = dh.getFieldDataByCondition("makeserial", "ms_firstsn", " ms_id='" + oMsid + "' and ms_sncode='" + TSN + "'").ToString();
                             //记录本次修改,存入makesnrelation表中
-                            updateSql = "update makeserial set ms_sncode='" + SN + "', ms_beforesn='" + TSN + "'," + s1.Remove(s1.Length - 1, 1).ToString() + " where ms_sncode='" + TSN + "' and ms_id='" + oMsid + "'";
+                            updateSql = "update makeserial set ms_sncode='" + SN + "', ms_beforesn='" + TSN + "'," + s1.Remove(s1.Length - 1, 1).ToString() + " where ms_id='" + oMsid + "' and  ms_sncode='" + TSN + "'";
                         }
                         string insertSql = "insert into  makesnrelation (BEFORESN,SN,FIRSTSN,MAKECODE,msr_indate, msr_inman)values('" + TSN + "','" + SN + "','" + firstsn + "','" + ms_macode.Text + "', sysdate ,'" + User.UserCode + "')";
                         dh.ExecuteSQLTran(updateSql, insertSql);
@@ -611,7 +611,7 @@ namespace UAS_MES.Make
                         if (ChangeResult.Checked)
                         {
                             //删除最近一条转换记录
-                            dh.ExecuteSql("delete from makesnrelation where sn <> '"+SN+"' and BEFORESN='" + TSN + "' and makecode='" + ms_macode.Text + "'", "delete");
+                            dh.ExecuteSql("delete from makesnrelation where BEFORESN='" + TSN + "' and makecode='" + ms_macode.Text + "' and sn <> '" + SN + "'", "delete");
                         }
                         //输出提示用户“>>序列号转换成功”,“>>关联采集成功”
                         //完成该道工序 setFinish

+ 8 - 8
UAS-MES/FunctionCode/Make/Make_SeqTransform.cs

@@ -188,7 +188,7 @@ namespace UAS_MES.Make
 
                                     //string beforesn = dh.getFieldDataByCondition("makeserial", "ms_beforesn", "ms_sncode='" + sncode.Text + "'").ToString().Trim();
                                     //为空,就说明,没有进行过序列号的转换
-                                    if (dh.CheckExist("makeserial", "ms_sncode='" + sncode.Text + "' and ms_id='" + oMsId + "' and ms_beforesn is null"))
+                                    if (dh.CheckExist("makeserial", "ms_id='" + oMsId + "' and  ms_sncode='" + sncode.Text + "' and ms_beforesn is null"))
                                     {
                                         //记录转换前的序列号
                                         bsncode = sncode.Text;
@@ -201,7 +201,7 @@ namespace UAS_MES.Make
                                     //不为空,进行过转换。不勾选修改结果,就不能再修改
                                     {
                                         //修改转换结果时,输入两次SN直接过站
-                                        if (dh.CheckExist("MakeSerial", "ms_sncode='" + sncode.Text + "' and ms_id='" + oMsId + "' and ms_beforesn is not null"))
+                                        if (dh.CheckExist("MakeSerial", "ms_id='" + oMsId + "' and  ms_sncode='" + sncode.Text + "' and ms_beforesn is not null"))
                                         {
                                             bsncode = sncode.Text;
                                             //显示序列号
@@ -227,7 +227,7 @@ namespace UAS_MES.Make
                             //判断工单是否导入了序列号清单
                             if (dh.CheckExist("makesnlist", "msl_makecode='" + ma_code.Text + "' and msl_type='after'"))
                             {
-                                if (!dh.CheckExist("makesnlist", "msl_makecode='" + ma_code.Text + "' and msl_sncode='" + sncode.Text + "'  and msl_type='after'"))
+                                if (!dh.CheckExist("makesnlist", "msl_sncode='" + sncode.Text + "' and msl_makecode='" + ma_code.Text + "' and msl_type='after'"))
                                 {
                                     //有序列号清单,输入的序列号却不在范围内
                                     OperateResult.AppendText(">>SN号" + sncode.Text + "错误,不在工单设定的转换后序列号清单中\n", Color.Red, sncode);
@@ -277,7 +277,7 @@ namespace UAS_MES.Make
                             //如果两次输入的序列号相同进行提示,不相同则进行下一步
                             //if (bsncode != sncode.Text)
                             //{
-                            if ((ChangeResult.Checked && dh.CheckExist("makeserial", "ms_sncode='" + sncode.Text + "' and ms_id='" + oMsId + "'")) || !dh.CheckExist("makeserial", "ms_sncode='" + sncode.Text + "'") || (!ChangeResult.Checked && (bsncode == sncode.Text)))
+                            if ((ChangeResult.Checked && dh.CheckExist("makeserial", "ms_id='" + oMsId + "' and ms_sncode='" + sncode.Text + "'")) || !dh.CheckExist("makeserial", "ms_sncode='" + sncode.Text + "'") || (!ChangeResult.Checked && (bsncode == sncode.Text)))
                             {
                                 string firstsn = "";
                                 string updateSql = "";
@@ -285,9 +285,9 @@ namespace UAS_MES.Make
                                 if (ChangeResult.Checked)
                                 {
                                     //查询ms_firstsn
-                                    firstsn = dh.getFieldDataByCondition("makeserial", "ms_firstsn", "ms_beforesn='" + bsncode + "' and ms_id='" + oMsId + "'").ToString();
+                                    firstsn = dh.getFieldDataByCondition("makeserial", "ms_firstsn", "ms_id='" + oMsId + "' and  ms_beforesn='" + bsncode + "'").ToString();
                                     //记录本次修改,存入makesnrelation表中
-                                    updateSql = "update makeserial set ms_sncode='" + sncode.Text + "' where ms_beforesn='" + bsncode + "' and ms_id='" + oMsId + "'";
+                                    updateSql = "update makeserial set ms_sncode='" + sncode.Text + "' where ms_id='" + oMsId + "' and  ms_beforesn='" + bsncode + "'";
                                     //删除最近一条转换记录
                                     dh.ExecuteSql("delete from makesnrelation where BEFORESN='" + bsncode + "' and makecode='" + ma_code.Text + "'", "delete");
                                 }
@@ -295,9 +295,9 @@ namespace UAS_MES.Make
                                 else
                                 {
                                     //查询ms_firstsn
-                                    firstsn = dh.getFieldDataByCondition("makeserial", "ms_firstsn", "ms_sncode='" + bsncode + "' and ms_id='" + oMsId + "'").ToString();
+                                    firstsn = dh.getFieldDataByCondition("makeserial", "ms_firstsn", "ms_id='" + oMsId + "' and  ms_sncode='" + bsncode + "'").ToString();
                                     //记录本次修改,存入makesnrelation表中
-                                    updateSql = "update makeserial set ms_sncode='" + sncode.Text + "', ms_beforesn='" + bsncode + "' where ms_sncode='" + bsncode + "' and ms_id='" + oMsId + "'";
+                                    updateSql = "update makeserial set ms_sncode='" + sncode.Text + "', ms_beforesn='" + bsncode + "' where ms_id='" + oMsId + "' and  ms_sncode='" + bsncode + "'";
                                 }
                                 string insertSql = "insert into  makesnrelation (BEFORESN,SN,FIRSTSN,MAKECODE,msr_indate, msr_inman)values('" + bsncode + "','" + sncode.Text + "','" + firstsn + "','" + ma_code.Text + "', sysdate ,'" + User.UserCode + "')";
                                 dh.ExecuteSQLTran(updateSql, insertSql);