Browse Source

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

章政 8 years ago
parent
commit
7225d0c239

+ 2 - 2
UAS-MES/FunctionCode/Make/Make_PackageCollection.Designer.cs

@@ -313,13 +313,13 @@
             this.sn_code.ID = null;
             this.sn_code.Location = new System.Drawing.Point(76, 545);
             this.sn_code.Name = "sn_code";
-            this.sn_code.Power = "ifwrite";
+            this.sn_code.Power = "ifread";
             this.sn_code.Size = new System.Drawing.Size(196, 21);
             this.sn_code.Str = null;
             this.sn_code.Str1 = null;
             this.sn_code.Str2 = null;
             this.sn_code.TabIndex = 135;
-            this.sn_code.Tag = "IfWrite";
+            this.sn_code.Tag = "ifread";
             this.sn_code.KeyDown += new System.Windows.Forms.KeyEventHandler(this.barcode_KeyDown);
             // 
             // PackageDetail

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

@@ -294,7 +294,7 @@
             this.outboxcode.Location = new System.Drawing.Point(1061, 324);
             this.outboxcode.Margin = new System.Windows.Forms.Padding(4);
             this.outboxcode.Name = "outboxcode";
-            this.outboxcode.Power = "ifwrite";
+            this.outboxcode.Power = "ifread";
             this.outboxcode.Size = new System.Drawing.Size(207, 25);
             this.outboxcode.Str = null;
             this.outboxcode.Str1 = null;
@@ -311,7 +311,7 @@
             this.pa_outboxcode.Location = new System.Drawing.Point(113, 36);
             this.pa_outboxcode.Margin = new System.Windows.Forms.Padding(4);
             this.pa_outboxcode.Name = "pa_outboxcode";
-            this.pa_outboxcode.Power = "ifwrite";
+            this.pa_outboxcode.Power = "ifread";
             this.pa_outboxcode.Size = new System.Drawing.Size(141, 25);
             this.pa_outboxcode.Str = null;
             this.pa_outboxcode.Str1 = null;
@@ -370,7 +370,7 @@
             this.NewPalletCode.MoveImage = ((System.Drawing.Image)(resources.GetObject("NewPalletCode.MoveImage")));
             this.NewPalletCode.Name = "NewPalletCode";
             this.NewPalletCode.NormalImage = ((System.Drawing.Image)(resources.GetObject("NewPalletCode.NormalImage")));
-            this.NewPalletCode.Power = "ifwrite";
+            this.NewPalletCode.Power = "ifread";
             this.NewPalletCode.Size = new System.Drawing.Size(80, 30);
             this.NewPalletCode.TabIndex = 159;
             this.NewPalletCode.Text = "新增栈板";

+ 2 - 2
UAS-MES/FunctionCode/Make/Make_PalletWeightRecord.Designer.cs

@@ -117,7 +117,7 @@
             this.weight.Location = new System.Drawing.Point(244, 191);
             this.weight.Margin = new System.Windows.Forms.Padding(4);
             this.weight.Name = "weight";
-            this.weight.Power = "ifwrite";
+            this.weight.Power = "ifread";
             this.weight.Size = new System.Drawing.Size(195, 25);
             this.weight.Str = null;
             this.weight.Str1 = null;
@@ -133,7 +133,7 @@
             this.pa_outboxcode.Location = new System.Drawing.Point(244, 121);
             this.pa_outboxcode.Margin = new System.Windows.Forms.Padding(4);
             this.pa_outboxcode.Name = "pa_outboxcode";
-            this.pa_outboxcode.Power = "ifwrite";
+            this.pa_outboxcode.Power = "ifread";
             this.pa_outboxcode.Size = new System.Drawing.Size(195, 25);
             this.pa_outboxcode.Str = null;
             this.pa_outboxcode.Str1 = null;

+ 8 - 8
UAS-MES/FunctionCode/Make/Make_Repair.Designer.cs

@@ -527,7 +527,7 @@
             this.NewRepairInf.Power = null;
             this.NewRepairInf.Size = new System.Drawing.Size(115, 30);
             this.NewRepairInf.TabIndex = 112;
