|
|
|
@ -2,9 +2,11 @@
|
|
|
|
|
using MaterialTraceability.Entity.DAO;
|
|
|
|
|
using MaterialTraceability.Entity.DTO;
|
|
|
|
|
using MaterialTraceability.Entity.Enum;
|
|
|
|
|
using MaterialTraceability.Entity.UpLoad;
|
|
|
|
|
using MaterialTraceability.SqlSugar;
|
|
|
|
|
using MaterialTraceability.SqlSugar.ServiceImpl;
|
|
|
|
|
using MaterialTraceability.WebService;
|
|
|
|
|
using MaterialTraceability.WebService.MiFirstOperationForsfcServiceService;
|
|
|
|
|
using MaterialTraceability.WebService.MiReleaseSfcWithActivityServiceService;
|
|
|
|
|
using MaterialTraceability.WebService.Param;
|
|
|
|
|
using MaterialTraceability.WebService.ProcessLotServiceWSService;
|
|
|
|
@ -94,6 +96,8 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
|
|
|
|
|
private IBaseServices<SysClient> sysClientServices = new BaseServices<SysClient>();
|
|
|
|
|
|
|
|
|
|
private IBaseServices<ProUpRecord> upRecordServices = new BaseServices<ProUpRecord>();
|
|
|
|
|
|
|
|
|
|
private MesAlarmInfo alarmInfo = new MesAlarmInfo();
|
|
|
|
|
|
|
|
|
|
private PlcBusiness plcBusiness = new PlcBusiness();
|
|
|
|
@ -108,16 +112,149 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
/// <param name="position"></param>
|
|
|
|
|
public void UpMaterialBegin(int position)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
string logStr = position == 3 ? "A放卷轴" : "B放卷轴";
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.PlcLog, $"{logStr}涨紧信号触发成功");
|
|
|
|
|
ProEquip proEquip = equipBusiness.Equiplist.Where(x => x.positionId == position).FirstOrDefault();
|
|
|
|
|
if (proEquip == null)
|
|
|
|
|
{
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.AlarmLog, $"获取{logStr}读写器设备信息异常");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
string epc = equipBusiness.ReadEPCByAntana(proEquip.equipId);
|
|
|
|
|
epc = epc.Replace("\0", "").Trim();
|
|
|
|
|
SaveReadRecord(proEquip, epc);
|
|
|
|
|
|
|
|
|
|
if (StringExtension.IsBlank(epc))
|
|
|
|
|
{
|
|
|
|
|
plcBusiness.writePlc(appConfig.TbAddress.放卷气胀泄气, 1);
|
|
|
|
|
plcBusiness.writePlc(position == 3 ? appConfig.TbAddress.放卷RFID异常 : appConfig.TbAddress.放卷RFID异常, 1);
|
|
|
|
|
LogHelper.Info($"{logStr}RFID条码信息读取失败,下发PLC报警");
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.AlarmLog, $"{logStr}RFID条码信息读取失败");
|
|
|
|
|
ViewModelRefreshEvent?.Invoke(new ViewModelDto()
|
|
|
|
|
{
|
|
|
|
|
rfidInfo = new RfidInfoDto()
|
|
|
|
|
{
|
|
|
|
|
rfid = "",
|
|
|
|
|
sfc = "",
|
|
|
|
|
ea = "",
|
|
|
|
|
position = position,
|
|
|
|
|
},
|
|
|
|
|
plcStatus = true,
|
|
|
|
|
});
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
LogHelper.Info($"{logStr}RFID条码信息读取成功:{epc}");
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.RfidLog, $"{logStr}RFID条码信息读取成功,RFID为{epc}");
|
|
|
|
|
//判断RFID标签是否重复
|
|
|
|
|
LogHelper.Info($"{logStr}判断RFID标签是否重复");
|
|
|
|
|
if (BusinessHelper.UpRfidIsRecur(epc, position).Result)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
//判断是否已经生产结束
|
|
|
|
|
if (UpMaterialIsEndProduction(epc).Result)
|
|
|
|
|
{
|
|
|
|
|
plcBusiness.writePlc(appConfig.LyAddress.RFID异常, 1);
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.AlarmLog, String.Format("当前读取的RFID:{0},已经生产结束不允许再次上料", epc));
|
|
|
|
|
LogHelper.Info(String.Format("当前读取的RFID:{0},已经生产结束不允许再次上料", epc));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Expression<Func<ProUpRecord, bool>> exp = s1 => true;
|
|
|
|
|
Expression<Func<ProUpRecord, object>> order = (x) => x.RecordTime;
|
|
|
|
|
ProUpRecord upRecord = upRecordServices.QueryFirst(exp, order, false).Result;
|
|
|
|
|
if (upRecord != null)
|
|
|
|
|
{
|
|
|
|
|
PlcBusiness.writeStrPlc(position == 3 ? appConfig.TbAddress.A放卷SFC : appConfig.TbAddress.B放卷SFC, upRecord.Sfc);
|
|
|
|
|
ViewModelRefreshEvent?.Invoke(new ViewModelDto()
|
|
|
|
|
{
|
|
|
|
|
rfidInfo = new RfidInfoDto()
|
|
|
|
|
{
|
|
|
|
|
rfid = epc,
|
|
|
|
|
sfc = upRecord.Sfc,
|
|
|
|
|
position = position,
|
|
|
|
|
},
|
|
|
|
|
plcStatus = true,
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
LogHelper.Info($"{logStr}RFID读取到的条码:{epc};与前一读取相同并且生产未结束,可以继续生产");
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.RfidLog, $"{logStr}RFID读取到的条码:{epc};与前一读取相同并且生产未结束,可以继续生产");
|
|
|
|
|
LogHelper.Info("冷压放卷流程处理成功");
|
|
|
|
|
//plcBusiness.writePlc(appConfig.LyAddress.放卷OK, 0);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//读取数据刷新
|
|
|
|
|
ViewModelRefreshEvent?.Invoke(new ViewModelDto()
|
|
|
|
|
{
|
|
|
|
|
rfidInfo = new RfidInfoDto()
|
|
|
|
|
{
|
|
|
|
|
rfid = epc,
|
|
|
|
|
//sfc = "",
|
|
|
|
|
position = position,
|
|
|
|
|
},
|
|
|
|
|
plcStatus = true,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
FJMesBegin(position, epc, true);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
LogHelper.Info($"{logStr}放卷涨紧流程RFID逻辑处理异常:{ex.Message}");
|
|
|
|
|
plcBusiness.writePlc(position == 3 ? appConfig.TbAddress.放卷RFID异常 : appConfig.TbAddress.放卷RFID异常, 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 放卷位结束
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="position"></param>
|
|
|
|
|
public void UpMaterialEnd(int position)
|
|
|
|
|
public async void UpMaterialEnd(int position)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
string logStr = position == 3 ? "A放卷轴" : "B放卷轴";
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.PlcLog, $"{logStr}结束信号触发成功");
|
|
|
|
|
|
|
|
|
|
ProShaftInfo shaftInfo = await this.GetShaftInfoByPosition(position);
|
|
|
|
|
|
|
|
|
|
if (shaftInfo == null)
|
|
|
|
|
{
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.RfidLog, $"{logStr}放卷结束,获取卷轴绑定的信息为空");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Expression<Func<ProUpRecord, bool>> upExp = s1 => true;
|
|
|
|
|
upExp = upExp.And(x => x.Sfc == shaftInfo.bindSfc && x.Rfid == shaftInfo.bindRfid && x.IsProduction == 0);
|
|
|
|
|
Expression<Func<ProUpRecord, object>> upOrder = (x) => x.RecordTime;
|
|
|
|
|
ProUpRecord upRecord = await upRecordServices.QueryFirst(upExp, upOrder, false);
|
|
|
|
|
if (upRecord == null)
|
|
|
|
|
{
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.AlarmLog, $"{logStr}放卷结束,获取上料信息为空");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//更新放卷信息
|
|
|
|
|
upRecord.endTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
upRecord.IsProduction = 1;
|
|
|
|
|
upRecord.isFinish = 1;
|
|
|
|
|
await upRecordServices.Update(upRecord);
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.RfidLog, "生成放卷信息");
|
|
|
|
|
|
|
|
|
|
shaftInfo.bindRfid = string.Empty;
|
|
|
|
|
shaftInfo.bindSfc = string.Empty;
|
|
|
|
|
shaftInfo.bindEaValue = string.Empty;
|
|
|
|
|
shaftInfo.bindTime = string.Empty;
|
|
|
|
|
await shaftInfoServices.Update(shaftInfo);
|
|
|
|
|
|
|
|
|
|
plcBusiness.writePlc(appConfig.TbAddress.放卷控制下料, 0);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
LogHelper.Info($"{logStr}放卷结束流程RFID逻辑处理异常:{ex.Message}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
///add by yinzf
|
|
|
|
|
/// <summary>
|
|
|
|
@ -126,9 +263,169 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
/// <param name="position"></param>
|
|
|
|
|
public void UpBegin(int position)
|
|
|
|
|
{
|
|
|
|
|
string logStr = position == 3 ? "A放卷轴" : "B放卷轴";
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.PlcLog, $"{logStr}开始信号触发成功");
|
|
|
|
|
|
|
|
|
|
plcBusiness.writePlc(appConfig.TbAddress.放卷控制下料, 1);
|
|
|
|
|
}
|
|
|
|
|
catch(Exception ex)
|
|
|
|
|
{
|
|
|
|
|
LogHelper.Info($"{logStr}放卷结束流程RFID逻辑处理异常:{ex.Message}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 放卷涨紧MES处理
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="position"></param>
|
|
|
|
|
/// <param name="epc"></param>
|
|
|
|
|
/// <param name="auto"></param>
|
|
|
|
|
public async void FJMesBegin(int position, string epc, bool auto)
|
|
|
|
|
{
|
|
|
|
|
string logStr = position == 3 ? "A放卷轴" : "B放卷轴";
|
|
|
|
|
string sfc = "";
|
|
|
|
|
string qty = "";
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if (!auto)
|
|
|
|
|
{
|
|
|
|
|
plcBusiness.writePlc(position == 3 ? appConfig.TbAddress.放卷RFID异常 : appConfig.TbAddress.放卷RFID异常, 0);
|
|
|
|
|
plcBusiness.writePlc(position == 3 ? appConfig.TbAddress.放卷MES异常 : appConfig.TbAddress.放卷MES异常, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region 这里进行MES操作
|
|
|
|
|
LogHelper.Info("调用MES首工序获取SFC接口");
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.MesLog, "调用MES首工序获取SFC接口");
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.RfidLog, "调用MES首工序获取SFC接口");
|
|
|
|
|
//调MES首工序获取SFC接口
|
|
|
|
|
MiFirstOperationForsfcServiceServiceParam miFirstOperationForsfcServiceServiceParam = new MiFirstOperationForsfcServiceServiceParam()
|
|
|
|
|
{
|
|
|
|
|
url = inifile.IniReadValue("MiFirstOperationForsfcServiceServiceParam", "url"),
|
|
|
|
|
site = inifile.IniReadValue("MiFirstOperationForsfcServiceServiceParam", "site"),
|
|
|
|
|
sfc = "",
|
|
|
|
|
processLot = epc,
|
|
|
|
|
operation = appConfig.operation,
|
|
|
|
|
operationRevision = inifile.IniReadValue("MiFirstOperationForsfcServiceServiceParam", "operationRevision"),
|
|
|
|
|
resource = appConfig.resource,
|
|
|
|
|
user = inifile.IniReadValue("MiFirstOperationForsfcServiceServiceParam", "user"),
|
|
|
|
|
activity = inifile.IniReadValue("MiFirstOperationForsfcServiceServiceParam", "activity"),
|
|
|
|
|
modeProcessSfc = inifile.IniReadValue("MiFirstOperationForsfcServiceServiceParam", "modeProcessSfc"),
|
|
|
|
|
loginUser = "",
|
|
|
|
|
password = "",
|
|
|
|
|
};
|
|
|
|
|
LogHelper.Info("MES首工序获取SFC接口请求参数:" + JsonChange.ModeToJson(miFirstOperationForsfcServiceServiceParam));
|
|
|
|
|
miFirstOperationForsfcResponse firstOperationForsfcResponse = new miFirstOperationForsfcResponse();
|
|
|
|
|
if (appConfig.isMesFlag == 1)
|
|
|
|
|
{
|
|
|
|
|
DateTime beginTime = DateTime.Now;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
firstOperationForsfcResponse = MesWebServices.iMiFirstOperationForsfcServiceService(miFirstOperationForsfcServiceServiceParam);
|
|
|
|
|
LogHelper.Info("MES首工序获取SFC接口返回参数:" + JsonChange.ModeToJson(firstOperationForsfcResponse));
|
|
|
|
|
|
|
|
|
|
//判断返回结果
|
|
|
|
|
if (firstOperationForsfcResponse.@return.code > 0)
|
|
|
|
|
{
|
|
|
|
|
LogHelper.Info("MES首工序获取SFC接口请求失败:" + firstOperationForsfcResponse.@return.message);
|
|
|
|
|
|
|
|
|
|
plcBusiness.writePlc(appConfig.TbAddress.放卷气胀泄气, 1);
|
|
|
|
|
plcBusiness.writePlc(appConfig.TbAddress.放卷MES异常, firstOperationForsfcResponse.@return.code);
|
|
|
|
|
LogHelper.Info("MES首工序获取SFC接口调用失败:" + firstOperationForsfcResponse.@return.message);
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.RfidLog, "MES首工序获取SFC接口调用失败");
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.MesLog, "MES首工序获取SFC接口调用失败" + upLoadBusiness.GetMesMessage(firstOperationForsfcResponse.@return.code, firstOperationForsfcResponse.@return.message));
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.AlarmLog, "MES首工序获取SFC接口调用失败" + upLoadBusiness.GetMesMessage(firstOperationForsfcResponse.@return.code, firstOperationForsfcResponse.@return.message));
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.PlcLog, "MES首工序获取SFC接口调用失败");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
sfc = firstOperationForsfcResponse.@return.sfc;
|
|
|
|
|
qty = firstOperationForsfcResponse.@return.qty;
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.RfidLog, String.Format("MES首工序获取SFC接口调用成功,SFC:{0};EA:{1}", sfc, qty));
|
|
|
|
|
LogHelper.Info(String.Format("MES首工序获取SFC接口调用成功,SFC:{0};EA:{1}", sfc, qty));
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
LogHelper.Info("调用MES首工序获取SFC接口异常:" + ex.Message);
|
|
|
|
|
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.AlarmLog, "调用MES首工序获取SFC接口异常:" + ex.Message);
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.MesLog, "调用MES首工序获取SFC接口异常:" + ex.Message);
|
|
|
|
|
WebServiceLog.saveMiFirstOperationForsfcServiceService(miFirstOperationForsfcServiceServiceParam, null
|
|
|
|
|
, beginTime, ex.Message);
|
|
|
|
|
plcBusiness.writePlc(appConfig.TbAddress.放卷气胀泄气, 1);
|
|
|
|
|
plcBusiness.writePlc(appConfig.TbAddress.放卷MES异常, 1);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
sfc = System.Guid.NewGuid().ToString("N").Substring(0, 14);
|
|
|
|
|
qty = "2000";
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.RfidLog, String.Format("MES首工序获取SFC接口调用成功,SFC:{0};EA:{1}", sfc, qty));
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
//向PLC写入SFC膜卷号
|
|
|
|
|
PlcBusiness.writeStrPlc(position == 3 ? appConfig.TbAddress.A放卷SFC : appConfig.TbAddress.B放卷SFC, sfc);
|
|
|
|
|
ViewModelRefreshEvent?.Invoke(new ViewModelDto()
|
|
|
|
|
{
|
|
|
|
|
rfidInfo = new RfidInfoDto()
|
|
|
|
|
{
|
|
|
|
|
rfid = epc,
|
|
|
|
|
sfc = sfc,
|
|
|
|
|
position = position,
|
|
|
|
|
ea = qty,
|
|
|
|
|
},
|
|
|
|
|
plcStatus = true,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//实时绑定卷轴与RFID信息
|
|
|
|
|
LogHelper.Info($"{logStr}绑定放卷轴与RFID:{epc};获取卷轴信息");
|
|
|
|
|
ProShaftInfo shaftInfo = await this.GetShaftInfoByPosition(position);
|
|
|
|
|
|
|
|
|
|
if (shaftInfo == null || StringExtension.IsBlank(shaftInfo.processId))
|
|
|
|
|
{
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.RfidLog, $"{logStr}绑定卷轴与RFID,获取卷轴信息为空");
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.AlarmLog, $"{logStr}绑定卷轴与RFID,获取卷轴信息为空");
|
|
|
|
|
LogHelper.Info($"{logStr}绑定卷轴与RFID,获取卷轴信息为空");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
LogHelper.Info($"{logStr}获取卷轴信息为:" + JsonChange.ModeToJson(shaftInfo));
|
|
|
|
|
shaftInfo.bindRfid = epc;
|
|
|
|
|
shaftInfo.bindSfc = sfc;
|
|
|
|
|
shaftInfo.bindEaValue = qty;
|
|
|
|
|
shaftInfo.bindTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
|
|
|
|
|
await shaftInfoServices.Update(shaftInfo);
|
|
|
|
|
|
|
|
|
|
//本地保存SFC,上料记录
|
|
|
|
|
ProUpRecord upRecord = new ProUpRecord()
|
|
|
|
|
{
|
|
|
|
|
Id = System.Guid.NewGuid().ToString(),
|
|
|
|
|
MachineId = appConfig.machineId,
|
|
|
|
|
PositionId = position,
|
|
|
|
|
Rfid = epc,
|
|
|
|
|
Sfc = sfc,
|
|
|
|
|
eaValue = StringChange.ParseToInt(qty),
|
|
|
|
|
IsProduction = 0,
|
|
|
|
|
beginTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"),
|
|
|
|
|
RecordTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss")
|
|
|
|
|
};
|
|
|
|
|
await upRecordServices.Add(upRecord);
|
|
|
|
|
|
|
|
|
|
upLoadBusiness.SaveUpRecord(upRecord);
|
|
|
|
|
|
|
|
|
|
LogHelper.Info($"{logStr}放卷流程处理成功");
|
|
|
|
|
plcBusiness.writePlc(position == 3 ? appConfig.TbAddress.A放卷OK : appConfig.TbAddress.B放卷OK, 1);
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
LogHelper.Info($"{logStr}放卷流程MES逻辑处理异常:{ex.Message}");
|
|
|
|
|
plcBusiness.writePlc(position == 3 ? appConfig.TbAddress.放卷RFID异常 : appConfig.TbAddress.放卷RFID异常, 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//end add
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 收卷位涨紧
|
|
|
|
|
/// </summary>
|
|
|
|
@ -617,6 +914,15 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
///放卷强制下料
|
|
|
|
|
if(position > 2)
|
|
|
|
|
{
|
|
|
|
|
string logstr = position == 3 ? "A放卷轴" : "B放卷轴";
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.PlcLog, $"{logstr}强制下料信号触发成功");
|
|
|
|
|
UpMaterialEnd(position);
|
|
|
|
|
plcBusiness.writePlc(appConfig.TbAddress.放卷控制下料, 0);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string logStr = position == 1 ? "A轴" : "B轴";
|
|
|
|
|
|
|
|
|
@ -793,5 +1099,34 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
};
|
|
|
|
|
upLoadBusiness.SaveReadRecord(readRecord);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 放卷位物料是否结束生产
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="epc"></param>
|
|
|
|
|
private async Task<bool> UpMaterialIsEndProduction(string rfidStr)
|
|
|
|
|
{
|
|
|
|
|
bool result = false;
|
|
|
|
|
|
|
|
|
|
Expression<Func<ProUpRecord, bool>> exp = s1 => true;
|
|
|
|
|
exp = exp.And(x => x.Rfid == rfidStr);
|
|
|
|
|
Expression<Func<ProUpRecord, object>> order = s1 => s1.RecordTime;
|
|
|
|
|
ProUpRecord upRecord = await upRecordServices.QueryFirst(exp, order, false);
|
|
|
|
|
if (upRecord != null)
|
|
|
|
|
{
|
|
|
|
|
if (StringExtension.IsBlank(upRecord.endTime))
|
|
|
|
|
{
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.RfidLog, String.Format("当前SFC:{0}放卷结束时间为空,生产未结束", rfidStr));
|
|
|
|
|
result = false;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.RfidLog, String.Format("当前SFC:{0}放卷结束时间为:{1}", rfidStr, upRecord.endTime));
|
|
|
|
|
result = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|