diff --git a/FacOneZPStation/FrmZP.Designer.cs b/FacOneZPStation/FrmZP.Designer.cs index 65fd801..0b7d14f 100644 --- a/FacOneZPStation/FrmZP.Designer.cs +++ b/FacOneZPStation/FrmZP.Designer.cs @@ -77,7 +77,7 @@ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.51529F)); this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.62445F)); this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 32.86026F)); - this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 699F)); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 702F)); this.tableLayoutPanel3.Controls.Add(this.button6, 3, 0); this.tableLayoutPanel3.Controls.Add(this.button1, 0, 1); this.tableLayoutPanel3.Controls.Add(this.button5, 2, 1); @@ -102,10 +102,10 @@ this.button6.Dock = System.Windows.Forms.DockStyle.Fill; this.button6.Font = new System.Drawing.Font("黑体", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.button6.ForeColor = System.Drawing.Color.Black; - this.button6.Location = new System.Drawing.Point(1861, 14); + this.button6.Location = new System.Drawing.Point(1858, 14); this.button6.Margin = new System.Windows.Forms.Padding(14); this.button6.Name = "button6"; - this.button6.Size = new System.Drawing.Size(673, 183); + this.button6.Size = new System.Drawing.Size(676, 183); this.button6.TabIndex = 7; this.button6.Text = "手动打印箱单"; this.button6.UseVisualStyleBackColor = false; @@ -119,7 +119,7 @@ this.button1.Location = new System.Drawing.Point(6, 217); this.button1.Margin = new System.Windows.Forms.Padding(6); this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(607, 200); + this.button1.Size = new System.Drawing.Size(606, 200); this.button1.TabIndex = 6; this.button1.Text = "打印标签"; this.button1.UseVisualStyleBackColor = false; @@ -131,10 +131,10 @@ this.button5.Dock = System.Windows.Forms.DockStyle.Fill; this.button5.Font = new System.Drawing.Font("黑体", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.button5.ForeColor = System.Drawing.Color.Black; - this.button5.Location = new System.Drawing.Point(1254, 225); + this.button5.Location = new System.Drawing.Point(1252, 225); this.button5.Margin = new System.Windows.Forms.Padding(14); this.button5.Name = "button5"; - this.button5.Size = new System.Drawing.Size(579, 184); + this.button5.Size = new System.Drawing.Size(578, 184); this.button5.TabIndex = 5; this.button5.Text = "不合格"; this.button5.UseVisualStyleBackColor = false; @@ -145,10 +145,10 @@ this.button4.BackColor = System.Drawing.Color.RoyalBlue; this.button4.Dock = System.Windows.Forms.DockStyle.Fill; this.button4.Font = new System.Drawing.Font("黑体", 16F); - this.button4.Location = new System.Drawing.Point(625, 6); + this.button4.Location = new System.Drawing.Point(624, 6); this.button4.Margin = new System.Windows.Forms.Padding(6); this.button4.Name = "button4"; - this.button4.Size = new System.Drawing.Size(609, 199); + this.button4.Size = new System.Drawing.Size(608, 199); this.button4.TabIndex = 4; this.button4.Text = "下一计划"; this.button4.UseVisualStyleBackColor = false; @@ -162,7 +162,7 @@ this.button3.Location = new System.Drawing.Point(6, 6); this.button3.Margin = new System.Windows.Forms.Padding(6); this.button3.Name = "button3"; - this.button3.Size = new System.Drawing.Size(607, 199); + this.button3.Size = new System.Drawing.Size(606, 199); this.button3.TabIndex = 3; this.button3.Text = "上一计划"; this.button3.UseVisualStyleBackColor = false; @@ -174,10 +174,10 @@ this.button2.Dock = System.Windows.Forms.DockStyle.Fill; this.button2.Font = new System.Drawing.Font("黑体", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.button2.ForeColor = System.Drawing.Color.Black; - this.button2.Location = new System.Drawing.Point(633, 225); + this.button2.Location = new System.Drawing.Point(632, 225); this.button2.Margin = new System.Windows.Forms.Padding(14); this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(593, 184); + this.button2.Size = new System.Drawing.Size(592, 184); this.button2.TabIndex = 2; this.button2.Text = "补打标签"; this.button2.UseVisualStyleBackColor = false; @@ -188,10 +188,10 @@ this.button7.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(255)))), ((int)(((byte)(128))))); this.button7.Dock = System.Windows.Forms.DockStyle.Fill; this.button7.Font = new System.Drawing.Font("黑体", 16F); - this.button7.Location = new System.Drawing.Point(1853, 217); + this.button7.Location = new System.Drawing.Point(1850, 217); this.button7.Margin = new System.Windows.Forms.Padding(6); this.button7.Name = "button7"; - this.button7.Size = new System.Drawing.Size(689, 200); + this.button7.Size = new System.Drawing.Size(692, 200); this.button7.TabIndex = 8; this.button7.Text = "补打箱单"; this.button7.UseVisualStyleBackColor = false; @@ -203,7 +203,7 @@ this.label7.Dock = System.Windows.Forms.DockStyle.Fill; this.label7.Font = new System.Drawing.Font("黑体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label7.ForeColor = System.Drawing.Color.White; - this.label7.Location = new System.Drawing.Point(1531, 3); + this.label7.Location = new System.Drawing.Point(1527, 3); this.label7.Margin = new System.Windows.Forms.Padding(2); this.label7.Name = "label7"; this.tableLayoutPanel4.SetRowSpan(this.label7, 2); @@ -215,10 +215,10 @@ // this.textBox2.Dock = System.Windows.Forms.DockStyle.Fill; this.textBox2.Font = new System.Drawing.Font("黑体", 26.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.textBox2.Location = new System.Drawing.Point(441, 127); + this.textBox2.Location = new System.Drawing.Point(440, 127); this.textBox2.Margin = new System.Windows.Forms.Padding(4); this.textBox2.Name = "textBox2"; - this.textBox2.Size = new System.Drawing.Size(1083, 87); + this.textBox2.Size = new System.Drawing.Size(1080, 87); this.textBox2.TabIndex = 30; this.textBox2.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox2_KeyDown); // @@ -230,7 +230,7 @@ this.label3.Location = new System.Drawing.Point(5, 123); this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(427, 125); + this.label3.Size = new System.Drawing.Size(426, 125); this.label3.TabIndex = 29; this.label3.Text = "扫描物料条码"; this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -240,10 +240,10 @@ this.labOrderNo.Dock = System.Windows.Forms.DockStyle.Fill; this.labOrderNo.Font = new System.Drawing.Font("黑体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.labOrderNo.ForeColor = System.Drawing.Color.White; - this.labOrderNo.Location = new System.Drawing.Point(1808, 251); + this.labOrderNo.Location = new System.Drawing.Point(1804, 251); this.labOrderNo.Margin = new System.Windows.Forms.Padding(2); this.labOrderNo.Name = "labOrderNo"; - this.labOrderNo.Size = new System.Drawing.Size(741, 175); + this.labOrderNo.Size = new System.Drawing.Size(745, 175); this.labOrderNo.TabIndex = 28; this.labOrderNo.Text = "A64654646464"; this.labOrderNo.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -254,7 +254,7 @@ this.label4.Dock = System.Windows.Forms.DockStyle.Fill; this.label4.Font = new System.Drawing.Font("黑体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label4.ForeColor = System.Drawing.Color.White; - this.label4.Location = new System.Drawing.Point(1531, 251); + this.label4.Location = new System.Drawing.Point(1527, 251); this.label4.Margin = new System.Windows.Forms.Padding(2); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(272, 175); @@ -268,10 +268,10 @@ this.labStationNo.Dock = System.Windows.Forms.DockStyle.Fill; this.labStationNo.Font = new System.Drawing.Font("黑体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.labStationNo.ForeColor = System.Drawing.Color.White; - this.labStationNo.Location = new System.Drawing.Point(439, 251); + this.labStationNo.Location = new System.Drawing.Point(438, 251); this.labStationNo.Margin = new System.Windows.Forms.Padding(2); this.labStationNo.Name = "labStationNo"; - this.labStationNo.Size = new System.Drawing.Size(1087, 175); + this.labStationNo.Size = new System.Drawing.Size(1084, 175); this.labStationNo.TabIndex = 26; this.labStationNo.Text = "V253-MF-S后保下部延伸焊接"; this.labStationNo.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -285,7 +285,7 @@ this.label2.Location = new System.Drawing.Point(3, 251); this.label2.Margin = new System.Windows.Forms.Padding(2); this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(431, 175); + this.label2.Size = new System.Drawing.Size(430, 175); this.label2.TabIndex = 25; this.label2.Text = "工位名称"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -295,10 +295,10 @@ this.labPName.Dock = System.Windows.Forms.DockStyle.Fill; this.labPName.Font = new System.Drawing.Font("黑体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.labPName.ForeColor = System.Drawing.Color.White; - this.labPName.Location = new System.Drawing.Point(1808, 431); + this.labPName.Location = new System.Drawing.Point(1804, 431); this.labPName.Margin = new System.Windows.Forms.Padding(2); this.labPName.Name = "labPName"; - this.labPName.Size = new System.Drawing.Size(741, 286); + this.labPName.Size = new System.Drawing.Size(745, 286); this.labPName.TabIndex = 24; this.labPName.Text = "MF253 MF S后保"; this.labPName.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -309,7 +309,7 @@ this.label8.Dock = System.Windows.Forms.DockStyle.Fill; this.label8.Font = new System.Drawing.Font("黑体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label8.ForeColor = System.Drawing.Color.White; - this.label8.Location = new System.Drawing.Point(1531, 431); + this.label8.Location = new System.Drawing.Point(1527, 431); this.label8.Margin = new System.Windows.Forms.Padding(2); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(272, 286); @@ -323,10 +323,10 @@ this.labPartNo.Dock = System.Windows.Forms.DockStyle.Fill; this.labPartNo.Font = new System.Drawing.Font("黑体", 42F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.labPartNo.ForeColor = System.Drawing.Color.White; - this.labPartNo.Location = new System.Drawing.Point(439, 431); + this.labPartNo.Location = new System.Drawing.Point(438, 431); this.labPartNo.Margin = new System.Windows.Forms.Padding(2); this.labPartNo.Name = "labPartNo"; - this.labPartNo.Size = new System.Drawing.Size(1087, 286); + this.labPartNo.Size = new System.Drawing.Size(1084, 286); this.labPartNo.TabIndex = 22; this.labPartNo.Text = "A2530822665"; this.labPartNo.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -345,7 +345,7 @@ this.label6.Location = new System.Drawing.Point(3, 431); this.label6.Margin = new System.Windows.Forms.Padding(2); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(431, 286); + this.label6.Size = new System.Drawing.Size(430, 286); this.label6.TabIndex = 21; this.label6.Text = "产品代码"; this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -356,10 +356,10 @@ this.labBadCount.Dock = System.Windows.Forms.DockStyle.Fill; this.labBadCount.Font = new System.Drawing.Font("黑体", 60F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.labBadCount.ForeColor = System.Drawing.Color.Lime; - this.labBadCount.Location = new System.Drawing.Point(1808, 722); + this.labBadCount.Location = new System.Drawing.Point(1804, 722); this.labBadCount.Margin = new System.Windows.Forms.Padding(2); this.labBadCount.Name = "labBadCount"; - this.labBadCount.Size = new System.Drawing.Size(741, 513); + this.labBadCount.Size = new System.Drawing.Size(745, 513); this.labBadCount.TabIndex = 20; this.labBadCount.Text = "0"; this.labBadCount.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -370,10 +370,10 @@ this.labNum.Dock = System.Windows.Forms.DockStyle.Fill; this.labNum.Font = new System.Drawing.Font("黑体", 60F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.labNum.ForeColor = System.Drawing.Color.Lime; - this.labNum.Location = new System.Drawing.Point(439, 722); + this.labNum.Location = new System.Drawing.Point(438, 722); this.labNum.Margin = new System.Windows.Forms.Padding(2); this.labNum.Name = "labNum"; - this.labNum.Size = new System.Drawing.Size(1087, 513); + this.labNum.Size = new System.Drawing.Size(1084, 513); this.labNum.TabIndex = 18; this.labNum.Text = "152/210"; this.labNum.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -387,7 +387,7 @@ this.label10.Location = new System.Drawing.Point(3, 722); this.label10.Margin = new System.Windows.Forms.Padding(2); this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(431, 513); + this.label10.Size = new System.Drawing.Size(430, 513); this.label10.TabIndex = 17; this.label10.Text = "计划/完成数"; this.label10.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -400,7 +400,7 @@ this.label14.Location = new System.Drawing.Point(5, 1); this.label14.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label14.Name = "label14"; - this.label14.Size = new System.Drawing.Size(427, 121); + this.label14.Size = new System.Drawing.Size(426, 121); this.label14.TabIndex = 12; this.label14.Text = "扫描本体条码"; this.label14.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -409,10 +409,10 @@ // this.textBox1.Dock = System.Windows.Forms.DockStyle.Fill; this.textBox1.Font = new System.Drawing.Font("黑体", 26.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.textBox1.Location = new System.Drawing.Point(441, 5); + this.textBox1.Location = new System.Drawing.Point(440, 5); this.textBox1.Margin = new System.Windows.Forms.Padding(4); this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(1083, 87); + this.textBox1.Size = new System.Drawing.Size(1080, 87); this.textBox1.TabIndex = 13; this.textBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox1_KeyDown); // @@ -421,11 +421,11 @@ this.labErrMessage.Dock = System.Windows.Forms.DockStyle.Fill; this.labErrMessage.Font = new System.Drawing.Font("微软雅黑", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.labErrMessage.ForeColor = System.Drawing.Color.Red; - this.labErrMessage.Location = new System.Drawing.Point(1810, 1); + this.labErrMessage.Location = new System.Drawing.Point(1806, 1); this.labErrMessage.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.labErrMessage.Name = "labErrMessage"; this.tableLayoutPanel4.SetRowSpan(this.labErrMessage, 2); - this.labErrMessage.Size = new System.Drawing.Size(737, 247); + this.labErrMessage.Size = new System.Drawing.Size(741, 247); this.labErrMessage.TabIndex = 16; this.labErrMessage.Text = "条码与产品不匹配,重新扫描"; this.labErrMessage.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -438,7 +438,7 @@ this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 28.52292F)); this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 71.47708F)); this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 276F)); - this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 744F)); + this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 748F)); this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 40F)); this.tableLayoutPanel4.Controls.Add(this.label7, 2, 0); this.tableLayoutPanel4.Controls.Add(this.textBox2, 1, 1); @@ -478,7 +478,7 @@ this.label12.Dock = System.Windows.Forms.DockStyle.Fill; this.label12.Font = new System.Drawing.Font("黑体", 21.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.label12.ForeColor = System.Drawing.Color.White; - this.label12.Location = new System.Drawing.Point(1531, 722); + this.label12.Location = new System.Drawing.Point(1527, 722); this.label12.Margin = new System.Windows.Forms.Padding(2); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(272, 513); @@ -491,10 +491,10 @@ this.labTime.BackColor = System.Drawing.Color.Transparent; this.labTime.Dock = System.Windows.Forms.DockStyle.Fill; this.labTime.Font = new System.Drawing.Font("微软雅黑", 16F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.labTime.Location = new System.Drawing.Point(1971, 0); + this.labTime.Location = new System.Drawing.Point(1969, 0); this.labTime.Margin = new System.Windows.Forms.Padding(0); this.labTime.Name = "labTime"; - this.labTime.Size = new System.Drawing.Size(589, 149); + this.labTime.Size = new System.Drawing.Size(591, 149); this.labTime.TabIndex = 7; this.labTime.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.labTime.Click += new System.EventHandler(this.labTime_Click); @@ -508,7 +508,7 @@ this.pictureBox1.Location = new System.Drawing.Point(0, 0); this.pictureBox1.Margin = new System.Windows.Forms.Padding(0); this.pictureBox1.Name = "pictureBox1"; - this.pictureBox1.Size = new System.Drawing.Size(357, 149); + this.pictureBox1.Size = new System.Drawing.Size(356, 149); this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.pictureBox1.TabIndex = 0; this.pictureBox1.TabStop = false; @@ -518,10 +518,10 @@ this.label1.BackColor = System.Drawing.Color.Transparent; this.label1.Dock = System.Windows.Forms.DockStyle.Fill; this.label1.Font = new System.Drawing.Font("黑体", 22F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label1.Location = new System.Drawing.Point(357, 0); + this.label1.Location = new System.Drawing.Point(356, 0); this.label1.Margin = new System.Windows.Forms.Padding(0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(1614, 149); + this.label1.Size = new System.Drawing.Size(1613, 149); this.label1.TabIndex = 1; this.label1.Text = "装配工位信息看板"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; @@ -532,7 +532,7 @@ this.tableLayoutPanel2.ColumnCount = 3; this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 18.10651F)); this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 81.89349F)); - this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 588F)); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 590F)); this.tableLayoutPanel2.Controls.Add(this.labTime, 2, 0); this.tableLayoutPanel2.Controls.Add(this.pictureBox1, 0, 0); this.tableLayoutPanel2.Controls.Add(this.label1, 1, 0); diff --git a/InjectionPC/FrmMain2408.Designer.cs b/InjectionPC/FrmMain2408.Designer.cs index 2195ee6..b4b319b 100644 --- a/InjectionPC/FrmMain2408.Designer.cs +++ b/InjectionPC/FrmMain2408.Designer.cs @@ -29,10 +29,10 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - GlacialComponents.Controls.GLColumn glColumn5 = new GlacialComponents.Controls.GLColumn(); - GlacialComponents.Controls.GLColumn glColumn6 = new GlacialComponents.Controls.GLColumn(); - GlacialComponents.Controls.GLColumn glColumn7 = new GlacialComponents.Controls.GLColumn(); - GlacialComponents.Controls.GLColumn glColumn8 = new GlacialComponents.Controls.GLColumn(); + GlacialComponents.Controls.GLColumn glColumn1 = new GlacialComponents.Controls.GLColumn(); + GlacialComponents.Controls.GLColumn glColumn2 = new GlacialComponents.Controls.GLColumn(); + GlacialComponents.Controls.GLColumn glColumn3 = new GlacialComponents.Controls.GLColumn(); + GlacialComponents.Controls.GLColumn glColumn4 = new GlacialComponents.Controls.GLColumn(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmMain2408)); this.panel1 = new System.Windows.Forms.Panel(); this.panel7 = new System.Windows.Forms.Panel(); @@ -732,43 +732,43 @@ this.glacialList1.AutoHeight = true; this.glacialList1.BackColor = System.Drawing.SystemColors.ControlLightLight; this.glacialList1.BackgroundStretchToFit = true; - glColumn5.ActivatedEmbeddedType = GlacialComponents.Controls.GLActivatedEmbeddedTypes.None; - glColumn5.CheckBoxes = false; - glColumn5.ImageIndex = -1; - glColumn5.Name = "条码"; - glColumn5.NumericSort = false; - glColumn5.Text = "条码"; - glColumn5.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; - glColumn5.Width = 350; - glColumn6.ActivatedEmbeddedType = GlacialComponents.Controls.GLActivatedEmbeddedTypes.None; - glColumn6.CheckBoxes = false; - glColumn6.ImageIndex = -1; - glColumn6.Name = "产品名称"; - glColumn6.NumericSort = false; - glColumn6.Text = "产品名称"; - glColumn6.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; - glColumn6.Width = 320; - glColumn7.ActivatedEmbeddedType = GlacialComponents.Controls.GLActivatedEmbeddedTypes.None; - glColumn7.CheckBoxes = false; - glColumn7.ImageIndex = -1; - glColumn7.Name = "打印方式"; - glColumn7.NumericSort = false; - glColumn7.Text = "打印方式"; - glColumn7.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; - glColumn7.Width = 150; - glColumn8.ActivatedEmbeddedType = GlacialComponents.Controls.GLActivatedEmbeddedTypes.None; - glColumn8.CheckBoxes = false; - glColumn8.ImageIndex = -1; - glColumn8.Name = "打印时间"; - glColumn8.NumericSort = false; - glColumn8.Text = "打印时间"; - glColumn8.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; - glColumn8.Width = 270; + glColumn1.ActivatedEmbeddedType = GlacialComponents.Controls.GLActivatedEmbeddedTypes.None; + glColumn1.CheckBoxes = false; + glColumn1.ImageIndex = -1; + glColumn1.Name = "条码"; + glColumn1.NumericSort = false; + glColumn1.Text = "条码"; + glColumn1.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; + glColumn1.Width = 350; + glColumn2.ActivatedEmbeddedType = GlacialComponents.Controls.GLActivatedEmbeddedTypes.None; + glColumn2.CheckBoxes = false; + glColumn2.ImageIndex = -1; + glColumn2.Name = "产品名称"; + glColumn2.NumericSort = false; + glColumn2.Text = "产品名称"; + glColumn2.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; + glColumn2.Width = 320; + glColumn3.ActivatedEmbeddedType = GlacialComponents.Controls.GLActivatedEmbeddedTypes.None; + glColumn3.CheckBoxes = false; + glColumn3.ImageIndex = -1; + glColumn3.Name = "打印方式"; + glColumn3.NumericSort = false; + glColumn3.Text = "打印方式"; + glColumn3.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; + glColumn3.Width = 150; + glColumn4.ActivatedEmbeddedType = GlacialComponents.Controls.GLActivatedEmbeddedTypes.None; + glColumn4.CheckBoxes = false; + glColumn4.ImageIndex = -1; + glColumn4.Name = "打印时间"; + glColumn4.NumericSort = false; + glColumn4.Text = "打印时间"; + glColumn4.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; + glColumn4.Width = 270; this.glacialList1.Columns.AddRange(new GlacialComponents.Controls.GLColumn[] { - glColumn5, - glColumn6, - glColumn7, - glColumn8}); + glColumn1, + glColumn2, + glColumn3, + glColumn4}); this.glacialList1.ControlStyle = GlacialComponents.Controls.GLControlStyles.Normal; this.glacialList1.Dock = System.Windows.Forms.DockStyle.Fill; this.glacialList1.Font = new System.Drawing.Font("宋体", 15.75F); diff --git a/InjectionPC/FrmMain2408.cs b/InjectionPC/FrmMain2408.cs index 6d2a239..650663b 100644 --- a/InjectionPC/FrmMain2408.cs +++ b/InjectionPC/FrmMain2408.cs @@ -3560,17 +3560,27 @@ namespace InjectionPC /// private void label9_Click(object sender, EventArgs e) { - Form fr = new FrmQuality(); - fr.FormClosed += (arg1, arg2) => + FrmQuality fr = new FrmQuality(); + fr.QualityViewClosed += (arg1) => { try { InitPackageInfo(); initBarCode(); + if (arg1.Contains(lbPackageCodeL.Text?.Trim())) + { + lbPackageCodeL.Text = ""; + lbCurrentlQtyL.Text = "0"; + } + else if (arg1.Contains(lbPackageCodeR.Text?.Trim())) + { + lbPackageCodeR.Text = ""; + lbCurrentlQtyR.Text = "0"; + } } catch(Exception ex) { - + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); } }; fr.Show(); diff --git a/InjectionPC/FrmQuality.Designer.cs b/InjectionPC/FrmQuality.Designer.cs index 57d91d6..a200edf 100644 --- a/InjectionPC/FrmQuality.Designer.cs +++ b/InjectionPC/FrmQuality.Designer.cs @@ -54,22 +54,26 @@ this.panel1 = new System.Windows.Forms.Panel(); this.label20 = new System.Windows.Forms.Label(); this.label23 = new System.Windows.Forms.Label(); - this.textBox3 = new System.Windows.Forms.TextBox(); + this.txtScanBarCode = new System.Windows.Forms.TextBox(); this.label24 = new System.Windows.Forms.Label(); this.textBox4 = new System.Windows.Forms.TextBox(); this.pictureBox2 = new System.Windows.Forms.PictureBox(); this.panel2 = new System.Windows.Forms.Panel(); this.button1 = new System.Windows.Forms.Button(); - this.textBox1 = new System.Windows.Forms.TextBox(); + this.txtBoxCode = new System.Windows.Forms.TextBox(); this.label12 = new System.Windows.Forms.Label(); this.textBox2 = new System.Windows.Forms.TextBox(); this.timer2 = new System.Windows.Forms.Timer(this.components); this.lbBoxCode = new System.Windows.Forms.Label(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.panel3 = new System.Windows.Forms.Panel(); + this.rbtn1 = new System.Windows.Forms.RadioButton(); + this.rbtn2 = new System.Windows.Forms.RadioButton(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); this.tableLayoutPanel1.SuspendLayout(); + this.panel3.SuspendLayout(); this.SuspendLayout(); // // timer1 @@ -149,7 +153,7 @@ "白班", "夜班"}); this.comboBox1.Location = new System.Drawing.Point(573, 187); - this.comboBox1.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); + this.comboBox1.Margin = new System.Windows.Forms.Padding(5); this.comboBox1.Name = "comboBox1"; this.comboBox1.Size = new System.Drawing.Size(300, 93); this.comboBox1.TabIndex = 20; @@ -198,7 +202,7 @@ this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image"))); this.pictureBox1.Location = new System.Drawing.Point(8, 8); - this.pictureBox1.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); + this.pictureBox1.Margin = new System.Windows.Forms.Padding(5); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(335, 166); this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; @@ -251,7 +255,7 @@ this.panel1.Controls.Add(this.pictureBox1); this.panel1.Controls.Add(this.label1); this.panel1.Location = new System.Drawing.Point(12, 11); - this.panel1.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); + this.panel1.Margin = new System.Windows.Forms.Padding(5); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(2539, 181); this.panel1.TabIndex = 17; @@ -260,11 +264,11 @@ // this.label20.BackColor = System.Drawing.Color.DeepSkyBlue; this.label20.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.label20.Font = new System.Drawing.Font("宋体", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label20.Location = new System.Drawing.Point(20, 288); + this.label20.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label20.Location = new System.Drawing.Point(0, 1); this.label20.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); this.label20.Name = "label20"; - this.label20.Size = new System.Drawing.Size(335, 102); + this.label20.Size = new System.Drawing.Size(283, 102); this.label20.TabIndex = 34; this.label20.Text = "扫描箱单:"; this.label20.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; @@ -273,24 +277,24 @@ // this.label23.BackColor = System.Drawing.Color.DeepSkyBlue; this.label23.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.label23.Font = new System.Drawing.Font("宋体", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label23.Location = new System.Drawing.Point(20, 389); + this.label23.Font = new System.Drawing.Font("宋体", 18F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label23.Location = new System.Drawing.Point(0, 98); this.label23.Margin = new System.Windows.Forms.Padding(5, 0, 5, 0); this.label23.Name = "label23"; - this.label23.Size = new System.Drawing.Size(335, 102); + this.label23.Size = new System.Drawing.Size(283, 102); this.label23.TabIndex = 37; this.label23.Text = "扫描条码:"; this.label23.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // - // textBox3 + // txtScanBarCode // - this.textBox3.Font = new System.Drawing.Font("宋体", 28F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.textBox3.Location = new System.Drawing.Point(356, 389); - this.textBox3.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); - this.textBox3.Name = "textBox3"; - this.textBox3.Size = new System.Drawing.Size(1047, 93); - this.textBox3.TabIndex = 38; - this.textBox3.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox3_KeyDown); + this.txtScanBarCode.Font = new System.Drawing.Font("宋体", 28F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtScanBarCode.Location = new System.Drawing.Point(356, 389); + this.txtScanBarCode.Margin = new System.Windows.Forms.Padding(5); + this.txtScanBarCode.Name = "txtScanBarCode"; + this.txtScanBarCode.Size = new System.Drawing.Size(1047, 93); + this.txtScanBarCode.TabIndex = 38; + this.txtScanBarCode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox3_KeyDown); // // label24 // @@ -309,7 +313,7 @@ // this.textBox4.Font = new System.Drawing.Font("宋体", 28F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.textBox4.Location = new System.Drawing.Point(1707, 392); - this.textBox4.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); + this.textBox4.Margin = new System.Windows.Forms.Padding(5); this.textBox4.Name = "textBox4"; this.textBox4.Size = new System.Drawing.Size(831, 93); this.textBox4.TabIndex = 40; @@ -318,7 +322,7 @@ // this.pictureBox2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.pictureBox2.Location = new System.Drawing.Point(356, 496); - this.pictureBox2.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); + this.pictureBox2.Margin = new System.Windows.Forms.Padding(5); this.pictureBox2.Name = "pictureBox2"; this.pictureBox2.Size = new System.Drawing.Size(2186, 694); this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; @@ -329,7 +333,7 @@ // this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.panel2.Location = new System.Drawing.Point(355, 1189); - this.panel2.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); + this.panel2.Margin = new System.Windows.Forms.Padding(5); this.panel2.Name = "panel2"; this.panel2.Size = new System.Drawing.Size(2030, 838); this.panel2.TabIndex = 42; @@ -339,7 +343,7 @@ this.button1.BackColor = System.Drawing.Color.DeepSkyBlue; this.button1.Font = new System.Drawing.Font("宋体", 21.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.button1.Location = new System.Drawing.Point(2387, 1189); - this.button1.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); + this.button1.Margin = new System.Windows.Forms.Padding(5); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(155, 840); this.button1.TabIndex = 40; @@ -347,15 +351,15 @@ this.button1.UseVisualStyleBackColor = false; this.button1.Click += new System.EventHandler(this.button1_Click); // - // textBox1 + // txtBoxCode // - this.textBox1.Font = new System.Drawing.Font("宋体", 28F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.textBox1.Location = new System.Drawing.Point(356, 292); - this.textBox1.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); - this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(1047, 93); - this.textBox1.TabIndex = 43; - this.textBox1.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox1_KeyDown); + this.txtBoxCode.Font = new System.Drawing.Font("宋体", 28F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtBoxCode.Location = new System.Drawing.Point(356, 292); + this.txtBoxCode.Margin = new System.Windows.Forms.Padding(5); + this.txtBoxCode.Name = "txtBoxCode"; + this.txtBoxCode.Size = new System.Drawing.Size(1047, 93); + this.txtBoxCode.TabIndex = 43; + this.txtBoxCode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox1_KeyDown); // // label12 // @@ -375,7 +379,7 @@ this.textBox2.Enabled = false; this.textBox2.Font = new System.Drawing.Font("宋体", 28F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.textBox2.Location = new System.Drawing.Point(1707, 291); - this.textBox2.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); + this.textBox2.Margin = new System.Windows.Forms.Padding(5); this.textBox2.Name = "textBox2"; this.textBox2.Size = new System.Drawing.Size(831, 93); this.textBox2.TabIndex = 45; @@ -413,23 +417,58 @@ this.tableLayoutPanel1.Size = new System.Drawing.Size(335, 692); this.tableLayoutPanel1.TabIndex = 46; // + // panel3 + // + this.panel3.BackColor = System.Drawing.Color.DeepSkyBlue; + this.panel3.Controls.Add(this.rbtn2); + this.panel3.Controls.Add(this.rbtn1); + this.panel3.Controls.Add(this.label23); + this.panel3.Controls.Add(this.label20); + this.panel3.Location = new System.Drawing.Point(20, 291); + this.panel3.Name = "panel3"; + this.panel3.Size = new System.Drawing.Size(331, 198); + this.panel3.TabIndex = 47; + // + // rbtn1 + // + this.rbtn1.AutoSize = true; + this.rbtn1.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.rbtn1.Location = new System.Drawing.Point(292, 31); + this.rbtn1.Name = "rbtn1"; + this.rbtn1.Size = new System.Drawing.Size(27, 26); + this.rbtn1.TabIndex = 38; + this.rbtn1.UseVisualStyleBackColor = true; + this.rbtn1.CheckedChanged += new System.EventHandler(this.rbtn1_CheckedChanged); + // + // rbtn2 + // + this.rbtn2.AutoSize = true; + this.rbtn2.Checked = true; + this.rbtn2.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.rbtn2.Location = new System.Drawing.Point(291, 137); + this.rbtn2.Name = "rbtn2"; + this.rbtn2.Size = new System.Drawing.Size(27, 26); + this.rbtn2.TabIndex = 39; + this.rbtn2.TabStop = true; + this.rbtn2.UseVisualStyleBackColor = true; + this.rbtn2.CheckedChanged += new System.EventHandler(this.rbtn2_CheckedChanged); + // // FrmQuality // this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(2560, 2048); + this.Controls.Add(this.panel3); this.Controls.Add(this.tableLayoutPanel1); this.Controls.Add(this.textBox2); this.Controls.Add(this.label12); - this.Controls.Add(this.textBox1); + this.Controls.Add(this.txtBoxCode); this.Controls.Add(this.button1); this.Controls.Add(this.panel2); this.Controls.Add(this.pictureBox2); this.Controls.Add(this.textBox4); this.Controls.Add(this.label24); - this.Controls.Add(this.textBox3); - this.Controls.Add(this.label23); - this.Controls.Add(this.label20); + this.Controls.Add(this.txtScanBarCode); this.Controls.Add(this.label11); this.Controls.Add(this.label8); this.Controls.Add(this.label7); @@ -441,7 +480,7 @@ this.Controls.Add(this.label9); this.Controls.Add(this.panel1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; - this.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5); + this.Margin = new System.Windows.Forms.Padding(5); this.Name = "FrmQuality"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "质量录入"; @@ -451,6 +490,8 @@ ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit(); this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.PerformLayout(); + this.panel3.ResumeLayout(false); + this.panel3.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); @@ -475,17 +516,20 @@ private System.Windows.Forms.Panel panel1; private System.Windows.Forms.Label label20; private System.Windows.Forms.Label label23; - private System.Windows.Forms.TextBox textBox3; + private System.Windows.Forms.TextBox txtScanBarCode; private System.Windows.Forms.Label label24; private System.Windows.Forms.TextBox textBox4; private System.Windows.Forms.PictureBox pictureBox2; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Button button1; - private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.TextBox txtBoxCode; private System.Windows.Forms.Label label12; private System.Windows.Forms.TextBox textBox2; private System.Windows.Forms.Timer timer2; private System.Windows.Forms.Label lbBoxCode; private System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; + private System.Windows.Forms.Panel panel3; + private System.Windows.Forms.RadioButton rbtn1; + private System.Windows.Forms.RadioButton rbtn2; } } \ No newline at end of file diff --git a/InjectionPC/FrmQuality.cs b/InjectionPC/FrmQuality.cs index 41828d1..bbe1041 100644 --- a/InjectionPC/FrmQuality.cs +++ b/InjectionPC/FrmQuality.cs @@ -15,6 +15,7 @@ using System.Threading; using System.Threading.Tasks; using System.Windows.Forms; using MESClassLibrary.BLL.BasicInfo; +using MESClassLibrary.BLL.Injection; using MESClassLibrary.BLL.Inspection; using MESClassLibrary.BLL.Log; using MESClassLibrary.BLL.TruckBox; @@ -30,7 +31,14 @@ namespace InjectionPC private bool _isScanBarCode = true; int count = 0; //缺陷图选择个数 private InjectionBoxBLL _injectionBoxBLL = new InjectionBoxBLL(); + private BadInjectionBLL badBLL = new BadInjectionBLL(); + private BadInjectionModel badmd = new BadInjectionModel(); + private BarCodeBLL barbll = new BarCodeBLL(); + private WmsBLL _wmsBll = new WmsBLL(); private string stationId = ""; + private DataTable _boxDetailTable = null; + private List _boxDelList = new List(); + internal event Action> QualityViewClosed = null; public FrmQuality() { InitializeComponent(); @@ -59,13 +67,13 @@ namespace InjectionPC label6.Text = Program.station; label8.Text = Program.OperatorName; comboBox1.Text = Program.Shift; - textBox3.TabIndex = 0; - textBox3.Focus(); - + txtScanBarCode.TabIndex = 0; + txtScanBarCode.Focus(); + txtBoxCode.Enabled = false; GetClass(); comboBox1.Enabled = false; - textBox1.Text = ""; + txtBoxCode.Text = ""; textBox2.Text = ""; Thread t = new Thread(new ThreadStart(TimeGo)); t.Start(); @@ -175,9 +183,9 @@ namespace InjectionPC #endregion - textBox3.Text = Program.strBarCode; + txtScanBarCode.Text = Program.strBarCode; lbBoxCode.Text = Program.strBoxCode; - textBox3.SelectAll(); + txtScanBarCode.SelectAll(); if (ConfigurationManager.AppSettings["IsLast"] == "1") { @@ -319,14 +327,12 @@ namespace InjectionPC return; } - BadInjectionBLL badBLL = new BadInjectionBLL(); - BadInjectionModel badmd = new BadInjectionModel(); InjectionBoxBLL ibll=new InjectionBoxBLL(); - BarCodeBLL barbll=new BarCodeBLL(); + InspectionBLL bll = new InspectionBLL(); tb_Inspection_tx md = new tb_Inspection_tx(); - if (textBox1.Text != "" && textBox3.Text != "") + if (txtBoxCode.Text != "" && txtScanBarCode.Text != "") { MessageBox.Show("箱单和条码只能输入一个!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; @@ -334,260 +340,202 @@ namespace InjectionPC #region 大件报废 - if (textBox1.Text == "" && textBox3.Text != "") + if (txtBoxCode.Text == "" && txtScanBarCode.Text != "") { - #region 判断是否已做过报废 - - DataTable baddt = badBLL.SearchByCode(textBox3.Text.Trim()); - if (baddt != null && baddt.Rows.Count > 0) - { - MessageBox.Show("请产品已做过报废处理!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - reason = ""; - textBox3.Text = ""; - textBox3.TabIndex = 0; - textBox3.Focus(); + SingleBadSave(); + } - textBox4.Text = ""; - pictureBox2.Image = null; + #endregion - pictureBox2.Controls.Clear(); + #region 小件报废,直接修改产量,如果是开机报废减产量,否则产量不变增加报废数 - panel2.Controls.Clear(); - return; + if (txtBoxCode.Text != "" && txtScanBarCode.Text == "") + { + FullBoxBadSave(_boxDetailTable); + if (!_boxDelList.Contains(txtBoxCode.Text?.Trim())) + { + _boxDelList.Add(txtBoxCode.Text?.Trim()); } + } - #endregion - - #region 保存报废详细信息和是否装过箱,装过箱子的不允许报废 - - badmd.ID = Guid.NewGuid().ToString(); - //直供件条码 - if (textBox3.Text.Trim().Contains("#")) - { - badmd.BarCode = textBox3.Text.Trim(); - DataTable dt1 = barbll.SeachInfoByOne(textBox3.Text.Trim(), Program.tableName, 2); - if (dt1 != null && dt1.Rows.Count > 0) - { - badmd.OneBarCode = dt1.Rows[0]["OneBarCode"].ToString(); - isbox = dt1.Rows[0]["BoxNo"].ToString(); + #endregion - if (SubtrBoxCount(isbox) == false) - return; + #region 插入质检总表 - //if (!string.IsNullOrEmpty(isbox)) - //{ - // DataTable boxTable = _injectionBoxBLL.SearchBox(isbox); - // if (boxTable.Rows.Count > 0) - // { - // if(boxTable.Rows[0]["IsPrint"].ToString() == "1") - // { - // MessageBox.Show("请产品已做装箱,不能做报废!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - // reason = ""; - // textBox3.Text = ""; - // textBox3.TabIndex = 0; - // textBox3.Focus(); - - // textBox4.Text = ""; - // pictureBox2.Image = null; - - // pictureBox2.Controls.Clear(); - - // panel2.Controls.Clear(); - // return; - // } - // else - // { - // _injectionBoxBLL.UpdateBoxCount(isbox, -1); - // } - - // } - - - - //} - } - } - else - { - //普通条码 - if (textBox3.Text.Trim().Contains('.')) - { - badmd.BarCode = textBox3.Text.Trim(); - DataTable dt = barbll.SeachInfoByOne(textBox3.Text.Trim(), Program.tableName, 2); - if (dt != null && dt.Rows.Count > 0) - { - badmd.OneBarCode = dt.Rows[0]["OneBarCode"].ToString(); + md.BarCode = badmd.OneBarCode; + md.IsOK = 0; + md.Station = 2; - isbox = dt.Rows[0]["BoxNo"].ToString(); - if (SubtrBoxCount(isbox) == false) - return; + bll.AddInfo(md); + + #endregion - } - else - { - MessageBox.Show("条码不存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - return; - } - } - //20位注塑码 - else - { - badmd.OneBarCode = textBox3.Text.Trim(); + reason = ""; + txtScanBarCode.Text = ""; + txtScanBarCode.TabIndex = 0; + txtScanBarCode.SelectAll(); + txtScanBarCode.Focus(); + + textBox4.Text = ""; + pictureBox2.Image = null; + txtBoxCode.Text = ""; - DataTable dt1 = barbll.SeachInfoByOne(textBox3.Text.Trim(), Program.tableName, 1); - if (dt1 != null && dt1.Rows.Count > 0) - { - badmd.BarCode = dt1.Rows[0]["BarCode"].ToString(); - isbox = dt1.Rows[0]["BoxNo"].ToString(); - - if (SubtrBoxCount(isbox) == false) - return; - - //if (!string.IsNullOrEmpty(isbox)) - //{ - // MessageBox.Show("请产品已做装箱,不能做报废!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - // reason = ""; - // textBox3.Text = ""; - // textBox3.TabIndex = 0; - // textBox3.Focus(); - - // textBox4.Text = ""; - // pictureBox2.Image = null; - // pictureBox2.Controls.Clear(); - // panel2.Controls.Clear(); - // return; - //} - } - } - - } + pictureBox2.Controls.Clear(); - badmd.StationID = stationId; - badmd.BadPosition = position; - badmd.BadReason = reason.Trim(); - badBLL.Add_Info(badmd); + panel2.Controls.Clear(); + position = ""; + reason = ""; + } + /// + /// 单个报废 + /// + private void SingleBadSave() + { + string isbox = ""; - #endregion + #region 判断是否已做过报废 - #region 更新BarCode表标志位 + DataTable baddt = badBLL.SearchByCode(txtScanBarCode.Text.Trim()); //bad 表 + if (baddt != null && baddt.Rows.Count > 0) + { + MessageBox.Show("请产品已做过报废处理!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); + reason = ""; + txtScanBarCode.Text = ""; + txtScanBarCode.TabIndex = 0; + txtScanBarCode.Focus(); - barbll.UpdateIsBad(Program.tableName, badmd.OneBarCode, badmd.BarCode); + textBox4.Text = ""; + pictureBox2.Image = null; - #endregion + pictureBox2.Controls.Clear(); - GetBadCount(); - } + panel2.Controls.Clear(); + return; + } #endregion - #region 小件报废,直接修改产量,如果是开机报废减产量,否则产量不变增加报废数 + #region 保存报废详细信息和是否装过箱,装过箱子的不允许报废 - if (textBox1.Text != "" && textBox3.Text == "") + badmd.ID = Guid.NewGuid().ToString(); + //直供件条码 + if (txtScanBarCode.Text.Trim().Contains("#")) { - #region 验证数据有效性 - - if (textBox2.Text.Trim() == "") + badmd.BarCode = txtScanBarCode.Text.Trim(); + //tb_barCode找到记录 + DataTable dt1 = barbll.SeachInfoByOne(txtScanBarCode.Text.Trim(), Program.tableName, 2); + if (dt1 != null && dt1.Rows.Count > 0) { - MessageBox.Show("请输入报废数量!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - textBox2.Focus(); - return; - } + badmd.OneBarCode = dt1.Rows[0]["OneBarCode"].ToString(); + isbox = dt1.Rows[0]["BoxNo"].ToString(); + //扣减装箱表boxRecord中箱码对应的数量 + if (SubtrBoxCount(isbox) == false) + return; - if (!IsNumeric(textBox2.Text.Trim())) + } + } + else + { + //普通条码 + if (txtScanBarCode.Text.Trim().Contains('.')) { - MessageBox.Show("报废数量必须为整数!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - textBox2.Focus(); - return; - } - - #endregion + badmd.BarCode = txtScanBarCode.Text.Trim(); + //tb_barCode找到记录 + DataTable dt = barbll.SeachInfoByOne(txtScanBarCode.Text.Trim(), Program.tableName, 2); + if (dt != null && dt.Rows.Count > 0) + { + badmd.OneBarCode = dt.Rows[0]["OneBarCode"].ToString(); - #region 判断报废数量是否大于该箱子里的数量 + isbox = dt.Rows[0]["BoxNo"].ToString(); + //扣减装箱表boxRecord中箱码对应的数量 + if (SubtrBoxCount(isbox) == false) + return; - DataTable dt1 = ibll.SearchBox(textBox1.Text); - if (dt1 != null && dt1.Rows.Count > 0) - { - if (Convert.ToInt32(textBox2.Text.Trim()) > dt1.Rows.Count) - { - MessageBox.Show("报废数不能大于装箱数量!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - textBox2.Focus(); - return; } else { - for (int i = 0; i < Convert.ToInt32(textBox2.Text.Trim()); i++) - { - #region 按时间倒序排并且已入箱的对应的个数将零件改为报废, - - DataTable dt2 = barbll.SearchBarCode(textBox1.Text.Trim(), Program.tableName, - textBox2.Text.Trim()); - if (dt2 != null && dt2.Rows.Count > 0) - { - for (int j = 0; j < dt2.Rows.Count; j++) - { - barbll.UpdateIsBad(Program.tableName, "", dt2.Rows[j]["BarCode"].ToString()); - - #region 添加报废记录 - - badmd.ID = Guid.NewGuid().ToString(); - badmd.OneBarCode = dt2.Rows[j]["OneBarCode"].ToString(); - badmd.BarCode = dt2.Rows[j]["BarCode"].ToString(); - badmd.BadPosition = position; - badmd.BadReason = reason.Trim(); - badBLL.Add_Info(badmd); - - #endregion - } - } - - #endregion - } + MessageBox.Show("条码不存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); + return; } } + //20位注塑码 else { - MessageBox.Show("该箱单不存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - textBox1.Focus(); - return; + badmd.OneBarCode = txtScanBarCode.Text.Trim(); + + DataTable dt1 = barbll.SeachInfoByOne(txtScanBarCode.Text.Trim(), Program.tableName, 1); + if (dt1 != null && dt1.Rows.Count > 0) + { + badmd.BarCode = dt1.Rows[0]["BarCode"].ToString(); + isbox = dt1.Rows[0]["BoxNo"].ToString(); + + if (SubtrBoxCount(isbox) == false) + return; + + } } - #endregion } + badmd.StationID = stationId; + badmd.BadPosition = position; + badmd.BadReason = reason.Trim(); + badBLL.Add_Info(badmd); + #endregion - #region 插入质检总表 + #region 更新BarCode表标志位 - md.BarCode = badmd.OneBarCode; - md.IsOK = 0; - md.Station = 2; + barbll.UpdateIsBad(Program.tableName, badmd.OneBarCode, badmd.BarCode); - bll.AddInfo(md); - #endregion - reason = ""; - textBox3.Text = ""; - textBox3.TabIndex = 0; - textBox3.SelectAll(); - textBox3.Focus(); - - textBox4.Text = ""; - pictureBox2.Image = null; - textBox1.Text = ""; + GetBadCount(); + } + /// + /// 按箱码报废 + /// + private void FullBoxBadSave(DataTable boxDetailTable) + { + string isbox = ""; + if (MessageBox.Show($"确认对箱码[{txtBoxCode.Text}]所含[{boxDetailTable.Rows.Count}]条数据做报废处理?", "", MessageBoxButtons.OKCancel) == DialogResult.Cancel) + return; + string boxCode = boxDetailTable.Rows[0]["BoxNo"].ToString(); + foreach(DataRow dr in boxDetailTable.Rows) + { + string barCode = dr["BarCode"].ToString(); + string oneBarCode = dr["OneBarCode"].ToString(); + badmd = new BadInjectionModel(); + badmd.ID = Guid.NewGuid().ToString(); + badmd.BarCode = barCode; + badmd.OneBarCode = oneBarCode; + isbox = boxCode; - pictureBox2.Controls.Clear(); + badmd.StationID = stationId; + badmd.BadPosition = position; + badmd.BadReason = reason.Trim(); + badBLL.Add_Info(badmd); - panel2.Controls.Clear(); - position = ""; - reason = ""; + } + + #region 扣减箱码数量 + ClearBoxCount(isbox); + #endregion + + #region 更新tb_BarCode表标志位 + + barbll.UpdateIsBadByBoxCode(Program.tableName, boxCode); + + #endregion + + GetBadCount(); } /// /// 扣减箱码数量 /// /// /// - bool SubtrBoxCount(string boxCode) + bool SubtrBoxCount(string boxCode) { if (!string.IsNullOrEmpty(boxCode)) { @@ -598,9 +546,9 @@ namespace InjectionPC { MessageBox.Show("请产品已做装箱,不能做报废!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); reason = ""; - textBox3.Text = ""; - textBox3.TabIndex = 0; - textBox3.Focus(); + txtScanBarCode.Text = ""; + txtScanBarCode.TabIndex = 0; + txtScanBarCode.Focus(); textBox4.Text = ""; pictureBox2.Image = null; @@ -620,164 +568,124 @@ namespace InjectionPC } return true; } - private static bool IsNumeric(string str) - { - System.Text.RegularExpressions.Regex reg1 = new System.Text.RegularExpressions.Regex(@"^[0-9]\d*$"); - return reg1.IsMatch(str); - } - private void button2_Click(object sender, EventArgs e) + /// + /// 扣减箱码数量为0,同时撤回WMS报工数据, 如果wms已读取,返回false + /// + /// + /// + bool ClearBoxCount(string boxCode) { - try + if (!string.IsNullOrEmpty(boxCode)) { - #region 售后件,注销,改为合格 - - //string partNo = "", manufacturer = "", barCode = ""; - - //ProductBLL pbll = new ProductBLL(); - //BarCodeBLL barbll = new BarCodeBLL(); - - //#region 验证数据有效性 - - //if (textBox1.Text.Trim() == "" && textBox3.Text.Trim() == "") - //{ - // MessageBox.Show("请输入箱单或条码!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - // return; - //} - - //if (textBox1.Text.Trim() != "" && textBox3.Text.Trim() != "") - //{ - // MessageBox.Show("箱单和条码只能输入一个!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - // return; - //} - - //#endregion - - //#region 小件 - - //if (textBox1.Text.Trim() != "") - //{ - // string[] aa = textBox1.Text.Split('.'); - - // partNo = aa[0].Trim(); - - // DataTable dt1 = pbll.SearchInfoByPartNo(partNo); - // if (dt1 != null && dt1.Rows.Count > 0) - // { - // if (dt1.Rows[0]["ManufacturerName"].ToString().Contains("奔驰")) - // { - // MessageBox.Show("奔驰产品不能转售后件!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - // return; - // } - // } - // else - // { - // for (int i = 0; i < Convert.ToInt32(textBox2.Text.Trim()); i++) - // { - // #region 按时间倒序排并且已入箱的对应的个数将零件改为报废, - - // DataTable dt2 = barbll.SearchBarCode(textBox1.Text.Trim(), Program.tableName, - // textBox2.Text.Trim()); - // if (dt2 != null && dt2.Rows.Count > 0) - // { - // for (int j = 0; j < dt2.Rows.Count; j++) - // { - // barbll.updateProductNature(Program.tableName, dt2.Rows[j]["BarCode"].ToString()); - // } - // } - - // #endregion - // } - // } - //} - - //#endregion - - //#region 大件 - - //if (textBox3.Text.Trim() != "") - //{ - // if (textBox3.Text.Trim().Contains('.')) - // { - // barCode = textBox3.Text.Trim(); - // } - // else - // { - // DataTable dt4 = barbll.SeachInfoByOne(textBox3.Text.Trim(), Program.tableName, 1); - // if (dt4 != null && dt4.Rows.Count > 0) - // { - // barCode = dt4.Rows[0]["BarCode"].ToString(); - // } - // else - // { - // MessageBox.Show("条码不存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - // return; - // } - // } - - // string[] aa = barCode.Split('.'); - // partNo = aa[0].Trim(); - - // DataTable dt3 = pbll.SearchInfoByPartNo(partNo); - // if (dt3 != null && dt3.Rows.Count > 0) - // { - // if (dt3.Rows[0]["ManufacturerName"].ToString().Contains("奔驰")) - // { - // MessageBox.Show("奔驰产品不能转售后件!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - // return; - // } - // else - // { - // barbll.updateProductNature(Program.tableName, barCode); - // } - // } - //} - - //#endregion + bool isRead = _wmsBll.IsReadBoxInWms(boxCode); + if (isRead == true) + { - #endregion + MessageBox.Show($"箱码[{boxCode}]已报工,不能做报废!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); + reason = ""; + txtScanBarCode.Text = ""; + txtScanBarCode.TabIndex = 0; + txtScanBarCode.Focus(); - #region 合格打印条码 + textBox4.Text = ""; + pictureBox2.Image = null; - + pictureBox2.Controls.Clear(); - #endregion - } - catch (Exception ex) - { - LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + panel2.Controls.Clear(); + return false; + } + else + { + bool isDel = _wmsBll.DelRecordByBox(boxCode); + if(isDel) + { + _injectionBoxBLL.UpdateBoxCount(boxCode, 100, true); + } + else + { + MessageBox.Show($"整箱报废失败,可能箱码[{boxCode}]在操作时已被wms接收"); + return false; + } + } + } + return true; + } + private static bool IsNumeric(string str) + { + System.Text.RegularExpressions.Regex reg1 = new System.Text.RegularExpressions.Regex(@"^[0-9]\d*$"); + return reg1.IsMatch(str); } + private void textBox3_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.Enter) { - _isScanBarCode = true; - string code = ""; - string[] barcode=new string[3]; - int row = 0, col = 0; - string picture = ""; - string LineID = ""; - ProductBLL bll = new ProductBLL(); - BarCodeBLL barbll=new BarCodeBLL(); - - string aa = textBox3.Text.Trim(); - if (textBox3.Text.Contains('.') == false && textBox3.Text.Contains('#') == false) + textBox2.Text = "1"; + _boxDetailTable = null; + BarCodeScan(txtScanBarCode.Text.Trim()); + } + } + /// + /// 扫描标签质检 + /// + /// + void BarCodeScan(string scanBarCode) + { + _isScanBarCode = true; + string code = ""; + string[] barcode = new string[3]; + int row = 0, col = 0; + string picture = ""; + string LineID = ""; + ProductBLL bll = new ProductBLL(); + BarCodeBLL barbll = new BarCodeBLL(); + + + if (scanBarCode.Contains('.') == false && scanBarCode.Contains('#') == false) + { + DataTable xdt = barbll.SeachInfoByOne(scanBarCode.Trim(), Program.tableName, 1); + if (xdt != null && xdt.Rows.Count > 0) { - DataTable xdt=barbll.SeachInfoByOne(textBox3.Text.Trim(), Program.tableName, 1); - if (xdt != null && xdt.Rows.Count > 0) - { - code = xdt.Rows[0]["BarCode"].ToString(); - } - else - { - MessageBox.Show("条码有误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - return; - } + code = xdt.Rows[0]["BarCode"].ToString(); + } + else + { + MessageBox.Show("条码有误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); + return; + } + + barcode = code.Split('.'); + DataTable dt = bll.SearchInfoByPartNo(barcode[0]); + if (dt != null && dt.Rows.Count > 0) + { + textBox4.Text = dt.Rows[0]["ProductName"].ToString(); + row = Convert.ToInt32(dt.Rows[0]["Rows"].ToString()); + col = Convert.ToInt32(dt.Rows[0]["Cols"].ToString()); + picture = dt.Rows[0]["PicturePath"].ToString(); + } + } + else + { + DataTable xdt = barbll.SeachInfoByOne(scanBarCode.Trim(), Program.tableName, 2); + if (xdt != null && xdt.Rows.Count > 0) + { + code = xdt.Rows[0]["BarCode"].ToString(); + } + else + { + MessageBox.Show("条码有误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); + return; + } - barcode = code.Split('.'); + if (scanBarCode.Contains('#') == false) + { + barcode = scanBarCode.Trim().Split('.'); DataTable dt = bll.SearchInfoByPartNo(barcode[0]); + if (dt != null && dt.Rows.Count > 0) { textBox4.Text = dt.Rows[0]["ProductName"].ToString(); @@ -788,256 +696,237 @@ namespace InjectionPC } else { - DataTable xdt = barbll.SeachInfoByOne(textBox3.Text.Trim(), Program.tableName, 2); - if (xdt != null && xdt.Rows.Count > 0) - { - code = xdt.Rows[0]["BarCode"].ToString(); - } - else - { - MessageBox.Show("条码有误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - return; - } - - if (textBox3.Text.Contains('#') == false) - { - barcode = textBox3.Text.Trim().Split('.'); - DataTable dt = bll.SearchInfoByPartNo(barcode[0]); + barcode = scanBarCode.Trim().Split('#'); + DataTable dt = bll.SearchInfoByPartNo(barcode[0]); - if (dt != null && dt.Rows.Count > 0) - { - textBox4.Text = dt.Rows[0]["ProductName"].ToString(); - row = Convert.ToInt32(dt.Rows[0]["Rows"].ToString()); - col = Convert.ToInt32(dt.Rows[0]["Cols"].ToString()); - picture = dt.Rows[0]["PicturePath"].ToString(); - } - } - else + if (dt != null && dt.Rows.Count > 0) { - barcode = textBox3.Text.Trim().Split('#'); - DataTable dt = bll.SearchInfoByPartNo(barcode[0]); - - if (dt != null && dt.Rows.Count > 0) - { - textBox4.Text = dt.Rows[0]["ProductName"].ToString(); - row = Convert.ToInt32(dt.Rows[0]["Rows"].ToString()); - col = Convert.ToInt32(dt.Rows[0]["Cols"].ToString()); - picture = dt.Rows[0]["PicturePath"].ToString(); - } + textBox4.Text = dt.Rows[0]["ProductName"].ToString(); + row = Convert.ToInt32(dt.Rows[0]["Rows"].ToString()); + col = Convert.ToInt32(dt.Rows[0]["Cols"].ToString()); + picture = dt.Rows[0]["PicturePath"].ToString(); } } - + } - try - { - #region Load PictureBox - if (!string.IsNullOrEmpty(picture)) + try + { + #region Load PictureBox + + if (!string.IsNullOrEmpty(picture)) + { + if (!File.Exists(System.IO.Directory.GetCurrentDirectory() + @"\" + picture)) { - if (!File.Exists(System.IO.Directory.GetCurrentDirectory() + @"\" + picture)) - { - //string strImageURL = ConfigurationManager.AppSettings["PicturePath"] + picture; - string strImageURL = "http://10.60.101.59:8001/PDF/" + picture; - - System.Net.WebClient webClient = new System.Net.WebClient(); - webClient.DownloadFile(strImageURL, Directory.GetCurrentDirectory() + @"\" + picture); - - //Ping p1 = new Ping(); - //bool status = false; - - //PingReply reply = p1.Send(Program.RemoteIP); //发送主机名或Ip地址 - //StringBuilder sbuilder; - //if (reply.Status == IPStatus.Success) - //{ - // string PictureFolder = ConfigurationManager.AppSettings["PictureFolder"].ToString(); - // string User = ConfigurationManager.AppSettings["PictureUser"].ToString(); - // string UserPwd = ConfigurationManager.AppSettings["PicturePsw"].ToString(); - // status = Upload.DoConnComputer(Program.RemoteIP, PictureFolder, User, UserPwd); - // if (status == true) - // { - // //共享文件夹的目录 - // string path = ConfigurationManager.AppSettings["PicturePath"].ToString() + picture; - // DirectoryInfo theFolder = new DirectoryInfo(path); - // string filename = theFolder.ToString(); - - // //执行方法 - // TransportRemoteToLocal(filename, System.Environment.CurrentDirectory + "\\", picture); //实现将远程服务器文件写入到本地 - // } - //} - } + //string strImageURL = ConfigurationManager.AppSettings["PicturePath"] + picture; + string strImageURL = "http://10.60.101.59:8001/PDF/" + picture; - FileStream fs = new FileStream(Directory.GetCurrentDirectory() + "\\" + picture, FileMode.Open, - FileAccess.Read); //获取图片文件流 - Image img = Image.FromStream(fs); // 文件流转换成Image格式 - pictureBox2.Image = img; //给 图片框设置要显示的图片 - fs.Close(); // 关闭流,释放图片资源 + System.Net.WebClient webClient = new System.Net.WebClient(); + webClient.DownloadFile(strImageURL, Directory.GetCurrentDirectory() + @"\" + picture); } - #endregion + FileStream fs = new FileStream(Directory.GetCurrentDirectory() + "\\" + picture, FileMode.Open, + FileAccess.Read); //获取图片文件流 + Image img = Image.FromStream(fs); // 文件流转换成Image格式 + pictureBox2.Image = img; //给 图片框设置要显示的图片 + fs.Close(); // 关闭流,释放图片资源 } - catch (Exception ex) - { - LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); - } - - #region 缺陷图划分区域 - Label[] lb = new Label[5]; - string[] str = - { + #endregion + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + } + + #region 缺陷图划分区域 + + Label[] lb = new Label[5]; + string[] str = + { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" }; - for (int i = 0; i < col; i++) + for (int i = 0; i < col; i++) + { + for (int j = 0; j < row; j++) { - for (int j = 0; j < row; j++) - { - lb[i] = new Label(); - lb[i].Text = str[i + col * j].ToString(); - lb[i].Font = new Font(lb[i].Font.FontFamily, 32, FontStyle.Bold); - - lb[i].Size = new Size(pictureBox2.Width / col, pictureBox2.Height / row); - lb[i].Location = new Point(0 + i * lb[i].Size.Width, 0 + j * lb[i].Size.Height); - lb[i].BorderStyle = BorderStyle.FixedSingle; - lb[i].BackColor = Color.Transparent; - lb[i].TextAlign = ContentAlignment.MiddleCenter; - pictureBox2.Controls.Add(lb[i]); - - lb[i].Click += new EventHandler(lblRoom_Click); - } + lb[i] = new Label(); + lb[i].Text = str[i + col * j].ToString(); + lb[i].Font = new Font(lb[i].Font.FontFamily, 32, FontStyle.Bold); + + lb[i].Size = new Size(pictureBox2.Width / col, pictureBox2.Height / row); + lb[i].Location = new Point(0 + i * lb[i].Size.Width, 0 + j * lb[i].Size.Height); + lb[i].BorderStyle = BorderStyle.FixedSingle; + lb[i].BackColor = Color.Transparent; + lb[i].TextAlign = ContentAlignment.MiddleCenter; + pictureBox2.Controls.Add(lb[i]); + + lb[i].Click += new EventHandler(lblRoom_Click); } + } - #endregion + #endregion - #region 缺陷原因 + #region 缺陷原因 - StationBLL sbll = new StationBLL(); - DataTable sdt = sbll.SearchInfoByNo(Program.station); - if (sdt != null && sdt.Rows.Count > 0) - { - LineID = sdt.Rows[0]["LineID"].ToString(); - } + StationBLL sbll = new StationBLL(); + DataTable sdt = sbll.SearchInfoByNo(Program.station); + if (sdt != null && sdt.Rows.Count > 0) + { + LineID = sdt.Rows[0]["LineID"].ToString(); + } - //sdt.Dispose(); - int drow = 0, dcol = 6; + int drow = 0, dcol = 6; - DefectBLL dbll = new DefectBLL(); - DataTable dt3 = dbll.SearchInfo(LineID); - if (dt3 != null && dt3.Rows.Count > 0) - { - drow = Convert.ToInt32(Math.Ceiling((double) dt3.Rows.Count / dcol)); - Label[] dLb = new Label[7]; - string[] dstr = new string[dt3.Rows.Count]; + DefectBLL dbll = new DefectBLL(); + DataTable dt3 = dbll.SearchInfo(LineID); + if (dt3 != null && dt3.Rows.Count > 0) + { + drow = Convert.ToInt32(Math.Ceiling((double)dt3.Rows.Count / dcol)); + Label[] dLb = new Label[7]; + string[] dstr = new string[dt3.Rows.Count]; - for (int i = 0; i < dt3.Rows.Count; i++) - { - dstr[i] = dt3.Rows[i]["DefectName"].ToString(); - } + for (int i = 0; i < dt3.Rows.Count; i++) + { + dstr[i] = dt3.Rows[i]["DefectName"].ToString(); + } - for (int i = 0; i < dcol; i++) //列 + for (int i = 0; i < dcol; i++) //列 + { + for (int j = 0; j < drow; j++) //行 { - for (int j = 0; j < drow; j++) //行 + dLb[i] = new Label(); + if ((i + dcol * j) < dstr.Length) { - dLb[i] = new Label(); - if ((i + dcol * j) < dstr.Length) - { - dLb[i].Text = dstr[i + dcol * j].ToString(); - dLb[i].Font = new Font(dLb[i].Font.FontFamily, 20, FontStyle.Bold); - - dLb[i].Size = new Size(130, 50); - dLb[i].Location = new Point(50 + i * (dLb[i].Size.Width + 25), - 50 + j * (dLb[i].Size.Height + 20)); - dLb[i].BorderStyle = BorderStyle.FixedSingle; - dLb[i].BackColor = Color.Transparent; - dLb[i].TextAlign = ContentAlignment.MiddleCenter; - panel2.Controls.Add(dLb[i]); - dLb[i].Click += new EventHandler(dLbRoom_Click); - } + dLb[i].Text = dstr[i + dcol * j].ToString(); + dLb[i].Font = new Font(dLb[i].Font.FontFamily, 20, FontStyle.Bold); + + dLb[i].Size = new Size(130, 50); + dLb[i].Location = new Point(50 + i * (dLb[i].Size.Width + 25), + 50 + j * (dLb[i].Size.Height + 20)); + dLb[i].BorderStyle = BorderStyle.FixedSingle; + dLb[i].BackColor = Color.Transparent; + dLb[i].TextAlign = ContentAlignment.MiddleCenter; + panel2.Controls.Add(dLb[i]); + dLb[i].Click += new EventHandler(dLbRoom_Click); } } } + } - #endregion + #endregion - if (ConfigurationManager.AppSettings["IsLast"] == "1") - { - timer2.Enabled = true; - } - else if (ConfigurationManager.AppSettings["IsLast"] == "0") - { - timer2.Enabled = false; - label9.Visible = false; - } + if (ConfigurationManager.AppSettings["IsLast"] == "1") + { + timer2.Enabled = true; + } + else if (ConfigurationManager.AppSettings["IsLast"] == "0") + { + timer2.Enabled = false; + label9.Visible = false; } } private void label2_Click(object sender, EventArgs e) { this.Close(); + if(QualityViewClosed != null) + { + QualityViewClosed(_boxDelList); + } //Environment.Exit(0); } + /// + /// 扫描箱码,整箱报废 + /// + /// + /// private void textBox1_KeyDown(object sender, KeyEventArgs e) { try { InjectionBoxBLL bll=new InjectionBoxBLL(); - ProductBLL pbll=new ProductBLL(); + BarCodeBLL pbll =new BarCodeBLL(); if (e.KeyCode == Keys.Enter) { - if (textBox1.Text.Trim() == "") - { - MessageBox.Show("请扫描或输入箱单!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - textBox1.Focus(); - return; - } - - if (textBox1.Text.Contains('.')==false) - { - MessageBox.Show("箱单格式有误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - textBox1.Focus(); - return; - } - - #region 判断箱单是否为小件,即看零件号是否需要打印单个条码 - - string[] aa = textBox1.Text.Split('.'); - string partNo = aa[0].ToString().Trim(); - - DataTable dt = pbll.SearchInfoByPartNo(partNo); - if (dt != null && dt.Rows.Count > 0) - { - if (dt.Rows[0]["IsPrintOneTag"].ToString() == "1") - { - MessageBox.Show("该零件有单个条码,不能扫描箱单!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - textBox1.Focus(); - return; - } - } - else - { - MessageBox.Show("该箱单有误,请重新扫描或输入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - textBox1.Focus(); - return; - } + string packageCode = txtBoxCode.Text.Trim(); - #endregion - _isScanBarCode = false; - DataTable dt1 = bll.SearchBox(textBox1.Text); - if (dt1 != null && dt1.Rows.Count > 0) - { - textBox2.Text = dt1.Rows[0]["BoxCount"].ToString(); - } - else + if (string.IsNullOrEmpty(packageCode)) return; + + DataTable packageTable = pbll.SearchBarCode(packageCode, Program.tableName, "100"); + if(packageTable.Rows.Count == 0) { - MessageBox.Show("该箱单不存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); - textBox1.Focus(); + //MessageBox.Show($"扫描箱单[{packageCode}]在系统中不存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); + txtBoxCode.Focus(); return; } + _boxDetailTable = packageTable; + DataRow dr = packageTable.Rows[0]; + textBox2.Text = packageTable.Rows.Count.ToString(); + BarCodeScan(dr["OneBarCode"].ToString()); + + + + + + + + + //if (textBox1.Text.Trim() == "") + //{ + // MessageBox.Show("请扫描或输入箱单!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); + // textBox1.Focus(); + // return; + //} + + //if (textBox1.Text.Contains('.')==false) + //{ + // MessageBox.Show("箱单格式有误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); + // textBox1.Focus(); + // return; + //} + + //#region 判断箱单是否为小件,即看零件号是否需要打印单个条码 + + //string[] aa = textBox1.Text.Split('.'); + //string partNo = aa[0].ToString().Trim(); + + //DataTable dt = pbll.SearchInfoByPartNo(partNo); + //if (dt != null && dt.Rows.Count > 0) + //{ + // if (dt.Rows[0]["IsPrintOneTag"].ToString() == "1") + // { + // MessageBox.Show("该零件有单个条码,不能扫描箱单!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); + // textBox1.Focus(); + // return; + // } + //} + //else + //{ + // MessageBox.Show("该箱单有误,请重新扫描或输入!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); + // textBox1.Focus(); + // return; + //} + + //#endregion + //_isScanBarCode = false; + //DataTable dt1 = bll.SearchBox(textBox1.Text); + //if (dt1 != null && dt1.Rows.Count > 0) + //{ + // textBox2.Text = dt1.Rows[0]["BoxCount"].ToString(); + //} + //else + //{ + // MessageBox.Show("该箱单不存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); + // textBox1.Focus(); + // return; + //} } } catch (Exception ex) @@ -1104,6 +993,34 @@ namespace InjectionPC } } + private void rbtn1_CheckedChanged(object sender, EventArgs e) + { + if (rbtn1.Checked) + { + txtBoxCode.Enabled = true; + txtScanBarCode.Text = ""; + txtBoxCode.Focus(); + } + else + { + txtBoxCode.Enabled = false; + } + } + + private void rbtn2_CheckedChanged(object sender, EventArgs e) + { + if (rbtn2.Checked) + { + txtScanBarCode.Enabled = true; + txtBoxCode.Text = ""; + txtScanBarCode.Focus(); + } + else + { + txtScanBarCode.Enabled = false; + } + } + private void GetBadCount() { try diff --git a/InjectionPC/装箱单.grf b/InjectionPC/装箱单.grf index 63d24a5..a74c33c 100644 Binary files a/InjectionPC/装箱单.grf and b/InjectionPC/装箱单.grf differ diff --git a/InjectionSearch/FrmBarCodeReplace.cs b/InjectionSearch/FrmBarCodeReplace.cs index 28ebf81..2324d6a 100644 --- a/InjectionSearch/FrmBarCodeReplace.cs +++ b/InjectionSearch/FrmBarCodeReplace.cs @@ -83,6 +83,12 @@ namespace InjectionSearch MessageBox.Show($"箱码{boxCode}尚未报工,无法此处替换."); return; } + //WMS中间表,wmsread=1后不能替换,只能去WMS替换 + if (wmsBLL.IsReadBoxInWms(boxCode) == true) + { + MessageBox.Show($"箱码{boxCode}已被WMS处理,因此无法替换."); + return; + } DialogResult result = MessageBox.Show($"确认用条码{newCode}替换原有条码{oldCode},确认将原有条码{oldCode}进行报废处理?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Information); diff --git a/InjectionSearch/装箱单.grf b/InjectionSearch/装箱单.grf index 63d24a5..a74c33c 100644 Binary files a/InjectionSearch/装箱单.grf and b/InjectionSearch/装箱单.grf differ diff --git a/MESClassLibrary/BLL/BasicInfo/BarCodeBLL.cs b/MESClassLibrary/BLL/BasicInfo/BarCodeBLL.cs index bf05bdf..b7d12f1 100644 --- a/MESClassLibrary/BLL/BasicInfo/BarCodeBLL.cs +++ b/MESClassLibrary/BLL/BasicInfo/BarCodeBLL.cs @@ -376,12 +376,32 @@ namespace MESClassLibrary.BLL.BasicInfo return false; } } - + public bool UpdateIsBadByBoxCode(string tableName, string boxNo) + { + try + { + return db.UpdateIsBadByBoxCode(tableName, boxNo); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return false; + } + } public DataTable SearchBarCode(string boxNo, string tableName, string row) { try { - return db.SearchBarCode(boxNo, tableName, row); + DataTable dt = null; + if (string.IsNullOrEmpty(tableName)) + { + dt = db.SearchInfoByBox(boxNo); + } + else + { + dt = db.SearchBarCode(boxNo, tableName, row); + } + return dt; } catch (Exception ex) { diff --git a/MESClassLibrary/BLL/Inspection/InjectionBoxBLL.cs b/MESClassLibrary/BLL/Inspection/InjectionBoxBLL.cs index 934b12a..b9ff286 100644 --- a/MESClassLibrary/BLL/Inspection/InjectionBoxBLL.cs +++ b/MESClassLibrary/BLL/Inspection/InjectionBoxBLL.cs @@ -26,11 +26,11 @@ namespace MESClassLibrary.BLL.Inspection return false; } } - public bool UpdateBoxCount(string packageCode, int addCount) + public bool UpdateBoxCount(string packageCode, int addCount,bool isFinish=false) { try { - return db.UpdateInfo(packageCode, addCount); + return db.UpdateInfo(packageCode, addCount, isFinish); } catch (Exception ex) { diff --git a/MESClassLibrary/BLL/Wms/WmsBLL.cs b/MESClassLibrary/BLL/Wms/WmsBLL.cs index 4b725fe..7102fb4 100644 --- a/MESClassLibrary/BLL/Wms/WmsBLL.cs +++ b/MESClassLibrary/BLL/Wms/WmsBLL.cs @@ -48,7 +48,7 @@ namespace MESClassLibrary.BLL.Injection } - + private string SendToInterface(string boxNo) { DataTable barCodeTable = barCodeDal.SearchInfoByBox(boxNo); @@ -57,11 +57,42 @@ namespace MESClassLibrary.BLL.Injection string rst = da.SaveInterface(barCodeTable); return rst; } - + /// + /// 是否已传到WMS + /// + /// + /// public bool IsSendPackageCode(string pacakgCode) { return da.IsSendPackageCode(pacakgCode); } + /// + /// 查询箱码在 wms中间表 是否已读 + /// + /// + /// + public bool IsReadBoxInWms(string packagCode) + { + return da.IsReadBoxInWms(packagCode); + } + /// + /// 查询注塑码或条码在 wms中间表 是否已读 + /// + /// + /// + public bool IsReadBarCodeInWms(string barCode) + { + return da.IsReadBarCodeInWms(barCode); + } + /// + /// 根据箱码删除中间表数据 整体报废wms未读取订单 true 删除成功, false 删除失败 + /// + /// + /// + public bool DelRecordByBox(string boxNo) + { + return da.DelRecordByBox(boxNo); + } } } diff --git a/MESClassLibrary/DAL/BasicInfo/BarCodeDAl.cs b/MESClassLibrary/DAL/BasicInfo/BarCodeDAl.cs index 3237847..cf3c649 100644 --- a/MESClassLibrary/DAL/BasicInfo/BarCodeDAl.cs +++ b/MESClassLibrary/DAL/BasicInfo/BarCodeDAl.cs @@ -984,7 +984,46 @@ namespace MESClassLibrary.DAL.BasicInfo return false; } } + /// + /// 根据箱码更新IsBad=1 + /// + /// + /// + /// + public bool UpdateIsBadByBoxCode(string tableName, string boxCode) + { + try + { + #region 添加数据 + + string sql = ""; + SqlParameter[] param = null; + + param = new SqlParameter[1]; + + + sql = @"update " + tableName + " set IsBad=1 where BoxNo=@boxCode"; + + #region 添加参数 + + param[0] = new SqlParameter("@boxCode", SqlDbType.VarChar); + param[0].Value = boxCode; + + #endregion + + + + SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(), CommandType.Text, sql, param); + #endregion + return true; + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return false; + } + } public DataTable SearchCountByBox(string boxNo,string tableName) { try diff --git a/MESClassLibrary/DAL/Injection/InjectionBoxDAL.cs b/MESClassLibrary/DAL/Injection/InjectionBoxDAL.cs index 56f176a..65faf10 100644 --- a/MESClassLibrary/DAL/Injection/InjectionBoxDAL.cs +++ b/MESClassLibrary/DAL/Injection/InjectionBoxDAL.cs @@ -74,7 +74,7 @@ namespace MESClassLibrary.DAL.Injection return false; } } - public bool UpdateInfo(string packageCode, int addCount) + public bool UpdateInfo(string packageCode, int addCount, bool isFinish = false) { try { @@ -90,9 +90,18 @@ namespace MESClassLibrary.DAL.Injection #region 添加数据 string sql = ""; SqlParameter[] param = null; - sql = "update " + TableName + $" set BoxCount = BoxCount+ {addCount} "; - sql += $" where BoxCount >={i} and "; - sql += "BoxNo=@BoxNo"; + if(isFinish == false) + { + sql = "update " + TableName + $" set BoxCount = BoxCount+ {addCount} "; + sql += $" where BoxCount >={i} and "; + sql += "BoxNo=@BoxNo"; + } + else + { + sql = "update " + TableName + $" set BoxCount = 0, IsPrint=1 ,remark='整箱报废'"; + sql += $" where (1=1) and "; + sql += "BoxNo=@BoxNo"; + } #region 添加参数 param = new SqlParameter[1]; diff --git a/MESClassLibrary/DAL/Wms/WmsDAL.cs b/MESClassLibrary/DAL/Wms/WmsDAL.cs index daf50ef..c3709a0 100644 --- a/MESClassLibrary/DAL/Wms/WmsDAL.cs +++ b/MESClassLibrary/DAL/Wms/WmsDAL.cs @@ -119,6 +119,78 @@ namespace MESClassLibrary.DAL.Injection } } + /// + /// wms 是否已读 + /// + /// + /// + public bool IsReadBoxInWms(string pacakgCode) + { + try + { + string sql = $" select * from tb_Injectionn_Interface where PackageCode='{pacakgCode}' and WmsRead =1"; + DataTable dt = SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, null).Tables[0]; + + return dt.Rows.Count > 0; + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return true; + } + + } + + public bool IsReadBarCodeInWms(string barCode) + { + try + { + string sql = string.Empty; + if (barCode.Contains(".")) + { + sql = $" select * from tb_Injectionn_Interface where BarCode='{barCode}' and WmsRead =1"; + } + else + { + sql = $" select * from tb_Injectionn_Interface where OneBarCode='{barCode}' and WmsRead =1"; + } + + DataTable dt = SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, null).Tables[0]; + + return dt.Rows.Count > 0; + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return true; + } + } + + public bool DelRecordByBox(string boxNo) + { + try + { + string sql = $" select * from tb_Injectionn_Interface where PackageCode='{boxNo}' and WmsRead =1"; + DataTable dt = SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, null).Tables[0]; + + if( dt.Rows.Count > 0) + { + return false; + } + else + { + string sql2 = $"delete from tb_Injectionn_Interface where PackageCode='{boxNo}' and WmsRead =0"; + SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(), CommandType.Text, sql2, null); + return true; + } + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return true; + } + + } #endregion #region 喷涂 diff --git a/PaintingPC/FrmChainDownNew.cs b/PaintingPC/FrmChainDownNew.cs index c4a2f56..2cd31db 100644 --- a/PaintingPC/FrmChainDownNew.cs +++ b/PaintingPC/FrmChainDownNew.cs @@ -237,7 +237,7 @@ namespace PaintingPC #region 执行存储过程操作 1、将上线表Flag改为1;2、插入到下线表中;3、判断是否需要打箱单;4、将pannel8对应标签选中并标记颜色 - SqlParameter[] param=new SqlParameter[5]; + SqlParameter[] param=new SqlParameter[6]; param[0] = new SqlParameter("@barCode", SqlDbType.NVarChar, 50); param[0].Value = barcode; @@ -254,6 +254,8 @@ namespace PaintingPC param[4] = new SqlParameter("@productName", SqlDbType.NVarChar,100); param[4].Value = productName; + param[5] = new SqlParameter("@boxNum", SqlDbType.NVarChar, 100); + param[5].Value = ""; #endregion int res = SqlHelper.ExecuteNonQuery(SqlHelper.SqlConnString, CommandType.StoredProcedure, "ChaimDown", param); diff --git a/PaintingPC/FrmQuality.Designer.cs b/PaintingPC/FrmQuality.Designer.cs index 90fd887..174c97b 100644 --- a/PaintingPC/FrmQuality.Designer.cs +++ b/PaintingPC/FrmQuality.Designer.cs @@ -310,7 +310,7 @@ this.cboxAddColor.Font = new System.Drawing.Font("微软雅黑", 22F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.cboxAddColor.FormattingEnabled = true; this.cboxAddColor.Location = new System.Drawing.Point(324, 31); - this.cboxAddColor.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); + this.cboxAddColor.Margin = new System.Windows.Forms.Padding(4); this.cboxAddColor.Name = "cboxAddColor"; this.cboxAddColor.Size = new System.Drawing.Size(1361, 86); this.cboxAddColor.TabIndex = 0; @@ -322,7 +322,7 @@ this.btnOk.Font = new System.Drawing.Font("宋体", 25.875F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.btnOk.Location = new System.Drawing.Point(2020, 936); this.btnOk.Name = "btnOk"; - this.btnOk.Size = new System.Drawing.Size(536, 175); + this.btnOk.Size = new System.Drawing.Size(536, 225); this.btnOk.TabIndex = 67; this.btnOk.Text = "合 格"; this.btnOk.UseVisualStyleBackColor = false; @@ -332,21 +332,22 @@ // this.btnNok.BackColor = System.Drawing.Color.Yellow; this.btnNok.Font = new System.Drawing.Font("宋体", 25.875F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.btnNok.Location = new System.Drawing.Point(2020, 1265); + this.btnNok.Location = new System.Drawing.Point(2029, 1226); this.btnNok.Name = "btnNok"; - this.btnNok.Size = new System.Drawing.Size(536, 175); + this.btnNok.Size = new System.Drawing.Size(536, 14); this.btnNok.TabIndex = 68; this.btnNok.Text = "不 良"; this.btnNok.UseVisualStyleBackColor = false; + this.btnNok.Visible = false; this.btnNok.Click += new System.EventHandler(this.btnNok_Click); // // btnRepair // this.btnRepair.BackColor = System.Drawing.Color.DodgerBlue; this.btnRepair.Font = new System.Drawing.Font("宋体", 25.875F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.btnRepair.Location = new System.Drawing.Point(2020, 1571); + this.btnRepair.Location = new System.Drawing.Point(2020, 1394); this.btnRepair.Name = "btnRepair"; - this.btnRepair.Size = new System.Drawing.Size(536, 175); + this.btnRepair.Size = new System.Drawing.Size(536, 225); this.btnRepair.TabIndex = 69; this.btnRepair.Text = "返 喷"; this.btnRepair.UseVisualStyleBackColor = false; @@ -356,9 +357,9 @@ // this.btnAbt.BackColor = System.Drawing.Color.OrangeRed; this.btnAbt.Font = new System.Drawing.Font("宋体", 25.875F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.btnAbt.Location = new System.Drawing.Point(2020, 1869); + this.btnAbt.Location = new System.Drawing.Point(2020, 1827); this.btnAbt.Name = "btnAbt"; - this.btnAbt.Size = new System.Drawing.Size(536, 175); + this.btnAbt.Size = new System.Drawing.Size(536, 217); this.btnAbt.TabIndex = 70; this.btnAbt.Text = "报 废"; this.btnAbt.UseVisualStyleBackColor = false; diff --git a/PaintingPC/FrmQuality.cs b/PaintingPC/FrmQuality.cs index 93dbb35..849af38 100644 --- a/PaintingPC/FrmQuality.cs +++ b/PaintingPC/FrmQuality.cs @@ -23,6 +23,7 @@ namespace PaintingPC private static string position = "", reason = ""; private bool _isWmsQuality = false ; + private string _carType = string.Empty; public FrmQuality(bool isWmsQuality) { InitializeComponent(); @@ -551,6 +552,7 @@ namespace PaintingPC { if (!string.IsNullOrWhiteSpace(txtBarCode.Text.Trim())) { + InspectModel model1 = new InspectModel(); model1.barcode = Function.UniteBarCodeToOne(txtBarCode.Text.Trim()); @@ -561,8 +563,19 @@ namespace PaintingPC model1.damnPosition = position; model1.reason = reason; model1.remark3 = paintId; + if (!string.IsNullOrEmpty(_carType)) + { + model1.CarType = _carType; + } + else + { + string paintID = labProPosition.Tag?.ToString(); + string carType = Function.carTypeName(model1.barcode.Substring(0, 10), paintID); + model1.CarType = carType; + } + - if(inspectResult != "合格") + if (inspectResult != "合格") { if (string.IsNullOrWhiteSpace(model1.damnPosition) || string.IsNullOrWhiteSpace(model1.reason)) { @@ -769,7 +782,7 @@ namespace PaintingPC #endregion #region 加载图片 - + try { DataTable dt = Function.SearchInfoByBarCode(barcode); @@ -843,6 +856,7 @@ namespace PaintingPC { lableFP.Text = "存在返喷"; } + _carType = dtInspect.Rows[0]["CarType"].ToString().Trim(); labProductInfo.Text = dtInspect.Rows[0]["productInfo"].ToString().Trim(); //产品信息 //string position1 = dtInspect.Rows[0]["damnPosition"].ToString(); //缺陷位置 //string reason1 = dtInspect.Rows[0]["reason"].ToString(); //原因 @@ -910,7 +924,7 @@ namespace PaintingPC string[] info = Function.GetProductInfo2(barcode).Split(','); labProductInfo.Text = info[0] + "," + info[1]; paintId = info[2]; - + labProPosition.Tag = paintId; labProductInfo.Tag = Function.GetSide(barcode, paintId); labProPosition.Text = labTitle.Text.Trim() + " " + labProductInfo.Tag.ToString().Replace(';', ' '); } @@ -1006,6 +1020,8 @@ namespace PaintingPC reason = ""; lableFP.Text = ""; cboxAddColor.DataSource = null; + + _carType = string.Empty; } public void ClearRadioButton() diff --git a/PaintingPC/Function.cs b/PaintingPC/Function.cs index 7ff6967..5e60388 100644 --- a/PaintingPC/Function.cs +++ b/PaintingPC/Function.cs @@ -1253,24 +1253,52 @@ namespace PaintingPC return res; } -// public static DataTable GetColorByCarType(string carTypeID) -// { -// DataTable res = new DataTable(); -// try -// { -// string sql = @" select * -// from tb_Color -// where ID in ( -// select ColorID from tb_CarTypeColor where CarTypeID = '" + carTypeID + @"' -// ) "; -// res = SqlHelper.GetDataDateTable(SqlHelper.SqlConnString, CommandType.Text, sql, null); -// } -// catch (Exception ex) -// { -// LogHelper.WriteErrLogBase(ex.ToString(), MethodBase.GetCurrentMethod().Name); -// } -// return res; -// } + /// + /// 获得车型 + /// + /// + /// + /// + public static string carTypeName(string stockNo, string paintId) + { + string res = ""; + try + { + string sql = @"SELECT c.CarTypeName FROM dbo.tb_Product p + LEFT OUTER JOIN dbo.tb_CarType c + ON p.CarTypeID=c.ID + where p.PartNo in (select Paint_No from tb_PaintColorInfo where StockNo='" + stockNo + @"'and PaintID='" + paintId + @"')"; + DataTable dt = SqlHelper.GetDataDateTable(SqlHelper.SqlConnString, CommandType.Text, sql, null); + if (dt != null && dt.Rows.Count > 0) + { + res = dt.Rows[0]["CarTypeName"].ToString(); + } + } + catch (Exception ex) + { + LogHelper.WriteErrLogBase(ex.ToString(), MethodBase.GetCurrentMethod().Name); + } + return res; + } + + // public static DataTable GetColorByCarType(string carTypeID) + // { + // DataTable res = new DataTable(); + // try + // { + // string sql = @" select * + // from tb_Color + // where ID in ( + // select ColorID from tb_CarTypeColor where CarTypeID = '" + carTypeID + @"' + // ) "; + // res = SqlHelper.GetDataDateTable(SqlHelper.SqlConnString, CommandType.Text, sql, null); + // } + // catch (Exception ex) + // { + // LogHelper.WriteErrLogBase(ex.ToString(), MethodBase.GetCurrentMethod().Name); + // } + // return res; + // } public static DataTable GetColorByType(string type) { diff --git a/PaintingPC/Model/InspectModel.cs b/PaintingPC/Model/InspectModel.cs index eaf2abb..73588f8 100644 --- a/PaintingPC/Model/InspectModel.cs +++ b/PaintingPC/Model/InspectModel.cs @@ -69,5 +69,10 @@ namespace PaintingPC.Model /// 备注3 /// public string remark3 { get; set; } + + /// + /// 车型 + /// + public string CarType { get; set; } } } diff --git a/WebService/Function.cs b/WebService/Function.cs index 7f666cb..bdc0b7c 100644 --- a/WebService/Function.cs +++ b/WebService/Function.cs @@ -12,6 +12,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Converters; using Tools; using WebService.Model; +using System.Data.SqlClient; namespace Webservice { @@ -861,7 +862,7 @@ namespace Webservice /// /// /// - public static string WMSSpraying(string barcode, int isPass, string stcokNo, string partNo, string batchNo) + public static string WMSSpraying(string barcode, int isPass, string stcokNo, string partNo, string batchNo,ref string colorName,ref string productName,ref string carType ) { JsonModel model = new JsonModel(); model.Result = "0"; @@ -965,7 +966,7 @@ namespace Webservice string msg = string.Empty; - if(AllowSendToWms(barcode,isPass, ref repaint,ref msg,ref lu_code) == false) + if(AllowSendToWms(barcode,isPass, ref repaint,ref msg,ref lu_code, ref colorName, ref productName, ref carType) == false) { model.Result = "0"; model.ResultType = "Result"; @@ -1126,16 +1127,20 @@ namespace Webservice /// /// 0-不合格;1-合格 /// - static bool AllowSendToWms(string oneBarCode, int state,ref int pRepaint,ref string errorMssg ,ref string paintColor) + static bool AllowSendToWms(string oneBarCode, int state, + ref int pRepaint,ref string errorMssg ,ref string paintColor, ref string colorName, ref string productName,ref string carType) { if (string.IsNullOrEmpty(oneBarCode)) return false; - DataTable inspectTable = GetInspectResultTable($"barcode='{oneBarCode}'",ref paintColor); + DataTable inspectTable = GetInspectResultTable($"{oneBarCode}",ref paintColor); if (inspectTable.Rows.Count == 0) { errorMssg = "没有进行质量判定,不能入库"; return false; } + colorName = inspectTable.Rows[0]["remark1"].ToString(); + productName = inspectTable.Rows[0]["remark2"].ToString(); + carType = inspectTable.Rows[0]["CarType"].ToString(); paintColor = GetPaintLU(oneBarCode.Substring(0, 10), inspectTable.Rows[0]["remark1"].ToString()); int rePaint = 0; //0:未返喷,1:喷涂线边判断返喷 2:物流仓库判定返喷 @@ -1202,7 +1207,7 @@ namespace Webservice return true; } - + /// /// 将二维码转换成相应一维码 /// @@ -2305,7 +2310,41 @@ namespace Webservice return res; } } + public static string SaveLineDownInfo(string barcode,string cartype,string color,string productName) + { + try + { + #region 执行存储过程操作 1、将上线表Flag改为1;2、插入到下线表中;3、判断是否需要打箱单;4、将pannel8对应标签选中并标记颜色 + + SqlParameter[] param = new SqlParameter[5]; + + param[0] = new SqlParameter("@barCode", SqlDbType.NVarChar, 50); + param[0].Value = barcode; + + param[1] = new SqlParameter("@carType", SqlDbType.NVarChar, 50); + param[1].Value = cartype; + + param[2] = new SqlParameter("@color", SqlDbType.NVarChar, 50); + param[2].Value = color; + + param[3] = new SqlParameter("@flag", SqlDbType.Int); + param[3].Value = 1; + param[4] = new SqlParameter("@productName", SqlDbType.NVarChar, 100); + param[4].Value = productName; + + #endregion + + int res = SqlHelper.ExecuteNonQuery(SqlHelper.SqlConnString, CommandType.StoredProcedure, "ChaimDown", param); + + + return null; + } + catch(Exception ex) + { + return ex.Message; + } + } #endregion #region TruckBox diff --git a/WebService/WMSWebService.asmx.cs b/WebService/WMSWebService.asmx.cs index 742ab0b..bc2dbc6 100644 --- a/WebService/WMSWebService.asmx.cs +++ b/WebService/WMSWebService.asmx.cs @@ -57,6 +57,9 @@ namespace Webservice string stcokNo = ""; string batchNo = ""; string partNo = ""; + string colorName = string.Empty; + string productName = string.Empty; + string carType = string.Empty; Function.GetCode(barcode, out stcokNo, out batchNo, out partNo); if (string.IsNullOrWhiteSpace(stcokNo) && string.IsNullOrWhiteSpace(partNo)) { @@ -69,7 +72,7 @@ namespace Webservice //string res = Function.WMSSpraying("60000000562010090015", 1, "6000000056", "86511-BU020RBC", "210721"); - string res = Function.WMSSpraying(barcode, 1, stcokNo, partNo, batchNo); + string res = Function.WMSSpraying(barcode, 1, stcokNo, partNo, batchNo,ref colorName,ref productName,ref carType); LogHelper.WriteSysLogBase("WMS接口:条码:" + barcode + ",MES返回结果:" + res, MethodBase.GetCurrentMethod().Name); @@ -91,7 +94,6 @@ namespace Webservice errorReason = ""; //return true; - #region 参数判断 if (string.IsNullOrWhiteSpace(barcode)) { //model.ErrReason = "条码号不能为空"; @@ -99,43 +101,100 @@ namespace Webservice errorReason = "条码号不能为空"; return false; } - + bool sendRst = true; string stcokNo = ""; string batchNo = ""; string partNo = ""; - Function.GetCode(barcode, out stcokNo, out batchNo, out partNo); - if (string.IsNullOrWhiteSpace(stcokNo) && string.IsNullOrWhiteSpace(partNo)) + string colorName = string.Empty; + string productName = string.Empty; + string carType = string.Empty; + try { - //model.ErrReason = "条码号无效,请检查条码是否破损缺失"; - //Context.Response.Write(JSONTools.ScriptSerialize>(model)); - errorReason = "条码号无效,请检查条码是否破损缺失"; + sendRst = SendToWmsService(barcode, ref stcokNo, ref batchNo, ref partNo, ref colorName, ref productName, ref carType); + errorReason = ""; + return sendRst; + } + catch (Exception ex) + { + errorReason = ex.Message; + LogHelper.WriteSysLogBase("【WMS报废调入MES接口】条码:" + barcode + ",报错:" + errorReason, MethodBase.GetCurrentMethod().Name); return false; } + } + /// + /// 喷涂下线 + /// + /// + /// + [WebMethod] + public string PaintLineDown(string barCode) + { + bool sendRst = true; + string colorName = string.Empty; + string productName = string.Empty; + string carType = string.Empty; + + string stcokNo = string.Empty; + string batchNo = string.Empty; + string partNo = string.Empty; + try + { + sendRst = SendToWmsService(barCode,ref stcokNo,ref batchNo,ref partNo,ref colorName,ref productName,ref carType); + + if(sendRst == true) + { + Function.SaveLineDownInfo(barCode, carType, colorName, productName); + if (Session["LastBarCode"] != null) + { + Function.SaveLineDownInfo(Session["LastBarCode"].ToString(), Session["LastCarType"].ToString(), Session["LastColorName"].ToString(), Session["LastProductName"].ToString()); + } + Session["LastBarCode"] = barCode; + Session["LastCarType"] = carType; + Session["LastColorName"] = colorName; + Session["LastProductName"] = productName; + return "操作成功!"; + } + else + { + return "发送到WMS接口失败,请重新操作."; + } + } + catch(Exception ex) + { + return ex.Message; + } - #endregion - - string res = Function.WMSSpraying(barcode, isOK, stcokNo, partNo, batchNo); - JsonModel model = JSONTools.ScriptDeserialize>(res); - - LogHelper.WriteSysLogBase("【WMS报废调入MES接口】条码:" + barcode + ",出参:" + res, MethodBase.GetCurrentMethod().Name); + } + bool SendToWmsService(string barCode, ref string stcokNo, ref string batchNo, ref string partNo, ref string colorName, ref string productName, ref string carType) + { + string errorMsg = string.Empty; + string errorReason = ""; + //return true; - if (model.Result == "1") - { - errorReason = ""; - return true; + #region 参数判断 + if (string.IsNullOrWhiteSpace(barCode)) + { + throw new Exception ("条码号不能为空"); } - else + Function.GetCode(barCode, out stcokNo, out batchNo, out partNo); + if (string.IsNullOrWhiteSpace(stcokNo) && string.IsNullOrWhiteSpace(partNo)) { - errorReason = model.ErrReason; + throw new Exception("条码号无效,请检查条码是否破损缺失"); + } - LogHelper.WriteSysLogBase("【WMS报废调入MES接口】条码:" + barcode + ",报错:" + errorReason, MethodBase.GetCurrentMethod().Name); - return false; + #endregion + + string res = Function.WMSSpraying(barCode, 1, stcokNo, partNo, batchNo, ref colorName, ref productName, ref carType); + JsonModel model = JSONTools.ScriptDeserialize>(res); + + if (model.Result == "0") + { + throw new Exception(model.ErrReason); } - //Context.Response.Write(res); + return true; } - /// /// 当WMS调拨入库时,即报废的产品再次入库,WMS传入条码,MES记录入库 ///