88 lines
2.9 KiB
C#
88 lines
2.9 KiB
C#
using System;
|
|
using SqlSugar;
|
|
using Infrastructure.Attribute;
|
|
|
|
using MES_Model.Services.IPlantService;
|
|
using MES_Model.Model.Business;
|
|
using MES_Model.Model.Dto;
|
|
using MES_Model.Service;
|
|
using MES_Model.Model;
|
|
|
|
namespace MES_Model.Services.Plant
|
|
{
|
|
/// <summary>
|
|
/// 工站/资源组Service业务层处理
|
|
/// </summary>
|
|
[AppService(ServiceType = typeof(IPlantWorkstationService), ServiceLifetime = LifeTime.Transient)]
|
|
public class PlantWorkstationService : BaseService<PlantWorkstation>, IPlantWorkstationService
|
|
{
|
|
/// <summary>
|
|
/// 查询工站/资源组列表
|
|
/// </summary>
|
|
/// <param name="parm"></param>
|
|
/// <returns></returns>
|
|
public PagedInfo<PlantWorkstationDto> GetList(PlantWorkstationQueryDto parm)
|
|
{
|
|
var predicate = Expressionable.Create<PlantWorkstation>();
|
|
|
|
var response = Queryable()
|
|
.Where(predicate.ToExpression())
|
|
.ToPage<PlantWorkstation, PlantWorkstationDto>(parm);
|
|
|
|
return response;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取详情
|
|
/// </summary>
|
|
/// <param name="WorkstationId"></param>
|
|
/// <returns></returns>
|
|
public PlantWorkstation GetInfo(int WorkstationId)
|
|
{
|
|
var response = Queryable()
|
|
.Where(x => x.WorkstationId == WorkstationId)
|
|
.First();
|
|
|
|
return response;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加工站/资源组
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public PlantWorkstation AddPlantWorkstation(PlantWorkstation model)
|
|
{
|
|
return Context.Insertable(model).ExecuteReturnEntity();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改工站/资源组
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public int UpdatePlantWorkstation(PlantWorkstation model)
|
|
{
|
|
//var response = Update(w => w.WorkstationId == model.WorkstationId, it => new PlantWorkstation()
|
|
//{
|
|
// FkFactorySiteCode = model.FkFactorySiteCode,
|
|
// FkWorkshopCode = model.FkWorkshopCode,
|
|
// FkProductlinebody = model.FkProductlinebody,
|
|
// WorkstationName = model.WorkstationName,
|
|
// WorkstaionType = model.WorkstaionType,
|
|
// Description = model.Description,
|
|
// FunctionGroupCode = model.FunctionGroupCode,
|
|
// FunctionGroupName = model.FunctionGroupName,
|
|
// IsReplaceable = model.IsReplaceable,
|
|
// CreatedBy = model.CreatedBy,
|
|
// CreatedTime = model.CreatedTime,
|
|
// UpdatedBy = model.UpdatedBy,
|
|
// UpdatedTime = model.UpdatedTime,
|
|
//});
|
|
//return response;
|
|
return Update(model, true);
|
|
}
|
|
|
|
}
|
|
} |