79 lines
2.2 KiB
C#
79 lines
2.2 KiB
C#
using Infrastructure.Attribute;
|
|
using Infrastructure.Extensions;
|
|
using RIZO.Model.Business.Dto;
|
|
using RIZO.Model.Business;
|
|
using RIZO.Repository;
|
|
using RIZO.Service.Business.IBusinessService;
|
|
|
|
namespace RIZO.Service.Business
|
|
{
|
|
/// <summary>
|
|
/// 工序表Service业务层处理
|
|
/// </summary>
|
|
[AppService(ServiceType = typeof(IOperationInfoService), ServiceLifetime = LifeTime.Transient)]
|
|
public class OperationInfoService : BaseService<OperationInfo>, IOperationInfoService
|
|
{
|
|
/// <summary>
|
|
/// 查询工序表列表
|
|
/// </summary>
|
|
/// <param name="parm"></param>
|
|
/// <returns></returns>
|
|
public PagedInfo<OperationInfoDto> GetList(OperationInfoQueryDto parm)
|
|
{
|
|
var predicate = QueryExp(parm);
|
|
|
|
var response = Queryable()
|
|
.Where(predicate.ToExpression())
|
|
.ToPage<OperationInfo, OperationInfoDto>(parm);
|
|
|
|
return response;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取详情
|
|
/// </summary>
|
|
/// <param name="Id"></param>
|
|
/// <returns></returns>
|
|
public OperationInfo GetInfo(long Id)
|
|
{
|
|
var response = Queryable()
|
|
.Where(x => x.Id == Id)
|
|
.First();
|
|
|
|
return response;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加工序表
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public OperationInfo AddOperationInfo(OperationInfo model)
|
|
{
|
|
return Insertable(model).ExecuteReturnEntity();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改工序表
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public int UpdateOperationInfo(OperationInfo model)
|
|
{
|
|
return Update(model, true);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 查询导出表达式
|
|
/// </summary>
|
|
/// <param name="parm"></param>
|
|
/// <returns></returns>
|
|
private static Expressionable<OperationInfo> QueryExp(OperationInfoQueryDto parm)
|
|
{
|
|
var predicate = Expressionable.Create<OperationInfo>();
|
|
|
|
return predicate;
|
|
}
|
|
}
|
|
} |