using SlnMesnac.Model.domain; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace SlnMesnac.Repository.service.Impl { public class McsMaterialInfoServiceImpl : IMcsMaterialInfoService { private readonly Repository _rep; public McsMaterialInfoServiceImpl(Repository rep) { _rep = rep; } /// /// 根据物料代码获取物料信息 /// /// /// /// public McsMaterialInfo GetMcsMaterialInfoByMatCode(string MatCode) { try { //return _rep.GetList(x => x.MatCode == MatCode).OrderByDescending(x => x.WriteTime).First(); return _rep.GetFirst(x => x.MatCode == MatCode); } catch (Exception e) { throw new ArgumentException($"根据物料代码获取物料信息异常:{e.Message}"); } } /// /// 获取MCS物料信息 /// /// /// public List GetMcsMaterialInfoList() { try { return _rep.GetList(); } catch (Exception e) { throw new ArgumentException($"获取MCS物料信息异常:{e.Message}"); } } } }