|
|
@ -129,7 +129,9 @@ public class StatusController extends BaseController { |
|
|
|
@GetMapping ("/type") |
|
|
|
public AjaxResult getTypeList() |
|
|
|
{ |
|
|
|
List<DcDevice> dcDeviceList = dcDeviceService.numberOfDevicesByType(); |
|
|
|
DcDevice dcDevice = new DcDevice(); |
|
|
|
dcDevice.setUseState(1); |
|
|
|
List<DcDevice> dcDeviceList = dcDeviceService.numberOfDevicesByType(dcDevice); |
|
|
|
HashMap<String, String> itemTypeMap = new HashMap<>(); |
|
|
|
itemTypeMap.put("1-1", "高清网络枪型固定摄像机"); |
|
|
|
itemTypeMap.put("1-2", "高清网络球形摄像机"); |
|
|
@ -153,7 +155,6 @@ public class StatusController extends BaseController { |
|
|
|
Status status = new Status(); |
|
|
|
status.setStartTime(todayStart); |
|
|
|
status.setTime(currentTime); |
|
|
|
status.setUseState(1); |
|
|
|
List<Status> listStatus = statusService.list(status); |
|
|
|
//根据时间分组
|
|
|
|
Map<Integer, List<Status>> map = listStatus.stream() |
|
|
@ -184,9 +185,9 @@ public class StatusController extends BaseController { |
|
|
|
//离线率
|
|
|
|
maps.put("failRate",failRate); |
|
|
|
//已使用数量
|
|
|
|
maps.put("sumUseState",String.valueOf(groupItems.size())); |
|
|
|
maps.put("sum",String.valueOf(groupItems.size())); |
|
|
|
//总数
|
|
|
|
maps.put("sum", String.valueOf(dcDeviceList.stream().filter(item -> Objects.equals(item.getDeviceType(), entrys.getKey())).map(DcDevice::getSumAll).collect(Collectors.toList()).get(0))); |
|
|
|
maps.put("sumUseState", String.valueOf(dcDeviceList.stream().filter(item -> Objects.equals(item.getDeviceType(), entrys.getKey())).map(DcDevice::getSumAll).collect(Collectors.toList()).get(0))); |
|
|
|
if(itemTypeMap.get(entrys.getKey())!=null) { |
|
|
|
subMap.put(itemTypeMap.get(entrys.getKey()), maps); |
|
|
|
} |
|
|
@ -205,8 +206,8 @@ public class StatusController extends BaseController { |
|
|
|
maps.put("sucessRate",String.format("%.2f", sucessRate)+"%"); |
|
|
|
//离线率
|
|
|
|
maps.put("failRate",failRate); |
|
|
|
List<DcDevice> list = dcDeviceService.list(); |
|
|
|
//已使用数量
|
|
|
|
List<DcDevice> list = dcDeviceService.list(); |
|
|
|
maps.put("sumUseState",String.valueOf(lastEntry.size())); |
|
|
|
//总数
|
|
|
|
maps.put("sum",String.valueOf(list.size())); |
|
|
|