| | |
| | | |
| | | |
| | | |
| | | return null; |
| | | //return R.status(alarmService.saveOrUpdate(alarm)); |
| | | //return null; |
| | | return R.status(alarmService.saveOrUpdate(alarm)); |
| | | } |
| | | |
| | | |
| | |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials","true"); |
| | | alarmService.updateJtype(operation.getJid(),operation.getJtype(),operation.getBz(),operation.getZctime()); |
| | | alarmService.updateJtype(operation.getJid(),operation.getJtype(),operation.getBz()); |
| | | alarmService.updatePoliceStatus(operation.getRid(),"0"); |
| | | operationService.save(operation); |
| | | return R.success("修改成功"); |
| | | } |
| | | |
| | | /** |
| | | * 查询所有保安信息 |
| | | */ |
| | | @PostMapping("/queryBa") |
| | | public R queryBa(OperationVO operation, HttpServletResponse response) { |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials","true"); |
| | | return R.data(alarmService.queryBa()); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 统计预警设备数量 |
| | | * @param response |
| | | * @return |
| | | */ |
| | | @GetMapping("/selectEq") |
| | | public R selectEq(HttpServletResponse response) { |
| | | response.setHeader("Access-Control-Allow-Origin", "*"); |
| | | response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); |
| | | response.setHeader("Access-Control-Allow-Credentials","true"); |
| | | List<Map<String, Object>> lists = new ArrayList<>(); |
| | | SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");//设置日期格式 |
| | | String time = df.format(new Date());// new Date()为获取当前系统时间 |
| | | ArrayList<String> strings = pastDay(time); |
| | | Map<String, Object> maps = new HashMap<String, Object>(); |
| | | for (int j=0;j<strings.size();j++){ |
| | | Map<String, Object> map = new HashMap<String, Object>(); |
| | | List<Map<String, Object>> list = alarmService.selectEq(strings.get(j)); |
| | | map.put("time",strings.get(j)); |
| | | map.put("Coun",list.size()); |
| | | lists.add(map); |
| | | } |
| | | return R.data(lists); |
| | | } |
| | | |
| | | } |