94 lines
3.1 KiB
C#
94 lines
3.1 KiB
C#
using System;
|
||
using MesServerWork;
|
||
using bizFacade;
|
||
using SystemFramework;
|
||
|
||
|
||
namespace MesServerFunctions
|
||
{
|
||
partial class Functions_BASE_10
|
||
{
|
||
/// <summary>
|
||
///1、物料验证
|
||
///2、MES生成总成编号
|
||
///3、MES传递机型
|
||
/// 处理页面扫描条码
|
||
/// </summary>
|
||
/// <param name="OpName"></param>
|
||
/// <param name="barcode"></param>
|
||
public void Barcode(object e)
|
||
{
|
||
try
|
||
{
|
||
OpcData.CustomeEvetnArgs msgEvent = (OpcData.CustomeEvetnArgs)e;
|
||
string OpName = Convert.ToString(msgEvent.OpName);
|
||
string barcode = Convert.ToString(msgEvent.TagValue);
|
||
int repairStatus=1;
|
||
repairStatus=RepairWorkStation.StationStatusSearch(OpName);
|
||
//repairStatus:0:返修 1:正常 20170630
|
||
if (repairStatus != 1)
|
||
{
|
||
Barcode_Repair(OpName, barcode);
|
||
return;
|
||
}
|
||
bool ispartload = false;
|
||
int IsSuccess = 0;
|
||
|
||
int IsAllowWork;
|
||
int engineTypeID;
|
||
|
||
string engineID;
|
||
string engineType;
|
||
|
||
MIS_BASE.Read_PartLoad(OpName, out ispartload);
|
||
if (!ispartload)
|
||
{
|
||
AsyncSendMessage_Notice(OpName,"PLC未申请上线,请确认");
|
||
return;
|
||
}
|
||
|
||
BaseDataSystemMES.PartMaterial_DM_Update(OpName, barcode, out IsSuccess);
|
||
|
||
if (IsSuccess==0)
|
||
{
|
||
AsyncSendMessage_Notice(OpName,"条码无效,请确认");
|
||
return;
|
||
}
|
||
|
||
Sendmessage("2", "1", OpName);//通知WEB前端更新零件信息
|
||
|
||
BaseDataSystemMES.MesServer_Judge_IsCanWork(OpName, out IsAllowWork);
|
||
|
||
//扫描完成线首工位需要创建发动机号
|
||
if (IsAllowWork == 1)
|
||
{
|
||
CreateEngineID(OpName, out engineType,out engineTypeID, out engineID);
|
||
|
||
if (engineType == "-1" || engineType == "" || engineTypeID == -1 || engineID == "")
|
||
{
|
||
AsyncSendMessage_Notice(OpName,"未选择订单或机型,请选择后重新到位");
|
||
return;
|
||
}
|
||
else
|
||
{
|
||
//将产品信息写入PLC
|
||
MIS_BASE.Write_EngineTypeID_MES(OpName, engineTypeID);
|
||
MIS_BASE.Write_EngineType_MES(OpName, engineType);
|
||
MIS_BASE.Write_EngineID_MES(OpName, engineID);
|
||
MIS_BASE.Write_EngineTypeGetOver_MES(OpName, true);
|
||
}
|
||
|
||
SendInfomation("ShowMobyMES", engineID + "&" + engineType, OpName);
|
||
}
|
||
|
||
}
|
||
catch (Exception err)
|
||
{
|
||
ApplicationLog.WriteLog(err, "Function10:Barcode");
|
||
}
|
||
|
||
}
|
||
|
||
}
|
||
}
|