You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

55 lines
1.6 KiB

using Entity.Ammeter;
using Entity.DbModel;
using Entity.DbModel.Station;
using HybirdFrameworkCore.Autofac.Attribute;
using Repository.Ammeter;
using Repository.Station;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using AutoMapper;
using Entity.Dto.Req;
using Entity.Dto.Resp;
using HybirdFrameworkCore.Entity;
using Mapster;
using SqlSugar;
namespace Service.Station;
[Scope("SingleInstance")]
public class SysRunningFaultService : BaseServices<SysRunningFault>
{
private SysRunningFaultRepository _sysRunningFaultRep;
public SysRunningFaultService(SysRunningFaultRepository sysRunningFaultRep)
{
_sysRunningFaultRep = sysRunningFaultRep;
this.BaseDal = sysRunningFaultRep;
}
/// <summary>
/// 获取系统运行时故障信息
/// </summary>
/// <param name="input"></param>
/// <returns></returns>
public async Task<PageResult<SysRunningFault>> Page(int pageSize)
{
PageResult<SysRunningFault> pageResult = new PageResult<SysRunningFault>();
List<SysRunningFault> sysRunningFaultList = await _sysRunningFaultRep.QueryListByClauseAsync(i=>i.FaultDescribe!="");
if (sysRunningFaultList.Count > 0)
{
pageResult.PageNum = sysRunningFaultList.Count/pageSize+1;
pageResult.ToTal = sysRunningFaultList.Count;
pageResult.Rows = sysRunningFaultList;
}
else
{
pageResult.PageNum = 0;
pageResult.ToTal = 0;
}
pageResult.PageSize = pageSize;
return pageResult;
}
}