diff --git a/MESWebSite/bin/EntityFramework.dll b/Dlls/EntityFramework.dll similarity index 100% rename from MESWebSite/bin/EntityFramework.dll rename to Dlls/EntityFramework.dll diff --git a/Dlls/Interop.Microsoft.Office.Core.dll b/Dlls/Interop.Microsoft.Office.Core.dll new file mode 100644 index 0000000..f8b00f1 Binary files /dev/null and b/Dlls/Interop.Microsoft.Office.Core.dll differ diff --git a/Dlls/Interop.Microsoft.Office.Interop.Excel.dll b/Dlls/Interop.Microsoft.Office.Interop.Excel.dll new file mode 100644 index 0000000..fe2e898 Binary files /dev/null and b/Dlls/Interop.Microsoft.Office.Interop.Excel.dll differ diff --git a/Dlls/Interop.grdes6Lib.dll b/Dlls/Interop.grdes6Lib.dll new file mode 100644 index 0000000..294bdd1 Binary files /dev/null and b/Dlls/Interop.grdes6Lib.dll differ diff --git a/Dlls/Interop.grdesLib.dll b/Dlls/Interop.grdesLib.dll new file mode 100644 index 0000000..69d9003 Binary files /dev/null and b/Dlls/Interop.grdesLib.dll differ diff --git a/Dlls/Interop.gregn6Lib.dll b/Dlls/Interop.gregn6Lib.dll new file mode 100644 index 0000000..8c1612f Binary files /dev/null and b/Dlls/Interop.gregn6Lib.dll differ diff --git a/Dlls/Interop.grproLib.dll b/Dlls/Interop.grproLib.dll new file mode 100644 index 0000000..8cedfb0 Binary files /dev/null and b/Dlls/Interop.grproLib.dll differ diff --git a/Dlls/Newtonsoft.Json.dll b/Dlls/Newtonsoft.Json.dll new file mode 100644 index 0000000..55d537f Binary files /dev/null and b/Dlls/Newtonsoft.Json.dll differ diff --git a/MESClassLibrary/BLL/BasicInfo/Bom_MKBLL.cs b/MESClassLibrary/BLL/BasicInfo/Bom_MKBLL.cs new file mode 100644 index 0000000..673e144 --- /dev/null +++ b/MESClassLibrary/BLL/BasicInfo/Bom_MKBLL.cs @@ -0,0 +1,281 @@ +using MESClassLibrary.BLL.Log; +using MESClassLibrary.EFModel; +using MESClassLibrary.Model; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using MESClassLibrary.DAL.BasicInfo; + +namespace MESClassLibrary.BLL.BasicInfo +{ + public class Bom_MKBLL + { + BasicBLL db = new BasicBLL(); + + /// + /// 新增信息 + /// + /// + /// + public bool AddInfo(tb_Bom_MK md) + { + try + { + var list = db.SearchInfoByKey("PartNo1", md.PartNo1);//判断是否有重复数据 + if (list != null) + { + //if (list.Where(p => p.BomID != md.BomID).Count() > 0) + //{ + // return false; + //} + + } + + return db.AddInfo(md); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return false; + } + + } + /// + /// 修改信息 + /// + /// + /// + public bool UpdateInfo(tb_Bom_MK md) + { + try + { + var list = db.SearchAllInfo().Where(p => p.PartNo1 == md.PartNo1 && p.BomID != md.BomID).ToList();//判断是否有重复数据 + //if (list.Count > 0) + //{ + // return false; + //} + + //初始化要更新的字段 + string[] proNames = new string[2]; + proNames[0] = "PartNo1"; + proNames[1] = "PartNo2"; + + //必填字段初始化,如果不需要更新必填字段则设置为空即可,时间类型无需初始化 + //如果没有初始化必填字段,更新会报错 + + + return db.UpdateInfo(md, proNames); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return false; + } + + } + + /// + /// 删除信息 + /// + /// + /// + /// + public bool DeleteInfo(tb_Bom_MK md) + { + try + { + return db.DelInfo(md); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return false; + } + + } + + /// + /// 查询全部信息分页 + /// + /// + public string SearchInfoAll(string page, string pagesize, string partNo1, string partNo2, string placeName) + { + try + { + + string jsonStr = "[]"; + int total = 0;//总行数 + List list = db.SearchAllInfo(); + + if (!String.IsNullOrEmpty(partNo1)) + { + list = list.Where(p => p.PartNo1 != null && p.PartNo1.Contains(partNo1)).ToList(); + } + + if (!String.IsNullOrEmpty(partNo2)) + { + list = list.Where(p => p.PartNo2 != null && p.PartNo2.Contains(partNo2) ).ToList(); + } + + if (!String.IsNullOrEmpty(placeName)) + { + list = list.Where(p => p.PlaceName != null && p.PlaceName.Contains(placeName)).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(); + + List modelList = new List(); + BasicBLL s_db = new BasicBLL(); + var s_list = s_db.SearchAllInfo(); + + foreach (var item in list) + { + Bom_MKModel dm = Tool.Mapper(item); + var info = s_list.FirstOrDefault(p => p.PartNo == item.PartNo1); + if (info != null) + { + dm.ProductName1 = info.ProductName; + } + + var info2 = s_list.FirstOrDefault(p => p.PartNo == item.PartNo2); + if (info2 != null) + { + dm.ProductName2 = info2.ProductName; + } + + modelList.Add(dm); + } + + + JsonDataModel md = new JsonDataModel(); + md.total = total.ToString(); + md.rows = modelList; + jsonStr = JSONTools.ScriptSerialize>(md); + } + return jsonStr; + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + + } + + /// + /// 查询全部信息 + /// + /// + public List SearchAll() + { + try + { + var s_list = db.SearchAllInfo().ToList(); + return s_list; + } + catch (Exception) + { + return null; + } + } + + /// + /// 根据ID查询信息 + /// + /// + /// + public tb_Bom_MK SearchInfoByID(string id) + { + try + { + return db.SearchInfoByID(id); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + + } + + public DataTable SearchBom(string PartNo) + { + BomDAL dal = new BomDAL(); + try + { + return dal.SearchBom(PartNo); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + } + + public DataTable Search(string partNo1, string partNo2) + { + BomDAL dal = new BomDAL(); + try + { + return dal.Search(partNo1, partNo2); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + } + + public bool AddInfo(Bom_MKModel md) + { + Bom_MKDAL dal = new Bom_MKDAL(); + try + { + return dal.AddInfo(md); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return false; + } + } + + public bool updateInfo(Bom_MKModel md) + { + Bom_MKDAL dal = new Bom_MKDAL(); + try + { + return dal.updateInfo(md); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return false; + } + } + + public bool DelInfo(Bom_MKModel md) + { + Bom_MKDAL dal = new Bom_MKDAL(); + try + { + return dal.DelInfo(md); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return false; + } + } + + } +} diff --git a/MESClassLibrary/BLL/ZPPlan/ZP_MK_PlanBLL.cs b/MESClassLibrary/BLL/ZPPlan/ZP_MK_PlanBLL.cs new file mode 100644 index 0000000..7b20c9c --- /dev/null +++ b/MESClassLibrary/BLL/ZPPlan/ZP_MK_PlanBLL.cs @@ -0,0 +1,358 @@ +using MESClassLibrary.BLL.Log; +using MESClassLibrary.DAL.ZPPlan; +using MESClassLibrary.EFModel; +using MESClassLibrary.Model; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Reflection; +using System.Text; + +namespace MESClassLibrary.BLL.BasicInfo +{ + public class ZP_MK_PlanBLL + { + readonly BasicBLL db = new BasicBLL(); + + /// + /// 新增信息 + /// + /// + /// + public bool AddInfo(tb_ZP_MK_Plan md) + { + try + { + var now = DateTime.Now; + //md.ID = Guid.NewGuid().ToString(); + md.CreateTime = now; + md.OrderNo = now.ToString("yyyyMMdd"); + md.State = 0; + md.OKCount = 0; + md.BadCount = 0; + md.Item = GetItem(md.OrderNo); + var result = db.AddInfo(md); + return result; + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return false; + } + } + + private int GetItem(string orderNo) + { + var lastItem = db.Search(q => q.OrderNo == orderNo, q => q.CreateTime).LastOrDefault(); + return lastItem == null ? 1 : (lastItem.Item.Value + 1); + } + + /// + /// 修改信息 + /// + /// + /// + public bool UpdateInfo(tb_ZP_MK_Plan md, ref string msg) + { + try + { + var data = db.SearchInfoByID(md.ID.ToString()); + if (data.State == 3) + { + msg = "该计划已经完成"; + return false; + } + if (data.OKCount.GetValueOrDefault(0).CompareTo(md.OrderCount) > 0) + { + msg = "计划数量不能小于完成数量"; + return false; + } + if (data.OKCount.GetValueOrDefault(0) == 0) + { + //data.StationID = md.StationID; + data.PartNo = md.PartNo; + data.OrderDate = md.OrderDate; + } + + //data.IsOneMore = md.IsOneMore; + data.OrderCount = md.OrderCount; + data.OrderName = md.OrderName; + return db.UpdateInfo(data); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + msg = ex.ToString(); + return false; + } + + } + + /// + /// 删除信息 + /// + /// + /// + /// + public bool DeleteInfo(tb_ZP_MK_Plan md) + { + try + { + return db.DelInfo(md); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return false; + } + + } + + /// + /// 查询全部信息分页 + /// + /// + public string SearchInfoAll(int page, + int pagesize, + string startTime, + string endTime, + string partNo) + { + try + { + string jsonStr = "[]"; + int total = 0;//总行数 + IEnumerable list = SearchDB(startTime, endTime, partNo); + if (list.Any()) + { + List modelList = new List(); + total = list.Count(); + int Skipcount = (Convert.ToInt32(page) - 1) * Convert.ToInt32(pagesize); + list = list.Skip(Skipcount).Take(Convert.ToInt32(pagesize)); + + ProductBLL prodBll = new ProductBLL(); + var prodList = prodBll.SearchAll(); + //StationBLL stationBll = new StationBLL(); + //var stationList = stationBll.SearchAll(); + + foreach (var item in list) + { + var prodInfo = prodList.Where(q => q.PartNo == item.PartNo).FirstOrDefault(); + //var stationInfo = stationList.Where(q => q.StationID == item.StationID).FirstOrDefault(); + + ZP_MK_PlanModel zpm = Tool.Mapper(item); + //zpm.StationNo = stationInfo == null ? "" : stationInfo.StationNo; + zpm.ProductName = prodInfo == null ? "" : prodInfo.ProductName; + + modelList.Add(zpm); + } + + JsonDataModel md = new JsonDataModel + { + total = total.ToString(), + rows = modelList + }; + jsonStr = md.ToSerializer(); + } + + return jsonStr; + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + } + + public List SearchByCreateTime(string startTime, string endTime, string partNo) + { + IEnumerable list = SearchDB(startTime, endTime, partNo); + List modelList = new List(); + if (list.Any()) + { + ProductBLL prodBll = new ProductBLL(); + var prodList = prodBll.SearchAll(); + StationBLL stationBll = new StationBLL(); + var stationList = stationBll.SearchAll(); + + foreach (var item in list) + { + var prodInfo = prodList.Where(q => q.PartNo == item.PartNo).FirstOrDefault(); + //var stationInfo = stationList.Where(q => q.StationID == item.StationID).FirstOrDefault(); + + ZP_MK_PlanModel zpm = Tool.Mapper(item); + //zpm.StationNo = stationInfo == null ? "" : stationInfo.StationNo; + zpm.ProductName = prodInfo == null ? "" : prodInfo.ProductName; + + modelList.Add(zpm); + } + } + return modelList; + } + + public IEnumerable SearchDB(string startTime, string endTime, string partNo) + { + DateTime st, et; + if (!DateTime.TryParse(startTime, out st)) st = DateTime.MinValue; + if (!DateTime.TryParse(endTime, out et)) et = DateTime.MaxValue; + + IEnumerable list; + if (string.IsNullOrEmpty(partNo)) + { + list = db.Search( + q => (q.OrderDate >= st && + q.OrderDate <= et) && + q.State != 3, + q => q.OrderDate); + } + else + { + list = db.Search(q => q.PartNo != null && q.PartNo.Contains(partNo) && q.State == 0, q => q.CreateTime); + } + return list; + } + + /// + /// 查询全部信息 + /// + /// + public List SearchAll() + { + try + { + var s_list = db.SearchAllInfo(); + return s_list; + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + } + + /// + /// 根据ID查询信息 + /// + /// + /// + public tb_ZP_MK_Plan SearchInfoByID(string id) + { + try + { + return db.SearchInfoByID(id); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + + } + + public DataTable GetProductingPlan(string station) + { + try + { + ZPPlanDAL dal=new ZPPlanDAL(); + + return dal.GetProductingPlan(station); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + } + + public DataTable GetProductingPlan1(string station,string orderNo) + { + try + { + ZPPlanDAL dal = new ZPPlanDAL(); + + return dal.GetProductingPlan1(station,orderNo); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + } + + public DataTable GetPlan(string station, int flag, string planTime) + { + try + { + ZPPlanDAL dal = new ZPPlanDAL(); + + return dal.GetPlan(station, flag,planTime); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + } + + public bool updateQty(ZPPlanModel md) + { + try + { + ZPPlanDAL dal = new ZPPlanDAL(); + + return dal.updateQty(md); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return false; + } + } + + public bool updateBad(ZPPlanModel md) + { + try + { + ZPPlanDAL dal = new ZPPlanDAL(); + + return dal.updateBad(md); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return false; + } + } + + public DataTable SearchPlanInfo(string planID) + { + try + { + ZPPlanDAL dal = new ZPPlanDAL(); + + return dal.SearchPlanInfo(planID); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + } + + public DataTable SearchOrderNo(string orderno) + { + try + { + ZPPlanDAL dal = new ZPPlanDAL(); + + return dal.SearchOrderNo(orderno); + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(),MethodBase.GetCurrentMethod()); + return null; + } + } + } +} diff --git a/MESClassLibrary/DAL/BasicInfo/Bom_MKDAL.cs b/MESClassLibrary/DAL/BasicInfo/Bom_MKDAL.cs new file mode 100644 index 0000000..7ad235b --- /dev/null +++ b/MESClassLibrary/DAL/BasicInfo/Bom_MKDAL.cs @@ -0,0 +1,150 @@ +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; +using MESClassLibrary.Model; + +namespace MESClassLibrary.DAL.BasicInfo +{ + public class Bom_MKDAL + { + public DataTable SearchBom(string PartNo) + { + try + { + string sql = @"SELECT dbo.tb_Product.ProductName, dbo.tb_ProductType.ProductTypeName, dbo.tb_ProductType.ProductTypeNo, + dbo.tb_Product.PartNo, dbo.tb_Bom.PartNo2, dbo.tb_Product.StockNo + FROM dbo.tb_Bom RIGHT OUTER JOIN + dbo.tb_Product ON dbo.tb_Bom.PartNo1 = dbo.tb_Product.PartNo LEFT OUTER JOIN + dbo.tb_ProductType ON dbo.tb_Product.ProductTypeID = dbo.tb_ProductType.ProductTypeID + WHERE PartNo=@PartNo"; + + SqlParameter[] param = new SqlParameter[1]; + param[0] = new SqlParameter("@PartNo", SqlDbType.VarChar); + param[0].Value = PartNo; + + return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, param).Tables[0]; + + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + } + + public DataTable Search(string partNo1, string partNo2) + { + try + { + string sql = "select * from tb_Bom where PartNo1=@partNo1,PartNo2=@partNo2"; + + SqlParameter[] param = new SqlParameter[2]; + param[0] = new SqlParameter("@@partNo1", SqlDbType.VarChar); + param[0].Value = partNo1; + + param[1] = new SqlParameter("@@partNo2", SqlDbType.VarChar); + param[1].Value = partNo2; + + return SqlHelper.ExecuteDataset(SqlHelper.GetConnSting(), CommandType.Text, sql, param).Tables[0]; + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return null; + } + } + + public bool AddInfo(Bom_MKModel md) + { + string sql = ""; + SqlParameter[] param = null; + + try + { + sql = "insert into tb_Bom(ID,,PartNo1,PartNo2) values(@ID,@partNo1,@partNo2)"; + + param = new SqlParameter[3]; + param[0] = new SqlParameter("@ID", SqlDbType.VarChar); + param[0].Value = md.BomID; + + param[1] = new SqlParameter("@partNo1", SqlDbType.VarChar); + param[1].Value = md.PartNo1; + + param[2] = new SqlParameter("@partNo2", SqlDbType.VarChar); + param[2].Value = md.PartNo2; + + SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(), CommandType.Text, sql, param); + + return true; + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return false; + } + } + + public bool updateInfo(Bom_MKModel md) + { + string sql = ""; + SqlParameter[] param = null; + + try + { + sql = "update tb_Bom set PartNo2=@partNo2 where PartNo1=@partNo1"; + + param = new SqlParameter[2]; + + param[0] = new SqlParameter("@partNo1", SqlDbType.VarChar); + param[0].Value = md.PartNo1; + + param[1] = new SqlParameter("@partNo2", SqlDbType.VarChar); + param[1].Value = md.PartNo2; + + SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(), CommandType.Text, sql, param); + + return true; + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return false; + } + } + + public bool DelInfo(Bom_MKModel md) + { + string sql = ""; + SqlParameter[] param = null; + + try + { + sql = "delete from tb_Bom where PartNo1=@partNo1 and PartNo2=@partNo2 "; + + param = new SqlParameter[2]; + + param[0] = new SqlParameter("@partNo1", SqlDbType.VarChar); + param[0].Value = md.PartNo1; + + param[1] = new SqlParameter("@partNo2", SqlDbType.VarChar); + param[1].Value = md.PartNo2; + + SqlHelper.ExecuteNonQuery(SqlHelper.GetConnSting(), CommandType.Text, sql, param); + + return true; + } + catch (Exception ex) + { + LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod()); + return false; + } + } + + } +} diff --git a/MESClassLibrary/EFModel/BBMPT.Context.cs b/MESClassLibrary/EFModel/BBMPT.Context.cs index 684f685..7b9b865 100644 --- a/MESClassLibrary/EFModel/BBMPT.Context.cs +++ b/MESClassLibrary/EFModel/BBMPT.Context.cs @@ -195,5 +195,7 @@ namespace MESClassLibrary.EFModel public virtual DbSet t_XD_ProductType { get; set; } public virtual DbSet W_XD_Product_del { get; set; } public virtual DbSet t_XD_StockArea { get; set; } + public virtual DbSet tb_Bom_MK { get; set; } + public virtual DbSet tb_ZP_MK_Plan { get; set; } } } diff --git a/MESClassLibrary/EFModel/BBMPT.Designer.cs b/MESClassLibrary/EFModel/BBMPT.Designer.cs index 7c783c7..887faf7 100644 --- a/MESClassLibrary/EFModel/BBMPT.Designer.cs +++ b/MESClassLibrary/EFModel/BBMPT.Designer.cs @@ -1,4 +1,4 @@ -// 为模型“D:\Project\BBMPT1\MESClassLibrary\EFModel\BBMPT.edmx”启用了 T4 代码生成。 +// 为模型“D:\job\BBMPT1\MESClassLibrary\EFModel\BBMPT.edmx”启用了 T4 代码生成。 // 要启用旧代码生成功能,请将“代码生成策略”设计器属性的值 // 更改为“旧的 ObjectContext”。当在设计器中打开该模型时,此属性会出现在 // “属性”窗口中。 diff --git a/MESClassLibrary/EFModel/BBMPT.edmx b/MESClassLibrary/EFModel/BBMPT.edmx index 6848c2f..b2a1c18 100644 --- a/MESClassLibrary/EFModel/BBMPT.edmx +++ b/MESClassLibrary/EFModel/BBMPT.edmx @@ -494,6 +494,8 @@ + + @@ -524,6 +526,8 @@ + + @@ -554,6 +558,8 @@ + + @@ -584,6 +590,8 @@ + + @@ -614,6 +622,8 @@ + + @@ -641,6 +651,20 @@ + + + + + + + + + + + + + + @@ -1038,6 +1062,7 @@ + @@ -1116,6 +1141,7 @@ + @@ -1450,6 +1476,7 @@ + @@ -2187,6 +2214,26 @@ + + + + + + + + + + + + + + + + + + + + @@ -2588,6 +2635,7 @@ + @@ -2677,6 +2725,7 @@ + @@ -2787,7 +2836,9 @@ [tb_BarCode1].[Des4] AS [Des4], [tb_BarCode1].[Des5] AS [Des5], [tb_BarCode1].[Weight] AS [Weight], - [tb_BarCode1].[BatchNo] AS [BatchNo] + [tb_BarCode1].[BatchNo] AS [BatchNo], + [tb_BarCode1].[IsNew] AS [IsNew], + [tb_BarCode1].[AddMan] AS [AddMan] FROM [dbo].[tb_BarCode1] AS [tb_BarCode1] @@ -2814,7 +2865,9 @@ [tb_BarCode2].[Des4] AS [Des4], [tb_BarCode2].[Des5] AS [Des5], [tb_BarCode2].[Weight] AS [Weight], - [tb_BarCode2].[BatchNo] AS [BatchNo] + [tb_BarCode2].[BatchNo] AS [BatchNo], + [tb_BarCode2].[IsNew] AS [IsNew], + [tb_BarCode2].[AddMan] AS [AddMan] FROM [dbo].[tb_BarCode2] AS [tb_BarCode2] @@ -2841,7 +2894,9 @@ [tb_BarCode3].[Des4] AS [Des4], [tb_BarCode3].[Des5] AS [Des5], [tb_BarCode3].[Weight] AS [Weight], - [tb_BarCode3].[BatchNo] AS [BatchNo] + [tb_BarCode3].[BatchNo] AS [BatchNo], + [tb_BarCode3].[IsNew] AS [IsNew], + [tb_BarCode3].[AddMan] AS [AddMan] FROM [dbo].[tb_BarCode3] AS [tb_BarCode3] @@ -2868,7 +2923,9 @@ [tb_BarCode4].[Des4] AS [Des4], [tb_BarCode4].[Des5] AS [Des5], [tb_BarCode4].[Weight] AS [Weight], - [tb_BarCode4].[BatchNo] AS [BatchNo] + [tb_BarCode4].[BatchNo] AS [BatchNo], + [tb_BarCode4].[IsNew] AS [IsNew], + [tb_BarCode4].[AddMan] AS [AddMan] FROM [dbo].[tb_BarCode4] AS [tb_BarCode4] @@ -2895,7 +2952,9 @@ [tb_BarCode5].[Des4] AS [Des4], [tb_BarCode5].[Des5] AS [Des5], [tb_BarCode5].[Weight] AS [Weight], - [tb_BarCode5].[BatchNo] AS [BatchNo] + [tb_BarCode5].[BatchNo] AS [BatchNo], + [tb_BarCode5].[IsNew] AS [IsNew], + [tb_BarCode5].[AddMan] AS [AddMan] FROM [dbo].[tb_BarCode5] AS [tb_BarCode5] @@ -3532,6 +3591,8 @@ + + @@ -3779,6 +3840,7 @@ + @@ -4071,6 +4133,7 @@ + @@ -4149,6 +4212,7 @@ + @@ -4431,6 +4495,7 @@ + @@ -5207,6 +5272,8 @@ + + @@ -5235,6 +5302,8 @@ + + @@ -5263,6 +5332,8 @@ + + @@ -5291,6 +5362,8 @@ + + @@ -5319,6 +5392,8 @@ + + @@ -6006,6 +6081,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -6272,6 +6380,7 @@ + @@ -6579,6 +6688,7 @@ + @@ -6655,6 +6765,7 @@ + @@ -6971,6 +7082,7 @@ + @@ -7779,6 +7891,8 @@ + + @@ -7808,6 +7922,8 @@ + + @@ -7837,6 +7953,8 @@ + + @@ -7866,6 +7984,8 @@ + + @@ -7895,6 +8015,8 @@ + + @@ -8632,6 +8754,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/MESClassLibrary/EFModel/BBMPT.edmx.diagram b/MESClassLibrary/EFModel/BBMPT.edmx.diagram index 347100d..1233514 100644 --- a/MESClassLibrary/EFModel/BBMPT.edmx.diagram +++ b/MESClassLibrary/EFModel/BBMPT.edmx.diagram @@ -173,6 +173,10 @@ + + + + @@ -6475,6 +6479,126 @@ + >>>>>>> .r85 + + + + >>>>>>> .r85 + + + + >>>>>>> .r85 + + + + >>>>>>> .r85 + + + + >>>>>>> .r85 + + + + >>>>>>> .r85 + + + + >>>>>>> .r85 + + + + >>>>>>> .r85 + + + + >>>>>>> .r85 + + + + >>>>>>> .r85 + + + + >>>>>>> .r85 + + + + >>>>>>> .r85 + + + + >>>>>>> .r85 + + + + >>>>>>> .r85 + + + + >>>>>>> .r85 + + + + >>>>>>> .r85 + + + + >>>>>>> .r85 + + + + >>>>>>> .r85 + + + + >>>>>>> .r85 + + + + >>>>>>> .r85 + + + + >>>>>>> .r85 + + + + >>>>>>> .r85 + + + + >>>>>>> .r85 + + + + >>>>>>> .r85 + + + + >>>>>>> .r85 + + + + >>>>>>> .r85 + + + + >>>>>>> .r85 + + + + >>>>>>> .r85 + + + + >>>>>>> .r85 + + + + >>>>>>> .r85 + + + diff --git a/MESClassLibrary/EFModel/tb_BarCode1.cs b/MESClassLibrary/EFModel/tb_BarCode1.cs index 26c13d2..e9fb48b 100644 --- a/MESClassLibrary/EFModel/tb_BarCode1.cs +++ b/MESClassLibrary/EFModel/tb_BarCode1.cs @@ -37,5 +37,7 @@ namespace MESClassLibrary.EFModel public string Des5 { get; set; } public Nullable Weight { get; set; } public string BatchNo { get; set; } + public Nullable IsNew { get; set; } + public string AddMan { get; set; } } } diff --git a/MESClassLibrary/EFModel/tb_BarCode2.cs b/MESClassLibrary/EFModel/tb_BarCode2.cs index ffd1932..815066e 100644 --- a/MESClassLibrary/EFModel/tb_BarCode2.cs +++ b/MESClassLibrary/EFModel/tb_BarCode2.cs @@ -37,5 +37,7 @@ namespace MESClassLibrary.EFModel public string Des5 { get; set; } public Nullable Weight { get; set; } public string BatchNo { get; set; } + public Nullable IsNew { get; set; } + public string AddMan { get; set; } } } diff --git a/MESClassLibrary/EFModel/tb_BarCode3.cs b/MESClassLibrary/EFModel/tb_BarCode3.cs index e59ff9b..0488b43 100644 --- a/MESClassLibrary/EFModel/tb_BarCode3.cs +++ b/MESClassLibrary/EFModel/tb_BarCode3.cs @@ -37,5 +37,7 @@ namespace MESClassLibrary.EFModel public string Des5 { get; set; } public Nullable Weight { get; set; } public string BatchNo { get; set; } + public Nullable IsNew { get; set; } + public string AddMan { get; set; } } } diff --git a/MESClassLibrary/EFModel/tb_BarCode4.cs b/MESClassLibrary/EFModel/tb_BarCode4.cs index 669666c..0effe74 100644 --- a/MESClassLibrary/EFModel/tb_BarCode4.cs +++ b/MESClassLibrary/EFModel/tb_BarCode4.cs @@ -37,5 +37,7 @@ namespace MESClassLibrary.EFModel public string Des5 { get; set; } public Nullable Weight { get; set; } public string BatchNo { get; set; } + public Nullable IsNew { get; set; } + public string AddMan { get; set; } } } diff --git a/MESClassLibrary/EFModel/tb_BarCode5.cs b/MESClassLibrary/EFModel/tb_BarCode5.cs index bac0d75..089fbff 100644 --- a/MESClassLibrary/EFModel/tb_BarCode5.cs +++ b/MESClassLibrary/EFModel/tb_BarCode5.cs @@ -37,5 +37,7 @@ namespace MESClassLibrary.EFModel public string Des5 { get; set; } public Nullable Weight { get; set; } public string BatchNo { get; set; } + public Nullable IsNew { get; set; } + public string AddMan { get; set; } } } diff --git a/MESClassLibrary/EFModel/tb_Bom.cs b/MESClassLibrary/EFModel/tb_Bom.cs index 284e829..34e080b 100644 --- a/MESClassLibrary/EFModel/tb_Bom.cs +++ b/MESClassLibrary/EFModel/tb_Bom.cs @@ -18,5 +18,6 @@ namespace MESClassLibrary.EFModel public string PartNo1 { get; set; } public string PartNo2 { get; set; } public string UserID { get; set; } + public Nullable IsChecked { get; set; } } } diff --git a/MESClassLibrary/EFModel/tb_Bom_MK.cs b/MESClassLibrary/EFModel/tb_Bom_MK.cs new file mode 100644 index 0000000..8143218 --- /dev/null +++ b/MESClassLibrary/EFModel/tb_Bom_MK.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// 此代码已从模板生成。 +// +// 手动更改此文件可能导致应用程序出现意外的行为。 +// 如果重新生成代码,将覆盖对此文件的手动更改。 +// +//------------------------------------------------------------------------------ + +namespace MESClassLibrary.EFModel +{ + using System; + using System.Collections.Generic; + + public partial class tb_Bom_MK + { + public int BomID { get; set; } + public string PartNo1 { get; set; } + public string PartNo2 { get; set; } + public string UserID { get; set; } + public Nullable IsChecked { get; set; } + public string PlaceName { get; set; } + public Nullable IsPartAssemble { get; set; } + public string StationNo { get; set; } + } +} diff --git a/MESClassLibrary/EFModel/tb_InjectionPlan.cs b/MESClassLibrary/EFModel/tb_InjectionPlan.cs index 480517d..4ccdd68 100644 --- a/MESClassLibrary/EFModel/tb_InjectionPlan.cs +++ b/MESClassLibrary/EFModel/tb_InjectionPlan.cs @@ -34,5 +34,6 @@ namespace MESClassLibrary.EFModel public Nullable MarketCount { get; set; } public Nullable BadCount { get; set; } public Nullable Qty { get; set; } + public Nullable ActualTime { get; set; } } } diff --git a/MESClassLibrary/EFModel/tb_Injection_BoxRecord.cs b/MESClassLibrary/EFModel/tb_Injection_BoxRecord.cs index c863798..683a100 100644 --- a/MESClassLibrary/EFModel/tb_Injection_BoxRecord.cs +++ b/MESClassLibrary/EFModel/tb_Injection_BoxRecord.cs @@ -27,5 +27,6 @@ namespace MESClassLibrary.EFModel public Nullable IsPrint { get; set; } public Nullable PrintTime { get; set; } public string Remark { get; set; } + public Nullable IsHandPrint { get; set; } } } diff --git a/MESClassLibrary/EFModel/tb_Operator.cs b/MESClassLibrary/EFModel/tb_Operator.cs index 11a5c66..40bfd23 100644 --- a/MESClassLibrary/EFModel/tb_Operator.cs +++ b/MESClassLibrary/EFModel/tb_Operator.cs @@ -21,5 +21,6 @@ namespace MESClassLibrary.EFModel public string OperatorPsw { get; set; } public string Des { get; set; } public string UserID { get; set; } + public string Limit { get; set; } } } diff --git a/MESClassLibrary/EFModel/tb_ZP_MK_Plan.cs b/MESClassLibrary/EFModel/tb_ZP_MK_Plan.cs new file mode 100644 index 0000000..d98927f --- /dev/null +++ b/MESClassLibrary/EFModel/tb_ZP_MK_Plan.cs @@ -0,0 +1,33 @@ +//------------------------------------------------------------------------------ +// +// 此代码已从模板生成。 +// +// 手动更改此文件可能导致应用程序出现意外的行为。 +// 如果重新生成代码,将覆盖对此文件的手动更改。 +// +//------------------------------------------------------------------------------ + +namespace MESClassLibrary.EFModel +{ + using System; + using System.Collections.Generic; + + public partial class tb_ZP_MK_Plan + { + public int ID { get; set; } + public string OrderNo { get; set; } + public string OrderName { get; set; } + public Nullable OrderDate { get; set; } + public Nullable Item { get; set; } + public string Station { get; set; } + public string Line { get; set; } + public string PartNo { get; set; } + public Nullable OrderCount { get; set; } + public Nullable OKCount { get; set; } + public Nullable State { get; set; } + public Nullable BadCount { get; set; } + public Nullable CreateTime { get; set; } + public Nullable FinishTime { get; set; } + public Nullable RepairCount { get; set; } + } +} diff --git a/MESClassLibrary/MESClassLibrary.csproj b/MESClassLibrary/MESClassLibrary.csproj index 9207f9e..27bcfcc 100644 --- a/MESClassLibrary/MESClassLibrary.csproj +++ b/MESClassLibrary/MESClassLibrary.csproj @@ -64,6 +64,7 @@ + @@ -162,6 +163,7 @@ + @@ -175,6 +177,7 @@ + @@ -326,6 +329,9 @@ BBMPT.tt + + BBMPT.tt + BBMPT.tt @@ -692,6 +698,9 @@ BBMPT.tt + + BBMPT.tt + BBMPT.tt @@ -777,6 +786,7 @@ + @@ -849,6 +859,7 @@ + @@ -883,6 +894,5 @@ - \ No newline at end of file diff --git a/MESClassLibrary/Model/Bom_MKModel.cs b/MESClassLibrary/Model/Bom_MKModel.cs new file mode 100644 index 0000000..9f78c8a --- /dev/null +++ b/MESClassLibrary/Model/Bom_MKModel.cs @@ -0,0 +1,16 @@ +using MESClassLibrary.EFModel; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MESClassLibrary.Model +{ + public class Bom_MKModel : tb_Bom_MK + { + public string ProductName1 { get; set; } + + public string ProductName2 { get; set; } + } +} diff --git a/MESClassLibrary/Model/ZP_MK_PlanModel.cs b/MESClassLibrary/Model/ZP_MK_PlanModel.cs new file mode 100644 index 0000000..b11965c --- /dev/null +++ b/MESClassLibrary/Model/ZP_MK_PlanModel.cs @@ -0,0 +1,20 @@ +using MESClassLibrary.EFModel; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace MESClassLibrary.Model +{ + public class ZP_MK_PlanModel : tb_ZP_MK_Plan + { + /// + /// 工位名称 + /// + public string StationNo { get; set; } + /// + /// 零件名称 + /// + public string ProductName { get; set; } + } +} diff --git a/MESWebSite/Export/ExportZP_MK_Plan.cs b/MESWebSite/Export/ExportZP_MK_Plan.cs new file mode 100644 index 0000000..affd494 --- /dev/null +++ b/MESWebSite/Export/ExportZP_MK_Plan.cs @@ -0,0 +1,31 @@ +using MESWebSite.CommonClass; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace MESWebSite.Export +{ + public class ExportZP_MK_Plan + { + [ExportHeader(HeaderName = "计划编号")] + public string OrderNo { get; set; } + + [ExportHeader(HeaderName = "计划编号")] + public string OrderName { get; set; } + + [ExportHeader(HeaderName = "序号")] + public Nullable Item { get; set; } + + [ExportHeader(HeaderName ="产品名称")] + public string ProductName { get; set; } + [ExportHeader(HeaderName = "零件编号")] + public string PartNo { get; set; } + [ExportHeader(HeaderName = "计划数量")] + public Nullable OrderCount { get; set; } + [ExportHeader(HeaderName = "生产数量")] + public Nullable ProductCount { get; set; } + [ExportHeader(HeaderName = "装配日期")] + public Nullable OrderDate { get; set; } + } +} \ No newline at end of file diff --git a/MESWebSite/HttpHandlers/Bom_MKHandler.ashx b/MESWebSite/HttpHandlers/Bom_MKHandler.ashx new file mode 100644 index 0000000..ebd4fc0 --- /dev/null +++ b/MESWebSite/HttpHandlers/Bom_MKHandler.ashx @@ -0,0 +1 @@ +<%@ WebHandler Language="C#" CodeBehind="Bom_MKHandler.ashx.cs" Class="MESWebSite.HttpHandlers.Bom_MKHandler" %> diff --git a/MESWebSite/HttpHandlers/Bom_MKHandler.ashx.cs b/MESWebSite/HttpHandlers/Bom_MKHandler.ashx.cs new file mode 100644 index 0000000..33e42c5 --- /dev/null +++ b/MESWebSite/HttpHandlers/Bom_MKHandler.ashx.cs @@ -0,0 +1,162 @@ +using MESClassLibrary.BLL; +using MESClassLibrary.BLL.BasicInfo; +using MESClassLibrary.EFModel; +using MESWebSite.CommonClass; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; + +namespace MESWebSite.HttpHandlers +{ + /// + /// Bom_MKHandler 的摘要说明 + /// + public class Bom_MKHandler : 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; + + default: + break; + + } + + } + public bool IsReusable + { + get + { + return false; + } + } + + void QueryList() + { + string page = Request.Params["page"]; + string pagesize = Request.Params["rows"]; + string partNo1 = Request.Params["PartNo1"]; + string partNo2 = Request.Params["PartNo2"]; + string placeName = Request.Params["PlaceName"]; + + if (string.IsNullOrEmpty(page)) + { + page = "0"; + } + if (string.IsNullOrEmpty(pagesize)) + { + pagesize = "15"; + } + Bom_MKBLL bll = new Bom_MKBLL(); + Response.Write(bll.SearchInfoAll(page, pagesize, partNo1, partNo2, placeName)); + Response.End(); + + + } + void SaveInfo() + { + string BomID = Request.Params["BomID"]; + string PartNo1 = Request.Params["PartNo1"]; + string PartNo2 = Request.Params["PartNo2"]; + string IsChecked = Request.Params["IsChecked"]; + string IsPartAssemble = Request.Params["IsPartAssemble"]; + string StationNo = Request.Params["StationNo"]; + string PlaceName = Request.Params["PlaceName"]; + + + string stationNo = ""; + BasicBLL stationDB = new BasicBLL(); + var stationList = stationDB.Search(p => p.StationNo == StationNo); + if (stationList != null && stationList.Count > 0) + { + stationNo = stationList[0].StationNo; + } + + if (string.IsNullOrEmpty(stationNo)) + { + Response.Write(ResponseResult.Fail("工位号不存在!")); + Response.End(); + return; + } + + Bom_MKBLL bll = new Bom_MKBLL(); + tb_Bom_MK md = new tb_Bom_MK(); + + md.PartNo1 = PartNo1; + md.PartNo2 = PartNo2; + md.PlaceName = PlaceName; + md.StationNo = StationNo; + if(IsPartAssemble == "1") + { + md.IsPartAssemble = 1; + } + else + { + md.IsPartAssemble = 0; + } + + if (IsChecked == "1") + { + md.IsChecked = true; + } + + var info = Request.Cookies.Get("LoginUserInfo"); + if (info != null) + { + md.UserID = info["UserID"].ToUpper(); + } + + if (BomID == "0") + { + //新增 + //md.BomID = Guid.NewGuid().ToString(); + Response.Write(bll.AddInfo(md) == true ? ResponseResult.Success() : ResponseResult.Fail("添加失败")); + } + else + { + //修改 + md.BomID = int.Parse(BomID); + Response.Write(bll.UpdateInfo(md) == true ? ResponseResult.Success() : ResponseResult.Fail("更新失败")); + } + Response.End(); + } + void DelInfo() + { + string BomID = Request.Params["BomID"]; + + Bom_MKBLL bll = new Bom_MKBLL(); + tb_Bom_MK md = new tb_Bom_MK(); + md.BomID = int.Parse(BomID); + var info = Request.Cookies.Get("LoginUserInfo"); + if (info != null) + { + md.UserID = info["UserID"].ToUpper(); + } + Response.Write(bll.DeleteInfo(md) == true ? "true" : "false"); + Response.End(); + + } + + } +} \ No newline at end of file diff --git a/MESWebSite/HttpHandlers/ZP_MK_PlanHandler.ashx b/MESWebSite/HttpHandlers/ZP_MK_PlanHandler.ashx new file mode 100644 index 0000000..ff1a6da --- /dev/null +++ b/MESWebSite/HttpHandlers/ZP_MK_PlanHandler.ashx @@ -0,0 +1 @@ +<%@ WebHandler Language="C#" CodeBehind="ZP_MK_PlanHandler.ashx.cs" Class="MESWebSite.HttpHandlers.ZP_MK_PlanHandler" %> diff --git a/MESWebSite/HttpHandlers/ZP_MK_PlanHandler.ashx.cs b/MESWebSite/HttpHandlers/ZP_MK_PlanHandler.ashx.cs new file mode 100644 index 0000000..2ddeb73 --- /dev/null +++ b/MESWebSite/HttpHandlers/ZP_MK_PlanHandler.ashx.cs @@ -0,0 +1,172 @@ +using MESClassLibrary.BLL; +using MESClassLibrary.BLL.BasicInfo; +using MESClassLibrary.EFModel; +using MESClassLibrary.Model; +using MESWebSite.CommonClass; +using MESWebSite.Export; +using MESWebSite.Manage; +using MESWebSite.Tool; +using NPOI.XSSF.UserModel; +using System; +using System.Collections.Generic; +using System.Data; +using System.IO; +using System.Linq; +using System.Web; + +namespace MESWebSite.HttpHandlers +{ + /// + /// ZP_MK_PlanHandler 的摘要说明 + /// + public class ZP_MK_PlanHandler : BaseHandler + { + + public ZP_MK_PlanHandler() : base() + { + RegisterAction(ExportExcel); + } + + protected override void DelInfo() + { + string ID = GetParam("ID"); + ZP_MK_PlanBLL bll = new ZP_MK_PlanBLL(); + Response.Write(bll.DeleteInfo(new tb_ZP_MK_Plan() { ID = int.Parse(ID) }) ? ResponseResult.Success() : ResponseResult.Fail("删除失败")); + Response.End(); + } + + protected override void QueryList() + { + string StartTime = GetParam("StartTime"); + string EndTime = GetParam("EndTime"); + string PartNo = GetParam("PartNo"); + int page = Page.To32Int(); + int pageSize = Rows.To32Int(); + + ZP_MK_PlanBLL bll = new ZP_MK_PlanBLL(); + string reslut = bll.SearchInfoAll(page, pageSize, StartTime, EndTime, PartNo); + Response.Write(reslut); + Response.End(); + } + + protected override void SaveInfo() + { + string id = GetParam("ID"); + //string stationID = GetParam("StationID"); + string partNo = GetParam("PartNo"); + int orderCount = GetParam("OrderCount").To32Int(); + string orderName = GetParam("OrderName"); + string line = GetParam("Line"); + string station = GetParam("Station"); + + DateTime orderDate; + if (!DateTime.TryParse(GetParam("OrderDate"), out orderDate)) + { + Response.Write(ResponseResult.Fail("装配日期错误!")); + Response.End(); + return; + }; + + string lineName = ""; + BasicBLL lineDB = new BasicBLL(); + var lineList = lineDB.Search(p => p.LineName == line); + if (lineList != null && lineList.Count > 0) + { + lineName = lineList[0].LineName; + } + + if (string.IsNullOrEmpty(lineName)) + { + Response.Write(ResponseResult.Fail("产线不存在!")); + Response.End(); + return; + } + + string stationNo = ""; + BasicBLL stationDB = new BasicBLL(); + var stationList = stationDB.Search(p => p.StationNo == station); + if (stationList != null && stationList.Count > 0) + { + stationNo = stationList[0].StationNo; + } + + if (string.IsNullOrEmpty(stationNo)) + { + Response.Write(ResponseResult.Fail("工位号不存在!")); + Response.End(); + return; + } + + string partNo1 = ""; + BasicBLL partNo1DB = new BasicBLL(); + var partNo1List = partNo1DB.Search(p => p.PartNo1 == partNo); + if (partNo1List != null && partNo1List.Count > 0) + { + partNo1 = partNo1List[0].StationNo; + } + + if (string.IsNullOrEmpty(partNo1)) + { + Response.Write(ResponseResult.Fail(partNo + " 产品名称未在Bom中配置!")); + Response.End(); + return; + } + + + ZP_MK_PlanBLL bll = new ZP_MK_PlanBLL(); + + tb_ZP_MK_Plan zpp = new tb_ZP_MK_Plan + { + + PartNo = partNo, + OrderDate = orderDate, + OrderCount = orderCount, + OrderName = orderName, + Line = line, + Station = station, + + }; + + //DataTable dt = bll.SearchOrderNo(DateTime.Now.ToString("yyyMMdd")); + //if (dt != null && dt.Rows.Count > 0) + //{ + // string old = dt.Rows[0]["OrderNo"].ToString(); + // zpp.OrderNo = DateTime.Now.ToString("yyyMMdd") + (Convert.ToInt32(old.Substring(old.Length - 4, 4))+1).ToString().PadLeft(4,'0'); + //} + //else + //{ + // zpp.OrderNo = DateTime.Now.ToString("yyyMMdd") + "0001"; + //} + + if (id == "0") + { + Response.Write(bll.AddInfo(zpp) ? ResponseResult.Success() : ResponseResult.Fail("添加失败")); + } + else + { + string msg = string.Empty; + Response.Write(bll.UpdateInfo(zpp, ref msg) ? ResponseResult.Success() : ResponseResult.Fail(msg)); + } + Response.End(); + } + + public void ExportExcel() + { + + string StartTime = GetParam("StartTime"); + string EndTime = GetParam("EndTime"); + string PartNo = GetParam("PartNo"); + ZP_MK_PlanBLL bll = new ZP_MK_PlanBLL(); + List result = bll.SearchByCreateTime(StartTime, EndTime, PartNo); + ExcelTool excelTool = new ExcelTool(); + XSSFWorkbook book = excelTool.Export(result, typeof(ExportZP_MK_Plan)); + using (MemoryStream ms = new MemoryStream()) + { + book.Write(ms); + Response.AddHeader("Content-Disposition", string.Format("attachment; filename={0}.xlsx", DateTime.Now.ToString("yyyyMMddHHmmssfff"))); + Response.BinaryWrite(ms.ToArray()); + Response.End(); + } + } + } +} \ No newline at end of file diff --git a/MESWebSite/MESWebSite.csproj b/MESWebSite/MESWebSite.csproj index a65e91c..ccaf66e 100644 --- a/MESWebSite/MESWebSite.csproj +++ b/MESWebSite/MESWebSite.csproj @@ -118,6 +118,7 @@ + @@ -174,6 +175,7 @@ + @@ -836,6 +838,8 @@ + + @@ -1068,6 +1072,7 @@ + @@ -1077,6 +1082,9 @@ BarCodeReportnHandler.ashx + + Bom_MKHandler.ashx + BomHandler.ashx @@ -1293,6 +1301,9 @@ ZPBomHandler.ashx + + ZP_MK_PlanHandler.ashx + ZPPlanHandler.ashx @@ -1324,6 +1335,13 @@ BarCodeRepeatSearch.aspx + + Bom_MK.aspx + ASPXCodeBehind + + + Bom_MK.aspx + Bom.aspx ASPXCodeBehind @@ -1849,6 +1867,13 @@ ZPPlan.aspx + + ZP_MK_Plan.aspx + ASPXCodeBehind + + + ZP_MK_Plan.aspx + SystemManager.ashx diff --git a/MESWebSite/Manage/Bom.aspx b/MESWebSite/Manage/Bom.aspx index 462f08e..affa775 100644 --- a/MESWebSite/Manage/Bom.aspx +++ b/MESWebSite/Manage/Bom.aspx @@ -197,7 +197,7 @@ { field: 'PartNo1', title: '注塑件(零件号)', sortable: 'true', width: 10 }, { field: 'ProductName1', title: '产品名称', sortable: 'true', width: 10 }, { field: 'PartNo2', title: '塑料粒子(零件号)', sortable: 'true', width: 10 }, - { field: 'ProductName2', title: '原料名称', sortable: 'true', width: 10 } + { field: 'ProductName2', title: '原料名称', sortable: 'true', width: 10 } ]], pagination: true,//表示在datagrid设置分页 diff --git a/MESWebSite/Manage/Bom.aspx.designer.cs b/MESWebSite/Manage/Bom.aspx.designer.cs index ae8892f..fa029db 100644 --- a/MESWebSite/Manage/Bom.aspx.designer.cs +++ b/MESWebSite/Manage/Bom.aspx.designer.cs @@ -2,16 +2,18 @@ // <自动生成> // 此代码由工具生成。 // -// 对此文件的更改可能会导致不正确的行为,并且如果 -// 重新生成代码,这些更改将会丢失。 +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 // //------------------------------------------------------------------------------ -namespace MESWebSite.Manage { - - - public partial class Bom { - +namespace MESWebSite.Manage +{ + + + public partial class Bom + { + /// /// 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 控件。 /// diff --git a/MESWebSite/Manage/Bom_MK.aspx b/MESWebSite/Manage/Bom_MK.aspx new file mode 100644 index 0000000..6cdda30 --- /dev/null +++ b/MESWebSite/Manage/Bom_MK.aspx @@ -0,0 +1,468 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Bom_MK.aspx.cs" Inherits="MESWebSite.Manage.Bom_MK" %> + + + + + + + + + + + + + + + + + 门槛BOM信息 + + +
+
+ + + + + + + + + + + + + + +
BOM信息 + 注塑件零件号: + 塑料粒子零件号: + 地点: + 查询 + 新增 + + 编辑 + + 删除 +
+
+ +
+ + + + + + + + +
+ + diff --git a/MESWebSite/Manage/Bom_MK.aspx.cs b/MESWebSite/Manage/Bom_MK.aspx.cs new file mode 100644 index 0000000..9d22bf4 --- /dev/null +++ b/MESWebSite/Manage/Bom_MK.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 Bom_MK : 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/Bom_MK.aspx.designer.cs b/MESWebSite/Manage/Bom_MK.aspx.designer.cs new file mode 100644 index 0000000..427fc22 --- /dev/null +++ b/MESWebSite/Manage/Bom_MK.aspx.designer.cs @@ -0,0 +1,44 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace MESWebSite.Manage +{ + + + public partial class Bom_MK + { + + /// + /// 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/CarType.aspx b/MESWebSite/Manage/CarType.aspx index 2fcd077..3bbdbf4 100644 --- a/MESWebSite/Manage/CarType.aspx +++ b/MESWebSite/Manage/CarType.aspx @@ -123,7 +123,7 @@ var PrimaryID; //要编辑的id var dg = $('#tb'); //表格 var isEdit = false; //是否为编辑状态 - var handlerUrl = "/HttpHandlers/CarTypeHandler1.ashx"; + var handlerUrl = "/HttpHandlers/CarTypeHandler.ashx"; /**************** DOM加载 ***************/ $(function () { diff --git a/MESWebSite/Manage/ZP_MK_Plan.aspx b/MESWebSite/Manage/ZP_MK_Plan.aspx new file mode 100644 index 0000000..087cff8 --- /dev/null +++ b/MESWebSite/Manage/ZP_MK_Plan.aspx @@ -0,0 +1,513 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ZP_MK_Plan.aspx.cs" Inherits="MESWebSite.Manage.ZP_MK_Plan" %> + + + + + + + + + + + + + + + + 门槛装配计划 + + +
+
+ + + + + + + + + + + + + + +
门槛装配计划 零件号: + + 装配日期: + + + 查询 + 新增 + + 编辑 + + 删除 + + 导出 +
+
+ +
+ + + + + + + + +
+ + diff --git a/MESWebSite/Manage/ZP_MK_Plan.aspx.cs b/MESWebSite/Manage/ZP_MK_Plan.aspx.cs new file mode 100644 index 0000000..4d6958d --- /dev/null +++ b/MESWebSite/Manage/ZP_MK_Plan.aspx.cs @@ -0,0 +1,17 @@ +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 ZP_MK_Plan : System.Web.UI.Page + { + protected void Page_Load(object sender, EventArgs e) + { + + } + } +} \ No newline at end of file diff --git a/MESWebSite/Manage/ZP_MK_Plan.aspx.designer.cs b/MESWebSite/Manage/ZP_MK_Plan.aspx.designer.cs new file mode 100644 index 0000000..745d026 --- /dev/null +++ b/MESWebSite/Manage/ZP_MK_Plan.aspx.designer.cs @@ -0,0 +1,44 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace MESWebSite.Manage +{ + + + public partial class ZP_MK_Plan + { + + /// + /// 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/PDF/20250710110501126.jpeg b/MESWebSite/PDF/20250710110501126.jpeg new file mode 100644 index 0000000..bdaace5 Binary files /dev/null and b/MESWebSite/PDF/20250710110501126.jpeg differ