Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 5a91a66b
由
孙克
编写于
2024-08-24 19:17:34 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
手动绑定料串到BG/CG
去除料格已放满验证
1 个父辈
a85b7e8f
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
93 行增加
和
66 行删除
src/main/java/com/neotel/smfcore/common/init/DataInitManager.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/CDeviceController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/manual/ManualLineController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/util/BinCacheUtil.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/third/MaterialRestController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/third/bean/MaterialLoc.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/third/util/MaterialLocUtil.java
src/main/java/com/neotel/smfcore/common/init/DataInitManager.java
查看文件 @
5a91a66
...
...
@@ -238,6 +238,8 @@ public class DataInitManager {
//手动出库
addNewFunctionMenu
(
6
,
raw
,
"outVir"
,
"手动出库"
,
"outVir"
,
"outVir/index"
,
"docOut"
,
functionMenuMap
);
//料串绑定
addNewFunctionMenu
(
7
,
raw
,
"manualBindStacker"
,
"料串绑定"
,
"manualBindStacker"
,
"manualBindStacker/index"
,
"docOut"
,
functionMenuMap
);
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/CDeviceController.java
查看文件 @
5a91a66
...
...
@@ -671,7 +671,7 @@ public class CDeviceController {
barcodeManager
.
saveBarcode
(
barcode
);
//更新料串缓存信息
MaterialLocUtil
.
update
Material
Loc
(
materialStr
,
""
,
null
);
MaterialLocUtil
.
update
Stacker
Loc
(
materialStr
,
""
,
null
);
Map
<
String
,
String
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"binCode"
,
boxStr
);
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/manual/ManualLineController.java
查看文件 @
5a91a66
...
...
@@ -187,19 +187,4 @@ public class ManualLineController {
return
ResultBean
.
newOkResult
(
""
);
}
@ApiOperation
(
"获取料串目的地接口"
)
@RequestMapping
(
"/material/api/getDestination"
)
@AnonymousAccess
public
ResultBean
getDestination
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
String
materialStr
=
paramMap
.
get
(
"materialStr"
);
String
loc
=
paramMap
.
get
(
"loc"
);
log
.
info
(
"获取料串目的地,料串为:"
+
materialStr
+
",位置为:"
+
loc
);
Map
<
String
,
String
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"destination"
,
"C2-3F-BG"
);
resultMap
.
put
(
"materialStr"
,
materialStr
);
return
ResultBean
.
newOkResult
(
resultMap
);
}
}
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/util/BinCacheUtil.java
查看文件 @
5a91a66
...
...
@@ -437,11 +437,11 @@ public class BinCacheUtil {
*/
public
static
String
canMaterialPutInBin
(
Barcode
reelBarcode
,
Barcode
boxBarcode
,
String
binId
)
{
String
isBinFull
=
boxBarcode
.
getExtraData
(
binId
);
if
(
isBinFull
!=
null
)
{
//该料格已放满, 不可以再放料
log
.
info
(
"料格["
+
binId
+
"]已满,不可放入物料["
+
reelBarcode
.
getBarcode
()
+
"]"
);
return
"料格["
+
binId
+
"]已满,不可放入物料["
+
reelBarcode
.
getBarcode
()
+
"]"
;
}
//
if (isBinFull != null) {
//
//该料格已放满, 不可以再放料
//
log.info("料格[" + binId + "]已满,不可放入物料[" + reelBarcode.getBarcode() + "]");
//
return "料格[" + binId + "]已满,不可放入物料[" + reelBarcode.getBarcode() + "]";
//
}
if
(!
BinCacheUtil
.
canPutInBinCode
(
binId
,
reelBarcode
.
getWarehouseCode
()))
{
return
"库别["
+
reelBarcode
.
getWarehouseCode
()
+
"]不可放入料格["
+
binId
+
"]"
;
}
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/third/MaterialRestController.java
查看文件 @
5a91a66
...
...
@@ -8,6 +8,7 @@ import com.neotel.smfcore.security.annotation.AnonymousAccess;
import
io.swagger.annotations.ApiOperation
;
import
lombok.Data
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.logging.log4j.util.Strings
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -29,7 +30,7 @@ public class MaterialRestController {
String
materialStr
=
paramMap
.
get
(
"materialStr"
);
String
loc
=
paramMap
.
get
(
"loc"
);
log
.
info
(
"收到料串位置更新,料串为:"
+
materialStr
+
",位置为:"
+
loc
);
MaterialLocUtil
.
update
Material
Loc
(
materialStr
,
loc
,
null
);
MaterialLocUtil
.
update
Stacker
Loc
(
materialStr
,
loc
,
null
);
return
ResultBean
.
newOkResult
(
""
);
}
...
...
@@ -39,6 +40,35 @@ public class MaterialRestController {
@RequestMapping
(
"/getMaterialLoc"
)
@AnonymousAccess
public
ResultBean
getMaterialLoc
()
{
return
ResultBean
.
newOkResult
(
MaterialLocUtil
.
getMaterialLoc
());
return
ResultBean
.
newOkResult
(
MaterialLocUtil
.
getAllStackerLoc
());
}
@ApiOperation
(
"获取料串目的地接口"
)
@RequestMapping
(
"/getDestination"
)
@AnonymousAccess
public
ResultBean
getDestination
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
String
stackerCode
=
paramMap
.
get
(
"materialStr"
);
String
loc
=
paramMap
.
get
(
"loc"
);
log
.
info
(
"获取料串目的地,料串为:"
+
stackerCode
+
",位置为:"
+
loc
);
String
stackerDestination
=
MaterialLocUtil
.
getStackerDestination
(
stackerCode
);
if
(
Strings
.
isBlank
(
stackerDestination
)){
stackerDestination
=
"W2-1F"
;
}
Map
<
String
,
String
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"destination"
,
stackerDestination
);
resultMap
.
put
(
"materialStr"
,
stackerCode
);
return
ResultBean
.
newOkResult
(
resultMap
);
}
@ApiOperation
(
"手动修改料串目的地接口"
)
@RequestMapping
(
"/manualBindStacker"
)
@AnonymousAccess
public
ResultBean
manualBindStack
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
String
stackerCode
=
paramMap
.
get
(
"stackerCode"
);
String
destination
=
paramMap
.
get
(
"destination"
);
log
.
info
(
"手动绑定料串["
+
stackerCode
+
"]目的地:"
+
stackerCode
);
MaterialLocUtil
.
updateStackerLoc
(
stackerCode
,
""
,
destination
);
return
ResultBean
.
newOkResult
(
"绑定成功"
);
}
}
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/third/bean/MaterialLoc.java
查看文件 @
5a91a66
...
...
@@ -10,13 +10,25 @@ import java.util.List;
@Data
public
class
MaterialLoc
{
private
String
material
;
/**
* 料串条码
*/
private
String
stackerCode
;
/**
* 位置编号
*/
private
String
loc
;
private
int
amount
=
0
;
/**
* 位置名称
*/
private
String
locName
;
private
List
<
Barcode
>
barcodeList
=
new
ArrayList
<>();
/**
* 目的地: C2-3F-BG或C2-3F-CG
*/
private
String
destination
;
private
Date
createDate
=
new
Date
();
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/third/util/MaterialLocUtil.java
查看文件 @
5a91a66
package
com
.
neotel
.
smfcore
.
custom
.
luxsan
.
factory_c
.
third
.
util
;
import
com.google.common.collect.Maps
;
import
com.neotel.smfcore.common.bean.ReelLockPosInfo
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.custom.luxsan.factory_c.third.bean.MaterialLoc
;
import
com.neotel.smfcore.custom.luxsan.factory_c.third.enums.MaterialLocEnum
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.PostConstruct
;
import
java.util.*
;
@Component
@Slf4j
public
class
MaterialLocUtil
{
public
static
final
String
CACHE_MATERIAL_LOC
=
"CACHE_MATERIAL_LOC"
;
public
static
final
String
CACHE_STACKER_LOC
=
"CACHE_STACKER_LOC"
;
private
static
Map
<
String
,
MaterialLoc
>
stackerLocMap
=
Maps
.
newConcurrentMap
();
private
static
DataCache
dataCache
;
@PostConstruct
public
void
init
()
{
Map
<
String
,
MaterialLoc
>
cacheMap
=
dataCache
.
getCache
(
CACHE_STACKER_LOC
);
if
(
cacheMap
!=
null
)
{
stackerLocMap
.
putAll
(
cacheMap
);
}
}
@Autowired
public
void
setDataCache
(
DataCache
cache
)
{
MaterialLocUtil
.
dataCache
=
cache
;
}
public
static
void
updateMaterialLoc
(
String
materialStr
,
String
loc
,
Barcode
barcode
)
{
Map
<
String
,
MaterialLoc
>
cacheMap
=
dataCache
.
getCache
(
CACHE_MATERIAL_LOC
);
if
(
cacheMap
==
null
)
{
cacheMap
=
new
HashMap
<>();
}
MaterialLoc
materialLoc
=
cacheMap
.
get
(
materialStr
);
/**
* 更新料串位置或目的地
*/
public
static
synchronized
void
updateStackerLoc
(
String
stackerCode
,
String
loc
,
String
destination
){
log
.
info
(
"更新料串["
+
stackerCode
+
"]位置为["
+
loc
+
"] 目的地为:["
+
destination
+
"]"
);
MaterialLoc
materialLoc
=
stackerLocMap
.
get
(
stackerCode
);
if
(
materialLoc
==
null
)
{
materialLoc
=
new
MaterialLoc
();
materialLoc
.
setStackerCode
(
stackerCode
);
}
if
(
StringUtils
.
isNotEmpty
(
loc
))
{
String
name
=
MaterialLocEnum
.
findNameById
(
loc
);
materialLoc
.
setLoc
(
name
);
}
materialLoc
.
setMaterial
(
materialStr
);
materialLoc
.
setUpdateDate
(
new
Date
());
List
<
Barcode
>
barcodeList
=
materialLoc
.
getBarcodeList
();
materialLoc
.
setLoc
(
loc
);
materialLoc
.
setLocName
(
name
);
if
(
barcode
!=
null
)
{
if
(
barcodeList
!=
null
&&
!
barcodeList
.
isEmpty
())
{
barcodeList
.
removeIf
(
t
->
t
.
getBarcode
().
equals
(
barcode
.
getBarcode
()));
}
barcode
.
setUpdateDate
(
new
Date
());
barcodeList
.
add
(
barcode
);
}
int
amount
=
barcodeList
.
stream
().
mapToInt
(
Barcode:
:
getAmount
).
sum
();
materialLoc
.
setAmount
(
amount
);
if
(
StringUtils
.
isNotEmpty
(
destination
))
{
materialLoc
.
setDestination
(
destination
);
}
materialLoc
.
setBarcodeList
(
barcodeList
);
materialLoc
.
setUpdateDate
(
new
Date
());
cacheMap
.
put
(
materialStr
,
materialLoc
);
dataCache
.
updateCache
(
CACHE_MATERIAL_LOC
,
cache
Map
);
stackerLocMap
.
put
(
stackerCode
,
materialLoc
);
//dataCache.updateCache(CACHE_STACKER_LOC, stackerLoc
Map);
}
public
static
void
removeMaterialLoc
(
String
materialStr
){
Map
<
String
,
MaterialLoc
>
cacheMap
=
dataCache
.
getCache
(
CACHE_MATERIAL_LOC
);
if
(
cacheMap
==
null
)
{
cacheMap
=
new
HashMap
<>();
public
static
String
getStackerDestination
(
String
stackerCode
){
MaterialLoc
materialLoc
=
stackerLocMap
.
get
(
stackerCode
);
if
(
materialLoc
!=
null
){
return
materialLoc
.
getDestination
();
}
cacheMap
.
remove
(
materialStr
);
dataCache
.
updateCache
(
CACHE_MATERIAL_LOC
,
cacheMap
);
return
""
;
}
public
static
Collection
<
MaterialLoc
>
getMaterialLoc
()
{
Map
<
String
,
MaterialLoc
>
cacheMap
=
dataCache
.
getCache
(
CACHE_MATERIAL_LOC
);
if
(
cacheMap
==
null
)
{
cacheMap
=
new
HashMap
<>();
}
return
cacheMap
.
values
();
public
static
Collection
<
MaterialLoc
>
getAllStackerLoc
()
{
return
stackerLocMap
.
values
();
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论