Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit e49d82c0
由
zshaohui
编写于
2024-07-25 15:52:29 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
电子料入退库 重新设置数量
1 个父辈
01b69ecc
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
109 行增加
和
8 行删除
src/main/java/com/neotel/smfcore/core/barcode/service/po/Barcode.java
src/main/java/com/neotel/smfcore/core/device/rest/DeviceController.java
src/main/java/com/neotel/smfcore/custom/lizhen/LizhenApi.java
src/main/java/com/neotel/smfcore/custom/lizhen/wcs/bean/BackToWarehouse.java
src/main/java/com/neotel/smfcore/core/barcode/service/po/Barcode.java
查看文件 @
e49d82c
...
...
@@ -75,6 +75,8 @@ public class Barcode extends BasePo implements Serializable {
* 标签解析出来的数量,用于判断条码是否是重新打印的,重新打印的条码需要重新设置数量
*/
private
int
labelAmount
=
0
;
private
String
labelId
;
/**
* 盘宽
*/
...
...
src/main/java/com/neotel/smfcore/core/device/rest/DeviceController.java
查看文件 @
e49d82c
...
...
@@ -29,6 +29,7 @@ import com.neotel.smfcore.core.system.util.TaskService;
import
com.neotel.smfcore.custom.lizhen.LizhenApi
;
import
com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType
;
import
com.neotel.smfcore.custom.lizhen.virtual.service.manager.IVirInventoryManager
;
import
com.neotel.smfcore.custom.lizhen.wcs.bean.BackToWarehouse
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
com.neotel.smfcore.core.storage.enums.DeviceType
;
import
com.neotel.smfcore.core.device.handler.IDeviceHandler
;
...
...
@@ -322,7 +323,9 @@ public class DeviceController {
Storage
theStorage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
if
(!
barcode
.
isAskPutIn
())
{
lizhenApi
.
backToWarehouse
(
warhouseCode
,
theStorage
.
getName
(),
barcode
.
getBarcode
());
BackToWarehouse
back
=
lizhenApi
.
backToWarehouse
(
warhouseCode
,
theStorage
.
getName
(),
barcode
.
getBarcode
());
barcode
.
setLabelId
(
back
.
getLABEL_ID
());
barcode
.
setAmount
(
back
.
getLABEL_QTY
());
}
barcode
.
setWarehouseCode
(
warhouseCode
);
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/LizhenApi.java
查看文件 @
e49d82c
...
...
@@ -20,6 +20,7 @@ import com.neotel.smfcore.core.system.service.po.DataLog;
import
com.neotel.smfcore.custom.lizhen.innerBox.bean.PreWarningItem
;
import
com.neotel.smfcore.custom.lizhen.innerBox.util.CommonUtil
;
import
com.neotel.smfcore.custom.lizhen.innerBox.util.PreWarningItemCache
;
import
com.neotel.smfcore.custom.lizhen.wcs.bean.BackToWarehouse
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
...
...
@@ -467,7 +468,7 @@ public class LizhenApi extends DefaultSmfApiListener {
}
public
void
backToWarehouse
(
String
warhouseCode
,
String
machineName
,
String
barcode
)
{
public
BackToWarehouse
backToWarehouse
(
String
warhouseCode
,
String
machineName
,
String
barcode
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"PLANT_CODE"
,
CommonUtil
.
plantCode
);
paramMap
.
put
(
"RETURN_TYPE"
,
"return_tower"
);
//退回大库: return 退回料塔: return_tower
...
...
@@ -480,14 +481,17 @@ public class LizhenApi extends DefaultSmfApiListener {
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
resultStr
);
String
msgty
=
jsonObject
.
getString
(
"MSGTY"
);
if
(!
"S"
.
equalsIgnoreCase
(
msgty
)){
throw
new
ValidateException
(
""
,
barcode
+
"调用电子料入退库失败:"
+
resultStr
);
if
(!
"S"
.
equalsIgnoreCase
(
msgty
))
{
throw
new
ValidateException
(
""
,
barcode
+
"调用电子料入退库失败:"
+
resultStr
);
}
String
data
=
jsonObject
.
getString
(
"DATA"
);
return
JSONObject
.
parseObject
(
data
,
BackToWarehouse
.
class
);
}
catch
(
ApiException
e
)
{
e
.
printStackTrace
();
log
.
info
(
barcode
+
"入库通知,调用电子料入退库,异常为:"
+
e
.
getMessage
());
}
throw
new
ValidateException
(
""
,
barcode
+
"调用电子料入退库失败:未找到对应的信息"
);
}
...
...
@@ -497,11 +501,66 @@ public class LizhenApi extends DefaultSmfApiListener {
}
public
static
void
main
(
String
[]
args
)
{
String
resultStr
=
"{\"code\":0,\"data\":{\"amount\":20000,\"barSource\":\"\",\"barcode\":\"A107970012824280LA\",\"batch\":\"TPA242000055\",\"createDate\":\"2024-07-18 15:57:41\",\"dateCode\":\"20240513\",\"expireDate\":\"2025-05-13 00:00:00\",\"expireDateStr\":\"05/13/2025\",\"expired\":false,\"extraDataMap\":{},\"firstPutInDate\":\"2024-07-18 15:57:52\",\"fullCode\":\"103S00558-797001|TPA242000055-20240513|20000|A107970012824280LA|CYNTEC|TPA242000055000280LA\",\"fullQty\":0,\"height\":8,\"heightMap\":{},\"hold\":0,\"id\":\"57798\",\"inStoreHour\":50,\"inStoreMiniute\":39,\"initialAmount\":0,\"inventory\":false,\"labelAmount\":20000,\"labelId\":\"L2024071800000931\",\"maxStorageTime\":0.0,\"mixTime\":0,\"needOutDateStr\":\"\",\"onlySingleOut\":false,\"orderId\":\"\",\"orderItemId\":\"\",\"out\":false,\"partNumber\":\"103S00558\",\"plateSize\":7,\"posName\":\"\",\"produceDate\":\"2024-07-17 11:29:44\",\"provider\":\"CYNTEC\",\"providerNumber\":\"797001\",\"putInDate\":\"2024-07-18 15:57:52\",\"putInDateStr\":\"07/18/2024 15:57:52\",\"putInTime\":1721289472118,\"qty\":0,\"reachWarmTime\":1721471816486,\"reachedWarmTime\":true,\"reelAmount\":1,\"relationCodes\":[],\"seq\":4,\"smallReel\":true,\"solder\":false,\"solderStatus\":0,\"startWarmTime\":-1,\"status\":0,\"thickness\":\"\",\"type\":0,\"updateDate\":\"2024-07-20 16:25:44\",\"used\":false,\"usedCount\":0,\"warehouseCode\":\"W10B\",\"warmTime\":0,\"willExpired\":false},\"msg\":\"ok\",\"msgKey\":\"smfcore.ok\",\"okResult\":true,\"params\":[]}"
;
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
);
if
(
jsonObject
.
getInteger
(
"code"
)
!=
null
&&
jsonObject
.
getInteger
(
"code"
)
==
0
){
Barcode
barcode
=
JSONObject
.
parseObject
(
jsonObject
.
getString
(
"data"
),
Barcode
.
class
);
System
.
out
.
println
(
123
);
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/java/com/neotel/smfcore/custom/lizhen/wcs/bean/BackToWarehouse.java
0 → 100644
查看文件 @
e49d82c
package
com
.
neotel
.
smfcore
.
custom
.
lizhen
.
wcs
.
bean
;
import
lombok.Data
;
@Data
public
class
BackToWarehouse
{
// 厂区
private
String
PLANT_CODE
;
// 标签码
private
String
LABEL_ID
;
// 料号
private
String
MATERIAL_CODE
;
// 库别
private
String
WAREHOUSE_CODE
;
// 数量
private
int
LABEL_QTY
;
// 厂商代码
private
String
VENDOR_CODE
;
// 厂商名称
private
String
VENDOR_NAME
;
// 版本
private
String
VERSION
;
// 单据日期
private
String
GR_DATE
;
// 假设日期是字符串,如果需要使用日期类型,请改为LocalDate等
// 异动日期
private
String
TRAN_DATE
;
// 同上
// 状态
private
int
STATUS
;
// 假设状态是整数
// 仓管员
private
String
KEEPER_CODE
;
// 制造商
private
String
BRAND
;
// 单位
private
String
UNIT
;
// 批次号
private
String
BATCH_CODE
;
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论