diff --git a/pav-server/src/main/java/com/palnet/biz/api/main/statistics/service/MainStatisticsService.java b/pav-server/src/main/java/com/palnet/biz/api/main/statistics/service/MainStatisticsService.java index daeed3b7..3b68e89d 100644 --- a/pav-server/src/main/java/com/palnet/biz/api/main/statistics/service/MainStatisticsService.java +++ b/pav-server/src/main/java/com/palnet/biz/api/main/statistics/service/MainStatisticsService.java @@ -120,7 +120,7 @@ public class MainStatisticsService { */ public List fltStatics(String cate, String date, String[] formatParam){ - List resultList = null; + List resultList = new ArrayList<>(); switch (cate) { case "TIME": @@ -135,6 +135,13 @@ public class MainStatisticsService { resultList = cntrlQueryRepository.fltCountStcs(date, formatParam); break; + default : + + throw new CustomException(ErrorCode.NON_VALID_PARAMETER, cate, date); + } + + for(FlightStcsValueModel node : resultList){ + if(node.getName() == null || node.getName().equals("")) node.setName(" "); } return resultList; @@ -148,7 +155,7 @@ public class MainStatisticsService { * @return */ public List fltTopStatics(String cate, String date, String[] formatParam){ - List resultList = null; + List resultList = new ArrayList<>(); switch (cate) { case "TIME": @@ -163,10 +170,13 @@ public class MainStatisticsService { resultList = cntrlQueryRepository.fltTopCountStcs(date, formatParam); break; + default : + + throw new CustomException(ErrorCode.NON_VALID_PARAMETER, cate, date); } for(FlightStcsValueModel node : resultList){ - if(node.getName().equals("")) node.setName(" "); + if(node.getName() == null || node.getName().equals("")) node.setName(" "); } return resultList; @@ -189,6 +199,10 @@ public class MainStatisticsService { result.add(node); } + for(FlightStcsValueModel node : result){ + if(node.getName() == null || node.getName().equals("")) node.setName(" "); + } + return result; } @@ -204,7 +218,7 @@ public class MainStatisticsService { List resultList = ctrCntrlWarnLogQueryRepository.warnStcs(cate, date, formatParam); for(FlightStcsValueModel node : resultList){ - if(node.getName().equals("")) node.setName(" "); + if(node.getName() == null || node.getName().equals("")) node.setName(" "); } return resultList; @@ -262,7 +276,7 @@ public class MainStatisticsService { } for(FlightStcsValueModel node : resultList){ - if(node.getName().equals("")) node.setName(" "); + if(node.getName() == null || node.getName().equals("")) node.setName(" "); } return resultList; @@ -291,7 +305,7 @@ public class MainStatisticsService { } for(FlightStcsValueModel node : resultList){ - if(node.getName().equals("")) node.setName(" "); + if(node.getName() == null || node.getName().equals("")) node.setName(" "); } return resultList; diff --git a/pav-server/src/main/java/com/palnet/server/handler/SocketHandler.java b/pav-server/src/main/java/com/palnet/server/handler/SocketHandler.java index 94008552..01c76245 100644 --- a/pav-server/src/main/java/com/palnet/server/handler/SocketHandler.java +++ b/pav-server/src/main/java/com/palnet/server/handler/SocketHandler.java @@ -31,8 +31,8 @@ public class SocketHandler extends SimpleChannelInboundHandler { } @Override - protected void channelRead0(ChannelHandlerContext ctx, SocketPayload payload){ - + protected void channelRead0(ChannelHandlerContext ctx, SocketPayload payload){ + try { logger.debug("==================== [SocketHandler channelRead0 ] ==================== ");