using Infrastructure.Attribute;
using SqlSugar;
using ZR.Model;
using ZR.Model.MES.wms;
using ZR.Model.MES.wms.Dto;
using ZR.Repository;
using ZR.Service.mes.wms.IService;
namespace ZR.Service.mes.wms
{
///
/// 后道检验工单表Service业务层处理
///
[AppService(ServiceType = typeof(IWmPolishInspectionWorkorderService), ServiceLifetime = LifeTime.Transient)]
public class WmPolishInspectionWorkorderService : BaseService, IWmPolishInspectionWorkorderService
{
///
/// 查询后道检验工单表列表
///
///
///
public PagedInfo GetList(WmPolishInspectionWorkorderQueryDto parm)
{
var predicate = Expressionable.Create();
var response = Queryable()
.Where(predicate.ToExpression())
.ToPage(parm);
return response;
}
///
/// 获取详情
///
///
///
public WmPolishInspectionWorkorder GetInfo(string Id)
{
var response = Queryable()
.Where(x => x.Id == Id)
.First();
return response;
}
///
/// 添加后道检验工单表
///
///
///
public WmPolishInspectionWorkorder AddWmPolishInspectionWorkorder(WmPolishInspectionWorkorder model)
{
return Context.Insertable(model).ExecuteReturnEntity();
}
///
/// 修改后道检验工单表
///
///
///
public int UpdateWmPolishInspectionWorkorder(WmPolishInspectionWorkorder model)
{
//var response = Update(w => w.Id == model.Id, it => new WmPolishInspectionWorkorder()
//{
// WorkorderNo = model.WorkorderNo,
// Partnumber = model.Partnumber,
// BlankNum = model.BlankNum,
// Quantity = model.Quantity,
// PassNum = model.PassNum,
// PolishNum = model.PolishNum,
// SandingNum = model.SandingNum,
// DiscardNum = model.DiscardNum,
// StartTime = model.StartTime,
// EndTime = model.EndTime,
// Type = model.Type,
// Remark = model.Remark,
// IsSend = model.IsSend,
// Status = model.Status,
// UpdatedBy = model.UpdatedBy,
// UpdatedTime = model.UpdatedTime,
// CreatedBy = model.CreatedBy,
// CreatedTime = model.CreatedTime,
//});
//return response;
return Update(model, true);
}
}
}