| | |
| | | th.setCompanyId(ContextUtil.getDefaultCompanyId()); |
| | | String data = message.getContent(); |
| | | String houseNo = data.substring(0, 2); |
| | | int depotId = BytesUtil.hexToInt(houseNo); |
| | | String t = data.substring(4, 8); |
| | | String h = data.substring(8, 12); |
| | | double temp, humy; |
| | |
| | | |
| | | th.setTempIn(temp); |
| | | th.setHumidityIn(humy); |
| | | log.info("主机--------->>>平台,解析仓温仓湿信息,仓库={},结果={}", houseNo, th.toString()); |
| | | log.info("主机--------->>>平台,解析仓温仓湿信息,仓库={},结果={}", depotId, th.toString()); |
| | | |
| | | String key = "TH_" + houseNo; |
| | | String key = "TH_" + depotId; |
| | | contextMapTH.put(key, th); |
| | | |
| | | } catch (Exception e) { |
| | |
| | | private THDto getTH(IoMessage message) { |
| | | String data = message.getContent(); |
| | | String houseNo = data.substring(0, 2); |
| | | |
| | | String key = "TH_" + houseNo; |
| | | Integer depotId = BytesUtil.hexToInt(houseNo); |
| | | String key = "TH_" + depotId; |
| | | |
| | | return contextMapTH.get(key); |
| | | } |