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
{

@ -53,12 +53,12 @@ namespace Admin.Core.Service
// 默认查询最近三天的数据,防止信息过多
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))
{
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))
{

@ -65,7 +65,7 @@ namespace Aucma.Core.CodeBinding.ViewModels
BindingInfo = "条码[B236000007811023002]和SN条码[B236000007811023002]绑定成功!";
LoadCharts();
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)
{
foreach (CodeBindingRecord record in records)

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

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

@ -270,6 +270,33 @@ namespace Aucma.Core.PLc
#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
/// <summary>
/// 写入int16
@ -277,7 +304,7 @@ namespace Aucma.Core.PLc
/// <param name="address"></param>
/// <param name="value"></param>
/// <returns></returns>
public bool WriteInt16(string address, string value)
public bool WriteInt16(string address, string value)
{
bool iflag = false;
try

Loading…
Cancel
Save