Browse Source

注塑查询打码 喷涂增加tb_ForeignColorMap表读取颜色

master
ruoxing.wang 3 weeks ago
parent
commit
6e196ec9a0
  1. 100
      FacOneZPStation/FrmZP.Designer.cs
  2. 85
      InjectionPC/FrmMain2408.Designer.cs
  3. 1914
      InjectionPC/FrmMain2408.cs
  4. 14
      InjectionPC/FrmMain2411.Designer.cs
  5. 903
      InjectionPC/FrmMain2411.cs
  6. 34
      InjectionPC/FrmQuality.cs
  7. 99
      InjectionSearch/FrmBarCodeSearch2408.Designer.cs
  8. 710
      InjectionSearch/FrmBarCodeSearch2408.cs
  9. 3
      InjectionSearch/FrmBarCodeSearch2408.resx
  10. 41
      MESClassLibrary/BLL/BasicInfo/BarCodeBLL.cs
  11. 22
      MESClassLibrary/BLL/Injection/PLCBreakBLL.cs
  12. 12
      MESClassLibrary/BLL/Inspection/InjectionBoxBLL.cs
  13. 13
      MESClassLibrary/BLL/Wms/WmsBLL.cs
  14. 20
      MESClassLibrary/DAL/BasicInfo/BarCodeDAl.cs
  15. 6
      MESClassLibrary/DAL/Injection/InjectionBoxDAL.cs
  16. 16
      MESClassLibrary/DAL/Injection/PLCBreakDAL.cs
  17. 1
      MESClassLibrary/MESClassLibrary.csproj
  18. 14
      PaintingPC/FrmQuality.cs
  19. 33
      PaintingPC/Function.cs
  20. 4
      PaintingPC/Model/InspectModel.cs
  21. 14
      WebService/Function.cs

100
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, 770F));
this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 776F));
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(1789, 14);
this.button6.Margin = new System.Windows.Forms.Padding(14, 14, 14, 14);
this.button6.Location = new System.Drawing.Point(1783, 14);
this.button6.Margin = new System.Windows.Forms.Padding(14);
this.button6.Name = "button6";
this.button6.Size = new System.Drawing.Size(743, 183);
this.button6.Size = new System.Drawing.Size(749, 183);
this.button6.TabIndex = 7;
this.button6.Text = "手动打印箱单";
this.button6.UseVisualStyleBackColor = false;
@ -119,7 +119,7 @@
this.button1.Location = new System.Drawing.Point(7, 217);
this.button1.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(581, 200);
this.button1.Size = new System.Drawing.Size(579, 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(1206, 225);
this.button5.Margin = new System.Windows.Forms.Padding(14, 14, 14, 14);
this.button5.Location = new System.Drawing.Point(1202, 225);
this.button5.Margin = new System.Windows.Forms.Padding(14);
this.button5.Name = "button5";
this.button5.Size = new System.Drawing.Size(555, 184);
this.button5.Size = new System.Drawing.Size(553, 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(602, 6);
this.button4.Location = new System.Drawing.Point(600, 6);
this.button4.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6);
this.button4.Name = "button4";
this.button4.Size = new System.Drawing.Size(583, 199);
this.button4.Size = new System.Drawing.Size(581, 199);
this.button4.TabIndex = 4;
this.button4.Text = "下一计划";
this.button4.UseVisualStyleBackColor = false;
@ -162,7 +162,7 @@
this.button3.Location = new System.Drawing.Point(7, 6);
this.button3.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6);
this.button3.Name = "button3";
this.button3.Size = new System.Drawing.Size(581, 199);
this.button3.Size = new System.Drawing.Size(579, 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(609, 225);
this.button2.Margin = new System.Windows.Forms.Padding(14, 14, 14, 14);
this.button2.Location = new System.Drawing.Point(607, 225);
this.button2.Margin = new System.Windows.Forms.Padding(14);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(569, 184);
this.button2.Size = new System.Drawing.Size(567, 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(1782, 217);
this.button7.Location = new System.Drawing.Point(1776, 217);
this.button7.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6);
this.button7.Name = "button7";
this.button7.Size = new System.Drawing.Size(757, 200);
this.button7.Size = new System.Drawing.Size(763, 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(1436, 3);
this.label7.Location = new System.Drawing.Point(1428, 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(414, 127);
this.textBox2.Location = new System.Drawing.Point(412, 127);
this.textBox2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(1015, 87);
this.textBox2.Size = new System.Drawing.Size(1009, 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, 122);
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(400, 124);
this.label3.Size = new System.Drawing.Size(398, 124);
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(1713, 249);
this.labOrderNo.Location = new System.Drawing.Point(1705, 249);
this.labOrderNo.Margin = new System.Windows.Forms.Padding(2);
this.labOrderNo.Name = "labOrderNo";
this.labOrderNo.Size = new System.Drawing.Size(836, 174);
this.labOrderNo.Size = new System.Drawing.Size(844, 174);
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(1436, 249);
this.label4.Location = new System.Drawing.Point(1428, 249);
this.label4.Margin = new System.Windows.Forms.Padding(2);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(272, 174);
@ -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(412, 249);
this.labStationNo.Location = new System.Drawing.Point(410, 249);
this.labStationNo.Margin = new System.Windows.Forms.Padding(2);
this.labStationNo.Name = "labStationNo";
this.labStationNo.Size = new System.Drawing.Size(1019, 174);
this.labStationNo.Size = new System.Drawing.Size(1013, 174);
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, 249);
this.label2.Margin = new System.Windows.Forms.Padding(2);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(404, 174);
this.label2.Size = new System.Drawing.Size(402, 174);
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(1713, 428);
this.labPName.Location = new System.Drawing.Point(1705, 428);
this.labPName.Margin = new System.Windows.Forms.Padding(2);
this.labPName.Name = "labPName";
this.labPName.Size = new System.Drawing.Size(836, 284);
this.labPName.Size = new System.Drawing.Size(844, 284);
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(1436, 428);
this.label8.Location = new System.Drawing.Point(1428, 428);
this.label8.Margin = new System.Windows.Forms.Padding(2);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(272, 284);
@ -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(412, 428);
this.labPartNo.Location = new System.Drawing.Point(410, 428);
this.labPartNo.Margin = new System.Windows.Forms.Padding(2);
this.labPartNo.Name = "labPartNo";
this.labPartNo.Size = new System.Drawing.Size(1019, 284);
this.labPartNo.Size = new System.Drawing.Size(1013, 284);
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, 428);
this.label6.Margin = new System.Windows.Forms.Padding(2);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(404, 284);
this.label6.Size = new System.Drawing.Size(402, 284);
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(1713, 717);
this.labBadCount.Location = new System.Drawing.Point(1705, 717);
this.labBadCount.Margin = new System.Windows.Forms.Padding(2);
this.labBadCount.Name = "labBadCount";
this.labBadCount.Size = new System.Drawing.Size(836, 515);
this.labBadCount.Size = new System.Drawing.Size(844, 515);
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(412, 717);
this.labNum.Location = new System.Drawing.Point(410, 717);
this.labNum.Margin = new System.Windows.Forms.Padding(2);
this.labNum.Name = "labNum";
this.labNum.Size = new System.Drawing.Size(1019, 515);
this.labNum.Size = new System.Drawing.Size(1013, 515);
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, 717);
this.label10.Margin = new System.Windows.Forms.Padding(2);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(404, 515);
this.label10.Size = new System.Drawing.Size(402, 515);
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(400, 120);
this.label14.Size = new System.Drawing.Size(398, 120);
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(414, 6);
this.textBox1.Location = new System.Drawing.Point(412, 6);
this.textBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(1015, 87);
this.textBox1.Size = new System.Drawing.Size(1009, 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(1715, 1);
this.labErrMessage.Location = new System.Drawing.Point(1707, 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(832, 245);
this.labErrMessage.Size = new System.Drawing.Size(840, 245);
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, 839F));
this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 847F));
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(1436, 717);
this.label12.Location = new System.Drawing.Point(1428, 717);
this.label12.Margin = new System.Windows.Forms.Padding(2);
this.label12.Name = "label12";
this.label12.Size = new System.Drawing.Size(272, 515);
@ -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(1924, 0);
this.labTime.Location = new System.Drawing.Point(1920, 0);
this.labTime.Margin = new System.Windows.Forms.Padding(0);
this.labTime.Name = "labTime";
this.labTime.Size = new System.Drawing.Size(636, 149);
this.labTime.Size = new System.Drawing.Size(640, 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(348, 149);
this.pictureBox1.Size = new System.Drawing.Size(347, 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(348, 0);
this.label1.Location = new System.Drawing.Point(347, 0);
this.label1.Margin = new System.Windows.Forms.Padding(0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(1576, 149);
this.label1.Size = new System.Drawing.Size(1573, 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, 635F));
this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 639F));
this.tableLayoutPanel2.Controls.Add(this.labTime, 2, 0);
this.tableLayoutPanel2.Controls.Add(this.pictureBox1, 0, 0);
this.tableLayoutPanel2.Controls.Add(this.label1, 1, 0);

