donglang преди 3 месеца
родител
ревизия
27f5bcfaee

+ 3 - 0
iot-platform-manager/src/main/java/com/platform/api/response/VehicleDataResp.java

@@ -82,6 +82,9 @@ public class VehicleDataResp {
     }
 
     public static VehicleDataResp toIotPageResp(VehicleTimeSeriesData seriesData){
+        if (seriesData == null) {
+            return VehicleDataResp.getInstance();
+        }
         VehicleDataResp devicePageResp = VehicleDataResp.getInstance();
         devicePageResp.setTs(seriesData.getTs());
         devicePageResp.setLongitude(seriesData.getLongitude());

+ 3 - 0
iot-platform-manager/src/main/java/com/platform/entity/IotDevice.java

@@ -161,6 +161,9 @@ public class IotDevice {
     }
 
     public static IotDevice toIotDevice(IotDeviceSaveRequest request) {
+        if (request == null) {
+            return new IotDevice();
+        }
         IotDevice iotDevice = IotDevice.getInstance();
         iotDevice.setTenantId(null);
         iotDevice.setCompanyId(null);

+ 3 - 0
iot-platform-manager/src/main/java/com/platform/entity/IotDeviceGroup.java

@@ -89,6 +89,9 @@ public class IotDeviceGroup {
     }
 
     public static IotDeviceGroup toIotDeviceGroup(IotDeviceGroupSaveRequest request) {
+        if (request == null) {
+            return new IotDeviceGroup();
+        }
         IotDeviceGroup instance = IotDeviceGroup.getInstance();
         instance.setDeviceGroupCode(UUID.randomUUID().toString());
         instance.setTitle(request.getTitle());

+ 8 - 2
iot-platform-manager/src/main/java/com/platform/entity/IotMod.java

@@ -1,9 +1,12 @@
 package com.platform.entity;
 
-import com.baomidou.mybatisplus.annotation.*;
-import com.platform.request.mod.IotModRequest;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
 import com.platform.request.mod.IotModSaveRequest;
 import lombok.Data;
+
 import java.time.LocalDateTime;
 import java.util.UUID;
 
@@ -123,6 +126,9 @@ public class IotMod {
 
 
     public static IotMod requestToIotMod(IotModSaveRequest request){
+        if (request == null) {
+            return new IotMod();
+        }
         IotMod iotMod = IotMod.getInstance();
         iotMod.setTenantId(null);
         iotMod.setModCode(UUID.randomUUID().toString());

+ 3 - 0
iot-platform-manager/src/main/java/com/platform/entity/IotModGroup.java

@@ -82,6 +82,9 @@ public class IotModGroup {
 
 
     public static IotModGroup requestToIotModGroup(IotModGroupSaveRequest request) {
+        if (request == null) {
+            return new IotModGroup();
+        }
         IotModGroup iotModGroup = IotModGroup.getInstance();
         iotModGroup.setCompanyId(null);
         iotModGroup.setTenantId(null);

+ 3 - 0
iot-platform-manager/src/main/java/com/platform/entity/VehicleData.java

@@ -134,6 +134,9 @@ public class VehicleData {
 
 
     public static VehicleData toVehicleData(VehicleDataVO vo){
+        if (vo == null) {
+            return new VehicleData();
+        }
         VehicleData vehicleData = VehicleData.getInstance();
         vehicleData.setCarNo(vo.getCarNo());
         vehicleData.setFleetId(vo.getFleetId());

+ 0 - 15
iot-platform-manager/src/main/java/com/platform/entity/VehicleTimeSeriesData.java

@@ -2,7 +2,6 @@ package com.platform.entity;
 
 
 import com.baomidou.mybatisplus.annotation.TableName;
-import com.platform.api.request.VehicleDataVO;
 import lombok.Data;
 
 import java.time.LocalDateTime;
@@ -82,18 +81,4 @@ public class VehicleTimeSeriesData {
      */
     private Integer alarmCode;
 
-
-
-    private static VehicleTimeSeriesData getInstance(){
-        return new VehicleTimeSeriesData();
-    }
-
-
-    public static VehicleTimeSeriesData toVehicleData(VehicleDataVO vo){
-        VehicleTimeSeriesData vehicleData = VehicleTimeSeriesData.getInstance();
-        vehicleData.setCarNo(vo.getCarNo());
-
-
-        return vehicleData;
-    }
 }

+ 3 - 0
iot-platform-manager/src/main/java/com/platform/response/device/IotDeviceResp.java

@@ -80,6 +80,9 @@ public class IotDeviceResp {
     }
 
     public static IotDeviceResp toIotPageResp(IotDevice iotDevice){
+        if (iotDevice == null) {
+            return new IotDeviceResp();
+        }
         IotDeviceResp devicePageResp = IotDeviceResp.getInstance();
         devicePageResp.setId(iotDevice.getId());
         devicePageResp.setDeviceCode(iotDevice.getDeviceCode());

+ 0 - 98
iot-platform-manager/src/main/java/com/platform/response/deviceGroup/DeviceGroupDetailResp.java

@@ -1,98 +0,0 @@
-package com.platform.response.deviceGroup;
-
-import com.platform.entity.IotDeviceGroup;
-import lombok.Data;
-
-import java.io.Serial;
-import java.io.Serializable;
-
-
-
-
-/**
- * @author PC
- */
-@Data
-public class DeviceGroupDetailResp implements Serializable {
-
-
-    @Serial
-    private static final long serialVersionUID = -3891584296778137376L;
-    /**
-     * 主键ID
-     */
-    private Long id;
-
-    /**
-     * 设备分组码值
-     */
-    private String deviceGroupCode;
-
-    /**
-     * 租户id
-     */
-    private String tenantId;
-
-    /**
-     * 所属客户id
-     */
-
-    private Long companyId;
-
-    /**
-     * 设备分组名称
-     */
-
-    private String title;
-
-    /**
-     * [有点晕?]1-12(车辆、装载机、矿卡、人员、水表、电表、边坡监控、视频监控、皮带称重、环境监测、无人地磅、排放监测)
-     */
-    private Integer largeType;
-
-    /**
-     * 0-未删除,1-删除
-     */
-    private Integer delFlag;
-
-    /**
-     * 创建时间
-     */
-    private String createTime;
-
-    /**
-     * 更新时间
-     */
-
-    private String updateTime;
-
-    /**
-     * 创建人
-     */
-    private String createUser;
-
-    /**
-     * 更新人
-     */
-    private String updateUser;
-
-    public static DeviceGroupDetailResp getInstance(){
-        return new DeviceGroupDetailResp();
-    }
-
-    public static DeviceGroupDetailResp toDeviceGroupDetailResp(IotDeviceGroup iotDeviceGroup) {
-        DeviceGroupDetailResp instance = DeviceGroupDetailResp.getInstance();
-        instance.setId(iotDeviceGroup.getId());
-        instance.setDeviceGroupCode(iotDeviceGroup.getDeviceGroupCode());
-        instance.setTenantId(iotDeviceGroup.getTenantId());
-        instance.setCompanyId(iotDeviceGroup.getCompanyId());
-        instance.setTitle(iotDeviceGroup.getTitle());
-        instance.setLargeType(iotDeviceGroup.getLargeType());
-        instance.setDelFlag(iotDeviceGroup.getDelFlag());
-        instance.setCreateTime("");
-        instance.setUpdateTime("");
-        instance.setCreateUser(iotDeviceGroup.getCreateUser());
-        instance.setUpdateUser(iotDeviceGroup.getUpdateUser());
-        return instance;
-    }
-}

+ 3 - 0
iot-platform-manager/src/main/java/com/platform/response/deviceGroup/IotDeviceGroupPageResp.java

@@ -41,6 +41,9 @@ public class IotDeviceGroupPageResp implements Serializable {
 
 
     public static IotDeviceGroupPageResp toDevicePageResp(IotDeviceGroup deviceGroup) {
+        if (deviceGroup == null) {
+            return new IotDeviceGroupPageResp();
+        }
         IotDeviceGroupPageResp deviceGroupPageResp = IotDeviceGroupPageResp.getInstance();
         deviceGroupPageResp.setId(deviceGroup.getId());
         deviceGroupPageResp.setDeviceGroupCode(deviceGroup.getDeviceGroupCode());

+ 0 - 118
iot-platform-manager/src/main/java/com/platform/response/mod/IotModDetailResp.java

@@ -1,118 +0,0 @@
-package com.platform.response.mod;
-
-
-import com.platform.entity.IotMod;
-import lombok.Data;
-
-import java.time.LocalDateTime;
-
-/**
- * Author: donglang
- * Time: 2025-10-09
- * Des: 物理模型详情模型
- * Version: 1.0
- */
-
-@Data
-public class IotModDetailResp {
-
-    /**
-     * 主键ID
-     */
-    private Long id;
-
-    /**
-     * 租户id
-     */
-    private String tenantId;
-
-    /**
-     * 物理模型码值
-     */
-    private String modCode;
-
-    /**
-     * 所属客户id
-     */
-    private Long companyId;
-
-    /**
-     * 物模型分组码值
-     */
-    private String modeGroupCode;
-
-    /**
-     * 唯一标识
-     */
-    private String guid;
-
-    /**
-     * 物模型名称
-     */
-    private String name;
-
-    /**
-     * 最后一次更新值[原来字段 desc]
-     */
-    private String description;
-
-    /**
-     * 备注
-     */
-    private String remarks;
-
-    /**
-     * 包含JSON
-     */
-    private String tslJson;
-
-    /**
-     * 版本[原来字段 tsl_ver]
-     */
-    private Integer version;
-
-    /**
-     * 设备数
-     */
-    private Integer num;
-
-    /**
-     * 0-未删除,1-删除
-     */
-    private Integer delFlag;
-
-    /**
-     * 创建人
-     */
-    private String createUser;
-
-    /**
-     * 更新人
-     */
-    private String updateUser;
-
-    /**
-     * 创建时间
-     */
-    private LocalDateTime createTime;
-
-    /**
-     * 更新时间
-     */
-    private LocalDateTime updateTime;
-
-    private static IotModDetailResp getInstance(){
-        return new IotModDetailResp();
-    }
-
-
-    public static IotModDetailResp toIotDetailResp(IotMod iotMod){
-        IotModDetailResp iotModDetailResp = IotModDetailResp.getInstance();
-        iotModDetailResp.setModCode(iotMod.getModCode());
-        //TODO
-
-        return iotModDetailResp;
-
-    }
-
-}

+ 3 - 0
iot-platform-manager/src/main/java/com/platform/response/mod/IotModResp.java

@@ -71,6 +71,9 @@ public class IotModResp {
 
 
     public static IotModResp toIotPageResp(IotMod iotMod){
+        if (iotMod == null) {
+            return new IotModResp();
+        }
         IotModResp iotModPageResp = IotModResp.getInstance();
         iotModPageResp.setId(iotMod.getId());
         iotModPageResp.setTenantId(iotMod.getTenantId());

+ 0 - 118
iot-platform-manager/src/main/java/com/platform/response/modGroup/IotModGroupDetailResp.java

@@ -1,118 +0,0 @@
-package com.platform.response.modGroup;
-
-
-import com.platform.entity.IotMod;
-import lombok.Data;
-
-import java.time.LocalDateTime;
-
-/**
- * Author: donglang
- * Time: 2025-10-09
- * Des: 物理模型详情模型
- * Version: 1.0
- */
-
-@Data
-public class IotModGroupDetailResp {
-
-    /**
-     * 主键ID
-     */
-    private Long id;
-
-    /**
-     * 租户id
-     */
-    private String tenantId;
-
-    /**
-     * 物理模型码值
-     */
-    private String modCode;
-
-    /**
-     * 所属客户id
-     */
-    private Long companyId;
-
-    /**
-     * 物模型分组码值
-     */
-    private String modeGroupCode;
-
-    /**
-     * 唯一标识
-     */
-    private String guid;
-
-    /**
-     * 物模型名称
-     */
-    private String name;
-
-    /**
-     * 最后一次更新值[原来字段 desc]
-     */
-    private String description;
-
-    /**
-     * 备注
-     */
-    private String remarks;
-
-    /**
-     * 包含JSON
-     */
-    private String tslJson;
-
-    /**
-     * 版本[原来字段 tsl_ver]
-     */
-    private Integer version;
-
-    /**
-     * 设备数
-     */
-    private Integer num;
-
-    /**
-     * 0-未删除,1-删除
-     */
-    private Integer delFlag;
-
-    /**
-     * 创建人
-     */
-    private String createUser;
-
-    /**
-     * 更新人
-     */
-    private String updateUser;
-
-    /**
-     * 创建时间
-     */
-    private LocalDateTime createTime;
-
-    /**
-     * 更新时间
-     */
-    private LocalDateTime updateTime;
-
-    private static IotModGroupDetailResp getInstance(){
-        return new IotModGroupDetailResp();
-    }
-
-
-    public static IotModGroupDetailResp toIotDetailResp(IotMod iotMod){
-        IotModGroupDetailResp iotModDetailResp = IotModGroupDetailResp.getInstance();
-        iotModDetailResp.setModCode(iotMod.getModCode());
-        //TODO
-
-        return iotModDetailResp;
-
-    }
-
-}

+ 3 - 0
iot-platform-manager/src/main/java/com/platform/response/modGroup/IotModGroupPageResp.java

@@ -47,6 +47,9 @@ public class IotModGroupPageResp {
 
 
     public static IotModGroupPageResp toIotPageResp(IotModGroup iotModGroup) {
+        if (iotModGroup == null) {
+            return new IotModGroupPageResp();
+        }
         IotModGroupPageResp iotModDetailResp = IotModGroupPageResp.getInstance();
         iotModDetailResp.setId(iotModGroup.getId());
         iotModDetailResp.setCompanyId(iotModGroup.getCompanyId());