100 lines
3.6 KiB
C#
100 lines
3.6 KiB
C#
|
|
using Infrastructure.Attribute;
|
|
|
|
using DOAN.Model;
|
|
|
|
using DOAN.Repository;
|
|
using DOAN.Service.MES.quality.FAI.IService;
|
|
using DOAN.Model.MES.quality.FAI;
|
|
using DOAN.Model.MES.quality.FAI.Dto;
|
|
|
|
|
|
namespace DOAN.Service.MES.quality.FAI
|
|
{
|
|
/// <summary>
|
|
/// 首件检验Service业务层处理
|
|
/// </summary>
|
|
[AppService(ServiceType = typeof(IQcFirstarticleInspectionService), ServiceLifetime = LifeTime.Transient)]
|
|
public class QcFirstarticleInspectionService : BaseService<QcFirstarticleInspection>, IQcFirstarticleInspectionService
|
|
{
|
|
/// <summary>
|
|
/// 查询首件检验列表
|
|
/// </summary>
|
|
/// <param name="parm"></param>
|
|
/// <returns></returns>
|
|
public PagedInfo<QcFirstarticleInspectionDto> GetList(QcFirstarticleInspectionQueryDto parm)
|
|
{
|
|
var predicate = Expressionable.Create<QcFirstarticleInspection>()
|
|
.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<QcFirstarticleInspection, QcFirstarticleInspectionDto>(parm);
|
|
|
|
return response;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取详情
|
|
/// </summary>
|
|
/// <param name="Id"></param>
|
|
/// <returns></returns>
|
|
public QcFirstarticleInspection GetInfo(int Id)
|
|
{
|
|
var response = Queryable()
|
|
.Where(x => x.Id == Id)
|
|
.First();
|
|
|
|
return response;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加首件检验
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public QcFirstarticleInspection AddQcFirstarticleInspection(QcFirstarticleInspection model)
|
|
{
|
|
return Context.Insertable(model).ExecuteReturnEntity();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改首件检验
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public int UpdateQcFirstarticleInspection(QcFirstarticleInspection model)
|
|
{
|
|
//var response = Update(w => w.Id == model.Id, it => new QcFirstarticleInspection()
|
|
//{
|
|
// 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);
|
|
}
|
|
|
|
}
|
|
} |