Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 328d68a9
由
zshaohui
编写于
2024-07-31 17:53:30 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
入库时调用wms fetchReel接口
1 个父辈
b2a92376
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
55 行增加
和
71 行删除
src/main/java/com/neotel/smfcore/core/barcode/rest/bean/dto/BarcodeDto.java
src/main/java/com/neotel/smfcore/core/device/rest/DeviceController.java
src/main/java/com/neotel/smfcore/custom/lizhen/LizhenApi.java
src/main/resources/config/application-21088prod.yml
src/main/resources/config/application-21088test.yml
src/main/java/com/neotel/smfcore/core/barcode/rest/bean/dto/BarcodeDto.java
查看文件 @
328d68a
...
@@ -282,4 +282,6 @@ public class BarcodeDto implements Serializable {
...
@@ -282,4 +282,6 @@ public class BarcodeDto implements Serializable {
@ApiModelProperty
(
"Keeper"
)
@ApiModelProperty
(
"Keeper"
)
private
String
keeperCode
;
private
String
keeperCode
;
private
String
labelId
;
}
}
src/main/java/com/neotel/smfcore/core/device/rest/DeviceController.java
查看文件 @
328d68a
...
@@ -191,14 +191,14 @@ public class DeviceController {
...
@@ -191,14 +191,14 @@ public class DeviceController {
}
}
//判断库别是否为空
//判断库别是否为空
Barcode
barcode1F
=
lizhenApi
.
getBarcode
(
barcode
.
getBarcode
());
Barcode
reelBarcode
=
lizhenApi
.
fetchReel
(
barcode
);
if
(
barcode1F
==
null
||
StringUtils
.
isEmpty
(
barcode1F
.
getWarehouseCode
())){
if
(
reelBarcode
==
null
){
throw
new
ValidateException
(
""
,
barcode
.
getBarcode
()+
"未找到对应的库别信息"
);
}
String
warehouseCode
=
reelBarcode
.
getWarehouseCode
();
if
(
StringUtils
.
isEmpty
(
warehouseCode
)){
throw
new
ValidateException
(
""
,
barcode
.
getBarcode
()+
"未找到对应的库别信息"
);
throw
new
ValidateException
(
""
,
barcode
.
getBarcode
()+
"未找到对应的库别信息"
);
}
}
String
warhouseCode
=
barcode1F
.
getWarehouseCode
();
log
.
info
(
barcode
.
getBarcode
()+
"从1F查出来的库别信息为:"
+
warhouseCode
);
//判断虚拟仓有没有存在,如果有,把虚拟仓库位置空
//判断虚拟仓有没有存在,如果有,把虚拟仓库位置空
StoragePos
storagePos
=
storagePosManager
.
getByBarcode
(
barcode
.
getBarcode
());
StoragePos
storagePos
=
storagePosManager
.
getByBarcode
(
barcode
.
getBarcode
());
...
@@ -323,12 +323,12 @@ public class DeviceController {
...
@@ -323,12 +323,12 @@ public class DeviceController {
Storage
theStorage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
Storage
theStorage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
if
(!
barcode
.
isAskPutIn
())
{
if
(!
barcode
.
isAskPutIn
())
{
BackToWarehouse
back
=
lizhenApi
.
backToWarehouse
(
warhouseCode
,
theStorage
.
getName
(),
barcode
.
getBarcode
());
BackToWarehouse
back
=
lizhenApi
.
backToWarehouse
(
war
e
houseCode
,
theStorage
.
getName
(),
barcode
.
getBarcode
());
barcode
.
setLabelId
(
back
.
getLABEL_ID
());
barcode
.
setLabelId
(
back
.
getLABEL_ID
());
barcode
.
setAmount
(
back
.
getLABEL_QTY
());
barcode
.
setAmount
(
back
.
getLABEL_QTY
());
}
}
barcode
.
setWarehouseCode
(
warhouseCode
);
barcode
.
setWarehouseCode
(
war
e
houseCode
);
barcode
.
setAskPutIn
(
true
);
barcode
.
setAskPutIn
(
true
);
barcode
=
barcodeManager
.
save
(
barcode
);
barcode
=
barcodeManager
.
save
(
barcode
);
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/LizhenApi.java
查看文件 @
328d68a
...
@@ -75,6 +75,9 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -75,6 +75,9 @@ public class LizhenApi extends DefaultSmfApiListener {
@Value
(
"${api.outNotifyUrl}"
)
@Value
(
"${api.outNotifyUrl}"
)
private
String
towerIssueUrl
=
""
;
private
String
towerIssueUrl
=
""
;
@Value
(
"${api.fetchReel}"
)
private
String
fetchReel
=
""
;
@PostConstruct
@PostConstruct
public
void
init
(){
public
void
init
(){
...
@@ -519,72 +522,49 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -519,72 +522,49 @@ public class LizhenApi extends DefaultSmfApiListener {
}
}
public
Barcode
fetchReel
(
Barcode
barcode
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"reel_code"
,
barcode
.
getBarcode
());
log
.
info
(
barcode
.
getBarcode
()
+
"fetchReel调用参数为:"
+
JSON
.
toJSONString
(
paramMap
));
try
{
String
resultStr
=
HttpHelper
.
postJson
(
fetchReel
,
paramMap
);
log
.
info
(
barcode
.
getBarcode
()
+
"fetchReel调用结果为:"
+
resultStr
);
JSONObject
resultObj
=
JSONObject
.
parseObject
(
resultStr
);
String
msgty
=
resultObj
.
getString
(
"MSGTY"
);
if
(
"S"
.
equals
(
msgty
)){
JSONObject
dataObj
=
resultObj
.
getJSONObject
(
"DATA"
);
String
labelId
=
dataObj
.
getString
(
"label_id"
);
int
reelQty
=
dataObj
.
getIntValue
(
"reel_qty"
);
String
warehouseCode
=
dataObj
.
getString
(
"warehouse_code"
);
if
(
StringUtils
.
isNotBlank
(
warehouseCode
)){
barcode
.
setWarehouseCode
(
warehouseCode
);
}
if
(
StringUtils
.
isNotBlank
(
labelId
)){
barcode
.
setLabelId
(
labelId
);
}
if
(
reelQty
!=
0
){
barcode
.
setAmount
(
reelQty
);
}
return
barcode
;
}
}
catch
(
Exception
e
)
{
log
.
info
(
barcode
.
getBarcode
()+
"fetchReel调用失败:"
+
e
.
getMessage
());
}
return
null
;
}
@Override
@Override
public
boolean
isForThisApi
(
String
apiName
)
{
public
boolean
isForThisApi
(
String
apiName
)
{
return
apiName
!=
null
&&
apiName
.
equalsIgnoreCase
(
"Lizhen"
);
return
apiName
!=
null
&&
apiName
.
equalsIgnoreCase
(
"Lizhen"
);
}
}
public
static
void
main
(
String
[]
args
)
{
public
static
void
main
(
String
[]
args
)
{
String
resultStr
=
"{\n"
+
" \"MSGTY\": \"S\",\n"
+
" \"MSGTX\": \"退回成功\",\n"
+
" \"DETAIL\": null,\n"
+
" \"DATA\": {\n"
+
" \"inventory_id\": \"21438181639800001\",\n"
+
" \"plant_code\": \"W339\",\n"
+
" \"material_type\": \"ROH\",\n"
+
" \"material_code\": \"138S1068\",\n"
+
" \"warehouse_code\": \"W10B\",\n"
+
" \"bin_code\": \"Tower1-RW10B\",\n"
+
" \"keeper_code\": \"BR013\",\n"
+
" \"label_id\": \"L2024072200003578\",\n"
+
" \"group_id\": null,\n"
+
" \"label_qty\": 10000.0,\n"
+
" \"vendor_code\": \"0000017425\",\n"
+
" \"vendor_name\": null,\n"
+
" \"fl_code\": null,\n"
+
" \"allocate_qty\": 0.0,\n"
+
" \"ticket_type\": null,\n"
+
" \"extend_days\": 0,\n"
+
" \"extend_times\": 0,\n"
+
" \"rohs\": null,\n"
+
" \"order_no\": null,\n"
+
" \"version\": null,\n"
+
" \"os_version\": null,\n"
+
" \"date_code\": null,\n"
+
" \"week_code\": null,\n"
+
" \"lot_code\": null,\n"
+
" \"remark\": null,\n"
+
" \"batch_code\": \"10000000NM\",\n"
+
" \"expire_date\": null,\n"
+
" \"gr_date\": \"2024-07-19 04:35:57\",\n"
+
" \"tran_date\": \"2024-07-22 13:29:23\",\n"
+
" \"status\": 0,\n"
+
" \"reel_qty\": 1.0,\n"
+
" \"pack_type\": null,\n"
+
" \"brand\": \"MURATA\",\n"
+
" \"mpn\": null,\n"
+
" \"unit\": \"PC\",\n"
+
" \"coo\": null,\n"
+
" \"region\": null,\n"
+
" \"cavity\": null,\n"
+
" \"group_code\": null,\n"
+
" \"create_at\": \"2024-07-22 13:29:23\",\n"
+
" \"create_by\": \"MLB_API\",\n"
+
" \"update_at\": null,\n"
+
" \"update_by\": null\n"
+
" }\n"
+
"}"
;
//String resultStr = HttpHelper.postJson(inNotifyUrl, paramMap);
//log.info(barcode + "入库通知,调用电子料入退库,结果为:" + resultStr);
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
resultStr
);
String
msgty
=
jsonObject
.
getString
(
"MSGTY"
);
if
(!
"S"
.
equalsIgnoreCase
(
msgty
))
{
//throw new ValidateException("", barcode + "调用电子料入退库失败:" + resultStr);
}
String
data
=
jsonObject
.
getString
(
"DATA"
);
BackToWarehouse
backToWarehouse
=
JSONObject
.
parseObject
(
data
,
BackToWarehouse
.
class
);
System
.
out
.
println
(
JSON
.
toJSONString
(
backToWarehouse
));
}
}
}
}
src/main/resources/config/application-21088prod.yml
查看文件 @
328d68a
...
@@ -4,4 +4,5 @@ api:
...
@@ -4,4 +4,5 @@ api:
inCheckUrl
:
http://10.68.25.40:8001/Npm/WmsCheckReelfob
#禁用料接口
inCheckUrl
:
http://10.68.25.40:8001/Npm/WmsCheckReelfob
#禁用料接口
outNotifyUrl
:
http://10.68.30.22:8082/api/mlb/TowerIssue
outNotifyUrl
:
http://10.68.30.22:8082/api/mlb/TowerIssue
inNotifyUrl
:
http://10.68.30.22:8082/api/mlb/BackToWarehouse
inNotifyUrl
:
http://10.68.30.22:8082/api/mlb/BackToWarehouse
getBarcode
:
http://10.68.27.83/smf-core/thirdBarcode/getBarcode
\ No newline at end of file
\ No newline at end of file
getBarcode
:
http://10.68.27.83/smf-core/thirdBarcode/getBarcode
fetchReel
:
http://10.68.30.22:8082/api/mlb/FetchReel
\ No newline at end of file
\ No newline at end of file
src/main/resources/config/application-21088test.yml
查看文件 @
328d68a
...
@@ -4,4 +4,5 @@ api:
...
@@ -4,4 +4,5 @@ api:
inCheckUrl
:
http://10.68.21.21:8001/Npm/WmsCheckReelfob
#禁用料接口
inCheckUrl
:
http://10.68.21.21:8001/Npm/WmsCheckReelfob
#禁用料接口
outNotifyUrl
:
http://10.42.220.171:8082/api/mlb/TowerIssue
outNotifyUrl
:
http://10.42.220.171:8082/api/mlb/TowerIssue
inNotifyUrl
:
http://10.42.220.171:8082/api/mlb/BackToWarehouse
inNotifyUrl
:
http://10.42.220.171:8082/api/mlb/BackToWarehouse
getBarcode
:
http://10.68.27.83/smf-core/thirdBarcode/getBarcode
\ No newline at end of file
\ No newline at end of file
getBarcode
:
http://10.68.27.83/smf-core/thirdBarcode/getBarcode
fetchReel
:
http://10.42.220.171:8082/api/mlb/FetchReel
\ No newline at end of file
\ No newline at end of file
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论