Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 81b10db5
由
zshaohui
编写于
2025-06-05 10:20:26 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.对接mes系统修改
1 个父辈
a926e363
显示空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
618 行增加
和
197 行删除
src/main/java/com/neotel/smfcore/core/api/SmfApi.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/core/order/service/po/LiteOrder.java
src/main/java/com/neotel/smfcore/core/order/service/po/LiteOrderItem.java
src/main/java/com/neotel/smfcore/custom/lizhen/DifferenceReelController.java
src/main/java/com/neotel/smfcore/custom/lizhen/LizhenApi.java
src/main/java/com/neotel/smfcore/custom/lizhen/LizhenController.java
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/InventoryController.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/bean/DifferentMaterial.java
src/main/java/com/neotel/smfcore/custom/lizhen/bean/ManualTower.java
src/main/java/com/neotel/smfcore/custom/lizhen/innerBox/bean/PreWarningItem.java
src/main/java/com/neotel/smfcore/custom/lizhen/innerBox/rest/VirtualRestController.java
src/main/java/com/neotel/smfcore/custom/lizhen/util/CommonUtil.java
src/main/java/com/neotel/smfcore/core/api/SmfApi.java
查看文件 @
81b10db
...
@@ -69,14 +69,14 @@ public class SmfApi {
...
@@ -69,14 +69,14 @@ public class SmfApi {
public
void
init
(){
public
void
init
(){
apiName
=
dataCache
.
getConfigCache
(
"api.name"
,
apiName
);
apiName
=
dataCache
.
getConfigCache
(
"api.name"
,
apiName
);
log
.
info
(
"apiName:"
+
apiName
);
log
.
info
(
"apiName:"
+
apiName
);
inCheckUrl
=
dataCache
.
getConfigCache
(
"api.inCheckUrl"
,
inCheckUrl
);
/*
inCheckUrl = dataCache.getConfigCache("api.inCheckUrl",inCheckUrl);
inNotifyUrl = dataCache.getConfigCache("api.inNotifyUrl",inNotifyUrl);
inNotifyUrl = dataCache.getConfigCache("api.inNotifyUrl",inNotifyUrl);
outNotifyUrl = dataCache.getConfigCache("api.outNotifyUrl",outNotifyUrl);
outNotifyUrl = dataCache.getConfigCache("api.outNotifyUrl",outNotifyUrl);
orderNotifyUrl = dataCache.getConfigCache("api.orderNotifyUrl",orderNotifyUrl);
orderNotifyUrl = dataCache.getConfigCache("api.orderNotifyUrl",orderNotifyUrl);
fetchInListUrl = dataCache.getConfigCache("api.fetchInListUrl",fetchInListUrl);
fetchInListUrl = dataCache.getConfigCache("api.fetchInListUrl",fetchInListUrl);
fetchOrderUrl = dataCache.getConfigCache("api.fetchOrderUrl",fetchOrderUrl);
fetchOrderUrl = dataCache.getConfigCache("api.fetchOrderUrl",fetchOrderUrl);
barcodeInfoUrl = dataCache.getConfigCache("api.barcodeInfoUrl",barcodeInfoUrl);
barcodeInfoUrl = dataCache.getConfigCache("api.barcodeInfoUrl",barcodeInfoUrl);
importUrl
=
dataCache
.
getConfigCache
(
"api.importUrl"
,
importUrl
);
importUrl = dataCache.getConfigCache("api.importUrl",importUrl);
*/
}
}
/**
/**
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLShelfHandler.java
查看文件 @
81b10db
...
@@ -24,6 +24,8 @@ import com.neotel.smfcore.core.system.service.po.DataLog;
...
@@ -24,6 +24,8 @@ import com.neotel.smfcore.core.system.service.po.DataLog;
import
com.neotel.smfcore.core.system.util.DevicesStatusUtil
;
import
com.neotel.smfcore.core.system.util.DevicesStatusUtil
;
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.LizhenApi
;
import
com.neotel.smfcore.custom.lizhen.bean.apirequest.BrandQtyRequest
;
import
com.neotel.smfcore.custom.lizhen.bean.apiresult.BrandQtyResult
;
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.rest.InnerBoxRestController
;
import
com.neotel.smfcore.custom.lizhen.innerBox.rest.InnerBoxRestController
;
import
com.neotel.smfcore.security.TokenProvider
;
import
com.neotel.smfcore.security.TokenProvider
;
...
@@ -428,8 +430,8 @@ public class NLShelfHandler extends BaseDeviceHandler {
...
@@ -428,8 +430,8 @@ public class NLShelfHandler extends BaseDeviceHandler {
barcode
=
lizhenApi
.
getInDate
(
barcode
);
barcode
=
lizhenApi
.
getInDate
(
barcode
);
//校验是否可以入库
//校验是否可以入库
Map
<
String
,
Object
>
brandQty
=
lizhenApi
.
brandQty
(
barcode
.
getPartNumber
(),
barcode
.
getProvider
(
));
BrandQtyResult
brandQtyResult
=
lizhenApi
.
brandQty
(
new
BrandQtyRequest
(
barcode
.
getPartNumber
(),
barcode
.
getProvider
()
));
if
(
brandQty
==
null
||
brandQty
.
isEmpty
()
)
{
if
(
brandQty
Result
==
null
)
{
throw
new
ValidateException
(
"smfcore.error.barcode.partNumber.invalid"
,
"{0}不是有效的料号"
,
new
String
[]{
barcode
.
getPartNumber
()});
throw
new
ValidateException
(
"smfcore.error.barcode.partNumber.invalid"
,
"{0}不是有效的料号"
,
new
String
[]{
barcode
.
getPartNumber
()});
}
}
...
...
src/main/java/com/neotel/smfcore/core/device/rest/DeviceController.java
查看文件 @
81b10db
...
@@ -26,6 +26,8 @@ import com.neotel.smfcore.core.system.service.po.DataLog;
...
@@ -26,6 +26,8 @@ import com.neotel.smfcore.core.system.service.po.DataLog;
import
com.neotel.smfcore.core.system.util.DevicesStatusUtil
;
import
com.neotel.smfcore.core.system.util.DevicesStatusUtil
;
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.LizhenApi
;
import
com.neotel.smfcore.custom.lizhen.bean.apirequest.BrandQtyRequest
;
import
com.neotel.smfcore.custom.lizhen.bean.apiresult.BrandQtyResult
;
import
com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType
;
import
com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
com.neotel.smfcore.core.storage.enums.DeviceType
;
import
com.neotel.smfcore.core.storage.enums.DeviceType
;
...
@@ -204,8 +206,8 @@ public class DeviceController {
...
@@ -204,8 +206,8 @@ public class DeviceController {
}
}
}
}
//校验是否可以入库
//校验是否可以入库
Map
<
String
,
Object
>
brandQty
=
lizhenApi
.
brandQty
(
barcode
.
getPartNumber
(),
barcode
.
getProvider
(
));
BrandQtyResult
brandQtyResult
=
lizhenApi
.
brandQty
(
new
BrandQtyRequest
(
barcode
.
getPartNumber
(),
barcode
.
getProvider
()
));
if
(
brandQty
==
null
||
brandQty
.
isEmpty
()
)
{
if
(
brandQty
Result
==
null
)
{
throw
new
ValidateException
(
"smfcore.error.barcode.partNumber.invalid"
,
"{0}不是有效的料号"
,
new
String
[]{
barcode
.
getPartNumber
()});
throw
new
ValidateException
(
"smfcore.error.barcode.partNumber.invalid"
,
"{0}不是有效的料号"
,
new
String
[]{
barcode
.
getPartNumber
()});
}
}
Barcode
barcodeCanPutIn
=
smfApi
.
canPutInAfterResolve
(
barcode
);
Barcode
barcodeCanPutIn
=
smfApi
.
canPutInAfterResolve
(
barcode
);
...
...
src/main/java/com/neotel/smfcore/core/order/LiteOrderCache.java
查看文件 @
81b10db
...
@@ -537,6 +537,8 @@ public class LiteOrderCache {
...
@@ -537,6 +537,8 @@ public class LiteOrderCache {
Collection
<
String
>
excludePosIds
=
excludeOutPosIds
();
Collection
<
String
>
excludePosIds
=
excludeOutPosIds
();
String
partNumber
=
orderItem
.
getPn
();
String
partNumber
=
orderItem
.
getPn
();
String
[]
partNumberSpl
=
partNumber
.
split
(
","
);
StoragePos
pos
=
null
;
StoragePos
pos
=
null
;
if
(
cacheOrder
.
getType
()
==
2
)
{
if
(
cacheOrder
.
getType
()
==
2
)
{
//RI
//RI
...
@@ -550,11 +552,12 @@ public class LiteOrderCache {
...
@@ -550,11 +552,12 @@ public class LiteOrderCache {
}
else
{
}
else
{
//PN
//PN
do
{
do
{
for
(
String
pn
:
partNumberSpl
)
{
//首先按空闲料仓进行出库
//首先按空闲料仓进行出库
List
<
StoragePos
>
storagePosList
=
storagePosManager
.
findPartNumberListInStorages
(
freeStorageIds
,
partNumber
,
excludePosIds
,
checkoutType
,
orderItem
.
getBrand
());
List
<
StoragePos
>
storagePosList
=
storagePosManager
.
findPartNumberListInStorages
(
freeStorageIds
,
pn
,
excludePosIds
,
checkoutType
,
orderItem
.
getBrand
());
//如果为空的话,则出全部的
//如果为空的话,则出全部的
if
(
storagePosList
==
null
||
storagePosList
.
isEmpty
())
{
if
(
storagePosList
==
null
||
storagePosList
.
isEmpty
())
{
storagePosList
=
storagePosManager
.
findPartNumberListInStorages
(
availableStorageIds
,
partNumber
,
excludePosIds
,
checkoutType
,
orderItem
.
getBrand
());
storagePosList
=
storagePosManager
.
findPartNumberListInStorages
(
availableStorageIds
,
pn
,
excludePosIds
,
checkoutType
,
orderItem
.
getBrand
());
}
}
//排序找到最早的
//排序找到最早的
...
@@ -577,6 +580,10 @@ public class LiteOrderCache {
...
@@ -577,6 +580,10 @@ public class LiteOrderCache {
}
}
}
}
}
}
if
(
pos
!=
null
)
{
break
;
}
}
if
(
pos
==
null
)
{
if
(
pos
==
null
)
{
break
;
break
;
...
@@ -957,13 +964,13 @@ public class LiteOrderCache {
...
@@ -957,13 +964,13 @@ public class LiteOrderCache {
if
(
alreadyCheckBox
.
contains
(
barcode
.
getBarcode
()))
{
if
(
alreadyCheckBox
.
contains
(
barcode
.
getBarcode
()))
{
log
.
info
(
"当前料箱已经校验过:"
+
barcode
.
getBarcode
());
log
.
info
(
"当前料箱已经校验过:"
+
barcode
.
getBarcode
());
}
else
{
}
else
{
batchCheckList
=
lizhenApi
.
batchCheck
(
subCodeList
);
batchCheckList
=
lizhenApi
.
batchCheck
Reel
(
subCodeList
,
""
,
""
);
if
(
batchCheckList
==
null
||
batchCheckList
.
isEmpty
())
{
if
(
batchCheckList
==
null
||
batchCheckList
.
isEmpty
())
{
alreadyCheckBox
.
add
(
barcode
.
getBarcode
());
alreadyCheckBox
.
add
(
barcode
.
getBarcode
());
}
}
}
}
}
else
{
}
else
{
batchCheckList
=
lizhenApi
.
batchCheck
(
subCodeList
);
batchCheckList
=
lizhenApi
.
batchCheck
Reel
(
subCodeList
,
""
,
""
);
if
(
batchCheckList
==
null
||
batchCheckList
.
isEmpty
())
{
if
(
batchCheckList
==
null
||
batchCheckList
.
isEmpty
())
{
alreadyCheckBox
.
add
(
barcode
.
getBarcode
());
alreadyCheckBox
.
add
(
barcode
.
getBarcode
());
}
}
...
...
src/main/java/com/neotel/smfcore/core/order/service/po/LiteOrder.java
查看文件 @
81b10db
...
@@ -151,6 +151,8 @@ public class LiteOrder extends BasePo implements Serializable {
...
@@ -151,6 +151,8 @@ public class LiteOrder extends BasePo implements Serializable {
*/
*/
private
Date
finishDate
;
private
Date
finishDate
;
private
boolean
differenceReq
=
false
;
public
void
setClosed
(
boolean
value
){
public
void
setClosed
(
boolean
value
){
this
.
closed
=
value
;
this
.
closed
=
value
;
...
...
src/main/java/com/neotel/smfcore/core/order/service/po/LiteOrderItem.java
查看文件 @
81b10db
...
@@ -219,6 +219,17 @@ public class LiteOrderItem extends BasePo implements Serializable ,Comparable<Li
...
@@ -219,6 +219,17 @@ public class LiteOrderItem extends BasePo implements Serializable ,Comparable<Li
*/
*/
private
Date
issuanceDate
;
private
Date
issuanceDate
;
private
String
station
;
private
String
pickingId
;
private
String
rowId
;
private
int
itemNo
;
private
String
model
;
/**
/**
* 出库是否满足要求,已出库数量大于需求数量
* 出库是否满足要求,已出库数量大于需求数量
*/
*/
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/DifferenceReelController.java
0 → 100644
查看文件 @
81b10db
package
com
.
neotel
.
smfcore
.
custom
.
lizhen
;
import
com.alibaba.fastjson.JSONObject
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.order.LiteOrderCache
;
import
com.neotel.smfcore.core.order.service.manager.ILiteOrderManager
;
import
com.neotel.smfcore.core.order.service.po.LiteOrder
;
import
com.neotel.smfcore.core.order.service.po.LiteOrderItem
;
import
com.neotel.smfcore.custom.lizhen.bean.DifferentMaterial
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
@Slf4j
@RestController
public
class
DifferenceReelController
{
@Autowired
private
ILiteOrderManager
liteOrderManager
;
@Autowired
private
LiteOrderCache
liteOrderCache
;
@ApiOperation
(
"工单差异料上传"
)
@RequestMapping
(
"/api/Mes/differenceReel"
)
@AnonymousAccess
public
synchronized
String
differenceReel
(
@RequestBody
List
<
DifferentMaterial
>
differentMaterialList
)
{
log
.
info
(
"收到mes的差异料数据为:"
+
JSONObject
.
toJSONString
(
differentMaterialList
));
List
<
LiteOrderItem
>
itemList
=
new
ArrayList
<>();
for
(
DifferentMaterial
differentMaterial
:
differentMaterialList
)
{
String
wo
=
differentMaterial
.
getWo
();
String
mc
=
differentMaterial
.
getMc
();
String
ipn
=
differentMaterial
.
getIpn
();
if
(
StringUtils
.
isEmpty
(
ipn
)){
continue
;
}
String
zone
=
differentMaterial
.
getZone
();
String
gidLineSide
=
differentMaterial
.
getGidLineSide
();
String
[]
gidLineSideS
=
gidLineSide
.
split
(
"_"
);
if
(
gidLineSideS
.
length
<
3
){
return
gidLineSide
+
"格式不正确"
;
}
String
line
=
gidLineSideS
[
0
];
String
side
=
gidLineSideS
[
2
];
LiteOrderItem
item
=
new
LiteOrderItem
();
item
.
setMo
(
wo
);
item
.
setMachineName
(
mc
);
item
.
setPn
(
ipn
);
item
.
setStation
(
zone
);
item
.
setTableNo
(
zone
);
item
.
setLine
(
line
);
item
.
setSide
(
side
);
item
.
setNeedNum
(
1
);
item
.
setNeedReelCount
(
1
);
itemList
.
add
(
item
);
}
if
(
itemList
!=
null
&&
!
itemList
.
isEmpty
()){
Map
<
String
,
List
<
LiteOrderItem
>>
itemMap
=
itemList
.
stream
().
collect
(
Collectors
.
groupingBy
(
LiteOrderItem:
:
getLine
));
for
(
String
line
:
itemMap
.
keySet
())
{
List
<
LiteOrderItem
>
item
=
itemMap
.
get
(
line
);
LiteOrder
liteOrder
=
new
LiteOrder
();
liteOrder
.
setOrderNo
(
System
.
currentTimeMillis
()+
"差异料"
);
liteOrder
.
setLine
(
line
);
liteOrder
.
setTotalTaskReelCount
(
item
.
size
());
liteOrder
.
setOrderItems
(
item
);
liteOrder
.
setDifferenceReq
(
true
);
liteOrder
=
liteOrderManager
.
createWithItems
(
liteOrder
);
liteOrderCache
.
addOrderToMap
(
liteOrder
);
}
}
return
""
;
}
}
src/main/java/com/neotel/smfcore/custom/lizhen/LizhenApi.java
查看文件 @
81b10db
...
@@ -10,6 +10,7 @@ import com.neotel.smfcore.common.exception.ApiException;
...
@@ -10,6 +10,7 @@ import com.neotel.smfcore.common.exception.ApiException;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.HttpHelper
;
import
com.neotel.smfcore.common.utils.HttpHelper
;
import
com.neotel.smfcore.common.utils.JsonUtil
;
import
com.neotel.smfcore.common.utils.JsonUtil
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.api.listener.BaseSmfApiListener
;
import
com.neotel.smfcore.core.api.listener.BaseSmfApiListener
;
import
com.neotel.smfcore.core.api.listener.DefaultSmfApiListener
;
import
com.neotel.smfcore.core.api.listener.DefaultSmfApiListener
;
...
@@ -19,11 +20,17 @@ import com.neotel.smfcore.core.device.util.DataCache;
...
@@ -19,11 +20,17 @@ import com.neotel.smfcore.core.device.util.DataCache;
import
com.neotel.smfcore.core.order.LiteOrderCache
;
import
com.neotel.smfcore.core.order.LiteOrderCache
;
import
com.neotel.smfcore.core.order.service.po.LiteOrder
;
import
com.neotel.smfcore.core.order.service.po.LiteOrder
;
import
com.neotel.smfcore.core.storage.enums.DeviceType
;
import
com.neotel.smfcore.core.storage.enums.DeviceType
;
import
com.neotel.smfcore.core.storage.service.manager.IStoragePosManager
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.custom.lizhen.agvBox.bean.GrLabel
;
import
com.neotel.smfcore.custom.lizhen.agvBox.bean.GrLabel
;
import
com.neotel.smfcore.custom.lizhen.bean.apirequest.BrandQtyRequest
;
import
com.neotel.smfcore.custom.lizhen.bean.apiresult.BrandQtyResult
;
import
com.neotel.smfcore.custom.lizhen.bean.apiresult.LuxsanApiResult
;
import
com.neotel.smfcore.custom.lizhen.innerBox.bean.PreWarningItem
;
import
com.neotel.smfcore.custom.lizhen.innerBox.bean.PreWarningItem
;
import
com.neotel.smfcore.custom.lizhen.innerBox.util.PreWarningItemCache
;
import
com.neotel.smfcore.custom.lizhen.innerBox.util.PreWarningItemCache
;
import
com.neotel.smfcore.custom.lizhen.util.CommonUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
...
@@ -45,6 +52,9 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -45,6 +52,9 @@ public class LizhenApi extends DefaultSmfApiListener {
@Autowired
@Autowired
private
DataCache
dataCache
;
private
DataCache
dataCache
;
@Autowired
private
IStoragePosManager
storagePosManager
;
@Value
(
"${api.fetchGRUrl}"
)
@Value
(
"${api.fetchGRUrl}"
)
private
String
fetchGRUrl
;
private
String
fetchGRUrl
;
...
@@ -63,8 +73,8 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -63,8 +73,8 @@ public class LizhenApi extends DefaultSmfApiListener {
@Value
(
"${api.outNotifyUrlPK}"
)
@Value
(
"${api.outNotifyUrlPK}"
)
private
String
outNotifyUrlPK
=
""
;
private
String
outNotifyUrlPK
=
""
;
@Value
(
"${api.batchCheck
Ur
l}"
)
@Value
(
"${api.batchCheck
Ree
l}"
)
private
String
batchCheck
Ur
l
=
""
;
private
String
batchCheck
Ree
l
=
""
;
@Value
(
"${api.checkReelMeasure}"
)
@Value
(
"${api.checkReelMeasure}"
)
private
String
checkReelMeasureUrl
=
""
;
private
String
checkReelMeasureUrl
=
""
;
...
@@ -72,18 +82,14 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -72,18 +82,14 @@ public class LizhenApi extends DefaultSmfApiListener {
@Value
(
"${api.getInDateUrl}"
)
@Value
(
"${api.getInDateUrl}"
)
private
String
getInDateUrl
=
""
;
private
String
getInDateUrl
=
""
;
@PostConstruct
@Value
(
"${api.commonGIRecordUrl}"
)
public
void
init
(){
private
String
commonGIRecordUrl
=
""
;
fetchGRUrl
=
dataCache
.
getConfigCache
(
"fetchGRUrl"
,
fetchGRUrl
);
brandQtyUrl
=
dataCache
.
getConfigCache
(
"brandQtyUrl"
,
brandQtyUrl
);
@Value
(
"${api.commonRMRecordUrl}"
)
plant
=
dataCache
.
getConfigCache
(
"plant"
,
plant
);
private
String
commonRMRecordUrl
=
""
;
barcodeInfoUrl
=
dataCache
.
getConfigCache
(
"barcodeInfoUrl"
,
barcodeInfoUrl
);
werks
=
dataCache
.
getConfigCache
(
"werks"
,
werks
);
@Value
(
"${api.save2DReelInfoUrl}"
)
outNotifyUrlPK
=
dataCache
.
getConfigCache
(
"api.outNotifyUrlPK"
,
outNotifyUrlPK
);
private
String
save2DReelInfoUrl
=
""
;
batchCheckUrl
=
dataCache
.
getConfigCache
(
"api.batchCheckUrl"
,
batchCheckUrl
);
checkReelMeasureUrl
=
dataCache
.
getConfigCache
(
"api.checkReelMeasure"
,
checkReelMeasureUrl
);
getInDateUrl
=
dataCache
.
getConfigCache
(
"api.getInDate"
,
getInDateUrl
);
}
/**
/**
* 根据partnumber和brand获取满卷数
* 根据partnumber和brand获取满卷数
...
@@ -92,41 +98,34 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -92,41 +98,34 @@ public class LizhenApi extends DefaultSmfApiListener {
* @param brand
* @param brand
* @return
* @return
*/
*/
public
Map
<
String
,
Object
>
brandQty
(
String
partnumber
,
String
brand
)
{
/**
log
.
info
(
"brandQty--material_code:"
+
partnumber
+
",brand:"
+
brand
);
* 获取尺寸和满卷数信息
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
*
if
(
StringUtils
.
isBlank
(
brandQtyUrl
)){
* @param request
resultMap
.
put
(
"qty"
,
0
);
* @return
resultMap
.
put
(
"reelSize"
,
0
);
*/
return
resultMap
;
public
BrandQtyResult
brandQty
(
BrandQtyRequest
request
)
{
if
(
StringUtils
.
isEmpty
(
brandQtyUrl
)){
return
new
BrandQtyResult
();
}
}
int
qty
=
0
;
log
.
info
(
"brandQtyUrl接口请求参数为:"
+
JSON
.
toJSONString
(
request
));
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"material_code"
,
partnumber
);
paramMap
.
put
(
"brand"
,
brand
);
try
{
try
{
String
result
=
HttpHelper
.
postJson
(
brandQtyUrl
,
paramMap
);
String
resultStr
=
HttpHelper
.
postJson
(
brandQtyUrl
,
request
);
log
.
info
(
"brandQty-"
+
partnumber
+
":请求结果为:"
+
result
);
log
.
info
(
"brandQtyUrl接口返回为:"
+
resultStr
);
JSONObject
jsonObject
=
JsonUtil
.
toObj
(
result
,
JSONObject
.
class
);
String
msgtx
=
jsonObject
.
getString
(
"MSGTY"
);
LuxsanApiResult
apiResult
=
JSONObject
.
parseObject
(
resultStr
,
LuxsanApiResult
.
class
);
if
(
"S"
.
equals
(
msgtx
))
{
if
(
"E"
.
equals
(
apiResult
.
getMSGTY
()))
{
JSONObject
dataObject
=
jsonObject
.
getJSONObject
(
"DATA"
);
throw
new
ValidateException
(
"smfcore.api.error"
,
"接口请求失败[{0}]"
,
new
String
[]{
apiResult
.
getMSGTX
()});
if
(
dataObject
!=
null
)
{
if
(
dataObject
.
getInteger
(
"qty"
)
!=
null
)
{
qty
=
dataObject
.
getInteger
(
"qty"
);
resultMap
.
put
(
"qty"
,
qty
);
}
String
reelSize
=
dataObject
.
getString
(
"reel_size"
);
if
(
StringUtils
.
isNotBlank
(
reelSize
))
{
resultMap
.
put
(
"reelSize"
,
reelSize
);
}
}
}
if
(
apiResult
.
getDATA
()
!=
null
)
{
return
JSONObject
.
parseObject
(
apiResult
.
getDATA
(),
BrandQtyResult
.
class
);
}
}
}
catch
(
ApiException
e
)
{
}
catch
(
ApiException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
log
.
info
(
"brandQty--"
+
partnumber
+
":异常:"
+
e
.
getMessage
());
}
}
return
resultMap
;
throw
new
ValidateException
(
"smfcore.api.error"
,
"接口请求失败[{0}]"
,
new
String
[]{
"未找到料号信息"
})
;
}
}
...
@@ -154,8 +153,8 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -154,8 +153,8 @@ public class LizhenApi extends DefaultSmfApiListener {
JSONObject
dataObject
=
dataArrray
.
getJSONObject
(
0
);
JSONObject
dataObject
=
dataArrray
.
getJSONObject
(
0
);
String
brand
=
dataObject
.
getString
(
"brand"
);
String
brand
=
dataObject
.
getString
(
"brand"
);
resultMap
.
put
(
"brand"
,
brand
);
resultMap
.
put
(
"brand"
,
brand
);
resultMap
.
put
(
"keeperCode"
,
dataObject
.
getString
(
"keeper_code"
));
resultMap
.
put
(
"keeperCode"
,
dataObject
.
getString
(
"keeper_code"
));
resultMap
.
put
(
"warehouseCode"
,
dataObject
.
getString
(
"warehouse_code"
));
resultMap
.
put
(
"warehouseCode"
,
dataObject
.
getString
(
"warehouse_code"
));
}
}
}
}
}
catch
(
ApiException
e
)
{
}
catch
(
ApiException
e
)
{
...
@@ -172,24 +171,24 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -172,24 +171,24 @@ public class LizhenApi extends DefaultSmfApiListener {
* @return
* @return
*/
*/
public
Barcode
barcodeInfo
(
Barcode
barcode
)
{
public
Barcode
barcodeInfo
(
Barcode
barcode
)
{
if
(
barcodeInfoUrl
==
null
)
{
if
(
StringUtils
.
isEmpty
(
barcodeInfoUrl
)
)
{
return
null
;
return
null
;
}
}
log
.
info
(
"获取MES物料数量入参为:"
+
barcode
.
getBarcode
()
);
log
.
info
(
barcode
.
getBarcode
()
+
"获取MES物料数量入参为:"
+
barcode
.
getBarcode
()
+
"地址为:"
+
barcodeInfoUrl
);
String
result
=
""
;
String
result
=
""
;
try
{
try
{
result
=
HttpHelper
.
postJson
(
barcodeInfoUrl
,
barcode
.
getBarcode
());
result
=
HttpHelper
.
postJson
(
barcodeInfoUrl
,
barcode
.
getBarcode
());
}
catch
(
ApiException
e
)
{
}
catch
(
ApiException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
log
.
info
(
"获取MES物料数量出参为:"
+
result
);
log
.
info
(
barcode
.
getBarcode
()
+
"获取MES物料数量出参为:"
+
result
);
JSONObject
resultJson
=
JsonUtil
.
toObj
(
result
,
JSONObject
.
class
);
JSONObject
resultJson
=
JsonUtil
.
toObj
(
result
,
JSONObject
.
class
);
Integer
status
=
resultJson
.
getInteger
(
"status"
);
Integer
status
=
resultJson
.
getInteger
(
"status"
);
if
(
status
!=
null
)
{
if
(
status
!=
null
)
{
if
(
status
==
200
)
{
if
(
status
==
200
)
{
JSONObject
dataJson
=
resultJson
.
getJSONObject
(
"data"
);
JSONObject
dataJson
=
resultJson
.
getJSONObject
(
"data"
);
String
reelID
=
dataJson
.
get
(
"reelID"
)
==
null
?
""
:
dataJson
.
get
(
"reelID"
).
toString
();
String
reelID
=
dataJson
.
get
(
"reelID"
)
==
null
?
""
:
dataJson
.
get
(
"reelID"
).
toString
();
//
String partNum = dataJson.get("partNum") == null ? "" : dataJson.get("partNum").toString();
String
partNum
=
dataJson
.
get
(
"partNum"
)
==
null
?
""
:
dataJson
.
get
(
"partNum"
).
toString
();
String
partSpec
=
dataJson
.
get
(
"partSpec"
)
==
null
?
""
:
dataJson
.
get
(
"partSpec"
).
toString
();
String
partSpec
=
dataJson
.
get
(
"partSpec"
)
==
null
?
""
:
dataJson
.
get
(
"partSpec"
).
toString
();
int
qty
=
dataJson
.
get
(
"qty"
)
==
null
?
0
:
Integer
.
valueOf
(
dataJson
.
get
(
"qty"
).
toString
());
int
qty
=
dataJson
.
get
(
"qty"
)
==
null
?
0
:
Integer
.
valueOf
(
dataJson
.
get
(
"qty"
).
toString
());
//String vendor = dataJson.get("vendor") == null ? "" : dataJson.get("vendor").toString();
//String vendor = dataJson.get("vendor") == null ? "" : dataJson.get("vendor").toString();
...
@@ -201,10 +200,14 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -201,10 +200,14 @@ public class LizhenApi extends DefaultSmfApiListener {
}
}
if (StringUtils.isNotBlank(reelID)){
if (StringUtils.isNotBlank(reelID)){
barcode.setBarcode(reelID);
barcode.setBarcode(reelID);
}
if (StringUtils.isNotBlank(partNum)){
barcode.setPartNumber(partNum);
}*/
}*/
if
(
StringUtils
.
isNotBlank
(
partNum
))
{
if
(!
partNum
.
equals
(
barcode
.
getPartNumber
()))
{
throw
new
ValidateException
(
"smfcore.mesApi.inCheck.ng"
,
reelID
+
"对应的料号为:"
+
barcode
.
getPartNumber
()
+
"与mes返回的料号:"
+
partNum
+
"不一致,请检查物料的唯一码是否重复"
);
}
//barcode.setPartNumber(partNum);
}
if
(
StringUtils
.
isNotBlank
(
reelID
))
{
if
(
StringUtils
.
isNotBlank
(
reelID
))
{
if
(
qty
==
0
)
{
if
(
qty
==
0
)
{
throw
new
ValidateException
(
"smfcore.mesApi.inCheck.ng"
,
reelID
+
"mes数量返回为0,不允许进行入库"
);
throw
new
ValidateException
(
"smfcore.mesApi.inCheck.ng"
,
reelID
+
"mes数量返回为0,不允许进行入库"
);
...
@@ -253,6 +256,8 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -253,6 +256,8 @@ public class LizhenApi extends DefaultSmfApiListener {
paramMap
.
put
(
"datecode"
,
barcode
.
getDateCode
());
paramMap
.
put
(
"datecode"
,
barcode
.
getDateCode
());
paramMap
.
put
(
"lot"
,
barcode
.
getBatch
());
paramMap
.
put
(
"lot"
,
barcode
.
getBatch
());
paramMap
.
put
(
"vendor"
,
barcode
.
getProvider
());
paramMap
.
put
(
"vendor"
,
barcode
.
getProvider
());
paramMap
.
put
(
"werks"
,
CommonUtil
.
plantCode
);
paramMap
.
put
(
"model"
,
"ALL"
);
String
param
=
JsonUtil
.
toJsonStr
(
paramMap
);
String
param
=
JsonUtil
.
toJsonStr
(
paramMap
);
log
.
info
(
"禁用料接口wmsCheckReelfob入参为:"
+
param
);
log
.
info
(
"禁用料接口wmsCheckReelfob入参为:"
+
param
);
try
{
try
{
...
@@ -278,14 +283,21 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -278,14 +283,21 @@ public class LizhenApi extends DefaultSmfApiListener {
//保存禁用料记录
//保存禁用料记录
Barcode
barcodeOri
=
barcodeManager
.
findByBarcode
(
barcode
.
getBarcode
());
Barcode
barcodeOri
=
barcodeManager
.
findByBarcode
(
barcode
.
getBarcode
());
if
(
barcodeOri
!=
null
){
if
(
barcodeOri
!=
null
)
{
barcodeOri
.
setExpireDate
(
barcode
.
getExpireDate
());
barcodeOri
.
setDisableMsg
(
resultStr
);
barcodeOri
.
setDisableMsg
(
resultStr
);
barcodeManager
.
save
(
barcodeOri
);
barcode
=
barcodeManager
.
save
(
barcodeOri
);
StoragePos
storagePos
=
storagePosManager
.
getByBarcode
(
barcode
.
getBarcode
());
if
(
storagePos
!=
null
)
{
storagePos
.
setBarcode
(
barcode
);
storagePosManager
.
save
(
storagePos
);
}
}
}
if
(
StringUtils
.
isNotBlank
(
resultStr
))
{
if
(
StringUtils
.
isNotBlank
(
resultStr
))
{
throw
new
ValidateException
(
"smfcore.mesApi.inCheck.ng"
,
/*"MES验证失败:" + */
barcode
.
getBarcode
()
+
"验证失败:"
+
resultStr
);
throw
new
ValidateException
(
"smfcore.mesApi.inCheck.ng"
,
/*"MES验证失败:" + */
barcode
.
getBarcode
()
+
"验证失败:"
+
resultStr
);
}
}
return
barcode
;
return
barcode
;
}
}
...
@@ -298,34 +310,9 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -298,34 +310,9 @@ public class LizhenApi extends DefaultSmfApiListener {
*/
*/
@Override
@Override
public
void
inTaskStatusChange
(
String
inNotifyUrl
,
DataLog
task
)
{
public
void
inTaskStatusChange
(
String
inNotifyUrl
,
DataLog
task
)
{
if
(!
task
.
isFinished
()){
if
(
task
.
isFinished
())
{
return
;
reelInToTower
(
task
);
}
reelReturnTower
(
task
);
Map
<
String
,
Object
>
dataMap
=
new
HashMap
<>();
dataMap
.
put
(
"pickingid"
,
""
);
dataMap
.
put
(
"wo"
,
""
);
dataMap
.
put
(
"reelno"
,
task
.
getBarcode
());
dataMap
.
put
(
"ipn"
,
task
.
getPartNumber
());
Barcode
barcode
=
barcodeManager
.
findByBarcode
(
task
.
getBarcode
());
if
(
barcode
!=
null
)
{
dataMap
.
put
(
"qty"
,
barcode
.
getAmount
());
dataMap
.
put
(
"datecode"
,
barcode
.
getDateCode
());
dataMap
.
put
(
"lot"
,
barcode
.
getBatch
());
dataMap
.
put
(
"vendor"
,
barcode
.
getProvider
());
dataMap
.
put
(
"batch"
,
""
);
dataMap
.
put
(
"vendorcode"
,
barcode
.
getProviderNumber
());
}
dataMap
.
put
(
"werks"
,
werks
);
dataMap
.
put
(
"reelid"
,
""
);
String
param
=
JsonUtil
.
toJsonStr
(
Arrays
.
asList
(
dataMap
));
log
.
info
(
"保存物料入参为:"
+
param
);
try
{
String
result
=
HttpHelper
.
postJson
(
inNotifyUrl
,
Arrays
.
asList
(
dataMap
));
log
.
info
(
"保存物料出参为:"
+
result
);
}
catch
(
ApiException
e
)
{
e
.
printStackTrace
();
log
.
info
(
barcode
.
getBarcode
()+
"保存物料异常:"
+
e
.
getMessage
());
}
}
}
}
...
@@ -337,60 +324,8 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -337,60 +324,8 @@ public class LizhenApi extends DefaultSmfApiListener {
*/
*/
@Override
@Override
public
void
outTaskStatusChange
(
String
outNotifyUrl
,
DataLog
task
)
{
public
void
outTaskStatusChange
(
String
outNotifyUrl
,
DataLog
task
)
{
if
(
task
.
isFinished
())
{
if
(
task
.
getBarcode
().
startsWith
(
"CS"
)
reelOutFromTower
(
task
);
||
task
.
getBarcode
().
startsWith
(
"CM"
)
||
task
.
getBarcode
().
startsWith
(
"CB"
))
{
return
;
}
if
(!
task
.
isFinished
())
{
return
;
}
if
(
task
.
isBoxOut
()){
return
;
}
Map
<
String
,
Object
>
dataMap
=
new
HashMap
<>();
dataMap
.
put
(
"pickingid"
,
""
);
if
(
StringUtils
.
isNotBlank
(
task
.
getSourceName
())
&&
StringUtils
.
isNotBlank
(
task
.
getLine
())
&&
!
task
.
isManualUpload
())
{
dataMap
.
put
(
"pickingid"
,
task
.
getSourceName
());
outNotifyUrl
=
outNotifyUrlPK
;
log
.
info
(
"出库pk不为空:"
+
outNotifyUrl
);
}
dataMap
.
put
(
"wo"
,
""
);
dataMap
.
put
(
"reelno"
,
task
.
getBarcode
());
dataMap
.
put
(
"ipn"
,
task
.
getPartNumber
());
dataMap
.
put
(
"qty"
,
task
.
getNum
());
dataMap
.
put
(
"datecode"
,
task
.
getDateCode
());
dataMap
.
put
(
"lot"
,
task
.
getBatchInfo
());
dataMap
.
put
(
"vendor"
,
task
.
getProvider
());
dataMap
.
put
(
"batch"
,
""
);
dataMap
.
put
(
"vendorcode"
,
task
.
getProviderNumber
());
dataMap
.
put
(
"werks"
,
werks
);
dataMap
.
put
(
"reelid"
,
""
);
if
(
outNotifyUrl
==
outNotifyUrlPK
)
{
List
<
Map
<
String
,
Object
>>
paramList
=
new
ArrayList
();
paramList
.
add
(
dataMap
);
JSONObject
jsonObject
=
new
JSONObject
();
jsonObject
.
put
(
"data"
,
paramList
);
String
param
=
JsonUtil
.
toJsonStr
(
jsonObject
);
log
.
info
(
"保存物料入参为:"
+
param
+
"地址为:"
+
outNotifyUrl
);
try
{
String
result
=
HttpHelper
.
postJson
(
outNotifyUrl
,
jsonObject
);
log
.
info
(
"保存物料出参为:"
+
result
);
}
catch
(
ApiException
e
)
{
e
.
printStackTrace
();
log
.
info
(
task
.
getBarcode
()
+
"保存物料异常:"
+
e
.
getMessage
());
}
}
else
{
String
param
=
JsonUtil
.
toJsonStr
(
Arrays
.
asList
(
dataMap
));
log
.
info
(
"保存物料入参为:"
+
param
+
"地址为:"
+
outNotifyUrl
);
try
{
String
result
=
HttpHelper
.
postJson
(
outNotifyUrl
,
Arrays
.
asList
(
dataMap
));
log
.
info
(
"保存物料出参为:"
+
result
);
}
catch
(
ApiException
e
)
{
e
.
printStackTrace
();
log
.
info
(
task
.
getBarcode
()
+
"保存物料异常:"
+
e
.
getMessage
());
}
}
}
}
}
...
@@ -462,7 +397,7 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -462,7 +397,7 @@ public class LizhenApi extends DefaultSmfApiListener {
return
StringUtils
.
isBlank
(
pickingid
);
return
StringUtils
.
isBlank
(
pickingid
);
}).
collect
(
Collectors
.
toList
());
}).
collect
(
Collectors
.
toList
());
if
(
noPickingidList
!=
null
&&
!
noPickingidList
.
isEmpty
()){
if
(
noPickingidList
!=
null
&&
!
noPickingidList
.
isEmpty
())
{
String
param
=
JsonUtil
.
toJsonStr
(
paramList
);
String
param
=
JsonUtil
.
toJsonStr
(
paramList
);
log
.
info
(
"保存物料入参为:"
+
param
+
"地址为:"
+
outNotifyUrl
);
log
.
info
(
"保存物料入参为:"
+
param
+
"地址为:"
+
outNotifyUrl
);
try
{
try
{
...
@@ -513,7 +448,7 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -513,7 +448,7 @@ public class LizhenApi extends DefaultSmfApiListener {
}
}
}
}
if
(
items
!=
null
&&
!
items
.
isEmpty
())
{
if
(
items
!=
null
&&
!
items
.
isEmpty
())
{
return
PreWarningItemCache
.
createAndExecuteLiteOrder
(
items
,
2
);
return
PreWarningItemCache
.
createAndExecuteLiteOrder
(
items
,
2
);
}
}
}
}
return
null
;
return
null
;
...
@@ -525,8 +460,7 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -525,8 +460,7 @@ public class LizhenApi extends DefaultSmfApiListener {
* @param barcodeList
* @param barcodeList
* @return
* @return
*/
*/
public
List
<
String
>
batchCheck
(
List
<
Barcode
>
barcodeList
)
{
public
List
<
String
>
batchCheckReel
(
List
<
Barcode
>
barcodeList
,
String
pickingId
,
String
model
)
{
List
<
String
>
resultList
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
paramList
=
new
ArrayList
<>();
List
<
Map
<
String
,
Object
>>
paramList
=
new
ArrayList
<>();
for
(
Barcode
barcode
:
barcodeList
)
{
for
(
Barcode
barcode
:
barcodeList
)
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
...
@@ -536,28 +470,67 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -536,28 +470,67 @@ public class LizhenApi extends DefaultSmfApiListener {
paramMap
.
put
(
"datecode"
,
barcode
.
getDateCode
());
paramMap
.
put
(
"datecode"
,
barcode
.
getDateCode
());
paramMap
.
put
(
"lot"
,
barcode
.
getBatch
());
paramMap
.
put
(
"lot"
,
barcode
.
getBatch
());
paramMap
.
put
(
"vendor"
,
barcode
.
getProvider
());
paramMap
.
put
(
"vendor"
,
barcode
.
getProvider
());
paramMap
.
put
(
"remark"
,
""
);
paramMap
.
put
(
"remark"
,
"ALL"
);
paramMap
.
put
(
"werks"
,
"ALL"
);
paramMap
.
put
(
"model"
,
"ALL"
);
if
(
StringUtils
.
isNotEmpty
(
model
))
{
paramMap
.
put
(
"model"
,
model
);
}
paramMap
.
put
(
"picking"
,
"ALL"
);
if
(
StringUtils
.
isNotEmpty
(
pickingId
))
{
paramMap
.
put
(
"picking"
,
pickingId
);
}
paramList
.
add
(
paramMap
);
paramList
.
add
(
paramMap
);
}
}
String
paramStr
=
JSON
.
toJSONString
(
paramList
);
log
.
info
(
"批量禁用入参为:"
+
JSON
.
toJSONString
(
paramList
));
log
.
info
(
"批量禁用料,入参为:"
+
paramStr
+
",地址为:"
+
batchCheckUrl
);
List
<
String
>
reelList
=
new
ArrayList
<>();
try
{
try
{
String
result
=
HttpHelper
.
postJson
(
batchCheckUrl
,
paramList
);
String
resultStr
=
HttpHelper
.
postJson
(
batchCheckReel
,
paramList
);
log
.
info
(
"批量禁用料,出参为:"
+
result
);
log
.
info
(
"批量禁用接口返回结果为:"
+
resultStr
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
result
);
if
(
jsonObject
.
getInteger
(
"status"
)
==
200
)
{
JSONObject
resultObj
=
JSONObject
.
parseObject
(
resultStr
);
JSONArray
data
=
jsonObject
.
getJSONArray
(
"data"
);
if
(
data
!=
null
&&
!
data
.
isEmpty
())
{
String
status
=
resultObj
.
getString
(
"status"
);
for
(
int
i
=
0
;
i
<
data
.
size
();
i
++)
{
JSONObject
item
=
data
.
getJSONObject
(
i
);
if
(
"200"
.
equals
(
status
))
{
resultList
.
add
(
item
.
getString
(
"reelNo"
));
JSONArray
dataArr
=
resultObj
.
getJSONArray
(
"data"
);
if
(
dataArr
!=
null
&&
!
dataArr
.
isEmpty
())
{
for
(
int
i
=
0
;
i
<
dataArr
.
size
();
i
++)
{
JSONObject
data
=
dataArr
.
getJSONObject
(
i
);
JSONArray
resultList
=
data
.
getJSONArray
(
"resultList"
);
if
(
resultList
!=
null
&&
!
resultList
.
isEmpty
())
{
for
(
int
j
=
0
;
j
<
resultList
.
size
();
j
++)
{
JSONObject
result
=
resultList
.
getJSONObject
(
j
);
String
reelId
=
result
.
getString
(
"reelId"
);
if
(
StringUtils
.
isNotBlank
(
reelId
))
{
reelList
.
add
(
reelId
);
}
}
}
}
}
}
}
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
info
(
"批量禁用接口调用失败:"
+
e
.
getMessage
());
}
//添加禁用料信息
for
(
Barcode
barcode
:
barcodeList
)
{
if
(
reelList
.
contains
(
barcode
.
getBarcode
()))
{
barcode
.
setDisableMsg
(
"禁用料"
);
}
else
{
barcode
.
setDisableMsg
(
""
);
}
barcode
=
barcodeManager
.
save
(
barcode
);
StoragePos
storagePos
=
storagePosManager
.
getByBarcode
(
barcode
.
getBarcode
());
if
(
storagePos
!=
null
)
{
storagePos
.
setBarcode
(
barcode
);
storagePosManager
.
save
(
storagePos
);
}
}
return
resultList
;
}
return
reelList
;
}
}
...
@@ -568,18 +541,21 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -568,18 +541,21 @@ public class LizhenApi extends DefaultSmfApiListener {
* @return
* @return
*/
*/
public
boolean
checkReelMeasure
(
Barcode
barcode
)
{
public
boolean
checkReelMeasure
(
Barcode
barcode
)
{
if
(
StringUtils
.
isBlank
(
checkReelMeasureUrl
)){
if
(
StringUtils
.
isBlank
(
checkReelMeasureUrl
))
{
return
true
;
return
true
;
}
}
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"reelID"
,
barcode
.
getBarcode
());
paramMap
.
put
(
"model"
,
"EVEREST"
);
paramMap
.
put
(
"ipn"
,
barcode
.
getPartNumber
());
paramMap
.
put
(
"reelid"
,
barcode
.
getBarcode
());
paramMap
.
put
(
"data"
,
""
);
paramMap
.
put
(
"emp"
,
"smf"
);
paramMap
.
put
(
"cmd"
,
"AUTOWH"
);
try
{
try
{
log
.
info
(
barcode
.
getBarcode
()
+
"散料量测接口入参为-----"
+
JSON
.
toJSONString
(
paramMap
));
log
.
info
(
barcode
.
getBarcode
()
+
"散料量测接口入参为-----"
+
JSON
.
toJSONString
(
paramMap
)
+
",接口地址为:"
+
checkReelMeasureUrl
);
String
result
=
HttpHelper
.
postJson
(
checkReelMeasureUrl
,
paramMap
);
String
result
=
HttpHelper
.
postJson
(
checkReelMeasureUrl
,
paramMap
);
log
.
info
(
barcode
.
getBarcode
()
+
"散料量测接口出参为-----"
+
result
);
log
.
info
(
barcode
.
getBarcode
()
+
"散料量测接口出参为-----"
+
result
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
result
);
JSONObject
jsonObject
=
JSON
.
parseObject
(
result
);
if
(
jsonObject
.
getInteger
(
"
status"
)
==
200
)
{
if
(
jsonObject
.
getInteger
(
"
code"
)
==
1
)
{
JSONObject
data
=
jsonObject
.
getJSONObject
(
"data"
);
JSONObject
data
=
jsonObject
.
getJSONObject
(
"data"
);
if
(
data
.
getBoolean
(
"result"
))
{
if
(
data
.
getBoolean
(
"result"
))
{
return
true
;
return
true
;
...
@@ -601,10 +577,10 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -601,10 +577,10 @@ public class LizhenApi extends DefaultSmfApiListener {
return
barcode
;
return
barcode
;
}
}
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"
material_code
"
,
barcode
.
getPartNumber
());
paramMap
.
put
(
"
MATERIAL_CODE
"
,
barcode
.
getPartNumber
());
paramMap
.
put
(
"
date_code
"
,
barcode
.
getDateCode
());
paramMap
.
put
(
"
DATE_CODE
"
,
barcode
.
getDateCode
());
paramMap
.
put
(
"
plant_code"
,
plant
);
paramMap
.
put
(
"
PLANT_CODE"
,
CommonUtil
.
plantCode
);
paramMap
.
put
(
"
brand
"
,
barcode
.
getProvider
());
paramMap
.
put
(
"
BRAND
"
,
barcode
.
getProvider
());
try
{
try
{
log
.
info
(
barcode
.
getBarcode
()
+
":getInDate入参为:"
+
JSON
.
toJSONString
(
paramMap
));
log
.
info
(
barcode
.
getBarcode
()
+
":getInDate入参为:"
+
JSON
.
toJSONString
(
paramMap
));
String
result
=
HttpHelper
.
postJson
(
getInDateUrl
,
paramMap
);
String
result
=
HttpHelper
.
postJson
(
getInDateUrl
,
paramMap
);
...
@@ -615,8 +591,7 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -615,8 +591,7 @@ public class LizhenApi extends DefaultSmfApiListener {
int
data
=
jsonObject
.
getIntValue
(
"DATA"
);
int
data
=
jsonObject
.
getIntValue
(
"DATA"
);
if
(
data
<
0
)
{
if
(
data
<
0
)
{
throw
new
ValidateException
(
"smfcore.error.barcode.expired"
,
"物料已过期,无法入库"
);
throw
new
ValidateException
(
"smfcore.error.barcode.expired"
,
"物料已过期,无法入库"
);
}
}
else
if
(
data
>
0
)
{
else
if
(
data
>
0
){
Date
expireDate
=
DateUtil
.
offsetDay
(
new
Date
(),
data
);
Date
expireDate
=
DateUtil
.
offsetDay
(
new
Date
(),
data
);
barcode
.
setExpireDate
(
expireDate
);
barcode
.
setExpireDate
(
expireDate
);
}
else
{
}
else
{
...
@@ -632,6 +607,140 @@ public class LizhenApi extends DefaultSmfApiListener {
...
@@ -632,6 +607,140 @@ public class LizhenApi extends DefaultSmfApiListener {
}
}
}
}
private
void
reelInToTower
(
DataLog
task
)
{
if
(
StringUtils
.
isEmpty
(
save2DReelInfoUrl
)){
return
;
}
Map
<
String
,
Object
>
dataMap
=
new
HashMap
<>();
dataMap
.
put
(
"pickingid"
,
""
);
dataMap
.
put
(
"wo"
,
""
);
dataMap
.
put
(
"reelno"
,
task
.
getBarcode
());
dataMap
.
put
(
"ipn"
,
task
.
getPartNumber
());
Barcode
barcode
=
barcodeManager
.
findByBarcode
(
task
.
getBarcode
());
if
(
barcode
!=
null
)
{
dataMap
.
put
(
"qty"
,
barcode
.
getAmount
());
dataMap
.
put
(
"datecode"
,
barcode
.
getDateCode
());
dataMap
.
put
(
"lot"
,
barcode
.
getBatch
());
dataMap
.
put
(
"vendor"
,
barcode
.
getProvider
());
dataMap
.
put
(
"batch"
,
""
);
dataMap
.
put
(
"vendorcode"
,
barcode
.
getProviderNumber
());
}
dataMap
.
put
(
"werks"
,
"W339"
);
dataMap
.
put
(
"reelid"
,
""
);
String
param
=
JsonUtil
.
toJsonStr
(
Arrays
.
asList
(
dataMap
));
log
.
info
(
barcode
.
getBarcode
()
+
"保存物料入参为:"
+
param
+
"地址为:"
+
save2DReelInfoUrl
);
try
{
String
result
=
HttpHelper
.
postJson
(
save2DReelInfoUrl
,
Arrays
.
asList
(
dataMap
));
log
.
info
(
barcode
.
getBarcode
()
+
"保存物料出参为:"
+
result
);
}
catch
(
ApiException
e
)
{
e
.
printStackTrace
();
log
.
info
(
barcode
.
getBarcode
()
+
"保存物料异常:"
+
e
.
getMessage
());
}
}
private
void
reelReturnTower
(
DataLog
oldTask
)
{
if
(
StringUtils
.
isEmpty
(
commonRMRecordUrl
)){
return
;
}
Map
<
String
,
Object
>
dataMap
=
new
HashMap
<>();
String
line
=
oldTask
.
getLine
();
if
(
StringUtils
.
isNotEmpty
(
line
))
{
if
(
line
.
contains
(
"_"
))
{
line
=
line
.
substring
(
0
,
line
.
indexOf
(
"_"
));
}
}
dataMap
.
put
(
"line"
,
line
);
dataMap
.
put
(
"reel_id"
,
oldTask
.
getBarcode
());
dataMap
.
put
(
"ipn"
,
oldTask
.
getPartNumber
());
dataMap
.
put
(
"rm_type"
,
2
);
Storage
storage
=
dataCache
.
getStorageById
(
oldTask
.
getStorageId
());
if
(
storage
.
isVirtual
())
{
dataMap
.
put
(
"rm_type"
,
1
);
}
Barcode
barcode
=
barcodeManager
.
findByBarcode
(
oldTask
.
getBarcode
());
if
(
barcode
!=
null
)
{
dataMap
.
put
(
"qty"
,
barcode
.
getAmount
());
dataMap
.
put
(
"date_code"
,
barcode
.
getDateCode
());
dataMap
.
put
(
"lot"
,
barcode
.
getBatch
());
dataMap
.
put
(
"vendor_name"
,
barcode
.
getProvider
());
dataMap
.
put
(
"batch_id"
,
""
);
//dataMap.put("vendorcode", barcode.getProviderNumber());
}
dataMap
.
put
(
"create_empno"
,
StringUtils
.
isEmpty
(
SecurityUtils
.
getLoginUsername
())
?
storage
.
getName
()
:
SecurityUtils
.
getLoginUsername
());
Date
date
=
new
Date
();
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
);
format
.
setTimeZone
(
TimeZone
.
getTimeZone
(
"UTC"
));
// 设置为UTC时间
String
nowDateStr
=
format
.
format
(
date
);
dataMap
.
put
(
"create_time"
,
nowDateStr
);
String
param
=
JsonUtil
.
toJsonStr
(
Arrays
.
asList
(
dataMap
)
+
"地址为:"
+
commonRMRecordUrl
);
log
.
info
(
oldTask
.
getBarcode
()
+
"调用退料接口:"
+
param
);
try
{
String
result
=
HttpHelper
.
postJson
(
commonRMRecordUrl
,
Arrays
.
asList
(
dataMap
));
log
.
info
(
oldTask
.
getBarcode
()
+
"退料出参为:"
+
result
);
}
catch
(
ApiException
e
)
{
e
.
printStackTrace
();
log
.
info
(
oldTask
.
getBarcode
()
+
"退料异常:"
+
e
.
getMessage
());
}
}
private
void
reelOutFromTower
(
DataLog
task
)
{
if
(
StringUtils
.
isEmpty
(
commonGIRecordUrl
)){
return
;
}
List
<
Map
<
String
,
Object
>>
paramList
=
new
ArrayList
<>();
Storage
storage
=
dataCache
.
getStorage
(
task
.
getCid
());
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
String
line
=
task
.
getLine
();
if
(
StringUtils
.
isNotEmpty
(
line
))
{
if
(
line
.
contains
(
"_"
))
{
line
=
line
.
substring
(
0
,
line
.
indexOf
(
"_"
));
}
}
paramMap
.
put
(
"line"
,
line
);
paramMap
.
put
(
"mc_id"
,
storage
.
getName
());
paramMap
.
put
(
"reel_id"
,
task
.
getBarcode
());
paramMap
.
put
(
"ipn"
,
task
.
getPartNumber
());
paramMap
.
put
(
"qty"
,
task
.
getNum
());
String
tableNo
=
task
.
getTableNo
();
if
(
StringUtils
.
isNotEmpty
(
tableNo
))
{
paramMap
.
put
(
"stationInfo"
,
task
.
getLine
()
+
","
+
task
.
getSide
()
+
","
+
task
.
getTableNo
()
+
","
+
task
.
getSlot
()
+
","
+
task
.
getSubSlot
());
}
else
{
paramMap
.
put
(
"stationInfo"
,
task
.
getLine
());
}
//发料类型(0:智能仓1:虚拟仓2:物料预警3:手动发料)
int
type
=
0
;
if
(
StringUtils
.
isNotEmpty
(
task
.
getSourceId
()))
{
type
=
2
;
}
else
{
if
(
storage
.
isVirtual
())
{
type
=
1
;
}
else
{
type
=
3
;
}
}
paramMap
.
put
(
"gi_type"
,
type
);
paramMap
.
put
(
"create_empno"
,
StringUtils
.
isEmpty
(
task
.
getCreator
())
?
"System"
:
task
.
getCreator
());
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'"
);
paramMap
.
put
(
"create_time"
,
sdf
.
format
(
task
.
getCreateDate
()));
paramList
.
add
(
paramMap
);
log
.
info
(
"出库通知入参为:"
+
JSON
.
toJSONString
(
paramList
)
+
"地址为:"
+
commonGIRecordUrl
);
try
{
String
result
=
HttpHelper
.
postJson
(
commonGIRecordUrl
,
paramList
);
log
.
info
(
task
.
getBarcode
()
+
"出入库通知返回结果为:"
+
result
);
}
catch
(
ApiException
e
)
{
e
.
printStackTrace
();
log
.
error
(
task
.
getBarcode
()
+
"出入库通知异常:"
+
e
.
getMessage
());
}
}
@Override
@Override
public
boolean
isForThisApi
(
String
apiName
)
{
public
boolean
isForThisApi
(
String
apiName
)
{
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/LizhenController.java
查看文件 @
81b10db
package
com
.
neotel
.
smfcore
.
custom
.
lizhen
;
package
com
.
neotel
.
smfcore
.
custom
.
lizhen
;
import
cn.hutool.http.HttpUtil
;
import
cn.hutool.http.HttpUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.exception.ApiException
;
import
com.neotel.smfcore.common.exception.ApiException
;
...
@@ -14,6 +16,7 @@ import com.neotel.smfcore.core.order.enums.LITEORDER_SOURCE;
...
@@ -14,6 +16,7 @@ import com.neotel.smfcore.core.order.enums.LITEORDER_SOURCE;
import
com.neotel.smfcore.core.order.service.manager.ILiteOrderManager
;
import
com.neotel.smfcore.core.order.service.manager.ILiteOrderManager
;
import
com.neotel.smfcore.core.order.service.po.LiteOrder
;
import
com.neotel.smfcore.core.order.service.po.LiteOrder
;
import
com.neotel.smfcore.core.order.service.po.LiteOrderItem
;
import
com.neotel.smfcore.core.order.service.po.LiteOrderItem
;
import
com.neotel.smfcore.custom.lizhen.bean.ManualTower
;
import
com.neotel.smfcore.custom.lizhen.innerBox.bean.PreWarningItem
;
import
com.neotel.smfcore.custom.lizhen.innerBox.bean.PreWarningItem
;
import
com.neotel.smfcore.custom.lizhen.innerBox.util.PreWarningItemCache
;
import
com.neotel.smfcore.custom.lizhen.innerBox.util.PreWarningItemCache
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
...
@@ -194,26 +197,113 @@ public class LizhenController {
...
@@ -194,26 +197,113 @@ public class LizhenController {
@AnonymousAccess
@AnonymousAccess
public
ResultBean
machineCallMaterial
(
@RequestBody
Map
<
String
,
String
>
data
)
{
public
ResultBean
machineCallMaterial
(
@RequestBody
Map
<
String
,
String
>
data
)
{
boolean
startJob
=
dataCache
.
getCache
(
Constants
.
CACHE_StartJob
);
boolean
startJob
=
dataCache
.
getCache
(
Constants
.
CACHE_StartJob
);
if
(!
startJob
){
if
(!
startJob
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"定时任务未开启"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"定时任务未开启"
,
new
String
[]{},
false
);
}
}
log
.
info
(
"Mes缺料预警---"
+
JSONObject
.
toJSONString
(
data
));
//
log.info("Mes缺料预警---" + JSONObject.toJSONString(data));
PreWarningItem
item
=
new
PreWarningItem
();
PreWarningItem
item
=
new
PreWarningItem
();
item
.
setMachinename
(
data
.
get
(
"MACHINENAME"
));
item
.
setMachinename
(
data
.
get
(
"MACHINE
_
NAME"
));
item
.
setStation
(
data
.
get
(
"
STATION
"
));
item
.
setStation
(
data
.
get
(
"
MACHINE
"
));
item
.
setSide
(
data
.
get
(
"
SID
E"
));
item
.
setSide
(
data
.
get
(
"
FAC
E"
));
item
.
setSlot
(
data
.
get
(
"SLOT"
));
item
.
setSlot
(
data
.
get
(
"SLOT"
));
item
.
setSubslot
(
data
.
get
(
"SUBSLOT"
));
item
.
setSubslot
(
data
.
get
(
"SUBSLOT"
));
item
.
setPartnumber
(
data
.
get
(
"
PARTNUMBER
"
));
item
.
setPartnumber
(
data
.
get
(
"
MATERIAL_CODE
"
));
item
.
setLine
(
data
.
get
(
"LINE"
));
item
.
setLine
(
data
.
get
(
"LINE"
));
item
.
setItemId
(
data
.
get
(
"ID"
));
item
.
setItemId
(
data
.
get
(
"ID"
));
item
.
setPickingId
(
data
.
get
(
"PICKING_ID"
));
String
mo
=
data
.
get
(
"MO"
);
item
.
setMo
(
mo
);
try
{
item
.
setItemNo
(
Integer
.
valueOf
(
data
.
get
(
"ITEM_NO"
)));
item
.
setPriority
(
Integer
.
valueOf
(
data
.
get
(
"PRIORITY"
)));
item
.
setPriority
(
Integer
.
valueOf
(
data
.
get
(
"PRIORITY"
)));
}
catch
(
NumberFormatException
e
)
{
e
.
printStackTrace
();
item
.
setPriority
(
0
);
item
.
setItemNo
(
1
);
}
item
.
setReel
(
data
.
get
(
"REEL"
));
item
.
setReel
(
data
.
get
(
"REEL"
));
item
.
setBrand
(
data
.
get
(
"VENDOR"
));
String
brand
=
data
.
get
(
"VENDOR"
);
if
(
StringUtils
.
isEmpty
(
brand
)){
brand
=
data
.
get
(
"BRAND"
);
}
item
.
setBrand
(
brand
);
if
(
StringUtils
.
isBlank
(
item
.
getSide
())){
log
.
info
(
"缺料预警id:"
+
item
.
getItemId
()+
"面别为空,忽略"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"side为空"
);
}
PreWarningItemCache
.
addItems
(
Arrays
.
asList
(
item
));
PreWarningItemCache
.
addItems
(
Arrays
.
asList
(
item
));
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
@ApiOperation
(
"Tower接收手动发料信息"
)
@RequestMapping
(
"/manualTower"
)
@AnonymousAccess
public
Map
<
String
,
String
>
manualTower
(
@RequestBody
JSONObject
jsonObject
)
{
log
.
info
(
"收到WMS手动发料数据为:"
+
JSON
.
toJSONString
(
jsonObject
));
Map
<
String
,
String
>
resultMap
=
new
HashMap
<>();
String
pickingId
=
jsonObject
.
getString
(
"PICKING_ID"
);
String
data
=
jsonObject
.
getString
(
"DATA"
);
List
<
ManualTower
>
manualTowerList
=
JSONArray
.
parseArray
(
data
,
ManualTower
.
class
);
if
(
StringUtils
.
isEmpty
(
pickingId
)
||
manualTowerList
==
null
||
manualTowerList
.
isEmpty
()){
resultMap
.
put
(
"MSGTY"
,
"E"
);
resultMap
.
put
(
"MSGTX"
,
"请核实参数是否为空"
);
return
resultMap
;
}
LiteOrder
liteOrder
=
liteOrderManager
.
findByOrderNo
(
pickingId
);
if
(
liteOrder
==
null
){
String
line
=
""
;
List
<
LiteOrderItem
>
itemList
=
new
ArrayList
<>();
for
(
ManualTower
manualTower
:
manualTowerList
)
{
LiteOrderItem
item
=
new
LiteOrderItem
();
item
.
setPn
(
manualTower
.
getMATERIAL_CODE
());
item
.
setNeedReelCount
(
manualTower
.
getREQ_REEL
()
==
0
?
1
:
manualTower
.
getREQ_REEL
());
item
.
setNeedNum
(
manualTower
.
getREQ_QTY
());
item
.
setSide
(
manualTower
.
getFACE
());
item
.
setBrand
(
manualTower
.
getBRAND
());
item
.
setLine
(
manualTower
.
getLINE
());
if
(
StringUtils
.
isEmpty
(
line
)){
line
=
manualTower
.
getLINE
();
}
item
.
setPickingId
(
pickingId
);
item
.
setRowId
(
manualTower
.
getROW_ID
());
item
.
setItemNo
(
manualTower
.
getITEM_NO
());
item
.
setTableNo
(
manualTower
.
getMACHINE
());
item
.
setMo
(
manualTower
.
getMO
());
item
.
setSlot
(
manualTower
.
getSLOT
());
item
.
setSubSlot
(
manualTower
.
getSUBSLOT
());
item
.
setBatchCode
(
manualTower
.
getBATCH_CODE
());
item
.
setModel
(
manualTower
.
getMODEL
());
item
.
setWarningItemId
(
manualTower
.
getITEM_NO
()+
""
);
item
.
setMachineName
(
manualTower
.
getMACHINE_NAME
());
itemList
.
add
(
item
);
}
liteOrder
=
new
LiteOrder
();
liteOrder
.
setOrderNo
(
pickingId
);
liteOrder
.
setLine
(
line
);
liteOrder
.
setOrderItems
(
itemList
);
liteOrder
=
liteOrderManager
.
createWithItems
(
liteOrder
);
liteOrderCache
.
addOrderToMap
(
liteOrder
);
resultMap
.
put
(
"MSGTY"
,
"S"
);
resultMap
.
put
(
"MSGTX"
,
"接收成功"
);
}
else
{
resultMap
.
put
(
"MSGTY"
,
"E"
);
resultMap
.
put
(
"MSGTX"
,
pickingId
+
"已经存在"
);
}
return
resultMap
;
}
private
String
getForwardUrl
(
String
line
)
{
private
String
getForwardUrl
(
String
line
)
{
String
url
=
""
;
String
url
=
""
;
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/InventoryController.java
查看文件 @
81b10db
...
@@ -30,6 +30,8 @@ import com.neotel.smfcore.custom.lizhen.agvBox.bean.query.InventoryQuery;
...
@@ -30,6 +30,8 @@ import com.neotel.smfcore.custom.lizhen.agvBox.bean.query.InventoryQuery;
import
com.neotel.smfcore.custom.lizhen.agvBox.service.manager.InventoryDataManager
;
import
com.neotel.smfcore.custom.lizhen.agvBox.service.manager.InventoryDataManager
;
import
com.neotel.smfcore.custom.lizhen.agvBox.util.BoxUtil
;
import
com.neotel.smfcore.custom.lizhen.agvBox.util.BoxUtil
;
import
com.neotel.smfcore.custom.lizhen.agvBox.util.StationCacheUtil
;
import
com.neotel.smfcore.custom.lizhen.agvBox.util.StationCacheUtil
;
import
com.neotel.smfcore.custom.lizhen.bean.apirequest.BrandQtyRequest
;
import
com.neotel.smfcore.custom.lizhen.bean.apiresult.BrandQtyResult
;
import
com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType
;
import
com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -625,8 +627,8 @@ public class InventoryController {
...
@@ -625,8 +627,8 @@ public class InventoryController {
return
barcode
.
getBarcode
()
+
"存在料箱中:"
+
barcode
.
getPosName
()
+
"与当前工位上的料箱:"
+
boxStr
+
"不一致"
;
return
barcode
.
getBarcode
()
+
"存在料箱中:"
+
barcode
.
getPosName
()
+
"与当前工位上的料箱:"
+
boxStr
+
"不一致"
;
}
}
//判断料号是否正确
//判断料号是否正确
Map
<
String
,
Object
>
barandMap
=
lizhenApi
.
brandQty
(
barcode
.
getPartNumber
(),
barcode
.
getProvider
(
));
BrandQtyResult
brandQtyResult
=
lizhenApi
.
brandQty
(
new
BrandQtyRequest
(
barcode
.
getPartNumber
(),
barcode
.
getProvider
()
));
if
(
b
arandMap
.
get
(
"qty"
)
==
null
)
{
if
(
b
randQtyResult
==
null
)
{
return
barcode
.
getPartNumber
()
+
"MES未返回料卷数量,未找到对应的料卷数量"
;
return
barcode
.
getPartNumber
()
+
"MES未返回料卷数量,未找到对应的料卷数量"
;
}
}
log
.
info
(
barcode
.
getBarcode
()
+
"隔口信息:"
+
barcode
.
getPosName
());
log
.
info
(
barcode
.
getBarcode
()
+
"隔口信息:"
+
barcode
.
getPosName
());
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/OutLineController.java
查看文件 @
81b10db
...
@@ -27,6 +27,8 @@ import com.neotel.smfcore.core.system.util.TaskService;
...
@@ -27,6 +27,8 @@ import com.neotel.smfcore.core.system.util.TaskService;
import
com.neotel.smfcore.custom.lizhen.LizhenApi
;
import
com.neotel.smfcore.custom.lizhen.LizhenApi
;
import
com.neotel.smfcore.custom.lizhen.agvBox.enums.INOUT_TYPE
;
import
com.neotel.smfcore.custom.lizhen.agvBox.enums.INOUT_TYPE
;
import
com.neotel.smfcore.custom.lizhen.agvBox.util.BoxUtil
;
import
com.neotel.smfcore.custom.lizhen.agvBox.util.BoxUtil
;
import
com.neotel.smfcore.custom.lizhen.bean.apirequest.BrandQtyRequest
;
import
com.neotel.smfcore.custom.lizhen.bean.apiresult.BrandQtyResult
;
import
com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType
;
import
com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
...
@@ -246,8 +248,8 @@ public class OutLineController {
...
@@ -246,8 +248,8 @@ public class OutLineController {
}
}
//校验是否可以入库
//校验是否可以入库
Map
<
String
,
Object
>
brandQty
=
lizhenApi
.
brandQty
(
barcode
.
getPartNumber
(),
barcode
.
getProvider
(
));
BrandQtyResult
brandQtyResult
=
lizhenApi
.
brandQty
(
new
BrandQtyRequest
(
barcode
.
getPartNumber
(),
barcode
.
getProvider
()
));
if
(
brandQty
==
null
||
brandQty
.
isEmpty
()
)
{
if
(
brandQty
Result
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.partNumber.invalid"
,
"{0}不是有效的料号"
,
new
String
[]{
barcode
.
getPartNumber
()});
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.partNumber.invalid"
,
"{0}不是有效的料号"
,
new
String
[]{
barcode
.
getPartNumber
()});
}
}
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/WarehouseController.java
查看文件 @
81b10db
...
@@ -28,6 +28,8 @@ import com.neotel.smfcore.custom.lizhen.agvBox.enums.INOUT_TYPE;
...
@@ -28,6 +28,8 @@ import com.neotel.smfcore.custom.lizhen.agvBox.enums.INOUT_TYPE;
import
com.neotel.smfcore.custom.lizhen.agvBox.service.manager.GrLabelManager
;
import
com.neotel.smfcore.custom.lizhen.agvBox.service.manager.GrLabelManager
;
import
com.neotel.smfcore.custom.lizhen.agvBox.util.BoxUtil
;
import
com.neotel.smfcore.custom.lizhen.agvBox.util.BoxUtil
;
import
com.neotel.smfcore.custom.lizhen.agvBox.util.StationCacheUtil
;
import
com.neotel.smfcore.custom.lizhen.agvBox.util.StationCacheUtil
;
import
com.neotel.smfcore.custom.lizhen.bean.apirequest.BrandQtyRequest
;
import
com.neotel.smfcore.custom.lizhen.bean.apiresult.BrandQtyResult
;
import
com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType
;
import
com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
...
@@ -115,23 +117,23 @@ public class WarehouseController {
...
@@ -115,23 +117,23 @@ public class WarehouseController {
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"Gr:"
+
grLabel
.
getLabelId
()
+
"已经失效"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"Gr:"
+
grLabel
.
getLabelId
()
+
"已经失效"
);
}
}
//得到料卷总数量与尺寸
//得到料卷总数量与尺寸
Map
<
String
,
Object
>
barandMap
=
lizhenApi
.
brandQty
(
grLabel
.
getPartNumber
(),
grLabel
.
getProvider
(
));
BrandQtyResult
brandQtyResult
=
lizhenApi
.
brandQty
(
new
BrandQtyRequest
(
grLabel
.
getPartNumber
(),
grLabel
.
getProvider
()
));
if
(
b
arandMap
.
get
(
"qty"
)
==
null
)
{
if
(
b
randQtyResult
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
grLabel
.
getPartNumber
()
+
"MES未返回料卷数量,未找到对应的料卷数量"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
grLabel
.
getPartNumber
()
+
"MES未返回料卷数量,未找到对应的料卷数量"
);
}
}
num
=
(
grLabel
.
getRemainingAmount
()
/
Integer
.
valueOf
(
barandMap
.
get
(
"qty"
).
toString
()
))
+
""
;
num
=
(
grLabel
.
getRemainingAmount
()
/
brandQtyResult
.
getQty
(
))
+
""
;
//校验尺寸,如果没有返回也没有手输,返回错误
//校验尺寸,如果没有返回也没有手输,返回错误
if
(
b
arandMap
.
get
(
"reelSize"
)
==
null
)
{
if
(
b
randQtyResult
.
getReel_size
()
==
0
)
{
if
(
StringUtils
.
isBlank
(
size
))
{
if
(
StringUtils
.
isBlank
(
size
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
grLabel
.
getPartNumber
()
+
"MES未返回物料规格,请选择对应的物料规格"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
grLabel
.
getPartNumber
()
+
"MES未返回物料规格,请选择对应的物料规格"
);
}
}
}
else
{
}
else
{
String
reelSize
=
barandMap
.
get
(
"reelSize"
).
toString
();
int
reelSize
=
brandQtyResult
.
getReel_size
();
if
(
"7"
.
equals
(
reelSize
)
)
{
if
(
7
==
reelSize
)
{
size
=
"7X8"
;
size
=
"7X8"
;
}
/*else if ("13".equals(reelSize)) {
}
/*else if ("13".equals(reelSize)) {
size = "13X24";
size = "13X24";
} */
else
if
(
"15"
.
equals
(
reelSize
)
)
{
} */
else
if
(
15
==
reelSize
)
{
size
=
"15X32"
;
size
=
"15X32"
;
}
}
}
}
...
@@ -402,8 +404,8 @@ public class WarehouseController {
...
@@ -402,8 +404,8 @@ public class WarehouseController {
}
}
//校验是否可以入库
//校验是否可以入库
Map
<
String
,
Object
>
brandQty
=
lizhenApi
.
brandQty
(
barcode
.
getPartNumber
(),
barcode
.
getProvider
(
));
BrandQtyResult
brandQtyResult
=
lizhenApi
.
brandQty
(
new
BrandQtyRequest
(
barcode
.
getPartNumber
(),
barcode
.
getProvider
()
));
if
(
brandQty
==
null
||
brandQty
.
isEmpty
()
)
{
if
(
brandQty
Result
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.partNumber.invalid"
,
"{0}不是有效的料号"
,
new
String
[]{
barcode
.
getPartNumber
()});
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.partNumber.invalid"
,
"{0}不是有效的料号"
,
new
String
[]{
barcode
.
getPartNumber
()});
}
}
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/bean/DifferentMaterial.java
0 → 100644
查看文件 @
81b10db
package
com
.
neotel
.
smfcore
.
custom
.
lizhen
.
bean
;
import
lombok.Data
;
@Data
public
class
DifferentMaterial
{
/**
* wo;//工单
* mc;//机台
* ipn;//物料
* zone;//站位
* gidLineSide;//线_Line_面
*/
private
String
wo
;
private
String
mc
;
private
String
ipn
;
private
String
zone
;
private
String
gidLineSide
;
/*
[
{
"wo": "030000248583",
"mc": "NPM-2",
"ipn": "377S00070",
"zone": "1-07-L",
"gidLineSide": "A05-5FRF-01_1A_B"
},
{
"wo": "030000248583",
"mc": "NPM-2",
"ipn": "117S00069$YA0A01B5",
"zone": "1-08-L",
"gidLineSide": "A05-5FRF-01_1A_B"
},
{
"wo": "030000248583",
"mc": "NPM-2",
"ipn": "N/A",
"zone": "1-10",
"gidLineSide": "A05-5FRF-01_1B_T"
}
]
*/
}
src/main/java/com/neotel/smfcore/custom/lizhen/bean/ManualTower.java
0 → 100644
查看文件 @
81b10db
package
com
.
neotel
.
smfcore
.
custom
.
lizhen
.
bean
;
import
lombok.Data
;
@Data
public
class
ManualTower
{
private
String
ROW_ID
;
// 假设这是一个唯一标识符,可以使用String
private
int
ITEM_NO
;
// 项目号,使用int,如果可能超出int范围,则使用long
private
String
PLANT_CODE
;
// 工厂代码
private
String
MATERIAL_CODE
;
// 料号
private
String
LINE
;
// 线别
private
String
MACHINE_NAME
;
// 机台名
private
String
MACHINE
;
// 机台(可能与MACHINE_NAME重复,但保持原样)
private
String
FACE
;
// 面别
private
String
SLOT
;
// 料站
private
String
SUBSLOT
;
// 左右料站
private
String
MO
;
// 工单
private
String
BRAND
;
// 制造商
private
String
BATCH_CODE
;
// 批次号
private
int
LEFT_QTY
;
// 剩余数量,使用int,根据需求调整
private
int
LEFT_PCBS
;
// 剩余板数
private
int
LEFT_TIMES
;
// 剩余时间,根据时间单位可能需要调整为long或特定时间类型
private
int
PRIORITY
;
// 优先级
private
int
PRODUCT_BOARDS
;
// 主板数
private
String
STATUS
;
// 状态,如果状态值很多且有具体含义,考虑使用枚举
private
String
MACHINE_TYPE
;
// 机台类型
private
String
RECIEVE_TYPE
;
// 接收类型,注意拼写错误,应为RECEIVE_TYPE
private
String
PITCH
;
// 摊位
private
double
TAP_LENGTH
;
// 料盘长度,假设需要较高的精度
private
int
REQ_REEL
;
// 需求卷数
private
int
REQ_QTY
;
// 需求数量
private
String
MODEL
;
// 机种
}
src/main/java/com/neotel/smfcore/custom/lizhen/innerBox/bean/PreWarningItem.java
查看文件 @
81b10db
...
@@ -30,6 +30,10 @@ public class PreWarningItem extends BasePo {
...
@@ -30,6 +30,10 @@ public class PreWarningItem extends BasePo {
private
String
itemId
;
private
String
itemId
;
private
String
reel
;
private
String
reel
;
private
String
brand
;
private
String
brand
;
private
String
pickingId
;
private
String
mo
;
private
int
itemNo
;
/**
/**
* 优先级,1:人工 0:机器
* 优先级,1:人工 0:机器
*/
*/
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/innerBox/rest/VirtualRestController.java
查看文件 @
81b10db
...
@@ -26,6 +26,8 @@ import com.neotel.smfcore.core.system.service.manager.IDataLogManager;
...
@@ -26,6 +26,8 @@ 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.LizhenApi
;
import
com.neotel.smfcore.custom.lizhen.bean.apirequest.BrandQtyRequest
;
import
com.neotel.smfcore.custom.lizhen.bean.apiresult.BrandQtyResult
;
import
com.neotel.smfcore.custom.lizhen.innerBox.bean.VirImportLog
;
import
com.neotel.smfcore.custom.lizhen.innerBox.bean.VirImportLog
;
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.service.manager.IVirImportLogManager
;
import
com.neotel.smfcore.custom.lizhen.innerBox.service.manager.IVirImportLogManager
;
...
@@ -127,8 +129,8 @@ public class VirtualRestController {
...
@@ -127,8 +129,8 @@ public class VirtualRestController {
}
}
//校验是否可以入库
//校验是否可以入库
Map
<
String
,
Object
>
brandQty
=
lizhenApi
.
brandQty
(
barcode
.
getPartNumber
(),
barcode
.
getProvider
(
));
BrandQtyResult
brandQtyResult
=
lizhenApi
.
brandQty
(
new
BrandQtyRequest
(
barcode
.
getPartNumber
(),
barcode
.
getProvider
()
));
if
(
brandQty
==
null
||
brandQty
.
isEmpty
()
)
{
if
(
brandQty
Result
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.partNumber.invalid"
,
"{0}不是有效的料号"
,
new
String
[]{
barcode
.
getPartNumber
()});
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.partNumber.invalid"
,
"{0}不是有效的料号"
,
new
String
[]{
barcode
.
getPartNumber
()});
}
}
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/util/CommonUtil.java
0 → 100644
查看文件 @
81b10db
package
com
.
neotel
.
smfcore
.
custom
.
lizhen
.
util
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
@Component
public
class
CommonUtil
{
public
static
String
plantCode
;
@Value
(
"${api.plantCode}"
)
private
void
setPlantCode
(
String
code
){
CommonUtil
.
plantCode
=
code
;
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论