ruoxing.wang 4 days ago
parent
commit
cb19d96a44
  1. 0
      Dlls/EntityFramework.dll
  2. BIN
      Dlls/Interop.Microsoft.Office.Core.dll
  3. BIN
      Dlls/Interop.Microsoft.Office.Interop.Excel.dll
  4. BIN
      Dlls/Interop.grdes6Lib.dll
  5. BIN
      Dlls/Interop.grdesLib.dll
  6. BIN
      Dlls/Interop.gregn6Lib.dll
  7. BIN
      Dlls/Interop.grproLib.dll
  8. BIN
      Dlls/Newtonsoft.Json.dll
  9. 281
      MESClassLibrary/BLL/BasicInfo/Bom_MKBLL.cs
  10. 358
      MESClassLibrary/BLL/ZPPlan/ZP_MK_PlanBLL.cs
  11. 150
      MESClassLibrary/DAL/BasicInfo/Bom_MKDAL.cs
  12. 2
      MESClassLibrary/EFModel/BBMPT.Context.cs
  13. 2
      MESClassLibrary/EFModel/BBMPT.Designer.cs
  14. 167
      MESClassLibrary/EFModel/BBMPT.edmx
  15. 124
      MESClassLibrary/EFModel/BBMPT.edmx.diagram
  16. 2
      MESClassLibrary/EFModel/tb_BarCode1.cs
  17. 2
      MESClassLibrary/EFModel/tb_BarCode2.cs
  18. 2
      MESClassLibrary/EFModel/tb_BarCode3.cs
  19. 2
      MESClassLibrary/EFModel/tb_BarCode4.cs
  20. 2
      MESClassLibrary/EFModel/tb_BarCode5.cs
  21. 1
      MESClassLibrary/EFModel/tb_Bom.cs
  22. 26
      MESClassLibrary/EFModel/tb_Bom_MK.cs
  23. 1
      MESClassLibrary/EFModel/tb_InjectionPlan.cs
  24. 1
      MESClassLibrary/EFModel/tb_Injection_BoxRecord.cs
  25. 1
      MESClassLibrary/EFModel/tb_Operator.cs
  26. 33
      MESClassLibrary/EFModel/tb_ZP_MK_Plan.cs
  27. 12
      MESClassLibrary/MESClassLibrary.csproj
  28. 16
      MESClassLibrary/Model/Bom_MKModel.cs
  29. 20
      MESClassLibrary/Model/ZP_MK_PlanModel.cs
  30. 31
      MESWebSite/Export/ExportZP_MK_Plan.cs
  31. 1
      MESWebSite/HttpHandlers/Bom_MKHandler.ashx
  32. 162
      MESWebSite/HttpHandlers/Bom_MKHandler.ashx.cs
  33. 1
      MESWebSite/HttpHandlers/ZP_MK_PlanHandler.ashx
  34. 172
      MESWebSite/HttpHandlers/ZP_MK_PlanHandler.ashx.cs
  35. 25
      MESWebSite/MESWebSite.csproj
  36. 10
      MESWebSite/Manage/Bom.aspx.designer.cs
  37. 468
      MESWebSite/Manage/Bom_MK.aspx
  38. 20
      MESWebSite/Manage/Bom_MK.aspx.cs
  39. 44
      MESWebSite/Manage/Bom_MK.aspx.designer.cs
  40. 2
      MESWebSite/Manage/CarType.aspx
  41. 513
      MESWebSite/Manage/ZP_MK_Plan.aspx
  42. 17
      MESWebSite/Manage/ZP_MK_Plan.aspx.cs
  43. 44
      MESWebSite/Manage/ZP_MK_Plan.aspx.designer.cs
  44. BIN
      MESWebSite/PDF/20250710110501126.jpeg

0
MESWebSite/bin/EntityFramework.dll → Dlls/EntityFramework.dll

BIN
Dlls/Interop.Microsoft.Office.Core.dll

Binary file not shown.

BIN
Dlls/Interop.Microsoft.Office.Interop.Excel.dll

Binary file not shown.

BIN
Dlls/Interop.grdes6Lib.dll

Binary file not shown.

BIN
Dlls/Interop.grdesLib.dll

Binary file not shown.

BIN
Dlls/Interop.gregn6Lib.dll

Binary file not shown.

BIN
Dlls/Interop.grproLib.dll

Binary file not shown.

BIN
Dlls/Newtonsoft.Json.dll

Binary file not shown.

281
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<tb_Bom_MK> db = new BasicBLL<tb_Bom_MK>();
/// <summary>
/// 新增信息
/// </summary>
/// <param name="md"></param>
/// <returns></returns>
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;
}
}
/// <summary>
/// 修改信息
/// </summary>
/// <param name="md"></param>
/// <returns></returns>
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;
}
}
/// <summary>
/// 删除信息
/// </summary>
/// <param name="md"></param>
/// <param name="flag"></param>
/// <returns></returns>
public bool DeleteInfo(tb_Bom_MK md)
{
try
{
return db.DelInfo(md);
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return false;
}
}
/// <summary>
/// 查询全部信息分页
/// </summary>
/// <returns></returns>
public string SearchInfoAll(string page, string pagesize, string partNo1, string partNo2, string placeName)
{
try
{
string jsonStr = "[]";
int total = 0;//总行数
List<tb_Bom_MK> 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<Bom_MKModel> modelList = new List<Bom_MKModel>();
BasicBLL<tb_Product> s_db = new BasicBLL<tb_Product>();
var s_list = s_db.SearchAllInfo();
foreach (var item in list)
{
Bom_MKModel dm = Tool.Mapper<Bom_MKModel, tb_Bom_MK>(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<Bom_MKModel> md = new JsonDataModel<Bom_MKModel>();
md.total = total.ToString();
md.rows = modelList;
jsonStr = JSONTools.ScriptSerialize<JsonDataModel<Bom_MKModel>>(md);
}
return jsonStr;
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return null;
}
}
/// <summary>
/// 查询全部信息
/// </summary>
/// <returns></returns>
public List<tb_Bom_MK> SearchAll()
{
try
{
var s_list = db.SearchAllInfo().ToList();
return s_list;
}
catch (Exception)
{
return null;
}
}
/// <summary>
/// 根据ID查询信息
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
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;
}
}
}
}

358
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<tb_ZP_MK_Plan> db = new BasicBLL<tb_ZP_MK_Plan>();
/// <summary>
/// 新增信息
/// </summary>
/// <param name="md"></param>
/// <returns></returns>
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);
}
/// <summary>
/// 修改信息
/// </summary>
/// <param name="md"></param>
/// <returns></returns>
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;
}
}
/// <summary>
/// 删除信息
/// </summary>
/// <param name="md"></param>
/// <param name="flag"></param>
/// <returns></returns>
public bool DeleteInfo(tb_ZP_MK_Plan md)
{
try
{
return db.DelInfo(md);
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return false;
}
}
/// <summary>
/// 查询全部信息分页
/// </summary>
/// <returns></returns>
public string SearchInfoAll(int page,
int pagesize,
string startTime,
string endTime,
string partNo)
{
try
{
string jsonStr = "[]";
int total = 0;//总行数
IEnumerable<tb_ZP_MK_Plan> list = SearchDB(startTime, endTime, partNo);
if (list.Any())
{
List<ZP_MK_PlanModel> modelList = new List<ZP_MK_PlanModel>();
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<ZP_MK_PlanModel, tb_ZP_MK_Plan>(item);
//zpm.StationNo = stationInfo == null ? "" : stationInfo.StationNo;
zpm.ProductName = prodInfo == null ? "" : prodInfo.ProductName;
modelList.Add(zpm);
}
JsonDataModel<ZP_MK_PlanModel> md = new JsonDataModel<ZP_MK_PlanModel>
{
total = total.ToString(),
rows = modelList
};
jsonStr = md.ToSerializer();
}
return jsonStr;
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return null;
}
}
public List<ZP_MK_PlanModel> SearchByCreateTime(string startTime, string endTime, string partNo)
{
IEnumerable<tb_ZP_MK_Plan> list = SearchDB(startTime, endTime, partNo);
List<ZP_MK_PlanModel> modelList = new List<ZP_MK_PlanModel>();
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<ZP_MK_PlanModel, tb_ZP_MK_Plan>(item);
//zpm.StationNo = stationInfo == null ? "" : stationInfo.StationNo;
zpm.ProductName = prodInfo == null ? "" : prodInfo.ProductName;
modelList.Add(zpm);
}
}
return modelList;
}
public IEnumerable<tb_ZP_MK_Plan> 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<tb_ZP_MK_Plan> 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;
}
/// <summary>
/// 查询全部信息
/// </summary>
/// <returns></returns>
public List<tb_ZP_MK_Plan> SearchAll()
{
try
{
var s_list = db.SearchAllInfo();
return s_list;
}
catch (Exception ex)
{
LogErrBLL.AddInfo(ex.ToString(), MethodBase.GetCurrentMethod());
return null;
}
}
/// <summary>
/// 根据ID查询信息
/// </summary>
/// <param name="id"></param>
/// <returns></returns>
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;
}
}
}
}

150
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;
}
}
}
}

2
MESClassLibrary/EFModel/BBMPT.Context.cs

@ -195,5 +195,7 @@ namespace MESClassLibrary.EFModel
public virtual DbSet<t_XD_ProductType> t_XD_ProductType { get; set; }
public virtual DbSet<W_XD_Product_del> W_XD_Product_del { get; set; }
public virtual DbSet<t_XD_StockArea> t_XD_StockArea { get; set; }
public virtual DbSet<tb_Bom_MK> tb_Bom_MK { get; set; }
public virtual DbSet<tb_ZP_MK_Plan> tb_ZP_MK_Plan { get; set; }
}
}

