| | |
| | | @ResponseBody |
| | | @PostMapping("/station/getTaskNo") |
| | | public R query(@RequestBody StaParam param) { |
| | | log.info("根据站点查询staNo:{}", param); |
| | | String staNo = param.getStaNo(); |
| | | Map<Integer, StaProtocol> station = stationService.getStationMap(param.getDevpId()); |
| | | StaProtocol staProtocol = station.get(Integer.parseInt(staNo)); |
| | |
| | | @ResponseBody |
| | | @PostMapping("/station/getError") |
| | | public R getError(@RequestBody StaParam param) { |
| | | log.info("根据站点查询staNo:{}", param); |
| | | String staNo = param.getStaNo(); |
| | | Map<Integer, StaProtocol> station = stationService.getStationMap(param.getDevpId()); |
| | | StaProtocol staProtocol = station.get(Integer.parseInt(staNo)); |
| | | return R.ok(staPlcErr(staProtocol)); |
| | | Map<Integer, StaProtocol> stationMap = stationService.getStationMap(param.getDevpId()); |
| | | List<PlcErrorTableVo> data = new ArrayList<>(); |
| | | for (Integer key : stationMap.keySet()) { |
| | | StaProtocol staProtocol = stationMap.get(key); |
| | | data = staPlcErr(data, staProtocol); |
| | | } |
| | | return R.ok(data); |
| | | } |
| | | |
| | | |
| | | private List<PlcErrorTableVo> staPlcErr(StaProtocol staProtocol) { |
| | | private List<PlcErrorTableVo> staPlcErr(List<PlcErrorTableVo> list, StaProtocol staProtocol) { |
| | | if (staProtocol == null) { |
| | | return null; |
| | | } |
| | | List<PlcErrorTableVo> list = new ArrayList<>(); |
| | | if (staProtocol.getBreakerErr()) { |
| | | PlcErrorTableVo vo = new PlcErrorTableVo(); |
| | | vo.setStaNo(staProtocol.getSiteId()); |