|
|
|
@ -87,7 +87,7 @@ namespace Aucma.Core.DoorFoam.Business
|
|
|
|
|
//程序启动缓存没数据查数据库
|
|
|
|
|
if (!tempKeys.ContainsKey(kvPair.Key))
|
|
|
|
|
{
|
|
|
|
|
BoxLastShotRecord record = _lastShotRecordServices.Query(x => x.System == kvPair.Value.System && x.ProductLineCode == kvPair.Value.ProductLineCode && x.GunCode == kvPair.Value.GunCode && kvPair.Value.StationNumber == "1004").OrderByDescending(x => x.CreateTime).FirstOrDefault();
|
|
|
|
|
BoxLastShotRecord record = _lastShotRecordServices.Query(x => x.System == kvPair.Value.System && x.ProductLineCode == kvPair.Value.ProductLineCode && x.GunCode == kvPair.Value.GunCode && x.StationNumber == "1004").OrderByDescending(x => x.CreateTime).FirstOrDefault();
|
|
|
|
|
if (record == null)
|
|
|
|
|
{
|
|
|
|
|
kvPair.Value.ProductLineCode = "CX_02";
|
|
|
|
@ -106,6 +106,17 @@ namespace Aucma.Core.DoorFoam.Business
|
|
|
|
|
int b = _lastShotRecordServices.AddAsync(kvPair.Value).Result;
|
|
|
|
|
RefreshLastShotDataDelegateEvent?.Invoke(kvPair.Value);
|
|
|
|
|
}
|
|
|
|
|
// 设备状态变化,更新设备状态
|
|
|
|
|
if (kvPair.Value.SystemStatus != tempKeys[kvPair.Key].SystemStatus)
|
|
|
|
|
{
|
|
|
|
|
BoxLastShotRecord record = _lastShotRecordServices.Query(x => x.System.Equals(kvPair.Value.System) && x.ProductLineCode.Equals(kvPair.Value.ProductLineCode) && x.GunCode.Equals(kvPair.Value.GunCode) && x.StationNumber == "1004").OrderByDescending(x => x.CreateTime).FirstOrDefault();
|
|
|
|
|
if (record != null)
|
|
|
|
|
{
|
|
|
|
|
record.SystemStatus = kvPair.Value.SystemStatus;
|
|
|
|
|
bool flag = _lastShotRecordServices.UpdateAsync(record).Result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|