Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 0032eb91
由
张少辉
编写于
2026-01-20 15:51:30 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.上架/下架 转换成 短的条码
2.退库问题修改
1 个父辈
7c5c3db0
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
44 行增加
和
27 行删除
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/custom/aiqingzhiyin1643/controller/MaterialOperationController.java
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/momo/MomoApi.java
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/util/BoxUtil.java
src/main/resources/config/application.yml
src/main/java/com/neotel/smfcore/core/barcode/service/po/Barcode.java
查看文件 @
0032eb9
...
@@ -247,8 +247,6 @@ public class Barcode extends BasePo implements Serializable {
...
@@ -247,8 +247,6 @@ public class Barcode extends BasePo implements Serializable {
private
String
receiptOrder
;
private
String
receiptOrder
;
private
String
checkOutOrder
;
//物料描述
//物料描述
private
String
description
;
private
String
description
;
...
...
src/main/java/com/neotel/smfcore/core/barcode/utils/CodeResolve.java
查看文件 @
0032eb9
...
@@ -122,9 +122,11 @@ public class CodeResolve {
...
@@ -122,9 +122,11 @@ public class CodeResolve {
if
((
codeBeanFromRule
.
getBarcode
()!=
null
)&&(
codeBeanFromRule
.
getBarcode
().
getPartNumber
()!=
null
))
{
if
((
codeBeanFromRule
.
getBarcode
()!=
null
)&&(
codeBeanFromRule
.
getBarcode
().
getPartNumber
()!=
null
))
{
if
(!
barcode
.
getPartNumber
().
equals
(
codeBeanFromRule
.
getBarcode
().
getPartNumber
()))
{
if
(!
barcode
.
getPartNumber
().
equals
(
codeBeanFromRule
.
getBarcode
().
getPartNumber
()))
{
try
{
try
{
if
(
barcode
.
getBarcode
().
length
()
!=
6
)
{
log
.
warn
(
"["
+
barcode
.
getBarcode
()
+
"]重新设置PN["
+
barcode
.
getPartNumber
()
+
"]为["
+
codeBeanFromRule
.
getBarcode
().
getPartNumber
()
+
"]"
);
log
.
warn
(
"["
+
barcode
.
getBarcode
()
+
"]重新设置PN["
+
barcode
.
getPartNumber
()
+
"]为["
+
codeBeanFromRule
.
getBarcode
().
getPartNumber
()
+
"]"
);
//barcode.setPartNumber(codeBeanFromRule.getBarcode().getPartNumber());
barcode
.
setPartNumber
(
codeBeanFromRule
.
getBarcode
().
getPartNumber
());
//barcode = barcodeManager.save(barcode);
barcode
=
barcodeManager
.
save
(
barcode
);
}
}
catch
(
Exception
ve
)
{
}
catch
(
Exception
ve
)
{
log
.
error
(
"重新设置PN出错"
,
ve
);
log
.
error
(
"重新设置PN出错"
,
ve
);
}
}
...
...
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/controller/MaterialOperationController.java
查看文件 @
0032eb9
...
@@ -4,6 +4,7 @@ import com.neotel.smfcore.common.bean.ResultBean;
...
@@ -4,6 +4,7 @@ import com.neotel.smfcore.common.bean.ResultBean;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.ReelLockPosUtil
;
import
com.neotel.smfcore.common.utils.ReelLockPosUtil
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.utils.CodeResolve
;
import
com.neotel.smfcore.core.barcode.utils.CodeResolve
;
import
com.neotel.smfcore.core.device.enums.OP
;
import
com.neotel.smfcore.core.device.enums.OP
;
...
@@ -57,6 +58,15 @@ public class MaterialOperationController {
...
@@ -57,6 +58,15 @@ public class MaterialOperationController {
Barcode
barcode
;
Barcode
barcode
;
try
{
try
{
// 检查code长度是否≥6(第一位+最后五位需要至少6位字符)
if
(
code
.
length
()
>=
6
)
{
// 提取第一位字符(转为String方便拼接)
String
firstChar
=
String
.
valueOf
(
code
.
charAt
(
0
));
// 提取最后五位字符(substring从指定索引截取到末尾)
String
lastFiveChars
=
code
.
substring
(
code
.
length
()
-
5
);
// 拼接新的code
code
=
firstChar
+
lastFiveChars
;
}
barcode
=
codeResolve
.
resolveOneValideBarcode
(
code
);
barcode
=
codeResolve
.
resolveOneValideBarcode
(
code
);
}
catch
(
ValidateException
e
)
{
}
catch
(
ValidateException
e
)
{
log
.
error
(
"[人工上架] code: {} 条码解析失败: {}"
,
code
,
e
.
getMessage
());
log
.
error
(
"[人工上架] code: {} 条码解析失败: {}"
,
code
,
e
.
getMessage
());
...
@@ -135,6 +145,15 @@ public class MaterialOperationController {
...
@@ -135,6 +145,15 @@ public class MaterialOperationController {
Barcode
barcode
;
Barcode
barcode
;
try
{
try
{
// 检查code长度是否≥6(第一位+最后五位需要至少6位字符)
if
(
code
.
length
()
>=
6
)
{
// 提取第一位字符(转为String方便拼接)
String
firstChar
=
String
.
valueOf
(
code
.
charAt
(
0
));
// 提取最后五位字符(substring从指定索引截取到末尾)
String
lastFiveChars
=
code
.
substring
(
code
.
length
()
-
5
);
// 拼接新的code
code
=
firstChar
+
lastFiveChars
;
}
barcode
=
codeResolve
.
resolveOneValideBarcode
(
code
);
barcode
=
codeResolve
.
resolveOneValideBarcode
(
code
);
}
catch
(
ValidateException
e
)
{
}
catch
(
ValidateException
e
)
{
log
.
error
(
"[人工下架] code: {} 条码解析失败: {}"
,
code
,
e
.
getMessage
());
log
.
error
(
"[人工下架] code: {} 条码解析失败: {}"
,
code
,
e
.
getMessage
());
...
...
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/momo/MomoApi.java
查看文件 @
0032eb9
...
@@ -53,8 +53,8 @@ public class MomoApi extends BaseSmfApiListener {
...
@@ -53,8 +53,8 @@ public class MomoApi extends BaseSmfApiListener {
if
(
StringUtils
.
isNotEmpty
(
receiptOrder
)){
if
(
StringUtils
.
isNotEmpty
(
receiptOrder
)){
stockIn
(
barcode
);
stockIn
(
barcode
);
}
else
{
}
else
{
if
(
StringUtils
.
isNotEmpty
(
barcode
.
get
CheckOutOrder
())){
if
(
StringUtils
.
isNotEmpty
(
barcode
.
get
StockoutNo
())){
stockReturn
(
task
);
stockReturn
(
barcode
);
}
}
}
}
}
}
...
@@ -83,40 +83,36 @@ public class MomoApi extends BaseSmfApiListener {
...
@@ -83,40 +83,36 @@ public class MomoApi extends BaseSmfApiListener {
}
}
}
}
public
void
stockReturn
(
DataLog
task
)
{
public
void
stockReturn
(
Barcode
barcode
)
{
/*
Map<String, Object> paramMap = new HashMap<>();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap.put("ReturnDate", DateUtil.toDateString(
task.getUpdate
Date(), "yyyy/MM/dd HH:mm:ss"));
paramMap
.
put
(
"ReturnDate"
,
DateUtil
.
toDateString
(
new
Date
(),
"yyyy/MM/dd HH:mm:ss"
));
paramMap.put("StockReturn",
task.getStockReturn
());
paramMap
.
put
(
"StockReturn"
,
barcode
.
getStockoutNo
());
List
<
Map
<
String
,
Object
>>
Details
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
Details
=
new
ArrayList
<>();
Map
<
String
,
Object
>
detailMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
detailMap
=
new
HashMap
<>();
detailMap.put("ProductName", task.getProductName());
detailMap
.
put
(
"ProductName"
,
barcode
.
getDescription
());
detailMap.put("ProductNo", task.getPartNumber());
detailMap
.
put
(
"ProductNo"
,
barcode
.
getPartNumber
());
detailMap.put("Qty", task.getQty());
detailMap
.
put
(
"Qty"
,
barcode
.
getLastStockOutNum
());
List
<
Map
<
String
,
Object
>>
RKContainer
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
RKContainer
=
new
ArrayList
<>();
Map
<
String
,
Object
>
rkContainerMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
rkContainerMap
=
new
HashMap
<>();
rkContainerMap.put("CQty",
task.getNum
());
rkContainerMap
.
put
(
"CQty"
,
barcode
.
getAmount
());
if (StringUtils.isNotEmpty(
task.getContainer
())) {
if
(
StringUtils
.
isNotEmpty
(
barcode
.
getPidBarcode
()))
{
rkContainerMap.put("Container",
task.getContainer
());
rkContainerMap
.
put
(
"Container"
,
barcode
.
getPidBarcode
());
}
else
{
}
else
{
rkContainerMap.put("Container",
task
.getBarcode());
rkContainerMap
.
put
(
"Container"
,
barcode
.
getBarcode
());
}
}
RKContainer
.
add
(
rkContainerMap
);
RKContainer
.
add
(
rkContainerMap
);
detailMap
.
put
(
"RKContainer"
,
RKContainer
);
detailMap
.
put
(
"RKContainer"
,
RKContainer
);
detailMap.put("StockreturnNoLine",
task.getStockreturn
NoLine());
detailMap
.
put
(
"StockreturnNoLine"
,
barcode
.
getStockout
NoLine
());
Details
.
add
(
detailMap
);
Details
.
add
(
detailMap
);
paramMap
.
put
(
"Details"
,
Details
);
paramMap
.
put
(
"Details"
,
Details
);
log
.
info
(
"接口6:MOM接收WMS的退库结果,请求参数为:"
+
JSON
.
toJSONString
(
paramMap
));
log
.
info
(
"接口6:MOM接收WMS的退库结果,请求参数为:"
+
JSON
.
toJSONString
(
paramMap
));
try
{
try
{
String
resultStr
=
HttpHelper
.
postJson
(
stockReturnUrl
,
paramMap
);
String
resultStr
=
HttpHelper
.
postJson
(
stockReturnUrl
,
paramMap
);
log
.
info
(
"接口6:MOM接收WMS的退库结果,返回参数为:"
+
resultStr
);
log
.
info
(
"接口6:MOM接收WMS的退库结果,返回参数为:"
+
resultStr
);
}
catch
(
ApiException
e
)
{
}
catch
(
ApiException
e
)
{
log
.
error
(
"接口6:MOM接收WMS的退库结果,请求异常:"
,
e
);
log
.
error
(
"接口6:MOM接收WMS的退库结果,请求异常:"
,
e
);
}
*/
}
}
}
...
...
src/main/java/com/neotel/smfcore/custom/aiqingzhiyin1643/util/BoxUtil.java
查看文件 @
0032eb9
...
@@ -67,6 +67,11 @@ public class BoxUtil {
...
@@ -67,6 +67,11 @@ public class BoxUtil {
}
}
public
static
void
intoPos
(
DataLog
opTask
)
{
public
static
void
intoPos
(
DataLog
opTask
)
{
//更新缓存中的库存信息
opTask
.
setStatus
(
OP_STATUS
.
FINISHED
.
name
());
taskService
.
updateFinishedTask
(
opTask
);
//已完成,加入库存,并且从完成队列中清除
//已完成,加入库存,并且从完成队列中清除
StoragePos
storagePos
=
storagePosManager
.
get
(
opTask
.
getPosId
());
StoragePos
storagePos
=
storagePosManager
.
get
(
opTask
.
getPosId
());
//二维码状态
//二维码状态
...
@@ -91,9 +96,6 @@ public class BoxUtil {
...
@@ -91,9 +96,6 @@ public class BoxUtil {
storagePos
.
setUsed
(
true
);
storagePos
.
setUsed
(
true
);
storagePos
.
setCanCheckOutTime
(
System
.
currentTimeMillis
());
storagePos
.
setCanCheckOutTime
(
System
.
currentTimeMillis
());
storagePosManager
.
save
(
storagePos
);
storagePosManager
.
save
(
storagePos
);
//更新缓存中的库存信息
opTask
.
setStatus
(
OP_STATUS
.
FINISHED
.
name
());
taskService
.
updateFinishedTask
(
opTask
);
taskService
.
removeFinishedTask
(
opTask
);
taskService
.
removeFinishedTask
(
opTask
);
}
}
...
...
src/main/resources/config/application.yml
查看文件 @
0032eb9
...
@@ -64,7 +64,7 @@ app:
...
@@ -64,7 +64,7 @@ app:
type
:
"
"
type
:
"
"
menu
:
menu
:
show
:
inList
show
:
hide
:
hide
:
smd
:
smd
:
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论