Explorar o código

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

Hcsy %!s(int64=8) %!d(string=hai) anos
pai
achega
c8217e0234

+ 22 - 16
UAS-MES/FunctionCode/Make/Make_UpdateCollectCode.Designer.cs

@@ -143,7 +143,7 @@
             this.collects.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.collects.Name = "collects";
             this.collects.Padding = new System.Windows.Forms.Padding(3, 2, 3, 2);
-            this.collects.Size = new System.Drawing.Size(164, 239);
+            this.collects.Size = new System.Drawing.Size(199, 239);
             this.collects.TabIndex = 92;
             this.collects.TabStop = false;
             this.collects.TextColor = System.Drawing.Color.Black;
@@ -151,11 +151,12 @@
             // Mac
             // 
             this.Mac.AutoSize = true;
-            this.Mac.Location = new System.Drawing.Point(33, 26);
+            this.Mac.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Mac.Location = new System.Drawing.Point(33, 20);
             this.Mac.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Mac.Name = "Mac";
             this.Mac.Power = null;
-            this.Mac.Size = new System.Drawing.Size(93, 19);
+            this.Mac.Size = new System.Drawing.Size(133, 31);
             this.Mac.TabIndex = 5;
             this.Mac.Text = "MAC/WIFI";
             this.Mac.UseVisualStyleBackColor = true;
@@ -164,11 +165,12 @@
             // Bt
             // 
             this.Bt.AutoSize = true;
-            this.Bt.Location = new System.Drawing.Point(33, 62);
+            this.Bt.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Bt.Location = new System.Drawing.Point(33, 57);
             this.Bt.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Bt.Name = "Bt";
             this.Bt.Power = null;
-            this.Bt.Size = new System.Drawing.Size(45, 19);
+            this.Bt.Size = new System.Drawing.Size(58, 31);
             this.Bt.TabIndex = 4;
             this.Bt.Text = "BT";
             this.Bt.UseVisualStyleBackColor = true;
@@ -177,11 +179,12 @@
             // NetCode
             // 
             this.NetCode.AutoSize = true;
+            this.NetCode.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
             this.NetCode.Location = new System.Drawing.Point(33, 93);
             this.NetCode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.NetCode.Name = "NetCode";
             this.NetCode.Power = null;
-            this.NetCode.Size = new System.Drawing.Size(59, 19);
+            this.NetCode.Size = new System.Drawing.Size(74, 31);
             this.NetCode.TabIndex = 3;
             this.NetCode.Text = "网标";
             this.NetCode.UseVisualStyleBackColor = true;
@@ -190,11 +193,12 @@
             // Imei1
             // 
             this.Imei1.AutoSize = true;
-            this.Imei1.Location = new System.Drawing.Point(33, 130);
+            this.Imei1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Imei1.Location = new System.Drawing.Point(33, 129);
             this.Imei1.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Imei1.Name = "Imei1";
             this.Imei1.Power = null;
-            this.Imei1.Size = new System.Drawing.Size(69, 19);
+            this.Imei1.Size = new System.Drawing.Size(89, 31);
             this.Imei1.TabIndex = 2;
             this.Imei1.Text = "IMEI1";
             this.Imei1.UseVisualStyleBackColor = true;
@@ -203,11 +207,12 @@
             // Imei2
             // 
             this.Imei2.AutoSize = true;
-            this.Imei2.Location = new System.Drawing.Point(33, 163);
+            this.Imei2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Imei2.Location = new System.Drawing.Point(33, 166);
             this.Imei2.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Imei2.Name = "Imei2";
             this.Imei2.Power = null;
-            this.Imei2.Size = new System.Drawing.Size(69, 19);
+            this.Imei2.Size = new System.Drawing.Size(89, 31);
             this.Imei2.TabIndex = 1;
             this.Imei2.Text = "IMEI2";
             this.Imei2.UseVisualStyleBackColor = true;
@@ -216,11 +221,12 @@
             // Imei3
             // 
             this.Imei3.AutoSize = true;
