增加客户端id及wifi名称

This commit is contained in:
zzc 2024-10-29 00:45:44 +08:00
parent 1f97673101
commit a1b3d69ff1
5 changed files with 18 additions and 3 deletions

View File

@ -31,5 +31,9 @@ public class DeviceClientMsgDto implements Serializable {
* MCU版本 * MCU版本
*/ */
private String mcuVersion; private String mcuVersion;
/**
* wifi名称
*/
private String wifiName;
} }

View File

@ -159,6 +159,11 @@ public class EqEquipmentDetailVo implements Serializable {
*/ */
private String mcuVersion; private String mcuVersion;
/**
* wifi名称
*/
private String wifiName;
/** /**
* 设备状态 * 设备状态

View File

@ -151,7 +151,7 @@ public class IotService {
map.put("entityType","DEVICE"); map.put("entityType","DEVICE");
map.put("entityId",deviceCode); map.put("entityId",deviceCode);
map.put("scope","CLIENT_SCOPE"); map.put("scope","CLIENT_SCOPE");
String send = getSend(CommonYmlConfig.URL_IOT_SCOPE_ATTRIBUTE + "?keys=equipmentType,serializableNum,modelVersion,mcuVersion", map); String send = getSend(CommonYmlConfig.URL_IOT_SCOPE_ATTRIBUTE + "?keys=equipmentType,serializableNum,modelVersion,mcuVersion,ssid", map);
// String send = getSend(CommonYmlConfig.URL_IOT_SCOPE_ATTRIBUTE + "?keys=", map); // String send = getSend(CommonYmlConfig.URL_IOT_SCOPE_ATTRIBUTE + "?keys=", map);
log.info("客户端属性获取:设备信息获取成功,设备编号:{}IOT接口返回{}", deviceCode, send); log.info("客户端属性获取:设备信息获取成功,设备编号:{}IOT接口返回{}", deviceCode, send);
if (send.startsWith("{")) throw new RuntimeException(MessageUtils.message("message.fault.device.notfound")); if (send.startsWith("{")) throw new RuntimeException(MessageUtils.message("message.fault.device.notfound"));
@ -177,6 +177,8 @@ public class IotService {
result.setModelVersion(JSON.parseObject(resultString).getString("value")); result.setModelVersion(JSON.parseObject(resultString).getString("value"));
}else if (key.equals("mcuVersion")){ }else if (key.equals("mcuVersion")){
result.setMcuVersion(JSON.parseObject(resultString).getString("value")); result.setMcuVersion(JSON.parseObject(resultString).getString("value"));
}else if (key.equals("ssid")){
result.setWifiName(JSON.parseObject(resultString).getString("value"));
} }
} }
return result; return result;
@ -239,7 +241,9 @@ public class IotService {
Map<String, String> map = new HashMap<>(); Map<String, String> map = new HashMap<>();
map.put("deviceProfileId",deviceProfileId); map.put("deviceProfileId",deviceProfileId);
String send = getSend(CommonYmlConfig.URL_IOT_ota_otaPackages, map); String send = getSend(CommonYmlConfig.URL_IOT_ota_otaPackages, map);
List<DeviceOtaPackages> deviceOtaPackages = JSON.parseArray(send, DeviceOtaPackages.class); JSONObject jsonObject = JSONObject.parseObject(send);
String data = jsonObject.getString("data");
List<DeviceOtaPackages> deviceOtaPackages = JSON.parseArray(data, DeviceOtaPackages.class);
return deviceOtaPackages; return deviceOtaPackages;
} }

View File

@ -275,6 +275,7 @@ public class EqEquipmentServiceImpl implements IEqEquipmentService {
result.setSerializableNum(clientMsg.getSerializableNum()); result.setSerializableNum(clientMsg.getSerializableNum());
result.setModelVersion(clientMsg.getModelVersion()); result.setModelVersion(clientMsg.getModelVersion());
result.setMcuVersion(clientMsg.getMcuVersion()); result.setMcuVersion(clientMsg.getMcuVersion());
result.setWifiName(clientMsg.getWifiName());
//获取遥测数据 //获取遥测数据
@ -420,6 +421,7 @@ public class EqEquipmentServiceImpl implements IEqEquipmentService {
DeviceOtaPackages lastOtaPackage = list.get(0); DeviceOtaPackages lastOtaPackage = list.get(0);
DeviceOtaPackages currentOtaPackage = null; DeviceOtaPackages currentOtaPackage = null;
//设备包版本id //设备包版本id
if (deviceDto.getFirmwareId()==null) throw new RuntimeException("设备未绑定OTA版本");
String currentPackageId = deviceDto.getFirmwareId().getId(); String currentPackageId = deviceDto.getFirmwareId().getId();
String lastPackageId = lastOtaPackage.getId().getId(); String lastPackageId = lastOtaPackage.getId().getId();
for (DeviceOtaPackages deviceOtaPackages : list) { for (DeviceOtaPackages deviceOtaPackages : list) {

View File

@ -97,7 +97,7 @@ spring.data:
# 数据库索引 # 数据库索引
database: 2 database: 2
# redis 密码必须配置 # redis 密码必须配置
password: ruoyi123 # password: ruoyi123
# 连接超时时间 # 连接超时时间
timeout: 10s timeout: 10s
# 是否开启ssl # 是否开启ssl