85
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();
@ -781,43 +781,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);
@ -1734,12 +1734,9 @@
//
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// serialPort1
//
this.serialPort1.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(this.serialPort1_DataReceived);
//
// timer2
//
this.timer2.Enabled = true;
this.timer2.Interval = 5000;
this.timer2.Tick += new System.EventHandler(this.timer2_Tick);
//

1914
InjectionPC/FrmMain2408.cs

File diff suppressed because it is too large

14
InjectionPC/FrmMain2411.Designer.cs

@ -28,7 +28,6 @@
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
GlacialComponents.Controls.GLColumn glColumn1 = new GlacialComponents.Controls.GLColumn();
GlacialComponents.Controls.GLColumn glColumn2 = new GlacialComponents.Controls.GLColumn();
GlacialComponents.Controls.GLColumn glColumn3 = new GlacialComponents.Controls.GLColumn();
@ -124,10 +123,10 @@
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.label35 = new System.Windows.Forms.Label();
this.label39 = new System.Windows.Forms.Label();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.serialPort1 = new System.IO.Ports.SerialPort(this.components);
this.timer2 = new System.Windows.Forms.Timer(this.components);
this.timer3 = new System.Windows.Forms.Timer(this.components);
this.timer1 = new System.Windows.Forms.Timer();
this.serialPort1 = new System.IO.Ports.SerialPort();
this.timer2 = new System.Windows.Forms.Timer();
this.timer3 = new System.Windows.Forms.Timer();
this.panel1.SuspendLayout();
this.panel7.SuspendLayout();
this.panel23.SuspendLayout();
@ -1301,12 +1300,9 @@
//
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// serialPort1
//
this.serialPort1.DataReceived += new System.IO.Ports.SerialDataReceivedEventHandler(this.serialPort1_DataReceived);
//
// timer2
//
this.timer2.Enabled = true;
this.timer2.Interval = 5000;
this.timer2.Tick += new System.EventHandler(this.timer2_Tick);
//

903
InjectionPC/FrmMain2411.cs

File diff suppressed because it is too large

34
InjectionPC/FrmQuality.cs

