Procházet zdrojové kódy

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

Hcsy před 8 roky
rodič
revize
6ae4eeaffb

+ 3 - 0
UAS-MES/FunctionCode/Make/Make_BigBoxCollection.cs

@@ -163,6 +163,9 @@ namespace UAS_MES.Make
                                         dh.ExecuteSql("update package set pa_makecode='" + carton_macode + "' where pa_outboxcode='" + bigoutboxcode.Text + "'", "update");
                                     }
                                     LogicHandler.DoCommandLog(Tag.ToString(), User.UserSourceCode, pa_makecode.Text, User.UserLineCode, User.UserSourceCode, "大箱采集", "卡通箱" + outboxcode.Text + "采集成功", outboxcode.Text, "");
+                                    //记录卡通箱所有序列号操作日志
+                                    LogicHandler.OutBoxStepPass(outboxcode.Text, pa_makecode.Text, User.UserSourceCode, User.UserCode, "大箱采集成功,大箱号:" + bigoutboxcode.Text, "大箱采集");
+                                    //
                                     OperateResult.AppendText(">>卡通箱号" + outboxcode.Text + "采集成功!\n", Color.Green, outboxcode);
                                     LoadGridData();
                                     LoadCollectNum();

+ 3 - 0
UAS-MES/FunctionCode/Make/Make_PalletCollection.cs

@@ -148,6 +148,9 @@ namespace UAS_MES.Make
                                     pa_makecode.Text = carton_macode;
                                     dh.ExecuteSql("update package set pa_makecode='" + carton_macode + "' where pa_outboxcode='" + palletcode.Text + "'", "update");
                                 }
+                                //已箱号过站
+                                LogicHandler.OutBoxStepPass(outboxcode.Text, pa_makecode.Text, User.UserSourceCode,User.UserSourceCode,"栈板采集成功,栈板号:"+palletcode.Text,"栈板采集");
+                                LogicHandler.DoCommandLog(Tag.ToString(),User.UserCode,"",User.UserLineCode,User.UserSourceCode,"栈板采集","栈板采集成功",palletcode.Text,"");
                                 OperateResult.AppendText(">>箱号" + outboxcode.Text + "采集成功!\n", Color.Green, outboxcode);
                                 LoadGridData();
                             }

+ 12 - 3
UAS-MES/FunctionCode/Make/Make_Repair.cs

@@ -133,7 +133,7 @@ namespace UAS_MES.Make
                     return;
                 }
                 sql.Clear();
-                sql.Append("select ma_kind,ms_status,ms_reworkstatus,nvl(ms_ifrework,0)ms_ifrework from makeserial left join make ");
+                sql.Append("select ms_status,ms_reworkstatus,nvl(ms_ifrework,0)ms_ifrework from makeserial left join make ");
                 sql.Append("on ms_makecode=ma_code where ms_sncode = '" + GetSNCode.Text + "' order by ms_id desc");
                 dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                 if (dt.Rows.Count > 0)
@@ -228,7 +228,6 @@ namespace UAS_MES.Make
         private void Make_Repair_SizeChanged(object sender, EventArgs e)
         {
             asc.controlAutoSize(this);
-
         }
 
         private void BadCodeTree_NodeMouseClick(object sender, TreeNodeMouseClickEventArgs e)
