using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using LeaRun.Application.Service.PipeNetworkManage; using LeaRun.Application.Entity.PipeNetworkManage; using LeaRun.Util.WebControl; namespace LeaRun.Application.Busines.PipeNetworkManage { public class MeterBLL { private MeterService meterService = new MeterService(); /// /// 缓存key /// public string cacheKey = "MeterCache"; /// /// 获取所有的 考核表 类型 /// /// public string GetMeterType() { return meterService.GetMeterType(); } /// /// 获取指定的 表类型列表 /// /// 分页参数 /// 查询条件 /// public IEnumerable GetMeterType(Pagination pagination, string queryJson) { return meterService.GetMeterType(pagination, queryJson); } /// /// 获取类型列表 /// /// public IEnumerable GetMeterTypeList() { return meterService.GetMeterTypeList(); } /// /// 获取表具类型 /// /// 类型ID /// public MeterTypeEntity GetMeterTypeEntity(int meterTypeId) { return meterService.GetMeterTypeEntity(meterTypeId); } /// /// 保存表具类型 /// /// 类型实体 /// public bool SaveMeterType(MeterTypeEntity meterType) { return meterService.SaveMeterType(meterType); } /// /// 更新表具类型 /// /// 类型实体 /// public bool UpdateMeterType(MeterTypeEntity meterType) { return meterService.UpdateMeterType(meterType); } /// /// 删除表具类型 /// /// 类型ID /// public string DelteMeterType(int meterTypeId) { return meterService.DelteMemterType(meterTypeId); } /// /// 获取表设备信息列表 /// /// public string GetMeterList(Pagination pagination, string queryJson) { return meterService.GetMeterList(pagination, queryJson); } /// /// 获取表设备信息列表 /// /// public IEnumerable GetMeters() { return meterService.GetMeters(); } /// /// 保存表设备信息 /// /// 表设备实体 /// public bool SaveMeter(MeterEntity meter) { return meterService.SaveMeter(meter); } /// /// 更新表设备信息 /// /// 表设备实体 /// public bool UpdateMeter(MeterEntity meter) { return meterService.UpdateMeter(meter); } /// /// 删除表设备信息 /// /// 设备信息ID /// public bool DeleteMeter(int meterAssessmentId) { return meterService.DeleteMeter(meterAssessmentId); } /// /// 获取表设备信息 /// /// /// public MeterEntity GetMeterEntity(int meterAssessmentId) { return meterService.GetMeterEntity(meterAssessmentId); } #region 水务宝 用到的方法 /// /// 获取所属公司的表 /// /// 公司ID /// 1.考核表 0.贸易表 2.无所谓 /// public IEnumerable GetMeterEntityByCompanyId(string companyId, int isKaoHe = 2) { return meterService.GetMeterEntityByCompanyId(companyId, isKaoHe); } /// /// 特定时间段内,平均压力小于某个值的 设备 /// /// /// /// /// public IEnumerable GetMeterByPressLessValue(decimal pressValue, string startT, string endT, IEnumerable entities) { return meterService.GetMeterByPressLessValue(pressValue, startT, endT, entities); } /// /// 特定时间段内,电池电压小于某个值的 设备 /// /// /// /// /// public IEnumerable GetMeterByBatteryVoltageValue(decimal voltageValue, IEnumerable entities) { return meterService.GetMeterByBatteryVoltageValue(voltageValue,entities); } /// /// 根据口径筛选设备 /// /// /// 口径值 /// 1.大于 2.等于 3小于 /// public IEnumerable GetMeterEntityByCaliber(IEnumerable entities, int caliberValue, int chooseType) { return meterService.GetMeterEntityByCaliber(entities, caliberValue, chooseType); } /// /// 获取有故障的设备 /// 瞬时流量 压力 净累计都为0 视为故障 /// 最近更新时间大于一天的 视为故障 /// /// /// public IEnumerable GetFaultMeter(IEnumerable entities) { return meterService.GetFaultMeter(entities); } /// /// 计算漏失 /// /// 表设备 /// 开始时间 /// 结束时间 /// 连续用水量 /// 校核按钮所使用的值 最小 /// 校核 状态0 初始化 1.点击校核按钮 /// 漏损倍率 /// public CalcLeakEntity GetCalcLeakEntity(MeterEntity entity, string startT, string endT, string continuous, string minFlowRate, string type) { return meterService.GetCalcLeakEntity(entity, startT, endT, continuous, minFlowRate, type); } /// /// 计算设备漏失率低于某个值 /// /// /// /// public IEnumerable GetDeviceLossMoreThanValue(IEnumerable entities, decimal value) { return meterService.GetDeviceLossMoreThanValue(entities,value); } /// /// 特定时间段内,最小流量小于某个值的 设备 /// /// /// /// /// public IEnumerable GetMeterByMinFlowLessValue(decimal flowValue, string startT, string endT, IEnumerable entities) { return meterService.GetMeterByMinFlowLessValue(flowValue, startT, endT, entities); } /// /// 更新贸易表的连续用水量 /// /// /// /// public bool UpdateMaoYiMeterContinueUserWater(string continueUserWater, string meterAssessmentId) { return meterService.UpdateMaoYiMeterContinueUserWater(continueUserWater,meterAssessmentId); } /// /// 设置考核表报警参数 /// /// 设备ID /// 连续用水量 /// 产销差 /// public bool SetMeterAlermParam(string meterId, string continueUseWater, string supplySaleDValue) { return meterService.SetMeterAlermParam(meterId,continueUseWater,supplySaleDValue); } /// /// 更新报警开关 /// /// 设备ID /// 报警类型 0-1-1|2|3|4 第一位 报警开关 第二位 大类型 第三位 小类型 /// public bool SetMeterAlermState(string meterId, string alermType) { return meterService.SetMeterAlermState(meterId,alermType); } #endregion } }