@ -39,6 +39,7 @@ namespace InjectionPC
private DataTable _boxDetailTable = null;
private List<string> _boxDelList = new List<string>();
internal event Action<List<string>> QualityViewClosed = null;
private StationBLL _stationBLL = new StationBLL();
public FrmQuality(bool isSingle = false)
{
InitializeComponent();
@ -405,7 +406,7 @@ namespace InjectionPC
private void SingleBadSave()
{
string isbox = "";
string stationNo = "";
#region 判断是否已做过报废
DataTable baddt = badBLL.SearchByCode(txtScanBarCode.Text.Trim()); //bad 表
@ -446,11 +447,14 @@ namespace InjectionPC
{
badmd.OneBarCode = dt1.Rows[0]["OneBarCode"].ToString();
isbox = dt1.Rows[0]["BoxNo"].ToString();
string stationID = dt1.Rows[0]["StationID"].ToString();
stationNo = _stationBLL.SearchStationNameByID(stationID);
//扣减装箱表boxRecord中箱码对应的数量
//if (SubtrBoxCount(isbox) == false)
// return;
if (SaveBad(badmd,isbox) == false)
if (SaveBad(badmd,isbox, stationNo) == false)
{
return;
}
@ -474,7 +478,9 @@ namespace InjectionPC
badmd.OneBarCode = dt.Rows[0]["OneBarCode"].ToString();
isbox = dt.Rows[0]["BoxNo"].ToString();
if (SaveBad(badmd, isbox) == false)
string stationID = dt.Rows[0]["StationID"].ToString();
stationNo = _stationBLL.SearchStationNameByID(stationID);
if (SaveBad(badmd, isbox, stationNo) == false)
{
return;
}
@ -495,9 +501,10 @@ namespace InjectionPC
if (dt1 != null && dt1.Rows.Count > 0)
{
badmd.BarCode = dt1.Rows[0]["BarCode"].ToString();
isbox = dt1.Rows[0]["BoxNo"].ToString();
if (SaveBad(badmd, isbox) == false)
isbox = dt1.Rows[0]["BoxNo"].ToString();
string stationID = dt1.Rows[0]["StationID"].ToString();
stationNo = _stationBLL.SearchStationNameByID(stationID);
if (SaveBad(badmd, isbox, stationNo) == false)
{
return;
}
@ -526,7 +533,7 @@ namespace InjectionPC
GetBadCount();
}
bool SaveBad(BadInjectionModel badmd ,string boxCode)
bool SaveBad(BadInjectionModel badmd ,string boxCode,string stationNo)
{
if (!string.IsNullOrEmpty(boxCode))
{
@ -558,7 +565,7 @@ namespace InjectionPC
return false;
}
string msg = badBLL.SaveBad(badmd,boxCode, Program.tableName, Program.station);
string msg = badBLL.SaveBad(badmd,boxCode, Program.tableName, stationNo);
if (!string.IsNullOrEmpty(msg))
{
MessageBox.Show("报废操作失败,失败原因:" + msg);
@ -597,12 +604,12 @@ namespace InjectionPC
}
bool SaveBadByBatch(DataTable boxDetailTable, string boxCode)
bool SaveBadByBatch(DataTable boxDetailTable, string boxCode,string stationNo)
{
if (!string.IsNullOrEmpty(boxCode))
{
badmd.Desc = textBox4.Text?.Trim();
string msg = badBLL.SaveBadByBatch(boxDetailTable, stationId, position, reason, boxCode, Program.tableName, textBox4.Text?.Trim(), Program.station);
string msg = badBLL.SaveBadByBatch(boxDetailTable, stationId, position, reason, boxCode, Program.tableName, textBox4.Text?.Trim(), stationNo);
if (!string.IsNullOrEmpty(msg))
{
@ -626,6 +633,9 @@ namespace InjectionPC
if (MessageBox.Show($"确认对箱码[{txtBoxCode.Text}]所含[{boxDetailTable.Rows.Count}]条数据做报废处理?", "", MessageBoxButtons.OKCancel) == DialogResult.Cancel)
return;
string boxCode = boxDetailTable.Rows[0]["BoxNo"].ToString();
string stationID = boxDetailTable.Rows[0]["StationID"].ToString();
string stationNo = _stationBLL.SearchStationNameByID(stationID);
if (string.IsNullOrEmpty(boxCode))
return;
@ -652,7 +662,7 @@ namespace InjectionPC
}
else
{
SaveBadByBatch(boxDetailTable, boxCode);
SaveBadByBatch(boxDetailTable, boxCode, stationNo);
}
#endregion

99
InjectionSearch/FrmBarCodeSearch2408.Designer.cs

@ -28,10 +28,11 @@
/// </summary>
private void InitializeComponent()
{
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();
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();
this.label1 = new System.Windows.Forms.Label();
this.comboBox1 = new System.Windows.Forms.ComboBox();
this.label2 = new System.Windows.Forms.Label();
@ -70,6 +71,7 @@
this.btnRePrint = new System.Windows.Forms.Button();
this.txtRePrintBoxCode = new System.Windows.Forms.TextBox();
this.label24 = new System.Windows.Forms.Label();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.panel1.SuspendLayout();
this.panel3.SuspendLayout();
this.tableLayoutPanel1.SuspendLayout();
@ -169,8 +171,6 @@
// cboxHandBox
//
this.cboxHandBox.AutoSize = true;
this.cboxHandBox.Checked = true;
this.cboxHandBox.CheckState = System.Windows.Forms.CheckState.Checked;
this.cboxHandBox.Font = new System.Drawing.Font("宋体", 21.75F, System.Drawing.FontStyle.Bold);
this.cboxHandBox.Location = new System.Drawing.Point(1394, 32);
this.cboxHandBox.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5);
@ -375,43 +375,43 @@
this.glacialList1.AutoHeight = true;
this.glacialList1.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.glacialList1.BackgroundStretchToFit = true;
glColumn1.ActivatedEmbeddedType = GlacialComponents.Controls.GLActivatedEmbeddedTypes.None;
glColumn1.CheckBoxes = false;
glColumn1.ImageIndex = -1;
glColumn1.Name = "Column1";
glColumn1.NumericSort = false;
glColumn1.Text = "条码";
glColumn1.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
glColumn1.Width = 300;
glColumn2.ActivatedEmbeddedType = GlacialComponents.Controls.GLActivatedEmbeddedTypes.None;
glColumn2.CheckBoxes = false;
glColumn2.ImageIndex = -1;
glColumn2.Name = "Column2";
glColumn2.NumericSort = false;
glColumn2.Text = "产品名称";
glColumn2.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
glColumn2.Width = 450;
glColumn3.ActivatedEmbeddedType = GlacialComponents.Controls.GLActivatedEmbeddedTypes.None;
glColumn3.CheckBoxes = false;
glColumn3.ImageIndex = -1;
glColumn3.Name = "Column3";
glColumn3.NumericSort = false;
glColumn3.Text = "打印方式";
glColumn3.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
glColumn3.Width = 80;
glColumn4.ActivatedEmbeddedType = GlacialComponents.Controls.GLActivatedEmbeddedTypes.None;
glColumn4.CheckBoxes = false;
glColumn4.ImageIndex = -1;
glColumn4.Name = "Column4";
glColumn4.NumericSort = false;
glColumn4.Text = "打印时间";
glColumn4.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
glColumn4.Width = 220;
glColumn5.ActivatedEmbeddedType = GlacialComponents.Controls.GLActivatedEmbeddedTypes.None;
glColumn5.CheckBoxes = false;
glColumn5.ImageIndex = -1;
glColumn5.Name = "Column1";
glColumn5.NumericSort = false;
glColumn5.Text = "条码";
glColumn5.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
glColumn5.Width = 300;
glColumn6.ActivatedEmbeddedType = GlacialComponents.Controls.GLActivatedEmbeddedTypes.None;
glColumn6.CheckBoxes = false;
glColumn6.ImageIndex = -1;
glColumn6.Name = "Column2";
glColumn6.NumericSort = false;
glColumn6.Text = "产品名称";
glColumn6.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
glColumn6.Width = 450;
glColumn7.ActivatedEmbeddedType = GlacialComponents.Controls.GLActivatedEmbeddedTypes.None;
glColumn7.CheckBoxes = false;
glColumn7.ImageIndex = -1;
glColumn7.Name = "Column3";
glColumn7.NumericSort = false;
glColumn7.Text = "打印方式";
glColumn7.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
glColumn7.Width = 80;
glColumn8.ActivatedEmbeddedType = GlacialComponents.Controls.GLActivatedEmbeddedTypes.None;
glColumn8.CheckBoxes = false;
glColumn8.ImageIndex = -1;
glColumn8.Name = "Column4";
glColumn8.NumericSort = false;
glColumn8.Text = "打印时间";
glColumn8.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft;
glColumn8.Width = 220;
this.glacialList1.Columns.AddRange(new GlacialComponents.Controls.GLColumn[] {
glColumn1,
glColumn2,
glColumn3,
glColumn4});
glColumn5,
glColumn6,
glColumn7,
glColumn8});
this.glacialList1.ControlStyle = GlacialComponents.Controls.GLControlStyles.Normal;
this.glacialList1.Font = new System.Drawing.Font("宋体", 10.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.glacialList1.FullRowSelect = true;
@ -564,7 +564,7 @@
this.pnBoxReprint.Controls.Add(this.txtRePrintBoxCode);
this.pnBoxReprint.Controls.Add(this.label24);
this.pnBoxReprint.Location = new System.Drawing.Point(560, 426);
this.pnBoxReprint.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
this.pnBoxReprint.Margin = new System.Windows.Forms.Padding(5);
this.pnBoxReprint.Name = "pnBoxReprint";
this.pnBoxReprint.Size = new System.Drawing.Size(1397, 151);
this.pnBoxReprint.TabIndex = 25;
@ -574,7 +574,7 @@
//
this.btnPrintCancel.Font = new System.Drawing.Font("宋体", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnPrintCancel.Location = new System.Drawing.Point(1197, 43);
this.btnPrintCancel.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
this.btnPrintCancel.Margin = new System.Windows.Forms.Padding(5);
this.btnPrintCancel.Name = "btnPrintCancel";
this.btnPrintCancel.Size = new System.Drawing.Size(160, 59);
this.btnPrintCancel.TabIndex = 3;
@ -586,7 +586,7 @@
//
this.btnRePrint.Font = new System.Drawing.Font("宋体", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnRePrint.Location = new System.Drawing.Point(1027, 40);
this.btnRePrint.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
this.btnRePrint.Margin = new System.Windows.Forms.Padding(5);
this.btnRePrint.Name = "btnRePrint";
this.btnRePrint.Size = new System.Drawing.Size(160, 59);
this.btnRePrint.TabIndex = 2;
@ -598,7 +598,7 @@
//
this.txtRePrintBoxCode.Font = new System.Drawing.Font("宋体", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.txtRePrintBoxCode.Location = new System.Drawing.Point(208, 43);
this.txtRePrintBoxCode.Margin = new System.Windows.Forms.Padding(5, 5, 5, 5);
this.txtRePrintBoxCode.Margin = new System.Windows.Forms.Padding(5);
this.txtRePrintBoxCode.Name = "txtRePrintBoxCode";
this.txtRePrintBoxCode.Size = new System.Drawing.Size(737, 55);
this.txtRePrintBoxCode.TabIndex = 1;
@ -615,6 +615,12 @@
this.label24.Text = "箱单号:";
this.label24.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// timer1
//
this.timer1.Enabled = true;
this.timer1.Interval = 5000;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// FrmBarCodeSearch2408
//
this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F);
@ -687,5 +693,6 @@
private System.Windows.Forms.Label label24;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.Button btnChangeSizeR;
private System.Windows.Forms.Timer timer1;
}
}

710
InjectionSearch/FrmBarCodeSearch2408.cs

@ -10,6 +10,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using grproLib;
using MESClassLibrary;
using MESClassLibrary.BLL;
using MESClassLibrary.BLL.BasicInfo;
using MESClassLibrary.BLL.Injection;
@ -31,6 +32,7 @@ namespace InjectionSearch
private BarCodeBLL _bll = new BarCodeBLL();
private WmsBLL _wmsBll = new WmsBLL();
private string _lastBoxNo = string.Empty;
private BarCodeBLL _barCodeBLL = new BarCodeBLL();
public FrmBarCodeSearch2408()
{
InitializeComponent();
@ -138,9 +140,9 @@ namespace InjectionSearch
comboBox2.Items.Add("IM19");
comboBox2.Items.Add("IM20");
GetClass();
textBox3.Text = Program.ProductDate.Substring(2, 2) + Program.ProductDate.Substring(5, 2) +
Program.ProductDate.Substring(8, 2); //批次
//textBox3.Text = Program.ProductDate.Substring(2, 2) + Program.ProductDate.Substring(5, 2) +
// Program.ProductDate.Substring(8, 2); //批次
textBox3.Text = GetBatch(true);
//comBoxSizeL.DataSource = _basicBLL1.GetPackageSize();
//comBoxSizeL.DisplayMember = "describe";
//comBoxSizeL.ValueMember = "Count";
@ -177,101 +179,7 @@ namespace InjectionSearch
}
}
//private void label18_Click(object sender, EventArgs e)
//{
// string code = "",name="";
// BarCodeModel md = new BarCodeModel();
// BarCodeBLL bll = new BarCodeBLL();
// ProductBLL pbll=new ProductBLL();
// string filename = "", partNo = "", OneCode="";
// try
// {
// if (glacialList1.SelectedItems.Count == 0)
// {
// MessageBox.Show("请选择要补打的条码!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
// return;
// }
// else
// {
// GlacialComponents.Controls.GLItem gv;
// gv = glacialList1.SelectedItems[0] as GlacialComponents.Controls.GLItem;
// code = gv.Text;
// string[] aa = code.Split('.');
// partNo = aa[0];
// DataTable dt = bll.SearchInfoByBarCode(code);
// if (dt != null && dt.Rows.Count > 0)
// {
// name = dt.Rows[0]["ProductName"].ToString();
// md.ID = Guid.NewGuid().ToString();
// md.BarCode = code;
// md.StationID = Program.StationID;
// md.StockNo = dt.Rows[0]["StockNo"].ToString();
// md.OneBarCode = dt.Rows[0]["OneBarCode"].ToString();
// md.StationID2 = dt.Rows[0]["StationID"].ToString();
// md.PrintType = 2;
// DataTable pdt = pbll.SearchIsImportByStockNo(md.StockNo);
// if (pdt != null && pdt.Rows.Count > 0)
// {
// if (pdt.Rows[0]["isImport"].ToString() == "1")
// {
// md.Import = "国产料Kingfa";
// }
// else
// {
// md.Import = "";
// }
// }
// }
// //if (bll.Add_Info_New(md, "tb_BarCode5") == false)
// //{
// // return;
// //}
// if (SaveBarCode(md, "tb_BarCode5", false) == false)
// {
// return;
// }
// #region 打印条码
// PlasticBLL plbll = new PlasticBLL();
// //filename = System.AppDomain.CurrentDomain.BaseDirectory + "单个条码.grf";
// filename = System.AppDomain.CurrentDomain.BaseDirectory + PrintMoudleName();
// DataTable headTable = new DataTable();
// headTable.Columns.Add("PrintTime");
// headTable.Columns.Add("PartNo");
// headTable.Columns.Add("PartName");
// headTable.Columns.Add("OneBarCode");
// headTable.Columns.Add("BarCode");
// DataRow row = headTable.NewRow();
// row["PrintTime"] = GetDateTime().ToString("yyyy/MM/dd HH:mm:ss");
// row["PartNo"] = partNo;
// row["PartName"] = name;
// row["OneBarCode"] = md.OneBarCode;
// row["BarCode"] = code;
// string reportName = ConfigurationManager.AppSettings["Printer1"].ToString();
// headTable.Rows.Add(row);
// ReportHelper rp = new ReportHelper(filename, headTable, null, (int)GRPaperOrientation.grpoDefault, 1, reportName);
// rp.Report.Print(false);
// #endregion
// initBarCode();
// }
// }
// catch (Exception ex)
// {
// LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
// }
//}
public DateTime GetDateTime()
{
@ -453,7 +361,7 @@ namespace InjectionSearch
}
else
{
packageCode = lbPackageCodeL.Text.Trim();
lbPackageCodeL.Text= packageCode;
}
if (string.IsNullOrEmpty(packageCode))
{
@ -506,12 +414,13 @@ namespace InjectionSearch
//}
if(SaveBarCode(md, "tb_BarCode5", i== Convert.ToInt32(textBox4.Text.Trim())) == false)
{
return;
LogErrBLL.AddInfo("手动批量打印条码" + md.OneBarCode + "报错", MethodBase.GetCurrentMethod());
//return;
}
#region 214TrunkBox存入质检表
if (partNo == "A2146106203kz")
if (partNo == "A2146106203kz")
{
tb_Inspection_tx imd = new tb_Inspection_tx();
InspectionBLL ibll = new InspectionBLL();
@ -530,7 +439,7 @@ namespace InjectionSearch
#region 打印条码
//filename = System.AppDomain.CurrentDomain.BaseDirectory + "单个条码.grf";
filename = System.AppDomain.CurrentDomain.BaseDirectory + PrintMoudleName();
filename = System.AppDomain.CurrentDomain.BaseDirectory + PrintMoudleName("0");
DataTable headTable = new DataTable();
headTable.Columns.Add("PrintTime");
headTable.Columns.Add("PartNo");
@ -556,183 +465,6 @@ namespace InjectionSearch
}
}
#region 原有打印代码
//DataTable dt = bll.SearchSerialNoByBarCodeNew(partNo + "." + textBox3.Text.Trim(),"");
//if (dt != null && dt.Rows.Count > 0)
//{
// OneCode = dt.Rows[0]["OneBarCode"].ToString().Trim();
// code = dt.Rows[0]["BarCode"].ToString().TrimEnd();
// for (int i = 1; i <= Convert.ToInt32(textBox4.Text.Trim()); i++)
// {
// //newcode = code.Substring(0, code.Length - 4) +
// // (Convert.ToInt32(code.Substring(code.Length - 4, 4)) + i)
// // .ToString()
// // .PadLeft(4, '0');
// //NewOneCode = OneCode.Substring(0, OneCode.Length - 4) +
// // (Convert.ToInt32(OneCode.Substring(OneCode.Length - 4, 4)) + i).ToString()
// // .PadLeft(4, '0');
// GetSjBarCode(stockNo, partNo, ref NewOneCode, ref newcode);
// string[] part = newcode.Split('.');
// //存入tb_BarCode表
// md.ID = Guid.NewGuid().ToString();
// md.StationID = Program.StationID;
// md.StationID2 = stationID;
// md.StockNo = stockNo;
// md.OneBarCode = NewOneCode;
// md.BarCode = newcode;
// md.PrintType = 1;
// md.PartNo = partNo;
// md.PlanID = planID;
// md.ProductNature = ProductNature;
// DataTable pdt = pbll.SearchIsImportByStockNo(stockNo);
// if (pdt != null && pdt.Rows.Count > 0)
// {
// PartName = pdt.Rows[0]["ProductName"].ToString();
// if (pdt.Rows[0]["isImport"].ToString() == "1")
// {
// md.Import = "国产料Kingfa";
// }
// else
// {
// md.Import = "";
// }
// }
// if (bll.Add_Info_New(md, "tb_BarCode5") == false)
// {
// return;
// }
// #region 214TrunkBox存入质检表
// if (partNo == "A2146106203kz")
// {
// tb_Inspection_tx imd = new tb_Inspection_tx();
// InspectionBLL ibll = new InspectionBLL();
// imd.BarCode = NewOneCode;
// imd.IsOK =1;
// imd.Station = 1;
// ibll.AddInfo(imd);
// }
// #endregion
// if (IsPrint == "1")
// {
// #region 打印条码
// filename = System.AppDomain.CurrentDomain.BaseDirectory + "单个条码.grf";
// DataTable headTable = new DataTable();
// headTable.Columns.Add("PrintTime");
// headTable.Columns.Add("PartNo");
// headTable.Columns.Add("PartName");
// headTable.Columns.Add("OneBarCode");
// headTable.Columns.Add("BarCode");
// DataRow row = headTable.NewRow();
// row["PrintTime"] = GetDateTime().ToString("yyyy/MM/dd HH:mm:ss");
// row["PartNo"] = partNo;
// row["PartName"] = PartName;
// row["OneBarCode"] = NewOneCode;
// row["BarCode"] = newcode;
// string reportName = ConfigurationManager.AppSettings["Printer1"].ToString();
// headTable.Rows.Add(row);
// ReportHelper rp = new ReportHelper(filename, headTable, null, (int)GRPaperOrientation.grpoDefault, 1, reportName);
// rp.Report.Print(false);
// #endregion
// }
// }
//}
//else
//{
// for (int i = 1; i <= Convert.ToInt32(textBox4.Text.Trim()); i++)
// {
// newcode = partNo + "." + textBox3.Text.Trim() + "." + i.ToString().PadLeft(4, '0');
// NewOneCode = stockNo + textBox3.Text.Trim() + i.ToString().PadLeft(4, '0');
// string[] part = newcode.Split('.');
// //存入tb_BarCode表
// md.ID = Guid.NewGuid().ToString();
// md.StationID = Program.StationID;
// md.StationID2 = stationID;
// md.StockNo = stockNo;
// md.OneBarCode = NewOneCode;
// md.BarCode = newcode;
// md.PrintType = 1;
// md.PartNo = partNo;
// md.PlanID = planID;
// md.ProductNature = ProductNature;
// DataTable pdt = pbll.SearchIsImportByStockNo(stockNo);
// if (pdt != null && pdt.Rows.Count > 0)
// {
// PartName = pdt.Rows[0]["ProductName"].ToString();
// if (pdt.Rows[0]["isImport"].ToString() == "1")
// {
// md.Import = "国产料Kingfa";
// }
// else
// {
// md.Import = "";
// }
// }
// if (bll.Add_Info_New(md, "tb_BarCode5") == false)
// {
// return;
// }
// #region 214TrunkBox存入质检表
// if (partNo == "A2146106203kz")
// {
// tb_Inspection_tx imd = new tb_Inspection_tx();
// InspectionBLL ibll = new InspectionBLL();
// imd.BarCode = NewOneCode;
// imd.IsOK = 1;
// imd.Station = 1;
// ibll.AddInfo(imd);
// }
// #endregion
// if (IsPrint == "1")
// {
// #region 打印条码
// filename = System.AppDomain.CurrentDomain.BaseDirectory + "单个条码.grf";
// DataTable headTable = new DataTable();
// headTable.Columns.Add("PrintTime");
// headTable.Columns.Add("PartNo");
// headTable.Columns.Add("PartName");
// headTable.Columns.Add("OneBarCode");
// headTable.Columns.Add("BarCode");
// DataRow row = headTable.NewRow();
// row["PrintTime"] = GetDateTime().ToString("yyyy/MM/dd HH:mm:ss");
// row["PartNo"] = partNo;
// row["PartName"] = PartName;
// row["OneBarCode"] = NewOneCode;
// row["BarCode"] = newcode;
// string reportName = ConfigurationManager.AppSettings["Printer1"].ToString();
// headTable.Rows.Add(row);
// ReportHelper rp = new ReportHelper(filename, headTable, null, (int)GRPaperOrientation.grpoDefault, 1, reportName);
// rp.Report.Print(false);
// #endregion
// }
// }
//}
#endregion
}
#endregion
@ -760,6 +492,15 @@ namespace InjectionSearch
MessageBox.Show("箱单生成失败,请重新操作!");
return;
}
else
{
lbPackageCodeL.Text = packageCode;
}
if (string.IsNullOrEmpty(packageCode))
{
MessageBox.Show("箱单生成失败,请重新操作!");
return;
}
}
else
{
@ -813,7 +554,8 @@ namespace InjectionSearch
//}
if (SaveBarCode(md, "tb_BarCode5", i == Convert.ToInt32(textBox4.Text.Trim())) == false)
{
return;
LogErrBLL.AddInfo("手动批量打印条码" + md.OneBarCode + "报错", MethodBase.GetCurrentMethod());
//return;
}
#endregion
@ -823,7 +565,7 @@ namespace InjectionSearch
#region 打印条码
//filename = System.AppDomain.CurrentDomain.BaseDirectory + "单个条码1.grf";
filename = System.AppDomain.CurrentDomain.BaseDirectory + PrintMoudleName();
filename = System.AppDomain.CurrentDomain.BaseDirectory + PrintMoudleName("1");
DataTable headTable = new DataTable();
headTable.Columns.Add("PrintTime");
@ -850,156 +592,6 @@ namespace InjectionSearch
}
}
#region 原来打印代码
//DataTable dt = bll.SearchSerialNoByBarCodeNew1(partNo + "#" + QLevel + "#" + textBox3.Text.Trim() + "#");
//if (dt != null && dt.Rows.Count > 0)
//{
// code = dt.Rows[0]["BarCode"].ToString().Trim();
// for (int i = 1; i <= Convert.ToInt32(textBox2.Text.Trim()); i++)
// {
// newcode = code.Substring(0, code.Length - 4) +
// (Convert.ToInt32(code.Substring(23, 3)) +
// i).ToString()
// .PadLeft(3, '0') + "#";
// #region 插入数据tb_barCode
// md.ID = Guid.NewGuid().ToString();
// md.StationID = Program.StationID;
// md.StationID2 = stationID;
// md.StockNo = stockNo;
// md.OneBarCode = "";
// md.BarCode = newcode;
// md.PrintType = 1;
// md.PartNo = partNo;
// md.PlanID = planID;
// md.ProductNature = ProductNature;
// DataTable dt2 = pbll.SearchIsImportByPartNo(partNo);
// if (dt2 != null && dt2.Rows.Count > 0)
// {
// if (dt2.Rows[0]["isImport"].ToString() == "1")
// {
// md.Import = "国产料Kingfa";
// }
// else
// {
// md.Import = "";
// }
// }
// if (bll.Add_Info_New(md, "tb_BarCode5") == false)
// {
// return;
// }
// #endregion
// if (IsPrint == "1")
// {
// #region 打印条码
// filename = System.AppDomain.CurrentDomain.BaseDirectory +
// "单个条码1.grf";
// DataTable headTable = new DataTable();
// headTable.Columns.Add("PrintTime");
// headTable.Columns.Add("PartNo");
// headTable.Columns.Add("PartName");
// headTable.Columns.Add("OneBarCode");
// headTable.Columns.Add("BarCode");
// DataRow row = headTable.NewRow();
// row["PrintTime"] = GetDateTime().ToString("yyyy/MM/dd HH:mm:ss");
// row["PartNo"] = partNo;
// row["PartName"] = PartName;
// row["OneBarCode"] = NewOneCode;
// row["BarCode"] = newcode;
// string reportName = ConfigurationManager.AppSettings["Printer1"].ToString();
// headTable.Rows.Add(row);
// ReportHelper rp = new ReportHelper(filename, headTable, null, (int)GRPaperOrientation.grpoDefault, 1, reportName);
// rp.Report.Print(false);
// #endregion
// }
// }
//}
//else
//{
// for (int i = 1; i <= Convert.ToInt32(textBox4.Text.Trim()); i++)
// {
// newcode = partNo + "#" + QLevel + "#" + textBox3.Text.Trim() + "#" +
// i.ToString().PadLeft(3, '0') + "#";
// NewOneCode = "";
// string[] part = newcode.Split('.');
// #region 存入tb_BarCode表
// md.ID = Guid.NewGuid().ToString();
// md.StationID = Program.StationID;
// md.StationID2 = stationID;
// md.StockNo = stockNo;
// md.OneBarCode = NewOneCode;
// md.BarCode = newcode;
// md.PrintType = 1;
// md.PartNo = partNo;
// md.PlanID = planID;
// md.ProductNature = ProductNature;
// DataTable pdt = pbll.SearchIsImportByStockNo(stockNo);
// if (pdt != null && pdt.Rows.Count > 0)
// {
// if (pdt.Rows[0]["isImport"].ToString() == "1")
// {
// md.Import = "国产料Kingfa";
// }
// else
// {
// md.Import = "";
// }
// }
// if (bll.Add_Info_New(md, "tb_BarCode5") == false)
// {
// return;
// }
// #endregion
// if (IsPrint == "1")
// {
// #region 打印条码
// filename = System.AppDomain.CurrentDomain.BaseDirectory +
// "单个条码1.grf";
// DataTable headTable = new DataTable();
// headTable.Columns.Add("PrintTime");
// headTable.Columns.Add("PartNo");
// headTable.Columns.Add("PartName");
// headTable.Columns.Add("OneBarCode");
// headTable.Columns.Add("BarCode");
// DataRow row = headTable.NewRow();
// row["PrintTime"] = GetDateTime().ToString("yyyy/MM/dd HH:mm:ss");
// row["PartNo"] = partNo;
// row["PartName"] = PartName;
// row["OneBarCode"] = NewOneCode;
// row["BarCode"] = newcode;
// string reportName = ConfigurationManager.AppSettings["Printer1"].ToString();
// headTable.Rows.Add(row);
// ReportHelper rp = new ReportHelper(filename, headTable, null, (int)GRPaperOrientation.grpoDefault, 1, reportName);
// rp.Report.Print(false);
// #endregion
// }
// }
//}
#endregion
}
#endregion
@ -1036,6 +628,7 @@ namespace InjectionSearch
boxmd.Mould = "2";
boxmd.StandardQty = packageSize.ToString();
//生成后先存上
if(_injectionBoxBLL.AddInfo(boxmd))
{
this.lbPackageCodeL.Text = packageCode;
@ -1043,60 +636,178 @@ namespace InjectionSearch
}
return null;
}
bool SaveBarCode(BarCodeModel bcm, string tableName , bool printBox)
private BarCodeModel _lastFailedModel = null;
bool SaveBarCode(BarCodeModel bcm, string tableName, bool printBox)
{
bool saveRst = false;
if (_lastFailedModel != null)
{
Save(_lastFailedModel, tableName, printBox);
_lastFailedModel = null;
}
if (cboxHandBox.Checked)
{
saveRst = _bll.Add_Info_New(bcm, "tb_BarCode5");
if(saveRst == true)
Save(bcm, tableName, printBox);
//if (cboxHandBox.Checked)
//{
// bool isSuccess = false;
// DataTable boxTable = null;
// int realCount = 0;
// int sizeCount = 0;
// LocalDBService local = new LocalDBService(SqlHelper.GetConnSting());
// try
// {
// local.BeginTrans();
// saveRst = _bll.Add_Info_New(local, bcm, "tb_BarCode5", "5");
// if (_injectionBoxBLL.UpdateBoxCount(local, bcm.BoxNo, 1))
// {
// boxTable = _injectionBoxBLL.SearchBox(bcm.BoxNo);
// if (boxTable.Rows.Count > 0)
// {
// string realCountStr = boxTable.Rows[0]["BoxCount"].ToString();
// int.TryParse(realCountStr, out realCount);
// int.TryParse(comBoxSizeL.SelectedValue?.ToString(), out sizeCount);
// if ((realCount != 0 && realCount == sizeCount) || printBox == true)
// {
// _wmsBll.SaveInterface(local, bcm, "", comboBox2.Text.Trim());
// isSuccess = true;
// }
// }
// }
// local.Commit();
// }
// catch (Exception ex)
// {
// if (local != null)
// {
// local.Rollback();
// }
// LogErrBLL.AddInfo("手动批量打印条码" + bcm.OneBarCode + "报错", MethodBase.GetCurrentMethod());
// _lastFailedModel = bcm;
// }
// finally
// {
// if (local != null)
// {
// local.EndTrans();
// }
// }
// //保存后打印箱单
// if (isSuccess)
// {
// //打印箱码
// PrintBoxCode(boxTable.Rows[0], realCount, false);
// _lastBoxNo = lbPackageCodeL.Text;
// lbPackageCodeL.Text = "";
// }
//}
}
else
{
try
{
if (_injectionBoxBLL.UpdateBoxCount(bcm.BoxNo,1))
saveRst = _bll.Add_Info_New(bcm, "tb_BarCode5", "5");
if (saveRst == false)
{
DataTable dt = _injectionBoxBLL.SearchBox(bcm.BoxNo);
if (dt.Rows.Count > 0)
_lastFailedModel = bcm;
}
}
catch(Exception ex)
{
_lastFailedModel = bcm;
}
}
return saveRst;
}
void Save(BarCodeModel bcm, string tableName, bool printBox)
{
bool saveRst = false;
if (cboxHandBox.Checked)
{
bool isSuccess = false;
DataTable boxTable = null;
int realCount = 0;
int sizeCount = 0;
LocalDBService local = new LocalDBService(SqlHelper.GetConnSting());
try
{
local.BeginTrans();
saveRst = _bll.Add_Info_New(local, bcm, "tb_BarCode5", "5");
if (_injectionBoxBLL.UpdateBoxCount(local, bcm.BoxNo, 1))
{
boxTable = _injectionBoxBLL.SearchBox(local,bcm.BoxNo);
if (boxTable.Rows.Count > 0)
{
string realCountStr = dt.Rows[0]["BoxCount"].ToString();
string realCountStr = boxTable.Rows[0]["BoxCount"].ToString();
int realCount = 0;
int sizeCount = 0;
int.TryParse(realCountStr, out realCount);
int.TryParse(comBoxSizeL.SelectedValue?.ToString(), out sizeCount);
if ((realCount != 0 && realCount == sizeCount) || printBox ==true)
if ((realCount != 0 && realCount == sizeCount) || printBox == true)
{
//检查上一个箱码是否给wms传成功了, 没成功重传一次.
//if (!string.IsNullOrEmpty(_lastBoxNo))
//{
// if(_wmsBll.IsSendPackageCode(_lastBoxNo) == false)
// {
// DataTable dt2 = _injectionBoxBLL.SearchBox(_lastBoxNo);
// if(dt2.Rows.Count >0)
// {
// _wmsBll.SaveInterface(dt2.Rows[0], MESClassLibrary.Enum.WmsInterfaceEnum.塑件箱码报工);
// }
// }
// _lastBoxNo = "";
//}
////wms接口传递
//_wmsBll.SaveInterface(dt.Rows[0], MESClassLibrary.Enum.WmsInterfaceEnum.塑件箱码报工);
_wmsBll.SaveInterface(dt.Rows[0]["BoxNo"].ToString(), _lastBoxNo, "", MESClassLibrary.Enum.WmsInterfaceEnum., comboBox2.Text.Trim());
//打印箱码
PrintBoxCode(dt.Rows[0], realCount,false);
_lastBoxNo = lbPackageCodeL.Text;
lbPackageCodeL.Text = "";
_wmsBll.SaveInterface(local, bcm, "", comboBox2.Text.Trim());
isSuccess = true;
}
}
}
local.Commit();
}
catch (Exception ex)
{
if (local != null)
{
local.Rollback();
}
LogErrBLL.AddInfo("手动批量打印条码" + bcm.OneBarCode + "报错", MethodBase.GetCurrentMethod());
_lastFailedModel = bcm;
}
finally
{
if (local != null)
{
local.EndTrans();
}
}
//保存后打印箱单
if (isSuccess)
{
//打印箱码
PrintBoxCode(boxTable.Rows[0], realCount, false);
_lastBoxNo = lbPackageCodeL.Text;
lbPackageCodeL.Text = "";
}
}
else
{
saveRst = _bll.Add_Info_New(bcm, "tb_BarCode5");
try
{
bool rst = _bll.Add_Info_New(bcm, "tb_BarCode5", "5");
if (rst == false)
{
_lastFailedModel = bcm;
}
}
catch (Exception ex)
{
_lastFailedModel = bcm;
}
}
return saveRst;
}
private void PrintBoxCode(DataRow boxRow, int realCount,bool isRePrint)
{
@ -1146,9 +857,9 @@ namespace InjectionSearch
// pnBoxReprint.Visible = true;
//}
}
private void UpdateBoxRecordPrintState(string UpdatePrinted)
private void UpdateBoxRecordPrintState(string boxCode)
{
_injectionBoxBLL.UpdatePrinted(UpdatePrinted);
_injectionBoxBLL.UpdatePrinted(boxCode);
}
private void button1_Click(object sender, EventArgs e)
@ -1210,7 +921,8 @@ namespace InjectionSearch
string batch = string.Empty;
if (autoPrint)
{
batch = Program.ProductDate.Substring(2, 2) + Program.ProductDate.Substring(5, 2) + Program.ProductDate.Substring(8, 2);
// batch = Program.ProductDate.Substring(2, 2) + Program.ProductDate.Substring(5, 2) + Program.ProductDate.Substring(8, 2);
batch = GetBatch(true);
}
else
{
@ -1227,7 +939,8 @@ namespace InjectionSearch
string batch = string.Empty;
if (autoPrint)
{
batch = Program.ProductDate.Substring(2, 2) + Program.ProductDate.Substring(5, 2) + Program.ProductDate.Substring(8, 2);
// batch = Program.ProductDate.Substring(2, 2) + Program.ProductDate.Substring(5, 2) + Program.ProductDate.Substring(8, 2);
batch = GetBatch(true);
}
else
{
@ -1384,32 +1097,55 @@ namespace InjectionSearch
comBoxSizeL.Enabled = false;
}
string PrintMoudleName()
string PrintMoudleName(string isSupply)
{
string stationName = comboBox2.Text.Trim();
return BussinessHelper.PrintMoudleName(stationName, isSupply);
//if ("IM05,IM08,IM10".Contains(stationName)) //二维小条码
//{
// return "单个条码2.grf";
//}
//else if ("IM06,IM07,IM09,IM11,IM12,".Contains(stationName)) //一维条码
//{
// return "单个条码.grf";
//}
if ("IM05,IM08,IM10".Contains(stationName)) //二维小条码
{
return "单个条码2.grf";
}
else if ("IM06,IM07,IM09,IM11,IM12,".Contains(stationName)) //一维条码
{
return "单个条码.grf";
}
//else if ("IM01,IM02,IM03,IM04,IM15,IM18,IM20".Contains(stationName)) //小米大条码
//{
// return "Sill.grf";
//}
//else if ("IM13,IM14".Contains(stationName)) //直供条码
//{
// return "单个条码1.grf";
//}
//else
//{
// return "单个条码2.grf";
//}
else if ("IM01,IM02,IM03,IM04,IM15,IM18,IM20".Contains(stationName)) //小米大条码
{
return "Sill.grf";
}
else if ("IM13,IM14".Contains(stationName)) //直供条码
}
string GetBatch(bool isAutoPrint)
{
string batch = string.Empty;
if (isAutoPrint)
{
return "单个条码1.grf";
DateTime dt = DateTime.Now;
if (DateTime.TryParse(Program.ProductDate, out dt) == false)
{
dt = DateTime.Now;
}
batch = dt.ToString("yyMMdd");
// batch = Program.ProductDate.Substring(2, 2) + Program.ProductDate.Substring(5, 2) + Program.ProductDate.Substring(8, 2);
}
else
{
return "单个条码2.grf";
batch = textBox1.Text.Trim();
}
return batch;
}
private void timer1_Tick(object sender, EventArgs e)
{
Program.ProductDate = _barCodeBLL.GetServiceTime().ToString();
}
}
}

