Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
StencilStorage
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 9597f9f2
由
sunke
编写于
2022-07-15 08:49:57 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
阳光电源出库扫码时不区分料架BUG
1 个父辈
221a18ec
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
35 行增加
和
15 行删除
myproject/src/main/java/com/myproject/webapp/controller/storage/AccShelfController.java
myproject/storageManager.iml
myproject/src/main/java/com/myproject/webapp/controller/storage/AccShelfController.java
查看文件 @
9597f9f
...
@@ -94,7 +94,7 @@ public class AccShelfController extends BaseController {
...
@@ -94,7 +94,7 @@ public class AccShelfController extends BaseController {
if
(
pos
!=
null
){
if
(
pos
!=
null
){
log
.
info
(
pos
.
getBarcode
().
getBarcode
()
+
" 从["
+
pos
.
getPosName
()+
"]出库,点亮对应库位"
);
log
.
info
(
pos
.
getBarcode
().
getBarcode
()
+
" 从["
+
pos
.
getPosName
()+
"]出库,点亮对应库位"
);
int
delayCloseTime
=
30000
;
int
delayCloseTime
=
30000
;
String
color
=
"
blue
"
;
String
color
=
"
green
"
;
openAndCloseLights
(
storage
,
pos
.
getPosName
(),
delayCloseTime
,
color
);
openAndCloseLights
(
storage
,
pos
.
getPosName
(),
delayCloseTime
,
color
);
taskService
.
addTaskToFinished
(
pos
,
null
,
null
);
taskService
.
addTaskToFinished
(
pos
,
null
,
null
);
return
"OK"
+
getText
(
"shelf.msg.outOk"
,
new
String
[]{
pos
.
getPosName
()},
request
.
getLocale
(),
"操作成功,请从库位["
+
pos
.
getPosName
()+
"]中取出物料"
);
return
"OK"
+
getText
(
"shelf.msg.outOk"
,
new
String
[]{
pos
.
getPosName
()},
request
.
getLocale
(),
"操作成功,请从库位["
+
pos
.
getPosName
()+
"]中取出物料"
);
...
@@ -124,6 +124,12 @@ public class AccShelfController extends BaseController {
...
@@ -124,6 +124,12 @@ public class AccShelfController extends BaseController {
Thread
.
sleep
(
delayCloseTime
);
Thread
.
sleep
(
delayCloseTime
);
log
.
info
(
storage
.
getName
()+
"["
+
cid
+
"]库位["
+
posName
+
"]灭灯"
);
log
.
info
(
storage
.
getName
()+
"["
+
cid
+
"]库位["
+
posName
+
"]灭灯"
);
StorageDataController
.
appendOp
(
cid
,
"close"
,
posName
);
StorageDataController
.
appendOp
(
cid
,
"close"
,
posName
);
StoragePos
lastPutinPos
=
lastPutinPosMap
.
get
(
cid
);
if
(
lastPutinPos
!=
null
&&
lastPutinPos
.
getPosName
()
!=
null
){
if
(
lastPutinPos
.
getPosName
().
equals
(
posName
)){
lastPutinPosMap
.
put
(
cid
,
new
StoragePos
());
}
}
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
}
}
...
@@ -147,7 +153,7 @@ public class AccShelfController extends BaseController {
...
@@ -147,7 +153,7 @@ public class AccShelfController extends BaseController {
}
}
List
<
StoragePos
>
allPos
=
storagePosManager
.
findNotEmptyByStorageId
(
storage
.
getId
());
List
<
StoragePos
>
allPos
=
storagePosManager
.
findNotEmptyByStorageId
(
storage
.
getId
());
for
(
StoragePos
pos
:
allPos
)
{
for
(
StoragePos
pos
:
allPos
)
{
opPosLight
(
"open"
,
storage
,
pos
,
"Green"
);
opPosLight
(
"open"
,
storage
.
getCid
()
,
pos
,
"Green"
);
}
}
return
"OK"
+
getText
(
"shelf.msg.opSucess"
,
request
.
getLocale
(),
"操作成功"
);
return
"OK"
+
getText
(
"shelf.msg.opSucess"
,
request
.
getLocale
(),
"操作成功"
);
}
}
...
@@ -164,15 +170,21 @@ public class AccShelfController extends BaseController {
...
@@ -164,15 +170,21 @@ public class AccShelfController extends BaseController {
String
code
=
request
.
getParameter
(
"code"
);
String
code
=
request
.
getParameter
(
"code"
);
StoragePos
lastPutinPos
=
lastPutinPosMap
.
get
(
cid
);
StoragePos
lastPutinPos
=
lastPutinPosMap
.
get
(
cid
);
Storage
storage
=
dataCache
.
getStorage
(
cid
);
Storage
storage
=
dataCache
.
getStorage
(
cid
);
if
(
lastPutinPos
!=
null
){
if
(
lastPutinPos
!=
null
&&
lastPutinPos
.
getPosName
()
!=
null
){
log
.
info
(
"扫码时关闭上一个库位:"
+
lastPutinPos
.
getPosName
());
log
.
info
(
"扫码时关闭上一个库位:"
+
lastPutinPos
.
getPosName
());
opPosLight
(
"close"
,
storage
,
lastPutinPos
,
""
);
opPosLight
(
"close"
,
storage
.
getCid
(),
lastPutinPos
,
""
);
lastPutinPosMap
.
put
(
cid
,
new
StoragePos
());
}
}
CodeBean
codeBean
=
dataCache
.
resolveSingleCode
(
code
);
CodeBean
codeBean
=
dataCache
.
resolveSingleCode
(
code
);
if
(
codeBean
.
isValid
()){
if
(
codeBean
.
isValid
()){
if
(
storage
.
isAccShelf
()){
if
(
storage
.
isAccShelf
()){
Barcode
barcode
=
codeBean
.
getBarcode
();
Barcode
barcode
=
codeBean
.
getBarcode
();
try
{
try
{
if
(
barcode
.
getPlateSize
()
==
1
){
//长宽为1的需要弹框设置尺寸
throw
new
ValidateException
(
"x 料盘未设置尺寸"
);
}
long
now
=
System
.
currentTimeMillis
();
long
now
=
System
.
currentTimeMillis
();
//5秒内同一个条码忽略
//5秒内同一个条码忽略
Date
usedDate
=
barcode
.
getUsedDate
();
Date
usedDate
=
barcode
.
getUsedDate
();
...
@@ -188,35 +200,35 @@ public class AccShelfController extends BaseController {
...
@@ -188,35 +200,35 @@ public class AccShelfController extends BaseController {
for
(
DataLog
task
:
allTasks
)
{
for
(
DataLog
task
:
allTasks
)
{
if
(
task
.
getBarcode
()
!=
null
&&
task
.
getBarcode
().
equals
(
barcode
.
getBarcode
())){
if
(
task
.
getBarcode
()
!=
null
&&
task
.
getBarcode
().
equals
(
barcode
.
getBarcode
())){
taskService
.
addTaskToFinished
(
inPos
,
null
,
null
);
taskService
.
addTaskToFinished
(
inPos
,
null
,
null
);
opPosLight
(
"close"
,
storage
,
inPos
,
null
);
opPosLight
(
"close"
,
task
.
getCid
()
,
inPos
,
null
);
return
"OK"
+
getText
(
"shelf.msg.outConfirm"
,
new
String
[]{
inPos
.
getPosName
()},
request
.
getLocale
(),
"出库完成, 库位["
+
inPos
.
getPosName
()+
"]灭灯"
)
;
return
"OK"
+
"出库完成, 库位["
+
inPos
.
getPosName
()+
"]灭灯"
;
}
}
}
}
return
getText
(
"shelf.msg.noTask"
,
new
String
[]{
inPos
.
getPosName
()},
request
.
getLocale
(),
"操作失败,已在库位["
+
inPos
.
getPosName
()+
"]中,未找到对应的出库任务"
)
;
return
"操作失败,已在库位["
+
inPos
.
getPosName
()+
"]中,未找到对应的出库任务"
;
}
}
List
<
Storage
>
storageList
=
Lists
.
newArrayList
(
storage
);
List
<
Storage
>
storageList
=
Lists
.
newArrayList
(
storage
);
StoragePos
pos
=
taskService
.
findEmptyPosForPutIn
(
storageList
,
barcode
);
StoragePos
pos
=
taskService
.
findEmptyPosForPutIn
(
storageList
,
barcode
);
int
delayCloseTime
=
30000
;
int
delayCloseTime
=
30000
;
String
color
=
"
red
"
;
String
color
=
"
green
"
;
if
(
pos
!=
null
){
if
(
pos
!=
null
){
log
.
info
(
barcode
.
getPartNumber
()+
" [ "
+
barcode
.
getBarcode
()+
" ] "
+
"入库到:"
+
storage
.
getName
()+
"["
+
cid
+
"] "
+
pos
.
getPosName
());
log
.
info
(
barcode
.
getPartNumber
()+
" [ "
+
barcode
.
getBarcode
()+
" ] "
+
"入库到:"
+
storage
.
getName
()+
"["
+
cid
+
"] "
+
pos
.
getPosName
());
taskService
.
addTaskToFinished
(
pos
,
barcode
,
null
);
taskService
.
addTaskToFinished
(
pos
,
barcode
,
null
);
openAndCloseLights
(
storage
,
pos
.
getPosName
(),
delayCloseTime
,
color
);
openAndCloseLights
(
storage
,
pos
.
getPosName
(),
delayCloseTime
,
color
);
lastPutinPosMap
.
put
(
cid
,
pos
);
lastPutinPosMap
.
put
(
cid
,
pos
);
pos
.
setCanCheckOutTime
(
System
.
currentTimeMillis
()
+
delayCloseTime
);
pos
.
setCanCheckOutTime
(
System
.
currentTimeMillis
()
+
delayCloseTime
);
return
"OK"
+
getText
(
"shelf.msg.inOk"
,
new
String
[]{
pos
.
getPosName
()},
request
.
getLocale
(),
"操作成功,请放入库位["
+
pos
.
getPosName
()+
"]"
)
;
return
"OK"
+
"操作成功,请放入库位["
+
pos
.
getPosName
()+
"]"
;
}
else
{
}
else
{
//库位没找到
//库位没找到
String
sizeInfo
=
barcode
.
getPlateSize
()+
" x "
+
barcode
.
getHeight
();
String
sizeInfo
=
barcode
.
getPlateSize
()+
" x "
+
barcode
.
getHeight
();
String
msg
=
"未找到适合["
+
sizeInfo
+
"]的库位"
;
String
msg
=
"未找到适合["
+
sizeInfo
+
"]的库位"
;
log
.
info
(
msg
);
log
.
info
(
msg
);
msg
=
getText
(
"shelf.msg.inError"
,
new
String
[]{
sizeInfo
},
request
.
getLocale
(),
msg
);
//
msg = getText("shelf.msg.inError",new String[]{sizeInfo},request.getLocale(),msg);
return
msg
;
return
msg
;
}
}
}
catch
(
ValidateException
e
)
{
}
catch
(
ValidateException
e
)
{
log
.
error
(
"Error:"
+
e
.
getMessage
());
log
.
error
(
"Error:"
+
e
.
getMessage
());
return
e
.
getMessage
(
);
return
getText
(
e
.
getMessage
(),
request
.
getLocale
(),
e
.
getMessage
()
);
}
}
}
}
}
else
{
}
else
{
...
@@ -248,16 +260,15 @@ public class AccShelfController extends BaseController {
...
@@ -248,16 +260,15 @@ public class AccShelfController extends BaseController {
/**
/**
* 操作库位灯(开灯,或关灯)
* 操作库位灯(开灯,或关灯)
* @param opKey
* @param opKey
* @param storage
* @param pos
* @param pos
* @param colorStr
* @param colorStr
*/
*/
private
void
opPosLight
(
String
opKey
,
St
orage
storage
,
StoragePos
pos
,
String
colorStr
){
private
void
opPosLight
(
String
opKey
,
St
ring
cid
,
StoragePos
pos
,
String
colorStr
){
String
opStr
=
pos
.
getPosName
();
String
opStr
=
pos
.
getPosName
();
if
(!
Strings
.
isNullOrEmpty
(
colorStr
)){
if
(!
Strings
.
isNullOrEmpty
(
colorStr
)){
opStr
=
opStr
+
"="
+
colorStr
;
opStr
=
opStr
+
"="
+
colorStr
;
}
}
StorageDataController
.
appendOp
(
storage
.
getCid
()
,
opKey
,
opStr
);
StorageDataController
.
appendOp
(
cid
,
opKey
,
opStr
);
log
.
info
(
"操作库位["
+
pos
.
getPosName
()+
"]"
+
opKey
+
" : "
+
opStr
);
log
.
info
(
"操作库位["
+
pos
.
getPosName
()+
"]"
+
opKey
+
" : "
+
opStr
);
}
}
...
...
myproject/storageManager.iml
查看文件 @
9597f9f
...
@@ -17,8 +17,17 @@
...
@@ -17,8 +17,17 @@
</sourceRoots>
</sourceRoots>
</configuration>
</configuration>
</facet>
</facet>
<facet
type=
"jpa"
name=
"JPA"
>
<configuration>
<setting
name=
"validation-enabled"
value=
"true"
/>
<setting
name=
"provider-name"
value=
"Hibernate"
/>
<datasource-mapping
/>
<naming-strategy-map
/>
<deploymentDescriptor
name=
"persistence.xml"
url=
"file://$MODULE_DIR$/src/main/resources/META-INF/persistence.xml"
/>
</configuration>
</facet>
</component>
</component>
<component
name=
"NewModuleRootManager"
LANGUAGE_LEVEL=
"JDK_1_7"
inherit-compiler-output=
"false"
>
<component
name=
"NewModuleRootManager"
LANGUAGE_LEVEL=
"JDK_1_7"
>
<output
url=
"file://$MODULE_DIR$/target/classes"
/>
<output
url=
"file://$MODULE_DIR$/target/classes"
/>
<output-test
url=
"file://$MODULE_DIR$/target/test-classes"
/>
<output-test
url=
"file://$MODULE_DIR$/target/test-classes"
/>
<content
url=
"file://$MODULE_DIR$"
>
<content
url=
"file://$MODULE_DIR$"
>
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论