using Aucma.Scada.Model.domain; using HighWayIot.Log4net; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace HighWayIot.Repository.service.Impl { public class BaseMaterialInfoServiceImpl : IBaseMaterialInfoService { Repository _baseMaterialInfo => new Repository("mes"); private LogHelper logHelper = LogHelper.Instance; public List getAllInfos() { try { var info = _baseMaterialInfo.GetList(x => x.MaterialSubclass == "200"); return info; } catch (Exception ex) { logHelper.Error("获取集合异常", ex); return null; } } /// /// 获取箱壳和内胆部件 /// /// public List getShellAndLiner() { try { var info = _baseMaterialInfo.GetList(x => x.MaterialSubclass == "200" || x.MaterialSubclass == "500"); return info; } catch (Exception ex) { logHelper.Error("获取集合异常", ex); return null; } } // 根据型号找到物料 public BaseMaterialInfo GetMaterialInfoByType(string materialType) { BaseMaterialInfo materialInfo = null; materialInfo = _baseMaterialInfo.GetFirst(x=>x.MaterialCode==materialType); return materialInfo; } } }