-            this.Imei3.Location = new System.Drawing.Point(33, 199);
+            this.Imei3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.Imei3.Location = new System.Drawing.Point(33, 202);
             this.Imei3.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Imei3.Name = "Imei3";
             this.Imei3.Power = null;
-            this.Imei3.Size = new System.Drawing.Size(69, 19);
+            this.Imei3.Size = new System.Drawing.Size(89, 31);
             this.Imei3.TabIndex = 0;
             this.Imei3.Text = "IMEI3";
             this.Imei3.UseVisualStyleBackColor = true;
@@ -231,7 +237,7 @@
             this.inputValue.AllPower = null;
             this.inputValue.BackColor = System.Drawing.Color.White;
             this.inputValue.ID = null;
-            this.inputValue.Location = new System.Drawing.Point(173, 477);
+            this.inputValue.Location = new System.Drawing.Point(147, 477);
             this.inputValue.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.inputValue.Name = "inputValue";
             this.inputValue.Power = null;
@@ -248,7 +254,7 @@
             this.OperateResult.Location = new System.Drawing.Point(24, 272);
             this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 3, 4, 3);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(895, 191);
+            this.OperateResult.Size = new System.Drawing.Size(876, 191);
             this.OperateResult.TabIndex = 88;
             this.OperateResult.Text = "";
             // 
@@ -256,7 +262,7 @@
             // 
             this.label3.AutoSize = true;
             this.label3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label3.Location = new System.Drawing.Point(95, 475);
+            this.label3.Location = new System.Drawing.Point(69, 475);
             this.label3.Name = "label3";
             this.label3.Size = new System.Drawing.Size(72, 27);
             this.label3.TabIndex = 93;
@@ -266,7 +272,7 @@
             // 
             this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(996, 512);
+            this.ClientSize = new System.Drawing.Size(924, 512);
             this.Controls.Add(this.label3);
             this.Controls.Add(this.collects);
             this.Controls.Add(this.inputValue);

+ 35 - 33
UAS-MES/FunctionCode/Make/Make_UpdateCollectCode.cs

@@ -31,12 +31,12 @@ namespace UAS_MES.Make
 
         string ms_id = "";
 
-        StringBuilder sb ;
+        StringBuilder sb;
 
         string sncode = "";
-        StringBuilder oldData ;
+        StringBuilder oldData;
         //记录新数据
