2025-11-29 15:25:53 +08:00

82 lines
2.7 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Infrastructure.Attribute;
using Infrastructure.Extensions;
using RIZO.Model.Mes.Dto.ProductionPreparation;
using RIZO.Model.Mes.ProductionPreparation;
using RIZO.Repository;
using RIZO.Service.Mes.IMesService.ProductionPreparation;
namespace RIZO.Service.Mes.ProductionPreparation
{
/// <summary>
/// 质量控制从表存储具体检查参数明细Service业务层处理
/// </summary>
[AppService(ServiceType = typeof(IQualityControlDetailService), ServiceLifetime = LifeTime.Transient)]
public class QualityControlDetailService : BaseService<QualityControlDetail>, IQualityControlDetailService
{
/// <summary>
/// 查询质量控制从表(存储具体检查参数明细)列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
public PagedInfo<QualityControlDetailDto> GetList(QualityControlDetailQueryDto parm)
{
var predicate = QueryExp(parm);
var response = Queryable()
.Where(predicate.ToExpression())
.ToPage<QualityControlDetail, QualityControlDetailDto>(parm);
return response;
}
/// <summary>
/// 获取详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public QualityControlDetail GetInfo(long Id)
{
var response = Queryable()
.Where(x => x.Id == Id)
.First();
return response;
}
/// <summary>
/// 添加质量控制从表(存储具体检查参数明细)
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public QualityControlDetail AddQualityControlDetail(QualityControlDetail model)
{
return Insertable(model).ExecuteReturnEntity();
}
/// <summary>
/// 修改质量控制从表(存储具体检查参数明细)
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public int UpdateQualityControlDetail(QualityControlDetail model)
{
return Update(model, true);
}
/// <summary>
/// 查询导出表达式
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
private static Expressionable<QualityControlDetail> QueryExp(QualityControlDetailQueryDto parm)
{
var predicate = Expressionable.Create<QualityControlDetail>();
if (parm.QcCode != null && parm.QcCode.ToString().Length > 0)
{
predicate.And(it => it.QcCode == parm.QcCode);
}
return predicate;
}
}
}