修改首页流量统计中addrTypes,transTypes,entranceIds为默认值,避免每次从数据库中查询效率低的问题

This commit is contained in:
renkaige
2019-01-08 20:44:44 +06:00
parent 1ebf5f80a7
commit b38a3652dd
2 changed files with 8 additions and 6 deletions

View File

@@ -216,8 +216,6 @@ public class DashboardServiceController extends BaseRestController {
@RequestMapping(value = "trafficBandwidthTransThree", method = RequestMethod.GET)
@ApiOperation(value = "带宽根据ip46,协议tcp,udp查询详情", httpMethod = "GET", notes = "对应带宽根据IPv4,6,协议tcp,udp统计数据显示")
public Map<String,?> trafficBandwidthTransThree(String beginDate,String endDate,String searchQuotaType,Model model, HttpServletRequest request, HttpServletResponse response) {
String[] addrTypes=dashboardService.getFiledTypeByName("addr_type");
String[] transTypes=dashboardService.getFiledTypeByName("trans_type");
long start = System.currentTimeMillis();
AuditLogThread auditLogThread = super.saveRequestLog(servicesRequestLogService, Constants.OPACTION_GET, request, null);
Map resultMap=new HashMap();

View File

@@ -66,7 +66,14 @@ public class DashboardService extends BaseService {
public NtcTotalReportDao ntcTotalReportDao;
@Autowired
public TrafficPortActiveStatisticDao trafficPortActiveStatisticDao;
//ip地址类型
private final String[] addrTypes = {"4","6"} ;
//tcp udp
private final String[] transTypes ={"17","6"} ;
//区域
private final String[] entranceIds ={"1","2"} ;
/**
* 流量统计 数据显示 info先查询最近时间根据时间条件查询数据 效率提高
*/
@@ -1285,9 +1292,6 @@ public class DashboardService extends BaseService {
dateRangeList.add(calendar.getTime());
calendar.add(Calendar.MINUTE, Constants.TREND_TIME_INTERVAL);
}
String[] addrTypes = getFiledTypeByName("addr_type");
String[] transTypes = getFiledTypeByName("trans_type");
String[] entranceIds = getFiledTypeByName("entrance_id");
if (bandwidthListIPvx != null && bandwidthListIPvx.size() > 0 && bandwidthListProtocol != null
&& bandwidthListProtocol.size() > 0 && addrTypes != null && addrTypes.length > 0
&& transTypes != null && transTypes.length > 0 && entranceIds != null && entranceIds.length > 0) {