feat: 增加LG/TCS-AGV接口并完善物料校验与Function逻辑
This commit is contained in:
@@ -14,12 +14,14 @@ namespace MesServerFunctions
|
||||
/// <param name="tagValue"></param>
|
||||
private void EngineTypeGetOver_PLC(object e)
|
||||
{
|
||||
string opName = "";
|
||||
|
||||
{
|
||||
try
|
||||
{
|
||||
DeviceDriver_BasicData.CustomeEvetnArgs msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
opName = OpName;
|
||||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
//判断PLC机型与MES机型是否一致
|
||||
if (tagValue == 1)
|
||||
@@ -61,7 +63,7 @@ namespace MesServerFunctions
|
||||
string msg = "【" + OpName + "】" + resultMsg;
|
||||
MyLog4Net.MyLogHelper.Error("EngineTypeGetOver", msg);
|
||||
SendMessage.AsyncSendMessage_Notice(OpName, msg);
|
||||
MisDataSaveDate.Helper.ApiLogHelper.SaveMesLog(OpName, "PLC传递机型 "+ msg, MisDataSaveDate.Helper.MesLogType.ERROR);
|
||||
MisDataSaveDate.Helper.ApiLogHelper.SaveMesLog(OpName, "PLC传递机型 " + msg, MisDataSaveDate.Helper.MesLogType.ERROR);
|
||||
}
|
||||
int parType = Convert.ToInt32(checkTable.Rows[0]["小机型"]);
|
||||
EngineTypeID = Convert.ToInt32(checkTable.Rows[0]["型号代码"]);
|
||||
@@ -108,7 +110,10 @@ namespace MesServerFunctions
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, "Function08:EngineTypeGetOver_PLC");
|
||||
string logOpName = string.IsNullOrWhiteSpace(opName) ? "Function1052_EngineGetOver" : opName;
|
||||
string logText = $"EngineTypeGetOver异常:异常={err.Message}";
|
||||
MisDataSaveDate.Helper.ApiLogHelper.SaveMesLog(logOpName, logText, MisDataSaveDate.Helper.MesLogType.ERROR);
|
||||
MyLog4Net.MyLogHelper.Error("Function1052_EngineGetOver", $"{logText}{Environment.NewLine}{err}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,12 +27,33 @@ namespace MesServerFunctions
|
||||
//判断PLC机型与MES机型是否一致
|
||||
if (tagValue == 1)
|
||||
{
|
||||
int EngineTypeID;//机型代码
|
||||
int PartPallet_Code;//托盘编号
|
||||
string EngineType;//机型
|
||||
string EngineID;//工件编号
|
||||
string OrderForm;
|
||||
MIS_BASE.GetEngineTypeFromPLC(OpName, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out OrderForm);
|
||||
int EngineTypeID = 0;//机型代码
|
||||
int PartPallet_Code = 0;//托盘编号
|
||||
string EngineType = "";//机型
|
||||
string OrderForm = "";
|
||||
MIS_BASE.Read_EngineID(OpName, out string PLCEngineID);
|
||||
MIS_BASE.Read_EngineID_MES(OpName, out string MESEngineID);
|
||||
string EngineID = string.IsNullOrEmpty(PLCEngineID) ? MESEngineID : PLCEngineID;
|
||||
|
||||
if (string.IsNullOrEmpty(EngineID))
|
||||
{
|
||||
string msg = $"【{OpName}】PLC与MES产品编号点位均为空,继续按空产品信息保存物料扫码记录!";
|
||||
MisDataSaveDate.Helper.ApiLogHelper.SaveMesLog(OpName, "MaterialsVerify " + msg, MisDataSaveDate.Helper.MesLogType.ERROR);
|
||||
}
|
||||
else
|
||||
{
|
||||
DataTable planDt = MisDataFun.XD_GetPlanInfoByEngineID(EngineID);
|
||||
if (planDt.Rows.Count > 0)
|
||||
{
|
||||
OrderForm = planDt.Rows[0]["订单号"].ToString();
|
||||
EngineType = planDt.Rows[0]["产品型号"].ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
string msg = $"【{OpName}】产品:{EngineID} 未在生产计划_派工订单_执行计划中查询到记录,继续保存物料扫码记录!";
|
||||
MisDataSaveDate.Helper.ApiLogHelper.SaveMesLog(OpName, "MaterialsVerify " + msg, MisDataSaveDate.Helper.MesLogType.ERROR);
|
||||
}
|
||||
}
|
||||
|
||||
int MaterialsTypeCode = Convert.ToInt32(MIS_BASE.ReadPLC(201, OpName));
|
||||
string MaterialsCode = MIS_BASE.ReadPLC(40, OpName).ToString();
|
||||
|
||||
@@ -16,6 +16,9 @@ namespace MesServerFunctions
|
||||
/// <param name="tagValue"></param>
|
||||
private void MesRead(object e)
|
||||
{
|
||||
string opName = "";
|
||||
string engineID = "";
|
||||
string orderForm = "";
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -33,6 +36,7 @@ namespace MesServerFunctions
|
||||
{
|
||||
DeviceDriver_BasicData.CustomeEvetnArgs msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||||
string OpName = Convert.ToString(msgEvent.OpName);
|
||||
opName = OpName;
|
||||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||||
|
||||
if (tagValue == 1)
|
||||
@@ -40,6 +44,8 @@ namespace MesServerFunctions
|
||||
int qualityMask;
|
||||
|
||||
MIS_BASE.GetEngineTypeFromPLC(OpName, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out OrderForm);
|
||||
engineID = EngineID;
|
||||
orderForm = OrderForm;
|
||||
//MIS_BASE.GetEngineTypeFromPLC_MES(OpName, out EngineTypeID_MES, out EngineType_MES, out EngineID_MES, out OrderForm_MES);
|
||||
//保存数据到线首表 先保存到 北汽福田变速器序列号总线上线 用于之前判断是否重号
|
||||
// 保存质量数据
|
||||
@@ -51,7 +57,10 @@ namespace MesServerFunctions
|
||||
// 测量数据发动机在线状态
|
||||
MisDataFun.WorkStartInsert(OpName, qualityMask);
|
||||
|
||||
// 存追溯表数据
|
||||
//保存质量数据到 接口表
|
||||
MisDataFun.SaveQualityInterfaceData(OpName, EngineID);
|
||||
|
||||
// 调用工位完工
|
||||
MisDataFun.WorkOrderOpWorkOver(OpName, EngineID, OrderForm);
|
||||
|
||||
// 推送质量数据到MES的页面
|
||||
@@ -79,7 +88,10 @@ namespace MesServerFunctions
|
||||
}
|
||||
catch (Exception err)
|
||||
{
|
||||
////ApplicationLog.WriteLog(err, "Function08:MesReadOver");
|
||||
string logOpName = string.IsNullOrWhiteSpace(opName) ? "Function1052_MesRead" : opName;
|
||||
string logText = $"MesRead异常:订单号={orderForm}, 工件编号={engineID}, 异常={err.Message}";
|
||||
MisDataSaveDate.Helper.ApiLogHelper.SaveMesLog(logOpName, logText, MisDataSaveDate.Helper.MesLogType.ERROR);
|
||||
MyLog4Net.MyLogHelper.Error("Function1052_MesRead", $"{logText}{Environment.NewLine}{err}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user