2
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”。当在设计器中打开该模型时,此属性会出现在
// “属性”窗口中。

167
MESClassLibrary/EFModel/BBMPT.edmx

@ -494,6 +494,8 @@
<Property Name="Des5" Type="nvarchar" MaxLength="200" />
<Property Name="Weight" Type="decimal" Precision="18" Scale="2" />
<Property Name="BatchNo" Type="nvarchar" MaxLength="50" />
<Property Name="IsNew" Type="int" />
<Property Name="AddMan" Type="varchar" MaxLength="50" />
</EntityType>
<!--生成过程中发现错误:
警告 6002: 表/视图“BBMPT1.dbo.tb_BarCode2”未定义主键。已推断出该键,并将定义创建为只读的表/视图。-->
@ -524,6 +526,8 @@
<Property Name="Des5" Type="nvarchar" MaxLength="200" />
<Property Name="Weight" Type="decimal" Precision="18" Scale="2" />
<Property Name="BatchNo" Type="nvarchar" MaxLength="50" />
<Property Name="IsNew" Type="int" />
<Property Name="AddMan" Type="varchar" MaxLength="50" />
</EntityType>
<!--生成过程中发现错误:
警告 6002: 表/视图“BBMPT1.dbo.tb_BarCode3”未定义主键。已推断出该键,并将定义创建为只读的表/视图。-->
@ -554,6 +558,8 @@
<Property Name="Des5" Type="nvarchar" MaxLength="200" />
<Property Name="Weight" Type="decimal" Precision="18" Scale="2" />
<Property Name="BatchNo" Type="nvarchar" MaxLength="50" />
<Property Name="IsNew" Type="int" />
<Property Name="AddMan" Type="varchar" MaxLength="50" />
</EntityType>
<!--生成过程中发现错误:
警告 6002: 表/视图“BBMPT1.dbo.tb_BarCode4”未定义主键。已推断出该键,并将定义创建为只读的表/视图。-->
@ -584,6 +590,8 @@
<Property Name="Des5" Type="nvarchar" MaxLength="200" />
<Property Name="Weight" Type="decimal" Precision="18" Scale="2" />
<Property Name="BatchNo" Type="nvarchar" MaxLength="50" />
<Property Name="IsNew" Type="int" />
<Property Name="AddMan" Type="varchar" MaxLength="50" />
</EntityType>
<!--生成过程中发现错误:
警告 6002: 表/视图“BBMPT1.dbo.tb_BarCode5”未定义主键。已推断出该键,并将定义创建为只读的表/视图。-->
@ -614,6 +622,8 @@
<Property Name="Des5" Type="nvarchar" MaxLength="200" />
<Property Name="Weight" Type="decimal" Precision="18" Scale="2" />
<Property Name="BatchNo" Type="nvarchar" MaxLength="50" />
<Property Name="IsNew" Type="int" />
<Property Name="AddMan" Type="varchar" MaxLength="50" />
</EntityType>
<!--生成过程中发现错误:
警告 6002: 表/视图“BBMPT1.dbo.tb_BarCodeUnique”未定义主键。已推断出该键,并将定义创建为只读的表/视图。-->
@ -641,6 +651,20 @@
<Property Name="PartNo1" Type="nvarchar" MaxLength="50" />
<Property Name="PartNo2" Type="nvarchar" MaxLength="50" />
<Property Name="UserID" Type="char" MaxLength="36" />
<Property Name="IsChecked" Type="bit" />
</EntityType>
<EntityType Name="tb_Bom_MK">
<Key>
<PropertyRef Name="BomID" />
</Key>
<Property Name="BomID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="PartNo1" Type="nvarchar" MaxLength="50" />
<Property Name="PartNo2" Type="nvarchar" MaxLength="50" />
<Property Name="UserID" Type="char" MaxLength="36" />
<Property Name="IsChecked" Type="bit" />
<Property Name="PlaceName" Type="nvarchar" MaxLength="100" />
<Property Name="IsPartAssemble" Type="int" />
<Property Name="StationNo" Type="varchar" MaxLength="50" />
</EntityType>
<EntityType Name="tb_Box_247">
<Key>
@ -1038,6 +1062,7 @@
<Property Name="IsPrint" Type="int" />
<Property Name="PrintTime" Type="datetime" />
<Property Name="Remark" Type="varchar" MaxLength="128" />
<Property Name="IsHandPrint" Type="int" />
</EntityType>
<EntityType Name="tb_Injection_DownRecord">
<Key>
@ -1116,6 +1141,7 @@
<Property Name="MarketCount" Type="int" />
<Property Name="BadCount" Type="int" />
<Property Name="Qty" Type="int" />
<Property Name="ActualTime" Type="datetime" />
</EntityType>
<EntityType Name="tb_InjectionPlan_20200901">
<Key>
@ -1450,6 +1476,7 @@
<Property Name="OperatorPsw" Type="nvarchar" MaxLength="50" />
<Property Name="Des" Type="text" />
<Property Name="UserID" Type="char" MaxLength="36" />
<Property Name="Limit" Type="varchar" MaxLength="50" />
</EntityType>
<EntityType Name="tb_Paint_Bucket">
<Key>
@ -2187,6 +2214,26 @@
<Property Name="DeviceNo" Type="nvarchar" MaxLength="20" />
<Property Name="CreateTime" Type="datetime" />
</EntityType>
<EntityType Name="tb_ZP_MK_Plan">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="int" StoreGeneratedPattern="Identity" Nullable="false" />
<Property Name="OrderNo" Type="nvarchar" MaxLength="50" />
<Property Name="OrderName" Type="nvarchar" MaxLength="50" />
<Property Name="OrderDate" Type="datetime" />
<Property Name="Item" Type="int" />
<Property Name="Station" Type="nvarchar" MaxLength="50" />
<Property Name="Line" Type="nvarchar" MaxLength="50" />
<Property Name="PartNo" Type="nvarchar" MaxLength="50" />
<Property Name="OrderCount" Type="int" />
<Property Name="OKCount" Type="int" />
<Property Name="State" Type="int" />
<Property Name="BadCount" Type="int" />
<Property Name="CreateTime" Type="datetime" />
<Property Name="FinishTime" Type="datetime" />
<Property Name="RepairCount" Type="int" />
</EntityType>
<EntityType Name="tb_ZPBom">
<Key>
<PropertyRef Name="ID" />
@ -2588,6 +2635,7 @@
<EntitySet Name="tb_BarCode_BMW" EntityType="Self.tb_BarCode_BMW" Schema="dbo" store:Type="Tables" />
<EntitySet Name="tb_BillNo" EntityType="Self.tb_BillNo" Schema="dbo" store:Type="Tables" />
<EntitySet Name="tb_Bom" EntityType="Self.tb_Bom" Schema="dbo" store:Type="Tables" />
<EntitySet Name="tb_Bom_MK" EntityType="Self.tb_Bom_MK" Schema="dbo" store:Type="Tables" />
<EntitySet Name="tb_Box_247" EntityType="Self.tb_Box_247" Schema="dbo" store:Type="Tables" />
<EntitySet Name="tb_Box_tx" EntityType="Self.tb_Box_tx" Schema="dbo" store:Type="Tables" />
<EntitySet Name="tb_BucketInfo" EntityType="Self.tb_BucketInfo" Schema="dbo" store:Type="Tables" />
@ -2677,6 +2725,7 @@
<EntitySet Name="tb_UserLoginLog" EntityType="Self.tb_UserLoginLog" Schema="dbo" store:Type="Tables" />
<EntitySet Name="tb_Weight" EntityType="Self.tb_Weight" Schema="dbo" store:Type="Tables" />
<EntitySet Name="tb_weightRecord" EntityType="Self.tb_weightRecord" Schema="dbo" store:Type="Tables" />
<EntitySet Name="tb_ZP_MK_Plan" EntityType="Self.tb_ZP_MK_Plan" Schema="dbo" store:Type="Tables" />
<EntitySet Name="tb_ZPBom" EntityType="Self.tb_ZPBom" Schema="dbo" store:Type="Tables" />
<EntitySet Name="tb_ZPBox" EntityType="Self.tb_ZPBox" Schema="dbo" store:Type="Tables" />
<EntitySet Name="tb_ZPPlan" EntityType="Self.tb_ZPPlan" Schema="dbo" store:Type="Tables" />
@ -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]</DefiningQuery>
</EntitySet>
<EntitySet Name="tb_BarCode2" EntityType="Self.tb_BarCode2" store:Type="Tables" store:Schema="dbo">
@ -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]</DefiningQuery>
</EntitySet>
<EntitySet Name="tb_BarCode3" EntityType="Self.tb_BarCode3" store:Type="Tables" store:Schema="dbo">
@ -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]</DefiningQuery>
</EntitySet>
<EntitySet Name="tb_BarCode4" EntityType="Self.tb_BarCode4" store:Type="Tables" store:Schema="dbo">
@ -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]</DefiningQuery>
</EntitySet>
<EntitySet Name="tb_BarCode5" EntityType="Self.tb_BarCode5" store:Type="Tables" store:Schema="dbo">
@ -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]</DefiningQuery>
</EntitySet>
<EntitySet Name="tb_BarCodeUnique" EntityType="Self.tb_BarCodeUnique" store:Type="Tables" store:Schema="dbo">
@ -3532,6 +3591,8 @@
<EntitySet Name="t_XD_ProductType" EntityType="BBMPTModel.t_XD_ProductType" />
<EntitySet Name="W_XD_Product_del" EntityType="BBMPTModel.W_XD_Product_del" />
<EntitySet Name="t_XD_StockArea" EntityType="BBMPTModel.t_XD_StockArea" />
<EntitySet Name="tb_Bom_MK" EntityType="BBMPTModel.tb_Bom_MK" />
<EntitySet Name="tb_ZP_MK_Plan" EntityType="BBMPTModel.tb_ZP_MK_Plan" />
</EntityContainer>
<EntityType Name="LogErr">
<Key>
@ -3779,6 +3840,7 @@
<Property Name="PartNo1" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
<Property Name="PartNo2" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
<Property Name="UserID" Type="String" MaxLength="36" FixedLength="true" Unicode="false" />
<Property Name="IsChecked" Type="Boolean" />
</EntityType>
<EntityType Name="tb_Box_247">
<Key>
@ -4071,6 +4133,7 @@
<Property Name="IsPrint" Type="Int32" />
<Property Name="PrintTime" Type="DateTime" Precision="3" />
<Property Name="Remark" Type="String" MaxLength="128" FixedLength="false" Unicode="false" />
<Property Name="IsHandPrint" Type="Int32" />
</EntityType>
<EntityType Name="tb_Injection_DownRecord">
<Key>
@ -4149,6 +4212,7 @@
<Property Name="MarketCount" Type="Int32" />
<Property Name="BadCount" Type="Int32" />
<Property Name="Qty" Type="Int32" />
<Property Name="ActualTime" Type="DateTime" Precision="3" />
</EntityType>
<EntityType Name="tb_InjectionPlan_20200901">
<Key>
@ -4431,6 +4495,7 @@
<Property Name="OperatorPsw" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
<Property Name="Des" Type="String" MaxLength="Max" FixedLength="false" Unicode="false" />
<Property Name="UserID" Type="String" MaxLength="36" FixedLength="true" Unicode="false" />
<Property Name="Limit" Type="String" MaxLength="50" FixedLength="false" Unicode="false" />
</EntityType>
<EntityType Name="tb_Paint_Bucket">
<Key>
@ -5207,6 +5272,8 @@
<Property Name="Des5" Type="String" MaxLength="200" FixedLength="false" Unicode="true" />
<Property Name="Weight" Type="Decimal" Precision="18" Scale="2" />
<Property Name="BatchNo" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
<Property Name="IsNew" Type="Int32" />
<Property Name="AddMan" Type="String" MaxLength="50" FixedLength="false" Unicode="false" />
</EntityType>
<EntityType Name="tb_BarCode2">
<Key>
@ -5235,6 +5302,8 @@
<Property Name="Des5" Type="String" MaxLength="200" FixedLength="false" Unicode="true" />
<Property Name="Weight" Type="Decimal" Precision="18" Scale="2" />
<Property Name="BatchNo" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
<Property Name="IsNew" Type="Int32" />
<Property Name="AddMan" Type="String" MaxLength="50" FixedLength="false" Unicode="false" />
</EntityType>
<EntityType Name="tb_BarCode3">
<Key>
@ -5263,6 +5332,8 @@
<Property Name="Des5" Type="String" MaxLength="200" FixedLength="false" Unicode="true" />
<Property Name="Weight" Type="Decimal" Precision="18" Scale="2" />
<Property Name="BatchNo" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
<Property Name="IsNew" Type="Int32" />
<Property Name="AddMan" Type="String" MaxLength="50" FixedLength="false" Unicode="false" />
</EntityType>
<EntityType Name="tb_BarCode4">
<Key>
@ -5291,6 +5362,8 @@
<Property Name="Des5" Type="String" MaxLength="200" FixedLength="false" Unicode="true" />
<Property Name="Weight" Type="Decimal" Precision="18" Scale="2" />
<Property Name="BatchNo" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
<Property Name="IsNew" Type="Int32" />
<Property Name="AddMan" Type="String" MaxLength="50" FixedLength="false" Unicode="false" />
</EntityType>
<EntityType Name="tb_BarCode5">
<Key>
@ -5319,6 +5392,8 @@
<Property Name="Des5" Type="String" MaxLength="200" FixedLength="false" Unicode="true" />
<Property Name="Weight" Type="Decimal" Precision="18" Scale="2" />
<Property Name="BatchNo" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
<Property Name="IsNew" Type="Int32" />
<Property Name="AddMan" Type="String" MaxLength="50" FixedLength="false" Unicode="false" />
</EntityType>
<EntityType Name="tb_BarCodeUnique">
<Key>
@ -6006,6 +6081,39 @@
<Property Name="Name" Type="String" MaxLength="255" FixedLength="false" Unicode="true" />
<Property Name="U8Code" Type="String" MaxLength="20" FixedLength="false" Unicode="true" />
</EntityType>
<EntityType Name="tb_Bom_MK">
<Key>
<PropertyRef Name="BomID" />
</Key>
<Property Name="BomID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="PartNo1" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
<Property Name="PartNo2" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
<Property Name="UserID" Type="String" MaxLength="36" FixedLength="true" Unicode="false" />
<Property Name="IsChecked" Type="Boolean" />
<Property Name="PlaceName" Type="String" MaxLength="100" FixedLength="false" Unicode="true" />
<Property Name="IsPartAssemble" Type="Int32" />
<Property Name="StationNo" Type="String" MaxLength="50" FixedLength="false" Unicode="false" />
</EntityType>
<EntityType Name="tb_ZP_MK_Plan">
<Key>
<PropertyRef Name="ID" />
</Key>
<Property Name="ID" Type="Int32" Nullable="false" annotation:StoreGeneratedPattern="Identity" />
<Property Name="OrderNo" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
<Property Name="OrderName" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
<Property Name="OrderDate" Type="DateTime" Precision="3" />
<Property Name="Item" Type="Int32" />
<Property Name="Station" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
<Property Name="Line" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
<Property Name="PartNo" Type="String" MaxLength="50" FixedLength="false" Unicode="true" />
<Property Name="OrderCount" Type="Int32" />
<Property Name="OKCount" Type="Int32" />
<Property Name="State" Type="Int32" />
<Property Name="BadCount" Type="Int32" />
<Property Name="CreateTime" Type="DateTime" Precision="3" />
<Property Name="FinishTime" Type="DateTime" Precision="3" />
<Property Name="RepairCount" Type="Int32" />
</EntityType>
</Schema>
</edmx:ConceptualModels>
<!-- C-S mapping content -->
@ -6272,6 +6380,7 @@
<EntitySetMapping Name="tb_Bom">
<EntityTypeMapping TypeName="BBMPTModel.tb_Bom">
<MappingFragment StoreEntitySet="tb_Bom">
<ScalarProperty Name="IsChecked" ColumnName="IsChecked" />
<ScalarProperty Name="UserID" ColumnName="UserID" />
<ScalarProperty Name="PartNo2" ColumnName="PartNo2" />
<ScalarProperty Name="PartNo1" ColumnName="PartNo1" />
@ -6579,6 +6688,7 @@
<EntitySetMapping Name="tb_Injection_BoxRecord">
<EntityTypeMapping TypeName="BBMPTModel.tb_Injection_BoxRecord">
<MappingFragment StoreEntitySet="tb_Injection_BoxRecord">
<ScalarProperty Name="IsHandPrint" ColumnName="IsHandPrint" />
<ScalarProperty Name="Remark" ColumnName="Remark" />
<ScalarProperty Name="PrintTime" ColumnName="PrintTime" />
<ScalarProperty Name="IsPrint" ColumnName="IsPrint" />
@ -6655,6 +6765,7 @@
<EntitySetMapping Name="tb_InjectionPlan">
<EntityTypeMapping TypeName="BBMPTModel.tb_InjectionPlan">
<MappingFragment StoreEntitySet="tb_InjectionPlan">
<ScalarProperty Name="ActualTime" ColumnName="ActualTime" />
<ScalarProperty Name="Qty" ColumnName="Qty" />
<ScalarProperty Name="BadCount" ColumnName="BadCount" />
<ScalarProperty Name="MarketCount" ColumnName="MarketCount" />
@ -6971,6 +7082,7 @@
<EntitySetMapping Name="tb_Operator">
<EntityTypeMapping TypeName="BBMPTModel.tb_Operator">
<MappingFragment StoreEntitySet="tb_Operator">
<ScalarProperty Name="Limit" ColumnName="Limit" />
<ScalarProperty Name="UserID" ColumnName="UserID" />
<ScalarProperty Name="Des" ColumnName="Des" />
<ScalarProperty Name="OperatorPsw" ColumnName="OperatorPsw" />
@ -7779,6 +7891,8 @@
<EntitySetMapping Name="tb_BarCode1">
<EntityTypeMapping TypeName="BBMPTModel.tb_BarCode1">
<MappingFragment StoreEntitySet="tb_BarCode1">
<ScalarProperty Name="AddMan" ColumnName="AddMan" />
<ScalarProperty Name="IsNew" ColumnName="IsNew" />
<ScalarProperty Name="BatchNo" ColumnName="BatchNo" />
<ScalarProperty Name="Weight" ColumnName="Weight" />
<ScalarProperty Name="Des5" ColumnName="Des5" />
@ -7808,6 +7922,8 @@
<EntitySetMapping Name="tb_BarCode2">
<EntityTypeMapping TypeName="BBMPTModel.tb_BarCode2">
<MappingFragment StoreEntitySet="tb_BarCode2">
<ScalarProperty Name="AddMan" ColumnName="AddMan" />
<ScalarProperty Name="IsNew" ColumnName="IsNew" />
<ScalarProperty Name="BatchNo" ColumnName="BatchNo" />
<ScalarProperty Name="Weight" ColumnName="Weight" />
<ScalarProperty Name="Des5" ColumnName="Des5" />
@ -7837,6 +7953,8 @@
<EntitySetMapping Name="tb_BarCode3">
<EntityTypeMapping TypeName="BBMPTModel.tb_BarCode3">
<MappingFragment StoreEntitySet="tb_BarCode3">
<ScalarProperty Name="AddMan" ColumnName="AddMan" />
<ScalarProperty Name="IsNew" ColumnName="IsNew" />
<ScalarProperty Name="BatchNo" ColumnName="BatchNo" />
<ScalarProperty Name="Weight" ColumnName="Weight" />
<ScalarProperty Name="Des5" ColumnName="Des5" />
@ -7866,6 +7984,8 @@
<EntitySetMapping Name="tb_BarCode4">
<EntityTypeMapping TypeName="BBMPTModel.tb_BarCode4">
<MappingFragment StoreEntitySet="tb_BarCode4">
<ScalarProperty Name="AddMan" ColumnName="AddMan" />
<ScalarProperty Name="IsNew" ColumnName="IsNew" />
<ScalarProperty Name="BatchNo" ColumnName="BatchNo" />
<ScalarProperty Name="Weight" ColumnName="Weight" />
<ScalarProperty Name="Des5" ColumnName="Des5" />
@ -7895,6 +8015,8 @@
<EntitySetMapping Name="tb_BarCode5">
<EntityTypeMapping TypeName="BBMPTModel.tb_BarCode5">
<MappingFragment StoreEntitySet="tb_BarCode5">
<ScalarProperty Name="AddMan" ColumnName="AddMan" />
<ScalarProperty Name="IsNew" ColumnName="IsNew" />
<ScalarProperty Name="BatchNo" ColumnName="BatchNo" />
<ScalarProperty Name="Weight" ColumnName="Weight" />
<ScalarProperty Name="Des5" ColumnName="Des5" />
@ -8632,6 +8754,41 @@
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="tb_Bom_MK">
<EntityTypeMapping TypeName="BBMPTModel.tb_Bom_MK">
<MappingFragment StoreEntitySet="tb_Bom_MK">
<ScalarProperty Name="StationNo" ColumnName="StationNo" />
<ScalarProperty Name="IsPartAssemble" ColumnName="IsPartAssemble" />
<ScalarProperty Name="PlaceName" ColumnName="PlaceName" />
<ScalarProperty Name="IsChecked" ColumnName="IsChecked" />
<ScalarProperty Name="UserID" ColumnName="UserID" />
<ScalarProperty Name="PartNo2" ColumnName="PartNo2" />
<ScalarProperty Name="PartNo1" ColumnName="PartNo1" />
<ScalarProperty Name="BomID" ColumnName="BomID" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
<EntitySetMapping Name="tb_ZP_MK_Plan">
<EntityTypeMapping TypeName="BBMPTModel.tb_ZP_MK_Plan">
<MappingFragment StoreEntitySet="tb_ZP_MK_Plan">
<ScalarProperty Name="RepairCount" ColumnName="RepairCount" />
<ScalarProperty Name="FinishTime" ColumnName="FinishTime" />
<ScalarProperty Name="CreateTime" ColumnName="CreateTime" />
<ScalarProperty Name="BadCount" ColumnName="BadCount" />
<ScalarProperty Name="State" ColumnName="State" />
<ScalarProperty Name="OKCount" ColumnName="OKCount" />
<ScalarProperty Name="OrderCount" ColumnName="OrderCount" />
<ScalarProperty Name="PartNo" ColumnName="PartNo" />
<ScalarProperty Name="Line" ColumnName="Line" />
<ScalarProperty Name="Station" ColumnName="Station" />
<ScalarProperty Name="Item" ColumnName="Item" />
<ScalarProperty Name="OrderDate" ColumnName="OrderDate" />
<ScalarProperty Name="OrderName" ColumnName="OrderName" />
<ScalarProperty Name="OrderNo" ColumnName="OrderNo" />
<ScalarProperty Name="ID" ColumnName="ID" />
</MappingFragment>
</EntityTypeMapping>
</EntitySetMapping>
</EntityContainerMapping>
</Mapping>
</edmx:Mappings>