3
InjectionSearch/FrmBarCodeSearch2408.resx

@ -117,4 +117,7 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

41
MESClassLibrary/BLL/BasicInfo/BarCodeBLL.cs

@ -88,11 +88,11 @@ namespace MESClassLibrary.BLL.BasicInfo
}
}
public bool Add_Info_New(BarCodeModel md,string tableName)
public bool Add_Info_New(BarCodeModel md,string tableName,string isNew="1")
{
try
{
return db.AddInfoNew(md,tableName);
return db.AddInfoNew(md,tableName, isNew);
}
catch (Exception ex)
{
@ -100,20 +100,23 @@ namespace MESClassLibrary.BLL.BasicInfo
return false;
}
}
public bool Add_Info_New(LocalDBService local, BarCodeModel md, string tableName)
public bool Add_Info_New(LocalDBService local,BarCodeModel md, string tableName, string isNew = "1")
{
try
{
return db.AddInfoNew(md, tableName);
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return false;
}
return db.AddInfoNew(local, md, tableName, isNew);
}
//public bool Add_Info_New(LocalDBService local, BarCodeModel md, string tableName)
//{
// try
// {
// return db.AddInfoNew(md, tableName);
// }
// catch (Exception ex)
// {
// LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
// return false;
// }
//}
/// <summary>
/// 补打
/// </summary>
@ -121,8 +124,9 @@ namespace MESClassLibrary.BLL.BasicInfo
/// <param name="tableName"></param>
/// <param name="oldOneBarCode"></param>
/// <param name="oldBarCode"></param>
/// <param name="isNew">是否新的 0:老程序 1:新程序正常打印 2:手动箱箱码插入数据</param>
/// <returns></returns>
public string ReprintSave(BarCodeModel md, string tableName,string oldOneBarCode,string oldBarCode,string station)
public string ReprintSave(BarCodeModel md, string tableName,string oldOneBarCode,string oldBarCode,string station,string isNew)
{
LocalDBService local = new LocalDBService(SqlHelper.GetConnSting());
try
@ -136,7 +140,7 @@ namespace MESClassLibrary.BLL.BasicInfo
//tb_barCode 插入 printType=2 补打
db.AddInfoNew(local, md, tableName);
db.AddInfoNew(local, md, tableName, isNew);
if (!string.IsNullOrEmpty(oldOneBarCode))
{
if (!string.IsNullOrEmpty(md.BoxNo))
@ -644,5 +648,10 @@ namespace MESClassLibrary.BLL.BasicInfo
return false;
}
}
public DateTime GetServiceTime()
{
return db.GetDateTime();
}
}
}

