From 7f3927ca6053744a4a88764db42be12e2d6ae3c2 Mon Sep 17 00:00:00 2001 From: zch Date: Mon, 16 Dec 2024 09:41:09 +0800 Subject: [PATCH] =?UTF-8?q?add(record):=20=E6=96=B0=E5=A2=9E=E7=9C=8B?= =?UTF-8?q?=E6=9D=BF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在 RecordBusbarTempController 中添加 boardTempList 方法,用于获取母排测温记录列表 - 在 RecordBusbarTempMapper 中添加 boardTempList 方法,用于查询每个设备的最新一条测温记录 - 在 RecordBusbarTempServiceImpl 中实现 boardTempList 方法 - 在 RecordBusbarTemp 模型中添加 cabinetAlias 字段,用于存储电柜别名 - 更新 RecordBusbarTempMapper.xml,添加新的查询语句和结果映射 --- .../ems/base/EmsBaseMonitorInfoMapper.xml | 1 + .../controller/BaseCabinetInfoController.java | 1 - .../base/mapper/BaseCabinetInfoMapper.java | 3 ++ .../base/service/IBaseCabinetInfoService.java | 3 ++ .../impl/BaseCabinetInfoServiceImpl.java | 3 ++ .../RecordBusbarAlarmController.java | 8 +++- .../RecordBusbarTempController.java | 14 ++++++ .../ruoyi/record/domain/RecordBusbarTemp.java | 11 +++++ .../VO/RecordBusbarAlarmCountResult.java | 3 ++ .../record/mapper/RecordBusbarTempMapper.java | 18 ++++---- .../service/IRecordBusbarTempService.java | 2 + .../impl/RecordBusbarTempServiceImpl.java | 5 +++ .../mapper/record/RecordBusbarTempMapper.xml | 43 +++++++++++++++++++ 13 files changed, 104 insertions(+), 11 deletions(-) diff --git a/ruoyi-ems/src/main/resources/mapper/ems/base/EmsBaseMonitorInfoMapper.xml b/ruoyi-ems/src/main/resources/mapper/ems/base/EmsBaseMonitorInfoMapper.xml index 2577fad..00d2138 100644 --- a/ruoyi-ems/src/main/resources/mapper/ems/base/EmsBaseMonitorInfoMapper.xml +++ b/ruoyi-ems/src/main/resources/mapper/ems/base/EmsBaseMonitorInfoMapper.xml @@ -175,4 +175,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + 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 bcf44b7..5622a34 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 @@ -135,5 +135,4 @@ public class BaseCabinetInfoController extends BaseController return baseCabinetInfoService.countBaseCabinetInfo(); } - } 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 33db17d..5417da5 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 @@ -59,5 +59,8 @@ public interface BaseCabinetInfoMapper */ public int deleteBaseCabinetInfoByObjIds(Long[] objIds); + /** + * 统计电柜数量 + * */ public int countBaseCabinetInfo(); } 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 4785804..9dece02 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 @@ -69,5 +69,8 @@ public interface IBaseCabinetInfoService */ public List selectCabinetInfoTreeList(BaseCabinetInfo baseCabinetInfo); + /** + * 统计电柜数量 + * */ public int countBaseCabinetInfo(); } 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 f36bc32..fadd717 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 @@ -124,6 +124,9 @@ public class BaseCabinetInfoServiceImpl implements IBaseCabinetInfoService 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/controller/RecordBusbarAlarmController.java b/ruoyi-module/src/main/java/com/ruoyi/record/controller/RecordBusbarAlarmController.java index 3350707..6e23278 100644 --- a/ruoyi-module/src/main/java/com/ruoyi/record/controller/RecordBusbarAlarmController.java +++ b/ruoyi-module/src/main/java/com/ruoyi/record/controller/RecordBusbarAlarmController.java @@ -1,6 +1,8 @@ package com.ruoyi.record.controller; +import java.util.Collections; import java.util.List; +import java.util.concurrent.Callable; import javax.servlet.http.HttpServletResponse; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; @@ -113,13 +115,15 @@ public class RecordBusbarAlarmController extends BaseController public AjaxResult recordBusbarAlarmList(RecordBusbarAlarm recordBusbarAlarm) { List list = recordBusbarAlarmService.selectRecordBusbarAlarmList(recordBusbarAlarm); + // 反转列表顺序 + Collections.reverse(list); return success(list); } - //记录母排近七天每天一天的巡检记录次数。 + //记录母排测温近七天每天一天的巡检记录次数。 @PostMapping("/recordBusbarAlarmCount") - public AjaxResult recordBusbarAlarmCount(@RequestBody RecordBusbarAlarm recordBusbarAlarm) { + public AjaxResult recordBusbarAlarmCount(RecordBusbarAlarm recordBusbarAlarm) { return AjaxResult.success(recordBusbarAlarmService.recordBusbarAlarmCount(recordBusbarAlarm)); } } diff --git a/ruoyi-module/src/main/java/com/ruoyi/record/controller/RecordBusbarTempController.java b/ruoyi-module/src/main/java/com/ruoyi/record/controller/RecordBusbarTempController.java index 62689bc..91aa832 100644 --- a/ruoyi-module/src/main/java/com/ruoyi/record/controller/RecordBusbarTempController.java +++ b/ruoyi-module/src/main/java/com/ruoyi/record/controller/RecordBusbarTempController.java @@ -158,4 +158,18 @@ public class RecordBusbarTempController extends BaseController return success(list); } + /** + * 获取母排测温记录列表。 + * @param recordBusbarTemp 母线温度记录对象,用于封装查询条件。 + * @return 返回一个AjaxResult对象,其中包含查询到的母线温度记录列表。 + */ + @PostMapping("/boardTempList") + public AjaxResult boardTempList(RecordBusbarTemp recordBusbarTemp) + { + List list = recordBusbarTempService.boardTempList(recordBusbarTemp); + return success(list); + } + + + } diff --git a/ruoyi-module/src/main/java/com/ruoyi/record/domain/RecordBusbarTemp.java b/ruoyi-module/src/main/java/com/ruoyi/record/domain/RecordBusbarTemp.java index c3a6ddb..fdfd853 100644 --- a/ruoyi-module/src/main/java/com/ruoyi/record/domain/RecordBusbarTemp.java +++ b/ruoyi-module/src/main/java/com/ruoyi/record/domain/RecordBusbarTemp.java @@ -85,6 +85,9 @@ public class RecordBusbarTemp extends BaseEntity @Excel(name = "巡检模式:1-自动;2-快速;3-定点") private Long routModel; + /** 电柜别名 */ + private String cabinetAlias; + public void setObjId(Long objId) { this.objId = objId; @@ -228,6 +231,13 @@ public class RecordBusbarTemp extends BaseEntity public void setRoutModel(Long routModel) { this.routModel = routModel; } + + public String getCabinetAlias() { + return cabinetAlias; + } + public void setCabinetAlias(String cabinetAlias) { + this.cabinetAlias = cabinetAlias; + } @Override public String toString() { @@ -249,6 +259,7 @@ public class RecordBusbarTemp extends BaseEntity .append("updatedTime", getUpdatedTime()) .append("recordTime", getRecordTime()) .append("routModel", getRoutModel()) + .append("cabinetAlias", getCabinetAlias()) .toString(); } } diff --git a/ruoyi-module/src/main/java/com/ruoyi/record/domain/VO/RecordBusbarAlarmCountResult.java b/ruoyi-module/src/main/java/com/ruoyi/record/domain/VO/RecordBusbarAlarmCountResult.java index 837d7f3..0f51a09 100644 --- a/ruoyi-module/src/main/java/com/ruoyi/record/domain/VO/RecordBusbarAlarmCountResult.java +++ b/ruoyi-module/src/main/java/com/ruoyi/record/domain/VO/RecordBusbarAlarmCountResult.java @@ -1,5 +1,6 @@ package com.ruoyi.record.domain.VO; +import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.record.domain.RecordBusbarAlarm; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -8,7 +9,9 @@ import java.util.Date; public class RecordBusbarAlarmCountResult extends RecordBusbarAlarm { + @JsonFormat(pattern = "yyyy-MM") private Date recordDate; + private int alarmCount; public Date getRecordDate() { diff --git a/ruoyi-module/src/main/java/com/ruoyi/record/mapper/RecordBusbarTempMapper.java b/ruoyi-module/src/main/java/com/ruoyi/record/mapper/RecordBusbarTempMapper.java index da2a5ee..cc2068b 100644 --- a/ruoyi-module/src/main/java/com/ruoyi/record/mapper/RecordBusbarTempMapper.java +++ b/ruoyi-module/src/main/java/com/ruoyi/record/mapper/RecordBusbarTempMapper.java @@ -5,15 +5,15 @@ import com.ruoyi.record.domain.RecordBusbarTemp; /** * 母排测温信息Mapper接口 - * + * * @author zangch * @date 2024-11-07 */ -public interface RecordBusbarTempMapper +public interface RecordBusbarTempMapper { /** * 查询母排测温信息 - * + * * @param objId 母排测温信息主键 * @return 母排测温信息 */ @@ -21,7 +21,7 @@ public interface RecordBusbarTempMapper /** * 查询母排测温信息列表 - * + * * @param recordBusbarTemp 母排测温信息 * @return 母排测温信息集合 */ @@ -29,7 +29,7 @@ public interface RecordBusbarTempMapper /** * 新增母排测温信息 - * + * * @param recordBusbarTemp 母排测温信息 * @return 结果 */ @@ -37,7 +37,7 @@ public interface RecordBusbarTempMapper /** * 修改母排测温信息 - * + * * @param recordBusbarTemp 母排测温信息 * @return 结果 */ @@ -45,7 +45,7 @@ public interface RecordBusbarTempMapper /** * 删除母排测温信息 - * + * * @param objId 母排测温信息主键 * @return 结果 */ @@ -53,9 +53,11 @@ public interface RecordBusbarTempMapper /** * 批量删除母排测温信息 - * + * * @param objIds 需要删除的数据主键集合 * @return 结果 */ public int deleteRecordBusbarTempByObjIds(Long[] objIds); + + public List boardTempList(RecordBusbarTemp recordBusbarTemp); } diff --git a/ruoyi-module/src/main/java/com/ruoyi/record/service/IRecordBusbarTempService.java b/ruoyi-module/src/main/java/com/ruoyi/record/service/IRecordBusbarTempService.java index d755c3a..b36d8a1 100644 --- a/ruoyi-module/src/main/java/com/ruoyi/record/service/IRecordBusbarTempService.java +++ b/ruoyi-module/src/main/java/com/ruoyi/record/service/IRecordBusbarTempService.java @@ -81,4 +81,6 @@ public interface IRecordBusbarTempService * @return 如果文件存在,返回包含文件资源的响应实体;如果文件不存在,返回404状态。 */ public ResponseEntity getVisiblePhoto(String filePath); + + public List boardTempList(RecordBusbarTemp recordBusbarTemp); } diff --git a/ruoyi-module/src/main/java/com/ruoyi/record/service/impl/RecordBusbarTempServiceImpl.java b/ruoyi-module/src/main/java/com/ruoyi/record/service/impl/RecordBusbarTempServiceImpl.java index 6d1398f..29f5e01 100644 --- a/ruoyi-module/src/main/java/com/ruoyi/record/service/impl/RecordBusbarTempServiceImpl.java +++ b/ruoyi-module/src/main/java/com/ruoyi/record/service/impl/RecordBusbarTempServiceImpl.java @@ -236,4 +236,9 @@ public class RecordBusbarTempServiceImpl implements IRecordBusbarTempService return ResponseEntity.notFound().build(); } } + + @Override + public List boardTempList(RecordBusbarTemp recordBusbarTemp){ + return recordBusbarTempMapper.boardTempList(recordBusbarTemp); + } } diff --git a/ruoyi-module/src/main/resources/mapper/record/RecordBusbarTempMapper.xml b/ruoyi-module/src/main/resources/mapper/record/RecordBusbarTempMapper.xml index bd2fd1d..a7b01d8 100644 --- a/ruoyi-module/src/main/resources/mapper/record/RecordBusbarTempMapper.xml +++ b/ruoyi-module/src/main/resources/mapper/record/RecordBusbarTempMapper.xml @@ -24,6 +24,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + + + + + + + + + + + + + + + + + select objId, busbar_code, @@ -145,4 +166,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{objId} + +