-        StringBuilder newData ;
+        StringBuilder newData;
         public Make_UpdateCollectCode()
         {
             InitializeComponent();
@@ -62,15 +62,15 @@ namespace UAS_MES.Make
 
         private void inputValue_KeyDown(object sender, KeyEventArgs e)
         {
-            if (e.KeyCode==Keys.Enter)
+            if (e.KeyCode == Keys.Enter)
             {
                 //输入不能为空
-                if (inputValue.Text=="")
+                if (inputValue.Text == "")
                 {
                     OperateResult.AppendText("<<输入不能为空\n", Color.Red);
                     return;
                 }
-                OperateResult.AppendText(">>"+inputValue.Text+"\n", Color.Black);
+                OperateResult.AppendText(">>" + inputValue.Text + "\n", Color.Black);
                 if (step == 0)
                 {
                     //判断是否有已勾选的项次
@@ -81,10 +81,10 @@ namespace UAS_MES.Make
                             list.Add((ctl as CheckBox));
                         }
                     }
-                    if (list.Count==0)
+                    if (list.Count == 0)
                     {
                         //无勾选的内容
-                        OperateResult.AppendText("<<请先勾选需要更新的信息\n", Color.Red,inputValue);
+                        OperateResult.AppendText("<<请先勾选需要更新的信息\n", Color.Red, inputValue);
                         return;
                     }
                     //判断TSN或者SN是否存在
@@ -96,9 +96,9 @@ namespace UAS_MES.Make
                         return;
                     }
                     //查询序列号状态
-                    dt = (DataTable)dh.ExecuteSql("select ms_status,ms_makecode from makeserial where ms_id='"+ms_id+"'", "select");
+                    dt = (DataTable)dh.ExecuteSql("select ms_status,ms_makecode from makeserial where ms_id='" + ms_id + "'", "select");
                     //序列号状态码必须是3
-                    if (dt.Rows[0]["ms_status"].ToString()!="3")
+                    if (dt.Rows[0]["ms_status"].ToString() != "3")
                     {
                         OperateResult.AppendText("<<序列号必须是待维修状态\n", Color.Red, inputValue);
                         return;
@@ -106,9 +106,9 @@ namespace UAS_MES.Make
                     sql.Clear();
                     sql.Append("select * from (select rownum rn, ms_prodcode,ms_makecode,ms_salecode,");
                     sql.Append("ms_mac,ms_imei1,ms_bt,ms_netcode,ms_imei2,ms_imei3  from makeserial ");
-                    sql.Append("where ms_firstsn=(select ms_firstsn from makeserial where ms_id='"+ms_id+"')");
+                    sql.Append("where ms_firstsn=(select ms_firstsn from makeserial where ms_id='" + ms_id + "')");
                     sql.Append(" and (nvl(ms_mac,' ')<>' ' or nvl(ms_bt,' ')<>' ' or nvl(ms_imei1,' ')<>' ' ) order by ms_id asc)where rn=1");
-                    dt = (DataTable)dh.ExecuteSql(sql.GetString(),"select");
+                    dt = (DataTable)dh.ExecuteSql(sql.GetString(), "select");
                     //无值则提示没有需要更新的信息
                     if (dt.Rows.Count == 0)
                     {
@@ -117,12 +117,12 @@ namespace UAS_MES.Make
                     }
                     else
                     {
-                        info = (DataTable)dh.ExecuteSql("select psr_type,psr_prefix,psr_length from productsnrelation where psr_prodcode='"+dt.Rows[0]["ms_prodcode"].ToString() +"'", "select");
+                        info = (DataTable)dh.ExecuteSql("select psr_type,psr_prefix,psr_length from productsnrelation where psr_prodcode='" + dt.Rows[0]["ms_prodcode"].ToString() + "'", "select");
                         //查询规则显示
                         collectCodeRules.DataSource = info;
                     }
                     step = 1;
-                    OperateResult.AppendText("<<请输入"+((CheckBox)list[0]).Text+"\n", Color.Green, inputValue);
+                    OperateResult.AppendText("<<请输入" + ((CheckBox)list[0]).Text + "\n", Color.Green, inputValue);
                     sb = new StringBuilder();
                     oldData = new StringBuilder();
                     newData = new StringBuilder();
@@ -131,7 +131,7 @@ namespace UAS_MES.Make
                 //采集的关联采集信息
                 {
                     //从第一个开始
-                    switch (((CheckBox)list[step-1]).Text)
+                    switch (((CheckBox)list[step - 1]).Text)
                     {
                         case "MAC/WIFI":
                         case "BT":
@@ -139,13 +139,13 @@ namespace UAS_MES.Make
                             {
                                 //如果一样提示用户“MAC 不允许与原来的值一致”,“请采集MAC”;
                                 OperateResult.AppendText("<<" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + "不允许与原来的值一致\n", Color.Red);
-                                OperateResult.AppendText(">>请采集" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + "\n", Color.Black,inputValue);
+                                OperateResult.AppendText(">>请采集" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + "\n", Color.Black, inputValue);
                                 return;
                             }
                             else
                             {
                                 //判断是否有合同号MAC范围
-                                if (dh.CheckExist("SaleMacBTRange", "sr_sacode='"+dt.Rows[0]["ms_salecode"].ToString()+"' and sr_type='"+ ((CheckBox)list[step - 1]).Text.Split('/')[0] + "'"))
+                                if (dh.CheckExist("SaleMacBTRange", "sr_sacode='" + dt.Rows[0]["ms_salecode"].ToString() + "' and sr_type='" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + "'"))
                                 {
                                     //有范围的情况下看是否在范围内
                                     if (!dh.CheckExist("SaleMacBTRange", "sr_sacode='" + dt.Rows[0]["ms_salecode"].ToString() + "' and  sr_type='" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + "' AND  '" + inputValue.Text + "' between sr_startcode and sr_endcode"))
@@ -156,19 +156,20 @@ namespace UAS_MES.Make
                                     }
                                 }
                                 //验证长度前缀
-                                if (!checkPrefixAndLength()) {
+                                if (!checkPrefixAndLength())
+                                {
                                     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;
                                 }
                                 //通过校验
-                                sb.Append("ms_"+((CheckBox)list[step - 1]).Text.Split('/')[0]+" = '"+inputValue.Text+"',");
-                                oldData.Append("ms_" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + ":"+ dt.Rows[0]["ms_" + ((CheckBox)list[step - 1]).Text.Split('/')[0]].ToString()+",");
-                                newData.Append("ms_" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + ":" +inputValue.Text+",");
+                                sb.Append("ms_" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + " = '" + inputValue.Text + "',");
+                                oldData.Append("ms_" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + ":" + dt.Rows[0]["ms_" + ((CheckBox)list[step - 1]).Text.Split('/')[0]].ToString() + ",");
+                                newData.Append("ms_" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + ":" + inputValue.Text + ",");
                             }
                             break;
                         case "网标":
@@ -176,7 +177,8 @@ namespace UAS_MES.Make
                         case "IMEI2":
                         case "IMEI3":
                             //验证长度前缀
-                            if (!checkPrefixAndLength()) {
+                            if (!checkPrefixAndLength())
+                            {
                                 return;
                             }
                             //验证长度前缀通过,验证数据库
@@ -186,7 +188,7 @@ namespace UAS_MES.Make
                                 return;
                             }
                             //通过校验
-                            sb.Append("ms_" + (((CheckBox)list[step - 1]).Text == "网标" ? "NETCODE" : ((CheckBox)list[step - 1]).Text)+" = '"+inputValue.Text+"',");
+                            sb.Append("ms_" + (((CheckBox)list[step - 1]).Text == "网标" ? "NETCODE" : ((CheckBox)list[step - 1]).Text) + " = '" + inputValue.Text + "',");
                             oldData.Append("ms_" + (((CheckBox)list[step - 1]).Text == "网标" ? "NETCODE" : ((CheckBox)list[step - 1]).Text) + ":" + dt.Rows[0]["ms_" + (((CheckBox)list[step - 1]).Text == "网标" ? "NETCODE" : ((CheckBox)list[step - 1]).Text)].ToString() + ",");
                             newData.Append("ms_" + (((CheckBox)list[step - 1]).Text == "网标" ? "NETCODE" : ((CheckBox)list[step - 1]).Text) + ":" + inputValue.Text + ",");
                             break;
@@ -197,19 +199,19 @@ namespace UAS_MES.Make
                         //更新数据库
                         sql.Clear();
                         sql.Append("update makeserial set ");
-                        sql.Append(sb.ToString().Substring(0,sb.ToString().Length-1));
-                        sql.Append(" where ms_id='"+ms_id+"'");
-                        dh.ExecuteSql(sql.GetString(),"update");
+                        sql.Append(sb.ToString().Substring(0, sb.ToString().Length - 1));
+                        sql.Append(" where ms_id='" + ms_id + "'");
+                        dh.ExecuteSql(sql.GetString(), "update");
                         //提示烧录成功
                         OperateResult.AppendText(">>烧录成功\n", Color.Green);
                         //记录日志
-                        LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, dt.Rows[0]["ms_makecode"].ToString(), User.UserLineCode, User.UserSourceCode, "更新烧录", "原数据:"+oldData.ToString()+"新数据:"+newData.ToString(), sncode,"");
+                        LogicHandler.DoCommandLog(Tag.ToString(), User.UserCode, dt.Rows[0]["ms_makecode"].ToString(), User.UserLineCode, User.UserSourceCode, "更新烧录", "原数据:" + oldData.ToString() + "新数据:" + newData.ToString(), sncode, "");
                         step = 0;
                         //清除规则
                         BaseUtil.CleanDataTableData(info);
                         //聚焦,提示
                         inputValue.Focus();
-                        OperateResult.AppendText("<<请采集SN\n", Color.Black,inputValue);
+                        OperateResult.AppendText("<<请采集SN\n", Color.Black, inputValue);
                         //清除LIST
                         list.Clear();
                     }
@@ -217,7 +219,7 @@ namespace UAS_MES.Make
                     {
                         step++;
                         //请输入下一个
-                        OperateResult.AppendText(">>请输入" + ((CheckBox)list[step-1]).Text.Split('/')[0] + "\n", Color.Green,inputValue);
+                        OperateResult.AppendText(">>请输入" + ((CheckBox)list[step - 1]).Text.Split('/')[0] + "\n", Color.Green, inputValue);
                     }
                 }
             }
