| | |
| | | */ |
| | | @PostMapping("/addYSYMonitor") |
| | | public ResponseVO<Object> addYSYMonitor(@RequestBody MonitorParam monitorParam) { |
| | | if (monitorParam == null || monitorParam.getAccessToken() == null || monitorParam.getDeviceSerial() == null) { |
| | | throw new BusinessException("参数不正确!"); |
| | | } |
| | | YSY_MonitorDto addMonitorDto = monitorService.addYSYMonitor(monitorParam.getAccessToken(), monitorParam.getDeviceSerial(), monitorParam.getValidateCode()); |
| | | // YSY_MonitorDto addMonitorDto = monitorService.addYSYMonitor(monitorParam.getAccessToken(), monitorParam.getDeviceSerial()); |
| | | |
| | |
| | | if ("200".equals(getMonitorDto.getCode())) { |
| | | Monitor monitor = new Monitor(); |
| | | monitor.setDeviceSerial(getMonitorDto.getData().getDeviceSerial()); |
| | | // monitor.setDevicesCode(monitorParam.getValidateCode()); |
| | | if (monitorParam.getValidateCode() != null) { |
| | | monitor.setDevicesCode(monitorParam.getValidateCode()); |
| | | } |
| | | monitor.setDeviceName(getMonitorDto.getData().getDeviceName()); |
| | | monitor.setDeviceType(getMonitorDto.getData().getModel()); |
| | | monitor.setEquipmentState(getMonitorDto.getData().getStatus()); |