diff --git a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertMessageController.java b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertMessageController.java index f0a2ba65..0553cf58 100644 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertMessageController.java +++ b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertMessageController.java @@ -109,9 +109,9 @@ public class AlertMessageController extends BaseController @PreAuthorize("@ss.hasPermi('inMonitoring:alertMessage:listByEquId')") @GetMapping("/{equId}") @ApiOperation("获取界面ALlertMessage信息") - public TableDataInfo listByEquId(@PathVariable("equId")Long equId) + public TableDataInfo listByEquId(@PathVariable("equId")String equId) { - startPage(); + List list = alertMessageService.selectAlertMessageListByEquId(equId); return getDataTable(list); } diff --git a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/message/messageController.java b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/message/messageController.java index d2642340..bf1a36e3 100644 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/message/messageController.java +++ b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/message/messageController.java @@ -1,9 +1,12 @@ package com.alops.web.controller.message; import com.alops.common.annotation.Log; +import com.alops.common.core.controller.BaseController; import com.alops.common.core.domain.AjaxResult; +import com.alops.common.core.page.TableDataInfo; import com.alops.common.enums.BusinessType; import com.alops.common.utils.SecurityUtils; +import com.alops.system.domain.EquType; import com.alops.system.domain.InternalMessage; import com.alops.system.domain.dto.AlertRuleAddDto; import com.alops.system.domain.vo.AlertRuleVo; @@ -11,13 +14,25 @@ import com.alops.system.service.IInternalMessageService; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; + + +import java.util.List; + +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; + +import org.springframework.web.bind.annotation.PathVariable; + +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; import java.util.List; +import static com.alops.common.utils.PageUtils.startPage; + @RestController @RequestMapping("/message") -public class messageController { +public class messageController extends BaseController { @Autowired public IInternalMessageService iInternalMessageService; @@ -51,14 +66,14 @@ public class messageController { @ApiOperation("获取用户消息列表") @Log(title = "【消息列表】") @GetMapping("/list") - public AjaxResult getMessageList() { + public TableDataInfo getMessageList() { + startPage(); // 获取当前登录用户ID Long userId = SecurityUtils.getLoginUser().getUserId(); - // 调用Service获取消息列表 List messages = iInternalMessageService.getMessagesByUserId(userId); + return getDataTable(messages); - return AjaxResult.success(messages); } diff --git a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquInterfaceController.java b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquInterfaceController.java index 99e8d4e0..e048e74b 100644 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquInterfaceController.java +++ b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquInterfaceController.java @@ -89,7 +89,7 @@ public class EquInterfaceController extends BaseController @ApiOperation("获取界面Interface接口信息") public TableDataInfo listByEquID(@PathVariable("equID") String equID) { - startPage(); + List list = equInterfaceService.selectEquInterfaceListByEquID(equID); return getDataTable(list); } diff --git a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquRoutingController.java b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquRoutingController.java index 67abccbb..4024f4ab 100644 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquRoutingController.java +++ b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquRoutingController.java @@ -56,7 +56,7 @@ public class EquRoutingController extends BaseController @ApiOperation("获取界面Routing信息") public TableDataInfo listByEquId(@PathVariable("equId") String equId) { - startPage(); + List list = equRoutingService.selectEquRoutingListByEquId(equId); return getDataTable(list); } diff --git a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquVeneerController.java b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquVeneerController.java index a63fc5b7..fa78f827 100644 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquVeneerController.java +++ b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquVeneerController.java @@ -56,7 +56,7 @@ public class EquVeneerController extends BaseController @ApiOperation("获取界面Venerr信息") public TableDataInfo listByEquId(@PathVariable("equID") String equID) { - startPage(); + List list = equVeneerService.selectEquVeneerListByEquId(equID); return getDataTable(list); } diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlertMessageMapper.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlertMessageMapper.java index 580fe2a6..ddfdcfbf 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlertMessageMapper.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlertMessageMapper.java @@ -47,7 +47,7 @@ public interface AlertMessageMapper public List selectAlertMessageList(AlertDto alertMessage); public List selectStaticAlertMessageList(); - public ArrayList selectAlertMessageByEquId(Long Equid); + public ArrayList selectAlertMessageByEquId(String Equid); /** * 统计设备类型、预警等级、时间的预警次数 diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertMessageService.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertMessageService.java index f528a1ad..03655ea1 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertMessageService.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertMessageService.java @@ -32,7 +32,7 @@ public interface IAlertMessageService */ public List selectAlertMessageList(AlertDto alertMessage); public List selectStaticAlertMessageList(); - public List selectAlertMessageListByEquId(Long equId); + public List selectAlertMessageListByEquId(String equId); /** * 统计设备类型、预警等级、时间的预警次数 diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertMessageServiceImpl.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertMessageServiceImpl.java index d0708772..18dedbae 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertMessageServiceImpl.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertMessageServiceImpl.java @@ -60,7 +60,7 @@ public class AlertMessageServiceImpl implements IAlertMessageService } @Override - public List selectAlertMessageListByEquId(Long equId) + public List selectAlertMessageListByEquId(String equId) { ArrayList alertMessagelist = alertMessageMapper.selectAlertMessageByEquId(equId); return alertMessagelist; diff --git a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlertMessageMapper.xml b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlertMessageMapper.xml index 1b51f2e1..ef1c2c8b 100644 --- a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlertMessageMapper.xml +++ b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlertMessageMapper.xml @@ -124,7 +124,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where am.id = #{id} - where g.equ_id = #{equid} AND a.batch = ( @@ -133,6 +133,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" WHERE equ_id = #{equid} ) GROUP BY a.id + ORDER BY a.occur_time DESC diff --git a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquInterfaceMapper.xml b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquInterfaceMapper.xml index 050c9063..9b70b38f 100644 --- a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquInterfaceMapper.xml +++ b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquInterfaceMapper.xml @@ -72,6 +72,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" diff --git a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquVlanMapper.xml b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquVlanMapper.xml index 3d2dc88c..dcbc9305 100644 --- a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquVlanMapper.xml +++ b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquVlanMapper.xml @@ -57,6 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"