75 lines
2.6 KiB
C#
75 lines
2.6 KiB
C#
using System;
|
|
using bizFacade;
|
|
//using SystemFramework;
|
|
using MesServerWork;
|
|
|
|
namespace MesServerFunctions
|
|
{
|
|
partial class Functions_BASE_28
|
|
{
|
|
///第一步,判断条码类型,根据条码类型,执行对应的存储过程
|
|
///第二步,条码类型(将扫描的条码保存到对应的表中)
|
|
///第三步,扫描完成之后给出允许工作信号
|
|
/// 处理页面扫描条码
|
|
/// </summary>
|
|
/// <param name="OpName"></param>
|
|
/// <param name="barcode"></param>
|
|
public void Barcode(object e)
|
|
{
|
|
try
|
|
{
|
|
DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
|
|
string OpName = Convert.ToString(msgEvent.OpName);
|
|
string barcode = Convert.ToString(msgEvent.TagValue);
|
|
|
|
bool IsSuccess = false;
|
|
bool EngineGetOver_PLC_NextWorkStep;
|
|
|
|
int IsAllowWork;
|
|
int EngineTypeID;//机型代码
|
|
int PartPallet_Code;//托盘编号
|
|
|
|
string EngineType;//机型
|
|
string EngineID;//工件编号
|
|
|
|
BaseDataSystemMES.PartMaterial_DM_Update(OpName, barcode, out IsSuccess);
|
|
if (!IsSuccess)
|
|
{
|
|
AsyncSendMessage_Notice(OpName, "条码无效,请确认!");
|
|
return;
|
|
}
|
|
|
|
SendInfomation("MaterialList", "1", OpName);//通知界面更新零件信息
|
|
|
|
//传递机型是否到位
|
|
MIS_BASE.Read_EngineGetOver_PLC(OpName, out EngineGetOver_PLC_NextWorkStep);
|
|
if (EngineGetOver_PLC_NextWorkStep)
|
|
{
|
|
BaseDataSystemMES.MesServer_Judge_IsCanWork(OpName, out IsAllowWork);
|
|
if (IsAllowWork == 1)
|
|
{
|
|
string OrderForm;
|
|
MIS_BASE.GetEngineTypeFromPLC(OpName, out EngineTypeID, out EngineType, out EngineID, out PartPallet_Code,out OrderForm);
|
|
Match(OpName, EngineID, EngineTypeID, EngineType, PartPallet_Code);//匹配
|
|
}
|
|
else
|
|
{
|
|
AsyncSendMessage_Notice(OpName, "请扫描物料!");
|
|
}
|
|
}
|
|
else
|
|
{
|
|
AsyncSendMessage_Notice(OpName, "PLC未传递机型");
|
|
}
|
|
|
|
}
|
|
catch (Exception err)
|
|
{
|
|
////ApplicationLog.WriteLog(err, "Function08:Barcode");
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|