96 lines
3.5 KiB
C#
96 lines
3.5 KiB
C#
using DOAN.Model;
|
|
using DOAN.Model.MES.quality.FQC;
|
|
using DOAN.Model.MES.quality.FQC.Dto;
|
|
using DOAN.Repository;
|
|
using DOAN.Service.MES.quality.FQC.IService;
|
|
using Infrastructure.Attribute;
|
|
|
|
namespace DOAN.Service.MES.quality.FQC
|
|
{
|
|
/// <summary>
|
|
/// 最终检验Service业务层处理
|
|
/// </summary>
|
|
[AppService(ServiceType = typeof(IQcFinalInspectionService), ServiceLifetime = LifeTime.Transient)]
|
|
public class QcFinalInspectionService : BaseService<QcFinalInspection>, IQcFinalInspectionService
|
|
{
|
|
/// <summary>
|
|
/// 查询最终检验列表
|
|
/// </summary>
|
|
/// <param name="parm"></param>
|
|
/// <returns></returns>
|
|
public PagedInfo<QcFinalInspectionDto> GetList(QcFinalInspectionQueryDto parm)
|
|
{
|
|
var predicate = Expressionable.Create<QcFinalInspection>()
|
|
.AndIF(!string.IsNullOrEmpty(parm.FkWorkorder), it => it.FkWorkorder.Contains(parm.FkWorkorder))
|
|
.AndIF(!string.IsNullOrEmpty(parm.ProductCode), it => it.ProductCode.Contains(parm.ProductCode))
|
|
.AndIF(!string.IsNullOrEmpty(parm.ParamterName), it => it.ParamterName.Contains(parm.ParamterName))
|
|
.AndIF(parm.CheckResult != 0, it => it.CheckResult == parm.CheckResult)
|
|
;
|
|
|
|
var response = Queryable()
|
|
.Where(predicate.ToExpression())
|
|
.ToPage<QcFinalInspection, QcFinalInspectionDto>(parm);
|
|
|
|
return response;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取详情
|
|
/// </summary>
|
|
/// <param name="Id"></param>
|
|
/// <returns></returns>
|
|
public QcFinalInspection GetInfo(int Id)
|
|
{
|
|
var response = Queryable()
|
|
.Where(x => x.Id == Id)
|
|
.First();
|
|
|
|
return response;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加最终检验
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public QcFinalInspection AddQcFinalInspection(QcFinalInspection model)
|
|
{
|
|
return Context.Insertable(model).ExecuteReturnEntity();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改最终检验
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
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);
|
|
}
|
|
|
|
}
|
|
} |