124
MESClassLibrary/EFModel/BBMPT.edmx.diagram

@ -173,6 +173,10 @@
<EntityTypeShape EntityType="BBMPTModel.View_1" Width="1.5" PointX="0.5" PointY="18.625" IsExpanded="false" />
<AssociationConnector Association="BBMPTModel.FK_T_SYS_RO_REFERENCE_T_SYS_PO" />
<EntityTypeShape EntityType="BBMPTModel.tb_ForeignColorMap" Width="1.5" PointX="0.5" PointY="3.75" IsExpanded="false" />
<EntityTypeShape EntityType="BBMPTModel.tb_Bom_MK" Width="1.5" PointX="7.5884246675243716" PointY="25.518843707404493" />
<EntityTypeShape EntityType="BBMPTModel.tb_ZP_MK_Plan" Width="1.5" PointX="8.6183643250811688" PointY="11.701445868099782" />
@ -6475,6 +6479,126 @@
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
&gt;&gt;&gt;&gt;&gt;&gt;&gt; .r85
</Diagram>
<Diagram DiagramId="56fb9509dfdb4dde96dce5edc0ce3e94" Name="Diagram2" >
</Diagram>

2
MESClassLibrary/EFModel/tb_BarCode1.cs

@ -37,5 +37,7 @@ namespace MESClassLibrary.EFModel
public string Des5 { get; set; }
public Nullable<decimal> Weight { get; set; }
public string BatchNo { get; set; }
public Nullable<int> IsNew { get; set; }
public string AddMan { get; set; }
}
}