-            this.NewRepairInf.Tag = "IfWrite";
+            this.NewRepairInf.Tag = "IfRead";
             this.NewRepairInf.Text = "新增维修信息";
             this.NewRepairInf.UseVisualStyleBackColor = true;
             this.NewRepairInf.Click += new System.EventHandler(this.NewRepairInf_Click);
@@ -547,7 +547,7 @@
             this.SaveRepairInf.Power = null;
             this.SaveRepairInf.Size = new System.Drawing.Size(115, 30);
             this.SaveRepairInf.TabIndex = 111;
-            this.SaveRepairInf.Tag = "IfWrite";
+            this.SaveRepairInf.Tag = "IfRead";
             this.SaveRepairInf.Text = "保存维修信息";
             this.SaveRepairInf.UseVisualStyleBackColor = true;
             this.SaveRepairInf.Visible = false;
@@ -568,7 +568,7 @@
             this.DeleteRepairInf.Power = null;
             this.DeleteRepairInf.Size = new System.Drawing.Size(76, 30);
             this.DeleteRepairInf.TabIndex = 110;
-            this.DeleteRepairInf.Tag = "IfWrite";
+            this.DeleteRepairInf.Tag = "IfRead";
             this.DeleteRepairInf.Text = "删除";
             this.DeleteRepairInf.UseVisualStyleBackColor = true;
             this.DeleteRepairInf.Click += new System.EventHandler(this.DeleteRepairInf_Click);
@@ -795,7 +795,7 @@
             this.Clean.Power = null;
             this.Clean.Size = new System.Drawing.Size(80, 30);
             this.Clean.TabIndex = 81;
-            this.Clean.Tag = "IfWrite";
+            this.Clean.Tag = "IfRead";
             this.Clean.Text = "清除";
             this.Clean.UseVisualStyleBackColor = true;
             this.Clean.Click += new System.EventHandler(this.Clean_Click);
@@ -858,7 +858,7 @@
             this.NewBadCode.Power = null;
             this.NewBadCode.Size = new System.Drawing.Size(115, 30);
             this.NewBadCode.TabIndex = 60;
-            this.NewBadCode.Tag = "IfWrite";
+            this.NewBadCode.Tag = "IfRead";
             this.NewBadCode.Text = "新增不良代码";
             this.NewBadCode.UseVisualStyleBackColor = true;
             this.NewBadCode.Click += new System.EventHandler(this.NewBadCode_Click);
@@ -879,7 +879,7 @@
             this.SaveBadLocation.Power = null;
             this.SaveBadLocation.Size = new System.Drawing.Size(61, 30);
             this.SaveBadLocation.TabIndex = 59;
-            this.SaveBadLocation.Tag = "IfWrite";
+            this.SaveBadLocation.Tag = "IfRead";
             this.SaveBadLocation.Text = "保存";
             this.SaveBadLocation.UseVisualStyleBackColor = true;
             this.SaveBadLocation.Click += new System.EventHandler(this.SaveBadLocation_Click);
@@ -900,7 +900,7 @@
             this.Scrap.Power = null;
             this.Scrap.Size = new System.Drawing.Size(91, 30);
             this.Scrap.TabIndex = 56;
-            this.Scrap.Tag = "IfWrite";
+            this.Scrap.Tag = "IfRead";
             this.Scrap.Text = "报废";
             this.Scrap.UseVisualStyleBackColor = true;
             this.Scrap.Click += new System.EventHandler(this.Scrap_Click);
@@ -921,7 +921,7 @@
             this.RepairComplete.Power = null;
             this.RepairComplete.Size = new System.Drawing.Size(91, 30);
             this.RepairComplete.TabIndex = 55;
-            this.RepairComplete.Tag = "IfWrite";
+            this.RepairComplete.Tag = "IfRead";
             this.RepairComplete.Text = "完成维修";
             this.RepairComplete.UseVisualStyleBackColor = true;
             this.RepairComplete.Click += new System.EventHandler(this.RepairComplete_Click);

+ 2 - 2
UAS-MES/FunctionCode/Make/Make_SeqTransform.Designer.cs

@@ -357,13 +357,13 @@
             this.sncode.Location = new System.Drawing.Point(145, 644);
             this.sncode.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
             this.sncode.Name = "sncode";
