From d90d972a77b9cc9b4468f4ff407cecf9f1ff1221 Mon Sep 17 00:00:00 2001 From: "ruoxing.wang" <88384874@qq.com> Date: Thu, 27 Feb 2025 16:40:02 +0800 Subject: [PATCH] =?UTF-8?q?web=E7=AB=AF,=20=E8=80=81=E5=A4=96=E5=BA=93?= =?UTF-8?q?=E5=BA=95=E6=BC=86=E4=BB=B6=E4=B8=8E=E9=A2=9C=E8=89=B2=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FacOneZPStation/FrmZP.Designer.cs | 88 +-- .../BLL/BasicInfo/ForeignColorMapBLL.cs | 277 ++++---- .../BLL/Painting/ForeignColorMapBLL.cs | 115 ++++ .../DAL/painting/ForeignColorMapDAL.cs | 592 ++++++++++++++++++ MESClassLibrary/MESClassLibrary.csproj | 3 + MESClassLibrary/Model/ForeignColorMapModel.cs | 18 + .../HttpHandlers/ForeignColorMapHandler.ashx | 1 + .../ForeignColorMapHandler.ashx.cs | 171 +++++ MESWebSite/MESWebSite.csproj | 12 + MESWebSite/Manage/ForeignColorMap.aspx | 423 +++++++++++++ MESWebSite/Manage/ForeignColorMap.aspx.cs | 20 + .../Manage/ForeignColorMap.aspx.designer.cs | 44 ++ MESWebSite/Manage/Station.aspx.designer.cs | 20 +- 13 files changed, 1594 insertions(+), 190 deletions(-) create mode 100644 MESClassLibrary/BLL/Painting/ForeignColorMapBLL.cs create mode 100644 MESClassLibrary/DAL/painting/ForeignColorMapDAL.cs create mode 100644 MESClassLibrary/Model/ForeignColorMapModel.cs create mode 100644 MESWebSite/HttpHandlers/ForeignColorMapHandler.ashx create mode 100644 MESWebSite/HttpHandlers/ForeignColorMapHandler.ashx.cs create mode 100644 MESWebSite/Manage/ForeignColorMap.aspx create mode 100644 MESWebSite/Manage/ForeignColorMap.aspx.cs create mode 100644 MESWebSite/Manage/ForeignColorMap.aspx.designer.cs diff --git a/FacOneZPStation/FrmZP.Designer.cs b/FacOneZPStation/FrmZP.Designer.cs index e30ae2e..616ddb1 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, 791F)); + this.tableLayoutPanel3.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 792F)); 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(1768, 14); + this.button6.Location = new System.Drawing.Point(1766, 14); this.button6.Margin = new System.Windows.Forms.Padding(14); this.button6.Name = "button6"; - this.button6.Size = new System.Drawing.Size(764, 183); + this.button6.Size = new System.Drawing.Size(766, 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(574, 200); + this.button1.Size = new System.Drawing.Size(573, 200); this.button1.TabIndex = 6; this.button1.Text = "打印标签"; this.button1.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(1192, 225); + this.button5.Location = new System.Drawing.Point(1190, 225); this.button5.Margin = new System.Windows.Forms.Padding(14); this.button5.Name = "button5"; this.button5.Size = new System.Drawing.Size(548, 184); @@ -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(595, 6); + this.button4.Location = new System.Drawing.Point(594, 6); this.button4.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6); this.button4.Name = "button4"; - this.button4.Size = new System.Drawing.Size(576, 199); + this.button4.Size = new System.Drawing.Size(575, 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(574, 199); + this.button3.Size = new System.Drawing.Size(573, 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(602, 225); + this.button2.Location = new System.Drawing.Point(601, 225); this.button2.Margin = new System.Windows.Forms.Padding(14); this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(562, 184); + this.button2.Size = new System.Drawing.Size(561, 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(1761, 217); + this.button7.Location = new System.Drawing.Point(1759, 217); this.button7.Margin = new System.Windows.Forms.Padding(7, 6, 7, 6); this.button7.Name = "button7"; - this.button7.Size = new System.Drawing.Size(778, 200); + this.button7.Size = new System.Drawing.Size(780, 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(1408, 3); + this.label7.Location = new System.Drawing.Point(1406, 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(406, 127); + this.textBox2.Location = new System.Drawing.Point(405, 127); this.textBox2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.textBox2.Name = "textBox2"; - this.textBox2.Size = new System.Drawing.Size(995, 87); + this.textBox2.Size = new System.Drawing.Size(994, 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(392, 124); + this.label3.Size = new System.Drawing.Size(391, 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(1685, 249); + this.labOrderNo.Location = new System.Drawing.Point(1683, 249); this.labOrderNo.Margin = new System.Windows.Forms.Padding(2); this.labOrderNo.Name = "labOrderNo"; - this.labOrderNo.Size = new System.Drawing.Size(864, 174); + this.labOrderNo.Size = new System.Drawing.Size(866, 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(1408, 249); + this.label4.Location = new System.Drawing.Point(1406, 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(404, 249); + this.labStationNo.Location = new System.Drawing.Point(403, 249); this.labStationNo.Margin = new System.Windows.Forms.Padding(2); this.labStationNo.Name = "labStationNo"; - this.labStationNo.Size = new System.Drawing.Size(999, 174); + this.labStationNo.Size = new System.Drawing.Size(998, 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(396, 174); + this.label2.Size = new System.Drawing.Size(395, 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(1685, 428); + this.labPName.Location = new System.Drawing.Point(1683, 428); this.labPName.Margin = new System.Windows.Forms.Padding(2); this.labPName.Name = "labPName"; - this.labPName.Size = new System.Drawing.Size(864, 284); + this.labPName.Size = new System.Drawing.Size(866, 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(1408, 428); + this.label8.Location = new System.Drawing.Point(1406, 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(404, 428); + this.labPartNo.Location = new System.Drawing.Point(403, 428); this.labPartNo.Margin = new System.Windows.Forms.Padding(2); this.labPartNo.Name = "labPartNo"; - this.labPartNo.Size = new System.Drawing.Size(999, 284); + this.labPartNo.Size = new System.Drawing.Size(998, 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(396, 284); + this.label6.Size = new System.Drawing.Size(395, 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(1685, 717); + this.labBadCount.Location = new System.Drawing.Point(1683, 717); this.labBadCount.Margin = new System.Windows.Forms.Padding(2); this.labBadCount.Name = "labBadCount"; - this.labBadCount.Size = new System.Drawing.Size(864, 515); + this.labBadCount.Size = new System.Drawing.Size(866, 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(404, 717); + this.labNum.Location = new System.Drawing.Point(403, 717); this.labNum.Margin = new System.Windows.Forms.Padding(2); this.labNum.Name = "labNum"; - this.labNum.Size = new System.Drawing.Size(999, 515); + this.labNum.Size = new System.Drawing.Size(998, 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(396, 515); + this.label10.Size = new System.Drawing.Size(395, 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(392, 120); + this.label14.Size = new System.Drawing.Size(391, 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(406, 6); + this.textBox1.Location = new System.Drawing.Point(405, 6); this.textBox1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); this.textBox1.Name = "textBox1"; - this.textBox1.Size = new System.Drawing.Size(995, 87); + this.textBox1.Size = new System.Drawing.Size(994, 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(1687, 1); + this.labErrMessage.Location = new System.Drawing.Point(1685, 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(860, 245); + this.labErrMessage.Size = new System.Drawing.Size(862, 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, 867F)); + this.tableLayoutPanel4.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 869F)); 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(1408, 717); + this.label12.Location = new System.Drawing.Point(1406, 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(1909, 0); + this.labTime.Location = new System.Drawing.Point(1908, 0); this.labTime.Margin = new System.Windows.Forms.Padding(0); this.labTime.Name = "labTime"; - this.labTime.Size = new System.Drawing.Size(651, 149); + this.labTime.Size = new System.Drawing.Size(652, 149); 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(345, 0); this.label1.Margin = new System.Windows.Forms.Padding(0); this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(1564, 149); + this.label1.Size = new System.Drawing.Size(1563, 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, 650F)); + this.tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 651F)); 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/MESClassLibrary/BLL/BasicInfo/ForeignColorMapBLL.cs b/MESClassLibrary/BLL/BasicInfo/ForeignColorMapBLL.cs index 6eafffa..432800a 100644 --- a/MESClassLibrary/BLL/BasicInfo/ForeignColorMapBLL.cs +++ b/MESClassLibrary/BLL/BasicInfo/ForeignColorMapBLL.cs @@ -15,143 +15,146 @@ namespace MESClassLibrary.BLL.BasicInfo { public class ForeignColorMapBLL { - //BasicBLL db = new BasicBLL(); - //ForeignColorMapDAL da =new ForeignColorMapDAL(); - - ///// - ///// 查询信息 - ///// - ///// - //public string SearchInfo(string page, string pagesize, string StationNo, string LineID) - //{ - // try - // { - // string jsonStr = "[]"; - // int total = 0;//总行数 - // List list = db.SearchAllInfo(); - - // if (!String.IsNullOrEmpty(LineID)) - // { - // list = list.Where(p => p.LineID == LineID).ToList();//按条件分页查询 - // } - - // if (!String.IsNullOrEmpty(StationNo)) - // { - // list = list.Where(p => p.StationNo != null && p.StationNo.Contains(StationNo)).ToList();//按条件分页查询 - // } - - // if (list.Count > 0) - // { - // total = list.Count; - // int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize); - // list = list.Skip(Skipcount).Take(Convert.ToInt32(pagesize)).ToList(); - - // #region 联查 - // List StationList = new List(); - // BasicBLL pl_db = new BasicBLL(); - // var pl_list = pl_db.SearchAllInfo().ToList(); - // foreach (var item in list) - // { - // StationModel dm = Tool.Mapper(item); - // var info = pl_list.FirstOrDefault(p => p.LineID == item.LineID); - // if (info != null) - // { - // dm.LineName = info.LineName; - // } - // StationList.Add(dm); - // } - // #endregion - - // JsonDataModel md = new JsonDataModel(); - // md.total = total.ToString(); - // md.rows = StationList; - // jsonStr = JSONTools.ScriptSerialize>(md); - // } - // return jsonStr; - // } - // catch (Exception ex) - // { - // LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); - // return ""; - // } - - - //} - ///// - ///// 添加信息 - ///// - ///// 生产线模型对象 - ///// - //public bool AddInfo(tb_Station md) - //{ - // try - // { - // var list = db.SearchInfoByKey("StationNo", md.StationNo);//判断是否有重复数据 - // if (list != null) - // { - // if (list.Where(p => p.StationID != md.StationID).Count() > 0) - // { - // return false; - // } - - // } - - // return db.AddInfo(md); - // } - // catch (Exception ex) - // { - // LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); - // return false; - // } - - //} - ///// - ///// 修改信息 - ///// - ///// 生产线模型对象 - ///// - //public bool UpdateInfo(tb_Station md) - //{ - // try - // { - // var list = db.SearchAllInfo().Where(p => p.StationNo == md.StationNo && p.StationID != md.StationID).ToList();//判断是否有重复数据 - // if (list.Count > 0) - // { - // return false; - // } - - // //初始化要更新的字段 - // string[] proNames = new string[4]; - // proNames[0] = "LineID"; - // proNames[1] = "StationNo"; - // proNames[2] = "Des"; - // proNames[3] = "ChangeMould"; - - // //必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化 - // //如果没有初始化必填字段,更新会报错 - // //md.Des = ""; - - // return db.UpdateInfo(md, proNames); - // } - // catch (Exception ex) - // { - // LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); - // return false; - // } - //} - ///// 删除生产线信息 - //public bool DelInfo(tb_Station md) - //{ - // try - // { - // return db.DelInfo(md); - // } - // catch (Exception ex) - // { - // LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); - // return false; - // } - //} + BasicBLL db = new BasicBLL(); + ForeignColorMapDAL da = new ForeignColorMapDAL(); + + /// + /// 查询信息 + /// + /// + public string SearchInfo(string page, string pagesize, string TypeCode, string PartCode) + { + try + { + string jsonStr = "[]"; + int total = 0;//总行数 + List list = db.SearchAllInfo(); + + if (!String.IsNullOrEmpty(TypeCode)) + { + list = list.Where(p => p.TypeCode == TypeCode).ToList();//按条件分页查询 + } + + if (!String.IsNullOrEmpty(PartCode)) + { + list = list.Where(p => p.PartCode.Contains(PartCode)).ToList();//按条件分页查询 + } + + if (list.Count > 0) + { + total = list.Count; + int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize); + list = list.Skip(Skipcount).Take(Convert.ToInt32(pagesize)).ToList(); + + + + #region 联查 + //List StationList = new List(); + //BasicBLL pl_db = new BasicBLL(); + //var pl_list = pl_db.SearchAllInfo().ToList(); + //foreach (var item in list) + //{ + // StationModel dm = Tool.Mapper(item); + // var info = pl_list.FirstOrDefault(p => p.LineID == item.LineID); + // if (info != null) + // { + // dm.LineName = info.LineName; + // } + // StationList.Add(dm); + //} + #endregion + + //JsonDataModel md = new JsonDataModel(); + //md.total = total.ToString(); + //md.rows = StationList; + jsonStr = JSONTools.ScriptSerialize>(list); + } + return jsonStr; + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return ""; + } + + + } + /// + /// 添加信息 + /// + /// 生产线模型对象 + /// + public bool AddInfo(tb_ForeignColorMap md) + { + try + { + var list = db.SearchInfoByKey("TypeCode", md.TypeCode);//判断是否有重复数据 + if (list.Count>0) + { + if (list.Where(p => p.ID != md.ID && p.PartCode == md.PartCode).Count() > 0) + { + return false; + } + + } + + return db.AddInfo(md); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return false; + } + + } + /// + /// 修改信息 + /// + /// 生产线模型对象 + /// + public bool UpdateInfo(tb_ForeignColorMap md) + { + try + { + var list = db.SearchAllInfo().Where(p => p.TypeCode == md.TypeCode && p.PartCode == md.PartCode && p.ID != md.ID).ToList();//判断是否有重复数据 + if (list.Count > 0) + { + return false; + } + + //初始化要更新的字段 + string[] proNames = new string[5]; + proNames[0] = "TypeCode"; + proNames[1] = "PartCode"; + proNames[2] = "PartName"; + proNames[3] = "Color"; + proNames[4] = "StockNo"; + + //必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化 + //如果没有初始化必填字段,更新会报错 + //md.Des = ""; + + return db.UpdateInfo(md, proNames); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return false; + } + } + /// 删除生产线信息 + public bool DelInfo(tb_ForeignColorMap md) + { + try + { + return db.DelInfo(md); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return false; + } + } //public string GetComboboxData(string StationNo) //{ diff --git a/MESClassLibrary/BLL/Painting/ForeignColorMapBLL.cs b/MESClassLibrary/BLL/Painting/ForeignColorMapBLL.cs new file mode 100644 index 0000000..50051ae --- /dev/null +++ b/MESClassLibrary/BLL/Painting/ForeignColorMapBLL.cs @@ -0,0 +1,115 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using MESClassLibrary.BLL.Log; +using MESClassLibrary.DAL; +using MESClassLibrary.DAL.painting; + +namespace MESClassLibrary.BLL.Painting +{ + public class ForeignColorMapBLL + { + public DataTable SearchInfoA() + { + ForeignColorMapDAL da = new ForeignColorMapDAL(); + try + { + return da.SearchInfoA(); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + } + + public DataTable SearchInfoB() + { + ForeignColorMapDAL da = new ForeignColorMapDAL(); + try + { + return da.SearchInfoB(); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + } + + public DataTable SearchInfoBByA() + { + ForeignColorMapDAL da = new ForeignColorMapDAL(); + try + { + return da.SearchInfoBByA(); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + } + + public DataTable SearchInfoAByB() + { + ForeignColorMapDAL da = new ForeignColorMapDAL(); + try + { + return da.SearchInfoAByB(); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + } + + public DataTable SearchDetailA() + { + ForeignColorMapDAL da = new ForeignColorMapDAL(); + try + { + return da.SearchDetailA(); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + } + + public DataTable SearchDetailB() + { + ForeignColorMapDAL da = new ForeignColorMapDAL(); + try + { + return da.SearchDetailB(); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + } + + public DataTable SearchColorByBarCode(string barcode) + { + try + { + ForeignColorMapDAL da = new ForeignColorMapDAL(); + + return da.SearchColorByBarCode(barcode); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + } + } +} diff --git a/MESClassLibrary/DAL/painting/ForeignColorMapDAL.cs b/MESClassLibrary/DAL/painting/ForeignColorMapDAL.cs new file mode 100644 index 0000000..bd31e89 --- /dev/null +++ b/MESClassLibrary/DAL/painting/ForeignColorMapDAL.cs @@ -0,0 +1,592 @@ +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using MESClassLibrary.BLL.Log; + +namespace MESClassLibrary.DAL.painting +{ + public class ForeignColorMapDAL + { + public DataTable SearchInfoA() + { + try + { + string sql = @"DECLARE @barcode nvarchar(100), + @productInfo nvarchar(100), + @createTime dateTime + + IF OBJECT_ID('TEMPDB..#a') IS NOT NULL + DROP TABLE #a + create table #a (BarCode nvarchar(100),productInfo nvarchar(100),createTime dateTime) + --truncate table #c + DECLARE cursor_name CURSOR FOR --定义游标 + SELECT barcode,CreateTime FROM dbo.tb_StockIn WHERE createTime BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:30:01') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:00') AND pass=1 + ORDER BY createTime DESC + OPEN cursor_name --打开游标 + FETCH NEXT FROM cursor_name INTO @barcode ,@createTime --抓取下一行游标数据 + WHILE @@FETCH_STATUS = 0 + BEGIN + SELECT TOP 1 @productInfo=productInfo FROM dbo.tb_InspectResult WHERE barcode=@barcode ORDER BY createTime DESC + + insert into #a(BarCode,ProductInfo,CreateTime) values(@barcode,@productInfo,@createTime) + FETCH NEXT FROM cursor_name INTO @barcode,@createTime + END + CLOSE cursor_name --关闭游标 + DEALLOCATE cursor_name --释放游标 + +SELECT COUNT(*) AS c1 , + (SELECT COUNT(*) FROM #a WHERE productInfo LIKE '%槛%' ) c2 + FROM #a WHERE productInfo LIKE '%保%'"; +// SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(), CommandType.Text, sql1, null); +// string sql = @"SELECT COUNT(*) AS c1 , +// (SELECT COUNT(*) FROM #c WHERE productInfo LIKE '%槛%' ) c2 +// FROM #c WHERE productInfo LIKE '%保%' "; +// string sql = @"select count(*) as c1 , +// (select count(*) from view_stockin where ([createtime] between convert(datetime,substring(convert(nvarchar(50),getdate(),120),1,10)+ ' 07:30:01') and convert(datetime,substring(convert(nvarchar(50),getdate(),120),1,10)+ ' 19:30:00')) and productinfo like '%槛%' and pass=1) c2 +// from view_stockin where ([createtime] between convert(datetime,substring(convert(nvarchar(50),getdate(),120),1,10)+ ' 07:30:01') and convert(datetime,substring(convert(nvarchar(50),getdate(),120),1,10)+ ' 19:30:00')) and productinfo like '%保%' and pass=1 "; + + return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, null).Tables[0]; + + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + } + + public DataTable SearchInfoB() + { + try + { + string sql = ""; + + if (DateTime.Now > DateTime.Parse(DateTime.Now.ToShortDateString() + " 19:30:00") && DateTime.Now < DateTime.Parse(DateTime.Now.ToShortDateString() + " 23:59:59")) + { + sql = @"DECLARE @barcode nvarchar(100), + @productInfo nvarchar(100), + @createTime dateTime + + IF OBJECT_ID('TEMPDB..#c') IS NOT NULL + DROP TABLE #c + create table #c (BarCode nvarchar(100),productInfo nvarchar(100),createTime dateTime) + --truncate table #c + DECLARE cursor_name CURSOR FOR --定义游标 + SELECT barcode,CreateTime FROM dbo.tb_StockIn WHERE createTime BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:01') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:59:59') AND pass=1 + ORDER BY createTime DESC + OPEN cursor_name --打开游标 + FETCH NEXT FROM cursor_name INTO @barcode ,@createTime --抓取下一行游标数据 + WHILE @@FETCH_STATUS = 0 + BEGIN + SELECT TOP 1 @productInfo=productInfo FROM dbo.tb_InspectResult WHERE barcode=@barcode ORDER BY createTime DESC + + insert into #c(BarCode,ProductInfo,CreateTime) values(@barcode,@productInfo,@createTime) + --PRINT '用户ID:'+@productInfo + FETCH NEXT FROM cursor_name INTO @barcode,@createTime + END + CLOSE cursor_name --关闭游标 + DEALLOCATE cursor_name --释放游标 + + SELECT COUNT(*) AS c1 , + (SELECT COUNT(*) FROM #c WHERE productInfo LIKE '%槛%' ) c2 + FROM #c WHERE productInfo LIKE '%保%'"; +// sql = @"SELECT COUNT(*) AS c1 , +// (SELECT COUNT(*) FROM View_StockIn WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:01') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:59:59')) AND productInfo LIKE '%槛%' and pass=1) c2 +// FROM View_StockIn WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:01') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:59:59')) AND productInfo LIKE '%保%' and pass=1"; + } + + if (DateTime.Now > DateTime.Parse(DateTime.Now.ToShortDateString() + " 00:00:00") && DateTime.Now < DateTime.Parse(DateTime.Now.ToShortDateString() + " 07:30:00")) + { + sql = @"DECLARE @barcode nvarchar(100), + @productInfo nvarchar(100), + @createTime dateTime + + IF OBJECT_ID('TEMPDB..#c') IS NOT NULL + DROP TABLE #c + create table #c (BarCode nvarchar(100),productInfo nvarchar(100),createTime dateTime) + --truncate table #c + DECLARE cursor_name CURSOR FOR --定义游标 + SELECT barcode,CreateTime FROM dbo.tb_StockIn WHERE createTime BETWEEN DATEADD(day,-1, CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:01')) AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:30:00') AND pass=1 + ORDER BY createTime DESC + OPEN cursor_name --打开游标 + FETCH NEXT FROM cursor_name INTO @barcode ,@createTime --抓取下一行游标数据 + WHILE @@FETCH_STATUS = 0 + BEGIN + SELECT TOP 1 @productInfo=productInfo FROM dbo.tb_InspectResult WHERE barcode=@barcode ORDER BY createTime DESC + + insert into #c(BarCode,ProductInfo,CreateTime) values(@barcode,@productInfo,@createTime) + --PRINT '用户ID:'+@productInfo + FETCH NEXT FROM cursor_name INTO @barcode,@createTime + END + CLOSE cursor_name --关闭游标 + DEALLOCATE cursor_name --释放游标 + + SELECT COUNT(*) AS c1 , + (SELECT COUNT(*) FROM #c WHERE productInfo LIKE '%槛%' ) c2 + FROM #c WHERE productInfo LIKE '%保%'"; + // sql = @"SELECT COUNT(*) AS c1 , +// (SELECT COUNT(*) FROM View_StockIn WHERE ([createTime] BETWEEN DATEADD(day,-1, CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:01')) AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:30:00')) AND productInfo LIKE '%槛%' and pass=1) c2 +// FROM View_StockIn WHERE ([createTime] BETWEEN DATEADD(day,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:01')) AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:59:59')) AND productInfo LIKE '%保%' and pass=1"; + } + + return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, null).Tables[0]; + + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + } + + public DataTable SearchInfoAByB() + { + try + { + string sql = ""; + + if (DateTime.Now > DateTime.Parse(DateTime.Now.ToShortDateString() + " 19:30:00") && DateTime.Now <= DateTime.Parse(DateTime.Now.ToShortDateString() + " 23:59:59")) + { + sql = @"DECLARE @barcode nvarchar(100), + @productInfo nvarchar(100), + @createTime dateTime + + IF OBJECT_ID('TEMPDB..#d') IS NOT NULL + DROP TABLE #d + create table #d (BarCode nvarchar(100),productInfo nvarchar(100),createTime dateTime) + --truncate table #c + DECLARE cursor_name CURSOR FOR --定义游标 + SELECT barcode,CreateTime FROM dbo.tb_StockIn WHERE createTime BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:30:01') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:00') AND pass=1 + ORDER BY createTime DESC + OPEN cursor_name --打开游标 + FETCH NEXT FROM cursor_name INTO @barcode ,@createTime --抓取下一行游标数据 + WHILE @@FETCH_STATUS = 0 + BEGIN + SELECT TOP 1 @productInfo=productInfo FROM dbo.tb_InspectResult WHERE barcode=@barcode ORDER BY createTime DESC + + insert into #d(BarCode,ProductInfo,CreateTime) values(@barcode,@productInfo,@createTime) + --PRINT '用户ID:'+@productInfo + FETCH NEXT FROM cursor_name INTO @barcode,@createTime + END + CLOSE cursor_name --关闭游标 + DEALLOCATE cursor_name --释放游标 + + SELECT COUNT(*) AS c1 , + (SELECT COUNT(*) FROM #d WHERE productInfo LIKE '%槛%' ) c2 + FROM #d WHERE productInfo LIKE '%保%'"; +// sql = @"SELECT COUNT(*) AS c1 , +// (SELECT COUNT(*) FROM View_StockIn WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:30:01') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:00')) AND productInfo LIKE '%槛%' and pass=1) c2 +// FROM View_StockIn WHERE ([createTime] BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:30:01') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:00')) AND productInfo LIKE '%保%' and pass=1"; + } + + if (DateTime.Now > DateTime.Parse(DateTime.Now.ToShortDateString() + " 00:00:00") && DateTime.Now < DateTime.Parse(DateTime.Now.ToShortDateString() + " 07:30:00")) + { + sql = @"DECLARE @barcode nvarchar(100), + @productInfo nvarchar(100), + @createTime dateTime + + IF OBJECT_ID('TEMPDB..#d') IS NOT NULL + DROP TABLE #d + create table #d (BarCode nvarchar(100),productInfo nvarchar(100),createTime dateTime) + --truncate table #c + DECLARE cursor_name CURSOR FOR --定义游标 + SELECT barcode,CreateTime FROM dbo.tb_StockIn WHERE createTime BETWEEN DATEADD(day,-1, CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:30:01')) AND DATEADD(day,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:00')) AND pass=1 + ORDER BY createTime DESC + OPEN cursor_name --打开游标 + FETCH NEXT FROM cursor_name INTO @barcode ,@createTime --抓取下一行游标数据 + WHILE @@FETCH_STATUS = 0 + BEGIN + SELECT TOP 1 @productInfo=productInfo FROM dbo.tb_InspectResult WHERE barcode=@barcode ORDER BY createTime DESC + + insert into #d(BarCode,ProductInfo,CreateTime) values(@barcode,@productInfo,@createTime) + --PRINT '用户ID:'+@productInfo + FETCH NEXT FROM cursor_name INTO @barcode,@createTime + END + CLOSE cursor_name --关闭游标 + DEALLOCATE cursor_name --释放游标 + + SELECT COUNT(*) AS c1 , + (SELECT COUNT(*) FROM #d WHERE productInfo LIKE '%槛%' ) c2 + FROM #d WHERE productInfo LIKE '%保%'"; +// sql = @"SELECT COUNT(*) AS c1 , +// (SELECT COUNT(*) FROM View_StockIn WHERE ([createTime] BETWEEN DATEADD(day,-1, CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:30:01')) AND DATEADD(day,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:00'))) AND productInfo LIKE '%槛%' and pass=1) c2 +// FROM View_StockIn WHERE ([createTime] BETWEEN DATEADD(day,-1, CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:30:01')) AND DATEADD(day,-1,CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:00'))) AND productInfo LIKE '%保%' and pass=1 "; + } + + return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, null).Tables[0]; + + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + } + + public DataTable SearchInfoBByA() + { + try + { + string sql = ""; + sql = @"DECLARE @barcode nvarchar(100), + @productInfo nvarchar(100), + @createTime dateTime + + IF OBJECT_ID('TEMPDB..#b') IS NOT NULL + DROP TABLE #b + create table #b (BarCode nvarchar(100),productInfo nvarchar(100),createTime dateTime) + --truncate table #c + DECLARE cursor_name CURSOR FOR --定义游标 + SELECT barcode,CreateTime FROM dbo.tb_StockIn WHERE createTime BETWEEN DATEADD(day,-1, CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:00')) AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:29:59') AND pass=1 + ORDER BY createTime DESC + OPEN cursor_name --打开游标 + FETCH NEXT FROM cursor_name INTO @barcode ,@createTime --抓取下一行游标数据 + WHILE @@FETCH_STATUS = 0 + BEGIN + SELECT TOP 1 @productInfo=productInfo FROM dbo.tb_InspectResult WHERE barcode=@barcode ORDER BY createTime DESC + + insert into #b(BarCode,ProductInfo,CreateTime) values(@barcode,@productInfo,@createTime) + --PRINT '用户ID:'+@productInfo + FETCH NEXT FROM cursor_name INTO @barcode,@createTime + END + CLOSE cursor_name --关闭游标 + DEALLOCATE cursor_name --释放游标 + + SELECT COUNT(*) AS c1 , + (SELECT COUNT(*) FROM #b WHERE productInfo LIKE '%槛%' ) c2 + FROM #b WHERE productInfo LIKE '%保%'"; +// sql = @"SELECT COUNT(*) AS c1 , +// (SELECT COUNT(*) FROM View_StockIn WHERE ([createTime] BETWEEN DATEADD(day,-1, CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:00')) AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:29:59')) AND productInfo LIKE '%槛%' and pass=1) c2 +// FROM View_StockIn WHERE([createTime] BETWEEN DATEADD(day,-1, CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:00')) AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:29:59')) AND productInfo LIKE '%保%' and pass=1"; + + return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, null).Tables[0]; + + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + } + + public DataTable SearchDetailA() + { + try + { + string sql = @"DECLARE @barcode nvarchar(100), + @productInfo nvarchar(100), + @createTime DATETIME, + @totle INT , + @ptype NVARCHAR(100), + @color NVARCHAR(100) + + + IF OBJECT_ID('TEMPDB..#a') IS NOT NULL + DROP TABLE #a + create table #a (BarCode nvarchar(100),productInfo nvarchar(100),createTime dateTime) + --truncate table #c + DECLARE cursor_name CURSOR FOR --定义游标 + SELECT barcode,CreateTime FROM dbo.tb_StockIn WHERE createTime BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:30:01') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:00') AND pass=1 + ORDER BY createTime DESC + OPEN cursor_name --打开游标 + FETCH NEXT FROM cursor_name INTO @barcode ,@createTime --抓取下一行游标数据 + WHILE @@FETCH_STATUS = 0 + BEGIN + SELECT TOP 1 @productInfo=productInfo FROM dbo.tb_InspectResult WHERE barcode=@barcode ORDER BY createTime DESC + + insert into #a(BarCode,ProductInfo,CreateTime) values(@barcode,@productInfo,@createTime) + FETCH NEXT FROM cursor_name INTO @barcode,@createTime + END + CLOSE cursor_name --关闭游标 + DEALLOCATE cursor_name --释放游标 + + IF OBJECT_ID('TEMPDB..#temp') IS NOT NULL + DROP TABLE #temp + create table #temp (id INT IDENTITY(1,1)NOT NULL, totle INT,ptype nvarchar(100),color NVARCHAR(100)) + + DECLARE a1 CURSOR FOR --定义游标 + SELECT COUNT(0) totle,SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) AS PType,LEFT(productInfo,CHARINDEX(',',productInfo)-1) AS color + FROM #a WHERE productInfo LIKE '%槛%' + GROUP BY LEFT(productInfo,CHARINDEX(',',productInfo)-1),SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) + ORDER BY SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) + OPEN a1 --打开游标 + FETCH NEXT FROM a1 INTO @totle ,@ptype,@color --抓取下一行游标数据 + WHILE @@FETCH_STATUS = 0 + BEGIN + + insert into #temp(totle,ptype,color) values(@totle,@ptype,@color) + FETCH NEXT FROM a1 INTO @totle ,@ptype,@color + END + CLOSE a1 --关闭游标 + DEALLOCATE a1 --释放游标 + + + DECLARE a2 CURSOR FOR --定义游标 + SELECT COUNT(0) totle,SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) AS PType,LEFT(productInfo,CHARINDEX(',',productInfo)-1) AS color + FROM #a WHERE productInfo LIKE '%保%' + GROUP BY LEFT(productInfo,CHARINDEX(',',productInfo)-1),SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) + ORDER BY SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) + OPEN a2 --打开游标 + FETCH NEXT FROM a2 INTO @totle ,@ptype,@color --抓取下一行游标数据 + WHILE @@FETCH_STATUS = 0 + BEGIN + insert into #temp(totle,ptype,color) values(@totle,@ptype,@color) + FETCH NEXT FROM a2 INTO @totle ,@ptype,@color + END + CLOSE a2 --关闭游标 + DEALLOCATE a2 --释放游标 + + SELECT * FROM #temp ORDER BY id "; + + return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, null).Tables[0]; + + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + } + + public DataTable SearchDetailB() + { + try + { + string sql = ""; + + if (DateTime.Now > DateTime.Parse(DateTime.Now.ToShortDateString() + " 19:30:00") && DateTime.Now < DateTime.Parse(DateTime.Now.ToShortDateString() + " 23:59:59")) + { + sql = @"DECLARE @barcode nvarchar(100), + @productInfo nvarchar(100), + @createTime DATETIME, + @totle INT , + @ptype NVARCHAR(100), + @color NVARCHAR(100) + + + IF OBJECT_ID('TEMPDB..#a') IS NOT NULL + DROP TABLE #a + create table #a (BarCode nvarchar(100),productInfo nvarchar(100),createTime dateTime) + --truncate table #c + DECLARE cursor_name CURSOR FOR --定义游标 + SELECT barcode,CreateTime FROM dbo.tb_StockIn WHERE createTime BETWEEN CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:01') AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 23:59:59') AND pass=1 + ORDER BY createTime DESC + OPEN cursor_name --打开游标 + FETCH NEXT FROM cursor_name INTO @barcode ,@createTime --抓取下一行游标数据 + WHILE @@FETCH_STATUS = 0 + BEGIN + SELECT TOP 1 @productInfo=productInfo FROM dbo.tb_InspectResult WHERE barcode=@barcode ORDER BY createTime DESC + + insert into #a(BarCode,ProductInfo,CreateTime) values(@barcode,@productInfo,@createTime) + FETCH NEXT FROM cursor_name INTO @barcode,@createTime + END + CLOSE cursor_name --关闭游标 + DEALLOCATE cursor_name --释放游标 + + IF OBJECT_ID('TEMPDB..#temp') IS NOT NULL + DROP TABLE #temp + create table #temp (id INT IDENTITY(1,1)NOT NULL, totle INT,ptype nvarchar(100),color NVARCHAR(100)) + + DECLARE a1 CURSOR FOR --定义游标 + SELECT COUNT(0) totle,SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) AS PType,LEFT(productInfo,CHARINDEX(',',productInfo)-1) AS color + FROM #a WHERE productInfo LIKE '%槛%' + GROUP BY LEFT(productInfo,CHARINDEX(',',productInfo)-1),SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) + ORDER BY SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) + OPEN a1 --打开游标 + FETCH NEXT FROM a1 INTO @totle ,@ptype,@color --抓取下一行游标数据 + WHILE @@FETCH_STATUS = 0 + BEGIN + + insert into #temp(totle,ptype,color) values(@totle,@ptype,@color) + FETCH NEXT FROM a1 INTO @totle ,@ptype,@color + END + CLOSE a1 --关闭游标 + DEALLOCATE a1 --释放游标 + + + DECLARE a2 CURSOR FOR --定义游标 + SELECT COUNT(0) totle,SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) AS PType,LEFT(productInfo,CHARINDEX(',',productInfo)-1) AS color + FROM #a WHERE productInfo LIKE '%保%' + GROUP BY LEFT(productInfo,CHARINDEX(',',productInfo)-1),SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) + ORDER BY SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) + OPEN a2 --打开游标 + FETCH NEXT FROM a2 INTO @totle ,@ptype,@color --抓取下一行游标数据 + WHILE @@FETCH_STATUS = 0 + BEGIN + insert into #temp(totle,ptype,color) values(@totle,@ptype,@color) + FETCH NEXT FROM a2 INTO @totle ,@ptype,@color + END + CLOSE a2 --关闭游标 + DEALLOCATE a2 --释放游标 + + SELECT * FROM #temp ORDER BY id "; + } + + if (DateTime.Now > DateTime.Parse(DateTime.Now.ToShortDateString() + " 00:00:00") && DateTime.Now < DateTime.Parse(DateTime.Now.ToShortDateString() + " 07:30:00")) + { + sql = @"DECLARE @barcode nvarchar(100), + @productInfo nvarchar(100), + @createTime DATETIME, + @totle INT , + @ptype NVARCHAR(100), + @color NVARCHAR(100) + + + IF OBJECT_ID('TEMPDB..#a') IS NOT NULL + DROP TABLE #a + create table #a (BarCode nvarchar(100),productInfo nvarchar(100),createTime dateTime) + --truncate table #c + DECLARE cursor_name CURSOR FOR --定义游标 + SELECT barcode,CreateTime FROM dbo.tb_StockIn WHERE createTime BETWEEN DATEADD(day,-1, CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:01')) AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:30:00') AND pass=1 + ORDER BY createTime DESC + OPEN cursor_name --打开游标 + FETCH NEXT FROM cursor_name INTO @barcode ,@createTime --抓取下一行游标数据 + WHILE @@FETCH_STATUS = 0 + BEGIN + SELECT TOP 1 @productInfo=productInfo FROM dbo.tb_InspectResult WHERE barcode=@barcode ORDER BY createTime DESC + + insert into #a(BarCode,ProductInfo,CreateTime) values(@barcode,@productInfo,@createTime) + FETCH NEXT FROM cursor_name INTO @barcode,@createTime + END + CLOSE cursor_name --关闭游标 + DEALLOCATE cursor_name --释放游标 + + IF OBJECT_ID('TEMPDB..#temp') IS NOT NULL + DROP TABLE #temp + create table #temp (id INT IDENTITY(1,1)NOT NULL, totle INT,ptype nvarchar(100),color NVARCHAR(100)) + + DECLARE a1 CURSOR FOR --定义游标 + SELECT COUNT(0) totle,SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) AS PType,LEFT(productInfo,CHARINDEX(',',productInfo)-1) AS color + FROM #a WHERE productInfo LIKE '%槛%' + GROUP BY LEFT(productInfo,CHARINDEX(',',productInfo)-1),SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) + ORDER BY SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) + OPEN a1 --打开游标 + FETCH NEXT FROM a1 INTO @totle ,@ptype,@color --抓取下一行游标数据 + WHILE @@FETCH_STATUS = 0 + BEGIN + + insert into #temp(totle,ptype,color) values(@totle,@ptype,@color) + FETCH NEXT FROM a1 INTO @totle ,@ptype,@color + END + CLOSE a1 --关闭游标 + DEALLOCATE a1 --释放游标 + + + DECLARE a2 CURSOR FOR --定义游标 + SELECT COUNT(0) totle,SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) AS PType,LEFT(productInfo,CHARINDEX(',',productInfo)-1) AS color + FROM #a WHERE productInfo LIKE '%保%' + GROUP BY LEFT(productInfo,CHARINDEX(',',productInfo)-1),SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) + ORDER BY SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) + OPEN a2 --打开游标 + FETCH NEXT FROM a2 INTO @totle ,@ptype,@color --抓取下一行游标数据 + WHILE @@FETCH_STATUS = 0 + BEGIN + insert into #temp(totle,ptype,color) values(@totle,@ptype,@color) + FETCH NEXT FROM a2 INTO @totle ,@ptype,@color + END + CLOSE a2 --关闭游标 + DEALLOCATE a2 --释放游标 + + SELECT * FROM #temp ORDER BY id "; + } + + if (DateTime.Now > DateTime.Parse(DateTime.Now.ToShortDateString() + " 07:30:00") && DateTime.Now < DateTime.Parse(DateTime.Now.ToShortDateString() + " 19:30:00")) + { + sql = @"DECLARE @barcode nvarchar(100), + @productInfo nvarchar(100), + @createTime DATETIME, + @totle INT , + @ptype NVARCHAR(100), + @color NVARCHAR(100) + + + IF OBJECT_ID('TEMPDB..#a') IS NOT NULL + DROP TABLE #a + create table #a (BarCode nvarchar(100),productInfo nvarchar(100),createTime dateTime) + --truncate table #c + DECLARE cursor_name CURSOR FOR --定义游标 + SELECT barcode,CreateTime FROM dbo.tb_StockIn WHERE [createTime] BETWEEN DATEADD(day,-1, CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 19:30:01')) AND CONVERT(DATETIME,SUBSTRING(CONVERT(NVARCHAR(50),GETDATE(),120),1,10)+ ' 07:30:00') AND pass=1 + ORDER BY createTime DESC + OPEN cursor_name --打开游标 + FETCH NEXT FROM cursor_name INTO @barcode ,@createTime --抓取下一行游标数据 + WHILE @@FETCH_STATUS = 0 + BEGIN + SELECT TOP 1 @productInfo=productInfo FROM dbo.tb_InspectResult WHERE barcode=@barcode ORDER BY createTime DESC + + insert into #a(BarCode,ProductInfo,CreateTime) values(@barcode,@productInfo,@createTime) + FETCH NEXT FROM cursor_name INTO @barcode,@createTime + END + CLOSE cursor_name --关闭游标 + DEALLOCATE cursor_name --释放游标 + + IF OBJECT_ID('TEMPDB..#temp') IS NOT NULL + DROP TABLE #temp + create table #temp (id INT IDENTITY(1,1)NOT NULL, totle INT,ptype nvarchar(100),color NVARCHAR(100)) + + DECLARE a1 CURSOR FOR --定义游标 + SELECT COUNT(0) totle,SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) AS PType,LEFT(productInfo,CHARINDEX(',',productInfo)-1) AS color + FROM #a WHERE productInfo LIKE '%槛%' + GROUP BY LEFT(productInfo,CHARINDEX(',',productInfo)-1),SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) + ORDER BY SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) + OPEN a1 --打开游标 + FETCH NEXT FROM a1 INTO @totle ,@ptype,@color --抓取下一行游标数据 + WHILE @@FETCH_STATUS = 0 + BEGIN + + insert into #temp(totle,ptype,color) values(@totle,@ptype,@color) + FETCH NEXT FROM a1 INTO @totle ,@ptype,@color + END + CLOSE a1 --关闭游标 + DEALLOCATE a1 --释放游标 + + + DECLARE a2 CURSOR FOR --定义游标 + SELECT COUNT(0) totle,SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) AS PType,LEFT(productInfo,CHARINDEX(',',productInfo)-1) AS color + FROM #a WHERE productInfo LIKE '%保%' + GROUP BY LEFT(productInfo,CHARINDEX(',',productInfo)-1),SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) + ORDER BY SUBSTRING(productInfo, dbo.fn_find(',',productInfo,3 )+1,LEN(productInfo)-dbo.fn_find(',',productInfo,3 )) + OPEN a2 --打开游标 + FETCH NEXT FROM a2 INTO @totle ,@ptype,@color --抓取下一行游标数据 + WHILE @@FETCH_STATUS = 0 + BEGIN + insert into #temp(totle,ptype,color) values(@totle,@ptype,@color) + FETCH NEXT FROM a2 INTO @totle ,@ptype,@color + END + CLOSE a2 --关闭游标 + DEALLOCATE a2 --释放游标 + + SELECT * FROM #temp ORDER BY id +"; + } + + return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, null).Tables[0]; + + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + } + + public DataTable SearchColorByBarCode(string barcode) + { + try + { + string sql = @"select top 1 paintCode from tb_StockIn where barcode='" + barcode + @"' order by createTime desc"; + + return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, null).Tables[0]; + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(),MethodBase.GetCurrentMethod()); + return null; + } + } + } +} diff --git a/MESClassLibrary/MESClassLibrary.csproj b/MESClassLibrary/MESClassLibrary.csproj index f1035b7..01edff5 100644 --- a/MESClassLibrary/MESClassLibrary.csproj +++ b/MESClassLibrary/MESClassLibrary.csproj @@ -130,6 +130,7 @@ + @@ -213,6 +214,7 @@ + @@ -753,6 +755,7 @@ + diff --git a/MESClassLibrary/Model/ForeignColorMapModel.cs b/MESClassLibrary/Model/ForeignColorMapModel.cs new file mode 100644 index 0000000..dda66e8 --- /dev/null +++ b/MESClassLibrary/Model/ForeignColorMapModel.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MESClassLibrary.Model +{ + public class ForeignColorMapModel + { + public string ForeignID { get; set; } + public string TypeCode { get; set; } + public string PartCode { get; set; } + public string PartName { get; set; } + public string Color { get; set; } + public string StockNo { get; set; } + } +} diff --git a/MESWebSite/HttpHandlers/ForeignColorMapHandler.ashx b/MESWebSite/HttpHandlers/ForeignColorMapHandler.ashx new file mode 100644 index 0000000..5ebf4b8 --- /dev/null +++ b/MESWebSite/HttpHandlers/ForeignColorMapHandler.ashx @@ -0,0 +1 @@ +<%@ WebHandler Language="C#" CodeBehind="ForeignColorMapHandler.ashx.cs" Class="MESWebSite.HttpHandlers.ForeignColorMapHandler" %> diff --git a/MESWebSite/HttpHandlers/ForeignColorMapHandler.ashx.cs b/MESWebSite/HttpHandlers/ForeignColorMapHandler.ashx.cs new file mode 100644 index 0000000..e394c08 --- /dev/null +++ b/MESWebSite/HttpHandlers/ForeignColorMapHandler.ashx.cs @@ -0,0 +1,171 @@ +using MESClassLibrary.BLL.BasicInfo; +using MESClassLibrary.EFModel; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Web; + +namespace MESWebSite.HttpHandlers +{ + /// + /// StationHandler 的摘要说明 + /// + public class ForeignColorMapHandler : IHttpHandler + { + + HttpRequest Request = null; + HttpResponse Response = null; + + public void ProcessRequest(HttpContext context) + { + context.Response.ContentType = "text/plain"; + Request = context.Request; + Response = context.Response; + + string method = Request.Params["method"]; + switch (method) + { + + case "QueryList": + QueryList(); + break; + case "SaveInfo": + SaveInfo(); + break; + case "DelInfo": + DelInfo(); + break; + case "QueryForCombobox": + QueryForCombobox(); + break; + case "QueryForComboboxByLineID": + QueryForComboboxByLineID(); + break; + default: + break; + + } + + } + public bool IsReusable + { + get + { + return false; + } + } + + void QueryList() + { + string page = Request.Params["page"]; + string pagesize = Request.Params["rows"]; + string TypeCode = Request.Params["TypeCode"]; + string PartCode = Request.Params["PartCode"]; + + + if (string.IsNullOrEmpty(page)) + { + page = "0"; + } + if (string.IsNullOrEmpty(pagesize)) + { + pagesize = "15"; + } + ForeignColorMapBLL bll = new ForeignColorMapBLL(); + Response.Write(bll.SearchInfo(page, pagesize, TypeCode, PartCode)); + Response.End(); + + + } + void SaveInfo() + { + string ForeignID = Request.Params["ID"]; + string TypeCode = Request.Params["TypeCode"]; + string PartCode = Request.Params["PartCode"]; + string PartName = Request.Params["PartName"]; + string Color = Request.Params["Color"]; + string StockNo = Request.Params["StockNo"]; + + + ForeignColorMapBLL bll = new ForeignColorMapBLL(); + tb_ForeignColorMap md = new tb_ForeignColorMap(); + + md.ID = int.Parse( ForeignID); + md.TypeCode = TypeCode; + md.PartCode = PartCode; + + md.Color = Color; + md.StockNo = StockNo; + + string partName = PartName; + ProductBLL productBLL = new ProductBLL(); + DataTable dt = productBLL.SearchInfoByPartNo( PartCode); + if (dt.Rows.Count == 0) + { + Response.Write($"零件号[{PartCode}]在系统中不存在!"); + Response.End(); + return; + } + else + { + List rows = dt.AsEnumerable().Where(p => p.Field("StockNo") == StockNo).ToList(); + if(rows.Count == 0) + { + Response.Write($"零件号[{PartCode}]与存货代码[{StockNo}]不匹配!"); + Response.End(); + return; + } + partName = rows[0]["ProductName"].ToString(); + + } + + md.PartName = partName; + if (ForeignID == "0") + { + //新增 + //md.ID = Guid.NewGuid().ToString(); + Response.Write(bll.AddInfo(md) == true ? "true" : "false"); + } + else + { + //修改 + //md.StationID = StationID; + Response.Write(bll.UpdateInfo(md) == true ? "true" : "false"); + } + Response.End(); + } + void DelInfo() + { + string ForeignID = Request.Params["ID"]; + + ForeignColorMapBLL bll = new ForeignColorMapBLL(); + tb_ForeignColorMap md = new tb_ForeignColorMap(); + md.ID = int.Parse(ForeignID); + + Response.Write(bll.DelInfo(md) == true ? "true" : "false"); + Response.End(); + + } + + void QueryForCombobox() + { + string StationNo = Request.Params["StationNo"]; + + StationBLL bll = new StationBLL(); + Response.Write(bll.GetComboboxData(StationNo)); + Response.End(); + + } + + void QueryForComboboxByLineID() + { + string LineID = "68dd1857-5e78-43f9-a065-6be76335e7fe"; + + StationBLL bll = new StationBLL(); + Response.Write(bll.GetComboboxDataByLine(LineID)); + Response.End(); + + } + } +} \ No newline at end of file diff --git a/MESWebSite/MESWebSite.csproj b/MESWebSite/MESWebSite.csproj index fabe6c5..0bbb4c3 100644 --- a/MESWebSite/MESWebSite.csproj +++ b/MESWebSite/MESWebSite.csproj @@ -114,6 +114,7 @@ + @@ -816,6 +817,7 @@ + @@ -1243,6 +1245,9 @@ RetrospectSearchHandler.ashx + + ForeignColorMapHandler.ashx + StationHandler.ashx @@ -1331,6 +1336,13 @@ ChaimUpRecord.aspx + + ForeignColorMap.aspx + ASPXCodeBehind + + + ForeignColorMap.aspx + ImgVideo.aspx ASPXCodeBehind diff --git a/MESWebSite/Manage/ForeignColorMap.aspx b/MESWebSite/Manage/ForeignColorMap.aspx new file mode 100644 index 0000000..7f21887 --- /dev/null +++ b/MESWebSite/Manage/ForeignColorMap.aspx @@ -0,0 +1,423 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ForeignColorMap.aspx.cs" Inherits="MESWebSite.Manage.ForeignColorMap" %> + + + + + + + + + + + + + + + + + 外库底漆件映射 + + +
+
+ + + + + + + + + + + + + + +
外库底漆件映射 + 程序号: + 零件号: + + 查询 + 新增 + + 编辑 + + 删除 +
+
+ +
+ + + + + + + + +
+ + diff --git a/MESWebSite/Manage/ForeignColorMap.aspx.cs b/MESWebSite/Manage/ForeignColorMap.aspx.cs new file mode 100644 index 0000000..f10c66e --- /dev/null +++ b/MESWebSite/Manage/ForeignColorMap.aspx.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace MESWebSite.Manage +{ + public partial class ForeignColorMap : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + if (Request.Cookies["LoginUserInfo"] == null) + { + Response.Write(""); + } + } + } +} \ No newline at end of file diff --git a/MESWebSite/Manage/ForeignColorMap.aspx.designer.cs b/MESWebSite/Manage/ForeignColorMap.aspx.designer.cs new file mode 100644 index 0000000..58a141f --- /dev/null +++ b/MESWebSite/Manage/ForeignColorMap.aspx.designer.cs @@ -0,0 +1,44 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace MESWebSite.Manage +{ + + + public partial class ForeignColorMap + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// lblMessage 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblMessage; + + /// + /// UserID 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlInputText UserID; + } +} diff --git a/MESWebSite/Manage/Station.aspx.designer.cs b/MESWebSite/Manage/Station.aspx.designer.cs index 0cde2b9..0dbaf6a 100644 --- a/MESWebSite/Manage/Station.aspx.designer.cs +++ b/MESWebSite/Manage/Station.aspx.designer.cs @@ -2,16 +2,18 @@ // <自动生成> // 此代码由工具生成。 // -// 对此文件的更改可能会导致不正确的行为,并且如果 -// 重新生成代码,这些更改将会丢失。 +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 // //------------------------------------------------------------------------------ -namespace MESWebSite.Manage { - - - public partial class Station { - +namespace MESWebSite.Manage +{ + + + public partial class Station + { + /// /// form1 控件。 /// @@ -20,7 +22,7 @@ namespace MESWebSite.Manage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// lblMessage 控件。 /// @@ -29,7 +31,7 @@ namespace MESWebSite.Manage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.WebControls.Label lblMessage; - + /// /// UserID 控件。 ///