| | |
| | | import javax.validation.Valid; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | return R.success("修改成功"); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 监控台统计 |
| | | * @return |
| | | */ |
| | | @PostMapping("/SeleC") |
| | | public R SeleC() { |
| | | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式 |
| | | String time = df.format(new Date());// new Date()为获取当前系统时间 |
| | | //设备在线数量 |
| | | Integer integerz = equipmentService.selectEqCz(); |
| | | //设备掉线数量 |
| | | Integer integerd = equipmentService.selectEqCd(); |
| | | //设备预警数量 |
| | | List<Map<String, Object>> list = equipmentService.selectEqCy(time); |
| | | //设备故障数量 |
| | | Integer integerg = equipmentService.selectEqCg(); |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | map.put("zx",integerz); |
| | | map.put("dx",integerd); |
| | | map.put("yj",list.size()); |
| | | map.put("gz",integerg); |
| | | return R.data(map); |
| | | } |
| | | |
| | | } |