Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
QisdaNew
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 3b3c8ba9
由
sunke
编写于
2020-05-26 10:10:10 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
入库时锁定库位,不生成任务
提供包装料仓锁定库位查询接口
1 个父辈
7646b463
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
414 行增加
和
46 行删除
README.md
myproject/src/main/java/com/myproject/bean/qisda/QisdaApiRequest.java
myproject/src/main/java/com/myproject/bean/qisda/ReelLockPosInfo.java
myproject/src/main/java/com/myproject/bean/utils/StatusBean.java
myproject/src/main/java/com/myproject/webapp/controller/webService/ITaskService.java
myproject/src/main/java/com/myproject/webapp/controller/webService/MainTimer.java
myproject/src/main/java/com/myproject/webapp/controller/webService/QisdaCache.java
myproject/src/main/java/com/myproject/webapp/controller/webService/QisdaDeviceController.java
myproject/src/main/java/com/myproject/webapp/controller/webService/StorageDataController.java
myproject/src/main/java/com/myproject/webapp/controller/webService/TaskService.java
README.md
查看文件 @
3b3c8ba
...
...
@@ -280,4 +280,46 @@ IP: 10.85.160.181
>> - data:
>> - tempRfid: 表示当前料架(料串)对应的虚拟RFID
10.
分盘料/紧急料放上料串或料架时调用
>地址:
>>/rest/api/qisda/device/afterPutCut
>
>参数:
>>cid: 料仓cid,流水线可传入空
>>barcode : 条码
>>rfid : RFID
>>rfidLoc: 料架位置,流水线可传-1
>
> 返回:
>>` {"code": 0, "msg":"ok", "data":{"cutPackageTask":"0","urgentPackageTask":"20","cutTask":"21","urgentTask":"22"}} `
>>
>> - code: 0为正常,其他为异常,
>> - msg:消息,
>> - data:
>> - cutPackageTask: 表示当前包装仓的分盘任务数
>> - urgentPackageTask: 表示当前包装仓的紧急料任务数
>> - cutTask: 表示流水线分盘任务数
>> - urgentTask: 表示流水线紧急料任务数
11.
包装料架进入料仓时料架RFID上已经锁定库位的料(有数据时,)或料架从包装料仓流出时AGV获取料架上已锁定的料盘(为空时当作空料架处理)
>地址:
>>/rest/api/qisda/device/getShelfLockInfo
>
>参数:
>>rfid : RFID
>
> 返回:
>>` {"code":0,"msg":"ok","data":[{"barcode":"S20052301213","cid":"packing-20","rfid":"A12","rfidLoc":"3","lockPos":"4D2001AA0006","lockPosId":"1231"}]} `
>>
>> - code: 0为正常,其他为异常,
>> - msg:消息,
>> - data:
>> - rfid: 料架RFID
>> - rfidLoc: 料架的库位
>> - barcode: 库位中料盘的条码
>> - cid: 库位中料盘的锁定库位对应的料仓编号
>> - lockPos: 库位中料盘的锁定库位
myproject/src/main/java/com/myproject/bean/qisda/QisdaApiRequest.java
0 → 100644
查看文件 @
3b3c8ba
package
com
.
myproject
.
bean
.
qisda
;
import
java.util.Date
;
import
java.util.Map
;
/**
* 用于入库,出库,发料失败时向Qisda重新发送指令,指令有先后顺序,reelId与desc作为唯一标识
* Created by sunke on 2020/5/15.
*/
public
class
QisdaApiRequest
{
public
QisdaApiRequest
(
String
desc
,
Map
<
String
,
Object
>
paramMap
,
String
reelId
,
String
url
)
{
this
.
desc
=
desc
;
this
.
paramMap
=
paramMap
;
this
.
reelId
=
reelId
;
this
.
url
=
url
;
}
public
QisdaApiRequest
()
{
}
/**
* 条码
*/
private
String
reelId
;
/**
* 描述:入库,出库,发料
*/
private
String
desc
;
/**
* url
*/
private
String
url
;
/**
* 参数
*/
private
Map
<
String
,
Object
>
paramMap
;
/**
* 时间
*/
private
Date
date
=
new
Date
();
public
String
getDesc
()
{
return
desc
;
}
public
void
setDesc
(
String
desc
)
{
this
.
desc
=
desc
;
}
public
Map
<
String
,
Object
>
getParamMap
()
{
return
paramMap
;
}
public
void
setParamMap
(
Map
<
String
,
Object
>
paramMap
)
{
this
.
paramMap
=
paramMap
;
}
public
String
getReelId
()
{
return
reelId
;
}
public
void
setReelId
(
String
reelId
)
{
this
.
reelId
=
reelId
;
}
public
String
getUrl
()
{
return
url
;
}
public
void
setUrl
(
String
url
)
{
this
.
url
=
url
;
}
public
String
getMapKey
(){
return
reelId
+
"_"
+
desc
;
}
public
Date
getDate
()
{
return
date
;
}
public
void
setDate
(
Date
date
)
{
this
.
date
=
date
;
}
}
myproject/src/main/java/com/myproject/bean/qisda/ReelLockPosInfo.java
0 → 100644
查看文件 @
3b3c8ba
package
com
.
myproject
.
bean
.
qisda
;
/**
* Created by sunke on 2020/5/25.
*/
public
class
ReelLockPosInfo
{
/**
* 条码信息
*/
private
String
barcode
;
/**
* 料仓cid
*/
private
String
cid
;
/**
* 料架编号
*/
private
String
rfid
;
/**
* 料架架位
*/
private
String
rfidLoc
;
/**
* 锁定的库位
*/
private
String
lockPos
;
/**
* 锁定的库位Id
*/
private
String
lockPosId
;
public
String
getBarcode
()
{
return
barcode
;
}
public
void
setBarcode
(
String
barcode
)
{
this
.
barcode
=
barcode
;
}
public
String
getCid
()
{
return
cid
;
}
public
void
setCid
(
String
cid
)
{
this
.
cid
=
cid
;
}
public
String
getLockPos
()
{
return
lockPos
;
}
public
void
setLockPos
(
String
lockPos
)
{
this
.
lockPos
=
lockPos
;
}
public
String
getLockPosId
()
{
return
lockPosId
;
}
public
void
setLockPosId
(
String
lockPosId
)
{
this
.
lockPosId
=
lockPosId
;
}
public
String
getRfid
()
{
return
rfid
;
}
public
void
setRfid
(
String
rfid
)
{
this
.
rfid
=
rfid
;
}
public
String
getRfidLoc
()
{
return
rfidLoc
;
}
public
void
setRfidLoc
(
String
rfidLoc
)
{
this
.
rfidLoc
=
rfidLoc
;
}
}
myproject/src/main/java/com/myproject/bean/utils/StatusBean.java
查看文件 @
3b3c8ba
...
...
@@ -170,12 +170,19 @@ public class StatusBean {
}
/**
* 获取入库时的RFID信息
* 获取入库时的RFID信息
(料串)
*/
public
String
getInRfid
(){
return
getFromData
(
"rfid"
);
}
/**
* 获取入库时的托盘信息
*/
public
String
getTrayRfid
(){
return
getFromData
(
"trayRfid"
);
}
public
void
setCode
(
String
barcode
){
data
.
put
(
"code"
,
barcode
);
}
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/ITaskService.java
查看文件 @
3b3c8ba
...
...
@@ -81,7 +81,9 @@ public interface ITaskService {
void
addTaskToExecute
(
DataLog
task
);
DataLog
addPutInTaskToExecute
(
Storage
storage
,
Barcode
barcode
,
StoragePos
storagePos
)
throws
ValidateException
;
//DataLog addPutInTaskToExecute(Storage storage, Barcode barcode, StoragePos storagePos) throws ValidateException;
DataLog
addPutInTaskToExecute
(
Storage
storage
,
Barcode
barcode
,
StoragePos
storagePos
,
String
trayRfid
)
throws
ValidateException
;
void
checkoutFinished
(
DataLog
task
)
throws
ValidateException
;
}
myproject/src/main/java/com/myproject/webapp/controller/webService/MainTimer.java
查看文件 @
3b3c8ba
...
...
@@ -55,8 +55,7 @@ public class MainTimer {
qisdaCache
.
initRfidDnMap
();
InquiryShelfBean
.
initShelfMap
();
QisdaCache
.
initApiRequestMap
();
QisdaCache
.
initFromDb
();
outInfoCache
.
loadUnEndOutInfos
();
log
.
info
(
"主定时器开启,60秒后开始执行, 每10s执行一次"
);
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/QisdaCache.java
查看文件 @
3b3c8ba
...
...
@@ -2,8 +2,8 @@ package com.myproject.webapp.controller.webService;
import
com.myproject.bean.qisda.InquiryShelfBean
;
import
com.myproject.bean.qisda.QisdaApiRequest
;
import
com.myproject.bean.qisda.ReelLockPosInfo
;
import
com.myproject.bean.qisda.ShelfInfo
;
import
com.myproject.bean.update.*
;
import
com.myproject.bean.update.qisda.CacheInfo
;
import
com.myproject.bean.update.qisda.DNInfo
;
import
com.myproject.bean.update.qisda.DNItem
;
...
...
@@ -13,6 +13,7 @@ import com.myproject.exception.ApiException;
import
com.myproject.util.HttpHelper
;
import
org.apache.logging.log4j.LogManager
;
import
org.apache.logging.log4j.Logger
;
import
org.apache.logging.log4j.util.Strings
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Repository
;
...
...
@@ -48,6 +49,10 @@ public class QisdaCache {
* 重发消息key
*/
private
static
String
FAILED_REQUEST_MAP_KEY
=
"failedRequestMap"
;
/**
* 料盘锁定库位信息,用于包装料分配到其他料仓
*/
private
static
String
REEL_LOCK_POS_MAP_KEY
=
"reelLocKPosMap"
;
/**
* 当前正在执行的工单需求单(首盘,补料),未完成时,其他工单需求单不可执行
...
...
@@ -64,6 +69,11 @@ public class QisdaCache {
*/
private
static
Map
<
String
,
QisdaApiRequest
>
failedRequestMap
;
/**
* 料盘锁定库位信息,用于包装料分配到其他料仓
*/
private
static
Map
<
String
,
ReelLockPosInfo
>
reelLocKPosMap
;
private
static
boolean
isProcessTimer
=
false
;
/**
* 定时器,每10秒执行一次
...
...
@@ -80,41 +90,72 @@ public class QisdaCache {
}
}
}
/**
*
获取失败列表,进行定时发送
*
从数据库中加载缓存信息
*/
private
static
void
sendFailedRequest
()
throws
ApiException
{
List
<
QisdaApiRequest
>
failedList
=
new
ArrayList
<>();
failedList
.
addAll
(
failedRequestMap
.
values
());
failedList
.
sort
(
new
Comparator
<
QisdaApiRequest
>()
{
@Override
public
int
compare
(
QisdaApiRequest
o1
,
QisdaApiRequest
o2
)
{
return
o1
.
getDate
().
compareTo
(
o2
.
getDate
())
;
public
static
void
initFromDb
(){
initApiRequestMap
();
initReelLockPosMap
();
}
});
for
(
QisdaApiRequest
apiRequest
:
failedList
)
{
log
.
info
(
"重发通知指令["
+
apiRequest
.
getMapKey
()
+
"]到Qisda"
);
String
result
=
HttpHelper
.
postParam
(
apiRequest
.
getUrl
(),
apiRequest
.
getParamMap
());
log
.
info
(
"重发通知指令["
+
apiRequest
.
getMapKey
()
+
"]到Qisda返回:"
+
result
);
QisdaCache
.
removeFailedRequest
(
apiRequest
);
/**
* 添加条码锁定库位信息
* @param reelLockPosInfo
*/
public
static
void
addReelLockPosInfo
(
ReelLockPosInfo
reelLockPosInfo
){
reelLocKPosMap
.
put
(
reelLockPosInfo
.
getBarcode
(),
reelLockPosInfo
);
cacheInfoDao
.
updateCacheItem
(
REEL_LOCK_POS_MAP_KEY
,
reelLocKPosMap
);
}
/**
* 获取料架上料盘锁定的库位信息
* @param rfid
* @return
*/
public
static
List
<
ReelLockPosInfo
>
getShelfLockPosInfo
(
String
rfid
){
List
<
ReelLockPosInfo
>
shelfLocPosInfoList
=
new
ArrayList
<>();
if
(
Strings
.
isNotBlank
(
rfid
)){
for
(
ReelLockPosInfo
reelLockPosInfo
:
reelLocKPosMap
.
values
())
{
if
(
rfid
.
equals
(
reelLockPosInfo
.
getRfid
())){
shelfLocPosInfoList
.
add
(
reelLockPosInfo
);
}
}
}
return
shelfLocPosInfoList
;
}
/**
*
加载请求指令
信息
*
清理条码锁定库位
信息
*/
public
static
void
initApiRequestMap
(){
if
(
failedRequestMap
==
null
){
failedRequestMap
=
new
ConcurrentHashMap
<>();
CacheInfo
cacheInfo
=
cacheInfoDao
.
getCacheInfo
(
FAILED_REQUEST_MAP_KEY
);
if
(
cacheInfo
!=
null
){
Map
<
String
,
QisdaApiRequest
>
dbFailedRequestMap
=
(
Map
<
String
,
QisdaApiRequest
>)
cacheInfo
.
getCacheValue
();
failedRequestMap
.
putAll
(
dbFailedRequestMap
);
log
.
info
(
"当前发送通知失败指令:"
+
failedRequestMap
);
public
static
void
removeReelLockPosInfo
(
String
barcode
){
reelLocKPosMap
.
remove
(
barcode
);
cacheInfoDao
.
updateCacheItem
(
REEL_LOCK_POS_MAP_KEY
,
reelLocKPosMap
);
}
/**
* 获取条码锁定的库位Id
* @param barcode 条码信息
* @return
*/
public
static
String
getReelLockPosId
(
String
barcode
){
ReelLockPosInfo
lockPosInfo
=
reelLocKPosMap
.
get
(
barcode
);
if
(
lockPosInfo
!=
null
){
return
lockPosInfo
.
getLockPosId
();
}
return
""
;
}
/**
* 获取所有锁定的库位Id列表
*/
public
static
Set
<
String
>
getAllLockPosIds
(){
Set
<
String
>
lockPosIds
=
new
HashSet
<>();
for
(
ReelLockPosInfo
reelLockPosInfo
:
reelLocKPosMap
.
values
())
{
lockPosIds
.
add
(
reelLockPosInfo
.
getLockPosId
());
}
return
lockPosIds
;
}
public
static
void
addFailedRequest
(
QisdaApiRequest
apiRequest
){
...
...
@@ -173,9 +214,6 @@ public class QisdaCache {
}
}
private
synchronized
static
void
saveRfidDnMap
(){
cacheInfoDao
.
updateCacheItem
(
RFID_DN_MAP_KEY
,
rfidDnMap
);
}
/**
* 获取RFID绑定的DN单信息
...
...
@@ -255,6 +293,61 @@ public class QisdaCache {
return
currentOrderHSerial
;
}
/**
* 加载请求指令信息
*/
private
static
void
initReelLockPosMap
(){
if
(
reelLocKPosMap
==
null
){
reelLocKPosMap
=
new
ConcurrentHashMap
<>();
CacheInfo
cacheInfo
=
cacheInfoDao
.
getCacheInfo
(
REEL_LOCK_POS_MAP_KEY
);
if
(
cacheInfo
!=
null
){
Map
<
String
,
ReelLockPosInfo
>
locPosMap
=
(
Map
<
String
,
ReelLockPosInfo
>)
cacheInfo
.
getCacheValue
();
reelLocKPosMap
.
putAll
(
locPosMap
);
log
.
info
(
"当前料盘锁定库位信息:"
+
reelLocKPosMap
);
}
}
}
/**
* 加载请求指令信息
*/
private
static
void
initApiRequestMap
(){
if
(
failedRequestMap
==
null
){
failedRequestMap
=
new
ConcurrentHashMap
<>();
CacheInfo
cacheInfo
=
cacheInfoDao
.
getCacheInfo
(
FAILED_REQUEST_MAP_KEY
);
if
(
cacheInfo
!=
null
){
Map
<
String
,
QisdaApiRequest
>
dbFailedRequestMap
=
(
Map
<
String
,
QisdaApiRequest
>)
cacheInfo
.
getCacheValue
();
failedRequestMap
.
putAll
(
dbFailedRequestMap
);
log
.
info
(
"当前发送通知失败指令:"
+
failedRequestMap
);
}
}
}
/**
* 获取失败列表,进行定时发送
*/
private
static
void
sendFailedRequest
()
throws
ApiException
{
List
<
QisdaApiRequest
>
failedList
=
new
ArrayList
<>();
failedList
.
addAll
(
failedRequestMap
.
values
());
failedList
.
sort
(
new
Comparator
<
QisdaApiRequest
>()
{
@Override
public
int
compare
(
QisdaApiRequest
o1
,
QisdaApiRequest
o2
)
{
return
o1
.
getDate
().
compareTo
(
o2
.
getDate
())
;
}
});
for
(
QisdaApiRequest
apiRequest
:
failedList
)
{
log
.
info
(
"重发通知指令["
+
apiRequest
.
getMapKey
()
+
"]到Qisda"
);
String
result
=
HttpHelper
.
postParam
(
apiRequest
.
getUrl
(),
apiRequest
.
getParamMap
());
log
.
info
(
"重发通知指令["
+
apiRequest
.
getMapKey
()
+
"]到Qisda返回:"
+
result
);
QisdaCache
.
removeFailedRequest
(
apiRequest
);
}
}
private
synchronized
static
void
saveRfidDnMap
(){
cacheInfoDao
.
updateCacheItem
(
RFID_DN_MAP_KEY
,
rfidDnMap
);
}
@Autowired
public
void
setCacheInfoDao
(
ICacheInfoDao
cacheInfoDao
)
{
QisdaCache
.
cacheInfoDao
=
cacheInfoDao
;
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/QisdaDeviceController.java
查看文件 @
3b3c8ba
...
...
@@ -73,6 +73,7 @@ public class QisdaDeviceController extends BaseController {
private
DataLog
secondScanTask
=
null
;
/**
* 流水线根据条码及机器人工位获取尺寸信息,同时为料盘锁定架位
*/
...
...
@@ -1014,6 +1015,26 @@ public class QisdaDeviceController extends BaseController {
}
/**
* 获取当前料架中锁定库位的料盘信息
*/
@RequestMapping
(
value
=
"/getShelfLockInfo"
)
@ResponseBody
public
ResultBean
getShelfLockInfo
(
HttpServletRequest
request
){
String
rfid
=
request
.
getParameter
(
"rfid"
);
List
<
ReelLockPosInfo
>
shelfLockInfoList
=
QisdaCache
.
getShelfLockPosInfo
(
rfid
);
ReelLockPosInfo
shelfLockInfo
=
new
ReelLockPosInfo
();
shelfLockInfo
.
setBarcode
(
"S20052301213"
);
shelfLockInfo
.
setCid
(
"packing-20"
);
shelfLockInfo
.
setRfidLoc
(
"3"
);
shelfLockInfo
.
setRfid
(
"A12"
);
shelfLockInfo
.
setLockPosId
(
"1231"
);
shelfLockInfo
.
setLockPos
(
"4D2001AA0006"
);
shelfLockInfoList
.
add
(
shelfLockInfo
);
return
ResultBean
.
newOkResult
(
shelfLockInfoList
);
}
/**
* 包装料仓空闲仓位数量
*/
@RequestMapping
(
value
=
"/emptyStoragePosCount"
)
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/StorageDataController.java
查看文件 @
3b3c8ba
...
...
@@ -7,6 +7,7 @@ import com.google.common.collect.Maps;
import
com.google.common.collect.Sets
;
import
com.myproject.bean.CodeBean
;
import
com.myproject.bean.json.*
;
import
com.myproject.bean.qisda.ReelLockPosInfo
;
import
com.myproject.bean.search.PageList
;
import
com.myproject.bean.update.*
;
import
com.myproject.bean.utils.BoxStatusBean
;
...
...
@@ -545,6 +546,8 @@ public class StorageDataController extends BaseController {
String
code
=
request
.
getParameter
(
"code"
);
String
cids
=
request
.
getParameter
(
"cids"
);
String
rfid
=
request
.
getParameter
(
"rfid"
);
String
rfidLoc
=
request
.
getParameter
(
"rfidLoc"
);
lineMsg
=
""
;
// if(Strings.isNullOrEmpty(cids)){
// cids = "line-ac-11,line-ac-12";
...
...
@@ -579,8 +582,16 @@ public class StorageDataController extends BaseController {
}
else
{
try
{
Barcode
barcode
=
dataCache
.
resolveOneValideBarcode
(
code
);
String
lockPosId
=
QisdaCache
.
getReelLockPosId
(
barcode
.
getBarcode
());
StoragePos
pos
;
if
(!
Strings
.
isNullOrEmpty
(
lockPosId
)){
//已有锁定库位
pos
=
storagePosManager
.
get
(
lockPosId
);
log
.
info
(
"条码["
+
barcode
.
getBarcode
()+
"]已锁定库位["
+
pos
.
getPosName
()+
"],返回锁定中的库位"
);
}
else
{
pos
=
taskService
.
findEmptyPosForPutIn
(
storageList
,
barcode
,
rfid
);
}
StoragePos
pos
=
taskService
.
findEmptyPosForPutIn
(
storageList
,
barcode
,
rfid
);
if
(
pos
!=
null
){
resultMap
.
put
(
"result"
,
"0"
);
resultMap
.
put
(
"msg"
,
""
);
...
...
@@ -588,9 +599,17 @@ public class StorageDataController extends BaseController {
resultMap
.
put
(
"barcode"
,
barcode
.
getBarcode
());
Storage
theStorage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
resultMap
.
put
(
"cid"
,
theStorage
.
getCid
());
okMsg
=
"["
+
rfid
+
"]["
+
barcode
.
getBarcode
()+
"]
准备入库到
["
+
pos
.
getPosName
()+
"]"
;
okMsg
=
"["
+
rfid
+
"]["
+
barcode
.
getBarcode
()+
"]
锁定库位
["
+
pos
.
getPosName
()+
"]"
;
log
.
info
(
okMsg
);
taskService
.
addPutInTaskToExecute
(
theStorage
,
barcode
,
pos
);
ReelLockPosInfo
reelLocInfo
=
new
ReelLockPosInfo
();
reelLocInfo
.
setBarcode
(
barcode
.
getBarcode
());
reelLocInfo
.
setCid
(
theStorage
.
getCid
());
reelLocInfo
.
setLockPos
(
pos
.
getPosName
());
reelLocInfo
.
setLockPosId
(
pos
.
getId
());
reelLocInfo
.
setRfid
(
rfid
);
reelLocInfo
.
setRfidLoc
(
rfidLoc
);
QisdaCache
.
addReelLockPosInfo
(
reelLocInfo
);
//taskService.addPutInTaskToExecute(theStorage, barcode, pos);
}
else
{
resultMap
.
put
(
"result"
,
"104"
);
errorMsg
=
"未找到可用的["
+
barcode
.
getPlateSize
()
+
"x"
+
barcode
.
getHeight
()+
"]仓位"
;
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/TaskService.java
查看文件 @
3b3c8ba
...
...
@@ -56,8 +56,8 @@ public class TaskService implements ITaskService {
@Autowired
private
IBarcodeManager
barcodeManager
;
@Autowired
private
IComponentManager
componentManager
;
//
@Autowired
//
private IComponentManager componentManager;
@Autowired
private
IDataLogDao
dataLogDao
;
...
...
@@ -244,7 +244,7 @@ public class TaskService implements ITaskService {
Barcode
barcodeSave
=
dataCache
.
resolveOneValideBarcode
(
barcode
);
//入库时的RFID
String
inRFID
=
statusBean
.
getInRfid
();
verifyBarcodePutIn
(
Lists
.
<
Storage
>
newArrayList
(
storage
),
barcodeSave
,
inRFID
);
verifyBarcodePutIn
(
Lists
.
newArrayList
(
storage
),
barcodeSave
,
inRFID
);
int
w
=
barcodeSave
.
getPlateSize
();
int
h
=
barcodeSave
.
getHeight
();
...
...
@@ -252,8 +252,6 @@ public class TaskService implements ITaskService {
throw
new
ValidateException
(
"尺寸["
+
w
+
"x"
+
h
+
"]不符"
);
}
StoragePos
storagePos
;
DataLog
executingTask
=
null
;
//如果有正在执行的任务,把库位发过去
...
...
@@ -278,7 +276,7 @@ public class TaskService implements ITaskService {
}
else
{
String
posName
=
statusBean
.
getFromData
(
"inPos"
);
if
(!
Strings
.
isNullOrEmpty
(
posName
)){
log
.
info
(
"指定入库到"
+
posName
);
log
.
info
(
barcodeSave
.
getBarcode
()
+
"指定入库到"
+
posName
);
storagePos
=
storagePosManager
.
getByPosName
(
posName
);
if
(
storagePos
==
null
){
...
...
@@ -296,8 +294,15 @@ public class TaskService implements ITaskService {
}
}
else
{
String
lockPosId
=
QisdaCache
.
getReelLockPosId
(
barcodeSave
.
getBarcode
());
if
(!
Strings
.
isNullOrEmpty
(
lockPosId
)){
//已经有锁定的库位
storagePos
=
storagePosManager
.
get
(
lockPosId
);
log
.
info
(
barcodeSave
.
getBarcode
()
+
"入库时查找到锁定的库位["
+
storagePos
.
getPosName
()+
"]"
);
}
else
{
storagePos
=
findLineEmptyPosForPutIn
(
storage
,
barcodeSave
);
}
}
String
singleIn
=
statusBean
.
getFromData
(
"singleIn"
);
if
(!
Strings
.
isNullOrEmpty
(
singleIn
)){
...
...
@@ -308,8 +313,9 @@ public class TaskService implements ITaskService {
barcodeManager
.
save
(
barcodeSave
);
}
}
addPutInTaskToExecute
(
storage
,
barcodeSave
,
storagePos
);
QisdaCache
.
removeReelLockPosInfo
(
barcodeSave
.
getBarcode
());
String
trayRfid
=
statusBean
.
getTrayRfid
();
addPutInTaskToExecute
(
storage
,
barcodeSave
,
storagePos
,
trayRfid
);
}
...
...
@@ -458,7 +464,7 @@ public class TaskService implements ITaskService {
* @return
*/
@Override
public
StoragePos
findEmptyPosForPutIn
(
List
<
Storage
>
storageList
,
Barcode
barcode
,
String
inRFID
)
throws
ValidateException
{
public
synchronized
StoragePos
findEmptyPosForPutIn
(
List
<
Storage
>
storageList
,
Barcode
barcode
,
String
inRFID
)
throws
ValidateException
{
verifyBarcodePutIn
(
storageList
,
barcode
,
inRFID
);
//如果有正在执行的任务,把库位发过去
...
...
@@ -798,7 +804,9 @@ public class TaskService implements ITaskService {
// }
Collection
<
String
>
operatingPosIds
=
new
HashSet
<>();
Collection
<
String
>
operatingPosIds
=
QisdaCache
.
getAllLockPosIds
();
// Collection<String> operatingPosIds = new HashSet<>();
for
(
DataLog
task
:
allTasks
){
String
posId
=
task
.
getPosId
();
if
(!
Strings
.
isNullOrEmpty
(
posId
)){
...
...
@@ -1321,6 +1329,7 @@ public class TaskService implements ITaskService {
DataLog
task
=
findExecutingTask
(
statusBeanToSave
.
getCid
(),
boxStatus
.
getPosId
(),
StorageConstants
.
OP
.
PUT_IN
);
if
(
task
!=
null
&&
task
.
isPutInTask
())
{
log
.
info
(
task
.
getBarcode
()
+
"入仓位["
+
task
.
getPosName
()
+
"]完成"
);
QisdaCache
.
removeReelLockPosInfo
(
task
.
getBarcode
());
DataLog
cancelTask
=
findFinishedTask
(
statusBeanToSave
.
getCid
(),
boxStatus
.
getPosId
());
if
(
cancelTask
!=
null
&&
cancelTask
.
isCancel
()){
//将相同库位已经取消的任务从完成队列里删除
...
...
@@ -1445,8 +1454,12 @@ public class TaskService implements ITaskService {
}
DataLog
task
=
newTask
(
pos
);
//手动出库的当做是紧急料
//手动出库的当做是紧急料
,放到料串上
task
.
setUrgentReel
(
true
);
AppendInfo
appendInfo
=
task
.
getAppendInfo
();
appendInfo
.
setShelfType
(
StorageConstants
.
SHEFL_TYPE
.
B
);
task
.
setAppendInfo
(
appendInfo
);
task
.
setType
(
StorageConstants
.
OP
.
CHECKOUT
);
task
.
setStatus
(
StorageConstants
.
OP_STATUS
.
WAIT
.
name
());
task
.
setSingleOut
(
isSingleOut
);
...
...
@@ -1632,7 +1645,7 @@ public class TaskService implements ITaskService {
* 加入要执行的任务
*/
@Override
public
synchronized
DataLog
addPutInTaskToExecute
(
Storage
storage
,
Barcode
barcode
,
StoragePos
storagePos
)
throws
ValidateException
{
public
synchronized
DataLog
addPutInTaskToExecute
(
Storage
storage
,
Barcode
barcode
,
StoragePos
storagePos
,
String
trayRfid
)
throws
ValidateException
{
Collection
<
DataLog
>
tasks
=
taskMap
.
values
();
for
(
DataLog
task
:
tasks
)
{
boolean
sameBarcode
=
task
.
getBarcode
().
equals
(
barcode
.
getBarcode
());
...
...
@@ -1662,6 +1675,7 @@ public class TaskService implements ITaskService {
//dataLog.setRelationCodes(barcode.getRelationCodes());
dataLog
.
setType
(
StorageConstants
.
OP
.
PUT_IN
);
dataLog
.
setNum
(
barcode
.
getInitialAmount
());
dataLog
.
setLocInfo
(
trayRfid
);
dataLog
.
setCid
(
storage
.
getCid
());
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论