|
@@ -185,8 +185,8 @@ public class ReceiveAllTypeService extends BaseService {
|
|
|
for(int i = 0 ; i < jsonResults.size() ; i ++){
|
|
|
//results
|
|
|
JSONObject jsonObj = jsonResults.getJSONObject(i);
|
|
|
- //设备id
|
|
|
- String equipmentId = (String) jsonObj.get("deviceId");
|
|
|
+ //设备编号
|
|
|
+ String equipmentNo = (String) jsonObj.get("deviceId");
|
|
|
//rows
|
|
|
JSONArray jsonRows = (JSONArray) jsonObj.get("rows");
|
|
|
//所有设备点位
|
|
@@ -241,7 +241,7 @@ public class ReceiveAllTypeService extends BaseService {
|
|
|
String ap = map.get(Active);
|
|
|
switch(equipmentType.getCode()){
|
|
|
case 2:
|
|
|
- List<InverterInfo> inverterInfo = inverterInfoRepository.findByEquipmentNo(equipmentId);
|
|
|
+ List<InverterInfo> inverterInfo = inverterInfoRepository.findByEquipmentNo(equipmentNo);
|
|
|
//逆变器
|
|
|
if (ap != null && map.get("electricalCurrent") != null) {
|
|
|
//有功
|
|
@@ -262,31 +262,31 @@ public class ReceiveAllTypeService extends BaseService {
|
|
|
redisUtils.hmset("nbq-" + electricFieldId + "-" + inverterInfo.get(0).getId(), map);
|
|
|
InverterStatusData inverterStatusData = JSON.parseObject(JSON.toJSONString(map), InverterStatusData.class);
|
|
|
inverterStatusDataRepository.save(inverterStatusData);
|
|
|
- log.info(map.get("time")+"nbq-" + electricFieldId + "-" + equipmentId+"已存入");
|
|
|
+ log.info(map.get("time")+"nbq-" + electricFieldId + "-" + inverterInfo.get(0).getId().toString()+"已存入");
|
|
|
break;
|
|
|
case 3:
|
|
|
//测风塔
|
|
|
- List<WindTowerInfo> windTowerInfo = windTowerInfoRepository.findByEquipmentNo(equipmentId);
|
|
|
+ List<WindTowerInfo> windTowerInfo = windTowerInfoRepository.findByEquipmentNo(equipmentNo);
|
|
|
map.put("equipmentId", windTowerInfo.get(0).getId().toString());
|
|
|
redisUtils.hmset("fj-" + electricFieldId + "-" + windTowerInfo.get(0).getId(), map);
|
|
|
WindTurbineStatusData windTurbineStatusData = JSON.parseObject(JSON.toJSONString(map), WindTurbineStatusData.class);
|
|
|
windTurbineStatusDataRepository.save(windTurbineStatusData);
|
|
|
- log.info("fj-" + electricFieldId + "-" + equipmentId+"已存入");
|
|
|
+ log.info("fj-" + electricFieldId + "-" + windTowerInfo.get(0).getId().toString()+"已存入");
|
|
|
break;
|
|
|
case 4:
|
|
|
- List<WindTurbineInfo> windTurbineInfo = windTurbineInfoRepository.findByEquipmentNo(equipmentId);
|
|
|
+ List<WindTurbineInfo> windTurbineInfo = windTurbineInfoRepository.findByEquipmentNo(equipmentNo);
|
|
|
//风机
|
|
|
map.put("equipmentId", windTurbineInfo.get(0).getId().toString());
|
|
|
redisUtils.hmset("cft-" + electricFieldId + "-" + windTurbineInfo.get(0).getId(), map);
|
|
|
WindTowerStatusData windTowerStatusData = JSON.parseObject(JSON.toJSONString(map), WindTowerStatusData.class);
|
|
|
windTowerStatusDataRepository.save(windTowerStatusData);
|
|
|
- log.info("cft-" + electricFieldId + "-" + equipmentId+"已存入");
|
|
|
+ log.info("cft-" + electricFieldId + "-" + windTurbineInfo.get(0).getId().toString()+"已存入");
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
|
}
|
|
|
}else {
|
|
|
- log.info(equipmentType.getMessage() + "-" + equipmentId+"无数据,不进行任何操作");
|
|
|
+ log.info(equipmentType.getMessage() + "-" + equipmentNo+"无数据,不进行任何操作");
|
|
|
}
|
|
|
}
|
|
|
}else {
|
|
@@ -456,7 +456,7 @@ public class ReceiveAllTypeService extends BaseService {
|
|
|
//results
|
|
|
JSONObject jsonObj = jsonResults.getJSONObject(i);
|
|
|
//设备id
|
|
|
- String equipmentId = (String) jsonObj.get("deviceId");
|
|
|
+ String equipmentNo = (String) jsonObj.get("deviceId");
|
|
|
//rows
|
|
|
JSONArray jsonRows = (JSONArray) jsonObj.get("rows");
|
|
|
//所有设备点位
|
|
@@ -518,14 +518,14 @@ public class ReceiveAllTypeService extends BaseService {
|
|
|
break;
|
|
|
}
|
|
|
//气象站
|
|
|
- List<WeatherStationInfo> weatherStationInfo = weatherStationInfoRepository.findByEquipmentNo(equipmentId);
|
|
|
+ List<WeatherStationInfo> weatherStationInfo = weatherStationInfoRepository.findByEquipmentNo(equipmentNo);
|
|
|
map.put("equipmentId", weatherStationInfo.get(0).getId().toString());
|
|
|
redisUtils.hmset("qxz-" + stationCode + "-" + weatherStationInfo.get(0).getId(), map);
|
|
|
WeatherStationStatusData weatherStationStatusData = JSON.parseObject(JSON.toJSONString(map), WeatherStationStatusData.class);
|
|
|
weatherStationStatusDataRepository.save(weatherStationStatusData);
|
|
|
- log.info(map.get("time")+"qxz-" + stationCode + "-" + equipmentId+"已存入");
|
|
|
+ log.info(map.get("time")+"qxz-" + stationCode + "-" + weatherStationInfo.get(0).getId().toString()+"已存入");
|
|
|
}else {
|
|
|
- log.info("气象站" + "-" + equipmentId+"无数据,不进行任何操作");
|
|
|
+ log.info(stationCode+"气象站无数据,不进行任何操作");
|
|
|
}
|
|
|
}
|
|
|
}else {
|