83 lines
2.7 KiB
C#
83 lines
2.7 KiB
C#
using Infrastructure.Attribute;
|
|
using SqlSugar;
|
|
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(IAndonAlarmRecordProcessService), ServiceLifetime = LifeTime.Transient)]
|
|
public class AndonAlarmRecordProcessService : BaseService<AndonAlarmRecordProcess>, IAndonAlarmRecordProcessService
|
|
{
|
|
/// <summary>
|
|
/// 查询安灯报警处理过程列表
|
|
/// </summary>
|
|
/// <param name="parm"></param>
|
|
/// <returns></returns>
|
|
public PagedInfo<AndonAlarmRecordProcessDto> GetList(AndonAlarmRecordProcessQueryDto parm)
|
|
{
|
|
var predicate = Expressionable.Create<AndonAlarmRecordProcess>();
|
|
|
|
var response = Queryable()
|
|
.Where(predicate.ToExpression())
|
|
.ToPage<AndonAlarmRecordProcess, AndonAlarmRecordProcessDto>(parm);
|
|
|
|
return response;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 获取详情
|
|
/// </summary>
|
|
/// <param name="Id"></param>
|
|
/// <returns></returns>
|
|
public AndonAlarmRecordProcess GetInfo(int Id)
|
|
{
|
|
var response = Queryable()
|
|
.Where(x => x.Id == Id)
|
|
.First();
|
|
|
|
return response;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 添加安灯报警处理过程
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public AndonAlarmRecordProcess AddAndonAlarmRecordProcess(AndonAlarmRecordProcess model)
|
|
{
|
|
return Context.Insertable(model).ExecuteReturnEntity();
|
|
}
|
|
|
|
/// <summary>
|
|
/// 修改安灯报警处理过程
|
|
/// </summary>
|
|
/// <param name="model"></param>
|
|
/// <returns></returns>
|
|
public int UpdateAndonAlarmRecordProcess(AndonAlarmRecordProcess model)
|
|
{
|
|
//var response = Update(w => w.Id == model.Id, it => new AndonAlarmRecordProcess()
|
|
//{
|
|
// AlarmCode = model.AlarmCode,
|
|
// Operate = model.Operate,
|
|
// Operator = model.Operator,
|
|
// OperatorName = model.OperatorName,
|
|
// OperateTime = model.OperateTime,
|
|
// Remarks = model.Remarks,
|
|
// CreatedBy = model.CreatedBy,
|
|
// CreatedTime = model.CreatedTime,
|
|
// UpdatedBy = model.UpdatedBy,
|
|
// UpdatedTime = model.UpdatedTime,
|
|
//});
|
|
//return response;
|
|
return Update(model, true);
|
|
}
|
|
|
|
}
|
|
} |