using Admin.Core.IRepository;
using Admin.Core.IService;
using Admin.Core.Model;
using Admin.Core.Model.Model_New;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Admin.Core.Service
{
///
/// 质检记录
///
public class ReportQualityInspectionServices : BaseServices, IReportQualityInspectionServices
{
private readonly IBaseRepository _dal;
private readonly IReportQualityInspectionRepository _qualityInspectionRepository;
private readonly ICodeBindingRecordRepository _codeBindingRecordRepository;
public ReportQualityInspectionServices(IBaseRepository dal, IReportQualityInspectionRepository reportQualityInspectionRepository, ICodeBindingRecordRepository codeBindingRepository)
{
_qualityInspectionRepository = reportQualityInspectionRepository;
_codeBindingRecordRepository = codeBindingRepository;
this._dal = dal;
base.BaseDal = dal;
}
///
/// 判断是否有不合格质检项,传入的是箱体码
///
///
public ReportQualityInsPection JudgeIsQualified(string BoxCode)
{
try
{
ReportQualityInsPection record = _qualityInspectionRepository.Db.Ado.SqlQuery($"select * from REPORT_QUALITY_INSPECTION where BAR_CODE = '{BoxCode}' AND STATION_CODE = 2010 AND TREATMENT_MEASURE = 3").FirstOrDefault();
return record;
}
catch (System.Exception ex)
{
Console.WriteLine(ex.Message);
}
return null;
}
}
}