22
MESClassLibrary/BLL/Injection/PLCBreakBLL.cs

@ -26,5 +26,27 @@ namespace MESClassLibrary.BLL.Injection
return null;
}
}
/// <summary>
/// 记录接收到PLC 信号的记录
/// </summary>
/// <param name="stationNo"></param>
/// <param name="TransactionID"></param>
/// <param name="NumItems"></param>
/// <param name="partCode1"></param>
/// <param name="partCode2"></param>
/// <param name="planCode"></param>
/// <returns></returns>
public bool SavePlcReceive(string stationNo, int TransactionID, int NumItems, string partCode1, string planCode, string pageType)
{
try
{
return da.SavePlcReceive(stationNo, TransactionID, NumItems, partCode1, planCode, pageType);
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return false ;
}
}
}
}

12
MESClassLibrary/BLL/Inspection/InjectionBoxBLL.cs

@ -80,6 +80,18 @@ namespace MESClassLibrary.BLL.Inspection
return null;
}
}
public DataTable SearchBox(LocalDBService local, string BoxNo)
{
try
{
return db.SearchBox(local,BoxNo);
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return null;
}
}
public DataTable SearchUnBox(string stationID, string mould)
{
try

13
MESClassLibrary/BLL/Wms/WmsBLL.cs

@ -18,14 +18,23 @@ namespace MESClassLibrary.BLL.Injection
private WmsDAL da=new WmsDAL();
private BarCodeDAl barCodeDal = new BarCodeDAl();
public string SaveRecordAndInterface(BarCodeModel bcm,string tableName,string badReason, string station)
/// <summary>
/// 单条码模式保存订单和接口数据
/// </summary>
/// <param name="bcm"></param>
/// <param name="tableName"></param>
/// <param name="badReason"></param>
/// <param name="station"></param>
/// <param name="isNew"></param>
/// <returns></returns>
public string SaveRecordAndInterface(BarCodeModel bcm,string tableName,string badReason, string station,string isNew)
{
LocalDBService local = new LocalDBService(SqlHelper.GetConnSting());
try
{
local.BeginTrans();
barCodeDal.AddInfoNew(local, bcm, tableName);
barCodeDal.AddInfoNew(local, bcm, tableName, isNew);
da.SaveInterface(local, bcm, badReason, station);
local.Commit();
}

20
MESClassLibrary/DAL/BasicInfo/BarCodeDAl.cs

@ -266,14 +266,14 @@ namespace MESClassLibrary.DAL.BasicInfo
}
}
public bool AddInfoNew(BarCodeModel md,string tableName)
public bool AddInfoNew(BarCodeModel md,string tableName, string isNew)
{
try
{
#region 添加数据
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 = "INSERT INTO " + tableName + " (ID,StationID,OneBarCode,[BarCode],[StockNo],[PartNo],[PrintType],[CreateTime],[IsImport],StationID2,PlanID,ProductNature,Des1,Des2,Des3,Des4,Des5,BoxNo,IsNew,Weight";
sql += ") VALUES (";
sql += "@ID,";
sql += "@StationID,";
@ -294,10 +294,11 @@ namespace MESClassLibrary.DAL.BasicInfo
sql += "@Des4,";
sql += "@Des5,";
sql += "@BoxNo,";
sql += "@IsNew,";
sql += "@Weight)";
#region 添加参数
param = new SqlParameter[18];
param = new SqlParameter[19];
param[0] = new SqlParameter("@ID", SqlDbType.VarChar);
param[0].Value = md.ID;
@ -349,8 +350,11 @@ namespace MESClassLibrary.DAL.BasicInfo
param[16] = new SqlParameter("@BoxNo", SqlDbType.VarChar);
param[16].Value = md.BoxNo;
param[17] = new SqlParameter("@Weight", SqlDbType.Decimal);
param[17].Value = md.Weight;
param[17] = new SqlParameter("@IsNew", SqlDbType.VarChar);
param[17].Value = isNew;
param[18] = new SqlParameter("@Weight", SqlDbType.Decimal);
param[18].Value = md.Weight;
#endregion
@ -364,14 +368,14 @@ namespace MESClassLibrary.DAL.BasicInfo
return false;
}
}
public bool AddInfoNew(LocalDBService local, BarCodeModel md, string tableName)
public bool AddInfoNew(LocalDBService local, BarCodeModel md, string tableName,string isNew)
{
string sql = "";
sql = "INSERT INTO " + tableName + " (ID,StationID,OneBarCode,[BarCode],[StockNo],[PartNo],[PrintType],[CreateTime],[IsImport],StationID2,PlanID,ProductNature,Des1,Des2,Des3,Des4,Des5,BoxNo,Weight,BatchNo";
sql = "INSERT INTO " + tableName + " (ID,StationID,OneBarCode,[BarCode],[StockNo],[PartNo],[PrintType],[CreateTime],[IsImport],StationID2,PlanID,ProductNature,Des1,Des2,Des3,Des4,Des5,BoxNo,Weight,BatchNo,IsNew";
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}','{ md.BatchNo}')";
$"'{md.StationID2}','{md.PlanID}','{md.ProductNature}','{md.Des1}','{md.Des2}','{md.Des3}','{md.Des4}','{md.Des5}','{md.BoxNo}','{ md.Weight}','{ md.BatchNo}','{isNew}')";
return local.Exec_NonQuery(sql);

