| | |
| | | @PostMapping("/addYSYMonitor") |
| | | public ResponseVO<Object> addYSYMonitor(@RequestBody MonitorParam monitorParam) { |
| | | YSY_MonitorDto addMonitorDto = monitorService.addYSYMonitor(monitorParam.getAccessToken(), monitorParam.getDeviceSerial(), monitorParam.getValidateCode()); |
| | | // YSY_MonitorDto addMonitorDto = monitorService.addYSYMonitor(monitorParam.getAccessToken(), monitorParam.getDeviceSerial()); |
| | | |
| | | if ("200".equals(addMonitorDto.getCode())) { |
| | | return ResponseUtil.success(addMonitorDto); |
| | |
| | | YSY_MonitorDto getMonitorDto = monitorService.getYSYMonitorInfo(monitorParam.getAccessToken(), monitorParam.getDeviceSerial()); |
| | | |
| | | if ("200".equals(getMonitorDto.getCode())) { |
| | | Monitor monitor = new Monitor(); |
| | | monitor.setDeviceSerial(getMonitorDto.getData().getDeviceSerial()); |
| | | // monitor.setDevicesCode(monitorParam.getValidateCode()); |
| | | monitor.setDeviceName(getMonitorDto.getData().getDeviceName()); |
| | | monitor.setDeviceType(getMonitorDto.getData().getModel()); |
| | | monitor.setEquipmentState(getMonitorDto.getData().getStatus()); |
| | | monitor.setIsEncrypt(getMonitorDto.getData().getIsEncrypt()); |
| | | monitor.setAddTime(getMonitorDto.getData().getUpdateTime()); |
| | | monitor.setNetAddress(getMonitorDto.getData().getNetAddress()); |
| | | monitorService.addMonitorInfoToTable(monitor); |
| | | |
| | | return ResponseUtil.success(getMonitorDto.getData()); |
| | | } else { |
| | | return ResponseUtil.fail(getMonitorDto.getMsg()); |
| | |
| | | if ("200".equals(getMonitorDto.getCode())) { |
| | | Monitor monitor = new Monitor(); |
| | | monitor.setDeviceSerial(getMonitorDto.getData().getDeviceSerial()); |
| | | monitor.setDevicesCode(monitorParam.getValidateCode()); |
| | | // monitor.setDevicesCode(monitorParam.getValidateCode()); |
| | | monitor.setDeviceName(getMonitorDto.getData().getDeviceName()); |
| | | monitor.setDeviceType(getMonitorDto.getData().getModel()); |
| | | monitor.setEquipmentState(getMonitorDto.getData().getStatus()); |