2
MESClassLibrary/EFModel/tb_BarCode2.cs

@ -37,5 +37,7 @@ namespace MESClassLibrary.EFModel
public string Des5 { get; set; }
public Nullable<decimal> Weight { get; set; }
public string BatchNo { get; set; }
public Nullable<int> IsNew { get; set; }
public string AddMan { get; set; }
}
}

2
MESClassLibrary/EFModel/tb_BarCode3.cs

@ -37,5 +37,7 @@ namespace MESClassLibrary.EFModel
public string Des5 { get; set; }
public Nullable<decimal> Weight { get; set; }
public string BatchNo { get; set; }
public Nullable<int> IsNew { get; set; }
public string AddMan { get; set; }
}
}

2
MESClassLibrary/EFModel/tb_BarCode4.cs

@ -37,5 +37,7 @@ namespace MESClassLibrary.EFModel
public string Des5 { get; set; }
public Nullable<decimal> Weight { get; set; }
public string BatchNo { get; set; }
public Nullable<int> IsNew { get; set; }
public string AddMan { get; set; }
}
}

2
MESClassLibrary/EFModel/tb_BarCode5.cs

@ -37,5 +37,7 @@ namespace MESClassLibrary.EFModel
public string Des5 { get; set; }
public Nullable<decimal> Weight { get; set; }
public string BatchNo { get; set; }
public Nullable<int> IsNew { get; set; }
public string AddMan { get; set; }
}
}

1
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<bool> IsChecked { get; set; }
}
}

26
MESClassLibrary/EFModel/tb_Bom_MK.cs

@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码已从模板生成。
//
// 手动更改此文件可能导致应用程序出现意外的行为。
// 如果重新生成代码,将覆盖对此文件的手动更改。
// </auto-generated>
//------------------------------------------------------------------------------
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<bool> IsChecked { get; set; }
public string PlaceName { get; set; }
public Nullable<int> IsPartAssemble { get; set; }
public string StationNo { get; set; }
}
}

1
MESClassLibrary/EFModel/tb_InjectionPlan.cs

@ -34,5 +34,6 @@ namespace MESClassLibrary.EFModel
public Nullable<int> MarketCount { get; set; }
public Nullable<int> BadCount { get; set; }
public Nullable<int> Qty { get; set; }
public Nullable<System.DateTime> ActualTime { get; set; }
}
}

1
MESClassLibrary/EFModel/tb_Injection_BoxRecord.cs

@ -27,5 +27,6 @@ namespace MESClassLibrary.EFModel
public Nullable<int> IsPrint { get; set; }
public Nullable<System.DateTime> PrintTime { get; set; }
public string Remark { get; set; }
public Nullable<int> IsHandPrint { get; set; }
}
}

1
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; }
}
}

33
MESClassLibrary/EFModel/tb_ZP_MK_Plan.cs

@ -0,0 +1,33 @@
//------------------------------------------------------------------------------
// <auto-generated>
// 此代码已从模板生成。
//
// 手动更改此文件可能导致应用程序出现意外的行为。
// 如果重新生成代码,将覆盖对此文件的手动更改。
// </auto-generated>
//------------------------------------------------------------------------------
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<System.DateTime> OrderDate { get; set; }
public Nullable<int> Item { get; set; }
public string Station { get; set; }
public string Line { get; set; }
public string PartNo { get; set; }
public Nullable<int> OrderCount { get; set; }
public Nullable<int> OKCount { get; set; }
public Nullable<int> State { get; set; }
public Nullable<int> BadCount { get; set; }
public Nullable<System.DateTime> CreateTime { get; set; }
public Nullable<System.DateTime> FinishTime { get; set; }
public Nullable<int> RepairCount { get; set; }
}
}

