Browse Source

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

Hcsy 8 years ago
parent
commit
046f658fab

+ 7 - 4
UAS-MES/FunctionCode/Make/Make_FeedingCollection.cs

@@ -81,7 +81,7 @@ namespace UAS_MES.Make
         {
             DBFind = ma_code.ReturnData;
             BaseUtil.SetFormValue(this.Controls, DBFind);
-            string ifforsn = dh.getFieldDataByCondition("make left join stepbom on ma_prodcode=sb_prodcode left join stepproduct on sb_id=sp_sbid", "nvl(sp_ifforsn,0) sp_ifforsn", "ma_code='" + ma_code.Text + "' and sp_craftcode='" + ma_craftcode.Text + "' and sp_stepcode='"+User.CurrentStepCode+"' and sb_bomversion='" + ma_bomversion.Text + "' order by sp_detno").ToString();
+            string ifforsn = dh.getFieldDataByCondition("make left join stepbom on ma_prodcode=sb_prodcode left join stepproduct on sb_id=sp_sbid", "nvl(sp_ifforsn,0) sp_ifforsn", "ma_code='" + ma_code.Text + "' and sp_craftcode='" + ma_craftcode.Text + "' and sp_stepcode='" + User.CurrentStepCode + "' and sb_bomversion='" + ma_bomversion.Text + "' order by sp_detno").ToString();
             if (ifforsn != "" && ifforsn != "0")
                 iflastsn.Checked = true;
             else
@@ -217,7 +217,7 @@ namespace UAS_MES.Make
                     ms_status = dt.Rows[0]["ms_status"].ToString();
                     ms_firstsn = dt.Rows[0]["ms_firstsn"].ToString();
                     BaseUtil.SetFormValue(this.Controls, dt);
-                    string ifforsn = dh.getFieldDataByCondition("make left join stepbom on ma_prodcode=sb_prodcode left join stepproduct on sb_id=sp_sbid", "nvl(sp_ifforsn,0) sp_ifforsn", "ma_code='" + ma_code.Text + "' and sp_stepcode='"+User.CurrentStepCode+"'  and sp_craftcode='" + ma_craftcode.Text + "' and sb_bomversion='" + ma_bomversion.Text + "' order by sp_detno").ToString();
+                    string ifforsn = dh.getFieldDataByCondition("make left join stepbom on ma_prodcode=sb_prodcode left join stepproduct on sb_id=sp_sbid", "nvl(sp_ifforsn,0) sp_ifforsn", "ma_code='" + ma_code.Text + "' and sp_stepcode='" + User.CurrentStepCode + "'  and sp_craftcode='" + ma_craftcode.Text + "' and sb_bomversion='" + ma_bomversion.Text + "' order by sp_detno").ToString();
                     if (ifforsn != "" && ifforsn != "0")
                         iflastsn.Checked = true;
                     else
@@ -252,7 +252,7 @@ namespace UAS_MES.Make
                                 {
                                     string sp_id = dt.Rows[0]["sp_id"].ToString();
                                     string sp_soncode = dt.Rows[0]["sp_soncode"].ToString();
-                                    if (!dh.CheckExist("Craftmaterial", "cm_makecode='" + ma_code.Text + "' and cm_sncode='" + code.Text + "'"))
+                                    if (!dh.CheckExist("Craftmaterial", "cm_makecode='" + ma_code.Text + "' and cm_soncode='" + make_prodcode + "' and cm_sncode='" + code.Text + "' and cm_status=0"))
                                     {
                                         CollectDataSonCode.Add(sp_soncode);
                                         CollectData.Add(code.Text);
@@ -262,7 +262,10 @@ namespace UAS_MES.Make
                                         GetItem();
                                         return;
                                     }
-                                    else OperateResult.AppendText(">>序列号" + code.Text + "已经上料\n", Color.Red, code);
+                                    else
+                                    {
+                                        GetItem();
+                                    }
                                 }
                                 else OperateResult.AppendText(">>序列号" + code.Text + "不存在于其他工单\n", Color.Red, code);
                             }

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

