|
@@ -397,7 +397,8 @@ namespace IMCS.CCS.Service.Impl
|
|
|
// start---------------RFID
|
|
|
|
|
|
//获取imcs存储的托盘编码和零件编码
|
|
|
- var trayAndProduct = await _redisService.Database.StringGetAsync(RFID + task.TaskNodeId);
|
|
|
+ string imcsRFID=_redisService.Database.StringGetAsync(RFID + task.TaskNodeId).Result;
|
|
|
+
|
|
|
var rfidFlag = await _redisService.Database.StringGetAsync(RFID + RedisKeyEnum.Flag);
|
|
|
Boolean flag = true;
|
|
|
if (rfidFlag.HasValue)
|
|
@@ -406,7 +407,7 @@ namespace IMCS.CCS.Service.Impl
|
|
|
}
|
|
|
|
|
|
|
|
|
- if (flag && trayAndProduct.HasValue)
|
|
|
+ if (flag && imcsRFID!=null)
|
|
|
{
|
|
|
var taskId = await _redisService.Database.StringGetAsync(RFID + task.Id);
|
|
|
if (taskId.HasValue)
|
|
@@ -441,11 +442,15 @@ namespace IMCS.CCS.Service.Impl
|
|
|
|
|
|
//读取RFID的零件编码
|
|
|
//string readResult = ToolUtils.ReturnStringByBytes(plcS7.Read("DB1.62", 39).Content);
|
|
|
-
|
|
|
+
|
|
|
|
|
|
//比较托盘编码是否一致
|
|
|
//读取redis数据
|
|
|
- Rfid imcsRfid = JsonConvert.DeserializeObject<Rfid>(trayAndProduct);
|
|
|
+ string[] strings = imcsRFID.Replace("\"", "").Split("&");
|
|
|
+ Rfid imcsRfid = new Rfid();
|
|
|
+ imcsRfid.trayNo = strings[0];
|
|
|
+ imcsRfid.trayNo = strings[1];
|
|
|
+
|
|
|
if(imcsRfid.trayNo != readResult)
|
|
|
{
|
|
|
Log.Instance.WriteLogAdd("RFID校验托盘失败:" + "读取imcs_redis数据_"+JsonConvert.SerializeObject(imcsRfid)+",读取RFID数据_"+ readResult.ToString(), LOG_TITLE_CALLBACK);
|