Valeo_Line_MES_backend/MDM/Services/Recipe/PfRecipeTemplateService.cs
2026-01-10 13:47:54 +08:00

82 lines
2.3 KiB
C#

using Infrastructure.Attribute;
using Infrastructure.Extensions;
using MDM.Service;
using RIZO.Model;
using RIZO.Model.MES.recipe;
using RIZO.Model.MES.recipe.Dto;
using RIZO.Repository;
using RIZO.Service.MES.recipe.IService;
namespace RIZO.Service.MES.recipe
{
/// <summary>
/// 配方模板表Service业务层处理
/// </summary>
[AppService(ServiceType = typeof(IPfRecipeTemplateService), ServiceLifetime = LifeTime.Transient)]
public class PfRecipeTemplateService : BaseService<PfRecipeTemplate>, IPfRecipeTemplateService
{
/// <summary>
/// 查询配方模板表列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
public PagedInfo<PfRecipeTemplateDto> GetList(PfRecipeTemplateQueryDto parm)
{
var predicate = QueryExp(parm);
var response = Queryable()
.Where(predicate.ToExpression())
.OrderBy(x => x.Sequence)
.ToPage<PfRecipeTemplate, PfRecipeTemplateDto>(parm);
return response;
}
/// <summary>
/// 获取详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public PfRecipeTemplate GetInfo(int Id)
{
var response = Queryable()
.Where(x => x.Id == Id)
.First();
return response;
}
/// <summary>
/// 添加配方模板表
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public PfRecipeTemplate AddPfRecipeTemplate(PfRecipeTemplate model)
{
return Insertable(model).ExecuteReturnEntity();
}
/// <summary>
/// 修改配方模板表
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public int UpdatePfRecipeTemplate(PfRecipeTemplate model)
{
return Update(model, true);
}
/// <summary>
/// 查询导出表达式
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
private static Expressionable<PfRecipeTemplate> QueryExp(PfRecipeTemplateQueryDto parm)
{
var predicate = Expressionable.Create<PfRecipeTemplate>();
return predicate;
}
}
}