From 4dd9324dba6853441efd4395b471736109c3520c Mon Sep 17 00:00:00 2001 From: gaoyutao Date: Tue, 2 Sep 2025 19:54:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=A5=E5=BA=93bug=20?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E7=AE=A1=E7=90=86=E6=A8=A1=E5=9D=97bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RmResourceRegistrationController.java | 8 - .../ruoyi/system/domain/AllInterfaceName.java | 12 + .../system/domain/EpsServerRevenueConfig.java | 2 + .../domain/InitialSwitchInfoDetails.java | 3 + .../domain/RmEpsTopologyManagement.java | 168 +--------- .../system/domain/RmResourceRegistration.java | 290 ++---------------- .../system/mapper/AllInterfaceNameMapper.java | 5 +- .../EpsServerRevenueConfigServiceImpl.java | 43 ++- .../InitialSwitchInfoDetailsServiceImpl.java | 26 +- .../RmResourceRegistrationServiceImpl.java | 1 + .../mapper/system/AllInterfaceNameMapper.xml | 73 +++-- .../system/EpsInitialTrafficDataMapper.xml | 8 +- .../system/EpsServerRevenueConfigMapper.xml | 28 +- .../system/InitialSwitchInfoDetailsMapper.xml | 16 +- .../system/RmEpsTopologyManagementMapper.xml | 21 +- .../system/RmResourceRegistrationMapper.xml | 49 ++- .../rocketmq/consumer/RocketMsgListener.java | 9 +- .../rocketmq/domain/InitialSwitchInfo.java | 2 + .../domain/InitialSwitchInfoTemp.java | 118 +------ .../mapper/InitialSwitchInfoTempMapper.java | 2 +- .../IInitialSwitchInfoTempService.java | 2 +- .../InitialSwitchInfoTempServiceImpl.java | 4 +- .../rocketmq/InitialSwitchInfoMapper.xml | 111 ++++--- .../rocketmq/InitialSwitchInfoTempMapper.xml | 38 ++- 24 files changed, 315 insertions(+), 724 deletions(-) diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/RmResourceRegistrationController.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/RmResourceRegistrationController.java index 8288f81..8cf4f3d 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/RmResourceRegistrationController.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/controller/RmResourceRegistrationController.java @@ -54,14 +54,6 @@ public class RmResourceRegistrationController extends BaseController public void export(HttpServletResponse response, RmResourceRegistration rmResourceRegistration) { List list = rmResourceRegistrationService.selectRmResourceRegistrationList(rmResourceRegistration); - for (RmResourceRegistration resourceRegistration : list) { - // 根据端口类型导出端口名称 - if("1".equals(resourceRegistration.getResourcePort())){ - resourceRegistration.setResourcePort("162(SNMP)"); - }else{ - resourceRegistration.setResourcePort(resourceRegistration.getOtherPortName()); - } - } ExcelUtil util = new ExcelUtil(RmResourceRegistration.class); util.showColumn(rmResourceRegistration.getProperties()); util.exportExcel(response, list, "资源注册数据"); diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/AllInterfaceName.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/AllInterfaceName.java index a94273c..84ce1c0 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/AllInterfaceName.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/AllInterfaceName.java @@ -4,6 +4,8 @@ import com.ruoyi.common.core.annotation.Excel; import com.ruoyi.common.core.web.domain.BaseEntity; import lombok.Data; +import java.util.Set; + /** * 所有接口名称对象 all_interface_name * @@ -62,4 +64,14 @@ public class AllInterfaceName extends BaseEntity @Excel(name = "交换机硬件SN") private String switchSn; + /** 接口名称集合 */ + private Set interfaceNames; + /** 交换机ip */ + @Excel(name = "交换机ip") + private String switchIp; + + /** 服务器ip */ + @Excel(name = "服务器ip") + private String serverIp; + } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/EpsServerRevenueConfig.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/EpsServerRevenueConfig.java index c161e81..a93e7a1 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/EpsServerRevenueConfig.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/EpsServerRevenueConfig.java @@ -62,4 +62,6 @@ public class EpsServerRevenueConfig extends BaseEntity private String endTime; /** 业务是否有变化 */ private String changed; + /** 服务器ip */ + private String serverIp; } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/InitialSwitchInfoDetails.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/InitialSwitchInfoDetails.java index 22db930..c2b1f47 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/InitialSwitchInfoDetails.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/InitialSwitchInfoDetails.java @@ -93,4 +93,7 @@ public class InitialSwitchInfoDetails extends BaseEntity private String bandwidthType; /** 日或月 */ private String dayOrMonth; + + /** 交换机ip */ + private String switchIp; } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/RmEpsTopologyManagement.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/RmEpsTopologyManagement.java index 5c3c266..dea2dc9 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/RmEpsTopologyManagement.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/RmEpsTopologyManagement.java @@ -3,8 +3,7 @@ package com.ruoyi.system.domain; import com.fasterxml.jackson.annotation.JsonFormat; import com.ruoyi.common.core.annotation.Excel; import com.ruoyi.common.core.web.domain.BaseEntity; -import org.apache.commons.lang3.builder.ToStringBuilder; -import org.apache.commons.lang3.builder.ToStringStyle; +import lombok.Data; import java.util.Date; @@ -14,6 +13,7 @@ import java.util.Date; * @author gyt * @date 2025-08-12 */ +@Data public class RmEpsTopologyManagement extends BaseEntity { private static final long serialVersionUID = 1L; @@ -71,166 +71,6 @@ public class RmEpsTopologyManagement extends BaseEntity /** 修改人名称 */ private String updaterName; - - - @Override - public Date getCreateTime() { - return createTime; - } - - @Override - public void setCreateTime(Date createTime) { - this.createTime = createTime; - } - - @Override - public Date getUpdateTime() { - return updateTime; - } - - @Override - public void setUpdateTime(Date updateTime) { - this.updateTime = updateTime; - } - - - public void setId(Long id) - { - this.id = id; - } - - public Long getId() - { - return id; - } - - public void setSwitchName(String switchName) - { - this.switchName = switchName; - } - - public String getSwitchName() - { - return switchName; - } - - public void setSwitchSn(String switchSn) - { - this.switchSn = switchSn; - } - - public String getSwitchSn() - { - return switchSn; - } - - public void setInterfaceName(String interfaceName) - { - this.interfaceName = interfaceName; - } - - public String getInterfaceName() - { - return interfaceName; - } - - public void setConnectedDeviceType(String connectedDeviceType) - { - this.connectedDeviceType = connectedDeviceType; - } - - public String getConnectedDeviceType() - { - return connectedDeviceType; - } - - public void setServerName(String serverName) - { - this.serverName = serverName; - } - - public String getServerName() - { - return serverName; - } - - public void setServerSn(String serverSn) - { - this.serverSn = serverSn; - } - - public String getServerSn() - { - return serverSn; - } - - public void setServerPort(String serverPort) - { - this.serverPort = serverPort; - } - - public String getServerPort() - { - return serverPort; - } - - public void setCreatorId(Long creatorId) - { - this.creatorId = creatorId; - } - - public Long getCreatorId() - { - return creatorId; - } - - public void setCreatorName(String creatorName) - { - this.creatorName = creatorName; - } - - public String getCreatorName() - { - return creatorName; - } - - public void setUpdaterId(Long updaterId) - { - this.updaterId = updaterId; - } - - public Long getUpdaterId() - { - return updaterId; - } - - public void setUpdaterName(String updaterName) - { - this.updaterName = updaterName; - } - - public String getUpdaterName() - { - return updaterName; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("switchName", getSwitchName()) - .append("switchSn", getSwitchSn()) - .append("interfaceName", getInterfaceName()) - .append("connectedDeviceType", getConnectedDeviceType()) - .append("serverName", getServerName()) - .append("serverSn", getServerSn()) - .append("serverPort", getServerPort()) - .append("createTime", getCreateTime()) - .append("updateTime", getUpdateTime()) - .append("creatorId", getCreatorId()) - .append("creatorName", getCreatorName()) - .append("updaterId", getUpdaterId()) - .append("updaterName", getUpdaterName()) - .toString(); - } + /** 交换机ip */ + private String switchIpAddress; } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/RmResourceRegistration.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/RmResourceRegistration.java index f10fce2..73ed9a0 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/RmResourceRegistration.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/domain/RmResourceRegistration.java @@ -1,9 +1,8 @@ package com.ruoyi.system.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; +import lombok.Data; /** * 资源注册对象 rm_resource_registration @@ -11,6 +10,7 @@ import com.ruoyi.common.core.web.domain.BaseEntity; * @author gyt * @date 2025-08-12 */ +@Data public class RmResourceRegistration extends BaseEntity { private static final long serialVersionUID = 1L; @@ -42,19 +42,32 @@ public class RmResourceRegistration extends BaseEntity /**其他端口名称 */ private String otherPortName; + /** agent版本 */ + @Excel(name = "agent版本") + private String agentVersion; + /** 协议 1.TCP,2.UDP */ @Excel(name = "协议",readConverterExp = "1=TCP,2=UDP") private String protocol; - + /** SNMP探测 0=否,1=是 */ + @Excel(name = "",readConverterExp = "0=否,1=是") + private String snmpDetect; /** 版本(1.SNMPv2,2.SNMPv3) */ - @Excel(name = "版本",readConverterExp = "1=SNMPv2,2=SNMPv3") + @Excel(name = "SNMP版本",readConverterExp = "1=华为SNMPv2c,2=华为SNMPv3") private String resourceVersion; /** 读写权限(1.RW,2.ReadOnly) */ - @Excel(name = "读写权限",readConverterExp = "1=RW,2=ReadOnly") + @Excel(name = "读写权限",readConverterExp = "1=只读,2=可读可写") private String rwPermission; + /** 团体名称 */ + @Excel(name = "团体名称") + private String teamName; + + /** SNMP采集地址 */ + @Excel(name = "SNMP采集地址") + private String snmpCollectAddr; /** 安全级别(1.authPriv、2.authNoPriv,3.noAuthNoPriv) */ @Excel(name = "安全级别",readConverterExp = "1=authPriv,2=authNoPriv,3=noAuthNoPriv") @@ -106,271 +119,4 @@ public class RmResourceRegistration extends BaseEntity /** 修改人名称 */ private String updaterName; - public String getOtherPortName() { - return otherPortName; - } - - public void setOtherPortName(String otherPortName) { - this.otherPortName = otherPortName; - } - - public void setId(Long id) - { - this.id = id; - } - - public Long getId() - { - return id; - } - - public void setHardwareSn(String hardwareSn) - { - this.hardwareSn = hardwareSn; - } - - public String getHardwareSn() - { - return hardwareSn; - } - - public void setResourceType(String resourceType) - { - this.resourceType = resourceType; - } - - public String getResourceType() - { - return resourceType; - } - - public void setResourceName(String resourceName) - { - this.resourceName = resourceName; - } - - public String getResourceName() - { - return resourceName; - } - - public void setIpAddress(String ipAddress) - { - this.ipAddress = ipAddress; - } - - public String getIpAddress() - { - return ipAddress; - } - - public void setResourcePort(String resourcePort) - { - this.resourcePort = resourcePort; - } - - public String getResourcePort() - { - return resourcePort; - } - - public void setProtocol(String protocol) - { - this.protocol = protocol; - } - - public String getProtocol() - { - return protocol; - } - - public void setResourceVersion(String resourceVersion) - { - this.resourceVersion = resourceVersion; - } - - public String getResourceVersion() - { - return resourceVersion; - } - - public void setRwPermission(String rwPermission) - { - this.rwPermission = rwPermission; - } - - public String getRwPermission() - { - return rwPermission; - } - - public void setSecurityLevel(String securityLevel) - { - this.securityLevel = securityLevel; - } - - public String getSecurityLevel() - { - return securityLevel; - } - - public void setEncryption(String encryption) - { - this.encryption = encryption; - } - - public String getEncryption() - { - return encryption; - } - - public void setResourcePwd(String resourcePwd) - { - this.resourcePwd = resourcePwd; - } - - public String getResourcePwd() - { - return resourcePwd; - } - - public void setRegistrationStatus(String registrationStatus) - { - this.registrationStatus = registrationStatus; - } - - public String getRegistrationStatus() - { - return registrationStatus; - } - - public void setOnlineStatus(String onlineStatus) - { - this.onlineStatus = onlineStatus; - } - - public String getOnlineStatus() - { - return onlineStatus; - } - - public void setDescription(String description) - { - this.description = description; - } - - public String getDescription() - { - return description; - } - - public void setCustomerId(Long customerId) - { - this.customerId = customerId; - } - - public Long getCustomerId() - { - return customerId; - } - - public void setCustomerName(String customerName) - { - this.customerName = customerName; - } - - public String getCustomerName() - { - return customerName; - } - - public void setServiceNumber(String serviceNumber) - { - this.serviceNumber = serviceNumber; - } - - public String getServiceNumber() - { - return serviceNumber; - } - - public void setCreatorId(Long creatorId) - { - this.creatorId = creatorId; - } - - public Long getCreatorId() - { - return creatorId; - } - - public void setCreatorName(String creatorName) - { - this.creatorName = creatorName; - } - - public String getCreatorName() - { - return creatorName; - } - - public void setUpdaterId(Long updaterId) - { - this.updaterId = updaterId; - } - - public Long getUpdaterId() - { - return updaterId; - } - - public void setUpdaterName(String updaterName) - { - this.updaterName = updaterName; - } - - public String getUpdaterName() - { - return updaterName; - } - - public String getResourceUserName() { - return resourceUserName; - } - - public void setResourceUserName(String resourceUserName) { - this.resourceUserName = resourceUserName; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("hardwareSn", getHardwareSn()) - .append("resourceType", getResourceType()) - .append("resourceName", getResourceName()) - .append("ipAddress", getIpAddress()) - .append("resourcePort", getResourcePort()) - .append("otherPortName", getOtherPortName()) - .append("protocol", getProtocol()) - .append("resourceVersion", getResourceVersion()) - .append("rwPermission", getRwPermission()) - .append("securityLevel", getSecurityLevel()) - .append("encryption", getEncryption()) - .append("resourcePwd", getResourcePwd()) - .append("resourceUserName", getResourceName()) - .append("registrationStatus", getRegistrationStatus()) - .append("onlineStatus", getOnlineStatus()) - .append("description", getDescription()) - .append("customerId", getCustomerId()) - .append("customerName", getCustomerName()) - .append("serviceNumber", getServiceNumber()) - .append("createTime", getCreateTime()) - .append("updateTime", getUpdateTime()) - .append("creatorId", getCreatorId()) - .append("creatorName", getCreatorName()) - .append("updaterId", getUpdaterId()) - .append("updaterName", getUpdaterName()) - .toString(); - } } diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/AllInterfaceNameMapper.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/AllInterfaceNameMapper.java index bab602c..6655650 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/AllInterfaceNameMapper.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/mapper/AllInterfaceNameMapper.java @@ -4,7 +4,6 @@ import com.ruoyi.system.domain.AllInterfaceName; import org.springframework.data.repository.query.Param; import java.util.List; -import java.util.Set; /** * 所有接口名称Mapper接口 @@ -64,10 +63,10 @@ public interface AllInterfaceNameMapper /** * 根据接口名称查询表中是否存在信息 - * @param names + * @param interfaceName * @return */ - List selectByNames(Set names); + List selectByNames(AllInterfaceName interfaceName); /** * 批量插入接口名称 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/EpsServerRevenueConfigServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/EpsServerRevenueConfigServiceImpl.java index 7897bcf..49aca1d 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/EpsServerRevenueConfigServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/EpsServerRevenueConfigServiceImpl.java @@ -179,12 +179,12 @@ public class EpsServerRevenueConfigServiceImpl implements IEpsServerRevenueConfi Map nodeMsg = epsServerRevenueConfigMapper.getNodeMsgByIp(ip); // 赋值 if(nodeMsg != null){ - initialTrafficData.setServiceSn(nodeMsg.get("hardwareSn") + ""); - initialTrafficData.setNodeName(nodeMsg.get("resourceName") + ""); - initialTrafficData.setRevenueMethod(nodeMsg.get("revenueMethod") + ""); - initialTrafficData.setBusinessId(nodeMsg.get("businessCode") + ""); - initialTrafficData.setBusinessName(nodeMsg.get("businessName") + ""); - if("2".equals(String.valueOf(nodeMsg.get("revenueMethod"))) + initialTrafficData.setServiceSn(getNullableString(nodeMsg, "hardwareSn")); + initialTrafficData.setNodeName(getNullableString(nodeMsg, "resourceName")); + initialTrafficData.setRevenueMethod(getNullableString(nodeMsg, "revenueMethod")); + initialTrafficData.setBusinessId(getNullableString(nodeMsg, "businessCode")); + initialTrafficData.setBusinessName(getNullableString(nodeMsg, "businessName")); + if("2".equals(nodeMsg.get("revenueMethod") + "") && nodeMsg.containsKey("packageBandwidth")){ Object bandwidth = nodeMsg.get("packageBandwidth"); if (bandwidth instanceof BigDecimal) { @@ -210,6 +210,13 @@ public class EpsServerRevenueConfigServiceImpl implements IEpsServerRevenueConfi return R.fail("数据保存失败:" + e.getMessage()); } } + private static String getNullableString(Map map, String key) { + Object value = map.get(key); + return value != null ? value.toString() : null; + } + private String getCompositeKey(String clientId, String interfaceName) { + return clientId + "|" + interfaceName; + } /** * 批量处理接口名称 */ @@ -225,11 +232,19 @@ public class EpsServerRevenueConfigServiceImpl implements IEpsServerRevenueConfi } // 批量查询已存在的接口名称 - List existingNames = allInterfaceNameMapper.selectByNames(interfaceNames); + AllInterfaceName allInterfaceName = new AllInterfaceName(); + if(!trafficDataList.isEmpty()){ + allInterfaceName.setClientId(trafficDataList.get(0).getClientId()); + allInterfaceName.setInterfaceNames(interfaceNames); + } + List existingNames = allInterfaceNameMapper.selectByNames(allInterfaceName); // 转为 Map<接口名称, 数据库记录> 便于快速查找 Map existingNameMap = existingNames.stream() - .collect(Collectors.toMap(AllInterfaceName::getInterfaceName, Function.identity())); - + .collect(Collectors.toMap( + item -> item.getClientId() + "|" + item.getInterfaceName(), // 关键修改点 + Function.identity(), + (oldValue, newValue) -> oldValue // 重复时保留旧记录 + )); // 分类处理:新增列表 vs 更新列表 List namesToInsert = new ArrayList<>(); List namesToUpdate = new ArrayList<>(); @@ -249,10 +264,11 @@ public class EpsServerRevenueConfigServiceImpl implements IEpsServerRevenueConfi newRecord.setNodeName(data.getNodeName()); newRecord.setBusinessCode(data.getBusinessId()); newRecord.setBusinessName(data.getBusinessName()); - + newRecord.setServerIp(data.getIpV4()); // 判断是否需要更新 - if (existingNameMap.containsKey(name)) { - AllInterfaceName oldRecord = existingNameMap.get(name); + String compositeKey = data.getClientId() + "|" + name; + if (existingNameMap.containsKey(compositeKey)) { + AllInterfaceName oldRecord = existingNameMap.get(compositeKey); if (isRecordChanged(oldRecord, newRecord)) { newRecord.setId(oldRecord.getId()); // 保留原ID namesToUpdate.add(newRecord); @@ -279,7 +295,8 @@ public class EpsServerRevenueConfigServiceImpl implements IEpsServerRevenueConfi !Objects.equals(oldRecord.getDeviceSn(), newRecord.getDeviceSn()) || !Objects.equals(oldRecord.getNodeName(), newRecord.getNodeName()) || !Objects.equals(oldRecord.getBusinessCode(), newRecord.getBusinessCode()) || - !Objects.equals(oldRecord.getBusinessName(), newRecord.getBusinessName()); + !Objects.equals(oldRecord.getBusinessName(), newRecord.getBusinessName()) || + !Objects.equals(oldRecord.getServerIp(), newRecord.getServerIp()); } /** * 批量删除服务器收益方式配置 diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/InitialSwitchInfoDetailsServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/InitialSwitchInfoDetailsServiceImpl.java index e60f7da..09c0766 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/InitialSwitchInfoDetailsServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/InitialSwitchInfoDetailsServiceImpl.java @@ -127,8 +127,10 @@ public class InitialSwitchInfoDetailsServiceImpl implements IInitialSwitchInfoDe for (InitialSwitchInfoDetails details : dataList) { // 根据接口名称查询交换机信息 String interfaceName = details.getName(); + String switchIp = details.getSwitchIp(); RmEpsTopologyManagement rmEpsTopologyManagement = new RmEpsTopologyManagement(); rmEpsTopologyManagement.setInterfaceName(interfaceName); + rmEpsTopologyManagement.setSwitchIpAddress(switchIp); List managements = rmEpsTopologyManagementMapper.selectRmEpsTopologyManagementList(rmEpsTopologyManagement); // 赋值 if(!managements.isEmpty()){ @@ -190,12 +192,19 @@ public class InitialSwitchInfoDetailsServiceImpl implements IInitialSwitchInfoDe if (interfaceNames.isEmpty()) { return; } - + AllInterfaceName allInterfaceName = new AllInterfaceName(); + if(!initialSwitchInfoDetails.isEmpty()){ + allInterfaceName.setClientId(initialSwitchInfoDetails.get(0).getClientId()); + allInterfaceName.setInterfaceNames(interfaceNames); + } // 批量查询已存在的接口名称 - List existingNames = allInterfaceNameMapper.selectByNames(interfaceNames); + List existingNames = allInterfaceNameMapper.selectByNames(allInterfaceName); Map existingNameMap = existingNames.stream() - .collect(Collectors.toMap(AllInterfaceName::getInterfaceName, Function.identity())); - + .collect(Collectors.toMap( + item -> item.getClientId() + "|" + item.getInterfaceName(), // 关键修改点 + Function.identity(), + (oldValue, newValue) -> oldValue // 重复时保留旧记录 + )); // 分类处理:新增列表 vs 更新列表 List namesToInsert = new ArrayList<>(); List namesToUpdate = new ArrayList<>(); @@ -216,6 +225,7 @@ public class InitialSwitchInfoDetailsServiceImpl implements IInitialSwitchInfoDe record.setInterfaceDeviceType(data.getInterfaceDeviceType()); record.setSwitchName(data.getSwitchName()); record.setSwitchSn(data.getSwitchSn()); + record.setSwitchIp(data.getSwitchIp()); // 根据服务器sn查询业务 if(data.getServerSn() != null){ EpsServerRevenueConfig epsServerRevenueConfig = new EpsServerRevenueConfig(); @@ -231,8 +241,9 @@ public class InitialSwitchInfoDetailsServiceImpl implements IInitialSwitchInfoDe record.setBusinessName(null); } // 判断是否需要更新 - if (existingNameMap.containsKey(name)) { - AllInterfaceName existingRecord = existingNameMap.get(name); + String compositeKey = data.getClientId() + "|" + name; + if (existingNameMap.containsKey(compositeKey)) { + AllInterfaceName existingRecord = existingNameMap.get(compositeKey); if (isRecordChanged(existingRecord, record)) { record.setId(existingRecord.getId()); // 保留原ID namesToUpdate.add(record); @@ -264,7 +275,8 @@ public class InitialSwitchInfoDetailsServiceImpl implements IInitialSwitchInfoDe !Objects.equals(oldRecord.getSwitchName(), newRecord.getSwitchName()) || !Objects.equals(oldRecord.getBusinessCode(), newRecord.getBusinessCode()) || !Objects.equals(oldRecord.getBusinessName(), newRecord.getBusinessName()) || - !Objects.equals(oldRecord.getSwitchSn(), newRecord.getSwitchSn()); + !Objects.equals(oldRecord.getSwitchSn(), newRecord.getSwitchSn()) || + !Objects.equals(oldRecord.getSwitchIp(), newRecord.getSwitchIp()); } public void calculateSwitch95BandwidthDaily(InitialSwitchInfoDetails queryParam, String dailyStartTime, String dailyEndTime) { diff --git a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RmResourceRegistrationServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RmResourceRegistrationServiceImpl.java index 7694c19..78c6c8a 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RmResourceRegistrationServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/RmResourceRegistrationServiceImpl.java @@ -126,6 +126,7 @@ public class RmResourceRegistrationServiceImpl implements IRmResourceRegistratio epsServerRevenueConfig.setNodeName(rmResourceRegistration.getResourceName()); epsServerRevenueConfig.setCreateTime(DateUtils.getNowDate()); epsServerRevenueConfig.setRegistrationStatus(rmResourceRegistration.getRegistrationStatus()); + epsServerRevenueConfig.setServerIp(rmResourceRegistration.getIpAddress()); // 新增前判断是否存在 EpsServerRevenueConfig exits = epsServerRevenueConfigMapper.countBySn(epsServerRevenueConfig.getHardwareSn()); if(exits != null){ diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/AllInterfaceNameMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/AllInterfaceNameMapper.xml index f0f8cbd..3b8b231 100644 --- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/AllInterfaceNameMapper.xml +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/AllInterfaceNameMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -17,15 +17,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + + + + + - select id, client_id, interface_name, device_sn, node_name, business_code, business_name, resource_type, switch_name, interface_device_type, server_port, switch_sn, create_time, update_time, create_by, update_by from all_interface_name + select id, client_id, interface_name, device_sn, node_name, business_code, business_name, resource_type, create_time, update_time, create_by, update_by, switch_name, interface_device_type, server_port, switch_sn, switch_ip, server_ip from all_interface_name - + + @@ -146,7 +167,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" node_name, business_code, business_name, - switch_name, interface_device_type, server_port, switch_sn, + switch_name, interface_device_type, server_port, switch_sn, switch_ip, server_ip, create_time, update_time ) @@ -160,7 +181,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{item.nodeName}, #{item.businessCode}, #{item.businessName}, - #{item.switchName}, #{item.interfaceDeviceType}, #{item.serverPort}, #{item.switchSn}, + #{item.switchName}, #{item.interfaceDeviceType}, #{item.serverPort}, #{item.switchSn}, #{item.switchIp}, #{item.serverIp}, NOW(), NOW() ) @@ -203,7 +224,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" server_port = #{item.serverPort}, interface_device_type = #{item.interfaceDeviceType}, switch_name = #{item.switchName}, - switch_sn = #{item.switchSn} + switch_sn = #{item.switchSn}, + switch_ip = #{item.switchIp}, + server_ip = #{item.serverIp} WHERE id = #{item.id} diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/EpsInitialTrafficDataMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/EpsInitialTrafficDataMapper.xml index 79dbbbc..8249960 100644 --- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/EpsInitialTrafficDataMapper.xml +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/EpsInitialTrafficDataMapper.xml @@ -12,8 +12,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" `status` VARCHAR(20) COMMENT '运行状态', `type` VARCHAR(30) COMMENT '接口类型', ipV4 VARCHAR(20) COMMENT 'IPv4地址', - `in_dropped` DECIMAL(5,2) COMMENT '入站丢包率(%)', - `out_dropped` DECIMAL(5,2) COMMENT '出站丢包率(%)', + `in_dropped` DECIMAL(20,2) COMMENT '入站丢包率(%)', + `out_dropped` DECIMAL(20,2) COMMENT '出站丢包率(%)', `in_speed` varchar(50) COMMENT '接收带宽(Mbps)', `out_speed` varchar(50) COMMENT '发送带宽(Mbps)', `speed` varchar(100) COMMENT '协商速度', @@ -43,8 +43,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" `status` VARCHAR(20) COMMENT '运行状态', `type` VARCHAR(30) COMMENT '接口类型', ipV4 VARCHAR(20) COMMENT 'IPv4地址', - `in_dropped` DECIMAL(5,2) COMMENT '入站丢包率(%)', - `out_dropped` DECIMAL(5,2) COMMENT '出站丢包率(%)', + `in_dropped` DECIMAL(20,2) COMMENT '入站丢包率(%)', + `out_dropped` DECIMAL(20,2) COMMENT '出站丢包率(%)', `in_speed` VARCHAR(20) COMMENT '接收带宽(Mbps)', `out_speed` VARCHAR(20) COMMENT '发送带宽(Mbps)', `speed` varchar(100) COMMENT '协商速度', diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/EpsServerRevenueConfigMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/EpsServerRevenueConfigMapper.xml index d5093b3..d506462 100644 --- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/EpsServerRevenueConfigMapper.xml +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/EpsServerRevenueConfigMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -20,16 +20,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + - select id, node_name, revenue_method, hardware_sn, traffic_port, bandwidth_95, package_bandwidth, update_time, business_name, business_code, registration_status, create_by, update_by, create_time, changed from eps_server_revenue_config + select id, node_name, revenue_method, hardware_sn, traffic_port, bandwidth_95, package_bandwidth, update_time, business_name, business_code, registration_status, create_by, update_by, create_time, changed, server_ip from eps_server_revenue_config - + - - insert into eps_server_revenue_config @@ -70,7 +67,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_by, create_time, changed, - + server_ip, + #{id}, #{nodeName}, @@ -87,7 +85,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{updateBy}, #{createTime}, #{changed}, - + #{serverIp}, + @@ -107,6 +106,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" update_by = #{updateBy}, create_time = #{createTime}, changed = #{changed}, + server_ip = #{serverIp}, where id = #{id} @@ -116,7 +116,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from eps_server_revenue_config where id in + delete from eps_server_revenue_config where id in #{id} @@ -141,4 +141,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and rrr.ip_address = #{ipAddress} + \ No newline at end of file diff --git a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/InitialSwitchInfoDetailsMapper.xml b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/InitialSwitchInfoDetailsMapper.xml index d48255e..8f2be72 100644 --- a/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/InitialSwitchInfoDetailsMapper.xml +++ b/ruoyi-modules/ruoyi-system/src/main/resources/mapper/system/InitialSwitchInfoDetailsMapper.xml @@ -14,6 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -29,7 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, client_id, name, in_bytes, out_bytes, status, type, in_speed, out_speed, 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 from initial_switch_info_details - + and switch_name like concat('%', #{switchName}, '%') and switch_sn = #{switchSn} - and interface_name= #{interfaceName} + and interface_name like concat('%', #{interfaceName}, '%') and connected_device_type = #{connectedDeviceType} and server_name like concat('%', #{serverName}, '%') and server_sn = #{serverSn} @@ -39,9 +40,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and creator_name like concat('%', #{creatorName}, '%') and updater_id = #{updaterId} and updater_name like concat('%', #{updaterName}, '%') + and switch_ip_address = #{switchIpAddress} - + - + and hardware_sn = #{hardwareSn} and resource_type = #{resourceType} and resource_name like concat('%', #{resourceName}, '%') and ip_address = #{ipAddress} and resource_port = #{resourcePort} - and other_port_name = #{otherPortName} + and other_port_name like concat('%', #{otherPortName}, '%') + and agent_version = #{agentVersion} and protocol = #{protocol} and resource_version = #{resourceVersion} and rw_permission = #{rwPermission} + and snmp_detect = #{snmpDetect} + and team_name like concat('%', #{teamName}, '%') + and snmp_collect_addr = #{snmpCollectAddr} and security_level = #{securityLevel} and encryption = #{encryption} - and resource_user_name = #{resourceUserName} + and resource_user_name like concat('%', #{resourceUserName}, '%') and resource_pwd = #{resourcePwd} and registration_status = #{registrationStatus} and online_status = #{onlineStatus} @@ -64,17 +72,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and updater_id = #{updaterId} and updater_name like concat('%', #{updaterName}, '%') - order by create_time desc - + - insert into rm_resource_registration @@ -85,9 +88,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ip_address, resource_port, other_port_name, + agent_version, protocol, resource_version, rw_permission, + snmp_detect, + team_name, + snmp_collect_addr, security_level, encryption, resource_user_name, @@ -104,7 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" creator_name, updater_id, updater_name, - + #{hardwareSn}, #{resourceType}, @@ -112,9 +119,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{ipAddress}, #{resourcePort}, #{otherPortName}, + #{agentVersion}, #{protocol}, #{resourceVersion}, #{rwPermission}, + #{snmpDetect}, + #{teamName}, + #{snmpCollectAddr}, #{securityLevel}, #{encryption}, #{resourceUserName}, @@ -131,7 +142,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{creatorName}, #{updaterId}, #{updaterName}, - + @@ -143,9 +154,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ip_address = #{ipAddress}, resource_port = #{resourcePort}, other_port_name = #{otherPortName}, + agent_version = #{agentVersion}, protocol = #{protocol}, resource_version = #{resourceVersion}, rw_permission = #{rwPermission}, + snmp_detect = #{snmpDetect}, + team_name = #{teamName}, + snmp_collect_addr = #{snmpCollectAddr}, security_level = #{securityLevel}, encryption = #{encryption}, resource_user_name = #{resourceUserName}, @@ -171,7 +186,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - delete from rm_resource_registration where id in + delete from rm_resource_registration where id in #{id} @@ -186,7 +201,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + \ No newline at end of file diff --git a/ruoyi-rocketmq/src/main/java/com/ruoyi/rocketmq/consumer/RocketMsgListener.java b/ruoyi-rocketmq/src/main/java/com/ruoyi/rocketmq/consumer/RocketMsgListener.java index c7e64c8..b2089a5 100644 --- a/ruoyi-rocketmq/src/main/java/com/ruoyi/rocketmq/consumer/RocketMsgListener.java +++ b/ruoyi-rocketmq/src/main/java/com/ruoyi/rocketmq/consumer/RocketMsgListener.java @@ -337,9 +337,14 @@ public class RocketMsgListener implements MessageListenerConcurrently { } } }); + }else{ + switchInfos.forEach(switchInfo -> { + switchInfo.setClientId(message.getClientId()); + switchInfo.setCreateTime(createTime); + }); } - // 清空临时表 - initialSwitchInfoTempService.truncateSwitchInfoTemp(); + // 清空临时表对应switch信息 + initialSwitchInfoTempService.truncateSwitchInfoTemp(message.getClientId()); // 临时表 用来计算inSpeed outSeppd initialSwitchInfoTempService.batchInsertInitialSwitchInfoTemp(switchInfos); // 初始交换机数据入库 diff --git a/ruoyi-rocketmq/src/main/java/com/ruoyi/rocketmq/domain/InitialSwitchInfo.java b/ruoyi-rocketmq/src/main/java/com/ruoyi/rocketmq/domain/InitialSwitchInfo.java index 4b2d083..d9f3ed0 100644 --- a/ruoyi-rocketmq/src/main/java/com/ruoyi/rocketmq/domain/InitialSwitchInfo.java +++ b/ruoyi-rocketmq/src/main/java/com/ruoyi/rocketmq/domain/InitialSwitchInfo.java @@ -39,6 +39,8 @@ public class InitialSwitchInfo extends BaseEntity private BigDecimal inSpeed; /** 发送流量(bytes/s) */ private BigDecimal outSpeed; + /** 交换机ip */ + private String switchIp; } diff --git a/ruoyi-rocketmq/src/main/java/com/ruoyi/rocketmq/domain/InitialSwitchInfoTemp.java b/ruoyi-rocketmq/src/main/java/com/ruoyi/rocketmq/domain/InitialSwitchInfoTemp.java index 30375f6..fe8e497 100644 --- a/ruoyi-rocketmq/src/main/java/com/ruoyi/rocketmq/domain/InitialSwitchInfoTemp.java +++ b/ruoyi-rocketmq/src/main/java/com/ruoyi/rocketmq/domain/InitialSwitchInfoTemp.java @@ -1,10 +1,10 @@ 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; +import lombok.Data; + +import java.math.BigDecimal; /** * 交换机监控信息对象 initial_switch_info_temp @@ -12,6 +12,7 @@ import com.ruoyi.common.core.web.domain.BaseEntity; * @author gyt * @date 2025-08-26 */ +@Data public class InitialSwitchInfoTemp extends BaseEntity { private static final long serialVersionUID = 1L; @@ -50,113 +51,6 @@ public class InitialSwitchInfoTemp extends BaseEntity /** 发送流量(bytes/s) */ @Excel(name = "发送流量", readConverterExp = "b=ytes/s") private BigDecimal outSpeed; - - 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 setName(String name) - { - this.name = name; - } - - public String getName() - { - return name; - } - - public void setInBytes(BigDecimal inBytes) - { - this.inBytes = inBytes; - } - - public BigDecimal getInBytes() - { - return inBytes; - } - - public void setOutBytes(BigDecimal outBytes) - { - this.outBytes = outBytes; - } - - public BigDecimal getOutBytes() - { - return outBytes; - } - - public void setStatus(String status) - { - this.status = status; - } - - public String getStatus() - { - return status; - } - - public void setType(String type) - { - this.type = type; - } - - public String getType() - { - return type; - } - - public void setInSpeed(BigDecimal inSpeed) - { - this.inSpeed = inSpeed; - } - - public BigDecimal getInSpeed() - { - return inSpeed; - } - - public void setOutSpeed(BigDecimal outSpeed) - { - this.outSpeed = outSpeed; - } - - public BigDecimal getOutSpeed() - { - return outSpeed; - } - - @Override - public String toString() { - return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) - .append("id", getId()) - .append("clientId", getClientId()) - .append("name", getName()) - .append("inBytes", getInBytes()) - .append("outBytes", getOutBytes()) - .append("status", getStatus()) - .append("type", getType()) - .append("inSpeed", getInSpeed()) - .append("outSpeed", getOutSpeed()) - .append("createBy", getCreateBy()) - .append("updateBy", getUpdateBy()) - .append("createTime", getCreateTime()) - .append("updateTime", getUpdateTime()) - .toString(); - } + /** 交换机ip */ + private String switchIp; } diff --git a/ruoyi-rocketmq/src/main/java/com/ruoyi/rocketmq/mapper/InitialSwitchInfoTempMapper.java b/ruoyi-rocketmq/src/main/java/com/ruoyi/rocketmq/mapper/InitialSwitchInfoTempMapper.java index 4e9ddc7..4f25dba 100644 --- a/ruoyi-rocketmq/src/main/java/com/ruoyi/rocketmq/mapper/InitialSwitchInfoTempMapper.java +++ b/ruoyi-rocketmq/src/main/java/com/ruoyi/rocketmq/mapper/InitialSwitchInfoTempMapper.java @@ -69,5 +69,5 @@ public interface InitialSwitchInfoTempMapper */ public int batchInsertInitialSwitchInfoTemp(@Param("list") List list); - void truncateSwitchInfoTemp(); + void truncateSwitchInfoTemp(String clientId); } diff --git a/ruoyi-rocketmq/src/main/java/com/ruoyi/rocketmq/service/IInitialSwitchInfoTempService.java b/ruoyi-rocketmq/src/main/java/com/ruoyi/rocketmq/service/IInitialSwitchInfoTempService.java index 8eb8f76..8143d19 100644 --- a/ruoyi-rocketmq/src/main/java/com/ruoyi/rocketmq/service/IInitialSwitchInfoTempService.java +++ b/ruoyi-rocketmq/src/main/java/com/ruoyi/rocketmq/service/IInitialSwitchInfoTempService.java @@ -69,5 +69,5 @@ public interface IInitialSwitchInfoTempService */ public int batchInsertInitialSwitchInfoTemp(List list); - void truncateSwitchInfoTemp(); + void truncateSwitchInfoTemp(String clientId); } diff --git a/ruoyi-rocketmq/src/main/java/com/ruoyi/rocketmq/service/impl/InitialSwitchInfoTempServiceImpl.java b/ruoyi-rocketmq/src/main/java/com/ruoyi/rocketmq/service/impl/InitialSwitchInfoTempServiceImpl.java index eedf5c2..2b24b7c 100644 --- a/ruoyi-rocketmq/src/main/java/com/ruoyi/rocketmq/service/impl/InitialSwitchInfoTempServiceImpl.java +++ b/ruoyi-rocketmq/src/main/java/com/ruoyi/rocketmq/service/impl/InitialSwitchInfoTempServiceImpl.java @@ -116,7 +116,7 @@ public class InitialSwitchInfoTempServiceImpl implements IInitialSwitchInfoTempS } @Override - public void truncateSwitchInfoTemp() { - initialSwitchInfoTempMapper.truncateSwitchInfoTemp(); + public void truncateSwitchInfoTemp(String clientId) { + initialSwitchInfoTempMapper.truncateSwitchInfoTemp(clientId); } } diff --git a/ruoyi-rocketmq/src/main/resources/mapper/rocketmq/InitialSwitchInfoMapper.xml b/ruoyi-rocketmq/src/main/resources/mapper/rocketmq/InitialSwitchInfoMapper.xml index eba9fff..91873f2 100644 --- a/ruoyi-rocketmq/src/main/resources/mapper/rocketmq/InitialSwitchInfoMapper.xml +++ b/ruoyi-rocketmq/src/main/resources/mapper/rocketmq/InitialSwitchInfoMapper.xml @@ -5,51 +5,39 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - - - - - - - - - - - - - + + + + + + + + + + + + + + - SELECT - id, client_id, `name`, in_bytes, out_bytes, status, `type`, - in_speed, out_speed, 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, create_by, update_by, create_time, update_time from initial_switch_info - INSERT INTO initial_switch_info + insert into initial_switch_info - client_id, - name, + client_id, + name, in_bytes, out_bytes, status, type, in_speed, - out_speed, + out_speed, + switch_ip, create_by, update_by, - create_time, - update_time + create_time, + update_time, - - #{clientId}, - #{name}, + + #{clientId}, + #{name}, #{inBytes}, #{outBytes}, #{status}, #{type}, #{inSpeed}, - #{outSpeed}, + #{outSpeed}, + #{switchIp}, #{createBy}, #{updateBy}, - NOW(), - NOW() + #{createTime}, + #{updateTime}, - UPDATE initial_switch_info - - client_id = #{clientId}, - name = #{name}, + update initial_switch_info + + client_id = #{clientId}, + name = #{name}, in_bytes = #{inBytes}, out_bytes = #{outBytes}, status = #{status}, type = #{type}, - in_speed = #{inSpeed} - out_speed = #{outSpeed} + in_speed = #{inSpeed}, + out_speed = #{outSpeed}, + switch_ip = #{switchIp}, + create_by = #{createBy}, update_by = #{updateBy}, - update_time = NOW() - - WHERE id = #{id} + create_time = #{createTime}, + update_time = #{updateTime}, + + where id = #{id} @@ -120,14 +113,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" INSERT INTO initial_switch_info ( - client_id, name, in_bytes, out_bytes, status, type, in_speed, out_speed, + client_id, `name`, in_bytes, out_bytes, status, `type`, in_speed, out_speed, switch_ip, create_by, update_by, create_time, update_time ) VALUES ( #{item.clientId}, #{item.name}, #{item.inBytes}, #{item.outBytes}, - #{item.status}, #{item.type}, #{item.inSpeed}, #{item.outSpeed}, #{item.createBy}, #{item.updateBy}, + #{item.status}, #{item.type}, #{item.inSpeed}, #{item.outSpeed}, #{item.switchIp}, #{item.createBy}, #{item.updateBy}, #{item.createTime} diff --git a/ruoyi-rocketmq/src/main/resources/mapper/rocketmq/InitialSwitchInfoTempMapper.xml b/ruoyi-rocketmq/src/main/resources/mapper/rocketmq/InitialSwitchInfoTempMapper.xml index a6d76c4..1a0d90a 100644 --- a/ruoyi-rocketmq/src/main/resources/mapper/rocketmq/InitialSwitchInfoTempMapper.xml +++ b/ruoyi-rocketmq/src/main/resources/mapper/rocketmq/InitialSwitchInfoTempMapper.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -14,6 +14,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + @@ -21,12 +22,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" - select id, client_id, name, in_bytes, out_bytes, status, type, in_speed, out_speed, 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, create_by, update_by, create_time, update_time from initial_switch_info_temp - +