-            this.sncode.Power = "ifwrite";
+            this.sncode.Power = "ifread";
             this.sncode.Size = new System.Drawing.Size(238, 34);
             this.sncode.Str = null;
             this.sncode.Str1 = null;
             this.sncode.Str2 = null;
             this.sncode.TabIndex = 77;
-            this.sncode.Tag = "IfWrite";
+            this.sncode.Tag = "IfRead";
             this.sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.sncode_KeyDown);
             // 
             // label2

+ 2 - 2
UAS-MES/FunctionCode/Make/Make_SpecialCartonPack.Designer.cs

@@ -292,13 +292,13 @@
             this.sn_code.Location = new System.Drawing.Point(101, 683);
             this.sn_code.Margin = new System.Windows.Forms.Padding(4);
             this.sn_code.Name = "sn_code";
-            this.sn_code.Power = "ifwrite";
+            this.sn_code.Power = "ifread";
             this.sn_code.Size = new System.Drawing.Size(260, 25);
             this.sn_code.Str = null;
             this.sn_code.Str1 = null;
             this.sn_code.Str2 = null;
             this.sn_code.TabIndex = 135;
-            this.sn_code.Tag = "IfWrite";
+            this.sn_code.Tag = "IfRead";
             this.sn_code.KeyDown += new System.Windows.Forms.KeyEventHandler(this.barcode_KeyDown);
             // 
             // PackageDetail

+ 1 - 1
UAS-MES/FunctionCode/Make/Make_TestCollection.Designer.cs

@@ -767,7 +767,7 @@
             this.ms_sncode.Str1 = null;
             this.ms_sncode.Str2 = null;
             this.ms_sncode.TabIndex = 68;
-            this.ms_sncode.Tag = "IfWrite";
+            this.ms_sncode.Tag = "IfRead";
             this.ms_sncode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.ms_code_KeyDown);
             // 
             // ma_softversion

+ 1 - 1
UAS-MES/FunctionCode/Packing/Packing_CartonTransfer.cs

@@ -267,7 +267,7 @@ namespace UAS_MES.Packing
                                             }
                                         }
                                         string new_laststepcode = dh.getFieldDataByCondition("packagedetail inner join makeserial on ms_outboxcode=pd_outboxcode and ms_sncode=pd_barcode and ms_prodcode = pd_prodcode", "max(nvl(ms_currentstepcode,ms_stepcode))", "pd_outboxcode='" + pa_outboxcode.Text + "'").ToString();
