fix:修改和新增逻辑

优化了部分有问题的代码并新增了部分代码
This commit is contained in:
weitang 2025-06-11 09:47:29 +08:00
parent 659d162c11
commit d8aeeb260b
9 changed files with 40 additions and 8 deletions

View File

@ -132,8 +132,8 @@ public class SubstationController {
@ApiOperation("获取变电站区域导航树") @ApiOperation("获取变电站区域导航树")
@GetMapping("/getSubstationAreaTree") @GetMapping("/getSubstationAreaTree")
public ResponseResult getSubstationAreaTree(String stationId) { public ResponseResult getSubstationAreaTree(String stationId,String areaName) {
List<Map<String, Object>> substationTree = substationService.getSubstationAreaTree(stationId); List<Map<String, Object>> substationTree = substationService.getSubstationAreaTree(stationId,areaName);
return ResponseResult.successData(substationTree); return ResponseResult.successData(substationTree);
} }

View File

@ -109,7 +109,7 @@ public interface ISubstationService extends IService<Substation> {
* 参数说明 * 参数说明
* 返回值说明: java.util.List<java.util.Map<java.lang.String,java.lang.Object>> * 返回值说明: java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
***********************************/ ***********************************/
List<Map<String, Object>> getSubstationAreaTree(String stationId); List<Map<String, Object>> getSubstationAreaTree(String stationId,String areaName);
/********************************** /**********************************
* 用途说明: 获取区域下所有间隔 * 用途说明: 获取区域下所有间隔

View File

@ -157,10 +157,10 @@ public class SubstationServiceImpl extends ServiceImpl<SubstationMapper, Substat
* 返回值说明: java.util.List<java.util.Map<java.lang.String,java.lang.Object>> * 返回值说明: java.util.List<java.util.Map<java.lang.String,java.lang.Object>>
***********************************/ ***********************************/
@Override @Override
public List<Map<String, Object>> getSubstationAreaTree(String stationId) { public List<Map<String, Object>> getSubstationAreaTree(String stationId,String areaName) {
Substation substation = this.substationMapper.selectById(stationId); Substation substation = this.substationMapper.selectById(stationId);
List<SubstationArea> list = List<SubstationArea> list =
substationAreaMapper.selectList(new LambdaQueryWrapper<SubstationArea>().eq(SubstationArea::getDatastatus, "1").eq(SubstationArea::getStationCode, substation.getStationCode()).orderByAsc(SubstationArea::getCustom1)); substationAreaMapper.selectList(new LambdaQueryWrapper<SubstationArea>().eq(SubstationArea::getDatastatus, "1").like(StrUtil.isNotBlank(areaName),SubstationArea::getAreaName,areaName).eq(SubstationArea::getStationCode, substation.getStationCode()).orderByAsc(SubstationArea::getCustom1));
return buildTreeArea(list); return buildTreeArea(list);
} }

View File

@ -89,6 +89,13 @@ public class AlarmLogController {
return ResponseResult.successData(maps); return ResponseResult.successData(maps);
} }
@GetMapping("/getAlarmDetail")
@ApiOperation("查询故障诊断详情信息")
public ResponseResult getAlarmDetail(String id) {
Map<String, Object> map=alarmLogService.getAlarmDetail(id);
return ResponseResult.successData(map);
}
@GetMapping("/getNotCheckAlarmCount") @GetMapping("/getNotCheckAlarmCount")
@ApiOperation("查询未审核告警和数量") @ApiOperation("查询未审核告警和数量")
public ResponseResult getNotCheckAlarmCount(String stationId) { public ResponseResult getNotCheckAlarmCount(String stationId) {

View File

@ -61,4 +61,5 @@ public interface AlarmLogMapper extends BaseMapper<AlarmLog> {
Page<Map<String, Object>> getAlarmLogPage(Page<Map<String, Object>> page, String stationCode, String taskAlarmType, String alarmLevel, String checkFlag, String alarmSourceType, String startDate, String endDate); Page<Map<String, Object>> getAlarmLogPage(Page<Map<String, Object>> page, String stationCode, String taskAlarmType, String alarmLevel, String checkFlag, String alarmSourceType, String startDate, String endDate);
Map<String, Object> getAlarmDetail(String id);
} }

View File

@ -92,4 +92,6 @@ public interface IAlarmLogService extends IService<AlarmLog> {
***********************************/ ***********************************/
void doAlaramRecord(String from,String type,String slaveIp,String address,String value); void doAlaramRecord(String from,String type,String slaveIp,String address,String value);
Map<String, Object> getAlarmDetail(String id);
} }

View File

@ -2272,6 +2272,11 @@ public class AlarmLogServiceImpl extends ServiceImpl<AlarmLogMapper, AlarmLog> i
} }
@Override
public Map<String, Object> getAlarmDetail(String id) {
return alarmLogMapper.getAlarmDetail(id);
}
/** /**
* 填充告警记录表 * 填充告警记录表
* *

View File

@ -158,7 +158,7 @@
<select id="countDeviceTypeStatus" resultType="java.util.Map"> <select id="countDeviceTypeStatus" resultType="java.util.Map">
SELECT SELECT
md.device_type, IFNULL(md.device_type, 'all') AS device_type,
COUNT(*) AS total, COUNT(*) AS total,
SUM(CASE WHEN md.`status` = '01' THEN 1 ELSE 0 END) AS online_count SUM(CASE WHEN md.`status` = '01' THEN 1 ELSE 0 END) AS online_count
FROM FROM
@ -177,8 +177,8 @@
AND md.device_type = #{type} AND md.device_type = #{type}
</if> </if>
GROUP BY GROUP BY
md.device_type md.device_type WITH ROLLUP
ORDER BY ORDER BY
md.device_type md.device_type;
</select> </select>
</mapper> </mapper>

View File

@ -247,6 +247,23 @@
</if> </if>
ORDER BY al.alarm_date DESC ORDER BY al.alarm_date DESC
</select> </select>
<select id="getAlarmDetail" resultType="java.util.Map">
SELECT
al.id,
al.content,
al.alarm_date,
al.`value`,
sm.device_type,
sm.patroldevice_json,
sm.file_url,
sm.factory_lifespan,
sm.run_time
FROM
iis_alarm_log al
INNER JOIN iis_substation_maindevice sm ON al.main_device_id = sm.main_device_id
WHERE
al.id = #{id}
</select>
<!-- <select id="getDeviceAlarmRecordPage"--> <!-- <select id="getDeviceAlarmRecordPage"-->
<!-- resultType="com.yfd.platform.modules.auxcontrol.domain.DeviceAlarmRecord">--> <!-- resultType="com.yfd.platform.modules.auxcontrol.domain.DeviceAlarmRecord">-->