6
MESClassLibrary/DAL/Injection/InjectionBoxDAL.cs

@ -222,6 +222,12 @@ namespace MESClassLibrary.DAL.Injection
return null;
}
}
public DataTable SearchBox(LocalDBService local, string BoxNo)
{
string sql = @"select * from " + TableName + $" with(nolock) where BoxNo='{BoxNo}'";
return local.Exec_DataSet(sql).Tables[0];
}
public DataTable SearchUnBox(string stationID,string mould)
{
try

16
MESClassLibrary/DAL/Injection/PLCBreakDAL.cs

@ -24,5 +24,21 @@ namespace MESClassLibrary.DAL.Injection
return null;
}
}
public bool SavePlcReceive(string stationNo,int TransactionID, int NumItems ,string partCode1,string planCode,string pageType )
{
try
{
string sql2 = $"insert into tb_PlcReceiveRecords(StationNo,TransactionID,NumItems,PartCode1,PlanCode,PageType)" +
$" values ('{stationNo}','{TransactionID}','{NumItems}','{partCode1}','{planCode}','{pageType}' )";
SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(), CommandType.Text, sql2, null);
return true;
}
catch (Exception ex)
{
LogErrBLL.AddInfo(stationNo + "记录设备接收信号次数记录错误. " +ex.ToString(), MethodBase.GetCurrentMethod());
return false;
}
}
}
}

