Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
Gree
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit b56c7772
由
sunke
编写于
2020-03-04 20:10:19 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
7x12的盘也放入小料架, 库存比对
1 个父辈
c418729a
显示空白字符变更
内嵌
并排
正在显示
14 个修改的文件
包含
290 行增加
和
80 行删除
README.md
myproject/src/main/java/com/myproject/bean/qisda/DiffInfo.java
myproject/src/main/java/com/myproject/bean/qisda/ShelfInfo.java
myproject/src/main/java/com/myproject/bean/update/DataLog.java
myproject/src/main/java/com/myproject/webapp/controller/qisda/DifferentInventoryController.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/StatusController.java
myproject/src/main/java/com/myproject/webapp/controller/webService/StorageDataController.java
myproject/src/main/java/com/myproject/webapp/controller/webService/TaskService.java
myproject/src/main/resources/log4j2.xml
myproject/src/main/webapp/WEB-INF/pages/dataLog/dataLogSearch.jsp
myproject/src/main/webapp/WEB-INF/pages/qisda/diffInventory.jsp
myproject/src/main/webapp/WEB-INF/pages/storage/allBoxView.jsp
README.md
查看文件 @
b56c777
...
@@ -38,7 +38,6 @@ sc delete MongoDB
...
@@ -38,7 +38,6 @@ sc delete MongoDB
mongod --auth -dbpath D:
\M
ongoDB
\d
ata --repair
mongod --auth -dbpath D:
\M
ongoDB
\d
ata --repair
mac mongo 启动:
mac mongo 启动:
sudo mongod -config /usr/local/etc/mongod.conf
sudo mongod -config /usr/local/etc/mongod.conf
...
@@ -87,6 +86,17 @@ IP: 10.85.160.181
...
@@ -87,6 +86,17 @@ IP: 10.85.160.181
>> - msg: 消息
>> - msg: 消息
>> - data: 料盘直径,=7时升起气缸
>> - data: 料盘直径,=7时升起气缸
2.
皮带线获取尺寸后,料盘到达机器人取料位置进调用,如果未扫到码,或者没等到取料位置信号亮,可以不用调用
> 地址:
>>/rest/api/qisda/device/arriveRobotLocation
>
> 参数:
>> - robotIndex=机器人编号,IP为51的机器人为1, 52的机器人为2, 53的机器人为3
>
> 返回:
>>``
2.
料盘流转位置信息更新
2.
料盘流转位置信息更新
>地址:
>地址:
...
...
myproject/src/main/java/com/myproject/bean/qisda/DiffInfo.java
0 → 100644
查看文件 @
b56c777
package
com
.
myproject
.
bean
.
qisda
;
/**
* Created by sunke on 2020/3/3.
*/
public
class
DiffInfo
{
private
String
reelId
;
private
String
facility
;
private
String
location
;
private
String
qty
;
private
String
diffDetails
;
public
String
getFacility
()
{
if
(
facility
==
null
){
return
""
;
}
return
facility
;
}
public
void
setFacility
(
String
facility
)
{
this
.
facility
=
facility
;
}
public
String
getReelId
()
{
return
reelId
;
}
public
void
setReelId
(
String
reelId
)
{
this
.
reelId
=
reelId
;
}
public
String
getLocation
()
{
if
(
location
==
null
){
return
""
;
}
return
location
;
}
public
void
setLocation
(
String
location
)
{
this
.
location
=
location
;
}
public
String
getQty
()
{
if
(
qty
==
null
){
return
""
;
}
return
qty
;
}
public
String
getDiffDetails
()
{
return
diffDetails
;
}
public
void
setDiffDetails
(
String
diffDetails
)
{
this
.
diffDetails
=
diffDetails
;
}
public
void
setQty
(
String
qty
)
{
this
.
qty
=
qty
;
}
public
DiffInfo
sameDiff
(
DiffInfo
another
){
DiffInfo
sameDiff
=
new
DiffInfo
();
sameDiff
.
setReelId
(
reelId
);
String
diffDetails
=
""
;
if
(!
getFacility
().
equals
(
another
.
getFacility
())){
diffDetails
=
"Facility["
+
getFacility
()+
" != "
+
another
.
getFacility
()+
"]"
;
}
if
(!
getQty
().
equals
(
another
.
getQty
())){
diffDetails
=
"Qty["
+
getQty
()+
" != "
+
another
.
getQty
()+
"]"
;
}
if
(!
getLocation
().
equals
(
another
.
getLocation
())){
diffDetails
=
"Location["
+
getLocation
()+
" != "
+
another
.
getLocation
()+
"]"
;
}
if
(!
diffDetails
.
isEmpty
()){
sameDiff
.
setDiffDetails
(
diffDetails
);
return
sameDiff
;
}
return
null
;
}
}
myproject/src/main/java/com/myproject/bean/qisda/ShelfInfo.java
查看文件 @
b56c777
...
@@ -237,9 +237,9 @@ public class ShelfInfo {
...
@@ -237,9 +237,9 @@ public class ShelfInfo {
}
}
}
else
if
(
robotIndex
.
equals
(
"2"
)){
}
else
if
(
robotIndex
.
equals
(
"2"
)){
for
(
int
i
=
1
;
i
<=
usedCount
;
i
++){
for
(
int
i
=
1
;
i
<=
usedCount
;
i
++){
//小料7
1,72,73
位不分配给2号机器人
//小料7
0,71,72
位不分配给2号机器人
if
(
StorageConstants
.
SHEFL_TYPE
.
is
C
Shelf
(
shelfType
)){
if
(
StorageConstants
.
SHEFL_TYPE
.
is
D
Shelf
(
shelfType
)){
if
(
i
==
71
||
i
==
72
||
i
==
73
){
if
(
i
==
70
||
i
==
71
||
i
==
72
){
continue
;
continue
;
}
}
}
}
...
...
myproject/src/main/java/com/myproject/bean/update/DataLog.java
查看文件 @
b56c777
...
@@ -367,7 +367,7 @@ public class DataLog extends BaseMongoBean /*implements Comparable<DataLog>*/ {
...
@@ -367,7 +367,7 @@ public class DataLog extends BaseMongoBean /*implements Comparable<DataLog>*/ {
*/
*/
public
boolean
needReSendToClient
(){
public
boolean
needReSendToClient
(){
if
(
isCheckOutTask
()
&&
isExecuting
()){
if
(
isCheckOutTask
()
&&
isExecuting
()){
return
System
.
currentTimeMillis
()
-
super
.
getUpdateDate
().
getTime
()
>=
3
0
*
1000
;
return
System
.
currentTimeMillis
()
-
super
.
getUpdateDate
().
getTime
()
>=
6
0
*
1000
;
}
}
return
false
;
return
false
;
}
}
...
@@ -512,7 +512,10 @@ public class DataLog extends BaseMongoBean /*implements Comparable<DataLog>*/ {
...
@@ -512,7 +512,10 @@ public class DataLog extends BaseMongoBean /*implements Comparable<DataLog>*/ {
* 是否是小料(7x8)的料
* 是否是小料(7x8)的料
*/
*/
public
boolean
isSmallReel
(){
public
boolean
isSmallReel
(){
return
w
==
7
&&
h
==
8
;
if
(
w
==
7
){
return
h
==
8
||
h
==
12
;
}
return
false
;
}
}
public
boolean
isCutReel
()
{
public
boolean
isCutReel
()
{
...
...
myproject/src/main/java/com/myproject/webapp/controller/qisda/DifferentInventoryController.java
查看文件 @
b56c777
...
@@ -3,9 +3,11 @@ package com.myproject.webapp.controller.qisda;
...
@@ -3,9 +3,11 @@ package com.myproject.webapp.controller.qisda;
import
com.csvreader.CsvReader
;
import
com.csvreader.CsvReader
;
import
com.google.common.base.Strings
;
import
com.google.common.base.Strings
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.myproject.bean.json.LiteOrder
;
import
com.myproject.bean.json.LiteOrder
;
import
com.myproject.bean.json.LiteOrderItem
;
import
com.myproject.bean.json.LiteOrderItem
;
import
com.myproject.bean.qisda.AppendInfo
;
import
com.myproject.bean.qisda.AppendInfo
;
import
com.myproject.bean.qisda.DiffInfo
;
import
com.myproject.bean.update.Barcode
;
import
com.myproject.bean.update.Barcode
;
import
com.myproject.bean.update.StoragePos
;
import
com.myproject.bean.update.StoragePos
;
import
com.myproject.bean.update.qisda.DNInfo
;
import
com.myproject.bean.update.qisda.DNInfo
;
...
@@ -36,6 +38,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
...
@@ -36,6 +38,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
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
;
import
java.util.concurrent.ConcurrentHashMap
;
...
@@ -65,58 +68,85 @@ public class DifferentInventoryController extends BaseController {
...
@@ -65,58 +68,85 @@ public class DifferentInventoryController extends BaseController {
log
.
info
(
"开始比对:"
+
file
);
log
.
info
(
"开始比对:"
+
file
);
List
<
StoragePos
>
posList
=
storagePosManager
.
findNotEmpty
();
List
<
StoragePos
>
posList
=
storagePosManager
.
findNotEmpty
();
List
<
String
>
reelIds
=
new
ArrayList
<>();
Map
<
String
,
DiffInfo
>
neotelReelMap
=
new
HashMap
<>();
for
(
StoragePos
storagePos
:
posList
)
{
for
(
StoragePos
storagePos
:
posList
)
{
reelIds
.
add
(
storagePos
.
getBarcode
().
getBarcode
());
Barcode
barcode
=
storagePos
.
getBarcode
();
DiffInfo
diffInfo
=
new
DiffInfo
();
diffInfo
.
setReelId
(
barcode
.
getBarcode
());
diffInfo
.
setQty
(
barcode
.
getAmount
()
+
""
);
diffInfo
.
setFacility
(
barcode
.
getAppendInfo
().
getFacility
());
diffInfo
.
setLocation
(
storagePos
.
getPosName
());
neotelReelMap
.
put
(
barcode
.
getBarcode
(),
diffInfo
);
}
}
List
<
String
>
qisdaReels
=
readQisda
(
file
);
Map
<
String
,
DiffInfo
>
qisdaReelMap
=
readQisda
(
file
);
List
<
String
>
boxDiff
Reels
=
new
ArrayList
<>();
List
<
DiffInfo
>
neotel
Reels
=
new
ArrayList
<>();
for
(
String
reelId
:
reelIds
)
{
List
<
DiffInfo
>
sameDiffList
=
new
ArrayList
<>();
if
(!
qisdaReels
.
contains
(
reelId
)){
for
(
String
reelId
:
neotelReelMap
.
keySet
())
{
boxDiffReels
.
add
(
reelId
);
DiffInfo
neotelInfo
=
neotelReelMap
.
get
(
reelId
);
DiffInfo
qisdaINfo
=
qisdaReelMap
.
get
(
reelId
);
if
(
qisdaINfo
==
null
){
//挚锦有数据,但佳世达没有
neotelReels
.
add
(
neotelInfo
);
}
else
{
DiffInfo
sameDiff
=
neotelInfo
.
sameDiff
(
qisdaINfo
);
if
(
sameDiff
!=
null
){
//两边都有,但有字段值不一样
sameDiffList
.
add
(
sameDiff
);
}
}
}
}
}
List
<
String
>
qisdaDiffReels
=
new
ArrayList
<>();
List
<
DiffInfo
>
qisdaDiffReels
=
new
ArrayList
<>();
for
(
String
reelId
:
qisdaReel
s
){
for
(
String
reelId
:
qisdaReel
Map
.
keySet
()
){
if
(!
reelIds
.
contains
(
reelId
)){
if
(!
neotelReelMap
.
containsKey
(
reelId
)){
qisdaDiffReels
.
add
(
reelId
);
qisdaDiffReels
.
add
(
qisdaReelMap
.
get
(
reelId
)
);
}
}
}
}
request
.
setAttribute
(
"boxReels"
,
boxDiff
Reels
);
request
.
setAttribute
(
"boxReels"
,
neotel
Reels
);
request
.
setAttribute
(
"qisdaReels"
,
qisdaDiffReels
);
request
.
setAttribute
(
"qisdaReels"
,
qisdaDiffReels
);
request
.
setAttribute
(
"sameDiffList"
,
sameDiffList
);
return
"qisda/diffInventory"
;
return
"qisda/diffInventory"
;
}
}
private
List
<
String
>
readQisda
(
String
filePath
){
private
Map
<
String
,
DiffInfo
>
readQisda
(
String
filePath
){
List
<
String
>
items
=
Lists
.
newArrayList
();
Map
<
String
,
DiffInfo
>
itemMap
=
Maps
.
newHashMap
();
try
{
try
{
CsvReader
csvRead
=
new
CsvReader
(
filePath
);
CsvReader
csvRead
=
new
CsvReader
(
filePath
);
csvRead
.
setSkipEmptyRecords
(
true
);
//忽略空行
csvRead
.
setSkipEmptyRecords
(
true
);
//忽略空行
csvRead
.
setTrimWhitespace
(
true
);
//去除空格
csvRead
.
setTrimWhitespace
(
true
);
//去除空格
csvRead
.
readHeaders
();
csvRead
.
readHeaders
();
int
reelIDIndex
=
csvRead
.
getIndex
(
"ReelID"
);
int
reelIDIndex
=
csvRead
.
getIndex
(
"ReelID"
);
int
facilityIndex
=
csvRead
.
getIndex
(
"Facility"
);
int
locationIndex
=
csvRead
.
getIndex
(
"Location"
);
int
qtyIndex
=
csvRead
.
getIndex
(
"Location"
);
while
(
csvRead
.
readRecord
()){
while
(
csvRead
.
readRecord
()){
String
[]
lineValues
=
csvRead
.
getValues
();
String
[]
lineValues
=
csvRead
.
getValues
();
String
reelId
=
lineValues
[
reelIDIndex
];
String
reelId
=
lineValues
[
reelIDIndex
];
String
facility
=
lineValues
[
facilityIndex
];
String
location
=
lineValues
[
locationIndex
];
String
qty
=
lineValues
[
qtyIndex
];
if
(
reelId
.
isEmpty
()){
if
(
reelId
.
isEmpty
()){
log
.
warn
(
"行[reelId="
+
reelId
+
"]中为空,此行忽略"
);
log
.
warn
(
"行[reelId="
+
reelId
+
"]中为空,此行忽略"
);
}
else
{
}
else
{
DiffInfo
diffInfo
=
new
DiffInfo
();
items
.
add
(
reelId
);
diffInfo
.
setReelId
(
reelId
);
diffInfo
.
setFacility
(
facility
);
diffInfo
.
setLocation
(
location
);
diffInfo
.
setQty
(
qty
);
itemMap
.
put
(
reelId
,
diffInfo
);
}
}
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
log
.
error
(
"读取库存CSV文件["
+
filePath
+
"]出错"
,
e
);
log
.
error
(
"读取库存CSV文件["
+
filePath
+
"]出错"
,
e
);
}
}
return
item
s
;
return
item
Map
;
}
}
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/QisdaApiController.java
查看文件 @
b56c777
...
@@ -1112,11 +1112,13 @@ public class QisdaApiController extends BaseController {
...
@@ -1112,11 +1112,13 @@ public class QisdaApiController extends BaseController {
if
(
dataLog
.
isCheckOutTask
()){
if
(
dataLog
.
isCheckOutTask
()){
//首盘和补料
//首盘和补料
if
(!
outInfo
.
isReelCutAction
()
&&
!
outInfo
.
isUrgentAction
()){
if
(!
outInfo
.
isReelCutAction
()
&&
!
outInfo
.
isUrgentAction
()){
return
"
还有未完成的任务,
完成后才可执行"
;
return
"
全部任务
完成后才可执行"
;
}
else
{
}
else
{
//分盘和紧急料
//分盘和紧急料
AppendInfo
appendInfo
=
dataLog
.
getAppendInfo
();
String
hserial
=
dataLog
.
getAppendInfo
().
gethSerial
();
//if(appendInfo.gethSerial().isEmpty() || hSerial)
if
(
hserial
.
equals
(
hserial
)){
return
"当前需求单还有未完成的任务"
;
}
}
}
}
}
}
}
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/QisdaDeviceController.java
查看文件 @
b56c777
...
@@ -85,13 +85,17 @@ public class QisdaDeviceController extends BaseController {
...
@@ -85,13 +85,17 @@ public class QisdaDeviceController extends BaseController {
try
{
try
{
String
robotIndex
=
request
.
getParameter
(
"robotIndex"
);
String
robotIndex
=
request
.
getParameter
(
"robotIndex"
);
String
barcodeStr
=
request
.
getParameter
(
"barcode"
);
String
barcodeStr
=
request
.
getParameter
(
"barcode"
);
log
.
info
(
"
收到流水线获取料盘尺寸信息请求:robotIndex="
+
robotIndex
+
" barcode="
+
barcodeStr
);
log
.
info
(
"
料盘到达机器人["
+
robotIndex
+
"]扫码位置,开始获取["
+
barcodeStr
+
"]的尺寸信息"
);
if
(
robotIndex
==
null
){
if
(
robotIndex
==
null
){
return
ResultBean
.
newErrorResult
(-
2
,
"参数错误:无robotIndex参数"
);
return
ResultBean
.
newErrorResult
(-
2
,
"参数错误:无robotIndex参数"
);
}
}
if
(!
robotIndex
.
equals
(
"1"
)
&&
!
robotIndex
.
equals
(
"2"
)){
if
(!
robotIndex
.
equals
(
"1"
)
&&
!
robotIndex
.
equals
(
"2"
)){
return
ResultBean
.
newErrorResult
(-
2
,
"参数错误:robotIndex参数只能为1或2"
);
return
ResultBean
.
newErrorResult
(-
2
,
"参数错误:robotIndex参数只能为1或2"
);
}
}
//清空扫码缓存信息
updateScanTask
(
robotIndex
,
null
);
Collection
<
CodeBean
>
codeBeans
=
dataCache
.
resolveCodeStr
(
barcodeStr
);
Collection
<
CodeBean
>
codeBeans
=
dataCache
.
resolveCodeStr
(
barcodeStr
);
Barcode
barcode
=
null
;
Barcode
barcode
=
null
;
for
(
CodeBean
codeBean
:
codeBeans
)
{
for
(
CodeBean
codeBean
:
codeBeans
)
{
...
@@ -101,13 +105,16 @@ public class QisdaDeviceController extends BaseController {
...
@@ -101,13 +105,16 @@ public class QisdaDeviceController extends BaseController {
}
else
{
}
else
{
String
msg
=
"找到多个有效的条码"
;
String
msg
=
"找到多个有效的条码"
;
log
.
error
(
msg
);
log
.
error
(
msg
);
return
ResultBean
.
newErrorResult
(
101
,
msg
);
return
ResultBean
.
newErrorResult
(
101
,
msg
);
}
}
}
}
}
}
if
(
barcode
==
null
){
if
(
barcode
==
null
){
String
msg
=
"未找到有效的条码"
;
String
msg
=
"未找到有效的条码"
;
log
.
error
(
msg
);
log
.
error
(
msg
);
return
ResultBean
.
newErrorResult
(
102
,
msg
);
return
ResultBean
.
newErrorResult
(
102
,
msg
);
}
}
...
@@ -118,22 +125,57 @@ public class QisdaDeviceController extends BaseController {
...
@@ -118,22 +125,57 @@ public class QisdaDeviceController extends BaseController {
if
(
task
==
null
){
if
(
task
==
null
){
String
msg
=
"未找到待分配位置的条码["
+
barcode
.
getBarcode
()+
"]尺寸信息"
;
String
msg
=
"未找到待分配位置的条码["
+
barcode
.
getBarcode
()+
"]尺寸信息"
;
log
.
error
(
msg
);
log
.
error
(
msg
);
return
ResultBean
.
newErrorResult
(
103
,
msg
);
return
ResultBean
.
newErrorResult
(
103
,
msg
);
}
}
updateScanTask
(
robotIndex
,
task
);
log
.
info
(
"返回机器人["
+
robotIndex
+
"]barcode=["
+
task
.
getBarcode
()+
"]的尺寸:"
+
task
.
getW
());
return
ResultBean
.
newOkResult
(
task
.
getW
()
+
""
);
}
catch
(
Exception
e
){
log
.
error
(
"流水线获取尺寸信息出错"
,
e
);
return
ResultBean
.
newErrorResult
(-
1
,
"流水线获取尺寸信息内部错误:"
+
e
.
getMessage
());
}
}
/**
* 更新相机扫码任务
* @param robotIndex
* @param task
*/
private
void
updateScanTask
(
String
robotIndex
,
DataLog
task
){
if
(
robotIndex
!=
null
){
if
(
robotIndex
.
equals
(
"1"
)){
if
(
robotIndex
.
equals
(
"1"
)){
//1号位机器人
//1号位机器人
firstScanTask
=
task
;
firstScanTask
=
task
;
}
else
if
(
robotIndex
.
equals
(
"2"
)){
}
else
if
(
robotIndex
.
equals
(
"2"
)){
secondScanTask
=
task
;
secondScanTask
=
task
;
}
}
log
.
info
(
"返回机器人["
+
robotIndex
+
"]barcode=["
+
task
.
getBarcode
()+
"]的尺寸:"
+
task
.
getW
());
}
return
ResultBean
.
newOkResult
(
task
.
getW
()
+
""
);
}
}
catch
(
Exception
e
){
/**
log
.
error
(
"流水线获取尺寸信息出错"
,
e
);
* 相机扫码获取完尺寸后,料盘到达机器人取料位置
return
ResultBean
.
newErrorResult
(-
1
,
"流水线获取尺寸信息内部错误:"
+
e
.
getMessage
());
*/
@RequestMapping
(
value
=
"/arriveRobotLocation"
)
@ResponseBody
public
Object
arriveRobot
(
HttpServletRequest
request
){
String
robotIndex
=
request
.
getParameter
(
"robotIndex"
);
//更新位置任务,清空扫码任务
log
.
info
(
"料盘到达机器人["
+
robotIndex
+
"]取料位置,更新位置任务,清空扫码任务"
);
if
(
robotIndex
!=
null
){
if
(
robotIndex
.
equals
(
"1"
)){
//1号位机器人
firstRobotTask
=
firstScanTask
;
}
else
if
(
robotIndex
.
equals
(
"2"
)){
secondRobotTask
=
secondScanTask
;
}
updateScanTask
(
robotIndex
,
null
);
}
}
return
""
;
}
}
/**
/**
...
@@ -267,7 +309,7 @@ public class QisdaDeviceController extends BaseController {
...
@@ -267,7 +309,7 @@ public class QisdaDeviceController extends BaseController {
try
{
try
{
String
robotIndex
=
request
.
getParameter
(
"robotIndex"
);
String
robotIndex
=
request
.
getParameter
(
"robotIndex"
);
String
rfid
=
request
.
getParameter
(
"rfid"
);
String
rfid
=
request
.
getParameter
(
"rfid"
);
log
.
info
(
"
收到机器人获取摆放位置信息请求:[robotIndex="
+
robotIndex
+
"]
rfid="
+
rfid
);
log
.
info
(
"
机器人["
+
robotIndex
+
"]获取摆放位置信息请求:
rfid="
+
rfid
);
if
(
robotIndex
==
null
){
if
(
robotIndex
==
null
){
return
ResultBean
.
newErrorResult
(-
2
,
"参数错误:无robotIndex参数"
);
return
ResultBean
.
newErrorResult
(-
2
,
"参数错误:无robotIndex参数"
);
}
}
...
@@ -283,13 +325,9 @@ public class QisdaDeviceController extends BaseController {
...
@@ -283,13 +325,9 @@ public class QisdaDeviceController extends BaseController {
if
(
robotIndex
!=
null
){
if
(
robotIndex
!=
null
){
if
(
robotIndex
.
equals
(
"1"
)){
if
(
robotIndex
.
equals
(
"1"
)){
//1号位机器人
//1号位机器人
firstRobotTask
=
firstScanTask
;
task
=
firstRobotTask
;
task
=
firstRobotTask
;
firstScanTask
=
null
;
}
else
if
(
robotIndex
.
equals
(
"2"
)){
}
else
if
(
robotIndex
.
equals
(
"2"
)){
secondRobotTask
=
secondScanTask
;
task
=
secondRobotTask
;
task
=
secondRobotTask
;
secondScanTask
=
null
;
}
}
}
}
...
@@ -330,7 +368,7 @@ public class QisdaDeviceController extends BaseController {
...
@@ -330,7 +368,7 @@ public class QisdaDeviceController extends BaseController {
resultMap
.
put
(
"rfid"
,
shelfLoc
.
getRfid
());
resultMap
.
put
(
"rfid"
,
shelfLoc
.
getRfid
());
resultMap
.
put
(
"rfidLoc"
,
shelfLoc
.
getLoc
()
+
""
);
resultMap
.
put
(
"rfidLoc"
,
shelfLoc
.
getLoc
()
+
""
);
log
.
info
(
"机器人
位置信息返回:[robotIndex="
+
robotIndex
+
"]
rfid="
+
shelfLoc
.
getRfid
()
+
"["
+
shelfLoc
.
getLoc
()+
"] barcode=["
+
task
.
getBarcode
()+
"]尺寸"
+
task
.
getW
()+
"x"
+
task
.
getH
());
log
.
info
(
"机器人
["
+
robotIndex
+
"]位置信息返回:[
rfid="
+
shelfLoc
.
getRfid
()
+
"["
+
shelfLoc
.
getLoc
()+
"] barcode=["
+
task
.
getBarcode
()+
"]尺寸"
+
task
.
getW
()+
"x"
+
task
.
getH
());
return
ResultBean
.
newOkResult
(
resultMap
);
return
ResultBean
.
newOkResult
(
resultMap
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
...
@@ -473,22 +511,34 @@ public class QisdaDeviceController extends BaseController {
...
@@ -473,22 +511,34 @@ public class QisdaDeviceController extends BaseController {
String
rfidLoc
=
request
.
getParameter
(
"rfidLoc"
);
String
rfidLoc
=
request
.
getParameter
(
"rfidLoc"
);
String
barcode
=
request
.
getParameter
(
"barcode"
);
String
barcode
=
request
.
getParameter
(
"barcode"
);
if
(
Strings
.
isNotBlank
(
robotIndex
)){
log
.
info
(
"机器人["
+
robotIndex
+
"]将料盘["
+
barcode
+
"]放入料架["
+
rfid
+
"]["
+
rfidLoc
+
"]完成"
);
if
(
robotIndex
.
equals
(
"1"
)){
//1号位机器人
firstRobotTask
=
null
;
}
else
if
(
robotIndex
.
equals
(
"2"
)){
secondRobotTask
=
null
;
}
}
DataLog
cacheTask
=
null
;
DataLog
cacheTask
=
null
;
if
(
Strings
.
isNotBlank
(
barcode
))
{
if
(
Strings
.
isNotBlank
(
barcode
))
{
cacheTask
=
taskService
.
getFinishedTask
(
barcode
);
cacheTask
=
taskService
.
getFinishedTask
(
barcode
);
if
(
cacheTask
==
null
)
{
if
(
cacheTask
==
null
)
{
log
.
error
(
"料盘["
+
barcode
+
"]的任务不存在"
);
log
.
error
(
"料盘["
+
barcode
+
"]的任务不存在"
);
}
else
{
}
else
{
if
(
Strings
.
isNotBlank
(
robotIndex
)){
if
(
robotIndex
.
equals
(
"1"
)
&&
firstRobotTask
!=
null
){
if
(
firstRobotTask
.
getBarcode
().
equals
(
barcode
)){
log
.
info
(
"机器人["
+
robotIndex
+
"]将料盘["
+
barcode
+
"]放入料架["
+
rfid
+
"]["
+
rfidLoc
+
"]完成,任务一致,清空机器人任务"
);
//1号位机器人
firstRobotTask
=
null
;
}
else
{
log
.
info
(
"机器人["
+
robotIndex
+
"]将料盘["
+
barcode
+
"]放入料架["
+
rfid
+
"]["
+
rfidLoc
+
"]完成,与当前任务["
+
firstScanTask
.
getBarcode
()+
"]不一致,不清空"
);
}
}
else
if
(
robotIndex
.
equals
(
"2"
)
&&
secondRobotTask
!=
null
){
if
(
secondRobotTask
.
getBarcode
().
equals
(
barcode
)){
//1号位机器人
log
.
info
(
"机器人["
+
robotIndex
+
"]将料盘["
+
barcode
+
"]放入料架["
+
rfid
+
"]["
+
rfidLoc
+
"]完成,任务一致,清空机器人任务"
);
secondRobotTask
=
null
;
}
else
{
log
.
info
(
"机器人["
+
robotIndex
+
"]将料盘["
+
barcode
+
"]放入料架["
+
rfid
+
"]["
+
rfidLoc
+
"]完成,与当前任务["
+
firstScanTask
.
getBarcode
()+
"]不一致,不清空"
);
}
}
}
reelPutInFinished
(
cacheTask
,
rfid
,
rfidLoc
);
reelPutInFinished
(
cacheTask
,
rfid
,
rfidLoc
);
}
}
}
}
...
@@ -576,7 +626,7 @@ public class QisdaDeviceController extends BaseController {
...
@@ -576,7 +626,7 @@ public class QisdaDeviceController extends BaseController {
return
ResultBean
.
newOkResult
(
resultMap
);
return
ResultBean
.
newOkResult
(
resultMap
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
log
.
error
(
"
上传摆放位置
信息出错"
,
e
);
log
.
error
(
"
机器人放料完成
信息出错"
,
e
);
}
}
return
""
;
return
""
;
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/StatusController.java
查看文件 @
b56c777
...
@@ -65,6 +65,9 @@ public class StatusController extends BaseController{
...
@@ -65,6 +65,9 @@ public class StatusController extends BaseController{
}
}
List
<
StatusBean
>
statusList
=
Lists
.
newArrayList
();
List
<
StatusBean
>
statusList
=
Lists
.
newArrayList
();
for
(
String
cid
:
cidList
)
{
for
(
String
cid
:
cidList
)
{
if
(
cid
.
isEmpty
()){
continue
;
}
StatusBean
statusBean
=
taskService
.
getStatus
(
cid
);
StatusBean
statusBean
=
taskService
.
getStatus
(
cid
);
if
(!
Strings
.
isNullOrEmpty
(
statusBean
.
getMsgCode
())){
if
(!
Strings
.
isNullOrEmpty
(
statusBean
.
getMsgCode
())){
String
localeMsg
=
getText
(
"client."
+
statusBean
.
getMsgCode
(),
statusBean
.
getMsgParam
(),
request
.
getLocale
(),
statusBean
.
msg
);
String
localeMsg
=
getText
(
"client."
+
statusBean
.
getMsgCode
(),
statusBean
.
getMsgParam
(),
request
.
getLocale
(),
statusBean
.
msg
);
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/StorageDataController.java
查看文件 @
b56c777
...
@@ -552,6 +552,7 @@ public class StorageDataController extends BaseController {
...
@@ -552,6 +552,7 @@ public class StorageDataController extends BaseController {
log
.
info
(
"流水线["
+
cids
+
"]获取["
+
rfid
+
"]["
+
code
+
"]的入库库位"
);
log
.
info
(
"流水线["
+
cids
+
"]获取["
+
rfid
+
"]["
+
code
+
"]的入库库位"
);
Map
<
String
,
Object
>
resultMap
=
Maps
.
newHashMap
();
Map
<
String
,
Object
>
resultMap
=
Maps
.
newHashMap
();
String
okMsg
=
""
;
String
okMsg
=
""
;
String
errorMsg
=
""
;
if
(
Strings
.
isNullOrEmpty
(
cids
)){
if
(
Strings
.
isNullOrEmpty
(
cids
)){
resultMap
.
put
(
"result"
,
"101"
);
resultMap
.
put
(
"result"
,
"101"
);
resultMap
.
put
(
"msg"
,
"未指定料仓 cids "
);
resultMap
.
put
(
"msg"
,
"未指定料仓 cids "
);
...
@@ -565,8 +566,8 @@ public class StorageDataController extends BaseController {
...
@@ -565,8 +566,8 @@ public class StorageDataController extends BaseController {
}
}
if
(
storageList
.
isEmpty
()){
if
(
storageList
.
isEmpty
()){
resultMap
.
put
(
"result"
,
"102"
);
resultMap
.
put
(
"result"
,
"102"
);
line
Msg
=
"无可用的料仓"
;
error
Msg
=
"无可用的料仓"
;
resultMap
.
put
(
"msg"
,
line
Msg
);
resultMap
.
put
(
"msg"
,
error
Msg
);
}
else
{
}
else
{
Collection
<
CodeBean
>
codeBeans
=
dataCache
.
resolveCodeStr
(
code
);
Collection
<
CodeBean
>
codeBeans
=
dataCache
.
resolveCodeStr
(
code
);
Barcode
barcode
=
null
;
Barcode
barcode
=
null
;
...
@@ -578,8 +579,8 @@ public class StorageDataController extends BaseController {
...
@@ -578,8 +579,8 @@ public class StorageDataController extends BaseController {
}
}
if
(
barcode
==
null
){
if
(
barcode
==
null
){
resultMap
.
put
(
"result"
,
"103"
);
resultMap
.
put
(
"result"
,
"103"
);
line
Msg
=
"条码["
+
code
+
"]无效"
;
error
Msg
=
"条码["
+
code
+
"]无效"
;
resultMap
.
put
(
"msg"
,
line
Msg
);
resultMap
.
put
(
"msg"
,
error
Msg
);
}
else
{
}
else
{
StoragePos
pos
=
null
;
StoragePos
pos
=
null
;
try
{
try
{
...
@@ -599,32 +600,34 @@ public class StorageDataController extends BaseController {
...
@@ -599,32 +600,34 @@ public class StorageDataController extends BaseController {
taskService
.
addPutInTaskToExecute
(
theStorage
,
barcode
,
pos
);
taskService
.
addPutInTaskToExecute
(
theStorage
,
barcode
,
pos
);
}
else
{
}
else
{
resultMap
.
put
(
"result"
,
"104"
);
resultMap
.
put
(
"result"
,
"104"
);
line
Msg
=
"未找到可用的仓位"
;
error
Msg
=
"未找到可用的仓位"
;
resultMap
.
put
(
"msg"
,
line
Msg
);
resultMap
.
put
(
"msg"
,
error
Msg
);
}
}
}
catch
(
ValidateException
e
)
{
}
catch
(
ValidateException
e
)
{
line
Msg
=
e
.
getMessage
();
error
Msg
=
e
.
getMessage
();
log
.
info
(
"查找空库位失败:"
+
line
Msg
);
log
.
info
(
"查找空库位失败:"
+
error
Msg
);
resultMap
.
put
(
"result"
,
"105"
);
resultMap
.
put
(
"result"
,
"105"
);
resultMap
.
put
(
"msg"
,
line
Msg
);
resultMap
.
put
(
"msg"
,
error
Msg
);
}
}
}
}
}
}
}
}
if
(!
lineMsg
.
isEmpty
()){
//没入成功
if
(!
errorMsg
.
isEmpty
()){
//有错误,记录日志
//有错误,记录日志
AlarmInfo
alarmInfo
=
new
AlarmInfo
();
AlarmInfo
alarmInfo
=
new
AlarmInfo
();
alarmInfo
.
setBoxId
(
"0"
);
alarmInfo
.
setBoxId
(
"0"
);
alarmInfo
.
setStorageName
(
"流水线"
);
alarmInfo
.
setStorageName
(
"流水线"
);
alarmInfo
.
setInOutStatus
(
"1"
);
alarmInfo
.
setInOutStatus
(
"1"
);
alarmInfo
.
setAlarmType
(
"入库
失败
"
);
alarmInfo
.
setAlarmType
(
"入库"
);
Date
date
=
new
Date
();
Date
date
=
new
Date
();
alarmInfo
.
setStartTime
(
date
);
alarmInfo
.
setStartTime
(
date
);
alarmInfo
.
setEndTime
(
date
);
alarmInfo
.
setEndTime
(
date
);
String
msg
=
"["
+
code
+
"]"
+
lineMsg
;
String
msg
=
"["
+
code
+
"]"
+
lineMsg
;
alarmInfo
.
setAlarmMsg
(
msg
);
alarmInfo
.
setAlarmMsg
(
msg
);
alarmInfoDao
.
save
(
alarmInfo
);
alarmInfoDao
.
save
(
alarmInfo
);
lineMsg
=
errorMsg
;
}
else
{
}
else
{
lineMsg
=
okMsg
;
lineMsg
=
okMsg
;
}
}
...
@@ -684,7 +687,7 @@ public class StorageDataController extends BaseController {
...
@@ -684,7 +687,7 @@ public class StorageDataController extends BaseController {
for
(
String
cid
:
cidList
)
{
for
(
String
cid
:
cidList
)
{
Storage
storage
=
dataCache
.
getStorage
(
cid
);
Storage
storage
=
dataCache
.
getStorage
(
cid
);
if
(
storage
==
null
){
if
(
storage
==
null
){
return
null
;
continue
;
}
}
String
storageId
=
storage
.
getId
();
String
storageId
=
storage
.
getId
();
List
<
PlateSizeBean
>
usage
=
storagePosManager
.
getStoragePosUsage
(
storageId
);
List
<
PlateSizeBean
>
usage
=
storagePosManager
.
getStoragePosUsage
(
storageId
);
...
...
myproject/src/main/java/com/myproject/webapp/controller/webService/TaskService.java
查看文件 @
b56c777
...
@@ -860,7 +860,7 @@ public class TaskService implements ITaskService {
...
@@ -860,7 +860,7 @@ public class TaskService implements ITaskService {
//log.error("cid["+cid + "]box["+boxId+"]已有入库任务,不可再分配出库任务");
//log.error("cid["+cid + "]box["+boxId+"]已有入库任务,不可再分配出库任务");
return
null
;
return
null
;
}
else
if
(
task
.
needReSendToClient
()){
//超过30秒仍未完成的出库再次发送到客户端
}
else
if
(
task
.
needReSendToClient
()){
//超过30秒仍未完成的出库再次发送到客户端
log
.
error
(
"cid["
+
cid
+
"]的出库任务["
+
task
.
getPosName
()+
"]超过
3
0秒仍未完成,重新发送到客户端!"
);
log
.
error
(
"cid["
+
cid
+
"]的出库任务["
+
task
.
getPosName
()+
"]超过
6
0秒仍未完成,重新发送到客户端!"
);
task
.
setUpdateDate
(
new
Date
());
task
.
setUpdateDate
(
new
Date
());
return
task
;
return
task
;
}
}
...
...
myproject/src/main/resources/log4j2.xml
查看文件 @
b56c777
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
<PatternLayout
pattern=
"%d{yyyy-MM-dd HH:mm:ss} %-5level [%file:%line] - %msg%n"
/>
<PatternLayout
pattern=
"%d{yyyy-MM-dd HH:mm:ss} %-5level [%file:%line] - %msg%n"
/>
</Console>
</Console>
<RollingFile
name=
"log"
fileName=
"${LOG_HOME}/${LOG_NAME}"
filePattern=
"${LOG_HOME}/${LOG_NAME}.%d{yyyy-MM-dd}"
append=
"true"
>
<RollingFile
name=
"log"
fileName=
"${LOG_HOME}/${LOG_NAME}"
filePattern=
"${LOG_HOME}/${LOG_NAME}.%d{yyyy-MM-dd}"
append=
"true"
>
<PatternLayout
charset=
"GB18030"
pattern=
"%d{yyyy-MM-dd HH:mm:ss} %-5level [%file:%line] - %msg%n"
/>
<PatternLayout
charset=
"GB18030"
pattern=
"%d{yyyy-MM-dd HH:mm:ss
.SSS
} %-5level [%file:%line] - %msg%n"
/>
<Policies>
<Policies>
<TimeBasedTriggeringPolicy
modulate=
"true"
interval=
"1"
/>
<TimeBasedTriggeringPolicy
modulate=
"true"
interval=
"1"
/>
</Policies>
</Policies>
...
...
myproject/src/main/webapp/WEB-INF/pages/dataLog/dataLogSearch.jsp
查看文件 @
b56c777
...
@@ -165,7 +165,7 @@
...
@@ -165,7 +165,7 @@
<%--</display:column>--%>
<%--</display:column>--%>
<%--<display:column titleKey="dataLog.batch" sortable="true" sortProperty="batchInfo" property="batchInfo"/>--%>
<%--<display:column titleKey="dataLog.batch" sortable="true" sortProperty="batchInfo" property="batchInfo"/>--%>
<%--<display:column property="operator" titleKey="dataLog.operator" sortable="true" sortProperty="operator"/>--%>
<%--<display:column property="operator" titleKey="dataLog.operator" sortable="true" sortProperty="operator"/>--%>
<display:column titleKey="dataLog.date" sortable="true" sortProperty="
cre
ateDate">
<display:column titleKey="dataLog.date" sortable="true" sortProperty="
upd
ateDate">
<fmt:formatDate value="${dataLog.createDate}" pattern="yyyy-MM-dd HH:mm"/>
<fmt:formatDate value="${dataLog.createDate}" pattern="yyyy-MM-dd HH:mm"/>
</display:column>
</display:column>
...
@@ -201,7 +201,7 @@
...
@@ -201,7 +201,7 @@
rtl: Metronic.isRTL(),
rtl: Metronic.isRTL(),
orientation: "left",
orientation: "left",
autoclose: true,
autoclose: true,
language:'zh-CN'
//
language:'zh-CN'
});
});
});
});
...
...
myproject/src/main/webapp/WEB-INF/pages/qisda/diffInventory.jsp
查看文件 @
b56c777
...
@@ -40,6 +40,7 @@
...
@@ -40,6 +40,7 @@
<tr role="row">
<tr role="row">
<th></th>
<th></th>
<th><fmt:message key="挚锦"/> (${fn:length(boxReels)})</th>
<th><fmt:message key="挚锦"/> (${fn:length(boxReels)})</th>
<th><fmt:message key="值不同"/>(${fn:length(sameDiffList)})</th>
<th><fmt:message key="佳世达"/>(${fn:length(qisdaReels)})</th>
<th><fmt:message key="佳世达"/>(${fn:length(qisdaReels)})</th>
<%--<th><fmt:message key="Facility"/></th>--%>
<%--<th><fmt:message key="Facility"/></th>--%>
<%--<th><fmt:message key="Company"/></th>--%>
<%--<th><fmt:message key="Company"/></th>--%>
...
@@ -52,20 +53,33 @@
...
@@ -52,20 +53,33 @@
</thead>
</thead>
<tbody class="dataTableBody">
<tbody class="dataTableBody">
<c:set var="i" value="0"/>
<c:set var="i" value="0"/>
<c:forEach items="${
boxReels}" var="reel
">
<c:forEach items="${
sameDiffList}" var="diffInfo
">
<c:set var="i" value="${i+1}"/>
<c:set var="i" value="${i+1}"/>
<tr>
<tr>
<td>${i}</td>
<td>${i}</td>
<td><a href="${ctx}/component/storagePosFind.html?barcode=${reel}" target="_blank">${reel}</a></td>
<td></td>
<td></td>
<td><a href="${ctx}/component/storagePosFind.html?barcode=${diffInfo.reelId}" target="_blank">${diffInfo.reelId} (${diffInfo.diffDetails})</a></td>
<td></td>
</tr>
</tr>
</c:forEach>
</c:forEach>
<c:forEach items="${qisdaReels}" var="qisdareel">
<c:forEach items="${boxReels}" var="diffInfo">
<c:set var="i" value="${i+1}"/>
<c:set var="i" value="${i+1}"/>
<tr>
<tr>
<td>${i}</td>
<td>${i}</td>
<td><a href="${ctx}/component/storagePosFind.html?barcode=${diffInfo.reelId}" target="_blank">${diffInfo.reelId}</a></td>
<td></td>
<td></td>
</tr>
</c:forEach>
<c:forEach items="${qisdaReels}" var="diffInfo">
<c:set var="i" value="${i+1}"/>
<tr>
<td>${i}</td>
<td></td>
<td></td>
<td></td>
<td>${
qisdareel
}</td>
<td>${
diffInfo.reelId
}</td>
</tr>
</tr>
</c:forEach>
</c:forEach>
</tbody>
</tbody>
...
...
myproject/src/main/webapp/WEB-INF/pages/storage/allBoxView.jsp
查看文件 @
b56c777
...
@@ -761,16 +761,13 @@
...
@@ -761,16 +761,13 @@
}
}
//刷新库存情况
function flushUsageItem(){
function flushUsageItem(){
$.post("${ctx}/service/store/listStorageUseage", {}, function (dataMap) {
$.post("${ctx}/service/store/listStorageUseage", {cids:"${cids}"}, function (dataMap) {
var maxItemCount = 0;
for(var cid in dataMap){
for(var cid in dataMap){
var data = dataMap[cid];
var data = dataMap[cid];
var itemCount = 0;
var sizeData = {};
var sizeData = {};
for(var i in data){
for(var i in data){
itemCount = itemCount + 1;
var itemData = data[i];
var itemData = data[i];
var sizeItem = sizeData[itemData.sizeStr];
var sizeItem = sizeData[itemData.sizeStr];
if(!sizeItem){
if(!sizeItem){
...
@@ -787,9 +784,6 @@
...
@@ -787,9 +784,6 @@
}
}
sizeData[itemData.sizeStr] = sizeItem;
sizeData[itemData.sizeStr] = sizeItem;
}
}
if(itemCount > maxItemCount){
maxItemCount = itemCount;
}
var sizeList = new Array();
var sizeList = new Array();
for(var sizeStr in sizeData){
for(var sizeStr in sizeData){
...
@@ -800,16 +794,14 @@
...
@@ -800,16 +794,14 @@
sizeList.sort(function(a,b){
sizeList.sort(function(a,b){
var w1 = a.w,w2 = b.w;
var w1 = a.w,w2 = b.w;
if(w1 === w2){
if(w1 === w2){
return
b.h - a
.h;
return
a.h - b
.h;
}
}
return w1 - w2;
return w1 - w2;
});
});
var totalCount = 0;
for(var i in sizeList){
for(var i in sizeList){
var sizeItem = sizeList[i];
var sizeItem = sizeList[i];
var sizeStr = sizeItem.w + "x" + sizeItem.h;
var sizeStr = sizeItem.w + "x" + sizeItem.h;
totalCount = totalCount + sizeItem["usedCount"] + sizeItem["idleCount"];
var html = getItemBar(sizeItem["w"],sizeItem["h"],sizeItem["usedCount"],sizeItem["idleCount"]);
var html = getItemBar(sizeItem["w"],sizeItem["h"],sizeItem["usedCount"],sizeItem["idleCount"]);
var sizeDom = $("#"+cid+" ."+sizeStr);
var sizeDom = $("#"+cid+" ."+sizeStr);
...
@@ -821,7 +813,23 @@
...
@@ -821,7 +813,23 @@
}
}
}
}
$(".task-content").attr("style","height:"+maxItemCount*34+"px;");
var allContent = $(".task-content");
allContent.each(function(index){
if(index % 2 == 1){
var height = $(this).attr("style");
if(height){
return;
}
var itemCount = $(this).children(".itembox").size();
var lastContent = allContent.eq(index -1);
var lastItemCount = lastContent.children(".itembox").size();
if(itemCount < lastItemCount){
itemCount = lastItemCount;
}
$(this).attr("style","height:"+itemCount*34+"px;");
lastContent.attr("style","height:"+itemCount*34+"px;");
}
});
});
});
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论