whyczh
2021-04-07 42536733ddfce247d5671d321ea1ec1c8b37f36a
更新试验计划参数配置接口
1个文件已修改
34 ■■■■ 已修改文件
src/main/java/com/whyc/controller/TestConfigController.java 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/main/java/com/whyc/controller/TestConfigController.java
@@ -56,18 +56,34 @@
        }
        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;
    }