|
|
|
@ -23,6 +23,7 @@ using TouchSocket.Core;
|
|
|
|
|
using static System.Net.Mime.MediaTypeNames;
|
|
|
|
|
|
|
|
|
|
#region << 版 本 注 释 >>
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------
|
|
|
|
|
* 版权所有 (c) 2024 WenJY 保留所有权利。
|
|
|
|
|
* CLR版本:4.0.30319.42000
|
|
|
|
@ -43,7 +44,9 @@ using static System.Net.Mime.MediaTypeNames;
|
|
|
|
|
*
|
|
|
|
|
* 版本:V1.0.0
|
|
|
|
|
*--------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
#endregion << 版 本 注 释 >>
|
|
|
|
|
|
|
|
|
|
namespace SlnMesnac.Business
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
@ -52,10 +55,13 @@ namespace SlnMesnac.Business
|
|
|
|
|
public class ProdCompletionBusiness : BaseBusiness
|
|
|
|
|
{
|
|
|
|
|
private FJ500Comm.FJ500SP fj500s = new FJ500Comm.FJ500SP();
|
|
|
|
|
|
|
|
|
|
//喷码机喷码失败或者设备状态检查重试次数,0代表状态正常
|
|
|
|
|
public static int PmTryAmount = 0;
|
|
|
|
|
|
|
|
|
|
//喷码机心跳,每次收到回复刷新时间,如果超过1分钟,则认为喷码机断开连接,添加一条报警
|
|
|
|
|
private DateTime PmHeartTime = DateTime.Now;
|
|
|
|
|
|
|
|
|
|
private readonly IMesProductPlanService _mesProductPlanService;
|
|
|
|
|
private readonly IMesProductOrderService _mesProductOrderService;
|
|
|
|
|
private readonly IMesPrdBarCodeService _barCodeTaskService;
|
|
|
|
@ -80,7 +86,6 @@ namespace SlnMesnac.Business
|
|
|
|
|
_mesProductOrderService = serviceProvider.GetRequiredService<IMesProductOrderService>();
|
|
|
|
|
_baseMaterialInfoService = serviceProvider.GetRequiredService<IBaseMaterialInfoService>();
|
|
|
|
|
Init();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void test()
|
|
|
|
@ -89,18 +94,18 @@ namespace SlnMesnac.Business
|
|
|
|
|
{
|
|
|
|
|
sqlSugarClient.AsTenant().BeginTran();
|
|
|
|
|
string palletCode1 = "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WmsBaseLocation source = sqlSugarClient.AsTenant().GetConnection("mes").Queryable<WmsBaseLocation>().Where(x => x.LocationCode == "3114").First();
|
|
|
|
|
WmsBaseLocation target = sqlSugarClient.AsTenant().GetConnection("mes").Queryable<WmsBaseLocation>().Where(x => x.LocationCode == "3314").First();
|
|
|
|
|
// palletCode1 = source.ContainerCode;
|
|
|
|
|
|
|
|
|
|
// source.ContainerCode = target.ContainerCode;
|
|
|
|
|
// palletCode1 = source.ContainerCode;
|
|
|
|
|
|
|
|
|
|
// source.ContainerCode = target.ContainerCode;
|
|
|
|
|
target.ContainerCode = source.ContainerCode;
|
|
|
|
|
sqlSugarClient.AsTenant().GetConnection("mes").Updateable<WmsBaseLocation>(source).ExecuteCommand();
|
|
|
|
|
sqlSugarClient.AsTenant().GetConnection("mes").Updateable<WmsBaseLocation>(target).ExecuteCommand();
|
|
|
|
|
sqlSugarClient.AsTenant().CommitTran();
|
|
|
|
|
|
|
|
|
|
}catch(Exception ex)
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
sqlSugarClient.AsTenant().RollbackTran();
|
|
|
|
|
}
|
|
|
|
@ -112,16 +117,16 @@ namespace SlnMesnac.Business
|
|
|
|
|
//BindingBarCode(bigCode, epc, productPlanDto);
|
|
|
|
|
//sqlSugarClient.AsTenant().BeginTran();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 3114
|
|
|
|
|
|
|
|
|
|
private static bool isEmptyPalletHandleRunning = false;
|
|
|
|
|
|
|
|
|
|
public void Init()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
Task.Run(async () =>
|
|
|
|
|
{
|
|
|
|
|
await EmptyPalletHandle();
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
Task.Run(() =>
|
|
|
|
|
{
|
|
|
|
@ -133,6 +138,7 @@ namespace SlnMesnac.Business
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 喷码机设备相关通讯
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 喷码机状态检查
|
|
|
|
|
/// </summary>
|
|
|
|
@ -146,11 +152,10 @@ namespace SlnMesnac.Business
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
//发送检查状态指令
|
|
|
|
|
// udpServer.SendMessage(fj500s.CheckState());
|
|
|
|
|
// Thread.Sleep(1000 * 5);
|
|
|
|
|
// udpServer.SendMessage(fj500s.CheckState());
|
|
|
|
|
// Thread.Sleep(1000 * 5);
|
|
|
|
|
// 重新发送带喷印条码,保证始终有条码
|
|
|
|
|
SendFirstPmCode();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
@ -169,8 +174,6 @@ namespace SlnMesnac.Business
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 喷码机返回信息解析处理
|
|
|
|
|
/// 1.传输完成及喷码完成
|
|
|
|
@ -195,7 +198,7 @@ namespace SlnMesnac.Business
|
|
|
|
|
// 喷码机设备故障
|
|
|
|
|
_logger.LogError($"====================收到喷码机设备状态检查故障或者喷印失败预警,喷码机重试次数:{PmTryAmount}");
|
|
|
|
|
PmTryAmount++;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (PmTryAmount <= 30)
|
|
|
|
|
{
|
|
|
|
|
//重新发送
|
|
|
|
@ -210,7 +213,6 @@ namespace SlnMesnac.Business
|
|
|
|
|
_logger.LogError("====================超过30次,推送报警");
|
|
|
|
|
AddAlarm(WarnStatusEnum.喷码机设备状态检查故障或者喷印失败预警超过30次);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (result == "0F")
|
|
|
|
|
{
|
|
|
|
@ -221,12 +223,11 @@ namespace SlnMesnac.Business
|
|
|
|
|
PmTryAmount = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (LastTryAmount>0 && PmTryAmount==0)
|
|
|
|
|
if (LastTryAmount > 0 && PmTryAmount == 0)
|
|
|
|
|
{ // 报警消除
|
|
|
|
|
_logger.LogInformation("喷码机报警消除");
|
|
|
|
|
deleteAlarm(WarnStatusEnum.喷码机设备状态检查故障或者喷印失败预警超过30次);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
@ -250,11 +251,11 @@ namespace SlnMesnac.Business
|
|
|
|
|
{
|
|
|
|
|
_logger.LogError("可喷码数不足,请检查原因");
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception ex)
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogError("SendFirstPmCode获取数据库最早未喷印未绑定条码异常:" + ex.Message);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -268,9 +269,8 @@ namespace SlnMesnac.Business
|
|
|
|
|
_barCodeTaskService.Update(mesPrdBarcodeInfo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion 喷码机设备相关通讯
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 设备产出逻辑处理
|
|
|
|
|
/// </summary>
|
|
|
|
@ -282,19 +282,17 @@ namespace SlnMesnac.Business
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
var plc = base.GetPlcByKey("plc");
|
|
|
|
|
|
|
|
|
|
if (plc == null || plc.IsConnected== false)
|
|
|
|
|
if (plc == null || plc.IsConnected == false)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogInformation("2F读取小包出口信号,PLC连接信息为空......");
|
|
|
|
|
Thread.Sleep(3000);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!plc.readBoolByAddress(GetPlcAddressByConfigKey("2楼小包出口到位信号")))
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
plc.writeStringByAddress(GetPlcAddressByConfigKey("2楼码垛出口RFID条码地址"), "", 12);
|
|
|
|
|
Thread.Sleep(5000);
|
|
|
|
|
continue;
|
|
|
|
@ -306,8 +304,6 @@ namespace SlnMesnac.Business
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
string rfid = plc.readStringByAddress(GetPlcAddressByConfigKey("2楼码垛出口RFID条码地址"), 12).Replace("\0", "");
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(rfid))
|
|
|
|
@ -319,8 +315,6 @@ namespace SlnMesnac.Business
|
|
|
|
|
|
|
|
|
|
string epcStr = await ReadEpcStrByRfidKeyAsync("secondFloorOut");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (string.IsNullOrEmpty(epcStr))
|
|
|
|
|
{
|
|
|
|
|
_logger.LogError("小包出口到位信号触发,读取RFID失败......");
|
|
|
|
@ -329,7 +323,8 @@ namespace SlnMesnac.Business
|
|
|
|
|
if (realPalletTask != null)
|
|
|
|
|
{
|
|
|
|
|
epcStr = realPalletTask.PalletCode;
|
|
|
|
|
}else if (!string.IsNullOrEmpty(debugConfig.MdjOutRFID))
|
|
|
|
|
}
|
|
|
|
|
else if (!string.IsNullOrEmpty(debugConfig.MdjOutRFID))
|
|
|
|
|
{ //判断人工是否有输入条码
|
|
|
|
|
epcStr = debugConfig.MdjOutRFID;
|
|
|
|
|
}
|
|
|
|
@ -354,14 +349,12 @@ namespace SlnMesnac.Business
|
|
|
|
|
Thread.Sleep(1000 * 5);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 校验该epc是否已经存在库存里,有的话重新读
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var hasLocation = sqlSugarClient.AsTenant().GetConnection("mes").Queryable<BaseLocation>().Where(x => x.ContainerCode == epcStr).First();
|
|
|
|
|
var hasLocation = sqlSugarClient.AsTenant().GetConnection("mes").Queryable<BaseLocation>().Where(x => x.ContainerCode == epcStr).First();
|
|
|
|
|
if (hasLocation != null)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogError("小包出口到位信号触发,读取RFID失败,该epc已经存在库存里:" + epcStr);
|
|
|
|
@ -374,17 +367,18 @@ namespace SlnMesnac.Business
|
|
|
|
|
_mesProductPlanService.GetStartedProdPlan(out MesProductPlanDto productPlanDto);
|
|
|
|
|
if (productPlanDto == null)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
//throw new ArgumentException($"未获取到正在执行的生产计划");
|
|
|
|
|
|
|
|
|
|
//无计划时,按照无计划订单处理,MaterialId可修改,在配置文件
|
|
|
|
|
productPlanDto = new MesProductPlanDto();
|
|
|
|
|
productPlanDto.PlanCode = "0";
|
|
|
|
|
productPlanDto.MaterialId = long.Parse(debugConfig.MaterialId);
|
|
|
|
|
productPlanDto.SaleOrderId = 0;
|
|
|
|
|
productPlanDto.SaleorderCode = "0";
|
|
|
|
|
productPlanDto.SaleOrderId = 0;
|
|
|
|
|
productPlanDto.SaleorderCode = "0";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 开启事务
|
|
|
|
|
|
|
|
|
|
sqlSugarClient.AsTenant().BeginTran();
|
|
|
|
|
//1.生成大条码插入mes_barcode_info;
|
|
|
|
|
string bigCode = GenerateBigBarcode(productPlanDto, epcStr);
|
|
|
|
@ -393,7 +387,6 @@ namespace SlnMesnac.Business
|
|
|
|
|
//3.更新mes_product_plan及mes_product_order表,更新已生产数量
|
|
|
|
|
UpdatePlanInfoAndOrder(productPlanDto);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 删除所有数据库托盘号
|
|
|
|
|
List<RealPalletTask> realPalletList = _realPalletTaskService.Query();
|
|
|
|
|
if (realPalletList != null && realPalletList.Count > 0)
|
|
|
|
@ -406,7 +399,8 @@ namespace SlnMesnac.Business
|
|
|
|
|
readRfidAmount = 0;
|
|
|
|
|
debugConfig.MdjOutRFID = "";
|
|
|
|
|
sqlSugarClient.AsTenant().CommitTran();
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#endregion 开启事务
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
@ -418,7 +412,7 @@ namespace SlnMesnac.Business
|
|
|
|
|
Thread.Sleep(1000 * 5);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 生成大条码插入mes_barcode_info;
|
|
|
|
|
/// </summary>
|
|
|
|
@ -427,7 +421,6 @@ namespace SlnMesnac.Business
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
private string GenerateBigBarcode(MesProductPlanDto productPlanDto, string epcStr)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
string bigBarcode = productPlanDto.PlanCode + DateTime.Now.ToString("_MMddHHmmss");
|
|
|
|
|
MesBaseBarcodeInfo mesBaseBarcodeInfo = new MesBaseBarcodeInfo();
|
|
|
|
|
mesBaseBarcodeInfo.printTime = DateTime.Now;
|
|
|
|
@ -477,7 +470,9 @@ namespace SlnMesnac.Business
|
|
|
|
|
List<MesPrdBarcodeInfo> list = _mesPrdBarCodeService.GetUseBarCodeList();
|
|
|
|
|
if (list == null || list.Count == 0)
|
|
|
|
|
{
|
|
|
|
|
throw new InvalidOperationException("托盘未找到可以绑定的小条码");
|
|
|
|
|
_logger.LogError("托盘未找到可以绑定的小条码");
|
|
|
|
|
return;
|
|
|
|
|
// throw new InvalidOperationException("托盘未找到可以绑定的小条码");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (list.Where(x => x.PrintFlag == "1").ToList().Count < 40)
|
|
|
|
@ -502,7 +497,6 @@ namespace SlnMesnac.Business
|
|
|
|
|
palletInfo.MaterialId = productPlanDto.MaterialId;
|
|
|
|
|
}
|
|
|
|
|
sqlSugarClient.AsTenant().GetConnection("mes").Updateable(palletInfo).ExecuteCommand();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void UpdatePlanInfoAndOrder(MesProductPlanDto productPlanDto)
|
|
|
|
@ -519,7 +513,9 @@ namespace SlnMesnac.Business
|
|
|
|
|
_logger.LogInformation("未找到该生产计划对应的生产工单!,按照无工单处理,无需更新计划");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 更新生产计划
|
|
|
|
|
|
|
|
|
|
if (productPlan.CompleteAmount == 0)
|
|
|
|
|
{
|
|
|
|
|
productPlan.RealBeginTime = DateTime.Now;
|
|
|
|
@ -527,40 +523,38 @@ namespace SlnMesnac.Business
|
|
|
|
|
productPlan.CompleteAmount++;
|
|
|
|
|
if (productPlan.CompleteAmount == productPlan.PlanAmount)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
productPlan.RealEndTime = DateTime.Now;
|
|
|
|
|
productPlan.PlanStatus = Model.enums.PlanStatusEnum.已完成;
|
|
|
|
|
}
|
|
|
|
|
productPlan.UpdateTime = DateTime.Now;
|
|
|
|
|
productPlan.UpdateBy = "SlnMesnac";
|
|
|
|
|
sqlSugarClient.AsTenant().GetConnection("mes").Updateable(productPlan).ExecuteCommand();
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#endregion 更新生产计划
|
|
|
|
|
|
|
|
|
|
#region 更新生产工单
|
|
|
|
|
|
|
|
|
|
if (productOrder.CompleteAmount == 0)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
productOrder.RealBeginTime = DateTime.Now;
|
|
|
|
|
}
|
|
|
|
|
productOrder.CompleteAmount++;
|
|
|
|
|
if (productOrder.CompleteAmount == productOrder.PlanAmount)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
productOrder.RealEndTime = DateTime.Now;
|
|
|
|
|
productOrder.OrderStatus = "2";
|
|
|
|
|
}
|
|
|
|
|
productOrder.UpdateTime = DateTime.Now;
|
|
|
|
|
productOrder.UpdateBy = "SlnMesnac";
|
|
|
|
|
sqlSugarClient.AsTenant().GetConnection("mes").Updateable(productOrder).ExecuteCommand();
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#endregion 更新生产工单
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region 报警
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
///
|
|
|
|
|
///
|
|
|
|
|
/// 插入报警
|
|
|
|
|
/// </summary>
|
|
|
|
|
private void AddAlarm(WarnStatusEnum warnStatusEnum)
|
|
|
|
@ -607,7 +601,6 @@ namespace SlnMesnac.Business
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
dmsRecordAlarmTime.UpdateTime = DateTime.Now;
|
|
|
|
|
dmsRecordAlarmTime.UpdateBy = "SlnMesnac";
|
|
|
|
|
DmsRecordAlarmInfo dmsRecordAlarmInfo = sqlSugarClient.AsTenant().GetConnection("mes").Queryable<DmsRecordAlarmInfo>().First(x => x.AlarmRuleId == warnRuleId);
|
|
|
|
@ -638,19 +631,15 @@ namespace SlnMesnac.Business
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sqlSugarClient.AsTenant().GetConnection("mes").Updateable(dmsRecordAlarmTime).ExecuteCommand();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sqlSugarClient.AsTenant().CommitTran();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
sqlSugarClient.AsTenant().RollbackTran();
|
|
|
|
|
_logger.LogError($"插入或者更新报错信息异常{warnStatusEnum.ToString()} ==>:{ex.Message}");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
@ -659,7 +648,6 @@ namespace SlnMesnac.Business
|
|
|
|
|
/// <exception cref="InvalidOperationException"></exception>
|
|
|
|
|
private void deleteAlarm(WarnStatusEnum warnStatusEnum)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
DmsRecordAlarmTime? dmsRecordAlarmTime = sqlSugarClient.AsTenant().GetConnection("mes").Queryable<DmsRecordAlarmTime>().First(x => x.AlarmRuleId == long.Parse(warnStatusEnum.GetDescription()));
|
|
|
|
|
if (dmsRecordAlarmTime != null)
|
|
|
|
|
{
|
|
|
|
@ -728,7 +716,6 @@ namespace SlnMesnac.Business
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
dmsRecordAlarmTime.UpdateTime = DateTime.Now;
|
|
|
|
|
dmsRecordAlarmTime.UpdateBy = "SlnMesnac";
|
|
|
|
|
DmsRecordAlarmInfo dmsRecordAlarmInfo = sqlSugarClient.AsTenant().GetConnection("mes").Queryable<DmsRecordAlarmInfo>().First(x => x.AlarmRuleId == warnRuleId);
|
|
|
|
@ -739,7 +726,6 @@ namespace SlnMesnac.Business
|
|
|
|
|
}
|
|
|
|
|
sqlSugarClient.AsTenant().GetConnection("mes").Updateable(dmsRecordAlarmTime).ExecuteCommand();
|
|
|
|
|
sqlSugarClient.AsTenant().GetConnection("mes").Updateable(dmsRecordAlarmInfo).ExecuteCommand();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sqlSugarClient.AsTenant().CommitTran();
|
|
|
|
@ -751,13 +737,9 @@ namespace SlnMesnac.Business
|
|
|
|
|
_logger.LogError($"NoReadRFIDAlarm异常:{ex.Message}");
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
#endregion 报警
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 空托盘进入码垛位,读取RFID备用
|
|
|
|
@ -786,7 +768,7 @@ namespace SlnMesnac.Business
|
|
|
|
|
RealPalletTask realPalletTask = _realPalletTaskService.Query().FirstOrDefault();
|
|
|
|
|
if (realPalletTask != null)
|
|
|
|
|
{
|
|
|
|
|
// _logger.LogInformation("空托盘到位信号触发,已经有读取托盘,不再读取......");
|
|
|
|
|
// _logger.LogInformation("空托盘到位信号触发,已经有读取托盘,不再读取......");
|
|
|
|
|
Thread.Sleep(5000);
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
@ -812,7 +794,6 @@ namespace SlnMesnac.Business
|
|
|
|
|
RecordTime = DateTime.Now,
|
|
|
|
|
};
|
|
|
|
|
_realPalletTaskService.Insert(realPalletTask);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
catch (Exception e)
|
|
|
|
|
{
|
|
|
|
@ -822,7 +803,6 @@ namespace SlnMesnac.Business
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据条码提取序列
|
|
|
|
|
/// </summary>
|
|
|
|
@ -843,6 +823,5 @@ namespace SlnMesnac.Business
|
|
|
|
|
throw new InvalidOperationException($"通过条码:{barCode}提取当前序列异常:未找到匹配的数字");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|