102 lines
3.3 KiB
C#
102 lines
3.3 KiB
C#
using DOAN.Model;
|
|
using DOAN.Model.Dto;
|
|
using DOAN.Model.MES.process;
|
|
using DOAN.Model.MES.process.Dto;
|
|
using DOAN.Repository;
|
|
using DOAN.Service.Business.IBusinessService;
|
|
using Infrastructure.Attribute;
|
|
using Infrastructure.Extensions;
|
|
using SqlSugar;
|
|
using System;
|
|
using System.Linq;
|
|
using static DOAN.Model.Dto.ProModelProcessDto;
|
|
|
|
namespace DOAN.Service.Business
|
|
{
|
|
/// <summary>
|
|
/// 工艺建模工序表Service业务层处理
|
|
/// </summary>
|
|
[AppService(ServiceType = typeof(IProModelProcessService), ServiceLifetime = LifeTime.Transient)]
|
|
public class ProModelProcessService : BaseService<ProModelProcess>, IProModelProcessService
|
|
{
|
|
/// <summary>
|
|
/// 查询工艺建模工序表列表
|
|
/// </summary>
|
|
/// <param name="parm"></param>
|
|
/// <returns></returns>
|
|
public PagedInfo<ProModelProcessDto> GetList(ProModelProcessQueryDto parm)
|
|
{
|
|
var predicate = Expressionable.Create<ProModelProcess>();
|
|
|
|
var response = Queryable()
|
|
.Where(predicate.ToExpression())
|
|
.ToPage<ProModelProcess, ProModelProcessDto>(parm);
|
|
|
|
return response;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取详情
|
|
/// </summary>
|
|
/// <param name="Id"></param>
|
|
/// <returns></returns>
|
|
public ProModelProcess GetInfo(long Id)
|
|
{
|
|
var response = Queryable()
|
|
.Where(x => x.Id == Id)
|
|
.First();
|
|
|
|
return response;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加工艺建模工序表
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public ProModelProcess AddProModelProcess(ProModelProcess model)
|
|
{
|
|
return Context.Insertable(model).ExecuteReturnEntity();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改工艺建模工序表
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public int UpdateProModelProcess(ProModelProcess model)
|
|
{
|
|
//var response = Update(w => w.Id == model.Id, it => new ProModelProcess()
|
|
//{
|
|
// ProcessCode = model.ProcessCode,
|
|
// ProcessName = model.ProcessName,
|
|
// ProcessSeq = model.ProcessSeq,
|
|
// WorkCenter = model.WorkCenter,
|
|
// StandardTime = model.StandardTime,
|
|
// Description = model.Description,
|
|
// IsActive = model.IsActive,
|
|
// UpdateTime = model.UpdateTime,
|
|
// UpdateBy = model.UpdateBy,
|
|
// Remark = model.Remark,
|
|
//});
|
|
//return response;
|
|
return Update(model, true);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 获取工艺路线表
|
|
/// </summary>
|
|
public List<RoutingParentListDto> GetModelRoutingList()
|
|
{
|
|
var response = Context.Queryable<ProModelRouting>()
|
|
.Select(p => new RoutingListDto
|
|
{
|
|
RoutingCode = p.RoutingCode,
|
|
RoutingName = p.RoutingName,
|
|
})
|
|
.ToList();
|
|
return response;
|
|
}
|
|
}
|
|
} |