1
MESClassLibrary/MESClassLibrary.csproj

@ -162,6 +162,7 @@
<Compile Include="BLL\ZPPlan\ZPStepRecordBLL.cs" />
<Compile Include="BLL\ZPPlan\ZPTagBLL.cs" />
<Compile Include="BLL\ZPPlan\ZPTagValueBLL.cs" />
<Compile Include="BussinessHelper.cs" />
<Compile Include="CommonTools.cs" />
<Compile Include="DAL\BaseDAL.cs" />
<Compile Include="DAL\BasicDAL.cs" />

14
PaintingPC/FrmQuality.cs

@ -26,7 +26,10 @@ namespace PaintingPC
private string _carType = string.Empty;
private Dictionary<string, string> _lastJustDict = new Dictionary<string, string>();
private string _foreighColor = string.Empty;
/// <summary>
/// 从tb_ForeignColorMap表得到的零件号
/// </summary>
private string _foreignPartCode = string.Empty;
public FrmQuality(bool isWmsQuality)
{
InitializeComponent();
@ -674,6 +677,7 @@ namespace PaintingPC
model1.damnPosition = position;
model1.reason = reason;
model1.remark3 = paintId;
model1.ForeignPartCode = _foreignPartCode;
if (!string.IsNullOrEmpty(_carType))
{
model1.CarType = _carType;
@ -782,7 +786,7 @@ namespace PaintingPC
}
}
}
private void LoadPage()
{
try
@ -1080,6 +1084,10 @@ namespace PaintingPC
labProPosition.Tag = paintId;
labProductInfo.Tag = Function.GetSide(barcode, paintId);
labProPosition.Text = labTitle.Text.Trim() + " " + labProductInfo.Tag.ToString().Replace(';', ' ');
if (info.Length == 4)
{
_foreignPartCode = info[3];
}
}
else
{
@ -1170,7 +1178,7 @@ namespace PaintingPC
lableFP.Text = "";
_foreighColor = "";
cboxAddColor.DataSource = null;
_foreignPartCode = "";
_carType = string.Empty;
}

