84 lines
2.9 KiB
C#
84 lines
2.9 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(IProcessOperationReworkRuleService), ServiceLifetime = LifeTime.Transient)]
|
|
public class ProcessOperationReworkRuleService : BaseService<ProcessOperationReworkRule>, IProcessOperationReworkRuleService
|
|
{
|
|
/// <summary>
|
|
/// 查询工序返工规则列表
|
|
/// </summary>
|
|
/// <param name="parm"></param>
|
|
/// <returns></returns>
|
|
public PagedInfo<ProcessOperationReworkRuleDto> GetList(ProcessOperationReworkRuleQueryDto parm)
|
|
{
|
|
var predicate = Expressionable.Create<ProcessOperationReworkRule>();
|
|
|
|
var response = Queryable()
|
|
.Where(predicate.ToExpression())
|
|
.ToPage<ProcessOperationReworkRule, ProcessOperationReworkRuleDto>(parm);
|
|
|
|
return response;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取详情
|
|
/// </summary>
|
|
/// <param name="ReworkRuleId"></param>
|
|
/// <returns></returns>
|
|
public ProcessOperationReworkRule GetInfo(int ReworkRuleId)
|
|
{
|
|
var response = Queryable()
|
|
.Where(x => x.ReworkRuleId == ReworkRuleId)
|
|
.First();
|
|
|
|
return response;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加工序返工规则
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public ProcessOperationReworkRule AddProcessOperationReworkRule(ProcessOperationReworkRule model)
|
|
{
|
|
return Context.Insertable(model).ExecuteReturnEntity();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改工序返工规则
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public int UpdateProcessOperationReworkRule(ProcessOperationReworkRule model)
|
|
{
|
|
//var response = Update(w => w.ReworkRuleId == model.ReworkRuleId, it => new ProcessOperationReworkRule()
|
|
//{
|
|
// FkRoutingCode = model.FkRoutingCode,
|
|
// FkOperationCode = model.FkOperationCode,
|
|
// IsReworkAllowed = model.IsReworkAllowed,
|
|
// MaxReworkTimes = model.MaxReworkTimes,
|
|
// ReworkTargetOperationCode = model.ReworkTargetOperationCode,
|
|
// ReworkCondition = model.ReworkCondition,
|
|
// Description = model.Description,
|
|
// CreatedBy = model.CreatedBy,
|
|
// CreatedTime = model.CreatedTime,
|
|
// UpdatedBy = model.UpdatedBy,
|
|
// UpdatedTime = model.UpdatedTime,
|
|
//});
|
|
//return response;
|
|
return Update(model, true);
|
|
}
|
|
|
|
}
|
|
} |