From 3ef0aacf0c67de9379c55634179fdc059cd8431e Mon Sep 17 00:00:00 2001 From: gaoyutao Date: Tue, 27 Jan 2026 11:27:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=9695=E5=80=BC=E8=AE=A1=E7=AE=97?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E6=95=B0=E6=8D=AE=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/domain/EpsNodeBandwidth.java | 2 ++ .../mapper/EpsMethodChangeRecordMapper.java | 11 +++++++++- .../EpsInitialTrafficDataServiceImpl.java | 21 +++++++++++++++++++ .../impl/EpsNodeBandwidthServiceImpl.java | 1 + .../system/EpsInitialTrafficDataMapper.xml | 7 +++++-- .../system/EpsMethodChangeRecordMapper.xml | 10 +++++++++ .../mapper/system/EpsNodeBandwidthMapper.xml | 7 ++++++- 7 files changed, 55 insertions(+), 4 deletions(-) diff --git a/tongran-modules/tongran-system/src/main/java/com/tongran/system/domain/EpsNodeBandwidth.java b/tongran-modules/tongran-system/src/main/java/com/tongran/system/domain/EpsNodeBandwidth.java index 707009a..f11120c 100644 --- a/tongran-modules/tongran-system/src/main/java/com/tongran/system/domain/EpsNodeBandwidth.java +++ b/tongran-modules/tongran-system/src/main/java/com/tongran/system/domain/EpsNodeBandwidth.java @@ -129,5 +129,7 @@ public class EpsNodeBandwidth extends BaseEntity private Long monitorId; /** 服务器id \n 分割 */ private String clientIds; + /** mac 地址 */ + private String macAddress; } diff --git a/tongran-modules/tongran-system/src/main/java/com/tongran/system/mapper/EpsMethodChangeRecordMapper.java b/tongran-modules/tongran-system/src/main/java/com/tongran/system/mapper/EpsMethodChangeRecordMapper.java index eb823b1..0308e2a 100644 --- a/tongran-modules/tongran-system/src/main/java/com/tongran/system/mapper/EpsMethodChangeRecordMapper.java +++ b/tongran-modules/tongran-system/src/main/java/com/tongran/system/mapper/EpsMethodChangeRecordMapper.java @@ -1,8 +1,9 @@ package com.tongran.system.mapper; -import java.util.List; import com.tongran.system.domain.EpsMethodChangeRecord; +import java.util.List; + /** * 收益方式修改记录Mapper接口 * @@ -58,4 +59,12 @@ public interface EpsMethodChangeRecordMapper * @return 结果 */ public int deleteEpsMethodChangeRecordByIds(Long[] ids); + + /** + * 查询收益方式修改记录列表 + * + * @param epsMethodChangeRecord 收益方式修改记录 + * @return 收益方式修改记录 + */ + public EpsMethodChangeRecord getNetNameByRecord(EpsMethodChangeRecord epsMethodChangeRecord); } diff --git a/tongran-modules/tongran-system/src/main/java/com/tongran/system/service/impl/EpsInitialTrafficDataServiceImpl.java b/tongran-modules/tongran-system/src/main/java/com/tongran/system/service/impl/EpsInitialTrafficDataServiceImpl.java index 4b6524d..c0742c0 100644 --- a/tongran-modules/tongran-system/src/main/java/com/tongran/system/service/impl/EpsInitialTrafficDataServiceImpl.java +++ b/tongran-modules/tongran-system/src/main/java/com/tongran/system/service/impl/EpsInitialTrafficDataServiceImpl.java @@ -844,6 +844,26 @@ public class EpsInitialTrafficDataServiceImpl implements EpsInitialTrafficDataSe private void calculateNormalDeviceBandwidth(EpsInitialTrafficData queryParam, String dailyStartTime, String dailyEndTime, String calculationMode) { + + // 获取业务变更记录 + EpsMethodChangeRecord changeQuery = new EpsMethodChangeRecord(); + changeQuery.setClientId(queryParam.getClientId()); + changeQuery.setEndTime(dailyEndTime); + EpsMethodChangeRecord record = epsMethodChangeRecordMapper + .getNetNameByRecord(changeQuery); + if(record != null){ + String name = record.getTrafficPort(); + // 查询mac + AllInterfaceName allInterfaceName = new AllInterfaceName(); + allInterfaceName.setClientId(queryParam.getClientId()); + allInterfaceName.setInterfaceName(name); + allInterfaceName.setResourceType("1"); + List allInterfaceNameList = allInterfaceNameMapper.selectByNames(allInterfaceName); + if(allInterfaceNameList != null && !allInterfaceNameList.isEmpty()){ + AllInterfaceName interfaceName = allInterfaceNameList.get(0); + queryParam.setMac(interfaceName.getServerIp()); + } + } queryParam.setStartTime(dailyStartTime); queryParam.setEndTime(dailyEndTime); List dataList = query(queryParam); @@ -967,6 +987,7 @@ public class EpsInitialTrafficDataServiceImpl implements EpsInitialTrafficDataSe // 查询此条数据是否存在 List exitsList = epsNodeBandwidthMapper.selectEpsNodeBandwidthList(bandwidth); bandwidth.setBandwidthResult(result); + bandwidth.setMacAddress(data.getMac()); switch (data.getBandwidthType()){ case "1": bandwidth.setBandwidth95Daily(result); diff --git a/tongran-modules/tongran-system/src/main/java/com/tongran/system/service/impl/EpsNodeBandwidthServiceImpl.java b/tongran-modules/tongran-system/src/main/java/com/tongran/system/service/impl/EpsNodeBandwidthServiceImpl.java index 1886937..cbeb418 100644 --- a/tongran-modules/tongran-system/src/main/java/com/tongran/system/service/impl/EpsNodeBandwidthServiceImpl.java +++ b/tongran-modules/tongran-system/src/main/java/com/tongran/system/service/impl/EpsNodeBandwidthServiceImpl.java @@ -72,6 +72,7 @@ public class EpsNodeBandwidthServiceImpl implements IEpsNodeBandwidthService queryParams.setClientId(epsNodeBandwidth.getClientId()); queryParams.setServiceSn(epsNodeBandwidth.getHardwareSn()); queryParams.setBusinessId(epsNodeBandwidth.getBusinessId()); + queryParams.setMac(epsNodeBandwidth.getMacAddress()); queryParams.setStartTime(dailyStartTime); queryParams.setEndTime(dailyEndTime); // 获取总数 diff --git a/tongran-modules/tongran-system/src/main/resources/mapper/system/EpsInitialTrafficDataMapper.xml b/tongran-modules/tongran-system/src/main/resources/mapper/system/EpsInitialTrafficDataMapper.xml index 6498807..e60c070 100644 --- a/tongran-modules/tongran-system/src/main/resources/mapper/system/EpsInitialTrafficDataMapper.xml +++ b/tongran-modules/tongran-system/src/main/resources/mapper/system/EpsInitialTrafficDataMapper.xml @@ -383,7 +383,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT a.id, GROUP_CONCAT(DISTINCT a.`name` SEPARATOR ',') AS name, - a.`mac` AS mac, + GROUP_CONCAT(DISTINCT a.`mac` SEPARATOR ',') AS mac, a.`status` AS status, a.`type` AS type, a.`ipV4` AS ipV4, @@ -453,7 +453,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and a.revenue_method = #{revenueMethod} - and a.mac = #{mac} + and a.mac in + + #{item} + GROUP BY a.create_time DESC diff --git a/tongran-modules/tongran-system/src/main/resources/mapper/system/EpsMethodChangeRecordMapper.xml b/tongran-modules/tongran-system/src/main/resources/mapper/system/EpsMethodChangeRecordMapper.xml index cf6fed3..ec8159c 100644 --- a/tongran-modules/tongran-system/src/main/resources/mapper/system/EpsMethodChangeRecordMapper.xml +++ b/tongran-modules/tongran-system/src/main/resources/mapper/system/EpsMethodChangeRecordMapper.xml @@ -115,4 +115,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{id} + + \ No newline at end of file diff --git a/tongran-modules/tongran-system/src/main/resources/mapper/system/EpsNodeBandwidthMapper.xml b/tongran-modules/tongran-system/src/main/resources/mapper/system/EpsNodeBandwidthMapper.xml index 3ad322d..191557d 100644 --- a/tongran-modules/tongran-system/src/main/resources/mapper/system/EpsNodeBandwidthMapper.xml +++ b/tongran-modules/tongran-system/src/main/resources/mapper/system/EpsNodeBandwidthMapper.xml @@ -34,15 +34,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + - select id, node_name, hardware_sn, calculation_mode, bandwidth_type, bandwidth_result, bandwidth_95_daily, bandwidth_95_monthly, avg_monthly_bandwidth_95, package_bandwidth_daily, machine_flow, uplink_switch, create_time, update_time, switch_sn, interface_name, resource_type, interface_link_device_type, effective_bandwidth_95_daily, effective_bandwidth_95_monthly, effective_avg_monthly_bandwidth_95, business_name, business_id, remark1, create_datetime, client_id, server_client_id, create_by, update_by from eps_node_bandwidth + select id, node_name, hardware_sn, calculation_mode, bandwidth_type, bandwidth_result, bandwidth_95_daily, bandwidth_95_monthly, avg_monthly_bandwidth_95, package_bandwidth_daily, machine_flow, uplink_switch, create_time, update_time, switch_sn, interface_name, resource_type, interface_link_device_type, effective_bandwidth_95_daily, effective_bandwidth_95_monthly, effective_avg_monthly_bandwidth_95, business_name, business_id, remark1, create_datetime, client_id, server_client_id, create_by, update_by, mac_address from eps_node_bandwidth