@@ -274,10 +273,19 @@ namespace UAS_MES.Make
         {
             BadCodeTree.Nodes.Clear();
             sql.Clear();
+            //不是返工工单时的取当前工单
             sql.Append("select mb_id,mb_sncode,mb_badcode,mb_bgcode,nvl(bc_name,mb_badcode) bc_name,nvl(bg_name,mb_bgcode) bg_name,");
             sql.Append("mb_badremark from makebad left join badcode on bc_code=mb_badcode left join badgroup ");
             sql.Append("on bg_code=mb_bgcode where mb_sncode='" + (GetSNCode.Text == "" ? ms_sncode.Text : GetSNCode.Text) + "' and mb_makecode='" + macode + "' and mb_status=0");
             dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+            if (dt.Rows.Count == 0)
+            {
+                sql.Clear();
+                sql.Append("select mb_id,mb_sncode,mb_badcode,mb_bgcode,nvl(bc_name,mb_badcode) bc_name,nvl(bg_name,mb_bgcode) bg_name, ");
+                sql.Append("mb_badremark from makebad left join badcode on bc_code=mb_badcode left join badgroup on bg_code=mb_bgcode  ");
+                sql.Append("left join make on ma_code=mb_makecode where mb_sncode='" + (GetSNCode.Text == "" ? ms_sncode.Text : GetSNCode.Text) + "' and mb_makecode<>'" + macode + "' and mb_status=0");
+                dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
+            }
             for (int i = 0; i < dt.Rows.Count; i++)
             {
                 //添加根节点
@@ -431,7 +439,8 @@ namespace UAS_MES.Make
                     {
                         string ms_ifrework = dt.Rows[0]["ms_ifrework"].ToString();
                         string ms_paststep = dt.Rows[0]["ms_paststep"].ToString();
-                        if (!ms_paststep.Contains(cd_stepcode.Text))
+                        //如果回流的执行过的工序为空
+                        if (!ms_paststep.Contains(cd_stepcode.Text) && ms_paststep != "")
                         {
                             OperatResult.AppendText(">>不允许回流到未执行的工序\n", Color.Red);
                             return;

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

@@ -361,7 +361,7 @@ namespace UAS_MES.Make
                 case "IMEI1":
                 case "IMEI2":
                 case "IMEI3":
-                    if (!ChangeResult.Checked&&checkExist("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);
@@ -384,7 +384,7 @@ namespace UAS_MES.Make
                 case "BT":
                 case "MAC":
                 case "NETCODE":
-                    if (!ChangeResult.Checked&&checkExist("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);
@@ -409,7 +409,7 @@ namespace UAS_MES.Make
                         //遍历判断已采集的信息是否已存在
                         foreach (DictionaryEntry de in hs)
                         {
-                            if (dh.CheckExist("makeserial", "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);
@@ -612,10 +612,10 @@ namespace UAS_MES.Make
                     }
                     if (rules.Rows[0]["psr_length"].ToString() != "")
                     {
-                        TSNLength.Text = rules.Rows[0]["psr_length"].ToString();
-                        TSNLength.Enabled = false;
-                        TSNLength_checkBox.Checked = true;
-                        TSNLength_checkBox.Enabled = false;
+                        SNLength.Text = rules.Rows[0]["psr_length"].ToString();
+                        SNLength.Enabled = false;
+                        SNLength_checkBox.Checked = true;
+                        SNLength_checkBox.Enabled = false;
                     }
                 }
             }

+ 58 - 52
UAS-MES/FunctionCode/Make/Make_UpdateCollectCode.Designer.cs

@@ -40,12 +40,12 @@
             this.dataGridViewTextBoxColumn3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.dataGridViewTextBoxColumn4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.collects = new UAS_MES.CustomControl.GroupBoxWithBorder.GroupBoxWithBorder();
-            this.Imei3 = new UAS_MES.CustomControl.CustomCheckBox.CustomCheckBox();
-            this.Imei2 = new UAS_MES.CustomControl.CustomCheckBox.CustomCheckBox();
-            this.Imei1 = new UAS_MES.CustomControl.CustomCheckBox.CustomCheckBox();
-            this.NetCode = new UAS_MES.CustomControl.CustomCheckBox.CustomCheckBox();
-            this.Bt = new UAS_MES.CustomControl.CustomCheckBox.CustomCheckBox();
             this.Mac = new UAS_MES.CustomControl.CustomCheckBox.CustomCheckBox();
+            this.Bt = new UAS_MES.CustomControl.CustomCheckBox.CustomCheckBox();
+            this.NetCode = new UAS_MES.CustomControl.CustomCheckBox.CustomCheckBox();
+            this.Imei1 = new UAS_MES.CustomControl.CustomCheckBox.CustomCheckBox();
+            this.Imei2 = new UAS_MES.CustomControl.CustomCheckBox.CustomCheckBox();
+            this.Imei3 = new UAS_MES.CustomControl.CustomCheckBox.CustomCheckBox();
             this.inputValue = new UAS_MES.CustomControl.TextBoxWithIcon.EnterTextBox();
             this.OperateResult = new UAS_MES.CustomControl.RichText.RichTextAutoBottom();
             ((System.ComponentModel.ISupportInitialize)(this.collectCodeRules)).BeginInit();
@@ -154,38 +154,29 @@
             this.collects.TabStop = false;
             this.collects.TextColor = System.Drawing.Color.Black;
             // 
-            // Imei3
-            // 
-            this.Imei3.AutoSize = true;
-            this.Imei3.Location = new System.Drawing.Point(37, 239);
-            this.Imei3.Name = "Imei3";
-            this.Imei3.Power = null;
-            this.Imei3.Size = new System.Drawing.Size(79, 22);
-            this.Imei3.TabIndex = 0;
-            this.Imei3.Text = "IMEI3";
-            this.Imei3.UseVisualStyleBackColor = true;
-            // 
-            // Imei2
+            // Mac
             // 
-            this.Imei2.AutoSize = true;
-            this.Imei2.Location = new System.Drawing.Point(37, 196);
-            this.Imei2.Name = "Imei2";
-            this.Imei2.Power = null;
-            this.Imei2.Size = new System.Drawing.Size(79, 22);
-            this.Imei2.TabIndex = 1;
-            this.Imei2.Text = "IMEI2";
-            this.Imei2.UseVisualStyleBackColor = true;
+            this.Mac.AutoSize = true;
+            this.Mac.Location = new System.Drawing.Point(37, 31);
+            this.Mac.Name = "Mac";
+            this.Mac.Power = null;
+            this.Mac.Size = new System.Drawing.Size(106, 22);
+            this.Mac.TabIndex = 5;
+            this.Mac.Text = "MAC/WIFI";
+            this.Mac.UseVisualStyleBackColor = true;
+            this.Mac.CheckedChanged += new System.EventHandler(this.Mac_CheckedChanged);
             // 
-            // Imei1
+            // Bt
             // 
-            this.Imei1.AutoSize = true;
-            this.Imei1.Location = new System.Drawing.Point(37, 156);
-            this.Imei1.Name = "Imei1";
-            this.Imei1.Power = null;
-            this.Imei1.Size = new System.Drawing.Size(79, 22);
-            this.Imei1.TabIndex = 2;
-            this.Imei1.Text = "IMEI1";
-            this.Imei1.UseVisualStyleBackColor = true;
+            this.Bt.AutoSize = true;
+            this.Bt.Location = new System.Drawing.Point(37, 74);
+            this.Bt.Name = "Bt";
+            this.Bt.Power = null;
+            this.Bt.Size = new System.Drawing.Size(52, 22);
+            this.Bt.TabIndex = 4;
+            this.Bt.Text = "BT";
+            this.Bt.UseVisualStyleBackColor = true;
+            this.Bt.CheckedChanged += new System.EventHandler(this.Mac_CheckedChanged);
             // 
             // NetCode
             // 
@@ -197,28 +188,43 @@
             this.NetCode.TabIndex = 3;
             this.NetCode.Text = "网标";
             this.NetCode.UseVisualStyleBackColor = true;
+            this.NetCode.CheckedChanged += new System.EventHandler(this.Mac_CheckedChanged);
             // 
-            // Bt
+            // Imei1
             // 
-            this.Bt.AutoSize = true;
-            this.Bt.Location = new System.Drawing.Point(37, 74);
-            this.Bt.Name = "Bt";
-            this.Bt.Power = null;
-            this.Bt.Size = new System.Drawing.Size(52, 22);
-            this.Bt.TabIndex = 4;
-            this.Bt.Text = "BT";
-            this.Bt.UseVisualStyleBackColor = true;
+            this.Imei1.AutoSize = true;
+            this.Imei1.Location = new System.Drawing.Point(37, 156);
+            this.Imei1.Name = "Imei1";
+            this.Imei1.Power = null;
+            this.Imei1.Size = new System.Drawing.Size(79, 22);
+            this.Imei1.TabIndex = 2;
+            this.Imei1.Text = "IMEI1";
+            this.Imei1.UseVisualStyleBackColor = true;
+            this.Imei1.CheckedChanged += new System.EventHandler(this.Mac_CheckedChanged);
             // 
-            // Mac
+            // Imei2
             // 
-            this.Mac.AutoSize = true;
-            this.Mac.Location = new System.Drawing.Point(37, 31);
-            this.Mac.Name = "Mac";
-            this.Mac.Power = null;
-            this.Mac.Size = new System.Drawing.Size(106, 22);
-            this.Mac.TabIndex = 5;
-            this.Mac.Text = "MAC/WIFI";
-            this.Mac.UseVisualStyleBackColor = true;
+            this.Imei2.AutoSize = true;
+            this.Imei2.Location = new System.Drawing.Point(37, 196);
+            this.Imei2.Name = "Imei2";
+            this.Imei2.Power = null;
+            this.Imei2.Size = new System.Drawing.Size(79, 22);
+            this.Imei2.TabIndex = 1;
+            this.Imei2.Text = "IMEI2";
+            this.Imei2.UseVisualStyleBackColor = true;
+            this.Imei2.CheckedChanged += new System.EventHandler(this.Mac_CheckedChanged);
+            // 
+            // Imei3
+            // 
+            this.Imei3.AutoSize = true;
+            this.Imei3.Location = new System.Drawing.Point(37, 239);
+            this.Imei3.Name = "Imei3";
+            this.Imei3.Power = null;
+            this.Imei3.Size = new System.Drawing.Size(79, 22);
+            this.Imei3.TabIndex = 0;
+            this.Imei3.Text = "IMEI3";
+            this.Imei3.UseVisualStyleBackColor = true;
+            this.Imei3.CheckedChanged += new System.EventHandler(this.Mac_CheckedChanged);
             // 
             // inputValue
             // 

+ 16 - 0
UAS-MES/FunctionCode/Make/Make_UpdateCollectCode.cs

@@ -261,5 +261,21 @@ namespace UAS_MES.Make
             }
             return true;
         }
+
+        private void Mac_CheckedChanged(object sender, EventArgs e)
+        {
+            //当有checkBox状态改变的时候
+            if (step!=0)
+            {
+                //步骤码归零
+                step = 0;
+                //清除list,信息栏
+                list.Clear();
+                BaseUtil.CleanDataTableData(info);
+                //聚焦,提示
+                inputValue.Focus();
+                OperateResult.AppendText(">>请采集SN\n", Color.Black);
+            }
+        }
     }
 }

+ 0 - 12
UAS-MES/FunctionCode/Make/Make_UpdateCollectCode.resx

@@ -129,16 +129,4 @@
   <metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
-  <metadata name="psr_type.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="psr_prefix.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="psr_length.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
-  <metadata name="Column1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
-    <value>True</value>
-  </metadata>
 </root>

+ 1 - 1
UAS-MES/FunctionCode/OQC/OQC_SamplingDataCollection.cs

@@ -298,7 +298,7 @@ namespace UAS_MES.OQC
                             sql.Append(",mb_sourcecode,mb_badcode,mb_bgcode,mb_badtable,mb_soncode,mb_status)");
                             sql.Append("select makebad_seq.nextval,ma_code,ms_code,ms_sncode,'" + User.UserCode + "',sysdate,'" + User.CurrentStepCode + "',ms_sourcecode,:bc_code,:bg_code,'',");
                             sql.Append("sp_soncode,'0' from make left join makeSerial on ms_makecode=ma_code left join stepProduct on ");
-                            sql.Append("sp_mothercode=ma_prodcode and sp_stepcode=ms_nextstepcode where ms_sncode='" + sncode.Text + "'");
+                            sql.Append("sp_mothercode=ma_prodcode and sp_stepcode=ms_nextstepcode where ms_sncode='" + sncode.Text + "' and ms_makecode='"+ob_makecode.Text+"'");
                             dh.BatchInsert(sql.GetString(), new string[] { "bc_code", "bg_code" }, bc_code.ToArray(), bg_code.ToArray());
                         }
                         //更新项目编号中的抽检数、不合格数,根据采样项目记录