心跳监测内容修改,ip对应数据改为clientId对应硬件SN,监控模板,策略bug修改

This commit is contained in:
gaoyutao
2025-09-25 19:12:52 +08:00
parent 939d8d0286
commit cc9593b4bf
28 changed files with 1447 additions and 762 deletions

View File

@@ -77,6 +77,13 @@ public interface EpsServerRevenueConfigMapper
* @return 服务器收益方式配置
*/
public Map getNodeMsgByIp(@Param("ipAddress") String ipAddress);
/**
* 根据sn查询服务器信息
*
* @param hardwareSn 硬件SN
* @return 服务器收益方式配置
*/
public Map getNodeMsgBySn(@Param("hardwareSn") String hardwareSn);
int updateEpsServerRevenueConfigByServerSn(EpsServerRevenueConfig epsServerRevenueConfig);

View File

@@ -173,13 +173,8 @@ public class EpsServerRevenueConfigServiceImpl implements IEpsServerRevenueConfi
List<EpsInitialTrafficData> dataList = epsInitialTrafficDataService.getAllTraficMsg(epsInitialTrafficData);
List<EpsInitialTrafficData> batchList = new ArrayList<>();
for (EpsInitialTrafficData initialTrafficData : dataList) {
// 根据ip查询节点名称
String ip = initialTrafficData.getIpV4() == null ? "" : initialTrafficData.getIpV4();
String mac = initialTrafficData.getMac() == null ? "" : initialTrafficData.getMac();
Map nodeMsg = epsServerRevenueConfigMapper.getNodeMsgByIp(ip);
if(nodeMsg == null){
nodeMsg = epsServerRevenueConfigMapper.getNodeMsgByIp(mac);
}
// 根据clientId查询节点名称
Map nodeMsg = epsServerRevenueConfigMapper.getNodeMsgBySn(initialTrafficData.getClientId());
// 赋值
if(nodeMsg != null){
initialTrafficData.setServiceSn(getNullableString(nodeMsg, "hardwareSn"));

View File

@@ -134,10 +134,10 @@ public class InitialSwitchInfoDetailsServiceImpl implements IInitialSwitchInfoDe
details.setId(null);
// 根据接口名称查询交换机信息
String interfaceName = details.getName();
String switchIp = details.getSwitchIp();
String switchSn = details.getSwitchSn();
RmEpsTopologyManagement rmEpsTopologyManagement = new RmEpsTopologyManagement();
rmEpsTopologyManagement.setInterfaceName(interfaceName);
rmEpsTopologyManagement.setSwitchIpAddress(switchIp);
rmEpsTopologyManagement.setSwitchSn(switchSn);
List<RmEpsTopologyManagement> managements = rmEpsTopologyManagementMapper.selectRmEpsTopologyManagementList(rmEpsTopologyManagement);
// 赋值
if(!managements.isEmpty()){

View File

@@ -54,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<insert id="insertAllInterfaceName" parameterType="AllInterfaceName" useGeneratedKeys="true" keyProperty="id">
insert into all_interface_name
insert IGNORE into all_interface_name
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="clientId != null and clientId != ''">client_id,</if>
<if test="interfaceName != null and interfaceName != ''">interface_name,</if>
@@ -166,7 +166,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- 批量插入接口名称 -->
<insert id="batchInsert" parameterType="java.util.List">
INSERT INTO all_interface_name
INSERT IGNORE INTO all_interface_name
(
interface_name,
client_id,

View File

@@ -148,6 +148,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and rrr.ip_address = #{ipAddress}
</where>
</select>
<select id="getNodeMsgBySn" parameterType="String" resultType="java.util.Map">
SELECT
rrr.hardware_sn AS hardwareSn,
rrr.resource_name AS resourceName,
esrc.revenue_method AS revenueMethod,
esrc.business_code AS businessCode,
esrc.business_name AS businessName,
esrc.package_bandwidth AS packageBandwidth
FROM
rm_resource_registration rrr
LEFT JOIN
eps_server_revenue_config esrc
ON
rrr.hardware_sn = esrc.hardware_sn
<where>
and rrr.registration_status = '1'
and rrr.hardware_sn = #{hardwareSn}
</where>
</select>
<select id="countBySn" parameterType="String">
<include refid="selectEpsServerRevenueConfigVo"/>
where hardware_sn = #{hardwareSn}

View File

@@ -248,7 +248,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateStatusByResource" parameterType="RmResourceRegistration">
update rm_resource_registration
<trim prefix="SET" suffixOverrides=",">
<if test="hardwareSn != null">hardware_sn = #{hardwareSn},</if>
<if test="resourceType != null">resource_type = #{resourceType},</if>
<if test="resourceName != null">resource_name = #{resourceName},</if>
<if test="ipAddress != null">ip_address = #{ipAddress},</if>
@@ -280,7 +279,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="updaterId != null">updater_id = #{updaterId},</if>
<if test="updaterName != null">updater_name = #{updaterName},</if>
</trim>
where ip_address = #{ipAddress}
where hardware_sn = #{hardwareSn}
</update>
<select id="getRegistrationByIds" parameterType="String" resultMap="RmResourceRegistrationResult">
<include refid="selectRmResourceRegistrationVo"/>