12
MESClassLibrary/MESClassLibrary.csproj

@ -64,6 +64,7 @@
<Compile Include="BLL\BasicInfo\BarCodeBLL.cs" />
<Compile Include="BLL\BasicInfo\BarcodeBMWBLL.cs" />
<Compile Include="BLL\BasicInfo\BasicBLL1.cs" />
<Compile Include="BLL\BasicInfo\Bom_MKBLL.cs" />
<Compile Include="BLL\BasicInfo\BomBLL.cs" />
<Compile Include="BLL\BasicInfo\BucketInfoBLL.cs" />
<Compile Include="BLL\BasicInfo\XDStockAreaBLL.cs" />
@ -162,6 +163,7 @@
<Compile Include="BLL\ZPPlan\ScanRecordBLL.cs" />
<Compile Include="BLL\ZPPlan\ZPBomBLL.cs" />
<Compile Include="BLL\ZPPlan\ZPBoxBLL.cs" />
<Compile Include="BLL\ZPPlan\ZP_MK_PlanBLL.cs" />
<Compile Include="BLL\ZPPlan\ZPPlanBLL.cs" />
<Compile Include="BLL\ZPPlan\ZPRecordBLL.cs" />
<Compile Include="BLL\ZPPlan\ZPStepRecordBLL.cs" />
@ -175,6 +177,7 @@
<Compile Include="DAL\BasicInfo\BarcodeBMWDAL.cs" />
<Compile Include="DAL\BasicInfo\BarCodeDAl.cs" />
<Compile Include="DAL\BasicInfo\BasicDAL1.cs" />
<Compile Include="DAL\BasicInfo\Bom_MKDAL.cs" />
<Compile Include="DAL\BasicInfo\BomDAL.cs" />
<Compile Include="DAL\BasicInfo\CarTypeDAL.cs" />
<Compile Include="DAL\BasicInfo\ColorDAL.cs" />
@ -326,6 +329,9 @@
<Compile Include="EFModel\tb_Bom.cs">
<DependentUpon>BBMPT.tt</DependentUpon>
</Compile>
<Compile Include="EFModel\tb_Bom_MK.cs">
<DependentUpon>BBMPT.tt</DependentUpon>
</Compile>
<Compile Include="EFModel\tb_Box_247.cs">
<DependentUpon>BBMPT.tt</DependentUpon>
</Compile>
@ -692,6 +698,9 @@
<Compile Include="EFModel\tb_ZPTagValue.cs">
<DependentUpon>BBMPT.tt</DependentUpon>
</Compile>
<Compile Include="EFModel\tb_ZP_MK_Plan.cs">
<DependentUpon>BBMPT.tt</DependentUpon>
</Compile>
<Compile Include="EFModel\test1.cs">
<DependentUpon>BBMPT.tt</DependentUpon>
</Compile>
@ -777,6 +786,7 @@
<Compile Include="Model\BadZPModel.cs" />
<Compile Include="Model\BarCodeModel.cs" />
<Compile Include="Model\BasicModel.cs" />
<Compile Include="Model\Bom_MKModel.cs" />
<Compile Include="Model\BomModel.cs" />
<Compile Include="Model\BoxModel.cs" />
<Compile Include="Model\CarTypeModel.cs" />
@ -849,6 +859,7 @@
<Compile Include="Model\WMS_InjectionModel.cs" />
<Compile Include="Model\ZPBomModel.cs" />
<Compile Include="Model\ZPBoxModel.cs" />
<Compile Include="Model\ZP_MK_PlanModel.cs" />
<Compile Include="Model\ZPPlanModel.cs" />
<Compile Include="Model\ZPRecordModel.cs" />
<Compile Include="Model\ZPTagValueModel.cs" />
@ -883,6 +894,5 @@
<ItemGroup>
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
</ItemGroup>
<ItemGroup />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

16
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; }
}
}

20
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
{
/// <summary>
/// 工位名称
/// </summary>
public string StationNo { get; set; }
/// <summary>
/// 零件名称
/// </summary>
public string ProductName { get; set; }
}
}

31
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<int> Item { get; set; }
[ExportHeader(HeaderName ="产品名称")]
public string ProductName { get; set; }
[ExportHeader(HeaderName = "零件编号")]
public string PartNo { get; set; }
[ExportHeader(HeaderName = "计划数量")]
public Nullable<int> OrderCount { get; set; }
[ExportHeader(HeaderName = "生产数量")]
public Nullable<int> ProductCount { get; set; }
[ExportHeader(HeaderName = "装配日期")]
public Nullable<System.DateTime> OrderDate { get; set; }
}
}

1
MESWebSite/HttpHandlers/Bom_MKHandler.ashx

@ -0,0 +1 @@
<%@ WebHandler Language="C#" CodeBehind="Bom_MKHandler.ashx.cs" Class="MESWebSite.HttpHandlers.Bom_MKHandler" %>

162
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
{
/// <summary>
/// Bom_MKHandler 的摘要说明
/// </summary>
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<tb_Station> stationDB = new BasicBLL<tb_Station>();
var stationList = stationDB.Search<tb_Station>(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();
}
}
}

1
MESWebSite/HttpHandlers/ZP_MK_PlanHandler.ashx

@ -0,0 +1 @@
<%@ WebHandler Language="C#" CodeBehind="ZP_MK_PlanHandler.ashx.cs" Class="MESWebSite.HttpHandlers.ZP_MK_PlanHandler" %>

172
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
{
/// <summary>
/// ZP_MK_PlanHandler 的摘要说明
/// </summary>
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<tb_Line> lineDB = new BasicBLL<tb_Line>();
var lineList = lineDB.Search<tb_Line>(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<tb_Station> stationDB = new BasicBLL<tb_Station>();
var stationList = stationDB.Search<tb_Station>(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<tb_Bom_MK> partNo1DB = new BasicBLL<tb_Bom_MK>();
var partNo1List = partNo1DB.Search<tb_Bom_MK>(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<ZP_MK_PlanModel> 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();
}
}
}
}

25
MESWebSite/MESWebSite.csproj

@ -118,6 +118,7 @@
<Content Include="Manage\BadInjectionSearch.aspx" />
<Content Include="Manage\BarCodeRecord.aspx" />
<Content Include="Manage\BarCodeRepeatSearch.aspx" />
<Content Include="Manage\Bom_MK.aspx" />
<Content Include="Manage\BucketInfo.aspx" />
<Content Include="Manage\BucketState.aspx" />
<Content Include="Manage\XDStockArea.aspx" />
@ -174,6 +175,7 @@
<Content Include="Manage\ZpBadInjectionSearch.aspx" />
<Content Include="Manage\ZPBom.aspx" />
<Content Include="Manage\ZPPlan.aspx" />
<Content Include="Manage\ZP_MK_Plan.aspx" />
<Content Include="PDF\20200409101110668.jpg" />
<Content Include="PDF\20200409101203760.jpg" />
<Content Include="PDF\20200409101239287.jpg" />
@ -836,6 +838,8 @@
<Content Include="HttpHandlers\XDColorHandler.ashx" />
<Content Include="HttpHandlers\XDProductHandler.ashx" />
<Content Include="HttpHandlers\XDStockAreaHandler.ashx" />
<Content Include="HttpHandlers\ZP_MK_PlanHandler.ashx" />
<Content Include="HttpHandlers\Bom_MKHandler.ashx" />
<None Include="Properties\PublishProfiles\BBMPT1.pubxml" />
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" />
<None Include="Properties\PublishProfiles\Web.config.pubxml" />
@ -1068,6 +1072,7 @@
<Compile Include="CommonClass\ResponseResult.cs" />
<Compile Include="CommonClass\SQLHelper.cs" />
<Compile Include="CommonClass\StringHelper.cs" />
<Compile Include="Export\ExportZP_MK_Plan.cs" />
<Compile Include="Export\ExportZPPlan.cs" />
<Compile Include="HelperTools.cs" />
<Compile Include="HttpHandlers\BadInjectionSearchHandler.ashx.cs">
@ -1077,6 +1082,9 @@
<DependentUpon>BarCodeReportnHandler.ashx</DependentUpon>
</Compile>
<Compile Include="HttpHandlers\BaseHandler.cs" />
<Compile Include="HttpHandlers\Bom_MKHandler.ashx.cs">
<DependentUpon>Bom_MKHandler.ashx</DependentUpon>
</Compile>
<Compile Include="HttpHandlers\BomHandler.ashx.cs">
<DependentUpon>BomHandler.ashx</DependentUpon>
</Compile>
@ -1293,6 +1301,9 @@
<Compile Include="HttpHandlers\ZPBomHandler.ashx.cs">
<DependentUpon>ZPBomHandler.ashx</DependentUpon>
</Compile>
<Compile Include="HttpHandlers\ZP_MK_PlanHandler.ashx.cs">
<DependentUpon>ZP_MK_PlanHandler.ashx</DependentUpon>
</Compile>
<Compile Include="HttpHandlers\ZPPlanHandler.ashx.cs">
<DependentUpon>ZPPlanHandler.ashx</DependentUpon>
</Compile>
@ -1324,6 +1335,13 @@
<Compile Include="Manage\BarCodeRepeatSearch.aspx.designer.cs">
<DependentUpon>BarCodeRepeatSearch.aspx</DependentUpon>
</Compile>
<Compile Include="Manage\Bom_MK.aspx.cs">
<DependentUpon>Bom_MK.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Manage\Bom_MK.aspx.designer.cs">
<DependentUpon>Bom_MK.aspx</DependentUpon>
</Compile>
<Compile Include="Manage\Bom.aspx.cs">
<DependentUpon>Bom.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -1849,6 +1867,13 @@
<Compile Include="Manage\ZPPlan.aspx.designer.cs">
<DependentUpon>ZPPlan.aspx</DependentUpon>
</Compile>
<Compile Include="Manage\ZP_MK_Plan.aspx.cs">
<DependentUpon>ZP_MK_Plan.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Manage\ZP_MK_Plan.aspx.designer.cs">
<DependentUpon>ZP_MK_Plan.aspx</DependentUpon>
</Compile>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Service\SystemManager.ashx.cs">
<DependentUpon>SystemManager.ashx</DependentUpon>

