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.

41 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using SlnMesnac.Model.domain;
namespace SlnMesnac.Repository.service.Impl
{
public class CwssBinToMaterServiceImpl:ICwssBinToMaterService
{
private readonly Repository<CwssBinToMater> _rep;
public CwssBinToMaterServiceImpl(Repository<CwssBinToMater> rep)
{
_rep = rep;
}
public List<CwssBinToMater> GetCwssBinToMaterList()
{
try
{
return _rep.GetList();
}
catch (Exception e)
{
throw new ArgumentException($"获取料仓物料对应信息异常:{e.Message}");
}
}
public CwssBinToMater GetCwssBinToMaterByBinNo(int EquipId, string BinNo)
{
try
{
//return _rep.GetFirst(x=>x.ScaleNum == 101 && x.EquipId == EquipId && x.BinNo == BinNo);
return _rep.GetFirst(x => (x.EquipCode.ToString()+x.BinSerial.ToString()) == BinNo);
}
catch (Exception e)
{
throw new ArgumentException($"根据设备编号、料罐编号获取料仓物料对应信息异常:{e.Message}");
}
}
}
}