Browse Source

注塑质检报废

master
ruoxing.wang 2 weeks ago
parent
commit
65df1122dc
  1. 90
      FacOneZPStation/FrmZP.Designer.cs
  2. 428
      InjectionPC/FrmMain.Designer.cs
  3. 17
      InjectionPC/FrmMain2408.Designer.cs
  4. 62
      InjectionPC/FrmMain2408.cs
  5. 15
      InjectionPC/FrmMain2411.Designer.cs
  6. 65
      InjectionPC/FrmMain2411.cs
  7. 171
      InjectionPC/FrmQuality.cs
  8. 133
      MESClassLibrary/BLL/BasicInfo/BadInjectionBLL.cs
  9. 21
      MESClassLibrary/BLL/BasicInfo/BarCodeBLL.cs
  10. 5
      MESClassLibrary/BLL/Inspection/InjectionBoxBLL.cs
  11. 32
      MESClassLibrary/BLL/Wms/WmsBLL.cs
  12. 10
      MESClassLibrary/DAL/BasicInfo/BadInjectionDAL.cs
  13. 40
      MESClassLibrary/DAL/BasicInfo/BarCodeDAl.cs
  14. 33
      MESClassLibrary/DAL/Injection/InjectionBoxDAL.cs
  15. 49
      MESClassLibrary/DAL/Wms/WmsDAL.cs
  16. 1
      MESClassLibrary/Model/BadInjectionModel.cs

90
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, 653F));
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 659F));
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(1693, 12);
this.button6.Location = new System.Drawing.Point(1687, 12);
this.button6.Margin = new System.Windows.Forms.Padding(13, 12, 13, 12);
this.button6.Name = "button6";
this.button6.Size = new System.Drawing.Size(629, 161);
this.button6.Size = new System.Drawing.Size(635, 161);
this.button6.TabIndex = 7;
this.button6.Text = "手动打印箱单";
this.button6.UseVisualStyleBackColor = false;
@ -119,7 +119,7 @@
this.button1.Location = new System.Drawing.Point(6, 190);
this.button1.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(551, 176);
this.button1.Size = new System.Drawing.Size(549, 176);
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(1141, 197);
this.button5.Location = new System.Drawing.Point(1137, 197);
this.button5.Margin = new System.Windows.Forms.Padding(13, 12, 13, 12);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(526, 162);
this.button5.Size = new System.Drawing.Size(524, 162);
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(569, 5);
this.button4.Location = new System.Drawing.Point(567, 5);
this.button4.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(553, 175);
this.button4.Size = new System.Drawing.Size(551, 175);
this.button4.TabIndex = 4;
this.button4.Text = "下一计划";
this.button4.UseVisualStyleBackColor = false;
@ -162,7 +162,7 @@
this.button3.Location = new System.Drawing.Point(6, 5);
this.button3.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(551, 175);
this.button3.Size = new System.Drawing.Size(549, 175);
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(576, 197);
this.button2.Location = new System.Drawing.Point(574, 197);
this.button2.Margin = new System.Windows.Forms.Padding(13, 12, 13, 12);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(539, 162);
this.button2.Size = new System.Drawing.Size(537, 162);
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(1686, 190);
this.button7.Location = new System.Drawing.Point(1680, 190);
this.button7.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5);
this.button7.Name = "button7";
this.button7.Size = new System.Drawing.Size(643, 176);
this.button7.Size = new System.Drawing.Size(649, 176);
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(1386, 3);
this.label7.Location = new System.Drawing.Point(1378, 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(400, 111);
this.textBox2.Location = new System.Drawing.Point(397, 111);
this.textBox2.Margin = new System.Windows.Forms.Padding(4);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(979, 77);
this.textBox2.Size = new System.Drawing.Size(974, 77);
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, 107);
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(386, 109);
this.label3.Size = new System.Drawing.Size(383, 109);
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(1640, 219);
this.labOrderNo.Location = new System.Drawing.Point(1632, 219);
this.labOrderNo.Margin = new System.Windows.Forms.Padding(2);
this.labOrderNo.Name = "labOrderNo";
this.labOrderNo.Size = new System.Drawing.Size(696, 152);
this.labOrderNo.Size = new System.Drawing.Size(704, 152);
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(1386, 219);
this.label4.Location = new System.Drawing.Point(1378, 219);
this.label4.Margin = new System.Windows.Forms.Padding(2);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(249, 152);
@ -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(398, 219);
this.labStationNo.Location = new System.Drawing.Point(395, 219);
this.labStationNo.Margin = new System.Windows.Forms.Padding(2);
this.labStationNo.Name = "labStationNo";
this.labStationNo.Size = new System.Drawing.Size(983, 152);
this.labStationNo.Size = new System.Drawing.Size(978, 152);
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, 219);
this.label2.Margin = new System.Windows.Forms.Padding(2);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(390, 152);
this.label2.Size = new System.Drawing.Size(387, 152);
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(1640, 376);
this.labPName.Location = new System.Drawing.Point(1632, 376);
this.labPName.Margin = new System.Windows.Forms.Padding(2);
this.labPName.Name = "labPName";
this.labPName.Size = new System.Drawing.Size(696, 249);
this.labPName.Size = new System.Drawing.Size(704, 249);
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(1386, 376);
this.label8.Location = new System.Drawing.Point(1378, 376);
this.label8.Margin = new System.Windows.Forms.Padding(2);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(249, 249);
@ -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(398, 376);
this.labPartNo.Location = new System.Drawing.Point(395, 376);
this.labPartNo.Margin = new System.Windows.Forms.Padding(2);
this.labPartNo.Name = "labPartNo";
this.labPartNo.Size = new System.Drawing.Size(983, 249);
this.labPartNo.Size = new System.Drawing.Size(978, 249);
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, 376);
this.label6.Margin = new System.Windows.Forms.Padding(2);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(390, 249);
this.label6.Size = new System.Drawing.Size(387, 249);
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(1640, 630);
this.labBadCount.Location = new System.Drawing.Point(1632, 630);
this.labBadCount.Margin = new System.Windows.Forms.Padding(2);
this.labBadCount.Name = "labBadCount";
this.labBadCount.Size = new System.Drawing.Size(696, 449);
this.labBadCount.Size = new System.Drawing.Size(704, 449);
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(398, 630);
this.labNum.Location = new System.Drawing.Point(395, 630);
this.labNum.Margin = new System.Windows.Forms.Padding(2);
this.labNum.Name = "labNum";
this.labNum.Size = new System.Drawing.Size(983, 449);
this.labNum.Size = new System.Drawing.Size(978, 449);
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, 630);
this.label10.Margin = new System.Windows.Forms.Padding(2);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(390, 449);
this.label10.Size = new System.Drawing.Size(387, 449);
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(386, 105);
this.label14.Size = new System.Drawing.Size(383, 105);
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(400, 5);
this.textBox1.Location = new System.Drawing.Point(397, 5);
this.textBox1.Margin = new System.Windows.Forms.Padding(4);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(979, 77);
this.textBox1.Size = new System.Drawing.Size(974, 77);
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(1642, 1);
this.labErrMessage.Location = new System.Drawing.Point(1634, 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(692, 215);
this.labErrMessage.Size = new System.Drawing.Size(700, 215);
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, 253F));
this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 699F));
this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 707F));
this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 37F));
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(1386, 630);
this.label12.Location = new System.Drawing.Point(1378, 630);
this.label12.Margin = new System.Windows.Forms.Padding(2);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(249, 449);
@ -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(1798, 0);
this.labTime.Location = new System.Drawing.Point(1794, 0);
this.labTime.Margin = new System.Windows.Forms.Padding(0);
this.labTime.Name = "labTime";
this.labTime.Size = new System.Drawing.Size(549, 130);
this.labTime.Size = new System.Drawing.Size(553, 130);
this.labTime.TabIndex = 7;
this.labTime.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.labTime.Click += new System.EventHandler(this.labTime_Click);
@ -521,7 +521,7 @@
this.label1.Location = new System.Drawing.Point(325, 0);
this.label1.Margin = new System.Windows.Forms.Padding(0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(1473, 130);
this.label1.Size = new System.Drawing.Size(1469, 130);
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, 548F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 552F));
this.tableLayoutPanel2.Controls.Add(this.labTime, 2, 0);
this.tableLayoutPanel2.Controls.Add(this.pictureBox1, 0, 0);
this.tableLayoutPanel2.Controls.Add(this.label1, 1, 0);

