|
|
|
@ -54,6 +54,8 @@ namespace SlnMesnac.Business
|
|
|
|
|
private FJ500Comm.FJ500SP fj500s = new FJ500Comm.FJ500SP();
|
|
|
|
|
//喷码机喷码失败或者设备状态检查重试次数
|
|
|
|
|
private int PmTryAmount = 0;
|
|
|
|
|
//喷码机心跳,每次收到回复刷新时间,如果超过1分钟,则认为喷码机断开连接,添加一条报警
|
|
|
|
|
private DateTime PmHeartTime = DateTime.Now;
|
|
|
|
|
private readonly IMesProductPlanService _mesProductPlanService;
|
|
|
|
|
private readonly IMesProductOrderService _mesProductOrderService;
|
|
|
|
|
private readonly IMesPrdBarCodeService _barCodeTaskService;
|
|
|
|
@ -135,6 +137,15 @@ namespace SlnMesnac.Business
|
|
|
|
|
_logger.LogError("checkStatus异常:" + ex.Message);
|
|
|
|
|
}
|
|
|
|
|
Thread.Sleep(1000 * 30);
|
|
|
|
|
|
|
|
|
|
if (DateTime.Now - PmHeartTime > TimeSpan.FromMinutes(2))
|
|
|
|
|
{
|
|
|
|
|
//报警
|
|
|
|
|
_logger.LogError("====================喷码机通讯心跳失败预警,推送报警");
|
|
|
|
|
AddAlarm(WarnStatusEnum.喷码机设备状态检查故障或者喷印失败预警超过30次);
|
|
|
|
|
PmTryAmount++;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -149,6 +160,7 @@ namespace SlnMesnac.Business
|
|
|
|
|
/// <param name="str"></param>
|
|
|
|
|
private void PmCodeHandler(string str)
|
|
|
|
|
{
|
|
|
|
|
PmHeartTime = DateTime.Now;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
int LastTryAmount = PmTryAmount;
|
|
|
|
|