Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit db6846a3
由
zshaohui
编写于
2024-07-13 10:54:39 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
原材料仓 退库上架提交
1 个父辈
136800e6
显示空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
183 行增加
和
5 行删除
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/common/util/CacheNameUtil.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/bean/ReturnTower.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/ReturnTowerController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/StorTransferController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/util/MaterialUtil.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/common/util/CacheNameUtil.java
查看文件 @
db6846a
...
...
@@ -8,6 +8,8 @@ public class CacheNameUtil {
public
static
final
String
CHCHE_STOR_TRANSFER
=
"CHCHE_STOR_TRANSFER"
;
public
static
final
String
CHCHE_RETURN_TOWER
=
"CHCHE_RETURN_TOWER"
;
public
static
final
String
CHCHE_TICKET_RETURN
=
"CHCHE_TICKET_RETURN"
;
public
static
final
String
CHCHE_TICKET_TRANSFER
=
"CHCHE_TICKET_TRANSFER"
;
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/bean/ReturnTower.java
0 → 100644
查看文件 @
db6846a
package
com
.
neotel
.
smfcore
.
custom
.
luxsan
.
factory_c
.
rawstor
.
bean
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
@Data
@AllArgsConstructor
public
class
ReturnTower
{
private
String
materialStr
;
private
String
warehouseCode
;
private
String
provider
;
private
int
w
;
private
int
h
;
}
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/ReturnTowerController.java
0 → 100644
查看文件 @
db6846a
package
com
.
neotel
.
smfcore
.
custom
.
luxsan
.
factory_c
.
rawstor
.
controller
;
import
com.alibaba.fastjson.JSON
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.utils.CodeResolve
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.custom.luxsan.api.LuxsanApi
;
import
com.neotel.smfcore.custom.luxsan.api.bean.request.BrandQtyRequest
;
import
com.neotel.smfcore.custom.luxsan.api.bean.result.BrandQtyResult
;
import
com.neotel.smfcore.custom.luxsan.factory_c.common.util.CacheNameUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.ReturnTower
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.StorTransfer
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.MaterialUtil
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.ehcache.impl.internal.concurrent.ConcurrentHashMap
;
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.Map
;
@Slf4j
@ApiOperation
(
"从3F转到W2 1F"
)
@RequestMapping
(
"/returnTower"
)
@RestController
public
class
ReturnTowerController
{
@Autowired
private
DataCache
dataCache
;
@Autowired
private
CodeResolve
codeResolve
;
@ApiOperation
(
"刷料串,进行绑定"
)
@RequestMapping
(
"/bindReturnTower"
)
@AnonymousAccess
public
ResultBean
bindReturnTower
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
log
.
info
(
"退回大库为:"
+
JSON
.
toJSONString
(
paramMap
));
String
materialStr
=
paramMap
.
get
(
"materialStr"
);
//String warehouseCode = paramMap.get("warehouseCode");
String
codeStr
=
paramMap
.
get
(
"codeStr"
);
if
(
StringUtils
.
isEmpty
(
materialStr
))
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"料串信息"
});
}
/*if (StringUtils.isEmpty(warehouseCode)) {
return ResultBean.newErrorResult(-1, "smfcore.valueCanotNull", "{0}不能为空", new String[]{"库别信息"});
}*/
//判断料串信息是否正确
if
(
StringUtils
.
isEmpty
(
materialStr
)
||
!
materialStr
.
startsWith
(
"B00"
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"料串:"
+
materialStr
+
"不是有效的"
);
}
//判断是否已经绑定过其他信息
if
(
MaterialUtil
.
bindInfo
(
materialStr
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"料串:"
+
materialStr
+
"已经进行绑定,请核实"
);
}
//解析条码为barcode
Barcode
barcode
=
codeResolve
.
resolveOneValideBarcode
(
codeStr
);
if
(
barcode
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.noValidCode"
,
"条码无效"
);
}
String
warehouseCode
=
barcode
.
getWarehouseCode
();
if
(
StringUtils
.
isEmpty
(
warehouseCode
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"未找到"
+
barcode
.
getBarcode
()+
"的库别信息"
);
}
//获取尺寸信息
BrandQtyResult
result
=
LuxsanApi
.
brandQtyUrl
(
new
BrandQtyRequest
(
barcode
.
getPartNumber
(),
barcode
.
getProvider
()));
if
(
result
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"未找到维护的尺寸信息"
);
}
int
reelSize
=
result
.
getReel_size
();
int
h
=
0
;
if
(
reelSize
==
7
)
{
h
=
8
;
}
else
if
(
reelSize
==
13
)
{
h
=
24
;
}
else
if
(
reelSize
==
15
)
{
h
=
32
;
}
ReturnTower
returnTower
=
new
ReturnTower
(
materialStr
,
warehouseCode
,
barcode
.
getProvider
(),
reelSize
,
h
);
//1.判断料仓信息是否在储位转移中
Map
<
String
,
ReturnTower
>
cacheMap
=
dataCache
.
getCache
(
CacheNameUtil
.
CHCHE_RETURN_TOWER
);
if
(
cacheMap
==
null
)
{
cacheMap
=
new
ConcurrentHashMap
<>();
}
if
(
cacheMap
.
get
(
materialStr
)
!=
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
materialStr
+
"已经在退库列表中"
);
}
cacheMap
.
put
(
materialStr
,
returnTower
);
dataCache
.
updateCache
(
CacheNameUtil
.
CHCHE_RETURN_TOWER
,
cacheMap
);
return
ResultBean
.
newOkResult
(
""
);
}
@ApiOperation
(
"退库信息"
)
@RequestMapping
(
"/returnTowerInfo"
)
@AnonymousAccess
public
ResultBean
returnTowerInfo
()
{
//1.判断料仓信息是否在储位转移中
Map
<
String
,
ReturnTower
>
cacheMap
=
dataCache
.
getCache
(
CacheNameUtil
.
CHCHE_RETURN_TOWER
);
if
(
cacheMap
==
null
){
cacheMap
=
new
ConcurrentHashMap
<>();
}
return
ResultBean
.
newOkResult
(
cacheMap
.
values
());
}
@ApiOperation
(
"移除退库信息"
)
@RequestMapping
(
"/removeReturnTower"
)
@AnonymousAccess
public
ResultBean
removeReturnTower
(
String
materialStr
)
{
//1.判断料仓信息是否在储位转移中
Map
<
String
,
ReturnTower
>
cacheMap
=
dataCache
.
getCache
(
CacheNameUtil
.
CHCHE_RETURN_TOWER
);
if
(
cacheMap
==
null
){
cacheMap
=
new
ConcurrentHashMap
<>();
}
cacheMap
.
remove
(
materialStr
);
dataCache
.
updateCache
(
CacheNameUtil
.
CHCHE_RETURN_TOWER
,
cacheMap
);
return
ResultBean
.
newOkResult
(
cacheMap
);
}
}
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/StorTransferController.java
查看文件 @
db6846a
...
...
@@ -137,6 +137,7 @@ public class StorTransferController {
}
cacheMap
.
remove
(
materialStr
);
dataCache
.
updateCache
(
CacheNameUtil
.
CHCHE_STOR_TRANSFER
,
cacheMap
);
return
ResultBean
.
newOkResult
(
cacheMap
);
}
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/util/MaterialUtil.java
查看文件 @
db6846a
...
...
@@ -2,10 +2,7 @@ package com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.BindGrInfo
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.StorTransfer
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.TicketReturn
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.TicketTransfer
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.bean.*
;
import
com.neotel.smfcore.custom.luxsan.factory_c.common.util.CacheNameUtil
;
import
org.ehcache.impl.internal.concurrent.ConcurrentHashMap
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -24,7 +21,7 @@ public class MaterialUtil {
public
static
boolean
bindInfo
(
String
materialStr
)
{
return
bindGr
(
materialStr
)
||
storTransfer
(
materialStr
)
||
ticketReturn
(
materialStr
)
||
ticketTransfer
(
materialStr
);
return
bindGr
(
materialStr
)
||
storTransfer
(
materialStr
)
||
ticketReturn
(
materialStr
)
||
ticketTransfer
(
materialStr
)
||
returnTower
(
materialStr
)
;
}
public
static
String
getWarhouseCode
(
String
materialStr
)
{
...
...
@@ -132,6 +129,18 @@ public class MaterialUtil {
return
null
;
}
//是否退回大库
public
static
boolean
returnTower
(
String
materialStr
)
{
Map
<
String
,
ReturnTower
>
cacheMap
=
dataCache
.
getCache
(
CacheNameUtil
.
CHCHE_RETURN_TOWER
);
if
(
cacheMap
!=
null
)
{
if
(
cacheMap
.
get
(
materialStr
)
!=
null
)
{
return
true
;
}
}
return
false
;
}
public
static
String
getMaterialSize
(
String
materialStr
)
{
String
size
=
"7"
;
if
(
bindGr
(
materialStr
)){
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论