Commit 3884af58 LN

/service/store/uploadStoragePos

客户端上传料仓库位列表 :增加设备类型参数 deviceType
1 个父辈 b924137f
...@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil; ...@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
import com.google.common.base.Strings; import com.google.common.base.Strings;
import com.neotel.smfcore.core.device.enums.BOX_STATUS; import com.neotel.smfcore.core.device.enums.BOX_STATUS;
import com.neotel.smfcore.core.language.util.MessageUtils; import com.neotel.smfcore.core.language.util.MessageUtils;
import com.neotel.smfcore.core.storage.enums.DeviceType;
import com.neotel.smfcore.core.system.service.po.AlarmInfo; import com.neotel.smfcore.core.system.service.po.AlarmInfo;
import lombok.Data; import lombok.Data;
import lombok.ToString; import lombok.ToString;
...@@ -103,6 +104,12 @@ public class StatusBean { ...@@ -103,6 +104,12 @@ public class StatusBean {
private long offlineTime=-1; private long offlineTime=-1;
private List<PosInfo> posList=null; private List<PosInfo> posList=null;
/**
* 料仓类型
*/
private String deviceType = DeviceType.AUTO.name();
/** /**
* 获取已经结束(缓存中存在,但新的报警列表不存在)的报警列表,同时将新的报警加入到缓存中 * 获取已经结束(缓存中存在,但新的报警列表不存在)的报警列表,同时将新的报警加入到缓存中
*/ */
......
...@@ -415,11 +415,15 @@ public class DeviceController { ...@@ -415,11 +415,15 @@ public class DeviceController {
String cid = statusBean.getCid(); String cid = statusBean.getCid();
Storage storage = dataCache.getStorage(cid); Storage storage = dataCache.getStorage(cid);
String deviceType=statusBean.getDeviceType();
if(ObjectUtil.isEmpty(deviceType)){
deviceType=DeviceType.AUTO.getName();
}
if (storage == null) { if (storage == null) {
log.error("uploadStoragePos料仓cid: [" + cid + "]不存在,默认自动创建料仓"); log.error("uploadStoragePos料仓cid: [" + cid + "]不存在,默认自动创建料仓");
//自动创建料仓 //自动创建料仓
storage = dataCache.AutoCreateStorage(cid); storage = dataCache.AutoCreateStorage(cid,deviceType);
if (storage == null) { if (storage == null) {
return ResultBean.newErrorResult(1, "smfcore.valueNotFind", "未找到{0}[{1}]", new String[]{"CID", cid}); return ResultBean.newErrorResult(1, "smfcore.valueNotFind", "未找到{0}[{1}]", new String[]{"CID", cid});
} }
......
...@@ -662,7 +662,7 @@ public class DataCache { ...@@ -662,7 +662,7 @@ public class DataCache {
} }
return availableStorageIds; return availableStorageIds;
} }
public Storage AutoCreateStorage(String cid) { public Storage AutoCreateStorage(String cid,String deviceType) {
//判断cid存在 //判断cid存在
Storage storage = null; Storage storage = null;
storage = getStorage(cid); storage = getStorage(cid);
...@@ -676,7 +676,7 @@ public class DataCache { ...@@ -676,7 +676,7 @@ public class DataCache {
storage = new Storage(); storage = new Storage();
storage.setCid(cid); storage.setCid(cid);
storage.setType(DeviceType.AUTO.getName()); storage.setType(deviceType);
storage.setName(cid); storage.setName(cid);
storage.setCompatibleType(COMPATIBLE_TYPE.EXACT_MATCH); storage.setCompatibleType(COMPATIBLE_TYPE.EXACT_MATCH);
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!