Commit e97eb0f7 authored by xixinzhao's avatar xixinzhao

判断是否为数字

parent 748a98cd
......@@ -1944,8 +1944,11 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
iotIndexInfoVo.setNumber(deviceName);
if (equipmentSpecificIndex.getIsTrend()) {
if (!ObjectUtils.isEmpty(entry.getValue())){
BigDecimal val = new BigDecimal(String.valueOf(entry.getValue()));
iotIndexInfoVo.setContent(equipmentSpecificIndex.getIndexName() + (val.setScale(2, BigDecimal.ROUND_HALF_UP)) + equipmentSpecificIndex.getIndexUnitName());
boolean isNum = StringUtil.isNumeric(String.valueOf(entry.getValue()));
if (isNum) {
BigDecimal val = new BigDecimal(String.valueOf(entry.getValue()));
iotIndexInfoVo.setContent(equipmentSpecificIndex.getIndexName() + (val.setScale(2, BigDecimal.ROUND_HALF_UP)) + equipmentSpecificIndex.getIndexUnitName());
}
}
} else {
if (pressurePumpStart.equals(equipmentSpecificIndex.getNameKey())) {
......@@ -2582,8 +2585,11 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
} else {
List<BigDecimal> bigDecimals = new ArrayList<>();
if (!ObjectUtils.isEmpty(mapList.get(key))) {
bigDecimals.add(new BigDecimal(mapList.get(key)));
stringIntegerHashMapIn.put(dateX, bigDecimals);
boolean isNum = StringUtil.isNumeric(mapList.get(key));
if (isNum) {
bigDecimals.add(new BigDecimal(mapList.get(key)));
stringIntegerHashMapIn.put(dateX, bigDecimals);
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment