90 lines
3.6 KiB
C#
90 lines
3.6 KiB
C#
using MesServerWork;
|
||
using MisDataFunDll;
|
||
using System;
|
||
using System.Collections.Generic;
|
||
using System.Threading;
|
||
//using SystemFramework;
|
||
|
||
namespace MesServerFunctions
|
||
{
|
||
partial class FunctionMES
|
||
{
|
||
/// <summary>
|
||
/// 允许保存(针对半自动和手动压装工位)
|
||
/// </summary>
|
||
/// <param name="OpName"></param>
|
||
/// <param name="tagValue"></param>
|
||
private void MesRead(object e)
|
||
{
|
||
{
|
||
try
|
||
{
|
||
int EngineTypeID;
|
||
string EngineType;
|
||
string EngineID;
|
||
int PartPallet_Code;
|
||
string OrderForm;
|
||
|
||
int EngineTypeID_MES;//机型代码
|
||
string EngineType_MES;//机型
|
||
string EngineID_MES;//工件编号
|
||
string OrderForm_MES;
|
||
|
||
{
|
||
DeviceDriver_BasicData.CustomeEvetnArgs msgEvent = (DeviceDriver_BasicData.CustomeEvetnArgs)e;
|
||
string OpName = Convert.ToString(msgEvent.OpName);
|
||
int tagValue = Convert.ToInt32(msgEvent.TagValue);
|
||
|
||
if (tagValue == 1)
|
||
{
|
||
int qualityMask;
|
||
|
||
MIS_BASE.GetEngineTypeFromPLC(OpName, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code, out OrderForm);
|
||
//MIS_BASE.GetEngineTypeFromPLC_MES(OpName, out EngineTypeID_MES, out EngineType_MES, out EngineID_MES, out OrderForm_MES);
|
||
//保存数据到线首表 先保存到 北汽福田变速器序列号总线上线 用于之前判断是否重号
|
||
// 保存质量数据
|
||
qualityMask = MisDataSaveDateMesRead.Funtion.MesRead(OpName, tagValue.ToString(), msgEvent.TagID.ToString());
|
||
|
||
// 保存物料数据
|
||
MisDataFun.Material_Insert(OpName, qualityMask);
|
||
|
||
// 测量数据发动机在线状态
|
||
MisDataFun.WorkStartInsert(OpName, qualityMask);
|
||
|
||
// 存追溯表数据
|
||
MisDataFun.WorkOrderOpWorkOver(OpName, EngineID, OrderForm);
|
||
|
||
// 推送质量数据到MES的页面
|
||
SendMessageFun.SendInfomation("ShowTimelyQuality", "1&" + qualityMask.ToString(), OpName);
|
||
|
||
//对应手动工位的
|
||
//MIS_BASE.Write_ConfirmOkGo(OpName, true);
|
||
//通知设备,MES的质量数据(和物料数据)保存完成
|
||
MIS_BASE.Write_MesReadOver(OpName, true);
|
||
//MIS_BASE.Write_MaterialVerifyOver(OpName, true);
|
||
//统计在线产量,在线节拍
|
||
SendMessage.SendActuallyCount(OpName, tagValue);
|
||
|
||
//调用工厂MES接口报工
|
||
WebApi.CALL_Inerface_DataHandle.CALL_Inerface_JobFinished(OpName, EngineID, OrderForm);
|
||
}
|
||
else
|
||
{
|
||
MIS_BASE.Write_MesReadOver(OpName, false);
|
||
MIS_BASE.Write_MaterialVerifyOver(OpName, false);
|
||
}
|
||
|
||
}
|
||
|
||
}
|
||
catch (Exception err)
|
||
{
|
||
////ApplicationLog.WriteLog(err, "Function08:MesReadOver");
|
||
}
|
||
}
|
||
|
||
}
|
||
|
||
}
|
||
}
|