@@ -225,9 +227,9 @@ namespace UAS_MES.Make
         private bool checkPrefixAndLength()
         {
             //找到对应的规则
-            for(int i=0;i<info.Rows.Count;i++)
+            for (int i = 0; i < info.Rows.Count; i++)
             {
-                if ((((CheckBox)list[step - 1]).Text.Split('/')[0]=="网标"?"NETCODE": ((CheckBox)list[step - 1]).Text.Split('/')[0])==info.Rows[i]["psr_type"].ToString())
+                if ((((CheckBox)list[step - 1]).Text.Split('/')[0] == "网标" ? "NETCODE" : ((CheckBox)list[step - 1]).Text.Split('/')[0]) == info.Rows[i]["psr_type"].ToString())
                 {
                     //校验长度
                     if ((info.Rows[i]["psr_length"].ToString() == "" ? true : inputValue.Text.Length != int.Parse(info.Rows[i]["psr_length"].ToString())))
@@ -265,7 +267,7 @@ namespace UAS_MES.Make
         private void Mac_CheckedChanged(object sender, EventArgs e)
         {
             //当有checkBox状态改变的时候
-            if (step!=0)
+            if (step != 0)
             {
                 //步骤码归零
                 step = 0;

+ 37 - 31
UAS-MES/FunctionCode/Packing/Packing_CartonSplit.Designer.cs

@@ -48,19 +48,22 @@
             // 
             this.label1.AutoSize = true;
             this.label1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label1.Location = new System.Drawing.Point(39, 29);
+            this.label1.Location = new System.Drawing.Point(35, 24);
             this.label1.Name = "label1";
-            this.label1.Size = new System.Drawing.Size(62, 31);
+            this.label1.Size = new System.Drawing.Size(52, 27);
             this.label1.TabIndex = 0;
             this.label1.Text = "箱号";
             // 
             // lock_outbox
             // 
             this.lock_outbox.AutoSize = true;
-            this.lock_outbox.Location = new System.Drawing.Point(342, 35);
+            this.lock_outbox.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.lock_outbox.Location = new System.Drawing.Point(304, 24);
+            this.lock_outbox.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.lock_outbox.Name = "lock_outbox";
-            this.lock_outbox.Size = new System.Drawing.Size(22, 21);
+            this.lock_outbox.Size = new System.Drawing.Size(74, 31);
             this.lock_outbox.TabIndex = 2;
+            this.lock_outbox.Text = "锁定";
             this.lock_outbox.UseVisualStyleBackColor = true;
             this.lock_outbox.CheckedChanged += new System.EventHandler(this.lock_outbox_CheckedChanged);
             // 
@@ -68,9 +71,9 @@
             // 
             this.label2.AutoSize = true;
             this.label2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label2.Location = new System.Drawing.Point(676, 29);
+            this.label2.Location = new System.Drawing.Point(601, 24);
             this.label2.Name = "label2";
-            this.label2.Size = new System.Drawing.Size(110, 31);
+            this.label2.Size = new System.Drawing.Size(92, 27);
             this.label2.TabIndex = 3;
             this.label2.Text = "箱内数量";
             // 
@@ -78,18 +81,18 @@
             // 
             this.pa_currentqty.AutoSize = true;
             this.pa_currentqty.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.pa_currentqty.Location = new System.Drawing.Point(792, 29);
+            this.pa_currentqty.Location = new System.Drawing.Point(704, 24);
             this.pa_currentqty.Name = "pa_currentqty";
-            this.pa_currentqty.Size = new System.Drawing.Size(0, 31);
+            this.pa_currentqty.Size = new System.Drawing.Size(0, 27);
             this.pa_currentqty.TabIndex = 4;
             // 
             // label4
             // 
             this.label4.AutoSize = true;
             this.label4.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label4.Location = new System.Drawing.Point(39, 116);
+            this.label4.Location = new System.Drawing.Point(35, 97);
             this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(110, 31);
+            this.label4.Size = new System.Drawing.Size(92, 27);
             this.label4.TabIndex = 5;
             this.label4.Text = "产品编号";
             // 
@@ -97,18 +100,18 @@
             // 
             this.pa_prodcode.AutoSize = true;
             this.pa_prodcode.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.pa_prodcode.Location = new System.Drawing.Point(160, 116);
+            this.pa_prodcode.Location = new System.Drawing.Point(142, 97);
             this.pa_prodcode.Name = "pa_prodcode";
-            this.pa_prodcode.Size = new System.Drawing.Size(0, 31);
+            this.pa_prodcode.Size = new System.Drawing.Size(0, 27);
             this.pa_prodcode.TabIndex = 6;
             // 
             // label6
             // 
             this.label6.AutoSize = true;
             this.label6.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label6.Location = new System.Drawing.Point(669, 116);
+            this.label6.Location = new System.Drawing.Point(595, 97);
             this.label6.Name = "label6";
-            this.label6.Size = new System.Drawing.Size(120, 31);
+            this.label6.Size = new System.Drawing.Size(101, 27);
             this.label6.TabIndex = 7;
             this.label6.Text = "工单/合同";
             // 
@@ -116,18 +119,18 @@
             // 
             this.packtype.AutoSize = true;
             this.packtype.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.packtype.Location = new System.Drawing.Point(802, 116);
+            this.packtype.Location = new System.Drawing.Point(713, 97);
             this.packtype.Name = "packtype";
-            this.packtype.Size = new System.Drawing.Size(0, 31);
+            this.packtype.Size = new System.Drawing.Size(0, 27);
             this.packtype.TabIndex = 8;
             // 
             // label8
             // 
             this.label8.AutoSize = true;
             this.label8.Font = new System.Drawing.Font("微软雅黑", 12F);
-            this.label8.Location = new System.Drawing.Point(39, 486);
+            this.label8.Location = new System.Drawing.Point(35, 400);
             this.label8.Name = "label8";
-            this.label8.Size = new System.Drawing.Size(86, 31);
+            this.label8.Size = new System.Drawing.Size(72, 27);
             this.label8.TabIndex = 9;
             this.label8.Text = "序列号";
             // 
@@ -135,9 +138,9 @@
             // 
             this.label9.AutoSize = true;
             this.label9.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label9.Location = new System.Drawing.Point(554, 486);
+            this.label9.Location = new System.Drawing.Point(492, 400);
             this.label9.Name = "label9";
-            this.label9.Size = new System.Drawing.Size(52, 27);
+            this.label9.Size = new System.Drawing.Size(44, 23);
             this.label9.TabIndex = 10;
             this.label9.Text = "计数";
             // 
@@ -145,19 +148,19 @@
             // 
             this.count.AutoSize = true;
             this.count.Font = new System.Drawing.Font("微软雅黑", 10F);
-            this.count.Location = new System.Drawing.Point(670, 486);
+            this.count.Location = new System.Drawing.Point(542, 400);
             this.count.Name = "count";
-            this.count.Size = new System.Drawing.Size(24, 27);
+            this.count.Size = new System.Drawing.Size(20, 23);
             this.count.TabIndex = 12;
             this.count.Text = "0";
             // 
             // OperateResult
             // 
             this.OperateResult.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.OperateResult.Location = new System.Drawing.Point(31, 204);
-            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
+            this.OperateResult.Location = new System.Drawing.Point(28, 170);
+            this.OperateResult.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.OperateResult.Name = "OperateResult";
-            this.OperateResult.Size = new System.Drawing.Size(915, 246);
+            this.OperateResult.Size = new System.Drawing.Size(814, 206);
             this.OperateResult.TabIndex = 196;
             this.OperateResult.Text = "";
             // 
@@ -166,10 +169,11 @@
             this.sncode.AllPower = null;
             this.sncode.BackColor = System.Drawing.Color.White;
             this.sncode.ID = null;
-            this.sncode.Location = new System.Drawing.Point(159, 486);
+            this.sncode.Location = new System.Drawing.Point(113, 400);
+            this.sncode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.sncode.Name = "sncode";
             this.sncode.Power = null;
-            this.sncode.Size = new System.Drawing.Size(196, 28);
+            this.sncode.Size = new System.Drawing.Size(175, 25);
             this.sncode.Str = null;
             this.sncode.Str1 = null;
             this.sncode.Str2 = null;
@@ -181,10 +185,11 @@
             this.pa_outboxcode.AllPower = null;
             this.pa_outboxcode.BackColor = System.Drawing.Color.White;
             this.pa_outboxcode.ID = null;
-            this.pa_outboxcode.Location = new System.Drawing.Point(127, 32);
+            this.pa_outboxcode.Location = new System.Drawing.Point(113, 27);
+            this.pa_outboxcode.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.pa_outboxcode.Name = "pa_outboxcode";
             this.pa_outboxcode.Power = null;
-            this.pa_outboxcode.Size = new System.Drawing.Size(196, 28);
+            this.pa_outboxcode.Size = new System.Drawing.Size(175, 25);
             this.pa_outboxcode.Str = null;
             this.pa_outboxcode.Str1 = null;
             this.pa_outboxcode.Str2 = null;
@@ -193,9 +198,9 @@
             // 
             // Packing_CartonSplit
             // 
-            this.AutoScaleDimensions = new System.Drawing.SizeF(9F, 18F);
+            this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F);
             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
-            this.ClientSize = new System.Drawing.Size(982, 581);
+            this.ClientSize = new System.Drawing.Size(873, 446);
             this.Controls.Add(this.OperateResult);
             this.Controls.Add(this.count);
             this.Controls.Add(this.sncode);
@@ -211,6 +216,7 @@
             this.Controls.Add(this.pa_outboxcode);
             this.Controls.Add(this.label1);
             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
+            this.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2);
             this.Name = "Packing_CartonSplit";
             this.Tag = "Packing!CartonSplit";
             this.Text = "Packing_CartonSplit";

+ 7 - 1
UAS-MES/FunctionCode/Packing/Packing_CartonSplit.cs

@@ -100,7 +100,7 @@ namespace UAS_MES.Packing
                     //删除明细
                     dh.ExecuteSql("delete from packagedetail where pd_id='"+pd_id+"'", "select");
                     //更新序列号
-                    dh.ExecuteSql("update makeserial set ms_outboxcode='' where ms_id='"+ms_id+"'", "update");
+                    dh.ExecuteSql("update makeserial set ms_outboxcode='' , ms_nextstepcode=ms_stepcode where ms_id='"+ms_id+"'", "update");
                     //更新箱内当前数量
                     dh.ExecuteSql("update package set pa_currentqty=pa_currentqty-1 where pa_outboxcode='"+pa_outboxcode.Text+"'", "update");
                     //记录拆箱操作日志
@@ -165,6 +165,12 @@ namespace UAS_MES.Packing
                     return false;
                 }
             }
+            //验证mothercode是否为空,有没有装大箱
+            if (dh.getFieldDataByCondition("package", "pa_mothercode", "pa_outboxcode='" + pa_outboxcode.Text + "'").ToString() != "")
+            {
+                OperateResult.AppendText("<<卡通箱:" + pa_outboxcode.Text + "已装箱,不允许拆箱\n", Color.Red, sncode);
+                return false;
+            }
             return true;
         }
 