33
PaintingPC/Function.cs

@ -1773,6 +1773,7 @@ namespace PaintingPC
,[remark3]
,[CarType]
,[AddMan]
,[ForeignPartCode]
)
VALUES
('" + model.barcode + @"'
@ -1791,7 +1792,8 @@ namespace PaintingPC
,'" + model.remark2 + @"'
,'" + model.remark3 + @"'
,'" + model.CarType + @"'
,'" + model.AddMan + @"'
,'" + model.AddMan + @"'
,'" + model.ForeignPartCode + @"'
);select @@Identity ";
//res = SqlHelper.ExecuteNonQuery(SqlHelper.SqlConnString, CommandType.Text, sql, null);
DataTable dt= SqlHelper.GetDataDateTable(SqlHelper.SqlConnString, CommandType.Text, sql, null);
@ -1816,7 +1818,7 @@ namespace PaintingPC
//string colorNo = "";
//string colorQQNo = "";
//string colorPRNo = "";
string colorInfo = "", paintCode = "", paintID = "";
string colorInfo = "", paintCode = "", paintID = "", typeCode = "";
string barCode1_1 = "", barCode1_2 = "", barCode1_3 = "", barCode1_4 = "", barCode1_5 = "", barCode1_6 = "",
barCode2_1 = "", barCode2_2 = "", barCode2_3 = "", barCode2_4 = "", barCode2_5 = "", barCode2_6 = "";
string columnName = "", side = "";
@ -1834,7 +1836,7 @@ namespace PaintingPC
string sql = @"
DECLARE @barcode varchar(30);
SET @barcode = '" + barcode + @"';
SELECT paintcode,
SELECT paintcode,TypeCode,
LTrim(RTrim(Side1_Data1)) as Side1_Data1,
LTrim(RTrim(Side1_Data2)) as Side1_Data2,
LTrim(RTrim(Side1_Data3)) as Side1_Data3,
@ -1869,12 +1871,37 @@ namespace PaintingPC
if (dtColor != null && dtColor.Rows.Count > 0)
{
paintCode = dtColor.Rows[0]["paintcode"].ToString();
typeCode = dtColor.Rows[0]["TypeCode"].ToString();
}
else
{
errorMsg = $"ForeignDB 没有条码[{barcode}]对应的数据";
}
if (!string.IsNullOrEmpty(typeCode) && paintCode.ToLower() != "na")
{
string sqlmap = @"select * from tb_ForeignColorMap where TypeCode='" + typeCode + @"'";
DataTable mapTable = SqlHelper.GetDataDateTable(SqlHelper.SqlConnString, CommandType.Text, sqlmap, null);
if(mapTable.Rows.Count > 0)
{
DataRow mapRow = mapTable.Rows[0];
string paintSql = @"select * from tb_PaintInfo where PaintCode='" + paintCode + @"'";
DataTable paintTable = SqlHelper.GetDataDateTable(SqlHelper.SqlConnString, CommandType.Text, sqlmap, null);
if(paintTable !=null && paintTable.Rows.Count > 0)
{
paintID = paintTable.Rows[0]["ID"].ToString();
res = mapRow["Color"] + "," + mapRow["PartName"] + "," + paintID+ "," + mapRow["PartCode"];
return res;
}
else
{
errorMsg = $"基础数据-油漆信息管理页面未配置油漆代码为{paintCode}的基础数据";
}
}
}
//根据颜色代码查颜色
if (!string.IsNullOrWhiteSpace(paintCode) && paintCode.ToLower() != "na")

4
PaintingPC/Model/InspectModel.cs

@ -78,5 +78,9 @@ namespace PaintingPC.Model
/// 报废操作人
/// </summary>
public string AddMan { get; set; }
/// <summary>
/// 老外系统取颜色后,从tb_ForeignColorMap表附加的零件号
/// </summary>
public string ForeignPartCode { get; set; }
}
}

14
WebService/Function.cs

@ -1139,8 +1139,18 @@ namespace Webservice
colorName = inspectTable.Rows[0]["remark1"].ToString();
productName = inspectTable.Rows[0]["remark2"].ToString();
carType = inspectTable.Rows[0]["CarType"].ToString();
//lu_Code = inspectTable.Rows[0]["remark1"].ToString();
lu_Code = GetPaintLU(oneBarCode.Substring(0, 10), colorName);
string foreignPartCode = inspectTable.Rows[0]["ForeignPartCode"].ToString();
if (!string.IsNullOrEmpty(foreignPartCode))
{
lu_Code = foreignPartCode;
}
else
{
//lu_Code = inspectTable.Rows[0]["remark1"].ToString();
lu_Code = GetPaintLU(oneBarCode.Substring(0, 10), colorName);
}
string lastState = string.Empty;
if (inspectTable.Rows.Count > 1)
{

Loading…
Cancel
Save