Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
Gree
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 11b40cce
由
sunke
编写于
2020-03-31 15:51:47 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
取消任务时清理占用库位, 第一次传料架时,空闲位置设置为100
1 个父辈
9b70a0d7
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
163 行增加
和
78 行删除
myproject/src/main/java/com/myproject/bean/qisda/InquiryShelfBean.java
myproject/src/main/java/com/myproject/bean/qisda/ShelfInfo.java
myproject/src/main/java/com/myproject/webapp/controller/webService/QisdaApiController.java
myproject/src/main/java/com/myproject/webapp/controller/webService/QisdaDeviceController.java
myproject/src/main/java/com/myproject/webapp/controller/webService/TaskService.java
myproject/src/main/webapp/WEB-INF/pages/qisda/outInfoSearch.jsp
myproject/src/main/java/com/myproject/bean/qisda/InquiryShelfBean.java
查看文件 @
11b40cc
...
...
@@ -301,7 +301,7 @@ public class InquiryShelfBean {
* 根据tempRfid编号获取料架信息
*/
public
ShelfInfo
findSameShelf
(
String
hSerial
,
String
rfid
){
if
(
hSerial
!=
null
){
if
(
hSerial
!=
null
&&
!
hSerial
.
isEmpty
()
){
Map
<
String
,
ShelfInfo
>
shelfMap
=
hSerialShelfMap
.
get
(
hSerial
);
if
(
shelfMap
!=
null
){
for
(
ShelfInfo
shelf
:
shelfMap
.
values
())
{
...
...
@@ -362,7 +362,7 @@ public class InquiryShelfBean {
* @return
*/
public
ShelfInfo
findPackageShelf
(
String
hSerial
,
String
packageRfid
){
if
(
packageRfid
==
null
){
if
(
packageRfid
==
null
||
packageRfid
.
isEmpty
()
){
return
null
;
}
Map
<
String
,
ShelfInfo
>
shSerialShelfInfoMap
=
hSerialShelfMap
.
get
(
hSerial
);
...
...
@@ -514,6 +514,59 @@ public class InquiryShelfBean {
return
null
;
}
/**
* 取消任务,解除料盘对料架的占用
*/
public
static
void
cancelReelTask
(
DataLog
task
){
AppendInfo
appendInfo
=
task
.
getAppendInfo
();
String
barcode
=
task
.
getBarcode
();
String
hSerial
=
appendInfo
.
gethSerial
();
String
taskShelfType
=
appendInfo
.
getShelfType
();
Map
<
String
,
ShelfInfo
>
shelfMap
=
hSerialShelfMap
.
get
(
hSerial
);
if
(
appendInfo
.
isFirstReelAction
()){
//首盘料,解除绑定的位置
if
(
shelfMap
!=
null
){
ShelfInfo
shelfInfo
=
shelfMap
.
get
(
appendInfo
.
getTempRfid
());
if
(
shelfInfo
!=
null
){
boolean
result
=
shelfInfo
.
cancelLimitLoc
(
taskShelfType
,
barcode
);
if
(
result
){
log
.
info
(
"首盘料["
+
task
.
getBarcode
()+
"]任务取消,解除料架"
+
shelfInfo
.
tempRfid
()
+
"锁定架位绑定"
);
updateShelfInfo
(
shelfInfo
);
}
}
}
}
else
if
(
appendInfo
.
isTailAction
()){
//补料盘,解除最后一个料架上的位置
ShelfInfo
maxShelf
=
null
;
for
(
ShelfInfo
shelfInfo
:
shelfMap
.
values
())
{
if
(
shelfInfo
.
getShelfType
().
equals
(
taskShelfType
)){
int
limitLoc
=
shelfInfo
.
getBarcodeLoc
(
barcode
,
taskShelfType
);
if
(
limitLoc
>
0
){
//已经锁定过
boolean
result
=
shelfInfo
.
cancelLimitLoc
(
taskShelfType
,
barcode
);
if
(
result
){
log
.
info
(
"补料盘["
+
task
.
getBarcode
()+
"]任务取消,解除料架"
+
shelfInfo
.
tempRfid
()
+
"的锁定架位绑定"
);
updateShelfInfo
(
shelfInfo
);
}
return
;
}
else
{
if
(
maxShelf
==
null
||
shelfInfo
.
getRfidIndex
()
>
maxShelf
.
getRfidIndex
()){
maxShelf
=
shelfInfo
;
}
}
}
}
if
(
maxShelf
!=
null
){
boolean
result
=
maxShelf
.
cancelLoc
(
appendInfo
.
getShelfType
(),
barcode
);
if
(
result
){
log
.
info
(
"补料盘["
+
task
.
getBarcode
()+
"]任务取消,解除料架"
+
maxShelf
.
tempRfid
()
+
"架位绑定"
);
updateShelfInfo
(
maxShelf
);
}
}
}
}
public
synchronized
boolean
putInShelf
(
DataLog
task
,
String
rfid
,
int
loc
){
AppendInfo
appendInfo
=
task
.
getAppendInfo
();
...
...
myproject/src/main/java/com/myproject/bean/qisda/ShelfInfo.java
查看文件 @
11b40cc
...
...
@@ -211,6 +211,45 @@ public class ShelfInfo {
}
}
/**
* 为补料取消一个库位
*/
public
boolean
cancelLoc
(
String
rfidType
,
String
barcode
){
if
(
rfidType
.
equals
(
this
.
getShelfType
())){
int
usedCount
=
getUsedLocCount
();
for
(
int
i
=
usedCount
;
i
>
0
;
i
--){
ShelfLoc
shelfLoc
=
locMap
.
get
(
i
);
if
(
shelfLoc
!=
null
&&
shelfLoc
.
isEmpty
()
&&
!
shelfLoc
.
isLock
()){
//未放过料,且未锁定
shelfLoc
.
putIn
(
barcode
);
return
true
;
}
}
}
return
false
;
}
/**
* 为首盘料取消一个锁定的库位
*/
public
boolean
cancelLimitLoc
(
String
rfidType
,
String
barcode
){
if
(
rfidType
.
equals
(
this
.
getShelfType
())){
for
(
ShelfLoc
shelfLoc
:
locMap
.
values
())
{
if
(
shelfLoc
.
isInThisLoc
(
barcode
)){
if
(
shelfLoc
.
isEmpty
()){
shelfLoc
.
putIn
(
barcode
);
locMap
.
put
(
shelfLoc
.
getLoc
(),
shelfLoc
);
return
true
;
}
else
{
log
.
error
(
"料盘["
+
barcode
+
"]解除绑定架位失败,此位置料盘已放入"
);
}
}
}
}
return
false
;
}
public
boolean
putInLimitLoc
(
String
rfid
,
int
rfidLoc
,
String
barcode
){
if
(
rfid
.
contains
(
shelfType
)){
//不是同一种料架的忽略
ShelfLoc
shelfLoc
=
locMap
.
get
(
rfidLoc
);
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/QisdaApiController.java
查看文件 @
11b40cc
...
...
@@ -1430,7 +1430,7 @@ public class QisdaApiController extends BaseController {
}
}
return
"需求单任务分配完成,共["
+
outReelNum
+
"]盘任务"
;
return
"需求单
"
+
hSerial
+
"
任务分配完成,共["
+
outReelNum
+
"]盘任务"
;
}
private
DataLog
newTask
(
OutItem
outItem
,
StoragePos
pos
){
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/QisdaDeviceController.java
查看文件 @
11b40cc
...
...
@@ -267,7 +267,7 @@ public class QisdaDeviceController extends BaseController {
}
String
barcode
=
""
;
String
packageLoc
=
""
;
int
packageLoc
=
-
1
;
int
reelInPackage
=
0
;
if
(
packageShelf
==
null
){
log
.
info
(
"机器人[3]获取包装料摆放位置信息,未找到包装料架["
+
packageRfid
+
"]的信息"
);
...
...
@@ -279,7 +279,7 @@ public class QisdaDeviceController extends BaseController {
reelInPackage
=
reelInPackage
+
1
;
if
(
barcode
.
isEmpty
()){
barcode
=
shelfLoc
.
getBarcode
();
packageLoc
=
shelfLoc
.
getLoc
()
+
""
;
packageLoc
=
shelfLoc
.
getLoc
();
}
}
}
...
...
@@ -299,7 +299,7 @@ public class QisdaDeviceController extends BaseController {
//当前大料架上空位数
int
emptyInBig
=
0
;
String
bigLoc
=
""
;
int
bigLoc
=
-
1
;
Map
<
Integer
,
ShelfLoc
>
bigShelfLocMap
=
bigShelf
.
getLocMap
();
for
(
ShelfLoc
shelfLoc
:
bigShelfLocMap
.
values
())
{
...
...
@@ -308,17 +308,17 @@ public class QisdaDeviceController extends BaseController {
emptyInBig
=
emptyInBig
+
1
;
if
(
taskAppendInfo
!=
null
){
//找到了包装料架上物料的任务才能查找位置
if
(
bigLoc
.
isEmpty
()
){
if
(
bigLoc
<=
0
){
if
(
taskAppendInfo
.
isFirstReelAction
()){
//首套料,需要固定位置
if
(
shelfLoc
.
isInThisLoc
(
barcode
)){
bigLoc
=
shelfLoc
.
getLoc
()
+
""
;
bigLoc
=
shelfLoc
.
getLoc
();
}
}
else
{
//尾料,不需要固定位置,返回机器人架位的同时,锁定此位置
bigShelf
.
lockForPackage
(
shelfLoc
,
barcode
);
InquiryShelfBean
.
updateShelfInfo
(
bigShelf
);
bigLoc
=
shelfLoc
.
getLoc
()
+
""
;
bigLoc
=
shelfLoc
.
getLoc
();
}
}
}
...
...
@@ -326,7 +326,7 @@ public class QisdaDeviceController extends BaseController {
}
if
(
packageTask
==
0
){
log
.
info
(
"已无包装料任务,更改料架可放包装料数量"
+
emptyInBig
+
"为0"
);
//
log.info("已无包装料任务,更改料架可放包装料数量"+ emptyInBig + "为0");
//emptyInBig = 0;
}
...
...
@@ -334,10 +334,10 @@ public class QisdaDeviceController extends BaseController {
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"barcode"
,
barcode
);
//大料架上可放包装料数量
resultMap
.
put
(
"emptyInBig"
,
emptyInBig
+
""
);
resultMap
.
put
(
"emptyInBig"
,
emptyInBig
);
//包装料架上剩余的包装料数量(包含当前获取的物料)
resultMap
.
put
(
"reelInPackage"
,
reelInPackage
+
""
);
resultMap
.
put
(
"packageTask"
,
packageTask
+
""
);
resultMap
.
put
(
"reelInPackage"
,
reelInPackage
);
resultMap
.
put
(
"packageTask"
,
packageTask
);
resultMap
.
put
(
"packageRfid"
,
packageRfid
);
resultMap
.
put
(
"packageLoc"
,
packageLoc
);
resultMap
.
put
(
"bigRfid"
,
bigShelf
.
tempRfid
());
...
...
@@ -680,7 +680,7 @@ public class QisdaDeviceController extends BaseController {
if
(!
task
.
isFinished
()
&&
!
task
.
isCancel
()
&&
task
.
isCheckOutTask
()){
totalTaskCount
=
totalTaskCount
+
1
;
if
(
task
.
isPackageReel
()){
if
(
task
.
isCutReel
()){
if
(
task
.
isCutReel
()
||
task
.
isUrgentReel
()
){
cutPackageTask
=
cutPackageTask
+
1
;
}
else
{
packageTask
=
packageTask
+
1
;
...
...
@@ -700,9 +700,7 @@ public class QisdaDeviceController extends BaseController {
int
bigEmpty
=
0
;
int
packageEmpty
=
0
;
if
(
cacheTask
!=
null
){
AppendInfo
appendInfo
=
cacheTask
.
getAppendInfo
();
String
hSerial
=
appendInfo
.
gethSerial
();
String
hSerial
=
outInfoCache
.
getCurrentOrderHSerial
();
ShelfInfo
shelfInfo
=
inquiryShelfBean
.
findSameShelf
(
hSerial
,
rfid
);
if
(
shelfInfo
!=
null
){
Map
<
Integer
,
ShelfLoc
>
locMap
=
shelfInfo
.
getLocMap
();
...
...
@@ -716,22 +714,18 @@ public class QisdaDeviceController extends BaseController {
//包装料架
if
(
StorageConstants
.
SHEFL_TYPE
.
isAShelf
(
shelfInfo
.
getShelfType
())){
packageEmpty
=
packageEmpty
+
1
;
}
else
if
(!
appendInfo
.
isFirstReelAction
())
{
}
else
{
//大料架,并且不是首套料
bigEmpty
=
bigEmpty
+
1
;
}
//首套料,需要按顺序
// if(appendInfo.isFirstReelAction()){
// //packageEmpty = packageEmpty + 1;
// }else{
// //补料盘不需要按顺序,具体还可以放多少,到包装料工位再确定
// bigEmpty = bigEmpty + 1;
// }
}
}
}
}
}
else
{
//没找到料架,小料空位和大料空位都返回100
smallEmpty
=
100
;
bigEmpty
=
100
;
packageEmpty
=
100
;
}
//剩余的任务数
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/TaskService.java
查看文件 @
11b40cc
...
...
@@ -784,11 +784,11 @@ public class TaskService implements ITaskService {
if
(!
Strings
.
isNullOrEmpty
(
barcode
)){
finishedTaskMap
.
put
(
task
.
getBarcode
(),
task
);
}
task
.
setStatus
(
StorageConstants
.
OP_STATUS
.
CANCEL
.
name
());
dataLogDao
.
save
(
task
);
log
.
info
(
"任务["
+
task
.
getId
()
+
"] posName["
+
task
.
getPosName
()+
"] Reel Id["
+
task
.
getBarcode
()+
"]取消成功"
);
finishedOrderTask
(
task
);
InquiryShelfBean
.
cancelReelTask
(
task
);
return
true
;
}
return
false
;
...
...
@@ -806,15 +806,14 @@ public class TaskService implements ITaskService {
//发送取消(发料)指令到佳世达
if
(
task
.
isCheckOutTask
()){
AppendInfo
taskAppendInfo
=
task
.
getAppendInfo
();
if
(
taskAppendInfo
.
isFirstReelAction
()
||
taskAppendInfo
.
isTailAction
()){
Barcode
barcode
=
barcodeManager
.
findByBarcode
(
task
.
getBarcode
());
//if(barcode.needToQisda()){
log
.
info
(
"["
+
task
.
getBarcode
()+
"]任务已出库完成,但未放上小车,发送E状态到佳世达"
);
log
.
info
(
"["
+
task
.
getBarcode
()+
"]任务已出库完成,但未放上小车,发送E状态到佳世达,同时解除料架架位"
);
InquiryShelfBean
.
cancelReelTask
(
task
);
QisdaApiController
.
VMIMateriaRecAss
(
task
,
barcode
,
"E"
);
//}
}
//TODO:如果是首盘料的料架任务,需要填充料架相应的架位,否则料架会卡在那里
}
finishedTaskMap
.
remove
(
task
.
getBarcode
());
}
...
...
@@ -1523,7 +1522,7 @@ public class TaskService implements ITaskService {
task
=
dataLogDao
.
save
(
task
);
Barcode
barcode
=
pos
.
getBarcode
();
//
Barcode barcode = pos.getBarcode();
// if(barcode != null){
// if(barcode.needToQisda()){
// log.info("非测试物料["+barcode.getBarcode()+"]出库" + barcode.getAppendInfo());
...
...
@@ -2032,48 +2031,48 @@ public class TaskService implements ITaskService {
* 更新工单状态信息
*/
private
synchronized
void
finishedOrderTask
(
DataLog
task
){
if
(
StorageConstants
.
OP
.
CHECKOUT
==
task
.
getType
()){
//更新工单状态
String
orderNo
=
task
.
getSourceName
();
if
(!
Strings
.
isNullOrEmpty
(
orderNo
)){
LiteOrder
order
=
liteOrderMap
.
get
(
orderNo
);
if
(
order
==
null
){
log
.
info
(
"缓存中未找到["
+
orderNo
+
"],从数据库中重新加载"
);
order
=
liteOrderDao
.
findWithItemsByOrderNo
(
orderNo
);
}
if
(
order
!=
null
){
//任务是取消的,需要将总待出库数量-1
if
(
task
.
isCancel
()){
order
.
setTaskReelCount
(
order
.
getTaskReelCount
()
-
1
);
log
.
info
(
"工单["
+
orderNo
+
"]的任务"
+
task
.
getPartNumber
()+
"["
+
task
.
getBarcode
()+
"]已取消,任务数-1="
+
order
.
getFinishedReelCount
()
+
"/"
+
order
.
getTaskReelCount
());
}
else
if
(
task
.
isFinished
()){
order
.
setFinishedReelCount
(
order
.
getFinishedReelCount
()
+
1
);
String
orderItemId
=
task
.
getSubSourceId
();
List
<
LiteOrderItem
>
items
=
new
ArrayList
<>();
for
(
LiteOrderItem
liteOrderItem
:
order
.
getOrderItems
())
{
if
(
liteOrderItem
.
getId
().
equals
(
orderItemId
)){
log
.
info
(
"工单["
+
orderNo
+
"]的任务"
+
task
.
getPartNumber
()+
"["
+
task
.
getBarcode
()+
"]出库完成,已完成数量+1="
+
order
.
getFinishedReelCount
()+
"/"
+
order
.
getTaskReelCount
());
//更新对应条目的已出库数量和出库盘数
liteOrderItem
.
setOutNum
(
liteOrderItem
.
getOutNum
()
+
task
.
getNum
());
liteOrderItem
.
setOutReelCount
(
liteOrderItem
.
getOutReelCount
()
+
1
);
liteOrderItem
=
liteOrderItemDao
.
save
(
liteOrderItem
);
}
items
.
add
(
liteOrderItem
);
}
}
else
{
log
.
error
(
"工单["
+
orderNo
+
"]的任务["
+
task
.
getBarcode
()+
"]完成时,状态为:"
+
task
.
getStatus
());
}
if
(
order
.
getFinishedReelCount
()
>=
order
.
getTaskReelCount
()){
log
.
info
(
"工单["
+
orderNo
+
"]的出库任务已完成,共出库:"
+
order
.
getFinishedReelCount
()
+
" 盘"
);
order
.
finishedTasks
();
}
liteOrderDao
.
save
(
order
);
liteOrderMap
.
put
(
orderNo
,
order
);
}
else
{
log
.
error
(
"完成任务时,未找到工单["
+
orderNo
+
"]信息"
);
}
}
}
//
if(StorageConstants.OP.CHECKOUT == task.getType()){
//
//更新工单状态
//
String orderNo = task.getSourceName();
//
if(!Strings.isNullOrEmpty(orderNo)){
//
LiteOrder order = liteOrderMap.get(orderNo);
//
if(order == null){
//
log.info("缓存中未找到["+orderNo+"],从数据库中重新加载");
//
order = liteOrderDao.findWithItemsByOrderNo(orderNo);
//
}
//
if(order != null){
//
//任务是取消的,需要将总待出库数量-1
//
if(task.isCancel()){
//
order.setTaskReelCount(order.getTaskReelCount() -1);
//
log.info("工单["+orderNo+"]的任务"+task.getPartNumber()+"["+task.getBarcode()+"]已取消,任务数-1="+order.getFinishedReelCount() + "/" + order.getTaskReelCount());
//
}else if(task.isFinished()){
//
order.setFinishedReelCount(order.getFinishedReelCount() + 1);
//
String orderItemId = task.getSubSourceId();
//
List<LiteOrderItem> items = new ArrayList<>();
//
for (LiteOrderItem liteOrderItem : order.getOrderItems()) {
//
if(liteOrderItem.getId().equals(orderItemId)){
//
log.info("工单["+orderNo+"]的任务"+task.getPartNumber()+"["+task.getBarcode()+"]出库完成,已完成数量+1="+order.getFinishedReelCount()+"/" + order.getTaskReelCount());
//
//更新对应条目的已出库数量和出库盘数
//
liteOrderItem.setOutNum(liteOrderItem.getOutNum() + task.getNum());
//
liteOrderItem.setOutReelCount(liteOrderItem.getOutReelCount() + 1);
//
liteOrderItem = liteOrderItemDao.save(liteOrderItem);
//
}
//
items.add(liteOrderItem);
//
}
//
}else{
//
log.error("工单["+orderNo+"]的任务["+task.getBarcode()+"]完成时,状态为:"+ task.getStatus());
//
}
//
if(order.getFinishedReelCount() >= order.getTaskReelCount()){
//
log.info("工单["+orderNo+"]的出库任务已完成,共出库:"+ order.getFinishedReelCount() +" 盘");
//
order.finishedTasks();
//
}
//
liteOrderDao.save(order);
//
liteOrderMap.put(orderNo, order);
//
} else{
//
log.error("完成任务时,未找到工单["+orderNo+"]信息");
//
}
//
}
//
}
}
}
...
...
myproject/src/main/webapp/WEB-INF/pages/qisda/outInfoSearch.jsp
查看文件 @
11b40cc
...
...
@@ -74,7 +74,7 @@
</display:column>
<display:column titleKey="checkOut.operate" media="html">
<c:if test="${outInfo.sendStatus != 2}">
<c:if test="${outInfo.sendStatus != 2
&& outInfo.taskNum == 0
}">
<button class="btn yellow" id="btn${outInfo.hSerial}"
onclick="executeOut('${outInfo.hSerial}')">
<i class="fa fa-sign-out"></i><fmt:message key="button.checkout"/></button>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论