+ 29 - 9
UAS_AutoPass/AutoAnalysisXml.cs

@@ -8,6 +8,7 @@ using System.Windows.Forms;
 using System.Xml;
 using UAS_AutoPass.ToolClass;
 using BenQGuru.eMES.DLLService;
+using System.Text;
 
 namespace UAS_AutoPass
 {
@@ -25,6 +26,8 @@ namespace UAS_AutoPass
         string isource;
 
         Thread InitDB;
+
+        StringBuilder sql = new StringBuilder();
         /// <summary>
         /// 缓存的文件
         /// </summary>
@@ -188,10 +191,10 @@ namespace UAS_AutoPass
             string iMakeCode = dh.getFieldDataByCondition("makeserial", "ms_makecode", "ms_sncode='" + sncode + "' order by ms_id desc").ToString();
             OperateResult.AppendText("读取文件" + e.Name + "\n");
             //获取采集的项目名称
-            List<string> name = new List<string>();
+            List<string> badcode = new List<string>();
             //获取采集项目的结果
-            List<string> result = new List<string>();
-            int name_or_result = 0;
+            List<string> badlocation = new List<string>();
+            int code_or_location = 0;
             while (myReader.Read())
             {
                 if (myReader.NodeType == XmlNodeType.Element && myReader.Name == "test" && myReader.IsStartElement())
@@ -203,15 +206,15 @@ namespace UAS_AutoPass
                 }
                 if (myReader.NodeType == XmlNodeType.Text)
                 {
-                    if (name_or_result % 2 == 0)
+                    if (code_or_location % 2 == 0)
                     {
-                        name.Add(myReader.Value);
-                        name_or_result++;
+                        badcode.Add(myReader.Value);
+                        code_or_location++;
                     }
                     else
                     {
-                        result.Add(myReader.Value);
-                        name_or_result++;
+                        badlocation.Add(myReader.Value);
+                        code_or_location++;
                     }
                 }
             }
