using DOAN.Model.MES.api.Dto;
using DOAN.Model.MES.base_;
using DOAN.Service.MES.base_.IService;
using Infrastructure.Attribute;
namespace DOAN.Service.MES.base_
{
///
/// 工艺路线Service业务层处理
///
[AppService(ServiceType = typeof(IBaseLineCodeService), ServiceLifetime = LifeTime.Transient)]
public class BaseLineCodeService : BaseService, IBaseLineCodeService
{
public List GetLineCodeOptions(RestLineCodeDto parm)
{
try
{
var predicate = Expressionable
.Create()
.AndIF(!string.IsNullOrEmpty(parm.Name), it => it.Name.Contains(parm.Name))
.AndIF(!string.IsNullOrEmpty(parm.Code), it => it.Code.Contains(parm.Code))
.AndIF(parm.Status > -1, it => it.Status == parm.Status);
var response = Queryable()
.Where(predicate.ToExpression())
.Select(it => new RestLineCodeDto
{
Name = it.Name,
Code = it.Code,
Remark = it.Remark,
Status = it.Status,
})
.ToList();
return response;
}
catch (Exception)
{
throw;
}
}
}
}