Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 10e307e5
由
zshaohui
编写于
2024-01-16 13:18:12 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
过期时间根据mes返回 设置
1 个父辈
b4cd7d13
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
103 行增加
和
4 行删除
src/main/java/com/neotel/smfcore/core/barcode/bean/BarcodeRule.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLShelfHandler.java
src/main/java/com/neotel/smfcore/core/device/rest/DeviceController.java
src/main/java/com/neotel/smfcore/core/order/LiteOrderCache.java
src/main/java/com/neotel/smfcore/custom/lizhen/LizhenApi.java
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/OutLineController.java
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/WarehouseController.java
src/main/java/com/neotel/smfcore/custom/lizhen/innerBox/rest/InnerBoxRestController.java
src/main/java/com/neotel/smfcore/custom/lizhen/innerBox/rest/VirtualRestController.java
src/main/resources/config/application.yml
src/main/java/com/neotel/smfcore/core/barcode/bean/BarcodeRule.java
查看文件 @
10e307e
...
@@ -671,7 +671,7 @@ public class BarcodeRule {
...
@@ -671,7 +671,7 @@ public class BarcodeRule {
}
}
b
.
setDateCode
(
dateCode
);
b
.
setDateCode
(
dateCode
);
//设置生产日期
//设置生产日期
ExpiredSetting
setting
=
ExpireDateUtil
.
getExpiredSetting
(
dateCode
,
supplier
,
partNumber
);
/*
ExpiredSetting setting = ExpireDateUtil.getExpiredSetting(dateCode, supplier, partNumber);
if (setting != null) {
if (setting != null) {
try {
try {
produceDate = cn.hutool.core.date.DateUtil.parse(dateCode, setting.getExpFormat());
produceDate = cn.hutool.core.date.DateUtil.parse(dateCode, setting.getExpFormat());
...
@@ -681,7 +681,7 @@ public class BarcodeRule {
...
@@ -681,7 +681,7 @@ public class BarcodeRule {
} catch (Exception e) {
} catch (Exception e) {
e.printStackTrace();
e.printStackTrace();
}
}
}
}
*/
}
}
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLShelfHandler.java
查看文件 @
10e307e
...
@@ -425,6 +425,8 @@ public class NLShelfHandler extends BaseDeviceHandler {
...
@@ -425,6 +425,8 @@ public class NLShelfHandler extends BaseDeviceHandler {
throw
new
ValidateException
(
"smfcore.error.barcode.invalid"
,
"{0}不是有效的条码"
,
new
String
[]{
code
});
throw
new
ValidateException
(
"smfcore.error.barcode.invalid"
,
"{0}不是有效的条码"
,
new
String
[]{
code
});
}
}
barcode
=
lizhenApi
.
getInDate
(
barcode
);
//校验是否可以入库
//校验是否可以入库
Map
<
String
,
Object
>
brandQty
=
lizhenApi
.
brandQty
(
barcode
.
getPartNumber
(),
barcode
.
getProvider
());
Map
<
String
,
Object
>
brandQty
=
lizhenApi
.
brandQty
(
barcode
.
getPartNumber
(),
barcode
.
getProvider
());
if
(
brandQty
==
null
||
brandQty
.
isEmpty
())
{
if
(
brandQty
==
null
||
brandQty
.
isEmpty
())
{
...
...
src/main/java/com/neotel/smfcore/core/device/rest/DeviceController.java
查看文件 @
10e307e
...
@@ -213,6 +213,11 @@ public class DeviceController {
...
@@ -213,6 +213,11 @@ public class DeviceController {
barcode
=
barcodeCanPutIn
;
barcode
=
barcodeCanPutIn
;
}
}
Barcode
barcodeDate
=
lizhenApi
.
getInDate
(
barcode
);
if
(
barcodeDate
!=
null
){
barcode
=
barcodeDate
;
}
Barcode
barcodeApi
=
lizhenApi
.
barcodeInfo
(
barcode
);
Barcode
barcodeApi
=
lizhenApi
.
barcodeInfo
(
barcode
);
//如果是L开头的去量测
//如果是L开头的去量测
...
...
src/main/java/com/neotel/smfcore/core/order/LiteOrderCache.java
查看文件 @
10e307e
...
@@ -590,6 +590,15 @@ public class LiteOrderCache {
...
@@ -590,6 +590,15 @@ public class LiteOrderCache {
excludePosIds
.
add
(
pos
.
getId
());
excludePosIds
.
add
(
pos
.
getId
());
pos
=
null
;
pos
=
null
;
}
}
try
{
lizhenApi
.
getInDate
(
pos
.
getBarcode
());
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
error
(
pos
.
getBarcode
().
getBarcode
()
+
":"
+
e
.
getMessage
());
excludePosIds
.
add
(
pos
.
getId
());
pos
=
null
;
}
}
while
(
pos
==
null
);
}
while
(
pos
==
null
);
}
}
if
(
pos
==
null
)
{
if
(
pos
==
null
)
{
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/LizhenApi.java
查看文件 @
10e307e
package
com
.
neotel
.
smfcore
.
custom
.
lizhen
;
package
com
.
neotel
.
smfcore
.
custom
.
lizhen
;
import
cn.hutool.core.date.DateTime
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.json.JSONUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONArray
;
...
@@ -67,6 +69,9 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -67,6 +69,9 @@ public class LizhenApi extends DefaultSmfApiListener {
@Value
(
"${api.checkReelMeasure}"
)
@Value
(
"${api.checkReelMeasure}"
)
private
String
checkReelMeasureUrl
=
""
;
private
String
checkReelMeasureUrl
=
""
;
@Value
(
"${api.getInDateUrl}"
)
private
String
getInDateUrl
=
""
;
@PostConstruct
@PostConstruct
public
void
init
(){
public
void
init
(){
fetchGRUrl
=
dataCache
.
getConfigCache
(
"fetchGRUrl"
,
fetchGRUrl
);
fetchGRUrl
=
dataCache
.
getConfigCache
(
"fetchGRUrl"
,
fetchGRUrl
);
...
@@ -77,6 +82,7 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -77,6 +82,7 @@ public class LizhenApi extends DefaultSmfApiListener {
outNotifyUrlPK
=
dataCache
.
getConfigCache
(
"api.outNotifyUrlPK"
,
outNotifyUrlPK
);
outNotifyUrlPK
=
dataCache
.
getConfigCache
(
"api.outNotifyUrlPK"
,
outNotifyUrlPK
);
batchCheckUrl
=
dataCache
.
getConfigCache
(
"api.batchCheckUrl"
,
batchCheckUrl
);
batchCheckUrl
=
dataCache
.
getConfigCache
(
"api.batchCheckUrl"
,
batchCheckUrl
);
checkReelMeasureUrl
=
dataCache
.
getConfigCache
(
"api.checkReelMeasure"
,
checkReelMeasureUrl
);
checkReelMeasureUrl
=
dataCache
.
getConfigCache
(
"api.checkReelMeasure"
,
checkReelMeasureUrl
);
getInDateUrl
=
dataCache
.
getConfigCache
(
"api.getInDate"
,
getInDateUrl
);
}
}
/**
/**
...
@@ -590,6 +596,43 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -590,6 +596,43 @@ public class LizhenApi extends DefaultSmfApiListener {
}
}
public
Barcode
getInDate
(
Barcode
barcode
)
{
if
(
StringUtils
.
isBlank
(
getInDateUrl
))
{
return
barcode
;
}
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"material_code"
,
barcode
.
getPartNumber
());
paramMap
.
put
(
"date_code"
,
barcode
.
getDateCode
());
paramMap
.
put
(
"plant_code"
,
plant
);
paramMap
.
put
(
"brand"
,
barcode
.
getProvider
());
try
{
log
.
info
(
barcode
.
getBarcode
()
+
":getInDate入参为:"
+
JSON
.
toJSONString
(
paramMap
));
String
result
=
HttpHelper
.
postJson
(
getInDateUrl
,
paramMap
);
log
.
info
(
barcode
.
getBarcode
()
+
":getInDate出参为:"
+
result
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
result
);
String
msgty
=
jsonObject
.
getString
(
"MSGTY"
);
if
(
"S"
.
equalsIgnoreCase
(
msgty
))
{
int
data
=
jsonObject
.
getIntValue
(
"DATA"
);
if
(
data
<
0
)
{
throw
new
ValidateException
(
"smfcore.error.barcode.expired"
,
"物料已过期,无法入库"
);
}
else
if
(
data
>
0
){
Date
expireDate
=
DateUtil
.
offsetDay
(
new
Date
(),
data
);
barcode
.
setExpireDate
(
expireDate
);
}
else
{
barcode
.
setExpireDate
(
null
);
}
return
barcode
;
}
else
{
throw
new
ValidateException
(
"smfcore.mesApi.getInDate.ng"
,
barcode
.
getBarcode
()
+
"验证ng:"
+
jsonObject
.
getString
(
"MSGTX"
));
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
throw
new
ValidateException
(
"smfcore.mesApi.getInDate.ng"
,
barcode
.
getBarcode
()
+
"验证ng:"
+
e
.
getMessage
());
}
}
@Override
@Override
public
boolean
isForThisApi
(
String
apiName
)
{
public
boolean
isForThisApi
(
String
apiName
)
{
return
apiName
!=
null
&&
apiName
.
equalsIgnoreCase
(
"Lizhen"
);
return
apiName
!=
null
&&
apiName
.
equalsIgnoreCase
(
"Lizhen"
);
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/OutLineController.java
查看文件 @
10e307e
...
@@ -221,6 +221,15 @@ public class OutLineController {
...
@@ -221,6 +221,15 @@ public class OutLineController {
}
}
}
}
try
{
Barcode
barcodeDate
=
lizhenApi
.
getInDate
(
barcode
);
if
(
barcodeDate
!=
null
){
barcode
=
barcodeDate
;
}
}
catch
(
Exception
e
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
e
.
getMessage
());
}
//判断物料是否过期
//判断物料是否过期
Date
expireDate
=
barcode
.
getExpireDate
();
Date
expireDate
=
barcode
.
getExpireDate
();
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/WarehouseController.java
查看文件 @
10e307e
...
@@ -1136,6 +1136,13 @@ public class WarehouseController {
...
@@ -1136,6 +1136,13 @@ public class WarehouseController {
e
.
printStackTrace
();
e
.
printStackTrace
();
return
ResultBean
.
newErrorResult
(-
1
,
""
,
e
.
getMessage
());
return
ResultBean
.
newErrorResult
(-
1
,
""
,
e
.
getMessage
());
}
}
try
{
lizhenApi
.
getInDate
(
codeBean
.
getBarcode
());
}
catch
(
Exception
e
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
e
.
getMessage
());
}
List
<
Barcode
>
subCodes
=
pidBarcode
.
getSubCodeList
();
List
<
Barcode
>
subCodes
=
pidBarcode
.
getSubCodeList
();
if
(
subCodes
==
null
||
subCodes
.
isEmpty
())
{
if
(
subCodes
==
null
||
subCodes
.
isEmpty
())
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"料箱:"
+
boxStr
+
",没有可出库的物料"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"料箱:"
+
boxStr
+
",没有可出库的物料"
);
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/innerBox/rest/InnerBoxRestController.java
查看文件 @
10e307e
...
@@ -26,6 +26,7 @@ import com.neotel.smfcore.core.storage.service.po.StoragePos;
...
@@ -26,6 +26,7 @@ import com.neotel.smfcore.core.storage.service.po.StoragePos;
import
com.neotel.smfcore.core.system.service.manager.IDataLogManager
;
import
com.neotel.smfcore.core.system.service.manager.IDataLogManager
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.custom.lizhen.LizhenApi
;
import
com.neotel.smfcore.custom.lizhen.innerBox.bean.OutLotInfo
;
import
com.neotel.smfcore.custom.lizhen.innerBox.bean.OutLotInfo
;
import
com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType
;
import
com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType
;
import
com.neotel.smfcore.custom.lizhen.innerBox.util.OutLotInfoCache
;
import
com.neotel.smfcore.custom.lizhen.innerBox.util.OutLotInfoCache
;
...
@@ -88,6 +89,9 @@ public class InnerBoxRestController {
...
@@ -88,6 +89,9 @@ public class InnerBoxRestController {
@Autowired
@Autowired
private
SmfApi
smfApi
;
private
SmfApi
smfApi
;
@Autowired
private
LizhenApi
lizhenApi
;
//料架缓存id
//料架缓存id
private
static
Map
<
String
,
String
>
labelOrderItemMap
=
new
ConcurrentHashMap
<>();
private
static
Map
<
String
,
String
>
labelOrderItemMap
=
new
ConcurrentHashMap
<>();
...
@@ -524,6 +528,15 @@ public class InnerBoxRestController {
...
@@ -524,6 +528,15 @@ public class InnerBoxRestController {
return
ResultBean
.
newErrorResult
(-
1
,
""
,
e
.
getMessage
());
return
ResultBean
.
newErrorResult
(-
1
,
""
,
e
.
getMessage
());
}
}
try
{
Barcode
barcodeDate
=
lizhenApi
.
getInDate
(
barcode
);
if
(
barcodeDate
!=
null
){
barcode
=
barcodeDate
;
}
}
catch
(
Exception
e
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
e
.
getMessage
());
}
//不在仓中,不允许出库
//不在仓中,不允许出库
StoragePos
storagePos
=
storagePosManager
.
getByBarcode
(
barcode
.
getBarcode
());
StoragePos
storagePos
=
storagePosManager
.
getByBarcode
(
barcode
.
getBarcode
());
if
(
storagePos
==
null
){
if
(
storagePos
==
null
){
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/innerBox/rest/VirtualRestController.java
查看文件 @
10e307e
...
@@ -163,6 +163,16 @@ public class VirtualRestController {
...
@@ -163,6 +163,16 @@ public class VirtualRestController {
return
ResultBean
.
newErrorResult
(-
1
,
""
,
e
.
getMessage
());
return
ResultBean
.
newErrorResult
(-
1
,
""
,
e
.
getMessage
());
}
}
try
{
Barcode
barcodeDate
=
lizhenApi
.
getInDate
(
barcode
);
if
(
barcodeDate
!=
null
){
barcode
=
barcodeDate
;
}
}
catch
(
Exception
e
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
e
.
getMessage
());
}
//判断是否已经存在库位
//判断是否已经存在库位
StoragePos
pos
=
storagePosManager
.
getByBarcode
(
barcode
.
getBarcode
());
StoragePos
pos
=
storagePosManager
.
getByBarcode
(
barcode
.
getBarcode
());
if
(
pos
!=
null
)
{
if
(
pos
!=
null
)
{
...
@@ -350,7 +360,7 @@ public class VirtualRestController {
...
@@ -350,7 +360,7 @@ public class VirtualRestController {
barcode
.
setAmount
(
dataLog
.
getNum
());
barcode
.
setAmount
(
dataLog
.
getNum
());
barcode
.
setDateCode
(
dataLog
.
getDateCode
());
barcode
.
setDateCode
(
dataLog
.
getDateCode
());
//设置生产日期
//设置生产日期
ExpiredSetting
setting
=
ExpireDateUtil
.
getExpiredSetting
(
dataLog
.
getDateCode
(),
dataLog
.
getProvider
(),
dataLog
.
getPartNumber
());
/*
ExpiredSetting setting = ExpireDateUtil.getExpiredSetting(dataLog.getDateCode(), dataLog.getProvider(),dataLog.getPartNumber());
if (setting != null) {
if (setting != null) {
try {
try {
Date produceDate = cn.hutool.core.date.DateUtil.parse(dataLog.getDateCode(), setting.getExpFormat());
Date produceDate = cn.hutool.core.date.DateUtil.parse(dataLog.getDateCode(), setting.getExpFormat());
...
@@ -360,7 +370,7 @@ public class VirtualRestController {
...
@@ -360,7 +370,7 @@ public class VirtualRestController {
} catch (Exception e) {
} catch (Exception e) {
e.printStackTrace();
e.printStackTrace();
}
}
}
}
*/
barcode
.
setPartNumber
(
dataLog
.
getPartNumber
());
barcode
.
setPartNumber
(
dataLog
.
getPartNumber
());
barcode
.
setBatch
(
dataLog
.
getBatchInfo
());
barcode
.
setBatch
(
dataLog
.
getBatchInfo
());
barcode
.
setProvider
(
dataLog
.
getProvider
());
barcode
.
setProvider
(
dataLog
.
getProvider
());
...
...
src/main/resources/config/application.yml
查看文件 @
10e307e
...
@@ -14,6 +14,7 @@ api:
...
@@ -14,6 +14,7 @@ api:
brandQtyUrl
:
#http://172.30.170.199:8082/api/wcs/brandQty #gr标签满卷数
brandQtyUrl
:
#http://172.30.170.199:8082/api/wcs/brandQty #gr标签满卷数
importUrl
:
#http://172.30.150.83:8001/smf-core/ext/forward/getDataLogs #内仓导入外仓picking虚拟仓数据
importUrl
:
#http://172.30.150.83:8001/smf-core/ext/forward/getDataLogs #内仓导入外仓picking虚拟仓数据
checkReelMeasure
:
#http://172.30.60.117:8001/Sct/CheckReelMeasure #外仓散料仓量测接口
checkReelMeasure
:
#http://172.30.60.117:8001/Sct/CheckReelMeasure #外仓散料仓量测接口
getInDateUrl
:
http://172.30.170.199:8082/api/Mes/GetInDate
plant
:
W337
plant
:
W337
werks
:
W337
werks
:
W337
outerFactory
:
B15
outerFactory
:
B15
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论