From 9b807f0b02781bfabb1a1c62618564b466022a7f Mon Sep 17 00:00:00 2001 From: zch Date: Fri, 13 Dec 2024 10:57:29 +0800 Subject: [PATCH] =?UTF-8?q?feat(record):=20=E4=BF=AE=E6=94=B9=E6=AF=8D?= =?UTF-8?q?=E6=8E=92=E6=8A=A5=E8=AD=A6=E8=AE=B0=E5=BD=95=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 RecordBusbarAlarmMapper 接口中的 recordBusbarAlarmCount 方法返回类型改为 List - 更新 RecordBusbarAlarmServiceImpl 中的 recordBusbarAlarmCount 方法实现 - 修改数据库映射文件 RecordBusbarAlarmMapper.xml 中的 SQL 语句 --- .../impl/EmsBaseMonitorInfoServiceImpl.java | 1 + .../impl/TWTempertureDataServiceImpl.java | 98 ++++++++++--------- .../controller/BaseBusbarInfoController.java | 11 ++- .../controller/BaseCabinetInfoController.java | 9 ++ .../base/mapper/BaseBusbarInfoMapper.java | 18 ++-- .../base/mapper/BaseCabinetInfoMapper.java | 18 ++-- .../base/service/IBaseBusbarInfoService.java | 18 ++-- .../base/service/IBaseCabinetInfoService.java | 2 + .../impl/BaseBusbarInfoServiceImpl.java | 27 ++--- .../impl/BaseCabinetInfoServiceImpl.java | 6 ++ .../mapper/RecordBusbarAlarmMapper.java | 19 ++-- .../service/IRecordBusbarAlarmService.java | 19 ++-- .../impl/RecordBusbarAlarmServiceImpl.java | 24 +++-- .../mapper/base/BaseBusbarInfoMapper.xml | 7 ++ .../mapper/base/BaseCabinetInfoMapper.xml | 5 + .../mapper/record/RecordBusbarAlarmMapper.xml | 3 +- ruoyi-ui/src/api/base/baseBusbarInfo.js | 10 ++ ruoyi-ui/src/api/base/baseCabinetInfo.js | 10 ++ 18 files changed, 195 insertions(+), 110 deletions(-) diff --git a/ruoyi-ems/src/main/java/com/ruoyi/ems/base/service/impl/EmsBaseMonitorInfoServiceImpl.java b/ruoyi-ems/src/main/java/com/ruoyi/ems/base/service/impl/EmsBaseMonitorInfoServiceImpl.java index ff33b6a..5a0ac7b 100644 --- a/ruoyi-ems/src/main/java/com/ruoyi/ems/base/service/impl/EmsBaseMonitorInfoServiceImpl.java +++ b/ruoyi-ems/src/main/java/com/ruoyi/ems/base/service/impl/EmsBaseMonitorInfoServiceImpl.java @@ -206,6 +206,7 @@ public class EmsBaseMonitorInfoServiceImpl implements IEmsBaseMonitorInfoService * @param energyType 需要查询的能源类型。 * @return 返回指定能源类型的数量。 */ + @Override public int getEnergyTypeCount(String energyType){ return emsBaseMonitorInfoMapper.getEnergyTypeCount(energyType); } diff --git a/ruoyi-ems/src/main/java/com/ruoyi/ems/record/service/impl/TWTempertureDataServiceImpl.java b/ruoyi-ems/src/main/java/com/ruoyi/ems/record/service/impl/TWTempertureDataServiceImpl.java index 3045a29..6465f8a 100644 --- a/ruoyi-ems/src/main/java/com/ruoyi/ems/record/service/impl/TWTempertureDataServiceImpl.java +++ b/ruoyi-ems/src/main/java/com/ruoyi/ems/record/service/impl/TWTempertureDataServiceImpl.java @@ -120,6 +120,7 @@ public class TWTempertureDataServiceImpl implements ITWTempertureDataService * @param tWTempertureData * @return */ + @Override public List selectLastTWTempertureDataList(TWTempertureData tWTempertureData) { // 按monitorName分组并获取每个分组的最新记录 return tWTempertureDataMapper.selectLastTWTempertureDataList(tWTempertureData); @@ -130,6 +131,7 @@ public class TWTempertureDataServiceImpl implements ITWTempertureDataService * @param tWTempertureData 需要查询的温度数据对象。 * @return 如果数据库中存在对应的温度数据,返回包含最新数据的列表;如果不存在或查询过程中发生异常,返回空列表。 */ + @Override public List selectLastTWTempertureData(TWTempertureData tWTempertureData) { try { // 从数据库中查询温度数据列表 @@ -168,59 +170,59 @@ public class TWTempertureDataServiceImpl implements ITWTempertureDataService } -/** - * 将源对象中指定字段的值设置到目标对象的相应字段中,如果该值不为空且目标对象的对应字段为空。 - * - * @param source 源对象,从中获取字段值 - * @param target 目标对象,将字段值设置到此对象中 - * @param fieldName 要操作的字段名称 - */ -private void setIfNotNull(TWTempertureData source, TWTempertureData target, String fieldName) { - try { - // 获取源对象中指定字段的getter方法 - Method getMethod = TWTempertureData.class.getMethod("get" + capitalize(fieldName)); - // 获取目标对象中指定字段的setter方法,参数类型与getter方法返回类型一致 - Method setMethod = TWTempertureData.class.getMethod("set" + capitalize(fieldName), getMethod.getReturnType()); - // 调用getter方法获取源对象中的字段值 - Object value = getMethod.invoke(source); - // 如果字段值不为空且目标对象中的对应字段值为空,则调用setter方法将值设置到目标对象中 - if (value != null && getMethod.invoke(target) == null) { - setMethod.invoke(target, value); + /** + * 将源对象中指定字段的值设置到目标对象的相应字段中,如果该值不为空且目标对象的对应字段为空。 + * + * @param source 源对象,从中获取字段值 + * @param target 目标对象,将字段值设置到此对象中 + * @param fieldName 要操作的字段名称 + */ + private void setIfNotNull(TWTempertureData source, TWTempertureData target, String fieldName) { + try { + // 获取源对象中指定字段的getter方法 + Method getMethod = TWTempertureData.class.getMethod("get" + capitalize(fieldName)); + // 获取目标对象中指定字段的setter方法,参数类型与getter方法返回类型一致 + Method setMethod = TWTempertureData.class.getMethod("set" + capitalize(fieldName), getMethod.getReturnType()); + // 调用getter方法获取源对象中的字段值 + Object value = getMethod.invoke(source); + // 如果字段值不为空且目标对象中的对应字段值为空,则调用setter方法将值设置到目标对象中 + if (value != null && getMethod.invoke(target) == null) { + setMethod.invoke(target, value); + } + } catch (Exception e) { + // 捕获并打印异常信息 + e.printStackTrace(); } - } catch (Exception e) { - // 捕获并打印异常信息 - e.printStackTrace(); } -} -/** - * 设置PM值。 - * @param source 源TWTempertureData对象,用于提供PM值。 - * @param target 目标TWTempertureData对象,用于接收PM值。 - */ -private void setPmValues(TWTempertureData source, TWTempertureData target) { - setIfNotNull(source, target, "pm1"); - if (target.getPm1() == null) { - setIfNotNull(source, target, "pm2"); - } - if (target.getPm2() == null) { - setIfNotNull(source, target, "pm10"); + /** + * 设置PM值。 + * @param source 源TWTempertureData对象,用于提供PM值。 + * @param target 目标TWTempertureData对象,用于接收PM值。 + */ + private void setPmValues(TWTempertureData source, TWTempertureData target) { + setIfNotNull(source, target, "pm1"); + if (target.getPm1() == null) { + setIfNotNull(source, target, "pm2"); + } + if (target.getPm2() == null) { + setIfNotNull(source, target, "pm10"); + } } -} -/** - * 将字符串的首字母大写。 - * - * @param str 要处理的字符串 - * @return 首字母大写的字符串,如果输入为空或长度为0,则返回原字符串 - */ -private String capitalize(String str) { - // 如果字符串为null或者长度为0,直接返回原字符串 - if (str == null || str.length() == 0) { - return str; + /** + * 将字符串的首字母大写。 + * + * @param str 要处理的字符串 + * @return 首字母大写的字符串,如果输入为空或长度为0,则返回原字符串 + */ + private String capitalize(String str) { + // 如果字符串为null或者长度为0,直接返回原字符串 + if (str == null || str.length() == 0) { + return str; + } + // 将字符串的第一个字符转换为大写,并与剩余部分拼接后返回 + return str.substring(0, 1).toUpperCase() + str.substring(1); } - // 将字符串的第一个字符转换为大写,并与剩余部分拼接后返回 - return str.substring(0, 1).toUpperCase() + str.substring(1); -} } diff --git a/ruoyi-module/src/main/java/com/ruoyi/base/controller/BaseBusbarInfoController.java b/ruoyi-module/src/main/java/com/ruoyi/base/controller/BaseBusbarInfoController.java index d613220..8ca0b39 100644 --- a/ruoyi-module/src/main/java/com/ruoyi/base/controller/BaseBusbarInfoController.java +++ b/ruoyi-module/src/main/java/com/ruoyi/base/controller/BaseBusbarInfoController.java @@ -23,7 +23,7 @@ import com.ruoyi.common.core.page.TableDataInfo; /** * 母排信息Controller - * + * * @author zangch * @date 2024-10-31 */ @@ -101,4 +101,13 @@ public class BaseBusbarInfoController extends BaseController { return toAjax(baseBusbarInfoService.deleteBaseBusbarInfoByObjIds(objIds)); } + + /** + * 统计母排数量 + */ + @PostMapping("/countCabinet") + public AjaxResult countCabinet() { + return success(baseBusbarInfoService.countBaseBusbarInfo()); + } + } diff --git a/ruoyi-module/src/main/java/com/ruoyi/base/controller/BaseCabinetInfoController.java b/ruoyi-module/src/main/java/com/ruoyi/base/controller/BaseCabinetInfoController.java index 3bdeb06..bcf44b7 100644 --- a/ruoyi-module/src/main/java/com/ruoyi/base/controller/BaseCabinetInfoController.java +++ b/ruoyi-module/src/main/java/com/ruoyi/base/controller/BaseCabinetInfoController.java @@ -127,4 +127,13 @@ public class BaseCabinetInfoController extends BaseController return success(list); } + /** + * 统计电柜数量 + * */ + @PostMapping("/countCabinet") + public int countCabinet() { + return baseCabinetInfoService.countBaseCabinetInfo(); + } + + } diff --git a/ruoyi-module/src/main/java/com/ruoyi/base/mapper/BaseBusbarInfoMapper.java b/ruoyi-module/src/main/java/com/ruoyi/base/mapper/BaseBusbarInfoMapper.java index 0bc6a47..4257253 100644 --- a/ruoyi-module/src/main/java/com/ruoyi/base/mapper/BaseBusbarInfoMapper.java +++ b/ruoyi-module/src/main/java/com/ruoyi/base/mapper/BaseBusbarInfoMapper.java @@ -5,15 +5,15 @@ import com.ruoyi.base.domain.BaseBusbarInfo; /** * 母排信息Mapper接口 - * + * * @author zangch * @date 2024-10-31 */ -public interface BaseBusbarInfoMapper +public interface BaseBusbarInfoMapper { /** * 查询母排信息 - * + * * @param objId 母排信息主键 * @return 母排信息 */ @@ -21,7 +21,7 @@ public interface BaseBusbarInfoMapper /** * 查询母排信息列表 - * + * * @param baseBusbarInfo 母排信息 * @return 母排信息集合 */ @@ -29,7 +29,7 @@ public interface BaseBusbarInfoMapper /** * 新增母排信息 - * + * * @param baseBusbarInfo 母排信息 * @return 结果 */ @@ -37,7 +37,7 @@ public interface BaseBusbarInfoMapper /** * 修改母排信息 - * + * * @param baseBusbarInfo 母排信息 * @return 结果 */ @@ -45,7 +45,7 @@ public interface BaseBusbarInfoMapper /** * 删除母排信息 - * + * * @param objId 母排信息主键 * @return 结果 */ @@ -53,9 +53,11 @@ public interface BaseBusbarInfoMapper /** * 批量删除母排信息 - * + * * @param objIds 需要删除的数据主键集合 * @return 结果 */ public int deleteBaseBusbarInfoByObjIds(Long[] objIds); + + public int countBaseBusbarInfo(); } diff --git a/ruoyi-module/src/main/java/com/ruoyi/base/mapper/BaseCabinetInfoMapper.java b/ruoyi-module/src/main/java/com/ruoyi/base/mapper/BaseCabinetInfoMapper.java index 2b5c4cf..33db17d 100644 --- a/ruoyi-module/src/main/java/com/ruoyi/base/mapper/BaseCabinetInfoMapper.java +++ b/ruoyi-module/src/main/java/com/ruoyi/base/mapper/BaseCabinetInfoMapper.java @@ -5,15 +5,15 @@ import com.ruoyi.base.domain.BaseCabinetInfo; /** * 电柜信息Mapper接口 - * + * * @author ruoyi * @date 2024-10-31 */ -public interface BaseCabinetInfoMapper +public interface BaseCabinetInfoMapper { /** * 查询电柜信息 - * + * * @param objId 电柜信息主键 * @return 电柜信息 */ @@ -21,7 +21,7 @@ public interface BaseCabinetInfoMapper /** * 查询电柜信息列表 - * + * * @param baseCabinetInfo 电柜信息 * @return 电柜信息集合 */ @@ -29,7 +29,7 @@ public interface BaseCabinetInfoMapper /** * 新增电柜信息 - * + * * @param baseCabinetInfo 电柜信息 * @return 结果 */ @@ -37,7 +37,7 @@ public interface BaseCabinetInfoMapper /** * 修改电柜信息 - * + * * @param baseCabinetInfo 电柜信息 * @return 结果 */ @@ -45,7 +45,7 @@ public interface BaseCabinetInfoMapper /** * 删除电柜信息 - * + * * @param objId 电柜信息主键 * @return 结果 */ @@ -53,9 +53,11 @@ public interface BaseCabinetInfoMapper /** * 批量删除电柜信息 - * + * * @param objIds 需要删除的数据主键集合 * @return 结果 */ public int deleteBaseCabinetInfoByObjIds(Long[] objIds); + + public int countBaseCabinetInfo(); } diff --git a/ruoyi-module/src/main/java/com/ruoyi/base/service/IBaseBusbarInfoService.java b/ruoyi-module/src/main/java/com/ruoyi/base/service/IBaseBusbarInfoService.java index a95af64..1160001 100644 --- a/ruoyi-module/src/main/java/com/ruoyi/base/service/IBaseBusbarInfoService.java +++ b/ruoyi-module/src/main/java/com/ruoyi/base/service/IBaseBusbarInfoService.java @@ -5,15 +5,15 @@ import com.ruoyi.base.domain.BaseBusbarInfo; /** * 母排信息Service接口 - * + * * @author zangch * @date 2024-10-31 */ -public interface IBaseBusbarInfoService +public interface IBaseBusbarInfoService { /** * 查询母排信息 - * + * * @param objId 母排信息主键 * @return 母排信息 */ @@ -21,7 +21,7 @@ public interface IBaseBusbarInfoService /** * 查询母排信息列表 - * + * * @param baseBusbarInfo 母排信息 * @return 母排信息集合 */ @@ -29,7 +29,7 @@ public interface IBaseBusbarInfoService /** * 新增母排信息 - * + * * @param baseBusbarInfo 母排信息 * @return 结果 */ @@ -37,7 +37,7 @@ public interface IBaseBusbarInfoService /** * 修改母排信息 - * + * * @param baseBusbarInfo 母排信息 * @return 结果 */ @@ -45,7 +45,7 @@ public interface IBaseBusbarInfoService /** * 批量删除母排信息 - * + * * @param objIds 需要删除的母排信息主键集合 * @return 结果 */ @@ -53,9 +53,11 @@ public interface IBaseBusbarInfoService /** * 删除母排信息信息 - * + * * @param objId 母排信息主键 * @return 结果 */ public int deleteBaseBusbarInfoByObjId(Long objId); + + public int countBaseBusbarInfo(); } diff --git a/ruoyi-module/src/main/java/com/ruoyi/base/service/IBaseCabinetInfoService.java b/ruoyi-module/src/main/java/com/ruoyi/base/service/IBaseCabinetInfoService.java index 65d306f..4785804 100644 --- a/ruoyi-module/src/main/java/com/ruoyi/base/service/IBaseCabinetInfoService.java +++ b/ruoyi-module/src/main/java/com/ruoyi/base/service/IBaseCabinetInfoService.java @@ -68,4 +68,6 @@ public interface IBaseCabinetInfoService * @return 所有电柜信息信息 */ public List selectCabinetInfoTreeList(BaseCabinetInfo baseCabinetInfo); + + public int countBaseCabinetInfo(); } diff --git a/ruoyi-module/src/main/java/com/ruoyi/base/service/impl/BaseBusbarInfoServiceImpl.java b/ruoyi-module/src/main/java/com/ruoyi/base/service/impl/BaseBusbarInfoServiceImpl.java index 944094a..2fd3af4 100644 --- a/ruoyi-module/src/main/java/com/ruoyi/base/service/impl/BaseBusbarInfoServiceImpl.java +++ b/ruoyi-module/src/main/java/com/ruoyi/base/service/impl/BaseBusbarInfoServiceImpl.java @@ -13,12 +13,12 @@ import com.ruoyi.base.service.IBaseBusbarInfoService; /** * 母排信息Service业务层处理 - * + * * @author zangch * @date 2024-10-31 */ @Service -public class BaseBusbarInfoServiceImpl implements IBaseBusbarInfoService +public class BaseBusbarInfoServiceImpl implements IBaseBusbarInfoService { @Autowired private BaseBusbarInfoMapper baseBusbarInfoMapper; @@ -28,7 +28,7 @@ public class BaseBusbarInfoServiceImpl implements IBaseBusbarInfoService /** * 查询母排信息 - * + * * @param objId 母排信息主键 * @return 母排信息 */ @@ -40,7 +40,7 @@ public class BaseBusbarInfoServiceImpl implements IBaseBusbarInfoService /** * 查询母排信息列表 - * + * * @param baseBusbarInfo 母排信息 * @return 母排信息 */ @@ -52,7 +52,7 @@ public class BaseBusbarInfoServiceImpl implements IBaseBusbarInfoService /** * 新增母排信息 - * + * * @param baseBusbarInfo 母排信息 * @return 结果 */ @@ -75,9 +75,9 @@ public class BaseBusbarInfoServiceImpl implements IBaseBusbarInfoService if (baseCabinetInfoList.isEmpty()) { throw new ServiceException("未找到该电柜信息,请先新增电柜"); } - + // 获取母排信息中的母排编码 - Long busbarCode = baseBusbarInfo.getBusbarCode(); + Long busbarCode = baseBusbarInfo.getBusbarCode(); // 创建一个新的母排信息对象并设置母排编码 BaseBusbarInfo searchBusbar = new BaseBusbarInfo(); searchBusbar.setBusbarCode(busbarCode); @@ -87,14 +87,14 @@ public class BaseBusbarInfoServiceImpl implements IBaseBusbarInfoService if (!baseBusbarInfoList.isEmpty()) { throw new ServiceException("该母排编号已存在,请重新输入"); } - + // 插入母排信息到数据库中,并返回插入操作的结果 return baseBusbarInfoMapper.insertBaseBusbarInfo(baseBusbarInfo); } /** * 修改母排信息 - * + * * @param baseBusbarInfo 母排信息 * @return 结果 */ @@ -133,7 +133,7 @@ public class BaseBusbarInfoServiceImpl implements IBaseBusbarInfoService /** * 批量删除母排信息 - * + * * @param objIds 需要删除的母排信息主键 * @return 结果 */ @@ -145,7 +145,7 @@ public class BaseBusbarInfoServiceImpl implements IBaseBusbarInfoService /** * 删除母排信息信息 - * + * * @param objId 母排信息主键 * @return 结果 */ @@ -154,4 +154,9 @@ public class BaseBusbarInfoServiceImpl implements IBaseBusbarInfoService { return baseBusbarInfoMapper.deleteBaseBusbarInfoByObjId(objId); } + + @Override + public int countBaseBusbarInfo(){ + return baseBusbarInfoMapper.countBaseBusbarInfo(); + } } diff --git a/ruoyi-module/src/main/java/com/ruoyi/base/service/impl/BaseCabinetInfoServiceImpl.java b/ruoyi-module/src/main/java/com/ruoyi/base/service/impl/BaseCabinetInfoServiceImpl.java index 7abeb1f..f36bc32 100644 --- a/ruoyi-module/src/main/java/com/ruoyi/base/service/impl/BaseCabinetInfoServiceImpl.java +++ b/ruoyi-module/src/main/java/com/ruoyi/base/service/impl/BaseCabinetInfoServiceImpl.java @@ -118,11 +118,17 @@ public class BaseCabinetInfoServiceImpl implements IBaseCabinetInfoService * * @return 所有电柜信息信息 */ + @Override public List selectCabinetInfoTreeList(BaseCabinetInfo baseCabinetInfo){ List baseCabinetInfos = baseCabinetInfoMapper.selectBaseCabinetInfoList(baseCabinetInfo); return baseCabinetInfos.stream().map(baseCabinetInfoTreeSelects::new).collect(Collectors.toList()); } + @Override + public int countBaseCabinetInfo(){ + return baseCabinetInfoMapper.countBaseCabinetInfo(); + } + /* */ /** diff --git a/ruoyi-module/src/main/java/com/ruoyi/record/mapper/RecordBusbarAlarmMapper.java b/ruoyi-module/src/main/java/com/ruoyi/record/mapper/RecordBusbarAlarmMapper.java index 511c7bb..8e97f75 100644 --- a/ruoyi-module/src/main/java/com/ruoyi/record/mapper/RecordBusbarAlarmMapper.java +++ b/ruoyi-module/src/main/java/com/ruoyi/record/mapper/RecordBusbarAlarmMapper.java @@ -2,18 +2,19 @@ package com.ruoyi.record.mapper; import java.util.List; import com.ruoyi.record.domain.RecordBusbarAlarm; +import com.ruoyi.record.domain.VO.RecordBusbarAlarmCountResult; /** * 巡检报警记录Mapper接口 - * + * * @author zangch * @date 2024-12-03 */ -public interface RecordBusbarAlarmMapper +public interface RecordBusbarAlarmMapper { /** * 查询巡检报警记录 - * + * * @param objId 巡检报警记录主键 * @return 巡检报警记录 */ @@ -21,7 +22,7 @@ public interface RecordBusbarAlarmMapper /** * 查询巡检报警记录列表 - * + * * @param recordBusbarAlarm 巡检报警记录 * @return 巡检报警记录集合 */ @@ -29,7 +30,7 @@ public interface RecordBusbarAlarmMapper /** * 新增巡检报警记录 - * + * * @param recordBusbarAlarm 巡检报警记录 * @return 结果 */ @@ -37,7 +38,7 @@ public interface RecordBusbarAlarmMapper /** * 修改巡检报警记录 - * + * * @param recordBusbarAlarm 巡检报警记录 * @return 结果 */ @@ -45,7 +46,7 @@ public interface RecordBusbarAlarmMapper /** * 删除巡检报警记录 - * + * * @param objId 巡检报警记录主键 * @return 结果 */ @@ -53,9 +54,11 @@ public interface RecordBusbarAlarmMapper /** * 批量删除巡检报警记录 - * + * * @param objIds 需要删除的数据主键集合 * @return 结果 */ public int deleteRecordBusbarAlarmByObjIds(Long[] objIds); + + public List recordBusbarAlarmCount(RecordBusbarAlarm recordBusbarAlarm); } diff --git a/ruoyi-module/src/main/java/com/ruoyi/record/service/IRecordBusbarAlarmService.java b/ruoyi-module/src/main/java/com/ruoyi/record/service/IRecordBusbarAlarmService.java index e160655..da71ee8 100644 --- a/ruoyi-module/src/main/java/com/ruoyi/record/service/IRecordBusbarAlarmService.java +++ b/ruoyi-module/src/main/java/com/ruoyi/record/service/IRecordBusbarAlarmService.java @@ -2,18 +2,19 @@ package com.ruoyi.record.service; import java.util.List; import com.ruoyi.record.domain.RecordBusbarAlarm; +import com.ruoyi.record.domain.VO.RecordBusbarAlarmCountResult; /** * 巡检报警记录Service接口 - * + * * @author zangch * @date 2024-12-03 */ -public interface IRecordBusbarAlarmService +public interface IRecordBusbarAlarmService { /** * 查询巡检报警记录 - * + * * @param objId 巡检报警记录主键 * @return 巡检报警记录 */ @@ -21,7 +22,7 @@ public interface IRecordBusbarAlarmService /** * 查询巡检报警记录列表 - * + * * @param recordBusbarAlarm 巡检报警记录 * @return 巡检报警记录集合 */ @@ -29,7 +30,7 @@ public interface IRecordBusbarAlarmService /** * 新增巡检报警记录 - * + * * @param recordBusbarAlarm 巡检报警记录 * @return 结果 */ @@ -37,7 +38,7 @@ public interface IRecordBusbarAlarmService /** * 修改巡检报警记录 - * + * * @param recordBusbarAlarm 巡检报警记录 * @return 结果 */ @@ -45,7 +46,7 @@ public interface IRecordBusbarAlarmService /** * 批量删除巡检报警记录 - * + * * @param objIds 需要删除的巡检报警记录主键集合 * @return 结果 */ @@ -53,11 +54,11 @@ public interface IRecordBusbarAlarmService /** * 删除巡检报警记录信息 - * + * * @param objId 巡检报警记录主键 * @return 结果 */ public int deleteRecordBusbarAlarmByObjId(Long objId); - int recordBusbarAlarmCount(RecordBusbarAlarm recordBusbarAlarm); + public List recordBusbarAlarmCount(RecordBusbarAlarm recordBusbarAlarm); } diff --git a/ruoyi-module/src/main/java/com/ruoyi/record/service/impl/RecordBusbarAlarmServiceImpl.java b/ruoyi-module/src/main/java/com/ruoyi/record/service/impl/RecordBusbarAlarmServiceImpl.java index 411c6ae..14d006f 100644 --- a/ruoyi-module/src/main/java/com/ruoyi/record/service/impl/RecordBusbarAlarmServiceImpl.java +++ b/ruoyi-module/src/main/java/com/ruoyi/record/service/impl/RecordBusbarAlarmServiceImpl.java @@ -1,6 +1,8 @@ package com.ruoyi.record.service.impl; import java.util.List; + +import com.ruoyi.record.domain.VO.RecordBusbarAlarmCountResult; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.ruoyi.record.mapper.RecordBusbarAlarmMapper; @@ -9,19 +11,19 @@ import com.ruoyi.record.service.IRecordBusbarAlarmService; /** * 巡检报警记录Service业务层处理 - * + * * @author zangch * @date 2024-12-03 */ @Service -public class RecordBusbarAlarmServiceImpl implements IRecordBusbarAlarmService +public class RecordBusbarAlarmServiceImpl implements IRecordBusbarAlarmService { @Autowired private RecordBusbarAlarmMapper recordBusbarAlarmMapper; /** * 查询巡检报警记录 - * + * * @param objId 巡检报警记录主键 * @return 巡检报警记录 */ @@ -33,7 +35,7 @@ public class RecordBusbarAlarmServiceImpl implements IRecordBusbarAlarmService /** * 查询巡检报警记录列表 - * + * * @param recordBusbarAlarm 巡检报警记录 * @return 巡检报警记录 */ @@ -45,7 +47,7 @@ public class RecordBusbarAlarmServiceImpl implements IRecordBusbarAlarmService /** * 新增巡检报警记录 - * + * * @param recordBusbarAlarm 巡检报警记录 * @return 结果 */ @@ -57,7 +59,7 @@ public class RecordBusbarAlarmServiceImpl implements IRecordBusbarAlarmService /** * 修改巡检报警记录 - * + * * @param recordBusbarAlarm 巡检报警记录 * @return 结果 */ @@ -69,7 +71,7 @@ public class RecordBusbarAlarmServiceImpl implements IRecordBusbarAlarmService /** * 批量删除巡检报警记录 - * + * * @param objIds 需要删除的巡检报警记录主键 * @return 结果 */ @@ -81,7 +83,7 @@ public class RecordBusbarAlarmServiceImpl implements IRecordBusbarAlarmService /** * 删除巡检报警记录信息 - * + * * @param objId 巡检报警记录主键 * @return 结果 */ @@ -90,4 +92,10 @@ public class RecordBusbarAlarmServiceImpl implements IRecordBusbarAlarmService { return recordBusbarAlarmMapper.deleteRecordBusbarAlarmByObjId(objId); } + + + @Override + public List recordBusbarAlarmCount(RecordBusbarAlarm recordBusbarAlarm){ + return recordBusbarAlarmMapper.recordBusbarAlarmCount(recordBusbarAlarm); + } } diff --git a/ruoyi-module/src/main/resources/mapper/base/BaseBusbarInfoMapper.xml b/ruoyi-module/src/main/resources/mapper/base/BaseBusbarInfoMapper.xml index 8cd39f4..efe16c9 100644 --- a/ruoyi-module/src/main/resources/mapper/base/BaseBusbarInfoMapper.xml +++ b/ruoyi-module/src/main/resources/mapper/base/BaseBusbarInfoMapper.xml @@ -140,4 +140,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{objId} + + + + + diff --git a/ruoyi-module/src/main/resources/mapper/base/BaseCabinetInfoMapper.xml b/ruoyi-module/src/main/resources/mapper/base/BaseCabinetInfoMapper.xml index 0a44be4..8b010a4 100644 --- a/ruoyi-module/src/main/resources/mapper/base/BaseCabinetInfoMapper.xml +++ b/ruoyi-module/src/main/resources/mapper/base/BaseCabinetInfoMapper.xml @@ -117,4 +117,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{objId} + + + diff --git a/ruoyi-module/src/main/resources/mapper/record/RecordBusbarAlarmMapper.xml b/ruoyi-module/src/main/resources/mapper/record/RecordBusbarAlarmMapper.xml index c2ca75a..83948a6 100644 --- a/ruoyi-module/src/main/resources/mapper/record/RecordBusbarAlarmMapper.xml +++ b/ruoyi-module/src/main/resources/mapper/record/RecordBusbarAlarmMapper.xml @@ -114,7 +114,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - SELECT DATE(record_time) AS record_date, COUNT(*) AS alarm_count @@ -125,4 +125,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" GROUP BY DATE(record_time) + diff --git a/ruoyi-ui/src/api/base/baseBusbarInfo.js b/ruoyi-ui/src/api/base/baseBusbarInfo.js index 3163446..3b958a2 100644 --- a/ruoyi-ui/src/api/base/baseBusbarInfo.js +++ b/ruoyi-ui/src/api/base/baseBusbarInfo.js @@ -42,3 +42,13 @@ export function delBaseBusbarInfo(objId) { method: 'delete' }) } + +/** + * 统计母排数量 + * */ +export function countBusbar() { + return request({ + url: '/base/baseBusbarInfo/countBusbar', + method: 'post' + }) +} diff --git a/ruoyi-ui/src/api/base/baseCabinetInfo.js b/ruoyi-ui/src/api/base/baseCabinetInfo.js index 589f386..3c871a8 100644 --- a/ruoyi-ui/src/api/base/baseCabinetInfo.js +++ b/ruoyi-ui/src/api/base/baseCabinetInfo.js @@ -51,3 +51,13 @@ export function getBaseCabinetInfoTree(data) { data: data }) } + +/** + * 统计电柜数量 + * */ +export function countCabinet() { + return request({ + url: '/base/baseCabinetInfo/countCabinet', + method: 'post' + }) +}