82 lines
2.7 KiB
C#
82 lines
2.7 KiB
C#
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;
|
||
}
|
||
}
|
||
} |