@@ -219,7 +222,24 @@ namespace UAS_AutoPass
             string ErrMessage = "";
             if (helper.GoMo(MakeCode.Text, sncode, isource, out ErrMessage))
             {
-                if (!helper.SetStepFinish(MakeCode.Text, isource, sncode, "自动过站采集", test_result, iusercode, "自动过站不良", out ErrMessage))
+                string BadCode = "";
+                if (test_result == "NG")
+                {
+                    for (int i = 0; i < badcode.Count; i++)
+                    {
+                        BadCode += badcode[i] + ",";
+                    }
+                }
+                if (helper.SetStepFinish(MakeCode.Text, isource, sncode, "自动过站采集", test_result, iusercode, BadCode.Substring(0, BadCode.Length - 1), out ErrMessage))
+                {
+                    //sql.Clear();
+                    //sql.Append("insert into makebadrsloc(mbl_id,mbl_mbrid,mbl_loc,mbl_badcode,mbl_brcode,");
+                    //sql.Append("mbl_sncode,mbl_makecode,mbl_indate ,mbl_inman) select makebadrsloc_seq.nextval," + mbr_id);
+                    //sql.Append(",:location,'" + bc_code.Text + "','" + nr_code.Text + "','" + GetSNCode.Text + "','" + macode + "',");
+                    //sql.Append("sysdate,'" + User.UserCode + "' from dual");
+
+                }
+                else
                 {
                     OperateResult.AppendText(ErrMessage + "\n");
                     return;

+ 6 - 1
UAS_AutoPass/Login.cs

@@ -12,6 +12,7 @@ namespace UAS_AutoPass
 
         public Login()
         {
+            StartPosition = FormStartPosition.CenterScreen;
             InitializeComponent();
         }
 
@@ -34,6 +35,10 @@ namespace UAS_AutoPass
         {
             UserName.Text = BaseUtil.GetCacheData("UserName").ToString();
             Source.Text = BaseUtil.GetCacheData("Source").ToString();
+            if (UserName.Text != "")
+            {
+                PassWord.Focus();
+            }
         }
     }
-}
+}