change-修复最后一枪空数据不采集

dev
liuwf 1 year ago
parent dff10cc964
commit a334e19dd0

@ -90,7 +90,7 @@ namespace Aucma.Core.BoxFoam.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).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 == "1005").OrderByDescending(x => x.CreateTime).FirstOrDefault();
if (record == null)
{
kvPair.Value.ProductLineCode = "CX_02";
@ -114,7 +114,7 @@ namespace Aucma.Core.BoxFoam.Business
// 设备状态变化,更新设备状态
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)).OrderByDescending(x => x.CreateTime).FirstOrDefault();
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 == "1005").OrderByDescending(x => x.CreateTime).FirstOrDefault();
if (record != null)
{
record.SystemStatus = kvPair.Value.SystemStatus;

@ -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;
}
}
}

@ -222,7 +222,7 @@ namespace Aucma.Core.DoorFoam.ViewModels
{
LastShotRecordDataGrid.Clear();
int i = 1;
// var list = await _boxLastShotRecordServices.QueryAsync();
// list.OrderByDescending(d => d.CreateTime).Take(30);
@ -232,15 +232,10 @@ namespace Aucma.Core.DoorFoam.ViewModels
if (item.System == "1") { system = "1系统"; }
if (item.System == "2") { system = "2系统"; }
LastShotRecordModel model = new LastShotRecordModel();
if (LastShotRecordDataGrid.Count() == 0)
{
model.No = 1;
}
else
{
model.No = LastShotRecordDataGrid.Count() + 1;
}
model.No = i;
model.No = LastShotRecordDataGrid.Count() + 1;
model.System = system;
model.GunHead = item.GunCode;
model.PolInjectionpressure = item.PolHp;

@ -181,7 +181,7 @@
<lvc:CartesianChart.AxisY>
<lvc:Axis FontSize="15" MinValue="0" MaxValue="50">
<lvc:Axis.Separator>
<lvc:Separator Step="1" Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3" Stroke="#404F56" >
<lvc:Separator Visibility="Hidden" StrokeThickness="1" StrokeDashArray="3" Stroke="#404F56" >
</lvc:Separator>
</lvc:Axis.Separator>
</lvc:Axis>

Loading…
Cancel
Save