From c45f9d47d26a7314430f67efe9a2b9751ddd3d0b Mon Sep 17 00:00:00 2001 From: "ruoxing.wang" <88384874@qq.com> Date: Tue, 14 Jan 2025 08:55:18 +0800 Subject: [PATCH] 1 --- InjectionPC/FrmQuality.Designer.cs | 50 +-- InjectionPC/FrmQuality.cs | 35 +- .../BLL/BasicInfo/ForeignColorMapBLL.cs | 247 +++++++++++ MESClassLibrary/BussinessHelper.cs | 52 +++ .../DAL/BasicInfo/ForeignColorMapDAL.cs | 88 ++++ MESClassLibrary/EFModel/BBMPT.Context.cs | 1 + MESClassLibrary/EFModel/tb_ForeignColorMap.cs | 23 + MESClassLibrary/MESClassLibrary.csproj | 5 + .../HttpHandlers/ForeignColorMapHandler.ashx | 1 + .../ForeignColorMapHandler.ashx.cs | 151 +++++++ MESWebSite/MESWebSite.csproj | 12 + MESWebSite/Manage/ForeignColorMap.aspx | 399 ++++++++++++++++++ MESWebSite/Manage/ForeignColorMap.aspx.cs | 20 + .../Manage/ForeignColorMap.aspx.designer.cs | 44 ++ PaintingPC/Function.cs | 3 +- WebService/WMSWebService.asmx.cs | 2 +- 16 files changed, 1089 insertions(+), 44 deletions(-) create mode 100644 MESClassLibrary/BLL/BasicInfo/ForeignColorMapBLL.cs create mode 100644 MESClassLibrary/BussinessHelper.cs create mode 100644 MESClassLibrary/DAL/BasicInfo/ForeignColorMapDAL.cs create mode 100644 MESClassLibrary/EFModel/tb_ForeignColorMap.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/InjectionPC/FrmQuality.Designer.cs b/InjectionPC/FrmQuality.Designer.cs index a200edf..35e923f 100644 --- a/InjectionPC/FrmQuality.Designer.cs +++ b/InjectionPC/FrmQuality.Designer.cs @@ -60,15 +60,15 @@ this.pictureBox2 = new System.Windows.Forms.PictureBox(); this.panel2 = new System.Windows.Forms.Panel(); this.button1 = new System.Windows.Forms.Button(); - this.txtBoxCode = new System.Windows.Forms.TextBox(); this.label12 = new System.Windows.Forms.Label(); this.textBox2 = new System.Windows.Forms.TextBox(); this.timer2 = new System.Windows.Forms.Timer(this.components); this.lbBoxCode = new System.Windows.Forms.Label(); this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); this.panel3 = new System.Windows.Forms.Panel(); - this.rbtn1 = new System.Windows.Forms.RadioButton(); this.rbtn2 = new System.Windows.Forms.RadioButton(); + this.rbtn1 = new System.Windows.Forms.RadioButton(); + this.txtBoxCode = new System.Windows.Forms.TextBox(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit(); @@ -351,16 +351,6 @@ this.button1.UseVisualStyleBackColor = false; this.button1.Click += new System.EventHandler(this.button1_Click); // - // txtBoxCode - // - this.txtBoxCode.Font = new System.Drawing.Font("宋体", 28F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.txtBoxCode.Location = new System.Drawing.Point(356, 292); - this.txtBoxCode.Margin = new System.Windows.Forms.Padding(5); - this.txtBoxCode.Name = "txtBoxCode"; - this.txtBoxCode.Size = new System.Drawing.Size(1047, 93); - this.txtBoxCode.TabIndex = 43; - this.txtBoxCode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox1_KeyDown); - // // label12 // this.label12.BackColor = System.Drawing.Color.DeepSkyBlue; @@ -429,17 +419,6 @@ this.panel3.Size = new System.Drawing.Size(331, 198); this.panel3.TabIndex = 47; // - // rbtn1 - // - this.rbtn1.AutoSize = true; - this.rbtn1.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.rbtn1.Location = new System.Drawing.Point(292, 31); - this.rbtn1.Name = "rbtn1"; - this.rbtn1.Size = new System.Drawing.Size(27, 26); - this.rbtn1.TabIndex = 38; - this.rbtn1.UseVisualStyleBackColor = true; - this.rbtn1.CheckedChanged += new System.EventHandler(this.rbtn1_CheckedChanged); - // // rbtn2 // this.rbtn2.AutoSize = true; @@ -453,16 +432,37 @@ this.rbtn2.UseVisualStyleBackColor = true; this.rbtn2.CheckedChanged += new System.EventHandler(this.rbtn2_CheckedChanged); // + // rbtn1 + // + this.rbtn1.AutoSize = true; + this.rbtn1.Font = new System.Drawing.Font("宋体", 15F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.rbtn1.Location = new System.Drawing.Point(292, 31); + this.rbtn1.Name = "rbtn1"; + this.rbtn1.Size = new System.Drawing.Size(27, 26); + this.rbtn1.TabIndex = 38; + this.rbtn1.UseVisualStyleBackColor = true; + this.rbtn1.CheckedChanged += new System.EventHandler(this.rbtn1_CheckedChanged); + // + // txtBoxCode + // + this.txtBoxCode.Font = new System.Drawing.Font("宋体", 28F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txtBoxCode.Location = new System.Drawing.Point(356, 291); + this.txtBoxCode.Margin = new System.Windows.Forms.Padding(5); + this.txtBoxCode.Name = "txtBoxCode"; + this.txtBoxCode.Size = new System.Drawing.Size(1047, 93); + this.txtBoxCode.TabIndex = 48; + this.txtBoxCode.KeyDown += new System.Windows.Forms.KeyEventHandler(this.textBox1_KeyDown); + // // FrmQuality // this.AutoScaleDimensions = new System.Drawing.SizeF(12F, 24F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(2560, 2048); + this.Controls.Add(this.txtBoxCode); this.Controls.Add(this.panel3); this.Controls.Add(this.tableLayoutPanel1); this.Controls.Add(this.textBox2); this.Controls.Add(this.label12); - this.Controls.Add(this.txtBoxCode); this.Controls.Add(this.button1); this.Controls.Add(this.panel2); this.Controls.Add(this.pictureBox2); @@ -522,7 +522,6 @@ private System.Windows.Forms.PictureBox pictureBox2; private System.Windows.Forms.Panel panel2; private System.Windows.Forms.Button button1; - private System.Windows.Forms.TextBox txtBoxCode; private System.Windows.Forms.Label label12; private System.Windows.Forms.TextBox textBox2; private System.Windows.Forms.Timer timer2; @@ -531,5 +530,6 @@ private System.Windows.Forms.Panel panel3; private System.Windows.Forms.RadioButton rbtn1; private System.Windows.Forms.RadioButton rbtn2; + private System.Windows.Forms.TextBox txtBoxCode; } } \ No newline at end of file diff --git a/InjectionPC/FrmQuality.cs b/InjectionPC/FrmQuality.cs index de3f4d3..d1abd4e 100644 --- a/InjectionPC/FrmQuality.cs +++ b/InjectionPC/FrmQuality.cs @@ -1024,19 +1024,20 @@ namespace InjectionPC /// private void textBox1_KeyDown(object sender, KeyEventArgs e) { - try - { - InjectionBoxBLL bll=new InjectionBoxBLL(); - BarCodeBLL pbll =new BarCodeBLL(); + InjectionBoxBLL bll = new InjectionBoxBLL(); + BarCodeBLL pbll = new BarCodeBLL(); - if (e.KeyCode == Keys.Enter) + if (e.KeyCode == Keys.Enter) + { + try { + string packageCode = txtBoxCode.Text.Trim(); if (string.IsNullOrEmpty(packageCode)) return; - + DataTable packageTable = pbll.SearchBarCode(packageCode, Program.tableName, "100"); - if(packageTable.Rows.Count == 0) + if (packageTable.Rows.Count == 0) { //MessageBox.Show($"扫描箱单[{packageCode}]在系统中不存在!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); MessageBox.Show($"扫描箱单[{packageCode}]不存在未报废订单!"); @@ -1049,8 +1050,7 @@ namespace InjectionPC BarCodeScan(dr["OneBarCode"].ToString()); - - + @@ -1105,15 +1105,16 @@ namespace InjectionPC // return; //} } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + } + finally + { + txtBoxCode.SelectAll(); + } } - catch (Exception ex) - { - LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); - } - finally - { - txtBoxCode.SelectAll(); - } + } private void timer2_Tick(object sender, EventArgs e) diff --git a/MESClassLibrary/BLL/BasicInfo/ForeignColorMapBLL.cs b/MESClassLibrary/BLL/BasicInfo/ForeignColorMapBLL.cs new file mode 100644 index 0000000..6eafffa --- /dev/null +++ b/MESClassLibrary/BLL/BasicInfo/ForeignColorMapBLL.cs @@ -0,0 +1,247 @@ +using MESClassLibrary.BLL.Log; +using MESClassLibrary.EFModel; +using MESClassLibrary.Model; +using MESClassLibrary.DAL.BasicInfo; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using System.Data; +using System.Data.SqlClient; + +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; + // } + //} + + //public string GetComboboxData(string StationNo) + //{ + // try + // { + // string jsonStr = "[]"; + // if (StationNo == null || StationNo == "") + // { + // var list = db.SearchAllInfo().ToList();//判断是否有重复数据 + // jsonStr = JSONTools.ScriptSerialize>(list); + // } + // else + // { + // var list = db.SearchInfoContains("StationNo", StationNo).ToList();//判断是否有重复数据 + // jsonStr = JSONTools.ScriptSerialize>(list); + // } + + // return jsonStr; + // } + // catch (Exception ex) + // { + // LogErrBLL.AddInfo(ex.ToString(),MethodBase.GetCurrentMethod()); + // return ""; + // } + //} + + //public string GetComboboxDataByLine(string LineID) + //{ + // try + // { + // string jsonStr = "[]"; + // if (LineID == null || LineID == "") + // { + // var list = db.SearchAllInfo().ToList();//判断是否有重复数据 + // jsonStr = JSONTools.ScriptSerialize>(list); + // } + // else + // { + // var list = db.SearchInfoContains("LineID", LineID).ToList();//判断是否有重复数据 + // jsonStr = JSONTools.ScriptSerialize>(list); + // } + + // return jsonStr; + // } + // catch (Exception) + // { + // return ""; + // } + //} + + //public DataTable SearchInfoByNo(string station) + //{ + // StationDAL db = new StationDAL(); + + // try + // { + // return db.SearchInfoByNo(station); + // } + // catch (Exception ex) + // { + // LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + // return null; + // } + //} + + //public List SearchAll() + //{ + // return db.SearchAllInfo(); + //} + + //public bool UpdateTime(DateTime time, string staionNo) + //{ + // try + // { + // return da.UpdateTime(time, staionNo); + // } + // catch (Exception ex) + // { + // LogErrBLL.AddInfo(ex.ToString(),MethodBase.GetCurrentMethod()); + // return false; + // } + //} + ///// + ///// 根据stationID 查询StationNo + ///// + ///// + ///// + //public string SearchStationNameByID(string stationID) + //{ + // return da.SearchStationNameByID(stationID); + //} + } +} diff --git a/MESClassLibrary/BussinessHelper.cs b/MESClassLibrary/BussinessHelper.cs new file mode 100644 index 0000000..25f5086 --- /dev/null +++ b/MESClassLibrary/BussinessHelper.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace MESClassLibrary +{ + public class BussinessHelper + { + /// + /// 注塑打印机模板名称 + /// + /// 工位编号 + /// 是否直供件0:非直供 1:直供 + /// + public static string PrintMoudleName(string stationNo, string isSupply = "0") + { + if ("IM05,IM08,IM10".Contains(stationNo)) //二维小条码 + { + return "单个条码2.grf"; + } + else if ("IM06,IM07,IM09,IM11,IM12,".Contains(stationNo)) //一维条码 + { + return "单个条码.grf"; + } + + else if ("IM01,IM02,IM03,IM04,IM15,IM18,IM20".Contains(stationNo)) //小米大条码 + { + return "Sill.grf"; + } + else if ("IM13,IM14".Contains(stationNo)) //直供条码 + { + //return "单个条码1.grf"; + if (isSupply == "0") //13,14机台,直供件打二维码 非直供件打一维码 + { + return "单个条码.grf"; + } + else + { + return "单个条码2.grf"; + } + } + else + { + return "单个条码2.grf"; + } + + } + + + } +} diff --git a/MESClassLibrary/DAL/BasicInfo/ForeignColorMapDAL.cs b/MESClassLibrary/DAL/BasicInfo/ForeignColorMapDAL.cs new file mode 100644 index 0000000..173b78b --- /dev/null +++ b/MESClassLibrary/DAL/BasicInfo/ForeignColorMapDAL.cs @@ -0,0 +1,88 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using MESClassLibrary.BLL.Log; +using MESClassLibrary.Model; +using System.Data; +using System.Data.SqlClient; +using System.Reflection; + +namespace MESClassLibrary.DAL.BasicInfo +{ + public class ForeignColorMapDAL + { + public static string TableName = "tb_Station"; + + public DataTable SearchInfoByNo(string station) + { + try + { + string sql = @"SELECT s.*,l.LineName FROM dbo.tb_Station s + LEFT JOIN dbo.tb_Line l + ON l.LineID = s.LineID where StationNo=@StationNo"; + + SqlParameter[] param = new SqlParameter[1]; + param[0] = new SqlParameter("@StationNo", SqlDbType.VarChar); + param[0].Value = station; + + return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, param).Tables[0]; + + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + } + + public bool UpdateTime(DateTime time,string staionNo) + { + try + { + string sql = @"update " + TableName + " set PrintTime=@PrintTime where StationNo=@StationNo"; + + SqlParameter[] param = new SqlParameter[2]; + + param[0] = new SqlParameter("@PrintTime", SqlDbType.DateTime); + param[0].Value = time; + + param[1] = new SqlParameter("@StationNo", SqlDbType.VarChar); + param[1].Value = staionNo; + + SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(), CommandType.Text, sql, param); + return true; + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return false; + } + } + public string SearchStationNameByID(string stationID) + { + try + { + string sql = @"SELECT * FROM dbo.tb_Station s + LEFT JOIN dbo.tb_Line l + ON l.LineID = s.LineID where StationID=@StationID"; + + SqlParameter[] param = new SqlParameter[1]; + param[0] = new SqlParameter("@StationID", SqlDbType.VarChar); + param[0].Value = stationID; + DataTable dt = SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, param).Tables[0]; + if (dt.Rows.Count > 0) + { + return dt.Rows[0]["StationNo"].ToString(); + } + return null; + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + } + } +} diff --git a/MESClassLibrary/EFModel/BBMPT.Context.cs b/MESClassLibrary/EFModel/BBMPT.Context.cs index c20464b..a122836 100644 --- a/MESClassLibrary/EFModel/BBMPT.Context.cs +++ b/MESClassLibrary/EFModel/BBMPT.Context.cs @@ -184,5 +184,6 @@ namespace MESClassLibrary.EFModel public virtual DbSet tb_ZPTagTest { get; set; } public virtual DbSet test1 { get; set; } public virtual DbSet View_1 { get; set; } + public virtual DbSet tb_ForeignColorMapSet { get; set; } } } diff --git a/MESClassLibrary/EFModel/tb_ForeignColorMap.cs b/MESClassLibrary/EFModel/tb_ForeignColorMap.cs new file mode 100644 index 0000000..c3003fd --- /dev/null +++ b/MESClassLibrary/EFModel/tb_ForeignColorMap.cs @@ -0,0 +1,23 @@ +//------------------------------------------------------------------------------ +// +// 此代码已从模板生成。 +// +// 手动更改此文件可能导致应用程序出现意外的行为。 +// 如果重新生成代码,将覆盖对此文件的手动更改。 +// +//------------------------------------------------------------------------------ + +namespace MESClassLibrary.EFModel +{ + using System; + using System.Collections.Generic; + + public partial class tb_ForeignColorMap + { + public int Id { get; set; } + public string TypeCode { get; set; } + public string PartCode { get; set; } + public string PartName { get; set; } + public string Color { get; set; } + } +} diff --git a/MESClassLibrary/MESClassLibrary.csproj b/MESClassLibrary/MESClassLibrary.csproj index 48b79b2..f1035b7 100644 --- a/MESClassLibrary/MESClassLibrary.csproj +++ b/MESClassLibrary/MESClassLibrary.csproj @@ -91,6 +91,7 @@ + @@ -183,6 +184,7 @@ + @@ -403,6 +405,9 @@ BBMPT.tt + + BBMPT.tt + BBMPT.tt diff --git a/MESWebSite/HttpHandlers/ForeignColorMapHandler.ashx b/MESWebSite/HttpHandlers/ForeignColorMapHandler.ashx new file mode 100644 index 0000000..c265eda --- /dev/null +++ b/MESWebSite/HttpHandlers/ForeignColorMapHandler.ashx @@ -0,0 +1 @@ +<%@ WebHandler Language="C#" CodeBehind="ForeignColorMapHandler.ashx.cs" Class="MESWebSite.HttpHandlers.StationHandler" %> diff --git a/MESWebSite/HttpHandlers/ForeignColorMapHandler.ashx.cs b/MESWebSite/HttpHandlers/ForeignColorMapHandler.ashx.cs new file mode 100644 index 0000000..c9cf1ba --- /dev/null +++ b/MESWebSite/HttpHandlers/ForeignColorMapHandler.ashx.cs @@ -0,0 +1,151 @@ +using MESClassLibrary.BLL.BasicInfo; +using MESClassLibrary.EFModel; +using System; +using System.Collections.Generic; +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 PartCode = Request.Params["PartCode"]; + string TypeCode = Request.Params["TypeCode"]; + + + if (string.IsNullOrEmpty(page)) + { + page = "0"; + } + if (string.IsNullOrEmpty(pagesize)) + { + pagesize = "15"; + } + StationBLL bll = new StationBLL(); + Response.Write(bll.SearchInfo(page, pagesize, StationNo, LineID)); + Response.End(); + + + } + void SaveInfo() + { + string StationID = Request.Params["StationID"]; + string LineID = Request.Params["LineID"]; + string StationNo = Request.Params["StationNo"]; + string Des = Request.Params["Des"]; + string time = Request.Params["time"]; + + StationBLL bll = new StationBLL(); + tb_Station md = new tb_Station(); + + md.LineID = LineID; + md.StationNo = StationNo; + md.Des = Des; + md.ChangeMould = Convert.ToInt32(time); + var info = Request.Cookies.Get("LoginUserInfo"); + if (info != null) + { + md.UserID = info["UserID"].ToUpper(); + } + if (StationID == "0") + { + //新增 + md.StationID = 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 StationID = Request.Params["StationID"]; + + StationBLL bll = new StationBLL(); + tb_Station md = new tb_Station(); + md.StationID = StationID; + var info = Request.Cookies.Get("LoginUserInfo"); + if (info != null) + { + md.UserID = info["UserID"].ToUpper(); + } + 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..f318f5a 100644 --- a/MESWebSite/MESWebSite.csproj +++ b/MESWebSite/MESWebSite.csproj @@ -155,6 +155,7 @@ + @@ -816,6 +817,7 @@ + @@ -1243,6 +1245,9 @@ RetrospectSearchHandler.ashx + + ForeignColorMapHandler.ashx + StationHandler.ashx @@ -1730,6 +1735,13 @@ RetrospectSearch.aspx + + ForeignColorMap.aspx + ASPXCodeBehind + + + ForeignColorMap.aspx + Station.aspx ASPXCodeBehind diff --git a/MESWebSite/Manage/ForeignColorMap.aspx b/MESWebSite/Manage/ForeignColorMap.aspx new file mode 100644 index 0000000..d5be848 --- /dev/null +++ b/MESWebSite/Manage/ForeignColorMap.aspx @@ -0,0 +1,399 @@ +<%@ 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/PaintingPC/Function.cs b/PaintingPC/Function.cs index a480deb..0d20a51 100644 --- a/PaintingPC/Function.cs +++ b/PaintingPC/Function.cs @@ -1879,7 +1879,8 @@ namespace PaintingPC } if (!string.IsNullOrEmpty(typeCode) && paintCode.ToLower() != "na") { - string sqlmap = @"select * from tb_ForeignColorMap where TypeCode='" + typeCode + @"'"; + string stockNo1 = barcode.Substring(0, 10); + string sqlmap = @"select * from tb_ForeignColorMap where TypeCode='" + typeCode + @"' and StockNo='"+ stockNo1 + "'"; DataTable mapTable = SqlHelper.GetDataDateTable(SqlHelper.SqlConnString, CommandType.Text, sqlmap, null); if(mapTable.Rows.Count > 0) diff --git a/WebService/WMSWebService.asmx.cs b/WebService/WMSWebService.asmx.cs index f8f3a0a..8a32ece 100644 --- a/WebService/WMSWebService.asmx.cs +++ b/WebService/WMSWebService.asmx.cs @@ -94,7 +94,7 @@ namespace Webservice /// 喷涂报废接口 /// /// 条码号:A2048856739-P.190605.0008(二维码) - /// 0-不合格;1-合格;9-返喷 8-其他 + /// 1 合格 ,0点修, 2报废, 9返喷 ,4喷涂其他,5 物流其他 [WebMethod] [ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json)] public bool WMSSprayingForCS(string barcode, int isOK, out string errorReason)