10
MESWebSite/Manage/Bom.aspx.designer.cs

@ -2,15 +2,17 @@
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,并且如果
// 重新生成代码,这些更改将会丢失。
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace MESWebSite.Manage {
namespace MESWebSite.Manage
{
public partial class Bom {
public partial class Bom
{
/// <summary>
/// form1 控件。

468
MESWebSite/Manage/Bom_MK.aspx

@ -0,0 +1,468 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Bom_MK.aspx.cs" Inherits="MESWebSite.Manage.Bom_MK" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="/CSS/Basics.css" rel="stylesheet" />
<link href="/Scripts/jquery-easyui-1.4.3/themes/metro/easyui.css" rel="stylesheet" type="text/css" />
<link href="/Scripts/jquery-easyui-1.4.3/themes/icon.css" rel="stylesheet" type="text/css" />
<link href="/Scripts/jquery-easyui-1.4.3/themes/color.css" rel="stylesheet" type="text/css" />
<script src="/Scripts/jquery-easyui-1.4.3/jquery.min.js" type="text/javascript"></script>
<script src="/Scripts/jquery-easyui-1.4.3/jquery.easyui.min.js" type="text/javascript"></script>
<script src="/Scripts/jquery-easyui-1.4.3/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
<script src="/Scripts/MyJs.js" type="text/javascript"></script>
<style>
#w td {
padding: 5px 5px;
text-align: left;
vertical-align: middle;
}
#w .title {
vertical-align: middle;
text-align: right;
width: 80px;
height: 40px;
}
p {
padding: 5px;
font-size: small;
font-family: 微软雅黑;
}
.datagrid {
text-align: center;
}
.search_first{
margin-left: 15%
}
/* 中等屏幕 桌面显示器 992至1400 */
@media screen and (min-width:992px) and (max-width:1400px){
.search_first{
margin-left: 0.1%
}
}
</style>
<title>门槛BOM信息</title>
</head>
<body>
<form id="form1" runat="server">
<div class="top">
<table style="width: 100%">
<tr style="display: flex ;flex-direction: row; flex-wrap: wrap;">
<td><span class="title" style="width: 150px">BOM信息</span>
</td>
<td style="width: 50px;"></td>
<td style="width: 300px;">注塑件零件号:
<input type="text" id="PartNo1_s" style="width: 140px;" /></td>
<td style="width: 300px;">塑料粒子零件号:
<input type="text" id="PartNo2_s" style="width: 140px;" /></td>
<td style="width: 200px;">地点:
<input type="text" id="PlaceName_s" style="width: 140px;" /></td>
<td style="width: 80px" ><a class="topsearchBtn">查询</a></td>
<td style="width: 80px">
<a class="topaddBtn">新增</a>
</td>
<td style="width: 80px">
<a class="toppenBtn">编辑</a>
</td>
<td style="width: 80px">
<a class="topdelBtn">删除</a>
</td>
</tr>
</table>
</div>
<table id="tb" title="BOM信息" style="width: 99%;">
</table>
<!-- 编辑窗口 -->
<div id="w" style="padding: 10px; visibility: hidden" title="编辑">
<table cellpadding="0" cellspacing="0">
<tr>
<td class="title" style="width: 110px;">
<p>
注塑件(零件号):
</p>
</td>
<td colspan="2">
<select id="fl_id_1" class="easyui-combobox" style="width: 234px; height: 36px;"
data-options="valueField: 'PartNo',textField: 'PartName'">
</select><span style="color: red; font-size: 18px; vertical-align: middle;">*</span>
</td>
</tr>
<tr>
<td class="title" style="width: 110px;">
<p>
塑料粒子(零件号):
</p>
</td>
<td colspan="2">
<select id="fl_id_2" class="easyui-combobox" style="width: 234px; height: 36px;"
data-options="valueField: 'PartNo',textField: 'PartName'">
</select><span style="color: red; font-size: 18px; vertical-align: middle;">*</span>
</td>
</tr>
<tr>
<td class="title" style="width: 110px;">
<p>
是否检测:
</p>
</td>
<td colspan="2">
<input id="IsChecked" type="checkbox"/>
</td>
</tr>
<tr>
<td class="title" style="width: 110px;">
<p>
是否半成品:
</p>
</td>
<td colspan="2">
<input id="IsPartAssemble" type="checkbox"/>
</td>
</tr>
<tr>
<td class="title" style="width: 110px;">
<p>
工位号:
</p>
</td>
<td colspan="2">
<input id="StationNo" type="text" class="text" style="width: 220px; height: 30px;" /><span style="color: red; font-size: 18px; vertical-align: middle;">*</span>
</td>
</tr>
<tr>
<td class="title" style="width: 110px;">
<p>
地点:
</p>
</td>
<td colspan="2">
<input id="PlaceName" type="text" class="text" style="width: 220px; height: 30px;" /><span style="color: red; font-size: 18px; vertical-align: middle;">*</span>
</td>
</tr>
</table>
</div>
<!-- 编辑窗口 - footer -->
<div id="ft" style="padding: 10px; text-align: center; background-color: #f9f9f9; visibility: hidden">
<a class="saveBtn" id="saveBtn">保存</a>
</div>
<div hidden="hidden">
<asp:Label ID="lblMessage" runat="server" Text=""></asp:Label>
</div>
<input id="UserID" type="text" hidden="hidden" runat="server" />
<script>
/**************** 全局变量 ***************/
var PrimaryID; //要编辑的id
var dg = $('#tb'); //表格
var isEdit = false; //是否为编辑状态
/**************** DOM加载 ***************/
$(function () {
$.ajaxSetup({
cache: false //关闭AJAX缓存
});
//新增按钮点击
$('.topaddBtn').first().click(function () {
isEdit = false;
$('#w').window('open');
});
//编辑按钮点击
$('.toppenBtn').first().click(function () {
isEdit = true;
initEidtWidget();
});
//删除按钮
$('.topdelBtn').first().click(function () {
$.messager.confirm('提示框', '你确定要删除吗?', function (r) {
if (r) {
deleteInfos();
}
});
});
//搜索按钮
$('.topsearchBtn').first().click(function () {
SearchInfo();
});
//保存按钮
$('#saveBtn').bind('click', function () {
SaveInfo(isEdit);
});
//编辑窗口加载
$('#w').window({
modal: true,
closed: true,
minimizable: false,
maximizable: false,
collapsible: false,
width: 460,
height: 520,
footer: '#ft',
top: 20,
onBeforeClose: function () { clearw(); },
onBeforeOpen: function () {
$('#w').css('visibility', 'visible'); $('#ft').css('visibility', 'visible');
reloadfl_id();
}
});
dg = $('#tb').datagrid({
fitColumns: true,
nowrap: false,
striped: true,
collapsible: false,
url: "/HttpHandlers/Bom_MKHandler.ashx?method=QueryList",
//sortName: 'sortNumber',
//sortOrder: 'asc',
remoteSort: false,
columns: [[
{ field: 'BomID', title: 'BomID', hidden: true },
{ 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: 'IsChecked', title: '是否检测', sortable: 'true', width: 10,
formatter: function (value) {
if (value == true) {
return "是";
} else {
return "否";
}
}
},
{
field: 'IsPartAssemble', title: '是否半成品', sortable: 'true', width: 10,
formatter: function (value) {
if (value == 1) {
return "是";
} else {
return "否";
}
}
},
{ field: 'StationNo', title: '工位号', sortable: 'true', width: 10 },
{ field: 'PlaceName', title: '地点', sortable: 'true', width: 10 },
]],
pagination: true,//表示在datagrid设置分页
rownumbers: true,
singleSelect: true
});
dg.datagrid('getPager').pagination({
pageSize: 10,
pageNumber: 1,
pageList: [10, 20, 30, 40, 50],
beforePageText: '第',//页数文本框前显示的汉字
afterPageText: '页 共 {pages} 页',
displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录',
});
});
/**************** 主要业务程序 ***************/
//新增 / 编辑
function SaveInfo(isEdit) {
var BomID = isEdit == true ? PrimaryID : 0;
var PartNo1 = $('#fl_id_1').combo('getValue');
var PartNo2 = $('#fl_id_2').combo('getValue');
var PlaceName = $('#PlaceName').val();
var StationNo = $('#StationNo').val();
var IsChecked = 0;
if ($('#IsChecked').is(':checked')) {
IsChecked = 1;
}
var IsPartAssemble = 0;
if ($('#IsPartAssemble').is(':checked')) {
IsPartAssemble = 1;
}
if (PartNo1 == "") {
$.messager.alert('提示', '注塑件不能为空,请重新输入', 'warning');
return;
}
if (PartNo2 == "") {
$.messager.alert('提示', '塑料粒子不能为空,请重新输入', 'warning');
return;
}
if (StationNo == "") {
$.messager.alert('提示', '工位号不能为空,请重新输入', 'warning');
return;
}
if (PlaceName == "") {
$.messager.alert('提示', '地点不能为空,请重新输入', 'warning');
return;
}
var model = {
BomID: BomID,
PartNo1: PartNo1,
PartNo2: PartNo2,
IsChecked: IsChecked,
IsPartAssemble: IsPartAssemble,
StationNo: StationNo,
PlaceName: PlaceName,
method: 'SaveInfo'
};
SaveModel(model);
}
function SaveModel(model) {
$.ajax({
type: "POST",
async: false,
url: "/HttpHandlers/Bom_MKHandler.ashx",
data: model,
dataType: 'json',
success: function (res) {
if (res.IsSuccess) {
$.messager.alert('提示', '已保存', 'info');
dg.datagrid('reload');
$('#w').window('close');
}
else {
$.messager.alert('错误', res.Message, 'warning');
}
},
error: function () {
}
});
}
//查询方法
function SearchInfo() {
var PartNo1 = $('#PartNo1_s').val();
var PartNo2 = $('#PartNo2_s').val();
var PlaceName = $('#PlaceName_s').val();
var queryParams = {
PartNo1: PartNo1,
PartNo2: PartNo2,
PlaceName: PlaceName
};
dg.datagrid({
queryParams: queryParams
});
dg.datagrid('reload');
}
//编辑时加载窗体数据
function initEidtWidget() {
var selRows = dg.datagrid('getSelections');
if (selRows.length > 1) {
$.messager.alert('提示', '每次只能编辑一条记录,请重新选取', 'warning');
return;
} else if (selRows.length == 0) {
$.messager.alert('提示', '请选择一条记录进行编辑', 'warning');
return;
}
//窗体数据初始化
var row = selRows[0];
PrimaryID = row.BomID;
$('#fl_id_1').combobox('select', row.PartNo1);
$('#fl_id_2').combobox('select', row.PartNo2);
if (row.IsChecked == 0) {
$('#IsChecked').removeAttr("checked")
} else {
$('#IsChecked').prop("checked", "checked")
}
if (row.IsPartAssemble == 0) {
$('#IsPartAssemble').removeAttr("checked")
} else {
$('#IsPartAssemble').prop("checked", "checked")
}
$('#PlaceName').val(row.PlaceName);
$('#StationNo').val(row.StationNo);
$('#w').window('open');
}
//删除方法
function deleteInfos() {
var selRows = dg.datagrid('getSelections');
if (selRows.length > 1) {
$.messager.alert('提示', '每次只能删除一条记录,请重新选取', 'warning');
return;
} else if (selRows.length == 0) {
$.messager.alert('提示', '请选择一条记录进行删除', 'warning');
return;
}
var row = selRows[0];
var model = {
BomID: row.BomID,
method: 'DelInfo'
};
$.ajax({
url: "/HttpHandlers/Bom_MKHandler.ashx",
data: model,
async: false,
success: function (data) {
if (data == 'true') {
$.messager.alert('提示', '已删除', 'info');
dg.datagrid('reload');
}
else {
$.messager.alert('提示', '由于有关联数据,删除失败', 'warning');
}
},
error: function () {
}
});
}
/**************** 辅助业务程序 ***************/
/**********************************************/
/***************** 窗体程序 *******************/
/**********************************************/
//编辑窗口关闭清空数据
function clearw() {
$('#fl_id_1').combo('clear');
$('#fl_id_2').combo('clear');
$('#IsChecked').removeAttr("checked");
$('#IsPartAssemble').removeAttr("checked");
$('#PlaceName').val('');
$('#StationNo').val('');
}
function reloadfl_id() {
$('#fl_id_1').combobox('reload', '/HttpHandlers/ProductHandler.ashx?method=QueryForCombobox&ProductTypeNo=2000');
$('#fl_id_2').combobox('reload', '/HttpHandlers/ProductHandler.ashx?method=QueryForCombobox&ProductTypeNo=1101');
}
</script>
</form>
</body>
</html>

20
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("<script language=javascript>alert('您的登录信息已过期,请重新登录!');top.location.href='../Login.aspx';</script>");
}
}
}
}