428
InjectionPC/FrmMain.Designer.cs

File diff suppressed because it is too large

17
InjectionPC/FrmMain2408.Designer.cs

@ -140,6 +140,7 @@
this.panel2 = new System.Windows.Forms.Panel();
this.panel4 = new System.Windows.Forms.Panel();
this.panel6 = new System.Windows.Forms.Panel();
this.btnOnlyBarCode = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.panel5 = new System.Windows.Forms.Panel();
this.label2 = new System.Windows.Forms.Label();
@ -1562,6 +1563,7 @@
//
// panel6
//
this.panel6.Controls.Add(this.btnOnlyBarCode);
this.panel6.Controls.Add(this.label1);
this.panel6.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel6.Location = new System.Drawing.Point(0, 0);
@ -1570,6 +1572,18 @@
this.panel6.Size = new System.Drawing.Size(1684, 147);
this.panel6.TabIndex = 1;
//
// btnOnlyBarCode
//
this.btnOnlyBarCode.BackColor = System.Drawing.Color.DeepSkyBlue;
this.btnOnlyBarCode.Font = new System.Drawing.Font("宋体", 14.14286F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOnlyBarCode.Location = new System.Drawing.Point(1467, 0);
this.btnOnlyBarCode.Name = "btnOnlyBarCode";
this.btnOnlyBarCode.Size = new System.Drawing.Size(217, 143);
this.btnOnlyBarCode.TabIndex = 1;
this.btnOnlyBarCode.Text = "条码模式";
this.btnOnlyBarCode.UseVisualStyleBackColor = false;
this.btnOnlyBarCode.Click += new System.EventHandler(this.btnOnlyBarCode_Click);
//
// label1
//
this.label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
@ -1580,7 +1594,7 @@
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(1684, 147);
this.label1.TabIndex = 0;
this.label1.Text = "注塑车间条码打印";
this.label1.Text = "注塑车间箱码条码打印";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// panel5
@ -1865,5 +1879,6 @@
private System.Windows.Forms.Button btnChangeSizeL;
private System.Windows.Forms.Panel panel49;
private System.Windows.Forms.Button btnChangeSizeR;
private System.Windows.Forms.Button btnOnlyBarCode;
}
}

62
InjectionPC/FrmMain2408.cs

