92 lines
2.8 KiB
C#
92 lines
2.8 KiB
C#
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
|
|
{
|
|
/// <summary>
|
|
/// Service业务层处理
|
|
/// </summary>
|
|
[AppService(
|
|
ServiceType = typeof(IWmPolishWorkorderService),
|
|
ServiceLifetime = LifeTime.Transient
|
|
)]
|
|
public class WmPolishWorkorderService
|
|
: BaseService<WmPolishWorkorder>,
|
|
IWmPolishWorkorderService
|
|
{
|
|
/// <summary>
|
|
/// 查询列表
|
|
/// </summary>
|
|
/// <param name="parm"></param>
|
|
/// <returns></returns>
|
|
public PagedInfo<WmPolishWorkorderDto> GetList(WmPolishWorkorderQueryDto parm)
|
|
{
|
|
var predicate = Expressionable.Create<WmPolishWorkorder>();
|
|
|
|
var response = Queryable()
|
|
.Where(predicate.ToExpression())
|
|
.ToPage<WmPolishWorkorder, WmPolishWorkorderDto>(parm);
|
|
|
|
return response;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取详情
|
|
/// </summary>
|
|
/// <param name="Id"></param>
|
|
/// <returns></returns>
|
|
public WmPolishWorkorder GetInfo(string Id)
|
|
{
|
|
var response = Queryable().Where(x => x.Id == Id).First();
|
|
|
|
return response;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public WmPolishWorkorder AddWmPolishWorkorder(WmPolishWorkorder model)
|
|
{
|
|
return Context.Insertable(model).ExecuteReturnEntity();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public int UpdateWmPolishWorkorder(WmPolishWorkorder model)
|
|
{
|
|
//var response = Update(w => w.Id == model.Id, it => new WmPolishWorkorder()
|
|
//{
|
|
// WorkorderNo = model.WorkorderNo,
|
|
// Partnumber = model.Partnumber,
|
|
// BlankNum = model.BlankNum,
|
|
// Quantity = model.Quantity,
|
|
// PassNum = model.PassNum,
|
|
// 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);
|
|
}
|
|
}
|
|
}
|