93 lines
3.1 KiB
C#
93 lines
3.1 KiB
C#
using System;
|
|
using SqlSugar;
|
|
using Infrastructure.Attribute;
|
|
using Infrastructure.Extensions;
|
|
using ZR.Model;
|
|
using ZR.Model.Dto;
|
|
using ZR.Model.Business;
|
|
using ZR.Repository;
|
|
using ZR.Service.Business.IBusinessService;
|
|
using System.Linq;
|
|
|
|
namespace ZR.Service.Business
|
|
{
|
|
/// <summary>
|
|
/// 质量GP12工单缺陷项记录Service业务层处理
|
|
/// </summary>
|
|
[AppService(ServiceType = typeof(IQcGp12RecordWorkorderDefectService), ServiceLifetime = LifeTime.Transient)]
|
|
public class QcGp12RecordWorkorderDefectService : BaseService<QcGp12RecordWorkorderDefect>, IQcGp12RecordWorkorderDefectService
|
|
{
|
|
/// <summary>
|
|
/// 查询质量GP12工单缺陷项记录列表
|
|
/// </summary>
|
|
/// <param name="parm"></param>
|
|
/// <returns></returns>
|
|
public PagedInfo<QcGp12RecordWorkorderDefectDto> GetList(QcGp12RecordWorkorderDefectQueryDto parm)
|
|
{
|
|
var predicate = Expressionable.Create<QcGp12RecordWorkorderDefect>();
|
|
|
|
var response = Queryable()
|
|
.Where(predicate.ToExpression())
|
|
.ToPage<QcGp12RecordWorkorderDefect, QcGp12RecordWorkorderDefectDto>(parm);
|
|
|
|
return response;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取详情
|
|
/// </summary>
|
|
/// <param name="Id"></param>
|
|
/// <returns></returns>
|
|
public QcGp12RecordWorkorderDefect GetInfo(string Id)
|
|
{
|
|
var response = Queryable()
|
|
.Where(x => x.Id == Id)
|
|
.First();
|
|
|
|
return response;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加质量GP12工单缺陷项记录
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public QcGp12RecordWorkorderDefect AddQcGp12RecordWorkorderDefect(QcGp12RecordWorkorderDefect model)
|
|
{
|
|
return Context.Insertable(model).ExecuteReturnEntity();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改质量GP12工单缺陷项记录
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public int UpdateQcGp12RecordWorkorderDefect(QcGp12RecordWorkorderDefect model)
|
|
{
|
|
//var response = Update(w => w.Id == model.Id, it => new QcGp12RecordWorkorderDefect()
|
|
//{
|
|
// WorkOrder = model.WorkOrder,
|
|
// PartNumber = model.PartNumber,
|
|
// Team = model.Team,
|
|
// SiteNo = model.SiteNo,
|
|
// ComNo = model.ComNo,
|
|
// DefectCode = model.DefectCode,
|
|
// DefectName = model.DefectName,
|
|
// DefectType = model.DefectType,
|
|
// DefectNum = model.DefectNum,
|
|
// ClickTime = model.ClickTime,
|
|
// Type = model.Type,
|
|
// Status = model.Status,
|
|
// Remark = model.Remark,
|
|
// CreatedBy = model.CreatedBy,
|
|
// CreatedTime = model.CreatedTime,
|
|
// UpdatedBy = model.UpdatedBy,
|
|
// UpdatedTime = model.UpdatedTime,
|
|
//});
|
|
//return response;
|
|
return Update(model, true);
|
|
}
|
|
|
|
}
|
|
} |