| | |
| | | package com.hxzkmonitor.controller; |
| | | |
| | | |
| | | import cn.hutool.json.JSONObject; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.hxzkmonitor.pojo.TbEvrydayweiyi2024; |
| | |
| | | String[] ed = new String[size]; |
| | | String[] nd = new String[size]; |
| | | String[] x = new String[size]; |
| | | List<JSONObject> list = new ArrayList<>(); |
| | | for (int i = 0; i < size; i++) { |
| | | hd[i] = data.get(i).getTdmm(); |
| | | ed[i] = data.get(i).getEdmm(); |
| | | nd[i] = data.get(i).getNdmm(); |
| | | x[i] = data.get(i).getFilename(); |
| | | LinkedHashMap<String, Object> json = new LinkedHashMap<>(); |
| | | json.put("编号", data.get(i).getTagid()); |
| | | json.put("设备名称", data.get(i).getAnchorname()); |
| | | json.put("东位移", data.get(i).getEdmm()); |
| | | json.put("北位移", data.get(i).getNdmm()); |
| | | json.put("天位移", data.get(i).getTdmm()); |
| | | json.put("添加时间", data.get(i).getAddtime()); |
| | | list.add(new JSONObject(json)); |
| | | } |
| | | Map<String, Object> result = new HashMap<>(); |
| | | result.put("ed", ed); |
| | | result.put("nd", nd); |
| | | result.put("hd", hd); |
| | | result.put("x", x); |
| | | return R.ok(result); |
| | | return R.ok(list); |
| | | } |
| | | |
| | | @PostMapping("/api/handlechartupdate3") |
| | |
| | | return R.ok(result); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/api/getweiyi") |
| | | public R getweiyi(String tagid) { |
| | | TbEvrydayweiyi2024 data = new TbEvrydayweiyi2024(); |
| | | data = tbEvrydayweiyi2024Service.getweiyi( tagid); |
| | | JSONObject json = new JSONObject(); |
| | | if (data!=null){ |
| | | json.put("东位移", data.getEdmm()); |
| | | json.put("北位移", data.getNdmm()); |
| | | json.put("天位移", data.getTdmm()); |
| | | json.put("编号", tagid); |
| | | json.put("是否在线", data.getOnlie()); |
| | | } |
| | | |
| | | return R.ok(json); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/api/gettagidweiyi") |
| | | public R gettagidweiyi(String tagid) { |
| | | // Map<String, Object> data = new ArrayList<>(); |
| | | Map<String, Object> data = tbEvrydayweiyi2024Service.gettagidweiyi( tagid); |
| | | JSONObject json = new JSONObject(); |
| | | // if (data.size()>0){ |
| | | // int size = data.size(); |
| | | // String[] hd = new String[size]; |
| | | // String[] ed = new String[size]; |
| | | // String[] nd = new String[size]; |
| | | // String[] x = new String[size]; |
| | | // for (int i = 0; i < size; i++) { |
| | | // hd[i] = data.get(i).getTdmm(); |
| | | // ed[i] = data.get(i).getEdmm(); |
| | | // nd[i] = data.get(i).getNdmm(); |
| | | // x[i] = data.get(i).getFilename(); |
| | | // } |
| | | // Map<String, Object> result = new HashMap<>(); |
| | | // result.put("ed", ed); |
| | | // result.put("nd", nd); |
| | | // result.put("hd", hd); |
| | | // result.put("x", x); |
| | | return R.ok(data); |
| | | // } |
| | | |
| | | // return R.ok(json); |
| | | } |
| | | } |
| | | |