shgx_tz_mom/ZR.Service/mes/andon/AndonWorkTimeService.cs
2026-03-03 19:46:07 +08:00

83 lines
2.3 KiB
C#

using Infrastructure.Attribute;
using Infrastructure.Model;
using SqlSugar;
using System;
using ZR.Model;
using ZR.Model.MES.andon;
using ZR.Model.MES.andon.Dto;
using ZR.Repository;
using ZR.Service.mes.andon.Iservice;
namespace ZR.Service.mes.andon
{
/// <summary>
/// 安灯区域工作时间表Service业务层处理
/// </summary>
[AppService(ServiceType = typeof(IAndonWorkTimeService), ServiceLifetime = LifeTime.Transient)]
public class AndonWorkTimeService : BaseService<AndonWorkTime>, IAndonWorkTimeService
{
/// <summary>
/// 查询安灯区域工作时间表列表
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
public PagedInfo<AndonWorkTimeDto> GetList(AndonWorkTimeQueryDto parm)
{
var predicate = QueryExp(parm);
var response = Queryable()
.Where(predicate.ToExpression())
.ToPage<AndonWorkTime, AndonWorkTimeDto>(parm);
return response;
}
/// <summary>
/// 获取详情
/// </summary>
/// <param name="Id"></param>
/// <returns></returns>
public AndonWorkTime GetInfo(int Id)
{
var response = Queryable()
.Where(x => x.Id == Id)
.First();
return response;
}
/// <summary>
/// 添加安灯区域工作时间表
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public AndonWorkTime AddAndonWorkTime(AndonWorkTime model)
{
return Insertable(model).ExecuteReturnEntity();
}
/// <summary>
/// 修改安灯区域工作时间表
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public int UpdateAndonWorkTime(AndonWorkTime model)
{
return Update(model, true);
}
/// <summary>
/// 查询导出表达式
/// </summary>
/// <param name="parm"></param>
/// <returns></returns>
private static Expressionable<AndonWorkTime> QueryExp(AndonWorkTimeQueryDto parm)
{
var predicate = Expressionable.Create<AndonWorkTime>();
return predicate;
}
}
}