| | |
| | | } |
| | | return new Response().set(1,deviceInfList); |
| | | } |
| | | //设备id获取设备类型id,将设备类型的默认参数复制到设备类返回 |
| | | //设备id获取设备类型id,如果设备有参数显示本身参数,如果没有将设备类型的默认参数复制到设备类返回 |
| | | public DeviceInf getDefaultConfig(Integer deviceId){ |
| | | DeviceInf deviceInf = deviceInfService.getOneByDeviceId(deviceId); |
| | | DeviceType deviceType = deviceTypeService.getOneByDeviceTypeId(deviceInf.getSystemId()); |
| | | deviceInf.setLoadStartType(deviceType.getLoadStartType()); |
| | | deviceInf.setLoadRuntimeHour(deviceType.getLoadRuntimeHour()); |
| | | deviceInf.setLoadRuntimeMin(deviceType.getLoadRuntimeMin()); |
| | | deviceInf.setLoadCurrStd(deviceType.getLoadCurrStd()); |
| | | deviceInf.setLoadVolStd(deviceType.getLoadVolStd()); |
| | | deviceInf.setLoadRpm(deviceType.getLoadRpm()); |
| | | deviceInf.setLoadTorque(deviceType.getLoadTorque()); |
| | | deviceInf.setLoadPropulsionShaft(deviceType.getLoadPropulsionShaft()); |
| | | if (deviceInf.getLoadStartType() == null) { |
| | | deviceInf.setLoadStartType(deviceType.getLoadStartType()); |
| | | } |
| | | if (deviceInf.getLoadRuntimeHour() == null) { |
| | | deviceInf.setLoadRuntimeHour(deviceType.getLoadRuntimeHour()); |
| | | } |
| | | if (deviceInf.getLoadRuntimeMin() == null) { |
| | | deviceInf.setLoadRuntimeMin(deviceType.getLoadRuntimeMin()); |
| | | } |
| | | if (deviceInf.getLoadCurrStd() == null) { |
| | | deviceInf.setLoadCurrStd(deviceType.getLoadCurrStd()); |
| | | } |
| | | if (deviceInf.getLoadVolStd() == null) { |
| | | deviceInf.setLoadVolStd(deviceType.getLoadVolStd()); |
| | | } |
| | | if (deviceInf.getLoadRpm() == null) { |
| | | deviceInf.setLoadRpm(deviceType.getLoadRpm()); |
| | | } |
| | | if (deviceInf.getLoadTorque() == null) { |
| | | deviceInf.setLoadTorque(deviceType.getLoadTorque()); |
| | | } |
| | | if (deviceInf.getLoadPropulsionShaft() == null) { |
| | | deviceInf.setLoadPropulsionShaft(deviceType.getLoadPropulsionShaft()); |
| | | } |
| | | return deviceInf; |
| | | } |
| | | |