82 lines
2.6 KiB
C#
82 lines
2.6 KiB
C#
|
|
|
||
|
|
using Infrastructure.Attribute;
|
||
|
|
using MES_Model.Model;
|
||
|
|
using MES_Model.Model.Process;
|
||
|
|
using MES_Model.Model.Process.Dto;
|
||
|
|
using MES_Model.Service;
|
||
|
|
using MES_Model.Services.IProcessService;
|
||
|
|
namespace MES_Model.Services.Process
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// 工艺路线Service业务层处理
|
||
|
|
/// </summary>
|
||
|
|
[AppService(ServiceType = typeof(IProcessRoutingService), ServiceLifetime = LifeTime.Transient)]
|
||
|
|
public class ProcessRoutingService : BaseService<ProcessRouting>, IProcessRoutingService
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// 查询工艺路线列表
|
||
|
|
/// </summary>
|
||
|
|
/// <param name="parm"></param>
|
||
|
|
/// <returns></returns>
|
||
|
|
public PagedInfo<ProcessRoutingDto> GetList(ProcessRoutingQueryDto parm)
|
||
|
|
{
|
||
|
|
var predicate = Expressionable.Create<ProcessRouting>();
|
||
|
|
|
||
|
|
var response = Queryable()
|
||
|
|
.Where(predicate.ToExpression())
|
||
|
|
.ToPage<ProcessRouting, ProcessRoutingDto>(parm);
|
||
|
|
|
||
|
|
return response;
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 获取详情
|
||
|
|
/// </summary>
|
||
|
|
/// <param name="RoutingId"></param>
|
||
|
|
/// <returns></returns>
|
||
|
|
public ProcessRouting GetInfo(int RoutingId)
|
||
|
|
{
|
||
|
|
var response = Queryable()
|
||
|
|
.Where(x => x.RoutingId == RoutingId)
|
||
|
|
.First();
|
||
|
|
|
||
|
|
return response;
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 添加工艺路线
|
||
|
|
/// </summary>
|
||
|
|
/// <param name="model"></param>
|
||
|
|
/// <returns></returns>
|
||
|
|
public ProcessRouting AddProcessRouting(ProcessRouting model)
|
||
|
|
{
|
||
|
|
return Context.Insertable(model).ExecuteReturnEntity();
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// 修改工艺路线
|
||
|
|
/// </summary>
|
||
|
|
/// <param name="model"></param>
|
||
|
|
/// <returns></returns>
|
||
|
|
public int UpdateProcessRouting(ProcessRouting model)
|
||
|
|
{
|
||
|
|
//var response = Update(w => w.RoutingId == model.RoutingId, it => new ProcessRouting()
|
||
|
|
//{
|
||
|
|
// FkProductMaterialCode = model.FkProductMaterialCode,
|
||
|
|
// RoutingName = model.RoutingName,
|
||
|
|
// Version = model.Version,
|
||
|
|
// Description = model.Description,
|
||
|
|
// Status = model.Status,
|
||
|
|
// EffectiveDate = model.EffectiveDate,
|
||
|
|
// CreatedBy = model.CreatedBy,
|
||
|
|
// CreatedTime = model.CreatedTime,
|
||
|
|
// UpdatedBy = model.UpdatedBy,
|
||
|
|
// UpdatedTime = model.UpdatedTime,
|
||
|
|
//});
|
||
|
|
//return response;
|
||
|
|
return Update(model, true);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|