Commit 52c9fc89 zshaohui

设备温湿度接口

1 个父辈 621b47a5
...@@ -6,6 +6,7 @@ import com.neotel.smfcore.common.bean.ResultBean; ...@@ -6,6 +6,7 @@ import com.neotel.smfcore.common.bean.ResultBean;
import com.neotel.smfcore.common.utils.DateUtil; import com.neotel.smfcore.common.utils.DateUtil;
import com.neotel.smfcore.common.utils.JsonUtil; import com.neotel.smfcore.common.utils.JsonUtil;
import com.neotel.smfcore.common.utils.StorageConstants; import com.neotel.smfcore.common.utils.StorageConstants;
import com.neotel.smfcore.common.utils.StringUtils;
import com.neotel.smfcore.core.barcode.rest.bean.mapstruct.BarcodeMapper; import com.neotel.smfcore.core.barcode.rest.bean.mapstruct.BarcodeMapper;
import com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager; import com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager;
import com.neotel.smfcore.core.barcode.service.po.Barcode; import com.neotel.smfcore.core.barcode.service.po.Barcode;
...@@ -15,6 +16,7 @@ import com.neotel.smfcore.core.device.bean.XlcBoxDoorStatus; ...@@ -15,6 +16,7 @@ import com.neotel.smfcore.core.device.bean.XlcBoxDoorStatus;
import com.neotel.smfcore.core.device.enums.DoorStatus; import com.neotel.smfcore.core.device.enums.DoorStatus;
import com.neotel.smfcore.core.device.handler.impl.XLCBoxHandler; import com.neotel.smfcore.core.device.handler.impl.XLCBoxHandler;
import com.neotel.smfcore.core.device.util.DataCache; import com.neotel.smfcore.core.device.util.DataCache;
import com.neotel.smfcore.core.kanban.rest.bean.HumiAndtemp;
import com.neotel.smfcore.core.order.LiteOrderCache; import com.neotel.smfcore.core.order.LiteOrderCache;
import com.neotel.smfcore.core.order.service.manager.ILiteOrderItemManager; import com.neotel.smfcore.core.order.service.manager.ILiteOrderItemManager;
import com.neotel.smfcore.core.order.service.manager.ILiteOrderManager; import com.neotel.smfcore.core.order.service.manager.ILiteOrderManager;
...@@ -266,4 +268,29 @@ public class NeotelController { ...@@ -266,4 +268,29 @@ public class NeotelController {
return ResultBean.newOkResult(results); return ResultBean.newOkResult(results);
} }
@ApiOperation("6.7 获取设备温湿度")
@RequestMapping("/getHumiAndtempList")
@AnonymousAccess
public ResultBean getHumiAndtempList() {
Map<String, List<HumiAndtemp>> resultMap = new HashMap<>();
for (Storage storage : dataCache.getAllStorage().values()) {
StatusBean bean = DevicesStatusUtil.getStatusBean(storage.getCid());
if (bean != null) {
for (BoxStatusBean statusBean : bean.getBoxStatus().values()) {
Map<String, String> data = statusBean.getData();
if (data != null) {
String humiAndtempListStr = data.get("humiAndtempList");
if (StringUtils.isNotBlank(humiAndtempListStr)) {
List<HumiAndtemp> humiAndtempList = JsonUtil.toList(humiAndtempListStr, HumiAndtemp.class);
resultMap.put(storage.getName(), humiAndtempList);
}
}
}
}
}
if (resultMap.isEmpty()) {
return ResultBean.newErrorResult(-1,"","获取失败");
}
return ResultBean.newOkResult(resultMap);
}
} }
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!