You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.8 KiB
C#
49 lines
1.8 KiB
C#
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
|
|
{
|
|
/// <summary>
|
|
/// 质检记录
|
|
/// </summary>
|
|
public class ReportQualityInspectionServices : BaseServices<ReportQualityInsPection>, IReportQualityInspectionServices
|
|
{
|
|
private readonly IBaseRepository<ReportQualityInsPection> _dal;
|
|
private readonly IReportQualityInspectionRepository _baseSpaceInfoRepository;
|
|
private readonly ICodeBindingRecordRepository _codeBindingRecordRepository;
|
|
public ReportQualityInspectionServices(IBaseRepository<ReportQualityInsPection> dal, IReportQualityInspectionRepository reportQualityInspectionRepository, ICodeBindingRecordRepository codeBindingRepository)
|
|
{
|
|
_baseSpaceInfoRepository = reportQualityInspectionRepository;
|
|
_codeBindingRecordRepository = codeBindingRepository;
|
|
this._dal = dal;
|
|
base.BaseDal = dal;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 判断是否有不合格质检项,传入的是SN码
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
public List<ReportQualityInsPection> JudgeIsQualified(string SnCode)
|
|
{
|
|
try
|
|
{
|
|
string boxCode = _codeBindingRecordRepository.Query(s => s.ProductCode == SnCode).FirstOrDefault().BoxCode;
|
|
var list = _baseSpaceInfoRepository.Query(x=>x.BarCode.Equals(boxCode) && x.IsFlag!=1);
|
|
return list;
|
|
|
|
}
|
|
catch (System.Exception ex)
|
|
{
|
|
Console.WriteLine(ex.Message);
|
|
return null;
|
|
}
|
|
}
|
|
}
|
|
} |