Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit b0783a6e
由
LN
编写于
2024-07-24 15:11:42 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
点料完成调用API008. 解析条码失败未加入入库单NG中
1 个父辈
6972d10f
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
58 行增加
和
17 行删除
src/main/java/com/neotel/smfcore/core/barcode/utils/CodeResolve.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/RobotBoxHandler.java
src/main/java/com/neotel/smfcore/core/device/rest/DeviceController.java
src/main/java/com/neotel/smfcore/custom/micron1053/api/MicronApi.java
src/main/java/com/neotel/smfcore/custom/micron1053/controller/MicronDeviceController.java
src/main/java/com/neotel/smfcore/core/barcode/utils/CodeResolve.java
查看文件 @
b0783a6
...
...
@@ -279,11 +279,15 @@ public class CodeResolve {
boolean
needUpdate
=
false
;
int
lastLabelAmount
=
barcode
.
getLabelAmount
();
int
currentLabelAmount
=
barcodeFromRule
.
getAmount
();
if
(
currentLabelAmount
!=
lastLabelAmount
){
//本次解析出来的数量与上次条码解析出来的数量不一样,重新设置数量
log
.
info
(
"重新设置"
+
codeBeanFromRule
.
getCodeStr
()+
"数量为:"
+
currentLabelAmount
);
barcode
.
setAmount
(
currentLabelAmount
);
//如果点过料,不再更新数量
if
(
currentLabelAmount
!=
lastLabelAmount
)
{
barcode
.
setLabelAmount
(
currentLabelAmount
);
if
(
barcode
.
getXrayCount
()
>
0
)
{
log
.
info
(
"重新设置"
+
codeBeanFromRule
.
getCodeStr
()
+
"标签数量为:"
+
currentLabelAmount
);
}
else
{
log
.
info
(
"重新设置"
+
codeBeanFromRule
.
getCodeStr
()
+
"标签数量和实时数量为:"
+
currentLabelAmount
);
barcode
.
setAmount
(
currentLabelAmount
);
}
needUpdate
=
true
;
}
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/RobotBoxHandler.java
查看文件 @
b0783a6
...
...
@@ -725,7 +725,7 @@ public class RobotBoxHandler extends BaseDeviceHandler {
}
}
catch
(
ValidateException
ve
)
{
errorMsg
=
MessageUtils
.
getText
(
ve
.
getMsgKey
(),
ve
.
getMsgParam
(),
new
Locale
(
"en"
,
"US"
),
ve
.
getDefaultMsg
());
if
(
ObjectUtil
.
isEmpty
(
apiBarcode
)){
if
(
ObjectUtil
.
is
Not
Empty
(
apiBarcode
)){
log
.
info
(
"Failed to find empty storage space:"
+
errorMsg
+
",update state"
);
loadingUtil
.
updateItemState
(
apiBarcode
,
""
,
INITEM_STATUS
.
NG
,
errorMsg
);
}
else
{
...
...
src/main/java/com/neotel/smfcore/core/device/rest/DeviceController.java
查看文件 @
b0783a6
...
...
@@ -8,6 +8,7 @@ import com.google.common.collect.Lists;
import
com.google.common.collect.Maps
;
import
com.neotel.smfcore.common.bean.ReelLockPosInfo
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.exception.ApiException
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.Constants
;
import
com.neotel.smfcore.common.utils.ReelLockPosUtil
;
...
...
@@ -21,6 +22,8 @@ import com.neotel.smfcore.core.barcode.service.po.Component;
import
com.neotel.smfcore.core.barcode.utils.CodeResolve
;
import
com.neotel.smfcore.core.device.bean.PosInfo
;
import
com.neotel.smfcore.core.device.enums.OP_STATUS
;
import
com.neotel.smfcore.core.inList.enums.INITEM.INITEM_STATUS
;
import
com.neotel.smfcore.core.inList.service.po.InList
;
import
com.neotel.smfcore.core.message.util.DeviceMessageUtil
;
import
com.neotel.smfcore.core.order.service.po.LiteOrder
;
import
com.neotel.smfcore.core.storage.service.manager.IStoragePosManager
;
...
...
@@ -30,6 +33,8 @@ import com.neotel.smfcore.core.system.service.po.AlarmInfo;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.core.system.util.DevicesStatusUtil
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.custom.micron1053.api.MicronApi
;
import
com.neotel.smfcore.custom.micron1053.loading.util.LoadingUtil
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
com.neotel.smfcore.core.storage.enums.DeviceType
;
import
com.neotel.smfcore.core.device.handler.IDeviceHandler
;
...
...
@@ -70,6 +75,8 @@ public class DeviceController {
@Autowired
private
IBarcodeManager
barcodeManager
;
@Autowired
private
LoadingUtil
loadingUtil
;
/**
* 权限验证API列表
*/
...
...
@@ -706,14 +713,42 @@ public class DeviceController {
if
(
StringUtils
.
isNotBlank
(
barcodeStr
))
{
Barcode
barcode
=
barcodeManager
.
findByBarcode
(
barcodeStr
);
if
(
barcode
!=
null
)
{
int
amount
=
barcode
.
getAmount
();
barcode
.
setAmount
(
NumberUtil
.
parseInt
(
amountStr
));
barcode
.
setOriAmount
(
amount
);
int
oldQty
=
barcode
.
getAmount
();
int
qty
=
NumberUtil
.
parseInt
(
amountStr
);
barcode
.
setAmount
(
qty
);
barcode
.
setOriAmount
(
oldQty
);
barcode
.
setXrayCount
(
barcode
.
getXrayCount
()
+
1
);
barcodeManager
.
save
(
barcode
);
return
ResultBean
.
newOkResult
(
barcode
.
getOriAmount
());
//处理入库单
InList
inList
=
loadingUtil
.
getInlist
();
if
(
inList
==
null
)
{
return
ResultBean
.
newOkResult
(
qty
);
}
try
{
//上传数量
String
result
=
MicronApi
.
Api008
(
barcode
.
getBarcode
(),
oldQty
,
qty
);
if
(
ObjectUtil
.
isEmpty
(
result
))
{
//点料已完成,等待获取库位号
loadingUtil
.
xRayEndUpdateItem
(
barcode
.
getBarcode
(),
qty
,
INITEM_STATUS
.
XRayEnd
);
return
ResultBean
.
newOkResult
(
qty
);
}
else
{
loadingUtil
.
xRayEndUpdateItem
(
barcode
.
getBarcode
(),
qty
,
INITEM_STATUS
.
XRayFail
);
return
ResultBean
.
newErrorResult
(
1
,
"smfcore.micron.operationFailure"
,
"操作失败"
);
}
}
catch
(
ApiException
api
)
{
loadingUtil
.
xRayEndUpdateItem
(
barcode
.
getBarcode
(),
qty
,
INITEM_STATUS
.
XRayFail
);
return
ResultBean
.
newErrorResult
(
1
,
api
.
getMsgKey
(),
api
.
getMessage
());
}
}
}
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"barcode"
,
barcodeStr
});
}
...
...
src/main/java/com/neotel/smfcore/custom/micron1053/api/MicronApi.java
查看文件 @
b0783a6
...
...
@@ -613,7 +613,7 @@ public class MicronApi {
}
public
static
boolean
Api008
(
String
serialNum
,
int
qty
,
int
newQty
)
throws
ApiException
{
public
static
String
Api008
(
String
serialNum
,
int
qty
,
int
newQty
)
throws
ApiException
{
//点料结束通知点料结果
String
url
=
config
.
getUrl
(
config
.
api_name_008
);
//url = MessageFormat.format(url,serialNum,qty);
...
...
@@ -642,7 +642,7 @@ public class MicronApi {
// if (micronResult.isOk()&& micronResult.statusIsSuccess()) {
String
errMsg
=
getDErrorMsg
(
micronResult
);
if
(
micronResult
.
isOk
())
{
return
true
;
return
""
;
}
else
if
(
ObjectUtil
.
isNotEmpty
(
errMsg
))
{
log
.
info
(
"API008 ,接口通信失败:"
+
errMsg
);
throw
new
ApiException
(
errMsg
);
...
...
@@ -654,7 +654,7 @@ public class MicronApi {
}
}
catch
(
ApiException
e
)
{
log
.
error
(
url
+
"出错"
,
e
);
return
false
;
return
e
.
getMessage
()
;
}
}
...
...
src/main/java/com/neotel/smfcore/custom/micron1053/controller/MicronDeviceController.java
查看文件 @
b0783a6
...
...
@@ -363,22 +363,24 @@ public class MicronDeviceController {
//TODO 更改条码数量
int
oldQty
=
barcode
.
getAmount
();
barcode
.
setAmount
(
qty
);
barcode
.
setOriAmount
(
oldQty
);
barcode
.
setXrayCount
(
barcode
.
getXrayCount
()
+
1
);
barcodeManager
.
saveBarcode
(
barcode
);
log
.
info
(
"点料完成,更新条码["
+
barcode
.
getBarcode
()
+
"]数量=["
+
qty
+
"],旧数量["
+
oldQty
+
"]"
);
//处理入库单
InList
inList
=
loadingUtil
.
getInlist
();
if
(
inList
==
null
)
{
return
ResultBean
.
newOkResult
(
"ok"
);
return
ResultBean
.
newOkResult
(
qty
);
}
try
{
//上传数量
boolean
result
=
MicronApi
.
Api008
(
barcode
.
getBarcode
(),
oldQty
,
qty
);
if
(
result
)
{
String
result
=
MicronApi
.
Api008
(
barcode
.
getBarcode
(),
oldQty
,
qty
);
if
(
ObjectUtil
.
isEmpty
(
result
)
)
{
//点料已完成,等待获取库位号
loadingUtil
.
xRayEndUpdateItem
(
barcode
.
getBarcode
(),
qty
,
INITEM_STATUS
.
XRayEnd
);
return
ResultBean
.
newOkResult
(
"ok"
);
return
ResultBean
.
newOkResult
(
qty
);
}
else
{
loadingUtil
.
xRayEndUpdateItem
(
barcode
.
getBarcode
(),
qty
,
INITEM_STATUS
.
XRayFail
);
...
...
@@ -387,7 +389,7 @@ public class MicronDeviceController {
}
catch
(
ApiException
api
)
{
loadingUtil
.
xRayEndUpdateItem
(
barcode
.
getBarcode
(),
qty
,
INITEM_STATUS
.
XRayFail
);
return
ResultBean
.
newErrorResult
(
1
,
"smfcore.micron.operationFailure"
,
"操作失败"
);
return
ResultBean
.
newErrorResult
(
1
,
api
.
getMsgKey
(),
api
.
getMessage
()
);
}
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论