84 lines
2.7 KiB
C#
84 lines
2.7 KiB
C#
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
|
|
{
|
|
/// <summary>
|
|
/// 终检结果详情Service业务层处理
|
|
/// </summary>
|
|
[AppService(ServiceType = typeof(IQcFinalInspectionResultService), ServiceLifetime = LifeTime.Transient)]
|
|
public class QcFinalInspectionResultService : BaseService<QcFinalInspectionResult>, IQcFinalInspectionResultService
|
|
{
|
|
/// <summary>
|
|
/// 查询终检结果详情列表
|
|
/// </summary>
|
|
/// <param name="parm"></param>
|
|
/// <returns></returns>
|
|
public PagedInfo<QcFinalInspectionResultDto> GetList(QcFinalInspectionResultQueryDto parm)
|
|
{
|
|
var predicate = Expressionable.Create<QcFinalInspectionResult>();
|
|
|
|
var response = Queryable()
|
|
.Where(predicate.ToExpression())
|
|
.ToPage<QcFinalInspectionResult, QcFinalInspectionResultDto>(parm);
|
|
|
|
return response;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取详情
|
|
/// </summary>
|
|
/// <param name="Id"></param>
|
|
/// <returns></returns>
|
|
public QcFinalInspectionResult GetInfo(int Id)
|
|
{
|
|
var response = Queryable()
|
|
.Where(x => x.Id == Id)
|
|
.First();
|
|
|
|
return response;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加终检结果详情
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public QcFinalInspectionResult AddQcFinalInspectionResult(QcFinalInspectionResult model)
|
|
{
|
|
return Context.Insertable(model).ExecuteReturnEntity();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改终检结果详情
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public int UpdateQcFinalInspectionResult(QcFinalInspectionResult model)
|
|
{
|
|
//var response = Update(w => w.Id == model.Id, it => new QcFinalInspectionResult()
|
|
//{
|
|
// Workorder = model.Workorder,
|
|
// Direction = model.Direction,
|
|
// QualifiedQuantity = model.QualifiedQuantity,
|
|
// UnqualifiedQuantiy = model.UnqualifiedQuantiy,
|
|
// CreatedBy = model.CreatedBy,
|
|
// CreatedTime = model.CreatedTime,
|
|
// UpdatedBy = model.UpdatedBy,
|
|
// UpdatedTime = model.UpdatedTime,
|
|
//});
|
|
//return response;
|
|
return Update(model, true);
|
|
}
|
|
|
|
}
|
|
} |