-                                        if (new_laststepcode != laststepcode.Text)
+                                        if (new_laststepcode!=""&&(new_laststepcode != laststepcode.Text))
                                         {
                                             OperateResult.AppendText(">>目标箱号中的序列号最后所在工序与所录入序列号最后所在工序不一致\n", Color.Red, sn_code);
                                             return;

+ 12 - 11
UAS-MES/FunctionCode/Packing/Packing_ProdWeightSet.Designer.cs

@@ -46,7 +46,7 @@
             this.errorValue = new System.Windows.Forms.TextBox();
             this.standardWeight = new System.Windows.Forms.TextBox();
             this.label7 = new System.Windows.Forms.Label();
-            this.label4 = new System.Windows.Forms.Label();
+            this.unit = new System.Windows.Forms.Label();
             this.label6 = new System.Windows.Forms.Label();
             this.pr_cartonunit = new System.Windows.Forms.Label();
             this.label22 = new System.Windows.Forms.Label();
@@ -185,7 +185,7 @@
             this.panel4.Controls.Add(this.errorValue);
             this.panel4.Controls.Add(this.standardWeight);
             this.panel4.Controls.Add(this.label7);
-            this.panel4.Controls.Add(this.label4);
+            this.panel4.Controls.Add(this.unit);
             this.panel4.Controls.Add(this.label6);
             this.panel4.Controls.Add(this.pr_cartonunit);
             this.panel4.Controls.Add(this.label22);
@@ -224,15 +224,15 @@
             this.label7.TabIndex = 50;
             this.label7.Text = "标准";
             // 
-            // label4
+            // unit
             // 
-            this.label4.AutoSize = true;
-            this.label4.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
-            this.label4.Location = new System.Drawing.Point(371, 22);
-            this.label4.Name = "label4";
-            this.label4.Size = new System.Drawing.Size(25, 27);
-            this.label4.TabIndex = 47;
-            this.label4.Text = "g";
+            this.unit.AutoSize = true;
+            this.unit.Font = new System.Drawing.Font("微软雅黑", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
+            this.unit.Location = new System.Drawing.Point(371, 22);
+            this.unit.Name = "unit";
+            this.unit.Size = new System.Drawing.Size(25, 27);
+            this.unit.TabIndex = 47;
+            this.unit.Text = "g";
             // 
             // label6
             // 
@@ -255,6 +255,7 @@
             this.pr_cartonunit.Size = new System.Drawing.Size(46, 38);
             this.pr_cartonunit.TabIndex = 42;
             this.pr_cartonunit.Text = "克";
+            this.pr_cartonunit.Visible = false;
             // 
             // label22
             // 
@@ -494,7 +495,7 @@
         private CustomControl.TextBoxWithIcon.EnterTextBox sncode;
         private System.Windows.Forms.Label label1;
         private System.Windows.Forms.Label label6;
-        private System.Windows.Forms.Label label4;
+        private System.Windows.Forms.Label unit;
         private System.Windows.Forms.Label label7;
         private System.Windows.Forms.TextBox errorValue;
         private System.Windows.Forms.TextBox standardWeight;

+ 19 - 33
UAS-MES/FunctionCode/Packing/Packing_ProdWeightSet.cs

@@ -37,9 +37,9 @@ namespace UAS_MES.Packing
 
         int samplesCount = 0;
 
-        string maxValue = "";//存储最大值
+        //string maxValue = "";//存储最大值
 
-        string minValue = "";//存储最小值
+        //string minValue = "";//存储最小值
 
         List<string> sncodes = new List<string>();//存序列号
         List<string> indates = new List<string>();//存时间
@@ -47,8 +47,6 @@ namespace UAS_MES.Packing
 
         string recordSW = ""; //存标准重量
         string recordEV = "";//存误差值
-
-        bool isKg = false;//记录单位是否KG
         public Packing_ProdWeightSet()
         {
             InitializeComponent();
@@ -84,20 +82,20 @@ namespace UAS_MES.Packing
             //分条赋值
             lvi.SubItems.Add(index+"");
             lvi.SubItems.Add(palletcode);
-            lvi.SubItems.Add(weigh+pr_cartonunit.Text);
+            lvi.SubItems.Add(weigh);
             lvi.SubItems.Add(time.ToString());
             //添加结果的信息进去
             showResult.Items.Add(lvi);
             //更新已称重量最大值最小值
             if (index > 1)
             {
-                maxValue = double.Parse(weigh) > double.Parse(maxValue) ? weigh : maxValue;
-                minValue = double.Parse(weigh) < double.Parse(minValue) ? weigh : minValue;
+                //maxValue = double.Parse(weigh) > double.Parse(maxValue) ? weigh : maxValue;
+                //minValue = double.Parse(weigh) < double.Parse(minValue) ? weigh : minValue;
             }
             else
             {
-                maxValue = weigh;
-                minValue = weigh;
+                //maxValue = weigh;
+                //minValue = weigh;
                 //每次添加第一条数据的时候清空list的值
                 sncodes.Clear();
                 indates.Clear();
@@ -177,24 +175,16 @@ namespace UAS_MES.Packing
                 OperateResult.AppendText("<<采样个数不足\n", Color.Red);
                 return;
             }
-            double sum = 0;
-            //点击取平均值
-            foreach (string s in weights)
-            {
-                sum += double.Parse(s);
-            }
-            sum = sum / weights.Count;
+            //double sum = 0;
+            ////点击取平均值
+            //foreach (string s in weights)
+            //{
+            //    sum += double.Parse(s);
+            //}
+            //sum = sum / weights.Count;
             //更新彩盒重量最大值最小值
-            if (isKg)
-            {
-                dh.ExecuteSql("update product set PR_COLORBOXMAXW ='" +Math.Round( (sum + double.Parse(errorValue.Text))/1000) + "', PR_COLORBOXMINW = '" +Math.Round( (sum - double.Parse(errorValue.Text))/1000) + "',PR_COLORBOXUNIT='" + pr_cartonunit.Text + "' where pr_code='" + pr_code.Text + "'", "update");
-                OperateResult.AppendText("<<重量设置成功,最大值" +Math.Round( (sum + double.Parse(errorValue.Text))/1000 )+ "kg,最小值" +Math.Round( (sum - double.Parse(errorValue.Text))/1000 ) + "kg\n", Color.Green);
-            }
-            else
-            {
-                dh.ExecuteSql("update product set PR_COLORBOXMAXW ='" +Math.Round( (sum + double.Parse(errorValue.Text)) ) + "', PR_COLORBOXMINW = '" + Math.Round((sum - double.Parse(errorValue.Text))) + "',PR_COLORBOXUNIT='" + pr_cartonunit.Text + "' where pr_code='" + pr_code.Text + "'", "update");
-                OperateResult.AppendText("<<重量设置成功,最大值"+ Math.Round( (sum + double.Parse(errorValue.Text)) ) + "g,最小值"+ Math.Round((sum - double.Parse(errorValue.Text))) + "g\n", Color.Green);
-            }
+            dh.ExecuteSql("update product set PR_COLORBOXMAXW ='" + (double.Parse(standardWeight.Text) + double.Parse(errorValue.Text)) + "', PR_COLORBOXMINW = '" + (double.Parse(standardWeight.Text) - double.Parse(errorValue.Text)) + "' where pr_code='" + pr_code.Text + "'", "update");
+            OperateResult.AppendText("<<重量设置成功,最大值" + (double.Parse(standardWeight.Text) + double.Parse(errorValue.Text)) + ",最小值" + (double.Parse(standardWeight.Text) - double.Parse(errorValue.Text)) + "g\n", Color.Green);
             //更新采样记录表
             string serialNum = dh.GetSerialNumberByCaller("ProdWeightSample");
             sql.Clear();
@@ -242,7 +232,8 @@ namespace UAS_MES.Packing
                     return;
                 }
                 //判断称重记录是否满足标准重量+-误差值
-                if (double.Parse(weight.Text)<(double.Parse(standardWeight.Text)- double.Parse(errorValue.Text))|| double.Parse(weight.Text) >(double.Parse(standardWeight.Text) + double.Parse(errorValue.Text)))
+                double ActualWeight = double.Parse(weight.Text == "" ? "0" : weight.Text.Replace("kg", "").Trim());
+                if (ActualWeight < (double.Parse(standardWeight.Text)- double.Parse(errorValue.Text))|| ActualWeight > (double.Parse(standardWeight.Text) + double.Parse(errorValue.Text)))
                 {
                     OperateResult.AppendText("<<序列号" + sncode.Text + "重量不在预设范围内\n", Color.Red, sncode);
                     return;
@@ -339,7 +330,6 @@ namespace UAS_MES.Packing
         {
             //产品更换的时候
             DataTable d = (DataTable)dh.ExecuteSql("select PR_COLORBOXMAXW,PR_COLORBOXMINW,PR_COLORBOXUNIT from product where pr_code='" + pr_code.Text + "'", "select");
-            isKg = false;
             //给标准重量赋值
             if (d.Rows[0]["PR_COLORBOXMAXW"].ToString() == "" || d.Rows[0]["PR_COLORBOXMINW"].ToString() == "")
             {
@@ -349,12 +339,8 @@ namespace UAS_MES.Packing
             {
                 //取二者平均值来
                 standardWeight.Text = (double.Parse(d.Rows[0]["PR_COLORBOXMAXW"].ToString()) + double.Parse(d.Rows[0]["PR_COLORBOXMINW"].ToString())) / 2 + "";
-                if (d.Rows[0]["PR_COLORBOXUNIT"].ToString()=="kg")
-                {
-                    isKg = true;
-                    standardWeight.Text = double.Parse(standardWeight.Text) * 1000 + "";
-                }
             }
+            unit.Text = d.Rows[0]["PR_COLORBOXUNIT"].ToString();
             //取误差值
             errorValue.Text = dh.GetConfig("prodWeightErrorValue", "MESSetting").ToString();
             //查询重量设置采样个数