using System; using System.Collections.Generic; using SlnMesnac.Model.domain; namespace SlnMesnac.Repository.service.Impl { public class CwssBinToMaterServiceImpl:ICwssBinToMaterService { private readonly Repository _rep; public CwssBinToMaterServiceImpl(Repository rep) { _rep = rep; } public List 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}"); } } } }