@@ -365,7 +365,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_status in (1,2,3) and nvl(ms_nextmacode,' ')=' ' and  (ms_imei1='" + code.Text + "' or ms_imei2 = '" + code.Text + "' or ms_imei3 = '" + code.Text + "')"))
                     {
                         OperateResult.AppendText(">>" + type + ":" + code.Text + "错误,不允许重复\n", Color.Red);
                         OperateResult.AppendText(">>请输入" + type + "\n", Color.Black,code);
@@ -388,7 +388,7 @@ namespace UAS_MES.Make
                 case "BT":
                 case "MAC":
                 case "NETCODE":
-                    if (!ChangeResult.Checked&&checkExist("ms_status in (1,2,3) and nvl(ms_nextmacode,' ')<>' ' and  MS_" + type + "='" + code.Text + "'"))
+                    if (!ChangeResult.Checked&&checkExist("ms_status in (1,2,3) and nvl(ms_nextmacode,' ')=' ' and  MS_" + type + "='" + code.Text + "'"))
                     {
                         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);
@@ -413,7 +413,7 @@ namespace UAS_MES.Make
                         //遍历判断已采集的信息是否已存在
                         foreach (DictionaryEntry de in hs)
                         {
-                            if (dh.CheckExist("makeserial", "ms_status in (1,2,3) and nvl(ms_nextmacode,' ')<>' ' and  MS_" + (de.Key.ToString() == "WIFI" ? "MAC" : de.Key) + "='" + de.Value + "'"))
+                            if (dh.CheckExist("makeserial", "ms_status in (1,2,3) and nvl(ms_nextmacode,' ')=' ' and  MS_" + (de.Key.ToString() == "WIFI" ? "MAC" : de.Key) + "='" + de.Value + "'"))
                             {
                                 flag = false;
                                 OperateResult.AppendText(">>" + de.Key + "已被使用,请重新输入TSN,重新转换\n", Color.Red);

+ 2 - 2
UAS-MES/FunctionCode/Make/Make_UpdateCollectCode.cs

@@ -161,7 +161,7 @@ namespace UAS_MES.Make
                                     return;
                                 }
                                 //验证长度前缀通过,验证数据库
-                                if (dh.CheckExist("makeserial", "ms_status in (1,2,3) and nvl(ms_nextmacode,' ')<>' ' and  ms_" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + " ='" + inputValue.Text + "'"))
+                                if (dh.CheckExist("makeserial", "ms_status in (1,2,3) and nvl(ms_nextmacode,' ')=' ' and  ms_" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + " ='" + inputValue.Text + "'"))
                                 {
                                     OperateResult.AppendText("<<" + ((CheckBox)list[step - 1]).Text + ":" + inputValue.Text + "错误,已被使用\n", Color.Red, inputValue);
                                     return;
@@ -182,7 +182,7 @@ namespace UAS_MES.Make
                                 return;
                             }
                             //验证长度前缀通过,验证数据库
-                            if (dh.CheckExist("makeserial", "ms_status in (1,2,3) and nvl(ms_nextmacode,' ')<>' ' and  ms_" + (((CheckBox)list[step - 1]).Text == "网标" ? "NETCODE" : ((CheckBox)list[step - 1]).Text) + " ='" + inputValue.Text + "'"))
+                            if (dh.CheckExist("makeserial", "ms_status in (1,2,3) and nvl(ms_nextmacode,' ')=' ' and  ms_" + (((CheckBox)list[step - 1]).Text == "网标" ? "NETCODE" : ((CheckBox)list[step - 1]).Text) + " ='" + inputValue.Text + "'"))
                             {
                                 OperateResult.AppendText("<<" + ((CheckBox)list[step - 1]).Text + ":" + inputValue.Text + "错误,已被使用\n", Color.Red, inputValue);
                                 return;