From 2ee4007bd19e09eb223500d8eab1f259c78cd6d6 Mon Sep 17 00:00:00 2001 From: xiaohuo <14141624+dsgfhrh@user.noreply.gitee.com> Date: Mon, 8 Sep 2025 20:32:21 +0800 Subject: [PATCH] =?UTF-8?q?Revert=20"snmp=E5=8D=8F=E8=AE=AE=E9=87=87?= =?UTF-8?q?=E9=9B=86+=E9=A2=84=E8=AD=A6=E8=A7=84=E5=88=99=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0+=E6=89=A7=E8=A1=8C=E9=A2=84=E8=AD=A6=E8=A7=84?= =?UTF-8?q?=E5=88=99+=E6=95=B0=E6=8D=AE=E5=BA=93=E6=89=80=E6=9C=89?= =?UTF-8?q?=E5=AE=9E=E4=BD=93"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a3ea4d900c8c88e3fb817d4785b37b4f4789aa7b. --- ALOps_sys_backend/alops-admin/pom.xml | 7 - .../equManagement/EquBaseController.java | 21 +- .../equManagement/EquOidController.java | 106 ------ .../equManagement/EquVlanController.java | 105 ------ .../ScheduleRulesController.java | 48 +-- .../AlarmRuleController.java | 106 ++++++ .../AlertRuleConditionController.java | 105 ------ .../AlertRuleController.java | 164 --------- .../DictAlarmParamController.java | 106 ------ ...eController.java => FauStaController.java} | 62 ++-- .../controller/tool/EquGatherController.java | 105 ------ .../tool/EquInterfaceController.java | 105 ------ .../controller/tool/EquRoutingController.java | 105 ------ .../controller/tool/EquVeneerController.java | 105 ------ .../src/main/resources/application.yml | 19 +- .../alops/common/core/domain/BaseEntity.java | 4 +- ALOps_sys_backend/alops-system/pom.xml | 8 - .../com/alops/system/domain/AlarmRule.java | 205 ++++++++++++ .../com/alops/system/domain/AlertRule.java | 191 ----------- .../system/domain/AlertRuleCondition.java | 142 -------- .../alops/system/domain/DictAlarmParam.java | 97 ------ .../java/com/alops/system/domain/EquBase.java | 88 +++-- .../com/alops/system/domain/EquGather.java | 64 +--- .../com/alops/system/domain/EquInterface.java | 87 ++--- .../java/com/alops/system/domain/EquOid.java | 236 ------------- .../com/alops/system/domain/EquRouting.java | 99 ------ .../java/com/alops/system/domain/EquValn.java | 101 ------ .../com/alops/system/domain/EquVeneer.java | 84 ----- .../java/com/alops/system/domain/EquVlan.java | 116 ------- .../domain/{AlertMessage.java => FauSta.java} | 24 +- .../alops/system/domain/InternalMessage.java | 83 ----- .../system/domain/dto/AlertRuleAddDto.java | 18 - .../java/com/alops/system/domain/vo/Code.java | 17 - .../system/domain/vo/EquGatherInsertInfo.java | 20 -- .../system/domain/vo/EquGatherResult.java | 17 - .../system/domain/vo/GatherEntities.java | 20 -- .../system/domain/vo/queryEquBaseVO.java | 295 ----------------- .../alops/system/mapper/AlarmRuleMapper.java | 64 ++++ .../system/mapper/AlertMessageMapper.java | 73 ---- .../mapper/AlertRuleConditionMapper.java | 72 ---- .../alops/system/mapper/AlertRuleMapper.java | 69 ---- .../system/mapper/DictAlarmParamMapper.java | 67 ---- .../alops/system/mapper/EquBaseMapper.java | 26 +- .../alops/system/mapper/EquGatherMapper.java | 73 ---- .../system/mapper/EquInterfaceMapper.java | 69 ---- .../com/alops/system/mapper/EquOidMapper.java | 72 ---- .../alops/system/mapper/EquRoutingMapper.java | 67 ---- .../alops/system/mapper/EquVeneerMapper.java | 66 ---- .../alops/system/mapper/EquVlanMapper.java | 67 ---- .../com/alops/system/mapper/FauStaMapper.java | 65 ++++ .../system/mapper/InternalMessageMapper.java | 73 ---- .../alops/system/mapper/SysUserMapper.java | 5 - .../service/ConvertRawValueService.java | 12 - .../system/service/IAlarmRuleService.java | 62 ++++ .../system/service/IAlertLaunchService.java | 7 - .../service/IAlertRuleConditionService.java | 62 ---- .../system/service/IAlertRuleService.java | 65 ---- .../system/service/IAlertSenderService.java | 7 - .../service/IDictAlarmParamService.java | 64 ---- .../alops/system/service/IEquBaseService.java | 3 +- .../system/service/IEquGatherService.java | 62 ---- .../system/service/IEquInterfaceService.java | 64 ---- .../alops/system/service/IEquOidService.java | 62 ---- .../system/service/IEquRoutingService.java | 62 ---- .../system/service/IEquVeneerService.java | 62 ---- .../alops/system/service/IEquVlanService.java | 62 ---- ...essageService.java => IFauStaService.java} | 24 +- .../system/service/IScheduleRulesService.java | 8 - .../system/service/MemoryToolService.java | 18 - .../com/alops/system/service/SnmpService.java | 11 - .../service/impl/AlarmRuleServiceImpl.java | 98 ++++++ .../service/impl/AlertLaunchServiceImpl.java | 155 --------- .../service/impl/AlertMessageServiceImpl.java | 94 ------ .../impl/AlertRuleConditionServiceImpl.java | 94 ------ .../service/impl/AlertRuleServiceImpl.java | 312 ------------------ .../service/impl/AlertSenderServiceImpl.java | 111 ------- .../impl/ConvertRawValueServiceImpl.java | 68 ---- .../impl/DictAlarmParamServiceImpl.java | 99 ------ .../service/impl/EquBaseServiceImpl.java | 3 +- .../service/impl/EquGatherServiceImpl.java | 94 ------ .../service/impl/EquInterfaceServiceImpl.java | 94 ------ .../service/impl/EquOidServiceImpl.java | 98 ------ .../service/impl/EquRoutingServiceImpl.java | 94 ------ .../service/impl/EquVeneerServiceImpl.java | 94 ------ .../service/impl/EquVlanServiceImpl.java | 97 ------ .../service/impl/FauStaServiceImpl.java | 94 ++++++ .../service/impl/MemoryToolServiceImpl.java | 297 ----------------- .../impl/ScheduleRulesServiceImpl.java | 287 ++++------------ .../system/service/impl/SnmpServiceImpl.java | 299 ----------------- .../typeHandlers/StringToLongTypeHandler.java | 39 --- .../mapper/system/AlarmRuleMapper.xml | 110 ++++++ .../system/AlertRuleConditionMapper.xml | 93 ------ .../mapper/system/AlertRuleMapper.xml | 131 -------- .../mapper/system/DictAlarmParamMapper.xml | 77 ----- .../resources/mapper/system/EquBaseMapper.xml | 49 ++- .../mapper/system/EquGatherMapper.xml | 166 ---------- .../mapper/system/EquInterfaceMapper.xml | 133 -------- .../resources/mapper/system/EquOidMapper.xml | 146 -------- .../mapper/system/EquRoutingMapper.xml | 83 ----- .../mapper/system/EquVeneerMapper.xml | 79 ----- .../resources/mapper/system/EquVlanMapper.xml | 99 ------ ...lertMessageMapper.xml => FauStaMapper.xml} | 49 +-- .../mapper/system/InternalMessageMapper.xml | 81 ----- .../resources/mapper/system/SysUserMapper.xml | 10 +- .../mapper/system/mybatis-config.xml | 11 - ALOps_sys_backend/pom.xml | 1 - ALOps_sys_fe/alops-ui/.env.development | 2 +- ALOps_sys_fe/alops-ui/package.json | 1 - ALOps_sys_fe/alops-ui/vue.config.js | 2 +- 109 files changed, 1054 insertions(+), 7820 deletions(-) delete mode 100644 ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquOidController.java delete mode 100644 ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquVlanController.java create mode 100644 ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlarmRuleController.java delete mode 100644 ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertRuleConditionController.java delete mode 100644 ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertRuleController.java delete mode 100644 ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/DictAlarmParamController.java rename ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/{AlertMessageController.java => FauStaController.java} (54%) delete mode 100644 ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquGatherController.java delete mode 100644 ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquInterfaceController.java delete mode 100644 ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquRoutingController.java delete mode 100644 ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquVeneerController.java create mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/AlarmRule.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/AlertRule.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/AlertRuleCondition.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/DictAlarmParam.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquOid.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquRouting.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquValn.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquVeneer.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquVlan.java rename ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/{AlertMessage.java => FauSta.java} (91%) delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/InternalMessage.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/AlertRuleAddDto.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/Code.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/EquGatherInsertInfo.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/EquGatherResult.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/GatherEntities.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/queryEquBaseVO.java create mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlarmRuleMapper.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlertMessageMapper.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlertRuleConditionMapper.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlertRuleMapper.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/DictAlarmParamMapper.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquGatherMapper.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquInterfaceMapper.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquOidMapper.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquRoutingMapper.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquVeneerMapper.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquVlanMapper.java create mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/FauStaMapper.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/InternalMessageMapper.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/ConvertRawValueService.java create mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlarmRuleService.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertLaunchService.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertRuleConditionService.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertRuleService.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertSenderService.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IDictAlarmParamService.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquGatherService.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquInterfaceService.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquOidService.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquRoutingService.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquVeneerService.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquVlanService.java rename ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/{IAlertMessageService.java => IFauStaService.java} (55%) delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/MemoryToolService.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/SnmpService.java create mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlarmRuleServiceImpl.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertLaunchServiceImpl.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertMessageServiceImpl.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertRuleConditionServiceImpl.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertRuleServiceImpl.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertSenderServiceImpl.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/ConvertRawValueServiceImpl.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/DictAlarmParamServiceImpl.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquGatherServiceImpl.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquInterfaceServiceImpl.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquOidServiceImpl.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquRoutingServiceImpl.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquVeneerServiceImpl.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquVlanServiceImpl.java create mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/FauStaServiceImpl.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/MemoryToolServiceImpl.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/SnmpServiceImpl.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/typeHandlers/StringToLongTypeHandler.java create mode 100644 ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlarmRuleMapper.xml delete mode 100644 ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlertRuleConditionMapper.xml delete mode 100644 ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlertRuleMapper.xml delete mode 100644 ALOps_sys_backend/alops-system/src/main/resources/mapper/system/DictAlarmParamMapper.xml delete mode 100644 ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquGatherMapper.xml delete mode 100644 ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquInterfaceMapper.xml delete mode 100644 ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquOidMapper.xml delete mode 100644 ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquRoutingMapper.xml delete mode 100644 ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquVeneerMapper.xml delete mode 100644 ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquVlanMapper.xml rename ALOps_sys_backend/alops-system/src/main/resources/mapper/system/{AlertMessageMapper.xml => FauStaMapper.xml} (76%) delete mode 100644 ALOps_sys_backend/alops-system/src/main/resources/mapper/system/InternalMessageMapper.xml delete mode 100644 ALOps_sys_backend/alops-system/src/main/resources/mapper/system/mybatis-config.xml diff --git a/ALOps_sys_backend/alops-admin/pom.xml b/ALOps_sys_backend/alops-admin/pom.xml index c5e46b6a..8a8c1b4c 100644 --- a/ALOps_sys_backend/alops-admin/pom.xml +++ b/ALOps_sys_backend/alops-admin/pom.xml @@ -76,13 +76,6 @@ alops-generator - - - org.springframework.boot - spring-boot-starter-mail - 2.5.15 - - diff --git a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquBaseController.java b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquBaseController.java index cd4ed9bc..50cecfb1 100644 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquBaseController.java +++ b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquBaseController.java @@ -13,7 +13,6 @@ import com.alops.common.enums.BusinessType; import com.alops.common.utils.poi.ExcelUtil; import com.alops.system.domain.EquBase; import com.alops.system.domain.dto.EquBaseQueryDto; -import com.alops.system.domain.vo.queryEquBaseVO; import com.alops.system.service.IEquBaseService; import io.swagger.annotations.ApiOperation; import org.springframework.security.access.prepost.PreAuthorize; @@ -49,7 +48,7 @@ public class EquBaseController extends BaseController @ApiOperation("查询符合参数设备信息") public AjaxResult list(EquBaseQueryDto equBaseQueryDto ) { startPage(); - List list = equBaseService.selectEquBaseList(equBaseQueryDto); + List list = equBaseService.selectEquBaseList(equBaseQueryDto); TableDataInfo tableDataInfo = getDataTable(list); Map data = new HashMap<>(); data.put("total", tableDataInfo.getTotal()); @@ -69,15 +68,15 @@ public class EquBaseController extends BaseController /** * 导出设备基本信息列表 */ -// @PreAuthorize("@ss.hasPermi('equipment:base:export')") -// @Log(title = "设备档案", businessType = BusinessType.EXPORT) -// @PostMapping("/export") -//// public void export(HttpServletResponse response, EquBaseQueryDto equBaseQueryDto) -//// { -//// List list = equBaseService.selectEquBaseList(equBaseQueryDto); -//// ExcelUtil util = new ExcelUtil(EquBase.class); -//// util.exportExcel(response, list, "设备基本信息数据"); -//// } + @PreAuthorize("@ss.hasPermi('equipment:base:export')") + @Log(title = "设备档案", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, EquBaseQueryDto equBaseQueryDto) + { + List list = equBaseService.selectEquBaseList(equBaseQueryDto); + ExcelUtil util = new ExcelUtil(EquBase.class); + util.exportExcel(response, list, "设备基本信息数据"); + } /** * 获取设备基本信息详细信息 diff --git a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquOidController.java b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquOidController.java deleted file mode 100644 index b15c41d9..00000000 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquOidController.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.alops.web.controller.equManagement; - -import java.util.List; -import javax.servlet.http.HttpServletResponse; - -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.poi.ExcelUtil; -import com.alops.system.domain.EquOid; -import com.alops.system.service.IEquOidService; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * OID配置信息Controller - * - * @author ruoyi - * @date 2025-08-15 - */ -@RestController -@RequestMapping("/system/oid") -public class EquOidController extends BaseController -{ - @Autowired - private IEquOidService equOidService; - - /** - * 查询OID配置信息列表 - * - */ - @PreAuthorize("@ss.hasPermi('system:oid:list')") - @GetMapping("/list") - public TableDataInfo list(EquOid equOid) - { - startPage(); - List list = equOidService.selectEquOidList(equOid); - return getDataTable(list); - } - - /** - * 导出OID配置信息列表 - */ - @PreAuthorize("@ss.hasPermi('system:oid:export')") - @Log(title = "OID配置信息", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, EquOid equOid) - { - List list = equOidService.selectEquOidList(equOid); - ExcelUtil util = new ExcelUtil(EquOid.class); - util.exportExcel(response, list, "OID配置信息数据"); - } - - /** - * 获取OID配置信息详细信息 - */ - @PreAuthorize("@ss.hasPermi('system:oid:query')") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) - { - return success(equOidService.selectEquOidById(id)); - } - - /** - * 新增OID配置信息 - */ - @PreAuthorize("@ss.hasPermi('system:oid:add')") - @Log(title = "OID配置信息", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody EquOid equOid) - { - return toAjax(equOidService.insertEquOid(equOid)); - } - - /** - * 修改OID配置信息 - */ - @PreAuthorize("@ss.hasPermi('system:oid:edit')") - @Log(title = "OID配置信息", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody EquOid equOid) - { - return toAjax(equOidService.updateEquOid(equOid)); - } - - /** - * 删除OID配置信息 - */ - @PreAuthorize("@ss.hasPermi('system:oid:remove')") - @Log(title = "OID配置信息", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) - { - return toAjax(equOidService.deleteEquOidByIds(ids)); - } -} diff --git a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquVlanController.java b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquVlanController.java deleted file mode 100644 index 1067a1e8..00000000 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquVlanController.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.alops.web.controller.equManagement; - -import java.util.List; -import javax.servlet.http.HttpServletResponse; - -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.poi.ExcelUtil; -import com.alops.system.domain.EquVlan; -import com.alops.system.service.IEquVlanService; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * 【请填写功能名称】Controller - * - * @author ruoyi - * @date 2025-08-15 - */ -@RestController -@RequestMapping("/system/vlan") -public class EquVlanController extends BaseController -{ - @Autowired - private IEquVlanService equVlanService; - - /** - * 查询【请填写功能名称】列表 - */ - @PreAuthorize("@ss.hasPermi('system:vlan:list')") - @GetMapping("/list") - public TableDataInfo list(EquVlan equVlan) - { - startPage(); - List list = equVlanService.selectEquVlanList(equVlan); - return getDataTable(list); - } - - /** - * 导出【请填写功能名称】列表 - */ - @PreAuthorize("@ss.hasPermi('system:vlan:export')") - @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, EquVlan equVlan) - { - List list = equVlanService.selectEquVlanList(equVlan); - ExcelUtil util = new ExcelUtil(EquVlan.class); - util.exportExcel(response, list, "【请填写功能名称】数据"); - } - - /** - * 获取【请填写功能名称】详细信息 - */ - @PreAuthorize("@ss.hasPermi('system:vlan:query')") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") String id) - { - return success(equVlanService.selectEquVlanById(id)); - } - - /** - * 新增【请填写功能名称】 - */ - @PreAuthorize("@ss.hasPermi('system:vlan:add')") - @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody EquVlan equVlan) - { - return toAjax(equVlanService.insertEquVlan(equVlan)); - } - - /** - * 修改【请填写功能名称】 - */ - @PreAuthorize("@ss.hasPermi('system:vlan:edit')") - @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody EquVlan equVlan) - { - return toAjax(equVlanService.updateEquVlan(equVlan)); - } - - /** - * 删除【请填写功能名称】 - */ - @PreAuthorize("@ss.hasPermi('system:vlan:remove')") - @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable String[] ids) - { - return toAjax(equVlanService.deleteEquVlanByIds(ids)); - } -} diff --git a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/ScheduleRulesController.java b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/ScheduleRulesController.java index c17a66cb..85f5b72c 100644 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/ScheduleRulesController.java +++ b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/ScheduleRulesController.java @@ -1,7 +1,6 @@ package com.alops.web.controller.equManagement; import java.util.List; -import java.util.concurrent.ExecutionException; import javax.servlet.http.HttpServletResponse; import com.alops.common.annotation.Log; @@ -11,9 +10,7 @@ import com.alops.common.core.page.TableDataInfo; import com.alops.common.enums.BusinessType; import com.alops.common.utils.poi.ExcelUtil; import com.alops.system.domain.ScheduleRules; -import com.alops.system.domain.vo.Code; import com.alops.system.service.IScheduleRulesService; -import io.swagger.annotations.ApiOperation; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -27,42 +24,21 @@ import org.springframework.web.bind.annotation.RestController; /** * 定时采集规则Controller - * + * * @author ruoyi * @date 2025-08-03 */ @RestController -@RequestMapping("/equipmentRule") +@RequestMapping("/system/rules") public class ScheduleRulesController extends BaseController { @Autowired private IScheduleRulesService scheduleRulesService; - /** - * 立即执行按钮 - */ - @PreAuthorize("@ss.hasPermi('equipment:rules:list')") - @GetMapping("/protoCollect") - @ApiOperation("立即执行") - public AjaxResult protoCollect() throws ExecutionException, InterruptedException { - // 调用 Service 层执行采集,返回业务状态码 - int code = scheduleRulesService.executeImmediately(); - - // 根据返回码生成 AjaxResult - if(code == Code.SUCCESS){ - return AjaxResult.success("采集完成"); - } else if(code == Code.PARTIAL){ - return AjaxResult.warn("部分设备采集失败"); - } else { - return AjaxResult.error("采集失败"); - } - } - - /** * 查询定时采集规则列表 */ - @PreAuthorize("@ss.hasPermi('equipment:rules:list')") + @PreAuthorize("@ss.hasPermi('system:rules:list')") @GetMapping("/list") public TableDataInfo list(ScheduleRules scheduleRules) { @@ -74,7 +50,7 @@ public class ScheduleRulesController extends BaseController /** * 导出定时采集规则列表 */ - @PreAuthorize("@ss.hasPermi('equipment:rules:export')") + @PreAuthorize("@ss.hasPermi('system:rules:export')") @Log(title = "定时采集规则", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, ScheduleRules scheduleRules) @@ -87,19 +63,17 @@ public class ScheduleRulesController extends BaseController /** * 获取定时采集规则详细信息 */ - @PreAuthorize("@ss.hasPermi('equipment:rules:query')") + @PreAuthorize("@ss.hasPermi('system:rules:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { return success(scheduleRulesService.selectScheduleRulesById(id)); } - - /** * 新增定时采集规则 */ - @PreAuthorize("@ss.hasPermi('equipment:rules:add')") + @PreAuthorize("@ss.hasPermi('system:rules:add')") @Log(title = "定时采集规则", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody ScheduleRules scheduleRules) @@ -107,12 +81,10 @@ public class ScheduleRulesController extends BaseController return toAjax(scheduleRulesService.insertScheduleRules(scheduleRules)); } - - /** * 修改定时采集规则 */ - @PreAuthorize("@ss.hasPermi('equipment:rules:edit')") + @PreAuthorize("@ss.hasPermi('system:rules:edit')") @Log(title = "定时采集规则", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody ScheduleRules scheduleRules) @@ -120,16 +92,14 @@ public class ScheduleRulesController extends BaseController return toAjax(scheduleRulesService.updateScheduleRules(scheduleRules)); } - /** * 删除定时采集规则 */ - @PreAuthorize("@ss.hasPermi('equipment:rules:remove')") + @PreAuthorize("@ss.hasPermi('system:rules:remove')") @Log(title = "定时采集规则", businessType = BusinessType.DELETE) - @DeleteMapping("rule/{ids}") + @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(scheduleRulesService.deleteScheduleRulesByIds(ids)); } - } diff --git a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlarmRuleController.java b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlarmRuleController.java new file mode 100644 index 00000000..a89e5ea9 --- /dev/null +++ b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlarmRuleController.java @@ -0,0 +1,106 @@ +package com.alops.web.controller.exceptionController; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +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.poi.ExcelUtil; +import com.alops.system.domain.AlarmRule; +import com.alops.system.service.IAlarmRuleService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + + +/** + * 预警规则Controller + * + * @author ruoyi + * @date 2025-08-01 + */ +@RestController +@RequestMapping("/system/rule") +public class AlarmRuleController extends BaseController +{ + @Autowired + private IAlarmRuleService alarmRuleService; + + /** + * 查询预警规则列表 + */ + @PreAuthorize("@ss.hasPermi('system:rule:list')") + @GetMapping("/list") + public TableDataInfo list(AlarmRule alarmRule) + { + startPage(); + List list = alarmRuleService.selectAlarmRuleList(alarmRule); + return getDataTable(list); + } + + /** + * 导出预警规则列表 + */ + @PreAuthorize("@ss.hasPermi('system:rule:export')") + @Log(title = "预警规则", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, AlarmRule alarmRule) + { + List list = alarmRuleService.selectAlarmRuleList(alarmRule); + ExcelUtil util = new ExcelUtil(AlarmRule.class); + util.exportExcel(response, list, "预警规则数据"); + } + + /** + * 获取预警规则详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:rule:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(alarmRuleService.selectAlarmRuleById(id)); + } + + /** + * 新增预警规则 + */ + @PreAuthorize("@ss.hasPermi('system:rule:add')") + @Log(title = "预警规则", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody AlarmRule alarmRule) + { + return toAjax(alarmRuleService.insertAlarmRule(alarmRule)); + } + + /** + * 修改预警规则 + */ + @PreAuthorize("@ss.hasPermi('system:rule:edit')") + @Log(title = "预警规则", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody AlarmRule alarmRule) + { + return toAjax(alarmRuleService.updateAlarmRule(alarmRule)); + } + + /** + * 删除预警规则 + */ + @PreAuthorize("@ss.hasPermi('system:rule:remove')") + @Log(title = "预警规则", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(alarmRuleService.deleteAlarmRuleByIds(ids)); + } +} diff --git a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertRuleConditionController.java b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertRuleConditionController.java deleted file mode 100644 index cae542e9..00000000 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertRuleConditionController.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.alops.web.controller.exceptionController; - -import java.util.List; -import javax.servlet.http.HttpServletResponse; - -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.poi.ExcelUtil; -import com.alops.system.domain.AlertRuleCondition; -import com.alops.system.service.IAlertRuleConditionService; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * 【请填写功能名称】Controller - * - * @author ruoyi - * @date 2025-09-04 - */ -@RestController -@RequestMapping("/system/condition") -public class AlertRuleConditionController extends BaseController -{ - @Autowired - private IAlertRuleConditionService alertRuleConditionService; - - /** - * 查询【请填写功能名称】列表 - */ - @PreAuthorize("@ss.hasPermi('system:condition:list')") - @GetMapping("/list") - public TableDataInfo list(AlertRuleCondition alertRuleCondition) - { - startPage(); - List list = alertRuleConditionService.selectAlertRuleConditionList(alertRuleCondition); - return getDataTable(list); - } - - /** - * 导出【请填写功能名称】列表 - */ - @PreAuthorize("@ss.hasPermi('system:condition:export')") - @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, AlertRuleCondition alertRuleCondition) - { - List list = alertRuleConditionService.selectAlertRuleConditionList(alertRuleCondition); - ExcelUtil util = new ExcelUtil(AlertRuleCondition.class); - util.exportExcel(response, list, "【请填写功能名称】数据"); - } - - /** - * 获取【请填写功能名称】详细信息 - */ - @PreAuthorize("@ss.hasPermi('system:condition:query')") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) - { - return success(alertRuleConditionService.selectAlertRuleConditionById(id)); - } - - /** - * 新增【请填写功能名称】 - */ - @PreAuthorize("@ss.hasPermi('system:condition:add')") - @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody AlertRuleCondition alertRuleCondition) - { - return toAjax(alertRuleConditionService.insertAlertRuleCondition(alertRuleCondition)); - } - - /** - * 修改【请填写功能名称】 - */ - @PreAuthorize("@ss.hasPermi('system:condition:edit')") - @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody AlertRuleCondition alertRuleCondition) - { - return toAjax(alertRuleConditionService.updateAlertRuleCondition(alertRuleCondition)); - } - - /** - * 删除【请填写功能名称】 - */ - @PreAuthorize("@ss.hasPermi('system:condition:remove')") - @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) - { - return toAjax(alertRuleConditionService.deleteAlertRuleConditionByIds(ids)); - } -} diff --git a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertRuleController.java b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertRuleController.java deleted file mode 100644 index 4f30da13..00000000 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertRuleController.java +++ /dev/null @@ -1,164 +0,0 @@ -package com.alops.web.controller.exceptionController; - -import java.util.List; -import java.util.Map; -import javax.servlet.http.HttpServletResponse; - -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.poi.ExcelUtil; -import com.alops.system.domain.AlertRule; -import com.alops.system.domain.dto.AlertRuleAddDto; -import com.alops.system.service.IAlertLaunchService; -import com.alops.system.service.IAlertRuleService; -import com.sun.jna.platform.win32.Winspool; -import io.swagger.annotations.ApiOperation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * 【请填写功能名称】Controller - * - * @author ruoyi - * @date 2025-09-04 - */ -@RestController -@RequestMapping("/system/rule") -public class AlertRuleController extends BaseController -{ - @Autowired - private IAlertRuleService alertRuleService; - @Autowired - private IAlertLaunchService iAlertLaunchService; - - //增加预警规则,生成对应的sql语句存入方法(只能针对个体表,表之间不能共同构成预警,特殊符号的规则只能有一个查询条件) - //1.拿到 //预警名称,预警级别,预警对应的表格,预警方式,预警的到站方 预警规则,预警模版 内容描述 启用状态,创建人 - //+好几个规则条件实体类 - //2.生成sql语句 - //如果是如果是equ_gather直接根据组成条件构成查询语句, - //如果是其他表格除去组成条件构成的语句+通过equ_garher_id关联到equ_gather表,搜索出实体外+设备id和设备类型 - //3.然后存入预警规则和预警规则条件表 - - /** - * 新增预警规则 - */ - @PreAuthorize("@ss.hasPermi('equipment:rules:add')") - @ApiOperation("增加预警规则") - @PostMapping("/add") - public AjaxResult addRule(@RequestBody AlertRuleAddDto dto) { - try { - AlertRule alertRule = alertRuleService.saveRule(dto); - return AjaxResult.success("预警规则新增成功", alertRule); - } catch (Exception e) { - e.printStackTrace(); - return AjaxResult.error("新增预警规则失败: " + e.getMessage()); - } - } - - - //立即预警方法 - //1.拿到预警规则,拿到查询语句(如果是change执行change的方法)和预警规则表的东西,进行查询,查询组成一个内从实体 - //2.根据每次预警模版,+进行对应填入,根据预警方式发送信息,再存入预警信息实体类 - //{设备id:{} 报错:{预警名称} 返回实体{自己看} } - //3.批量存入预警信息数据库 - - /** - * 立即执行预警(带规则 ID 列表) - */ - @PreAuthorize("@ss.hasPermi('equipment:rules:execute')") - @ApiOperation("立即执行预警") - @PostMapping("/executeImmediate") - public AjaxResult executeImmediate(@RequestBody Map> paramMap) { - try { - List ruleIds = paramMap.get("ruleIds"); - if (ruleIds == null || ruleIds.isEmpty()) { - return AjaxResult.error("请选择至少一条规则"); - } - - iAlertLaunchService.executeImmediateAlerts(ruleIds); // 调用 Service 执行 - return AjaxResult.success("立即预警任务已触发,存入成功,请查看"); - } catch (Exception e) { - e.printStackTrace(); - return AjaxResult.error("执行立即预警失败: " + e.getMessage()); - } - } - - /** - * 查询【请填写功能名称】列表 - */ - @PreAuthorize("@ss.hasPermi('system:rule:list')") - @GetMapping("/list") - public TableDataInfo list(AlertRule alertRule) - { - startPage(); - List list = alertRuleService.selectAlertRuleList(alertRule); - return getDataTable(list); - } - - /** - * 导出【请填写功能名称】列表 - */ - @PreAuthorize("@ss.hasPermi('system:rule:export')") - @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, AlertRule alertRule) - { - List list = alertRuleService.selectAlertRuleList(alertRule); - ExcelUtil util = new ExcelUtil(AlertRule.class); - util.exportExcel(response, list, "【请填写功能名称】数据"); - } - - /** - * 获取【请填写功能名称】详细信息 - */ - @PreAuthorize("@ss.hasPermi('system:rule:query')") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) - { - return success(alertRuleService.selectAlertRuleById(id)); - } - - /** - * 新增【请填写功能名称】 - */ - @PreAuthorize("@ss.hasPermi('system:rule:add')") - @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody AlertRule alertRule) - { - return toAjax(alertRuleService.insertAlertRule(alertRule)); - } - - /** - * 修改【请填写功能名称】 - */ - @PreAuthorize("@ss.hasPermi('system:rule:edit')") - @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody AlertRule alertRule) - { - return toAjax(alertRuleService.updateAlertRule(alertRule)); - } - - /** - * 删除【请填写功能名称】 - */ - @PreAuthorize("@ss.hasPermi('system:rule:remove')") - @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) - { - return toAjax(alertRuleService.deleteAlertRuleByIds(ids)); - } -} diff --git a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/DictAlarmParamController.java b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/DictAlarmParamController.java deleted file mode 100644 index 57cc7033..00000000 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/DictAlarmParamController.java +++ /dev/null @@ -1,106 +0,0 @@ -package com.alops.web.controller.exceptionController; - -import java.util.List; -import javax.servlet.http.HttpServletResponse; - -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.poi.ExcelUtil; -import com.alops.system.domain.DictAlarmParam; -import com.alops.system.service.IDictAlarmParamService; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -/** - * 【请填写功能名称】Controller - * - * @author ruoyi - * @date 2025-09-05 - */ -@RestController -@RequestMapping("/system/param") -public class DictAlarmParamController extends BaseController -{ - @Autowired - private IDictAlarmParamService dictAlarmParamService; - - @ApiOperation("获取预警参数") - @PreAuthorize("@ss.hasPermi('system:param:byTable')") - @GetMapping("/byTable") - public AjaxResult getParamsByTableName(@RequestParam String tableName) { - return AjaxResult.success("获取预警参数成功",dictAlarmParamService.getParamsByTableName(tableName)); - } - /** - * 查询【请填写功能名称】列表 - */ - @PreAuthorize("@ss.hasPermi('system:param:list')") - @GetMapping("/list") - public TableDataInfo list(DictAlarmParam dictAlarmParam) - { - startPage(); - List list = dictAlarmParamService.selectDictAlarmParamList(dictAlarmParam); - return getDataTable(list); - } - - /** - * 导出【请填写功能名称】列表 - */ - @PreAuthorize("@ss.hasPermi('system:param:export')") - @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, DictAlarmParam dictAlarmParam) - { - List list = dictAlarmParamService.selectDictAlarmParamList(dictAlarmParam); - ExcelUtil util = new ExcelUtil(DictAlarmParam.class); - util.exportExcel(response, list, "【请填写功能名称】数据"); - } - - /** - * 获取【请填写功能名称】详细信息 - */ - @PreAuthorize("@ss.hasPermi('system:param:query')") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) - { - return success(dictAlarmParamService.selectDictAlarmParamById(id)); - } - - /** - * 新增【请填写功能名称】 - */ - @PreAuthorize("@ss.hasPermi('system:param:add')") - @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody DictAlarmParam dictAlarmParam) - { - return toAjax(dictAlarmParamService.insertDictAlarmParam(dictAlarmParam)); - } - - /** - * 修改【请填写功能名称】 - */ - @PreAuthorize("@ss.hasPermi('system:param:edit')") - @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody DictAlarmParam dictAlarmParam) - { - return toAjax(dictAlarmParamService.updateDictAlarmParam(dictAlarmParam)); - } - - /** - * 删除【请填写功能名称】 - */ - @PreAuthorize("@ss.hasPermi('system:param:remove')") - @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable Long[] ids) - { - return toAjax(dictAlarmParamService.deleteDictAlarmParamByIds(ids)); - } -} 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/FauStaController.java similarity index 54% rename from ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertMessageController.java rename to ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/FauStaController.java index 091f3b6e..e11d327a 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/FauStaController.java @@ -9,8 +9,8 @@ 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.poi.ExcelUtil; -import com.alops.system.domain.AlertMessage; -import com.alops.system.service.IAlertMessageService; +import com.alops.system.domain.FauSta; +import com.alops.system.service.IFauStaService; import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.GetMapping; @@ -22,87 +22,85 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; + /** * 故障统计Controller * * @author ruoyi - * @date 2025-09-04 + * @date 2025-08-01 */ @RestController -@RequestMapping("/system/message") -public class AlertMessageController extends BaseController +@RequestMapping("/system/sta") +public class FauStaController extends BaseController { @Autowired - private IAlertMessageService alertMessageService; - - - + private IFauStaService fauStaService; /** - * 查询预警信息统计列表 + * 查询故障统计列表 */ - @PreAuthorize("@ss.hasPermi('system:message:list')") + @PreAuthorize("@ss.hasPermi('system:sta:list')") @GetMapping("/list") - public TableDataInfo list(AlertMessage alertMessage) + public TableDataInfo list(FauSta fauSta) { startPage(); - List list = alertMessageService.selectAlertMessageList(alertMessage); + List list = fauStaService.selectFauStaList(fauSta); return getDataTable(list); } /** - * 导出 预警信息列表 + * 导出故障统计列表 */ - @PreAuthorize("@ss.hasPermi('system:message:export')") + @PreAuthorize("@ss.hasPermi('system:sta:export')") @Log(title = "故障统计", businessType = BusinessType.EXPORT) @PostMapping("/export") - public void export(HttpServletResponse response, AlertMessage alertMessage) + public void export(HttpServletResponse response, FauSta fauSta) { - List list = alertMessageService.selectAlertMessageList(alertMessage); - ExcelUtil util = new ExcelUtil(AlertMessage.class); + List list = fauStaService.selectFauStaList(fauSta); + ExcelUtil util = new ExcelUtil(FauSta.class); util.exportExcel(response, list, "故障统计数据"); } /** - * 获取预警信息 + * 获取故障统计详细信息 */ - @PreAuthorize("@ss.hasPermi('system:message:query')") + @PreAuthorize("@ss.hasPermi('system:sta:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { - return success(alertMessageService.selectAlertMessageById(id)); + return success(fauStaService.selectFauStaById(id)); } /** - * 新增预警信息 + * 新增故障统计 */ - @PreAuthorize("@ss.hasPermi('system:message:add')") + @PreAuthorize("@ss.hasPermi('system:sta:add')") @Log(title = "故障统计", businessType = BusinessType.INSERT) @PostMapping - public AjaxResult add(@RequestBody AlertMessage alertMessage) + public AjaxResult add(@RequestBody FauSta fauSta) { - return toAjax(alertMessageService.insertAlertMessage(alertMessage)); + return toAjax(fauStaService.insertFauSta(fauSta)); } /** - * 修改预警信息 + * 修改故障统计 */ - @PreAuthorize("@ss.hasPermi('system:message:edit')") + @PreAuthorize("@ss.hasPermi('system:sta:edit')") @Log(title = "故障统计", businessType = BusinessType.UPDATE) @PutMapping - public AjaxResult edit(@RequestBody AlertMessage alertMessage) + public AjaxResult edit(@RequestBody FauSta fauSta) { - return toAjax(alertMessageService.updateAlertMessage(alertMessage)); + return toAjax(fauStaService.updateFauSta(fauSta)); } /** - * 删除预警信息 + * 删除故障统计 */ - @PreAuthorize("@ss.hasPermi('system:message:remove')") + @PreAuthorize("@ss.hasPermi('system:sta:remove')") @Log(title = "故障统计", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable Long[] ids) { - return toAjax(alertMessageService.deleteAlertMessageByIds(ids)); + return toAjax(fauStaService.deleteFauStaByIds(ids)); } } diff --git a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquGatherController.java b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquGatherController.java deleted file mode 100644 index 71a5cce1..00000000 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquGatherController.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.alops.web.controller.tool; - -import java.util.List; -import javax.servlet.http.HttpServletResponse; - -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.poi.ExcelUtil; -import com.alops.system.domain.EquGather; -import com.alops.system.service.IEquGatherService; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * 设备采集信息Controller - * - * @author ruoyi - * @date 2025-08-15 - */ -@RestController -@RequestMapping("/system/gather") -public class EquGatherController extends BaseController -{ - @Autowired - private IEquGatherService equGatherService; - - /** - * 查询设备采集信息列表 - */ - @PreAuthorize("@ss.hasPermi('system:gather:list')") - @GetMapping("/list") - public TableDataInfo list(EquGather equGather) - { - startPage(); - List list = equGatherService.selectEquGatherList(equGather); - return getDataTable(list); - } - - /** - * 导出设备采集信息列表 - */ - @PreAuthorize("@ss.hasPermi('system:gather:export')") - @Log(title = "设备采集信息", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, EquGather equGather) - { - List list = equGatherService.selectEquGatherList(equGather); - ExcelUtil util = new ExcelUtil(EquGather.class); - util.exportExcel(response, list, "设备采集信息数据"); - } - - /** - * 获取设备采集信息详细信息 - */ - @PreAuthorize("@ss.hasPermi('system:gather:query')") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") String id) - { - return success(equGatherService.selectEquGatherById(id)); - } - - /** - * 新增设备采集信息 - */ - @PreAuthorize("@ss.hasPermi('system:gather:add')") - @Log(title = "设备采集信息", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody EquGather equGather) - { - return toAjax(equGatherService.insertEquGather(equGather)); - } - - /** - * 修改设备采集信息 - */ - @PreAuthorize("@ss.hasPermi('system:gather:edit')") - @Log(title = "设备采集信息", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody EquGather equGather) - { - return toAjax(equGatherService.updateEquGather(equGather)); - } - - /** - * 删除设备采集信息 - */ - @PreAuthorize("@ss.hasPermi('system:gather:remove')") - @Log(title = "设备采集信息", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable String[] ids) - { - return toAjax(equGatherService.deleteEquGatherByIds(ids)); - } -} 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 deleted file mode 100644 index 8f67a044..00000000 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquInterfaceController.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.alops.web.controller.tool; - -import java.util.List; -import javax.servlet.http.HttpServletResponse; - -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.poi.ExcelUtil; -import com.alops.system.domain.EquInterface; -import com.alops.system.service.IEquInterfaceService; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * 端口运行状态Controller - * - * @author ruoyi - * @date 2025-08-20 - */ -@RestController -@RequestMapping("/system/interface") -public class EquInterfaceController extends BaseController -{ - @Autowired - private IEquInterfaceService equInterfaceService; - - /** - * 查询端口运行状态列表 - */ - @PreAuthorize("@ss.hasPermi('system:interface:list')") - @GetMapping("/list") - public TableDataInfo list(EquInterface equInterface) - { - startPage(); - List list = equInterfaceService.selectEquInterfaceList(equInterface); - return getDataTable(list); - } - - /** - * 导出端口运行状态列表 - */ - @PreAuthorize("@ss.hasPermi('system:interface:export')") - @Log(title = "端口运行状态", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, EquInterface equInterface) - { - List list = equInterfaceService.selectEquInterfaceList(equInterface); - ExcelUtil util = new ExcelUtil(EquInterface.class); - util.exportExcel(response, list, "端口运行状态数据"); - } - - /** - * 获取端口运行状态详细信息 - */ - @PreAuthorize("@ss.hasPermi('system:interface:query')") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") String id) - { - return success(equInterfaceService.selectEquInterfaceById(id)); - } - - /** - * 新增端口运行状态 - */ - @PreAuthorize("@ss.hasPermi('system:interface:add')") - @Log(title = "端口运行状态", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody EquInterface equInterface) - { - return toAjax(equInterfaceService.insertEquInterface(equInterface)); - } - - /** - * 修改端口运行状态 - */ - @PreAuthorize("@ss.hasPermi('system:interface:edit')") - @Log(title = "端口运行状态", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody EquInterface equInterface) - { - return toAjax(equInterfaceService.updateEquInterface(equInterface)); - } - - /** - * 删除端口运行状态 - */ - @PreAuthorize("@ss.hasPermi('system:interface:remove')") - @Log(title = "端口运行状态", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable String[] ids) - { - return toAjax(equInterfaceService.deleteEquInterfaceByIds(ids)); - } -} 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 deleted file mode 100644 index fe1d8d1f..00000000 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquRoutingController.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.alops.web.controller.tool; - -import java.util.List; -import javax.servlet.http.HttpServletResponse; - -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.poi.ExcelUtil; -import com.alops.system.domain.EquRouting; -import com.alops.system.service.IEquRoutingService; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * 路由信息Controller - * - * @author ruoyi - * @date 2025-08-15 - */ -@RestController -@RequestMapping("/system/routing") -public class EquRoutingController extends BaseController -{ - @Autowired - private IEquRoutingService equRoutingService; - - /** - * 查询路由信息列表 - */ - @PreAuthorize("@ss.hasPermi('system:routing:list')") - @GetMapping("/list") - public TableDataInfo list(EquRouting equRouting) - { - startPage(); - List list = equRoutingService.selectEquRoutingList(equRouting); - return getDataTable(list); - } - - /** - * 导出路由信息列表 - */ - @PreAuthorize("@ss.hasPermi('system:routing:export')") - @Log(title = "路由信息", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, EquRouting equRouting) - { - List list = equRoutingService.selectEquRoutingList(equRouting); - ExcelUtil util = new ExcelUtil(EquRouting.class); - util.exportExcel(response, list, "路由信息数据"); - } - - /** - * 获取路由信息详细信息 - */ - @PreAuthorize("@ss.hasPermi('system:routing:query')") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") String id) - { - return success(equRoutingService.selectEquRoutingById(id)); - } - - /** - * 新增路由信息 - */ - @PreAuthorize("@ss.hasPermi('system:routing:add')") - @Log(title = "路由信息", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody EquRouting equRouting) - { - return toAjax(equRoutingService.insertEquRouting(equRouting)); - } - - /** - * 修改路由信息 - */ - @PreAuthorize("@ss.hasPermi('system:routing:edit')") - @Log(title = "路由信息", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody EquRouting equRouting) - { - return toAjax(equRoutingService.updateEquRouting(equRouting)); - } - - /** - * 删除路由信息 - */ - @PreAuthorize("@ss.hasPermi('system:routing:remove')") - @Log(title = "路由信息", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable String[] ids) - { - return toAjax(equRoutingService.deleteEquRoutingByIds(ids)); - } -} 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 deleted file mode 100644 index 969f5c02..00000000 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquVeneerController.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.alops.web.controller.tool; - -import java.util.List; -import javax.servlet.http.HttpServletResponse; - -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.poi.ExcelUtil; -import com.alops.system.domain.EquVeneer; -import com.alops.system.service.IEquVeneerService; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.PostMapping; -import org.springframework.web.bind.annotation.PutMapping; -import org.springframework.web.bind.annotation.DeleteMapping; -import org.springframework.web.bind.annotation.PathVariable; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; - -/** - * 【请填写功能名称】Controller - * - * @author ruoyi - * @date 2025-08-15 - */ -@RestController -@RequestMapping("/system/veneer") -public class EquVeneerController extends BaseController -{ - @Autowired - private IEquVeneerService equVeneerService; - - /** - * 查询【请填写功能名称】列表 - */ - @PreAuthorize("@ss.hasPermi('system:veneer:list')") - @GetMapping("/list") - public TableDataInfo list(EquVeneer equVeneer) - { - startPage(); - List list = equVeneerService.selectEquVeneerList(equVeneer); - return getDataTable(list); - } - - /** - * 导出【请填写功能名称】列表 - */ - @PreAuthorize("@ss.hasPermi('system:veneer:export')") - @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT) - @PostMapping("/export") - public void export(HttpServletResponse response, EquVeneer equVeneer) - { - List list = equVeneerService.selectEquVeneerList(equVeneer); - ExcelUtil util = new ExcelUtil(EquVeneer.class); - util.exportExcel(response, list, "【请填写功能名称】数据"); - } - - /** - * 获取【请填写功能名称】详细信息 - */ - @PreAuthorize("@ss.hasPermi('system:veneer:query')") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") String id) - { - return success(equVeneerService.selectEquVeneerById(id)); - } - - /** - * 新增【请填写功能名称】 - */ - @PreAuthorize("@ss.hasPermi('system:veneer:add')") - @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody EquVeneer equVeneer) - { - return toAjax(equVeneerService.insertEquVeneer(equVeneer)); - } - - /** - * 修改【请填写功能名称】 - */ - @PreAuthorize("@ss.hasPermi('system:veneer:edit')") - @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody EquVeneer equVeneer) - { - return toAjax(equVeneerService.updateEquVeneer(equVeneer)); - } - - /** - * 删除【请填写功能名称】 - */ - @PreAuthorize("@ss.hasPermi('system:veneer:remove')") - @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") - public AjaxResult remove(@PathVariable String[] ids) - { - return toAjax(equVeneerService.deleteEquVeneerByIds(ids)); - } -} diff --git a/ALOps_sys_backend/alops-admin/src/main/resources/application.yml b/ALOps_sys_backend/alops-admin/src/main/resources/application.yml index fb19c529..c1dbf108 100644 --- a/ALOps_sys_backend/alops-admin/src/main/resources/application.yml +++ b/ALOps_sys_backend/alops-admin/src/main/resources/application.yml @@ -48,19 +48,7 @@ user: lockTime: 10 # Spring配置 -Spring: - # 邮件信息 - mail: - host: smtp.qq.com - port: 465 - username: 2028008386@qq.com - password: qdcptuazfndybjdd - protocol: smtp - properties: - mail.smtp.auth: true - mail.smtp.ssl.enable: true # QQ邮箱用 SSL - mail.smtp.starttls.enable: true - mail.smtp.starttls.required: true +spring: # 资源信息 messages: # 国际化资源文件路径 @@ -101,10 +89,6 @@ Spring: max-active: 8 # #连接池最大阻塞等待时间(使用负值表示没有限制) max-wait: -1ms - #邮件信息 - - - # token配置 token: @@ -146,4 +130,3 @@ xss: # 匹配链接 urlPatterns: /system/*,/monitor/*,/tool/* - diff --git a/ALOps_sys_backend/alops-common/src/main/java/com/alops/common/core/domain/BaseEntity.java b/ALOps_sys_backend/alops-common/src/main/java/com/alops/common/core/domain/BaseEntity.java index 059fcaa9..000b282f 100644 --- a/ALOps_sys_backend/alops-common/src/main/java/com/alops/common/core/domain/BaseEntity.java +++ b/ALOps_sys_backend/alops-common/src/main/java/com/alops/common/core/domain/BaseEntity.java @@ -29,7 +29,7 @@ public class BaseEntity implements Serializable private Date createTime; /** 更新者 */ - private String updateBy; + private String updateBy; /** 更新时间 */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @@ -77,7 +77,7 @@ public class BaseEntity implements Serializable return updateBy; } - public void setUpdateBy(String updateBy) + public void setUpdateBy(String updateBy) { this.updateBy = updateBy; } diff --git a/ALOps_sys_backend/alops-system/pom.xml b/ALOps_sys_backend/alops-system/pom.xml index a09b3f2e..19822654 100644 --- a/ALOps_sys_backend/alops-system/pom.xml +++ b/ALOps_sys_backend/alops-system/pom.xml @@ -29,16 +29,8 @@ com.alops alops-common - - - - org.springframework.boot - spring-boot-starter-mail - 2.5.15 - - \ No newline at end of file diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/AlarmRule.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/AlarmRule.java new file mode 100644 index 00000000..acd3eb23 --- /dev/null +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/AlarmRule.java @@ -0,0 +1,205 @@ +package com.alops.system.domain; + +import java.math.BigDecimal; + +import com.alops.common.annotation.Excel; +import com.alops.common.core.domain.BaseEntity; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; + +/** + * 预警规则对象 alarm_rule + * + * @author ruoyi + * @date 2025-08-01 + */ +public class AlarmRule extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 规则ID */ + private Long id; + + /** 预警名称 */ + @Excel(name = "预警名称") + private String ruleName; + + /** 预警简述 */ + @Excel(name = "预警简述") + private String description; + + /** 设备参数(如:temperature/cpu_usage) */ + @Excel(name = "设备参数(如:temperature/cpu_usage)") + private String paramName; + + /** 对应的设备类型 */ + @Excel(name = "对应的设备类型") + private String equType; + + /** 比较运算符(>/=/<) */ + @Excel(name = "比较运算符(>/=/<)") + private String compareOperator; + + /** 触发阈值 */ + @Excel(name = "触发阈值") + private BigDecimal paramValue; + + /** 预警级别(1-5) */ + @Excel(name = "预警级别(1-5)") + private Long alertLevel; + + /** 预警消息模板 */ + @Excel(name = "预警消息模板") + private String alertMessage; + + /** 处理角色ID */ + @Excel(name = "处理角色ID") + private Long roleId; + + /** 通知邮箱 */ + @Excel(name = "通知邮箱") + private String notifyEmail; + + /** 启用状态(0-禁用,1-启用) */ + @Excel(name = "启用状态(0-禁用,1-启用)") + private Long ruleStatus; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setRuleName(String ruleName) + { + this.ruleName = ruleName; + } + + public String getRuleName() + { + return ruleName; + } + + public void setDescription(String description) + { + this.description = description; + } + + public String getDescription() + { + return description; + } + + public void setParamName(String paramName) + { + this.paramName = paramName; + } + + public String getParamName() + { + return paramName; + } + + public void setEquType(String equType) + { + this.equType = equType; + } + + public String getEquType() + { + return equType; + } + + public void setCompareOperator(String compareOperator) + { + this.compareOperator = compareOperator; + } + + public String getCompareOperator() + { + return compareOperator; + } + + public void setParamValue(BigDecimal paramValue) + { + this.paramValue = paramValue; + } + + public BigDecimal getParamValue() + { + return paramValue; + } + + public void setAlertLevel(Long alertLevel) + { + this.alertLevel = alertLevel; + } + + public Long getAlertLevel() + { + return alertLevel; + } + + public void setAlertMessage(String alertMessage) + { + this.alertMessage = alertMessage; + } + + public String getAlertMessage() + { + return alertMessage; + } + + public void setRoleId(Long roleId) + { + this.roleId = roleId; + } + + public Long getRoleId() + { + return roleId; + } + + public void setNotifyEmail(String notifyEmail) + { + this.notifyEmail = notifyEmail; + } + + public String getNotifyEmail() + { + return notifyEmail; + } + + public void setRuleStatus(Long ruleStatus) + { + this.ruleStatus = ruleStatus; + } + + public Long getRuleStatus() + { + return ruleStatus; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("ruleName", getRuleName()) + .append("description", getDescription()) + .append("paramName", getParamName()) + .append("equType", getEquType()) + .append("compareOperator", getCompareOperator()) + .append("paramValue", getParamValue()) + .append("alertLevel", getAlertLevel()) + .append("alertMessage", getAlertMessage()) + .append("roleId", getRoleId()) + .append("notifyEmail", getNotifyEmail()) + .append("ruleStatus", getRuleStatus()) + .append("createTime", getCreateTime()) + .toString(); + } +} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/AlertRule.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/AlertRule.java deleted file mode 100644 index fbe38097..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/AlertRule.java +++ /dev/null @@ -1,191 +0,0 @@ -package com.alops.system.domain; - -import com.alops.common.annotation.Excel; -import com.alops.common.core.domain.BaseEntity; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; - -/** - * 【请填写功能名称】对象 alert_rule - * - * @author ruoyi - * @date 2025-09-05 - */ -public class AlertRule extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** 主键 */ - private Long id; - - /** 预警规则名称 */ - @Excel(name = "预警规则名称") - private String ruleName; - - /** 预警级别 */ - @Excel(name = "预警级别") - private Long severity; - - /** 预警方式(email/message) */ - @Excel(name = "预警方式(email/message)") - private String alertWay; - - /** 预警到站方 */ - @Excel(name = "预警到站方") - private String alertStation; - - /** 预警规则内容描述 */ - @Excel(name = "预警规则内容描述") - private String description; - - /** 启用状态(0为启用) */ - @Excel(name = "启用状态", readConverterExp = "0=为启用") - private Integer enable; - - /** 表格名称 */ - @Excel(name = "表格名称") - private String tableName; - - /** 预警sql语句查询 */ - @Excel(name = "预警sql语句查询") - private String alertSql; - - /** 预警模版(参数用数据库命名法) */ - @Excel(name = "预警模版", readConverterExp = "参=数用数据库命名法") - private String alertTemplate; - - /** 预警类型 */ - @Excel(name = "预警类型") - private String type; - - public void setId(Long id) - { - this.id = id; - } - - public Long getId() - { - return id; - } - - public void setRuleName(String ruleName) - { - this.ruleName = ruleName; - } - - public String getRuleName() - { - return ruleName; - } - - public void setSeverity(Long severity) - { - this.severity = severity; - } - - public Long getSeverity() - { - return severity; - } - - public void setAlertWay(String alertWay) - { - this.alertWay = alertWay; - } - - public String getAlertWay() - { - return alertWay; - } - - public void setAlertStation(String alertStation) - { - this.alertStation = alertStation; - } - - public String getAlertStation() - { - return alertStation; - } - - public void setDescription(String description) - { - this.description = description; - } - - public String getDescription() - { - return description; - } - - public void setEnable(Integer enable) - { - this.enable = enable; - } - - public Integer getEnable() - { - return enable; - } - - public void setTableName(String tableName) - { - this.tableName = tableName; - } - - public String getTableName() - { - return tableName; - } - - public void setAlertSql(String alertSql) - { - this.alertSql = alertSql; - } - - public String getAlertSql() - { - return alertSql; - } - - public void setAlertTemplate(String alertTemplate) - { - this.alertTemplate = alertTemplate; - } - - public String getAlertTemplate() - { - return alertTemplate; - } - - public void setType(String type) - { - this.type = type; - } - - public String getType() - { - return type; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("ruleName", getRuleName()) - .append("severity", getSeverity()) - .append("alertWay", getAlertWay()) - .append("alertStation", getAlertStation()) - .append("description", getDescription()) - .append("enable", getEnable()) - .append("createTime", getCreateTime()) - .append("updateTime", getUpdateTime()) - .append("createBy", getCreateBy()) - .append("updateBy", getUpdateBy()) - .append("tableName", getTableName()) - .append("alertSql", getAlertSql()) - .append("alertTemplate", getAlertTemplate()) - .append("type", getType()) - .toString(); - } -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/AlertRuleCondition.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/AlertRuleCondition.java deleted file mode 100644 index 900bad59..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/AlertRuleCondition.java +++ /dev/null @@ -1,142 +0,0 @@ -package com.alops.system.domain; - -import com.alops.common.annotation.Excel; -import com.alops.common.core.domain.BaseEntity; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; - -/** - * 【请填写功能名称】对象 alert_rule_condition - * - * @author ruoyi - * @date 2025-09-04 - */ -public class AlertRuleCondition extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** 主键 */ - private Long id; - - /** 预警规则id */ - @Excel(name = "预警规则id") - private Long alertRuleId; - - /** 参数名称 */ - @Excel(name = "参数名称") - private String paramName; - - /** 比较符号 */ - @Excel(name = "比较符号") - private String operator; - - /** 比较值 */ - @Excel(name = "比较值") - private String compareValue; - - /** 与下一个条件的逻辑符号 */ - @Excel(name = "与下一个条件的逻辑符号") - private String logicOperator; - - /** 条件顺序 */ - @Excel(name = "条件顺序") - private Long orderNo; - - /** 比较值的类型 */ - @Excel(name = "比较值的类型") - private String valueType; - - public void setId(Long id) - { - this.id = id; - } - - public Long getId() - { - return id; - } - - public void setAlertRuleId(Long alertRuleId) - { - this.alertRuleId = alertRuleId; - } - - public Long getAlertRuleId() - { - return alertRuleId; - } - - public void setParamName(String paramName) - { - this.paramName = paramName; - } - - public String getParamName() - { - return paramName; - } - - public void setOperator(String operator) - { - this.operator = operator; - } - - public String getOperator() - { - return operator; - } - - public void setCompareValue(String compareValue) - { - this.compareValue = compareValue; - } - - public String getCompareValue() - { - return compareValue; - } - - public void setLogicOperator(String logicOperator) - { - this.logicOperator = logicOperator; - } - - public String getLogicOperator() - { - return logicOperator; - } - - public void setOrderNo(Long orderNo) - { - this.orderNo = orderNo; - } - - public Long getOrderNo() - { - return orderNo; - } - - public void setValueType(String valueType) - { - this.valueType = valueType; - } - - public String getValueType() - { - return valueType; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("alertRuleId", getAlertRuleId()) - .append("paramName", getParamName()) - .append("operator", getOperator()) - .append("compareValue", getCompareValue()) - .append("logicOperator", getLogicOperator()) - .append("orderNo", getOrderNo()) - .append("valueType", getValueType()) - .toString(); - } -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/DictAlarmParam.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/DictAlarmParam.java deleted file mode 100644 index 12ae6368..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/DictAlarmParam.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.alops.system.domain; - -import com.alops.common.annotation.Excel; -import com.alops.common.core.domain.BaseEntity; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; - -/** - * 【请填写功能名称】对象 dict_alarm_param - * - * @author ruoyi - * @date 2025-09-05 - */ -public class DictAlarmParam extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** $column.columnComment */ - private Long id; - - /** 参数名称 */ - @Excel(name = "参数名称") - private String paramName; - - /** 表名 */ - @Excel(name = "表名") - private String tableName; - - /** 参数名 */ - @Excel(name = "参数名") - private String columnName; - - /** 参数类型 */ - @Excel(name = "参数类型") - private String paramType; - - public void setId(Long id) - { - this.id = id; - } - - public Long getId() - { - return id; - } - - public void setParamName(String paramName) - { - this.paramName = paramName; - } - - public String getParamName() - { - return paramName; - } - - public void setTableName(String tableName) - { - this.tableName = tableName; - } - - public String getTableName() - { - return tableName; - } - - public void setColumnName(String columnName) - { - this.columnName = columnName; - } - - public String getColumnName() - { - return columnName; - } - - public void setParamType(String paramType) - { - this.paramType = paramType; - } - - public String getParamType() - { - return paramType; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("paramName", getParamName()) - .append("tableName", getTableName()) - .append("columnName", getColumnName()) - .append("paramType", getParamType()) - .toString(); - } -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquBase.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquBase.java index 09dd7257..65748d39 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquBase.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquBase.java @@ -36,8 +36,8 @@ public class EquBase extends BaseEntity private String ip; /** 设备厂商 */ - @Excel(name = "设备厂商id ") - private String manufacture; + @Excel(name = "设备厂商 ") + private EquManu manufacture; /** 安装位置 id */ @Excel(name = "安装位置 id") @@ -73,6 +73,17 @@ public class EquBase extends BaseEntity @Excel(name = "质保时间(年)") private Long warranty; + /** 累积故障次数 */ + @Excel(name = "累积故障次数") + private Long failureFrequency; + + /** 累积维修次数 */ + @Excel(name = "累积维修次数") + private Long repairFrequency; + + /** 累积维修金额(元) */ + @Excel(name = "累积维修金额(元)") + private BigDecimal repairCost; /** 添加日期 */ @JsonFormat(pattern = "yyyy-MM-dd") @@ -87,17 +98,6 @@ public class EquBase extends BaseEntity /** 启用状态 */ @Excel(name = "启用状态") private Long status; - /** 累积故障次数 */ - @Excel(name = "累积故障次数") - private Long failureFrequency; - - /** 累积维修次数 */ - @Excel(name = "累积维修次数") - private Long repairFrequency; - - /** 累积维修金额(元) */ - @Excel(name = "累积维修金额(元)") - private BigDecimal repairCost; public void setId(String id) { @@ -139,12 +139,12 @@ public class EquBase extends BaseEntity return ip; } - public void setManufacture(String manufacture) + public void setManufacture(EquManu manufacture) { this.manufacture = manufacture; } - public String getManufacture() + public EquManu getManufacture() { return manufacture; } @@ -229,65 +229,64 @@ public class EquBase extends BaseEntity return warranty; } - - - public void setCreateDate(Date createDate) + public void setFailureFrequency(Long failureFrequency) { - this.createDate = createDate; + this.failureFrequency = failureFrequency; } - public Date getCreateDate() + public Long getFailureFrequency() { - return createDate; + return failureFrequency; } - public void setUpdateDate(Date updateDate) + public void setRepairFrequency(Long repairFrequency) { - this.updateDate = updateDate; + this.repairFrequency = repairFrequency; } - public Date getUpdateDate() + public Long getRepairFrequency() { - return updateDate; + return repairFrequency; } - public void setStatus(Long status) + public void setRepairCost(BigDecimal repairCost) { - this.status = status; + this.repairCost = repairCost; } - public Long getStatus() + public BigDecimal getRepairCost() { - return status; + return repairCost; } - public void setFailureFrequency(Long failureFrequency) + + public void setCreateDate(Date createDate) { - this.failureFrequency = failureFrequency; + this.createDate = createDate; } - public Long getFailureFrequency() + public Date getCreateDate() { - return failureFrequency; + return createDate; } - public void setRepairFrequency(Long repairFrequency) + public void setUpdateDate(Date updateDate) { - this.repairFrequency = repairFrequency; + this.updateDate = updateDate; } - public Long getRepairFrequency() + public Date getUpdateDate() { - return repairFrequency; + return updateDate; } - public void setRepairCost(BigDecimal repairCost) + public void setStatus(Long status) { - this.repairCost = repairCost; + this.status = status; } - public BigDecimal getRepairCost() + public Long getStatus() { - return repairCost; + return status; } @Override @@ -306,15 +305,14 @@ public class EquBase extends BaseEntity .append("lifeCycle", getLifeCycle()) .append("serviceTime", getServiceTime()) .append("warranty", getWarranty()) - + .append("failureFrequency", getFailureFrequency()) + .append("repairFrequency", getRepairFrequency()) + .append("repairCost", getRepairCost()) .append("createBy", getCreateBy()) .append("createDate", getCreateDate()) .append("updateBy", getUpdateBy()) .append("updateDate", getUpdateDate()) .append("status", getStatus()) - .append("failureFrequency", getFailureFrequency()) - .append("repairFrequency", getRepairFrequency()) - .append("repairCost", getRepairCost()) .toString(); } } diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquGather.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquGather.java index 9366e4cc..1e445065 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquGather.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquGather.java @@ -8,15 +8,13 @@ import com.alops.common.core.domain.BaseEntity; import com.fasterxml.jackson.annotation.JsonFormat; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; -import org.apache.ibatis.annotations.Mapper; /** * 设备采集信息对象 equ_gather * * @author ruoyi - * @date 2025-08-15 + * @date 2025-08-01 */ - public class EquGather extends BaseEntity { private static final long serialVersionUID = 1L; @@ -77,22 +75,6 @@ public class EquGather extends BaseEntity @Excel(name = "采集时间", width = 30, dateFormat = "yyyy-MM-dd") private Date gatherTime; - /** 输入电压状态(Normal/UnderVoltage) */ - @Excel(name = "输入电压状态(Normal/UnderVoltage)") - private String volInStatus; - - /** 输出电压状态(Normal/UnderVoltage) */ - @Excel(name = "输出电压状态(Normal/UnderVoltage)") - private String volOutStatus; - - /** 风扇转速状态(Normal/Abnormal) */ - @Excel(name = "风扇转速状态(Normal/Abnormal)") - private String fanSpeedStatus; - - /** 设备持续运行时长(如365天12小时) */ - @Excel(name = "设备持续运行时长(如365天12小时)") - private String contWorkPeriod; - public void setId(String id) { this.id = id; @@ -233,46 +215,6 @@ public class EquGather extends BaseEntity return gatherTime; } - public void setVolInStatus(String volInStatus) - { - this.volInStatus = volInStatus; - } - - public String getVolInStatus() - { - return volInStatus; - } - - public void setVolOutStatus(String volOutStatus) - { - this.volOutStatus = volOutStatus; - } - - public String getVolOutStatus() - { - return volOutStatus; - } - - public void setFanSpeedStatus(String fanSpeedStatus) - { - this.fanSpeedStatus = fanSpeedStatus; - } - - public String getFanSpeedStatus() - { - return fanSpeedStatus; - } - - public void setContWorkPeriod(String contWorkPeriod) - { - this.contWorkPeriod = contWorkPeriod; - } - - public String getContWorkPeriod() - { - return contWorkPeriod; - } - @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) @@ -290,10 +232,6 @@ public class EquGather extends BaseEntity .append("logOnline", getLogOnline()) .append("logSys", getLogSys()) .append("gatherTime", getGatherTime()) - .append("volInStatus", getVolInStatus()) - .append("volOutStatus", getVolOutStatus()) - .append("fanSpeedStatus", getFanSpeedStatus()) - .append("contWorkPeriod", getContWorkPeriod()) .toString(); } } diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquInterface.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquInterface.java index 2c3ded06..caf22db5 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquInterface.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquInterface.java @@ -10,16 +10,16 @@ import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; /** - * 端口运行状态对象 equ_interface + * 设备接口信息对象 equ_interface * * @author ruoyi - * @date 2025-08-20 + * @date 2025-08-01 */ public class EquInterface extends BaseEntity { private static final long serialVersionUID = 1L; - /** 主键 */ + /** 接口 id */ private String id; /** 设备 ID */ @@ -31,17 +31,17 @@ public class EquInterface extends BaseEntity @Excel(name = "采集时间", width = 30, dateFormat = "yyyy-MM-dd") private Date gatherTime; - /** 端口运行与否(UP/DOWN(true/false)) */ - @Excel(name = "端口运行与否(UP/DOWN(true/false))") - private String running; + /** 端口运行与否(UP/DOWN) */ + @Excel(name = "端口运行与否(UP/DOWN)") + private Integer running; /** 传输速率(Mbps) */ @Excel(name = "传输速率(Mbps)") private Long rate; - /** 通信模式字典值(null/half/auto) */ - @Excel(name = "通信模式字典值(null/half/auto)") - private String commuicateMode; + /** 通信模式字典值(0/1/2) */ + @Excel(name = "通信模式字典值(0/1/2)") + private Long commuicateMode; /** 出方向流量(bps) */ @Excel(name = "出方向流量(bps)") @@ -51,9 +51,9 @@ public class EquInterface extends BaseEntity @Excel(name = "入方向流量(bps)") private Long inFlow; - /** 入方向带宽占有率(%) */ - @Excel(name = "入方向带宽占有率(%)") - private BigDecimal inBandwidth; + /** 带宽占有率(%) */ + @Excel(name = "带宽占有率(%)") + private BigDecimal bandwidth; /** 丢包率(%) */ @Excel(name = "丢包率(%)") @@ -63,18 +63,6 @@ public class EquInterface extends BaseEntity @Excel(name = "错包率(%)") private BigDecimal errorRate; - /** 采集关联外键 */ - @Excel(name = "采集关联外键") - private String equGatherId; - - /** 接口id */ - @Excel(name = "接口id") - private String interfaceId; - - /** 出方向带宽占有率(%) */ - @Excel(name = "出方向带宽占有率(%)") - private BigDecimal outBandwidth; - public void setId(String id) { this.id = id; @@ -105,12 +93,12 @@ public class EquInterface extends BaseEntity return gatherTime; } - public void setRunning(String running) + public void setRunning(Integer running) { this.running = running; } - public String getRunning() + public Integer getRunning() { return running; } @@ -125,12 +113,12 @@ public class EquInterface extends BaseEntity return rate; } - public void setCommuicateMode(String commuicateMode) + public void setCommuicateMode(Long commuicateMode) { this.commuicateMode = commuicateMode; } - public String getCommuicateMode() + public Long getCommuicateMode() { return commuicateMode; } @@ -155,14 +143,14 @@ public class EquInterface extends BaseEntity return inFlow; } - public void setInBandwidth(BigDecimal inBandwidth) + public void setBandwidth(BigDecimal bandwidth) { - this.inBandwidth = inBandwidth; + this.bandwidth = bandwidth; } - public BigDecimal getInBandwidth() + public BigDecimal getBandwidth() { - return inBandwidth; + return bandwidth; } public void setLossRate(BigDecimal lossRate) @@ -185,36 +173,6 @@ public class EquInterface extends BaseEntity return errorRate; } - public void setEquGatherId(String equGatherId) - { - this.equGatherId = equGatherId; - } - - public String getEquGatherId() - { - return equGatherId; - } - - public void setInterfaceId(String interfaceId) - { - this.interfaceId = interfaceId; - } - - public String getInterfaceId() - { - return interfaceId; - } - - public void setOutBandwidth(BigDecimal outBandwidth) - { - this.outBandwidth = outBandwidth; - } - - public BigDecimal getOutBandwidth() - { - return outBandwidth; - } - @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) @@ -226,12 +184,9 @@ public class EquInterface extends BaseEntity .append("commuicateMode", getCommuicateMode()) .append("outFlow", getOutFlow()) .append("inFlow", getInFlow()) - .append("inBandwidth", getInBandwidth()) + .append("bandwidth", getBandwidth()) .append("lossRate", getLossRate()) .append("errorRate", getErrorRate()) - .append("equGatherId", getEquGatherId()) - .append("interfaceId", getInterfaceId()) - .append("outBandwidth", getOutBandwidth()) .toString(); } } diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquOid.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquOid.java deleted file mode 100644 index c14165ad..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquOid.java +++ /dev/null @@ -1,236 +0,0 @@ -package com.alops.system.domain; - -import com.alops.common.annotation.Excel; -import com.alops.common.core.domain.BaseEntity; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.apache.ibatis.annotations.Mapper; - -/** - * OID配置信息对象 equ_oid - * - * @author ruoyi - * @date 2025-08-15 - */ - -public class EquOid extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** 主键ID */ - private Long id; - - /** 实际的OID值 */ - @Excel(name = "实际的OID值") - private String oid; - - /** OID参数名称(唯一业务标识) */ - @Excel(name = "OID参数名称", readConverterExp = "唯=一业务标识") - private String param; - - /** 存储表名 */ - @Excel(name = "存储表名") - private String storeTable; - - /** 单个计算规则表达式 */ - @Excel(name = "单个计算规则表达式") - private String convertRule; - - /** 合成组名,多个OID合成字段时相同 */ - @Excel(name = "合成组名,多个OID合成字段时相同") - private String combineGroup; - - /** 是否是高位字段,合成64位时用,高为1 */ - @Excel(name = "是否是高位字段,合成64位时用,高为1") - private Integer isHighPart; - - /** 厂商ID */ - @Excel(name = "厂商ID") - private String manufacturerId; - - /** 截取方式规则(1最后一个非 0 值2 方式 2:每行索引 + 最后词 方式 3:单值 4 路由专用) */ - @Excel(name = "截取方式规则", readConverterExp = "1=最后一个非,0=,值=2,方=式,2=:每行索引,+=,最=后词,方=式,3=:单值,4=,路=由专用") - private String cutRule; - - /** 是否一个OID对应多个参数 */ - @Excel(name = "是否一个OID对应多个参数") - private Integer multiParam; - - /** 子参数组合组标识 */ - @Excel(name = "子参数组合组标识") - private String subParamGroup; - - /** 描述说明 */ - @Excel(name = "描述说明") - private String description; - - /** 单位 */ - @Excel(name = "单位") - private String unit; - - /** 是否启用及启用方式 */ - @Excel(name = "是否启用及启用方式") - private Integer enabled; - - public void setId(Long id) - { - this.id = id; - } - - public Long getId() - { - return id; - } - - public void setOid(String oid) - { - this.oid = oid; - } - - public String getOid() - { - return oid; - } - - public void setParam(String param) - { - this.param = param; - } - - public String getParam() - { - return param; - } - - public void setStoreTable(String storeTable) - { - this.storeTable = storeTable; - } - - public String getStoreTable() - { - return storeTable; - } - - public void setConvertRule(String convertRule) - { - this.convertRule = convertRule; - } - - public String getConvertRule() - { - return convertRule; - } - - public void setCombineGroup(String combineGroup) - { - this.combineGroup = combineGroup; - } - - public String getCombineGroup() - { - return combineGroup; - } - - public void setIsHighPart(Integer isHighPart) - { - this.isHighPart = isHighPart; - } - - public Integer getIsHighPart() - { - return isHighPart; - } - - public void setManufacturerId(String manufacturerId) - { - this.manufacturerId = manufacturerId; - } - - public String getManufacturerId() - { - return manufacturerId; - } - - public void setCutRule(String cutRule) - { - this.cutRule = cutRule; - } - - public String getCutRule() - { - return cutRule; - } - - public void setMultiParam(Integer multiParam) - { - this.multiParam = multiParam; - } - - public Integer getMultiParam() - { - return multiParam; - } - - public void setSubParamGroup(String subParamGroup) - { - this.subParamGroup = subParamGroup; - } - - public String getSubParamGroup() - { - return subParamGroup; - } - - public void setDescription(String description) - { - this.description = description; - } - - public String getDescription() - { - return description; - } - - public void setUnit(String unit) - { - this.unit = unit; - } - - public String getUnit() - { - return unit; - } - - public void setEnabled(Integer enabled) - { - this.enabled = enabled; - } - - public Integer getEnabled() - { - return enabled; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("oid", getOid()) - .append("param", getParam()) - .append("storeTable", getStoreTable()) - .append("convertRule", getConvertRule()) - .append("combineGroup", getCombineGroup()) - .append("isHighPart", getIsHighPart()) - .append("manufacturerId", getManufacturerId()) - .append("cutRule", getCutRule()) - .append("multiParam", getMultiParam()) - .append("subParamGroup", getSubParamGroup()) - .append("description", getDescription()) - .append("unit", getUnit()) - .append("enabled", getEnabled()) - .append("createTime", getCreateTime()) - .append("updateTime", getUpdateTime()) - .toString(); - } -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquRouting.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquRouting.java deleted file mode 100644 index 96b9d1c0..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquRouting.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.alops.system.domain; - -import com.alops.common.annotation.Excel; -import com.alops.common.core.domain.BaseEntity; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.apache.ibatis.annotations.Mapper; - -/** - * 路由信息对象 equ_routing - * - * @author ruoyi - * @date 2025-08-15 - */ - -public class EquRouting extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** 主键 */ - private String id; - - /** 设备采集id */ - @Excel(name = "设备采集id") - private String equGatherId; - - /** 目的地址 (ipv4/ipv6网段) */ - @Excel(name = "目的地址 (ipv4/ipv6网段)") - private String desAddress; - - /** 子网掩码 */ - @Excel(name = "子网掩码") - private String subnetMask; - - /** 下一跳地址 (ipv4/ipv6网段) */ - @Excel(name = "下一跳地址 (ipv4/ipv6网段)") - private String nextHop; - - public void setId(String id) - { - this.id = id; - } - - public String getId() - { - return id; - } - - public void setEquGatherId(String equGatherId) - { - this.equGatherId = equGatherId; - } - - public String getEquGatherId() - { - return equGatherId; - } - - public void setDesAddress(String desAddress) - { - this.desAddress = desAddress; - } - - public String getDesAddress() - { - return desAddress; - } - - public void setSubnetMask(String subnetMask) - { - this.subnetMask = subnetMask; - } - - public String getSubnetMask() - { - return subnetMask; - } - - public void setNextHop(String nextHop) - { - this.nextHop = nextHop; - } - - public String getNextHop() - { - return nextHop; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("equGatherId", getEquGatherId()) - .append("desAddress", getDesAddress()) - .append("subnetMask", getSubnetMask()) - .append("nextHop", getNextHop()) - .toString(); - } -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquValn.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquValn.java deleted file mode 100644 index 1894daaf..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquValn.java +++ /dev/null @@ -1,101 +0,0 @@ -package com.alops.system.domain; - -import com.alops.common.annotation.Excel; -import com.alops.common.core.domain.BaseEntity; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.apache.ibatis.annotations.Mapper; - -/** - * 网络配置对象 equ_valn - * - * @author ruoyi - * @date 2025-08-09 - */ - -public class EquValn extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** 主键 */ - private Long id; - - /** 设备id */ - @Excel(name = "设备id") - private String equId; - - /** VLan管理id */ - @Excel(name = "VLan管理id") - private String mainId; - - /** ipv4地址 */ - @Excel(name = "ipv4地址") - private String ipAddress; - - /** 子网掩码 */ - @Excel(name = "子网掩码") - private String subnetMask; - - public void setId(Long id) - { - this.id = id; - } - - public Long getId() - { - return id; - } - - public void setEquId(String equId) - { - this.equId = equId; - } - - public String getEquId() - { - return equId; - } - - public void setMainId(String mainId) - { - this.mainId = mainId; - } - - public String getMainId() - { - return mainId; - } - - public void setIpAddress(String ipAddress) - { - this.ipAddress = ipAddress; - } - - public String getIpAddress() - { - return ipAddress; - } - - public void setSubnetMask(String subnetMask) - { - this.subnetMask = subnetMask; - } - - public String getSubnetMask() - { - return subnetMask; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("equId", getEquId()) - .append("mainId", getMainId()) - .append("ipAddress", getIpAddress()) - .append("subnetMask", getSubnetMask()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .toString(); - } -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquVeneer.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquVeneer.java deleted file mode 100644 index 23bd8554..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquVeneer.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.alops.system.domain; - -import com.alops.common.annotation.Excel; -import com.alops.common.core.domain.BaseEntity; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.apache.ibatis.annotations.Mapper; - -/** - * 【请填写功能名称】对象 equ_veneer - * - * @author ruoyi - * @date 2025-08-15 - */ - -public class EquVeneer extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** 主键 */ - private String id; - - /** 设备的一个单板的运行id */ - @Excel(name = "设备的一个单板的运行id") - private String veneerId; - - /** 单板运行状态校准值(Online/Offline/Fault) */ - @Excel(name = "单板运行状态校准值", readConverterExp = "O=nline/Offline/Fault") - private String veneerStatus; - - /** 采集id */ - @Excel(name = "采集id") - private String equGatherId; - - public void setId(String id) - { - this.id = id; - } - - public String getId() - { - return id; - } - - public void setVeneerId(String veneerId) - { - this.veneerId = veneerId; - } - - public String getVeneerId() - { - return veneerId; - } - - public void setVeneerStatus(String veneerStatus) - { - this.veneerStatus = veneerStatus; - } - - public String getVeneerStatus() - { - return veneerStatus; - } - - public void setEquGatherId(String equGatherId) - { - this.equGatherId = equGatherId; - } - - public String getEquGatherId() - { - return equGatherId; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("veneerId", getVeneerId()) - .append("veneerStatus", getVeneerStatus()) - .append("equGatherId", getEquGatherId()) - .toString(); - } -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquVlan.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquVlan.java deleted file mode 100644 index f7bfaae9..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquVlan.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.alops.system.domain; - -import com.alops.common.annotation.Excel; -import com.alops.common.core.domain.BaseEntity; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; -import org.apache.ibatis.annotations.Mapper; - -/** - * 【请填写功能名称】对象 equ_vlan - * - * @author ruoyi - * @date 2025-08-15 - */ - -public class EquVlan extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** 主键 */ - private String id; - - /** 采集ID */ - @Excel(name = "采集ID") - private String equGatherId; - - /** vlan的ip地址 */ - @Excel(name = "vlan的ip地址") - private String mainId; - - /** IPv4地址 */ - @Excel(name = "IPv4地址") - private String ipAddress; - - /** 掩码格式 */ - @Excel(name = "掩码格式") - private String subnetMask; - - /** $column.columnComment */ - @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") - private String vlanId; - - public void setId(String id) - { - this.id = id; - } - - public String getId() - { - return id; - } - - public void setEquGatherId(String equGatherId) - { - this.equGatherId = equGatherId; - } - - public String getEquGatherId() - { - return equGatherId; - } - - public void setMainId(String mainId) - { - this.mainId = mainId; - } - - public String getMainId() - { - return mainId; - } - - public void setIpAddress(String ipAddress) - { - this.ipAddress = ipAddress; - } - - public String getIpAddress() - { - return ipAddress; - } - - public void setSubnetMask(String subnetMask) - { - this.subnetMask = subnetMask; - } - - public String getSubnetMask() - { - return subnetMask; - } - - public void setVlanId(String vlanId) - { - this.vlanId = vlanId; - } - - public String getVlanId() - { - return vlanId; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("equGatherId", getEquGatherId()) - .append("mainId", getMainId()) - .append("ipAddress", getIpAddress()) - .append("subnetMask", getSubnetMask()) - .append("createTime", getCreateTime()) - .append("updateBy", getUpdateBy()) - .append("vlanId", getVlanId()) - .toString(); - } -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/AlertMessage.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/FauSta.java similarity index 91% rename from ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/AlertMessage.java rename to ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/FauSta.java index 6f73361f..4fb9bce5 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/AlertMessage.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/FauSta.java @@ -9,29 +9,29 @@ import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; /** - * 故障统计对象 alert_message + * 故障统计对象 fau_sta * * @author ruoyi - * @date 2025-09-04 + * @date 2025-08-01 */ -public class AlertMessage extends BaseEntity +public class FauSta extends BaseEntity { private static final long serialVersionUID = 1L; - /** ID */ + /** 故障ID */ private Long id; /** 设备ID */ @Excel(name = "设备ID") private String equId; - /** 预警现象简述 */ - @Excel(name = "预警现象简述") + /** 故障现象简述 */ + @Excel(name = "故障现象简述") private String description; - /** 预警类型(枚举表名) */ - @Excel(name = "预警类型(枚举表名)") - private String type; + /** 故障类型(枚举) */ + @Excel(name = "故障类型(枚举)") + private Long type; /** 设备类型 */ @Excel(name = "设备类型") @@ -46,7 +46,7 @@ public class AlertMessage extends BaseEntity private String solution; /** 故障级别(1-5级) */ - @Excel(name = "预警级别(1-5级)") + @Excel(name = "故障级别(1-5级)") private Long level; /** 发生时间 */ @@ -101,12 +101,12 @@ public class AlertMessage extends BaseEntity return description; } - public void setType(String type) + public void setType(Long type) { this.type = type; } - public String getType() + public Long getType() { return type; } diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/InternalMessage.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/InternalMessage.java deleted file mode 100644 index 428bdd5c..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/InternalMessage.java +++ /dev/null @@ -1,83 +0,0 @@ -package com.alops.system.domain; - -import com.alops.common.annotation.Excel; -import com.alops.common.core.domain.BaseEntity; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; - -/** - * 站内信对象 internal_message - * - * @author ruoyi - * @date 2025-09-04 - */ -public class InternalMessage extends BaseEntity -{ - private static final long serialVersionUID = 1L; - - /** 主键ID */ - private Long id; - - /** 接收用户ID */ - @Excel(name = "接收用户ID") - private Long userId; - - /** 消息内容 */ - @Excel(name = "消息内容") - private String content; - - /** 消息状态(unread/read) */ - @Excel(name = "消息状态(unread/read)") - private String status; - - public void setId(Long id) - { - this.id = id; - } - - public Long getId() - { - return id; - } - - public void setUserId(Long userId) - { - this.userId = userId; - } - - public Long getUserId() - { - return userId; - } - - public void setContent(String content) - { - this.content = content; - } - - public String getContent() - { - return content; - } - - public void setStatus(String status) - { - this.status = status; - } - - public String getStatus() - { - return status; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("userId", getUserId()) - .append("content", getContent()) - .append("status", getStatus()) - .append("createTime", getCreateTime()) - .toString(); - } -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/AlertRuleAddDto.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/AlertRuleAddDto.java deleted file mode 100644 index 4e5843ee..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/AlertRuleAddDto.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.alops.system.domain.dto; - -import com.alops.system.domain.AlertRule; -import com.alops.system.domain.AlertRuleCondition; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import java.util.List; - -@Data -@NoArgsConstructor -@AllArgsConstructor -public class AlertRuleAddDto { - - private AlertRule alertRule; - private List alertRuleConditionList; - -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/Code.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/Code.java deleted file mode 100644 index ab246d95..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/Code.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.alops.system.domain.vo; - -public class Code { - - // 通用状态 - public static final int SUCCESS = 200; // 成功 - public static final int FAIL = 500; // 失败 - public static final int PARTIAL = 206; // 部分成功 - - // 业务相关状态码(可扩展) - public static final int DEVICE_NOT_FOUND = 1001; - public static final int SNMP_QUERY_FAIL = 1002; - public static final int DB_INSERT_FAIL = 1003; - - //后续业务码都放这里 - -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/EquGatherInsertInfo.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/EquGatherInsertInfo.java deleted file mode 100644 index 11875130..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/EquGatherInsertInfo.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.alops.system.domain.vo; - -import com.alops.system.domain.EquOid; - -import java.util.List; -import java.util.Map; - -public class EquGatherInsertInfo { - private Map> oidsByTable; // List 表格 OID 分组 - private String equGatherId; // 主表主键,作为外键使用 - - public EquGatherInsertInfo(Map> oidsByTable, String equGatherId) { - this.oidsByTable = oidsByTable; - this.equGatherId = equGatherId; - } - - public Map> getOidsByTable() { return oidsByTable; } - public String getEquGatherId() { return equGatherId; } -} - diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/EquGatherResult.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/EquGatherResult.java deleted file mode 100644 index 45e6fb32..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/EquGatherResult.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.alops.system.domain.vo; - -import com.alops.system.domain.EquGather; -import com.alops.system.domain.EquInterface; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.List; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class EquGatherResult { - private EquGather gather; - private List interfaces; -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/GatherEntities.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/GatherEntities.java deleted file mode 100644 index 32f4928e..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/GatherEntities.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.alops.system.domain.vo; - -import com.alops.system.domain.EquGather; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; - -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Data -@AllArgsConstructor -@NoArgsConstructor -public class GatherEntities { - - private EquGather equGather; // 主表 - private Map> subEntities = new HashMap<>(); - -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/queryEquBaseVO.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/queryEquBaseVO.java deleted file mode 100644 index bf9ee4c2..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/queryEquBaseVO.java +++ /dev/null @@ -1,295 +0,0 @@ -package com.alops.system.domain.vo; - -import com.alops.common.annotation.Excel; -import com.alops.common.core.domain.BaseEntity; -import com.alops.system.domain.EquManu; -import com.fasterxml.jackson.annotation.JsonFormat; -import lombok.AllArgsConstructor; -import lombok.Data; -import lombok.NoArgsConstructor; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; - -import java.math.BigDecimal; -import java.util.Date; -@Data -@AllArgsConstructor -@NoArgsConstructor -public class queryEquBaseVO extends BaseEntity { - - /** - * 设备基本信息对象 equ_base - * - * @author ruoyi - * @date 2025-08-01 - */ - private static final long serialVersionUID = 1L; - - /** 设备唯一标识 */ - private String id; - - /** 设备名称 */ - @Excel(name = "设备名称") - private String name; - - /** 设备版本 */ - @Excel(name = "设备版本") - private String version; - - /** 带外管理 IP */ - @Excel(name = "带外管理 IP") - private String ip; - -// /** 设备厂商 */ -// @Excel(name = "设备厂商 ") -// private EquManu manufacture; - /** 设备厂商 */ - @Excel(name = "设备厂商id ") - private String manuId; - /** 设备厂商 */ - @Excel(name = "设备厂商名称 ") - private String manuName; - /** 安装位置 id */ - @Excel(name = "安装位置 id") - private String location; - - /** 设备类型 id */ - @Excel(name = "设备类型 id") - private String equType; - - /** 设备管理员 id */ - @Excel(name = "设备管理员 id") - private Long inCharge; - - /** 出厂日期 */ - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "出厂日期", width = 30, dateFormat = "yyyy-MM-dd") - private Date releaseDate; - - /** 安装日期 */ - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "安装日期", width = 30, dateFormat = "yyyy-MM-dd") - private Date installDate; - - /** 预计年限(年) */ - @Excel(name = "预计年限(年)") - private Long lifeCycle; - - /** 服役年限(年) */ - @Excel(name = "服役年限(年)") - private Long serviceTime; - - /** 质保时间(年) */ - @Excel(name = "质保时间(年)") - private Long warranty; - - - /** 添加日期 */ - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "添加日期", width = 30, dateFormat = "yyyy-MM-dd") - private Date createDate; - - /** 最后修改日期 */ - @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "最后修改日期", width = 30, dateFormat = "yyyy-MM-dd") - private Date updateDate; - - /** 启用状态 */ - @Excel(name = "启用状态") - private Long status; - /** 累积故障次数 */ - @Excel(name = "累积故障次数") - private Long failureFrequency; - - /** 累积维修次数 */ - @Excel(name = "累积维修次数") - private Long repairFrequency; - - /** 累积维修金额(元) */ - @Excel(name = "累积维修金额(元)") - private BigDecimal repairCost; - - public void setId(String id) - { - this.id = id; - } - - public String getId() - { - return id; - } - - public void setName(String name) - { - this.name = name; - } - - public String getName() - { - return name; - } - - public void setVersion(String version) - { - this.version = version; - } - - public String getVersion() - { - return version; - } - - public void setIp(String ip) - { - this.ip = ip; - } - - public String getIp() - { - return ip; - } - - - - public void setLocation(String location) - { - this.location = location; - } - - public String getLocation() - { - return location; - } - - public void setEquType(String equType) - { - this.equType = equType; - } - - public String getEquType() - { - return equType; - } - - public void setInCharge(Long inCharge) - { - this.inCharge = inCharge; - } - - public Long getInCharge() - { - return inCharge; - } - - public void setReleaseDate(Date releaseDate) - { - this.releaseDate = releaseDate; - } - - public Date getReleaseDate() - { - return releaseDate; - } - - public void setInstallDate(Date installDate) - { - this.installDate = installDate; - } - - public Date getInstallDate() - { - return installDate; - } - - public void setLifeCycle(Long lifeCycle) - { - this.lifeCycle = lifeCycle; - } - - public Long getLifeCycle() - { - return lifeCycle; - } - - public void setServiceTime(Long serviceTime) - { - this.serviceTime = serviceTime; - } - - public Long getServiceTime() - { - return serviceTime; - } - - public void setWarranty(Long warranty) - { - this.warranty = warranty; - } - - public Long getWarranty() - { - return warranty; - } - - - - public void setCreateDate(Date createDate) - { - this.createDate = createDate; - } - - public Date getCreateDate() - { - return createDate; - } - - public void setUpdateDate(Date updateDate) - { - this.updateDate = updateDate; - } - - public Date getUpdateDate() - { - return updateDate; - } - - public void setStatus(Long status) - { - this.status = status; - } - - public Long getStatus() - { - return status; - } - - @Override - public String toString() { - return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("name", getName()) - .append("version", getVersion()) - .append("ip", getIp()) - .append("manuId", getManuId()) - .append("manuName", getManuName()) - .append("location", getLocation()) - .append("equType", getEquType()) - .append("inCharge", getInCharge()) - .append("releaseDate", getReleaseDate()) - .append("installDate", getInstallDate()) - .append("lifeCycle", getLifeCycle()) - .append("serviceTime", getServiceTime()) - .append("warranty", getWarranty()) - .append("createBy", getCreateBy()) - .append("createDate", getCreateDate()) - .append("updateBy", getUpdateBy()) - .append("updateDate", getUpdateDate()) - .append("status", getStatus()) - .append("failureFrequency", getFailureFrequency()) - .append("repairFrequency", getRepairFrequency()) - .append("repairCost", getRepairCost()) - .toString(); - } - } - - diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlarmRuleMapper.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlarmRuleMapper.java new file mode 100644 index 00000000..5d0c5009 --- /dev/null +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlarmRuleMapper.java @@ -0,0 +1,64 @@ +package com.alops.system.mapper; + +import com.alops.system.domain.AlarmRule; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** + * 预警规则Mapper接口 + * + * @author ruoyi + * @date 2025-08-01 + */ +@Mapper +public interface AlarmRuleMapper +{ + /** + * 查询预警规则 + * + * @param id 预警规则主键 + * @return 预警规则 + */ + public AlarmRule selectAlarmRuleById(Long id); + + /** + * 查询预警规则列表 + * + * @param alarmRule 预警规则 + * @return 预警规则集合 + */ + public List selectAlarmRuleList(AlarmRule alarmRule); + + /** + * 新增预警规则 + * + * @param alarmRule 预警规则 + * @return 结果 + */ + public int insertAlarmRule(AlarmRule alarmRule); + + /** + * 修改预警规则 + * + * @param alarmRule 预警规则 + * @return 结果 + */ + public int updateAlarmRule(AlarmRule alarmRule); + + /** + * 删除预警规则 + * + * @param id 预警规则主键 + * @return 结果 + */ + public int deleteAlarmRuleById(Long id); + + /** + * 批量删除预警规则 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteAlarmRuleByIds(Long[] ids); +} 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 deleted file mode 100644 index 61521487..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlertMessageMapper.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.alops.system.mapper; - -import com.alops.system.domain.AlertMessage; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.data.repository.query.Param; - -import java.util.List; - -/** - * 故障统计Mapper接口 - * - * @author ruoyi - * @date 2025-09-04 - */ -@Mapper -public interface AlertMessageMapper -{ - - /** - * 批量插入预警消息 - * @param messages 消息列表 - * @return 受影响行数 - */ - int batchInsert(List messages); - ; - /** - * 查询故障统计 - * - * @param id 故障统计主键 - * @return 故障统计 - */ - public AlertMessage selectAlertMessageById(Long id); - - /** - * 查询故障统计列表 - * - * @param alertMessage 故障统计 - * @return 故障统计集合 - */ - public List selectAlertMessageList(AlertMessage alertMessage); - - /** - * 新增故障统计 - * - * @param alertMessage 故障统计 - * @return 结果 - */ - public int insertAlertMessage(AlertMessage alertMessage); - - /** - * 修改故障统计 - * - * @param alertMessage 故障统计 - * @return 结果 - */ - public int updateAlertMessage(AlertMessage alertMessage); - - /** - * 删除故障统计 - * - * @param id 故障统计主键 - * @return 结果 - */ - public int deleteAlertMessageById(Long id); - - /** - * 批量删除故障统计 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteAlertMessageByIds(Long[] ids); -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlertRuleConditionMapper.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlertRuleConditionMapper.java deleted file mode 100644 index 281b69d7..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlertRuleConditionMapper.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.alops.system.mapper; - -import com.alops.system.domain.AlertRuleCondition; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.data.repository.query.Param; - -import java.util.List; - -/** - * 【请填写功能名称】Mapper接口 - * - * @author ruoyi - * @date 2025-09-04 - */ -@Mapper -public interface AlertRuleConditionMapper - -{ - /** - * 根据预警规则ID查询对应的规则条件 - * @param ruleId 预警规则ID(整型) - * @return AlertRuleCondition 列表 - */ - List findByRuleId(@Param("ruleId") Long ruleId); - /** - * 查询【请填写功能名称】 - * - * @param id 【请填写功能名称】主键 - * @return 【请填写功能名称】 - */ - public AlertRuleCondition selectAlertRuleConditionById(Long id); - - /** - * 查询【请填写功能名称】列表 - * - * @param alertRuleCondition 【请填写功能名称】 - * @return 【请填写功能名称】集合 - */ - public List selectAlertRuleConditionList(AlertRuleCondition alertRuleCondition); - - /** - * 新增【请填写功能名称】 - * - * @param alertRuleCondition 【请填写功能名称】 - * @return 结果 - */ - public int insertAlertRuleCondition(AlertRuleCondition alertRuleCondition); - - /** - * 修改【请填写功能名称】 - * - * @param alertRuleCondition 【请填写功能名称】 - * @return 结果 - */ - public int updateAlertRuleCondition(AlertRuleCondition alertRuleCondition); - - /** - * 删除【请填写功能名称】 - * - * @param id 【请填写功能名称】主键 - * @return 结果 - */ - public int deleteAlertRuleConditionById(Long id); - - /** - * 批量删除【请填写功能名称】 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteAlertRuleConditionByIds(Long[] ids); -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlertRuleMapper.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlertRuleMapper.java deleted file mode 100644 index 379fea07..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlertRuleMapper.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.alops.system.mapper; - -import com.alops.system.domain.AlertRule; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.data.repository.query.Param; - -import java.util.List; - -/** - * 【请填写功能名称】Mapper接口 - * - * @author ruoyi - * @date 2025-09-05 - */ -@Mapper -public interface AlertRuleMapper -{ - - //根据id组,批量返回 - // Mapper 接口 - List selectByIds(@Param("list") List ids); - /** - * 查询【请填写功能名称】 - * - * @param id 【请填写功能名称】主键 - * @return 【请填写功能名称】 - */ - public AlertRule selectAlertRuleById(Long id); - - /** - * 查询【请填写功能名称】列表 - * - * @param alertRule 【请填写功能名称】 - * @return 【请填写功能名称】集合 - */ - public List selectAlertRuleList(AlertRule alertRule); - - /** - * 新增【请填写功能名称】 - * - * @param alertRule 【请填写功能名称】 - * @return 结果 - */ - public int insertAlertRule(AlertRule alertRule); - - /** - * 修改【请填写功能名称】 - * - * @param alertRule 【请填写功能名称】 - * @return 结果 - */ - public int updateAlertRule(AlertRule alertRule); - - /** - * 删除【请填写功能名称】 - * - * @param id 【请填写功能名称】主键 - * @return 结果 - */ - public int deleteAlertRuleById(Long id); - - /** - * 批量删除【请填写功能名称】 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteAlertRuleByIds(Long[] ids); -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/DictAlarmParamMapper.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/DictAlarmParamMapper.java deleted file mode 100644 index 758e670a..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/DictAlarmParamMapper.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.alops.system.mapper; - -import com.alops.system.domain.DictAlarmParam; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.data.repository.query.Param; - -import java.util.List; - -/** - * 【请填写功能名称】Mapper接口 - * - * @author ruoyi - * @date 2025-09-05 - */ -@Mapper -public interface DictAlarmParamMapper -{ - - List selectByTableName(@Param("tableName") String tableName); - /** - * 查询【请填写功能名称】 - * - * @param id 【请填写功能名称】主键 - * @return 【请填写功能名称】 - */ - public DictAlarmParam selectDictAlarmParamById(Long id); - - /** - * 查询【请填写功能名称】列表 - * - * @param dictAlarmParam 【请填写功能名称】 - * @return 【请填写功能名称】集合 - */ - public List selectDictAlarmParamList(DictAlarmParam dictAlarmParam); - - /** - * 新增【请填写功能名称】 - * - * @param dictAlarmParam 【请填写功能名称】 - * @return 结果 - */ - public int insertDictAlarmParam(DictAlarmParam dictAlarmParam); - - /** - * 修改【请填写功能名称】 - * - * @param dictAlarmParam 【请填写功能名称】 - * @return 结果 - */ - public int updateDictAlarmParam(DictAlarmParam dictAlarmParam); - - /** - * 删除【请填写功能名称】 - * - * @param id 【请填写功能名称】主键 - * @return 结果 - */ - public int deleteDictAlarmParamById(Long id); - - /** - * 批量删除【请填写功能名称】 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteDictAlarmParamByIds(Long[] ids); -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquBaseMapper.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquBaseMapper.java index 9a513ce0..7643d8d2 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquBaseMapper.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquBaseMapper.java @@ -2,9 +2,7 @@ package com.alops.system.mapper; import com.alops.system.domain.EquBase; import com.alops.system.domain.dto.EquBaseQueryDto; -import com.alops.system.domain.vo.queryEquBaseVO; import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Update; import java.util.List; @@ -18,18 +16,6 @@ import java.util.List; @Mapper public interface EquBaseMapper { - @Update("DELETE FROM equ_interface") - void deleteEquInterface(); - - @Update("DELETE FROM equ_routing") - void deleteEquRouting(); - - @Update("DELETE FROM equ_veneer") - void deleteEquVeneer(); - - @Update("DELETE FROM equ_vlan") - void deleteEquVlan(); - /** * 查询设备基本信息 * @@ -39,20 +25,12 @@ public interface EquBaseMapper public EquBase selectEquBaseById(String id); /** - * 查询设备基本信息和厂商信息 + * 查询设备基本信息列表 * * @param equBaseQueryDto 设备基本信息 * @return 设备基本信息集合 */ - public List selectEquBaseList(EquBaseQueryDto equBaseQueryDto); - /** - * 查询设备基本信息列表 - * - * - */ - public List findEquBaseList(); - - + public List selectEquBaseList(EquBaseQueryDto equBaseQueryDto); /** * 新增设备基本信息 diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquGatherMapper.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquGatherMapper.java deleted file mode 100644 index 461618b5..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquGatherMapper.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.alops.system.mapper; - -import com.alops.system.domain.EquGather; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.data.repository.query.Param; - -import java.util.List; - -/** - * 设备采集信息Mapper接口 - * - * @author ruoyi - * @date 2025-08-15 - */ -@Mapper -public interface EquGatherMapper -{ - - // 更新 health 字段 - int updateHealth(String collectId, Double totalHealth); - - /** - * 查询设备采集信息 - * - * @param id 设备采集信息主键 - * @return 设备采集信息 - */ - public EquGather selectEquGatherById(String id); - - /** - * 批量插入 EquGather 记录 - */ - int batchInsertEquGather(@Param("list") List list); - /** - * 查询设备采集信息列表 - * - * @param equGather 设备采集信息 - * @return 设备采集信息集合 - */ - public List selectEquGatherList(EquGather equGather); - - /** - * 新增设备采集信息 - * - * @param equGather 设备采集信息 - * @return 结果 - */ - public int insertEquGather(EquGather equGather); - - /** - * 修改设备采集信息 - * - * @param equGather 设备采集信息 - * @return 结果 - */ - public int updateEquGather(EquGather equGather); - - /** - * 删除设备采集信息 - * - * @param id 设备采集信息主键 - * @return 结果 - */ - public int deleteEquGatherById(String id); - - /** - * 批量删除设备采集信息 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteEquGatherByIds(String[] ids); -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquInterfaceMapper.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquInterfaceMapper.java deleted file mode 100644 index 549be44c..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquInterfaceMapper.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.alops.system.mapper; - -import com.alops.system.domain.EquInterface; -import org.apache.ibatis.annotations.Mapper; - -import java.util.List; - -/** - * 端口运行状态Mapper接口 - * - * @author ruoyi - * @date 2025-08-20 - */ -@Mapper -public interface EquInterfaceMapper -{ - - /** - * 批量插入 PortsEntity - */ - void insertBatch(List list); - /** - * 查询端口运行状态 - * - * @param id 端口运行状态主键 - * @return 端口运行状态 - */ - public EquInterface selectEquInterfaceById(String id); - - /** - * 查询端口运行状态列表 - * - * @param equInterface 端口运行状态 - * @return 端口运行状态集合 - */ - public List selectEquInterfaceList(EquInterface equInterface); - - /** - * 新增端口运行状态 - * - * @param equInterface 端口运行状态 - * @return 结果 - */ - public int insertEquInterface(EquInterface equInterface); - - /** - * 修改端口运行状态 - * - * @param equInterface 端口运行状态 - * @return 结果 - */ - public int updateEquInterface(EquInterface equInterface); - - /** - * 删除端口运行状态 - * - * @param id 端口运行状态主键 - * @return 结果 - */ - public int deleteEquInterfaceById(String id); - - /** - * 批量删除端口运行状态 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteEquInterfaceByIds(String[] ids); -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquOidMapper.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquOidMapper.java deleted file mode 100644 index 3f7c62fe..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquOidMapper.java +++ /dev/null @@ -1,72 +0,0 @@ -package com.alops.system.mapper; - -import com.alops.system.domain.EquOid; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.data.repository.query.Param; - -import java.util.List; - -/** - * OID配置信息Mapper接口 - * - * @author ruoyi - * @date 2025-08-15 - */ -@Mapper -public interface EquOidMapper -{ - - /** - * 根据厂商ID和启用状态查询OID列表 - * @param manufacturerId 厂商ID - * @return OID列表 - */ - List findByManuIdAndStatus(@Param("manufacturerId") String manufacturerId); - /** - * 查询OID配置信息 - * - * @param id OID配置信息主键 - * @return OID配置信息 - */ - public EquOid selectEquOidById(Long id); - - /** - * 查询OID配置信息列表 - * - * @param equOid OID配置信息 - * @return OID配置信息集合 - */ - public List selectEquOidList(EquOid equOid); - - /** - * 新增OID配置信息 - * - * @param equOid OID配置信息 - * @return 结果 - */ - public int insertEquOid(EquOid equOid); - - /** - * 修改OID配置信息 - * - * @param equOid OID配置信息 - * @return 结果 - */ - public int updateEquOid(EquOid equOid); - - /** - * 删除OID配置信息 - * - * @param id OID配置信息主键 - * @return 结果 - */ - public int deleteEquOidById(Long id); - - /** - * 批量删除OID配置信息 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteEquOidByIds(Long[] ids); -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquRoutingMapper.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquRoutingMapper.java deleted file mode 100644 index df21be44..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquRoutingMapper.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.alops.system.mapper; - -import com.alops.system.domain.EquRouting; -import org.apache.ibatis.annotations.Mapper; - -import java.util.List; - -/** - * 路由信息Mapper接口 - * - * @author ruoyi - * @date 2025-08-15 - */ -@Mapper -public interface EquRoutingMapper -{ - void insertBatchRouting(List list); - /** - * 查询路由信息 - * - * @param id 路由信息主键 - * @return 路由信息 - */ - public EquRouting selectEquRoutingById(String id); - - /** - * 查询路由信息列表 - * - * @param equRouting 路由信息 - * @return 路由信息集合 - */ - public List selectEquRoutingList(EquRouting equRouting); - - /** - * 新增路由信息 - * - * @param equRouting 路由信息 - * @return 结果 - */ - public int insertEquRouting(EquRouting equRouting); - - /** - * 修改路由信息 - * - * @param equRouting 路由信息 - * @return 结果 - */ - public int updateEquRouting(EquRouting equRouting); - - /** - * 删除路由信息 - * - * @param id 路由信息主键 - * @return 结果 - */ - public int deleteEquRoutingById(String id); - - /** - * 批量删除路由信息 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteEquRoutingByIds(String[] ids); - - -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquVeneerMapper.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquVeneerMapper.java deleted file mode 100644 index 34861fce..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquVeneerMapper.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.alops.system.mapper; - -import com.alops.system.domain.EquVeneer; -import org.apache.ibatis.annotations.Mapper; - -import java.util.List; - -/** - * 【请填写功能名称】Mapper接口 - * - * @author ruoyi - * @date 2025-08-15 - */ -@Mapper -public interface EquVeneerMapper - -{ - void insertBatchVeneer(List list); - /** - * 查询【请填写功能名称】 - * - * @param id 【请填写功能名称】主键 - * @return 【请填写功能名称】 - */ - public EquVeneer selectEquVeneerById(String id); - - /** - * 查询【请填写功能名称】列表 - * - * @param equVeneer 【请填写功能名称】 - * @return 【请填写功能名称】集合 - */ - public List selectEquVeneerList(EquVeneer equVeneer); - - /** - * 新增【请填写功能名称】 - * - * @param equVeneer 【请填写功能名称】 - * @return 结果 - */ - public int insertEquVeneer(EquVeneer equVeneer); - - /** - * 修改【请填写功能名称】 - * - * @param equVeneer 【请填写功能名称】 - * @return 结果 - */ - public int updateEquVeneer(EquVeneer equVeneer); - - /** - * 删除【请填写功能名称】 - * - * @param id 【请填写功能名称】主键 - * @return 结果 - */ - public int deleteEquVeneerById(String id); - - /** - * 批量删除【请填写功能名称】 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteEquVeneerByIds(String[] ids); -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquVlanMapper.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquVlanMapper.java deleted file mode 100644 index 32245def..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquVlanMapper.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.alops.system.mapper; - -import com.alops.system.domain.EquVlan; -import org.apache.ibatis.annotations.Mapper; - -import java.util.List; - - -/** - * 【请填写功能名称】Mapper接口 - * - * @author ruoyi - * @date 2025-08-15 - */ -@Mapper -public interface EquVlanMapper -{ - - void insertBatchVlan(List list); - /** - * 查询【请填写功能名称】 - * - * @param id 【请填写功能名称】主键 - * @return 【请填写功能名称】 - */ - public EquVlan selectEquVlanById(String id); - - /** - * 查询【请填写功能名称】列表 - * - * @param equVlan 【请填写功能名称】 - * @return 【请填写功能名称】集合 - */ - public List selectEquVlanList(EquVlan equVlan); - - /** - * 新增【请填写功能名称】 - * - * @param equVlan 【请填写功能名称】 - * @return 结果 - */ - public int insertEquVlan(EquVlan equVlan); - - /** - * 修改【请填写功能名称】 - * - * @param equVlan 【请填写功能名称】 - * @return 结果 - */ - public int updateEquVlan(EquVlan equVlan); - - /** - * 删除【请填写功能名称】 - * - * @param id 【请填写功能名称】主键 - * @return 结果 - */ - public int deleteEquVlanById(String id); - - /** - * 批量删除【请填写功能名称】 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteEquVlanByIds(String[] ids); -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/FauStaMapper.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/FauStaMapper.java new file mode 100644 index 00000000..c461a6de --- /dev/null +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/FauStaMapper.java @@ -0,0 +1,65 @@ +package com.alops.system.mapper; + +import com.alops.system.domain.FauSta; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + + +/** + * 故障统计Mapper接口 + * + * @author ruoyi + * @date 2025-08-01 + */ +@Mapper +public interface FauStaMapper +{ + /** + * 查询故障统计 + * + * @param id 故障统计主键 + * @return 故障统计 + */ + public FauSta selectFauStaById(Long id); + + /** + * 查询故障统计列表 + * + * @param fauSta 故障统计 + * @return 故障统计集合 + */ + public List selectFauStaList(FauSta fauSta); + + /** + * 新增故障统计 + * + * @param fauSta 故障统计 + * @return 结果 + */ + public int insertFauSta(FauSta fauSta); + + /** + * 修改故障统计 + * + * @param fauSta 故障统计 + * @return 结果 + */ + public int updateFauSta(FauSta fauSta); + + /** + * 删除故障统计 + * + * @param id 故障统计主键 + * @return 结果 + */ + public int deleteFauStaById(Long id); + + /** + * 批量删除故障统计 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteFauStaByIds(Long[] ids); +} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/InternalMessageMapper.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/InternalMessageMapper.java deleted file mode 100644 index f7cef6e8..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/InternalMessageMapper.java +++ /dev/null @@ -1,73 +0,0 @@ -package com.alops.system.mapper; - -import com.alops.system.domain.InternalMessage; -import org.apache.ibatis.annotations.Mapper; -import org.springframework.data.repository.query.Param; - -import java.util.List; - -/** - * 站内信Mapper接口 - * - * @author ruoyi - * @date 2025-09-04 - */ -@Mapper -public interface InternalMessageMapper - { - /** - * 批量插入消息 - * @param messages 消息列表 - * @return 受影响行数 - */ - int batchInsert(@Param("messages") List messages); - - - /** - * 查询站内信 - * - * @param id 站内信主键 - * @return 站内信 - */ - public InternalMessage selectInternalMessageById(Long id); - - /** - * 查询站内信列表 - * - * @param internalMessage 站内信 - * @return 站内信集合 - */ - public List selectInternalMessageList(InternalMessage internalMessage); - - /** - * 新增站内信 - * - * @param internalMessage 站内信 - * @return 结果 - */ - public int insertInternalMessage(InternalMessage internalMessage); - - /** - * 修改站内信 - * - * @param internalMessage 站内信 - * @return 结果 - */ - public int updateInternalMessage(InternalMessage internalMessage); - - /** - * 删除站内信 - * - * @param id 站内信主键 - * @return 结果 - */ - public int deleteInternalMessageById(Long id); - - /** - * 批量删除站内信 - * - * @param ids 需要删除的数据主键集合 - * @return 结果 - */ - public int deleteInternalMessageByIds(Long[] ids); -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/SysUserMapper.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/SysUserMapper.java index ec557c82..a2a87d30 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/SysUserMapper.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/SysUserMapper.java @@ -13,11 +13,6 @@ import com.alops.common.core.domain.entity.SysUser; */@Mapper public interface SysUserMapper { - - /** - * 根据角色ID查询用户列表(多对多) - */ - List selectByRoleId(@Param("roleId") Long roleId); /** * 根据条件分页查询用户列表 * diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/ConvertRawValueService.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/ConvertRawValueService.java deleted file mode 100644 index 16f66b8b..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/ConvertRawValueService.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.alops.system.service; - -import com.alops.system.domain.EquOid; -import org.springframework.stereotype.Service; - -import java.util.Map; -@Service -public interface ConvertRawValueService { - - public String convertValue(String rule, String val); - -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlarmRuleService.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlarmRuleService.java new file mode 100644 index 00000000..47cd49b8 --- /dev/null +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlarmRuleService.java @@ -0,0 +1,62 @@ +package com.alops.system.service; + +import com.alops.system.domain.AlarmRule; + +import java.util.List; + +/** + * 预警规则Service接口 + * + * @author ruoyi + * @date 2025-08-01 + */ +public interface IAlarmRuleService +{ + /** + * 查询预警规则 + * + * @param id 预警规则主键 + * @return 预警规则 + */ + public AlarmRule selectAlarmRuleById(Long id); + + /** + * 查询预警规则列表 + * + * @param alarmRule 预警规则 + * @return 预警规则集合 + */ + public List selectAlarmRuleList(AlarmRule alarmRule); + + /** + * 新增预警规则 + * + * @param alarmRule 预警规则 + * @return 结果 + */ + public int insertAlarmRule(AlarmRule alarmRule); + + /** + * 修改预警规则 + * + * @param alarmRule 预警规则 + * @return 结果 + */ + public int updateAlarmRule(AlarmRule alarmRule); + + /** + * 批量删除预警规则 + * + * @param ids 需要删除的预警规则主键集合 + * @return 结果 + */ + public int deleteAlarmRuleByIds(Long[] ids); + + /** + * 删除预警规则信息 + * + * @param id 预警规则主键 + * @return 结果 + */ + public int deleteAlarmRuleById(Long id); +} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertLaunchService.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertLaunchService.java deleted file mode 100644 index c849e2b8..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertLaunchService.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.alops.system.service; - -import java.util.List; - -public interface IAlertLaunchService { - public void executeImmediateAlerts(List ruleIds); -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertRuleConditionService.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertRuleConditionService.java deleted file mode 100644 index 501fdd80..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertRuleConditionService.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.alops.system.service; - -import com.alops.system.domain.AlertRuleCondition; - -import java.util.List; - -/** - * 【请填写功能名称】Service接口 - * - * @author ruoyi - * @date 2025-09-04 - */ -public interface IAlertRuleConditionService -{ - /** - * 查询【请填写功能名称】 - * - * @param id 【请填写功能名称】主键 - * @return 【请填写功能名称】 - */ - public AlertRuleCondition selectAlertRuleConditionById(Long id); - - /** - * 查询【请填写功能名称】列表 - * - * @param alertRuleCondition 【请填写功能名称】 - * @return 【请填写功能名称】集合 - */ - public List selectAlertRuleConditionList(AlertRuleCondition alertRuleCondition); - - /** - * 新增【请填写功能名称】 - * - * @param alertRuleCondition 【请填写功能名称】 - * @return 结果 - */ - public int insertAlertRuleCondition(AlertRuleCondition alertRuleCondition); - - /** - * 修改【请填写功能名称】 - * - * @param alertRuleCondition 【请填写功能名称】 - * @return 结果 - */ - public int updateAlertRuleCondition(AlertRuleCondition alertRuleCondition); - - /** - * 批量删除【请填写功能名称】 - * - * @param ids 需要删除的【请填写功能名称】主键集合 - * @return 结果 - */ - public int deleteAlertRuleConditionByIds(Long[] ids); - - /** - * 删除【请填写功能名称】信息 - * - * @param id 【请填写功能名称】主键 - * @return 结果 - */ - public int deleteAlertRuleConditionById(Long id); -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertRuleService.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertRuleService.java deleted file mode 100644 index e818e5d5..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertRuleService.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.alops.system.service; - -import com.alops.system.domain.AlertRule; -import com.alops.system.domain.dto.AlertRuleAddDto; - -import java.util.List; - -/** - * 【请填写功能名称】Service接口 - * - * @author ruoyi - * @date 2025-09-04 - */ -public interface IAlertRuleService -{ - - public AlertRule saveRule(AlertRuleAddDto dto); - /** - * 查询【请填写功能名称】 - * - * @param id 【请填写功能名称】主键 - * @return 【请填写功能名称】 - */ - public AlertRule selectAlertRuleById(Long id); - - /** - * 查询【请填写功能名称】列表 - * - * @param alertRule 【请填写功能名称】 - * @return 【请填写功能名称】集合 - */ - public List selectAlertRuleList(AlertRule alertRule); - - /** - * 新增【请填写功能名称】 - * - * @param alertRule 【请填写功能名称】 - * @return 结果 - */ - public int insertAlertRule(AlertRule alertRule); - - /** - * 修改【请填写功能名称】 - * - * @param alertRule 【请填写功能名称】 - * @return 结果 - */ - public int updateAlertRule(AlertRule alertRule); - - /** - * 批量删除【请填写功能名称】 - * - * @param ids 需要删除的【请填写功能名称】主键集合 - * @return 结果 - */ - public int deleteAlertRuleByIds(Long[] ids); - - /** - * 删除【请填写功能名称】信息 - * - * @param id 【请填写功能名称】主键 - * @return 结果 - */ - public int deleteAlertRuleById(Long id); -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertSenderService.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertSenderService.java deleted file mode 100644 index f98b51a4..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertSenderService.java +++ /dev/null @@ -1,7 +0,0 @@ -package com.alops.system.service; - -import java.util.List; - -public interface IAlertSenderService { - public void sendAlert(List alertMessage, String alertWay, String target); -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IDictAlarmParamService.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IDictAlarmParamService.java deleted file mode 100644 index 6aa48d8c..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IDictAlarmParamService.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.alops.system.service; - -import com.alops.system.domain.DictAlarmParam; - -import java.util.List; - -/** - * 【请填写功能名称】Service接口 - * - * @author ruoyi - * @date 2025-09-05 - */ -public interface IDictAlarmParamService -{ - - List getParamsByTableName(String tableName); - /** - * 查询【请填写功能名称】 - * - * @param id 【请填写功能名称】主键 - * @return 【请填写功能名称】 - */ - public DictAlarmParam selectDictAlarmParamById(Long id); - - /** - * 查询【请填写功能名称】列表 - * - * @param dictAlarmParam 【请填写功能名称】 - * @return 【请填写功能名称】集合 - */ - public List selectDictAlarmParamList(DictAlarmParam dictAlarmParam); - - /** - * 新增【请填写功能名称】 - * - * @param dictAlarmParam 【请填写功能名称】 - * @return 结果 - */ - public int insertDictAlarmParam(DictAlarmParam dictAlarmParam); - - /** - * 修改【请填写功能名称】 - * - * @param dictAlarmParam 【请填写功能名称】 - * @return 结果 - */ - public int updateDictAlarmParam(DictAlarmParam dictAlarmParam); - - /** - * 批量删除【请填写功能名称】 - * - * @param ids 需要删除的【请填写功能名称】主键集合 - * @return 结果 - */ - public int deleteDictAlarmParamByIds(Long[] ids); - - /** - * 删除【请填写功能名称】信息 - * - * @param id 【请填写功能名称】主键 - * @return 结果 - */ - public int deleteDictAlarmParamById(Long id); -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquBaseService.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquBaseService.java index 5d00e6b2..0bac6c95 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquBaseService.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquBaseService.java @@ -2,7 +2,6 @@ package com.alops.system.service; import com.alops.system.domain.EquBase; import com.alops.system.domain.dto.EquBaseQueryDto; -import com.alops.system.domain.vo.queryEquBaseVO; import java.util.List; @@ -29,7 +28,7 @@ public interface IEquBaseService * @param equBaseQueryDto 设备基本信息 * @return 设备基本信息集合 */ - public List selectEquBaseList(EquBaseQueryDto equBaseQueryDto); + public List selectEquBaseList(EquBaseQueryDto equBaseQueryDto); /** * 新增设备基本信息 diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquGatherService.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquGatherService.java deleted file mode 100644 index 617868f2..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquGatherService.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.alops.system.service; - -import com.alops.system.domain.EquGather; - -import java.util.List; - -/** - * 设备采集信息Service接口 - * - * @author ruoyi - * @date 2025-08-15 - */ -public interface IEquGatherService -{ - /** - * 查询设备采集信息 - * - * @param id 设备采集信息主键 - * @return 设备采集信息 - */ - public EquGather selectEquGatherById(String id); - - /** - * 查询设备采集信息列表 - * - * @param equGather 设备采集信息 - * @return 设备采集信息集合 - */ - public List selectEquGatherList(EquGather equGather); - - /** - * 新增设备采集信息 - * - * @param equGather 设备采集信息 - * @return 结果 - */ - public int insertEquGather(EquGather equGather); - - /** - * 修改设备采集信息 - * - * @param equGather 设备采集信息 - * @return 结果 - */ - public int updateEquGather(EquGather equGather); - - /** - * 批量删除设备采集信息 - * - * @param ids 需要删除的设备采集信息主键集合 - * @return 结果 - */ - public int deleteEquGatherByIds(String[] ids); - - /** - * 删除设备采集信息信息 - * - * @param id 设备采集信息主键 - * @return 结果 - */ - public int deleteEquGatherById(String id); -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquInterfaceService.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquInterfaceService.java deleted file mode 100644 index 570a0a32..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquInterfaceService.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.alops.system.service; - -import com.alops.system.domain.EquInterface; -import org.springframework.stereotype.Service; - -import java.util.List; - -/** - * 端口运行状态Service接口 - * - * @author ruoyi - * @date 2025-08-20 - */ - -public interface IEquInterfaceService -{ - /** - * 查询端口运行状态 - * - * @param id 端口运行状态主键 - * @return 端口运行状态 - */ - public EquInterface selectEquInterfaceById(String id); - - /** - * 查询端口运行状态列表 - * - * @param equInterface 端口运行状态 - * @return 端口运行状态集合 - */ - public List selectEquInterfaceList(EquInterface equInterface); - - /** - * 新增端口运行状态 - * - * @param equInterface 端口运行状态 - * @return 结果 - */ - public int insertEquInterface(EquInterface equInterface); - - /** - * 修改端口运行状态 - * - * @param equInterface 端口运行状态 - * @return 结果 - */ - public int updateEquInterface(EquInterface equInterface); - - /** - * 批量删除端口运行状态 - * - * @param ids 需要删除的端口运行状态主键集合 - * @return 结果 - */ - public int deleteEquInterfaceByIds(String[] ids); - - /** - * 删除端口运行状态信息 - * - * @param id 端口运行状态主键 - * @return 结果 - */ - public int deleteEquInterfaceById(String id); -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquOidService.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquOidService.java deleted file mode 100644 index a6282e09..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquOidService.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.alops.system.service; - -import com.alops.system.domain.EquOid; - -import java.util.List; - -/** - * OID配置信息Service接口 - * - * @author ruoyi - * @date 2025-08-15 - */ -public interface IEquOidService -{ - /** - * 查询OID配置信息 - * - * @param id OID配置信息主键 - * @return OID配置信息 - */ - public EquOid selectEquOidById(Long id); - - /** - * 查询OID配置信息列表 - * - * @param equOid OID配置信息 - * @return OID配置信息集合 - */ - public List selectEquOidList(EquOid equOid); - - /** - * 新增OID配置信息 - * - * @param equOid OID配置信息 - * @return 结果 - */ - public int insertEquOid(EquOid equOid); - - /** - * 修改OID配置信息 - * - * @param equOid OID配置信息 - * @return 结果 - */ - public int updateEquOid(EquOid equOid); - - /** - * 批量删除OID配置信息 - * - * @param ids 需要删除的OID配置信息主键集合 - * @return 结果 - */ - public int deleteEquOidByIds(Long[] ids); - - /** - * 删除OID配置信息信息 - * - * @param id OID配置信息主键 - * @return 结果 - */ - public int deleteEquOidById(Long id); -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquRoutingService.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquRoutingService.java deleted file mode 100644 index 2e116183..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquRoutingService.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.alops.system.service; - -import com.alops.system.domain.EquRouting; - -import java.util.List; - -/** - * 路由信息Service接口 - * - * @author ruoyi - * @date 2025-08-15 - */ -public interface IEquRoutingService -{ - /** - * 查询路由信息 - * - * @param id 路由信息主键 - * @return 路由信息 - */ - public EquRouting selectEquRoutingById(String id); - - /** - * 查询路由信息列表 - * - * @param equRouting 路由信息 - * @return 路由信息集合 - */ - public List selectEquRoutingList(EquRouting equRouting); - - /** - * 新增路由信息 - * - * @param equRouting 路由信息 - * @return 结果 - */ - public int insertEquRouting(EquRouting equRouting); - - /** - * 修改路由信息 - * - * @param equRouting 路由信息 - * @return 结果 - */ - public int updateEquRouting(EquRouting equRouting); - - /** - * 批量删除路由信息 - * - * @param ids 需要删除的路由信息主键集合 - * @return 结果 - */ - public int deleteEquRoutingByIds(String[] ids); - - /** - * 删除路由信息信息 - * - * @param id 路由信息主键 - * @return 结果 - */ - public int deleteEquRoutingById(String id); -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquVeneerService.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquVeneerService.java deleted file mode 100644 index da61c79b..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquVeneerService.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.alops.system.service; - -import com.alops.system.domain.EquVeneer; - -import java.util.List; - -/** - * 【请填写功能名称】Service接口 - * - * @author ruoyi - * @date 2025-08-15 - */ -public interface IEquVeneerService -{ - /** - * 查询【请填写功能名称】 - * - * @param id 【请填写功能名称】主键 - * @return 【请填写功能名称】 - */ - public EquVeneer selectEquVeneerById(String id); - - /** - * 查询【请填写功能名称】列表 - * - * @param equVeneer 【请填写功能名称】 - * @return 【请填写功能名称】集合 - */ - public List selectEquVeneerList(EquVeneer equVeneer); - - /** - * 新增【请填写功能名称】 - * - * @param equVeneer 【请填写功能名称】 - * @return 结果 - */ - public int insertEquVeneer(EquVeneer equVeneer); - - /** - * 修改【请填写功能名称】 - * - * @param equVeneer 【请填写功能名称】 - * @return 结果 - */ - public int updateEquVeneer(EquVeneer equVeneer); - - /** - * 批量删除【请填写功能名称】 - * - * @param ids 需要删除的【请填写功能名称】主键集合 - * @return 结果 - */ - public int deleteEquVeneerByIds(String[] ids); - - /** - * 删除【请填写功能名称】信息 - * - * @param id 【请填写功能名称】主键 - * @return 结果 - */ - public int deleteEquVeneerById(String id); -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquVlanService.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquVlanService.java deleted file mode 100644 index 0a951d96..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquVlanService.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.alops.system.service; - -import com.alops.system.domain.EquVlan; - -import java.util.List; - -/** - * 【请填写功能名称】Service接口 - * - * @author ruoyi - * @date 2025-08-15 - */ -public interface IEquVlanService -{ - /** - * 查询【请填写功能名称】 - * - * @param id 【请填写功能名称】主键 - * @return 【请填写功能名称】 - */ - public EquVlan selectEquVlanById(String id); - - /** - * 查询【请填写功能名称】列表 - * - * @param equVlan 【请填写功能名称】 - * @return 【请填写功能名称】集合 - */ - public List selectEquVlanList(EquVlan equVlan); - - /** - * 新增【请填写功能名称】 - * - * @param equVlan 【请填写功能名称】 - * @return 结果 - */ - public int insertEquVlan(EquVlan equVlan); - - /** - * 修改【请填写功能名称】 - * - * @param equVlan 【请填写功能名称】 - * @return 结果 - */ - public int updateEquVlan(EquVlan equVlan); - - /** - * 批量删除【请填写功能名称】 - * - * @param ids 需要删除的【请填写功能名称】主键集合 - * @return 结果 - */ - public int deleteEquVlanByIds(String[] ids); - - /** - * 删除【请填写功能名称】信息 - * - * @param id 【请填写功能名称】主键 - * @return 结果 - */ - public int deleteEquVlanById(String id); -} 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/IFauStaService.java similarity index 55% rename from ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertMessageService.java rename to ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IFauStaService.java index adb89217..7a167f0f 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/IFauStaService.java @@ -1,6 +1,6 @@ package com.alops.system.service; -import com.alops.system.domain.AlertMessage; +import com.alops.system.domain.FauSta; import java.util.List; @@ -8,9 +8,9 @@ import java.util.List; * 故障统计Service接口 * * @author ruoyi - * @date 2025-09-04 + * @date 2025-08-01 */ -public interface IAlertMessageService +public interface IFauStaService { /** * 查询故障统计 @@ -18,31 +18,31 @@ public interface IAlertMessageService * @param id 故障统计主键 * @return 故障统计 */ - public AlertMessage selectAlertMessageById(Long id); + public FauSta selectFauStaById(Long id); /** * 查询故障统计列表 * - * @param alertMessage 故障统计 + * @param fauSta 故障统计 * @return 故障统计集合 */ - public List selectAlertMessageList(AlertMessage alertMessage); + public List selectFauStaList(FauSta fauSta); /** * 新增故障统计 * - * @param alertMessage 故障统计 + * @param fauSta 故障统计 * @return 结果 */ - public int insertAlertMessage(AlertMessage alertMessage); + public int insertFauSta(FauSta fauSta); /** * 修改故障统计 * - * @param alertMessage 故障统计 + * @param fauSta 故障统计 * @return 结果 */ - public int updateAlertMessage(AlertMessage alertMessage); + public int updateFauSta(FauSta fauSta); /** * 批量删除故障统计 @@ -50,7 +50,7 @@ public interface IAlertMessageService * @param ids 需要删除的故障统计主键集合 * @return 结果 */ - public int deleteAlertMessageByIds(Long[] ids); + public int deleteFauStaByIds(Long[] ids); /** * 删除故障统计信息 @@ -58,5 +58,5 @@ public interface IAlertMessageService * @param id 故障统计主键 * @return 结果 */ - public int deleteAlertMessageById(Long id); + public int deleteFauStaById(Long id); } diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IScheduleRulesService.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IScheduleRulesService.java index 6e59a034..2a9e7a3b 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IScheduleRulesService.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IScheduleRulesService.java @@ -1,11 +1,8 @@ package com.alops.system.service; -import com.alops.common.core.domain.AjaxResult; import com.alops.system.domain.ScheduleRules; -import org.springframework.stereotype.Service; import java.util.List; -import java.util.concurrent.ExecutionException; /** @@ -14,13 +11,8 @@ import java.util.concurrent.ExecutionException; * @author ruoyi * @date 2025-08-03 */ - public interface IScheduleRulesService { - - - public int executeImmediately() throws ExecutionException, InterruptedException; - /** * 查询定时采集规则 * diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/MemoryToolService.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/MemoryToolService.java deleted file mode 100644 index 8c589e9e..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/MemoryToolService.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.alops.system.service; - -import com.alops.system.domain.EquBase; -import com.alops.system.domain.EquOid; -import com.alops.system.domain.vo.EquGatherInsertInfo; -import com.alops.system.domain.vo.GatherEntities; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Map; - -@Service -public interface MemoryToolService { - public GatherEntities buildAndInsertEntity( - EquBase device, - Map snmpResults); - public int persistAll(List allEntities); -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/SnmpService.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/SnmpService.java deleted file mode 100644 index 6d9c0c21..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/SnmpService.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.alops.system.service; - -import com.alops.system.domain.EquOid; -import org.springframework.stereotype.Service; - -import java.util.List; -import java.util.Map; -@Service -public interface SnmpService { - public Map query(String ip, List oids); -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlarmRuleServiceImpl.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlarmRuleServiceImpl.java new file mode 100644 index 00000000..1b58d14f --- /dev/null +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlarmRuleServiceImpl.java @@ -0,0 +1,98 @@ +package com.alops.system.service.impl; + +import java.util.List; + +import com.alops.common.utils.DateUtils; +import com.alops.system.domain.AlarmRule; +import com.alops.system.mapper.AlarmRuleMapper; +import com.alops.system.service.IAlarmRuleService; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + + +/** + * 预警规则Service业务层处理 + * + * @author ruoyi + * @date 2025-08-01 + */ +@Service +public class AlarmRuleServiceImpl implements IAlarmRuleService +{ + @Autowired + private AlarmRuleMapper alarmRuleMapper; + + /** + * 查询预警规则 + * + * @param id 预警规则主键 + * @return 预警规则 + */ + @Override + public AlarmRule selectAlarmRuleById(Long id) + { + return alarmRuleMapper.selectAlarmRuleById(id); + } + + /** + * 查询预警规则列表 + * + * @param alarmRule 预警规则 + * @return 预警规则 + */ + @Override + public List selectAlarmRuleList(AlarmRule alarmRule) + { + return alarmRuleMapper.selectAlarmRuleList(alarmRule); + } + + /** + * 新增预警规则 + * + * @param alarmRule 预警规则 + * @return 结果 + */ + @Override + public int insertAlarmRule(AlarmRule alarmRule) + { + alarmRule.setCreateTime(DateUtils.getNowDate()); + return alarmRuleMapper.insertAlarmRule(alarmRule); + } + + /** + * 修改预警规则 + * + * @param alarmRule 预警规则 + * @return 结果 + */ + @Override + public int updateAlarmRule(AlarmRule alarmRule) + { + return alarmRuleMapper.updateAlarmRule(alarmRule); + } + + /** + * 批量删除预警规则 + * + * @param ids 需要删除的预警规则主键 + * @return 结果 + */ + @Override + public int deleteAlarmRuleByIds(Long[] ids) + { + return alarmRuleMapper.deleteAlarmRuleByIds(ids); + } + + /** + * 删除预警规则信息 + * + * @param id 预警规则主键 + * @return 结果 + */ + @Override + public int deleteAlarmRuleById(Long id) + { + return alarmRuleMapper.deleteAlarmRuleById(id); + } +} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertLaunchServiceImpl.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertLaunchServiceImpl.java deleted file mode 100644 index 6e424a80..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertLaunchServiceImpl.java +++ /dev/null @@ -1,155 +0,0 @@ -package com.alops.system.service.impl; - -import com.alops.system.domain.AlertMessage; -import com.alops.system.domain.AlertRule; -import com.alops.system.domain.AlertRuleCondition; -import com.alops.system.mapper.AlertMessageMapper; -import com.alops.system.mapper.AlertRuleConditionMapper; -import com.alops.system.mapper.AlertRuleMapper; -import com.alops.system.service.IAlertLaunchService; -import com.alops.system.service.IAlertSenderService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.jdbc.core.JdbcTemplate; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.*; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; - -@Service -public class AlertLaunchServiceImpl implements IAlertLaunchService { - - @Autowired - private AlertRuleMapper alertRuleMapper; - @Autowired - private AlertRuleConditionMapper alertRuleConditionMapper; - @Autowired - private AlertMessageMapper alertMessageMapper; - @Autowired - private JdbcTemplate jdbcTemplate; - @Autowired - private IAlertSenderService alertSender; // 发送通知 - - private final ExecutorService executor = Executors.newFixedThreadPool(5); - - /** - * 执行立即预警 - */ - @Override - public void executeImmediateAlerts(List ruleIds) { - List rules = alertRuleMapper.selectByIds(ruleIds); - - //每个规则开一个线程 - - for (AlertRule rule : rules) { - executor.submit(() -> processRule(rule)); - } - } - /** - * 同步插入消息 - */ - @Transactional - public void sendInternalMessages(List messages) { - if (messages == null || messages.isEmpty()) { - return; - } - int rows = alertMessageMapper.batchInsert(messages); - if (rows != messages.size()) { - throw new RuntimeException("部分消息未插入成功"); - } - } - - - /** - * 处理单条预警规则 - */ - private void processRule(AlertRule rule) { - try { - //1.一次预警规则的所有预警信息实体存一块 - List messages = new ArrayList<>(); - List msgs=new ArrayList<>(); - //2.判断是否特殊符号 - boolean isChangedRule = "CHANGED".equalsIgnoreCase(rule.getAlertSql()); - //3.一个预警规则查询的所有行数据 - List> queryResults; - if (isChangedRule) { - queryResults = handleChangedRule(rule); - } else { - queryResults = jdbcTemplate.queryForList(rule.getAlertSql()); - } - //构建预警信息实体和预警信息内容 - for (Map row : queryResults) { - AlertMessage msg = new AlertMessage(); - String msgdes=null; - msg.setLevel(rule.getSeverity()); - msg.setType(rule.getType()); - msg.setOccurTime(new Date()); - msg.setStatus("open"); - msg.setEquId(row.get("equ_id") != null ? row.get("equ_id").toString() : null); - msg.setEquType(row.get("equ_type") != null ? row.get("equ_type").toString() : null); - msgdes=fillTemplate(rule.getAlertTemplate(), row, rule); - msg.setDescription(msgdes); - messages.add(msg); - msgs.add(msgdes); - } - - if (!messages.isEmpty()) { - alertSender.sendAlert(msgs,rule.getAlertWay(), rule.getAlertStation()); - sendInternalMessages(messages); - } - - } catch (Exception e) { - e.printStackTrace(); - } - } - - private String fillTemplate(String template, Map row, AlertRule rule) { - String msg = template; - Map ruleMap = convertRuleToMap(rule); - //从预警规则中获取 预警规则名称,级别,方式,到站方 预警规则内容描述,预警规则创新时间,表格名称 - for (Map.Entry entry : ruleMap.entrySet()) { - msg = msg.replace("{" + entry.getKey() + "}", entry.getValue() != null ? entry.getValue().toString() : ""); - } - //设备id,设备类型,你要查参数 ,针对表格内容具体id, - for (Map.Entry entry : row.entrySet()) { - msg = msg.replace("{" + entry.getKey() + "}", entry.getValue() != null ? entry.getValue().toString() : ""); - } - return msg; - } - - private Map convertRuleToMap(AlertRule rule) { - Map map = new HashMap<>(); - map.put("rule_name", rule.getRuleName()); - map.put("alert_way", rule.getAlertWay()); - map.put("alert_station", rule.getAlertStation()); - map.put("severity", rule.getSeverity()); - map.put("description", rule.getDescription()); - map.put("create_time", rule.getCreateTime()); - map.put("table_name", rule.getTableName()); - return map; - } - - private List> handleChangedRule(AlertRule rule) { - List conditions = alertRuleConditionMapper.findByRuleId(rule.getId()); - if (conditions.isEmpty() || conditions.get(0).getParamName() == null) { - return new ArrayList<>(); - } - - String col = conditions.get(0).getParamName(); - - String sql = "SELECT g1.* FROM equ_gather g1 " + - "JOIN equ_gather g2 ON g1.equ_id = g2.equ_id " + - "AND g1.gather_time > g2.gather_time " + - "AND NOT EXISTS (" + - " SELECT 1 FROM equ_gather g3 " + - " WHERE g3.equ_id = g1.equ_id " + - " AND g3.gather_time > g2.gather_time " + - " AND g3.gather_time < g1.gather_time" + - ") " + - "WHERE (g1.`" + col + "` <> g2.`" + col + "`)"; - - return jdbcTemplate.queryForList(sql); - } - -} 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 deleted file mode 100644 index 978180c0..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertMessageServiceImpl.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.alops.system.service.impl; - -import java.util.List; - -import com.alops.system.domain.AlertMessage; -import com.alops.system.mapper.AlertMessageMapper; -import com.alops.system.service.IAlertMessageService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * 故障统计Service业务层处理 - * - * @author ruoyi - * @date 2025-09-04 - */ -@Service -public class AlertMessageServiceImpl implements IAlertMessageService -{ - @Autowired - private AlertMessageMapper alertMessageMapper; - - /** - * 查询故障统计 - * - * @param id 故障统计主键 - * @return 故障统计 - */ - @Override - public AlertMessage selectAlertMessageById(Long id) - { - return alertMessageMapper.selectAlertMessageById(id); - } - - /** - * 查询故障统计列表 - * - * @param alertMessage 故障统计 - * @return 故障统计 - */ - @Override - public List selectAlertMessageList(AlertMessage alertMessage) - { - return alertMessageMapper.selectAlertMessageList(alertMessage); - } - - /** - * 新增故障统计 - * - * @param alertMessage 故障统计 - * @return 结果 - */ - @Override - public int insertAlertMessage(AlertMessage alertMessage) - { - return alertMessageMapper.insertAlertMessage(alertMessage); - } - - /** - * 修改故障统计 - * - * @param alertMessage 故障统计 - * @return 结果 - */ - @Override - public int updateAlertMessage(AlertMessage alertMessage) - { - return alertMessageMapper.updateAlertMessage(alertMessage); - } - - /** - * 批量删除故障统计 - * - * @param ids 需要删除的故障统计主键 - * @return 结果 - */ - @Override - public int deleteAlertMessageByIds(Long[] ids) - { - return alertMessageMapper.deleteAlertMessageByIds(ids); - } - - /** - * 删除故障统计信息 - * - * @param id 故障统计主键 - * @return 结果 - */ - @Override - public int deleteAlertMessageById(Long id) - { - return alertMessageMapper.deleteAlertMessageById(id); - } -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertRuleConditionServiceImpl.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertRuleConditionServiceImpl.java deleted file mode 100644 index 1b36addb..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertRuleConditionServiceImpl.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.alops.system.service.impl; - -import java.util.List; - -import com.alops.system.domain.AlertRuleCondition; -import com.alops.system.mapper.AlertRuleConditionMapper; -import com.alops.system.service.IAlertRuleConditionService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * 【请填写功能名称】Service业务层处理 - * - * @author ruoyi - * @date 2025-09-04 - */ -@Service -public class AlertRuleConditionServiceImpl implements IAlertRuleConditionService -{ - @Autowired - private AlertRuleConditionMapper alertRuleConditionMapper; - - /** - * 查询【请填写功能名称】 - * - * @param id 【请填写功能名称】主键 - * @return 【请填写功能名称】 - */ - @Override - public AlertRuleCondition selectAlertRuleConditionById(Long id) - { - return alertRuleConditionMapper.selectAlertRuleConditionById(id); - } - - /** - * 查询【请填写功能名称】列表 - * - * @param alertRuleCondition 【请填写功能名称】 - * @return 【请填写功能名称】 - */ - @Override - public List selectAlertRuleConditionList(AlertRuleCondition alertRuleCondition) - { - return alertRuleConditionMapper.selectAlertRuleConditionList(alertRuleCondition); - } - - /** - * 新增【请填写功能名称】 - * - * @param alertRuleCondition 【请填写功能名称】 - * @return 结果 - */ - @Override - public int insertAlertRuleCondition(AlertRuleCondition alertRuleCondition) - { - return alertRuleConditionMapper.insertAlertRuleCondition(alertRuleCondition); - } - - /** - * 修改【请填写功能名称】 - * - * @param alertRuleCondition 【请填写功能名称】 - * @return 结果 - */ - @Override - public int updateAlertRuleCondition(AlertRuleCondition alertRuleCondition) - { - return alertRuleConditionMapper.updateAlertRuleCondition(alertRuleCondition); - } - - /** - * 批量删除【请填写功能名称】 - * - * @param ids 需要删除的【请填写功能名称】主键 - * @return 结果 - */ - @Override - public int deleteAlertRuleConditionByIds(Long[] ids) - { - return alertRuleConditionMapper.deleteAlertRuleConditionByIds(ids); - } - - /** - * 删除【请填写功能名称】信息 - * - * @param id 【请填写功能名称】主键 - * @return 结果 - */ - @Override - public int deleteAlertRuleConditionById(Long id) - { - return alertRuleConditionMapper.deleteAlertRuleConditionById(id); - } -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertRuleServiceImpl.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertRuleServiceImpl.java deleted file mode 100644 index da2c04d0..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertRuleServiceImpl.java +++ /dev/null @@ -1,312 +0,0 @@ -package com.alops.system.service.impl; - -import java.util.Arrays; -import java.util.Comparator; -import java.util.List; -import java.util.stream.Collectors; - -import com.alops.common.utils.DateUtils; -import com.alops.system.domain.AlertRule; -import com.alops.system.domain.AlertRuleCondition; -import com.alops.system.domain.dto.AlertRuleAddDto; -import com.alops.system.mapper.AlertRuleConditionMapper; -import com.alops.system.mapper.AlertRuleMapper; -import com.alops.system.service.IAlertRuleService; - -import org.apache.commons.lang3.StringEscapeUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * 【请填写功能名称】Service业务层处理 - * - * @author ruoyi - * @date 2025-09-04 - */ -@Service -public class AlertRuleServiceImpl implements IAlertRuleService -{ - @Autowired - private AlertRuleMapper alertRuleMapper; - @Autowired - private AlertRuleConditionMapper alertRuleConditionMapper; - - //生成预警规则 - /** - * 保存预警规则及条件,同时生成 SQL - */ - @Override - public AlertRule saveRule(AlertRuleAddDto dto) { - AlertRule rule = dto.getAlertRule(); - List conditions = dto.getAlertRuleConditionList(); - System.out.println(conditions); - // 生成 SQL,先判断是否是 CHANGED - String sql; - if (conditions != null - && conditions.size() == 1 - && "CHANGED".equalsIgnoreCase(conditions.get(0).getOperator())) { - sql = "CHANGED"; - } else { - sql = buildSql(rule, conditions); - } - rule.setAlertSql(sql); - - // 插入规则 - alertRuleMapper.insertAlertRule(rule); - - // 插入条件 - if (conditions != null) { - for (AlertRuleCondition c : conditions) { - c.setAlertRuleId(rule.getId()); - alertRuleConditionMapper.insertAlertRuleCondition(c); - } - } - - return rule; - } - - /** - * 根据规则和条件生成 SQL - */ - - public String buildSql(AlertRule rule, List conditions) { - if (conditions == null || conditions.isEmpty()) return ""; - System.out.println(conditions); - conditions.sort(Comparator.comparing(AlertRuleCondition::getOrderNo)); - - StringBuilder sql = new StringBuilder("SELECT "); - - if ("equ_gather".equalsIgnoreCase(rule.getTableName())) { - // equ_gather 表直接拼接条件 - sql.append("g.*, b.equ_type FROM equ_gather g ") - .append("JOIN equ_base b ON g.equ_id = b.id ") - .append("WHERE "); - sql.append(buildConditionsSql(conditions)); - } else { - // 其他表关联 equ_gather 和 equ_base - sql.append("t.*, g.equ_id, b.equ_type FROM ") - .append(rule.getTableName()).append(" t ") - .append("JOIN equ_gather g ON t.equ_gather_id = g.id ") - .append("JOIN equ_base b ON g.equ_id = b.id ") - .append("WHERE "); - sql.append(buildConditionsSql(conditions)); - } - - return sql.toString(); - } - - - /** - * 拼接条件 SQL - */ - private String buildConditionsSql(List conditions) { - StringBuilder sb = new StringBuilder(); - for (int i = 0; i < conditions.size(); i++) { - AlertRuleCondition c = conditions.get(i); - System.out.println("第"+i+"个"+c); - // 跳过 CHANGED,因为已经单独处理 - if ("CHANGED".equalsIgnoreCase(c.getOperator())) { - continue; - } - - sb.append(buildConditionSql(c)); - - if (i < conditions.size() - 1) { - String logicOp = c.getLogicOperator(); - if (logicOp == null || logicOp.trim().isEmpty()) { - logicOp = "and"; // 默认逻辑运算符,可改成 "or" - } - sb.append(" ").append(logicOp).append(" "); - } - } - - return sb.toString(); - } - - /** - * 单个条件生成 SQL 片段 - */ - private String buildConditionSql(AlertRuleCondition c) { - String column = c.getParamName(); - String op = normalizeOperator(c.getOperator()); - String value = c.getCompareValue(); - String valueType = c.getValueType(); // 新增字段 - - switch (op) { - case "=": case "!=": case "<": case "<=": case ">": case ">=": - return column + " " + op + " " + formatValue(value, valueType); - - case "contains": - return column + " LIKE '%" + escapeLike(value) + "%'"; - case "not contains": - return column + " NOT LIKE '%" + escapeLike(value) + "%'"; - case "starts with": - return column + " LIKE '" + escapeLike(value) + "%'"; - case "not starts with": - return column + " NOT LIKE '" + escapeLike(value) + "%'"; - case "ends with": - return column + " LIKE '%" + escapeLike(value) + "'"; - case "not ends with": - return column + " NOT LIKE '%" + escapeLike(value) + "'"; - - case "is null": - return column + " IS NULL"; - case "is not null": - return column + " IS NOT NULL"; - case "is empty": - return "(" + column + " = '' OR " + column + " IS NULL)"; - case "is not empty": - return "(" + column + " <> '' AND " + column + " IS NOT NULL)"; - - case "between": - case "not between": - String[] vals = value.split(","); - if (vals.length != 2) { - throw new IllegalArgumentException(op + " 运算符需要两个值: " + value); - } - String range = formatValue(vals[0].trim(), valueType) + " AND " + formatValue(vals[1].trim(), valueType); - return column + (op.equals("between") ? " BETWEEN " : " NOT BETWEEN ") + range; - - case "in": - case "not in": - return column + (op.equals("in") ? " IN " : " NOT IN ") + "(" + wrapInList(value, valueType) + ")"; - - default: - throw new UnsupportedOperationException("未知运算符: " + op); - } - } - - /** - * 格式化单个值,根据类型决定是否加引号 - */ - private String formatValue(String raw, String valueType) { - if (raw == null) return "NULL"; - raw = raw.trim(); - - if ("number".equalsIgnoreCase(valueType)) { - return raw; - } else if ("date".equalsIgnoreCase(valueType)) { - return "'" + raw + "'"; // 也可以这里加 TO_DATE 之类 - } else { - return "'" + raw.replace("'", "''") + "'"; // 默认当字符串 - } - } - - /** - * IN 列表格式化 - */ - private String wrapInList(String value, String valueType) { - return Arrays.stream(value.split(",")) - .map(String::trim) - .map(v -> formatValue(v, valueType)) - .collect(Collectors.joining(",")); - } - - /** - * 统一处理 HTML 转义后的运算符 - */ - private String normalizeOperator(String op) { - System.out.println("原始 operator: '" + op + "'"); - if (op == null || op.trim().isEmpty()) { - throw new IllegalArgumentException("条件运算符不能为空"); - } - - op = op.replace("<", "<") - .replace(">", ">") - .replace("&", "&") - .replace(""", "\"") - .replace("'", "'") - .replace("=", "=") - .replace("!=", "!=") - .trim() - // 去掉多余空格 - .replaceAll("\\s+", ""); - - return op.toLowerCase(); - } - - - /** - * LIKE 值转义(避免 % 或 _ 误伤) - */ - private String escapeLike(String value) { - return value.replace("'", "''"); // 仅处理 SQL 注入风险 - } - - - - - /** - * 查询【请填写功能名称】 - * - * @param id 【请填写功能名称】主键 - * @return 【请填写功能名称】 - */ - @Override - public AlertRule selectAlertRuleById(Long id) - { - return alertRuleMapper.selectAlertRuleById(id); - } - - /** - * 查询【请填写功能名称】列表 - * - * @param alertRule 【请填写功能名称】 - * @return 【请填写功能名称】 - */ - @Override - public List selectAlertRuleList(AlertRule alertRule) - { - return alertRuleMapper.selectAlertRuleList(alertRule); - } - - /** - * 新增【请填写功能名称】 - * - * @param alertRule 【请填写功能名称】 - * @return 结果 - */ - @Override - public int insertAlertRule(AlertRule alertRule) - { - alertRule.setCreateTime(DateUtils.getNowDate()); - return alertRuleMapper.insertAlertRule(alertRule); - } - - /** - * 修改【请填写功能名称】 - * - * @param alertRule 【请填写功能名称】 - * @return 结果 - */ - @Override - public int updateAlertRule(AlertRule alertRule) - { - alertRule.setUpdateTime(DateUtils.getNowDate()); - return alertRuleMapper.updateAlertRule(alertRule); - } - - /** - * 批量删除【请填写功能名称】 - * - * @param ids 需要删除的【请填写功能名称】主键 - * @return 结果 - */ - @Override - public int deleteAlertRuleByIds(Long[] ids) - { - return alertRuleMapper.deleteAlertRuleByIds(ids); - } - - /** - * 删除【请填写功能名称】信息 - * - * @param id 【请填写功能名称】主键 - * @return 结果 - */ - @Override - public int deleteAlertRuleById(Long id) - { - return alertRuleMapper.deleteAlertRuleById(id); - } -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertSenderServiceImpl.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertSenderServiceImpl.java deleted file mode 100644 index 5b04996e..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertSenderServiceImpl.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.alops.system.service.impl; - -import com.alops.common.core.domain.entity.SysUser; -import com.alops.system.domain.AlertMessage; -import com.alops.system.domain.InternalMessage; -import com.alops.system.mapper.InternalMessageMapper; -import com.alops.system.mapper.SysUserMapper; - -import com.alops.system.service.IAlertSenderService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.mail.SimpleMailMessage; -import org.springframework.mail.javamail.JavaMailSender; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -@Service -public class AlertSenderServiceImpl implements IAlertSenderService { - - @Autowired - private JavaMailSender mailSender; // Spring Boot 邮件服务 - - @Autowired - private SysUserMapper userMapper; // 用户 Mapper - - @Autowired - private InternalMessageMapper messageMapper; // 站内信 Mapper - - @Value("${spring.mail.username}") - private String from; - /** - * 发送预警消息 - * - * @param alertWay "email" 或 "message" - * @param target 预警目标(邮箱或角色ID) - */ - @Override - public void sendAlert(List alertMessages, String alertWay, String target) { - if (alertMessages == null || alertMessages.isEmpty()) return; - - // 将多条消息合并成一条 - String combinedMessage = String.join("\n", alertMessages); - System.out.println(alertWay); - if ("email".equalsIgnoreCase(alertWay)) { - sendEmail(combinedMessage, target); - } else if ("message".equalsIgnoreCase(alertWay)) { - sendInternalMessage(combinedMessage, target); - } else { - throw new IllegalArgumentException("未知预警方式:" + alertWay); - } - } - - /** - * 邮件发送 - */ - private void sendEmail(String content, String emails) { - String[] emailArr = emails.split(","); - for (String email : emailArr) { - try { - SimpleMailMessage message = new SimpleMailMessage(); - message.setFrom(from); // 发件人(必须是 spring.mail.username) - message.setTo(email.trim()); // 收件人(必须写完整的 qq 邮箱,如 123456@qq.com) - message.setSubject("预警通知"); // 邮件标题 - message.setText(content); // 邮件正文 - mailSender.send(message); - } catch (Exception e) { - e.printStackTrace(); - } - } - } - - /** - * 站内信发送 - */ - private void sendInternalMessage(String content, String roleIdStr) { - long roleId = Long.parseLong(roleIdStr); - List users = userMapper.selectByRoleId(roleId); - if (users == null || users.isEmpty()) return; - - List messages = new ArrayList<>(); - for (SysUser user : users) { - InternalMessage msg = new InternalMessage(); - msg.setUserId(user.getUserId()); - msg.setContent(content); // 一次插入整条合并后的消息 - msg.setCreateTime(new Date()); - msg.setStatus("unread"); - messages.add(msg); - } - - if (!messages.isEmpty()) { - insertMessages(messages); - } - } - - @Transactional(rollbackFor = Exception.class) - public void insertMessages(List messages) { - if (messages == null || messages.isEmpty()) { - return; - } - int rows = messageMapper.batchInsert(messages); // 返回插入行数 - if (rows != messages.size()) { - throw new RuntimeException("部分消息未插入成功,事务回滚"); - } - } -} - diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/ConvertRawValueServiceImpl.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/ConvertRawValueServiceImpl.java deleted file mode 100644 index b30b5e79..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/ConvertRawValueServiceImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.alops.system.service.impl; - -import com.alops.system.domain.EquOid; -import com.alops.system.service.ConvertRawValueService; -import org.springframework.stereotype.Service; - -import java.util.Map; -@Service -public class ConvertRawValueServiceImpl implements ConvertRawValueService { - - - @Override - public String convertValue(String rule, String val) { - if (rule == null) return val; // 没规则就原样返回 - - switch (rule) { - case "veneer_status": - // Fan board → Fault,其它 → Online - if ("Fan board".equalsIgnoreCase(val)) { - return "Fault"; - } else { - return "Online"; - } - - case "fan_speed_status": - // 1 → Normal, 0 → Abnormal - if ("1".equals(val)) { - return "Normal"; - } else if ("0".equals(val)) { - return "Abnormal"; - } - break; - - case "vol_in_status": - case "vol_out_status": - // 1 → Normal, 0 → UnderVoltage - if ("1".equals(val)) { - return "Normal"; - } else if ("0".equals(val)) { - return "UnderVoltage"; - } - break; - - case "running": - // 1 → true, 2 → false - if ("1".equals(val)) { - return "true"; - } else if ("2".equals(val)) { - return "false"; - } - break; - - case "commuicate_mode": - // 1 → Full, 2 → Half - if ("1".equals(val)) { - return "Full"; - } else if ("2".equals(val)) { - return "Half"; - } - break; - - default: - return val; // 默认返回原值 - } - - return val; - } -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/DictAlarmParamServiceImpl.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/DictAlarmParamServiceImpl.java deleted file mode 100644 index d169c444..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/DictAlarmParamServiceImpl.java +++ /dev/null @@ -1,99 +0,0 @@ -package com.alops.system.service.impl; - -import java.util.List; - -import com.alops.system.domain.DictAlarmParam; -import com.alops.system.mapper.DictAlarmParamMapper; -import com.alops.system.service.IDictAlarmParamService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * 【请填写功能名称】Service业务层处理 - * - * @author ruoyi - * @date 2025-09-05 - */ -@Service -public class DictAlarmParamServiceImpl implements IDictAlarmParamService -{ - - @Override - public List getParamsByTableName(String tableName) { - return dictAlarmParamMapper.selectByTableName(tableName); - } - @Autowired - private DictAlarmParamMapper dictAlarmParamMapper; - - /** - * 查询【请填写功能名称】 - * - * @param id 【请填写功能名称】主键 - * @return 【请填写功能名称】 - */ - @Override - public DictAlarmParam selectDictAlarmParamById(Long id) - { - return dictAlarmParamMapper.selectDictAlarmParamById(id); - } - - /** - * 查询【请填写功能名称】列表 - * - * @param dictAlarmParam 【请填写功能名称】 - * @return 【请填写功能名称】 - */ - @Override - public List selectDictAlarmParamList(DictAlarmParam dictAlarmParam) - { - return dictAlarmParamMapper.selectDictAlarmParamList(dictAlarmParam); - } - - /** - * 新增【请填写功能名称】 - * - * @param dictAlarmParam 【请填写功能名称】 - * @return 结果 - */ - @Override - public int insertDictAlarmParam(DictAlarmParam dictAlarmParam) - { - return dictAlarmParamMapper.insertDictAlarmParam(dictAlarmParam); - } - - /** - * 修改【请填写功能名称】 - * - * @param dictAlarmParam 【请填写功能名称】 - * @return 结果 - */ - @Override - public int updateDictAlarmParam(DictAlarmParam dictAlarmParam) - { - return dictAlarmParamMapper.updateDictAlarmParam(dictAlarmParam); - } - - /** - * 批量删除【请填写功能名称】 - * - * @param ids 需要删除的【请填写功能名称】主键 - * @return 结果 - */ - @Override - public int deleteDictAlarmParamByIds(Long[] ids) - { - return dictAlarmParamMapper.deleteDictAlarmParamByIds(ids); - } - - /** - * 删除【请填写功能名称】信息 - * - * @param id 【请填写功能名称】主键 - * @return 结果 - */ - @Override - public int deleteDictAlarmParamById(Long id) - { - return dictAlarmParamMapper.deleteDictAlarmParamById(id); - } -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquBaseServiceImpl.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquBaseServiceImpl.java index d2d40da9..580671e1 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquBaseServiceImpl.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquBaseServiceImpl.java @@ -4,7 +4,6 @@ import java.util.List; import com.alops.system.domain.EquBase; import com.alops.system.domain.dto.EquBaseQueryDto; -import com.alops.system.domain.vo.queryEquBaseVO; import com.alops.system.mapper.EquBaseMapper; import com.alops.system.service.IEquBaseService; import org.springframework.beans.factory.annotation.Autowired; @@ -41,7 +40,7 @@ public class EquBaseServiceImpl implements IEquBaseService * @return 设备基本信息 */ @Override - public List selectEquBaseList(EquBaseQueryDto equBaseQueryDto) + public List selectEquBaseList(EquBaseQueryDto equBaseQueryDto) { return equBaseMapper.selectEquBaseList(equBaseQueryDto); } diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquGatherServiceImpl.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquGatherServiceImpl.java deleted file mode 100644 index bbd6c7f3..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquGatherServiceImpl.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.alops.system.service.impl; - -import java.util.List; - -import com.alops.system.domain.EquGather; -import com.alops.system.mapper.EquGatherMapper; -import com.alops.system.service.IEquGatherService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * 设备采集信息Service业务层处理 - * - * @author ruoyi - * @date 2025-08-15 - */ -@Service -public class EquGatherServiceImpl implements IEquGatherService -{ - @Autowired - private EquGatherMapper equGatherMapper; - - /** - * 查询设备采集信息 - * - * @param id 设备采集信息主键 - * @return 设备采集信息 - */ - @Override - public EquGather selectEquGatherById(String id) - { - return equGatherMapper.selectEquGatherById(id); - } - - /** - * 查询设备采集信息列表 - * - * @param equGather 设备采集信息 - * @return 设备采集信息 - */ - @Override - public List selectEquGatherList(EquGather equGather) - { - return equGatherMapper.selectEquGatherList(equGather); - } - - /** - * 新增设备采集信息 - * - * @param equGather 设备采集信息 - * @return 结果 - */ - @Override - public int insertEquGather(EquGather equGather) - { - return equGatherMapper.insertEquGather(equGather); - } - - /** - * 修改设备采集信息 - * - * @param equGather 设备采集信息 - * @return 结果 - */ - @Override - public int updateEquGather(EquGather equGather) - { - return equGatherMapper.updateEquGather(equGather); - } - - /** - * 批量删除设备采集信息 - * - * @param ids 需要删除的设备采集信息主键 - * @return 结果 - */ - @Override - public int deleteEquGatherByIds(String[] ids) - { - return equGatherMapper.deleteEquGatherByIds(ids); - } - - /** - * 删除设备采集信息信息 - * - * @param id 设备采集信息主键 - * @return 结果 - */ - @Override - public int deleteEquGatherById(String id) - { - return equGatherMapper.deleteEquGatherById(id); - } -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquInterfaceServiceImpl.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquInterfaceServiceImpl.java deleted file mode 100644 index e21cdc97..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquInterfaceServiceImpl.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.alops.system.service.impl; - -import java.util.List; - -import com.alops.system.domain.EquInterface; -import com.alops.system.mapper.EquInterfaceMapper; -import com.alops.system.service.IEquInterfaceService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * 端口运行状态Service业务层处理 - * - * @author ruoyi - * @date 2025-08-20 - */ -@Service -public class EquInterfaceServiceImpl implements IEquInterfaceService -{ - @Autowired - private EquInterfaceMapper equInterfaceMapper; - - /** - * 查询端口运行状态 - * - * @param id 端口运行状态主键 - * @return 端口运行状态 - */ - @Override - public EquInterface selectEquInterfaceById(String id) - { - return equInterfaceMapper.selectEquInterfaceById(id); - } - - /** - * 查询端口运行状态列表 - * - * @param equInterface 端口运行状态 - * @return 端口运行状态 - */ - @Override - public List selectEquInterfaceList(EquInterface equInterface) - { - return equInterfaceMapper.selectEquInterfaceList(equInterface); - } - - /** - * 新增端口运行状态 - * - * @param equInterface 端口运行状态 - * @return 结果 - */ - @Override - public int insertEquInterface(EquInterface equInterface) - { - return equInterfaceMapper.insertEquInterface(equInterface); - } - - /** - * 修改端口运行状态 - * - * @param equInterface 端口运行状态 - * @return 结果 - */ - @Override - public int updateEquInterface(EquInterface equInterface) - { - return equInterfaceMapper.updateEquInterface(equInterface); - } - - /** - * 批量删除端口运行状态 - * - * @param ids 需要删除的端口运行状态主键 - * @return 结果 - */ - @Override - public int deleteEquInterfaceByIds(String[] ids) - { - return equInterfaceMapper.deleteEquInterfaceByIds(ids); - } - - /** - * 删除端口运行状态信息 - * - * @param id 端口运行状态主键 - * @return 结果 - */ - @Override - public int deleteEquInterfaceById(String id) - { - return equInterfaceMapper.deleteEquInterfaceById(id); - } -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquOidServiceImpl.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquOidServiceImpl.java deleted file mode 100644 index 1c4cc332..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquOidServiceImpl.java +++ /dev/null @@ -1,98 +0,0 @@ -package com.alops.system.service.impl; - -import java.util.List; - -import com.alops.common.utils.DateUtils; -import com.alops.system.domain.EquOid; -import com.alops.system.mapper.EquOidMapper; - -import com.alops.system.service.IEquOidService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * OID配置信息Service业务层处理 - * - * @author ruoyi - * @date 2025-08-15 - */ -@Service -public class EquOidServiceImpl implements IEquOidService -{ - @Autowired - private EquOidMapper equOidMapper; - - /** - * 查询OID配置信息 - * - * @param id OID配置信息主键 - * @return OID配置信息 - */ - @Override - public EquOid selectEquOidById(Long id) - { - return equOidMapper.selectEquOidById(id); - } - - /** - * 查询OID配置信息列表 - * - * @param equOid OID配置信息 - * @return OID配置信息 - */ - @Override - public List selectEquOidList(EquOid equOid) - { - return equOidMapper.selectEquOidList(equOid); - } - - /** - * 新增OID配置信息 - * - * @param equOid OID配置信息 - * @return 结果 - */ - @Override - public int insertEquOid(EquOid equOid) - { - equOid.setCreateTime(DateUtils.getNowDate()); - return equOidMapper.insertEquOid(equOid); - } - - /** - * 修改OID配置信息 - * - * @param equOid OID配置信息 - * @return 结果 - */ - @Override - public int updateEquOid(EquOid equOid) - { - equOid.setUpdateTime(DateUtils.getNowDate()); - return equOidMapper.updateEquOid(equOid); - } - - /** - * 批量删除OID配置信息 - * - * @param ids 需要删除的OID配置信息主键 - * @return 结果 - */ - @Override - public int deleteEquOidByIds(Long[] ids) - { - return equOidMapper.deleteEquOidByIds(ids); - } - - /** - * 删除OID配置信息信息 - * - * @param id OID配置信息主键 - * @return 结果 - */ - @Override - public int deleteEquOidById(Long id) - { - return equOidMapper.deleteEquOidById(id); - } -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquRoutingServiceImpl.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquRoutingServiceImpl.java deleted file mode 100644 index c2448f93..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquRoutingServiceImpl.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.alops.system.service.impl; - -import java.util.List; - -import com.alops.system.domain.EquRouting; -import com.alops.system.mapper.EquRoutingMapper; -import com.alops.system.service.IEquRoutingService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * 路由信息Service业务层处理 - * - * @author ruoyi - * @date 2025-08-15 - */ -@Service -public class EquRoutingServiceImpl implements IEquRoutingService -{ - @Autowired - private EquRoutingMapper equRoutingMapper; - - /** - * 查询路由信息 - * - * @param id 路由信息主键 - * @return 路由信息 - */ - @Override - public EquRouting selectEquRoutingById(String id) - { - return equRoutingMapper.selectEquRoutingById(id); - } - - /** - * 查询路由信息列表 - * - * @param equRouting 路由信息 - * @return 路由信息 - */ - @Override - public List selectEquRoutingList(EquRouting equRouting) - { - return equRoutingMapper.selectEquRoutingList(equRouting); - } - - /** - * 新增路由信息 - * - * @param equRouting 路由信息 - * @return 结果 - */ - @Override - public int insertEquRouting(EquRouting equRouting) - { - return equRoutingMapper.insertEquRouting(equRouting); - } - - /** - * 修改路由信息 - * - * @param equRouting 路由信息 - * @return 结果 - */ - @Override - public int updateEquRouting(EquRouting equRouting) - { - return equRoutingMapper.updateEquRouting(equRouting); - } - - /** - * 批量删除路由信息 - * - * @param ids 需要删除的路由信息主键 - * @return 结果 - */ - @Override - public int deleteEquRoutingByIds(String[] ids) - { - return equRoutingMapper.deleteEquRoutingByIds(ids); - } - - /** - * 删除路由信息信息 - * - * @param id 路由信息主键 - * @return 结果 - */ - @Override - public int deleteEquRoutingById(String id) - { - return equRoutingMapper.deleteEquRoutingById(id); - } -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquVeneerServiceImpl.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquVeneerServiceImpl.java deleted file mode 100644 index 84802cce..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquVeneerServiceImpl.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.alops.system.service.impl; - -import java.util.List; - -import com.alops.system.domain.EquVeneer; -import com.alops.system.mapper.EquVeneerMapper; -import com.alops.system.service.IEquVeneerService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * 【请填写功能名称】Service业务层处理 - * - * @author ruoyi - * @date 2025-08-15 - */ -@Service -public class EquVeneerServiceImpl implements IEquVeneerService -{ - @Autowired - private EquVeneerMapper equVeneerMapper; - - /** - * 查询【请填写功能名称】 - * - * @param id 【请填写功能名称】主键 - * @return 【请填写功能名称】 - */ - @Override - public EquVeneer selectEquVeneerById(String id) - { - return equVeneerMapper.selectEquVeneerById(id); - } - - /** - * 查询【请填写功能名称】列表 - * - * @param equVeneer 【请填写功能名称】 - * @return 【请填写功能名称】 - */ - @Override - public List selectEquVeneerList(EquVeneer equVeneer) - { - return equVeneerMapper.selectEquVeneerList(equVeneer); - } - - /** - * 新增【请填写功能名称】 - * - * @param equVeneer 【请填写功能名称】 - * @return 结果 - */ - @Override - public int insertEquVeneer(EquVeneer equVeneer) - { - return equVeneerMapper.insertEquVeneer(equVeneer); - } - - /** - * 修改【请填写功能名称】 - * - * @param equVeneer 【请填写功能名称】 - * @return 结果 - */ - @Override - public int updateEquVeneer(EquVeneer equVeneer) - { - return equVeneerMapper.updateEquVeneer(equVeneer); - } - - /** - * 批量删除【请填写功能名称】 - * - * @param ids 需要删除的【请填写功能名称】主键 - * @return 结果 - */ - @Override - public int deleteEquVeneerByIds(String[] ids) - { - return equVeneerMapper.deleteEquVeneerByIds(ids); - } - - /** - * 删除【请填写功能名称】信息 - * - * @param id 【请填写功能名称】主键 - * @return 结果 - */ - @Override - public int deleteEquVeneerById(String id) - { - return equVeneerMapper.deleteEquVeneerById(id); - } -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquVlanServiceImpl.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquVlanServiceImpl.java deleted file mode 100644 index 0702af6e..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquVlanServiceImpl.java +++ /dev/null @@ -1,97 +0,0 @@ -package com.alops.system.service.impl; - -import java.util.List; - -import com.alops.common.utils.DateUtils; -import com.alops.system.domain.EquVlan; -import com.alops.system.mapper.EquVlanMapper; - -import com.alops.system.service.IEquVlanService; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -/** - * 【请填写功能名称】Service业务层处理 - * - * @author ruoyi - * @date 2025-08-15 - */ -@Service -public class EquVlanServiceImpl implements IEquVlanService -{ - @Autowired - private EquVlanMapper equVlanMapper; - - /** - * 查询【请填写功能名称】 - * - * @param id 【请填写功能名称】主键 - * @return 【请填写功能名称】 - */ - @Override - public EquVlan selectEquVlanById(String id) - { - return equVlanMapper.selectEquVlanById(id); - } - - /** - * 查询【请填写功能名称】列表 - * - * @param equVlan 【请填写功能名称】 - * @return 【请填写功能名称】 - */ - @Override - public List selectEquVlanList(EquVlan equVlan) - { - return equVlanMapper.selectEquVlanList(equVlan); - } - - /** - * 新增【请填写功能名称】 - * - * @param equVlan 【请填写功能名称】 - * @return 结果 - */ - @Override - public int insertEquVlan(EquVlan equVlan) - { - equVlan.setCreateTime(DateUtils.getNowDate()); - return equVlanMapper.insertEquVlan(equVlan); - } - - /** - * 修改【请填写功能名称】 - * - * @param equVlan 【请填写功能名称】 - * @return 结果 - */ - @Override - public int updateEquVlan(EquVlan equVlan) - { - return equVlanMapper.updateEquVlan(equVlan); - } - - /** - * 批量删除【请填写功能名称】 - * - * @param ids 需要删除的【请填写功能名称】主键 - * @return 结果 - */ - @Override - public int deleteEquVlanByIds(String[] ids) - { - return equVlanMapper.deleteEquVlanByIds(ids); - } - - /** - * 删除【请填写功能名称】信息 - * - * @param id 【请填写功能名称】主键 - * @return 结果 - */ - @Override - public int deleteEquVlanById(String id) - { - return equVlanMapper.deleteEquVlanById(id); - } -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/FauStaServiceImpl.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/FauStaServiceImpl.java new file mode 100644 index 00000000..a8ff0010 --- /dev/null +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/FauStaServiceImpl.java @@ -0,0 +1,94 @@ +package com.alops.system.service.impl; + +import java.util.List; + +import com.alops.system.domain.FauSta; +import com.alops.system.mapper.FauStaMapper; +import com.alops.system.service.IFauStaService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 故障统计Service业务层处理 + * + * @author ruoyi + * @date 2025-08-01 + */ +@Service +public class FauStaServiceImpl implements IFauStaService +{ + @Autowired + private FauStaMapper fauStaMapper; + + /** + * 查询故障统计 + * + * @param id 故障统计主键 + * @return 故障统计 + */ + @Override + public FauSta selectFauStaById(Long id) + { + return fauStaMapper.selectFauStaById(id); + } + + /** + * 查询故障统计列表 + * + * @param fauSta 故障统计 + * @return 故障统计 + */ + @Override + public List selectFauStaList(FauSta fauSta) + { + return fauStaMapper.selectFauStaList(fauSta); + } + + /** + * 新增故障统计 + * + * @param fauSta 故障统计 + * @return 结果 + */ + @Override + public int insertFauSta(FauSta fauSta) + { + return fauStaMapper.insertFauSta(fauSta); + } + + /** + * 修改故障统计 + * + * @param fauSta 故障统计 + * @return 结果 + */ + @Override + public int updateFauSta(FauSta fauSta) + { + return fauStaMapper.updateFauSta(fauSta); + } + + /** + * 批量删除故障统计 + * + * @param ids 需要删除的故障统计主键 + * @return 结果 + */ + @Override + public int deleteFauStaByIds(Long[] ids) + { + return fauStaMapper.deleteFauStaByIds(ids); + } + + /** + * 删除故障统计信息 + * + * @param id 故障统计主键 + * @return 结果 + */ + @Override + public int deleteFauStaById(Long id) + { + return fauStaMapper.deleteFauStaById(id); + } +} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/MemoryToolServiceImpl.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/MemoryToolServiceImpl.java deleted file mode 100644 index af9dc14c..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/MemoryToolServiceImpl.java +++ /dev/null @@ -1,297 +0,0 @@ -package com.alops.system.service.impl; - -import com.alops.system.domain.*; -import com.alops.system.domain.vo.Code; -import com.alops.system.domain.vo.EquGatherInsertInfo; -import com.alops.system.domain.vo.GatherEntities; -import com.alops.system.mapper.*; -import com.alops.system.service.ConvertRawValueService; -import com.alops.system.service.MemoryToolService; -import org.springframework.beans.factory.annotation.Autowired; - -import java.lang.reflect.Field; -import java.math.BigDecimal; -import java.sql.Timestamp; -import java.time.LocalDateTime; -import java.util.*; -import java.util.stream.Collectors; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.stereotype.Service; - -@Service -//建造实体类的工具 -public class MemoryToolServiceImpl implements MemoryToolService { - - - @Autowired - private EquGatherMapper equGatherMapper; - @Autowired - private EquInterfaceMapper equInterfaceMapper; - @Autowired - private EquRoutingMapper equRoutingMapper; - @Autowired - private EquVeneerMapper equVeneerMapper; - @Autowired - private EquVlanMapper equVlanMapper; - - private static final Logger log = LoggerFactory.getLogger(MemoryToolServiceImpl.class); - //生成实体类和存入数据库 - public GatherEntities buildAndInsertEntity( - EquBase device, - Map snmpResults) { - - // 1. 创建主表实体 - EquGather equGather = new EquGather(); - String gatherId = UUID.randomUUID().toString(); - equGather.setId(gatherId); - equGather.setEquId(device.getId()); - equGather.setGatherTime(new Date()); - - // 2. 临时存放单值字段 - Map equGatherFields = new HashMap<>(); - - // 3. 遍历 snmpResults - Map> listEntitiesMap = new HashMap<>(); // key: 表名, value: 实体列表 - for (Map.Entry entry : snmpResults.entrySet()) { - String param = entry.getKey(); - Object value = entry.getValue(); - - if (value instanceof List) { - - // 处理 List 类型,转换成实体对象,表名直接用 param - List> rows = (List>) value; - List entities = new ArrayList<>(); - - for (Map row : rows) { - // 生成实体 - Object entity = createEntityForTable(param, row); - - if (entity != null) { - // 生成主键 UUID 并填入实体 - String rowId = UUID.randomUUID().toString(); - fillField(entity, param, "id", rowId); - // 关联设备ID -// fillField(entity, param, "device_id", device.getId()); - // 如果需要关联主表 gatherId,也填进去 - fillField(entity, param, "equ_gather_id", gatherId); - - entities.add(entity); - - } - } - listEntitiesMap.put(param, entities); - // 直接批量插入数据库 -// insertEntityList(param, entities); - - } else { - - // 单值字段,直接存 equGather - equGatherFields.put(param, value != null ? value.toString() : null); - } - } - - // 4. 填充单值字段到主表实体 - equGatherFields.forEach((k, v) -> fillField(equGather, "equ_gather", k, v)); - - // 5. 插入主表 - // equGatherMapper.insertEquGather(equGather); - // 5. 封装返回 - GatherEntities result = new GatherEntities(); - result.setEquGather(equGather); - result.getSubEntities().putAll(listEntitiesMap); - - return result; - - } - /** - * 批量落库主表和子表 - * - * @param allEntities 待插入的实体列表 - * @return 状态码:Code.SUCCESS 成功,Code.FAIL 失败 - */ - public int persistAll(List allEntities) { - // 1. 空检查 - if (allEntities == null || allEntities.isEmpty()) { - log.warn("待插入实体为空"); - return Code.FAIL; - } - - try { - // ===== 2. 主表批量插入 ===== - List gatherList = allEntities.stream() - .map(GatherEntities::getEquGather) - .collect(Collectors.toList()); - - if (!gatherList.isEmpty()) { - // 如果 Mapper 批量方法返回 void,异常会在失败时抛出 - equGatherMapper.batchInsertEquGather(gatherList); - } - - // ===== 3. 子表按表名分组批量插入 ===== - Map> groupedSubEntities = new HashMap<>(); - for (GatherEntities g : allEntities) { - g.getSubEntities().forEach((table, list) -> - groupedSubEntities.computeIfAbsent(table, k -> new ArrayList<>()).addAll(list) - ); - } - - for (Map.Entry> entry : groupedSubEntities.entrySet()) { - String tableName = entry.getKey(); - List list = entry.getValue(); - if (!list.isEmpty()) { - // 子表插入,如果失败抛异常 - insertEntityList(tableName, list); - } - } - - // ===== 4. 全部成功 ===== - return Code.SUCCESS; - } catch (Exception e) { - log.error("批量落库失败", e); - return Code.FAIL; - } - } - - - - /** - * 根据表名和字段生成对应实体对象 - */ - private Object createEntityForTable(String tableName, Map rowData) { - switch (tableName) { - case "equ_interface": - EquInterface equInterface=new EquInterface(); - rowData.forEach((k, v) -> fillField(equInterface, tableName, k, v != null ? v.toString() : null)); - return equInterface; - case "equ_routing": - - EquRouting equRouting=new EquRouting(); - rowData.forEach((k, v) -> fillField(equRouting, tableName, k, v != null ? v.toString() : null)); - return equRouting; - case "equ_veneer": - - EquVeneer equVeneer=new EquVeneer(); - rowData.forEach((k, v) -> fillField(equVeneer, tableName, k, v != null ? v.toString() : null)); - return equVeneer; - case "equ_vlan": - - EquVlan equVlan=new EquVlan(); - rowData.forEach((k, v) -> fillField(equVlan, tableName, k, v != null ? v.toString() : null)); - return equVlan; - // 可以继续加其他表 - default: - return null; - } - } - - /** - * 批量插入数据库,按表名分发到对应 Mapper - */ - private void insertEntityList(String tableName, List entities) { - if (entities.isEmpty()) return; - - switch (tableName) { - case "equ_interface": - equInterfaceMapper.insertBatch((List)(List) entities); - break; - case "equ_routing": - - equRoutingMapper.insertBatchRouting((List)(List) entities); - break; - case "equ_veneer": - - equVeneerMapper.insertBatchVeneer((List)(List) entities); - break; - case "equ_vlan": - equVlanMapper.insertBatchVlan((List)(List) entities); - break; - // 其他表继续添加 - } - } - - /** - * 根据表名和字段名给实体赋值 - * - * @param entity 要赋值的实体对象 - * @param tableName 表名(可选,可用于日志或扩展) - * @param fieldName 字段名,对应实体的属性名 - * @param value 要赋的值(String 类型,可根据属性类型转换) - */ - public void fillField(Object entity, String tableName, String fieldName, String value) { - if (entity == null || fieldName == null || value == null) { - return; - } - - try { - Field field = null; - Class clazz = entity.getClass(); - - try { - // 先尝试直接找(比如字段名本来就是一致的情况) - field = clazz.getDeclaredField(fieldName); - } catch (NoSuchFieldException e) { - // 如果找不到,尝试下划线转驼峰 - String camelName = toCamelCase(fieldName); - try { - field = clazz.getDeclaredField(camelName); - } catch (NoSuchFieldException ignored) { - log.warn("实体 {} 没有字段 {}(驼峰:{}),表名 {}", - clazz.getSimpleName(), fieldName, camelName, tableName); - return; // 找不到就直接返回 - } - } - - field.setAccessible(true); // 设置可访问 - Class type = field.getType(); - - // 类型转换 - if (type == String.class) { - field.set(entity, value); - } else if (type == int.class || type == Integer.class) { - field.set(entity, Integer.parseInt(value)); - } else if (type == long.class || type == Long.class) { - field.set(entity, (long) Double.parseDouble(value)); // 改这里 - } else if (type == double.class || type == Double.class) { - field.set(entity, Double.parseDouble(value)); - } else if (type == boolean.class || type == Boolean.class) { - field.set(entity, Boolean.parseBoolean(value)); - } else if (type == Date.class) { - field.set(entity, Timestamp.valueOf(value)); - } else if (type == BigDecimal.class) { - field.set(entity, new BigDecimal(value)); - } else { - field.set(entity, value); - } - - - } catch (Exception e) { - log.error("实体 {} 字段 {} 赋值失败: {}", entity.getClass().getSimpleName(), fieldName, e.getMessage(), e); - } - } - - /** - * 下划线转驼峰,例如 des_address -> desAddress - */ - private String toCamelCase(String columnName) { - StringBuilder result = new StringBuilder(); - boolean upperCaseNext = false; - for (char c : columnName.toCharArray()) { - if (c == '_') { - upperCaseNext = true; - } else { - if (upperCaseNext) { - result.append(Character.toUpperCase(c)); - upperCaseNext = false; - } else { - result.append(Character.toLowerCase(c)); - } - } - } - return result.toString(); - } - - - -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/ScheduleRulesServiceImpl.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/ScheduleRulesServiceImpl.java index 2a98d971..10eac15f 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/ScheduleRulesServiceImpl.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/ScheduleRulesServiceImpl.java @@ -1,251 +1,94 @@ package com.alops.system.service.impl; -import java.math.BigDecimal; -import java.sql.SQLOutput; -import java.sql.Timestamp; -import java.util.*; -import java.util.concurrent.ExecutionException; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.concurrent.Future; -import java.util.stream.Collectors; +import java.util.List; -import com.alops.common.core.domain.AjaxResult; -import com.alops.system.domain.*; -import com.alops.system.domain.vo.Code; -import com.alops.system.domain.vo.EquGatherResult; -import com.alops.system.domain.vo.GatherEntities; -import com.alops.system.mapper.*; +import com.alops.system.domain.ScheduleRules; +import com.alops.system.mapper.ScheduleRulesMapper; import com.alops.system.service.IScheduleRulesService; -import com.alops.system.service.MemoryToolService; -import com.alops.system.service.SnmpService; -import org.apache.poi.ss.formula.functions.Now; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - - -import static java.lang.Long.parseLong; -import static javax.xml.bind.DatatypeConverter.parseDecimal; /** * 定时采集规则Service业务层处理 - * + * * @author ruoyi * @date 2025-08-03 */ @Service -public class ScheduleRulesServiceImpl implements IScheduleRulesService { +public class ScheduleRulesServiceImpl implements IScheduleRulesService +{ @Autowired private ScheduleRulesMapper scheduleRulesMapper; - @Autowired - private EquBaseMapper equBaseMapper; - @Autowired - private EquOidMapper equOidMapper; - @Autowired - private SnmpService snmpService; - @Autowired - private EquGatherMapper equGatherMapper; - - @Autowired - private MemoryToolService memoryToolService; - private static final Logger log = LoggerFactory.getLogger(ScheduleRulesServiceImpl.class); - /** - * 删除所有设备相关表数据,保证事务一致性 + * 查询定时采集规则 + * + * @param id 定时采集规则主键 + * @return 定时采集规则 */ - @Transactional(rollbackFor = Exception.class) - public void deleteAllEquipmentData() { - equBaseMapper.deleteEquInterface(); - equBaseMapper.deleteEquRouting(); - equBaseMapper.deleteEquVeneer(); - equBaseMapper.deleteEquVlan(); - } - - @Override - public int executeImmediately() throws ExecutionException, InterruptedException { - //删除之前的信息 - deleteAllEquipmentData(); - - // 1.收集设备信息 - List devices = equBaseMapper.findEquBaseList(); - if (devices.isEmpty()) { - return Code.FAIL; - } - - // 2.根据厂商ip收集 OID - Map> oidMap = new HashMap<>(); - for (EquBase dev : devices) { - String key = dev.getManufacture(); - List oids = equOidMapper.findByManuIdAndStatus(key); - oidMap.put(key, oids); - } - - ExecutorService executor = Executors.newFixedThreadPool(10); - List> futures = new ArrayList<>(); - - for (EquBase device : devices) { - futures.add(executor.submit(() -> { - try { - long start = System.currentTimeMillis(); - List oids = oidMap.getOrDefault(device.getManufacture(), Collections.emptyList()); - Map snmpResults = snmpService.query(device.getIp(), oids); - long afterSnmp = System.currentTimeMillis(); - System.out.println("SNMP查询耗时: " + (afterSnmp - start) + " ms"); - - GatherEntities entities = memoryToolService.buildAndInsertEntity(device, snmpResults); - long afterBuild = System.currentTimeMillis(); - System.out.println("buildAndInsertEntity构建实体类耗时: " + (afterBuild - afterSnmp) + " ms"); - if (entities != null && entities.getEquGather() != null) { - Double temperature = parseDouble(snmpResults.get("temperature")); // 温度 - Double cpuUsage = parseDouble(snmpResults.get("cpu_utilization")); - Double memUsage = parseDouble(snmpResults.get("memory_utilization")); - double tempHealth = calculateTemperatureHealth(temperature); - double humidityHealth = 1; - double cpuHealth = calculateCpuHealth(cpuUsage); - double memHealth = calculateMemoryHealth(memUsage); - - double totalHealth = Math.max( - Math.max(tempHealth, humidityHealth), - Math.max(cpuHealth, memHealth) - ); - entities.getEquGather().setHealth(BigDecimal.valueOf(totalHealth)); - return entities; - } - return null; - } catch (Exception e) { - e.printStackTrace(); - log.error("设备采集失败,设备ID: {}, IP: {}, 原因: {}", device.getId(), device.getIp(), e.getMessage(), e); - return null; - } - })); - } - - - - List allEntities = new ArrayList<>(); - for (Future f : futures) { - GatherEntities g = f.get(); - if (g != null) allEntities.add(g); - } - long persistStart = System.currentTimeMillis(); - // 统一批量落库 - int result=memoryToolService.persistAll(allEntities); - long persistEnd = System.currentTimeMillis(); - System.out.println("批量落库耗时: " + (persistEnd - persistStart) + " ms"); - return result; + @Override + public ScheduleRules selectScheduleRulesById(Long id) + { + return scheduleRulesMapper.selectScheduleRulesById(id); } - // 健康度计算函数示例 - private int calculateTemperatureHealth(Double temp) { - if (temp == null) return 4; // 无数据视为需维护 - if (temp >= 25 && temp <= 45) return 1; - if ((temp >= 20 && temp < 25) || (temp > 45 && temp <= 50)) return 2; - if ((temp >= 16 && temp < 20) || (temp > 50 && temp <= 55)) return 3; - return 4; + /** + * 查询定时采集规则列表 + * + * @param scheduleRules 定时采集规则 + * @return 定时采集规则 + */ + @Override + public List selectScheduleRulesList(ScheduleRules scheduleRules) + { + return scheduleRulesMapper.selectScheduleRulesList(scheduleRules); } - private int calculateCpuHealth(Double cpu) { - if (cpu == null) return 4; - if (cpu <= 80) return 1; - if (cpu <= 90) return 2; - if (cpu <= 95) return 3; - return 4; + /** + * 新增定时采集规则 + * + * @param scheduleRules 定时采集规则 + * @return 结果 + */ + @Override + public int insertScheduleRules(ScheduleRules scheduleRules) + { + return scheduleRulesMapper.insertScheduleRules(scheduleRules); } - private int calculateMemoryHealth(Double mem) { - if (mem == null) return 4; - if (mem <= 80) return 1; - if (mem <= 90) return 2; - if (mem <= 95) return 3; - return 4; + /** + * 修改定时采集规则 + * + * @param scheduleRules 定时采集规则 + * @return 结果 + */ + @Override + public int updateScheduleRules(ScheduleRules scheduleRules) + { + return scheduleRulesMapper.updateScheduleRules(scheduleRules); } - private Double parseDouble(Object obj) { - if (obj == null) return null; - try { - return Double.parseDouble(obj.toString()); - } catch (NumberFormatException e) { - return null; - } + /** + * 批量删除定时采集规则 + * + * @param ids 需要删除的定时采集规则主键 + * @return 结果 + */ + @Override + public int deleteScheduleRulesByIds(Long[] ids) + { + return scheduleRulesMapper.deleteScheduleRulesByIds(ids); } - - - /** - * 查询定时采集规则 - * - * @param id 定时采集规则主键 - * @return 定时采集规则 - */ - - @Override - public ScheduleRules selectScheduleRulesById (Long id) - { - return scheduleRulesMapper.selectScheduleRulesById(id); - } - - /** - * 查询定时采集规则列表 - * - * @param scheduleRules 定时采集规则 - * @return 定时采集规则 - */ - @Override - public List selectScheduleRulesList (ScheduleRules scheduleRules) - { - return scheduleRulesMapper.selectScheduleRulesList(scheduleRules); - } - - /** - * 新增定时采集规则 - * - * @param scheduleRules 定时采集规则 - * @return 结果 - */ - @Override - public int insertScheduleRules (ScheduleRules scheduleRules) - { - return scheduleRulesMapper.insertScheduleRules(scheduleRules); - } - - /** - * 修改定时采集规则 - * - * @param scheduleRules 定时采集规则 - * @return 结果 - */ - @Override - public int updateScheduleRules (ScheduleRules scheduleRules) - { - return scheduleRulesMapper.updateScheduleRules(scheduleRules); - } - - /** - * 批量删除定时采集规则 - * - * @param ids 需要删除的定时采集规则主键 - * @return 结果 - */ - @Override - public int deleteScheduleRulesByIds (Long[]ids) - { - return scheduleRulesMapper.deleteScheduleRulesByIds(ids); - } - - /** - * 删除定时采集规则信息 - * - * @param id 定时采集规则主键 - * @return 结果 - */ - @Override - public int deleteScheduleRulesById (Long id) - { - return scheduleRulesMapper.deleteScheduleRulesById(id); - } + /** + * 删除定时采集规则信息 + * + * @param id 定时采集规则主键 + * @return 结果 + */ + @Override + public int deleteScheduleRulesById(Long id) + { + return scheduleRulesMapper.deleteScheduleRulesById(id); } - +} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/SnmpServiceImpl.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/SnmpServiceImpl.java deleted file mode 100644 index aff2ba89..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/SnmpServiceImpl.java +++ /dev/null @@ -1,299 +0,0 @@ -package com.alops.system.service.impl; - -import com.alops.system.domain.EquOid; -import com.alops.system.service.ConvertRawValueService; -import com.alops.system.service.SnmpService; -import org.snmp4j.CommunityTarget; -import org.snmp4j.Snmp; -import org.snmp4j.mp.SnmpConstants; -import org.snmp4j.smi.*; -import org.snmp4j.transport.DefaultUdpTransportMapping; -import org.snmp4j.util.DefaultPDUFactory; -import org.snmp4j.util.TreeEvent; -import org.snmp4j.util.TreeUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.net.InetAddress; -import java.net.UnknownHostException; -import java.util.*; -//根据截取方式生成结果 -@Service -public class SnmpServiceImpl implements SnmpService { -@Autowired -private ConvertRawValueService convertRawValueService; - @Override - public Map query(String ip, List oids) { - Map result = new HashMap<>(); - // 保存 param(多表表名) -> 动态字段名(对应id) - Map paramDynamicKeyMap = new HashMap<>(); - - try { - Address targetAddress = GenericAddress.parse("udp:" + ip + "/161"); - CommunityTarget target = new CommunityTarget(); - target.setCommunity(new OctetString("publicswitch")); - target.setAddress(targetAddress); - target.setRetries(2); - target.setTimeout(1500); - target.setVersion(SnmpConstants.version2c); - - Snmp snmp = new Snmp(new DefaultUdpTransportMapping()); - snmp.listen(); - Map>> highTemp = new HashMap<>(); - Map>> lowTemp = new HashMap<>(); - - // 存放每个 param 的 mergedMap - Map>> mergedMaps = new HashMap<>(); - - for (EquOid oid : oids) { - System.out.println(oid.getDescription()+"请求===="+System.currentTimeMillis()); - String way = oid.getCutRule(); // 截取方式 - OID rootOid = new OID(oid.getOid()); - TreeUtils treeUtils = new TreeUtils(snmp, new DefaultPDUFactory()); - List events = treeUtils.getSubtree(target, rootOid); - System.out.println(oid.getDescription()+"返回===="+System.currentTimeMillis()); - if (events == null || events.isEmpty()) { - result.put(oid.getParam(), null); - continue; - } - - switch (way) { - case "1": - // 最后一个非 0 值 - String lastNonZero = null; - for (TreeEvent event : events) { - if (event == null || event.isError()) continue; - VariableBinding[] vbs = event.getVariableBindings(); - if (vbs == null) continue; - for (VariableBinding vb : vbs) { - String val = vb.getVariable().toString(); - if (!"0".equals(val)) { - lastNonZero = val; - } - } - } - // 调用自定义转换函数 -// String value1 = convertRawValueService.convertValue( oid.getConvertRule(),lastNonZero); - result.put(oid.getParam(),lastNonZero); - - - break; - - - case "2": - - String[] keys2 = (oid.getSubParamGroup() != null) ? oid.getSubParamGroup().split(",") : new String[0]; - - // 如果之前已经有这个 param,就用它的内容继续合并 - Map> mergedMap = - mergedMaps.getOrDefault(oid.getParam(), new LinkedHashMap<>()); - - for (TreeEvent event : events) { - if (event == null || event.isError()) continue; - VariableBinding[] vbs = event.getVariableBindings(); - if (vbs == null) continue; - - for (VariableBinding vb : vbs) { - String oidStr = vb.getOid().toString(); - String index = oidStr.substring(oidStr.lastIndexOf(".") + 1); - String val = vb.getVariable().toString(); - - // 判断是否高低位 - if (oid.getCombineGroup() != null && !oid.getCombineGroup().isEmpty()) { - String param = oid.getParam(); - String group = oid.getCombineGroup(); - if (oid.getIsHighPart() != null && oid.getIsHighPart().intValue() != 0) { - highTemp.computeIfAbsent(param, k -> new HashMap<>()) - .computeIfAbsent(group, k -> new HashMap<>()) - .put(index, val); - } else { - lowTemp.computeIfAbsent(param, k -> new HashMap<>()) - .computeIfAbsent(group, k -> new HashMap<>()) - .put(index, val); - } - continue; - } - - // 普通字段 convertRawValueService.convertValue(oid.getConvertRule(), val) - Map entry = mergedMap.getOrDefault(index, new HashMap<>()); - if (keys2.length > 0) { - - entry.put(keys2[0], index); - paramDynamicKeyMap.put(oid.getParam(), keys2[0]);} - if (keys2.length > 1) entry.put(keys2[1], val); - mergedMap.put(index, entry); - } - } - - mergedMaps.put(oid.getParam(), mergedMap); - break; - - - case "3": - // 单值 - String singleValue = null; - outerLoop: - for (TreeEvent event : events) { - if (event == null || event.isError()) continue; - VariableBinding[] vbs = event.getVariableBindings(); - if (vbs == null) continue; - for (VariableBinding vb : vbs) { - singleValue = vb.getVariable().toString(); - break outerLoop; // 只取第一个 - } - } - -// String value3 = convertRawValueService.convertValue(oid.getConvertRule(),singleValue ); - result.put(oid.getParam(), singleValue); - - break; - - case "4": - // 目的地址 + 掩码 + 下一跳,动态 key - List> routeList = new ArrayList<>(); - String[] keys4 = (oid.getSubParamGroup() != null) - ? oid.getSubParamGroup().split(",") - : new String[0]; - - for (TreeEvent event : events) { - if (event == null || event.isError()) continue; - VariableBinding[] vbs = event.getVariableBindings(); - if (vbs == null) continue; - - for (VariableBinding vb : vbs) { - String oidStr = vb.getOid().toString(); - String prefix = "1.3.6.1.2.1.4.24.7.1.9.1.4"; - if (!oidStr.startsWith(prefix)) continue; - - String suffix = oidStr.substring(prefix.length()); - String[] parts = suffix.split("\\."); - if (parts.length < 8) continue; - - Map route = new HashMap<>(); - - // 遍历 keys4 - for (int i = 0; i < keys4.length; i++) { - if (i == 0) { -// // 第一个字段:目的地址作为id - String destIp = parts[1] + "." + parts[2] + "." + parts[3] + "." + parts[4]; - route.put(keys4[i], destIp); - - } else if (i == 1) { - // 第二个字段:子网掩码 - - int maskInt = Integer.parseInt(parts[5]); - route.put(keys4[i], convertMask(maskInt)); - } else if (i == 2) { - // 第三个字段:下一跳 - String nextHop = parts[parts.length - 4] + "." + - parts[parts.length - 3] + "." + - parts[parts.length - 2] + "." + - parts[parts.length - 1]; - route.put(keys4[i], nextHop); - } - } - - routeList.add(route); - } - } - - result.put(oid.getParam(), routeList); - break; - - case "5": - // 取最后两行数据的最后一个值,两个都是1则返回1,否则0 - List lastTwoValues = new ArrayList<>(); - for (TreeEvent event : events) { - if (event == null || event.isError()) continue; - VariableBinding[] vbs = event.getVariableBindings(); - if (vbs == null || vbs.length == 0) continue; - lastTwoValues.add(vbs[vbs.length - 1].getVariable().toString()); - } - String value5 = "0"; - if (lastTwoValues.size() >= 2) { - String val1 = lastTwoValues.get(lastTwoValues.size() - 2); - String val2 = lastTwoValues.get(lastTwoValues.size() - 1); - if ("1".equals(val1) && "1".equals(val2)) { - value5 = "1"; - } - } -// value5 = convertRawValueService.convertValue(oid.getConvertRule(), value5); - result.put(oid.getParam(), value5); - break; - - case "6": - // 取最后一行的最后一个值 - String lastValue = null; - for (TreeEvent event : events) { - if (event == null || event.isError()) continue; - VariableBinding[] vbs = event.getVariableBindings(); - if (vbs == null || vbs.length == 0) continue; - lastValue = vbs[vbs.length - 1].getVariable().toString(); - } -// String value6 = convertRawValueService.convertValue(oid.getConvertRule(), lastValue); - result.put(oid.getParam(), lastValue); - break; - default: - result.put(oid.getParam(), null); - } - - } - - snmp.close(); - // 对于非高低位的普通字段 - for (String param : mergedMaps.keySet()) { - if (!highTemp.containsKey(param)) { // 不是高低位的 - Map> map = mergedMaps.get(param); - if (map != null && !map.isEmpty()) { - result.put(param, new ArrayList<>(map.values())); - } - } - } - - // 全局高低位统一合并 - for (String param : highTemp.keySet()) { - Map> highGroups = highTemp.get(param); - Map> lowGroups = lowTemp.getOrDefault(param, new HashMap<>()); - Map> mergedMap = mergedMaps.getOrDefault(param, new LinkedHashMap<>()); - - for (String group : highGroups.keySet()) { - Map highValues = highGroups.get(group); - Map lowValues = lowGroups.getOrDefault(group, new HashMap<>()); - - for (String index : highValues.keySet()) { - int high = Integer.parseInt(highValues.get(index)); - int low = Integer.parseInt(lowValues.getOrDefault(index, "0")); - long combined = ((long) high << 32) + (long) low; - - Map entry = mergedMap.getOrDefault(index, new HashMap<>()); - - String dynamicKey = paramDynamicKeyMap.getOrDefault(param, "index"); - entry.put(dynamicKey, index); - entry.put(group, String.valueOf(combined)); - mergedMap.put(index, entry); - } - } - result.put(param, new ArrayList<>(mergedMap.values())); - } - - } catch (Exception e) { - e.printStackTrace(); - } - - - return result; - } - - // CIDR 转掩码 - private String convertMask(int cidr) throws UnknownHostException { - int mask = 0xffffffff << (32 - cidr); - byte[] bytes = new byte[]{ - (byte) (mask >>> 24), - (byte) (mask >> 16 & 0xff), - (byte) (mask >> 8 & 0xff), - (byte) (mask & 0xff) - }; - InetAddress netAddr = InetAddress.getByAddress(bytes); - return netAddr.getHostAddress(); - } -} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/typeHandlers/StringToLongTypeHandler.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/typeHandlers/StringToLongTypeHandler.java deleted file mode 100644 index 36affef0..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/typeHandlers/StringToLongTypeHandler.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.alops.system.typeHandlers; - -import org.apache.ibatis.type.BaseTypeHandler; -import org.apache.ibatis.type.JdbcType; -import org.apache.ibatis.type.MappedJdbcTypes; -import org.apache.ibatis.type.MappedTypes; - -import java.sql.CallableStatement; -import java.sql.PreparedStatement; -import java.sql.ResultSet; -import java.sql.SQLException; - -@MappedTypes(String.class) -@MappedJdbcTypes(JdbcType.BIGINT) -public class StringToLongTypeHandler extends BaseTypeHandler { - - @Override - public void setNonNullParameter(PreparedStatement ps, int i, String parameter, JdbcType jdbcType) throws SQLException { - ps.setLong(i, Long.parseLong(parameter)); - } - - @Override - public String getNullableResult(ResultSet rs, String columnName) throws SQLException { - long value = rs.getLong(columnName); - return rs.wasNull() ? null : String.valueOf(value); - } - - @Override - public String getNullableResult(ResultSet rs, int columnIndex) throws SQLException { - long value = rs.getLong(columnIndex); - return rs.wasNull() ? null : String.valueOf(value); - } - - @Override - public String getNullableResult(CallableStatement cs, int columnIndex) throws SQLException { - long value = cs.getLong(columnIndex); - return cs.wasNull() ? null : String.valueOf(value); - } -} diff --git a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlarmRuleMapper.xml b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlarmRuleMapper.xml new file mode 100644 index 00000000..3c715944 --- /dev/null +++ b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlarmRuleMapper.xml @@ -0,0 +1,110 @@ + + + + + + + + + + + + + + + + + + + + + + select id, rule_name, description, param_name, equ_type, compare_operator, param_value, alert_level, alert_message, role_id, notify_email, rule_status, create_time from alarm_rule + + + + + + + + insert into alarm_rule + + rule_name, + description, + param_name, + equ_type, + compare_operator, + param_value, + alert_level, + alert_message, + role_id, + notify_email, + rule_status, + create_time, + + + #{ruleName}, + #{description}, + #{paramName}, + #{equType}, + #{compareOperator}, + #{paramValue}, + #{alertLevel}, + #{alertMessage}, + #{roleId}, + #{notifyEmail}, + #{ruleStatus}, + #{createTime}, + + + + + update alarm_rule + + rule_name = #{ruleName}, + description = #{description}, + param_name = #{paramName}, + equ_type = #{equType}, + compare_operator = #{compareOperator}, + param_value = #{paramValue}, + alert_level = #{alertLevel}, + alert_message = #{alertMessage}, + role_id = #{roleId}, + notify_email = #{notifyEmail}, + rule_status = #{ruleStatus}, + create_time = #{createTime}, + + where id = #{id} + + + + delete from alarm_rule where id = #{id} + + + + delete from alarm_rule where id in + + #{id} + + + \ No newline at end of file diff --git a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlertRuleConditionMapper.xml b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlertRuleConditionMapper.xml deleted file mode 100644 index 8f836bef..00000000 --- a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlertRuleConditionMapper.xml +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - - - - - - - - - - select id, alert_rule_id, param_name, operator, compare_value, logic_operator, order_no, value_type from alert_rule_condition - - - - - - - - insert into alert_rule_condition - - alert_rule_id, - param_name, - operator, - compare_value, - logic_operator, - order_no, - value_type, - - - #{alertRuleId}, - #{paramName}, - #{operator}, - #{compareValue}, - #{logicOperator}, - #{orderNo}, - #{valueType}, - - - - - update alert_rule_condition - - alert_rule_id = #{alertRuleId}, - param_name = #{paramName}, - operator = #{operator}, - compare_value = #{compareValue}, - logic_operator = #{logicOperator}, - order_no = #{orderNo}, - value_type = #{valueType}, - - where id = #{id} - - - - delete from alert_rule_condition where id = #{id} - - - - delete from alert_rule_condition where id in - - #{id} - - - \ No newline at end of file diff --git a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlertRuleMapper.xml b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlertRuleMapper.xml deleted file mode 100644 index c2368636..00000000 --- a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlertRuleMapper.xml +++ /dev/null @@ -1,131 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - select id, rule_name, severity, alert_way, alert_station, description, enable, create_time, update_time, create_by, update_by, table_name, alert_sql, alert_template, type from alert_rule - - - - - - - - insert into alert_rule - - rule_name, - severity, - alert_way, - alert_station, - description, - enable, - create_time, - update_time, - create_by, - update_by, - table_name, - alert_sql, - alert_template, - type, - - - #{ruleName}, - #{severity}, - #{alertWay}, - #{alertStation}, - #{description}, - #{enable}, - - #{createTime} - NOW() - , - - #{updateTime} - NOW() - , - #{createBy}, - #{updateBy}, - #{tableName}, - #{alertSql}, - #{alertTemplate}, - #{type}, - - - - - update alert_rule - - rule_name = #{ruleName}, - severity = #{severity}, - alert_way = #{alertWay}, - alert_station = #{alertStation}, - description = #{description}, - enable = #{enable}, - create_time = #{createTime}, - update_time = #{updateTime}, - create_by = #{createBy}, - update_by = #{updateBy}, - table_name = #{tableName}, - alert_sql = #{alertSql}, - alert_template = #{alertTemplate}, - type = #{type}, - - where id = #{id} - - - - delete from alert_rule where id = #{id} - - - - delete from alert_rule where id in - - #{id} - - - \ No newline at end of file diff --git a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/DictAlarmParamMapper.xml b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/DictAlarmParamMapper.xml deleted file mode 100644 index 3ca3ff71..00000000 --- a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/DictAlarmParamMapper.xml +++ /dev/null @@ -1,77 +0,0 @@ - - - - - - - - - - - - - - - - select id, param_name, table_name, column_name, param_type from dict_alarm_param - - - - - - - - insert into dict_alarm_param - - param_name, - table_name, - column_name, - param_type, - - - #{paramName}, - #{tableName}, - #{columnName}, - #{paramType}, - - - - - update dict_alarm_param - - param_name = #{paramName}, - table_name = #{tableName}, - column_name = #{columnName}, - param_type = #{paramType}, - - where id = #{id} - - - - delete from dict_alarm_param where id = #{id} - - - - delete from dict_alarm_param where id in - - #{id} - - - \ No newline at end of file diff --git a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquBaseMapper.xml b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquBaseMapper.xml index 7b99404b..89670822 100644 --- a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquBaseMapper.xml +++ b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquBaseMapper.xml @@ -9,7 +9,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - @@ -18,32 +17,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + - - - - - + - select id, name, version, ip, manufacture, location, equ_type, in_charge, release_date, install_date, life_cycle, service_time, warranty, create_by, create_date, update_by, update_date, status, failure_frequency, repair_frequency, repair_cost from equ_base + select id, name, version, ip, manufacture, location, equ_type, in_charge, release_date, install_date, life_cycle, service_time, warranty, failure_frequency, repair_frequency, repair_cost, create_by, create_date, update_by, update_date, status from equ_base - SELECT b.id, b.name, b.version, b.ip, - m.id as manuId, - m.name as manuName, + m.id as equ_manu_id, + m.name as equ_manu_name, b.location, b.equ_type, b.in_charge, @@ -52,14 +50,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" b.life_cycle, b.service_time, b.warranty, + b.failure_frequency, + b.repair_frequency, + b.repair_cost, b.create_by, b.create_date, b.update_by, b.update_date, b.status, - b.failure_frequency as failureFrequency, - b.repair_frequency as repairFrequency, - b.repair_cost as repairCost, g.health FROM equ_base b LEFT JOIN equ_gather g ON b.id = g.equ_id @@ -95,9 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + - - - and equ_id = #{equId} - and health = #{health} - and temperature = #{temperature} - and humidity = #{humidity} - and cpu_utilization = #{cpuUtilization} - and memory_utilization = #{memoryUtilization} - and fan_speed = #{fanSpeed} - and vol_in = #{volIn} - and vol_out = #{volOut} - and alarm_info = #{alarmInfo} - and log_online = #{logOnline} - and log_sys = #{logSys} - and gather_time = #{gatherTime} - and vol_in_status = #{volInStatus} - and vol_out_status = #{volOutStatus} - and fan_speed_status = #{fanSpeedStatus} - and cont_work_period = #{contWorkPeriod} - - - - - - - - insert into equ_gather ( - id, equ_id, health, temperature, humidity, - cpu_utilization, memory_utilization, fan_speed, - vol_in, vol_out, alarm_info, log_online, log_sys, - gather_time, vol_in_status, vol_out_status, - fan_speed_status, cont_work_period - ) - values - - ( - #{item.id}, #{item.equId}, #{item.health}, #{item.temperature}, #{item.humidity}, - #{item.cpuUtilization}, #{item.memoryUtilization}, #{item.fanSpeed}, - #{item.volIn}, #{item.volOut}, #{item.alarmInfo}, #{item.logOnline}, #{item.logSys}, - #{item.gatherTime}, #{item.volInStatus}, #{item.volOutStatus}, - #{item.fanSpeedStatus}, #{item.contWorkPeriod} - ) - - - - insert into equ_gather - - id, - equ_id, - health, - temperature, - humidity, - cpu_utilization, - memory_utilization, - fan_speed, - vol_in, - vol_out, - alarm_info, - log_online, - log_sys, - gather_time, - vol_in_status, - vol_out_status, - fan_speed_status, - cont_work_period, - - - #{id}, - #{equId}, - #{health}, - #{temperature}, - #{humidity}, - #{cpuUtilization}, - #{memoryUtilization}, - #{fanSpeed}, - #{volIn}, - #{volOut}, - #{alarmInfo}, - #{logOnline}, - #{logSys}, - #{gatherTime}, - #{volInStatus}, - #{volOutStatus}, - #{fanSpeedStatus}, - #{contWorkPeriod}, - - - - - update equ_gather - - equ_id = #{equId}, - health = #{health}, - temperature = #{temperature}, - humidity = #{humidity}, - cpu_utilization = #{cpuUtilization}, - memory_utilization = #{memoryUtilization}, - fan_speed = #{fanSpeed}, - vol_in = #{volIn}, - vol_out = #{volOut}, - alarm_info = #{alarmInfo}, - log_online = #{logOnline}, - log_sys = #{logSys}, - gather_time = #{gatherTime}, - vol_in_status = #{volInStatus}, - vol_out_status = #{volOutStatus}, - fan_speed_status = #{fanSpeedStatus}, - cont_work_period = #{contWorkPeriod}, - - where id = #{id} - - - - delete from equ_gather where id = #{id} - - - - delete from equ_gather where id in - - #{id} - - - \ No newline at end of file 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 deleted file mode 100644 index 8611be9c..00000000 --- a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquInterfaceMapper.xml +++ /dev/null @@ -1,133 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - INSERT INTO equ_interface ( - id, equ_id, gather_time, running, rate, commuicate_mode, out_flow, in_flow, - in_bandwidth, loss_rate, error_rate, equ_gather_id, interface_id, out_bandwidth - ) - VALUES - - (#{item.id}, #{item.equId}, #{item.gatherTime}, #{item.running}, #{item.rate}, - #{item.commuicateMode}, #{item.outFlow}, #{item.inFlow}, #{item.inBandwidth}, - #{item.lossRate}, #{item.errorRate}, #{item.equGatherId}, #{item.interfaceId}, - #{item.outBandwidth}) - - - - - - select id, equ_id, gather_time, running, rate, commuicate_mode, out_flow, in_flow, in_bandwidth, loss_rate, error_rate, equ_gather_id, interface_id, out_bandwidth from equ_interface - - - - - - - - insert into equ_interface - - id, - equ_id, - gather_time, - running, - rate, - commuicate_mode, - out_flow, - in_flow, - in_bandwidth, - loss_rate, - error_rate, - equ_gather_id, - interface_id, - out_bandwidth, - - - #{id}, - #{equId}, - #{gatherTime}, - #{running}, - #{rate}, - #{commuicateMode}, - #{outFlow}, - #{inFlow}, - #{inBandwidth}, - #{lossRate}, - #{errorRate}, - #{equGatherId}, - #{interfaceId}, - #{outBandwidth}, - - - - - update equ_interface - - equ_id = #{equId}, - gather_time = #{gatherTime}, - running = #{running}, - rate = #{rate}, - commuicate_mode = #{commuicateMode}, - out_flow = #{outFlow}, - in_flow = #{inFlow}, - in_bandwidth = #{inBandwidth}, - loss_rate = #{lossRate}, - error_rate = #{errorRate}, - equ_gather_id = #{equGatherId}, - interface_id = #{interfaceId}, - out_bandwidth = #{outBandwidth}, - - where id = #{id} - - - - delete from equ_interface where id = #{id} - - - - delete from equ_interface where id in - - #{id} - - - \ No newline at end of file diff --git a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquOidMapper.xml b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquOidMapper.xml deleted file mode 100644 index 9edb8ac1..00000000 --- a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquOidMapper.xml +++ /dev/null @@ -1,146 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - select id, oid, param, store_table, convert_rule, combine_group, is_high_part, manufacturer_id, cut_rule, multi_param, sub_param_group, description, unit, enabled, create_time, update_time from equ_oid - - - - - - - - insert into equ_oid - - oid, - param, - store_table, - convert_rule, - combine_group, - is_high_part, - manufacturer_id, - cut_rule, - multi_param, - sub_param_group, - description, - unit, - enabled, - create_time, - update_time, - - - #{oid}, - #{param}, - #{storeTable}, - #{convertRule}, - #{combineGroup}, - #{isHighPart}, - #{manufacturerId}, - #{cutRule}, - #{multiParam}, - #{subParamGroup}, - #{description}, - #{unit}, - #{enabled}, - #{createTime}, - #{updateTime}, - - - - - update equ_oid - - oid = #{oid}, - param = #{param}, - store_table = #{storeTable}, - convert_rule = #{convertRule}, - combine_group = #{combineGroup}, - is_high_part = #{isHighPart}, - manufacturer_id = #{manufacturerId}, - cut_rule = #{cutRule}, - multi_param = #{multiParam}, - sub_param_group = #{subParamGroup}, - description = #{description}, - unit = #{unit}, - enabled = #{enabled}, - create_time = #{createTime}, - update_time = #{updateTime}, - - where id = #{id} - - - - delete from equ_oid where id = #{id} - - - - delete from equ_oid where id in - - #{id} - - - \ No newline at end of file diff --git a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquRoutingMapper.xml b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquRoutingMapper.xml deleted file mode 100644 index 6e59d233..00000000 --- a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquRoutingMapper.xml +++ /dev/null @@ -1,83 +0,0 @@ - - - - - - - - - - - - - - - INSERT INTO equ_routing (id, equ_gather_id, des_address, subnet_mask, next_hop) - VALUES - - ( - #{item.id}, #{item.equGatherId}, #{item.desAddress}, #{item.subnetMask}, #{item.nextHop} - ) - - - - select id, equ_gather_id, des_address, subnet_mask, next_hop from equ_routing - - - - - - - - insert into equ_routing - - id, - equ_gather_id, - des_address, - subnet_mask, - next_hop, - - - #{id}, - #{equGatherId}, - #{desAddress}, - #{subnetMask}, - #{nextHop}, - - - - - update equ_routing - - equ_gather_id = #{equGatherId}, - des_address = #{desAddress}, - subnet_mask = #{subnetMask}, - next_hop = #{nextHop}, - - where id = #{id} - - - - delete from equ_routing where id = #{id} - - - - delete from equ_routing where id in - - #{id} - - - \ No newline at end of file diff --git a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquVeneerMapper.xml b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquVeneerMapper.xml deleted file mode 100644 index c7b9970b..00000000 --- a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquVeneerMapper.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - - - - - INSERT INTO equ_veneer (id, veneer_id, veneer_status, equ_gather_id) - VALUES - - ( - #{item.id}, #{item.veneerId}, #{item.veneerStatus}, #{item.equGatherId} - ) - - - - - select id, veneer_id, veneer_status, equ_gather_id from equ_veneer - - - - - - - - insert into equ_veneer - - id, - veneer_id, - veneer_status, - equ_gather_id, - - - #{id}, - #{veneerId}, - #{veneerStatus}, - #{equGatherId}, - - - - - update equ_veneer - - veneer_id = #{veneerId}, - veneer_status = #{veneerStatus}, - equ_gather_id = #{equGatherId}, - - where id = #{id} - - - - delete from equ_veneer where id = #{id} - - - - delete from equ_veneer where id in - - #{id} - - - \ No newline at end of file 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 deleted file mode 100644 index 53d00763..00000000 --- a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquVlanMapper.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - - - - - - - - - - - - INSERT INTO equ_vlan ( - id, equ_gather_id, main_id, ip_address, subnet_mask, - vlan_id - ) - VALUES - - ( - #{item.id}, #{item.equGatherId}, #{item.mainId}, #{item.ipAddress}, #{item.subnetMask}, - #{item.vlanId} - ) - - - - select id, equ_gather_id, main_id, ip_address, subnet_mask, create_time, update_by, vlan_id from equ_vlan - - - - - - - - insert into equ_vlan - - id, - equ_gather_id, - main_id, - ip_address, - subnet_mask, - create_time, - update_by, - vlan_id, - - - #{id}, - #{equGatherId}, - #{mainId}, - #{ipAddress}, - #{subnetMask}, - #{createTime}, - #{updateBy}, - #{vlanId}, - - - - - update equ_vlan - - equ_gather_id = #{equGatherId}, - main_id = #{mainId}, - ip_address = #{ipAddress}, - subnet_mask = #{subnetMask}, - create_time = #{createTime}, - update_by = #{updateBy}, - vlan_id = #{vlanId}, - - where id = #{id} - - - - delete from equ_vlan where id = #{id} - - - - delete from equ_vlan where id in - - #{id} - - - \ No newline at end of file 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/FauStaMapper.xml similarity index 76% rename from ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlertMessageMapper.xml rename to ALOps_sys_backend/alops-system/src/main/resources/mapper/system/FauStaMapper.xml index 16edf911..5ea9513f 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/FauStaMapper.xml @@ -2,9 +2,9 @@ - + - + @@ -20,29 +20,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - - - - INSERT INTO alert_message - (equ_id, description, type, equ_type, cause, solution, level, occur_time, reporter, handler, handle_time, status) - VALUES - - (#{msg.equId}, #{msg.description}, #{msg.type}, #{msg.equType}, - #{msg.cause}, #{msg.solution}, #{msg.level}, #{msg.occurTime}, - #{msg.reporter}, #{msg.handler}, #{msg.handleTime}, #{msg.status}) - - - - - - - - select id, equ_id, description, type, equ_type, cause, solution, level, occur_time, reporter, handler, handle_time, status from alert_message + + select id, equ_id, description, type, equ_type, cause, solution, level, occur_time, reporter, handler, handle_time, status from fau_sta - + and equ_id = #{equId} and description = #{description} @@ -59,13 +42,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - + where id = #{id} - - insert into alert_message + + insert into fau_sta equ_id, description, @@ -96,8 +79,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - update alert_message + + update fau_sta equ_id = #{equId}, description = #{description}, @@ -115,12 +98,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where id = #{id} - - delete from alert_message where id = #{id} + + delete from fau_sta where id = #{id} - - delete from alert_message where id in + + delete from fau_sta where id in #{id} diff --git a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/InternalMessageMapper.xml b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/InternalMessageMapper.xml deleted file mode 100644 index 0d9ca174..00000000 --- a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/InternalMessageMapper.xml +++ /dev/null @@ -1,81 +0,0 @@ - - - - - - - - - - - - - - - INSERT INTO internal_message (user_id, content, status, create_time) - VALUES - - (#{msg.userId}, #{msg.content}, #{msg.status}, #{msg.createTime}) - - - - - - - select id, user_id, content, status, create_time from internal_message - - - - - - - - insert into internal_message - - user_id, - content, - status, - create_time, - - - #{userId}, - #{content}, - #{status}, - #{createTime}, - - - - - update internal_message - - user_id = #{userId}, - content = #{content}, - status = #{status}, - create_time = #{createTime}, - - where id = #{id} - - - - delete from internal_message where id = #{id} - - - - delete from internal_message where id in - - #{id} - - - \ No newline at end of file diff --git a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/SysUserMapper.xml b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/SysUserMapper.xml index 00674290..9f4dab4f 100644 --- a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -35,15 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - - - + diff --git a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/mybatis-config.xml b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/mybatis-config.xml deleted file mode 100644 index e7608ea8..00000000 --- a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/mybatis-config.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/ALOps_sys_backend/pom.xml b/ALOps_sys_backend/pom.xml index 6a3d5da9..83d33dc9 100644 --- a/ALOps_sys_backend/pom.xml +++ b/ALOps_sys_backend/pom.xml @@ -119,7 +119,6 @@ ${tomcat.version} - com.alibaba diff --git a/ALOps_sys_fe/alops-ui/.env.development b/ALOps_sys_fe/alops-ui/.env.development index cc67cd89..fb5fbac8 100644 --- a/ALOps_sys_fe/alops-ui/.env.development +++ b/ALOps_sys_fe/alops-ui/.env.development @@ -5,7 +5,7 @@ VUE_APP_TITLE = 中国烟草 ENV = 'development' # 若依管理系统/开发环境 -VUE_APP_BASE_API = '/dev-api' +VUE_APP_BASE_API = 'http://39.102.212.161:8080' # 路由懒加载 VUE_CLI_BABEL_TRANSPILE_MODULES = true diff --git a/ALOps_sys_fe/alops-ui/package.json b/ALOps_sys_fe/alops-ui/package.json index 9d2ddabc..7a122d05 100644 --- a/ALOps_sys_fe/alops-ui/package.json +++ b/ALOps_sys_fe/alops-ui/package.json @@ -7,7 +7,6 @@ "scripts": { "dev": "vue-cli-service serve", "build:prod": "vue-cli-service build", - "build:dev": "vue-cli-service build --mode development", "build:stage": "vue-cli-service build --mode staging", "preview": "node build/index.js --preview" }, diff --git a/ALOps_sys_fe/alops-ui/vue.config.js b/ALOps_sys_fe/alops-ui/vue.config.js index 78f879df..65cd2195 100644 --- a/ALOps_sys_fe/alops-ui/vue.config.js +++ b/ALOps_sys_fe/alops-ui/vue.config.js @@ -9,7 +9,7 @@ const CompressionPlugin = require('compression-webpack-plugin') const name = process.env.VUE_APP_TITLE || '中国烟草运维管理系统' // 网页标题 -const baseUrl = 'http://localhost:8080' // 后端接口 +const baseUrl = 'http://39.102.212.161:8080' // 后端接口 const port = process.env.port || process.env.npm_config_port || 80 // 端口