44
MESWebSite/Manage/Bom_MK.aspx.designer.cs

@ -0,0 +1,44 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace MESWebSite.Manage
{
public partial class Bom_MK
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// lblMessage 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblMessage;
/// <summary>
/// UserID 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlInputText UserID;
}
}

2
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 () {

513
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" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="/CSS/Basics.css" rel="stylesheet" />
<link href="/Scripts/jquery-easyui-1.4.3/themes/metro/easyui.css" rel="stylesheet" type="text/css" />
<link href="/Scripts/jquery-easyui-1.4.3/themes/icon.css" rel="stylesheet" type="text/css" />
<link href="/Scripts/jquery-easyui-1.4.3/themes/color.css" rel="stylesheet" type="text/css" />
<script src="/Scripts/jquery-easyui-1.4.3/jquery.min.js" type="text/javascript"></script>
<script src="/Scripts/jquery-easyui-1.4.3/jquery.easyui.min.js" type="text/javascript"></script>
<script src="/Scripts/jquery-easyui-1.4.3/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
<script src="/Scripts/MyJs.js" type="text/javascript"></script>
<style>
#w td {
padding: 5px 5px;
text-align: left;
vertical-align: middle;
}
#w .title {
vertical-align: middle;
text-align: right;
width: 80px;
height: 40px;
}
p {
padding: 5px;
font-size: small;
font-family: 微软雅黑;
}
.datagrid {
text-align: center;
}
.search_first{
margin-left: 15%
}
/* 中等屏幕 桌面显示器 992至1400 */
@media screen and (min-width:992px) and (max-width:1400px){
.search_first{
margin-left: 17%
}
}
</style>
<title>门槛装配计划</title>
</head>
<body>
<form id="form1" runat="server">
<div class="top">
<table style="width: 100%">
<tr style="display: flex;flex-direction: row; flex-wrap: wrap;">
<td><span class="title" style="width: 120px">门槛装配计划</span></td>
<td style="width: 100px;"></td>
<td style="width: 260px;"> 零件号:
<input type="text" id="part_no_s" style="width: 140px;"/>
</td>
<td style="width: 380px;"> 装配日期:
<input id="start_time" class="easyui-datetimebox" style="width: 130px; height: 30px;" data-options="onShowPanel:function(){ $(this).datetimebox('spinner').timespinner('setValue','00:00:00');}" />
<input id="end_time" class="easyui-datetimebox" style="width: 130px; height: 30px;" data-options="onShowPanel:function(){ $(this).datetimebox('spinner').timespinner('setValue','23:59:59');}" />
</td>
<td style="width: 80px;"><a class="topsearchBtn">查询</a></td>
<td style="width: 80px;">
<a class="topaddBtn">新增</a>
</td>
<td style="width: 80px;">
<a class="toppenBtn">编辑</a>
</td>
<td style="width: 80px;">
<a class="topdelBtn">删除</a>
</td>
<td style="width: 80px;">
<a class="topexcelBtn">导出</a>
</td>
</tr>
</table>
</div>
<table id="tb" title="装配计划" style="width: 99%;">
</table>
<!-- 编辑窗口 -->
<div id="w" style="padding: 10px; visibility: hidden" title="编辑">
<table cellpadding="0" cellspacing="0">
<%--<tr>
<td class="title" style="width: 110px;">
<p>
工位编号:
</p>
</td>
<td colspan="2">
<select id="station_no" class="easyui-combobox" style="width: 200px; height: 30px;"
data-options="valueField: 'StationID',textField: 'StationNo'">
</select>
</td>
</tr>--%>
<tr>
<td class="title" style="width: 110px;">
<p>
产品名称:
</p>
</td>
<td colspan="2">
<select id="part_no" class="easyui-combobox" style="width: 200px; height: 30px;"
data-options="valueField: 'PartNo',textField: 'ProductName'">
</select>
</td>
</tr>
<tr>
<td class="title" style="width: 110px;">
<p>
计划名称:
</p>
</td>
<td colspan="2">
<input id="OrderName" type="text" class="text" style="width: 230px; height: 30px;" />
</td>
</tr>
<tr>
<td class="title" style="width: 110px;">
<p>
产线:
</p>
</td>
<td colspan="2">
<input id="Line" type="text" class="text" style="width: 230px; height: 30px;" />
</td>
</tr>
<tr>
<td class="title" style="width: 110px;">
<p>
工位号:
</p>
</td>
<td colspan="2">
<input id="Station" type="text" class="text" style="width: 230px; height: 30px;" />
</td>
</tr>
<tr>
<td class="title" style="width: 110px;">
<p>
计划数量:
</p>
</td>
<td colspan="2">
<input id="OrderCount" type="text" class="text" style="width: 230px; height: 30px;" />
</td>
</tr>
<tr>
<td class="title" style="width: 110px;">
<p>
装配日期:
</p>
</td>
<td>
<input id="OrderDate" class="easyui-datetimebox" style="width: 180px; height: 30px;" data-options="required:true" />
</td>
</tr>
</table>
</div>
<!-- 编辑窗口 - footer -->
<div id="ft" style="padding: 10px; text-align: center; background-color: #f9f9f9; visibility: hidden">
<a class="saveBtn" id="saveBtn">保存</a>
</div>
<div hidden="hidden">
<asp:Label ID="lblMessage" runat="server" Text=""></asp:Label>
</div>
<input id="UserID" type="text" hidden="hidden" runat="server" />
<script>
/**************** 全局变量 ***************/
var PrimaryID; //要编辑的id
var dg = $('#tb'); //表格
var isEdit = false; //是否为编辑状态
var handlerUrl = "/HttpHandlers/ZP_MK_PlanHandler.ashx";
/**************** DOM加载 ***************/
$(function () {
$.ajaxSetup({
cache: false //关闭AJAX缓存
});
// 下拉框加载
//reload_station_no('#station_no');
reload_part_no('#part_no');
//新增按钮点击
$('.topaddBtn').first().click(function () {
isEdit = false;
$('#w').window('open');
});
//编辑按钮点击
$('.toppenBtn').first().click(function () {
isEdit = true;
initEidtWidget();
});
//删除按钮
$('.topdelBtn').first().click(function () {
$.messager.confirm('提示框', '你确定要删除吗?', function (r) {
if (r) {
deleteInfos();
}
});
});
$('.topexcelBtn').first().click(function () {
var StartTime = $('#start_time').datebox('getValue');
var EndTime = $('#end_time').datebox('getValue');
var queryParams = {
StartTime,
EndTime
};
post('<%=ResolveUrl("~/HttpHandlers/ZP_MK_PlanHandler.ashx?method=ExportExcel") %>', queryParams);
});
//搜索按钮
$('.topsearchBtn').first().click(function () {
SearchInfo();
});
//保存按钮
$('#saveBtn').bind('click', function () {
SaveInfo(isEdit);
});
//$('#IsOneMore').change(function() {
// $('#part_no').combo('clear');
// reload_part_no('#part_no');
//})
//编辑窗口加载
$('#w').window({
modal: true,
closed: true,
minimizable: false,
maximizable: false,
collapsible: false,
width: 460,
height: 520,
footer: '#ft',
top: 20,
onBeforeClose: function () { clearw(); },
onBeforeOpen: function () {
$('#w').css('visibility', 'visible'); $('#ft').css('visibility', 'visible');
}
});
dg = $('#tb').datagrid({
fitColumns: true,
nowrap: false,
striped: true,
collapsible: false,
url: handlerUrl + "?method=QueryList",
//sortName: 'sortNumber',
//sortOrder: 'asc',
remoteSort: false,
columns: [[
{ field: 'ID', title: 'ID', hidden: true },
{ field: 'OrderNo', title: '计划编号', sortable: 'true', width: 10 },
{ field: 'OrderName', title: '计划名称', sortable: 'true', width: 8 },
{ field: 'Line', title: '产线', sortable: 'true', width: 8 },
{ field: 'Station', title: '工位号', sortable: 'true', width: 8 },
{ field: 'Item', title: '序号', sortable: 'true', width: 10 },
{ field: 'PartNo', title: '零件编号', sortable: 'true', width: 10 },
{ field: 'ProductName', title: '产品名称', sortable: 'true', width: 10 },
{ field: 'OrderCount', title: '计划数量', sortable: 'true', width: 10 },
{ field: 'ProductCount', title: '生产数量', sortable: 'true', width: 10 },
{
field: 'OrderDate', title: '装配时间', sortable: 'true', width: 10,
formatter: function (date) {
var pa = /.*\((.*)\)/;
var unixtime = date.match(pa)[1].substring(0, 10);
return getTime(unixtime).substring(0, 19);
}
},
]],
pagination: true,//表示在datagrid设置分页
rownumbers: true,
singleSelect: true
});
dg.datagrid('getPager').pagination({
pageSize: 10,
pageNumber: 1,
pageList: [10, 20, 30, 40, 50],
beforePageText: '第',//页数文本框前显示的汉字
afterPageText: '页 共 {pages} 页',
displayMsg: '当前显示 {from} - {to} 条记录 共 {total} 条记录',
});
});
/**************** 主要业务程序 ***************/
//新增 / 编辑
function SaveInfo(isEdit) {
var ID = isEdit == true ? PrimaryID : 0;
var PartNo = $('#part_no').combo('getValue');
//var StationID = $('#station_no').combo('getValue');
var OrderDate = $('#OrderDate').datebox('getValue');
//var IsOneMore = checkboxValue($('#IsOneMore'));
var OrderCount = $('#OrderCount').val();
var OrderName = $('#OrderName').val();
var Line = $('#Line').val();
var Station = $('#Station').val();
if (PartNo == "") {
$.messager.alert('提示', '零件不能为空,请重新输入', 'warning');
return;
}
if (OrderName == "") {
$.messager.alert('提示', '计划名称不能为空,请重新输入', 'warning');
return;
}
if (Line == "") {
$.messager.alert('提示', '线路不能为空,请重新输入', 'warning');
return;
}
if (Station == "") {
$.messager.alert('提示', '工位号不能为空,请重新输入', 'warning');
return;
}
if (OrderCount == "") {
$.messager.alert('提示', '计划数量不能为空,请重新输入', 'warning');
return;
}
if (OrderDate == "") {
$.messager.alert('提示', '装配日期不能为空,请重新输入', 'warning');
return;
}
var model = {
ID,
PartNo,
//StationID,
OrderName,
OrderDate,
OrderCount,
Line,
Station,
method: 'SaveInfo'
};
SaveModel(model);
}
function SaveModel(model) {
$.ajax({
type: "POST",
async: false,
url: handlerUrl,
data: model,
dataType: 'json',
success: function (res) {
if (res.IsSuccess) {
$.messager.alert('提示', '已保存', 'info');
dg.datagrid('reload');
$('#w').window('close');
}
else {
$.messager.alert('错误', res.Message, 'warning');
}
},
error: function () {
}
});
}
//查询方法
function SearchInfo() {
var PartNo = $('#part_no_s').val();
var StartTime = $('#start_time').datebox('getValue');
var EndTime = $('#end_time').datebox('getValue');
dg.datagrid({
queryParams: {
PartNo,
StartTime,
EndTime
}
});
dg.datagrid('reload');
}
////编辑时加载窗体数据
function initEidtWidget() {
var selRows = dg.datagrid('getSelections');
if (selRows.length > 1) {
$.messager.alert('提示', '每次只能编辑一条记录,请重新选取', 'warning');
return;
} else if (selRows.length == 0) {
$.messager.alert('提示', '请选择一条记录进行编辑', 'warning');
return;
}
//窗体数据初始化
var row = selRows[0];
PrimaryID = row.ID;
$('#part_no').combobox('select', row.PartNo);
//$('#station_no').combobox('select', row.StationID);
//toggleChecked('#IsOneMore', row.IsOneMore);
$('#OrderCount').val(row.OrderCount);
$('#OrderName').val(row.OrderName);
$('#Line').val(row.Line);
$('#Station').val(row.Station);
var pa = /.*\((.*)\)/;
var unixtime = row.OrderDate.match(pa)[1].substring(0, 10);
$('#OrderDate').datetimebox('setValue', getTime(unixtime).substring(0, 19));
$('#w').window('open');
}
//删除方法
function deleteInfos() {
var selRows = dg.datagrid('getSelections');
if (selRows.length > 1) {
$.messager.alert('提示', '每次只能删除一条记录,请重新选取', 'warning');
return;
} else if (selRows.length == 0) {
$.messager.alert('提示', '请选择一条记录进行删除', 'warning');
return;
}
var row = selRows[0];
var model = {
ID: row.ID,
method: 'DelInfo'
};
$.ajax({
url: handlerUrl,
data: model,
dataType: 'json',
async: false,
success: function (res) {
if (res.IsSuccess) {
$.messager.alert('提示', '已删除', 'info');
dg.datagrid('reload');
}
else {
$.messager.alert('提示', res.Message, 'warning');
}
},
error: function () {
}
});
}
/**************** 辅助业务程序 ***************/
/**********************************************/
/***************** 窗体程序 *******************/
/**********************************************/
//编辑窗口关闭清空数据
function clearw() {
$('#part_no').combo('clear');
//$('#station_no').combo('clear');
$('#OrderDate').datebox('setValue', '');
$('#OrderCount').val('');
$('#OrderName').val('');
$('#Line').val('');
$('#Station').val('');
}
function toggleChecked(id, checked) {
+checked ? $(id).prop("checked", "checked") : $(id).removeAttr("checked");
}
function checkboxValue(ctl) {
return ctl.is(':checked') ? 1 : 0;
}
/**
* 加载产品下拉信息
**/
function reload_part_no(ctl) {
base_reload_combobox(ctl, '/HttpHandlers/ProductHandler.ashx?method=GetComboboxProduct4');
}
function reload_station_no(ctl) {
base_reload_combobox(ctl, '/HttpHandlers/StationHandler.ashx?method=QueryForCombobox&StationNo=ZP');
}
function base_reload_combobox(ctl, url) {
$(ctl).combobox('reload', url);
}
function post(url, PARAMS) {
var temp_form = document.createElement("form");
temp_form.action = url;
temp_form.target = "_blank";
temp_form.method = "post";
temp_form.style.display = "none"; for (var x in PARAMS) {
var opt = document.createElement("textarea");
opt.name = x;
opt.value = PARAMS[x];
temp_form.appendChild(opt);
}
document.body.appendChild(temp_form);
temp_form.submit();
}
</script>
</form>
</body>
</html>

17
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)
{
}
}
}

44
MESWebSite/Manage/ZP_MK_Plan.aspx.designer.cs

@ -0,0 +1,44 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace MESWebSite.Manage
{
public partial class ZP_MK_Plan
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// lblMessage 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblMessage;
/// <summary>
/// UserID 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlInputText UserID;
}
}

BIN
MESWebSite/PDF/20250710110501126.jpeg

Binary file not shown.

After

Width:  |  Height:  |  Size: 111 KiB

Loading…
Cancel
Save