95 lines
2.8 KiB
C#
95 lines
2.8 KiB
C#
using Aliyun.OSS;
|
|
using Infrastructure.Attribute;
|
|
using Infrastructure.Extensions;
|
|
using RIZO.Model.Mes.Dto.Process;
|
|
using RIZO.Model.Mes.Process;
|
|
using RIZO.Repository;
|
|
using RIZO.Service.Mes.IMesService.Process;
|
|
using System;
|
|
|
|
namespace RIZO.Service.Mes.Process
|
|
{
|
|
/// <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;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 通过工艺路线编码获取工序详情
|
|
/// </summary>
|
|
/// <param name="processCode"></param>
|
|
/// <returns></returns>
|
|
public PagedInfo<OperationInfoDto> GetOperationInfoByProcessCode(OperationInfoQueryDto parm)
|
|
{
|
|
string processCode = parm.processCode;
|
|
var response = Queryable()
|
|
.Where(it => it.ProcessCode == processCode)
|
|
.ToPage<OperationInfo, OperationInfoDto>(parm);
|
|
return response;
|
|
}
|
|
}
|
|
} |