Commit 31010d16 zshaohui

增加多个温湿度传感器接收

1 个父辈 1a9638f6
......@@ -5,7 +5,9 @@ import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import com.neotel.smfcore.common.exception.ValidateException;
import com.neotel.smfcore.common.utils.Constants;
import com.neotel.smfcore.common.utils.JsonUtil;
import com.neotel.smfcore.common.utils.ReelLockPosUtil;
import com.neotel.smfcore.common.utils.StringUtils;
import com.neotel.smfcore.core.api.SmfApi;
import com.neotel.smfcore.core.api.bean.CodeValidateParam;
import com.neotel.smfcore.core.barcode.bean.CodeBean;
......@@ -783,6 +785,22 @@ public class BaseDeviceHandler implements IDeviceHandler {
if (statusOfBoxes != null) {
for (BoxStatusBean boxStatus : statusOfBoxes.values()) {
if (needSaveToMongo) {
try {
Map<String, String> data = statusBean.getData();
if (data != null) {
String humiAndtempListStr = data.get("humiAndtempList");
if (StringUtils.isNotBlank(humiAndtempListStr)) {
log.info("收到温湿度信息,Cid为:" + cid + ",集合信息为:" + humiAndtempListStr);
Humiture humiture = new Humiture();
humiture.setHumiAndtempListStr(humiAndtempListStr);
humiture.setCid(cid);
humitureManager.save(humiture);
statusBean.setLastSaveTime(System.currentTimeMillis());
}
}
} catch (ValidateException e) {
log.error("保存温湿度出错", e);
}
//保存温湿度到数据库
Humiture humiture = new Humiture();
humiture.setCid(cid);
......
......@@ -26,7 +26,10 @@ public class Humiture extends BasePo implements Serializable {
*/
private String humidity;
/**
* 温湿度集合str
*/
private String humiAndtempListStr;
public String getBoxKey(){
return cid;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!