修正部分参数
This commit is contained in:
@ -41,6 +41,8 @@ public class FXXDataProcessServiceImpl implements IFXXDataProcessService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private RedisCache redisCache;
|
private RedisCache redisCache;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private EmsDevicesSettingMapper emsDevicesSettingMapper;;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void handleFxData(String message) {
|
public void handleFxData(String message) {
|
||||||
@ -138,7 +140,13 @@ public class FXXDataProcessServiceImpl implements IFXXDataProcessService {
|
|||||||
|
|
||||||
Map<String, Object> obj = JSON.parseObject(dataJson, new TypeReference<Map<String, Object>>() {
|
Map<String, Object> obj = JSON.parseObject(dataJson, new TypeReference<Map<String, Object>>() {
|
||||||
});
|
});
|
||||||
|
EmsDevicesSetting joken = new EmsDevicesSetting();
|
||||||
|
joken.setDeviceId(deviceId);
|
||||||
|
List<EmsDevicesSetting> up = emsDevicesSettingMapper.selectEmsDevicesSettingList(joken);
|
||||||
|
String stackDeviceId = "";
|
||||||
|
if (up != null && up.size() >0) {
|
||||||
|
stackDeviceId = up.get(0).getParentId();
|
||||||
|
}
|
||||||
//BMS 电池簇
|
//BMS 电池簇
|
||||||
EmsBatteryCluster data = new EmsBatteryCluster();
|
EmsBatteryCluster data = new EmsBatteryCluster();
|
||||||
// 设置所有 BigDecimal 类型字段为 ZERO
|
// 设置所有 BigDecimal 类型字段为 ZERO
|
||||||
@ -195,14 +203,20 @@ public class FXXDataProcessServiceImpl implements IFXXDataProcessService {
|
|||||||
data.setMinCellSocId(StringUtils.getLong(obj.get("ZDDTSOCDYD")));
|
data.setMinCellSocId(StringUtils.getLong(obj.get("ZDDTSOCDYD")));
|
||||||
data.setMaxCellSohId(StringUtils.getLong(obj.get("ZGDTSOHDYD")));
|
data.setMaxCellSohId(StringUtils.getLong(obj.get("ZGDTSOHDYD")));
|
||||||
data.setMinCellSohId(StringUtils.getLong(obj.get("ZDDTSOHDYD")));
|
data.setMinCellSohId(StringUtils.getLong(obj.get("ZDDTSOHDYD")));
|
||||||
data.setStackDeviceId("1");
|
data.setStackDeviceId(stackDeviceId);
|
||||||
emsBatteryClusterMapper.insertEmsBatteryCluster(data);
|
emsBatteryClusterMapper.insertEmsBatteryCluster(data);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void batteryDataProcess(String deviceId, String dataJson) {
|
private void batteryDataProcess(String deviceId, String dataJson) {
|
||||||
|
EmsDevicesSetting joken = new EmsDevicesSetting();
|
||||||
|
joken.setDeviceId(deviceId);
|
||||||
|
List<EmsDevicesSetting> up = emsDevicesSettingMapper.selectEmsDevicesSettingList(joken);
|
||||||
|
String stackDeviceId = "";
|
||||||
|
if (up != null && up.size() >0) {
|
||||||
|
stackDeviceId = up.get(0).getParentId();
|
||||||
|
}
|
||||||
//单体电池
|
//单体电池
|
||||||
Map<String, Map<String, Object>> records = processData(JSON.parseObject(dataJson, new TypeReference<Map<String, Object>>() {}));
|
Map<String, Map<String, Object>> records = processData(JSON.parseObject(dataJson, new TypeReference<Map<String, Object>>() {}));
|
||||||
List<EmsBatteryData> list = new ArrayList<>();
|
List<EmsBatteryData> list = new ArrayList<>();
|
||||||
@ -220,14 +234,14 @@ public class FXXDataProcessServiceImpl implements IFXXDataProcessService {
|
|||||||
batteryData.setVoltage(StringUtils.getBigDecimal(fields.get("DTDY")));
|
batteryData.setVoltage(StringUtils.getBigDecimal(fields.get("DTDY")));
|
||||||
|
|
||||||
batteryData.setBatteryCluster(deviceId);
|
batteryData.setBatteryCluster(deviceId);
|
||||||
batteryData.setBatteryPack(deviceId);
|
batteryData.setBatteryPack(stackDeviceId);
|
||||||
|
|
||||||
// 时间戳
|
// 时间戳
|
||||||
batteryData.setDataTimestamp(new Date());
|
batteryData.setDataTimestamp(new Date());
|
||||||
|
|
||||||
// ID字段
|
// ID字段
|
||||||
batteryData.setSiteId(("021_FXX_01"));
|
batteryData.setSiteId(("021_FXX_01"));
|
||||||
batteryData.setClusterDeviceId(("021"));
|
batteryData.setClusterDeviceId(deviceId);
|
||||||
|
|
||||||
list.add(batteryData);
|
list.add(batteryData);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user