|
|
|
@ -63,6 +63,7 @@ public class EquipmentInfoServiceImpl implements EquipmentInfoService { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
enterpriseInfo.setOrganName(params.toString()); |
|
|
|
|
//获取用户的organCode
|
|
|
|
|
List<EnterpriseInfoExtend> enterpriseInfoExtends = enterpriseInfoService.selectEnterpriseInfoList(enterpriseInfo); |
|
|
|
|
if (CollectionUtils.isEmpty(enterpriseInfoExtends)) { |
|
|
|
|
return; |
|
|
|
@ -71,6 +72,7 @@ public class EquipmentInfoServiceImpl implements EquipmentInfoService { |
|
|
|
|
enterpriseInfoExtends.stream().forEach(r -> { |
|
|
|
|
TpLinkConfig tpLinkConfig = new TpLinkConfig(); |
|
|
|
|
tpLinkConfig.setOrganCode(r.getOrganCode()); |
|
|
|
|
//获取对应organCode的 ak sk
|
|
|
|
|
List<TpLinkConfig> tpLinkConfigs = tpLinkConfigService.selectTpLinkConfigList(tpLinkConfig); |
|
|
|
|
if (!CollectionUtils.isEmpty(tpLinkConfigs)) { |
|
|
|
|
tpLinkConfigs.stream().forEach(t -> { |
|
|
|
@ -82,7 +84,7 @@ public class EquipmentInfoServiceImpl implements EquipmentInfoService { |
|
|
|
|
map.put("limit", 100); |
|
|
|
|
map1.put("enterpriseId", t.getEnterpriseId()); |
|
|
|
|
map.put("filterAnd", map1); |
|
|
|
|
//获取设备列表
|
|
|
|
|
//获取设备列表 接口调用
|
|
|
|
|
String iotInfo = getIotInfo(t, HttpMethod.POST.toString(), ApiConstants.EquipmentUrl, JSONObject.toJSONString(map)); |
|
|
|
|
System.out.println(iotInfo); |
|
|
|
|
JSONObject jsonObject = JSONObject.parseObject(iotInfo); |
|
|
|
@ -131,7 +133,6 @@ public class EquipmentInfoServiceImpl implements EquipmentInfoService { |
|
|
|
|
//获取企业信息 获取到的企业ID 保存到配置表
|
|
|
|
|
String enterprise = getIotInfo(t, HttpMethod.POST.toString(), ApiConstants.EnterpriseUrl, JSONObject.toJSONString(map)); |
|
|
|
|
JSONObject json = JSONObject.parseObject(enterprise); |
|
|
|
|
|
|
|
|
|
if (json.get("error_code").toString().equals("0")) { |
|
|
|
|
//获取企业信息
|
|
|
|
|
map.put("start", 1); |
|
|
|
@ -233,6 +234,7 @@ public class EquipmentInfoServiceImpl implements EquipmentInfoService { |
|
|
|
|
map1.put("queryCategory", "device"); |
|
|
|
|
map1.put("regionAccumulate", 0); |
|
|
|
|
map1.put("accuracy", "hour"); |
|
|
|
|
//TODO 不知道这个参数的作用
|
|
|
|
|
List<Long> timeList = new ArrayList<>(); |
|
|
|
|
timeList.add(2023051800L); |
|
|
|
|
timeList.add(2023051901L); |
|
|
|
|