using DOAN.Model.MES.base_; using DOAN.Model.MES.base_.Dto; using DOAN.Model.MES.product; using DOAN.Service.MES.product.IService; using Infrastructure.Attribute; namespace DOAN.Service.MES.product { /// /// 工单参考数据服务 /// [AppService( ServiceType = typeof(IProWorkorderReferenceService), ServiceLifetime = LifeTime.Transient )] public class ProWorkorderReferenceService : BaseService, IProWorkorderReferenceService { /// /// 获取物料信息 /// /// /// public List GetMaterialInfo(BaseMaterialListQueryDto5 parm) { var predicate = Expressionable .Create() .OrIF( !string.IsNullOrEmpty(parm.Name_or_Code), it => it.Name.Contains(parm.Name_or_Code) ) .OrIF( !string.IsNullOrEmpty(parm.Name_or_Code), it => it.Code.Contains(parm.Name_or_Code) ); return Context .Queryable() .Where(predicate.ToExpression()) .Take(20) .ToList(); } /// /// 获取客户信息 /// /// /// public List GetCustomInfo(BaseCustomQueryDto2 parm) { var predicate = Expressionable .Create() .AndIF( !string.IsNullOrEmpty(parm.CustomNo), it => it.CustomNo.Contains(parm.CustomNo) ) .And(it => it.Status == 1); var response = Context .Queryable() .Where(predicate.ToExpression()) .OrderBy(it => it.CustomNo) .Take(20) .ToList(); return response; } /// /// 获取工艺路线 /// /// /// public List GetProcessRoute(DateTime dateTime) { throw new NotImplementedException(); } /// /// 获取全部工艺路线 /// /// public List GetAllRoute() { var result = Context.Queryable().Where(it => it.Status == 1).ToList(); return result; } /// /// 获取班组 /// /// public List GetGroupList() { var result = Context.Queryable().Where(it => it.Status == 1).ToList(); return result; } } }