|
|
|
|
using Admin.Core.IRepository;
|
|
|
|
|
using Admin.Core.IService;
|
|
|
|
|
using Admin.Core.Model;
|
|
|
|
|
using log4net;
|
|
|
|
|
using Microsoft.IdentityModel.Logging;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Admin.Core.Service
|
|
|
|
|
{
|
|
|
|
|
public class CodeBindingRecordServices : BaseServices<CodeBindingRecord>, ICodeBindingRecordServices
|
|
|
|
|
{
|
|
|
|
|
#region 对象引用
|
|
|
|
|
private static readonly log4net.ILog log = LogManager.GetLogger(typeof(CodeBindingRecordServices));
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
private readonly IBaseRepository<CodeBindingRecord> _dal;
|
|
|
|
|
private ICodeBindingRecordRepository _codeBindingRecordRepository;
|
|
|
|
|
public CodeBindingRecordServices(IBaseRepository<CodeBindingRecord> dal, ICodeBindingRecordRepository codeBindingRecordRepository)
|
|
|
|
|
{
|
|
|
|
|
this._dal = dal;
|
|
|
|
|
base.BaseDal = dal;
|
|
|
|
|
_codeBindingRecordRepository = codeBindingRecordRepository;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 时间段条件查询
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public async Task<List<CodeBindingRecord>> QueryAllByTime(string time1, string time2)
|
|
|
|
|
{
|
|
|
|
|
return _codeBindingRecordRepository.QueryAllByTime(time1,time2).Result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 查询第一条数据
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public async Task<CodeBindingRecord> FirstAsync()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// return new CodeBindingRecord
|
|
|
|
|
//{
|
|
|
|
|
// ObjId = 111,
|
|
|
|
|
// BoxCode = "1234567890",
|
|
|
|
|
// BoxName = "苏打水",
|
|
|
|
|
// ProductCode = "0987654321",
|
|
|
|
|
// BindingResult = "成功",
|
|
|
|
|
// RecordTime1 = System.DateTime.Now
|
|
|
|
|
//};
|
|
|
|
|
return _codeBindingRecordRepository.FirstAsync().Result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
///查询条码2为null的数据,并取最新的一条
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public async Task<CodeBindingRecord> QueryByTime()
|
|
|
|
|
{
|
|
|
|
|
return _codeBindingRecordRepository.QueryByTime().Result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|