From 46cc70ac2523afea0476ba25ca947cb0213d7795 Mon Sep 17 00:00:00 2001 From: YYD-YY <2962062657@qq.com> Date: Wed, 24 Sep 2025 19:39:02 +0800 Subject: [PATCH] =?UTF-8?q?9.24=E6=9B=B4=E6=96=B0=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E3=80=81=E8=AE=BE=E5=A4=87=E7=B1=BB=E5=9E=8B=E3=80=81=E5=8E=82?= =?UTF-8?q?=E5=95=86=E3=80=81=E5=8D=95=E5=8F=B0=E3=80=81=E5=A4=9A=E5=8F=B0?= =?UTF-8?q?=E8=AE=BE=E5=A4=87=E4=BF=A1=E6=81=AF=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../equManagement/EquBaseController.java | 86 ++++-- .../equManagement/EquManuController.java | 55 ++-- .../equManagement/EquSupplierController.java | 110 +++++++ .../equManagement/EquTypeController.java | 54 ++-- .../equManagement/EquVlanController.java | 32 +- .../AlertMessageController.java | 39 ++- .../intQuestion/LocalKnowledgeController.java | 29 +- .../tool/EquInterfaceController.java | 28 +- .../controller/tool/EquRoutingController.java | 15 +- .../controller/tool/EquVeneerController.java | 16 +- .../framework/config/SecurityConfig.java | 2 +- ALOps_sys_backend/alops-system/pom.xml | 7 +- .../java/com/alops/system/domain/EquManu.java | 47 ++- .../com/alops/system/domain/EquRouting.java | 10 + .../com/alops/system/domain/EquSupplier.java | 147 +++++++++ .../java/com/alops/system/domain/EquType.java | 30 +- .../com/alops/system/domain/EquVeneer.java | 9 + .../java/com/alops/system/domain/EquVlan.java | 62 +++- .../system/domain/dto/AlertStatisticDto.java | 22 ++ .../system/domain/dto/EquBaseQueryDto.java | 5 +- .../system/domain/dto/EquManuAddDto.java | 66 ++++ .../system/domain/dto/EquManuUpdateDto.java | 72 +++++ .../system/domain/dto/EquTypeAddDto.java | 46 +++ .../system/domain/dto/EquTypeUpdateDto.java | 49 +++ .../system/domain/dto/MonitorHistoryDto.java | 15 + .../system/domain/dto/MonitorLastDto.java | 37 +++ .../system/domain/dto/MonitorListDto.java | 25 ++ .../domain/dto/MonitorStatisticDto.java | 19 ++ .../alops/system/domain/vo/EquMonitorVO.java | 25 ++ .../alops/system/mapper/AlarmRuleMapper.java | 64 ---- .../system/mapper/AlertMessageMapper.java | 14 +- .../alops/system/mapper/EquBaseMapper.java | 12 +- .../system/mapper/EquInterfaceMapper.java | 4 +- .../alops/system/mapper/EquRoutingMapper.java | 3 + .../system/mapper/EquSupplierMapper.java | 63 ++++ .../alops/system/mapper/EquVeneerMapper.java | 2 + .../alops/system/mapper/EquVlanMapper.java | 2 +- .../com/alops/system/mapper/FauStaMapper.java | 65 ---- .../system/service/IAlarmRuleService.java | 62 ---- .../system/service/IAlertMessageService.java | 9 + .../alops/system/service/IEquBaseService.java | 33 +- .../system/service/IEquInterfaceService.java | 2 + .../system/service/IEquRoutingService.java | 2 + .../system/service/IEquSupplierService.java | 61 ++++ .../system/service/IEquVeneerService.java | 1 + .../alops/system/service/IEquVlanService.java | 2 +- .../service/impl/AlarmRuleServiceImpl.java | 98 ------ .../service/impl/AlertMessageServiceImpl.java | 44 +++ .../service/impl/EquBaseServiceImpl.java | 66 +++- .../service/impl/EquInterfaceServiceImpl.java | 7 + .../service/impl/EquManuServiceImpl.java | 8 + .../service/impl/EquRoutingServiceImpl.java | 15 + .../service/impl/EquSupplierServiceImpl.java | 95 ++++++ .../service/impl/EquTypeServiceImpl.java | 5 + .../service/impl/EquVeneerServiceImpl.java | 12 + .../service/impl/EquVlanServiceImpl.java | 12 + .../service/impl/FauStaServiceImpl.java | 94 ------ .../mapper/system/AlarmRuleMapper.xml | 110 ------- .../mapper/system/AlertMessageMapper.xml | 54 +++- .../resources/mapper/system/EquBaseMapper.xml | 204 ++++++++++++- .../mapper/system/EquInterfaceMapper.xml | 9 + .../resources/mapper/system/EquManuMapper.xml | 2 +- .../mapper/system/EquRoutingMapper.xml | 9 + .../mapper/system/EquSupplierMapper.xml | 86 ++++++ .../resources/mapper/system/EquTypeMapper.xml | 11 +- .../mapper/system/EquVeneerMapper.xml | 9 + .../resources/mapper/system/EquVlanMapper.xml | 10 + .../alops-ui/src/api/system/supplier.js | 44 +++ .../src/views/system/supplier/index.vue | 287 ++++++++++++++++++ ALOps_sys_fe/alops-ui/vue.config.js | 2 +- 70 files changed, 2224 insertions(+), 629 deletions(-) create mode 100644 ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquSupplierController.java create mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquSupplier.java create mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/AlertStatisticDto.java create mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/EquManuAddDto.java create mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/EquManuUpdateDto.java create mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/EquTypeAddDto.java create mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/EquTypeUpdateDto.java create mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/MonitorHistoryDto.java create mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/MonitorLastDto.java create mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/MonitorListDto.java create mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/MonitorStatisticDto.java create mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/EquMonitorVO.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlarmRuleMapper.java create mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquSupplierMapper.java delete 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/service/IAlarmRuleService.java create mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquSupplierService.java delete mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlarmRuleServiceImpl.java create mode 100644 ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquSupplierServiceImpl.java delete 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/resources/mapper/system/AlarmRuleMapper.xml create mode 100644 ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquSupplierMapper.xml create mode 100644 ALOps_sys_fe/alops-ui/src/api/system/supplier.js create mode 100644 ALOps_sys_fe/alops-ui/src/views/system/supplier/index.vue 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..a46fc713 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 @@ -5,6 +5,7 @@ import java.util.List; import java.util.Map; import javax.servlet.http.HttpServletResponse; +import com.alops.common.annotation.Anonymous; import com.alops.common.annotation.Log; import com.alops.common.core.controller.BaseController; import com.alops.common.core.domain.AjaxResult; @@ -13,6 +14,9 @@ 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.dto.MonitorListDto; +import com.alops.system.domain.dto.MonitorStatisticDto; +import com.alops.system.domain.vo.EquMonitorVO; import com.alops.system.domain.vo.queryEquBaseVO; import com.alops.system.service.IEquBaseService; import io.swagger.annotations.ApiOperation; @@ -30,12 +34,12 @@ import org.springframework.web.bind.annotation.RestController; /** * 设备基本信息Controller - * + * * @author ruoyi * @date 2025-08-01 */ @RestController -@RequestMapping("/equipment") +@RequestMapping("/device/files") public class EquBaseController extends BaseController { @Autowired @@ -44,7 +48,7 @@ public class EquBaseController extends BaseController /** * 查询设备基本信息列表 */ - @PreAuthorize("@ss.hasPermi('equipment:base:queryByVO')") + @PreAuthorize("@ss.hasPermi('device:files:queryByVO')") @GetMapping("/queryByVO") @ApiOperation("查询符合参数设备信息") public AjaxResult list(EquBaseQueryDto equBaseQueryDto ) { @@ -57,42 +61,57 @@ public class EquBaseController extends BaseController return AjaxResult.success("查询成功", data); } -// @PreAuthorize("@ss.hasPermi('equipment:base:list')") -// @GetMapping("/list") -// public TableDataInfo list(EquBase equBase) -// { -// startPage(); -// List list = equBaseService.selectEquBaseList(equBase); -// return getDataTable(list); -// } + /**查询设备监测信息列表(查询多台显示界面的单独信息)**/ + @PreAuthorize("@ss.hasPermi('device:files:query')") + @GetMapping("/listMonitor") + @ApiOperation("查询设备监测信息列表(查询多台显示界面的单独信息)") + public AjaxResult listMonitorInfo(EquBaseQueryDto equBaseQueryDto) + { + List list = equBaseService.selectEquMonitorList(equBaseQueryDto); + return AjaxResult.success("查询成功", list); + } /** - * 导出设备基本信息列表 + * 获取设备最新时间的历史监控信息 + * @param id 查询对象,包含设备ID、开始时间和结束时间 */ -// @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('device:files:query')") + @GetMapping(value = "/latest/{id}") // URL清晰地表达了意图:获取历史监控信息 + @ApiOperation("获取设备最新时间的历史监控信息") + @Anonymous + public AjaxResult getLastInfo(@PathVariable("id") String id) // 方法名也更清晰 + { + // 调用职责单一的 Service 方法 + return success(equBaseService.selectLatestEquMonitorInfo(id)); + } + /** + * 获取设备指定时间段内的历史监控信息 + * @param equBaseQueryDto 查询对象,包含设备ID、开始时间和结束时间 + */ + @PreAuthorize("@ss.hasPermi('device:files:query')") + @GetMapping(value = "/history") // URL清晰地表达了意图:获取历史监控信息 + @ApiOperation("获取设备指定时间段内的历史监控信息") + @Anonymous + public AjaxResult getHistoricalInfo(EquBaseQueryDto equBaseQueryDto) { + // 这里直接返回单个对象,而不是List + return success(equBaseService.selectHistoricalEquMonitorInfo(equBaseQueryDto)); + } /** - * 获取设备基本信息详细信息 + * 统计设备监测信息列表 - 按设备类型分类 */ - @PreAuthorize("@ss.hasPermi('equipment:base:query')") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") String id) - { - return success(equBaseService.selectEquBaseById(id)); + @PreAuthorize("@ss.hasPermi('device:files:statistic')") + @GetMapping("/byEquType") + @ApiOperation("按设备类型分类统计设备信息") + public AjaxResult listMonitorInfoByType() { + List list = equBaseService.selectEquStatisticByType(); + return AjaxResult.success("查询成功", list); } /** * 新增设备基本信息 */ - @PreAuthorize("@ss.hasPermi('equipment:base:add')") + @PreAuthorize("@ss.hasPermi('device:files:add')") @Log(title = "设备档案", businessType = BusinessType.INSERT) @PostMapping("/add") @ApiOperation("新增设备信息") @@ -104,20 +123,23 @@ public class EquBaseController extends BaseController /** * 修改设备基本信息 */ - @PreAuthorize("@ss.hasPermi('equipment:base:edit')") + @PreAuthorize("@ss.hasPermi('device:files:modify')") @Log(title = "设备档案", businessType = BusinessType.UPDATE) - @PutMapping + @PutMapping("/modify") + @ApiOperation("修改设备信息") public AjaxResult edit(@RequestBody EquBase equBase) { return toAjax(equBaseService.updateEquBase(equBase)); } + /** * 删除设备基本信息 */ - @PreAuthorize("@ss.hasPermi('equipment:base:remove')") + @PreAuthorize("@ss.hasPermi('device:files:delete')") @Log(title = "设备档案", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") + @DeleteMapping("/{ids}") + @ApiOperation("删除设备信息") public AjaxResult remove(@PathVariable String[] ids) { return toAjax(equBaseService.deleteEquBaseByIds(ids)); diff --git a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquManuController.java b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquManuController.java index 3f548e76..f04873cb 100644 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquManuController.java +++ b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquManuController.java @@ -1,4 +1,5 @@ package com.alops.web.controller.equManagement; +import com.alops.system.domain.dto.EquManuAddDto; import java.util.List; import javax.servlet.http.HttpServletResponse; @@ -10,7 +11,9 @@ 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.EquManu; +import com.alops.system.domain.dto.EquManuUpdateDto; import com.alops.system.service.IEquManuService; +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; @@ -25,12 +28,12 @@ import org.springframework.web.bind.annotation.RestController; /** * 设备厂商管理Controller - * + * * @author ruoyi * @date 2025-08-01 */ @RestController -@RequestMapping("/system/manu") +@RequestMapping("/deviceManu") public class EquManuController extends BaseController { @Autowired @@ -39,8 +42,9 @@ public class EquManuController extends BaseController /** * 查询设备厂商管理列表 */ - @PreAuthorize("@ss.hasPermi('system:manu:list')") - @GetMapping("/list") + @PreAuthorize("@ss.hasPermi('device:deviceManu:queryByVO')") + @GetMapping("/queryByVO") + @ApiOperation("查询设备厂商管理列表") public TableDataInfo list(EquManu equManu) { startPage(); @@ -51,7 +55,7 @@ public class EquManuController extends BaseController /** * 导出设备厂商管理列表 */ - @PreAuthorize("@ss.hasPermi('system:manu:export')") + @PreAuthorize("@ss.hasPermi('device:deviceManu:export')") @Log(title = "设备厂商管理", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, EquManu equManu) @@ -64,7 +68,7 @@ public class EquManuController extends BaseController /** * 获取设备厂商管理详细信息 */ - @PreAuthorize("@ss.hasPermi('system:manu:query')") + @PreAuthorize("@ss.hasPermi('device:deviceManu:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") String id) { @@ -74,31 +78,46 @@ public class EquManuController extends BaseController /** * 新增设备厂商管理 */ - @PreAuthorize("@ss.hasPermi('system:manu:add')") + @PreAuthorize("@ss.hasPermi('device:deviceManu:add')") @Log(title = "设备厂商管理", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody EquManu equManu) - { + @PostMapping("/add") + @ApiOperation("新增设备厂商管理列表") + public AjaxResult addByVo(@RequestBody EquManuAddDto dto) { + if (dto == null) { + return AjaxResult.error("请求参数为空"); + } + + EquManu equManu = EquManu.fromDto(dto); return toAjax(equManuService.insertEquManu(equManu)); } - /** * 修改设备厂商管理 */ - @PreAuthorize("@ss.hasPermi('system:manu:edit')") + @PreAuthorize("@ss.hasPermi('device:deviceManu:modify')") @Log(title = "设备厂商管理", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody EquManu equManu) - { + @PutMapping("/modify") + @ApiOperation("修改设备厂商管理列表") + public AjaxResult edit(@RequestBody EquManuUpdateDto dto) { + EquManu equManu = new EquManu(); + equManu.setId(dto.getId()); + equManu.setName(dto.getName()); + equManu.setDescription(dto.getDescription()); + equManu.setContactBy(dto.getContactBy()); + equManu.setContactWay(dto.getContactWay()); + if (dto.getStatus() != null) { + equManu.setStatus(dto.getStatus().longValue()); + } + + // ⚠️ 注意:不要更新 createBy 和 createDate return toAjax(equManuService.updateEquManu(equManu)); } - /** * 删除设备厂商管理 */ - @PreAuthorize("@ss.hasPermi('system:manu:remove')") + @PreAuthorize("@ss.hasPermi('device:deviceManu:delete')") @Log(title = "设备厂商管理", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") + @DeleteMapping("/{ids}") + @ApiOperation("删除设备厂商管理列表") public AjaxResult remove(@PathVariable String[] ids) { return toAjax(equManuService.deleteEquManuByIds(ids)); diff --git a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquSupplierController.java b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquSupplierController.java new file mode 100644 index 00000000..f2db9ecd --- /dev/null +++ b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquSupplierController.java @@ -0,0 +1,110 @@ +package com.alops.web.controller.equManagement; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +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; +import com.alops.common.annotation.Log; +import com.alops.common.core.controller.BaseController; +import com.alops.common.core.domain.AjaxResult; +import com.alops.common.enums.BusinessType; +import com.alops.system.domain.EquSupplier; +import com.alops.system.service.IEquSupplierService; +import com.alops.common.utils.poi.ExcelUtil; +import com.alops.common.core.page.TableDataInfo; + +/** + * 供应商功能Controller + * + * @author ruoyi + * @date 2025-09-20 + */ +@RestController +@RequestMapping("/device/supplier") +public class EquSupplierController extends BaseController +{ + @Autowired + private IEquSupplierService equSupplierService; + + /** + * 查询供应商功能信息列表 + */ + @PreAuthorize("@ss.hasPermi('device:supplier:query')") + @GetMapping("/query") + @ApiOperation("查询供应商功能信息列表") + public TableDataInfo list(EquSupplier equSupplier) + { + startPage(); + List list = equSupplierService.selectEquSupplierList(equSupplier); + return getDataTable(list); + } + + /** + * 导出供应商功能信息列表 + */ + @PreAuthorize("@ss.hasPermi('device:supplier:export')") + @Log(title = "供应商功能信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, EquSupplier equSupplier) + { + List list = equSupplierService.selectEquSupplierList(equSupplier); + ExcelUtil util = new ExcelUtil(EquSupplier.class); + util.exportExcel(response, list, "【请填写功能名称】数据"); + } + + /** + * 获取供应商功能信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('device:supplier:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") String id) + { + return success(equSupplierService.selectEquSupplierById(id)); + } + + /** + * 新增供应商功能信息 + */ + @PreAuthorize("@ss.hasPermi('device:supplier:add')") + @Log(title = "供应商功能信息", businessType = BusinessType.INSERT) + @PostMapping + @ApiOperation("新增供应商功能信息列表") + public AjaxResult add(@RequestBody EquSupplier equSupplier) + { + return toAjax(equSupplierService.insertEquSupplier(equSupplier)); + } + + /** + * 修改供应商功能信息 + */ + @PreAuthorize("@ss.hasPermi('device:supplier:edit')") + @Log(title = "供应商功能信息", businessType = BusinessType.UPDATE) + @PutMapping + @ApiOperation("修改供应商功能信息列表") + public AjaxResult edit(@RequestBody EquSupplier equSupplier) + { + return toAjax(equSupplierService.updateEquSupplier(equSupplier)); + } + + /** + * 删除供应商功能信息 + */ + @PreAuthorize("@ss.hasPermi('device:supplier:delete')") + @Log(title = "供应商功能信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + @ApiOperation("删除供应商功能信息列表") + public AjaxResult remove(@PathVariable String[] ids) + { + return toAjax(equSupplierService.deleteEquSupplierByIds(ids)); + } +} diff --git a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquTypeController.java b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquTypeController.java index d03a8c5f..ff62c70d 100644 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquTypeController.java +++ b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/equManagement/EquTypeController.java @@ -10,7 +10,10 @@ 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.EquType; +import com.alops.system.domain.dto.EquTypeAddDto; +import com.alops.system.domain.dto.EquTypeUpdateDto; import com.alops.system.service.IEquTypeService; +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; @@ -25,12 +28,12 @@ import org.springframework.web.bind.annotation.RestController; /** * 设备类型管理Controller - * + * * @author ruoyi * @date 2025-08-01 */ @RestController -@RequestMapping("/system/type") +@RequestMapping("/device/deviceType") public class EquTypeController extends BaseController { @Autowired @@ -39,8 +42,9 @@ public class EquTypeController extends BaseController /** * 查询设备类型管理列表 */ - @PreAuthorize("@ss.hasPermi('system:type:list')") - @GetMapping("/list") + @PreAuthorize("@ss.hasPermi('device:deviceType:query')") + @GetMapping("/query") + @ApiOperation("查询设备类型管理列表") public TableDataInfo list(EquType equType) { startPage(); @@ -51,7 +55,7 @@ public class EquTypeController extends BaseController /** * 导出设备类型管理列表 */ - @PreAuthorize("@ss.hasPermi('system:type:export')") + @PreAuthorize("@ss.hasPermi('device:deviceType:export')") @Log(title = "设备类型管理", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, EquType equType) @@ -64,41 +68,55 @@ public class EquTypeController extends BaseController /** * 获取设备类型管理详细信息 */ - @PreAuthorize("@ss.hasPermi('system:type:query')") + @PreAuthorize("@ss.hasPermi('device:deviceType:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") String id) { return success(equTypeService.selectEquTypeById(id)); } + + /** * 新增设备类型管理 */ - @PreAuthorize("@ss.hasPermi('system:type:add')") + @PreAuthorize("@ss.hasPermi('device:deviceType:add')") @Log(title = "设备类型管理", businessType = BusinessType.INSERT) - @PostMapping - public AjaxResult add(@RequestBody EquType equType) - { + @PostMapping("/add") + @ApiOperation("新增设备类型管理列表") + public AjaxResult add(@RequestBody EquTypeAddDto dto) { + if (dto == null) { + return AjaxResult.error("请求参数为空"); + } + + EquType equType = EquType.fromDto(dto); + return toAjax(equTypeService.insertEquType(equType)); } - /** * 修改设备类型管理 */ - @PreAuthorize("@ss.hasPermi('system:type:edit')") + @PreAuthorize("@ss.hasPermi('device:deviceType:modify')") @Log(title = "设备类型管理", businessType = BusinessType.UPDATE) - @PutMapping - public AjaxResult edit(@RequestBody EquType equType) - { + @PutMapping("/modify") + @ApiOperation("修改设备类型管理列表") + public AjaxResult edit(@RequestBody EquTypeUpdateDto dto) { + EquType equType = new EquType(); + equType.setId(dto.getId()); + equType.setName(dto.getName()); + equType.setDescription(dto.getDescription()); + equType.setImage(dto.getImage()); + // ⚠️ 不修改 createBy 和 createDate,保持原值 + return toAjax(equTypeService.updateEquType(equType)); } - /** * 删除设备类型管理 */ - @PreAuthorize("@ss.hasPermi('system:type:remove')") + @PreAuthorize("@ss.hasPermi('device:deviceType:delete')") @Log(title = "设备类型管理", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") + @DeleteMapping("/{ids}") + @ApiOperation("删除设备类型管理列表") public AjaxResult remove(@PathVariable String[] ids) { return toAjax(equTypeService.deleteEquTypeByIds(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 index 1067a1e8..7ef7429e 100644 --- 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 @@ -11,6 +11,7 @@ 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 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; @@ -23,13 +24,13 @@ import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; /** - * 【请填写功能名称】Controller + * EquVlanController * * @author ruoyi * @date 2025-08-15 */ @RestController -@RequestMapping("/system/vlan") +@RequestMapping("/device/vlan") public class EquVlanController extends BaseController { @Autowired @@ -38,8 +39,8 @@ public class EquVlanController extends BaseController /** * 查询【请填写功能名称】列表 */ - @PreAuthorize("@ss.hasPermi('system:vlan:list')") - @GetMapping("/list") + @PreAuthorize("@ss.hasPermi('device:vlan:query')") + @GetMapping("/query") public TableDataInfo list(EquVlan equVlan) { startPage(); @@ -47,10 +48,23 @@ public class EquVlanController extends BaseController return getDataTable(list); } + /** + * 查询单台的vlan信息列表 + */ + @PreAuthorize("@ss.hasPermi('device:vlan:queryByEquId')") + @GetMapping("/ByEquId/{equId}") + @ApiOperation("获取界面Vlan信息") + public TableDataInfo listByEquId(@PathVariable("equId") String equId) + { + startPage(); + List list = equVlanService.selectEquVlanListByEquId(equId); + return getDataTable(list); + } + /** * 导出【请填写功能名称】列表 */ - @PreAuthorize("@ss.hasPermi('system:vlan:export')") + @PreAuthorize("@ss.hasPermi('device:vlan:export')") @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, EquVlan equVlan) @@ -63,7 +77,7 @@ public class EquVlanController extends BaseController /** * 获取【请填写功能名称】详细信息 */ - @PreAuthorize("@ss.hasPermi('system:vlan:query')") + @PreAuthorize("@ss.hasPermi('device:vlan:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") String id) { @@ -73,7 +87,7 @@ public class EquVlanController extends BaseController /** * 新增【请填写功能名称】 */ - @PreAuthorize("@ss.hasPermi('system:vlan:add')") + @PreAuthorize("@ss.hasPermi('device:vlan:add')") @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT) @PostMapping public AjaxResult add(@RequestBody EquVlan equVlan) @@ -84,7 +98,7 @@ public class EquVlanController extends BaseController /** * 修改【请填写功能名称】 */ - @PreAuthorize("@ss.hasPermi('system:vlan:edit')") + @PreAuthorize("@ss.hasPermi('device:vlan:edit')") @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE) @PutMapping public AjaxResult edit(@RequestBody EquVlan equVlan) @@ -95,7 +109,7 @@ public class EquVlanController extends BaseController /** * 删除【请填写功能名称】 */ - @PreAuthorize("@ss.hasPermi('system:vlan:remove')") + @PreAuthorize("@ss.hasPermi('device:vlan:delete')") @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE) @DeleteMapping("/{ids}") public AjaxResult remove(@PathVariable String[] 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/AlertMessageController.java index 091f3b6e..0921528d 100644 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertMessageController.java +++ b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/exceptionController/AlertMessageController.java @@ -10,7 +10,11 @@ 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.domain.AlertRule; +import com.alops.system.domain.EquInterface; +import com.alops.system.domain.dto.AlertStatisticDto; import com.alops.system.service.IAlertMessageService; +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; @@ -35,9 +39,6 @@ public class AlertMessageController extends BaseController @Autowired private IAlertMessageService alertMessageService; - - - /** * 查询预警信息统计列表 */ @@ -50,6 +51,33 @@ public class AlertMessageController extends BaseController return getDataTable(list); } + + /** + * 查询界面预警信息+++ + */ + @PreAuthorize("@ss.hasPermi('inMonitoring:alertMessage:listByEquId')") + @GetMapping("/{equId}") + @ApiOperation("获取界面ALlertMessage信息") + public TableDataInfo listByEquId(@PathVariable("equId")Long equId) + { + startPage(); + List list = alertMessageService.selectAlertMessageListByEquId(equId); + return getDataTable(list); + } + + + /** + * 统计预警次数信息 + */ + @PreAuthorize("@ss.hasPermi('inMonitoring:alertMessage:statistic')") + @GetMapping("/times") + @ApiOperation("统计预警次数信息") + public AjaxResult getAlertStatistic() { + AlertStatisticDto dto = alertMessageService.statisticAlert(); + return AjaxResult.success(dto); + } + + /** * 导出 预警信息列表 */ @@ -67,12 +95,13 @@ public class AlertMessageController extends BaseController * 获取预警信息 */ @PreAuthorize("@ss.hasPermi('system:message:query')") - @GetMapping(value = "/{id}") - public AjaxResult getInfo(@PathVariable("id") Long id) + @GetMapping(value = "/query") + public AjaxResult getInfo(Long id) { return success(alertMessageService.selectAlertMessageById(id)); } + /** * 新增预警信息 */ diff --git a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/intQuestion/LocalKnowledgeController.java b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/intQuestion/LocalKnowledgeController.java index a23b786a..4b8f052e 100644 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/intQuestion/LocalKnowledgeController.java +++ b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/intQuestion/LocalKnowledgeController.java @@ -11,6 +11,7 @@ import com.alops.common.enums.BusinessType; import com.alops.common.utils.poi.ExcelUtil; import com.alops.system.domain.LocalKnowledge; import com.alops.system.service.ILocalKnowledgeService; +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; @@ -25,12 +26,12 @@ import org.springframework.web.bind.annotation.RestController; /** * 专家知识库Controller - * + * * @author ruoyi * @date 2025-08-01 */ @RestController -@RequestMapping("/system/knowledge") +@RequestMapping("/knowBase") public class LocalKnowledgeController extends BaseController { @Autowired @@ -39,8 +40,9 @@ public class LocalKnowledgeController extends BaseController /** * 查询专家知识库列表 */ - @PreAuthorize("@ss.hasPermi('system:knowledge:list')") - @GetMapping("/list") + @PreAuthorize("@ss.hasPermi('intelligent:knowledge:query')") + @GetMapping("/query") + @ApiOperation("查询专家知识库列表") public TableDataInfo list(LocalKnowledge localKnowledge) { startPage(); @@ -51,7 +53,7 @@ public class LocalKnowledgeController extends BaseController /** * 导出专家知识库列表 */ - @PreAuthorize("@ss.hasPermi('system:knowledge:export')") + @PreAuthorize("@ss.hasPermi('intelligent:knowledge:export')") @Log(title = "专家知识库", businessType = BusinessType.EXPORT) @PostMapping("/export") public void export(HttpServletResponse response, LocalKnowledge localKnowledge) @@ -64,7 +66,7 @@ public class LocalKnowledgeController extends BaseController /** * 获取专家知识库详细信息 */ - @PreAuthorize("@ss.hasPermi('system:knowledge:query')") + @PreAuthorize("@ss.hasPermi('intelligent:knowledge:query')") @GetMapping(value = "/{id}") public AjaxResult getInfo(@PathVariable("id") Long id) { @@ -74,9 +76,10 @@ public class LocalKnowledgeController extends BaseController /** * 新增专家知识库 */ - @PreAuthorize("@ss.hasPermi('system:knowledge:add')") + @PreAuthorize("@ss.hasPermi('intelligent:knowledge:add')") @Log(title = "专家知识库", businessType = BusinessType.INSERT) - @PostMapping + @PostMapping("/add") + @ApiOperation("新增专家知识库列表") public AjaxResult add(@RequestBody LocalKnowledge localKnowledge) { return toAjax(localKnowledgeService.insertLocalKnowledge(localKnowledge)); @@ -85,9 +88,10 @@ public class LocalKnowledgeController extends BaseController /** * 修改专家知识库 */ - @PreAuthorize("@ss.hasPermi('system:knowledge:edit')") + @PreAuthorize("@ss.hasPermi('intelligent:knowledge:modify')") @Log(title = "专家知识库", businessType = BusinessType.UPDATE) - @PutMapping + @PutMapping("/modify") + @ApiOperation("修改专家知识库列表") public AjaxResult edit(@RequestBody LocalKnowledge localKnowledge) { return toAjax(localKnowledgeService.updateLocalKnowledge(localKnowledge)); @@ -96,9 +100,10 @@ public class LocalKnowledgeController extends BaseController /** * 删除专家知识库 */ - @PreAuthorize("@ss.hasPermi('system:knowledge:remove')") + @PreAuthorize("@ss.hasPermi('intelligent:knowledge:delete')") @Log(title = "专家知识库", businessType = BusinessType.DELETE) - @DeleteMapping("/{ids}") + @DeleteMapping("/{ids}") + @ApiOperation("删除专家知识库列表") public AjaxResult remove(@PathVariable Long[] ids) { return toAjax(localKnowledgeService.deleteLocalKnowledgeByIds(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 index 8f67a044..99e8d4e0 100644 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquInterfaceController.java +++ b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquInterfaceController.java @@ -11,6 +11,7 @@ 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 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; @@ -46,7 +47,17 @@ public class EquInterfaceController extends BaseController List list = equInterfaceService.selectEquInterfaceList(equInterface); return getDataTable(list); } - + /** + * 查询界面详细信息--- + */ + // @PreAuthorize("@ss.hasPermi('system:interface:list')") + //@GetMapping("/list") + // public TableDataInfo listByEquID(String equID) + // { + // startPage(); + // List list = equInterfaceService.selectEquInterfaceListByEquID(equID); + // return getDataTable(list); + // } /** * 导出端口运行状态列表 */ @@ -64,12 +75,25 @@ public class EquInterfaceController extends BaseController * 获取端口运行状态详细信息 */ @PreAuthorize("@ss.hasPermi('system:interface:query')") - @GetMapping(value = "/{id}") + @GetMapping(value = "/query/{id}") public AjaxResult getInfo(@PathVariable("id") String id) { return success(equInterfaceService.selectEquInterfaceById(id)); } + /** + * 查询界面详细信息---- + */ + @PreAuthorize("@ss.hasPermi('device:interface:listByEquId')") + @GetMapping("/{equID}") + @ApiOperation("获取界面Interface接口信息") + public TableDataInfo listByEquID(@PathVariable("equID") String equID) + { + startPage(); + List list = equInterfaceService.selectEquInterfaceListByEquID(equID); + return getDataTable(list); + } + /** * 新增端口运行状态 */ diff --git a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquRoutingController.java b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquRoutingController.java index fe1d8d1f..67abccbb 100644 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquRoutingController.java +++ b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquRoutingController.java @@ -11,6 +11,7 @@ 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 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; @@ -47,6 +48,18 @@ public class EquRoutingController extends BaseController return getDataTable(list); } + /** + * 查询路由界面详细信息+++ + */ + @PreAuthorize("@ss.hasPermi('device:routing:listByEquId')") + @GetMapping("/{equId}") + @ApiOperation("获取界面Routing信息") + public TableDataInfo listByEquId(@PathVariable("equId") String equId) + { + startPage(); + List list = equRoutingService.selectEquRoutingListByEquId(equId); + return getDataTable(list); + } /** * 导出路由信息列表 */ @@ -64,7 +77,7 @@ public class EquRoutingController extends BaseController * 获取路由信息详细信息 */ @PreAuthorize("@ss.hasPermi('system:routing:query')") - @GetMapping(value = "/{id}") + @GetMapping(value = "/query/{id}") public AjaxResult getInfo(@PathVariable("id") String id) { return success(equRoutingService.selectEquRoutingById(id)); diff --git a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquVeneerController.java b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquVeneerController.java index 969f5c02..a63fc5b7 100644 --- a/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquVeneerController.java +++ b/ALOps_sys_backend/alops-admin/src/main/java/com/alops/web/controller/tool/EquVeneerController.java @@ -11,6 +11,7 @@ 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 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; @@ -47,6 +48,19 @@ public class EquVeneerController extends BaseController return getDataTable(list); } + /** + * 查询界面信息+++ + */ + @PreAuthorize("@ss.hasPermi('device:veneer:listByEquId')") + @GetMapping("/{equID}") + @ApiOperation("获取界面Venerr信息") + public TableDataInfo listByEquId(@PathVariable("equID") String equID) + { + startPage(); + List list = equVeneerService.selectEquVeneerListByEquId(equID); + return getDataTable(list); + } + /** * 导出【请填写功能名称】列表 */ @@ -64,7 +78,7 @@ public class EquVeneerController extends BaseController * 获取【请填写功能名称】详细信息 */ @PreAuthorize("@ss.hasPermi('system:veneer:query')") - @GetMapping(value = "/{id}") + @GetMapping(value = "/query/{id}") public AjaxResult getInfo(@PathVariable("id") String id) { return success(equVeneerService.selectEquVeneerById(id)); diff --git a/ALOps_sys_backend/alops-framework/src/main/java/com/alops/framework/config/SecurityConfig.java b/ALOps_sys_backend/alops-framework/src/main/java/com/alops/framework/config/SecurityConfig.java index 4b15c597..58059c7e 100644 --- a/ALOps_sys_backend/alops-framework/src/main/java/com/alops/framework/config/SecurityConfig.java +++ b/ALOps_sys_backend/alops-framework/src/main/java/com/alops/framework/config/SecurityConfig.java @@ -114,7 +114,7 @@ public class SecurityConfig requests.antMatchers("/login", "/register", "/captchaImage").permitAll() // 静态资源,可匿名访问 .antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**").permitAll() - .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**").permitAll() + .antMatchers("/swagger-ui.html", "/swagger-resources/**", "/webjars/**", "/*/api-docs", "/druid/**","/swagger-ui/**").permitAll() // 除上面外的所有请求全部需要鉴权认证 .anyRequest().authenticated(); }) diff --git a/ALOps_sys_backend/alops-system/pom.xml b/ALOps_sys_backend/alops-system/pom.xml index a09b3f2e..c0a7e980 100644 --- a/ALOps_sys_backend/alops-system/pom.xml +++ b/ALOps_sys_backend/alops-system/pom.xml @@ -36,7 +36,12 @@ spring-boot-starter-mail 2.5.15 - + + io.swagger + swagger-annotations + 1.6.2 + compile + diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquManu.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquManu.java index cec17ff2..c514d6b6 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquManu.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquManu.java @@ -1,10 +1,12 @@ package com.alops.system.domain; +import com.alops.system.domain.dto.EquManuAddDto; import java.util.Date; import com.alops.common.annotation.Excel; import com.alops.common.core.domain.BaseEntity; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -14,7 +16,7 @@ import org.apache.commons.lang3.builder.ToStringStyle; * @author ruoyi * @date 2025-08-01 */ -public class EquManu extends BaseEntity +public class EquManu { private static final long serialVersionUID = 1L; @@ -31,21 +33,47 @@ public class EquManu extends BaseEntity /** 联系人ID */ @Excel(name = "联系人ID") - private Long contactBy; + private String contactBy; /** 联系方式 */ @Excel(name = "联系方式") private String contactWay; /** 添加日期 */ + //@JsonIgnore @JsonFormat(pattern = "yyyy-MM-dd") - @Excel(name = "添加日期", width = 30, dateFormat = "yyyy-MM-dd") + @Excel(name = "添加日期", width = 30, dateFormat = "yyyy-MM-dd") private Date createDate; /** 状态(0-禁用,1-启用) */ @Excel(name = "状态(0-禁用,1-启用)") private Long status; + //@JsonIgnore + private String createBy; // 新增 + + public EquManu() {} + + public static EquManu fromDto(EquManuAddDto dto) { + if (dto == null) { + return null; + } + + EquManu equManu = new EquManu(); + + if (dto.getContactBy() != null) { + equManu.setContactBy(dto.getContactBy()); + } + equManu.setContactWay(dto.getContactWay()); + equManu.setDescription(dto.getDescription()); + equManu.setName(dto.getName()); + if (dto.getStatus() != null) { + equManu.setStatus(dto.getStatus().longValue()); + } + + return equManu; + } + public void setId(String id) { this.id = id; @@ -76,12 +104,12 @@ public class EquManu extends BaseEntity return description; } - public void setContactBy(Long contactBy) + public void setContactBy(String contactBy) { this.contactBy = contactBy; } - public Long getContactBy() + public String getContactBy() { return contactBy; } @@ -116,6 +144,14 @@ public class EquManu extends BaseEntity return status; } + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) @@ -129,4 +165,5 @@ public class EquManu extends BaseEntity .append("status", getStatus()) .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 index 96b9d1c0..c94f9dce 100644 --- 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 @@ -20,6 +20,8 @@ public class EquRouting extends BaseEntity /** 主键 */ private String id; + private String equId; + /** 设备采集id */ @Excel(name = "设备采集id") private String equGatherId; @@ -46,6 +48,14 @@ public class EquRouting extends BaseEntity return id; } + public String getEquId() { + return equId; + } + + public void setEquId(String equId) { + this.equId = equId; + } + public void setEquGatherId(String equGatherId) { this.equGatherId = equGatherId; diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquSupplier.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquSupplier.java new file mode 100644 index 00000000..38c94f31 --- /dev/null +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquSupplier.java @@ -0,0 +1,147 @@ +package com.alops.system.domain; + +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.alops.common.annotation.Excel; +import com.alops.common.core.domain.BaseEntity; + +import java.util.Date; + +/** + * 供应商功能 对象 equ_supplier + * + * @author ruoyi + * @date 2025-09-20 + */ +public class EquSupplier +{ + private static final long serialVersionUID = 1L; + + /** 供应商id */ + private String id; + + /** 供应商名称 */ + @Excel(name = "供应商名称") + private String name; + + /** 供应商简介 */ + @Excel(name = "供应商简介") + private String description; + + /** 联系人姓名 */ + @Excel(name = "联系人姓名") + private String contactBy; + + /** l联系方式 */ + @Excel(name = "l联系方式") + private String contactWay; + + /** 状态(0禁1启用) */ + @Excel(name = "状态", readConverterExp = "0=禁1启用") + private Long status; + + /** 创建者 */ + private String createBy; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + + 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 setDescription(String description) + { + this.description = description; + } + + public String getDescription() + { + return description; + } + + public void setContactBy(String contactBy) + { + this.contactBy = contactBy; + } + + public String getContactBy() + { + return contactBy; + } + + public void setContactWay(String contactWay) + { + this.contactWay = contactWay; + } + + public String getContactWay() + { + return contactWay; + } + + public void setStatus(Long status) + { + this.status = status; + } + + public Long getStatus() + { + return status; + } + + public String getCreateBy() + { + return createBy; + } + + public void setCreateBy(String createBy) + { + this.createBy = createBy; + } + + public Date getCreateTime() + { + return createTime; + } + + public void setCreateTime(Date createTime) + { + this.createTime = createTime; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("name", getName()) + .append("description", getDescription()) + .append("contactBy", getContactBy()) + .append("contactWay", getContactWay()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("status", getStatus()) + .toString(); + } + + +} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquType.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquType.java index ebe585c3..110d5090 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquType.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/EquType.java @@ -5,6 +5,8 @@ import java.util.Date; import com.alops.common.annotation.Excel; import com.alops.common.core.domain.BaseEntity; import com.fasterxml.jackson.annotation.JsonFormat; +import com.fasterxml.jackson.annotation.JsonIgnore; +import lombok.Data; import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringStyle; @@ -14,7 +16,8 @@ import org.apache.commons.lang3.builder.ToStringStyle; * @author ruoyi * @date 2025-08-01 */ -public class EquType extends BaseEntity +@Data +public class EquType { private static final long serialVersionUID = 1L; @@ -34,10 +37,25 @@ public class EquType extends BaseEntity private String image; /** 添加日期 */ + //@JsonIgnore @JsonFormat(pattern = "yyyy-MM-dd") @Excel(name = "添加日期", width = 30, dateFormat = "yyyy-MM-dd") private Date createDate; + //@JsonIgnore + private String createBy; + + public EquType() {} + + // DTO → Entity 显式转换方法 + public static EquType fromDto(com.alops.system.domain.dto.EquTypeAddDto dto) { + EquType equType = new EquType(); + equType.setDescription(dto.getDescription()); + equType.setImage(dto.getImage()); + equType.setName(dto.getName()); + return equType; + } + public void setId(String id) { this.id = id; @@ -88,7 +106,15 @@ public class EquType extends BaseEntity return createDate; } - @Override + public String getCreateBy() { + return createBy; + } + + public void setCreateBy(String createBy) { + this.createBy = createBy; + } + + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) .append("id", getId()) 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 index 23bd8554..022c8d1e 100644 --- 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 @@ -23,6 +23,7 @@ public class EquVeneer extends BaseEntity /** 设备的一个单板的运行id */ @Excel(name = "设备的一个单板的运行id") private String veneerId; + private String equId; /** 单板运行状态校准值(Online/Offline/Fault) */ @Excel(name = "单板运行状态校准值", readConverterExp = "O=nline/Offline/Fault") @@ -42,6 +43,14 @@ public class EquVeneer extends BaseEntity return id; } + public String getEquId() { + return equId; + } + + public void setEquId(String equId) { + this.equId = equId; + } + public void setVeneerId(String veneerId) { this.veneerId = veneerId; 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 index f7bfaae9..6b529981 100644 --- 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 @@ -2,24 +2,31 @@ package com.alops.system.domain; import com.alops.common.annotation.Excel; 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; +import java.util.Date; + /** - * 【请填写功能名称】对象 equ_vlan + * 对象 equ_vlan * * @author ruoyi * @date 2025-08-15 */ -public class EquVlan extends BaseEntity +public class EquVlan { private static final long serialVersionUID = 1L; /** 主键 */ private String id; + /** 设备id */ + @Excel(name = "设备id") + private String equId; + /** 采集ID */ @Excel(name = "采集ID") private String equGatherId; @@ -40,6 +47,16 @@ public class EquVlan extends BaseEntity @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") private String vlanId; + /** 创建者 */ + private String createBy; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + /** 更新者 */ + private String updateBy; + public void setId(String id) { this.id = id; @@ -49,6 +66,15 @@ public class EquVlan extends BaseEntity { return id; } + public void setEquId(String equId) + { + this.equId = equId; + } + + public String getEquId() + { + return equId; + } public void setEquGatherId(String equGatherId) { @@ -100,6 +126,38 @@ public class EquVlan extends BaseEntity return vlanId; } + + public String getCreateBy() + { + return createBy; + } + + public void setCreateBy(String createBy) + { + this.createBy = createBy; + } + + public Date getCreateTime() + { + return createTime; + } + + public void setCreateTime(Date createTime) + { + this.createTime = createTime; + } + + public String getUpdateBy() + { + return updateBy; + } + + public void setUpdateBy(String updateBy) + { + this.updateBy = updateBy; + } + + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/AlertStatisticDto.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/AlertStatisticDto.java new file mode 100644 index 00000000..3fe6246c --- /dev/null +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/AlertStatisticDto.java @@ -0,0 +1,22 @@ +package com.alops.system.domain.dto; + +import lombok.Data; +import java.util.Map; + +/** + * 预警统计 DTO + */ +@Data +public class AlertStatisticDto { + // 按设备类型统计 + private Map typeCount; + + // 按等级统计 + private Map levelCount; + + // 本年度预警次数 + private Integer yearCount; + + // 本月预警次数 + private Integer monthCount; +} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/EquBaseQueryDto.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/EquBaseQueryDto.java index 99343bc8..dd511332 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/EquBaseQueryDto.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/EquBaseQueryDto.java @@ -1,6 +1,7 @@ package com.alops.system.domain.dto; import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; import java.io.Serializable; import java.util.Date; @@ -9,10 +10,13 @@ import java.util.Date; /** * 设备查询条件 DTO */ +@Data public class EquBaseQueryDto implements Serializable { private static final long serialVersionUID = 1L; + private String id; + /** 设备类型 (equ_type, varchar) */ private String equType; @@ -41,7 +45,6 @@ public class EquBaseQueryDto implements Serializable { /** 状态 (status, tinyint) */ private Integer status; - // ====== Getter 和 Setter ====== public String getEquType() { return equType; diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/EquManuAddDto.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/EquManuAddDto.java new file mode 100644 index 00000000..43a6bc79 --- /dev/null +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/EquManuAddDto.java @@ -0,0 +1,66 @@ +package com.alops.system.domain.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel("设备厂商新增DTO") +public class EquManuAddDto { + + @ApiModelProperty("厂商名称") + private String name; + + @ApiModelProperty("厂商描述") + private String description; + + @ApiModelProperty("联系人名称") + private String contactBy ; + + @ApiModelProperty("联系人方式,") + private String contactWay ; + + @ApiModelProperty("状态") + private Integer status = 1; + + // ===== Getter & Setter ===== + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getContactBy() { + return contactBy; + } + + public void setContactBy(String contactBy) { + this.contactBy = contactBy; + } + + public String getContactWay() { + return contactWay; + } + + public void setContactWay(String contactWay) { + this.contactWay = contactWay; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } +} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/EquManuUpdateDto.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/EquManuUpdateDto.java new file mode 100644 index 00000000..96127b77 --- /dev/null +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/EquManuUpdateDto.java @@ -0,0 +1,72 @@ +package com.alops.system.domain.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel("设备厂商修改DTO") +public class EquManuUpdateDto { + + @ApiModelProperty("厂商ID") + private String id; + + @ApiModelProperty("厂商名称") + private String name; + + @ApiModelProperty("厂商描述") + private String description; + + @ApiModelProperty("联系人名称") + private String contactBy; + + @ApiModelProperty("联系人方式") + private String contactWay; + + @ApiModelProperty("状态") + private Integer status; + + + // ===== Getter & Setter ===== + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getContactBy() { + return contactBy; + } + + public void setContactBy(String contactBy) { + this.contactBy = contactBy; + } + + public String getContactWay() { + return contactWay; + } + + public void setContactWay(String contactWay) { + this.contactWay = contactWay; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + +} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/EquTypeAddDto.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/EquTypeAddDto.java new file mode 100644 index 00000000..e5a22075 --- /dev/null +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/EquTypeAddDto.java @@ -0,0 +1,46 @@ +package com.alops.system.domain.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel("新增设备类型参数") +public class EquTypeAddDto { + + @ApiModelProperty("设备类型简介") + private String description; + + @ApiModelProperty("设备图片地址") + private String image; + + @ApiModelProperty("设备类型名称") + private String name; + + + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + +} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/EquTypeUpdateDto.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/EquTypeUpdateDto.java new file mode 100644 index 00000000..cf4870ce --- /dev/null +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/EquTypeUpdateDto.java @@ -0,0 +1,49 @@ +package com.alops.system.domain.dto; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel("设备类型修改DTO") +public class EquTypeUpdateDto { + + @ApiModelProperty("类型ID") + private String id; + + @ApiModelProperty("设备类型名称") + private String name; + + @ApiModelProperty("设备类型简介") + private String description; + + @ApiModelProperty("设备图片存储地址") + private String image; + + @ApiModelProperty("状态") // 如果EquType有status字段,可以加上 + private Integer status; + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getImage() { + return image; + } + + public void setImage(String image) { + this.image = image; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } +} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/MonitorHistoryDto.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/MonitorHistoryDto.java new file mode 100644 index 00000000..58c2d0f7 --- /dev/null +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/MonitorHistoryDto.java @@ -0,0 +1,15 @@ +package com.alops.system.domain.dto; +import lombok.Data; +import java.util.ArrayList; +import java.util.List; + +@Data +public class MonitorHistoryDto { + // 返回给前端的字段 + private List temperatureList = new ArrayList<>(); + private List involtageList = new ArrayList<>(); + private List outvoltageList = new ArrayList<>(); + private List timeList = new ArrayList<>(); + + +} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/MonitorLastDto.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/MonitorLastDto.java new file mode 100644 index 00000000..9f50c91d --- /dev/null +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/MonitorLastDto.java @@ -0,0 +1,37 @@ +package com.alops.system.domain.dto; + +import lombok.Data; +import java.util.Date; + +@Data +public class MonitorLastDto { + // equ_gather 表 + private Integer contWorkPeriod; + private Float fanSpeed; + private Float cpuUtilization; + private Float memoryUtilization; + private String health; + + // equ_base 表 + private Long id; + private String name; + private String version; + private String deviceLevel; + private String ip; + private String location; + private Date installDate; + private String inCharge; + private Integer failureFrequency; + private Integer warranty; + + // equ_type + private String equType; + + // equ_manu + private String manufacture; + private String manufactureContactBy; + private String manufactureContactWay; + + // equ_supplier + private String supplierId; +} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/MonitorListDto.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/MonitorListDto.java new file mode 100644 index 00000000..3bb98c55 --- /dev/null +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/MonitorListDto.java @@ -0,0 +1,25 @@ +package com.alops.system.domain.dto; + +import lombok.Data; + +import java.sql.Blob; + +/** + * 显示多台设备监测信息(单个的信息) DTO + */ +@Data +public class MonitorListDto { + private String id; + private String name; + private String version; + private String deviceLevel; + private String location; + private String status; + private Integer failureFrequency; + private Blob equImage; + + // 监控指标 + private Float cpuUtilization; + private String health; + private Integer fanSpeed; +} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/MonitorStatisticDto.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/MonitorStatisticDto.java new file mode 100644 index 00000000..cc27f6f1 --- /dev/null +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/dto/MonitorStatisticDto.java @@ -0,0 +1,19 @@ +package com.alops.system.domain.dto; +import lombok.Data; +import java.util.List; + +/** + * 按设备类型统计 DTO + */ +@Data +public class MonitorStatisticDto { + private String equTypeId; // 设备类型ID 或 名称 + private String equTypeName; // 设备类型名称 + private List devices; // 属于该类型的设备列表 + + @Data + public static class DeviceSimpleInfo { + private String id; + private String name; + } +} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/EquMonitorVO.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/EquMonitorVO.java new file mode 100644 index 00000000..2236cb89 --- /dev/null +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/domain/vo/EquMonitorVO.java @@ -0,0 +1,25 @@ +package com.alops.system.domain.vo; + +import com.alops.system.domain.*; +import lombok.Data; + +import java.util.ArrayList; + +@Data +public class EquMonitorVO extends EquBase { + /** 设备类型 */ + /**风扇转速**/ + private Float fanSpeed; + private Float cpuUtilization; + private String contWorkPeriod; + /**设备温度**/ + private ArrayList temperatureList; + /**设备输入电压**/ + private ArrayList involtageList; + /**设备输出电压**/ + private ArrayList outvoltageList; + private Float health; + private Float aging; + private Float memoryUtilization; + +} 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 deleted file mode 100644 index 5d0c5009..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlarmRuleMapper.java +++ /dev/null @@ -1,64 +0,0 @@ -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 index 61521487..71ddc93e 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlertMessageMapper.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/AlertMessageMapper.java @@ -2,9 +2,11 @@ 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 org.apache.ibatis.annotations.Param; +import java.util.ArrayList; import java.util.List; +import java.util.Map; /** * 故障统计Mapper接口 @@ -38,6 +40,16 @@ public interface AlertMessageMapper * @return 故障统计集合 */ public List selectAlertMessageList(AlertMessage alertMessage); + public ArrayList selectAlertMessageByEquId(Long Equid); + + /** + * 统计设备类型、预警等级、时间的预警次数 + **/ + List> countByType(); + List> countByLevel(); + int countByYear(@Param("year") int year); + int countByMonth(@Param("year") int year, @Param("month") int month); + /** * 新增故障统计 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..b9908899 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 @@ -1,12 +1,13 @@ package com.alops.system.mapper; import com.alops.system.domain.EquBase; -import com.alops.system.domain.dto.EquBaseQueryDto; +import com.alops.system.domain.dto.*; import com.alops.system.domain.vo.queryEquBaseVO; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Update; import java.util.List; +import java.util.Map; /** @@ -38,6 +39,15 @@ public interface EquBaseMapper */ public EquBase selectEquBaseById(String id); + /**查询界面具体信息 -YY**/ + + MonitorLastDto selectEquMonitorById(String id); + List> selectEquMonitorByIdToList(EquBaseQueryDto queryDto); + + List selectEquMonitorList(EquBaseQueryDto equBaseQueryDto); + /**分类统计界面信息 -YY**/ + List selectEquStatisticByType(); + /** * 查询设备基本信息和厂商信息 * 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 index 549be44c..ede8a609 100644 --- 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 @@ -3,6 +3,7 @@ package com.alops.system.mapper; import com.alops.system.domain.EquInterface; import org.apache.ibatis.annotations.Mapper; +import java.util.ArrayList; import java.util.List; /** @@ -26,7 +27,8 @@ public interface EquInterfaceMapper * @return 端口运行状态 */ public EquInterface selectEquInterfaceById(String id); - + /**查询界面信息**/ + public ArrayList selectEquInterfaceByEquId(String equId); /** * 查询端口运行状态列表 * 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 index df21be44..e4dafd57 100644 --- 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 @@ -3,6 +3,7 @@ package com.alops.system.mapper; import com.alops.system.domain.EquRouting; import org.apache.ibatis.annotations.Mapper; +import java.util.ArrayList; import java.util.List; /** @@ -23,6 +24,7 @@ public interface EquRoutingMapper */ public EquRouting selectEquRoutingById(String id); + /** * 查询路由信息列表 * @@ -31,6 +33,7 @@ public interface EquRoutingMapper */ public List selectEquRoutingList(EquRouting equRouting); + public ArrayList selectEquRoutingListByEquId(String equId); /** * 新增路由信息 * diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquSupplierMapper.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquSupplierMapper.java new file mode 100644 index 00000000..a8c9f026 --- /dev/null +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/EquSupplierMapper.java @@ -0,0 +1,63 @@ +package com.alops.system.mapper; + +import java.util.List; +import com.alops.system.domain.EquSupplier; +import org.apache.ibatis.annotations.Mapper; + +/** + * 【请填写功能名称】Mapper接口 + * + * @author ruoyi + * @date 2025-09-20 + */ +@Mapper +public interface EquSupplierMapper +{ + /** + * 查询【请填写功能名称】 + * + * @param id 【请填写功能名称】主键 + * @return 【请填写功能名称】 + */ + public EquSupplier selectEquSupplierById(String id); + + /** + * 查询【请填写功能名称】列表 + * + * @param equSupplier 【请填写功能名称】 + * @return 【请填写功能名称】集合 + */ + public List selectEquSupplierList(EquSupplier equSupplier); + + /** + * 新增【请填写功能名称】 + * + * @param equSupplier 【请填写功能名称】 + * @return 结果 + */ + public int insertEquSupplier(EquSupplier equSupplier); + + /** + * 修改【请填写功能名称】 + * + * @param equSupplier 【请填写功能名称】 + * @return 结果 + */ + public int updateEquSupplier(EquSupplier equSupplier); + + /** + * 删除【请填写功能名称】 + * + * @param id 【请填写功能名称】主键 + * @return 结果 + */ + public int deleteEquSupplierById(String id); + + /** + * 批量删除【请填写功能名称】 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteEquSupplierByIds(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 index 34861fce..f36d3f9c 100644 --- 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 @@ -3,6 +3,7 @@ package com.alops.system.mapper; import com.alops.system.domain.EquVeneer; import org.apache.ibatis.annotations.Mapper; +import java.util.ArrayList; import java.util.List; /** @@ -31,6 +32,7 @@ public interface EquVeneerMapper * @return 【请填写功能名称】集合 */ public List selectEquVeneerList(EquVeneer equVeneer); + public ArrayList selectEquVeneerListByEquId(String equId); /** * 新增【请填写功能名称】 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 index 32245def..f5f6ca59 100644 --- 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 @@ -32,7 +32,7 @@ public interface EquVlanMapper * @return 【请填写功能名称】集合 */ public List selectEquVlanList(EquVlan equVlan); - + public List selectEquVlanListByEquId(String equId); /** * 新增【请填写功能名称】 * 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 deleted file mode 100644 index c461a6de..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/mapper/FauStaMapper.java +++ /dev/null @@ -1,65 +0,0 @@ -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/service/IAlarmRuleService.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlarmRuleService.java deleted file mode 100644 index 47cd49b8..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlarmRuleService.java +++ /dev/null @@ -1,62 +0,0 @@ -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/IAlertMessageService.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertMessageService.java index adb89217..800f408b 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertMessageService.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IAlertMessageService.java @@ -1,6 +1,7 @@ package com.alops.system.service; import com.alops.system.domain.AlertMessage; +import com.alops.system.domain.dto.AlertStatisticDto; import java.util.List; @@ -20,6 +21,7 @@ public interface IAlertMessageService */ public AlertMessage selectAlertMessageById(Long id); + /** * 查询故障统计列表 * @@ -28,6 +30,13 @@ public interface IAlertMessageService */ public List selectAlertMessageList(AlertMessage alertMessage); + public List selectAlertMessageListByEquId(Long equId); + + /** + * 统计设备类型、预警等级、时间的预警次数 + **/ + AlertStatisticDto statisticAlert(); + /** * 新增故障统计 * 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..2a3a0976 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 @@ -1,7 +1,7 @@ package com.alops.system.service; import com.alops.system.domain.EquBase; -import com.alops.system.domain.dto.EquBaseQueryDto; +import com.alops.system.domain.dto.*; import com.alops.system.domain.vo.queryEquBaseVO; import java.util.List; @@ -21,7 +21,26 @@ public interface IEquBaseService * @param id 设备基本信息主键 * @return 设备基本信息 */ - public EquBase selectEquBaseById(String id); + public EquBase selectEquBaseById(String id); + /**查询界面具体信息**/ + // EquMonitorVO selectEquMonitorInfo(EquBaseQueryDto queryDto); + + + /** + * 获取设备最新的监控信息快照 + * + * @param id 设备ID + * @return 包含最新单条监控数据的设备VO + */ + MonitorLastDto selectLatestEquMonitorInfo(String id); + + /** + * 获取设备在指定时间段内的历史监控信息 + * + * @param queryDto 包含设备ID和时间范围的查询参数 + * @return 包含监控数据列表的设备VO + */ + MonitorHistoryDto selectHistoricalEquMonitorInfo(EquBaseQueryDto queryDto); /** * 查询设备基本信息列表 @@ -31,7 +50,12 @@ public interface IEquBaseService */ public List selectEquBaseList(EquBaseQueryDto equBaseQueryDto); - /** + public List selectEquMonitorList(EquBaseQueryDto equBaseQueryDto); + + /**分类统计信息**/ + List selectEquStatisticByType(); + + /** * 新增设备基本信息 * * @param equBase 设备基本信息 @@ -62,4 +86,5 @@ public interface IEquBaseService * @return 结果 */ public int deleteEquBaseById(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 index 570a0a32..5b95a1a8 100644 --- 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 @@ -3,6 +3,7 @@ package com.alops.system.service; import com.alops.system.domain.EquInterface; import org.springframework.stereotype.Service; +import java.util.ArrayList; import java.util.List; /** @@ -30,6 +31,7 @@ public interface IEquInterfaceService */ public List selectEquInterfaceList(EquInterface equInterface); + public List selectEquInterfaceListByEquID(String equID); /** * 新增端口运行状态 * 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 index 2e116183..b3d93d3c 100644 --- 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 @@ -28,6 +28,8 @@ public interface IEquRoutingService */ public List selectEquRoutingList(EquRouting equRouting); + public List selectEquRoutingListByEquId(String equId); + /** * 新增路由信息 * diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquSupplierService.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquSupplierService.java new file mode 100644 index 00000000..7fe722ff --- /dev/null +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/IEquSupplierService.java @@ -0,0 +1,61 @@ +package com.alops.system.service; + +import java.util.List; +import com.alops.system.domain.EquSupplier; + +/** + * 【请填写功能名称】Service接口 + * + * @author ruoyi + * @date 2025-09-20 + */ +public interface IEquSupplierService +{ + /** + * 查询【请填写功能名称】 + * + * @param id 【请填写功能名称】主键 + * @return 【请填写功能名称】 + */ + public EquSupplier selectEquSupplierById(String id); + + /** + * 查询【请填写功能名称】列表 + * + * @param equSupplier 【请填写功能名称】 + * @return 【请填写功能名称】集合 + */ + public List selectEquSupplierList(EquSupplier equSupplier); + + /** + * 新增【请填写功能名称】 + * + * @param equSupplier 【请填写功能名称】 + * @return 结果 + */ + public int insertEquSupplier(EquSupplier equSupplier); + + /** + * 修改【请填写功能名称】 + * + * @param equSupplier 【请填写功能名称】 + * @return 结果 + */ + public int updateEquSupplier(EquSupplier equSupplier); + + /** + * 批量删除【请填写功能名称】 + * + * @param ids 需要删除的【请填写功能名称】主键集合 + * @return 结果 + */ + public int deleteEquSupplierByIds(String[] ids); + + /** + * 删除【请填写功能名称】信息 + * + * @param id 【请填写功能名称】主键 + * @return 结果 + */ + public int deleteEquSupplierById(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 index da61c79b..bda9a0da 100644 --- 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 @@ -27,6 +27,7 @@ public interface IEquVeneerService * @return 【请填写功能名称】集合 */ public List selectEquVeneerList(EquVeneer equVeneer); + public List selectEquVeneerListByEquId(String equId); /** * 新增【请填写功能名称】 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 index 0a951d96..3828c7b0 100644 --- 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 @@ -27,7 +27,7 @@ public interface IEquVlanService * @return 【请填写功能名称】集合 */ public List selectEquVlanList(EquVlan equVlan); - + public List selectEquVlanListByEquId(String equId); /** * 新增【请填写功能名称】 * 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 deleted file mode 100644 index 1b58d14f..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlarmRuleServiceImpl.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.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/AlertMessageServiceImpl.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertMessageServiceImpl.java index 978180c0..03121815 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertMessageServiceImpl.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/AlertMessageServiceImpl.java @@ -1,8 +1,13 @@ package com.alops.system.service.impl; +import java.time.LocalDate; +import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import com.alops.system.domain.AlertMessage; +import com.alops.system.domain.dto.AlertStatisticDto; import com.alops.system.mapper.AlertMessageMapper; import com.alops.system.service.IAlertMessageService; import org.springframework.beans.factory.annotation.Autowired; @@ -44,7 +49,46 @@ public class AlertMessageServiceImpl implements IAlertMessageService return alertMessageMapper.selectAlertMessageList(alertMessage); } + @Override + public List selectAlertMessageListByEquId(Long equId) + { + ArrayList alertMessagelist = alertMessageMapper.selectAlertMessageByEquId(equId); + return alertMessagelist; + } + /** + * 统计设备类型、预警等级、时间的预警次数 + **/ + @Override + public AlertStatisticDto statisticAlert() { + AlertStatisticDto dto = new AlertStatisticDto(); + + // 按设备类型统计 + Map typeMap = new HashMap<>(); + for (Map row : alertMessageMapper.countByType()) { + typeMap.put((String) row.get("equ_type"), ((Long) row.get("cnt")).intValue()); + } + dto.setTypeCount(typeMap); + + // 按等级统计 + Map levelMap = new HashMap<>(); + for (Map row : alertMessageMapper.countByLevel()) { + levelMap.put(((Integer) row.get("level")), ((Long) row.get("cnt")).intValue()); + } + dto.setLevelCount(levelMap); + + // 年 / 月 + LocalDate now = LocalDate.now(); + int year = now.getYear(); + int month = now.getMonthValue(); + + dto.setYearCount(alertMessageMapper.countByYear(year)); + dto.setMonthCount(alertMessageMapper.countByMonth(year, month)); + + return dto; + } + + /** * 新增故障统计 * * @param alertMessage 故障统计 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..ad3221e0 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 @@ -1,14 +1,17 @@ package com.alops.system.service.impl; import java.util.List; +import java.util.Map; import com.alops.system.domain.EquBase; -import com.alops.system.domain.dto.EquBaseQueryDto; +import com.alops.system.domain.dto.*; import com.alops.system.domain.vo.queryEquBaseVO; import com.alops.system.mapper.EquBaseMapper; +import com.alops.system.mapper.EquInterfaceMapper; import com.alops.system.service.IEquBaseService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; /** * 设备基本信息Service业务层处理 @@ -22,6 +25,8 @@ public class EquBaseServiceImpl implements IEquBaseService @Autowired private EquBaseMapper equBaseMapper; + @Autowired + private EquInterfaceMapper interfaceMapper; /** * 查询设备基本信息 * @@ -31,9 +36,50 @@ public class EquBaseServiceImpl implements IEquBaseService @Override public EquBase selectEquBaseById(String id) { + return equBaseMapper.selectEquBaseById(id); } + + + /** + * 实现 - 获取设备最新的监控信息快照 + */ + @Override + public MonitorLastDto selectLatestEquMonitorInfo(String id) { + // 建议增加基础的参数校验 + if (!StringUtils.hasText(id)) { + // 根据业务规则,可以返回null或抛出自定义异常 + throw new IllegalArgumentException("查询最新设备信息时,设备ID不能为空。"); + } + // EquMonitorVO monitorVO1 = equBaseMapper.selectEquMonitorById(id); + // return monitorVO1; + return equBaseMapper.selectEquMonitorById(id); + } + + /** + * 实现 - 获取设备在指定时间段内的历史监控信息 + */ + @Override + public MonitorHistoryDto selectHistoricalEquMonitorInfo(EquBaseQueryDto queryDto) { + if (queryDto == null || queryDto.getId() == null + || queryDto.getMinTime() == null || queryDto.getMaxTime() == null) { + throw new IllegalArgumentException("查询历史数据需要提供设备ID和完整的时间范围。"); + } + + List> rows = equBaseMapper.selectEquMonitorByIdToList(queryDto); + + MonitorHistoryDto dto = new MonitorHistoryDto(); + for (Map row : rows) { + dto.getTemperatureList().add(row.get("temperature_value") != null ? ((Number) row.get("temperature_value")).floatValue() : null); + dto.getInvoltageList().add(row.get("involtage_value") != null ? ((Number) row.get("involtage_value")).floatValue() : null); + dto.getOutvoltageList().add(row.get("outvoltage_value") != null ? ((Number) row.get("outvoltage_value")).floatValue() : null); + dto.getTimeList().add(row.get("gather_time").toString()); + } + return dto; + } + + /** * 查询设备基本信息列表 * @@ -46,6 +92,24 @@ public class EquBaseServiceImpl implements IEquBaseService return equBaseMapper.selectEquBaseList(equBaseQueryDto); } + /** + * 查询多台显示界面的单独信息 + **/ + @Override + public List selectEquMonitorList(EquBaseQueryDto equBaseQueryDto) { + return equBaseMapper.selectEquMonitorList(equBaseQueryDto); + } + + /** + * 设备类型分类统计信息 + **/ + @Override + public List selectEquStatisticByType() { + return equBaseMapper.selectEquStatisticByType(); + } + + + /** * 新增设备基本信息 * 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 index e21cdc97..8c02a7c6 100644 --- 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 @@ -1,5 +1,6 @@ package com.alops.system.service.impl; +import java.util.ArrayList; import java.util.List; import com.alops.system.domain.EquInterface; @@ -44,6 +45,12 @@ public class EquInterfaceServiceImpl implements IEquInterfaceService return equInterfaceMapper.selectEquInterfaceList(equInterface); } + @Override + public List selectEquInterfaceListByEquID(String equID) { + ArrayList interfacesList = equInterfaceMapper.selectEquInterfaceByEquId(equID); + return interfacesList; + } + /** * 新增端口运行状态 * diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquManuServiceImpl.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquManuServiceImpl.java index 5d098d19..875a9c5d 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquManuServiceImpl.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquManuServiceImpl.java @@ -1,8 +1,12 @@ package com.alops.system.service.impl; +import java.util.Date; import java.util.List; +import java.util.UUID; +import com.alops.common.utils.SecurityUtils; import com.alops.system.domain.EquManu; +import com.alops.system.domain.EquType; import com.alops.system.mapper.EquManuMapper; import com.alops.system.service.IEquManuService; import org.springframework.beans.factory.annotation.Autowired; @@ -53,6 +57,9 @@ public class EquManuServiceImpl implements IEquManuService @Override public int insertEquManu(EquManu equManu) { + equManu.setId(UUID.randomUUID().toString()); + equManu.setCreateDate(new Date()); + Long userId = SecurityUtils.getLoginUser().getUserId(); return equManuMapper.insertEquManu(equManu); } @@ -65,6 +72,7 @@ public class EquManuServiceImpl implements IEquManuService @Override public int updateEquManu(EquManu equManu) { + Long userId = SecurityUtils.getLoginUser().getUserId(); return equManuMapper.updateEquManu(equManu); } 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 index c2448f93..8498aca5 100644 --- 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 @@ -1,7 +1,9 @@ package com.alops.system.service.impl; +import java.util.ArrayList; import java.util.List; +import com.alops.system.domain.EquInterface; import com.alops.system.domain.EquRouting; import com.alops.system.mapper.EquRoutingMapper; import com.alops.system.service.IEquRoutingService; @@ -32,6 +34,7 @@ public class EquRoutingServiceImpl implements IEquRoutingService return equRoutingMapper.selectEquRoutingById(id); } + /** * 查询路由信息列表 * @@ -43,6 +46,18 @@ public class EquRoutingServiceImpl implements IEquRoutingService { return equRoutingMapper.selectEquRoutingList(equRouting); } + /** + * 查询路由界面详细信息+++ + * + * @param equId 路由信息主键 + * @return 路由信息 + */ + @Override + public List selectEquRoutingListByEquId(String equId) + { + ArrayList EquRoutingList = equRoutingMapper.selectEquRoutingListByEquId(equId); + return EquRoutingList ; + } /** * 新增路由信息 diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquSupplierServiceImpl.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquSupplierServiceImpl.java new file mode 100644 index 00000000..3ec981b8 --- /dev/null +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquSupplierServiceImpl.java @@ -0,0 +1,95 @@ +package com.alops.system.service.impl; + +import java.util.List; +import com.alops.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.alops.system.mapper.EquSupplierMapper; +import com.alops.system.domain.EquSupplier; +import com.alops.system.service.IEquSupplierService; + +/** + * 【请填写功能名称】Service业务层处理 + * + * @author ruoyi + * @date 2025-09-20 + */ +@Service +public class EquSupplierServiceImpl implements IEquSupplierService +{ + @Autowired + private EquSupplierMapper equSupplierMapper; + + /** + * 查询【请填写功能名称】 + * + * @param id 【请填写功能名称】主键 + * @return 【请填写功能名称】 + */ + @Override + public EquSupplier selectEquSupplierById(String id) + { + return equSupplierMapper.selectEquSupplierById(id); + } + + /** + * 查询【请填写功能名称】列表 + * + * @param equSupplier 【请填写功能名称】 + * @return 【请填写功能名称】 + */ + @Override + public List selectEquSupplierList(EquSupplier equSupplier) + { + return equSupplierMapper.selectEquSupplierList(equSupplier); + } + + /** + * 新增【请填写功能名称】 + * + * @param equSupplier 【请填写功能名称】 + * @return 结果 + */ + @Override + public int insertEquSupplier(EquSupplier equSupplier) + { + equSupplier.setCreateTime(DateUtils.getNowDate()); + return equSupplierMapper.insertEquSupplier(equSupplier); + } + + /** + * 修改【请填写功能名称】 + * + * @param equSupplier 【请填写功能名称】 + * @return 结果 + */ + @Override + public int updateEquSupplier(EquSupplier equSupplier) + { + return equSupplierMapper.updateEquSupplier(equSupplier); + } + + /** + * 批量删除【请填写功能名称】 + * + * @param ids 需要删除的【请填写功能名称】主键 + * @return 结果 + */ + @Override + public int deleteEquSupplierByIds(String[] ids) + { + return equSupplierMapper.deleteEquSupplierByIds(ids); + } + + /** + * 删除【请填写功能名称】信息 + * + * @param id 【请填写功能名称】主键 + * @return 结果 + */ + @Override + public int deleteEquSupplierById(String id) + { + return equSupplierMapper.deleteEquSupplierById(id); + } +} diff --git a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquTypeServiceImpl.java b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquTypeServiceImpl.java index 1a2045a1..cd95be3d 100644 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquTypeServiceImpl.java +++ b/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/EquTypeServiceImpl.java @@ -1,7 +1,9 @@ package com.alops.system.service.impl; import java.util.List; +import java.util.UUID; +import com.alops.common.utils.SecurityUtils; import com.alops.system.domain.EquType; import com.alops.system.mapper.EquTypeMapper; import com.alops.system.service.IEquTypeService; @@ -53,6 +55,8 @@ public class EquTypeServiceImpl implements IEquTypeService @Override public int insertEquType(EquType equType) { + equType.setId(UUID.randomUUID().toString()); + Long userId = SecurityUtils.getLoginUser().getUserId(); return equTypeMapper.insertEquType(equType); } @@ -65,6 +69,7 @@ public class EquTypeServiceImpl implements IEquTypeService @Override public int updateEquType(EquType equType) { + Long userId = SecurityUtils.getLoginUser().getUserId(); return equTypeMapper.updateEquType(equType); } 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 index 84802cce..c2014e0e 100644 --- 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 @@ -1,7 +1,9 @@ package com.alops.system.service.impl; +import java.util.ArrayList; import java.util.List; +import com.alops.system.domain.EquInterface; import com.alops.system.domain.EquVeneer; import com.alops.system.mapper.EquVeneerMapper; import com.alops.system.service.IEquVeneerService; @@ -44,6 +46,16 @@ public class EquVeneerServiceImpl implements IEquVeneerService return equVeneerMapper.selectEquVeneerList(equVeneer); } + /** + * 查询界面信息列表+++ + */ + @Override + public List selectEquVeneerListByEquId(String equId) + { + ArrayList VeneerList = equVeneerMapper.selectEquVeneerListByEquId(equId); + return VeneerList; + } + /** * 新增【请填写功能名称】 * 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 index 0702af6e..92e1f1fb 100644 --- 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 @@ -46,6 +46,18 @@ public class EquVlanServiceImpl implements IEquVlanService return equVlanMapper.selectEquVlanList(equVlan); } + /** + * 查询单台的vlan信息列表 + * + * @param equId【请填写功能名称】 + * @return 【请填写功能名称】 + */ + @Override + public List selectEquVlanListByEquId(String equId) + { + return equVlanMapper.selectEquVlanListByEquId(equId); + } + /** * 新增【请填写功能名称】 * 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 deleted file mode 100644 index a8ff0010..00000000 --- a/ALOps_sys_backend/alops-system/src/main/java/com/alops/system/service/impl/FauStaServiceImpl.java +++ /dev/null @@ -1,94 +0,0 @@ -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/resources/mapper/system/AlarmRuleMapper.xml b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlarmRuleMapper.xml deleted file mode 100644 index 3c715944..00000000 --- a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlarmRuleMapper.xml +++ /dev/null @@ -1,110 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - 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/AlertMessageMapper.xml b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlertMessageMapper.xml index 16edf911..00d8d10d 100644 --- a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlertMessageMapper.xml +++ b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/AlertMessageMapper.xml @@ -18,6 +18,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -25,12 +26,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) + (equ_id, description, type, equ_type, cause, solution, level, occur_time, reporter, handler, handle_time, status, batch) 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}) + #{msg.reporter}, #{msg.handler}, #{msg.handleTime}, #{msg.status},#{msg.batch})) @@ -38,7 +39,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - 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, type, equ_type, solution, level, occur_time, handler, handle_time, status,batch from alert_message + + + + select a.id, g.equ_id, type, equ_type solution, level, occur_time, handler, handle_time, status,batch from alert_message a LEFT JOIN equ_gather g ON a.equ_id = g.equ_id @@ -64,6 +70,46 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where id = #{id} + + + + + + + + + + + + + + insert into alert_message @@ -79,6 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" handler, handle_time, status, + batch, #{equId}, @@ -93,6 +140,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{handler}, #{handleTime}, #{status}, + #{batch}, 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..bc3c5549 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 @@ -27,10 +27,68 @@ 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 @@ -46,25 +104,76 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" m.name as manuName, b.location, b.equ_type, + t.name AS equTypeName, b.in_charge, - b.release_date, + #b.release_date, b.install_date, b.life_cycle, - b.service_time, + #b.service_time, b.warranty, b.create_by, b.create_date, - b.update_by, - b.update_date, + #b.update_by, + #b.update_date, + b.device_level, + b.supplier_id, b.status, b.failure_frequency as failureFrequency, - b.repair_frequency as repairFrequency, - b.repair_cost as repairCost, + #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 LEFT JOIN equ_manu m ON b.manufacture = m.id + LEFT JOIN equ_type t ON b.equ_type = t.id + + + AND b.equ_type = #{equType} + + + AND b.name LIKE concat('%', #{equName}, '%') + + + AND b.location = #{location} + + + AND b.manufacture = #{manufacture} + + + AND b.in_charge = #{inCharge} + + + AND b.status = #{status} + + + AND b.create_date =]]> #{minTime} + + + AND b.create_date #{maxTime} + + + AND g.health =]]> #{health} + + + + + + + + + + + + + + + + + + + + + diff --git a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquInterfaceMapper.xml b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquInterfaceMapper.xml index 8611be9c..97607ba8 100644 --- a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquInterfaceMapper.xml +++ b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquInterfaceMapper.xml @@ -40,6 +40,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 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 + + select i.id, g.equ_id, i.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 i LEFT JOIN equ_gather g ON i.equ_gather_id = g.id + + + + insert into equ_interface diff --git a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquManuMapper.xml b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquManuMapper.xml index a25a2e7f..df45958b 100644 --- a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquManuMapper.xml +++ b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquManuMapper.xml @@ -68,8 +68,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" contact_by = #{contactBy}, contact_way = #{contactWay}, create_by = #{createBy}, - create_date = #{createDate}, status = #{status}, + create_date = create_date where id = #{id} 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 index 6e59d233..97e6b3c2 100644 --- 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 @@ -26,6 +26,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select id, equ_gather_id, des_address, subnet_mask, next_hop from equ_routing + + select r.id, g.equ_id AS equId, equ_gather_id, des_address, subnet_mask, next_hop from equ_routing r JOIN equ_gather g ON r.equ_gather_id = g.id + + + + insert into equ_routing diff --git a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquSupplierMapper.xml b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquSupplierMapper.xml new file mode 100644 index 00000000..968a7b08 --- /dev/null +++ b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquSupplierMapper.xml @@ -0,0 +1,86 @@ + + + + + + + + + + + + + + + + + select id, name, description, contact_by, contact_way, create_by, create_time, status from equ_supplier + + + + + + + + insert into equ_supplier + + id, + name, + description, + contact_by, + contact_way, + create_by, + create_time, + status, + + + #{id}, + #{name}, + #{description}, + #{contactBy}, + #{contactWay}, + #{createBy}, + #{createTime}, + #{status}, + + + + + update equ_supplier + + name = #{name}, + description = #{description}, + contact_by = #{contactBy}, + contact_way = #{contactWay}, + create_by = #{createBy}, + create_time = #{createTime}, + status = #{status}, + + where id = #{id} + + + + delete from equ_supplier where id = #{id} + + + + delete from equ_supplier where id in + + #{id} + + + \ No newline at end of file diff --git a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquTypeMapper.xml b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquTypeMapper.xml index 1b554f22..84945ac6 100644 --- a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquTypeMapper.xml +++ b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquTypeMapper.xml @@ -40,18 +40,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" description, image, create_by, - create_date, - + + #{id}, #{name}, #{description}, #{image}, #{createBy}, - #{createDate}, - + + + update equ_type @@ -59,7 +60,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" description = #{description}, image = #{image}, create_by = #{createBy}, - create_date = #{createDate}, + create_date = create_date where id = #{id} 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 index c7b9970b..e034bc77 100644 --- 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 @@ -26,6 +26,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select id, veneer_id, veneer_status, equ_gather_id from equ_veneer + + select v.id, g.equ_id AS equId, veneer_id, veneer_status, equ_gather_id FROM equ_veneer v LEFT JOIN equ_gather g ON v.equ_gather_id = g.id + + + + insert into equ_veneer diff --git a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquVlanMapper.xml b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquVlanMapper.xml index 53d00763..b402e15c 100644 --- a/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquVlanMapper.xml +++ b/ALOps_sys_backend/alops-system/src/main/resources/mapper/system/EquVlanMapper.xml @@ -28,10 +28,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ) + select id, equ_gather_id, main_id, ip_address, subnet_mask, create_time, update_by, vlan_id from equ_vlan + + select vl.id, g.equ_id, equ_gather_id, main_id, ip_address, subnet_mask, create_time, update_by, vlan_id from equ_vlan vl LEFT JOIN equ_gather g ON vl.equ_gather_id = g.id + + + + insert into equ_vlan diff --git a/ALOps_sys_fe/alops-ui/src/api/system/supplier.js b/ALOps_sys_fe/alops-ui/src/api/system/supplier.js new file mode 100644 index 00000000..5ec83ccd --- /dev/null +++ b/ALOps_sys_fe/alops-ui/src/api/system/supplier.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询【请填写功能名称】列表 +export function listSupplier(query) { + return request({ + url: '/system/supplier/list', + method: 'get', + params: query + }) +} + +// 查询【请填写功能名称】详细 +export function getSupplier(id) { + return request({ + url: '/system/supplier/' + id, + method: 'get' + }) +} + +// 新增【请填写功能名称】 +export function addSupplier(data) { + return request({ + url: '/system/supplier', + method: 'post', + data: data + }) +} + +// 修改【请填写功能名称】 +export function updateSupplier(data) { + return request({ + url: '/system/supplier', + method: 'put', + data: data + }) +} + +// 删除【请填写功能名称】 +export function delSupplier(id) { + return request({ + url: '/system/supplier/' + id, + method: 'delete' + }) +} diff --git a/ALOps_sys_fe/alops-ui/src/views/system/supplier/index.vue b/ALOps_sys_fe/alops-ui/src/views/system/supplier/index.vue new file mode 100644 index 00000000..d2a71a90 --- /dev/null +++ b/ALOps_sys_fe/alops-ui/src/views/system/supplier/index.vue @@ -0,0 +1,287 @@ + + + diff --git a/ALOps_sys_fe/alops-ui/vue.config.js b/ALOps_sys_fe/alops-ui/vue.config.js index 65cd2195..78f879df 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://39.102.212.161:8080' // 后端接口 +const baseUrl = 'http://localhost:8080' // 后端接口 const port = process.env.port || process.env.npm_config_port || 80 // 端口