@ -595,7 +595,7 @@ namespace InjectionPC
// Program.ProductDate.Substring(8, 2) + "#" + "001"+"#";
//}
GetSupplyCode(partNo[j].ToString().Trim(), QLevel, true, mould, PartName, ref newcode);
GetSupplyCode(stockNo[j].ToString().Trim(), partNo[j].ToString().Trim(), QLevel, true, mould, PartName, ref NewOneCode, ref newcode);
}
#endregion
@ -611,7 +611,7 @@ namespace InjectionPC
md.PrintType = 0;
md.PlanID = planID;
md.ProductNature = ProductNature;
md.Des1 = PartName;
//DataTable pdt = productBll.SearchIsImportByPartNo(partNo[j].ToString());
//if (pdt != null && pdt.Rows.Count > 0)
//{
@ -632,7 +632,7 @@ namespace InjectionPC
for (int l = 0; l < 5; l++)
{
// if (brbll.Add_Info_New(md, Program.tableName))
if (SaveBarCode(md, Program.tableName, true, mould) == false)
if (SaveBarCode(md, Program.tableName, true, mould) == true)
{
break;
}
@ -786,7 +786,7 @@ namespace InjectionPC
// Program.ProductDate.Substring(8, 2) + "#" + "001" + "#";
//}
GetSupplyCode(partNo[j].ToString().Trim(), QLevel, true, mould, PartName, ref newcode);
GetSupplyCode(stockNo[j].ToString().Trim(), partNo[j].ToString().Trim(), QLevel, true, mould, PartName, ref NewOneCode, ref newcode);
#endregion
}
@ -801,7 +801,7 @@ namespace InjectionPC
md.PrintType = 0;
md.PlanID = planID;
md.ProductNature = ProductNature;
md.Des1 = PartName;
DataTable pdt = productBll.SearchIsImportByPartNo(partNo[j].ToString());
if (pdt != null && pdt.Rows.Count > 0)
{
@ -822,7 +822,7 @@ namespace InjectionPC
for (int l = 0; l < 5; l++)
{
//if (brbll.Add_Info_New(md, Program.tableName))
if (SaveBarCode(md, Program.tableName, true, mould) == false)
if (SaveBarCode(md, Program.tableName, true, mould) == true)
{
break;
}
@ -1074,7 +1074,7 @@ namespace InjectionPC
// Program.ProductDate.Substring(8, 2) + "#" + "001" + "#";
//}
GetSupplyCode(partNo[j].ToString().Trim(), QLevel, true, mould, PartName, ref newcode);
GetSupplyCode(stockNo[j].ToString().Trim(), partNo[j].ToString().Trim(), QLevel, true, mould, PartName, ref NewOneCode, ref newcode);
}
catch (Exception ex)
{
@ -1097,7 +1097,7 @@ namespace InjectionPC
md.PrintType = 0;
md.PlanID = planID;
md.ProductNature = ProductNature;
md.Des1 = PartName;
DataTable pdt = productBll.SearchIsImportByPartNo(partNo[j].ToString());
if (pdt != null && pdt.Rows.Count > 0)
{
@ -1118,7 +1118,7 @@ namespace InjectionPC
for (int l = 0; l < 5; l++)
{
//if (brbll.Add_Info_New(md, Program.tableName))
if (SaveBarCode(md, Program.tableName, true, mould) == false)
if (SaveBarCode(md, Program.tableName, true, mould) == true)
{
break;
}
@ -1289,7 +1289,7 @@ namespace InjectionPC
// Program.ProductDate.Substring(8, 2) + "#" + "001" + "#";
//}
GetSupplyCode(partNo[j].ToString().Trim(), QLevel, true, mould, PartName, ref newcode);
GetSupplyCode(stockNo[j].ToString().Trim(), partNo[j].ToString().Trim(), QLevel, true, mould, PartName, ref NewOneCode, ref newcode);
}
catch (Exception ex)
{
@ -1312,7 +1312,7 @@ namespace InjectionPC
md.PrintType = 0;
md.PlanID = planID;
md.ProductNature = ProductNature;
md.Des1 = PartName;
DataTable pdt = productBll.SearchIsImportByPartNo(partNo[j].ToString());
if (pdt != null && pdt.Rows.Count > 0)
{
@ -1333,7 +1333,7 @@ namespace InjectionPC
for (int l = 0; l < 5; l++)
{
//if (brbll.Add_Info_New(md, Program.tableName))
if (SaveBarCode(md, Program.tableName, true, mould) == false)
if (SaveBarCode(md, Program.tableName, true, mould) == true)
{
break;
}
@ -1599,7 +1599,7 @@ namespace InjectionPC
md.PrintType = 0;
md.PlanID = planID;
md.ProductNature = ProductNature;
md.Des1 = PartName;
DataTable pdt = productBll.SearchIsImportByPartNo(partNo[j].ToString());
if (pdt != null && pdt.Rows.Count > 0)
{
@ -1620,7 +1620,7 @@ namespace InjectionPC
for (int l = 0; l < 5; l++)
{
//if (brbll.Add_Info_New(md, Program.tableName))
if (SaveBarCode(md, Program.tableName, true, same[j].ToString()) == false)
if (SaveBarCode(md, Program.tableName, true, same[j].ToString()) == true)
{
break;
}
@ -1826,7 +1826,7 @@ namespace InjectionPC
md.PrintType = 0;
md.PlanID = planID;
md.ProductNature = ProductNature;
md.Des1 = PartName;
DataTable pdt = productBll.SearchIsImportByPartNo(partNo[j].ToString());
if (pdt != null && pdt.Rows.Count > 0)
{
@ -1847,7 +1847,7 @@ namespace InjectionPC
for (int l = 0; l < 5; l++)
{
//if (brbll.Add_Info_New(md, Program.tableName))
if (SaveBarCode(md, Program.tableName, true, same[j].ToString()) == false)
if (SaveBarCode(md, Program.tableName, true, same[j].ToString()) == true)
{
break;
}
@ -2452,7 +2452,7 @@ namespace InjectionPC
md.PlanID = planID;
md.ProductNature = "正常件"; //第一次没有这个
md.Des1 = PartName;
DataTable dt2 = pbll.SearchIsImportByPartNo(partNo);
if (dt2 != null && dt2.Rows.Count > 0)
{
@ -2709,7 +2709,7 @@ namespace InjectionPC
// (Convert.ToInt32(code.Substring(23, 3)) +
// i).ToString()
// .PadLeft(3, '0') + "#";
GetSupplyCode(partNo, QLevel,false, "0", PartName, ref newcode);
GetSupplyCode(stockNo, partNo, QLevel,false, "0", PartName, ref NewOneCode, ref newcode);
#region 插入数据tb_barCode
@ -3807,7 +3807,7 @@ namespace InjectionPC
md.PrintType = 0;
md.PlanID = planID;
md.ProductNature = ProductNature;
md.Des1 = PartName;
DataTable pdt = productBll.SearchIsImportByPartNo(partNo[j].ToString());
if (pdt != null && pdt.Rows.Count > 0)
{
@ -3878,7 +3878,7 @@ namespace InjectionPC
md.PrintType = 0;
md.PlanID = planID;
md.ProductNature = ProductNature;
md.Des1 = PartName;
DataTable pdt = productBll.SearchIsImportByPartNo(partNo[j].ToString());
if (pdt != null && pdt.Rows.Count > 0)
{
@ -4571,7 +4571,7 @@ namespace InjectionPC
/// <param name="partNo"></param>
/// <param name="qLevel"></param>
/// <param name="newCode"></param>
void GetSupplyCode(string partNo,string qLevel, bool autoPrint,string mould,string partName, ref string newCode)
void GetSupplyCode(string stockNo, string partNo,string qLevel, bool autoPrint,string mould,string partName, ref string newOneCode, ref string newCode)
{
string batch = string.Empty;
if (autoPrint)
@ -4583,6 +4583,7 @@ namespace InjectionPC
batch = textBox1.Text.Trim();
}
newCode = _uniqueBll.GetSupplySerialNo(partNo, qLevel, batch);
newOneCode = _uniqueBll.GetSjBarCodeSerialNo(stockNo, batch);
CheckPackageCode(partNo, autoPrint, mould, partName);
}
@ -4814,6 +4815,25 @@ namespace InjectionPC
frm.ShowDialog();
}
private void btnOnlyBarCode_Click(object sender, EventArgs e)
{
if (MessageBox.Show("确定切换为单条码模式?", "切换确认", MessageBoxButtons.OKCancel) == DialogResult.Cancel) return;
try
{
this.FormClosed += (arg1, arg2) => {
FrmMain2411 frm = new FrmMain2411();
frm.Show();
};
this.Close();
}
catch(Exception ex)
{
}
}
string PrintMoudleName()

15
InjectionPC/FrmMain2411.Designer.cs

@ -115,6 +115,7 @@
this.panel2 = new System.Windows.Forms.Panel();
this.panel4 = new System.Windows.Forms.Panel();
this.panel6 = new System.Windows.Forms.Panel();
this.btnBarCodeWithBox = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.panel5 = new System.Windows.Forms.Panel();
this.label2 = new System.Windows.Forms.Label();
@ -1184,6 +1185,7 @@
//
// panel6
//
this.panel6.Controls.Add(this.btnBarCodeWithBox);
this.panel6.Controls.Add(this.label1);
this.panel6.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel6.Location = new System.Drawing.Point(0, 0);
@ -1192,6 +1194,18 @@
this.panel6.Size = new System.Drawing.Size(1684, 147);
this.panel6.TabIndex = 1;
//
// btnBarCodeWithBox
//
this.btnBarCodeWithBox.BackColor = System.Drawing.Color.DeepSkyBlue;
this.btnBarCodeWithBox.Font = new System.Drawing.Font("宋体", 14.14286F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnBarCodeWithBox.Location = new System.Drawing.Point(1464, 1);
this.btnBarCodeWithBox.Name = "btnBarCodeWithBox";
this.btnBarCodeWithBox.Size = new System.Drawing.Size(217, 143);
this.btnBarCodeWithBox.TabIndex = 2;
this.btnBarCodeWithBox.Text = "箱码模式";
this.btnBarCodeWithBox.UseVisualStyleBackColor = false;
this.btnBarCodeWithBox.Click += new System.EventHandler(this.btnBarCodeWithBox_Click);
//
// label1
//
this.label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
@ -1450,5 +1464,6 @@
private System.Windows.Forms.Label label16;
private System.Windows.Forms.Label label35;
private System.Windows.Forms.Label label39;
private System.Windows.Forms.Button btnBarCodeWithBox;
}
}

65
InjectionPC/FrmMain2411.cs

@ -364,6 +364,7 @@ namespace InjectionPC
if (status == false)
{
MessageBox.Show("连接服务器失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
@ -539,7 +540,7 @@ namespace InjectionPC
// Program.ProductDate.Substring(8, 2) + "#" + "001"+"#";
//}
GetSupplyCode(partNo[j].ToString().Trim(), QLevel, true, mould, PartName, ref newcode);
GetSupplyCode(stockNo[j].ToString().Trim(), partNo[j].ToString().Trim(), QLevel, true, mould, PartName, ref NewOneCode, ref newcode);
}
#endregion
@ -555,7 +556,7 @@ namespace InjectionPC
md.PrintType = 0;
md.PlanID = planID;
md.ProductNature = ProductNature;
md.Des1 = PartName;
//DataTable pdt = productBll.SearchIsImportByPartNo(partNo[j].ToString());
//if (pdt != null && pdt.Rows.Count > 0)
//{
@ -576,7 +577,7 @@ namespace InjectionPC
for (int l = 0; l < 5; l++)
{
// if (brbll.Add_Info_New(md, Program.tableName))
if (SaveBarCode(md, Program.tableName, true, mould) == false)
if (SaveBarCode(md, Program.tableName, true, mould) == true)
{
break;
}
@ -730,7 +731,7 @@ namespace InjectionPC
// Program.ProductDate.Substring(8, 2) + "#" + "001" + "#";
//}
GetSupplyCode(partNo[j].ToString().Trim(), QLevel, true, mould, PartName, ref newcode);
GetSupplyCode(stockNo[j].ToString().Trim(), partNo[j].ToString().Trim(), QLevel, true, mould, PartName, ref NewOneCode, ref newcode);
#endregion
}
@ -745,7 +746,7 @@ namespace InjectionPC
md.PrintType = 0;
md.PlanID = planID;
md.ProductNature = ProductNature;
md.Des1 = PartName;
DataTable pdt = productBll.SearchIsImportByPartNo(partNo[j].ToString());
if (pdt != null && pdt.Rows.Count > 0)
{
@ -766,7 +767,7 @@ namespace InjectionPC
for (int l = 0; l < 5; l++)
{
//if (brbll.Add_Info_New(md, Program.tableName))
if (SaveBarCode(md, Program.tableName, true, mould) == false)
if (SaveBarCode(md, Program.tableName, true, mould) == true)
{
break;
}
@ -1018,7 +1019,7 @@ namespace InjectionPC
// Program.ProductDate.Substring(8, 2) + "#" + "001" + "#";
//}
GetSupplyCode(partNo[j].ToString().Trim(), QLevel, true, mould, PartName, ref newcode);
GetSupplyCode(stockNo[j].ToString().Trim(), partNo[j].ToString().Trim(), QLevel, true, mould, PartName, ref NewOneCode, ref newcode);
}
catch (Exception ex)
{
@ -1041,7 +1042,7 @@ namespace InjectionPC
md.PrintType = 0;
md.PlanID = planID;
md.ProductNature = ProductNature;
md.Des1 = PartName;
DataTable pdt = productBll.SearchIsImportByPartNo(partNo[j].ToString());
if (pdt != null && pdt.Rows.Count > 0)
{
@ -1062,7 +1063,7 @@ namespace InjectionPC
for (int l = 0; l < 5; l++)
{
//if (brbll.Add_Info_New(md, Program.tableName))
if (SaveBarCode(md, Program.tableName, true, mould) == false)
if (SaveBarCode(md, Program.tableName, true, mould) == true)
{
break;
}
@ -1233,7 +1234,7 @@ namespace InjectionPC
// Program.ProductDate.Substring(8, 2) + "#" + "001" + "#";
//}
GetSupplyCode(partNo[j].ToString().Trim(), QLevel, true, mould, PartName, ref newcode);
GetSupplyCode(stockNo[j].ToString().Trim(), partNo[j].ToString().Trim(), QLevel, true, mould, PartName, ref NewOneCode, ref newcode);
}
catch (Exception ex)
{
@ -1256,7 +1257,7 @@ namespace InjectionPC
md.PrintType = 0;
md.PlanID = planID;
md.ProductNature = ProductNature;
md.Des1 = PartName;
DataTable pdt = productBll.SearchIsImportByPartNo(partNo[j].ToString());
if (pdt != null && pdt.Rows.Count > 0)
{
@ -1277,7 +1278,7 @@ namespace InjectionPC
for (int l = 0; l < 5; l++)
{
//if (brbll.Add_Info_New(md, Program.tableName))
if (SaveBarCode(md, Program.tableName, true, mould) == false)
if (SaveBarCode(md, Program.tableName, true, mould) == true)
{
break;
}
@ -1543,7 +1544,7 @@ namespace InjectionPC
md.PrintType = 0;
md.PlanID = planID;
md.ProductNature = ProductNature;
md.Des1 = PartName;
DataTable pdt = productBll.SearchIsImportByPartNo(partNo[j].ToString());
if (pdt != null && pdt.Rows.Count > 0)
{
@ -1564,7 +1565,7 @@ namespace InjectionPC
for (int l = 0; l < 5; l++)
{
//if (brbll.Add_Info_New(md, Program.tableName))
if (SaveBarCode(md, Program.tableName, true, same[j].ToString()) == false)
if (SaveBarCode(md, Program.tableName, true, same[j].ToString()) == true)
{
break;
}
@ -1770,7 +1771,7 @@ namespace InjectionPC
md.PrintType = 0;
md.PlanID = planID;
md.ProductNature = ProductNature;
md.Des1 = PartName;
DataTable pdt = productBll.SearchIsImportByPartNo(partNo[j].ToString());
if (pdt != null && pdt.Rows.Count > 0)
{
@ -1791,7 +1792,7 @@ namespace InjectionPC
for (int l = 0; l < 5; l++)
{
//if (brbll.Add_Info_New(md, Program.tableName))
if (SaveBarCode(md, Program.tableName, true, same[j].ToString()) == false)
if (SaveBarCode(md, Program.tableName, true, same[j].ToString()) == true)
{
break;
}
@ -2395,7 +2396,7 @@ namespace InjectionPC
md.PlanID = planID;
md.ProductNature = "正常件"; //第一次没有这个
md.Des1 = PartName;
DataTable dt2 = pbll.SearchIsImportByPartNo(partNo);
if (dt2 != null && dt2.Rows.Count > 0)
{
@ -2652,7 +2653,7 @@ namespace InjectionPC
// (Convert.ToInt32(code.Substring(23, 3)) +
// i).ToString()
// .PadLeft(3, '0') + "#";
GetSupplyCode(partNo, QLevel,false, "0", PartName, ref newcode);
GetSupplyCode(stockNo,partNo, QLevel,false, "0", PartName, ref NewOneCode, ref newcode);
#region 插入数据tb_barCode
@ -2664,7 +2665,7 @@ namespace InjectionPC
md.PartNo = partNo;
md.PrintType = 1;
md.PlanID = planID;
md.Des1 = PartName;
DataTable dt2 = pbll.SearchIsImportByPartNo(partNo);
if (dt2 != null && dt2.Rows.Count > 0)
{
@ -3725,7 +3726,7 @@ namespace InjectionPC
md.PrintType = 0;
md.PlanID = planID;
md.ProductNature = ProductNature;
md.Des1 = PartName;
DataTable pdt = productBll.SearchIsImportByPartNo(partNo[j].ToString());
if (pdt != null && pdt.Rows.Count > 0)
{
@ -3796,7 +3797,7 @@ namespace InjectionPC
md.PrintType = 0;
md.PlanID = planID;
md.ProductNature = ProductNature;
md.Des1 = PartName;
DataTable pdt = productBll.SearchIsImportByPartNo(partNo[j].ToString());
if (pdt != null && pdt.Rows.Count > 0)
{
@ -4062,7 +4063,7 @@ namespace InjectionPC
bool SaveBarCode(BarCodeModel bcm,string tableName, bool isAutoPrint,string mould,bool handPrint = false)
{
string rst = _wmsBll.SaveRecordAndInterface(bcm, Program.tableName);
string rst = _wmsBll.SaveRecordAndInterface(bcm, Program.tableName,"");
if (string.IsNullOrEmpty(rst))
{
return true;
@ -4179,7 +4180,7 @@ namespace InjectionPC
/// <param name="partNo"></param>
/// <param name="qLevel"></param>
/// <param name="newCode"></param>
void GetSupplyCode(string partNo,string qLevel, bool autoPrint,string mould,string partName, ref string newCode)
void GetSupplyCode(string stockNo,string partNo,string qLevel, bool autoPrint,string mould,string partName, ref string newOneCode, ref string newCode)
{
string batch = string.Empty;
if (autoPrint)
@ -4191,6 +4192,7 @@ namespace InjectionPC
batch = textBox1.Text.Trim();
}
newCode = _uniqueBll.GetSupplySerialNo(partNo, qLevel, batch);
newOneCode = _uniqueBll.GetSjBarCodeSerialNo(stockNo, batch);
}
@ -4237,6 +4239,23 @@ namespace InjectionPC
timer3.Enabled = false;
}
private void btnBarCodeWithBox_Click(object sender, EventArgs e)
{
if (MessageBox.Show("确定切换为箱码绑定模式?", "切换确认", MessageBoxButtons.OKCancel) == DialogResult.Cancel) return;
try
{
this.FormClosed += (arg1, arg2) => {
FrmMain2408 frm = new FrmMain2408();
frm.Show();
};
this.Close();
}
catch (Exception ex)
{
}
}
string PrintMoudleName()
{

171
InjectionPC/FrmQuality.cs

@ -39,10 +39,15 @@ namespace InjectionPC
private DataTable _boxDetailTable = null;
private List<string> _boxDelList = new List<string>();
internal event Action<List<string>> QualityViewClosed = null;
public FrmQuality()
public FrmQuality(bool isSingle = false)
{
InitializeComponent();
this.Size = new Size(1280, 1024);
if(isSingle == true)
{
txtBoxCode.Enabled = false;
txtBoxCode.KeyDown -= textBox1_KeyDown;
}
}
private void label9_Click(object sender, EventArgs e)
@ -302,13 +307,13 @@ namespace InjectionPC
}
/// <summary>
/// 保存缺陷
/// 保存缺陷 1.tb_Bad_Injection 增加记录 2.tb_Injection_BoxRecord表减一条数据 3. tb_BarCode1表 IsBad=1 4.[tb_Injectionn_Interface]表增加一条QaRst=1的数据
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button1_Click(object sender, EventArgs e)
{
string stockNo = "",batchNo="",partNo="",isbox="";
//string stockNo = "",batchNo="",partNo="",isbox="";
foreach (Control c in pictureBox2.Controls)
{
@ -422,6 +427,11 @@ namespace InjectionPC
#region 保存报废详细信息和是否装过箱,装过箱子的不允许报废
badmd.ID = Guid.NewGuid().ToString();
badmd.StationID = stationId;
badmd.BadPosition = position;
badmd.BadReason = reason.Trim();
badmd.code = _scanPartNo;
badmd.Desc = textBox4.Text?.Trim();
//直供件条码
if (txtScanBarCode.Text.Trim().Contains("#"))
{
@ -433,9 +443,18 @@ namespace InjectionPC
badmd.OneBarCode = dt1.Rows[0]["OneBarCode"].ToString();
isbox = dt1.Rows[0]["BoxNo"].ToString();
//扣减装箱表boxRecord中箱码对应的数量
if (SubtrBoxCount(isbox) == false)
return;
//if (SubtrBoxCount(isbox) == false)
// return;
if (SaveBad(badmd,isbox) == false)
{
return;
}
}
else
{
MessageBox.Show("条码不存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
}
else
@ -451,9 +470,10 @@ namespace InjectionPC
badmd.OneBarCode = dt.Rows[0]["OneBarCode"].ToString();
isbox = dt.Rows[0]["BoxNo"].ToString();
//扣减装箱表boxRecord中箱码对应的数量
if (SubtrBoxCount(isbox) == false)
if (SaveBad(badmd, isbox) == false)
{
return;
}
}
else
@ -473,65 +493,144 @@ namespace InjectionPC
badmd.BarCode = dt1.Rows[0]["BarCode"].ToString();
isbox = dt1.Rows[0]["BoxNo"].ToString();
if (SubtrBoxCount(isbox) == false)
if (SaveBad(badmd, isbox) == false)
{
return;
}
}
else
{
MessageBox.Show("条码不存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
return;
}
}
}
badmd.StationID = stationId;
badmd.BadPosition = position;
badmd.BadReason = reason.Trim();
badBLL.Add_Info(badmd);
//badBLL.Add_Info(badmd);
#endregion
#region 更新BarCode表标志位
barbll.UpdateIsBad(Program.tableName, badmd.OneBarCode, badmd.BarCode);
//barbll.UpdateIsBad(Program.tableName, badmd.OneBarCode, badmd.BarCode);
#endregion
GetBadCount();
}
bool SaveBad(BadInjectionModel badmd ,string boxCode)
{
if (!string.IsNullOrEmpty(boxCode))
{
DataTable boxTable = _injectionBoxBLL.SearchBox(boxCode);
if (boxTable.Rows.Count > 0)
{
if (boxTable.Rows[0]["IsPrint"].ToString() == "1")
{
MessageBox.Show("请产品已做装箱,不能做报废!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
reason = "";
txtScanBarCode.Text = "";
txtScanBarCode.TabIndex = 0;
txtScanBarCode.Focus();
textBox4.Text = "";
pictureBox2.Image = null;
pictureBox2.Controls.Clear();
panel2.Controls.Clear();
return false;
}
else
{
bool exsitInWms = _wmsBll.IsReadBarCodeInWms(badmd.BarCode);
if(exsitInWms == true)
{
MessageBox.Show($"条码[{badmd.BarCode}]在WMS已处理,无法在MES进行报废操作.");
return false;
}
string msg = badBLL.SaveBad(badmd,boxCode, Program.tableName);
if (!string.IsNullOrEmpty(msg))
{
MessageBox.Show("报废操作失败,失败原因:" + msg);
return false;
}
else
{
MessageBox.Show(badmd.OneBarCode +"报废操作成功");
}
}
}
}
return true;
}
bool SaveBadByBatch(DataTable boxDetailTable, string boxCode)
{
if (!string.IsNullOrEmpty(boxCode))
{
badmd.Desc = textBox4.Text?.Trim();
string msg = badBLL.SaveBadByBatch(boxDetailTable, stationId, position, reason, boxCode, Program.tableName, textBox4.Text?.Trim());
if (!string.IsNullOrEmpty(msg))
{
MessageBox.Show($"整箱报废失败:" + msg);
return false;
}
}
return true;
}
/// <summary>
/// 按箱码报废
/// </summary>
private void FullBoxBadSave(DataTable boxDetailTable)
{
string isbox = "";
if (MessageBox.Show($"确认对箱码[{txtBoxCode.Text}]所含[{boxDetailTable.Rows.Count}]条数据做报废处理?", "", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
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;
badmd.StationID = stationId;
badmd.BadPosition = position;
badmd.BadReason = reason.Trim();
badBLL.Add_Info(badmd);
if (string.IsNullOrEmpty(boxCode))
return;
}
#region 扣减箱码数量
ClearBoxCount(isbox);
#endregion
#region 更新tb_BarCode表标志位
bool isRead = _wmsBll.IsReadBoxInWms(boxCode);
if (isRead == true)
{
MessageBox.Show($"箱码[{boxCode}]已报工,不能做报废!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
reason = "";
txtScanBarCode.Text = "";
txtScanBarCode.TabIndex = 0;
txtScanBarCode.Focus();
textBox4.Text = "";
pictureBox2.Image = null;
barbll.UpdateIsBadByBoxCode(Program.tableName, boxCode);
pictureBox2.Controls.Clear();
panel2.Controls.Clear();
return;
}
else
{
SaveBadByBatch(boxDetailTable, boxCode);
}
#endregion
GetBadCount();
}
/// <summary>
@ -633,6 +732,7 @@ namespace InjectionPC
BarCodeScan(txtScanBarCode.Text.Trim());
}
}
private string _scanPartNo = string.Empty;
/// <summary>
/// 扫描标签质检
/// </summary>
@ -655,6 +755,8 @@ namespace InjectionPC
if (xdt != null && xdt.Rows.Count > 0)
{
code = xdt.Rows[0]["BarCode"].ToString();
_scanPartNo = xdt.Rows[0]["PartNo"].ToString();
}
else
{
@ -678,6 +780,7 @@ namespace InjectionPC
if (xdt != null && xdt.Rows.Count > 0)
{
code = xdt.Rows[0]["BarCode"].ToString();
_scanPartNo = xdt.Rows[0]["PartNo"].ToString();
}
else
{

133
MESClassLibrary/BLL/BasicInfo/BadInjectionBLL.cs

@ -5,7 +5,10 @@ using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
using MESClassLibrary.BLL.Injection;
using MESClassLibrary.BLL.Inspection;
using MESClassLibrary.BLL.Log;
using MESClassLibrary.DAL;
using MESClassLibrary.DAL.BasicInfo;
using MESClassLibrary.EFModel;
using MESClassLibrary.Model;
@ -19,6 +22,9 @@ namespace MESClassLibrary.BLL.BasicInfo
BadInjectionDAL db=new BadInjectionDAL();
BasicBLL<tb_Bad_Injection> da=new BasicBLL<tb_Bad_Injection>();
private InjectionBoxBLL _injectionBoxBLL = new InjectionBoxBLL();
private BarCodeBLL barCodeBll = new BarCodeBLL();
private WmsBLL _wmsBll = new WmsBLL();
public bool Add_Info(BadInjectionModel md)
{
try
@ -230,5 +236,132 @@ namespace MESClassLibrary.BLL.BasicInfo
return "0";
}
}
/// <summary>
/// 单根报废
/// </summary>
/// <param name="md"></param>
/// <param name="boxCode"></param>
/// <param name="tableName"></param>
/// <returns></returns>
public string SaveBad(BadInjectionModel md, string boxCode, string tableName)
{
LocalDBService localDB = new LocalDBService(SqlHelper.GetConnSting());
try
{
localDB.BeginTrans();
db.AddInfo(localDB, md);
_injectionBoxBLL.UpdateBoxCount(localDB, boxCode, -1);
barCodeBll.UpdateIsBad(localDB, tableName, md.OneBarCode, md.BarCode);
BarCodeModel bcm = new BarCodeModel();
bcm.IsBad = 1;
bcm.OneBarCode = md.OneBarCode;
bcm.BarCode = md.BarCode;
bcm.BoxNo = boxCode;
bcm.Des1 = md.Desc;
bcm.PartNo = md.code;
bcm.StationID = md.StationID;
_wmsBll.SaveInterface(localDB, bcm, md.BadReason);
localDB.Commit();
return "";
}
catch (Exception ex)
{
if (localDB != null)
{
localDB.Rollback();
}
return ex.Message;
}
finally
{
if (localDB != null)
{
localDB.EndTrans();
}
}
}
/// <summary>
/// 整箱报废
/// </summary>
/// <param name="boxDetailTable"></param>
/// <param name="stationId"></param>
/// <param name="position"></param>
/// <param name="reason"></param>
/// <param name="boxCode"></param>
/// <param name="tableName"></param>
/// <param name="partNo"></param>
/// <returns></returns>
public string SaveBadByBatch(DataTable boxDetailTable,string stationId,string position,string reason, string boxCode,string tableName,string partName)
{
LocalDBService localDB = new LocalDBService(SqlHelper.GetConnSting());
try
{
localDB.BeginTrans();
bool isDel = _wmsBll.DelRecordByBox(localDB,boxCode);
if (isDel)
{
_injectionBoxBLL.UpdateBoxCount(localDB, boxCode, 100, true);
}
else
{
localDB.Rollback();
return $"整箱报废失败,可能箱码[{boxCode}]在操作时已被wms接收";
}
foreach (DataRow dr in boxDetailTable.Rows)
{
string barCode = dr["BarCode"].ToString();
string oneBarCode = dr["OneBarCode"].ToString();
BadInjectionModel badmd = new BadInjectionModel();
badmd.ID = Guid.NewGuid().ToString();
badmd.BarCode = barCode;
badmd.OneBarCode = oneBarCode;
badmd.StationID = stationId;
badmd.BadPosition = position;
badmd.BadReason = reason.Trim();
db.AddInfo(localDB, badmd);
BarCodeModel bcm = new BarCodeModel();
bcm.IsBad = 1;
bcm.OneBarCode = oneBarCode;
bcm.BarCode = barCode;
bcm.BoxNo = boxCode;
bcm.Des1 = partName ;
bcm.PartNo = dr["PartNo"].ToString();
bcm.StationID = stationId;
_wmsBll.SaveInterface(localDB, bcm, reason);
}
barCodeBll.UpdateIsBadByBoxCode(localDB,tableName, boxCode);
localDB.Commit();
return "";
}
catch (Exception ex)
{
if (localDB != null)
{
localDB.Rollback();
}
return ex.Message;
}
finally
{
if (localDB != null)
{
localDB.EndTrans();
}
}
return "";
}
}
}

21
MESClassLibrary/BLL/BasicInfo/BarCodeBLL.cs

@ -325,8 +325,10 @@ namespace MESClassLibrary.BLL.BasicInfo
db.UpdateBoxNoByID(localDB, newtableName, boxCode, newID);
db.UpdateBoxNoNull(localDB, oldtableName, oldID);
badDb.AddInfo(localDB, model);
//删除旧的条码
wmsDal.DeleteRecord(localDB, boxCode, model.OneBarCode, model.BarCode);
wmsDal.AddRecord(localDB, boxCode, newOneBarCode, newBarCode);
//保存新条码
wmsDal.AddRecord(localDB, boxCode, newOneBarCode, newBarCode,"0", model.Desc,"");
localDB.Commit();
return true;
}
@ -387,6 +389,11 @@ namespace MESClassLibrary.BLL.BasicInfo
return false;
}
}
public bool UpdateIsBad(LocalDBService localDB, string tableName, string onebarcode, string barcode)
{
return db.UpdateIsBad(localDB,tableName, onebarcode, barcode);
}
public bool UpdateIsBadByBoxCode(string tableName, string boxNo)
{
try
@ -399,6 +406,18 @@ namespace MESClassLibrary.BLL.BasicInfo
return false;
}
}
public bool UpdateIsBadByBoxCode(LocalDBService localDB, string tableName, string boxNo)
{
try
{
return db.UpdateIsBadByBoxCode(localDB,tableName, boxNo);
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return false;
}
}
public DataTable SearchBarCode(string boxNo, string tableName, string row)
{
try

5
MESClassLibrary/BLL/Inspection/InjectionBoxBLL.cs

@ -5,6 +5,7 @@ using System.Linq;
using System.Reflection;
using System.Text;
using MESClassLibrary.BLL.Log;
using MESClassLibrary.DAL;
using MESClassLibrary.DAL.Injection;
using MESClassLibrary.Model;
@ -38,6 +39,10 @@ namespace MESClassLibrary.BLL.Inspection
return false;
}
}
public bool UpdateBoxCount(LocalDBService localDB, string packageCode, int addCount, bool isFinish = false)
{
return db.UpdateInfo(localDB,packageCode, addCount, isFinish);
}
public bool UpdatePrinted(string packageCode)
{
try

32
MESClassLibrary/BLL/Wms/WmsBLL.cs

@ -18,7 +18,7 @@ namespace MESClassLibrary.BLL.Injection
private WmsDAL da=new WmsDAL();
private BarCodeDAl barCodeDal = new BarCodeDAl();
public string SaveRecordAndInterface(BarCodeModel bcm,string tableName)
public string SaveRecordAndInterface(BarCodeModel bcm,string tableName,string badReason)
{
LocalDBService local = new LocalDBService(SqlHelper.GetConnSting());
try
@ -26,7 +26,7 @@ namespace MESClassLibrary.BLL.Injection
local.BeginTrans();
barCodeDal.AddInfoNew(local, bcm, tableName);
da.SaveInterface(local, bcm);
da.SaveInterface(local, bcm, badReason);
local.Commit();
}
catch (Exception ex)
@ -48,7 +48,18 @@ namespace MESClassLibrary.BLL.Injection
}
public void SaveInterface(LocalDBService local ,BarCodeModel bcm,string badReason)
{
da.SaveInterface(local, bcm, badReason);
}
/// <summary>
/// 合格保存接口
/// </summary>
/// <param name="boxNo"></param>
/// <param name="lastBoxNo1"></param>
/// <param name="lastBoxNo2"></param>
/// <param name="interfaceType"></param>
/// <returns></returns>
public string SaveInterface(string boxNo,string lastBoxNo1,string lastBoxNo2, WmsInterfaceEnum interfaceType)
{
//上一个是否传递成功,没成功重新传 左侧
@ -57,7 +68,7 @@ namespace MESClassLibrary.BLL.Injection
bool exsit = da.IsSendPackageCode(lastBoxNo1);
if(exsit == false)
{
SendToInterface(lastBoxNo1);
SendToInterface(lastBoxNo1,"");
}
}
//上一个是否传递成功,没成功重新传 右侧侧
@ -66,10 +77,10 @@ namespace MESClassLibrary.BLL.Injection
bool exsit = da.IsSendPackageCode(lastBoxNo2);
if (exsit == false)
{
SendToInterface(lastBoxNo2);
SendToInterface(lastBoxNo2, "");
}
}
string rst = SendToInterface(boxNo);
string rst = SendToInterface(boxNo,"");
if (!string.IsNullOrEmpty(rst))
{
LogErrBLL.AddInfo(rst, MethodBase.GetCurrentMethod());
@ -80,12 +91,11 @@ namespace MESClassLibrary.BLL.Injection
}
private string SendToInterface(string boxNo)
private string SendToInterface(string boxNo, string badReason)
{
DataTable barCodeTable = barCodeDal.SearchInfoByBox(boxNo);
string rst = da.SaveInterface(barCodeTable);
string rst = da.SaveInterface(barCodeTable, badReason);
return rst;
}
/// <summary>
@ -125,5 +135,9 @@ namespace MESClassLibrary.BLL.Injection
{
return da.DelRecordByBox(boxNo);
}
public bool DelRecordByBox(LocalDBService localDB , string boxNo)
{
return da.DelRecordByBox(localDB, boxNo);
}
}
}

10
MESClassLibrary/DAL/BasicInfo/BadInjectionDAL.cs

@ -66,8 +66,7 @@ namespace MESClassLibrary.DAL.BasicInfo
}
public bool AddInfo(LocalDBService localDB, BadInjectionModel md)
{
try
{
#region 添加数据
string sql = "";
sql = $"INSERT INTO tb_Bad_Injection (ID,OneBarCode,[BarCode],[BadPosition],[BadReason],StationID)" +
@ -77,12 +76,7 @@ namespace MESClassLibrary.DAL.BasicInfo
#endregion
return true;
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return false;
}
}
public DataTable SearchByCode(string code)
{

40
MESClassLibrary/DAL/BasicInfo/BarCodeDAl.cs

@ -371,7 +371,7 @@ namespace MESClassLibrary.DAL.BasicInfo
string sql = "";
SqlParameter[] param = null;
sql = "INSERT INTO " + tableName + " (ID,StationID,OneBarCode,[BarCode],[StockNo],[PartNo],[PrintType],[CreateTime],[IsImport],StationID2,PlanID,ProductNature,Des1,Des2,Des3,Des4,Des5,BoxNo,Weight";
sql += $") VALUES ('{md.ID}','{md.StationID}','{md.OneBarCode}','{md.BarCode}','{md.StockNo}','{md.PartNo}','{md.PrintType}','{md.Import}'," +
sql += $") VALUES ('{md.ID}','{md.StationID}','{md.OneBarCode}','{md.BarCode}','{md.StockNo}','{md.PartNo}','{md.PrintType}',getdate(),'{md.Import}'," +
$"'{md.StationID2}','{md.PlanID}','{md.ProductNature}','{md.Des1}','{md.Des2}','{md.Des3}','{md.Des4}','{md.Des5}','{md.BoxNo}','{ md.Weight}')";
@ -1001,6 +1001,31 @@ namespace MESClassLibrary.DAL.BasicInfo
return false;
}
}
public bool UpdateIsBad(LocalDBService localDB, string tableName, string onebarcode, string barcode)
{
string sql = "";
SqlParameter[] param = null;
param = new SqlParameter[1];
if (onebarcode != "")
{
//sql = @"update " + tableName + " set IsBad=1 where OneBarCode=@OneBarCode and BoxNo is null";
sql = @"update " + tableName + $" set IsBad=1 where OneBarCode='{onebarcode}'";
}
else if (barcode != "")
{
//sql = @"update " + tableName + " set IsBad=1 where BarCode=@BarCode and BoxNo is null";
sql = @"update " + tableName + $" set IsBad=1 where BarCode='{barcode}'";
}
localDB.Exec_NonQuery(sql);
return true;
}
/// <summary>
/// 根据箱码更新IsBad=1
/// </summary>
@ -1041,6 +1066,19 @@ namespace MESClassLibrary.DAL.BasicInfo
return false;
}
}
public bool UpdateIsBadByBoxCode(LocalDBService localDB, string tableName, string boxCode)
{
string sql = "";
SqlParameter[] param = null;
param = new SqlParameter[1];
sql = @"update " + tableName + $" set IsBad=1 where BoxNo='{boxCode}'";
localDB.Exec_NonQuery(sql);
//SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(), CommandType.Text, sql, param);
return true;
}
public DataTable SearchCountByBox(string boxNo,string tableName)
{
try

33
MESClassLibrary/DAL/Injection/InjectionBoxDAL.cs

@ -120,6 +120,39 @@ namespace MESClassLibrary.DAL.Injection
return false;
}
}
public bool UpdateInfo(LocalDBService localDB, string packageCode, int addCount, bool isFinish = false)
{
int i = 0;
if (addCount > 0)
{
i = 0;
}
else
{
i = 1;
}
string sql = "";
SqlParameter[] param = null;
if (isFinish == false)
{
sql = "update " + TableName + $" set BoxCount = BoxCount+ {addCount} ";
sql += $" where BoxCount >={i} and BoxNo='{packageCode}'";
}
else
{
sql = "update " + TableName + $" set BoxCount = 0, IsPrint=1 ,remark='整箱报废'";
sql += $" where (1=1) and BoxNo='{packageCode}'";
}
localDB.Exec_NonQuery(sql);
return true;
}
public bool UpdatePrinted(string packageCode)
{
try

49
MESClassLibrary/DAL/Wms/WmsDAL.cs

@ -22,7 +22,7 @@ namespace MESClassLibrary.DAL.Injection
/// </summary>
/// <param name="barCodeTable"></param>
/// <returns></returns>
public string SaveInterface(DataTable barCodeTable)
public string SaveInterface(DataTable barCodeTable,string badReason)
{
LocalDBService local = new LocalDBService(SqlHelper.GetConnSting());
try
@ -30,8 +30,8 @@ namespace MESClassLibrary.DAL.Injection
local.BeginTrans();
foreach (DataRow dr in barCodeTable.Rows)
{
string sql = $" insert into tb_Injectionn_Interface(PackageCode,OneBarCode,BarCode,Remark)" +
$" values ('{dr["BoxNo"]}','{dr["OneBarCode"]}','{dr["BarCode"]}','')";
string sql = $" insert into tb_Injectionn_Interface(PackageCode,OneBarCode,BarCode,Remark,QaRst,Describe,BadReason)" +
$" values ('{dr["BoxNo"]}','{dr["OneBarCode"]}','{dr["BarCode"]}','','0','{dr["PartName"]}','{badReason}')";
local.Exec_NonQuery(sql);
}
local.Commit();
@ -54,19 +54,13 @@ namespace MESClassLibrary.DAL.Injection
return null;
}
public bool SaveInterface(LocalDBService local, BarCodeModel bcm)
public bool SaveInterface(LocalDBService local, BarCodeModel bcm,string badReason)
{
try
{
string sql = $" insert into tb_Injectionn_Interface(PackageCode,OneBarCode,BarCode,Remark)" +
$" values ('{bcm.BoxNo}','{bcm.OneBarCode}','{bcm.BarCode}','')";
return local.Exec_NonQuery(sql);
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return false;
}
string sql = $" insert into tb_Injectionn_Interface(PackageCode,OneBarCode,BarCode,Remark,QaRst,Describe,BadReason)" +
$" values ('{bcm.BoxNo}','{bcm.OneBarCode}','{bcm.BarCode}','','{bcm.IsBad}','{bcm.Des1}','{badReason}')";
return local.Exec_NonQuery(sql);
}
/// <summary>
/// wms注塑中间表tb_Injectionn_Interface 单条插入箱码,注塑码数据
@ -76,11 +70,12 @@ namespace MESClassLibrary.DAL.Injection
/// <param name="oneBarCode"></param>
/// <param name="barCode"></param>
/// <returns></returns>
public bool AddRecord(LocalDBService localDB, string boxNo, string oneBarCode, string barCode)
public bool AddRecord(LocalDBService localDB, string boxNo, string oneBarCode, string barCode,string isBad,string desc,string badReason)
{
try
{
string sql = $"insert into tb_Injectionn_Interface(PackageCode,OneBarCode,BarCode,Remark) values ('{boxNo}','{oneBarCode}','{barCode}','')";
string sql = $"insert into tb_Injectionn_Interface(PackageCode,OneBarCode,BarCode,Remark,QaRst,Describe,BadReason) " +
$"values ('{boxNo}','{oneBarCode}','{barCode}','','{isBad}','{desc}','{badReason}')";
localDB.Exec_NonQuery(sql);
return true;
}
@ -205,6 +200,26 @@ namespace MESClassLibrary.DAL.Injection
return true;
}
}
public bool DelRecordByBox(LocalDBService localDB, string boxNo)
{
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";
localDB.Exec_NonQuery(sql2);
// SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(), CommandType.Text, sql2, null);
return true;
}
}
#endregion

1
MESClassLibrary/Model/BadInjectionModel.cs

@ -16,5 +16,6 @@ namespace MESClassLibrary.Model
//public string BadReason { get; set; }
public string code { get; set; }
public string Desc { get; set; }
}
}

Loading…
Cancel
Save