75 lines
2.2 KiB
C#
75 lines
2.2 KiB
C#
using System;
|
|
using MesServerWork;
|
|
using bizFacade;
|
|
//using SystemFramework;
|
|
|
|
namespace MesServerFunctions
|
|
{
|
|
partial class Functions_BASE_26
|
|
{
|
|
/// <summary>
|
|
///1、物料验证
|
|
///2、MES生成总成编号
|
|
///3、MES传递机型
|
|
/// 处理页面扫描条码
|
|
/// </summary>
|
|
/// <param name="OpName"></param>
|
|
/// <param name="barcode"></param>
|
|
public void Barcode(object e)
|
|
{
|
|
try
|
|
{
|
|
//20161228 条码连续扫描拼接错误
|
|
//if (!BaseDataSystemMES.BarConfirm(barcode))
|
|
//{
|
|
// AsyncSendMessage_Notice(OpName, "条码号存在重复数据,请重新扫描!");
|
|
// return;
|
|
|
|
//}
|
|
DoWhatPlc.CustomeEvetnArgs msgEvent = (DoWhatPlc.CustomeEvetnArgs)e;
|
|
string OpName = Convert.ToString(msgEvent.OpName);
|
|
string barcode = Convert.ToString(msgEvent.TagValue);
|
|
|
|
bool ispartload = false;
|
|
bool IsSuccess = false;
|
|
int IsAllowWork;
|
|
|
|
BaseDataSystemMES.PartMaterial_DM_Update(OpName, barcode, out IsSuccess);
|
|
//MIS_BASE.Read_PartLoad(OpName, out ispartload);
|
|
|
|
|
|
|
|
|
|
if (!IsSuccess)
|
|
{
|
|
AsyncSendMessage_Notice(OpName,"条码无效,请确认");
|
|
return;
|
|
}
|
|
|
|
Sendmessage("2", "1", OpName);//通知WEB前端更新零件信息
|
|
|
|
BaseDataSystemMES.MesServer_Judge_IsCanWork(OpName, out IsAllowWork);
|
|
if(IsAllowWork==1)
|
|
{
|
|
//物料数据
|
|
BaseDataSystemMES.Material_Insert(OpName, 1);
|
|
|
|
Sendmessage("49", "11", OpName);//向web发送消息
|
|
|
|
//工作完成
|
|
//MIS_BASE.Write_MaterialVerifyOver(OpName, true);
|
|
|
|
//MIS_BASE.Write_FixAllow(OpName, true);
|
|
}
|
|
|
|
}
|
|
catch (Exception err)
|
|
{
|
|
////ApplicationLog.WriteLog(err, "Function03:Barcode");
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
}
|