change - 修改条码绑定逻辑

dev
liuwf 1 year ago
parent 33503be635
commit cc327e020a

@ -1,4 +1,5 @@
using Admin.Core.Model.Model_New; using Admin.Core.IRepository;
using Admin.Core.Model.Model_New;
namespace Admin.Core.Repository namespace Admin.Core.Repository
{ {

@ -53,12 +53,12 @@ namespace Admin.Core.Service
// 默认查询最近三天的数据,防止信息过多 // 默认查询最近三天的数据,防止信息过多
if (string.IsNullOrEmpty(time1) && string.IsNullOrEmpty(time2)) if (string.IsNullOrEmpty(time1) && string.IsNullOrEmpty(time2))
{ {
list = await _codeBindingRecordRepository.QueryAsync(d => d.RecordTime1 >= System.DateTime.Now.AddDays(-3)); list = await _codeBindingRecordRepository.QueryAsync(d => d.RecordTime2 >= System.DateTime.Now.AddDays(-3));
} }
else if (!string.IsNullOrEmpty(time1) && string.IsNullOrEmpty(time2)) else if (!string.IsNullOrEmpty(time1) && string.IsNullOrEmpty(time2))
{ {
DateTime BeginTime = Convert.ToDateTime(Convert.ToDateTime(time1).ToString("yyyy-MM-dd")); DateTime BeginTime = Convert.ToDateTime(Convert.ToDateTime(time1).ToString("yyyy-MM-dd"));
list = await _codeBindingRecordRepository.QueryAsync(d => d.RecordTime1 >= BeginTime); list = await _codeBindingRecordRepository.QueryAsync(d => d.RecordTime2 >= BeginTime);
} }
else if (string.IsNullOrEmpty(time1) && !string.IsNullOrEmpty(time2)) else if (string.IsNullOrEmpty(time1) && !string.IsNullOrEmpty(time2))
{ {

@ -65,7 +65,7 @@ namespace Aucma.Core.CodeBinding.ViewModels
BindingInfo = "条码[B236000007811023002]和SN条码[B236000007811023002]绑定成功!"; BindingInfo = "条码[B236000007811023002]和SN条码[B236000007811023002]绑定成功!";
LoadCharts(); LoadCharts();
List<CodeBindingRecord> records = null; List<CodeBindingRecord> records = null;
records = await _codeBindingRecordServices.QueryAsync(x => x.BoxCode != null && x.RecordTime1 >= System.DateTime.Now.AddDays(-3), "RECORD_TIME1 desc"); records = await _codeBindingRecordServices.QueryAsync(x => x.BoxCode != null && x.RecordTime2 >= System.DateTime.Now.AddDays(-3), "RECORD_TIME1 desc");
if (records != null) if (records != null)
{ {
foreach (CodeBindingRecord record in records) foreach (CodeBindingRecord record in records)

@ -67,7 +67,7 @@ namespace Aucma.Core.PLc
/// </summary> /// </summary>
/// <param name="address"></param> /// <param name="address"></param>
/// <returns></returns> /// <returns></returns>
float ReadDouble(string address); double ReadDouble(string address);
/// <summary> /// <summary>
/// 写入int16 /// 写入int16
/// </summary> /// </summary>

@ -275,7 +275,6 @@ namespace Aucma.Core.PLc
#endregion #endregion
#region 读取Double #region 读取Double
/// <summary> /// <summary>
/// 读取Double /// 读取Double
/// </summary> /// </summary>

@ -270,6 +270,33 @@ namespace Aucma.Core.PLc
#endregion #endregion
#region 读取Double
/// <summary>
/// 读取double
/// </summary>
/// <param name="address"></param>
/// <returns></returns>
public double ReadDouble(string address)
{
double flag = 0;
try
{
OperateResult<double> read = siemensS7Net.ReadDouble(address);
if (read.IsSuccess)
{
flag = read.Content;
}
}
catch (Exception ex)
{
log.Error("ReadString方法异常" + ex.ToString());
}
return flag;
}
#endregion
#region 写入int16 #region 写入int16
/// <summary> /// <summary>
/// 写入int16 /// 写入int16

Loading…
Cancel
Save