修改yongshuiChart数据转换异常

This commit is contained in:
wyw 2024-09-10 20:45:01 +08:00
parent 9fb8de3e33
commit 26d56dd1f7

View File

@ -10,6 +10,7 @@ import com.fastbee.common.model.vo.iot.DeviceDetailVo;
import com.fastbee.common.model.vo.iot.QueryLogVo; import com.fastbee.common.model.vo.iot.QueryLogVo;
import com.fastbee.common.utils.DateUtils; import com.fastbee.common.utils.DateUtils;
import com.fastbee.common.utils.DevParamsUtils; import com.fastbee.common.utils.DevParamsUtils;
import com.fastbee.common.utils.NumberUtils;
import com.fastbee.common.utils.StringUtils; import com.fastbee.common.utils.StringUtils;
import com.fastbee.data.domain.vo.AnfangInfoVo; import com.fastbee.data.domain.vo.AnfangInfoVo;
import com.fastbee.data.service.devicedetail.IDeviceDetailService; import com.fastbee.data.service.devicedetail.IDeviceDetailService;
@ -377,16 +378,16 @@ public class DeviceDetailServiceImpl implements IDeviceDetailService {
put("name", haiWeiPropertyVo.getNameCn()); put("name", haiWeiPropertyVo.getNameCn());
}}; }};
if(haiWeiPropertyVo.getNameEn().equals("三菱FX2N_1_guanxian")){ if(haiWeiPropertyVo.getNameEn().equals("三菱FX2N_1_guanxian")){
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_FlowDown")){ if(haiWeiPropertyVo.getNameEn().equals("三菱FX2N_1_FlowDown")){
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_mCon")){ if(haiWeiPropertyVo.getNameEn().equals("三菱FX2N_1_mCon")){
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); list.add(hashMap);
} }