1
This commit is contained in:
79
ZR.Service/mes/andon/AndonAlarmAreaService.cs
Normal file
79
ZR.Service/mes/andon/AndonAlarmAreaService.cs
Normal file
@@ -0,0 +1,79 @@
|
||||
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(IAndonAlarmAreaService), ServiceLifetime = LifeTime.Transient)]
|
||||
public class AndonAlarmAreaService : BaseService<AndonAlarmArea>, IAndonAlarmAreaService
|
||||
{
|
||||
/// <summary>
|
||||
/// 查询报警区域表列表
|
||||
/// </summary>
|
||||
/// <param name="parm"></param>
|
||||
/// <returns></returns>
|
||||
public PagedInfo<AndonAlarmAreaDto> GetList(AndonAlarmAreaQueryDto parm)
|
||||
{
|
||||
var predicate = Expressionable.Create<AndonAlarmArea>();
|
||||
|
||||
var response = Queryable()
|
||||
.Where(predicate.ToExpression())
|
||||
.ToPage<AndonAlarmArea, AndonAlarmAreaDto>(parm);
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取详情
|
||||
/// </summary>
|
||||
/// <param name="Id"></param>
|
||||
/// <returns></returns>
|
||||
public AndonAlarmArea GetInfo(int Id)
|
||||
{
|
||||
var response = Queryable()
|
||||
.Where(x => x.Id == Id)
|
||||
.First();
|
||||
|
||||
return response;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 添加报警区域表
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public AndonAlarmArea AddAndonAlarmArea(AndonAlarmArea model)
|
||||
{
|
||||
return Context.Insertable(model).ExecuteReturnEntity();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 修改报警区域表
|
||||
/// </summary>
|
||||
/// <param name="model"></param>
|
||||
/// <returns></returns>
|
||||
public int UpdateAndonAlarmArea(AndonAlarmArea model)
|
||||
{
|
||||
//var response = Update(w => w.Id == model.Id, it => new AndonAlarmArea()
|
||||
//{
|
||||
// ParentId = model.ParentId,
|
||||
// Area = model.Area,
|
||||
// CreatedBy = model.CreatedBy,
|
||||
// CreatedTime = model.CreatedTime,
|
||||
// UpdatedBy = model.UpdatedBy,
|
||||
// UpdatedTime = model.UpdatedTime,
|
||||
//});
|
||||
//return response;
|
||||
return Update(model, true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
23
ZR.Service/mes/andon/IService/IAndonAlarmAreaService.cs
Normal file
23
ZR.Service/mes/andon/IService/IAndonAlarmAreaService.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using ZR.Model;
|
||||
using System.Collections.Generic;
|
||||
using ZR.Model.MES.andon;
|
||||
using ZR.Model.MES.andon.Dto;
|
||||
|
||||
|
||||
namespace ZR.Service.mes.andon.Iservice
|
||||
/// <summary>
|
||||
/// 报警区域表service接口
|
||||
/// </summary>
|
||||
public interface IAndonAlarmAreaService : IBaseService<AndonAlarmArea>
|
||||
{
|
||||
PagedInfo<AndonAlarmAreaDto> GetList(AndonAlarmAreaQueryDto parm);
|
||||
|
||||
AndonAlarmArea GetInfo(int Id);
|
||||
|
||||
AndonAlarmArea AddAndonAlarmArea(AndonAlarmArea parm);
|
||||
|
||||
int UpdateAndonAlarmArea(AndonAlarmArea parm);
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user