Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 56a1190f
由
zshaohui
编写于
2025-08-05 16:06:47 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.功能优化提交
1 个父辈
4e0d6aca
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
158 行增加
和
12 行删除
src/main/java/com/neotel/smfcore/core/barcode/service/po/Barcode.java
src/main/java/com/neotel/smfcore/core/barcode/utils/CodeResolve.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/BaseDeviceHandler.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLPShelfHandler.java
src/main/java/com/neotel/smfcore/core/order/LiteOrderCache.java
src/main/java/com/neotel/smfcore/core/order/service/po/LiteOrderItem.java
src/main/java/com/neotel/smfcore/custom/zhongche1568/ZhongcheApi.java
src/main/java/com/neotel/smfcore/custom/zhongche1568/bean/api/MaterialCountResult.java
src/main/java/com/neotel/smfcore/custom/zhongche1568/controller/ZhongCheController.java
src/main/java/com/neotel/smfcore/custom/zhongche1568/controller/ZhongCheDeviceController.java
src/main/java/com/neotel/smfcore/core/barcode/service/po/Barcode.java
查看文件 @
56a1190
...
@@ -231,6 +231,8 @@ public class Barcode extends BasePo implements Serializable {
...
@@ -231,6 +231,8 @@ public class Barcode extends BasePo implements Serializable {
*/
*/
private
Date
sluggishTime
;
private
Date
sluggishTime
;
private
String
countType
;
/**
/**
* 自定义的附加信息
* 自定义的附加信息
*/
*/
...
...
src/main/java/com/neotel/smfcore/core/barcode/utils/CodeResolve.java
查看文件 @
56a1190
...
@@ -208,7 +208,7 @@ public class CodeResolve {
...
@@ -208,7 +208,7 @@ public class CodeResolve {
int
lastLabelAmount
=
barcode
.
getLabelAmount
();
int
lastLabelAmount
=
barcode
.
getLabelAmount
();
if
(
type
!=
COMPONENT_TYPE
.
SOLDERPASTE
)
{
if
(
type
!=
COMPONENT_TYPE
.
SOLDERPASTE
)
{
int
currentLabelAmount
=
barcodeFromRule
.
getAmount
();
int
currentLabelAmount
=
barcodeFromRule
.
getAmount
();
if
(
currentLabelAmount
!=
lastLabelAmount
)
{
if
(
currentLabelAmount
!=
lastLabelAmount
&&
currentLabelAmount
>
1
)
{
//本次解析出来的数量与上次条码解析出来的数量不一样,重新设置数量
//本次解析出来的数量与上次条码解析出来的数量不一样,重新设置数量
log
.
info
(
"重新设置"
+
codeBeanFromRule
.
getCodeStr
()
+
"数量为:"
+
currentLabelAmount
);
log
.
info
(
"重新设置"
+
codeBeanFromRule
.
getCodeStr
()
+
"数量为:"
+
currentLabelAmount
);
barcode
.
setAmount
(
currentLabelAmount
);
barcode
.
setAmount
(
currentLabelAmount
);
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/BaseDeviceHandler.java
查看文件 @
56a1190
...
@@ -750,6 +750,7 @@ public class BaseDeviceHandler implements IDeviceHandler {
...
@@ -750,6 +750,7 @@ public class BaseDeviceHandler implements IDeviceHandler {
barcode
.
setInOpor
(
task
.
getOperator
());
barcode
.
setInOpor
(
task
.
getOperator
());
barcode
.
setCheckOutDate
(
null
,
""
);
barcode
.
setCheckOutDate
(
null
,
""
);
barcode
.
setPosName
(
task
.
getPosName
());
barcode
.
setPosName
(
task
.
getPosName
());
barcode
.
setCountType
(
""
);
if
(
barcode
.
isSolder
())
{
if
(
barcode
.
isSolder
())
{
if
(
storagePos
.
isWarmPos
())
{
if
(
storagePos
.
isWarmPos
())
{
//回温仓位
//回温仓位
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLPShelfHandler.java
查看文件 @
56a1190
...
@@ -21,6 +21,8 @@ import com.neotel.smfcore.core.system.util.DevicesStatusUtil;
...
@@ -21,6 +21,8 @@ import com.neotel.smfcore.core.system.util.DevicesStatusUtil;
import
com.neotel.smfcore.core.system.websocket.MsgType
;
import
com.neotel.smfcore.core.system.websocket.MsgType
;
import
com.neotel.smfcore.core.system.websocket.SocketMsg
;
import
com.neotel.smfcore.core.system.websocket.SocketMsg
;
import
com.neotel.smfcore.core.system.websocket.WebSocketServer
;
import
com.neotel.smfcore.core.system.websocket.WebSocketServer
;
import
com.neotel.smfcore.custom.zhongche1568.ZhongcheApi
;
import
com.neotel.smfcore.custom.zhongche1568.bean.api.MaterialCountResult
;
import
com.neotel.smfcore.security.TokenProvider
;
import
com.neotel.smfcore.security.TokenProvider
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
com.neotel.smfcore.security.service.manager.IUserManager
;
import
com.neotel.smfcore.security.service.manager.IUserManager
;
...
@@ -48,6 +50,9 @@ public class NLPShelfHandler extends BaseDeviceHandler {
...
@@ -48,6 +50,9 @@ public class NLPShelfHandler extends BaseDeviceHandler {
@Autowired
@Autowired
private
IUserManager
userManager
;
private
IUserManager
userManager
;
@Autowired
private
ZhongcheApi
zhongcheApi
;
/**
/**
* 扫码
* 扫码
*/
*/
...
@@ -143,6 +148,23 @@ public class NLPShelfHandler extends BaseDeviceHandler {
...
@@ -143,6 +148,23 @@ public class NLPShelfHandler extends BaseDeviceHandler {
}
}
}
}
/*try {
MaterialCountResult count = zhongcheApi.materialCount(barcode.getBarcode(), barcode.getFullCode());
String materialType = count.getMaterialType();
if (!"NOT_COUNT_IN".equals(materialType)) {
return ResultBean.newErrorResult(-1, "", "");
}
int qty = count.getQty();
barcode.setCountType(count.getMaterialType());
if (qty != 0) {
barcode.setAmount(qty);
barcodeManager.save(barcode);
}
} catch (ValidateException e) {
return ResultBean.newErrorResult(-1, e.getMsgKey(), e.getDefaultMsg(), e.getMsgParam());
}*/
String
pn
=
barcode
.
getPartNumber
();
String
pn
=
barcode
.
getPartNumber
();
String
reelId
=
barcode
.
getBarcode
();
String
reelId
=
barcode
.
getBarcode
();
String
num
=
barcode
.
getAmount
()
+
""
;
String
num
=
barcode
.
getAmount
()
+
""
;
...
...
src/main/java/com/neotel/smfcore/core/order/LiteOrderCache.java
查看文件 @
56a1190
...
@@ -863,6 +863,12 @@ public class LiteOrderCache {
...
@@ -863,6 +863,12 @@ public class LiteOrderCache {
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.order.out.notFound"
,
"未找到工单"
);
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.order.out.notFound"
,
"未找到工单"
);
}
}
}
}
if
(!
cacheOrder
.
isTaskFinished
()
&&
!
cacheOrder
.
isNew
())
{
log
.
info
(
"工单["
+
orderNo
+
"]正在执行"
);
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.order.out.executing"
,
"工单正在执行"
);
}
if
(
cacheOrder
.
isClosed
()){
if
(
cacheOrder
.
isClosed
()){
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.order.hasClose"
,
"工单已关闭"
);
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.order.hasClose"
,
"工单已关闭"
);
}
}
...
...
src/main/java/com/neotel/smfcore/core/order/service/po/LiteOrderItem.java
查看文件 @
56a1190
...
@@ -2,13 +2,17 @@ package com.neotel.smfcore.core.order.service.po;
...
@@ -2,13 +2,17 @@ package com.neotel.smfcore.core.order.service.po;
import
com.neotel.smfcore.common.base.BasePo
;
import
com.neotel.smfcore.common.base.BasePo
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
lombok.Data
;
import
lombok.Data
;
import
org.springframework.data.annotation.Transient
;
import
org.springframework.data.annotation.Transient
;
import
org.springframework.data.mongodb.core.index.Indexed
;
import
org.springframework.data.mongodb.core.index.Indexed
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
@Data
@Data
...
@@ -100,6 +104,8 @@ public class LiteOrderItem extends BasePo implements Serializable ,Comparable<Li
...
@@ -100,6 +104,8 @@ public class LiteOrderItem extends BasePo implements Serializable ,Comparable<Li
private
String
orderType
=
""
;
private
String
orderType
=
""
;
private
List
<
DataLog
>
outTaskList
;
/**
/**
* 自定义的附加字段,key=字段名,value=值
* 自定义的附加字段,key=字段名,value=值
*/
*/
...
@@ -145,4 +151,14 @@ public class LiteOrderItem extends BasePo implements Serializable ,Comparable<Li
...
@@ -145,4 +151,14 @@ public class LiteOrderItem extends BasePo implements Serializable ,Comparable<Li
this
.
barcodeStr
=
barcodeStr
+
" ("
+
amount
+
")"
;
this
.
barcodeStr
=
barcodeStr
+
" ("
+
amount
+
")"
;
}
}
}
}
public
void
setOutTaskList
(
DataLog
dataLog
)
{
if
(
this
.
outTaskList
==
null
){
this
.
outTaskList
=
new
ArrayList
<>();
}
DataLog
newTask
=
new
DataLog
();
newTask
.
setBarcode
(
dataLog
.
getBarcode
());
newTask
.
setPosName
(
dataLog
.
getPosName
());
this
.
outTaskList
.
add
(
newTask
);
}
}
}
src/main/java/com/neotel/smfcore/custom/zhongche1568/ZhongcheApi.java
查看文件 @
56a1190
package
com
.
neotel
.
smfcore
.
custom
.
zhongche1568
;
package
com
.
neotel
.
smfcore
.
custom
.
zhongche1568
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.neotel.smfcore.common.exception.ApiException
;
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.StringUtils
;
import
com.neotel.smfcore.core.api.listener.BaseSmfApiListener
;
import
com.neotel.smfcore.core.api.listener.BaseSmfApiListener
;
import
com.neotel.smfcore.core.order.service.po.LiteOrder
;
import
com.neotel.smfcore.core.order.service.po.LiteOrder
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.custom.zhongche1568.bean.api.MaterialCountResult
;
import
com.neotel.smfcore.custom.zhongche1568.bean.api.MaterialCountResult
;
import
com.neotel.smfcore.custom.zhongche1568.bean.shelf.ShelfInfo
;
import
com.neotel.smfcore.custom.zhongche1568.bean.shelf.ShelfInfo
;
import
com.neotel.smfcore.custom.zhongche1568.bean.shelf.ShelfLocInfo
;
import
com.neotel.smfcore.custom.zhongche1568.bean.shelf.ShelfLocInfo
;
import
com.neotel.smfcore.custom.zhongche1568.enums.ZhongCheOrderType
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -62,6 +65,14 @@ public class ZhongcheApi extends BaseSmfApiListener {
...
@@ -62,6 +65,14 @@ public class ZhongcheApi extends BaseSmfApiListener {
}
}
public
MaterialCountResult
materialCount
(
String
reelId
,
String
fullCode
)
{
public
MaterialCountResult
materialCount
(
String
reelId
,
String
fullCode
)
{
if
(
StringUtils
.
isEmpty
(
materialCountUrl
)){
MaterialCountResult
reuslt
=
new
MaterialCountResult
();
reuslt
.
setMaterialType
(
"COUNT_IN"
);
reuslt
.
setReelId
(
reelId
);
reuslt
.
setQty
(
1
);
return
reuslt
;
}
log
.
info
(
"判断是否点料,reelId为:"
+
reelId
+
",fullCode为:"
+
fullCode
+
",地址为:"
+
materialCountUrl
);
log
.
info
(
"判断是否点料,reelId为:"
+
reelId
+
",fullCode为:"
+
fullCode
+
",地址为:"
+
materialCountUrl
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"reelId"
,
reelId
);
paramMap
.
put
(
"reelId"
,
reelId
);
...
@@ -82,6 +93,9 @@ public class ZhongcheApi extends BaseSmfApiListener {
...
@@ -82,6 +93,9 @@ public class ZhongcheApi extends BaseSmfApiListener {
public
void
postCountData
(
String
reelId
,
int
countQty
)
{
public
void
postCountData
(
String
reelId
,
int
countQty
)
{
if
(
StringUtils
.
isEmpty
(
postCountDataUrl
)){
return
;
}
log
.
info
(
"判断是否点料,reelId为:"
+
reelId
+
",数量为:"
+
countQty
+
",地址为:"
+
postCountDataUrl
);
log
.
info
(
"判断是否点料,reelId为:"
+
reelId
+
",数量为:"
+
countQty
+
",地址为:"
+
postCountDataUrl
);
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
paramMap
.
put
(
"reelId"
,
reelId
);
paramMap
.
put
(
"reelId"
,
reelId
);
...
@@ -118,7 +132,9 @@ public class ZhongcheApi extends BaseSmfApiListener {
...
@@ -118,7 +132,9 @@ public class ZhongcheApi extends BaseSmfApiListener {
}
}
paramMap
.
put
(
"outItems"
,
itemList
);
paramMap
.
put
(
"outItems"
,
itemList
);
try
{
try
{
log
.
info
(
"S0005出到货架上,通知wms请求参数为:"
+
JSON
.
toJSONString
(
paramMap
));
String
result
=
HttpHelper
.
postJson
(
shelfFullNotificationUrl
,
paramMap
);
String
result
=
HttpHelper
.
postJson
(
shelfFullNotificationUrl
,
paramMap
);
log
.
info
(
"S0005出到货架上,通知wms返回结果为:"
+
result
);
JSONObject
resultObj
=
JSONObject
.
parseObject
(
result
);
JSONObject
resultObj
=
JSONObject
.
parseObject
(
result
);
Integer
code
=
resultObj
.
getInteger
(
"code"
);
Integer
code
=
resultObj
.
getInteger
(
"code"
);
if
(
code
!=
0
)
{
if
(
code
!=
0
)
{
...
@@ -130,4 +146,22 @@ public class ZhongcheApi extends BaseSmfApiListener {
...
@@ -130,4 +146,22 @@ public class ZhongcheApi extends BaseSmfApiListener {
}
}
}
}
@Override
public
void
onOrderStatusChange
(
String
orderNotifyUrl
,
LiteOrder
liteOrder
)
{
/*if (liteOrder.isClosed() || liteOrder.isTaskFinished()) {
if (ZhongCheOrderType.FIRST.equals(liteOrder.getType())) {
ShelfInfo shelfInfo = new ShelfInfo();
shelfInfo.setOrderNo(liteOrder.getOrderNo());
shelfInfo.setShelfNo("Box");
shelfInfo.setLine(liteOrder.getLine());
shelfInfo.setSo(liteOrder.getSo());
List<>
this.shelfFullNotification(, true);
}
}*/
}
}
}
src/main/java/com/neotel/smfcore/custom/zhongche1568/bean/api/MaterialCountResult.java
查看文件 @
56a1190
...
@@ -13,4 +13,6 @@ public class MaterialCountResult {
...
@@ -13,4 +13,6 @@ public class MaterialCountResult {
private
String
materialType
;
private
String
materialType
;
private
String
reelId
;
private
String
reelId
;
private
int
qty
;
}
}
src/main/java/com/neotel/smfcore/custom/zhongche1568/controller/ZhongCheController.java
查看文件 @
56a1190
...
@@ -43,8 +43,19 @@ public class ZhongCheController {
...
@@ -43,8 +43,19 @@ public class ZhongCheController {
if
(!
ZhongCheOrderType
.
FIRST
.
equals
(
type
)
&&
!
ZhongCheOrderType
.
REMAINING
.
equals
(
type
))
{
if
(!
ZhongCheOrderType
.
FIRST
.
equals
(
type
)
&&
!
ZhongCheOrderType
.
REMAINING
.
equals
(
type
))
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueInvalid"
,
"[{0}]不是有效的参数"
,
new
String
[]{
"type"
});
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueInvalid"
,
"[{0}]不是有效的参数"
,
new
String
[]{
"type"
});
}
}
String
line
=
request
.
getLine
();
if
(
StringUtils
.
isEmpty
(
line
)){
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"line"
});
}
//判断工单号是否存在
//判断工单号是否存在
String
hSerial
=
request
.
getHSerial
();
String
hSerial
=
request
.
getHSerial
();
if
(
StringUtils
.
isEmpty
(
hSerial
))
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"hSerial"
});
}
String
so
=
request
.
getSo
();
if
(
StringUtils
.
isEmpty
(
so
))
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"so"
});
}
LiteOrder
liteOrder
=
liteOrderManager
.
findOneByOrderNo
(
hSerial
);
LiteOrder
liteOrder
=
liteOrderManager
.
findOneByOrderNo
(
hSerial
);
if
(
liteOrder
!=
null
)
{
if
(
liteOrder
!=
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueAlreadyExist"
,
"{0}[{1}]已存在"
,
new
String
[]{
"hSerial"
,
hSerial
});
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueAlreadyExist"
,
"{0}[{1}]已存在"
,
new
String
[]{
"hSerial"
,
hSerial
});
...
...
src/main/java/com/neotel/smfcore/custom/zhongche1568/controller/ZhongCheDeviceController.java
查看文件 @
56a1190
...
@@ -82,13 +82,28 @@ public class ZhongCheDeviceController {
...
@@ -82,13 +82,28 @@ public class ZhongCheDeviceController {
@AnonymousAccess
@AnonymousAccess
public
ResultBean
materialCount
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
public
ResultBean
materialCount
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
String
code
=
paramMap
.
get
(
"code"
);
String
code
=
paramMap
.
get
(
"code"
);
log
.
info
(
"收到物料点料信息:"
+
code
);
String
fullCode
=
paramMap
.
get
(
"fullCode"
);
log
.
info
(
"收到物料点料信息:"
+
code
+
",完整条码信息为:"
+
fullCode
);
Barcode
barcode
=
codeResolve
.
resolveOneValideBarcode
(
code
);
Barcode
barcode
=
codeResolve
.
resolveOneValideBarcode
(
code
);
if
(
barcode
==
null
)
{
if
(
barcode
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.invalid"
,
"{0}不是有效的条码"
,
new
String
[]{
code
});
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.invalid"
,
"{0}不是有效的条码"
,
new
String
[]{
code
});
}
}
//判断有没有存在库位中
String
posName
=
barcode
.
getPosName
();
if
(
StringUtils
.
isNotEmpty
(
posName
))
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.materialBox.inPos"
,
"物料已在库位{0}中"
,
new
String
[]{
posName
});
}
log
.
info
(
code
+
"重新设置物料的完整条码信息:"
+
fullCode
);
barcode
.
setFullCode
(
fullCode
);
barcodeManager
.
save
(
barcode
);
try
{
try
{
MaterialCountResult
count
=
zhongcheApi
.
materialCount
(
barcode
.
getBarcode
(),
barcode
.
getFullCode
());
MaterialCountResult
count
=
zhongcheApi
.
materialCount
(
barcode
.
getBarcode
(),
barcode
.
getFullCode
());
int
qty
=
count
.
getQty
();
barcode
.
setCountType
(
count
.
getMaterialType
());
if
(
qty
!=
0
)
{
barcode
.
setAmount
(
qty
);
barcodeManager
.
save
(
barcode
);
}
return
ResultBean
.
newOkResult
(
count
);
return
ResultBean
.
newOkResult
(
count
);
}
catch
(
ValidateException
e
)
{
}
catch
(
ValidateException
e
)
{
return
ResultBean
.
newErrorResult
(-
1
,
e
.
getMsgKey
(),
e
.
getDefaultMsg
(),
e
.
getMsgParam
());
return
ResultBean
.
newErrorResult
(-
1
,
e
.
getMsgKey
(),
e
.
getDefaultMsg
(),
e
.
getMsgParam
());
...
@@ -110,23 +125,19 @@ public class ZhongCheDeviceController {
...
@@ -110,23 +125,19 @@ public class ZhongCheDeviceController {
if
(
barcode
==
null
)
{
if
(
barcode
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.invalid"
,
"{0}不是有效的条码"
,
new
String
[]{
code
});
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.invalid"
,
"{0}不是有效的条码"
,
new
String
[]{
code
});
}
}
String
posName
=
barcode
.
getPosName
();
if
(
StringUtils
.
isNotEmpty
(
posName
))
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.materialBox.inPos"
,
"物料已在库位{0}中"
,
new
String
[]{
posName
});
}
int
countQty
=
Integer
.
parseInt
(
countQtyStr
);
int
countQty
=
Integer
.
parseInt
(
countQtyStr
);
try
{
try
{
zhongcheApi
.
postCountData
(
barcode
.
getBarcode
(),
countQty
);
zhongcheApi
.
postCountData
(
barcode
.
getBarcode
(),
countQty
);
}
catch
(
ValidateException
e
)
{
}
catch
(
ValidateException
e
)
{
return
ResultBean
.
newErrorResult
(-
1
,
e
.
getMsgKey
(),
e
.
getDefaultMsg
(),
e
.
getMsgParam
());
return
ResultBean
.
newErrorResult
(-
1
,
e
.
getMsgKey
(),
e
.
getDefaultMsg
(),
e
.
getMsgParam
());
}
}
//同时更新库位的信息
StoragePos
pos
=
storagePosManager
.
getByBarcode
(
barcode
.
getBarcode
());
if
(
pos
!=
null
)
{
barcode
=
pos
.
getBarcode
();
}
barcode
.
setAmount
(
countQty
);
barcode
.
setAmount
(
countQty
);
barcodeManager
.
saveBarcode
(
barcode
);
barcodeManager
.
save
(
barcode
);
if
(
pos
!=
null
)
{
pos
.
setBarcode
(
barcode
);
storagePosManager
.
save
(
pos
);
}
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
...
@@ -472,6 +483,25 @@ public class ZhongCheDeviceController {
...
@@ -472,6 +483,25 @@ public class ZhongCheDeviceController {
}
}
}
}
if
(
opTask
==
null
)
{
if
(
opTask
==
null
)
{
//如果没找到对应的任务,判断是否在库位中
StoragePos
pos
=
storagePosManager
.
getByBarcode
(
barcode
.
getBarcode
());
if
(
pos
!=
null
)
{
Barcode
posBarcode
=
pos
.
getBarcode
();
if
(
posBarcode
!=
null
)
{
log
.
info
(
barcode
.
getBarcode
()+
"存在库位中,实际在流水线上,库位:"
+
pos
.
getPosName
()+
"清空,变成可用"
);
pos
.
setBarcode
(
null
);
pos
.
setUsed
(
false
);
pos
.
setEnabled
(
true
);
storagePosManager
.
save
(
pos
);
//二维码状态
barcode
.
setUsed
(
true
);
barcode
.
setUsedDate
(
new
Date
());
//仓位状态
barcode
.
setCheckOutDate
(
new
Date
(),
""
);
barcode
.
setPosName
(
""
);
barcodeManager
.
save
(
barcode
);
}
}
return
ResultBean
.
newErrorResult
(
303
,
"smfcore.task.notExist"
,
"任务不存在"
);
return
ResultBean
.
newErrorResult
(
303
,
"smfcore.task.notExist"
,
"任务不存在"
);
}
}
if
(
opTask
.
isFinished
())
{
if
(
opTask
.
isFinished
())
{
...
@@ -492,6 +522,28 @@ public class ZhongCheDeviceController {
...
@@ -492,6 +522,28 @@ public class ZhongCheDeviceController {
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
@ApiOperation
(
"根据物料条码获取厚度"
)
@RequestMapping
(
"/zhongChe/getHeightByBarcode"
)
@AnonymousAccess
public
ResultBean
getHeightByBarcode
(
HttpServletRequest
request
)
{
int
height
=
12
;
try
{
String
code
=
request
.
getParameter
(
"barcode"
);
if
(
StringUtils
.
isNotEmpty
(
code
)){
Barcode
barcode
=
codeResolve
.
resolveOneValideBarcode
(
code
);
if
(
barcode
!=
null
)
{
height
=
barcode
.
getHeight
();
if
(
barcode
.
getPlateSize
()
==
7
){
height
=
height
/
2
;
}
}
}
}
catch
(
ValidateException
e
)
{
e
.
printStackTrace
();
}
return
ResultBean
.
newOkResult
(
height
);
}
/**
/**
* 物料取出
* 物料取出
*/
*/
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论