Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit e7ca553e
由
zshaohui
编写于
2024-07-04 15:02:35 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
砍单回库修改
1 个父辈
001038dd
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
106 行增加
和
22 行删除
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/wipstor/controller/CancelRestockController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/wipstor/controller/LineController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/wipstor/util/CacheUtil.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/wipstor/util/ManualWorkUtil.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/wipstor/controller/CancelRestockController.java
查看文件 @
e7ca553
...
@@ -109,4 +109,30 @@ public class CancelRestockController {
...
@@ -109,4 +109,30 @@ public class CancelRestockController {
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
@ApiOperation
(
"获取砍单回库的料箱信息"
)
@RequestMapping
(
"/boxInfo"
)
@AnonymousAccess
public
ResultBean
boxInfo
()
{
Map
<
String
,
String
>
cacheMap
=
dataCache
.
getCache
(
CacheNameUtil
.
CHCHE_SHIPCANCELUPSHELF
);
if
(
cacheMap
==
null
)
{
cacheMap
=
new
HashMap
<>();
}
return
ResultBean
.
newOkResult
(
cacheMap
.
values
());
}
@ApiOperation
(
"移除砍单回库的料箱信息"
)
@RequestMapping
(
"/removeBoxInfo"
)
@AnonymousAccess
public
ResultBean
removeBoxInfo
(
String
boxStr
)
{
Map
<
String
,
String
>
cacheMap
=
dataCache
.
getCache
(
CacheNameUtil
.
CHCHE_SHIPCANCELUPSHELF
);
if
(
cacheMap
==
null
)
{
cacheMap
=
new
HashMap
<>();
}
cacheMap
.
remove
(
boxStr
);
dataCache
.
updateCache
(
CacheNameUtil
.
CHCHE_SHIPCANCELUPSHELF
,
cacheMap
);
return
ResultBean
.
newOkResult
(
""
);
}
}
}
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/wipstor/controller/LineController.java
查看文件 @
e7ca553
...
@@ -35,6 +35,7 @@ import com.neotel.smfcore.custom.luxsan.api.enums.PalletEnum;
...
@@ -35,6 +35,7 @@ import com.neotel.smfcore.custom.luxsan.api.enums.PalletEnum;
import
com.neotel.smfcore.custom.luxsan.factory_c.common.util.CacheNameUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.common.util.CacheNameUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.common.util.CommonUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.common.util.CommonUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.wipstor.bean.ManualPutIn
;
import
com.neotel.smfcore.custom.luxsan.factory_c.wipstor.bean.ManualPutIn
;
import
com.neotel.smfcore.custom.luxsan.factory_c.wipstor.util.CacheUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.wipstor.util.ManualWorkUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.wipstor.util.ManualWorkUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.wipstor.util.TaskLocUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.wipstor.util.TaskLocUtil
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
...
@@ -101,15 +102,16 @@ public class LineController {
...
@@ -101,15 +102,16 @@ public class LineController {
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.invalid"
,
"条码无效"
);
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.invalid"
,
"条码无效"
);
}
}
//如果是人工作业 直接返回ok
if
(
ManualWorkUtil
.
bindManualWork
(
barcode
.
getBarcode
())
||
ManualWorkUtil
.
bindShipCancelUpShelf
(
barcode
.
getBarcode
()))
{
return
ResultBean
.
newOkResult
(
""
);
}
String
scanCartonId
=
barcode
.
getScanCartonId
();
String
scanCartonId
=
barcode
.
getScanCartonId
();
if
(
Strings
.
isBlank
(
scanCartonId
)){
if
(
Strings
.
isBlank
(
scanCartonId
)){
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.noBind"
,
"条码未绑定CartonId"
);
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.noBind"
,
"条码未绑定CartonId"
);
}
}
//如果是人工作业 直接返回ok
if
(
ManualWorkUtil
.
bindManualWork
(
barcode
.
getBarcode
()))
{
return
ResultBean
.
newOkResult
(
""
);
}
try
{
try
{
ValidCartonResult
result
=
LuxsanApi
.
validCarton
(
new
ValidCartonRequest
(
""
,
scanCartonId
,
CommonUtil
.
plantCode
));
ValidCartonResult
result
=
LuxsanApi
.
validCarton
(
new
ValidCartonRequest
(
""
,
scanCartonId
,
CommonUtil
.
plantCode
));
...
@@ -144,8 +146,8 @@ public class LineController {
...
@@ -144,8 +146,8 @@ public class LineController {
//如果是人工作业的,直接入库
//如果是人工作业的,直接入库
if
(
ManualWorkUtil
.
bindManualWork
(
barcode
.
getBarcode
())){
if
(
ManualWorkUtil
.
bindManualWork
(
barcode
.
getBarcode
())
||
ManualWorkUtil
.
bindShipCancelUpShelf
(
barcode
.
getBarcode
())
){
log
.
info
(
barcode
.
getBarcode
()+
"绑定人工作业或者砍单回库作业,不进行校验"
);
}
else
{
}
else
{
//2.请求接口判断是否过账
//2.请求接口判断是否过账
try
{
try
{
...
@@ -224,27 +226,13 @@ public class LineController {
...
@@ -224,27 +226,13 @@ public class LineController {
//清理扫描的cartonId
//清理扫描的cartonId
barcode
.
setScanCartonId
(
""
);
barcode
.
setScanCartonId
(
""
);
barcode
.
setOdn
(
""
);
//4.生成入库任务
//4.生成入库任务
String
boxLoc
=
TaskLocUtil
.
IN
;
String
boxLoc
=
TaskLocUtil
.
IN
;
taskService
.
addPutInTaskToExecute
(
storage
,
barcode
,
pos
,
boxLoc
);
taskService
.
addPutInTaskToExecute
(
storage
,
barcode
,
pos
,
boxLoc
);
CacheUtil
.
clearBindInfo
(
barcode
.
getBarcode
());
Map
<
String
,
ManualPutIn
>
cacheMap
=
dataCache
.
getCache
(
CacheNameUtil
.
CHCHE_WIP_MANUAL_INPUT
);
if
(
cacheMap
==
null
){
cacheMap
=
new
ConcurrentHashMap
<>();
}
cacheMap
.
remove
(
barcode
.
getBarcode
());
dataCache
.
updateCache
(
CacheNameUtil
.
CHCHE_WIP_MANUAL_INPUT
,
cacheMap
);
List
<
String
>
cacheList
=
dataCache
.
getCache
(
CacheNameUtil
.
CHCHE_MANUALWORK_PUTIN
);
if
(
cacheList
==
null
)
{
cacheList
=
new
ArrayList
<>();
}
cacheList
.
remove
(
barcode
.
getBarcode
());
dataCache
.
updateCache
(
CacheNameUtil
.
CHCHE_MANUALWORK_PUTIN
,
cacheList
);
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
...
@@ -370,8 +358,14 @@ public class LineController {
...
@@ -370,8 +358,14 @@ public class LineController {
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.invalid"
,
"条码无效"
);
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.invalid"
,
"条码无效"
);
}
}
barcode
.
setScanCartonId
(
cartonId
);
barcode
.
setScanCartonId
(
cartonId
);
barcode
.
setCartonId
(
""
);
barcode
.
setPalletId
(
""
);
barcode
.
setOdn
(
""
);
barcodeManager
.
saveBarcode
(
barcode
);
barcodeManager
.
saveBarcode
(
barcode
);
//先移除绑定信息
CacheUtil
.
clearBindInfo
(
barcode
.
getBarcode
());
Map
<
String
,
ManualPutIn
>
cacheMap
=
dataCache
.
getCache
(
CacheNameUtil
.
CHCHE_WIP_MANUAL_INPUT
);
Map
<
String
,
ManualPutIn
>
cacheMap
=
dataCache
.
getCache
(
CacheNameUtil
.
CHCHE_WIP_MANUAL_INPUT
);
if
(
cacheMap
==
null
){
if
(
cacheMap
==
null
){
cacheMap
=
new
ConcurrentHashMap
<>();
cacheMap
=
new
ConcurrentHashMap
<>();
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/wipstor/util/CacheUtil.java
0 → 100644
查看文件 @
e7ca553
package
com
.
neotel
.
smfcore
.
custom
.
luxsan
.
factory_c
.
wipstor
.
util
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.custom.luxsan.factory_c.common.util.CacheNameUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.wipstor.bean.ManualPutIn
;
import
lombok.extern.slf4j.Slf4j
;
import
org.ehcache.impl.internal.concurrent.ConcurrentHashMap
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
@Slf4j
@Service
public
class
CacheUtil
{
private
static
DataCache
dataCache
;
@Autowired
private
void
setDataCache
(
DataCache
cache
){
CacheUtil
.
dataCache
=
cache
;
}
public
static
void
clearBindInfo
(
String
boxStr
){
//移除人工绑定信息
List
<
String
>
cacheList
=
dataCache
.
getCache
(
CacheNameUtil
.
CHCHE_MANUALWORK_PUTIN
);
if
(
cacheList
==
null
)
{
cacheList
=
new
ArrayList
<>();
}
cacheList
.
remove
(
boxStr
);
dataCache
.
updateCache
(
CacheNameUtil
.
CHCHE_MANUALWORK_PUTIN
,
cacheList
);
//移除人工绑定信息
Map
<
String
,
ManualPutIn
>
cacheMap
=
dataCache
.
getCache
(
CacheNameUtil
.
CHCHE_WIP_MANUAL_INPUT
);
if
(
cacheMap
==
null
){
cacheMap
=
new
ConcurrentHashMap
<>();
}
cacheMap
.
remove
(
boxStr
);
dataCache
.
updateCache
(
CacheNameUtil
.
CHCHE_WIP_MANUAL_INPUT
,
cacheMap
);
//移除砍单回库信息
Map
<
String
,
String
>
cancelCacheMap
=
dataCache
.
getCache
(
CacheNameUtil
.
CHCHE_SHIPCANCELUPSHELF
);
if
(
cancelCacheMap
==
null
)
{
cancelCacheMap
=
new
HashMap
<>();
}
cancelCacheMap
.
remove
(
boxStr
);
dataCache
.
updateCache
(
CacheNameUtil
.
CHCHE_SHIPCANCELUPSHELF
,
cacheMap
);
}
}
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/wipstor/util/ManualWorkUtil.java
查看文件 @
e7ca553
...
@@ -6,7 +6,9 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -6,7 +6,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
@Component
@Component
public
class
ManualWorkUtil
{
public
class
ManualWorkUtil
{
...
@@ -28,4 +30,12 @@ public class ManualWorkUtil {
...
@@ -28,4 +30,12 @@ public class ManualWorkUtil {
}
}
public
static
boolean
bindShipCancelUpShelf
(
String
boxStr
){
Map
<
String
,
String
>
cacheMap
=
dataCache
.
getCache
(
CacheNameUtil
.
CHCHE_SHIPCANCELUPSHELF
);
if
(
cacheMap
==
null
)
{
cacheMap
=
new
HashMap
<>();
}
return
cacheMap
.
containsKey
(
boxStr
);
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论