From cbf1de497020200cec38af26a3f6a3403c1a5666 Mon Sep 17 00:00:00 2001 From: "ruoxing.wang" <88384874@qq.com> Date: Fri, 25 Oct 2024 22:55:03 +0800 Subject: [PATCH] =?UTF-8?q?=E5=96=B7=E6=B6=82=E8=80=81=E5=A4=96=E5=BA=93?= =?UTF-8?q?=E6=88=96=E8=80=85=E6=9C=AC=E5=9C=B0=E5=BA=93=E6=B2=A1=E9=A2=9C?= =?UTF-8?q?=E8=89=B2=E9=85=8D=E7=BD=AE=E7=9A=84=E6=98=8E=E7=A1=AE=E6=8F=90?= =?UTF-8?q?=E7=A4=BA.=20=E5=90=88=E6=A0=BC=E8=BD=AC=E6=8A=A5=E5=BA=9F?= =?UTF-8?q?=E7=9A=84=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FacOneZPStation/FrmZP.Designer.cs | 80 +++++++-------- InjectionPC/FrmMain2408.cs | 4 +- InjectionPC/Sill.grf | Bin 2241 -> 1720 bytes PaintingPC/FrmQuality.Designer.cs | 158 ++++++++++++++++-------------- PaintingPC/FrmQuality.cs | 63 +++++++++--- PaintingPC/Function.cs | 46 +++++++-- WebService/Function.cs | 75 ++++++++++---- WebService/WMSWebService.asmx.cs | 29 ++++-- 8 files changed, 296 insertions(+), 159 deletions(-) diff --git a/FacOneZPStation/FrmZP.Designer.cs b/FacOneZPStation/FrmZP.Designer.cs index 367a27e..d12dcaa 100644 --- a/FacOneZPStation/FrmZP.Designer.cs +++ b/FacOneZPStation/FrmZP.Designer.cs @@ -77,7 +77,7 @@ this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.51529F)); this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.62445F)); this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 32.86026F)); - this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 648F)); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 649F)); 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(1699, 12); + this.button6.Location = new System.Drawing.Point(1698, 12); this.button6.Margin = new System.Windows.Forms.Padding(13, 12, 13, 12); this.button6.Name = "button6"; - this.button6.Size = new System.Drawing.Size(623, 161); + this.button6.Size = new System.Drawing.Size(624, 161); this.button6.TabIndex = 7; this.button6.Text = "手动打印箱单"; this.button6.UseVisualStyleBackColor = false; @@ -131,7 +131,7 @@ 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(1145, 197); + this.button5.Location = new System.Drawing.Point(1144, 197); this.button5.Margin = new System.Windows.Forms.Padding(13, 12, 13, 12); this.button5.Name = "button5"; this.button5.Size = new System.Drawing.Size(528, 162); @@ -148,7 +148,7 @@ this.button4.Location = new System.Drawing.Point(571, 5); this.button4.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5); this.button4.Name = "button4"; - this.button4.Size = new System.Drawing.Size(555, 175); + this.button4.Size = new System.Drawing.Size(554, 175); this.button4.TabIndex = 4; this.button4.Text = "下一计划"; this.button4.UseVisualStyleBackColor = false; @@ -177,7 +177,7 @@ this.button2.Location = new System.Drawing.Point(578, 197); this.button2.Margin = new System.Windows.Forms.Padding(13, 12, 13, 12); this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(541, 162); + this.button2.Size = new System.Drawing.Size(540, 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(1692, 190); + this.button7.Location = new System.Drawing.Point(1691, 190); this.button7.Margin = new System.Windows.Forms.Padding(6, 5, 6, 5); this.button7.Name = "button7"; - this.button7.Size = new System.Drawing.Size(637, 176); + this.button7.Size = new System.Drawing.Size(638, 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(1394, 3); + this.label7.Location = new System.Drawing.Point(1392, 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(402, 111); + this.textBox2.Location = new System.Drawing.Point(401, 111); this.textBox2.Margin = new System.Windows.Forms.Padding(4); this.textBox2.Name = "textBox2"; - this.textBox2.Size = new System.Drawing.Size(985, 77); + this.textBox2.Size = new System.Drawing.Size(984, 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(388, 109); + this.label3.Size = new System.Drawing.Size(387, 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(1648, 219); + this.labOrderNo.Location = new System.Drawing.Point(1646, 219); this.labOrderNo.Margin = new System.Windows.Forms.Padding(2); this.labOrderNo.Name = "labOrderNo"; - this.labOrderNo.Size = new System.Drawing.Size(688, 152); + this.labOrderNo.Size = new System.Drawing.Size(690, 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(1394, 219); + this.label4.Location = new System.Drawing.Point(1392, 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(400, 219); + this.labStationNo.Location = new System.Drawing.Point(399, 219); this.labStationNo.Margin = new System.Windows.Forms.Padding(2); this.labStationNo.Name = "labStationNo"; - this.labStationNo.Size = new System.Drawing.Size(989, 152); + this.labStationNo.Size = new System.Drawing.Size(988, 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(392, 152); + this.label2.Size = new System.Drawing.Size(391, 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(1648, 376); + this.labPName.Location = new System.Drawing.Point(1646, 376); this.labPName.Margin = new System.Windows.Forms.Padding(2); this.labPName.Name = "labPName"; - this.labPName.Size = new System.Drawing.Size(688, 249); + this.labPName.Size = new System.Drawing.Size(690, 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(1394, 376); + this.label8.Location = new System.Drawing.Point(1392, 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(400, 376); + this.labPartNo.Location = new System.Drawing.Point(399, 376); this.labPartNo.Margin = new System.Windows.Forms.Padding(2); this.labPartNo.Name = "labPartNo"; - this.labPartNo.Size = new System.Drawing.Size(989, 249); + this.labPartNo.Size = new System.Drawing.Size(988, 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(392, 249); + this.label6.Size = new System.Drawing.Size(391, 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(1648, 630); + this.labBadCount.Location = new System.Drawing.Point(1646, 630); this.labBadCount.Margin = new System.Windows.Forms.Padding(2); this.labBadCount.Name = "labBadCount"; - this.labBadCount.Size = new System.Drawing.Size(688, 449); + this.labBadCount.Size = new System.Drawing.Size(690, 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(400, 630); + this.labNum.Location = new System.Drawing.Point(399, 630); this.labNum.Margin = new System.Windows.Forms.Padding(2); this.labNum.Name = "labNum"; - this.labNum.Size = new System.Drawing.Size(989, 449); + this.labNum.Size = new System.Drawing.Size(988, 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(392, 449); + this.label10.Size = new System.Drawing.Size(391, 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(388, 105); + this.label14.Size = new System.Drawing.Size(387, 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(402, 5); + this.textBox1.Location = new System.Drawing.Point(401, 5); this.textBox1.Margin = new System.Windows.Forms.Padding(4); this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(985, 77); + this.textBox1.Size = new System.Drawing.Size(984, 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(1650, 1); + this.labErrMessage.Location = new System.Drawing.Point(1648, 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(684, 215); + this.labErrMessage.Size = new System.Drawing.Size(686, 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, 691F)); + this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 693F)); 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(1394, 630); + this.label12.Location = new System.Drawing.Point(1392, 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(1802, 0); + this.labTime.Location = new System.Drawing.Point(1801, 0); this.labTime.Margin = new System.Windows.Forms.Padding(0); this.labTime.Name = "labTime"; - this.labTime.Size = new System.Drawing.Size(545, 130); + this.labTime.Size = new System.Drawing.Size(546, 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(326, 0); this.label1.Margin = new System.Windows.Forms.Padding(0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(1476, 130); + this.label1.Size = new System.Drawing.Size(1475, 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, 544F)); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 545F)); this.tableLayoutPanel2.Controls.Add(this.labTime, 2, 0); this.tableLayoutPanel2.Controls.Add(this.pictureBox1, 0, 0); this.tableLayoutPanel2.Controls.Add(this.label1, 1, 0); diff --git a/InjectionPC/FrmMain2408.cs b/InjectionPC/FrmMain2408.cs index 2382478..f864eea 100644 --- a/InjectionPC/FrmMain2408.cs +++ b/InjectionPC/FrmMain2408.cs @@ -3271,7 +3271,7 @@ namespace InjectionPC productID = dt.Rows[0]["ProductID"].ToString(); nextproductID = dt.Rows[1]["InjectionPlanID"].ToString(); panel45.Visible = true; - if(lbCurrentlQtyL.Text=="0" || string.IsNullOrEmpty(lbCurrentlQtyL.Text)) + if (lbCurrentlQtyL.Text == "0" || string.IsNullOrEmpty(lbCurrentlQtyL.Text)) { lbPackageCodeL.Text = ""; } @@ -3280,7 +3280,7 @@ namespace InjectionPC lbPackageCodeR.Text = ""; } - + } else { diff --git a/InjectionPC/Sill.grf b/InjectionPC/Sill.grf index ec590e72fa80478c28ae62e6c9c4dfb02b2239c5..c6fddc419c43a4bfa54abe066175988544891566 100644 GIT binary patch literal 1720 zcmbtUO>Yx15aqf^{D(+A%wj z35gSb09E{%QsBg2U~JEBH))he?PWj4<2Uck8~fjnpSv$#%YEG%$eAkjy}RBsS zQ)%V7UEXp|R_dPGlmI2xr0f>5la*aHUYE2vW2iF?hBgW{g$}`dST*u$38S|&DcnG8 z%WUi%K=I8mvzWCBBumBD$^qbYS|53*BsHdeB$%+`L6k71h#6 z9%<2jzIElr)(fW^M->RvecP;z<6b+gpo23OMR7x#PdH_PYhooWAb!f}k~BsF%6Ym% zni0l$^5BhD74Qv2?8vF=s3SyhhZjP|7 zUq%!6zs4mG##V`6Md1fT&4<~>G&r+m#7W-Jk(2<3@`3> zi3lMYn6T_}0T)8^zYCvRF#!A^Y!hN~=O@l<4@YHBbmoRPgR;<&6)GO4RGQsW*+K7dj-EL zbud%`9=|G7t1sA+cldRAyOPMjCM)2oH_#OvB|580zzYRX-;d*_1t(>9DQ>zrTM@yb zjj9|61-iEExK6{RZz2lLGZ#J7;a79imSW8uwC_K4Q@2zl93$i9%{w8ZCSrwJh{MXt5b+e{cUpir|P8lq7-WslDOjkWlKlJ8Mu% z_4KO_Re}VqIB7ckZ#iVb#e5=CaPp3)D&Le^!Ms1977X?aHT9Oi*`o%2aEd67n?EZR zVrL~Q(}BZGe&b%XcYK;WUQ6x@aTBnqc9Y^_3q7Ipr<-qgAMZcBxxam9L+witH-CQ~ zYeueKxx?;R^Dx3#-&~(7tldhI(gPQM##qG6#H>saFy0) + { + if (inspectTable.Rows[0]["inspectResult"].ToString().Contains("合格")) + { + MessageBox.Show("条码已判定为合格,无法重新判定为报废"); + return ; + } + } ClearControlColor(SetControlGroup()); btnAbt.BackColor = Color.Red; - //保存 - SaveInspect("报废", colorName, partName); - + string id = SaveInspect("报废", colorName, partName); #region 报废则调WMS WebService,入库 try @@ -470,11 +482,25 @@ namespace PaintingPC //webService.Timeout = 1200000; string errorReason = ""; - webService.WMSSprayingForCS(Function.UniteBarCodeToOne(txtBarCode.Text.Trim()), 0, out errorReason); + bool rst = webService.WMSSprayingForCS(Function.UniteBarCodeToOne(txtBarCode.Text.Trim()), 0, out errorReason); + if(rst == false) + { + + if (!string.IsNullOrEmpty(id)) + { + LogHelper.WriteErrLogBase($"质检调用WMS接口失败,删除条码为[{txtBarCode.Text}]的质检记录", MethodBase.GetCurrentMethod().Name); + + Function.DelInspectRst(id); + } + MessageBox.Show("报废操作失败,原因:"+ errorReason); + return; + } + } catch (Exception ex) { - LogHelper.WriteErrLogBase("工位:" + labStation.Text.Trim() + ",二次质检调用WMS接口:" + ex.ToString(), MethodBase.GetCurrentMethod().Name); + MessageBox.Show("报废操作发生异常,原因:" + ex.Message); + LogHelper.WriteErrLogBase("质检调用WMS接口:" + ex.ToString(), MethodBase.GetCurrentMethod().Name); } #endregion @@ -551,8 +577,14 @@ namespace PaintingPC } return true; } - - public void SaveInspect(string inspectResult,string colorName, string partName) + /// + /// 保存质检记录 tb_InspectResult + /// + /// + /// + /// + /// 返回插入记录的ID + public string SaveInspect(string inspectResult,string colorName, string partName) { try { @@ -586,7 +618,7 @@ namespace PaintingPC if (string.IsNullOrWhiteSpace(model1.damnPosition) || string.IsNullOrWhiteSpace(model1.reason)) { MessageBox.Show("必须选择缺陷位置与缺陷原因,否则无法保存!"); - return; + return ""; } } @@ -617,12 +649,15 @@ namespace PaintingPC { model1.remark3 = "油漆件库"; // 喷涂质检 或 油漆件库 } - Function.InsertInspect2(model1); + return Function.InsertInspect2(model1); } + return ""; } catch (Exception ex) { - LogHelper.WriteErrLogBase("二次质检提交:" + ex.ToString(), MethodBase.GetCurrentMethod().Name); + LogHelper.WriteErrLogBase("质检提交:" + ex.ToString(), MethodBase.GetCurrentMethod().Name); + MessageBox.Show("质检提交异常,原因:" + ex.Message); + return null; } } @@ -653,6 +688,7 @@ namespace PaintingPC { try { + lbForeig.Text = ""; ClearPage(); LoadPage(); } @@ -926,8 +962,13 @@ namespace PaintingPC #region 没有一检结果,查询老外数据库,取产品信息 if(_isWmsQuality == false) { + string paintError = string.Empty; //喷涂线边质检,没有质检结果,查询老外数据库,取产品信息 - string[] info = Function.GetProductInfo2(barcode).Split(','); + string[] info = Function.GetProductInfo2(barcode,ref paintError).Split(','); + if (!string.IsNullOrEmpty(paintError)) + { + lbForeig.Text = paintError; + } labProductInfo.Text = info[0] + "," + info[1]; paintId = info[2]; labProPosition.Tag = paintId; diff --git a/PaintingPC/Function.cs b/PaintingPC/Function.cs index efeb1d6..61f3e1a 100644 --- a/PaintingPC/Function.cs +++ b/PaintingPC/Function.cs @@ -1703,13 +1703,28 @@ namespace PaintingPC return res; } } - + public static int DelInspectRst(string id) + { + int res = 0; + try + { + string sql = $"delete from tb_InspectResult where id ='{id}'"; + res = SqlHelper.ExecuteNonQuery(SqlHelper.SqlConnString, CommandType.Text, sql, null); + return res; + } + catch(Exception ex) + { + LogHelper.WriteLogManager(ex); + LogHelper.WriteErrLogBase(ex.ToString(), MethodBase.GetCurrentMethod().Name); + return res; + } + } /// /// 保存检验结果 /// /// /// - public static int InsertInspect2(InspectModel model) + public static string InsertInspect2(InspectModel model) { int res = 0; try @@ -1749,20 +1764,25 @@ namespace PaintingPC ,'" + model.remark1 + @"' ,'" + model.remark2 + @"' ,'" + model.remark3 + @"' - ) "; - res = SqlHelper.ExecuteNonQuery(SqlHelper.SqlConnString, CommandType.Text, sql, null); + );select @@Identity "; + //res = SqlHelper.ExecuteNonQuery(SqlHelper.SqlConnString, CommandType.Text, sql, null); + DataTable dt= SqlHelper.GetDataDateTable(SqlHelper.SqlConnString, CommandType.Text, sql, null); + if (dt.Rows.Count > 0) + { + return dt.Rows[0][0].ToString(); + } LogHelper.WriteSysLogBase("[sql:]" + sql, MethodBase.GetCurrentMethod().Name); - return res; + return ""; } catch (Exception ex) { LogHelper.WriteLogManager(ex); LogHelper.WriteErrLogBase(ex.ToString(), MethodBase.GetCurrentMethod().Name); - return res; + return ""; } } - public static string GetProductInfo2(string barcode) + public static string GetProductInfo2(string barcode,ref string errorMsg) { string res = ""; //string colorNo = ""; @@ -1822,6 +1842,10 @@ namespace PaintingPC { paintCode = dtColor.Rows[0]["paintcode"].ToString(); } + else + { + errorMsg = $"ForeignDB 没有条码[{barcode}]对应的数据"; + } //根据颜色代码查颜色 @@ -1841,6 +1865,10 @@ namespace PaintingPC //colorInfo = dt.Rows[0]["ColorName"].ToString(); paintID = dt.Rows[0]["ID"].ToString(); } + else + { + errorMsg = $"基础数据-油漆信息管理页面未配置油漆代码为{paintCode}的基础数据"; + } string sql_1 = @"select Color from tb_PaintColorInfo where StockNo='" + barcode.Substring(0, 10) + @"' and PaintID='" + paintID + @"'"; DataTable dt_1 = SqlHelper.GetDataDateTable(SqlHelper.SqlConnString, CommandType.Text, sql_1, null); @@ -1848,6 +1876,10 @@ namespace PaintingPC { colorInfo = dt_1.Rows[0]["Color"].ToString(); } + else + { + errorMsg = $"基础数据-产品颜色页面未配置存货代码代码为{barcode.Substring(0, 10)},油漆代码为[{paintCode}]的基础数据"; + } } #endregion diff --git a/WebService/Function.cs b/WebService/Function.cs index 8b1d31e..6e4fbe7 100644 --- a/WebService/Function.cs +++ b/WebService/Function.cs @@ -862,7 +862,7 @@ namespace Webservice /// /// /// - public static string WMSSpraying(string barcode, int isPass, string stcokNo, string partNo, string batchNo,ref string colorName,ref string productName,ref string carType ) + public static string WMSSpraying(string barcode, int isPass, string stcokNo, string partNo, string batchNo,ref string colorName,ref string productName,ref string carType) { JsonModel model = new JsonModel(); model.Result = "0"; @@ -1049,7 +1049,9 @@ namespace Webservice #region 调用WMS接口前记录数据 - string sql_bf = @" INSERT INTO [tb_StockIn_beif] + try + { + string sql_bf = @" INSERT INTO [tb_StockIn_beif] ([ID] ,[barcode] ,[pass] @@ -1059,31 +1061,57 @@ namespace Webservice ,'" + barcode + @"' ,'" + isPass.ToString() + @"' ,(select getdate())) "; - SqlHelper.ExecuteNonQuery(SqlHelper.SqlConnString, CommandType.Text, sql_bf, null); + SqlHelper.ExecuteNonQuery(SqlHelper.SqlConnString, CommandType.Text, sql_bf, null); + } + catch(Exception ex) + { + model.Result = "0"; + model.ResultType = "Result"; + model.ResultRowsCount = "0"; + model.ErrReason = "调用接口前,保存入tb_StockIn_beif表失败,原因:"+ex.Message; + model.DataList = null; + + return JSONTools.ScriptSerialize>(model); + } #endregion #region 调用WMS Web Service + string res = string.Empty; + try + { + WebService.WebReference.JsonService webService = new WebService.WebReference.JsonService(); + webService.Url = ConfigurationManager.AppSettings["WMSWebServiceURL"].ToString(); + webService.Timeout = 1200000; - WebService.WebReference.JsonService webService = new WebService.WebReference.JsonService(); - webService.Url = ConfigurationManager.AppSettings["WMSWebServiceURL"].ToString(); - webService.Timeout = 1200000; + string jsonParam = " [{\"ServiceType\":\"AddMesData\",\"OperName\":\"ADMIN\"}]"; + string strJson = "[25," + JSONTools.ScriptSerialize>(list) + "]"; + res = webService.AddData(jsonParam, strJson); + LogHelper.WriteSysLogBase("条码:" + barcode + "调用WMS入库接口,参数:strJson = " + strJson + "返回结果:" + res, MethodBase.GetCurrentMethod().Name); + } + catch(Exception ex) + { + model.Result = "0"; + model.ResultType = "Result"; + model.ResultRowsCount = "0"; + model.ErrReason = $"调用WMS接口[{ConfigurationManager.AppSettings["WMSWebServiceURL"].ToString()}]异常,原因:" + ex.Message; + model.DataList = null; - string jsonParam = " [{\"ServiceType\":\"AddMesData\",\"OperName\":\"ADMIN\"}]"; - string strJson = "[25," + JSONTools.ScriptSerialize>(list) + "]"; + return JSONTools.ScriptSerialize>(model); + } #endregion #region 调用,返回结果 - string res = webService.AddData(jsonParam, strJson); - LogHelper.WriteSysLogBase("条码:" + barcode + "调用WMS入库接口,参数:strJson = " + strJson + "返回结果:" + res, MethodBase.GetCurrentMethod().Name); #region 调用是否成功,若成功则存入数据库,WMS调用成功则无返回结果 if (res.ToUpper() == "TRUE") { - string sql = @" INSERT INTO [tb_StockIn] + try + { + string sql = @" INSERT INTO [tb_StockIn] ([ID] ,[barcode] ,[pass] @@ -1092,20 +1120,28 @@ namespace Webservice ((select newid()) ,'" + barcode + @"' ,'" + isPass.ToString() + @"' - ,(select getdate()),'"+ repaint + "') "; - SqlHelper.ExecuteNonQuery(SqlHelper.SqlConnString, CommandType.Text, sql, null); + ,(select getdate()),'" + repaint + "') "; + SqlHelper.ExecuteNonQuery(SqlHelper.SqlConnString, CommandType.Text, sql, null); - model.Result = "1"; - model.ResultType = "Result"; - model.ResultRowsCount = "0"; - model.ErrReason = " 成功"; + model.Result = "1"; + model.ResultType = "Result"; + model.ResultRowsCount = "0"; + model.ErrReason = " 成功"; + } + catch(Exception ex) + { + model.Result = "0"; + model.ResultType = "Result"; + model.ResultRowsCount = "0"; + model.ErrReason = "Wms接口传递成功,但是存入tb_StockIn失败,原因:" + ex.Message; + } } else { model.Result = "0"; model.ResultType = "Result"; model.ResultRowsCount = "0"; - model.ErrReason = res; + model.ErrReason = "Wms接口返回错误,错误信息:"+ res; } #endregion @@ -1117,7 +1153,8 @@ namespace Webservice { LogHelper.WriteLogManager(ex); LogHelper.WriteErrLogBase(ex.ToString(), MethodBase.GetCurrentMethod().Name); - model.ErrReason = ex.Message; + model.Result = "0"; + model.ErrReason =$"执行方法[WMSSpraying]发生异常,原因" + ex.Message; return JSONTools.ScriptSerialize>(model); } } diff --git a/WebService/WMSWebService.asmx.cs b/WebService/WMSWebService.asmx.cs index caae1df..376a357 100644 --- a/WebService/WMSWebService.asmx.cs +++ b/WebService/WMSWebService.asmx.cs @@ -110,9 +110,17 @@ namespace Webservice string carType = string.Empty; try { - sendRst = SendToWmsService(barcode, isOK, ref stcokNo, ref batchNo, ref partNo, ref colorName, ref productName, ref carType); errorReason = ""; - return sendRst; + sendRst = SendToWmsService(barcode, isOK, ref stcokNo, ref batchNo, ref partNo, ref colorName, ref productName, ref carType,ref errorReason); + if(sendRst == true) + { + return sendRst; + } + else + { + return false; + } + } catch (Exception ex) { @@ -140,7 +148,8 @@ namespace Webservice string partNo = string.Empty; try { - sendRst = SendToWmsService(barCode,1, ref stcokNo, ref batchNo, ref partNo, ref colorName, ref productName, ref carType); + string errorReason = ""; + sendRst = SendToWmsService(barCode, 1, ref stcokNo, ref batchNo, ref partNo, ref colorName, ref productName, ref carType, ref errorReason); if (sendRst == true) { @@ -160,12 +169,12 @@ namespace Webservice } else { - return "发送到WMS接口失败,请重新操作."; + return errorReason; } } catch (Exception ex) { - return ex.Message; + return "下线服务异常,异常原因:"+ ex.Message; } } @@ -179,21 +188,22 @@ namespace Webservice return Function.ExsitBarCodeInDownRecord(barCode); } - bool SendToWmsService(string barCode,int isPass, ref string stcokNo, ref string batchNo, ref string partNo, ref string colorName, ref string productName, ref string carType) + bool SendToWmsService(string barCode,int isPass, ref string stcokNo, ref string batchNo, ref string partNo, ref string colorName, ref string productName, ref string carType,ref string errorReason) { string errorMsg = string.Empty; - string errorReason = ""; //return true; #region 参数判断 if (string.IsNullOrWhiteSpace(barCode)) { - throw new Exception("条码号不能为空"); + errorReason = "条码号不能为空"; + return false; } Function.GetCode(barCode, out stcokNo, out batchNo, out partNo); if (string.IsNullOrWhiteSpace(stcokNo) && string.IsNullOrWhiteSpace(partNo)) { - throw new Exception("条码号无效,请检查条码是否破损缺失"); + errorReason = "条码号无效,请检查条码是否破损缺失"; + return false; } @@ -204,6 +214,7 @@ namespace Webservice if (model.Result == "0") { + errorReason = model.ErrReason; throw new Exception(model.ErrReason); } return true;