Просмотр исходного кода

修复 水稻测温病导出报错

zhaiyifei 10 месяцев назад
Родитель
Сommit
a5f23fc805

+ 4 - 1
src/main/java/com/yunfeiyun/agmp/iotm/device/bzy/controller/IotDeviceBzyController.java

@@ -202,8 +202,11 @@ public class IotDeviceBzyController extends BaseController {
         if(iotDevice == null){
             throw new IotBizException(ErrorCode.INVALID_PARAMETER.getCode(),"设备不存在");
         }
+        JSONObject jsonObject = new JSONObject();
         IotDeviceconfig iotDeviceconfig = iIotDeviceconfigService.selectIotDeviceConfigByDevBid(devBid);
-        JSONObject jsonObject = JSONObject.parseObject(iotDeviceconfig.getDevcfgContext());
+        if(iotDeviceconfig != null){
+            jsonObject = JSONObject.parseObject(iotDeviceconfig.getDevcfgContext());
+        }
         return AjaxResult.success(jsonObject);
     }