Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 2a622d86
由
LN
编写于
2023-02-23 14:37:48 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1053:1.入库分配时优先分配无出库任务的料仓。2.获取料架数量时按照任务排序。3.出库任务查找:同时只发一个工单两个料架的出库任务。
1 个父辈
4389a1a8
隐藏空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
176 行增加
和
62 行删除
src/main/java/com/neotel/smfcore/core/barcode/bean/BarcodeRule.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/BaseDeviceHandler.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/RobotBoxHandler.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/ThirdBoxHandler.java
src/main/java/com/neotel/smfcore/core/system/service/po/DataLog.java
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
src/main/java/com/neotel/smfcore/custom/micron1053/controller/MicronDeviceController.java
src/main/java/com/neotel/smfcore/custom/micron1053/controller/MicronML5Controller.java
src/main/java/com/neotel/smfcore/custom/micron1053/util/MicronDataCache.java
src/main/java/com/neotel/smfcore/core/barcode/bean/BarcodeRule.java
查看文件 @
2a622d8
...
@@ -861,6 +861,13 @@ public class BarcodeRule {
...
@@ -861,6 +861,13 @@ public class BarcodeRule {
rule
=
"PN[5:0:-1]|BATCH[2:0:-1]|LOT|QTY[2:0:-1]|RI|SP[5:0:-1]|EXPDATEdd-MM-yyyy[2:0:-1]|xxx|xxx|xxx"
;
rule
=
"PN[5:0:-1]|BATCH[2:0:-1]|LOT|QTY[2:0:-1]|RI|SP[5:0:-1]|EXPDATEdd-MM-yyyy[2:0:-1]|xxx|xxx|xxx"
;
rule
=
"PN[5:0:-1]|BATCH[2:0:-1]|LOT|QTY[2_7Q:0:-1]|RI|SP[5:0:-1]|EXPDATEdd-MM-yyyy[2:0:-1]|xxx|xxx|xxx"
;
rule
=
"PN[5:0:-1]|BATCH[2:0:-1]|LOT|QTY[2_7Q:0:-1]|RI|SP[5:0:-1]|EXPDATEdd-MM-yyyy[2:0:-1]|xxx|xxx|xxx"
;
codeStr
=
"zBYHNMC3.41+250123|1TBYHNMC3.41|7Q1000|1TBYHNMC3.41|P466385|1PMT29F2T08EMHBFJ4-T:B"
;
rule
=
"EXPDATEyyMMdd[12:0:-1]|BATCH[2:0:-1]|QTY[2:0:-1]|RI[2:0:-1]|PN[1:0:-1]|XXX"
;
codeStr
=
"=1+0x0-400x62=zJFSRW46.11+250205|1TJFSRW46.11|7Q404|1TJFSRW46.11|P530828|1PMT29F2T08ELLEEG7-QD:E"
;
rule
=
"EXPDATEyyMMdd[12:0:-1]|BATCH[2:0:-1]|QTY[2:0:-1]|RI[2:0:-1]|PN[1:0:-1]|XXX"
;
// rule="PN[1:0:-1]|BATCH[2:0:-1]|LOT[2:0:-1]|QTY[2_7Q:0:-1]|RI[1:0:-1]|SP[3:0:-1]|PRODATEyyyyMMdd[2:0:-1]|xxx";
BarcodeRule
br
=
BarcodeRule
.
newRule
(
rule
);
BarcodeRule
br
=
BarcodeRule
.
newRule
(
rule
);
Barcode
b
=
br
.
toCodeBean
(
codeStr
).
getBarcode
();
Barcode
b
=
br
.
toCodeBean
(
codeStr
).
getBarcode
();
if
(
b
!=
null
){
if
(
b
!=
null
){
...
@@ -874,6 +881,7 @@ public class BarcodeRule {
...
@@ -874,6 +881,7 @@ public class BarcodeRule {
System
.
out
.
println
(
"Supllier:"
+
b
.
getProvider
());
System
.
out
.
println
(
"Supllier:"
+
b
.
getProvider
());
System
.
out
.
println
(
"Memo:"
+
b
.
getMemo
());
System
.
out
.
println
(
"Memo:"
+
b
.
getMemo
());
}
else
{
}
else
{
System
.
out
.
println
(
"解析失败"
);
log
.
info
(
"解析失败"
);
log
.
info
(
"解析失败"
);
}
}
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/BaseDeviceHandler.java
查看文件 @
2a622d8
...
@@ -908,6 +908,29 @@ public class BaseDeviceHandler implements IDeviceHandler {
...
@@ -908,6 +908,29 @@ public class BaseDeviceHandler implements IDeviceHandler {
return
dataLogs
;
return
dataLogs
;
}
}
protected
StatusBean
sendOutTaskToClient
(
DataLog
outTask
,
StatusBean
statusBean
,
Storage
storage
)
{
if
(
outTask
!=
null
)
{
log
.
info
(
"分配出库任务"
+
outTask
.
getBarcode
()
+
"["
+
outTask
.
getPosName
()
+
"]到 "
+
storage
.
getCid
());
outTask
.
setStatus
(
OP_STATUS
.
EXECUTING
.
name
());
taskService
.
updateQueueTask
(
outTask
);
statusBean
.
setOp
(
OP
.
CHECKOUT
);
String
posName
=
outTask
.
getPosName
();
Barcode
codeObj
=
barcodeManager
.
findByBarcode
(
outTask
.
getBarcode
());
int
plateW
=
0
;
int
plateH
=
0
;
if
(
codeObj
!=
null
)
{
plateW
=
codeObj
.
getPlateSize
();
plateH
=
codeObj
.
getHeight
();
}
else
{
log
.
warn
(
"出库无料仓位"
+
storage
.
getName
()
+
"["
+
posName
+
"]"
);
}
statusBean
.
addPosInfo
(
outTask
.
getBarcode
(),
posName
,
plateW
,
plateH
,
false
);
log
.
info
(
"出库"
+
storage
.
getName
()
+
"["
+
posName
+
"]物料["
+
outTask
.
getBarcode
()
+
"] 发送到客户端"
+
storage
.
getCid
());
}
return
statusBean
;
}
/**
/**
* 判断是否打开了亮灯指引功能
* 判断是否打开了亮灯指引功能
* @return
* @return
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/RobotBoxHandler.java
查看文件 @
2a622d8
...
@@ -23,13 +23,13 @@ import com.neotel.smfcore.core.storage.service.po.StoragePos;
...
@@ -23,13 +23,13 @@ import com.neotel.smfcore.core.storage.service.po.StoragePos;
import
com.neotel.smfcore.core.system.service.dao.IAlarmInfoDao
;
import
com.neotel.smfcore.core.system.service.dao.IAlarmInfoDao
;
import
com.neotel.smfcore.core.system.service.po.AlarmInfo
;
import
com.neotel.smfcore.core.system.service.po.AlarmInfo
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.custom.micron1053.util.MicronDataCache
;
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
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.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
...
@@ -97,11 +97,35 @@ public class RobotBoxHandler extends BaseDeviceHandler {
...
@@ -97,11 +97,35 @@ public class RobotBoxHandler extends BaseDeviceHandler {
if
(
dataCache
.
getCache
(
Constants
.
CACHE_StopOut
))
{
if
(
dataCache
.
getCache
(
Constants
.
CACHE_StopOut
))
{
return
statusBean
;
return
statusBean
;
}
}
String
cid
=
statusBean
.
getCid
();
String
cid
=
statusBean
.
getCid
();
// 任务根据时间排序。查找当前正在出的工单和料架 (入库任务不计算)
List
<
DataLog
>
allTasks
=
taskService
.
getAllTasks
();
Collections
.
sort
(
allTasks
);
List
<
String
>
shelfType
=
new
ArrayList
<>();
List
<
String
>
sourceIds
=
new
ArrayList
<>();
for
(
DataLog
task
:
allTasks
)
{
if
(
task
.
isPutInTask
()||
task
.
isEnd
()||
task
.
isFinished
()||
task
.
isCancel
()){
continue
;
}
if
(
task
.
isCheckOutTask
()&&
task
.
isWait
()){
continue
;
}
String
shelf
=
MicronDataCache
.
getShelfType
(
task
);
if
(!
shelfType
.
contains
(
shelf
)){
shelfType
.
add
(
shelf
);
}
if
(
ObjectUtil
.
isNotEmpty
(
task
.
getSourceId
())&&(!
sourceIds
.
contains
(
task
.
getSourceId
()))){
sourceIds
.
add
(
task
.
getSourceId
());
}
}
//查询
List
<
DataLog
>
queueTasks
=
new
ArrayList
<>();
queueTasks
.
addAll
(
taskService
.
getQueueTasks
());
Collections
.
sort
(
queueTasks
);
Collection
<
DataLog
>
queueTasks
=
taskService
.
getQueueTasks
();
int
executingOutTaskSize
=
0
;
int
executingOutTaskSize
=
0
;
DataLog
outTask
=
null
;
DataLog
outTask
=
null
;
for
(
DataLog
queueTask
:
queueTasks
)
{
for
(
DataLog
queueTask
:
queueTasks
)
{
...
@@ -125,34 +149,33 @@ public class RobotBoxHandler extends BaseDeviceHandler {
...
@@ -125,34 +149,33 @@ public class RobotBoxHandler extends BaseDeviceHandler {
outTask
=
null
;
outTask
=
null
;
break
;
break
;
}
}
outTask
=
queueTask
;
if
(
queueTask
.
isUrgentReel
())
{
if
(
queueTask
.
isUrgentReel
())
{
outTask
=
queueTask
;
break
;
break
;
}
}
//如果料架>=2,当前任务的料架在已出料架中,可以直接出
//如果料架<2,且当前任务属于已出工单,可以直接出
//循环查找,当前任务不满足时查找下一个任务
String
shelf
=
MicronDataCache
.
getShelfType
(
queueTask
);
if
(
shelfType
.
size
()
<
2
||
shelfType
.
contains
(
shelf
))
{
//料架正确,工单为空,返回
if
(
ObjectUtil
.
isEmpty
(
queueTask
.
getSourceId
()))
{
outTask
=
queueTask
;
break
;
}
else
if
(
sourceIds
.
size
()
<
1
||
sourceIds
.
contains
(
queueTask
.
getSourceId
()))
{
outTask
=
queueTask
;
break
;
}
}
}
}
}
}
}
}
}
}
if
(
outTask
!=
null
)
{
statusBean
=
sendOutTaskToClient
(
outTask
,
statusBean
,
storage
);
log
.
info
(
"分配出库任务"
+
outTask
.
getBarcode
()
+
"["
+
outTask
.
getPosName
()
+
"]到 "
+
cid
);
outTask
.
setStatus
(
OP_STATUS
.
EXECUTING
.
name
());
taskService
.
updateQueueTask
(
outTask
);
statusBean
.
setOp
(
OP
.
CHECKOUT
);
String
posName
=
outTask
.
getPosName
();
Barcode
codeObj
=
barcodeManager
.
findByBarcode
(
outTask
.
getBarcode
());
int
plateW
=
0
;
int
plateH
=
0
;
if
(
codeObj
!=
null
)
{
plateW
=
codeObj
.
getPlateSize
();
plateH
=
codeObj
.
getHeight
();
}
else
{
log
.
warn
(
"出库无料仓位"
+
storage
.
getName
()
+
"["
+
posName
+
"]"
);
}
statusBean
.
addPosInfo
(
outTask
.
getBarcode
(),
posName
,
plateW
,
plateH
,
false
);
log
.
info
(
"出库"
+
storage
.
getName
()
+
"["
+
posName
+
"]物料["
+
outTask
.
getBarcode
()
+
"] 发送到客户端"
+
cid
);
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"出库出错"
,
e
);
log
.
error
(
"出库出错"
,
e
);
...
@@ -160,7 +183,6 @@ public class RobotBoxHandler extends BaseDeviceHandler {
...
@@ -160,7 +183,6 @@ public class RobotBoxHandler extends BaseDeviceHandler {
return
statusBean
;
return
statusBean
;
}
}
protected
StatusBean
handleFinished
(
StatusBean
statusBean
)
{
protected
StatusBean
handleFinished
(
StatusBean
statusBean
)
{
Map
<
String
,
BoxStatusBean
>
statusOfBoxes
=
statusBean
.
getBoxStatus
();
Map
<
String
,
BoxStatusBean
>
statusOfBoxes
=
statusBean
.
getBoxStatus
();
if
(
statusOfBoxes
!=
null
)
{
if
(
statusOfBoxes
!=
null
)
{
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/ThirdBoxHandler.java
查看文件 @
2a622d8
package
com
.
neotel
.
smfcore
.
core
.
device
.
handler
.
impl
;
package
com
.
neotel
.
smfcore
.
core
.
device
.
handler
.
impl
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.google.common.base.Strings
;
import
com.google.common.base.Strings
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.Constants
;
import
com.neotel.smfcore.common.utils.Constants
;
...
@@ -16,15 +17,13 @@ import com.neotel.smfcore.core.storage.enums.DeviceType;
...
@@ -16,15 +17,13 @@ import com.neotel.smfcore.core.storage.enums.DeviceType;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
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.c
ore.system.util.DevicesStatusUtil
;
import
com.neotel.smfcore.c
ustom.micron1053.util.MicronDataCache
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Collection
;
import
java.util.*
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
@Service
@Service
@Slf4j
@Slf4j
public
class
ThirdBoxHandler
extends
BaseDeviceHandler
{
public
class
ThirdBoxHandler
extends
BaseDeviceHandler
{
...
@@ -83,17 +82,41 @@ public class ThirdBoxHandler extends BaseDeviceHandler{
...
@@ -83,17 +82,41 @@ public class ThirdBoxHandler extends BaseDeviceHandler{
if
(
dataCache
.
getCache
(
Constants
.
CACHE_StopOut
))
{
if
(
dataCache
.
getCache
(
Constants
.
CACHE_StopOut
))
{
return
statusBean
;
return
statusBean
;
}
}
String
cid
=
statusBean
.
getCid
();
String
cid
=
statusBean
.
getCid
();
// 任务根据时间排序。查找当前正在出的工单和料架 (入库任务不计算)
List
<
DataLog
>
allTasks
=
taskService
.
getAllTasks
();
Collections
.
sort
(
allTasks
);
List
<
String
>
shelfType
=
new
ArrayList
<>();
List
<
String
>
sourceIds
=
new
ArrayList
<>();
for
(
DataLog
task
:
allTasks
)
{
if
(
task
.
isPutInTask
()||
task
.
isEnd
()||
task
.
isFinished
()||
task
.
isCancel
()){
continue
;
}
if
(
task
.
isCheckOutTask
()&&
task
.
isWait
()){
continue
;
}
String
shelf
=
MicronDataCache
.
getShelfType
(
task
);
if
(!
shelfType
.
contains
(
shelf
)){
shelfType
.
add
(
shelf
);
}
if
(
ObjectUtil
.
isNotEmpty
(
task
.
getSourceId
())&&(!
sourceIds
.
contains
(
task
.
getSourceId
()))){
sourceIds
.
add
(
task
.
getSourceId
());
}
}
//查询
List
<
DataLog
>
queueTasks
=
new
ArrayList
<>();
queueTasks
.
addAll
(
taskService
.
getQueueTasks
());
Collections
.
sort
(
queueTasks
);
Collection
<
DataLog
>
queueTasks
=
taskService
.
getQueueTasks
();
int
executingOutTaskSize
=
0
;
int
executingOutTaskSize
=
0
;
DataLog
outTask
=
null
;
DataLog
outTask
=
null
;
for
(
DataLog
queueTask
:
queueTasks
)
{
for
(
DataLog
queueTask
:
queueTasks
)
{
if
(
queueTask
.
getCid
().
equals
(
cid
))
{
if
(
queueTask
.
getCid
().
equals
(
cid
))
{
//有入库任务不分配出库任务
//有入库任务不分配出库任务
if
(
queueTask
.
isPutInTask
())
{
if
(
queueTask
.
isPutInTask
())
{
return
statusBean
;
return
statusBean
;
}
else
{
}
else
{
if
(
queueTask
.
isExecuting
())
{
if
(
queueTask
.
isExecuting
())
{
...
@@ -111,34 +134,33 @@ public class ThirdBoxHandler extends BaseDeviceHandler{
...
@@ -111,34 +134,33 @@ public class ThirdBoxHandler extends BaseDeviceHandler{
outTask
=
null
;
outTask
=
null
;
break
;
break
;
}
}
outTask
=
queueTask
;
if
(
queueTask
.
isUrgentReel
())
{
if
(
queueTask
.
isUrgentReel
())
{
outTask
=
queueTask
;
break
;
break
;
}
}
//如果料架>=2,当前任务的料架在已出料架中,可以直接出
//如果料架<2,且当前任务属于已出工单,可以直接出
//循环查找,当前任务不满足时查找下一个任务
String
shelf
=
MicronDataCache
.
getShelfType
(
queueTask
);
if
(
shelfType
.
size
()
<
2
||
shelfType
.
contains
(
shelf
))
{
//料架正确,工单为空,返回
if
(
ObjectUtil
.
isEmpty
(
queueTask
.
getSourceId
()))
{
outTask
=
queueTask
;
break
;
}
else
if
(
sourceIds
.
size
()
<
1
||
sourceIds
.
contains
(
queueTask
.
getSourceId
()))
{
outTask
=
queueTask
;
break
;
}
}
}
}
}
}
}
}
}
}
if
(
outTask
!=
null
)
{
statusBean
=
sendOutTaskToClient
(
outTask
,
statusBean
,
storage
);
log
.
info
(
"分配出库任务"
+
outTask
.
getBarcode
()
+
"["
+
outTask
.
getPosName
()
+
"]到 "
+
cid
);
outTask
.
setStatus
(
OP_STATUS
.
EXECUTING
.
name
());
taskService
.
updateQueueTask
(
outTask
);
statusBean
.
setOp
(
OP
.
CHECKOUT
);
String
posName
=
outTask
.
getPosName
();
Barcode
codeObj
=
barcodeManager
.
findByBarcode
(
outTask
.
getBarcode
());
int
plateW
=
0
;
int
plateH
=
0
;
if
(
codeObj
!=
null
)
{
plateW
=
codeObj
.
getPlateSize
();
plateH
=
codeObj
.
getHeight
();
}
else
{
log
.
warn
(
"出库无料仓位"
+
storage
.
getName
()
+
"["
+
posName
+
"]"
);
}
statusBean
.
addPosInfo
(
outTask
.
getBarcode
(),
posName
,
plateW
,
plateH
,
false
);
log
.
info
(
"出库"
+
storage
.
getName
()
+
"["
+
posName
+
"]物料["
+
outTask
.
getBarcode
()
+
"] 发送到客户端"
+
cid
);
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"出库出错"
,
e
);
log
.
error
(
"出库出错"
,
e
);
...
...
src/main/java/com/neotel/smfcore/core/system/service/po/DataLog.java
查看文件 @
2a622d8
...
@@ -19,7 +19,7 @@ import java.util.List;
...
@@ -19,7 +19,7 @@ import java.util.List;
@Data
@Data
@Document
@Document
public
class
DataLog
extends
BasePo
implements
Serializable
{
public
class
DataLog
extends
BasePo
implements
Serializable
,
Comparable
<
DataLog
>
{
public
DataLog
(){
public
DataLog
(){
...
@@ -435,4 +435,9 @@ public class DataLog extends BasePo implements Serializable {
...
@@ -435,4 +435,9 @@ public class DataLog extends BasePo implements Serializable {
}
}
return
false
;
return
false
;
}
}
@Override
public
int
compareTo
(
DataLog
o
)
{
return
this
.
getId
().
compareTo
(
o
.
getId
());
}
}
}
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
查看文件 @
2a622d8
...
@@ -702,11 +702,28 @@ public class TaskService {
...
@@ -702,11 +702,28 @@ public class TaskService {
}
}
});
});
return
findEmptyPosInStorages
(
barcode
,
availbleStorageList
,
storageTaskCountMap
,
lastPosId
);
return
findEmptyPosInStorages
(
barcode
,
availbleStorageList
,
hasOutTaskStorageIds
,
lastPosId
);
}
}
private
synchronized
StoragePos
findEmptyPosInStorages
(
Barcode
barcode
,
List
<
Storage
>
availbleStorageList
,
final
Map
<
String
,
Integer
>
executingTaskCountMap
,
String
lastPosId
)
{
private
synchronized
StoragePos
findEmptyPosInStorages
(
Barcode
barcode
,
List
<
Storage
>
availbleStorageList
,
final
Set
<
String
>
hasOutTaskStorageIds
,
String
lastPosId
)
{
//第一遍查找,先不查找有出库任务的料仓
for
(
Storage
storage
:
availbleStorageList
)
{
if
(
hasOutTaskStorageIds
.
contains
(
storage
.
getId
())){
continue
;
}
try
{
Collection
<
String
>
operatingPosIds
=
excludePosIds
();
log
.
debug
(
"尝试从["
+
storage
.
getCid
()
+
"]中为["
+
barcode
.
getBarcode
()
+
"]查找空位"
);
StoragePos
pos
=
storagePosManager
.
getEmptyPosByStorage
(
storage
,
barcode
,
operatingPosIds
,
lastPosId
);
if
(
pos
!=
null
)
{
return
pos
;
}
}
catch
(
Exception
e
)
{
log
.
error
(
"尝试从["
+
storage
.
getCid
()
+
"]中为["
+
barcode
.
getBarcode
()
+
"]查找空位失败:"
+
e
.
getMessage
());
}
}
//第二遍查找,从所有料仓中查找
for
(
Storage
storage
:
availbleStorageList
)
{
for
(
Storage
storage
:
availbleStorageList
)
{
try
{
try
{
Collection
<
String
>
operatingPosIds
=
excludePosIds
();
Collection
<
String
>
operatingPosIds
=
excludePosIds
();
...
@@ -719,7 +736,6 @@ public class TaskService {
...
@@ -719,7 +736,6 @@ public class TaskService {
log
.
error
(
"尝试从["
+
storage
.
getCid
()
+
"]中为["
+
barcode
.
getBarcode
()
+
"]查找空位失败:"
+
e
.
getMessage
());
log
.
error
(
"尝试从["
+
storage
.
getCid
()
+
"]中为["
+
barcode
.
getBarcode
()
+
"]查找空位失败:"
+
e
.
getMessage
());
}
}
}
}
try
{
try
{
String
cids
=
""
;
String
cids
=
""
;
for
(
Storage
storage
:
availbleStorageList
)
{
for
(
Storage
storage
:
availbleStorageList
)
{
...
...
src/main/java/com/neotel/smfcore/custom/micron1053/controller/MicronDeviceController.java
查看文件 @
2a622d8
...
@@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Collections
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -51,14 +52,21 @@ public class MicronDeviceController {
...
@@ -51,14 +52,21 @@ public class MicronDeviceController {
@ResponseBody
@ResponseBody
@AnonymousAccess
@AnonymousAccess
public
ResultBean
getTaskCount
(
HttpServletRequest
request
)
{
public
ResultBean
getTaskCount
(
HttpServletRequest
request
)
{
// String type = request.getParameter("type");
// 根据时间排序,获取所有任务,Wait和已完成的 任务不发
List
<
DataLog
>
dataLogs
=
taskService
.
getAllTasks
();
List
<
DataLog
>
dataLogs
=
taskService
.
getAllTasks
();
// String[] types=new String[]{"pizzaBox","pcb","tray","reel"}
;
Collections
.
sort
(
dataLogs
)
;
Map
<
String
,
Integer
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Integer
>
resultMap
=
new
HashMap
<>();
for
(
DataLog
task
:
dataLogs
for
(
DataLog
task
:
dataLogs
)
{
)
{
if
(
task
.
isEnd
()||
task
.
isFinished
()||
task
.
isCancel
()){
continue
;
}
if
(
task
.
isCheckOutTask
()&&
task
.
isWait
()){
continue
;
}
String
taskType
=
MicronDataCache
.
GetMaterialType
(
task
);
String
taskType
=
MicronDataCache
.
GetMaterialType
(
task
);
String
key
=
taskType
+
"_out"
;
String
key
=
taskType
+
"_out"
;
if
(
task
.
isPutInTask
())
{
if
(
task
.
isPutInTask
())
{
...
...
src/main/java/com/neotel/smfcore/custom/micron1053/controller/MicronML5Controller.java
查看文件 @
2a622d8
...
@@ -16,10 +16,7 @@ import org.springframework.web.bind.annotation.GetMapping;
...
@@ -16,10 +16,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import
org.springframework.web.bind.annotation.RequestMapping
;
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.*
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@Slf4j
@Slf4j
@RestController
@RestController
...
@@ -64,9 +61,18 @@ public class MicronML5Controller {
...
@@ -64,9 +61,18 @@ public class MicronML5Controller {
}
}
Map
<
String
,
Integer
>
needShelfs
=
new
HashMap
<>();
Map
<
String
,
Integer
>
needShelfs
=
new
HashMap
<>();
// 根据时间排序,获取所有任务,Wait和已完成的 任务不发
List
<
DataLog
>
dataLogs
=
taskService
.
getAllTasks
();
List
<
DataLog
>
dataLogs
=
taskService
.
getAllTasks
();
Collections
.
sort
(
dataLogs
);
for
(
DataLog
task
:
dataLogs
for
(
DataLog
task
:
dataLogs
)
{
)
{
if
(
task
.
isPutInTask
()||
task
.
isEnd
()||
task
.
isFinished
()||
task
.
isCancel
()){
continue
;
}
if
(
task
.
isCheckOutTask
()&&
task
.
isWait
()){
continue
;
}
String
taskType
=
MicronDataCache
.
GetMaterialType
(
task
);
String
taskType
=
MicronDataCache
.
GetMaterialType
(
task
);
String
shelf
=
MicronDataCache
.
getShelfType
(
taskType
);
String
shelf
=
MicronDataCache
.
getShelfType
(
taskType
);
if
(
needShelfs
.
containsKey
(
shelf
))
{
if
(
needShelfs
.
containsKey
(
shelf
))
{
...
...
src/main/java/com/neotel/smfcore/custom/micron1053/util/MicronDataCache.java
查看文件 @
2a622d8
...
@@ -86,6 +86,10 @@ public class MicronDataCache {
...
@@ -86,6 +86,10 @@ public class MicronDataCache {
public
static
String
GetMaterialType
(
DataLog
dataLog
){
public
static
String
GetMaterialType
(
DataLog
dataLog
){
return
GetMaterialType
(
dataLog
.
getCid
(),
dataLog
.
getStorageId
(),
dataLog
.
getW
(),
dataLog
.
getH
());
return
GetMaterialType
(
dataLog
.
getCid
(),
dataLog
.
getStorageId
(),
dataLog
.
getW
(),
dataLog
.
getH
());
}
}
public
static
String
getShelfType
(
DataLog
dataLog
){
String
mType
=
GetMaterialType
(
dataLog
);
return
getShelfType
(
mType
);
}
public
static
String
getShelfType
(
String
materialType
){
public
static
String
getShelfType
(
String
materialType
){
if
(
materialType
.
equals
(
PIZZABOX
)){
if
(
materialType
.
equals
(
PIZZABOX
)){
return
"M01"
;
return
"M01"
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论