| | |
| | | package com.whyc.webService; |
| | | |
| | | import com.whyc.service.UserService; |
| | | import com.whyc.util.DateUtil; |
| | | import com.whyc.webService.dto.request.Api; |
| | | import com.whyc.webService.dto.request.RequestParam; |
| | | import com.whyc.webService.dto.response.response1.Corporation; |
| | |
| | | |
| | | import javax.jws.WebService; |
| | | import javax.servlet.ServletContext; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.LinkedList; |
| | | import java.util.List; |
| | |
| | | break; |
| | | //2在线用户数 |
| | | case "BusinessSystemOnlineNum": |
| | | item2(apisResponse); |
| | | getItem2(apisResponse); |
| | | break; |
| | | //3日登录用户数 |
| | | case "BusinessDayLoginNum": |
| | | getItem3(apisResponse); |
| | | break; |
| | | } |
| | | } |
| | |
| | | return null; |
| | | } |
| | | |
| | | private void item2(List<com.whyc.webService.dto.response.response1.Api> apisResponse) { |
| | | private void getItem3(List<com.whyc.webService.dto.response.response1.Api> apisResponse) { |
| | | HashMap<String, String> loginMap = (HashMap<String, String>) servletContext.getAttribute("login"); |
| | | int loginQuantity = 0; |
| | | if(loginMap != null){ |
| | | String dateStr = DateUtil.YYYY_MM_DD.format(new Date()); |
| | | loginMap.values().removeIf(aString -> !aString.equals(dateStr)); |
| | | loginQuantity = loginMap.size(); |
| | | } |
| | | com.whyc.webService.dto.response.response1.Api apiResponse = new com.whyc.webService.dto.response.response1.Api(); |
| | | apiResponse.setName("BusinessDayLoginNum"); |
| | | apiResponse.setValue(loginQuantity); |
| | | apisResponse.add(apiResponse); |
| | | } |
| | | |
| | | private void getItem2(List<com.whyc.webService.dto.response.response1.Api> apisResponse) { |
| | | HashMap<String, Long> onlineMap = (HashMap<String, Long>) servletContext.getAttribute("online"); |
| | | //统计更新时间在10秒钟内的 |
| | | int onlineQuantity = 0; |