| | |
| | | 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.*; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | @GetMapping("/pageDept") |
| | | @ApiOperationSupport(order = 3) |
| | | @ApiOperation(value = "分页", notes = "传入equipment") |
| | | public R<IPage<EquipmentVO>> pageDept(EquipmentVO equipment, Query query, String pid, HttpServletResponse response) throws ParseException { |
| | | public R<IPage<EquipmentVO>> pageDept(EquipmentVO equipment, Query query, String pid,String dxtype, HttpServletResponse response) throws ParseException { |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials", "true"); |
| | | |
| | | IPage<EquipmentVO> page = equipmentService.selectDeptPages(Condition.getPage(query), equipment, pid); |
| | | IPage<EquipmentVO> page = equipmentService.selectDeptPages(Condition.getPage(query), equipment, pid,dxtype); |
| | | |
| | | for (int j = 0; j < page.getRecords().size(); j++) { |
| | | String expireTime = page.getRecords().get(j).getExpireTime(); |
| | |
| | | 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); |
| | | } |
| | | |
| | | } |