Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 28937bae
由
zshaohui
编写于
2025-10-24 09:21:32 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.AGV接口对接功能开发
1 个父辈
174e0d21
全部展开
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
233 行增加
和
8 行删除
src/main/java/com/neotel/smfcore/core/device/enums/OP_STATUS.java
src/main/java/com/neotel/smfcore/core/storage/rest/StoragePosController.java
src/main/java/com/neotel/smfcore/core/system/service/po/DataLog.java
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/bean/CtuCheckOutTask.java
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/bean/CtuPutInTask.java
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/bean/Station.java
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/controller/AgvDeviceController.java
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/util/BoxUtil.java
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/util/StationCacheUtil.java
src/main/resources/config/application.yml
src/main/java/com/neotel/smfcore/core/device/enums/OP_STATUS.java
查看文件 @
28937ba
...
@@ -85,5 +85,20 @@ public enum OP_STATUS {
...
@@ -85,5 +85,20 @@ public enum OP_STATUS {
/**
/**
* 异常
* 异常
*/
*/
ABNORMAL
;
ABNORMAL
,
/**
* 任务状态
* EXECUTING=已发送到AGV
* IN_ON_LINE=入库时人员将料箱推上线体,
* IN_ON_AGV=入库时AGV从线体上抓起料箱
* OUT_ON_LINE=出库时AGV将料箱放上线体,
* OUT_ON_AGV=出库时AGV将料箱从库位中取出
* FINISHED=任务完成(入库时AGV将料箱放入库位;出库时料箱到达工位)
*/
IN_ON_LINE
,
IN_ON_AGV
,
OUT_ON_LINE
,
OUT_ON_AGV
,
ERROR
;
}
}
src/main/java/com/neotel/smfcore/core/storage/rest/StoragePosController.java
查看文件 @
28937ba
...
@@ -579,7 +579,7 @@ public class StoragePosController {
...
@@ -579,7 +579,7 @@ public class StoragePosController {
//如果料仓不可用,不能出库
//如果料仓不可用,不能出库
if
(!
storage
.
isVirtual
())
{
if
(!
storage
.
isVirtual
())
{
if
(!
dataCache
.
StorageIsAvailable
(
storage
))
{
if
(!
dataCache
.
StorageIsAvailable
(
storage
))
{
throw
new
ValidateException
(
"smfcore.storage.notAvailable"
,
"料仓{0}离线或不可用,无法出库"
,
new
String
[]{
storage
.
getName
()});
//
throw new ValidateException("smfcore.storage.notAvailable", "料仓{0}离线或不可用,无法出库", new String[]{storage.getName()});
}
}
}
}
...
...
src/main/java/com/neotel/smfcore/core/system/service/po/DataLog.java
查看文件 @
28937ba
...
@@ -263,6 +263,8 @@ public class DataLog extends BasePo implements Serializable ,Comparable<DataLog>
...
@@ -263,6 +263,8 @@ public class DataLog extends BasePo implements Serializable ,Comparable<DataLog>
private
String
shelfLoc
;
private
String
shelfLoc
;
private
String
currentLoc
;
public
String
getBarcode
()
{
public
String
getBarcode
()
{
if
(
barcode
==
null
){
if
(
barcode
==
null
){
return
""
;
return
""
;
...
...
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/bean/CtuCheckOutTask.java
0 → 100644
查看文件 @
28937ba
package
com
.
neotel
.
smfcore
.
custom
.
aiqingzhiyin1643
.
bean
;
import
lombok.Data
;
@Data
public
class
CtuCheckOutTask
{
private
String
barcode
;
private
String
posName
;
private
String
status
;
private
String
checkOutLoc
;
}
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/bean/CtuPutInTask.java
0 → 100644
查看文件 @
28937ba
package
com
.
neotel
.
smfcore
.
custom
.
aiqingzhiyin1643
.
bean
;
import
lombok.Data
;
@Data
public
class
CtuPutInTask
{
private
String
barcode
;
private
String
posName
;
private
String
status
;
private
String
putInLoc
;
}
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/bean/Station.java
0 → 100644
查看文件 @
28937ba
package
com
.
neotel
.
smfcore
.
custom
.
aiqingzhiyin1643
.
bean
;
import
lombok.Data
;
@Data
public
class
Station
{
private
String
name
;
//上一个箱子
private
String
lastBox
;
//当前箱子
private
String
currentBox
;
}
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/controller/AgvDeviceController.java
0 → 100644
查看文件 @
28937ba
此文件的差异被折叠,
点击展开。
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/util/BoxUtil.java
0 → 100644
查看文件 @
28937ba
package
com
.
neotel
.
smfcore
.
custom
.
aiqingzhiyin1643
.
util
;
import
com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.device.enums.OP
;
import
com.neotel.smfcore.core.device.enums.OP_STATUS
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.storage.service.manager.IStoragePosManager
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
@Slf4j
@Service
public
class
BoxUtil
{
public
static
DataLog
generateInTask
(
StoragePos
pos
,
Barcode
barcode
,
String
currentLoc
)
{
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
DataLog
dataLog
=
new
DataLog
(
storage
,
barcode
,
pos
);
dataLog
.
setType
(
OP
.
PUT_IN
);
dataLog
.
setCurrentLoc
(
currentLoc
);
return
dataLog
;
}
public
static
void
outFromPos
(
DataLog
opTask
)
{
//从队列里面移除操作
taskService
.
removeQueueTask
(
opTask
);
StoragePos
storagePos
=
storagePosManager
.
get
(
opTask
.
getPosId
());
Barcode
barcode
=
storagePos
.
getBarcode
();
if
(
barcode
==
null
)
{
log
.
warn
(
"任务:"
+
opTask
.
getId
()
+
" 仓位:"
+
opTask
.
getPosId
()
+
" 的 Barcode 为null, 之前可能处理过,结束任务后直接返回"
);
return
;
}
barcode
=
barcodeManager
.
get
(
barcode
.
getId
());
if
(
barcode
!=
null
)
{
//二维码状态
barcode
.
setUsed
(
true
);
barcode
.
setUsedDate
(
new
Date
());
//仓位状态
barcode
.
setCheckOutDate
(
new
Date
(),
""
);
barcode
.
setPosName
(
""
);
barcodeManager
.
save
(
barcode
);
}
storagePos
.
setBarcode
(
null
);
storagePos
.
setUsed
(
false
);
storagePosManager
.
save
(
storagePos
);
log
.
info
(
"出库完成,清空仓位: "
+
storagePos
.
getId
()
+
"["
+
storagePos
.
getPosName
()
+
"]"
);
//更新缓存中的库存信息
dataCache
.
updateInventory
(
storagePos
,
barcode
);
}
public
static
void
intoPos
(
DataLog
opTask
)
{
//已完成,加入库存,并且从完成队列中清除
StoragePos
storagePos
=
storagePosManager
.
get
(
opTask
.
getPosId
());
//二维码状态
Barcode
barcode
=
barcodeManager
.
findByBarcode
(
opTask
.
getBarcode
());
if
(
barcode
!=
null
)
{
barcode
.
setUsedCount
(
barcode
.
getUsedCount
()
+
1
);
barcode
.
setPutInTime
(
System
.
currentTimeMillis
());
barcode
.
setInOpor
(
""
);
barcode
.
setCheckOutDate
(
null
,
""
);
barcode
.
setPosName
(
opTask
.
getPosName
());
storagePos
.
setBarcode
(
barcode
);
dataCache
.
updateInventory
(
storagePos
,
barcode
);
barcode
=
barcodeManager
.
save
(
barcode
);
}
/**
* 仓位状态
*/
storagePos
.
setBarcode
(
barcode
);
storagePos
.
setUsed
(
true
);
storagePos
.
setCanCheckOutTime
(
System
.
currentTimeMillis
());
storagePosManager
.
save
(
storagePos
);
//更新缓存中的库存信息
opTask
.
setStatus
(
OP_STATUS
.
FINISHED
.
name
());
taskService
.
updateFinishedTask
(
opTask
);
taskService
.
removeFinishedTask
(
opTask
);
}
private
static
DataCache
dataCache
;
@Autowired
private
void
setDataCache
(
DataCache
cache
){
BoxUtil
.
dataCache
=
cache
;
}
private
static
TaskService
taskService
;
@Autowired
private
void
setTaskService
(
TaskService
service
){
BoxUtil
.
taskService
=
service
;
}
private
static
IStoragePosManager
storagePosManager
;
@Autowired
private
void
setStoragePosManager
(
IStoragePosManager
manager
){
BoxUtil
.
storagePosManager
=
manager
;
}
private
static
IBarcodeManager
barcodeManager
;
@Autowired
private
void
setBarcodeManager
(
IBarcodeManager
manager
){
BoxUtil
.
barcodeManager
=
manager
;
}
}
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/util/StationCacheUtil.java
0 → 100644
查看文件 @
28937ba
package
com
.
neotel
.
smfcore
.
custom
.
aiqingzhiyin1643
.
util
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.custom.aiqingzhiyin1643.bean.Station
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.PostConstruct
;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
@Service
@Slf4j
public
class
StationCacheUtil
{
/**
* 工位缓存信息
*/
private
static
Map
<
String
,
Station
>
stationMap
=
new
ConcurrentHashMap
<>();
@PostConstruct
public
void
init
()
{
log
.
info
(
"开始工位缓存信息"
);
for
(
int
i
=
1
;
i
<=
5
;
i
++)
{
String
stationName
=
"s"
+
i
;
Station
station
=
dataCache
.
getCache
(
stationName
);
if
(
station
==
null
){
station
=
new
Station
();
station
.
setName
(
stationName
);
}
stationMap
.
put
(
stationName
,
station
);
dataCache
.
updateCache
(
stationName
,
station
);
}
}
public
static
Station
getStation
(
String
stationName
)
{
return
stationMap
.
get
(
stationName
);
}
public
static
void
updateStation
(
Station
station
)
{
stationMap
.
put
(
station
.
getName
(),
station
);
dataCache
.
updateCache
(
station
.
getName
(),
station
);
}
private
static
DataCache
dataCache
;
@Autowired
public
void
setDataCache
(
DataCache
dataCache
)
{
StationCacheUtil
.
dataCache
=
dataCache
;
}
}
src/main/resources/config/application.yml
查看文件 @
28937ba
...
@@ -2,15 +2,15 @@ server:
...
@@ -2,15 +2,15 @@ server:
port
:
8800
port
:
8800
api
:
api
:
name
:
1
568
name
:
1
643
inCheckUrl
:
#入库验证
inCheckUrl
:
#入库验证
outNotifyUrl
:
#出库通知
outNotifyUrl
:
#出库通知
inNotifyUrl
:
http://10.96.31.231:8082/smfApi/pushWarehouseCompleteNoticeInfo
#入库通知
inNotifyUrl
:
#入库通知
fetchOrderUrl
:
#获取工单
fetchOrderUrl
:
#获取工单
materialCountUrl
:
http://10.96.31.231:8082/smfApi/pushInvVerificationInfo
#是否点料
materialCountUrl
:
#是否点料
postCountDataUrl
:
http://10.96.31.231:8082/smfApi/pushOrderResultUploadInfo
#点料结果上传
postCountDataUrl
:
#点料结果上传
shelfFullNotificationUrl
:
http://10.96.31.231:8082/smfApi/pushPickInstNoticeInfo
#货架放满通知
shelfFullNotificationUrl
:
#货架放满通知
orderNotifyUrl
:
1
orderNotifyUrl
:
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论