Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit d1c67edd
由
LN
编写于
2022-02-28 10:23:35 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
增加设备通信接口:cidIsExists和uploadStoragePos
1 个父辈
76e4e688
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
122 行增加
和
93 行删除
src/main/java/com/neotel/smfcore/core/device/bean/PosInfo.java
src/main/java/com/neotel/smfcore/core/device/bean/StatusBean.java
src/main/java/com/neotel/smfcore/core/device/rest/DeviceController.java
src/main/java/com/neotel/smfcore/core/device/util/DataCache.java
src/main/java/com/neotel/smfcore/core/storage/service/po/StoragePos.java
src/main/java/com/neotel/smfcore/core/device/bean/PosInfo.java
0 → 100644
查看文件 @
d1c67ed
package
com
.
neotel
.
smfcore
.
core
.
device
.
bean
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
PosInfo
implements
Serializable
{
/**
* 库位号
*/
private
String
pos
;
/**
* 优先级
*/
private
Integer
pri
;
/**
* 高度
*/
private
Integer
h
;
/**
* 宽度
*/
private
Integer
w
;
}
src/main/java/com/neotel/smfcore/core/device/bean/StatusBean.java
查看文件 @
d1c67ed
...
@@ -102,6 +102,8 @@ public class StatusBean {
...
@@ -102,6 +102,8 @@ public class StatusBean {
*/
*/
private
long
offlineTime
=-
1
;
private
long
offlineTime
=-
1
;
private
List
<
PosInfo
>
posList
=
null
;
/**
/**
* 获取已经结束(缓存中存在,但新的报警列表不存在)的报警列表,同时将新的报警加入到缓存中
* 获取已经结束(缓存中存在,但新的报警列表不存在)的报警列表,同时将新的报警加入到缓存中
*/
*/
...
@@ -289,77 +291,6 @@ public class StatusBean {
...
@@ -289,77 +291,6 @@ public class StatusBean {
return
System
.
currentTimeMillis
()
-
lastSaveTime
>=
5
*
60
*
1000
;
return
System
.
currentTimeMillis
()
-
lastSaveTime
>=
5
*
60
*
1000
;
}
}
// public long getLastSaveTime() {
// return lastSaveTime;
// }
//
// public void setLastSaveTime(long lastSaveTime) {
// this.lastSaveTime = lastSaveTime;
// }
//
// public long getTime() {
// return time;
// }
//
// public void setTime(long time) {
// this.time = time;
// }
//
// public String getCid() {
// return cid;
// }
//
// public void setCid(String cid) {
// this.cid = cid;
// }
//
// public int getSeq() {
// return seq;
// }
//
// public void setSeq(int seq) {
// this.seq = seq;
// }
//
// public int getOp() {
// return op;
// }
//
// public void setOp(int op) {
// this.op = op;
// }
//
// public Map<String, String> getData() {
// return data;
// }
//
// public void setData(Map<String, String> data) {
// this.data = data;
// }
//
// public int getStatus() {
// return status;
// }
//
// public void setStatus(int status) {
// this.status = status;
// }
//
// public String getMsg() {
// return msg;
// }
//
// public void setMsg(String msg) {
// this.msg = msg;
// }
//
// public String getClientIp() {
// return clientIp;
// }
//
// public void setClientIp(String clientIp) {
// this.clientIp = clientIp;
// }
// public void setShowMsg(Locale local){
// public void setShowMsg(Locale local){
// String lang = local.getLanguage();
// String lang = local.getLanguage();
...
@@ -374,13 +305,6 @@ public class StatusBean {
...
@@ -374,13 +305,6 @@ public class StatusBean {
// this.msg = showMsg;
// this.msg = showMsg;
// }
// }
//
//
// public Map<String, BoxStatusBean> getBoxStatus() {
// return boxStatus;
// }
//
// public void setBoxStatus(Map<String, BoxStatusBean> boxStatus) {
// this.boxStatus = boxStatus;
// }
public
boolean
isAvailable
(){
public
boolean
isAvailable
(){
if
(!
timeOut
()){
if
(!
timeOut
()){
...
@@ -466,21 +390,7 @@ public class StatusBean {
...
@@ -466,21 +390,7 @@ public class StatusBean {
// }
// }
// }
// }
// public String getMsgEn() {
// return msgEn;
// }
//
// public void setMsgEn(String msgEn) {
// this.msgEn = msgEn;
// }
//
// public Map<String, String> getMsgData() {
// return msgData;
// }
//
// public void setMsgData(Map<String, String> msgData) {
// this.msgData = msgData;
// }
public
String
getDoorReelSingnal
()
{
public
String
getDoorReelSingnal
()
{
String
doorReelSignal
=
getFromData
(
"doorReelSignal"
);
String
doorReelSignal
=
getFromData
(
"doorReelSignal"
);
...
...
src/main/java/com/neotel/smfcore/core/device/rest/DeviceController.java
查看文件 @
d1c67ed
此文件的差异被折叠,
点击展开。
src/main/java/com/neotel/smfcore/core/device/util/DataCache.java
查看文件 @
d1c67ed
...
@@ -17,6 +17,8 @@ import com.neotel.smfcore.core.language.service.po.LanguageMsg;
...
@@ -17,6 +17,8 @@ import com.neotel.smfcore.core.language.service.po.LanguageMsg;
import
com.neotel.smfcore.core.language.util.MessageUtils
;
import
com.neotel.smfcore.core.language.util.MessageUtils
;
import
com.neotel.smfcore.core.storage.bean.InventoryItem
;
import
com.neotel.smfcore.core.storage.bean.InventoryItem
;
import
com.neotel.smfcore.core.storage.enums.CHECKOUT_TYPE
;
import
com.neotel.smfcore.core.storage.enums.CHECKOUT_TYPE
;
import
com.neotel.smfcore.core.storage.enums.COMPATIBLE_TYPE
;
import
com.neotel.smfcore.core.storage.enums.DeviceType
;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
import
com.neotel.smfcore.core.system.bean.OrderSetting
;
import
com.neotel.smfcore.core.system.bean.OrderSetting
;
import
com.neotel.smfcore.core.system.service.dao.ICacheItemDao
;
import
com.neotel.smfcore.core.system.service.dao.ICacheItemDao
;
...
@@ -343,6 +345,17 @@ public class DataCache {
...
@@ -343,6 +345,17 @@ public class DataCache {
}
}
return
null
;
return
null
;
}
}
/**
* 根据 料仓名称 Name 获取料仓信息
*/
public
Storage
getStorageByName
(
String
storageName
){
for
(
Storage
storage
:
getAllStorage
().
values
()){
if
(
storage
.
getName
().
equals
(
storageName
)){
return
storage
;
}
}
return
null
;
}
public
Storage
reloadStorage
(
Storage
storage
,
String
oldCid
)
throws
ValidateException
{
public
Storage
reloadStorage
(
Storage
storage
,
String
oldCid
)
throws
ValidateException
{
...
@@ -426,6 +439,9 @@ public class DataCache {
...
@@ -426,6 +439,9 @@ public class DataCache {
if
(
ObjectUtil
.
isNotEmpty
(
s
))
{
if
(
ObjectUtil
.
isNotEmpty
(
s
))
{
for
(
String
v
:
for
(
String
v
:
valueArray
)
{
valueArray
)
{
if
(
ObjectUtil
.
isEmpty
(
v
)){
continue
;
}
try
{
try
{
Pattern
pattern
=
Pattern
.
compile
(
QueryHelp
.
escapeExprSpecialWord
(
s
),
Pattern
.
CASE_INSENSITIVE
);
Pattern
pattern
=
Pattern
.
compile
(
QueryHelp
.
escapeExprSpecialWord
(
s
),
Pattern
.
CASE_INSENSITIVE
);
Matcher
m
=
pattern
.
matcher
(
v
);
Matcher
m
=
pattern
.
matcher
(
v
);
...
@@ -643,4 +659,30 @@ public class DataCache {
...
@@ -643,4 +659,30 @@ public class DataCache {
return
availableStorageIds
;
return
availableStorageIds
;
}
}
public
Storage
AutoCreateStorage
(
String
cid
)
{
//判断cid存在
Storage
storage
=
null
;
storage
=
getStorage
(
cid
);
if
(
storage
!=
null
)
{
return
storage
;
}
//判断cid是否和其他料仓名称重复,重复时无法自动创建
if
(
getStorageByName
(
cid
)
!=
null
)
{
return
null
;
}
storage
=
new
Storage
();
storage
.
setCid
(
cid
);
storage
.
setType
(
DeviceType
.
AUTO
.
getName
());
storage
.
setName
(
cid
);
storage
.
setCompatibleType
(
COMPATIBLE_TYPE
.
EXACT_MATCH
);
storage
.
setSourcePath
(
""
);
storage
.
setGroupId
(
""
);
storage
=
storageManager
.
save
(
storage
);
reloadStorage
(
storage
,
""
);
log
.
info
(
"AutoCreateStorage :自动创建料仓完成:cid["
+
storage
.
getCid
()+
"]name["
+
storage
.
getName
()+
"]type["
+
storage
.
getCompatibleType
().
name
()+
"]"
);
return
storage
;
}
}
}
src/main/java/com/neotel/smfcore/core/storage/service/po/StoragePos.java
查看文件 @
d1c67ed
...
@@ -2,8 +2,10 @@ package com.neotel.smfcore.core.storage.service.po;
...
@@ -2,8 +2,10 @@ package com.neotel.smfcore.core.storage.service.po;
import
com.google.common.base.Strings
;
import
com.google.common.base.Strings
;
import
com.neotel.smfcore.common.base.BasePo
;
import
com.neotel.smfcore.common.base.BasePo
;
import
com.neotel.smfcore.common.utils.PointUtil
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
lombok.Data
;
import
lombok.Data
;
import
org.springframework.data.geo.Point
;
import
org.springframework.data.mongodb.core.index.GeoSpatialIndexType
;
import
org.springframework.data.mongodb.core.index.GeoSpatialIndexType
;
import
org.springframework.data.mongodb.core.index.GeoSpatialIndexed
;
import
org.springframework.data.mongodb.core.index.GeoSpatialIndexed
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
org.springframework.data.mongodb.core.mapping.Document
;
...
@@ -14,6 +16,51 @@ import java.util.List;
...
@@ -14,6 +16,51 @@ import java.util.List;
@Data
@Data
@Document
@Document
public
class
StoragePos
extends
BasePo
implements
Serializable
{
public
class
StoragePos
extends
BasePo
implements
Serializable
{
public
StoragePos
(){
}
public
StoragePos
(
String
storageId
,
String
posName
,
int
h
,
int
w
,
int
priority
){
setStorageId
(
storageId
);
setPosName
(
posName
);
setH
(
h
);
setW
(
w
);
setPriority
(
priority
);
Point
point
=
PointUtil
.
getPosPoint
(
posName
);
setCoordinate
(
new
double
[]{
point
.
getX
(),
point
.
getY
()});
}
public
boolean
updatePosInfo
(
String
storageId
,
String
posName
,
int
h
,
int
w
,
int
priority
){
boolean
needUpdate
=
false
;
if
(!
getPosName
().
equals
(
posName
)){
needUpdate
=
true
;
setPosName
(
posName
);
}
if
(!
getStorageId
().
equals
(
storageId
)){
needUpdate
=
true
;
setStorageId
(
storageId
);
}
if
(
getH
()!=
h
){
needUpdate
=
true
;
setH
(
h
);
}
if
(
getW
()!=
w
){
needUpdate
=
true
;
setW
(
w
);
}
if
(
getPriority
()!=
priority
){
needUpdate
=
true
;
setPriority
(
priority
);
}
Point
point
=
PointUtil
.
getPosPoint
(
getPosName
());
if
(
getCoordinate
()==
null
||
getCoordinate
().
length
!=
2
||
(
getCoordinate
()[
0
]!=
point
.
getX
())
||(
getCoordinate
()[
1
]!=
point
.
getY
())){
needUpdate
=
true
;
setCoordinate
(
new
double
[]{
point
.
getX
(),
point
.
getY
()});
}
return
needUpdate
;
}
private
String
storageId
;
private
String
storageId
;
private
Barcode
barcode
;
private
Barcode
barcode
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论