Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 2f07434e
由
孙克
编写于
2024-05-08 17:29:37 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
原材料仓料箱出入库时不更新storagePos的Barcode字段, 通过status字段来区分是否在库
1 个父辈
802303cc
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
22 行增加
和
19 行删除
src/main/java/com/neotel/smfcore/core/barcode/bean/BarcodeRule.java
src/main/java/com/neotel/smfcore/core/barcode/service/po/Barcode.java
src/main/java/com/neotel/smfcore/core/barcode/utils/CodeResolve.java
src/main/java/com/neotel/smfcore/core/language/util/MessageUtils.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/CDeviceController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/util/BoxHandleUtil.java
src/main/java/com/neotel/smfcore/core/barcode/bean/BarcodeRule.java
查看文件 @
2f07434
...
@@ -465,7 +465,7 @@ public class BarcodeRule {
...
@@ -465,7 +465,7 @@ public class BarcodeRule {
}
}
public
CodeBean
toCodeBean
(
String
codeStr
){
public
CodeBean
toCodeBean
(
String
codeStr
){
log
.
info
(
"开始解析条码["
+
codeStr
+
"]"
);
log
.
debug
(
"开始解析条码["
+
codeStr
+
"]"
);
CodeBean
codeBean
=
new
CodeBean
();
CodeBean
codeBean
=
new
CodeBean
();
codeBean
.
setCodeStr
(
codeStr
);
codeBean
.
setCodeStr
(
codeStr
);
//是否带有位置信息
//是否带有位置信息
...
@@ -523,7 +523,7 @@ public class BarcodeRule {
...
@@ -523,7 +523,7 @@ public class BarcodeRule {
codeArr
=
codeStr
.
split
(
separator
,-
1
);
codeArr
=
codeStr
.
split
(
separator
,-
1
);
//条码与规则长度对应不上
//条码与规则长度对应不上
if
(
codeArr
.
length
!=
length
){
if
(
codeArr
.
length
!=
length
){
log
.
info
(
"条码["
+
codeStr
+
"]与规则【"
+
ruleStr
+
"】长度不同"
);
log
.
debug
(
"条码["
+
codeStr
+
"]与规则【"
+
ruleStr
+
"】长度不同"
);
codeBean
.
setError
(
"smfcore.error.barcode.wrongLength"
,
new
String
[]{
codeStr
},
"条码[{0}]长度错误"
);
codeBean
.
setError
(
"smfcore.error.barcode.wrongLength"
,
new
String
[]{
codeStr
},
"条码[{0}]长度错误"
);
return
codeBean
;
return
codeBean
;
}
else
{
}
else
{
...
@@ -542,7 +542,7 @@ public class BarcodeRule {
...
@@ -542,7 +542,7 @@ public class BarcodeRule {
}
}
if
(
Strings
.
isNullOrEmpty
(
reelId
)){
if
(
Strings
.
isNullOrEmpty
(
reelId
)){
log
.
info
(
"条码解析失败,未找到RI字段"
);
log
.
debug
(
"条码解析失败,未找到RI字段"
);
codeBean
.
setError
(
"smfcore.error.barcode.noField"
,
new
String
[]{
"RI"
},
"条码解析失败,未找到{0}字段"
);
codeBean
.
setError
(
"smfcore.error.barcode.noField"
,
new
String
[]{
"RI"
},
"条码解析失败,未找到{0}字段"
);
return
codeBean
;
return
codeBean
;
}
}
...
@@ -550,14 +550,14 @@ public class BarcodeRule {
...
@@ -550,14 +550,14 @@ public class BarcodeRule {
String
partNumber
=
partNumber_item
.
getStrValue
(
codeArr
);
String
partNumber
=
partNumber_item
.
getStrValue
(
codeArr
);
if
(
Strings
.
isNullOrEmpty
(
partNumber
)){
if
(
Strings
.
isNullOrEmpty
(
partNumber
)){
log
.
info
(
"条码解析失败,未找到PN字段"
);
log
.
debug
(
"条码解析失败,未找到PN字段"
);
codeBean
.
setError
(
"smfcore.error.barcode.noField"
,
new
String
[]{
"PN"
},
"条码解析失败,未找到{0}字段"
);
codeBean
.
setError
(
"smfcore.error.barcode.noField"
,
new
String
[]{
"PN"
},
"条码解析失败,未找到{0}字段"
);
return
codeBean
;
return
codeBean
;
}
}
if
(
batch_item
.
hasThisField
())
{
if
(
batch_item
.
hasThisField
())
{
String
batch
=
batch_item
.
getStrValue
(
codeArr
);
String
batch
=
batch_item
.
getStrValue
(
codeArr
);
if
(
batch
.
indexOf
(
"-"
)
==
-
1
)
{
if
(
batch
.
indexOf
(
"-"
)
==
-
1
)
{
log
.
info
(
"条码解析失败,BATCH字段不合规则"
);
log
.
debug
(
"条码解析失败,BATCH字段不合规则"
);
codeBean
.
setError
(
"smfcore.error.barcode.noField"
,
new
String
[]{
"BATCH"
},
"条码解析失败,未找到{0}字段"
);
codeBean
.
setError
(
"smfcore.error.barcode.noField"
,
new
String
[]{
"BATCH"
},
"条码解析失败,未找到{0}字段"
);
return
codeBean
;
return
codeBean
;
}
}
...
@@ -576,13 +576,13 @@ public class BarcodeRule {
...
@@ -576,13 +576,13 @@ public class BarcodeRule {
if
(
quantity_item
.
hasThisField
()){
if
(
quantity_item
.
hasThisField
()){
quantity
=
quantity_item
.
getIntValue
(
codeArr
);
quantity
=
quantity_item
.
getIntValue
(
codeArr
);
if
(
quantity
==
-
1
){
if
(
quantity
==
-
1
){
log
.
info
(
"条码解析失败,未找到QTY 字段"
);
log
.
debug
(
"条码解析失败,未找到QTY 字段"
);
codeBean
.
setError
(
"smfcore.error.barcode.noField"
,
new
String
[]{
"QTY"
},
"条码解析失败,未找到{0}字段"
);
codeBean
.
setError
(
"smfcore.error.barcode.noField"
,
new
String
[]{
"QTY"
},
"条码解析失败,未找到{0}字段"
);
return
codeBean
;
return
codeBean
;
}
}
if
(
quantity
==
0
)
{
if
(
quantity
==
0
)
{
if
(!(
codeStr
.
startsWith
(
"CS"
)
||
codeStr
.
startsWith
(
"CM"
)
||
codeStr
.
startsWith
(
"CB"
)))
{
if
(!(
codeStr
.
startsWith
(
"CS"
)
||
codeStr
.
startsWith
(
"CM"
)
||
codeStr
.
startsWith
(
"CB"
)))
{
log
.
info
(
"条码解析失败,未找到QTY 字段"
);
log
.
debug
(
"条码解析失败,未找到QTY 字段"
);
codeBean
.
setError
(
"smfcore.error.barcode.noField"
,
new
String
[]{
"QTY"
},
"条码解析失败,未找到{0}字段"
);
codeBean
.
setError
(
"smfcore.error.barcode.noField"
,
new
String
[]{
"QTY"
},
"条码解析失败,未找到{0}字段"
);
return
codeBean
;
return
codeBean
;
}
}
...
@@ -591,7 +591,7 @@ public class BarcodeRule {
...
@@ -591,7 +591,7 @@ public class BarcodeRule {
Date
produceDate
=
produceDate_item
.
getDateValue
(
codeArr
);
Date
produceDate
=
produceDate_item
.
getDateValue
(
codeArr
);
if
(
produceDate_item
.
hasThisField
()
&&
produceDate
==
null
){
if
(
produceDate_item
.
hasThisField
()
&&
produceDate
==
null
){
log
.
info
(
"条码解析失败,PRODATE字段不合规则"
);
log
.
debug
(
"条码解析失败,PRODATE字段不合规则"
);
codeBean
.
setError
(
"smfcore.error.barcode.noField"
,
new
String
[]{
"PRODATE"
},
"条码解析失败,未找到{0}字段"
);
codeBean
.
setError
(
"smfcore.error.barcode.noField"
,
new
String
[]{
"PRODATE"
},
"条码解析失败,未找到{0}字段"
);
return
codeBean
;
return
codeBean
;
}
}
...
@@ -629,7 +629,7 @@ public class BarcodeRule {
...
@@ -629,7 +629,7 @@ public class BarcodeRule {
if
(
dateCode_item
.
hasThisField
())
{
if
(
dateCode_item
.
hasThisField
())
{
String
dateCode
=
dateCode_item
.
getStrValue
(
codeArr
);
String
dateCode
=
dateCode_item
.
getStrValue
(
codeArr
);
if
(
dateCode
.
indexOf
(
"-"
)
==
-
1
)
{
if
(
dateCode
.
indexOf
(
"-"
)
==
-
1
)
{
log
.
info
(
"条码解析失败,DATECODE字段不合规则"
);
log
.
debug
(
"条码解析失败,DATECODE字段不合规则"
);
codeBean
.
setError
(
"smfcore.error.barcode.noField"
,
new
String
[]{
"DATECODE"
},
"条码解析失败,未找到{0}字段"
);
codeBean
.
setError
(
"smfcore.error.barcode.noField"
,
new
String
[]{
"DATECODE"
},
"条码解析失败,未找到{0}字段"
);
return
codeBean
;
return
codeBean
;
}
}
...
@@ -693,7 +693,7 @@ public class BarcodeRule {
...
@@ -693,7 +693,7 @@ public class BarcodeRule {
codeArr
=
codeStr
.
split
(
separator
,
-
1
);
codeArr
=
codeStr
.
split
(
separator
,
-
1
);
//条码与规则长度对应不上
//条码与规则长度对应不上
if
(
codeArr
.
length
!=
length
)
{
if
(
codeArr
.
length
!=
length
)
{
log
.
info
(
"条码["
+
codeStr
+
"]与规则【"
+
ruleStr
+
"】长度不同"
);
log
.
debug
(
"条码["
+
codeStr
+
"]与规则【"
+
ruleStr
+
"】长度不同"
);
return
null
;
return
null
;
}
else
{
}
else
{
codeArr
=
codeStr
.
split
(
separator
,
length
);
codeArr
=
codeStr
.
split
(
separator
,
length
);
...
@@ -710,7 +710,7 @@ public class BarcodeRule {
...
@@ -710,7 +710,7 @@ public class BarcodeRule {
reelId
=
reelId_item
.
getStrValue
(
codeArr
);
reelId
=
reelId_item
.
getStrValue
(
codeArr
);
}
}
if
(
Strings
.
isNullOrEmpty
(
reelId
))
{
if
(
Strings
.
isNullOrEmpty
(
reelId
))
{
log
.
info
(
"条码解析失败,未找到RI字段"
);
log
.
debug
(
"条码解析失败,未找到RI字段"
);
//codeBean.setError("smfcore.error.barcode.noField",new String[]{"RI"},"条码解析失败,未找到{0}字段");
//codeBean.setError("smfcore.error.barcode.noField",new String[]{"RI"},"条码解析失败,未找到{0}字段");
return
null
;
return
null
;
}
}
...
@@ -721,7 +721,7 @@ public class BarcodeRule {
...
@@ -721,7 +721,7 @@ public class BarcodeRule {
memo
=
memo_item
.
getStrValue
(
codeArr
);
memo
=
memo_item
.
getStrValue
(
codeArr
);
}
}
if
(
Strings
.
isNullOrEmpty
(
memo
)){
if
(
Strings
.
isNullOrEmpty
(
memo
)){
log
.
info
(
"条码解析失败,未找到MEMO字段"
);
log
.
debug
(
"条码解析失败,未找到MEMO字段"
);
return
null
;
return
null
;
}
}
...
@@ -729,7 +729,7 @@ public class BarcodeRule {
...
@@ -729,7 +729,7 @@ public class BarcodeRule {
String
partNumber
=
partNumber_item
.
getStrValue
(
codeArr
);
String
partNumber
=
partNumber_item
.
getStrValue
(
codeArr
);
if
(
Strings
.
isNullOrEmpty
(
partNumber
))
{
if
(
Strings
.
isNullOrEmpty
(
partNumber
))
{
log
.
info
(
"条码解析失败,未找到PN字段"
);
log
.
debug
(
"条码解析失败,未找到PN字段"
);
return
null
;
return
null
;
}
}
grLabel
.
setPartNumber
(
partNumber
);
grLabel
.
setPartNumber
(
partNumber
);
...
@@ -737,7 +737,7 @@ public class BarcodeRule {
...
@@ -737,7 +737,7 @@ public class BarcodeRule {
if
(
quantity_item
.
hasThisField
())
{
if
(
quantity_item
.
hasThisField
())
{
quantity
=
quantity_item
.
getIntValue
(
codeArr
);
quantity
=
quantity_item
.
getIntValue
(
codeArr
);
if
(
quantity
==
-
1
)
{
if
(
quantity
==
-
1
)
{
log
.
info
(
"条码解析失败,未找到QTY 字段"
);
log
.
debug
(
"条码解析失败,未找到QTY 字段"
);
return
null
;
return
null
;
}
}
}
}
...
...
src/main/java/com/neotel/smfcore/core/barcode/service/po/Barcode.java
查看文件 @
2f07434
...
@@ -626,7 +626,7 @@ public class Barcode extends BasePo implements Serializable {
...
@@ -626,7 +626,7 @@ public class Barcode extends BasePo implements Serializable {
}
}
}
}
public
void
removeFromSubCodes
(
Barcode
subCode
){
public
synchronized
void
removeFromSubCodes
(
Barcode
subCode
){
if
(
subCodeList
!=
null
&&
subCodeList
.
size
()
>
0
){
if
(
subCodeList
!=
null
&&
subCodeList
.
size
()
>
0
){
boolean
removeOk
=
subCodeList
.
removeIf
(
t
->
t
.
getBarcode
().
equals
(
subCode
.
getBarcode
()));
boolean
removeOk
=
subCodeList
.
removeIf
(
t
->
t
.
getBarcode
().
equals
(
subCode
.
getBarcode
()));
if
(
removeOk
){
if
(
removeOk
){
...
...
src/main/java/com/neotel/smfcore/core/barcode/utils/CodeResolve.java
查看文件 @
2f07434
...
@@ -410,6 +410,7 @@ public class CodeResolve {
...
@@ -410,6 +410,7 @@ public class CodeResolve {
*/
*/
public
Barcode
resolveOneValideBarcode
(
String
codeStr
,
int
type
)
throws
ValidateException
{
public
Barcode
resolveOneValideBarcode
(
String
codeStr
,
int
type
)
throws
ValidateException
{
if
(
org
.
apache
.
logging
.
log4j
.
util
.
Strings
.
isBlank
(
codeStr
)){
if
(
org
.
apache
.
logging
.
log4j
.
util
.
Strings
.
isBlank
(
codeStr
)){
log
.
info
(
"未扫到条码"
);
throw
new
ValidateException
(
"smfcore.error.barcode.empty"
,
"未扫到条码"
);
throw
new
ValidateException
(
"smfcore.error.barcode.empty"
,
"未扫到条码"
);
}
}
Collection
<
CodeBean
>
codeBeans
=
resolveCodeStr
(
codeStr
,
type
);
Collection
<
CodeBean
>
codeBeans
=
resolveCodeStr
(
codeStr
,
type
);
...
@@ -421,6 +422,7 @@ public class CodeResolve {
...
@@ -421,6 +422,7 @@ public class CodeResolve {
if
(
barcode
==
null
){
if
(
barcode
==
null
){
barcode
=
barcodeFromRule
;
barcode
=
barcodeFromRule
;
}
else
{
}
else
{
log
.
info
(
"从["
+
codeStr
+
"]中找到多个有效条码"
);
throw
new
ValidateException
(
"smfcore.error.barcode.many"
,
"找到多个有效的条码"
,
new
String
[]{
codeStr
});
throw
new
ValidateException
(
"smfcore.error.barcode.many"
,
"找到多个有效的条码"
,
new
String
[]{
codeStr
});
}
}
}
else
{
}
else
{
...
@@ -429,6 +431,7 @@ public class CodeResolve {
...
@@ -429,6 +431,7 @@ public class CodeResolve {
}
}
if
(
barcode
==
null
){
if
(
barcode
==
null
){
log
.
info
(
"从["
+
codeStr
+
"]中未找到有效的条码"
);
throw
new
ValidateException
(
"smfcore.error.barcode.invalid"
,
"未找到有效的条码"
,
new
String
[]{
codeStr
});
throw
new
ValidateException
(
"smfcore.error.barcode.invalid"
,
"未找到有效的条码"
,
new
String
[]{
codeStr
});
}
}
return
barcode
;
return
barcode
;
...
...
src/main/java/com/neotel/smfcore/core/language/util/MessageUtils.java
查看文件 @
2f07434
...
@@ -142,7 +142,7 @@ public class MessageUtils {
...
@@ -142,7 +142,7 @@ public class MessageUtils {
// log.info("获取资源[" + msgKey + "][" + defaultMsg + "][" + lanType + "]失败:未找到code[" + msgKey + "]对应语言[" + lanType + "]");
// log.info("获取资源[" + msgKey + "][" + defaultMsg + "][" + lanType + "]失败:未找到code[" + msgKey + "]对应语言[" + lanType + "]");
return
msg
.
getMsg
();
return
msg
.
getMsg
();
}
}
log
.
info
(
"获取资源["
+
msgKey
+
"]["
+
defaultMsg
+
"]["
+
lanType
+
"]失败:未找到code["
+
msgKey
+
"]"
);
log
.
debug
(
"获取资源["
+
msgKey
+
"]["
+
defaultMsg
+
"]["
+
lanType
+
"]失败:未找到code["
+
msgKey
+
"]"
);
}
}
return
defaultMsg
;
return
defaultMsg
;
}
}
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/CDeviceController.java
查看文件 @
2f07434
此文件的差异被折叠,
点击展开。
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/util/BoxHandleUtil.java
查看文件 @
2f07434
...
@@ -90,7 +90,7 @@ public class BoxHandleUtil {
...
@@ -90,7 +90,7 @@ public class BoxHandleUtil {
barcode
.
setUsedDate
(
new
Date
());
barcode
.
setUsedDate
(
new
Date
());
//仓位状态
//仓位状态
barcode
.
setCheckOutDate
(
new
Date
(),
""
);
barcode
.
setCheckOutDate
(
new
Date
(),
""
);
barcode
.
setPosName
(
""
);
//
barcode.setPosName("");
barcode
.
setOrderItemId
(
""
);
barcode
.
setOrderItemId
(
""
);
barcode
.
setOrderId
(
""
);
barcode
.
setOrderId
(
""
);
barcode
.
setLockName
(
""
);
barcode
.
setLockName
(
""
);
...
@@ -98,8 +98,8 @@ public class BoxHandleUtil {
...
@@ -98,8 +98,8 @@ public class BoxHandleUtil {
barcodeManager
.
save
(
barcode
);
barcodeManager
.
save
(
barcode
);
}
}
storagePos
.
setBarcode
(
null
);
//
storagePos.setBarcode(null);
storagePos
.
setUsed
(
false
);
//
storagePos.setUsed(false);
storagePosManager
.
save
(
storagePos
);
storagePosManager
.
save
(
storagePos
);
log
.
info
(
"出库完成,清空仓位: "
+
storagePos
.
getId
()
+
"["
+
storagePos
.
getPosName
()
+
"]"
);
log
.
info
(
"出库完成,清空仓位: "
+
storagePos
.
getId
()
+
"["
+
storagePos
.
getPosName
()
+
"]"
);
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论