Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 4a4a847f
由
zshaohui
编写于
2024-08-27 14:24:37 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.提供给入库线体,获取满料串分流目的地
2.提供给客户端 获取当前入料机构的料串信息
1 个父辈
d8332d1b
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
243 行增加
和
57 行删除
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/common/util/CacheNameUtil.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/CDeviceController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/manual/ManualLineController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/third/RawInLineController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/third/bean/RawInLineMaterialLoc.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/third/util/RawInLineUtil.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/common/util/CacheNameUtil.java
查看文件 @
4a4a847
...
@@ -29,4 +29,7 @@ public class CacheNameUtil {
...
@@ -29,4 +29,7 @@ public class CacheNameUtil {
//人工分拣线体工位定时状态通知
//人工分拣线体工位定时状态通知
public
static
final
String
CHCHE_MANUAL_LINE_STATIONSTATUS
=
"CHCHE_MANUAL_LINE_STATIONSTATUS"
;
public
static
final
String
CHCHE_MANUAL_LINE_STATIONSTATUS
=
"CHCHE_MANUAL_LINE_STATIONSTATUS"
;
//入料机构料串信息
public
static
final
String
CHCHE_RAWIN_LINE_MATERIAL_DESTINATION
=
"CHCHE_RAWIN_LINE_MATERIAL_DESTINATION"
;
}
}
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/CDeviceController.java
查看文件 @
4a4a847
...
@@ -39,7 +39,9 @@ import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.BoxHandleUtil;
...
@@ -39,7 +39,9 @@ import com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.BoxHandleUtil;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.MaterialUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.MaterialUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.common.util.CacheNameUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.common.util.CacheNameUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.common.util.CommonUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.common.util.CommonUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.third.bean.MaterialLoc
;
import
com.neotel.smfcore.custom.luxsan.factory_c.third.util.MaterialLocUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.third.util.MaterialLocUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.third.util.RawInLineUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.wipstor.util.TaskLocUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.wipstor.util.TaskLocUtil
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -1017,6 +1019,14 @@ public class CDeviceController {
...
@@ -1017,6 +1019,14 @@ public class CDeviceController {
return
ResultBean
.
newOkResult
(
boxBarcode
.
getHeightMap
());
return
ResultBean
.
newOkResult
(
boxBarcode
.
getHeightMap
());
}
}
@ApiOperation
(
"获取入料机构,料串目的地"
)
@RequestMapping
(
"/getMaterialByLoc"
)
@AnonymousAccess
public
String
getMaterialByLoc
(
String
loc
)
{
return
RawInLineUtil
.
getCurrentMaterial
(
loc
);
}
private
synchronized
void
callAgvTask
(
String
stackerId
,
Barcode
stackerBarcode
)
{
private
synchronized
void
callAgvTask
(
String
stackerId
,
Barcode
stackerBarcode
)
{
//判断AGV是上的料箱有几个
//判断AGV是上的料箱有几个
int
count
=
0
;
int
count
=
0
;
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/manual/ManualLineController.java
查看文件 @
4a4a847
...
@@ -15,12 +15,10 @@ import com.neotel.smfcore.core.storage.service.po.StoragePos;
...
@@ -15,12 +15,10 @@ import com.neotel.smfcore.core.storage.service.po.StoragePos;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.custom.luxsan.factory_c.common.util.CacheNameUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.common.util.CacheNameUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.enums.TaskCurrentLoc
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.BoxHandleUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.BoxHandleUtil
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
javafx.concurrent.Task
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
...
@@ -28,9 +26,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
...
@@ -28,9 +26,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
@Api
(
tags
=
"人工分拣线对接"
)
@Api
(
tags
=
"人工分拣线对接"
)
@Slf4j
@Slf4j
...
@@ -76,6 +74,8 @@ public class ManualLineController {
...
@@ -76,6 +74,8 @@ public class ManualLineController {
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
Map
<
String
,
Object
>
lockBoxMap
=
new
ConcurrentHashMap
<>();
//空箱到达线体空箱出口后, 线体请求CTU背负空箱
//空箱到达线体空箱出口后, 线体请求CTU背负空箱
@ApiOperation
(
"请求CTU背负空箱"
)
@ApiOperation
(
"请求CTU背负空箱"
)
@RequestMapping
(
"/ctu/takeEmptyBox"
)
@RequestMapping
(
"/ctu/takeEmptyBox"
)
...
@@ -115,76 +115,86 @@ public class ManualLineController {
...
@@ -115,76 +115,86 @@ public class ManualLineController {
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"料箱信息"
});
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"料箱信息"
});
}
}
if
(
lockBoxMap
.
get
(
boxStr
)
==
null
){
lockBoxMap
.
put
(
boxStr
,
new
Object
());
}
boxStr
=
boxStr
+
"A"
;
boxStr
=
boxStr
+
"A"
;
Barcode
boxBarcode
=
codeResolve
.
resolveOneValideBarcode
(
boxStr
);
Object
lockObj
=
lockBoxMap
.
get
(
boxStr
);
if
(
boxBarcode
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.invalid"
,
"条码无效"
);
}
//1.清理要出库的数据
synchronized
(
lockObj
)
{
List
<
Barcode
>
newSubCodeList
=
new
ArrayList
<>();
Barcode
boxBarcode
=
codeResolve
.
resolveOneValideBarcode
(
boxStr
);
if
(
boxBarcode
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.invalid"
,
"条码无效"
);
}
//1.清理要出库的数据
List
<
Barcode
>
newSubCodeList
=
new
ArrayList
<>();
List
<
Barcode
>
subCodeList
=
boxBarcode
.
getSubCodeList
();
List
<
Barcode
>
subCodeList
=
boxBarcode
.
getSubCodeList
();
if
(
subCodeList
!=
null
&&
!
subCodeList
.
isEmpty
())
{
if
(
subCodeList
!=
null
&&
!
subCodeList
.
isEmpty
())
{
for
(
Barcode
barcode
:
subCodeList
)
{
for
(
Barcode
barcode
:
subCodeList
)
{
if
(
barcode
.
isOut
())
{
if
(
barcode
.
isOut
())
{
log
.
info
(
boxStr
+
"有需要出库的料盘:"
+
barcode
.
getBarcode
()
+
"需要改成不出库"
);
log
.
info
(
boxStr
+
"有需要出库的料盘:"
+
barcode
.
getBarcode
()
+
"需要改成不出库"
);
String
orderItemId
=
barcode
.
getOrderItemId
();
String
orderItemId
=
barcode
.
getOrderItemId
();
barcode
.
setOdn
(
""
);
barcode
.
setOdn
(
""
);
barcode
.
setOrderId
(
""
);
barcode
.
setOrderId
(
""
);
barcode
.
setOrderItemId
(
""
);
barcode
.
setOrderItemId
(
""
);
barcode
.
setOut
(
false
);
barcode
.
setOut
(
false
);
barcode
=
barcodeManager
.
save
(
barcode
);
barcode
=
barcodeManager
.
save
(
barcode
);
BoxHandleUtil
.
manualGenerateTask
(
barcode
,
OP_STATUS
.
CANCEL
.
name
(),
barcode
.
getAmount
(),
OP
.
CHECKOUT
,
orderItemId
);
BoxHandleUtil
.
manualGenerateTask
(
barcode
,
OP_STATUS
.
CANCEL
.
name
(),
barcode
.
getAmount
(),
OP
.
CHECKOUT
,
orderItemId
);
}
newSubCodeList
.
add
(
barcode
);
}
}
newSubCodeList
.
add
(
barcode
);
}
}
}
boxBarcode
.
setSubCodeList
(
newSubCodeList
);
boxBarcode
.
setSubCodeList
(
newSubCodeList
);
boxBarcode
=
barcodeManager
.
save
(
boxBarcode
);
boxBarcode
=
barcodeManager
.
save
(
boxBarcode
);
//1.判断是否有正在入库的任务
//1.判断是否有正在入库的任务
for
(
DataLog
dataLog
:
taskService
.
getAllTasks
())
{
for
(
DataLog
dataLog
:
taskService
.
getAllTasks
())
{
if
(!
dataLog
.
isCancel
()
&&
!
dataLog
.
isFinished
()
&&
dataLog
.
getBarcode
().
equals
(
boxBarcode
.
getBarcode
()))
{
if
(
boxBarcode
.
getBarcode
().
equals
(
dataLog
.
getBarcode
())){
if
(
dataLog
.
isPutInTask
())
{
if
(!
dataLog
.
isCancel
()
&&
!
dataLog
.
isFinished
()){
//如果有出库任务 直接完成
if
(
dataLog
.
isPutInTask
()){
return
ResultBean
.
newOkResult
(
""
);
log
.
info
(
boxStr
+
"有未完成/未取消的任务,库位为:"
+
dataLog
.
getPosName
()+
"直接返回ok"
);
}
else
{
return
ResultBean
.
newOkResult
(
""
);
log
.
info
(
boxStr
+
"有正在执行的出库任务,服务器更改状态为完成"
);
}
else
{
if
(!
dataLog
.
isOutFromPos
())
{
log
.
info
(
boxStr
+
"有正在执行的出库任务,服务器更改状态为完成"
);
taskService
.
moveTaskToFinished
(
dataLog
);
if
(!
dataLog
.
isOutFromPos
())
{
BoxHandleUtil
.
outFromPos
(
dataLog
);
taskService
.
moveTaskToFinished
(
dataLog
);
dataLog
.
setOutFromPos
(
true
);
BoxHandleUtil
.
outFromPos
(
dataLog
);
dataLog
.
setOutFromPos
(
true
);
}
dataLog
.
setStatus
(
OP_STATUS
.
FINISHED
.
name
());
taskService
.
updateFinishedTask
(
dataLog
);
}
}
}
dataLog
.
setStatus
(
OP_STATUS
.
FINISHED
.
name
());
taskService
.
updateFinishedTask
(
dataLog
);
}
}
}
}
}
//如果是type为0时,入智能仓
//如果是type为0时,入智能仓
StoragePos
pos
=
BoxHandleUtil
.
locOnePos
(
boxBarcode
);
StoragePos
pos
=
BoxHandleUtil
.
locOnePos
(
boxBarcode
);
if
(
pos
==
null
)
{
if
(
pos
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
boxStr
+
"未找到可用库位"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
boxStr
+
"未找到可用库位"
);
}
}
//如果是虚拟仓的库位,提示出来
//如果是虚拟仓的库位,提示出来
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
if
(
storage
.
isVirtual
())
{
if
(
storage
.
isVirtual
())
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"料箱:"
+
boxStr
+
"所属的库位为:"
+
pos
.
getPosName
()
+
",属于虚拟仓,请在虚拟仓页面进行操作"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"料箱:"
+
boxStr
+
"所属的库位为:"
+
pos
.
getPosName
()
+
",属于虚拟仓,请在虚拟仓页面进行操作"
);
}
}
pos
.
setBarcode
(
boxBarcode
);
pos
.
setBarcode
(
boxBarcode
);
storagePosManager
.
save
(
pos
);
storagePosManager
.
save
(
pos
);
log
.
info
(
boxStr
+
"入库到智能仓,分配的储位为:"
+
pos
.
getPosName
());
log
.
info
(
boxStr
+
"入库到智能仓,分配的储位为:"
+
pos
.
getPosName
());
DataLog
dataLog
=
taskService
.
addPutInTaskToExecute
(
storage
,
boxBarcode
,
pos
,
lineNo
+
"_out"
);
DataLog
dataLog
=
taskService
.
addPutInTaskToExecute
(
storage
,
boxBarcode
,
pos
,
lineNo
+
"_out"
);
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
}
}
}
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/third/RawInLineController.java
0 → 100644
查看文件 @
4a4a847
package
com
.
neotel
.
smfcore
.
custom
.
luxsan
.
factory_c
.
third
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.custom.luxsan.factory_c.third.util.RawInLineUtil
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.HashMap
;
import
java.util.Map
;
@Slf4j
@Api
(
tags
=
"入库流水线"
)
@RestController
public
class
RawInLineController
{
@ApiOperation
(
"获取满料串分流目的地"
)
@RequestMapping
(
"/rawInLine/materialDestination"
)
@AnonymousAccess
public
ResultBean
materialDestination
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
String
materialStr
=
paramMap
.
get
(
"materialStr"
);
String
loc
=
paramMap
.
get
(
"loc"
);
log
.
info
(
"入库流水线,获取满料串:"
+
materialStr
+
"目的地为:"
+
loc
);
String
destination
=
RawInLineUtil
.
getNextDestination
(
materialStr
,
loc
);
Map
<
String
,
String
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"destination"
,
destination
);
resultMap
.
put
(
"materialStr"
,
materialStr
);
return
ResultBean
.
newOkResult
(
resultMap
);
}
}
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/third/bean/RawInLineMaterialLoc.java
0 → 100644
查看文件 @
4a4a847
package
com
.
neotel
.
smfcore
.
custom
.
luxsan
.
factory_c
.
third
.
bean
;
import
lombok.Data
;
@Data
public
class
RawInLineMaterialLoc
{
private
String
material
;
//当前位置
private
String
currentLoc
;
//目的地
private
String
destination
;
}
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/third/util/RawInLineUtil.java
0 → 100644
查看文件 @
4a4a847
package
com
.
neotel
.
smfcore
.
custom
.
luxsan
.
factory_c
.
third
.
util
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.custom.luxsan.factory_c.common.util.CacheNameUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.third.bean.RawInLineMaterialLoc
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.util.Map
;
import
java.util.concurrent.ConcurrentHashMap
;
@Component
@Slf4j
public
class
RawInLineUtil
{
private
static
DataCache
dataCache
;
@Autowired
private
void
setDataCache
(
DataCache
cache
){
RawInLineUtil
.
dataCache
=
cache
;
}
public
static
final
String
forkLoc
=
"forkLoc"
;
//料串分流位,
public
static
final
String
rawInLine01
=
"rawInLine01"
;
//1号入库分拣机,
public
static
final
String
rawInLine02
=
"rawInLine02"
;
//2号入库分拣机,
public
static
final
String
rawInLine03
=
"rawInLine03"
;
//3号入库分拣机,
public
static
final
String
rawInLine04
=
"rawInLine04"
;
//4号入库分拣机,
public
static
final
String
rawInLine05
=
"rawInLine05"
;
//5号入库分拣机,
public
static
final
String
rawInLine06
=
"rawInLine06"
;
//6号入库分拣机
public
static
void
updateDestinationMap
(
String
material
,
String
loc
,
String
destination
)
{
Map
<
String
,
RawInLineMaterialLoc
>
destinationMap
=
dataCache
.
getCache
(
CacheNameUtil
.
CHCHE_RAWIN_LINE_MATERIAL_DESTINATION
);
if
(
destinationMap
==
null
)
{
destinationMap
=
new
ConcurrentHashMap
<>();
}
RawInLineMaterialLoc
materialLoc
=
destinationMap
.
get
(
material
);
if
(
materialLoc
==
null
){
materialLoc
=
new
RawInLineMaterialLoc
();
}
materialLoc
.
setMaterial
(
material
);
materialLoc
.
setCurrentLoc
(
loc
);
if
(
StringUtils
.
isNotEmpty
(
destination
)){
materialLoc
.
setDestination
(
destination
);
}
destinationMap
.
put
(
material
,
materialLoc
);
dataCache
.
updateCache
(
CacheNameUtil
.
CHCHE_RAWIN_LINE_MATERIAL_DESTINATION
,
destinationMap
);
}
public
static
String
getNextDestination
(
String
material
,
String
loc
)
{
updateDestinationMap
(
material
,
loc
,
""
);
return
getNextLoc
(
material
,
loc
);
}
public
static
String
getCurrentMaterial
(
String
loc
)
{
Map
<
String
,
RawInLineMaterialLoc
>
destinationMap
=
dataCache
.
getCache
(
CacheNameUtil
.
CHCHE_RAWIN_LINE_MATERIAL_DESTINATION
);
if
(
destinationMap
==
null
)
{
destinationMap
=
new
ConcurrentHashMap
<>();
}
for
(
RawInLineMaterialLoc
materialLoc
:
destinationMap
.
values
())
{
if
(
loc
.
equals
(
materialLoc
.
getCurrentLoc
())){
return
materialLoc
.
getMaterial
();
}
}
return
""
;
}
private
static
String
getNextLoc
(
String
material
,
String
loc
)
{
log
.
info
(
"获取满料串:"
+
material
+
",当前位置为:"
+
loc
);
String
nextLoc
=
"forkLoc"
;
if
(
forkLoc
.
equals
(
loc
))
{
nextLoc
=
rawInLine01
;
}
else
if
(
rawInLine01
.
equals
(
loc
))
{
nextLoc
=
rawInLine02
;
}
else
if
(
rawInLine02
.
equals
(
loc
))
{
nextLoc
=
rawInLine03
;
}
else
if
(
rawInLine03
.
equals
(
loc
))
{
nextLoc
=
rawInLine04
;
}
else
if
(
rawInLine04
.
equals
(
loc
))
{
nextLoc
=
rawInLine05
;
}
else
if
(
rawInLine05
.
equals
(
loc
))
{
nextLoc
=
rawInLine06
;
}
Map
<
String
,
RawInLineMaterialLoc
>
destinationMap
=
dataCache
.
getCache
(
CacheNameUtil
.
CHCHE_RAWIN_LINE_MATERIAL_DESTINATION
);
int
count
=
0
;
for
(
RawInLineMaterialLoc
materialLoc
:
destinationMap
.
values
())
{
if
(
nextLoc
.
equals
(
materialLoc
.
getDestination
()))
{
count
++;
}
}
log
.
info
(
"获取满料串:"
+
material
+
",下一个位置为:"
+
nextLoc
+
",当前数量为:"
+
count
);
if
(
count
>=
5
)
{
updateDestinationMap
(
material
,
loc
,
loc
);
return
loc
;
}
updateDestinationMap
(
material
,
loc
,
nextLoc
);
return
nextLoc
;
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论