agent2.0版本数据适配,开发脚本策略接口

This commit is contained in:
gaoyutao
2025-09-23 18:21:05 +08:00
parent a9270027f4
commit d5f232e295
62 changed files with 5286 additions and 44 deletions

View File

@@ -96,4 +96,16 @@ public class InitialSwitchInfoDetails extends BaseEntity
/** 交换机ip */
private String switchIp;
/** 端口配置速率(Mbps) */
private BigDecimal ifSpeed;
/** 入站丢包 */
private Integer ifInDiscards;
/** 出站丢包 */
private Integer ifOutDiscards;
/** 错误的入站数据包数量 */
private Integer ifInErrors;
/** 错误的出站数据包数量 */
private Integer ifOutErrors;
/** 端口索引 */
private Integer ifIndex;
}

View File

@@ -131,6 +131,7 @@ public class RmResourceGroupServiceImpl implements IRmResourceGroupService
StringBuilder resultStr = new StringBuilder();
String[] idArray = ids.split(",");
for (String s : idArray) {
rmResourceGroup.setResourceIds(s);
int rows = rmResourceGroupMapper.exitsResourceById(rmResourceGroup);
if(rows > 0){
resultStr.append(s);

View File

@@ -27,10 +27,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="switchSn" column="switch_sn" />
<result property="businessCode" column="business_code" />
<result property="businessName" column="business_name" />
<result property="ifSpeed" column="if_speed" />
<result property="ifInDiscards" column="if_in_discards" />
<result property="ifOutDiscards" column="if_out_discards" />
<result property="ifInErrors" column="if_in_errors" />
<result property="ifOutErrors" column="if_out_errors" />
<result property="ifIndex" column="if_index" />
</resultMap>
<sql id="selectInitialSwitchInfoDetailsVo">
select id, client_id, name, in_bytes, out_bytes, status, type, in_speed, out_speed, switch_ip, create_by, update_by, create_time, update_time, switch_name, interface_device_type, server_name, server_port, server_sn, switch_sn, business_code, business_name from initial_switch_info_details
select id, client_id, name, in_bytes, out_bytes, status, type, in_speed, out_speed, switch_ip, create_by, update_by, create_time, update_time, switch_name, interface_device_type, server_name, server_port, server_sn, switch_sn, business_code, business_name, if_speed, if_in_discards, if_out_discards, if_in_errors, if_out_errors, if_index from initial_switch_info_details
</sql>
<select id="selectInitialSwitchInfoDetailsList" parameterType="InitialSwitchInfoDetails" resultMap="InitialSwitchInfoDetailsResult">
@@ -92,6 +98,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="switchSn != null">switch_sn,</if>
<if test="businessCode != null">business_code,</if>
<if test="businessName != null">business_name,</if>
<if test="ifSpeed != null">if_speed,</if>
<if test="ifInDiscards != null">if_in_discards,</if>
<if test="ifOutDiscards != null">if_out_discards,</if>
<if test="ifInErrors != null">if_in_errors,</if>
<if test="ifOutErrors != null">if_out_errors,</if>
<if test="ifIndex != null and ifIndex != ''">if_index,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="clientId != null and clientId != ''">#{clientId},</if>
@@ -115,6 +127,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="switchSn != null">#{switchSn},</if>
<if test="businessCode != null">#{businessCode},</if>
<if test="businessName != null">#{businessName},</if>
<if test="ifSpeed != null">#{ifSpeed},</if>
<if test="ifInDiscards != null">#{ifInDiscards},</if>
<if test="ifOutDiscards != null">#{ifOutDiscards},</if>
<if test="ifInErrors != null">#{ifInErrors},</if>
<if test="ifOutErrors != null">#{ifOutErrors},</if>
<if test="ifIndex != null and ifIndex != ''">#{ifIndex},</if>
</trim>
</insert>
@@ -142,6 +160,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="switchSn != null">switch_sn = #{switchSn},</if>
<if test="businessCode != null">business_code = #{businessCode},</if>
<if test="businessName != null">business_name = #{businessName},</if>
<if test="ifSpeed != null">if_speed = #{ifSpeed},</if>
<if test="ifInDiscards != null">if_in_discards = #{ifInDiscards},</if>
<if test="ifOutDiscards != null">if_out_discards = #{ifOutDiscards},</if>
<if test="ifInErrors != null">if_in_errors = #{ifInErrors},</if>
<if test="ifOutErrors != null">if_out_errors = #{ifOutErrors},</if>
<if test="ifIndex != null and ifIndex != ''">if_index = #{ifIndex},</if>
</trim>
where id = #{id}
</update>
@@ -169,6 +193,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
in_speed AS inSpeed,
out_speed AS outSpeed,
switch_ip AS switchIp,
if_index AS ifIndex,
if_speed AS ifSpeed,
if_in_discards AS ifInDiscards,
if_out_discards AS ifOutDiscards,
if_in_errors AS ifInErrors,
if_out_errors AS ifOutErrors,
create_by AS createBy,
update_by AS updateBy,
create_time AS createTime,
@@ -182,6 +212,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
ORDER BY create_time DESC
</select>
<insert id="saveBatchSwitchTraffic" parameterType="InitialSwitchInfoDetails">
INSERT IGNORE INTO initial_switch_info_details
(
@@ -194,6 +225,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
in_speed,
out_speed,
switch_ip,
if_index,
if_speed,
if_in_discards,
if_out_discards,
if_in_errors,
if_out_errors,
switch_name,
interface_device_type,
`server_name`,
@@ -219,6 +256,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{item.inSpeed},
#{item.outSpeed},
#{item.switchIp},
#{item.ifIndex},
#{item.ifSpeed},
#{item.ifInDiscards},
#{item.ifOutDiscards},
#{item.ifInErrors},
#{item.ifOutErrors},
#{item.switchName},
#{item.interfaceDeviceType},
#{item.serverName},

View File

@@ -0,0 +1,105 @@
package com.ruoyi.rocketmq.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.rocketmq.domain.InitialOtherSystemMonitorData;
import com.ruoyi.rocketmq.service.IInitialOtherSystemMonitorDataService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.page.TableDataInfo;
/**
* 系统其他信息监控数据Controller
*
* @author gyt
* @date 2025-09-23
*/
@RestController
@RequestMapping("/otherSystemData")
public class InitialOtherSystemMonitorDataController extends BaseController
{
@Autowired
private IInitialOtherSystemMonitorDataService initialOtherSystemMonitorDataService;
/**
* 查询系统其他信息监控数据列表
*/
@RequiresPermissions("rocketmq:otherSystemData:list")
@GetMapping("/list")
public TableDataInfo list(InitialOtherSystemMonitorData initialOtherSystemMonitorData)
{
startPage();
List<InitialOtherSystemMonitorData> list = initialOtherSystemMonitorDataService.selectInitialOtherSystemMonitorDataList(initialOtherSystemMonitorData);
return getDataTable(list);
}
/**
* 导出系统其他信息监控数据列表
*/
@RequiresPermissions("rocketmq:otherSystemData:export")
@Log(title = "系统其他信息监控数据", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, InitialOtherSystemMonitorData initialOtherSystemMonitorData)
{
List<InitialOtherSystemMonitorData> list = initialOtherSystemMonitorDataService.selectInitialOtherSystemMonitorDataList(initialOtherSystemMonitorData);
ExcelUtil<InitialOtherSystemMonitorData> util = new ExcelUtil<InitialOtherSystemMonitorData>(InitialOtherSystemMonitorData.class);
util.exportExcel(response, list, "系统其他信息监控数据数据");
}
/**
* 获取系统其他信息监控数据详细信息
*/
@RequiresPermissions("rocketmq:otherSystemData:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(initialOtherSystemMonitorDataService.selectInitialOtherSystemMonitorDataById(id));
}
/**
* 新增系统其他信息监控数据
*/
@RequiresPermissions("rocketmq:otherSystemData:add")
@Log(title = "系统其他信息监控数据", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody InitialOtherSystemMonitorData initialOtherSystemMonitorData)
{
return toAjax(initialOtherSystemMonitorDataService.insertInitialOtherSystemMonitorData(initialOtherSystemMonitorData));
}
/**
* 修改系统其他信息监控数据
*/
@RequiresPermissions("rocketmq:otherSystemData:edit")
@Log(title = "系统其他信息监控数据", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody InitialOtherSystemMonitorData initialOtherSystemMonitorData)
{
return toAjax(initialOtherSystemMonitorDataService.updateInitialOtherSystemMonitorData(initialOtherSystemMonitorData));
}
/**
* 删除系统其他信息监控数据
*/
@RequiresPermissions("rocketmq:otherSystemData:remove")
@Log(title = "系统其他信息监控数据", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(initialOtherSystemMonitorDataService.deleteInitialOtherSystemMonitorDataByIds(ids));
}
}

View File

@@ -0,0 +1,98 @@
package com.ruoyi.rocketmq.controller;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.rocketmq.domain.InitialSwitchFanInfo;
import com.ruoyi.rocketmq.service.IInitialSwitchFanInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 风扇信息Controller
*
* @author gyt
* @date 2025-09-22
*/
@RestController
@RequestMapping("/switchFanInfo")
public class InitialSwitchFanInfoController extends BaseController
{
@Autowired
private IInitialSwitchFanInfoService initialSwitchFanInfoService;
/**
* 查询风扇信息列表
*/
@RequiresPermissions("rocketmq:info:list")
@GetMapping("/list")
public TableDataInfo list(InitialSwitchFanInfo initialSwitchFanInfo)
{
startPage();
List<InitialSwitchFanInfo> list = initialSwitchFanInfoService.selectInitialSwitchFanInfoList(initialSwitchFanInfo);
return getDataTable(list);
}
/**
* 导出风扇信息列表
*/
@RequiresPermissions("rocketmq:info:export")
@Log(title = "风扇信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, InitialSwitchFanInfo initialSwitchFanInfo)
{
List<InitialSwitchFanInfo> list = initialSwitchFanInfoService.selectInitialSwitchFanInfoList(initialSwitchFanInfo);
ExcelUtil<InitialSwitchFanInfo> util = new ExcelUtil<InitialSwitchFanInfo>(InitialSwitchFanInfo.class);
util.exportExcel(response, list, "风扇信息数据");
}
/**
* 获取风扇信息详细信息
*/
@RequiresPermissions("rocketmq:info:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(initialSwitchFanInfoService.selectInitialSwitchFanInfoById(id));
}
/**
* 新增风扇信息
*/
@RequiresPermissions("rocketmq:info:add")
@Log(title = "风扇信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody InitialSwitchFanInfo initialSwitchFanInfo)
{
return toAjax(initialSwitchFanInfoService.insertInitialSwitchFanInfo(initialSwitchFanInfo));
}
/**
* 修改风扇信息
*/
@RequiresPermissions("rocketmq:info:edit")
@Log(title = "风扇信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody InitialSwitchFanInfo initialSwitchFanInfo)
{
return toAjax(initialSwitchFanInfoService.updateInitialSwitchFanInfo(initialSwitchFanInfo));
}
/**
* 删除风扇信息
*/
@RequiresPermissions("rocketmq:info:remove")
@Log(title = "风扇信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(initialSwitchFanInfoService.deleteInitialSwitchFanInfoByIds(ids));
}
}

View File

@@ -0,0 +1,98 @@
package com.ruoyi.rocketmq.controller;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.rocketmq.domain.InitialSwitchMpuInfo;
import com.ruoyi.rocketmq.service.IInitialSwitchMpuInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* MPU信息Controller
*
* @author gyt
* @date 2025-09-22
*/
@RestController
@RequestMapping("/switchMpuInfo")
public class InitialSwitchMpuInfoController extends BaseController
{
@Autowired
private IInitialSwitchMpuInfoService initialSwitchMpuInfoService;
/**
* 查询MPU信息列表
*/
@RequiresPermissions("rocketmq:info:list")
@GetMapping("/list")
public TableDataInfo list(InitialSwitchMpuInfo initialSwitchMpuInfo)
{
startPage();
List<InitialSwitchMpuInfo> list = initialSwitchMpuInfoService.selectInitialSwitchMpuInfoList(initialSwitchMpuInfo);
return getDataTable(list);
}
/**
* 导出MPU信息列表
*/
@RequiresPermissions("rocketmq:info:export")
@Log(title = "MPU信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, InitialSwitchMpuInfo initialSwitchMpuInfo)
{
List<InitialSwitchMpuInfo> list = initialSwitchMpuInfoService.selectInitialSwitchMpuInfoList(initialSwitchMpuInfo);
ExcelUtil<InitialSwitchMpuInfo> util = new ExcelUtil<InitialSwitchMpuInfo>(InitialSwitchMpuInfo.class);
util.exportExcel(response, list, "MPU信息数据");
}
/**
* 获取MPU信息详细信息
*/
@RequiresPermissions("rocketmq:info:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(initialSwitchMpuInfoService.selectInitialSwitchMpuInfoById(id));
}
/**
* 新增MPU信息
*/
@RequiresPermissions("rocketmq:info:add")
@Log(title = "MPU信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody InitialSwitchMpuInfo initialSwitchMpuInfo)
{
return toAjax(initialSwitchMpuInfoService.insertInitialSwitchMpuInfo(initialSwitchMpuInfo));
}
/**
* 修改MPU信息
*/
@RequiresPermissions("rocketmq:info:edit")
@Log(title = "MPU信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody InitialSwitchMpuInfo initialSwitchMpuInfo)
{
return toAjax(initialSwitchMpuInfoService.updateInitialSwitchMpuInfo(initialSwitchMpuInfo));
}
/**
* 删除MPU信息
*/
@RequiresPermissions("rocketmq:info:remove")
@Log(title = "MPU信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(initialSwitchMpuInfoService.deleteInitialSwitchMpuInfoByIds(ids));
}
}

View File

@@ -0,0 +1,105 @@
package com.ruoyi.rocketmq.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.rocketmq.domain.InitialSwitchOpticalModule;
import com.ruoyi.rocketmq.service.IInitialSwitchOpticalModuleService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.page.TableDataInfo;
/**
* 光模块信息Controller
*
* @author gyt
* @date 2025-09-22
*/
@RestController
@RequestMapping("/switchOpticalModule")
public class InitialSwitchOpticalModuleController extends BaseController
{
@Autowired
private IInitialSwitchOpticalModuleService initialSwitchOpticalModuleService;
/**
* 查询光模块信息列表
*/
@RequiresPermissions("rocketmq:module:list")
@GetMapping("/list")
public TableDataInfo list(InitialSwitchOpticalModule initialSwitchOpticalModule)
{
startPage();
List<InitialSwitchOpticalModule> list = initialSwitchOpticalModuleService.selectInitialSwitchOpticalModuleList(initialSwitchOpticalModule);
return getDataTable(list);
}
/**
* 导出光模块信息列表
*/
@RequiresPermissions("rocketmq:module:export")
@Log(title = "光模块信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, InitialSwitchOpticalModule initialSwitchOpticalModule)
{
List<InitialSwitchOpticalModule> list = initialSwitchOpticalModuleService.selectInitialSwitchOpticalModuleList(initialSwitchOpticalModule);
ExcelUtil<InitialSwitchOpticalModule> util = new ExcelUtil<InitialSwitchOpticalModule>(InitialSwitchOpticalModule.class);
util.exportExcel(response, list, "光模块信息数据");
}
/**
* 获取光模块信息详细信息
*/
@RequiresPermissions("rocketmq:module:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(initialSwitchOpticalModuleService.selectInitialSwitchOpticalModuleById(id));
}
/**
* 新增光模块信息
*/
@RequiresPermissions("rocketmq:module:add")
@Log(title = "光模块信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody InitialSwitchOpticalModule initialSwitchOpticalModule)
{
return toAjax(initialSwitchOpticalModuleService.insertInitialSwitchOpticalModule(initialSwitchOpticalModule));
}
/**
* 修改光模块信息
*/
@RequiresPermissions("rocketmq:module:edit")
@Log(title = "光模块信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody InitialSwitchOpticalModule initialSwitchOpticalModule)
{
return toAjax(initialSwitchOpticalModuleService.updateInitialSwitchOpticalModule(initialSwitchOpticalModule));
}
/**
* 删除光模块信息
*/
@RequiresPermissions("rocketmq:module:remove")
@Log(title = "光模块信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(initialSwitchOpticalModuleService.deleteInitialSwitchOpticalModuleByIds(ids));
}
}

View File

@@ -0,0 +1,105 @@
package com.ruoyi.rocketmq.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.rocketmq.domain.InitialSwitchOtherCollectData;
import com.ruoyi.rocketmq.service.IInitialSwitchOtherCollectDataService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.page.TableDataInfo;
/**
* 交换机系统其他信息采集数据Controller
*
* @author gyt
* @date 2025-09-23
*/
@RestController
@RequestMapping("/switchOtherData")
public class InitialSwitchOtherCollectDataController extends BaseController
{
@Autowired
private IInitialSwitchOtherCollectDataService initialSwitchOtherCollectDataService;
/**
* 查询交换机系统其他信息采集数据列表
*/
@RequiresPermissions("rocketmq:switchOtherData:list")
@GetMapping("/list")
public TableDataInfo list(InitialSwitchOtherCollectData initialSwitchOtherCollectData)
{
startPage();
List<InitialSwitchOtherCollectData> list = initialSwitchOtherCollectDataService.selectInitialSwitchOtherCollectDataList(initialSwitchOtherCollectData);
return getDataTable(list);
}
/**
* 导出交换机系统其他信息采集数据列表
*/
@RequiresPermissions("rocketmq:switchOtherData:export")
@Log(title = "交换机系统其他信息采集数据", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, InitialSwitchOtherCollectData initialSwitchOtherCollectData)
{
List<InitialSwitchOtherCollectData> list = initialSwitchOtherCollectDataService.selectInitialSwitchOtherCollectDataList(initialSwitchOtherCollectData);
ExcelUtil<InitialSwitchOtherCollectData> util = new ExcelUtil<InitialSwitchOtherCollectData>(InitialSwitchOtherCollectData.class);
util.exportExcel(response, list, "交换机系统其他信息采集数据数据");
}
/**
* 获取交换机系统其他信息采集数据详细信息
*/
@RequiresPermissions("rocketmq:switchOtherData:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(initialSwitchOtherCollectDataService.selectInitialSwitchOtherCollectDataById(id));
}
/**
* 新增交换机系统其他信息采集数据
*/
@RequiresPermissions("rocketmq:switchOtherData:add")
@Log(title = "交换机系统其他信息采集数据", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody InitialSwitchOtherCollectData initialSwitchOtherCollectData)
{
return toAjax(initialSwitchOtherCollectDataService.insertInitialSwitchOtherCollectData(initialSwitchOtherCollectData));
}
/**
* 修改交换机系统其他信息采集数据
*/
@RequiresPermissions("rocketmq:switchOtherData:edit")
@Log(title = "交换机系统其他信息采集数据", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody InitialSwitchOtherCollectData initialSwitchOtherCollectData)
{
return toAjax(initialSwitchOtherCollectDataService.updateInitialSwitchOtherCollectData(initialSwitchOtherCollectData));
}
/**
* 删除交换机系统其他信息采集数据
*/
@RequiresPermissions("rocketmq:switchOtherData:remove")
@Log(title = "交换机系统其他信息采集数据", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(initialSwitchOtherCollectDataService.deleteInitialSwitchOtherCollectDataByIds(ids));
}
}

View File

@@ -0,0 +1,98 @@
package com.ruoyi.rocketmq.controller;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.rocketmq.domain.InitialSwitchPowerSupply;
import com.ruoyi.rocketmq.service.IInitialSwitchPowerSupplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 电源信息Controller
*
* @author gyt
* @date 2025-09-22
*/
@RestController
@RequestMapping("/switchPowerSupply")
public class InitialSwitchPowerSupplyController extends BaseController
{
@Autowired
private IInitialSwitchPowerSupplyService initialSwitchPowerSupplyService;
/**
* 查询电源信息列表
*/
@RequiresPermissions("rocketmq:supply:list")
@GetMapping("/list")
public TableDataInfo list(InitialSwitchPowerSupply initialSwitchPowerSupply)
{
startPage();
List<InitialSwitchPowerSupply> list = initialSwitchPowerSupplyService.selectInitialSwitchPowerSupplyList(initialSwitchPowerSupply);
return getDataTable(list);
}
/**
* 导出电源信息列表
*/
@RequiresPermissions("rocketmq:supply:export")
@Log(title = "电源信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, InitialSwitchPowerSupply initialSwitchPowerSupply)
{
List<InitialSwitchPowerSupply> list = initialSwitchPowerSupplyService.selectInitialSwitchPowerSupplyList(initialSwitchPowerSupply);
ExcelUtil<InitialSwitchPowerSupply> util = new ExcelUtil<InitialSwitchPowerSupply>(InitialSwitchPowerSupply.class);
util.exportExcel(response, list, "电源信息数据");
}
/**
* 获取电源信息详细信息
*/
@RequiresPermissions("rocketmq:supply:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(initialSwitchPowerSupplyService.selectInitialSwitchPowerSupplyById(id));
}
/**
* 新增电源信息
*/
@RequiresPermissions("rocketmq:supply:add")
@Log(title = "电源信息", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody InitialSwitchPowerSupply initialSwitchPowerSupply)
{
return toAjax(initialSwitchPowerSupplyService.insertInitialSwitchPowerSupply(initialSwitchPowerSupply));
}
/**
* 修改电源信息
*/
@RequiresPermissions("rocketmq:supply:edit")
@Log(title = "电源信息", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody InitialSwitchPowerSupply initialSwitchPowerSupply)
{
return toAjax(initialSwitchPowerSupplyService.updateInitialSwitchPowerSupply(initialSwitchPowerSupply));
}
/**
* 删除电源信息
*/
@RequiresPermissions("rocketmq:supply:remove")
@Log(title = "电源信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(initialSwitchPowerSupplyService.deleteInitialSwitchPowerSupplyByIds(ids));
}
}

View File

@@ -0,0 +1,105 @@
package com.ruoyi.rocketmq.controller;
import java.util.List;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
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.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.rocketmq.domain.InitialSystemOtherCollectData;
import com.ruoyi.rocketmq.service.IInitialSystemOtherCollectDataService;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.page.TableDataInfo;
/**
* 交换机系统其他信息采集数据Controller
*
* @author gyt
* @date 2025-09-23
*/
@RestController
@RequestMapping("/systemOtherCollectData")
public class InitialSystemOtherCollectDataController extends BaseController
{
@Autowired
private IInitialSystemOtherCollectDataService initialSystemOtherCollectDataService;
/**
* 查询交换机系统其他信息采集数据列表
*/
@RequiresPermissions("rocketmq:systemOtherCollectData:list")
@GetMapping("/list")
public TableDataInfo list(InitialSystemOtherCollectData initialSystemOtherCollectData)
{
startPage();
List<InitialSystemOtherCollectData> list = initialSystemOtherCollectDataService.selectInitialSystemOtherCollectDataList(initialSystemOtherCollectData);
return getDataTable(list);
}
/**
* 导出交换机系统其他信息采集数据列表
*/
@RequiresPermissions("rocketmq:systemOtherCollectData:export")
@Log(title = "交换机系统其他信息采集数据", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, InitialSystemOtherCollectData initialSystemOtherCollectData)
{
List<InitialSystemOtherCollectData> list = initialSystemOtherCollectDataService.selectInitialSystemOtherCollectDataList(initialSystemOtherCollectData);
ExcelUtil<InitialSystemOtherCollectData> util = new ExcelUtil<InitialSystemOtherCollectData>(InitialSystemOtherCollectData.class);
util.exportExcel(response, list, "交换机系统其他信息采集数据数据");
}
/**
* 获取交换机系统其他信息采集数据详细信息
*/
@RequiresPermissions("rocketmq:systemOtherCollectData:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(initialSystemOtherCollectDataService.selectInitialSystemOtherCollectDataById(id));
}
/**
* 新增交换机系统其他信息采集数据
*/
@RequiresPermissions("rocketmq:systemOtherCollectData:add")
@Log(title = "交换机系统其他信息采集数据", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody InitialSystemOtherCollectData initialSystemOtherCollectData)
{
return toAjax(initialSystemOtherCollectDataService.insertInitialSystemOtherCollectData(initialSystemOtherCollectData));
}
/**
* 修改交换机系统其他信息采集数据
*/
@RequiresPermissions("rocketmq:systemOtherCollectData:edit")
@Log(title = "交换机系统其他信息采集数据", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody InitialSystemOtherCollectData initialSystemOtherCollectData)
{
return toAjax(initialSystemOtherCollectDataService.updateInitialSystemOtherCollectData(initialSystemOtherCollectData));
}
/**
* 删除交换机系统其他信息采集数据
*/
@RequiresPermissions("rocketmq:systemOtherCollectData:remove")
@Log(title = "交换机系统其他信息采集数据", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(initialSystemOtherCollectDataService.deleteInitialSystemOtherCollectDataByIds(ids));
}
}

View File

@@ -0,0 +1,112 @@
package com.ruoyi.rocketmq.controller;
import com.ruoyi.common.core.utils.poi.ExcelUtil;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.PageDomain;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.common.log.annotation.Log;
import com.ruoyi.common.log.enums.BusinessType;
import com.ruoyi.common.security.annotation.RequiresPermissions;
import com.ruoyi.rocketmq.domain.RmDeploymentPolicy;
import com.ruoyi.rocketmq.service.IRmDeploymentPolicyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* 服务器脚本策略Controller
*
* @author gyt
* @date 2025-09-15
*/
@RestController
@RequestMapping("/policy")
public class RmDeploymentPolicyController extends BaseController
{
@Autowired
private IRmDeploymentPolicyService rmDeploymentPolicyService;
/**
* 查询服务器脚本策略列表
*/
@RequiresPermissions("rocketmq:policy:list")
@PostMapping("/list")
public TableDataInfo list(@RequestBody RmDeploymentPolicy rmDeploymentPolicy)
{
PageDomain pageDomain = new PageDomain();
pageDomain.setPageNum(rmDeploymentPolicy.getPageNum());
pageDomain.setPageSize(rmDeploymentPolicy.getPageSize());
startPage(pageDomain);
List<RmDeploymentPolicy> list = rmDeploymentPolicyService.selectRmDeploymentPolicyList(rmDeploymentPolicy);
return getDataTable(list);
}
/**
* 导出服务器脚本策略列表
*/
@RequiresPermissions("rocketmq:policy:export")
@Log(title = "服务器脚本策略", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, RmDeploymentPolicy rmDeploymentPolicy)
{
List<RmDeploymentPolicy> list = rmDeploymentPolicyService.selectRmDeploymentPolicyList(rmDeploymentPolicy);
ExcelUtil<RmDeploymentPolicy> util = new ExcelUtil<RmDeploymentPolicy>(RmDeploymentPolicy.class);
util.exportExcel(response, list, "服务器脚本策略数据");
}
/**
* 获取服务器脚本策略详细信息
*/
@RequiresPermissions("rocketmq:policy:query")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return success(rmDeploymentPolicyService.selectRmDeploymentPolicyById(id));
}
/**
* 新增服务器脚本策略
*/
@RequiresPermissions("rocketmq:policy:add")
@Log(title = "服务器脚本策略", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody RmDeploymentPolicy rmDeploymentPolicy)
{
return toAjax(rmDeploymentPolicyService.insertRmDeploymentPolicy(rmDeploymentPolicy));
}
/**
* 修改服务器脚本策略
*/
@RequiresPermissions("rocketmq:policy:edit")
@Log(title = "服务器脚本策略", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody RmDeploymentPolicy rmDeploymentPolicy)
{
return toAjax(rmDeploymentPolicyService.updateRmDeploymentPolicy(rmDeploymentPolicy));
}
/**
* 删除服务器脚本策略
*/
@RequiresPermissions("rocketmq:policy:remove")
@Log(title = "服务器脚本策略", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(rmDeploymentPolicyService.deleteRmDeploymentPolicyByIds(ids));
}
/**
* 下发服务器脚本策略
*/
@RequiresPermissions("rocketmq:policy:list")
@GetMapping(value = "/issueDeploymentPolicy")
public AjaxResult issueDeploymentPolicy(Long id)
{
return success(rmDeploymentPolicyService.issueDeploymentPolicy(id));
}
}

View File

@@ -0,0 +1,316 @@
package com.ruoyi.rocketmq.domain;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
/**
* 系统其他信息监控数据对象 initial_other_system_monitor_data
*
* @author gyt
* @date 2025-09-23
*/
public class InitialOtherSystemMonitorData extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 客户端ID */
@Excel(name = "客户端ID")
private String clientId;
/** 交换卷/文件的可用空间(字节)采集 */
@Excel(name = "交换卷/文件的可用空间", readConverterExp = "字=节")
private Long systemSwapSizeFreeCollect;
/** 可用交换空间百分比采集 */
@Excel(name = "可用交换空间百分比采集")
private BigDecimal systemSwapSizePercentCollect;
/** 内存利用率采集 */
@Excel(name = "内存利用率采集")
private BigDecimal memoryUtilizationCollect;
/** 可用内存采集 */
@Excel(name = "可用内存采集")
private Long memorySizeAvailableCollect;
/** 可用内存百分比采集 */
@Excel(name = "可用内存百分比采集")
private BigDecimal memorySizePercentCollect;
/** 总内存采集 */
@Excel(name = "总内存采集")
private Long memorySizeTotalCollect;
/** 操作系统采集 */
@Excel(name = "操作系统采集")
private String systemSwOsCollect;
/** 操作系统架构采集 */
@Excel(name = "操作系统架构采集")
private String systemSwArchCollect;
/** 最大进程数采集 */
@Excel(name = "最大进程数采集")
private Long kernelMaxprocCollect;
/** 正在运行的进程数采集 */
@Excel(name = "正在运行的进程数采集")
private Long procNumRunCollect;
/** 登录用户数采集 */
@Excel(name = "登录用户数采集")
private Long systemUsersNumCollect;
/** 硬盘总可用空间采集 */
@Excel(name = "硬盘总可用空间采集")
private Long systemDiskSizeTotalCollect;
/** 系统启动时间采集 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "系统启动时间采集", width = 30, dateFormat = "yyyy-MM-dd")
private Date systemBoottimeCollect;
/** 系统描述采集 */
@Excel(name = "系统描述采集")
private String systemUnameCollect;
/** 系统本地时间采集 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "系统本地时间采集", width = 30, dateFormat = "yyyy-MM-dd")
private Date systemLocaltimeCollect;
/** 系统正常运行时间采集 */
@Excel(name = "系统正常运行时间采集")
private Long systemUptimeCollect;
/** 进程数采集 */
@Excel(name = "进程数采集")
private Long procNumCollect;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setClientId(String clientId)
{
this.clientId = clientId;
}
public String getClientId()
{
return clientId;
}
public void setSystemSwapSizeFreeCollect(Long systemSwapSizeFreeCollect)
{
this.systemSwapSizeFreeCollect = systemSwapSizeFreeCollect;
}
public Long getSystemSwapSizeFreeCollect()
{
return systemSwapSizeFreeCollect;
}
public void setSystemSwapSizePercentCollect(BigDecimal systemSwapSizePercentCollect)
{
this.systemSwapSizePercentCollect = systemSwapSizePercentCollect;
}
public BigDecimal getSystemSwapSizePercentCollect()
{
return systemSwapSizePercentCollect;
}
public void setMemoryUtilizationCollect(BigDecimal memoryUtilizationCollect)
{
this.memoryUtilizationCollect = memoryUtilizationCollect;
}
public BigDecimal getMemoryUtilizationCollect()
{
return memoryUtilizationCollect;
}
public void setMemorySizeAvailableCollect(Long memorySizeAvailableCollect)
{
this.memorySizeAvailableCollect = memorySizeAvailableCollect;
}
public Long getMemorySizeAvailableCollect()
{
return memorySizeAvailableCollect;
}
public void setMemorySizePercentCollect(BigDecimal memorySizePercentCollect)
{
this.memorySizePercentCollect = memorySizePercentCollect;
}
public BigDecimal getMemorySizePercentCollect()
{
return memorySizePercentCollect;
}
public void setMemorySizeTotalCollect(Long memorySizeTotalCollect)
{
this.memorySizeTotalCollect = memorySizeTotalCollect;
}
public Long getMemorySizeTotalCollect()
{
return memorySizeTotalCollect;
}
public void setSystemSwOsCollect(String systemSwOsCollect)
{
this.systemSwOsCollect = systemSwOsCollect;
}
public String getSystemSwOsCollect()
{
return systemSwOsCollect;
}
public void setSystemSwArchCollect(String systemSwArchCollect)
{
this.systemSwArchCollect = systemSwArchCollect;
}
public String getSystemSwArchCollect()
{
return systemSwArchCollect;
}
public void setKernelMaxprocCollect(Long kernelMaxprocCollect)
{
this.kernelMaxprocCollect = kernelMaxprocCollect;
}
public Long getKernelMaxprocCollect()
{
return kernelMaxprocCollect;
}
public void setProcNumRunCollect(Long procNumRunCollect)
{
this.procNumRunCollect = procNumRunCollect;
}
public Long getProcNumRunCollect()
{
return procNumRunCollect;
}
public void setSystemUsersNumCollect(Long systemUsersNumCollect)
{
this.systemUsersNumCollect = systemUsersNumCollect;
}
public Long getSystemUsersNumCollect()
{
return systemUsersNumCollect;
}
public void setSystemDiskSizeTotalCollect(Long systemDiskSizeTotalCollect)
{
this.systemDiskSizeTotalCollect = systemDiskSizeTotalCollect;
}
public Long getSystemDiskSizeTotalCollect()
{
return systemDiskSizeTotalCollect;
}
public void setSystemBoottimeCollect(Date systemBoottimeCollect)
{
this.systemBoottimeCollect = systemBoottimeCollect;
}
public Date getSystemBoottimeCollect()
{
return systemBoottimeCollect;
}
public void setSystemUnameCollect(String systemUnameCollect)
{
this.systemUnameCollect = systemUnameCollect;
}
public String getSystemUnameCollect()
{
return systemUnameCollect;
}
public void setSystemLocaltimeCollect(Date systemLocaltimeCollect)
{
this.systemLocaltimeCollect = systemLocaltimeCollect;
}
public Date getSystemLocaltimeCollect()
{
return systemLocaltimeCollect;
}
public void setSystemUptimeCollect(Long systemUptimeCollect)
{
this.systemUptimeCollect = systemUptimeCollect;
}
public Long getSystemUptimeCollect()
{
return systemUptimeCollect;
}
public void setProcNumCollect(Long procNumCollect)
{
this.procNumCollect = procNumCollect;
}
public Long getProcNumCollect()
{
return procNumCollect;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("clientId", getClientId())
.append("systemSwapSizeFreeCollect", getSystemSwapSizeFreeCollect())
.append("systemSwapSizePercentCollect", getSystemSwapSizePercentCollect())
.append("memoryUtilizationCollect", getMemoryUtilizationCollect())
.append("memorySizeAvailableCollect", getMemorySizeAvailableCollect())
.append("memorySizePercentCollect", getMemorySizePercentCollect())
.append("memorySizeTotalCollect", getMemorySizeTotalCollect())
.append("systemSwOsCollect", getSystemSwOsCollect())
.append("systemSwArchCollect", getSystemSwArchCollect())
.append("kernelMaxprocCollect", getKernelMaxprocCollect())
.append("procNumRunCollect", getProcNumRunCollect())
.append("systemUsersNumCollect", getSystemUsersNumCollect())
.append("systemDiskSizeTotalCollect", getSystemDiskSizeTotalCollect())
.append("systemBoottimeCollect", getSystemBoottimeCollect())
.append("systemUnameCollect", getSystemUnameCollect())
.append("systemLocaltimeCollect", getSystemLocaltimeCollect())
.append("systemUptimeCollect", getSystemUptimeCollect())
.append("procNumCollect", getProcNumCollect())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("createBy", getCreateBy())
.append("updateBy", getUpdateBy())
.toString();
}
}

View File

@@ -0,0 +1,101 @@
package com.ruoyi.rocketmq.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
/**
* 风扇信息对象 initial_switch_fan_info
*
* @author gyt
* @date 2025-09-22
*/
public class InitialSwitchFanInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 风扇索引 */
@Excel(name = "风扇索引")
private String fanEntIndex;
/** 风扇名称 */
@Excel(name = "风扇名称")
private String fanName;
/** 风扇状态 */
@Excel(name = "风扇状态")
private String fanEntityFanState;
/** 客户端ID */
@Excel(name = "客户端ID")
private String clientId;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setFanEntIndex(String fanEntIndex)
{
this.fanEntIndex = fanEntIndex;
}
public String getFanEntIndex()
{
return fanEntIndex;
}
public void setFanName(String fanName)
{
this.fanName = fanName;
}
public String getFanName()
{
return fanName;
}
public void setFanEntityFanState(String fanEntityFanState)
{
this.fanEntityFanState = fanEntityFanState;
}
public String getFanEntityFanState()
{
return fanEntityFanState;
}
public void setClientId(String clientId)
{
this.clientId = clientId;
}
public String getClientId()
{
return clientId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("fanEntIndex", getFanEntIndex())
.append("fanName", getFanName())
.append("fanEntityFanState", getFanEntityFanState())
.append("clientId", getClientId())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("createBy", getCreateBy())
.append("updateBy", getUpdateBy())
.toString();
}
}

View File

@@ -1,5 +1,7 @@
package com.ruoyi.rocketmq.domain;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import lombok.Data;
@@ -13,6 +15,7 @@ import java.math.BigDecimal;
* @date 2025-08-25
*/
@Data
@JsonIgnoreProperties(ignoreUnknown = true)
public class InitialSwitchInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
@@ -26,14 +29,19 @@ public class InitialSwitchInfo extends BaseEntity
private String clientId;
/** 名称 */
@JsonProperty("ifDescr")
private String name;
/** 接收流量 */
@JsonProperty("ifHCInOctets")
private BigDecimal inBytes;
/** 发送流量 */
@JsonProperty("ifHCOutOctets")
private BigDecimal outBytes;
/** 状态 */
@JsonProperty("ifOperStatus")
private String status;
/** 类型 */
@JsonProperty("ifType")
private String type;
/** 接收流量(bytes/s) */
private BigDecimal inSpeed;
@@ -41,6 +49,18 @@ public class InitialSwitchInfo extends BaseEntity
private BigDecimal outSpeed;
/** 交换机ip */
private String switchIp;
/** 端口配置速率(Mbps) */
private BigDecimal ifSpeed;
/** 入站丢包 */
private Integer ifInDiscards;
/** 出站丢包 */
private Integer ifOutDiscards;
/** 错误的入站数据包数量 */
private Integer ifInErrors;
/** 错误的出站数据包数量 */
private Integer ifOutErrors;
/** 端口索引 */
private Integer ifIndex;
}

View File

@@ -53,4 +53,16 @@ public class InitialSwitchInfoTemp extends BaseEntity
private BigDecimal outSpeed;
/** 交换机ip */
private String switchIp;
/** 端口配置速率(Mbps) */
private BigDecimal ifSpeed;
/** 入站丢包 */
private Integer ifInDiscards;
/** 出站丢包 */
private Integer ifOutDiscards;
/** 错误的入站数据包数量 */
private Integer ifInErrors;
/** 错误的出站数据包数量 */
private Integer ifOutErrors;
/** 端口索引 */
private Integer ifIndex;
}

View File

@@ -0,0 +1,147 @@
package com.ruoyi.rocketmq.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
/**
* MPU信息对象 initial_switch_mpu_info
*
* @author gyt
* @date 2025-09-22
*/
public class InitialSwitchMpuInfo extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** MPU索引 */
@Excel(name = "MPU索引")
private String mpuEntIndex;
/** MPU名称 */
@Excel(name = "MPU名称")
private String mpuName;
/** MPU的CPU使用率(%) */
@Excel(name = "MPU的CPU使用率(%)")
private BigDecimal mpuEntityCpuUsage;
/** MPU的内存使用率(%) */
@Excel(name = "MPU的内存使用率(%)")
private BigDecimal mpuEntityMemUsage;
/** MPU的操作系统 */
@Excel(name = "MPU的操作系统")
private String mpuPhysicalSoftwareRev;
/** MPU的温度(℃) */
@Excel(name = "MPU的温度(℃)")
private BigDecimal mpuEntityTemperature;
/** 客户端ID */
@Excel(name = "客户端ID")
private String clientId;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setMpuEntIndex(String mpuEntIndex)
{
this.mpuEntIndex = mpuEntIndex;
}
public String getMpuEntIndex()
{
return mpuEntIndex;
}
public void setMpuName(String mpuName)
{
this.mpuName = mpuName;
}
public String getMpuName()
{
return mpuName;
}
public void setMpuEntityCpuUsage(BigDecimal mpuEntityCpuUsage)
{
this.mpuEntityCpuUsage = mpuEntityCpuUsage;
}
public BigDecimal getMpuEntityCpuUsage()
{
return mpuEntityCpuUsage;
}
public void setMpuEntityMemUsage(BigDecimal mpuEntityMemUsage)
{
this.mpuEntityMemUsage = mpuEntityMemUsage;
}
public BigDecimal getMpuEntityMemUsage()
{
return mpuEntityMemUsage;
}
public void setMpuPhysicalSoftwareRev(String mpuPhysicalSoftwareRev)
{
this.mpuPhysicalSoftwareRev = mpuPhysicalSoftwareRev;
}
public String getMpuPhysicalSoftwareRev()
{
return mpuPhysicalSoftwareRev;
}
public void setMpuEntityTemperature(BigDecimal mpuEntityTemperature)
{
this.mpuEntityTemperature = mpuEntityTemperature;
}
public BigDecimal getMpuEntityTemperature()
{
return mpuEntityTemperature;
}
public void setClientId(String clientId)
{
this.clientId = clientId;
}
public String getClientId()
{
return clientId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("mpuEntIndex", getMpuEntIndex())
.append("mpuName", getMpuName())
.append("mpuEntityCpuUsage", getMpuEntityCpuUsage())
.append("mpuEntityMemUsage", getMpuEntityMemUsage())
.append("mpuPhysicalSoftwareRev", getMpuPhysicalSoftwareRev())
.append("mpuEntityTemperature", getMpuEntityTemperature())
.append("clientId", getClientId())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("createBy", getCreateBy())
.append("updateBy", getUpdateBy())
.toString();
}
}

View File

@@ -0,0 +1,147 @@
package com.ruoyi.rocketmq.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
/**
* 光模块信息对象 initial_switch_optical_module
*
* @author gyt
* @date 2025-09-22
*/
public class InitialSwitchOpticalModule extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 光模块端口索引 */
@Excel(name = "光模块端口索引")
private String fiberEntIndex;
/** 光模块端口名称 */
@Excel(name = "光模块端口名称")
private String fiberPortName;
/** 光模块发送光衰阈值(dBm) */
@Excel(name = "光模块发送光衰阈值(dBm)")
private BigDecimal hwEntityOpticalTxLowThreshold;
/** 光模块接收光衰阈值(dBm) */
@Excel(name = "光模块接收光衰阈值(dBm)")
private BigDecimal hwEntityOpticalRxLowThreshold;
/** 光模块接收功率(dBm) */
@Excel(name = "光模块接收功率(dBm)")
private BigDecimal hwEntityOpticalRxPower;
/** 光模块发送功率(dBm) */
@Excel(name = "光模块发送功率(dBm)")
private BigDecimal hwEntityOpticalTxPower;
/** 客户端ID */
@Excel(name = "客户端ID")
private String clientId;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setFiberEntIndex(String fiberEntIndex)
{
this.fiberEntIndex = fiberEntIndex;
}
public String getFiberEntIndex()
{
return fiberEntIndex;
}
public void setFiberPortName(String fiberPortName)
{
this.fiberPortName = fiberPortName;
}
public String getFiberPortName()
{
return fiberPortName;
}
public void setHwEntityOpticalTxLowThreshold(BigDecimal hwEntityOpticalTxLowThreshold)
{
this.hwEntityOpticalTxLowThreshold = hwEntityOpticalTxLowThreshold;
}
public BigDecimal getHwEntityOpticalTxLowThreshold()
{
return hwEntityOpticalTxLowThreshold;
}
public void setHwEntityOpticalRxLowThreshold(BigDecimal hwEntityOpticalRxLowThreshold)
{
this.hwEntityOpticalRxLowThreshold = hwEntityOpticalRxLowThreshold;
}
public BigDecimal getHwEntityOpticalRxLowThreshold()
{
return hwEntityOpticalRxLowThreshold;
}
public void setHwEntityOpticalRxPower(BigDecimal hwEntityOpticalRxPower)
{
this.hwEntityOpticalRxPower = hwEntityOpticalRxPower;
}
public BigDecimal getHwEntityOpticalRxPower()
{
return hwEntityOpticalRxPower;
}
public void setHwEntityOpticalTxPower(BigDecimal hwEntityOpticalTxPower)
{
this.hwEntityOpticalTxPower = hwEntityOpticalTxPower;
}
public BigDecimal getHwEntityOpticalTxPower()
{
return hwEntityOpticalTxPower;
}
public void setClientId(String clientId)
{
this.clientId = clientId;
}
public String getClientId()
{
return clientId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("fiberEntIndex", getFiberEntIndex())
.append("fiberPortName", getFiberPortName())
.append("hwEntityOpticalTxLowThreshold", getHwEntityOpticalTxLowThreshold())
.append("hwEntityOpticalRxLowThreshold", getHwEntityOpticalRxLowThreshold())
.append("hwEntityOpticalRxPower", getHwEntityOpticalRxPower())
.append("hwEntityOpticalTxPower", getHwEntityOpticalTxPower())
.append("clientId", getClientId())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("createBy", getCreateBy())
.append("updateBy", getUpdateBy())
.toString();
}
}

View File

@@ -0,0 +1,86 @@
package com.ruoyi.rocketmq.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
/**
* 交换机系统其他信息采集数据对象 initial_switch_other_collect_data
*
* @author gyt
* @date 2025-09-23
*/
public class InitialSwitchOtherCollectData extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 客户端ID */
@Excel(name = "客户端ID")
private String clientId;
/** 采集类型 */
@Excel(name = "采集类型")
private String collectType;
/** 采集值 */
@Excel(name = "采集值")
private String collectValue;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setClientId(String clientId)
{
this.clientId = clientId;
}
public String getClientId()
{
return clientId;
}
public void setCollectType(String collectType)
{
this.collectType = collectType;
}
public String getCollectType()
{
return collectType;
}
public void setCollectValue(String collectValue)
{
this.collectValue = collectValue;
}
public String getCollectValue()
{
return collectValue;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("clientId", getClientId())
.append("collectType", getCollectType())
.append("collectValue", getCollectValue())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("createBy", getCreateBy())
.append("updateBy", getUpdateBy())
.toString();
}
}

View File

@@ -0,0 +1,131 @@
package com.ruoyi.rocketmq.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
/**
* 电源信息对象 initial_switch_power_supply
*
* @author gyt
* @date 2025-09-22
*/
public class InitialSwitchPowerSupply extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 电源索引 */
@Excel(name = "电源索引")
private String pwrEntIndex;
/** 电源名称 */
@Excel(name = "电源名称")
private String pwrName;
/** 电源状态 */
@Excel(name = "电源状态")
private String pwrEntityPwrState;
/** 电源电流(mA) */
@Excel(name = "电源电流(mA)")
private Long pwrEntityPwrCurrent;
/** 电源电压(mV) */
@Excel(name = "电源电压(mV)")
private Long pwrEntityPwrVoltage;
/** 客户端ID */
@Excel(name = "客户端ID")
private String clientId;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setPwrEntIndex(String pwrEntIndex)
{
this.pwrEntIndex = pwrEntIndex;
}
public String getPwrEntIndex()
{
return pwrEntIndex;
}
public void setPwrName(String pwrName)
{
this.pwrName = pwrName;
}
public String getPwrName()
{
return pwrName;
}
public void setPwrEntityPwrState(String pwrEntityPwrState)
{
this.pwrEntityPwrState = pwrEntityPwrState;
}
public String getPwrEntityPwrState()
{
return pwrEntityPwrState;
}
public void setPwrEntityPwrCurrent(Long pwrEntityPwrCurrent)
{
this.pwrEntityPwrCurrent = pwrEntityPwrCurrent;
}
public Long getPwrEntityPwrCurrent()
{
return pwrEntityPwrCurrent;
}
public void setPwrEntityPwrVoltage(Long pwrEntityPwrVoltage)
{
this.pwrEntityPwrVoltage = pwrEntityPwrVoltage;
}
public Long getPwrEntityPwrVoltage()
{
return pwrEntityPwrVoltage;
}
public void setClientId(String clientId)
{
this.clientId = clientId;
}
public String getClientId()
{
return clientId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("pwrEntIndex", getPwrEntIndex())
.append("pwrName", getPwrName())
.append("pwrEntityPwrState", getPwrEntityPwrState())
.append("pwrEntityPwrCurrent", getPwrEntityPwrCurrent())
.append("pwrEntityPwrVoltage", getPwrEntityPwrVoltage())
.append("clientId", getClientId())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("createBy", getCreateBy())
.append("updateBy", getUpdateBy())
.toString();
}
}

View File

@@ -0,0 +1,86 @@
package com.ruoyi.rocketmq.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
/**
* 交换机系统其他信息采集数据对象 initial_system_other_collect_data
*
* @author gyt
* @date 2025-09-23
*/
public class InitialSystemOtherCollectData extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 客户端ID */
@Excel(name = "客户端ID")
private String clientId;
/** 采集类型 */
@Excel(name = "采集类型")
private String collectType;
/** 采集值 */
@Excel(name = "采集值")
private String collectValue;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setClientId(String clientId)
{
this.clientId = clientId;
}
public String getClientId()
{
return clientId;
}
public void setCollectType(String collectType)
{
this.collectType = collectType;
}
public String getCollectType()
{
return collectType;
}
public void setCollectValue(String collectValue)
{
this.collectValue = collectValue;
}
public String getCollectValue()
{
return collectValue;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("clientId", getClientId())
.append("collectType", getCollectType())
.append("collectValue", getCollectValue())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("createBy", getCreateBy())
.append("updateBy", getUpdateBy())
.toString();
}
}

View File

@@ -0,0 +1,80 @@
package com.ruoyi.rocketmq.domain;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import lombok.Data;
import java.util.Date;
/**
* 服务器脚本策略对象 rm_deployment_policy
*
* @author gyt
* @date 2025-09-15
*/
@Data
public class RmDeploymentPolicy extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 策略ID */
private Long id;
/** 策略名称 */
@Excel(name = "策略名称")
private String policyName;
/** 策略描述 */
@Excel(name = "策略描述")
private String description;
/** 关联资源组ID */
@Excel(name = "关联资源组ID")
private Long resourceGroupId;
/** 包含的设备ID列表逗号分隔 */
private String includedDevicesId;
/** 包含设备 */
@Excel(name = "包含设备")
private String includedDevicesName;
/** 源文件地址格式 */
@Excel(name = "源文件地址格式")
private String sourceFilePathType;
/** 源文件路径 */
@Excel(name = "源文件路径")
private String sourceFilePath;
/** 目标目录 */
@Excel(name = "目标目录")
private String targetDirectory;
/** 命令执行内容 */
@Excel(name = "命令执行内容")
private String commandContent;
/** 0=立即执行,1=定时执行 */
@Excel(name = "执行方式", readConverterExp = "0=立即执行,1=定时执行")
private Integer executionMethod;
/** 定时执行时间 */
@Excel(name = "定时执行时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date scheduledTime;
/** 定时执行时间(时间戳秒) */
private Long policyTime;
/** 策略状态0-未下发1-已下发 */
@Excel(name = "策略状态0-未下发1-已下发")
private String policyStatus;
/** 策略下发时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "策略下发时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date deployTime;
/** 脚本类型 */
@Excel(name = "脚本类型")
private String scriptType;
}

View File

@@ -3,7 +3,7 @@ package com.ruoyi.rocketmq.domain.vo;
import lombok.Data;
@Data
public class SwitchDataVo {
public class CollectDataVo {
/** 类型 */
private String type;
/** 数据 */

View File

@@ -12,6 +12,12 @@ public class RspVo {
* 描述
*/
private String resMag;
/**
* 描述
*/
private String resMsg;
private String result;
/**
* 时间戳
*/

View File

@@ -0,0 +1,54 @@
package com.ruoyi.rocketmq.domain.vo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.time.Instant;
import java.util.List;
@Data
public class ScriptPolicyVo {
/**
* 策略名称
*/
private String policyName;
/**
* 文件
*/
private List<ScriptFile> files;
// 目标路径地址
private String filePath;
// 命令
private List<String> commands;
// 执行方式0、立即执行1、定时执行
private int method;
// 执行方式为1、定时执行时必传-指定时间
private long policyTime;
// 时间戳
private long timestamp = Instant.now().getEpochSecond();
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public static class ScriptFile{
//文件类型0、平台文件地址1、外网HTTPS
private int fileType;
//文件类型为1、外网HTTPS时必传
private String fileUrl;
//文件类型为0、平台文件地址时必传文件名
private String fileName;
//文件类型为0、平台文件地址时必传文件流
private String fileData;
}
}

View File

@@ -1,13 +1,15 @@
package com.ruoyi.rocketmq.handler;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.enums.MsgEnum;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.rocketmq.domain.*;
import com.ruoyi.rocketmq.domain.vo.CollectDataVo;
import com.ruoyi.rocketmq.domain.vo.RspVo;
import com.ruoyi.rocketmq.domain.vo.SwitchDataVo;
import com.ruoyi.rocketmq.service.*;
import com.ruoyi.rocketmq.utils.JsonDataParser;
import com.ruoyi.system.api.RemoteRevenueConfigService;
@@ -71,6 +73,20 @@ public class DeviceMessageHandler {
private IInitialSwitchInfoTempService initialSwitchInfoTempService;
@Autowired
private IInitialHeartbeatListenLogService initialHeartbeatListenLog;
@Autowired
private IInitialSwitchPowerSupplyService initialSwitchPowerSupplyService;
@Autowired
private IInitialSwitchFanInfoService initialSwitchFanInfoService;
@Autowired
private IInitialSwitchMpuInfoService initialSwitchMpuInfoService;
@Autowired
private IInitialSwitchOpticalModuleService initialSwitchOpticalModuleService;
@Autowired
private IInitialSwitchOtherCollectDataService insertInitialSwitchOtherInfo;
@Autowired
private IInitialSystemOtherCollectDataService iInitialSystemOtherCollectDataService;
// 在类中添加
private static final ObjectMapper objectMapper = new ObjectMapper();
/**
@@ -90,13 +106,13 @@ public class DeviceMessageHandler {
registerHandler(MsgEnum.Agent版本更新应答.getValue(), this::handleResponseMessage);
// 其他类型消息可以单独注册处理器
// registerHandler(MsgEnum.CPU上报.getValue(), this::handleCpuMessage);
// registerHandler(MsgEnum.磁盘上报.getValue(), this::handleDiskMessage);
// registerHandler(MsgEnum.容器上报.getValue(), this::handleDockerMessage);
// registerHandler(MsgEnum.内存上报.getValue(), this::handleMemoryMessage);
// registerHandler(MsgEnum.网络上报.getValue(), this::handleNetMessage);
// registerHandler(MsgEnum.挂载上报.getValue(), this::handleMountPointMessage);
// registerHandler(MsgEnum.系统其他上报.getValue(), this::handleSystemMessage);
registerHandler(MsgEnum.CPU上报.getValue(), this::handleCpuMessage);
registerHandler(MsgEnum.磁盘上报.getValue(), this::handleDiskMessage);
registerHandler(MsgEnum.容器上报.getValue(), this::handleDockerMessage);
registerHandler(MsgEnum.内存上报.getValue(), this::handleMemoryMessage);
registerHandler(MsgEnum.网络上报.getValue(), this::handleNetMessage);
registerHandler(MsgEnum.挂载上报.getValue(), this::handleMountPointMessage);
registerHandler(MsgEnum.系统其他上报.getValue(), this::handleOtherSystemMessage);
registerHandler(MsgEnum.交换机上报.getValue(), this::handleSwitchDataMessage);
registerHandler(MsgEnum.心跳上报.getValue(), this::handleHeartbeatMessage);
}
@@ -133,7 +149,7 @@ public class DeviceMessageHandler {
if(!interfaces.isEmpty()){
// 时间戳转换
long timestamp = interfaces.get(0).getTimestamp();
long millis = timestamp < 1_000_000_000L ? timestamp * 1000 : timestamp;
long millis = timestamp * 1000;
Date createTime = new Date(millis / 1000 * 1000); // 去除毫秒
String timeStr = DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",createTime);
InitialBandwidthTraffic data = new InitialBandwidthTraffic();
@@ -163,7 +179,7 @@ public class DeviceMessageHandler {
if(!dockers.isEmpty()){
// 时间戳转换
long timestamp = dockers.get(0).getTimestamp();
long millis = timestamp < 1_000_000_000L ? timestamp * 1000 : timestamp;
long millis = timestamp * 1000;
Date createTime = new Date(millis / 1000 * 1000); // 去除毫秒
dockers.forEach(iface -> {
iface.setClientId(message.getClientId());
@@ -183,7 +199,7 @@ public class DeviceMessageHandler {
List<InitialCpuInfo> cpus = JsonDataParser.parseJsonData(message.getData(),InitialCpuInfo.class);
// 时间戳转换
long timestamp = cpus.get(0).getTimestamp();
long millis = timestamp < 1_000_000_000L ? timestamp * 1000 : timestamp;
long millis = timestamp * 1000;
Date createTime = new Date(millis / 1000 * 1000); // 去除毫秒
if(!cpus.isEmpty()){
cpus.forEach(iface -> {
@@ -204,7 +220,7 @@ public class DeviceMessageHandler {
List<InitialDiskInfo> disks = JsonDataParser.parseJsonData(message.getData(), InitialDiskInfo.class);
// 时间戳转换
long timestamp = disks.get(0).getTimestamp();
long millis = timestamp < 1_000_000_000L ? timestamp * 1000 : timestamp;
long millis = timestamp * 1000;
Date createTime = new Date(millis / 1000 * 1000); // 去除毫秒
if(!disks.isEmpty()){
disks.forEach(iface -> {
@@ -226,7 +242,7 @@ public class DeviceMessageHandler {
if(!memorys.isEmpty()){
// 时间戳转换
long timestamp = memorys.get(0).getTimestamp();
long millis = timestamp < 1_000_000_000L ? timestamp * 1000 : timestamp;
long millis = timestamp * 1000;
Date createTime = new Date(millis / 1000 * 1000); // 去除毫秒
memorys.forEach(iface -> {
iface.setClientId(message.getClientId());
@@ -247,7 +263,7 @@ public class DeviceMessageHandler {
if(!mountPointInfos.isEmpty()){
// 时间戳转换
long timestamp = mountPointInfos.get(0).getTimestamp();
long millis = timestamp < 1_000_000_000L ? timestamp * 1000 : timestamp;
long millis = timestamp * 1000;
Date createTime = new Date(millis / 1000 * 1000); // 去除毫秒
mountPointInfos.forEach(iface -> {
iface.setClientId(message.getClientId());
@@ -264,29 +280,230 @@ public class DeviceMessageHandler {
* @param message
*/
private void handleSwitchDataMessage(DeviceMessage message) {
List<SwitchDataVo> switchData = JsonDataParser.parseJsonData(message.getData(), SwitchDataVo.class);
List<CollectDataVo> switchData = JsonDataParser.parseJsonData(message.getData(), CollectDataVo.class);
if(!switchData.isEmpty()){
SwitchDataVo switchDataVo = switchData.get(0);
List<InitialSwitchInfo> switchInfos = JsonDataParser.parseJsonData(switchDataVo.getValue(), InitialSwitchInfo.class);
CollectDataVo switchDataVo = switchData.get(0);
switchDataVo.setValue(switchDataVo.getValue().replaceAll("\"noSuchInstance\"", "null"));
switch(switchDataVo.getType()){
case "switchNetCollect":
// handleSwitchMessage(message);
handleSwitchMessage(switchDataVo, message.getClientId());
break;
case "switchPwrCollect":
handleSwitchPwrMessage(switchDataVo, message.getClientId());
break;
case "switchModuleCollect":
handleSwitchModuleMessage(switchDataVo, message.getClientId());
break;
case "switchMpuCollect":
handleSwitchMpuMessage(switchDataVo, message.getClientId());
break;
case "switchFanCollect":
handleSwitchFanMessage(switchDataVo, message.getClientId());
break;
default:
handleSwitchOtherMessage(switchDataVo, message.getClientId());
break;
}
}else{
throw new RuntimeException("交换机data数据为空");
}
}
/**
* 电源发现数据
* @param switchDataVo
*/
private void handleSwitchPwrMessage(CollectDataVo switchDataVo, String clientId){
List<InitialSwitchPowerSupply> powerSupplyList = JsonDataParser.parseJsonData(switchDataVo.getValue(), InitialSwitchPowerSupply.class);
if (!powerSupplyList.isEmpty()){
InitialSwitchPowerSupply insertData = powerSupplyList.get(0);
// 时间戳转换
long timestamp = switchDataVo.getTimestamp();
long millis = timestamp * 1000;
Date createTime = new Date(millis / 1000 * 1000); // 去除毫秒
insertData.setClientId(clientId);
insertData.setCreateTime(createTime);
initialSwitchPowerSupplyService.insertInitialSwitchPowerSupply(insertData);
}
}
/**
* 光模块发现数据
* @param switchDataVo
*/
private void handleSwitchModuleMessage(CollectDataVo switchDataVo, String clientId){
List<InitialSwitchOpticalModule> moduleList = JsonDataParser.parseJsonData(switchDataVo.getValue(), InitialSwitchOpticalModule.class);
if (!moduleList.isEmpty()){
InitialSwitchOpticalModule insertData = moduleList.get(0);
// 时间戳转换
long timestamp = switchDataVo.getTimestamp();
long millis = timestamp * 1000;
Date createTime = new Date(millis / 1000 * 1000); // 去除毫秒
insertData.setClientId(clientId);
insertData.setCreateTime(createTime);
initialSwitchOpticalModuleService.insertInitialSwitchOpticalModule(insertData);
}
}
/**
* MPU发现数据
* @param switchDataVo
*/
private void handleSwitchMpuMessage(CollectDataVo switchDataVo, String clientId){
List<InitialSwitchMpuInfo> mpuList = JsonDataParser.parseJsonData(switchDataVo.getValue(), InitialSwitchMpuInfo.class);
if (!mpuList.isEmpty()){
InitialSwitchMpuInfo insertData = mpuList.get(0);
// 时间戳转换
long timestamp = switchDataVo.getTimestamp();
long millis = timestamp * 1000;
Date createTime = new Date(millis / 1000 * 1000); // 去除毫秒
insertData.setClientId(clientId);
insertData.setCreateTime(createTime);
initialSwitchMpuInfoService.insertInitialSwitchMpuInfo(insertData);
}
}
/**
* 风扇发现数据
* @param switchDataVo
*/
private void handleSwitchFanMessage(CollectDataVo switchDataVo, String clientId){
List<InitialSwitchFanInfo> fanList = JsonDataParser.parseJsonData(switchDataVo.getValue(), InitialSwitchFanInfo.class);
if (!fanList.isEmpty()){
InitialSwitchFanInfo insertData = fanList.get(0);
// 时间戳转换
long timestamp = switchDataVo.getTimestamp();
long millis = timestamp * 1000;
Date createTime = new Date(millis / 1000 * 1000); // 去除毫秒
insertData.setClientId(clientId);
insertData.setCreateTime(createTime);
initialSwitchFanInfoService.insertInitialSwitchFanInfo(insertData);
}
}
/**
* 其他发现数据(默认处理)
* @param switchDataVo
*/
private void handleSwitchOtherMessage(CollectDataVo switchDataVo, String clientId){
if (switchDataVo != null){
try {
InitialSwitchOtherCollectData insertData = new InitialSwitchOtherCollectData();
// 时间戳转换
long timestamp = switchDataVo.getTimestamp();
long millis = timestamp * 1000;
Date createTime = new Date(millis / 1000 * 1000); // 去除毫秒
insertData.setClientId(clientId);
insertData.setCreateTime(createTime);
String value = switchDataVo.getValue();
// 解析JSON字符串
JsonNode jsonNode = objectMapper.readTree(value);
// 获取第一个字段的key和value
if (jsonNode.isObject() && jsonNode.fields().hasNext()) {
Map.Entry<String, JsonNode> entry = jsonNode.fields().next();
String fieldName = entry.getKey();
String fieldValue = entry.getValue().asText();
insertData.setCollectType(fieldName);
if(!"null".equals(fieldValue)){
insertData.setCollectValue(fieldValue);
}
} else if (jsonNode.isArray() && jsonNode.size() > 0) {
// 处理数组格式 [{}]
JsonNode firstElement = jsonNode.get(0);
if (firstElement.isObject() && firstElement.fields().hasNext()) {
Map.Entry<String, JsonNode> entry = firstElement.fields().next();
String fieldName = entry.getKey();
String fieldValue = entry.getValue().asText();
insertData.setCollectType(fieldName);
if(!"null".equals(fieldValue)){
insertData.setCollectValue(fieldValue);
}
}
}
insertInitialSwitchOtherInfo.insertInitialSwitchOtherCollectData(insertData);
} catch (Exception e) {
log.error("解析JSON数据失败: {}, value: {}", e.getMessage(), switchDataVo.getValue());
// 可以选择保存原始数据或进行其他错误处理
}
}
}
/**
* 交换机数据入库
* @param switchDataVo
*/
private void handleSwitchMessage(CollectDataVo switchDataVo, String clientId) {
List<InitialSwitchInfo> switchInfos = JsonDataParser.parseJsonData(switchDataVo.getValue(), InitialSwitchInfo.class);
if(!switchInfos.isEmpty()){
// 时间戳转换
long timestamp = switchDataVo.getTimestamp();
long millis = timestamp * 1000;
Date createTime = new Date(millis / 1000 * 1000); // 去除毫秒
String timeStr = DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",createTime);
// 查询临时表信息,计算实际流量值
InitialSwitchInfoTemp temp = new InitialSwitchInfoTemp();
temp.setClientId(clientId);
List<InitialSwitchInfoTemp> tempList = initialSwitchInfoTempService.selectInitialSwitchInfoTempList(temp);
if(!tempList.isEmpty()){
// 1. 构建快速查找的Map
Map<String, InitialSwitchInfoTemp> tempMap = tempList.stream()
.collect(Collectors.toMap(
InitialSwitchInfoTemp::getName,
Function.identity(),
(existing, replacement) -> existing
));
// 2. 预计算除数(避免重复创建对象)
BigDecimal divisor = new BigDecimal(300);
// 3. 计算速度
switchInfos.forEach(switchInfo -> {
switchInfo.setClientId(clientId);
switchInfo.setCreateTime(createTime);
InitialSwitchInfoTemp tempInfo = tempMap.get(switchInfo.getName());
if (tempInfo != null) {
// 计算inSpeed
if (switchInfo.getInBytes() != null && tempInfo.getInBytes() != null) {
BigDecimal inDiff = switchInfo.getInBytes().subtract(tempInfo.getInBytes());
switchInfo.setInSpeed(inDiff.divide(divisor, 2, RoundingMode.HALF_UP));
}
// 计算outSpeed
if (switchInfo.getOutBytes() != null && tempInfo.getOutBytes() != null) {
BigDecimal outDiff = switchInfo.getOutBytes().subtract(tempInfo.getOutBytes());
switchInfo.setOutSpeed(outDiff.divide(divisor, 2, RoundingMode.HALF_UP));
}
}
});
}else{
switchInfos.forEach(switchInfo -> {
switchInfo.setClientId(clientId);
switchInfo.setCreateTime(createTime);
});
}
// 清空临时表对应switch信息
initialSwitchInfoTempService.truncateSwitchInfoTemp(clientId);
// 临时表 用来计算inSpeed outSeppd
initialSwitchInfoTempService.batchInsertInitialSwitchInfoTemp(switchInfos);
// 初始交换机数据入库
initialSwitchInfoService.batchInsertInitialSwitchInfo(switchInfos);
// 业务表入库
InitialSwitchInfoDetailsRemote detailsRemote = new InitialSwitchInfoDetailsRemote();
detailsRemote.setClientId(clientId);
detailsRemote.setStartTime(timeStr);
detailsRemote.setEndTime(timeStr);
remoteRevenueConfigService.autoSaveSwitchTraffic(detailsRemote, SecurityConstants.INNER);
}else{
throw new RuntimeException("交换机data数据为空");
}
}
/**
* 交换机数据入库
* @param message
@@ -296,7 +513,7 @@ public class DeviceMessageHandler {
if(!switchInfos.isEmpty()){
// 时间戳转换
long timestamp = switchInfos.get(0).getTimestamp();
long millis = timestamp < 1_000_000_000L ? timestamp * 1000 : timestamp;
long millis = timestamp * 1000;
Date createTime = new Date(millis / 1000 * 1000); // 去除毫秒
String timeStr = DateUtils.parseDateToStr("yyyy-MM-dd HH:mm:ss",createTime);
// 查询临时表信息,计算实际流量值
@@ -356,6 +573,39 @@ public class DeviceMessageHandler {
throw new RuntimeException("交换机data数据为空");
}
}
/**
* 系统其他信息
* @param message
*/
private void handleOtherSystemMessage(DeviceMessage message) {
List<CollectDataVo> otherData = JsonDataParser.parseJsonData(message.getData(), CollectDataVo.class);
if(!otherData.isEmpty()){
CollectDataVo systemDataVo = otherData.get(0);
if (systemDataVo != null){
try {
InitialSystemOtherCollectData insertData = new InitialSystemOtherCollectData();
// 时间戳转换
long timestamp = systemDataVo.getTimestamp();
long millis = timestamp * 1000;
Date createTime = new Date(millis / 1000 * 1000); // 去除毫秒
insertData.setClientId(message.getClientId());
insertData.setCreateTime(createTime);
String collectType = systemDataVo.getType();
String collectValue = systemDataVo.getValue();
insertData.setCollectType(collectType);
insertData.setCollectValue(collectValue);
iInitialSystemOtherCollectDataService.insertInitialSystemOtherCollectData(insertData);
} catch (Exception e) {
log.error("解析JSON数据失败: {}, value: {}", e.getMessage(), systemDataVo.getValue());
// 可以选择保存原始数据或进行其他错误处理
}
}
}
}
/**
* 系统数据入库
* @param message
@@ -365,7 +615,7 @@ public class DeviceMessageHandler {
if(!systemInfos.isEmpty()){
// 时间戳转换
long timestamp = systemInfos.get(0).getTimestamp();
long millis = timestamp < 1_000_000_000L ? timestamp * 1000 : timestamp;
long millis = timestamp * 1000;
Date createTime = new Date(millis / 1000 * 1000); // 去除毫秒
systemInfos.forEach(iface -> {
iface.setClientId(message.getClientId());
@@ -544,6 +794,19 @@ public class DeviceMessageHandler {
}
return null;
}
/**
* 脚本策略应答信息
* @param message
*/
private RspVo handleScriptRspMessage(DeviceMessage message) {
List<RspVo> rspVoList = JsonDataParser.parseJsonData(message.getData(), RspVo.class);
if (!rspVoList.isEmpty()) {
RspVo rsp = rspVoList.get(0);
log.info("应答信息:{}",rsp);
return rsp;
}
return null;
}
/**
* 注册应答处理
* @param message

View File

@@ -0,0 +1,61 @@
package com.ruoyi.rocketmq.mapper;
import java.util.List;
import com.ruoyi.rocketmq.domain.InitialOtherSystemMonitorData;
/**
* 系统其他信息监控数据Mapper接口
*
* @author gyt
* @date 2025-09-23
*/
public interface InitialOtherSystemMonitorDataMapper
{
/**
* 查询系统其他信息监控数据
*
* @param id 系统其他信息监控数据主键
* @return 系统其他信息监控数据
*/
public InitialOtherSystemMonitorData selectInitialOtherSystemMonitorDataById(Long id);
/**
* 查询系统其他信息监控数据列表
*
* @param initialOtherSystemMonitorData 系统其他信息监控数据
* @return 系统其他信息监控数据集合
*/
public List<InitialOtherSystemMonitorData> selectInitialOtherSystemMonitorDataList(InitialOtherSystemMonitorData initialOtherSystemMonitorData);
/**
* 新增系统其他信息监控数据
*
* @param initialOtherSystemMonitorData 系统其他信息监控数据
* @return 结果
*/
public int insertInitialOtherSystemMonitorData(InitialOtherSystemMonitorData initialOtherSystemMonitorData);
/**
* 修改系统其他信息监控数据
*
* @param initialOtherSystemMonitorData 系统其他信息监控数据
* @return 结果
*/
public int updateInitialOtherSystemMonitorData(InitialOtherSystemMonitorData initialOtherSystemMonitorData);
/**
* 删除系统其他信息监控数据
*
* @param id 系统其他信息监控数据主键
* @return 结果
*/
public int deleteInitialOtherSystemMonitorDataById(Long id);
/**
* 批量删除系统其他信息监控数据
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteInitialOtherSystemMonitorDataByIds(Long[] ids);
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.rocketmq.mapper;
import java.util.List;
import com.ruoyi.rocketmq.domain.InitialSwitchFanInfo;
/**
* 风扇信息Mapper接口
*
* @author gyt
* @date 2025-09-22
*/
public interface InitialSwitchFanInfoMapper
{
/**
* 查询风扇信息
*
* @param id 风扇信息主键
* @return 风扇信息
*/
public InitialSwitchFanInfo selectInitialSwitchFanInfoById(Long id);
/**
* 查询风扇信息列表
*
* @param initialSwitchFanInfo 风扇信息
* @return 风扇信息集合
*/
public List<InitialSwitchFanInfo> selectInitialSwitchFanInfoList(InitialSwitchFanInfo initialSwitchFanInfo);
/**
* 新增风扇信息
*
* @param initialSwitchFanInfo 风扇信息
* @return 结果
*/
public int insertInitialSwitchFanInfo(InitialSwitchFanInfo initialSwitchFanInfo);
/**
* 修改风扇信息
*
* @param initialSwitchFanInfo 风扇信息
* @return 结果
*/
public int updateInitialSwitchFanInfo(InitialSwitchFanInfo initialSwitchFanInfo);
/**
* 删除风扇信息
*
* @param id 风扇信息主键
* @return 结果
*/
public int deleteInitialSwitchFanInfoById(Long id);
/**
* 批量删除风扇信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteInitialSwitchFanInfoByIds(Long[] ids);
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.rocketmq.mapper;
import java.util.List;
import com.ruoyi.rocketmq.domain.InitialSwitchMpuInfo;
/**
* MPU信息Mapper接口
*
* @author gyt
* @date 2025-09-22
*/
public interface InitialSwitchMpuInfoMapper
{
/**
* 查询MPU信息
*
* @param id MPU信息主键
* @return MPU信息
*/
public InitialSwitchMpuInfo selectInitialSwitchMpuInfoById(Long id);
/**
* 查询MPU信息列表
*
* @param initialSwitchMpuInfo MPU信息
* @return MPU信息集合
*/
public List<InitialSwitchMpuInfo> selectInitialSwitchMpuInfoList(InitialSwitchMpuInfo initialSwitchMpuInfo);
/**
* 新增MPU信息
*
* @param initialSwitchMpuInfo MPU信息
* @return 结果
*/
public int insertInitialSwitchMpuInfo(InitialSwitchMpuInfo initialSwitchMpuInfo);
/**
* 修改MPU信息
*
* @param initialSwitchMpuInfo MPU信息
* @return 结果
*/
public int updateInitialSwitchMpuInfo(InitialSwitchMpuInfo initialSwitchMpuInfo);
/**
* 删除MPU信息
*
* @param id MPU信息主键
* @return 结果
*/
public int deleteInitialSwitchMpuInfoById(Long id);
/**
* 批量删除MPU信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteInitialSwitchMpuInfoByIds(Long[] ids);
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.rocketmq.mapper;
import java.util.List;
import com.ruoyi.rocketmq.domain.InitialSwitchOpticalModule;
/**
* 光模块信息Mapper接口
*
* @author gyt
* @date 2025-09-22
*/
public interface InitialSwitchOpticalModuleMapper
{
/**
* 查询光模块信息
*
* @param id 光模块信息主键
* @return 光模块信息
*/
public InitialSwitchOpticalModule selectInitialSwitchOpticalModuleById(Long id);
/**
* 查询光模块信息列表
*
* @param initialSwitchOpticalModule 光模块信息
* @return 光模块信息集合
*/
public List<InitialSwitchOpticalModule> selectInitialSwitchOpticalModuleList(InitialSwitchOpticalModule initialSwitchOpticalModule);
/**
* 新增光模块信息
*
* @param initialSwitchOpticalModule 光模块信息
* @return 结果
*/
public int insertInitialSwitchOpticalModule(InitialSwitchOpticalModule initialSwitchOpticalModule);
/**
* 修改光模块信息
*
* @param initialSwitchOpticalModule 光模块信息
* @return 结果
*/
public int updateInitialSwitchOpticalModule(InitialSwitchOpticalModule initialSwitchOpticalModule);
/**
* 删除光模块信息
*
* @param id 光模块信息主键
* @return 结果
*/
public int deleteInitialSwitchOpticalModuleById(Long id);
/**
* 批量删除光模块信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteInitialSwitchOpticalModuleByIds(Long[] ids);
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.rocketmq.mapper;
import java.util.List;
import com.ruoyi.rocketmq.domain.InitialSwitchOtherCollectData;
/**
* 交换机系统其他信息采集数据Mapper接口
*
* @author gyt
* @date 2025-09-23
*/
public interface InitialSwitchOtherCollectDataMapper
{
/**
* 查询交换机系统其他信息采集数据
*
* @param id 交换机系统其他信息采集数据主键
* @return 交换机系统其他信息采集数据
*/
public InitialSwitchOtherCollectData selectInitialSwitchOtherCollectDataById(Long id);
/**
* 查询交换机系统其他信息采集数据列表
*
* @param initialSwitchOtherCollectData 交换机系统其他信息采集数据
* @return 交换机系统其他信息采集数据集合
*/
public List<InitialSwitchOtherCollectData> selectInitialSwitchOtherCollectDataList(InitialSwitchOtherCollectData initialSwitchOtherCollectData);
/**
* 新增交换机系统其他信息采集数据
*
* @param initialSwitchOtherCollectData 交换机系统其他信息采集数据
* @return 结果
*/
public int insertInitialSwitchOtherCollectData(InitialSwitchOtherCollectData initialSwitchOtherCollectData);
/**
* 修改交换机系统其他信息采集数据
*
* @param initialSwitchOtherCollectData 交换机系统其他信息采集数据
* @return 结果
*/
public int updateInitialSwitchOtherCollectData(InitialSwitchOtherCollectData initialSwitchOtherCollectData);
/**
* 删除交换机系统其他信息采集数据
*
* @param id 交换机系统其他信息采集数据主键
* @return 结果
*/
public int deleteInitialSwitchOtherCollectDataById(Long id);
/**
* 批量删除交换机系统其他信息采集数据
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteInitialSwitchOtherCollectDataByIds(Long[] ids);
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.rocketmq.mapper;
import java.util.List;
import com.ruoyi.rocketmq.domain.InitialSwitchPowerSupply;
/**
* 电源信息Mapper接口
*
* @author gyt
* @date 2025-09-22
*/
public interface InitialSwitchPowerSupplyMapper
{
/**
* 查询电源信息
*
* @param id 电源信息主键
* @return 电源信息
*/
public InitialSwitchPowerSupply selectInitialSwitchPowerSupplyById(Long id);
/**
* 查询电源信息列表
*
* @param initialSwitchPowerSupply 电源信息
* @return 电源信息集合
*/
public List<InitialSwitchPowerSupply> selectInitialSwitchPowerSupplyList(InitialSwitchPowerSupply initialSwitchPowerSupply);
/**
* 新增电源信息
*
* @param initialSwitchPowerSupply 电源信息
* @return 结果
*/
public int insertInitialSwitchPowerSupply(InitialSwitchPowerSupply initialSwitchPowerSupply);
/**
* 修改电源信息
*
* @param initialSwitchPowerSupply 电源信息
* @return 结果
*/
public int updateInitialSwitchPowerSupply(InitialSwitchPowerSupply initialSwitchPowerSupply);
/**
* 删除电源信息
*
* @param id 电源信息主键
* @return 结果
*/
public int deleteInitialSwitchPowerSupplyById(Long id);
/**
* 批量删除电源信息
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteInitialSwitchPowerSupplyByIds(Long[] ids);
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.rocketmq.mapper;
import java.util.List;
import com.ruoyi.rocketmq.domain.InitialSystemOtherCollectData;
/**
* 交换机系统其他信息采集数据Mapper接口
*
* @author gyt
* @date 2025-09-23
*/
public interface InitialSystemOtherCollectDataMapper
{
/**
* 查询交换机系统其他信息采集数据
*
* @param id 交换机系统其他信息采集数据主键
* @return 交换机系统其他信息采集数据
*/
public InitialSystemOtherCollectData selectInitialSystemOtherCollectDataById(Long id);
/**
* 查询交换机系统其他信息采集数据列表
*
* @param initialSystemOtherCollectData 交换机系统其他信息采集数据
* @return 交换机系统其他信息采集数据集合
*/
public List<InitialSystemOtherCollectData> selectInitialSystemOtherCollectDataList(InitialSystemOtherCollectData initialSystemOtherCollectData);
/**
* 新增交换机系统其他信息采集数据
*
* @param initialSystemOtherCollectData 交换机系统其他信息采集数据
* @return 结果
*/
public int insertInitialSystemOtherCollectData(InitialSystemOtherCollectData initialSystemOtherCollectData);
/**
* 修改交换机系统其他信息采集数据
*
* @param initialSystemOtherCollectData 交换机系统其他信息采集数据
* @return 结果
*/
public int updateInitialSystemOtherCollectData(InitialSystemOtherCollectData initialSystemOtherCollectData);
/**
* 删除交换机系统其他信息采集数据
*
* @param id 交换机系统其他信息采集数据主键
* @return 结果
*/
public int deleteInitialSystemOtherCollectDataById(Long id);
/**
* 批量删除交换机系统其他信息采集数据
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteInitialSystemOtherCollectDataByIds(Long[] ids);
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.rocketmq.mapper;
import java.util.List;
import com.ruoyi.rocketmq.domain.RmDeploymentPolicy;
/**
* 服务器脚本策略Mapper接口
*
* @author gyt
* @date 2025-09-15
*/
public interface RmDeploymentPolicyMapper
{
/**
* 查询服务器脚本策略
*
* @param id 服务器脚本策略主键
* @return 服务器脚本策略
*/
public RmDeploymentPolicy selectRmDeploymentPolicyById(Long id);
/**
* 查询服务器脚本策略列表
*
* @param rmDeploymentPolicy 服务器脚本策略
* @return 服务器脚本策略集合
*/
public List<RmDeploymentPolicy> selectRmDeploymentPolicyList(RmDeploymentPolicy rmDeploymentPolicy);
/**
* 新增服务器脚本策略
*
* @param rmDeploymentPolicy 服务器脚本策略
* @return 结果
*/
public int insertRmDeploymentPolicy(RmDeploymentPolicy rmDeploymentPolicy);
/**
* 修改服务器脚本策略
*
* @param rmDeploymentPolicy 服务器脚本策略
* @return 结果
*/
public int updateRmDeploymentPolicy(RmDeploymentPolicy rmDeploymentPolicy);
/**
* 删除服务器脚本策略
*
* @param id 服务器脚本策略主键
* @return 结果
*/
public int deleteRmDeploymentPolicyById(Long id);
/**
* 批量删除服务器脚本策略
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteRmDeploymentPolicyByIds(Long[] ids);
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.rocketmq.service;
import java.util.List;
import com.ruoyi.rocketmq.domain.InitialOtherSystemMonitorData;
/**
* 系统其他信息监控数据Service接口
*
* @author gyt
* @date 2025-09-23
*/
public interface IInitialOtherSystemMonitorDataService
{
/**
* 查询系统其他信息监控数据
*
* @param id 系统其他信息监控数据主键
* @return 系统其他信息监控数据
*/
public InitialOtherSystemMonitorData selectInitialOtherSystemMonitorDataById(Long id);
/**
* 查询系统其他信息监控数据列表
*
* @param initialOtherSystemMonitorData 系统其他信息监控数据
* @return 系统其他信息监控数据集合
*/
public List<InitialOtherSystemMonitorData> selectInitialOtherSystemMonitorDataList(InitialOtherSystemMonitorData initialOtherSystemMonitorData);
/**
* 新增系统其他信息监控数据
*
* @param initialOtherSystemMonitorData 系统其他信息监控数据
* @return 结果
*/
public int insertInitialOtherSystemMonitorData(InitialOtherSystemMonitorData initialOtherSystemMonitorData);
/**
* 修改系统其他信息监控数据
*
* @param initialOtherSystemMonitorData 系统其他信息监控数据
* @return 结果
*/
public int updateInitialOtherSystemMonitorData(InitialOtherSystemMonitorData initialOtherSystemMonitorData);
/**
* 批量删除系统其他信息监控数据
*
* @param ids 需要删除的系统其他信息监控数据主键集合
* @return 结果
*/
public int deleteInitialOtherSystemMonitorDataByIds(Long[] ids);
/**
* 删除系统其他信息监控数据信息
*
* @param id 系统其他信息监控数据主键
* @return 结果
*/
public int deleteInitialOtherSystemMonitorDataById(Long id);
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.rocketmq.service;
import java.util.List;
import com.ruoyi.rocketmq.domain.InitialSwitchFanInfo;
/**
* 风扇信息Service接口
*
* @author gyt
* @date 2025-09-22
*/
public interface IInitialSwitchFanInfoService
{
/**
* 查询风扇信息
*
* @param id 风扇信息主键
* @return 风扇信息
*/
public InitialSwitchFanInfo selectInitialSwitchFanInfoById(Long id);
/**
* 查询风扇信息列表
*
* @param initialSwitchFanInfo 风扇信息
* @return 风扇信息集合
*/
public List<InitialSwitchFanInfo> selectInitialSwitchFanInfoList(InitialSwitchFanInfo initialSwitchFanInfo);
/**
* 新增风扇信息
*
* @param initialSwitchFanInfo 风扇信息
* @return 结果
*/
public int insertInitialSwitchFanInfo(InitialSwitchFanInfo initialSwitchFanInfo);
/**
* 修改风扇信息
*
* @param initialSwitchFanInfo 风扇信息
* @return 结果
*/
public int updateInitialSwitchFanInfo(InitialSwitchFanInfo initialSwitchFanInfo);
/**
* 批量删除风扇信息
*
* @param ids 需要删除的风扇信息主键集合
* @return 结果
*/
public int deleteInitialSwitchFanInfoByIds(Long[] ids);
/**
* 删除风扇信息信息
*
* @param id 风扇信息主键
* @return 结果
*/
public int deleteInitialSwitchFanInfoById(Long id);
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.rocketmq.service;
import java.util.List;
import com.ruoyi.rocketmq.domain.InitialSwitchMpuInfo;
/**
* MPU信息Service接口
*
* @author gyt
* @date 2025-09-22
*/
public interface IInitialSwitchMpuInfoService
{
/**
* 查询MPU信息
*
* @param id MPU信息主键
* @return MPU信息
*/
public InitialSwitchMpuInfo selectInitialSwitchMpuInfoById(Long id);
/**
* 查询MPU信息列表
*
* @param initialSwitchMpuInfo MPU信息
* @return MPU信息集合
*/
public List<InitialSwitchMpuInfo> selectInitialSwitchMpuInfoList(InitialSwitchMpuInfo initialSwitchMpuInfo);
/**
* 新增MPU信息
*
* @param initialSwitchMpuInfo MPU信息
* @return 结果
*/
public int insertInitialSwitchMpuInfo(InitialSwitchMpuInfo initialSwitchMpuInfo);
/**
* 修改MPU信息
*
* @param initialSwitchMpuInfo MPU信息
* @return 结果
*/
public int updateInitialSwitchMpuInfo(InitialSwitchMpuInfo initialSwitchMpuInfo);
/**
* 批量删除MPU信息
*
* @param ids 需要删除的MPU信息主键集合
* @return 结果
*/
public int deleteInitialSwitchMpuInfoByIds(Long[] ids);
/**
* 删除MPU信息信息
*
* @param id MPU信息主键
* @return 结果
*/
public int deleteInitialSwitchMpuInfoById(Long id);
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.rocketmq.service;
import java.util.List;
import com.ruoyi.rocketmq.domain.InitialSwitchOpticalModule;
/**
* 光模块信息Service接口
*
* @author gyt
* @date 2025-09-22
*/
public interface IInitialSwitchOpticalModuleService
{
/**
* 查询光模块信息
*
* @param id 光模块信息主键
* @return 光模块信息
*/
public InitialSwitchOpticalModule selectInitialSwitchOpticalModuleById(Long id);
/**
* 查询光模块信息列表
*
* @param initialSwitchOpticalModule 光模块信息
* @return 光模块信息集合
*/
public List<InitialSwitchOpticalModule> selectInitialSwitchOpticalModuleList(InitialSwitchOpticalModule initialSwitchOpticalModule);
/**
* 新增光模块信息
*
* @param initialSwitchOpticalModule 光模块信息
* @return 结果
*/
public int insertInitialSwitchOpticalModule(InitialSwitchOpticalModule initialSwitchOpticalModule);
/**
* 修改光模块信息
*
* @param initialSwitchOpticalModule 光模块信息
* @return 结果
*/
public int updateInitialSwitchOpticalModule(InitialSwitchOpticalModule initialSwitchOpticalModule);
/**
* 批量删除光模块信息
*
* @param ids 需要删除的光模块信息主键集合
* @return 结果
*/
public int deleteInitialSwitchOpticalModuleByIds(Long[] ids);
/**
* 删除光模块信息信息
*
* @param id 光模块信息主键
* @return 结果
*/
public int deleteInitialSwitchOpticalModuleById(Long id);
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.rocketmq.service;
import java.util.List;
import com.ruoyi.rocketmq.domain.InitialSwitchOtherCollectData;
/**
* 交换机系统其他信息采集数据Service接口
*
* @author gyt
* @date 2025-09-23
*/
public interface IInitialSwitchOtherCollectDataService
{
/**
* 查询交换机系统其他信息采集数据
*
* @param id 交换机系统其他信息采集数据主键
* @return 交换机系统其他信息采集数据
*/
public InitialSwitchOtherCollectData selectInitialSwitchOtherCollectDataById(Long id);
/**
* 查询交换机系统其他信息采集数据列表
*
* @param initialSwitchOtherCollectData 交换机系统其他信息采集数据
* @return 交换机系统其他信息采集数据集合
*/
public List<InitialSwitchOtherCollectData> selectInitialSwitchOtherCollectDataList(InitialSwitchOtherCollectData initialSwitchOtherCollectData);
/**
* 新增交换机系统其他信息采集数据
*
* @param initialSwitchOtherCollectData 交换机系统其他信息采集数据
* @return 结果
*/
public int insertInitialSwitchOtherCollectData(InitialSwitchOtherCollectData initialSwitchOtherCollectData);
/**
* 修改交换机系统其他信息采集数据
*
* @param initialSwitchOtherCollectData 交换机系统其他信息采集数据
* @return 结果
*/
public int updateInitialSwitchOtherCollectData(InitialSwitchOtherCollectData initialSwitchOtherCollectData);
/**
* 批量删除交换机系统其他信息采集数据
*
* @param ids 需要删除的交换机系统其他信息采集数据主键集合
* @return 结果
*/
public int deleteInitialSwitchOtherCollectDataByIds(Long[] ids);
/**
* 删除交换机系统其他信息采集数据信息
*
* @param id 交换机系统其他信息采集数据主键
* @return 结果
*/
public int deleteInitialSwitchOtherCollectDataById(Long id);
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.rocketmq.service;
import java.util.List;
import com.ruoyi.rocketmq.domain.InitialSwitchPowerSupply;
/**
* 电源信息Service接口
*
* @author gyt
* @date 2025-09-22
*/
public interface IInitialSwitchPowerSupplyService
{
/**
* 查询电源信息
*
* @param id 电源信息主键
* @return 电源信息
*/
public InitialSwitchPowerSupply selectInitialSwitchPowerSupplyById(Long id);
/**
* 查询电源信息列表
*
* @param initialSwitchPowerSupply 电源信息
* @return 电源信息集合
*/
public List<InitialSwitchPowerSupply> selectInitialSwitchPowerSupplyList(InitialSwitchPowerSupply initialSwitchPowerSupply);
/**
* 新增电源信息
*
* @param initialSwitchPowerSupply 电源信息
* @return 结果
*/
public int insertInitialSwitchPowerSupply(InitialSwitchPowerSupply initialSwitchPowerSupply);
/**
* 修改电源信息
*
* @param initialSwitchPowerSupply 电源信息
* @return 结果
*/
public int updateInitialSwitchPowerSupply(InitialSwitchPowerSupply initialSwitchPowerSupply);
/**
* 批量删除电源信息
*
* @param ids 需要删除的电源信息主键集合
* @return 结果
*/
public int deleteInitialSwitchPowerSupplyByIds(Long[] ids);
/**
* 删除电源信息信息
*
* @param id 电源信息主键
* @return 结果
*/
public int deleteInitialSwitchPowerSupplyById(Long id);
}

View File

@@ -0,0 +1,61 @@
package com.ruoyi.rocketmq.service;
import java.util.List;
import com.ruoyi.rocketmq.domain.InitialSystemOtherCollectData;
/**
* 交换机系统其他信息采集数据Service接口
*
* @author gyt
* @date 2025-09-23
*/
public interface IInitialSystemOtherCollectDataService
{
/**
* 查询交换机系统其他信息采集数据
*
* @param id 交换机系统其他信息采集数据主键
* @return 交换机系统其他信息采集数据
*/
public InitialSystemOtherCollectData selectInitialSystemOtherCollectDataById(Long id);
/**
* 查询交换机系统其他信息采集数据列表
*
* @param initialSystemOtherCollectData 交换机系统其他信息采集数据
* @return 交换机系统其他信息采集数据集合
*/
public List<InitialSystemOtherCollectData> selectInitialSystemOtherCollectDataList(InitialSystemOtherCollectData initialSystemOtherCollectData);
/**
* 新增交换机系统其他信息采集数据
*
* @param initialSystemOtherCollectData 交换机系统其他信息采集数据
* @return 结果
*/
public int insertInitialSystemOtherCollectData(InitialSystemOtherCollectData initialSystemOtherCollectData);
/**
* 修改交换机系统其他信息采集数据
*
* @param initialSystemOtherCollectData 交换机系统其他信息采集数据
* @return 结果
*/
public int updateInitialSystemOtherCollectData(InitialSystemOtherCollectData initialSystemOtherCollectData);
/**
* 批量删除交换机系统其他信息采集数据
*
* @param ids 需要删除的交换机系统其他信息采集数据主键集合
* @return 结果
*/
public int deleteInitialSystemOtherCollectDataByIds(Long[] ids);
/**
* 删除交换机系统其他信息采集数据信息
*
* @param id 交换机系统其他信息采集数据主键
* @return 结果
*/
public int deleteInitialSystemOtherCollectDataById(Long id);
}

View File

@@ -0,0 +1,63 @@
package com.ruoyi.rocketmq.service;
import java.util.List;
import com.ruoyi.rocketmq.domain.RmDeploymentPolicy;
/**
* 服务器脚本策略Service接口
*
* @author gyt
* @date 2025-09-15
*/
public interface IRmDeploymentPolicyService
{
/**
* 查询服务器脚本策略
*
* @param id 服务器脚本策略主键
* @return 服务器脚本策略
*/
public RmDeploymentPolicy selectRmDeploymentPolicyById(Long id);
/**
* 查询服务器脚本策略列表
*
* @param rmDeploymentPolicy 服务器脚本策略
* @return 服务器脚本策略集合
*/
public List<RmDeploymentPolicy> selectRmDeploymentPolicyList(RmDeploymentPolicy rmDeploymentPolicy);
/**
* 新增服务器脚本策略
*
* @param rmDeploymentPolicy 服务器脚本策略
* @return 结果
*/
public int insertRmDeploymentPolicy(RmDeploymentPolicy rmDeploymentPolicy);
/**
* 修改服务器脚本策略
*
* @param rmDeploymentPolicy 服务器脚本策略
* @return 结果
*/
public int updateRmDeploymentPolicy(RmDeploymentPolicy rmDeploymentPolicy);
/**
* 批量删除服务器脚本策略
*
* @param ids 需要删除的服务器脚本策略主键集合
* @return 结果
*/
public int deleteRmDeploymentPolicyByIds(Long[] ids);
/**
* 删除服务器脚本策略信息
*
* @param id 服务器脚本策略主键
* @return 结果
*/
public int deleteRmDeploymentPolicyById(Long id);
int issueDeploymentPolicy(Long id);
}

View File

@@ -0,0 +1,96 @@
package com.ruoyi.rocketmq.service.impl;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.rocketmq.domain.InitialOtherSystemMonitorData;
import com.ruoyi.rocketmq.mapper.InitialOtherSystemMonitorDataMapper;
import com.ruoyi.rocketmq.service.IInitialOtherSystemMonitorDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 系统其他信息监控数据Service业务层处理
*
* @author gyt
* @date 2025-09-23
*/
@Service
public class InitialOtherSystemMonitorDataServiceImpl implements IInitialOtherSystemMonitorDataService
{
@Autowired
private InitialOtherSystemMonitorDataMapper initialOtherSystemMonitorDataMapper;
/**
* 查询系统其他信息监控数据
*
* @param id 系统其他信息监控数据主键
* @return 系统其他信息监控数据
*/
@Override
public InitialOtherSystemMonitorData selectInitialOtherSystemMonitorDataById(Long id)
{
return initialOtherSystemMonitorDataMapper.selectInitialOtherSystemMonitorDataById(id);
}
/**
* 查询系统其他信息监控数据列表
*
* @param initialOtherSystemMonitorData 系统其他信息监控数据
* @return 系统其他信息监控数据
*/
@Override
public List<InitialOtherSystemMonitorData> selectInitialOtherSystemMonitorDataList(InitialOtherSystemMonitorData initialOtherSystemMonitorData)
{
return initialOtherSystemMonitorDataMapper.selectInitialOtherSystemMonitorDataList(initialOtherSystemMonitorData);
}
/**
* 新增系统其他信息监控数据
*
* @param initialOtherSystemMonitorData 系统其他信息监控数据
* @return 结果
*/
@Override
public int insertInitialOtherSystemMonitorData(InitialOtherSystemMonitorData initialOtherSystemMonitorData)
{
return initialOtherSystemMonitorDataMapper.insertInitialOtherSystemMonitorData(initialOtherSystemMonitorData);
}
/**
* 修改系统其他信息监控数据
*
* @param initialOtherSystemMonitorData 系统其他信息监控数据
* @return 结果
*/
@Override
public int updateInitialOtherSystemMonitorData(InitialOtherSystemMonitorData initialOtherSystemMonitorData)
{
initialOtherSystemMonitorData.setUpdateTime(DateUtils.getNowDate());
return initialOtherSystemMonitorDataMapper.updateInitialOtherSystemMonitorData(initialOtherSystemMonitorData);
}
/**
* 批量删除系统其他信息监控数据
*
* @param ids 需要删除的系统其他信息监控数据主键
* @return 结果
*/
@Override
public int deleteInitialOtherSystemMonitorDataByIds(Long[] ids)
{
return initialOtherSystemMonitorDataMapper.deleteInitialOtherSystemMonitorDataByIds(ids);
}
/**
* 删除系统其他信息监控数据信息
*
* @param id 系统其他信息监控数据主键
* @return 结果
*/
@Override
public int deleteInitialOtherSystemMonitorDataById(Long id)
{
return initialOtherSystemMonitorDataMapper.deleteInitialOtherSystemMonitorDataById(id);
}
}

View File

@@ -0,0 +1,96 @@
package com.ruoyi.rocketmq.service.impl;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.rocketmq.domain.InitialSwitchFanInfo;
import com.ruoyi.rocketmq.mapper.InitialSwitchFanInfoMapper;
import com.ruoyi.rocketmq.service.IInitialSwitchFanInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 风扇信息Service业务层处理
*
* @author gyt
* @date 2025-09-22
*/
@Service
public class InitialSwitchFanInfoServiceImpl implements IInitialSwitchFanInfoService
{
@Autowired
private InitialSwitchFanInfoMapper initialSwitchFanInfoMapper;
/**
* 查询风扇信息
*
* @param id 风扇信息主键
* @return 风扇信息
*/
@Override
public InitialSwitchFanInfo selectInitialSwitchFanInfoById(Long id)
{
return initialSwitchFanInfoMapper.selectInitialSwitchFanInfoById(id);
}
/**
* 查询风扇信息列表
*
* @param initialSwitchFanInfo 风扇信息
* @return 风扇信息
*/
@Override
public List<InitialSwitchFanInfo> selectInitialSwitchFanInfoList(InitialSwitchFanInfo initialSwitchFanInfo)
{
return initialSwitchFanInfoMapper.selectInitialSwitchFanInfoList(initialSwitchFanInfo);
}
/**
* 新增风扇信息
*
* @param initialSwitchFanInfo 风扇信息
* @return 结果
*/
@Override
public int insertInitialSwitchFanInfo(InitialSwitchFanInfo initialSwitchFanInfo)
{
return initialSwitchFanInfoMapper.insertInitialSwitchFanInfo(initialSwitchFanInfo);
}
/**
* 修改风扇信息
*
* @param initialSwitchFanInfo 风扇信息
* @return 结果
*/
@Override
public int updateInitialSwitchFanInfo(InitialSwitchFanInfo initialSwitchFanInfo)
{
initialSwitchFanInfo.setUpdateTime(DateUtils.getNowDate());
return initialSwitchFanInfoMapper.updateInitialSwitchFanInfo(initialSwitchFanInfo);
}
/**
* 批量删除风扇信息
*
* @param ids 需要删除的风扇信息主键
* @return 结果
*/
@Override
public int deleteInitialSwitchFanInfoByIds(Long[] ids)
{
return initialSwitchFanInfoMapper.deleteInitialSwitchFanInfoByIds(ids);
}
/**
* 删除风扇信息信息
*
* @param id 风扇信息主键
* @return 结果
*/
@Override
public int deleteInitialSwitchFanInfoById(Long id)
{
return initialSwitchFanInfoMapper.deleteInitialSwitchFanInfoById(id);
}
}

View File

@@ -0,0 +1,96 @@
package com.ruoyi.rocketmq.service.impl;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.rocketmq.domain.InitialSwitchMpuInfo;
import com.ruoyi.rocketmq.mapper.InitialSwitchMpuInfoMapper;
import com.ruoyi.rocketmq.service.IInitialSwitchMpuInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* MPU信息Service业务层处理
*
* @author gyt
* @date 2025-09-22
*/
@Service
public class InitialSwitchMpuInfoServiceImpl implements IInitialSwitchMpuInfoService
{
@Autowired
private InitialSwitchMpuInfoMapper initialSwitchMpuInfoMapper;
/**
* 查询MPU信息
*
* @param id MPU信息主键
* @return MPU信息
*/
@Override
public InitialSwitchMpuInfo selectInitialSwitchMpuInfoById(Long id)
{
return initialSwitchMpuInfoMapper.selectInitialSwitchMpuInfoById(id);
}
/**
* 查询MPU信息列表
*
* @param initialSwitchMpuInfo MPU信息
* @return MPU信息
*/
@Override
public List<InitialSwitchMpuInfo> selectInitialSwitchMpuInfoList(InitialSwitchMpuInfo initialSwitchMpuInfo)
{
return initialSwitchMpuInfoMapper.selectInitialSwitchMpuInfoList(initialSwitchMpuInfo);
}
/**
* 新增MPU信息
*
* @param initialSwitchMpuInfo MPU信息
* @return 结果
*/
@Override
public int insertInitialSwitchMpuInfo(InitialSwitchMpuInfo initialSwitchMpuInfo)
{
return initialSwitchMpuInfoMapper.insertInitialSwitchMpuInfo(initialSwitchMpuInfo);
}
/**
* 修改MPU信息
*
* @param initialSwitchMpuInfo MPU信息
* @return 结果
*/
@Override
public int updateInitialSwitchMpuInfo(InitialSwitchMpuInfo initialSwitchMpuInfo)
{
initialSwitchMpuInfo.setUpdateTime(DateUtils.getNowDate());
return initialSwitchMpuInfoMapper.updateInitialSwitchMpuInfo(initialSwitchMpuInfo);
}
/**
* 批量删除MPU信息
*
* @param ids 需要删除的MPU信息主键
* @return 结果
*/
@Override
public int deleteInitialSwitchMpuInfoByIds(Long[] ids)
{
return initialSwitchMpuInfoMapper.deleteInitialSwitchMpuInfoByIds(ids);
}
/**
* 删除MPU信息信息
*
* @param id MPU信息主键
* @return 结果
*/
@Override
public int deleteInitialSwitchMpuInfoById(Long id)
{
return initialSwitchMpuInfoMapper.deleteInitialSwitchMpuInfoById(id);
}
}

View File

@@ -0,0 +1,96 @@
package com.ruoyi.rocketmq.service.impl;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.rocketmq.domain.InitialSwitchOpticalModule;
import com.ruoyi.rocketmq.mapper.InitialSwitchOpticalModuleMapper;
import com.ruoyi.rocketmq.service.IInitialSwitchOpticalModuleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 光模块信息Service业务层处理
*
* @author gyt
* @date 2025-09-22
*/
@Service
public class InitialSwitchOpticalModuleServiceImpl implements IInitialSwitchOpticalModuleService
{
@Autowired
private InitialSwitchOpticalModuleMapper initialSwitchOpticalModuleMapper;
/**
* 查询光模块信息
*
* @param id 光模块信息主键
* @return 光模块信息
*/
@Override
public InitialSwitchOpticalModule selectInitialSwitchOpticalModuleById(Long id)
{
return initialSwitchOpticalModuleMapper.selectInitialSwitchOpticalModuleById(id);
}
/**
* 查询光模块信息列表
*
* @param initialSwitchOpticalModule 光模块信息
* @return 光模块信息
*/
@Override
public List<InitialSwitchOpticalModule> selectInitialSwitchOpticalModuleList(InitialSwitchOpticalModule initialSwitchOpticalModule)
{
return initialSwitchOpticalModuleMapper.selectInitialSwitchOpticalModuleList(initialSwitchOpticalModule);
}
/**
* 新增光模块信息
*
* @param initialSwitchOpticalModule 光模块信息
* @return 结果
*/
@Override
public int insertInitialSwitchOpticalModule(InitialSwitchOpticalModule initialSwitchOpticalModule)
{
return initialSwitchOpticalModuleMapper.insertInitialSwitchOpticalModule(initialSwitchOpticalModule);
}
/**
* 修改光模块信息
*
* @param initialSwitchOpticalModule 光模块信息
* @return 结果
*/
@Override
public int updateInitialSwitchOpticalModule(InitialSwitchOpticalModule initialSwitchOpticalModule)
{
initialSwitchOpticalModule.setUpdateTime(DateUtils.getNowDate());
return initialSwitchOpticalModuleMapper.updateInitialSwitchOpticalModule(initialSwitchOpticalModule);
}
/**
* 批量删除光模块信息
*
* @param ids 需要删除的光模块信息主键
* @return 结果
*/
@Override
public int deleteInitialSwitchOpticalModuleByIds(Long[] ids)
{
return initialSwitchOpticalModuleMapper.deleteInitialSwitchOpticalModuleByIds(ids);
}
/**
* 删除光模块信息信息
*
* @param id 光模块信息主键
* @return 结果
*/
@Override
public int deleteInitialSwitchOpticalModuleById(Long id)
{
return initialSwitchOpticalModuleMapper.deleteInitialSwitchOpticalModuleById(id);
}
}

View File

@@ -0,0 +1,96 @@
package com.ruoyi.rocketmq.service.impl;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.rocketmq.domain.InitialSwitchOtherCollectData;
import com.ruoyi.rocketmq.mapper.InitialSwitchOtherCollectDataMapper;
import com.ruoyi.rocketmq.service.IInitialSwitchOtherCollectDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 交换机系统其他信息采集数据Service业务层处理
*
* @author gyt
* @date 2025-09-23
*/
@Service
public class InitialSwitchOtherCollectDataServiceImpl implements IInitialSwitchOtherCollectDataService
{
@Autowired
private InitialSwitchOtherCollectDataMapper initialSwitchOtherCollectDataMapper;
/**
* 查询交换机系统其他信息采集数据
*
* @param id 交换机系统其他信息采集数据主键
* @return 交换机系统其他信息采集数据
*/
@Override
public InitialSwitchOtherCollectData selectInitialSwitchOtherCollectDataById(Long id)
{
return initialSwitchOtherCollectDataMapper.selectInitialSwitchOtherCollectDataById(id);
}
/**
* 查询交换机系统其他信息采集数据列表
*
* @param initialSwitchOtherCollectData 交换机系统其他信息采集数据
* @return 交换机系统其他信息采集数据
*/
@Override
public List<InitialSwitchOtherCollectData> selectInitialSwitchOtherCollectDataList(InitialSwitchOtherCollectData initialSwitchOtherCollectData)
{
return initialSwitchOtherCollectDataMapper.selectInitialSwitchOtherCollectDataList(initialSwitchOtherCollectData);
}
/**
* 新增交换机系统其他信息采集数据
*
* @param initialSwitchOtherCollectData 交换机系统其他信息采集数据
* @return 结果
*/
@Override
public int insertInitialSwitchOtherCollectData(InitialSwitchOtherCollectData initialSwitchOtherCollectData)
{
return initialSwitchOtherCollectDataMapper.insertInitialSwitchOtherCollectData(initialSwitchOtherCollectData);
}
/**
* 修改交换机系统其他信息采集数据
*
* @param initialSwitchOtherCollectData 交换机系统其他信息采集数据
* @return 结果
*/
@Override
public int updateInitialSwitchOtherCollectData(InitialSwitchOtherCollectData initialSwitchOtherCollectData)
{
initialSwitchOtherCollectData.setUpdateTime(DateUtils.getNowDate());
return initialSwitchOtherCollectDataMapper.updateInitialSwitchOtherCollectData(initialSwitchOtherCollectData);
}
/**
* 批量删除交换机系统其他信息采集数据
*
* @param ids 需要删除的交换机系统其他信息采集数据主键
* @return 结果
*/
@Override
public int deleteInitialSwitchOtherCollectDataByIds(Long[] ids)
{
return initialSwitchOtherCollectDataMapper.deleteInitialSwitchOtherCollectDataByIds(ids);
}
/**
* 删除交换机系统其他信息采集数据信息
*
* @param id 交换机系统其他信息采集数据主键
* @return 结果
*/
@Override
public int deleteInitialSwitchOtherCollectDataById(Long id)
{
return initialSwitchOtherCollectDataMapper.deleteInitialSwitchOtherCollectDataById(id);
}
}

View File

@@ -0,0 +1,96 @@
package com.ruoyi.rocketmq.service.impl;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.rocketmq.domain.InitialSwitchPowerSupply;
import com.ruoyi.rocketmq.mapper.InitialSwitchPowerSupplyMapper;
import com.ruoyi.rocketmq.service.IInitialSwitchPowerSupplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 电源信息Service业务层处理
*
* @author gyt
* @date 2025-09-22
*/
@Service
public class InitialSwitchPowerSupplyServiceImpl implements IInitialSwitchPowerSupplyService
{
@Autowired
private InitialSwitchPowerSupplyMapper initialSwitchPowerSupplyMapper;
/**
* 查询电源信息
*
* @param id 电源信息主键
* @return 电源信息
*/
@Override
public InitialSwitchPowerSupply selectInitialSwitchPowerSupplyById(Long id)
{
return initialSwitchPowerSupplyMapper.selectInitialSwitchPowerSupplyById(id);
}
/**
* 查询电源信息列表
*
* @param initialSwitchPowerSupply 电源信息
* @return 电源信息
*/
@Override
public List<InitialSwitchPowerSupply> selectInitialSwitchPowerSupplyList(InitialSwitchPowerSupply initialSwitchPowerSupply)
{
return initialSwitchPowerSupplyMapper.selectInitialSwitchPowerSupplyList(initialSwitchPowerSupply);
}
/**
* 新增电源信息
*
* @param initialSwitchPowerSupply 电源信息
* @return 结果
*/
@Override
public int insertInitialSwitchPowerSupply(InitialSwitchPowerSupply initialSwitchPowerSupply)
{
return initialSwitchPowerSupplyMapper.insertInitialSwitchPowerSupply(initialSwitchPowerSupply);
}
/**
* 修改电源信息
*
* @param initialSwitchPowerSupply 电源信息
* @return 结果
*/
@Override
public int updateInitialSwitchPowerSupply(InitialSwitchPowerSupply initialSwitchPowerSupply)
{
initialSwitchPowerSupply.setUpdateTime(DateUtils.getNowDate());
return initialSwitchPowerSupplyMapper.updateInitialSwitchPowerSupply(initialSwitchPowerSupply);
}
/**
* 批量删除电源信息
*
* @param ids 需要删除的电源信息主键
* @return 结果
*/
@Override
public int deleteInitialSwitchPowerSupplyByIds(Long[] ids)
{
return initialSwitchPowerSupplyMapper.deleteInitialSwitchPowerSupplyByIds(ids);
}
/**
* 删除电源信息信息
*
* @param id 电源信息主键
* @return 结果
*/
@Override
public int deleteInitialSwitchPowerSupplyById(Long id)
{
return initialSwitchPowerSupplyMapper.deleteInitialSwitchPowerSupplyById(id);
}
}

View File

@@ -0,0 +1,96 @@
package com.ruoyi.rocketmq.service.impl;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.rocketmq.domain.InitialSystemOtherCollectData;
import com.ruoyi.rocketmq.mapper.InitialSystemOtherCollectDataMapper;
import com.ruoyi.rocketmq.service.IInitialSystemOtherCollectDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 交换机系统其他信息采集数据Service业务层处理
*
* @author gyt
* @date 2025-09-23
*/
@Service
public class InitialSystemOtherCollectDataServiceImpl implements IInitialSystemOtherCollectDataService
{
@Autowired
private InitialSystemOtherCollectDataMapper initialSystemOtherCollectDataMapper;
/**
* 查询交换机系统其他信息采集数据
*
* @param id 交换机系统其他信息采集数据主键
* @return 交换机系统其他信息采集数据
*/
@Override
public InitialSystemOtherCollectData selectInitialSystemOtherCollectDataById(Long id)
{
return initialSystemOtherCollectDataMapper.selectInitialSystemOtherCollectDataById(id);
}
/**
* 查询交换机系统其他信息采集数据列表
*
* @param initialSystemOtherCollectData 交换机系统其他信息采集数据
* @return 交换机系统其他信息采集数据
*/
@Override
public List<InitialSystemOtherCollectData> selectInitialSystemOtherCollectDataList(InitialSystemOtherCollectData initialSystemOtherCollectData)
{
return initialSystemOtherCollectDataMapper.selectInitialSystemOtherCollectDataList(initialSystemOtherCollectData);
}
/**
* 新增交换机系统其他信息采集数据
*
* @param initialSystemOtherCollectData 交换机系统其他信息采集数据
* @return 结果
*/
@Override
public int insertInitialSystemOtherCollectData(InitialSystemOtherCollectData initialSystemOtherCollectData)
{
return initialSystemOtherCollectDataMapper.insertInitialSystemOtherCollectData(initialSystemOtherCollectData);
}
/**
* 修改交换机系统其他信息采集数据
*
* @param initialSystemOtherCollectData 交换机系统其他信息采集数据
* @return 结果
*/
@Override
public int updateInitialSystemOtherCollectData(InitialSystemOtherCollectData initialSystemOtherCollectData)
{
initialSystemOtherCollectData.setUpdateTime(DateUtils.getNowDate());
return initialSystemOtherCollectDataMapper.updateInitialSystemOtherCollectData(initialSystemOtherCollectData);
}
/**
* 批量删除交换机系统其他信息采集数据
*
* @param ids 需要删除的交换机系统其他信息采集数据主键
* @return 结果
*/
@Override
public int deleteInitialSystemOtherCollectDataByIds(Long[] ids)
{
return initialSystemOtherCollectDataMapper.deleteInitialSystemOtherCollectDataByIds(ids);
}
/**
* 删除交换机系统其他信息采集数据信息
*
* @param id 交换机系统其他信息采集数据主键
* @return 结果
*/
@Override
public int deleteInitialSystemOtherCollectDataById(Long id)
{
return initialSystemOtherCollectDataMapper.deleteInitialSystemOtherCollectDataById(id);
}
}

View File

@@ -0,0 +1,246 @@
package com.ruoyi.rocketmq.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.enums.MsgEnum;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.rocketmq.domain.DeviceMessage;
import com.ruoyi.rocketmq.domain.RmDeploymentPolicy;
import com.ruoyi.rocketmq.domain.vo.ScriptPolicyVo;
import com.ruoyi.rocketmq.mapper.RmDeploymentPolicyMapper;
import com.ruoyi.rocketmq.model.ProducerMode;
import com.ruoyi.rocketmq.producer.MessageProducer;
import com.ruoyi.rocketmq.service.IRmDeploymentPolicyService;
import com.ruoyi.system.api.RemoteRevenueConfigService;
import com.ruoyi.system.api.domain.RmResourceRegistrationRemote;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.*;
import java.util.stream.Collectors;
/**
* 服务器脚本策略Service业务层处理
*
* @author gyt
* @date 2025-09-15
*/
@Service
@Slf4j
public class RmDeploymentPolicyServiceImpl implements IRmDeploymentPolicyService
{
@Autowired
private RmDeploymentPolicyMapper rmDeploymentPolicyMapper;
@Autowired
private RemoteRevenueConfigService remoteRevenueConfigService;
@Autowired
private ProducerMode producerMode;
/**
* 查询服务器脚本策略
*
* @param id 服务器脚本策略主键
* @return 服务器脚本策略
*/
@Override
public RmDeploymentPolicy selectRmDeploymentPolicyById(Long id)
{
RmDeploymentPolicy rmDeploymentPolicy = rmDeploymentPolicyMapper.selectRmDeploymentPolicyById(id);
// 包含设备名称赋值
getIncludeNameById(rmDeploymentPolicy);
return rmDeploymentPolicy;
}
/**
* 查询服务器脚本策略列表
*
* @param rmDeploymentPolicy 服务器脚本策略
* @return 服务器脚本策略
*/
@Override
public List<RmDeploymentPolicy> selectRmDeploymentPolicyList(RmDeploymentPolicy rmDeploymentPolicy)
{
List<RmDeploymentPolicy> deploymentPolicyList = rmDeploymentPolicyMapper.selectRmDeploymentPolicyList(rmDeploymentPolicy);
// 包含设备名称赋值
deploymentPolicyList.forEach(policy -> {
getIncludeNameById(policy);
});
return deploymentPolicyList;
}
/**
* 根据资源id查询资源名称
* @param policy
*/
public void getIncludeNameById(RmDeploymentPolicy policy){
if (StringUtils.isBlank(policy.getIncludedDevicesId())) {
policy.setIncludedDevicesName("");
return;
}
String[] ids = policy.getIncludedDevicesId().split(",");
R<List<RmResourceRegistrationRemote>> resourceNameList =
remoteRevenueConfigService.getRegistrationByIds(ids, SecurityConstants.INNER);
if (resourceNameList == null || resourceNameList.getData() == null) {
policy.setIncludedDevicesName("");
return;
}
String names = resourceNameList.getData().stream()
.filter(Objects::nonNull)
.map(RmResourceRegistrationRemote::getResourceName)
.filter(StringUtils::isNotBlank)
.collect(Collectors.joining(","));
policy.setIncludedDevicesName(names);
}
/**
* 新增服务器脚本策略
*
* @param rmDeploymentPolicy 服务器脚本策略
* @return 结果
*/
@Override
public int insertRmDeploymentPolicy(RmDeploymentPolicy rmDeploymentPolicy)
{
rmDeploymentPolicy.setCreateTime(DateUtils.getNowDate());
return rmDeploymentPolicyMapper.insertRmDeploymentPolicy(rmDeploymentPolicy);
}
/**
* 修改服务器脚本策略
*
* @param rmDeploymentPolicy 服务器脚本策略
* @return 结果
*/
@Override
public int updateRmDeploymentPolicy(RmDeploymentPolicy rmDeploymentPolicy)
{
rmDeploymentPolicy.setUpdateTime(DateUtils.getNowDate());
return rmDeploymentPolicyMapper.updateRmDeploymentPolicy(rmDeploymentPolicy);
}
/**
* 批量删除服务器脚本策略
*
* @param ids 需要删除的服务器脚本策略主键
* @return 结果
*/
@Override
public int deleteRmDeploymentPolicyByIds(Long[] ids)
{
return rmDeploymentPolicyMapper.deleteRmDeploymentPolicyByIds(ids);
}
/**
* 删除服务器脚本策略信息
*
* @param id 服务器脚本策略主键
* @return 结果
*/
@Override
public int deleteRmDeploymentPolicyById(Long id)
{
return rmDeploymentPolicyMapper.deleteRmDeploymentPolicyById(id);
}
@Override
public int issueDeploymentPolicy(Long id) {
try {
// 获取策略详情和资源设备
RmDeploymentPolicy policy = rmDeploymentPolicyMapper.selectRmDeploymentPolicyById(id);
if (policy == null) {
log.error("策略不存在id: {}", id);
return 0;
}
if (StringUtils.isBlank(policy.getIncludedDevicesId())) {
policy.setIncludedDevicesName("");
return 0;
}
String[] ids = policy.getIncludedDevicesId().split(",");
R<List<RmResourceRegistrationRemote>> resourceNameList =
remoteRevenueConfigService.getRegistrationByIds(ids, SecurityConstants.INNER);
List<RmResourceRegistrationRemote> devices = resourceNameList.getData();
if (CollectionUtils.isEmpty(devices)) {
return 0;
}
// 构建并发送脚本配置
String[] commands = policy.getCommandContent().split(",");
List<String> commandList = new ArrayList<>(Arrays.asList(commands));
List<ScriptPolicyVo.ScriptFile> files = new ArrayList<>();
ScriptPolicyVo scriptPolicyVo = new ScriptPolicyVo();
scriptPolicyVo.setPolicyName(policy.getPolicyName());
scriptPolicyVo.setFilePath(policy.getTargetDirectory());
scriptPolicyVo.setCommands(commandList);
scriptPolicyVo.setMethod(policy.getExecutionMethod());
// 定时执行
if(policy.getExecutionMethod() == 1){
Date scheduledTime = policy.getScheduledTime();
// 转化为时间戳(秒)
long timestampInSecondes = scheduledTime.getTime() / 1000;
scriptPolicyVo.setPolicyTime(timestampInSecondes);
}
String[] fileTypes = policy.getSourceFilePathType().split(",");
String[] fileUrls = policy.getSourceFilePath().split(",");
for(int i=0;i< fileTypes.length;i++){
ScriptPolicyVo.ScriptFile file = new ScriptPolicyVo.ScriptFile();
file.setFileType(Integer.parseInt(fileTypes[i]));
file.setFileUrl(fileUrls[i]);
String fileUrl = fileUrls[i];
// 文件名称
int lastSlashIndex = fileUrl.lastIndexOf("/");
String fileName = fileUrl.substring(lastSlashIndex + 1);
file.setFileName(fileName);
files.add(file);
}
scriptPolicyVo.setFiles(files);
sendDeploymentPolicyToDevices(devices, scriptPolicyVo);
// 更新策略状态为已下发
RmDeploymentPolicy deploymentPolicy = new RmDeploymentPolicy();
deploymentPolicy.setId(id);
deploymentPolicy.setPolicyStatus("1");
deploymentPolicy.setDeployTime(DateUtils.getNowDate());
rmDeploymentPolicyMapper.updateRmDeploymentPolicy(deploymentPolicy);
return 1;
} catch (Exception e) {
log.error("下发策略失败id: {}", id, e);
return 0;
}
}
/**
* 发送配置到设备
*/
private void sendDeploymentPolicyToDevices(List<RmResourceRegistrationRemote> devices, ScriptPolicyVo scriptPolicyVo) {
MessageProducer messageProducer = new MessageProducer();
String configJson = JSONObject.toJSONString(scriptPolicyVo);
for (RmResourceRegistrationRemote device : devices) {
try {
DeviceMessage message = new DeviceMessage();
message.setClientId(device.getHardwareSn());
message.setData(configJson);
message.setDataType(MsgEnum.执行脚本策略.getValue());
messageProducer.sendAsyncProducerMessage(
producerMode.getAgentTopic(),
"",
"",
JSONObject.toJSONString(message)
);
} catch (Exception e) {
log.error("发送设备配置失败deviceId: {}", device.getHardwareSn(), e);
}
}
}
}

View File

@@ -120,7 +120,7 @@ public class RmInitialMonitorItemServiceImpl implements IRmInitialMonitorItemSer
}
else if ("autodiscoverItem".equals(itemType)) {
// 挂载点信息
resultMap.put("point", filterItems(allItems, "POINT"));
resultMap.put("vfs", filterItems(allItems, "POINT"));
// 网络接口信息
resultMap.put("net", filterItems(allItems, "NET"));
// 磁盘信息
@@ -132,19 +132,19 @@ public class RmInitialMonitorItemServiceImpl implements IRmInitialMonitorItemSer
else if ("switch".equals(resourceType)) {
if ("monitorItem".equals(itemType)) {
// 系统信息
resultMap.put("system", filterItems(allItems, "SYSTEM"));
resultMap.put("switchOther", filterItems(allItems, "SYSTEM"));
// MPU信息
resultMap.put("mpu", filterItems(allItems, "MPU"));
resultMap.put("switchMpu", filterItems(allItems, "MPU"));
// 电源信息
resultMap.put("power", filterItems(allItems, "POWERSOURCE"));
resultMap.put("switchPwr", filterItems(allItems, "POWERSOURCE"));
}
else if ("autodiscoverItem".equals(itemType)) {
// 网络端口信息
resultMap.put("netport", filterItems(allItems, "NETPORT"));
resultMap.put("switchNet", filterItems(allItems, "NETPORT"));
// 光模块信息
resultMap.put("lightmodule", filterItems(allItems, "LIGHTMODULE"));
resultMap.put("switchModule", filterItems(allItems, "LIGHTMODULE"));
// 风扇信息
resultMap.put("fan", filterItems(allItems, "FAN"));
resultMap.put("switchFan", filterItems(allItems, "FAN"));
}
}

View File

@@ -150,7 +150,7 @@ public class RmMonitorPolicyServiceImpl implements IRmMonitorPolicyService
rmTemplateLinux.setCollectionCycle(rmMonitorPolicyVo.getCollectionCycle());
rmTemplateLinuxMapper.updateRmTemplateLinux(rmTemplateLinux);
}
}else{
}else if("switch".equals(rmMonitorPolicy.getResourceType())){
for (RmMonitorPolicyVo rmMonitorPolicyVo : collectionAndIdList) {
// 添加采集周期
RmTemplateSwitch rmTemplateSwitch = new RmTemplateSwitch();
@@ -158,6 +158,8 @@ public class RmMonitorPolicyServiceImpl implements IRmMonitorPolicyService
rmTemplateSwitch.setCollectionCycle(rmMonitorPolicyVo.getCollectionCycle());
rmTemplateSwitchMapper.updateRmTemplateSwitch(rmTemplateSwitch);
}
}else {
return 0;
}
}
return 1;
@@ -216,11 +218,11 @@ public class RmMonitorPolicyServiceImpl implements IRmMonitorPolicyService
if(policyDetails.get("switch") != null){
isSwitch = true;
}
SwitchOidVo switchOidVo = buildOids(policyDetails);
List<CollectVo> collectVos = buildCollectConfigurations(policyDetails);
// 去重
List<CollectVo> uniqueList = collectVos.stream().distinct().collect(Collectors.toList());
if(isSwitch){
SwitchOidVo switchOidVo = buildOids(policyDetails);
sendSwitchConfigurationsToDevices(devices, uniqueList, switchOidVo);
}else{
sendConfigurationsToDevices(devices, uniqueList);
@@ -289,7 +291,7 @@ public class RmMonitorPolicyServiceImpl implements IRmMonitorPolicyService
} else if (config instanceof RmTemplateSwitch) {
RmTemplateSwitch switchConfig = (RmTemplateSwitch) config;
if("switchOther".equals(type)){
vo.setType(FieldNameConverterUtil.convertToJavaProperty(switchConfig.getMetricKey()));
vo.setType(FieldNameConverterUtil.convertToSwitchProperty(switchConfig.getMetricKey()));
}else{
vo.setType(type + COLLECT_SUFFIX);
}

View File

@@ -48,6 +48,64 @@ public class FieldNameConverterUtil {
return result.toString();
}
/**
* 将SNMP字段名转换为Java属性名带指定前缀和Collect后缀
* 示例sysDescr -> switchSysDescrCollect
* ifHCInOctets -> switchIfHCInOctetsCollect
*
* @param snmpFieldName SNMP字段名
* @param prefix 前缀switch、router等
* @return Java属性名
*/
public static String convertSnmpToJavaProperty(String snmpFieldName, String prefix) {
return convertSnmpToJavaProperty(snmpFieldName, prefix, "Collect");
}
/**
* 将SNMP字段名转换为Java属性名带指定前缀和自定义后缀
* 示例sysDescr + "switch" + "Config" -> switchSysDescrConfig
* ifHCInOctets + "router" + "Info" -> routerIfHCInOctetsInfo
*
* @param snmpFieldName SNMP字段名
* @param prefix 前缀switch、router等
* @param suffix 自定义后缀
* @return Java属性名
*/
public static String convertSnmpToJavaProperty(String snmpFieldName, String prefix, String suffix) {
if (StringUtils.isBlank(snmpFieldName)) {
return "";
}
StringBuilder result = new StringBuilder();
// 添加前缀
if (StringUtils.isNotBlank(prefix)) {
result.append(prefix);
}
// 处理SNMP字段名将首字母大写
result.append(StringUtils.capitalize(snmpFieldName));
// 添加后缀
if (StringUtils.isNotBlank(suffix)) {
result.append(suffix);
}
return result.toString();
}
/**
* 将SNMP字段名转换为交换机Java属性名带switch前缀和Collect后缀
* 示例sysDescr -> switchSysDescrCollect
* ifHCInOctets -> switchIfHCInOctetsCollect
*
* @param snmpFieldName SNMP字段名
* @return Java属性名
*/
public static String convertToSwitchProperty(String snmpFieldName) {
return convertSnmpToJavaProperty(snmpFieldName, "switch", "Collect");
}
/**
* 将Java属性名转换回数据库字段名
* 示例systemSwapSizeFreeCollect -> system.swap.size.free
@@ -70,4 +128,49 @@ public class FieldNameConverterUtil {
return withoutSuffix.replaceAll("(?<=[a-z])(?=[A-Z])", ".")
.toLowerCase();
}
/**
* 将带前缀和后缀的Java属性名转换回原始SNMP字段名
* 示例switchSysDescrCollect -> sysDescr
* routerIfHCInOctetsInfo -> ifHCInOctets
*
* @param javaProperty Java属性名
* @param prefix 需要去除的前缀
* @param suffix 需要去除的后缀
* @return 原始SNMP字段名
*/
public static String convertToSnmpField(String javaProperty, String prefix, String suffix) {
if (StringUtils.isBlank(javaProperty)) {
return "";
}
// 去除后缀
String withoutSuffix = StringUtils.isNotBlank(suffix)
? StringUtils.removeEnd(javaProperty, suffix)
: javaProperty;
// 去除前缀
String withoutPrefix = StringUtils.isNotBlank(prefix)
? StringUtils.removeStart(withoutSuffix, StringUtils.capitalize(prefix))
: withoutSuffix;
// 将首字母转为小写
if (StringUtils.isNotBlank(withoutPrefix)) {
return StringUtils.uncapitalize(withoutPrefix);
}
return withoutPrefix;
}
/**
* 将交换机Java属性名转换回原始SNMP字段名
* 示例switchSysDescrCollect -> sysDescr
* switchIfHCInOctetsCollect -> ifHCInOctets
*
* @param switchProperty 交换机Java属性名
* @return 原始SNMP字段名
*/
public static String convertFromSwitchProperty(String switchProperty) {
return convertToSnmpField(switchProperty, "switch", "Collect");
}
}

View File

@@ -0,0 +1,157 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.rocketmq.mapper.InitialOtherSystemMonitorDataMapper">
<resultMap type="InitialOtherSystemMonitorData" id="InitialOtherSystemMonitorDataResult">
<result property="id" column="id" />
<result property="clientId" column="client_id" />
<result property="systemSwapSizeFreeCollect" column="system_swap_size_free_collect" />
<result property="systemSwapSizePercentCollect" column="system_swap_size_percent_collect" />
<result property="memoryUtilizationCollect" column="memory_utilization_collect" />
<result property="memorySizeAvailableCollect" column="memory_size_available_collect" />
<result property="memorySizePercentCollect" column="memory_size_percent_collect" />
<result property="memorySizeTotalCollect" column="memory_size_total_collect" />
<result property="systemSwOsCollect" column="system_sw_os_collect" />
<result property="systemSwArchCollect" column="system_sw_arch_collect" />
<result property="kernelMaxprocCollect" column="kernel_maxproc_collect" />
<result property="procNumRunCollect" column="proc_num_run_collect" />
<result property="systemUsersNumCollect" column="system_users_num_collect" />
<result property="systemDiskSizeTotalCollect" column="system_disk_size_total_collect" />
<result property="systemBoottimeCollect" column="system_boottime_collect" />
<result property="systemUnameCollect" column="system_uname_collect" />
<result property="systemLocaltimeCollect" column="system_localtime_collect" />
<result property="systemUptimeCollect" column="system_uptime_collect" />
<result property="procNumCollect" column="proc_num_collect" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
</resultMap>
<sql id="selectInitialOtherSystemMonitorDataVo">
select id, client_id, system_swap_size_free_collect, system_swap_size_percent_collect, memory_utilization_collect, memory_size_available_collect, memory_size_percent_collect, memory_size_total_collect, system_sw_os_collect, system_sw_arch_collect, kernel_maxproc_collect, proc_num_run_collect, system_users_num_collect, system_disk_size_total_collect, system_boottime_collect, system_uname_collect, system_localtime_collect, system_uptime_collect, proc_num_collect, create_time, update_time, create_by, update_by from initial_other_system_monitor_data
</sql>
<select id="selectInitialOtherSystemMonitorDataList" parameterType="InitialOtherSystemMonitorData" resultMap="InitialOtherSystemMonitorDataResult">
<include refid="selectInitialOtherSystemMonitorDataVo"/>
<where>
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
<if test="systemSwapSizeFreeCollect != null "> and system_swap_size_free_collect = #{systemSwapSizeFreeCollect}</if>
<if test="systemSwapSizePercentCollect != null "> and system_swap_size_percent_collect = #{systemSwapSizePercentCollect}</if>
<if test="memoryUtilizationCollect != null "> and memory_utilization_collect = #{memoryUtilizationCollect}</if>
<if test="memorySizeAvailableCollect != null "> and memory_size_available_collect = #{memorySizeAvailableCollect}</if>
<if test="memorySizePercentCollect != null "> and memory_size_percent_collect = #{memorySizePercentCollect}</if>
<if test="memorySizeTotalCollect != null "> and memory_size_total_collect = #{memorySizeTotalCollect}</if>
<if test="systemSwOsCollect != null and systemSwOsCollect != ''"> and system_sw_os_collect = #{systemSwOsCollect}</if>
<if test="systemSwArchCollect != null and systemSwArchCollect != ''"> and system_sw_arch_collect = #{systemSwArchCollect}</if>
<if test="kernelMaxprocCollect != null "> and kernel_maxproc_collect = #{kernelMaxprocCollect}</if>
<if test="procNumRunCollect != null "> and proc_num_run_collect = #{procNumRunCollect}</if>
<if test="systemUsersNumCollect != null "> and system_users_num_collect = #{systemUsersNumCollect}</if>
<if test="systemDiskSizeTotalCollect != null "> and system_disk_size_total_collect = #{systemDiskSizeTotalCollect}</if>
<if test="systemBoottimeCollect != null "> and system_boottime_collect = #{systemBoottimeCollect}</if>
<if test="systemUnameCollect != null and systemUnameCollect != ''"> and system_uname_collect = #{systemUnameCollect}</if>
<if test="systemLocaltimeCollect != null "> and system_localtime_collect = #{systemLocaltimeCollect}</if>
<if test="systemUptimeCollect != null "> and system_uptime_collect = #{systemUptimeCollect}</if>
<if test="procNumCollect != null "> and proc_num_collect = #{procNumCollect}</if>
</where>
</select>
<select id="selectInitialOtherSystemMonitorDataById" parameterType="Long" resultMap="InitialOtherSystemMonitorDataResult">
<include refid="selectInitialOtherSystemMonitorDataVo"/>
where id = #{id}
</select>
<insert id="insertInitialOtherSystemMonitorData" parameterType="InitialOtherSystemMonitorData" useGeneratedKeys="true" keyProperty="id">
insert into initial_other_system_monitor_data
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="clientId != null">client_id,</if>
<if test="systemSwapSizeFreeCollect != null">system_swap_size_free_collect,</if>
<if test="systemSwapSizePercentCollect != null">system_swap_size_percent_collect,</if>
<if test="memoryUtilizationCollect != null">memory_utilization_collect,</if>
<if test="memorySizeAvailableCollect != null">memory_size_available_collect,</if>
<if test="memorySizePercentCollect != null">memory_size_percent_collect,</if>
<if test="memorySizeTotalCollect != null">memory_size_total_collect,</if>
<if test="systemSwOsCollect != null">system_sw_os_collect,</if>
<if test="systemSwArchCollect != null">system_sw_arch_collect,</if>
<if test="kernelMaxprocCollect != null">kernel_maxproc_collect,</if>
<if test="procNumRunCollect != null">proc_num_run_collect,</if>
<if test="systemUsersNumCollect != null">system_users_num_collect,</if>
<if test="systemDiskSizeTotalCollect != null">system_disk_size_total_collect,</if>
<if test="systemBoottimeCollect != null">system_boottime_collect,</if>
<if test="systemUnameCollect != null">system_uname_collect,</if>
<if test="systemLocaltimeCollect != null">system_localtime_collect,</if>
<if test="systemUptimeCollect != null">system_uptime_collect,</if>
<if test="procNumCollect != null">proc_num_collect,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="clientId != null">#{clientId},</if>
<if test="systemSwapSizeFreeCollect != null">#{systemSwapSizeFreeCollect},</if>
<if test="systemSwapSizePercentCollect != null">#{systemSwapSizePercentCollect},</if>
<if test="memoryUtilizationCollect != null">#{memoryUtilizationCollect},</if>
<if test="memorySizeAvailableCollect != null">#{memorySizeAvailableCollect},</if>
<if test="memorySizePercentCollect != null">#{memorySizePercentCollect},</if>
<if test="memorySizeTotalCollect != null">#{memorySizeTotalCollect},</if>
<if test="systemSwOsCollect != null">#{systemSwOsCollect},</if>
<if test="systemSwArchCollect != null">#{systemSwArchCollect},</if>
<if test="kernelMaxprocCollect != null">#{kernelMaxprocCollect},</if>
<if test="procNumRunCollect != null">#{procNumRunCollect},</if>
<if test="systemUsersNumCollect != null">#{systemUsersNumCollect},</if>
<if test="systemDiskSizeTotalCollect != null">#{systemDiskSizeTotalCollect},</if>
<if test="systemBoottimeCollect != null">#{systemBoottimeCollect},</if>
<if test="systemUnameCollect != null">#{systemUnameCollect},</if>
<if test="systemLocaltimeCollect != null">#{systemLocaltimeCollect},</if>
<if test="systemUptimeCollect != null">#{systemUptimeCollect},</if>
<if test="procNumCollect != null">#{procNumCollect},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
</trim>
</insert>
<update id="updateInitialOtherSystemMonitorData" parameterType="InitialOtherSystemMonitorData">
update initial_other_system_monitor_data
<trim prefix="SET" suffixOverrides=",">
<if test="clientId != null">client_id = #{clientId},</if>
<if test="systemSwapSizeFreeCollect != null">system_swap_size_free_collect = #{systemSwapSizeFreeCollect},</if>
<if test="systemSwapSizePercentCollect != null">system_swap_size_percent_collect = #{systemSwapSizePercentCollect},</if>
<if test="memoryUtilizationCollect != null">memory_utilization_collect = #{memoryUtilizationCollect},</if>
<if test="memorySizeAvailableCollect != null">memory_size_available_collect = #{memorySizeAvailableCollect},</if>
<if test="memorySizePercentCollect != null">memory_size_percent_collect = #{memorySizePercentCollect},</if>
<if test="memorySizeTotalCollect != null">memory_size_total_collect = #{memorySizeTotalCollect},</if>
<if test="systemSwOsCollect != null">system_sw_os_collect = #{systemSwOsCollect},</if>
<if test="systemSwArchCollect != null">system_sw_arch_collect = #{systemSwArchCollect},</if>
<if test="kernelMaxprocCollect != null">kernel_maxproc_collect = #{kernelMaxprocCollect},</if>
<if test="procNumRunCollect != null">proc_num_run_collect = #{procNumRunCollect},</if>
<if test="systemUsersNumCollect != null">system_users_num_collect = #{systemUsersNumCollect},</if>
<if test="systemDiskSizeTotalCollect != null">system_disk_size_total_collect = #{systemDiskSizeTotalCollect},</if>
<if test="systemBoottimeCollect != null">system_boottime_collect = #{systemBoottimeCollect},</if>
<if test="systemUnameCollect != null">system_uname_collect = #{systemUnameCollect},</if>
<if test="systemLocaltimeCollect != null">system_localtime_collect = #{systemLocaltimeCollect},</if>
<if test="systemUptimeCollect != null">system_uptime_collect = #{systemUptimeCollect},</if>
<if test="procNumCollect != null">proc_num_collect = #{procNumCollect},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteInitialOtherSystemMonitorDataById" parameterType="Long">
delete from initial_other_system_monitor_data where id = #{id}
</delete>
<delete id="deleteInitialOtherSystemMonitorDataByIds" parameterType="String">
delete from initial_other_system_monitor_data where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.rocketmq.mapper.InitialSwitchFanInfoMapper">
<resultMap type="InitialSwitchFanInfo" id="InitialSwitchFanInfoResult">
<result property="id" column="id" />
<result property="fanEntIndex" column="fan_ent_index" />
<result property="fanName" column="fan_name" />
<result property="fanEntityFanState" column="fan_entity_fan_state" />
<result property="clientId" column="client_id" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
</resultMap>
<sql id="selectInitialSwitchFanInfoVo">
select id, fan_ent_index, fan_name, fan_entity_fan_state, client_id, create_time, update_time, create_by, update_by from initial_switch_fan_info
</sql>
<select id="selectInitialSwitchFanInfoList" parameterType="InitialSwitchFanInfo" resultMap="InitialSwitchFanInfoResult">
<include refid="selectInitialSwitchFanInfoVo"/>
<where>
<if test="fanEntIndex != null and fanEntIndex != ''"> and fan_ent_index = #{fanEntIndex}</if>
<if test="fanName != null and fanName != ''"> and fan_name like concat('%', #{fanName}, '%')</if>
<if test="fanEntityFanState != null and fanEntityFanState != ''"> and fan_entity_fan_state = #{fanEntityFanState}</if>
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
</where>
</select>
<select id="selectInitialSwitchFanInfoById" parameterType="Long" resultMap="InitialSwitchFanInfoResult">
<include refid="selectInitialSwitchFanInfoVo"/>
where id = #{id}
</select>
<insert id="insertInitialSwitchFanInfo" parameterType="InitialSwitchFanInfo" useGeneratedKeys="true" keyProperty="id">
insert IGNORE into initial_switch_fan_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fanEntIndex != null">fan_ent_index,</if>
<if test="fanName != null">fan_name,</if>
<if test="fanEntityFanState != null">fan_entity_fan_state,</if>
<if test="clientId != null">client_id,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fanEntIndex != null">#{fanEntIndex},</if>
<if test="fanName != null">#{fanName},</if>
<if test="fanEntityFanState != null">#{fanEntityFanState},</if>
<if test="clientId != null">#{clientId},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
</trim>
</insert>
<update id="updateInitialSwitchFanInfo" parameterType="InitialSwitchFanInfo">
update initial_switch_fan_info
<trim prefix="SET" suffixOverrides=",">
<if test="fanEntIndex != null">fan_ent_index = #{fanEntIndex},</if>
<if test="fanName != null">fan_name = #{fanName},</if>
<if test="fanEntityFanState != null">fan_entity_fan_state = #{fanEntityFanState},</if>
<if test="clientId != null">client_id = #{clientId},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteInitialSwitchFanInfoById" parameterType="Long">
delete from initial_switch_fan_info where id = #{id}
</delete>
<delete id="deleteInitialSwitchFanInfoByIds" parameterType="String">
delete from initial_switch_fan_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -15,6 +15,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="inSpeed" column="in_speed" />
<result property="outSpeed" column="out_speed" />
<result property="switchIp" column="switch_ip" />
<result property="ifIndex" column="if_index" />
<result property="ifSpeed" column="if_speed" />
<result property="ifInDiscards" column="if_in_discards" />
<result property="ifOutDiscards" column="if_out_discards" />
<result property="ifInErrors" column="if_in_errors" />
<result property="ifOutErrors" column="if_out_errors" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="createTime" column="create_time" />
@@ -22,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectInitialSwitchInfoVo">
select id, client_id, name, in_bytes, out_bytes, status, type, in_speed, out_speed, switch_ip, create_by, update_by, create_time, update_time from initial_switch_info
select id, client_id, name, in_bytes, out_bytes, status, type, in_speed, out_speed, switch_ip, if_index, if_speed, if_in_discards, if_out_discards, if_in_errors, if_out_errors, create_by, update_by, create_time, update_time from initial_switch_info
</sql>
<select id="selectInitialSwitchInfoList" parameterType="InitialSwitchInfo" resultMap="InitialSwitchInfoResult">
@@ -37,6 +43,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inSpeed != null "> and in_speed = #{inSpeed}</if>
<if test="outSpeed != null "> and out_speed = #{outSpeed}</if>
<if test="switchIp != null and switchIp != ''"> and switch_ip = #{switchIp}</if>
<if test="ifIndex != null and ifIndex != ''"> and if_index = #{ifIndex}</if>
<if test="ifSpeed != null "> and if_speed = #{ifSpeed}</if>
<if test="ifInDiscards != null "> and if_in_discards = #{ifInDiscards}</if>
<if test="ifOutDiscards != null "> and if_out_discards = #{ifOutDiscards}</if>
<if test="ifInErrors != null "> and if_in_errors = #{ifInErrors}</if>
<if test="ifOutErrors != null "> and if_out_errors = #{ifOutErrors}</if>
</where>
</select>
@@ -57,6 +69,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inSpeed != null">in_speed,</if>
<if test="outSpeed != null">out_speed,</if>
<if test="switchIp != null and switchIp != ''">switch_ip,</if>
<if test="ifIndex != null and ifIndex != ''">if_index,</if>
<if test="ifSpeed != null">if_speed,</if>
<if test="ifInDiscards != null">if_in_discards,</if>
<if test="ifOutDiscards != null">if_out_discards,</if>
<if test="ifInErrors != null">if_in_errors,</if>
<if test="ifOutErrors != null">if_out_errors,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
<if test="createTime != null">create_time,</if>
@@ -72,6 +90,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inSpeed != null">#{inSpeed},</if>
<if test="outSpeed != null">#{outSpeed},</if>
<if test="switchIp != null and switchIp != ''">#{switchIp},</if>
<if test="ifIndex != null and ifIndex != ''">#{ifIndex},</if>
<if test="ifSpeed != null">#{ifSpeed},</if>
<if test="ifInDiscards != null">#{ifInDiscards},</if>
<if test="ifOutDiscards != null">#{ifOutDiscards},</if>
<if test="ifInErrors != null">#{ifInErrors},</if>
<if test="ifOutErrors != null">#{ifOutErrors},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="createTime != null">#{createTime},</if>
@@ -91,6 +115,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inSpeed != null">in_speed = #{inSpeed},</if>
<if test="outSpeed != null">out_speed = #{outSpeed},</if>
<if test="switchIp != null and switchIp != ''">switch_ip = #{switchIp},</if>
<if test="ifIndex != null and ifIndex != ''">if_index = #{ifIndex},</if>
<if test="ifSpeed != null">if_speed = #{ifSpeed},</if>
<if test="ifInDiscards != null">if_in_discards = #{ifInDiscards},</if>
<if test="ifOutDiscards != null">if_out_discards = #{ifOutDiscards},</if>
<if test="ifInErrors != null">if_in_errors = #{ifInErrors},</if>
<if test="ifOutErrors != null">if_out_errors = #{ifOutErrors},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
@@ -114,13 +144,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
INSERT IGNORE INTO initial_switch_info
(
client_id, `name`, in_bytes, out_bytes, status, `type`, in_speed, out_speed, switch_ip,
if_index, if_speed, if_in_discards, if_out_discards, if_in_errors, if_out_errors,
create_by, update_by, create_time, update_time
)
VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.clientId}, #{item.name}, #{item.inBytes}, #{item.outBytes},
#{item.status}, #{item.type}, #{item.inSpeed}, #{item.outSpeed}, #{item.switchIp}, #{item.createBy}, #{item.updateBy},
#{item.status}, #{item.type}, #{item.inSpeed}, #{item.outSpeed}, #{item.switchIp},
#{item.ifIndex}, #{item.ifSpeed}, #{item.ifInDiscards},#{item.ifOutDiscards},#{item.ifInErrors},#{item.ifOutErrors},
#{item.createBy}, #{item.updateBy},
<choose>
<when test="item.createTime != null">
#{item.createTime}
@@ -140,6 +173,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)
</foreach>
</insert>
<select id="getSwitchNetDetailsMsg" parameterType="String" resultMap="InitialSwitchInfoResult">
<include refid="selectInitialSwitchInfoVo"/>
where client_id = #{clientId}

View File

@@ -15,6 +15,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="inSpeed" column="in_speed" />
<result property="outSpeed" column="out_speed" />
<result property="switchIp" column="switch_ip" />
<result property="ifIndex" column="if_index" />
<result property="ifSpeed" column="if_speed" />
<result property="ifInDiscards" column="if_in_discards" />
<result property="ifOutDiscards" column="if_out_discards" />
<result property="ifInErrors" column="if_in_errors" />
<result property="ifOutErrors" column="if_out_errors" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
<result property="createTime" column="create_time" />
@@ -22,7 +28,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql id="selectInitialSwitchInfoTempVo">
select id, client_id, name, in_bytes, out_bytes, status, type, in_speed, out_speed, switch_ip, create_by, update_by, create_time, update_time from initial_switch_info_temp
select id, client_id, name, in_bytes, out_bytes, status, type, in_speed, out_speed, switch_ip, if_index, if_speed, if_in_discards, if_out_discards, if_in_errors, if_out_errors, create_by, update_by, create_time, update_time from initial_switch_info_temp
</sql>
<select id="selectInitialSwitchInfoTempList" parameterType="InitialSwitchInfoTemp" resultMap="InitialSwitchInfoTempResult">
@@ -37,6 +43,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="inSpeed != null "> and in_speed = #{inSpeed}</if>
<if test="outSpeed != null "> and out_speed = #{outSpeed}</if>
<if test="switchIp != null and switchIp != ''"> and switch_ip = #{switchIp}</if>
<if test="ifIndex != null and ifIndex != ''"> and if_index = #{ifIndex}</if>
<if test="ifSpeed != null "> and if_speed = #{ifSpeed}</if>
<if test="ifInDiscards != null "> and if_in_discards = #{ifInDiscards}</if>
<if test="ifOutDiscards != null "> and if_out_discards = #{ifOutDiscards}</if>
<if test="ifInErrors != null "> and if_in_errors = #{ifInErrors}</if>
<if test="ifOutErrors != null "> and if_out_errors = #{ifOutErrors}</if>
</where>
</select>
@@ -56,7 +68,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="type != null">type,</if>
<if test="inSpeed != null">in_speed,</if>
<if test="outSpeed != null">out_speed,</if>
<if test="switchIp != null">switch_ip,</if>
<if test="switchIp != null and switchIp != ''">switch_ip,</if>
<if test="ifIndex != null and ifIndex != ''">if_index,</if>
<if test="ifSpeed != null">if_speed,</if>
<if test="ifInDiscards != null">if_in_discards,</if>
<if test="ifOutDiscards != null">if_out_discards,</if>
<if test="ifInErrors != null">if_in_errors,</if>
<if test="ifOutErrors != null">if_out_errors,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
<if test="createTime != null">create_time,</if>
@@ -71,7 +89,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="type != null">#{type},</if>
<if test="inSpeed != null">#{inSpeed},</if>
<if test="outSpeed != null">#{outSpeed},</if>
<if test="switchIp != null">#{switchIp},</if>
<if test="switchIp != null and switchIp != ''">#{switchIp},</if>
<if test="ifIndex != null and ifIndex != ''">#{ifIndex},</if>
<if test="ifSpeed != null">#{ifSpeed},</if>
<if test="ifInDiscards != null">#{ifInDiscards},</if>
<if test="ifOutDiscards != null">#{ifOutDiscards},</if>
<if test="ifInErrors != null">#{ifInErrors},</if>
<if test="ifOutErrors != null">#{ifOutErrors},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="createTime != null">#{createTime},</if>
@@ -90,7 +114,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="type != null">type = #{type},</if>
<if test="inSpeed != null">in_speed = #{inSpeed},</if>
<if test="outSpeed != null">out_speed = #{outSpeed},</if>
<if test="switchIp != null">switch_ip = #{switchIp},</if>
<if test="switchIp != null and switchIp != ''">switch_ip = #{switchIp},</if>
<if test="ifIndex != null and ifIndex != ''">if_index = #{ifIndex},</if>
<if test="ifSpeed != null">if_speed = #{ifSpeed},</if>
<if test="ifInDiscards != null">if_in_discards = #{ifInDiscards},</if>
<if test="ifOutDiscards != null">if_out_discards = #{ifOutDiscards},</if>
<if test="ifInErrors != null">if_in_errors = #{ifInErrors},</if>
<if test="ifOutErrors != null">if_out_errors = #{ifOutErrors},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
@@ -109,17 +139,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<insert id="batchInsertInitialSwitchInfoTemp" parameterType="java.util.List" useGeneratedKeys="true" keyProperty="id">
INSERT IGNORE INTO initial_switch_info_temp
(
client_id, name, in_bytes, out_bytes, status, type, in_speed, out_speed, switch_ip,
client_id, `name`, in_bytes, out_bytes, status, `type`, in_speed, out_speed, switch_ip,
if_index, if_speed, if_in_discards, if_out_discards, if_in_errors, if_out_errors,
create_by, update_by, create_time, update_time
)
VALUES
<foreach collection="list" item="item" separator=",">
(
#{item.clientId}, #{item.name}, #{item.inBytes}, #{item.outBytes},
#{item.status}, #{item.type}, #{item.inSpeed}, #{item.outSpeed}, #{item.switchIp}, #{item.createBy}, #{item.updateBy},
#{item.status}, #{item.type}, #{item.inSpeed}, #{item.outSpeed}, #{item.switchIp},
#{item.ifIndex}, #{item.ifSpeed}, #{item.ifInDiscards},#{item.ifOutDiscards},#{item.ifInErrors},#{item.ifOutErrors},
#{item.createBy}, #{item.updateBy},
<choose>
<when test="item.createTime != null">
#{item.createTime}
@@ -139,6 +173,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
)
</foreach>
</insert>
<delete id="truncateSwitchInfoTemp" parameterType="String">
DELETE FROM initial_switch_info_temp
WHERE

View File

@@ -0,0 +1,102 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.rocketmq.mapper.InitialSwitchMpuInfoMapper">
<resultMap type="InitialSwitchMpuInfo" id="InitialSwitchMpuInfoResult">
<result property="id" column="id" />
<result property="mpuEntIndex" column="mpu_ent_index" />
<result property="mpuName" column="mpu_name" />
<result property="mpuEntityCpuUsage" column="mpu_entity_cpu_usage" />
<result property="mpuEntityMemUsage" column="mpu_entity_mem_usage" />
<result property="mpuPhysicalSoftwareRev" column="mpu_physical_software_rev" />
<result property="mpuEntityTemperature" column="mpu_entity_temperature" />
<result property="clientId" column="client_id" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
</resultMap>
<sql id="selectInitialSwitchMpuInfoVo">
select id, mpu_ent_index, mpu_name, mpu_entity_cpu_usage, mpu_entity_mem_usage, mpu_physical_software_rev, mpu_entity_temperature, client_id, create_time, update_time, create_by, update_by from initial_switch_mpu_info
</sql>
<select id="selectInitialSwitchMpuInfoList" parameterType="InitialSwitchMpuInfo" resultMap="InitialSwitchMpuInfoResult">
<include refid="selectInitialSwitchMpuInfoVo"/>
<where>
<if test="mpuEntIndex != null and mpuEntIndex != ''"> and mpu_ent_index = #{mpuEntIndex}</if>
<if test="mpuName != null and mpuName != ''"> and mpu_name like concat('%', #{mpuName}, '%')</if>
<if test="mpuEntityCpuUsage != null "> and mpu_entity_cpu_usage = #{mpuEntityCpuUsage}</if>
<if test="mpuEntityMemUsage != null "> and mpu_entity_mem_usage = #{mpuEntityMemUsage}</if>
<if test="mpuPhysicalSoftwareRev != null and mpuPhysicalSoftwareRev != ''"> and mpu_physical_software_rev = #{mpuPhysicalSoftwareRev}</if>
<if test="mpuEntityTemperature != null "> and mpu_entity_temperature = #{mpuEntityTemperature}</if>
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
</where>
</select>
<select id="selectInitialSwitchMpuInfoById" parameterType="Long" resultMap="InitialSwitchMpuInfoResult">
<include refid="selectInitialSwitchMpuInfoVo"/>
where id = #{id}
</select>
<insert id="insertInitialSwitchMpuInfo" parameterType="InitialSwitchMpuInfo" useGeneratedKeys="true" keyProperty="id">
insert IGNORE into initial_switch_mpu_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="mpuEntIndex != null">mpu_ent_index,</if>
<if test="mpuName != null">mpu_name,</if>
<if test="mpuEntityCpuUsage != null">mpu_entity_cpu_usage,</if>
<if test="mpuEntityMemUsage != null">mpu_entity_mem_usage,</if>
<if test="mpuPhysicalSoftwareRev != null">mpu_physical_software_rev,</if>
<if test="mpuEntityTemperature != null">mpu_entity_temperature,</if>
<if test="clientId != null">client_id,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="mpuEntIndex != null">#{mpuEntIndex},</if>
<if test="mpuName != null">#{mpuName},</if>
<if test="mpuEntityCpuUsage != null">#{mpuEntityCpuUsage},</if>
<if test="mpuEntityMemUsage != null">#{mpuEntityMemUsage},</if>
<if test="mpuPhysicalSoftwareRev != null">#{mpuPhysicalSoftwareRev},</if>
<if test="mpuEntityTemperature != null">#{mpuEntityTemperature},</if>
<if test="clientId != null">#{clientId},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
</trim>
</insert>
<update id="updateInitialSwitchMpuInfo" parameterType="InitialSwitchMpuInfo">
update initial_switch_mpu_info
<trim prefix="SET" suffixOverrides=",">
<if test="mpuEntIndex != null">mpu_ent_index = #{mpuEntIndex},</if>
<if test="mpuName != null">mpu_name = #{mpuName},</if>
<if test="mpuEntityCpuUsage != null">mpu_entity_cpu_usage = #{mpuEntityCpuUsage},</if>
<if test="mpuEntityMemUsage != null">mpu_entity_mem_usage = #{mpuEntityMemUsage},</if>
<if test="mpuPhysicalSoftwareRev != null">mpu_physical_software_rev = #{mpuPhysicalSoftwareRev},</if>
<if test="mpuEntityTemperature != null">mpu_entity_temperature = #{mpuEntityTemperature},</if>
<if test="clientId != null">client_id = #{clientId},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteInitialSwitchMpuInfoById" parameterType="Long">
delete from initial_switch_mpu_info where id = #{id}
</delete>
<delete id="deleteInitialSwitchMpuInfoByIds" parameterType="String">
delete from initial_switch_mpu_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,102 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.rocketmq.mapper.InitialSwitchOpticalModuleMapper">
<resultMap type="InitialSwitchOpticalModule" id="InitialSwitchOpticalModuleResult">
<result property="id" column="id" />
<result property="fiberEntIndex" column="fiber_ent_index" />
<result property="fiberPortName" column="fiber_port_name" />
<result property="hwEntityOpticalTxLowThreshold" column="hw_entity_optical_tx_low_threshold" />
<result property="hwEntityOpticalRxLowThreshold" column="hw_entity_optical_rx_low_threshold" />
<result property="hwEntityOpticalRxPower" column="hw_entity_optical_rx_power" />
<result property="hwEntityOpticalTxPower" column="hw_entity_optical_tx_power" />
<result property="clientId" column="client_id" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
</resultMap>
<sql id="selectInitialSwitchOpticalModuleVo">
select id, fiber_ent_index, fiber_port_name, hw_entity_optical_tx_low_threshold, hw_entity_optical_rx_low_threshold, hw_entity_optical_rx_power, hw_entity_optical_tx_power, client_id, create_time, update_time, create_by, update_by from initial_switch_optical_module
</sql>
<select id="selectInitialSwitchOpticalModuleList" parameterType="InitialSwitchOpticalModule" resultMap="InitialSwitchOpticalModuleResult">
<include refid="selectInitialSwitchOpticalModuleVo"/>
<where>
<if test="fiberEntIndex != null and fiberEntIndex != ''"> and fiber_ent_index = #{fiberEntIndex}</if>
<if test="fiberPortName != null and fiberPortName != ''"> and fiber_port_name like concat('%', #{fiberPortName}, '%')</if>
<if test="hwEntityOpticalTxLowThreshold != null "> and hw_entity_optical_tx_low_threshold = #{hwEntityOpticalTxLowThreshold}</if>
<if test="hwEntityOpticalRxLowThreshold != null "> and hw_entity_optical_rx_low_threshold = #{hwEntityOpticalRxLowThreshold}</if>
<if test="hwEntityOpticalRxPower != null "> and hw_entity_optical_rx_power = #{hwEntityOpticalRxPower}</if>
<if test="hwEntityOpticalTxPower != null "> and hw_entity_optical_tx_power = #{hwEntityOpticalTxPower}</if>
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
</where>
</select>
<select id="selectInitialSwitchOpticalModuleById" parameterType="Long" resultMap="InitialSwitchOpticalModuleResult">
<include refid="selectInitialSwitchOpticalModuleVo"/>
where id = #{id}
</select>
<insert id="insertInitialSwitchOpticalModule" parameterType="InitialSwitchOpticalModule" useGeneratedKeys="true" keyProperty="id">
insert IGNORE into initial_switch_optical_module
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="fiberEntIndex != null">fiber_ent_index,</if>
<if test="fiberPortName != null">fiber_port_name,</if>
<if test="hwEntityOpticalTxLowThreshold != null">hw_entity_optical_tx_low_threshold,</if>
<if test="hwEntityOpticalRxLowThreshold != null">hw_entity_optical_rx_low_threshold,</if>
<if test="hwEntityOpticalRxPower != null">hw_entity_optical_rx_power,</if>
<if test="hwEntityOpticalTxPower != null">hw_entity_optical_tx_power,</if>
<if test="clientId != null">client_id,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="fiberEntIndex != null">#{fiberEntIndex},</if>
<if test="fiberPortName != null">#{fiberPortName},</if>
<if test="hwEntityOpticalTxLowThreshold != null">#{hwEntityOpticalTxLowThreshold},</if>
<if test="hwEntityOpticalRxLowThreshold != null">#{hwEntityOpticalRxLowThreshold},</if>
<if test="hwEntityOpticalRxPower != null">#{hwEntityOpticalRxPower},</if>
<if test="hwEntityOpticalTxPower != null">#{hwEntityOpticalTxPower},</if>
<if test="clientId != null">#{clientId},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
</trim>
</insert>
<update id="updateInitialSwitchOpticalModule" parameterType="InitialSwitchOpticalModule">
update initial_switch_optical_module
<trim prefix="SET" suffixOverrides=",">
<if test="fiberEntIndex != null">fiber_ent_index = #{fiberEntIndex},</if>
<if test="fiberPortName != null">fiber_port_name = #{fiberPortName},</if>
<if test="hwEntityOpticalTxLowThreshold != null">hw_entity_optical_tx_low_threshold = #{hwEntityOpticalTxLowThreshold},</if>
<if test="hwEntityOpticalRxLowThreshold != null">hw_entity_optical_rx_low_threshold = #{hwEntityOpticalRxLowThreshold},</if>
<if test="hwEntityOpticalRxPower != null">hw_entity_optical_rx_power = #{hwEntityOpticalRxPower},</if>
<if test="hwEntityOpticalTxPower != null">hw_entity_optical_tx_power = #{hwEntityOpticalTxPower},</if>
<if test="clientId != null">client_id = #{clientId},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteInitialSwitchOpticalModuleById" parameterType="Long">
delete from initial_switch_optical_module where id = #{id}
</delete>
<delete id="deleteInitialSwitchOpticalModuleByIds" parameterType="String">
delete from initial_switch_optical_module where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.rocketmq.mapper.InitialSwitchOtherCollectDataMapper">
<resultMap type="InitialSwitchOtherCollectData" id="InitialSwitchOtherCollectDataResult">
<result property="id" column="id" />
<result property="clientId" column="client_id" />
<result property="collectType" column="collect_type" />
<result property="collectValue" column="collect_value" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
</resultMap>
<sql id="selectInitialSwitchOtherCollectDataVo">
select id, client_id, collect_type, collect_value, create_time, update_time, create_by, update_by from initial_switch_other_collect_data
</sql>
<select id="selectInitialSwitchOtherCollectDataList" parameterType="InitialSwitchOtherCollectData" resultMap="InitialSwitchOtherCollectDataResult">
<include refid="selectInitialSwitchOtherCollectDataVo"/>
<where>
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
<if test="collectType != null and collectType != ''"> and collect_type = #{collectType}</if>
<if test="collectValue != null and collectValue != ''"> and collect_value = #{collectValue}</if>
</where>
</select>
<select id="selectInitialSwitchOtherCollectDataById" parameterType="Long" resultMap="InitialSwitchOtherCollectDataResult">
<include refid="selectInitialSwitchOtherCollectDataVo"/>
where id = #{id}
</select>
<insert id="insertInitialSwitchOtherCollectData" parameterType="InitialSwitchOtherCollectData" useGeneratedKeys="true" keyProperty="id">
insert IGNORE into initial_switch_other_collect_data
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="clientId != null and clientId != ''">client_id,</if>
<if test="collectType != null and collectType != ''">collect_type,</if>
<if test="collectValue != null">collect_value,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="clientId != null and clientId != ''">#{clientId},</if>
<if test="collectType != null and collectType != ''">#{collectType},</if>
<if test="collectValue != null">#{collectValue},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
</trim>
</insert>
<update id="updateInitialSwitchOtherCollectData" parameterType="InitialSwitchOtherCollectData">
update initial_switch_other_collect_data
<trim prefix="SET" suffixOverrides=",">
<if test="clientId != null and clientId != ''">client_id = #{clientId},</if>
<if test="collectType != null and collectType != ''">collect_type = #{collectType},</if>
<if test="collectValue != null">collect_value = #{collectValue},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteInitialSwitchOtherCollectDataById" parameterType="Long">
delete from initial_switch_other_collect_data where id = #{id}
</delete>
<delete id="deleteInitialSwitchOtherCollectDataByIds" parameterType="String">
delete from initial_switch_other_collect_data where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.rocketmq.mapper.InitialSwitchPowerSupplyMapper">
<resultMap type="InitialSwitchPowerSupply" id="InitialSwitchPowerSupplyResult">
<result property="id" column="id" />
<result property="pwrEntIndex" column="pwr_ent_index" />
<result property="pwrName" column="pwr_name" />
<result property="pwrEntityPwrState" column="pwr_entity_pwr_state" />
<result property="pwrEntityPwrCurrent" column="pwr_entity_pwr_current" />
<result property="pwrEntityPwrVoltage" column="pwr_entity_pwr_voltage" />
<result property="clientId" column="client_id" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
</resultMap>
<sql id="selectInitialSwitchPowerSupplyVo">
select id, pwr_ent_index, pwr_name, pwr_entity_pwr_state, pwr_entity_pwr_current, pwr_entity_pwr_voltage, client_id, create_time, update_time, create_by, update_by from initial_switch_power_supply
</sql>
<select id="selectInitialSwitchPowerSupplyList" parameterType="InitialSwitchPowerSupply" resultMap="InitialSwitchPowerSupplyResult">
<include refid="selectInitialSwitchPowerSupplyVo"/>
<where>
<if test="pwrEntIndex != null and pwrEntIndex != ''"> and pwr_ent_index = #{pwrEntIndex}</if>
<if test="pwrName != null and pwrName != ''"> and pwr_name like concat('%', #{pwrName}, '%')</if>
<if test="pwrEntityPwrState != null and pwrEntityPwrState != ''"> and pwr_entity_pwr_state = #{pwrEntityPwrState}</if>
<if test="pwrEntityPwrCurrent != null "> and pwr_entity_pwr_current = #{pwrEntityPwrCurrent}</if>
<if test="pwrEntityPwrVoltage != null "> and pwr_entity_pwr_voltage = #{pwrEntityPwrVoltage}</if>
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
</where>
</select>
<select id="selectInitialSwitchPowerSupplyById" parameterType="Long" resultMap="InitialSwitchPowerSupplyResult">
<include refid="selectInitialSwitchPowerSupplyVo"/>
where id = #{id}
</select>
<insert id="insertInitialSwitchPowerSupply" parameterType="InitialSwitchPowerSupply" useGeneratedKeys="true" keyProperty="id">
insert IGNORE into initial_switch_power_supply
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="pwrEntIndex != null">pwr_ent_index,</if>
<if test="pwrName != null">pwr_name,</if>
<if test="pwrEntityPwrState != null">pwr_entity_pwr_state,</if>
<if test="pwrEntityPwrCurrent != null">pwr_entity_pwr_current,</if>
<if test="pwrEntityPwrVoltage != null">pwr_entity_pwr_voltage,</if>
<if test="clientId != null">client_id,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="pwrEntIndex != null">#{pwrEntIndex},</if>
<if test="pwrName != null">#{pwrName},</if>
<if test="pwrEntityPwrState != null">#{pwrEntityPwrState},</if>
<if test="pwrEntityPwrCurrent != null">#{pwrEntityPwrCurrent},</if>
<if test="pwrEntityPwrVoltage != null">#{pwrEntityPwrVoltage},</if>
<if test="clientId != null">#{clientId},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
</trim>
</insert>
<update id="updateInitialSwitchPowerSupply" parameterType="InitialSwitchPowerSupply">
update initial_switch_power_supply
<trim prefix="SET" suffixOverrides=",">
<if test="pwrEntIndex != null">pwr_ent_index = #{pwrEntIndex},</if>
<if test="pwrName != null">pwr_name = #{pwrName},</if>
<if test="pwrEntityPwrState != null">pwr_entity_pwr_state = #{pwrEntityPwrState},</if>
<if test="pwrEntityPwrCurrent != null">pwr_entity_pwr_current = #{pwrEntityPwrCurrent},</if>
<if test="pwrEntityPwrVoltage != null">pwr_entity_pwr_voltage = #{pwrEntityPwrVoltage},</if>
<if test="clientId != null">client_id = #{clientId},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteInitialSwitchPowerSupplyById" parameterType="Long">
delete from initial_switch_power_supply where id = #{id}
</delete>
<delete id="deleteInitialSwitchPowerSupplyByIds" parameterType="String">
delete from initial_switch_power_supply where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.rocketmq.mapper.InitialSystemOtherCollectDataMapper">
<resultMap type="InitialSystemOtherCollectData" id="InitialSystemOtherCollectDataResult">
<result property="id" column="id" />
<result property="clientId" column="client_id" />
<result property="collectType" column="collect_type" />
<result property="collectValue" column="collect_value" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
</resultMap>
<sql id="selectInitialSystemOtherCollectDataVo">
select id, client_id, collect_type, collect_value, create_time, update_time, create_by, update_by from initial_system_other_collect_data
</sql>
<select id="selectInitialSystemOtherCollectDataList" parameterType="InitialSystemOtherCollectData" resultMap="InitialSystemOtherCollectDataResult">
<include refid="selectInitialSystemOtherCollectDataVo"/>
<where>
<if test="clientId != null and clientId != ''"> and client_id = #{clientId}</if>
<if test="collectType != null and collectType != ''"> and collect_type = #{collectType}</if>
<if test="collectValue != null and collectValue != ''"> and collect_value = #{collectValue}</if>
</where>
</select>
<select id="selectInitialSystemOtherCollectDataById" parameterType="Long" resultMap="InitialSystemOtherCollectDataResult">
<include refid="selectInitialSystemOtherCollectDataVo"/>
where id = #{id}
</select>
<insert id="insertInitialSystemOtherCollectData" parameterType="InitialSystemOtherCollectData" useGeneratedKeys="true" keyProperty="id">
insert IGNORE into initial_system_other_collect_data
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="clientId != null and clientId != ''">client_id,</if>
<if test="collectType != null and collectType != ''">collect_type,</if>
<if test="collectValue != null">collect_value,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="clientId != null and clientId != ''">#{clientId},</if>
<if test="collectType != null and collectType != ''">#{collectType},</if>
<if test="collectValue != null">#{collectValue},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
</trim>
</insert>
<update id="updateInitialSystemOtherCollectData" parameterType="InitialSystemOtherCollectData">
update initial_system_other_collect_data
<trim prefix="SET" suffixOverrides=",">
<if test="clientId != null and clientId != ''">client_id = #{clientId},</if>
<if test="collectType != null and collectType != ''">collect_type = #{collectType},</if>
<if test="collectValue != null">collect_value = #{collectValue},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteInitialSystemOtherCollectDataById" parameterType="Long">
delete from initial_system_other_collect_data where id = #{id}
</delete>
<delete id="deleteInitialSystemOtherCollectDataByIds" parameterType="String">
delete from initial_system_other_collect_data where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@@ -0,0 +1,132 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.rocketmq.mapper.RmDeploymentPolicyMapper">
<resultMap type="RmDeploymentPolicy" id="RmDeploymentPolicyResult">
<result property="id" column="id" />
<result property="policyName" column="policy_name" />
<result property="description" column="description" />
<result property="resourceGroupId" column="resource_group_id" />
<result property="includedDevicesId" column="included_devices_id" />
<result property="sourceFilePathType" column="source_file_path_type" />
<result property="sourceFilePath" column="source_file_path" />
<result property="targetDirectory" column="target_directory" />
<result property="commandContent" column="command_content" />
<result property="executionMethod" column="execution_method" />
<result property="scheduledTime" column="scheduled_time" />
<result property="policyStatus" column="policy_status" />
<result property="deployTime" column="deploy_time" />
<result property="scriptType" column="script_type" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
<result property="createBy" column="create_by" />
<result property="updateBy" column="update_by" />
</resultMap>
<sql id="selectRmDeploymentPolicyVo">
select id, policy_name, description, resource_group_id, included_devices_id, source_file_path_type, source_file_path, target_directory, command_content, execution_method, scheduled_time, policy_status, deploy_time, script_type, create_time, update_time, create_by, update_by from rm_deployment_policy
</sql>
<select id="selectRmDeploymentPolicyList" parameterType="RmDeploymentPolicy" resultMap="RmDeploymentPolicyResult">
<include refid="selectRmDeploymentPolicyVo"/>
<where>
<if test="policyName != null and policyName != ''"> and policy_name like concat('%', #{policyName}, '%')</if>
<if test="description != null and description != ''"> and description = #{description}</if>
<if test="resourceGroupId != null "> and resource_group_id = #{resourceGroupId}</if>
<if test="includedDevicesId != null and includedDevicesId != ''"> and included_devices_id = #{includedDevicesId}</if>
<if test="sourceFilePathType != null and sourceFilePathType != ''"> and source_file_path_type = #{sourceFilePathType}</if>
<if test="sourceFilePath != null and sourceFilePath != ''"> and source_file_path = #{sourceFilePath}</if>
<if test="targetDirectory != null and targetDirectory != ''"> and target_directory = #{targetDirectory}</if>
<if test="commandContent != null and commandContent != ''"> and command_content = #{commandContent}</if>
<if test="executionMethod != null"> and execution_method = #{executionMethod}</if>
<if test="scheduledTime != null and scheduledTime != ''"> and scheduled_time = #{scheduledTime}</if>
<if test="policyStatus != null and policyStatus != ''"> and policy_status = #{policyStatus}</if>
<if test="deployTime != null "> and deploy_time = #{deployTime}</if>
<if test="scriptType != null and scriptType != ''"> and script_type = #{scriptType}</if>
</where>
</select>
<select id="selectRmDeploymentPolicyById" parameterType="Long" resultMap="RmDeploymentPolicyResult">
<include refid="selectRmDeploymentPolicyVo"/>
where id = #{id}
</select>
<insert id="insertRmDeploymentPolicy" parameterType="RmDeploymentPolicy" useGeneratedKeys="true" keyProperty="id">
insert into rm_deployment_policy
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="policyName != null and policyName != ''">policy_name,</if>
<if test="description != null">description,</if>
<if test="resourceGroupId != null">resource_group_id,</if>
<if test="includedDevicesId != null">included_devices_id,</if>
<if test="sourceFilePathType != null">source_file_path_type,</if>
<if test="sourceFilePath != null and sourceFilePath != ''">source_file_path,</if>
<if test="targetDirectory != null and targetDirectory != ''">target_directory,</if>
<if test="commandContent != null">command_content,</if>
<if test="executionMethod != null">execution_method,</if>
<if test="scheduledTime != null">scheduled_time,</if>
<if test="policyStatus != null and policyStatus != ''">policy_status,</if>
<if test="deployTime != null">deploy_time,</if>
<if test="scriptType != null">script_type,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="createBy != null">create_by,</if>
<if test="updateBy != null">update_by,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="policyName != null and policyName != ''">#{policyName},</if>
<if test="description != null">#{description},</if>
<if test="resourceGroupId != null">#{resourceGroupId},</if>
<if test="includedDevicesId != null">#{includedDevicesId},</if>
<if test="sourceFilePathType != null">#{sourceFilePathType},</if>
<if test="sourceFilePath != null and sourceFilePath != ''">#{sourceFilePath},</if>
<if test="targetDirectory != null and targetDirectory != ''">#{targetDirectory},</if>
<if test="commandContent != null">#{commandContent},</if>
<if test="executionMethod != null">#{executionMethod},</if>
<if test="scheduledTime != null">#{scheduledTime},</if>
<if test="policyStatus != null and policyStatus != ''">#{policyStatus},</if>
<if test="deployTime != null">#{deployTime},</if>
<if test="scriptType != null">#{scriptType},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="createBy != null">#{createBy},</if>
<if test="updateBy != null">#{updateBy},</if>
</trim>
</insert>
<update id="updateRmDeploymentPolicy" parameterType="RmDeploymentPolicy">
update rm_deployment_policy
<trim prefix="SET" suffixOverrides=",">
<if test="policyName != null and policyName != ''">policy_name = #{policyName},</if>
<if test="description != null">description = #{description},</if>
<if test="resourceGroupId != null">resource_group_id = #{resourceGroupId},</if>
<if test="includedDevicesId != null">included_devices_id = #{includedDevicesId},</if>
<if test="sourceFilePathType != null">source_file_path_type = #{sourceFilePathType},</if>
<if test="sourceFilePath != null and sourceFilePath != ''">source_file_path = #{sourceFilePath},</if>
<if test="targetDirectory != null and targetDirectory != ''">target_directory = #{targetDirectory},</if>
<if test="commandContent != null">command_content = #{commandContent},</if>
<if test="executionMethod != null">execution_method = #{executionMethod},</if>
<if test="scheduledTime != null">scheduled_time = #{scheduledTime},</if>
<if test="policyStatus != null and policyStatus != ''">policy_status = #{policyStatus},</if>
<if test="deployTime != null">deploy_time = #{deployTime},</if>
<if test="scriptType != null">script_type = #{scriptType},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteRmDeploymentPolicyById" parameterType="Long">
delete from rm_deployment_policy where id = #{id}
</delete>
<delete id="deleteRmDeploymentPolicyByIds" parameterType="String">
delete from rm_deployment_policy where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>