From a29e547c4eb8718b04e898a534c2f99c8b651393 Mon Sep 17 00:00:00 2001 From: wyw <373811525@qq.com> Date: Tue, 10 Sep 2024 20:56:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9/device/detail/gongdianChart?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=BD=AC=E6=8D=A2=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../devicedetail/impl/DeviceDetailServiceImpl.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fastbee-open-api/src/main/java/com/fastbee/data/service/devicedetail/impl/DeviceDetailServiceImpl.java b/fastbee-open-api/src/main/java/com/fastbee/data/service/devicedetail/impl/DeviceDetailServiceImpl.java index e5ceb12..b308000 100644 --- a/fastbee-open-api/src/main/java/com/fastbee/data/service/devicedetail/impl/DeviceDetailServiceImpl.java +++ b/fastbee-open-api/src/main/java/com/fastbee/data/service/devicedetail/impl/DeviceDetailServiceImpl.java @@ -266,12 +266,13 @@ public class DeviceDetailServiceImpl implements IDeviceDetailService { put("name", haiWeiPropertyVo.getNameCn()); }}; if(haiWeiPropertyVo.getNameEn().equals("三菱FX2N_1_MpptDown")){ - hashMap.put("value", Float.parseFloat(haiWeiPropertyVo.getValue().toString()) == 1f? - "异常":"正常"); + + hashMap.put("value", NumberUtils.isNumeric(haiWeiPropertyVo.getValue().toString())?( + Float.parseFloat(haiWeiPropertyVo.getValue().toString()) == 1f?"正常":"异常"):"正常"); } if(haiWeiPropertyVo.getNameEn().equals("三菱FX2N_1_市电状态")){ - hashMap.put("value", Float.parseFloat(haiWeiPropertyVo.getValue().toString()) == 1f? - "市电":"太阳能"); + hashMap.put("value", NumberUtils.isNumeric(haiWeiPropertyVo.getValue().toString())?( + Float.parseFloat(haiWeiPropertyVo.getValue().toString()) == 1f?"市电":"太阳能"):"市电"); } list.add(hashMap); }