Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 05e56ac7
由
LN
编写于
2022-01-28 14:26:55 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
NL料架增加入库单验证
1 个父辈
a824869c
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
54 行增加
和
10 行删除
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLShelfHandler.java
src/main/java/com/neotel/smfcore/core/device/util/DataCache.java
src/main/java/com/neotel/smfcore/core/inList/bean/ItemReelInfo.java
src/main/java/com/neotel/smfcore/core/inList/rest/InListController.java
src/main/java/com/neotel/smfcore/core/storage/enums/DeviceType.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLShelfHandler.java
查看文件 @
05e56ac
...
@@ -9,6 +9,7 @@ import com.neotel.smfcore.core.barcode.service.po.Barcode;
...
@@ -9,6 +9,7 @@ import com.neotel.smfcore.core.barcode.service.po.Barcode;
import
com.neotel.smfcore.core.device.api.IOpAuthApi
;
import
com.neotel.smfcore.core.device.api.IOpAuthApi
;
import
com.neotel.smfcore.core.device.bean.NLShelfOperateBean
;
import
com.neotel.smfcore.core.device.bean.NLShelfOperateBean
;
import
com.neotel.smfcore.core.device.bean.StatusBean
;
import
com.neotel.smfcore.core.device.bean.StatusBean
;
import
com.neotel.smfcore.core.inList.util.InListCache
;
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.storage.enums.DeviceType
;
import
com.neotel.smfcore.core.storage.enums.DeviceType
;
...
@@ -48,6 +49,8 @@ public class NLShelfHandler extends BaseDeviceHandler {
...
@@ -48,6 +49,8 @@ public class NLShelfHandler extends BaseDeviceHandler {
@Autowired
@Autowired
private
ILiteOrderManager
liteOrderManager
;
private
ILiteOrderManager
liteOrderManager
;
@Autowired
private
InListCache
inListCache
;
@Override
@Override
public
StatusBean
handleClientRequest
(
StatusBean
statusBean
,
HttpServletRequest
request
)
{
public
StatusBean
handleClientRequest
(
StatusBean
statusBean
,
HttpServletRequest
request
)
{
...
@@ -287,6 +290,7 @@ public class NLShelfHandler extends BaseDeviceHandler {
...
@@ -287,6 +290,7 @@ public class NLShelfHandler extends BaseDeviceHandler {
//入库
//入库
NLShelfOperateBean
operateBean
=
getOperateBean
(
token
);
NLShelfOperateBean
operateBean
=
getOperateBean
(
token
);
StoragePos
opPos
=
operateBean
.
getOpPos
();
StoragePos
opPos
=
operateBean
.
getOpPos
();
currentStorage
=
dataCache
.
getStorageById
(
opPos
.
getStorageId
());
if
(
opPos
==
null
)
{
if
(
opPos
==
null
)
{
//未扫描库位
//未扫描库位
String
operatePosId
=
operateBean
.
getNextPosId
();
String
operatePosId
=
operateBean
.
getNextPosId
();
...
@@ -297,6 +301,13 @@ public class NLShelfHandler extends BaseDeviceHandler {
...
@@ -297,6 +301,13 @@ public class NLShelfHandler extends BaseDeviceHandler {
//有下一个库位
//有下一个库位
StoragePos
currentPos
=
storagePosManager
.
get
(
String
.
valueOf
(
operatePosId
));
StoragePos
currentPos
=
storagePosManager
.
get
(
String
.
valueOf
(
operatePosId
));
if
(
currentPos
!=
null
)
{
if
(
currentPos
!=
null
)
{
//入库单验证
ResultBean
resultBean
=
inListCache
.
inListValidate
(
currentStorage
.
getInListName
(),
barcode
.
getPartNumber
()
);
if
(!
resultBean
.
isOkResult
()){
return
resultBean
;
}
canBarcodePutInPos
(
currentPos
,
barcode
);
canBarcodePutInPos
(
currentPos
,
barcode
);
//验证通过,先灭上一个库位灯
//验证通过,先灭上一个库位灯
closeLastPos
(
token
);
closeLastPos
(
token
);
...
@@ -324,6 +335,11 @@ public class NLShelfHandler extends BaseDeviceHandler {
...
@@ -324,6 +335,11 @@ public class NLShelfHandler extends BaseDeviceHandler {
}
}
}
}
}
else
{
}
else
{
//入库单验证
ResultBean
resultBean
=
inListCache
.
inListValidate
(
currentStorage
.
getInListName
(),
barcode
.
getPartNumber
()
);
if
(!
resultBean
.
isOkResult
()){
return
resultBean
;
}
//已扫过库位
//已扫过库位
canBarcodePutInPos
(
opPos
,
barcode
);
canBarcodePutInPos
(
opPos
,
barcode
);
log
.
info
(
barcode
.
getPartNumber
()
+
" [ "
+
barcode
.
getBarcode
()
+
" ] "
+
"入库到:"
+
opPos
.
getPosName
());
log
.
info
(
barcode
.
getPartNumber
()
+
" [ "
+
barcode
.
getBarcode
()
+
" ] "
+
"入库到:"
+
opPos
.
getPosName
());
...
...
src/main/java/com/neotel/smfcore/core/device/util/DataCache.java
查看文件 @
05e56ac
...
@@ -10,6 +10,7 @@ import com.neotel.smfcore.common.utils.StringUtils;
...
@@ -10,6 +10,7 @@ import com.neotel.smfcore.common.utils.StringUtils;
import
com.neotel.smfcore.common.utils.YmlUpdateUtil
;
import
com.neotel.smfcore.common.utils.YmlUpdateUtil
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.utils.CodeResolve
;
import
com.neotel.smfcore.core.barcode.utils.CodeResolve
;
import
com.neotel.smfcore.core.inList.util.InListCache
;
import
com.neotel.smfcore.core.language.service.bean.LanguageInfo
;
import
com.neotel.smfcore.core.language.service.bean.LanguageInfo
;
import
com.neotel.smfcore.core.language.service.po.LanguageMsg
;
import
com.neotel.smfcore.core.language.service.po.LanguageMsg
;
import
com.neotel.smfcore.core.language.util.MessageUtils
;
import
com.neotel.smfcore.core.language.util.MessageUtils
;
...
@@ -57,6 +58,10 @@ public class DataCache {
...
@@ -57,6 +58,10 @@ public class DataCache {
@Autowired
@Autowired
private
ICacheItemDao
cacheItemDao
;
private
ICacheItemDao
cacheItemDao
;
@Autowired
private
InListCache
inListCache
;
/**
/**
* 是否需要推送温湿度报警值
* 是否需要推送温湿度报警值
*/
*/
...
@@ -519,6 +524,11 @@ public class DataCache {
...
@@ -519,6 +524,11 @@ public class DataCache {
//入库
//入库
amount
=
barcode
.
getAmount
();
amount
=
barcode
.
getAmount
();
storage
.
useOnePos
(
pos
);
storage
.
useOnePos
(
pos
);
//入库单处理
if
(
ObjectUtil
.
isNotEmpty
(
storage
.
getInListName
())){
inListCache
.
UpdateInList
(
storage
.
getInListName
(),
pos
,
barcode
);
}
}
}
allStorage
.
put
(
cid
,
storage
);
allStorage
.
put
(
cid
,
storage
);
return
updateInventoryAmount
(
cid
,
partNumber
,
amount
);
return
updateInventoryAmount
(
cid
,
partNumber
,
amount
);
...
...
src/main/java/com/neotel/smfcore/core/inList/bean/ItemReelInfo.java
查看文件 @
05e56ac
...
@@ -17,7 +17,7 @@ public class ItemReelInfo implements Serializable {
...
@@ -17,7 +17,7 @@ public class ItemReelInfo implements Serializable {
/**
/**
* 唯一编号
* 唯一编号
*/
*/
private
String
RI
;
private
String
ri
;
/**
/**
* 入库数量
* 入库数量
...
...
src/main/java/com/neotel/smfcore/core/inList/rest/InListController.java
查看文件 @
05e56ac
...
@@ -22,6 +22,7 @@ import com.neotel.smfcore.core.inList.service.po.InList;
...
@@ -22,6 +22,7 @@ import com.neotel.smfcore.core.inList.service.po.InList;
import
com.neotel.smfcore.core.inList.service.po.InListItem
;
import
com.neotel.smfcore.core.inList.service.po.InListItem
;
import
com.neotel.smfcore.core.inList.util.InListCache
;
import
com.neotel.smfcore.core.inList.util.InListCache
;
import
com.neotel.smfcore.core.storage.enums.DeviceType
;
import
com.neotel.smfcore.core.storage.enums.DeviceType
;
import
com.neotel.smfcore.core.storage.service.manager.IStorageManager
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
com.neotel.smfcore.security.bean.FileProperties
;
import
com.neotel.smfcore.security.bean.FileProperties
;
...
@@ -66,6 +67,9 @@ public class InListController {
...
@@ -66,6 +67,9 @@ public class InListController {
@Autowired
@Autowired
private
DataCache
dataCache
;
private
DataCache
dataCache
;
@Autowired
private
IStorageManager
storageManager
;
@ApiOperation
(
"上传入库单"
)
@ApiOperation
(
"上传入库单"
)
@PostMapping
(
value
=
"/upload"
)
@PostMapping
(
value
=
"/upload"
)
@AnonymousAccess
@AnonymousAccess
...
@@ -180,12 +184,17 @@ public class InListController {
...
@@ -180,12 +184,17 @@ public class InListController {
String
inListName
=
params
.
get
(
"inListName"
);
String
inListName
=
params
.
get
(
"inListName"
);
String
storageId
=
params
.
get
(
"storageId"
);
String
storageId
=
params
.
get
(
"storageId"
);
String
groupId
=
params
.
get
(
"groupId"
);
String
groupId
=
params
.
get
(
"groupId"
);
InList
inList
=
inListCache
.
getInList
(
inListName
);
if
(
ObjectUtil
.
isEmpty
(
inListName
)){
if
(
inList
==
null
)
{
return
ResultBean
.
newErrorResult
(
1
,
"smfcore.inlist.notFound"
,
"未找到入库单[{0}]"
,
new
String
[]{
inListName
});
}
}
if
(
inList
.
getStatus
()
==
INLIST_STATUS
.
OK
)
{
else
{
return
ResultBean
.
newErrorResult
(
1
,
"smfcore.inlist.listOk"
,
"入库单[{0}]已完成"
,
new
String
[]{
inListName
});
InList
inList
=
inListCache
.
getInList
(
inListName
);
if
(
inList
==
null
)
{
return
ResultBean
.
newErrorResult
(
1
,
"smfcore.inlist.notFound"
,
"未找到入库单[{0}]"
,
new
String
[]{
inListName
});
}
if
(
inList
.
getStatus
()
==
INLIST_STATUS
.
OK
)
{
return
ResultBean
.
newErrorResult
(
1
,
"smfcore.inlist.listOk"
,
"入库单[{0}]已完成"
,
new
String
[]{
inListName
});
}
}
}
if
(
ObjectUtil
.
isEmpty
(
storageId
))
{
if
(
ObjectUtil
.
isEmpty
(
storageId
))
{
...
@@ -194,9 +203,11 @@ public class InListController {
...
@@ -194,9 +203,11 @@ public class InListController {
for
(
String
cid
:
cidList
)
{
for
(
String
cid
:
cidList
)
{
Storage
storage
=
dataCache
.
getStorage
(
cid
);
Storage
storage
=
dataCache
.
getStorage
(
cid
);
if
(
storage
!=
null
)
{
if
(
storage
!=
null
)
{
if
(
storage
.
is
Shelf
()
||
storage
.
isNLShelf
()
||
storage
.
isAccShelf
()
||
storage
.
isCodeShelf
(
))
{
if
(
storage
.
is
Type
(
new
DeviceType
[]{
DeviceType
.
NLP
,
DeviceType
.
NL
}
))
{
storage
.
setInListName
(
inListName
);
storage
.
setInListName
(
inListName
);
log
.
info
(
"设置组["
+
groupId
+
"]料架["
+
storage
.
getName
()
+
"]的入库单为:["
+
inListName
+
"]"
);
log
.
info
(
"设置组["
+
groupId
+
"]料架["
+
storage
.
getName
()
+
"]的入库单为:["
+
inListName
+
"]"
);
storageManager
.
save
(
storage
);
dataCache
.
reloadStorage
(
storage
,
storage
.
getCid
());
}
}
}
}
...
@@ -204,9 +215,11 @@ public class InListController {
...
@@ -204,9 +215,11 @@ public class InListController {
}
else
{
}
else
{
Storage
storage
=
dataCache
.
getStorageById
(
storageId
);
Storage
storage
=
dataCache
.
getStorageById
(
storageId
);
if
(
storage
!=
null
)
{
if
(
storage
!=
null
)
{
if
(
storage
.
is
Shelf
()
||
storage
.
isNLShelf
()
||
storage
.
isAccShelf
()
||
storage
.
isCodeShelf
(
))
{
if
(
storage
.
is
Type
(
new
DeviceType
[]{
DeviceType
.
NLP
,
DeviceType
.
NL
}
))
{
storage
.
setInListName
(
inListName
);
storage
.
setInListName
(
inListName
);
log
.
info
(
"设置料架["
+
storage
.
getName
()
+
"]的入库单为:["
+
inListName
+
"]"
);
log
.
info
(
"设置料架["
+
storage
.
getName
()
+
"]的入库单为:["
+
inListName
+
"]"
);
storageManager
.
save
(
storage
);
dataCache
.
reloadStorage
(
storage
,
storage
.
getCid
());
}
}
}
}
}
}
...
...
src/main/java/com/neotel/smfcore/core/storage/enums/DeviceType.java
查看文件 @
05e56ac
...
@@ -105,7 +105,12 @@ public enum DeviceType {
...
@@ -105,7 +105,12 @@ public enum DeviceType {
NL
(
"storage.type.nl"
),
NL
(
"storage.type.nl"
),
/**
/**
* 17 (默认料仓)
* 17 感应料架NLP
*/
NLP
(
"storage.type.nlp"
),
/**
* 18 (默认料仓)
*/
*/
DEFAULT
(
"storage.type.default"
)
DEFAULT
(
"storage.type.default"
)
;
;
...
@@ -129,6 +134,6 @@ public enum DeviceType {
...
@@ -129,6 +134,6 @@ public enum DeviceType {
}
}
public
static
List
<
DeviceType
>
availableTypeList
(){
public
static
List
<
DeviceType
>
availableTypeList
(){
return
Lists
.
newArrayList
(
AUTO
,
LINE
,
BATCH
,
ACCSHELF
,
CODESHELF
,
SOLDERPASTE
,
VERTICALBOX
,
SMD_XL
,
SMD_DUO
);
return
Lists
.
newArrayList
(
AUTO
,
LINE
,
BATCH
,
SOLDERPASTE
,
VERTICALBOX
,
SMD_XL
,
SMD_DUO
,
SMD_XLC
,
VIRTUAL
,
NL
,
NLP
);
}
}
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论