using System;
using SqlSugar;
using Infrastructure.Attribute;
using Infrastructure.Extensions;
using DOAN.Model;
using DOAN.Model.Dto;
using DOAN.Model.Business;
using DOAN.Repository;
using DOAN.Service.Business.IBusinessService;
using System.Linq;
namespace DOAN.Service.Business
{
///
/// 最终检验Service业务层处理
///
[AppService(ServiceType = typeof(IQcFinalInspectionService), ServiceLifetime = LifeTime.Transient)]
public class QcFinalInspectionService : BaseService, IQcFinalInspectionService
{
///
/// 查询最终检验列表
///
///
///
public PagedInfo GetList(QcFinalInspectionQueryDto parm)
{
var predicate = Expressionable.Create();
var response = Queryable()
.Where(predicate.ToExpression())
.ToPage(parm);
return response;
}
///
/// 获取详情
///
///
///
public QcFinalInspection GetInfo(int Id)
{
var response = Queryable()
.Where(x => x.Id == Id)
.First();
return response;
}
///
/// 添加最终检验
///
///
///
public QcFinalInspection AddQcFinalInspection(QcFinalInspection model)
{
return Context.Insertable(model).ExecuteReturnEntity();
}
///
/// 修改最终检验
///
///
///
public int UpdateQcFinalInspection(QcFinalInspection model)
{
//var response = Update(w => w.Id == model.Id, it => new QcFinalInspection()
//{
// FkWorkorder = model.FkWorkorder,
// FactoryCode = model.FactoryCode,
// LineCode = model.LineCode,
// MachineCode = model.MachineCode,
// ProductCode = model.ProductCode,
// Productname = model.Productname,
// SNnumber = model.SNnumber,
// ParamterName = model.ParamterName,
// StandardParamterValue = model.StandardParamterValue,
// RealParamterValue = model.RealParamterValue,
// UpRangeLimit = model.UpRangeLimit,
// LowRangeLimit = model.LowRangeLimit,
// Unit = model.Unit,
// CheckResult = model.CheckResult,
// ParamTime = model.ParamTime,
// Createdby = model.Createdby,
// Updatedby = model.Updatedby,
// CreatedTime = model.CreatedTime,
// UpdatedTime = model.UpdatedTime,
//});
//return response;
return Update(model, true);
}
}
}