|
|
|
@ -108,14 +108,14 @@ namespace SlnMesnac.WPF.ViewModel.IndexPage
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
DateTime start = Convert.ToDateTime(DateTime.Now.ToString("D").ToString());
|
|
|
|
|
DateTime end = Convert.ToDateTime(DateTime.Now.AddDays(1).ToString("D").ToString()).AddSeconds(-1);
|
|
|
|
|
List<data1_Table> _data1Tables = _data1TableService.Getdata1TableListAsync().Result;
|
|
|
|
|
if (_data1Tables != null && _data1Tables.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
List<T_RP_StationPara_110_1> newList = new List<T_RP_StationPara_110_1>();
|
|
|
|
|
|
|
|
|
|
foreach (var data1Table in _data1Tables)
|
|
|
|
|
{
|
|
|
|
|
newList.Add(new T_RP_StationPara_110_1()
|
|
|
|
|
T_RP_StationPara_110_1 T_RP_StationPara_110_1 = new T_RP_StationPara_110_1()
|
|
|
|
|
{
|
|
|
|
|
semibarcode = data1Table.dpqrcode,
|
|
|
|
|
scanbarcode = data1Table.jpqrcode,
|
|
|
|
@ -129,18 +129,31 @@ namespace SlnMesnac.WPF.ViewModel.IndexPage
|
|
|
|
|
para7 = data1Table.e3value,
|
|
|
|
|
para8 = data1Table.e4value,
|
|
|
|
|
inserttime = DateTime.Parse(data1Table.time)
|
|
|
|
|
});
|
|
|
|
|
data1Table.flag = "F";
|
|
|
|
|
var iflag = _data1TableService.UpdateAsync(data1Table).Result;
|
|
|
|
|
if (iflag)
|
|
|
|
|
};
|
|
|
|
|
bool insertflag = false;
|
|
|
|
|
var GetFlag = await _tr_stationPara_110_1Service.GetResultAsync(data1Table.jpqrcode, data1Table.dpqrcode);
|
|
|
|
|
if (GetFlag != null)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine(StringChange.ModeToJson(data1Table));
|
|
|
|
|
T_RP_StationPara_110_1.id = GetFlag.id;
|
|
|
|
|
insertflag = _tr_stationPara_110_1Service.Update(T_RP_StationPara_110_1);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
insertflag = _tr_stationPara_110_1Service.Insert(T_RP_StationPara_110_1);
|
|
|
|
|
}
|
|
|
|
|
if (insertflag)
|
|
|
|
|
{
|
|
|
|
|
data1Table.flag = "F";
|
|
|
|
|
var iflag = _data1TableService.UpdateAsync(data1Table).Result;
|
|
|
|
|
if (iflag)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine(StringChange.ModeToJson(data1Table));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (newList != null && newList.Count != 0)
|
|
|
|
|
{
|
|
|
|
|
bool insertflag = await _tr_stationPara_110_1Service.AddTaskAsync(newList);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
@ -150,13 +163,71 @@ namespace SlnMesnac.WPF.ViewModel.IndexPage
|
|
|
|
|
}
|
|
|
|
|
private async void LoadEDataInfo()
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
DateTime start = Convert.ToDateTime(DateTime.Now.ToString("D").ToString());
|
|
|
|
|
DateTime end = Convert.ToDateTime(DateTime.Now.AddDays(1).ToString("D").ToString()).AddSeconds(-1);
|
|
|
|
|
List<data2_Table> _data1Tables = _data2TableService.Getdata2TableListAsync(start, end).Result;
|
|
|
|
|
if (_data1Tables != null && _data1Tables.Count > 0)
|
|
|
|
|
{
|
|
|
|
|
for (global::System.Int32 i = 0; i < _data1Tables.Count; i++)
|
|
|
|
|
{
|
|
|
|
|
T_RP_StationPara_110_2 t_RP_StationPara_110_2 = new T_RP_StationPara_110_2()
|
|
|
|
|
{
|
|
|
|
|
scanbarcode = _data1Tables[i].qrcode,
|
|
|
|
|
state = _data1Tables[i].totaljudge == "OK" ? "1" : "2",
|
|
|
|
|
para1 = _data1Tables[i].f1value,
|
|
|
|
|
para1State = _data1Tables[i].f1judge == "OK" ? "1" : "2",
|
|
|
|
|
para2 = _data1Tables[i].f2value,
|
|
|
|
|
para2State = _data1Tables[i].f2judge == "OK" ? "1" : "2",
|
|
|
|
|
para3 = _data1Tables[i].f3value,
|
|
|
|
|
para3State = _data1Tables[i].f3judge == "OK" ? "1" : "2",
|
|
|
|
|
para4 = _data1Tables[i].f4value,
|
|
|
|
|
para4State = _data1Tables[i].f4judge == "OK" ? "1" : "2",
|
|
|
|
|
para5 = _data1Tables[i].frangevalue,
|
|
|
|
|
para5State = _data1Tables[i].frange == "OK" ? "1" : "2",
|
|
|
|
|
inserttime = _data1Tables[i].time
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
var GetFlag = await _tr_stationPara_110_2Service.GetResultAsync(_data1Tables[i].qrcode);
|
|
|
|
|
bool insertflag = false;
|
|
|
|
|
//存在相同测量数据则更新
|
|
|
|
|
if (GetFlag != null)
|
|
|
|
|
{
|
|
|
|
|
t_RP_StationPara_110_2.id = GetFlag.id;
|
|
|
|
|
insertflag = await _tr_stationPara_110_2Service.UpdateResultAsync(t_RP_StationPara_110_2);
|
|
|
|
|
}
|
|
|
|
|
//反之则插入
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
insertflag = await _tr_stationPara_110_2Service.AddTaskAsync(t_RP_StationPara_110_2);
|
|
|
|
|
}
|
|
|
|
|
if (insertflag)
|
|
|
|
|
{
|
|
|
|
|
_data1Tables[i].flag = "F";
|
|
|
|
|
var iflag = _data2TableService.UpdateAsync(_data1Tables[i]).Result;
|
|
|
|
|
if (iflag)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine(StringChange.ModeToJson(_data1Tables[i]));
|
|
|
|
|
_logger.LogDebug(StringChange.ModeToJson(_data1Tables[i]));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
_logger.LogError($"异常:{ex.Message}");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void Init()
|
|
|
|
|
{
|
|
|
|
|
#region 测试数据
|
|
|
|
|
//LoadEDataInfo();
|
|
|
|
|
//LoadTaskInfo();
|
|
|
|
|
LoadTaskInfo();
|
|
|
|
|
//Thread.Sleep(5000);
|
|
|
|
|
|
|
|
|
|
//_tcpServer.SendReplyGetManualException(
|
|
|
|
|