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.

55 lines
1.8 KiB
C#

using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Extensions.Logging;
using SlnMesnac.Model.domain;
namespace SlnMesnac.Repository.service.Impl
{
public class McsBinToMaterServiceImpl:IMcsBinToMaterService
{
private readonly Repository<McsBinToMater> _rep;
public McsBinToMaterServiceImpl(Repository<McsBinToMater> rep)
{
_rep = rep;
}
/// <summary>
/// 获取大料料罐物料对应信息
/// </summary>
/// <returns></returns>
/// <exception cref="ArgumentException"></exception>
public List<McsBinToMater> GetMcsBinToMaterList()
{
try
{
return _rep.GetList();;
}
catch (Exception e)
{
throw new ArgumentException($"获取料仓物料对应信息异常:{e.Message}");
}
}
/// <summary>
/// 通过机台编号、料罐编号获取料罐物料对应信息
/// </summary>
/// <param name="EquipId"></param>
/// <param name="BinNo"></param>
/// <returns></returns>
/// <exception cref="ArgumentException"></exception>
public McsBinToMater GetMcsBinToMaterByBinNo(int EquipId, string BinNo)
{
try
{
//return _rep.GetFirst(x=>x.ScaleNum == 101 && x.EquipId == EquipId && x.BinNo == BinNo);
return _rep.GetFirst(x => x.EquipId.ToString()+x.ScaleNum.ToString()+x.BinNo.ToString() == BinNo);
}
catch (Exception e)
{
throw new ArgumentException($"根据设备编号、料罐编号获取料仓物料对应信息异常:{e.Message}");
}
}
}
}