Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 011dd9c3
由
zshaohui
编写于
2025-11-19 13:59:43 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.线体对应多个机种
1 个父辈
66ad6eff
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
162 行增加
和
142 行删除
src/main/java/com/neotel/smfcore/core/order/LiteOrderCache.java
src/main/java/com/neotel/smfcore/core/storage/rest/StoragePosController.java
src/main/java/com/neotel/smfcore/core/order/LiteOrderCache.java
查看文件 @
011dd9c
...
...
@@ -667,55 +667,63 @@ public class LiteOrderCache {
try
{
excludePosIds
.
add
(
pos
.
getId
());
List
<
String
>
modelList
=
new
ArrayList
<>();
String
model
=
orderItem
.
getModel
();
if
(
StringUtils
.
isEmpty
(
model
))
{
//C02-3FSMT-18,C02-3FSMT-19,C02-3FSMT-09,C02-3FSMT-08
String
orderLine
=
cacheOrder
.
getLine
();
if
(
StringUtils
.
isNotEmpty
(
orderLine
))
{
if
(
orderLine
.
startsWith
(
"C02-1FSMT-98"
)){
model
=
"RAINIER"
;
}
else
if
(
orderLine
.
startsWith
(
"C02-3FSMT-03"
)){
model
=
"RAINIER"
;
model
List
.
add
(
"RAINIER"
)
;
}
else
if
(
orderLine
.
startsWith
(
"C02-3FSMT-04"
)){
model
=
"RAINIER"
;
model
List
.
add
(
"RAINIER"
)
;
}
else
if
(
orderLine
.
startsWith
(
"C02-3FSMT-05"
)){
model
=
"RAINIER"
;
model
List
.
add
(
"X11"
)
;
}
else
if
(
orderLine
.
startsWith
(
"C02-3FSMT-06"
)){
model
=
"RAINIER"
;
model
List
.
add
(
"RAINIER"
)
;
}
else
if
(
orderLine
.
startsWith
(
"C02-3FSMT-07"
)){
model
=
"RAINIER"
;
model
List
.
add
(
"RAINIER"
)
;
}
else
if
(
orderLine
.
startsWith
(
"C02-3FSMT-13"
)){
model
=
"RAINIER"
;
model
List
.
add
(
"RAINIER"
)
;
}
else
if
(
orderLine
.
startsWith
(
"C02-3FSMT-14"
)){
model
=
"RAINIER"
;
model
List
.
add
(
"RAINIER"
)
;
}
else
if
(
orderLine
.
startsWith
(
"C02-3FSMT-15"
)){
model
=
"RAINIER"
;
model
List
.
add
(
"X11"
)
;
}
else
if
(
orderLine
.
startsWith
(
"C02-3FSMT-16"
)){
model
=
"RAINIER"
;
model
List
.
add
(
"RAINIER"
)
;
}
else
if
(
orderLine
.
startsWith
(
"C02-3FSMT-17"
)){
model
=
"RAINIER"
;
model
List
.
add
(
"RAINIER"
)
;
}
else
if
(
orderLine
.
startsWith
(
"C03-1FSMT-02"
)){
model
=
"RAINIER"
;
}
else
if
(
orderLine
.
startsWith
(
"C03-1FSMT-12"
)){
model
=
"RAINIER"
;
}
else
if
(
orderLine
.
startsWith
(
"C02-3FSMT-08"
)){
model
=
"X11"
;
model
List
.
add
(
"X11"
)
;
}
else
if
(
orderLine
.
startsWith
(
"C02-3FSMT-18"
)){
model
=
"X11"
;
model
List
.
add
(
"X11"
)
;
}
else
if
(
orderLine
.
startsWith
(
"C03-1FSMT-01"
)){
model
=
"X11"
;
}
else
if
(
orderLine
.
startsWith
(
"C03-1FSMT-11"
)){
model
=
"X11"
;
}
else
if
(
orderLine
.
startsWith
(
"C02-3FSMT-09"
)){
model
=
"X8"
;
modelList
.
add
(
"X11"
);
modelList
.
add
(
"X8"
);
}
else
if
(
orderLine
.
startsWith
(
"C02-3FSMT-19"
)){
model
=
"X8"
;
modelList
.
add
(
"X8"
);
modelList
.
add
(
"X11"
);
}
else
{
model
=
"ALL"
;
model
List
.
add
(
"ALL"
)
;
}
}
else
{
model
=
"ALL"
;
model
List
.
add
(
"ALL"
)
;
}
}
else
{
modelList
.
add
(
"ALL"
);
}
if
(
modelList
==
null
||
modelList
.
isEmpty
()){
modelList
.
add
(
"ALL"
);
}
//如果是迈征工单,不是满料,不出库
...
...
@@ -728,11 +736,12 @@ public class LiteOrderCache {
throw new ValidateException("",barcode.getBarcode()+"不是满卷数量,不允许出库");
}
}*/
List
<
String
>
batchCheckReel
=
lizhenApi
.
batchCheckReel
(
Arrays
.
asList
(
pos
.
getBarcode
()),
""
,
model
);
if
(
batchCheckReel
!=
null
&&
!
batchCheckReel
.
isEmpty
()){
disable
=
true
;
throw
new
ValidateException
(
""
,
pos
.
getBarcode
().
getBarcode
()+
"被禁用,库位为:"
+
pos
.
getPosName
());
for
(
String
batchModel
:
modelList
)
{
List
<
String
>
batchCheckReel
=
lizhenApi
.
batchCheckReel
(
Arrays
.
asList
(
pos
.
getBarcode
()),
""
,
batchModel
);
if
(
batchCheckReel
!=
null
&&
!
batchCheckReel
.
isEmpty
()){
disable
=
true
;
throw
new
ValidateException
(
""
,
pos
.
getBarcode
().
getBarcode
()+
"被禁用,库位为:"
+
pos
.
getPosName
());
}
}
}
catch
(
ValidateException
e
)
{
pos
=
null
;
...
...
src/main/java/com/neotel/smfcore/core/storage/rest/StoragePosController.java
查看文件 @
011dd9c
...
...
@@ -35,7 +35,9 @@ import com.neotel.smfcore.core.system.service.po.DataLog;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.custom.lizhen.LizhenApi
;
import
com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType
;
import
java.lang.String
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -68,7 +70,7 @@ public class StoragePosController {
@Autowired
private
final
IStoragePosManager
storagePosManager
;
// @Autowired
// @Autowired
// private final IStoragePosDao storagePosDao;
@Autowired
private
final
StoragePosMapper
storagePosMapper
;
...
...
@@ -106,9 +108,9 @@ public class StoragePosController {
criteria
.
setStorageIdList
(
null
);
}
String
blurry
=
criteria
.
getBlurry
();
if
(!
Strings
.
isNullOrEmpty
(
blurry
))
{
if
(!
Strings
.
isNullOrEmpty
(
blurry
))
{
//去除库位中的SOxxxx
blurry
=
blurry
.
substring
(
blurry
.
indexOf
(
"-"
)
+
1
);
blurry
=
blurry
.
substring
(
blurry
.
indexOf
(
"-"
)
+
1
);
criteria
.
setBlurry
(
blurry
);
}
Query
query
=
QueryHelp
.
getQuery
(
criteria
);
...
...
@@ -116,18 +118,18 @@ public class StoragePosController {
PageData
<
StoragePos
>
pages
=
storagePosManager
.
findByPage
(
query
,
pageable
);
List
<
StoragePosDto
>
StoragePosDtos
=
storagePosMapper
.
toDto
(
pages
.
getContent
());
for
(
int
i
=
0
;
i
<
StoragePosDtos
.
size
();
i
++)
{
Storage
storage
=
dataCache
.
getStorageById
(
StoragePosDtos
.
get
(
i
).
getStorageId
());
if
(
storage
!=
null
)
{
StoragePosDtos
.
get
(
i
).
setStorageName
(
storage
.
getName
());
if
(!
storage
.
isVirtual
())
{
StoragePosDtos
.
get
(
i
).
setNeedPermissionPassword
(
true
);
}
if
(
StoragePosDtos
.
get
(
i
).
isEnabled
())
{
StoragePosDtos
.
get
(
i
).
setMsg
(
""
);
}
}
}
for
(
int
i
=
0
;
i
<
StoragePosDtos
.
size
();
i
++)
{
Storage
storage
=
dataCache
.
getStorageById
(
StoragePosDtos
.
get
(
i
).
getStorageId
());
if
(
storage
!=
null
)
{
StoragePosDtos
.
get
(
i
).
setStorageName
(
storage
.
getName
());
if
(!
storage
.
isVirtual
())
{
StoragePosDtos
.
get
(
i
).
setNeedPermissionPassword
(
true
);
}
if
(
StoragePosDtos
.
get
(
i
).
isEnabled
())
{
StoragePosDtos
.
get
(
i
).
setMsg
(
""
);
}
}
}
return
new
PageData
(
StoragePosDtos
,
pages
.
getTotalElements
());
}
...
...
@@ -230,7 +232,7 @@ public class StoragePosController {
Barcode
barcode
=
storagePos
.
getBarcode
();
if
(
barcode
!=
null
)
{
barcode
=
barcodeManager
.
findByBarcode
(
barcode
.
getBarcode
());
if
(
barcode
==
null
){
if
(
barcode
==
null
)
{
barcode
=
storagePos
.
getBarcode
();
}
log
.
info
(
"清理库位["
+
storagePos
.
getPosName
()
+
"]中的库存"
+
barcode
.
getBarcode
());
...
...
@@ -264,7 +266,7 @@ public class StoragePosController {
pos
.
setMsg
(
""
);
storagePosManager
.
save
(
pos
);
log
.
info
(
"启用禁用库位:库位号["
+
pos
.
getId
()
+
"]["
+
pos
.
getPosName
()
+
"]="
+
enabledDto
.
isEnabled
());
DeviceMessageUtil
.
addEnabledPosMessage
(
pos
,
SecurityUtils
.
getCurrentUsername
());
DeviceMessageUtil
.
addEnabledPosMessage
(
pos
,
SecurityUtils
.
getCurrentUsername
());
return
ResultBean
.
newOkResult
(
""
);
}
...
...
@@ -289,16 +291,16 @@ public class StoragePosController {
pos
.
setPriority
(
saveDto
.
getPriority
());
pos
.
setH
(
saveDto
.
getH
());
pos
.
setW
(
saveDto
.
getW
());
String
enabledStr
=
""
;
if
(
pos
.
isEnabled
()!=
saveDto
.
isEnabled
())
{
String
enabledStr
=
""
;
if
(
pos
.
isEnabled
()
!=
saveDto
.
isEnabled
())
{
pos
.
setEnabled
(
saveDto
.
isEnabled
());
enabledStr
=
saveDto
.
isEnabled
()?
",启用库位"
:
",禁用库位"
;
DeviceMessageUtil
.
addEnabledPosMessage
(
pos
,
SecurityUtils
.
getCurrentUsername
());
enabledStr
=
saveDto
.
isEnabled
()
?
",启用库位"
:
",禁用库位"
;
DeviceMessageUtil
.
addEnabledPosMessage
(
pos
,
SecurityUtils
.
getCurrentUsername
());
}
storagePosManager
.
save
(
pos
);
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
dataCache
.
reloadStorage
(
storage
,
storage
.
getCid
());
log
.
info
(
"修改库位:库位号["
+
pos
.
getId
()
+
"]=["
+
saveDto
.
toString
()
+
"]"
+
enabledStr
);
log
.
info
(
"修改库位:库位号["
+
pos
.
getId
()
+
"]=["
+
saveDto
.
toString
()
+
"]"
+
enabledStr
);
return
new
ResponseEntity
<>(
HttpStatus
.
OK
);
}
...
...
@@ -328,7 +330,7 @@ public class StoragePosController {
@RequestMapping
(
"/download"
)
@PreAuthorize
(
"@el.check('storagePos:download')"
)
//@AnonymousAccess
public
void
download
(
StoragePosQueryCriteria
criteria
,
HttpServletResponse
response
)
{
public
void
download
(
StoragePosQueryCriteria
criteria
,
HttpServletResponse
response
)
{
if
(
criteria
.
getStorageIdList
()
!=
null
&&
criteria
.
getStorageIdList
().
contains
(
"0"
))
{
criteria
.
setStorageIdList
(
null
);
}
...
...
@@ -391,19 +393,19 @@ public class StoragePosController {
for
(
StoragePos
storagePos
:
storagePosList
)
{
boolean
enabled
=
storagePos
.
isEnabled
();
Barcode
barcode
=
storagePos
.
getBarcode
();
if
(!
enabled
){
if
(!
enabled
)
{
disablePosList
.
add
(
storagePos
.
getPosName
());
}
if
(
barcode
!=
null
)
{
if
(
barcode
!=
null
)
{
hasReelPosList
.
add
(
storagePos
.
getPosName
());
}
else
{
noReelPosList
.
add
(
storagePos
.
getPosName
());
}
}
resultMap
.
put
(
"disable"
,
disablePosList
);
resultMap
.
put
(
"hasReel"
,
hasReelPosList
);
resultMap
.
put
(
"noReel"
,
noReelPosList
);
resultMap
.
put
(
"disable"
,
disablePosList
);
resultMap
.
put
(
"hasReel"
,
hasReelPosList
);
resultMap
.
put
(
"noReel"
,
noReelPosList
);
}
return
ResultBean
.
newOkResult
(
resultMap
);
...
...
@@ -414,39 +416,39 @@ public class StoragePosController {
@AnonymousAccess
public
ResultBean
enabled
(
@RequestParam
(
"cid"
)
String
cid
,
@RequestParam
(
"posName"
)
String
posName
)
{
StoragePos
storagePos
=
storagePosManager
.
getByPosName
(
posName
);
if
(
storagePos
!=
null
&&
!
storagePos
.
isEnabled
()){
if
(
storagePos
!=
null
&&
!
storagePos
.
isEnabled
())
{
/*Barcode barcode = storagePos.getBarcode();
if (barcode != null){
taskService.addTaskToFinished(storagePos,barcode,"admin-enable");
}*/
log
.
info
(
SecurityUtils
.
getLoginUsername
()
+
"启用库位:"
+
posName
);
log
.
info
(
SecurityUtils
.
getLoginUsername
()
+
"启用库位:"
+
posName
);
storagePos
.
setEnabled
(
true
);
storagePosManager
.
save
(
storagePos
);
Storage
storage
=
dataCache
.
getStorageById
(
storagePos
.
getStorageId
());
dataCache
.
reloadStorage
(
storage
,
storage
.
getCid
());
dataCache
.
reloadStorage
(
storage
,
storage
.
getCid
());
}
return
ResultBean
.
newOkResult
(
""
);
}
private
Query
getPosFindCriteria
(
StoragePosFindCriteria
criteria
){
if
(
ObjectUtil
.
isNotEmpty
(
criteria
.
getStorageId
())
&&
criteria
.
getStorageId
().
equals
(
"0"
))
{
private
Query
getPosFindCriteria
(
StoragePosFindCriteria
criteria
)
{
if
(
ObjectUtil
.
isNotEmpty
(
criteria
.
getStorageId
())
&&
criteria
.
getStorageId
().
equals
(
"0"
))
{
criteria
.
setStorageId
(
null
);
}
if
(
ObjectUtil
.
isNotEmpty
(
criteria
.
getBatch
())){
if
(
ObjectUtil
.
isNotEmpty
(
criteria
.
getBatch
()))
{
String
batch
=
criteria
.
getBatch
();
criteria
.
setBatchList
(
Arrays
.
asList
(
batch
.
split
(
","
)));
criteria
.
setBatch
(
null
);
}
if
(
ObjectUtil
.
isNotEmpty
(
criteria
.
getDateCode
())){
if
(
ObjectUtil
.
isNotEmpty
(
criteria
.
getDateCode
()))
{
String
dateCode
=
criteria
.
getDateCode
();
criteria
.
setDateCodeList
(
Arrays
.
asList
(
dateCode
.
split
(
","
)));
criteria
.
setDateCode
(
null
);
}
if
(
ObjectUtil
.
isNotEmpty
(
criteria
.
getPartNumber
())){
if
(
ObjectUtil
.
isNotEmpty
(
criteria
.
getPartNumber
()))
{
String
partNumber
=
criteria
.
getPartNumber
();
criteria
.
setPartNumberList
(
Arrays
.
asList
(
partNumber
.
split
(
","
)));
criteria
.
setPartNumber
(
null
);
...
...
@@ -479,12 +481,12 @@ public class StoragePosController {
@GetMapping
(
"/find"
)
@PreAuthorize
(
"@el.check('checkOut')"
)
public
PageData
<
StoragePosDto
>
storagePosFind
(
StoragePosFindCriteria
criteria
,
Pageable
pageable
,
HttpServletRequest
request
)
{
Query
query
=
getPosFindCriteria
(
criteria
);
Query
query
=
getPosFindCriteria
(
criteria
);
PageData
<
StoragePos
>
pages
=
storagePosManager
.
findByPage
(
query
,
pageable
);
List
<
StoragePosDto
>
StoragePosDtos
=
storagePosMapper
.
toDto
(
pages
.
getContent
());
for
(
StoragePosDto
storagePosDto
:
StoragePosDtos
)
{
BarcodeDto
barcode
=
storagePosDto
.
getBarcode
();
if
(
barcode
.
getPutInTime
()
==
-
1
){
if
(
barcode
.
getPutInTime
()
==
-
1
)
{
barcode
.
setFirstPutInDate
(
barcode
.
getCreateDate
());
//storagePosDto.setBarcode(barcode);
}
...
...
@@ -554,12 +556,12 @@ public class StoragePosController {
if
(
partNumberList
!=
null
&&
!
partNumberList
.
isEmpty
())
{
boolean
hasCont
=
false
;
for
(
String
pn
:
partNumberList
)
{
if
(
barcode
.
getPartNumber
().
startsWith
(
pn
)){
if
(
barcode
.
getPartNumber
().
startsWith
(
pn
))
{
hasCont
=
true
;
break
;
}
}
if
(!
hasCont
){
if
(!
hasCont
)
{
continue
;
}
}
...
...
@@ -607,7 +609,7 @@ public class StoragePosController {
task
.
setLoc
(
stationName
);
}
task
.
setBoxPosName
(
pos
.
getPosName
());
if
(
storage
.
isVirtual
()){
if
(
storage
.
isVirtual
())
{
task
.
setExtendType
(
ExtendType
.
VIRTUAL_CHECKOUT
);
}
else
{
task
.
setExtendType
(
ExtendType
.
STORAGE_CHECKOUT
);
...
...
@@ -654,8 +656,8 @@ public class StoragePosController {
@ApiOperation
(
"导出查找出库列表"
)
@GetMapping
(
value
=
"/find/download"
)
@PreAuthorize
(
"@el.check('checkOut')"
)
public
void
download
(
HttpServletResponse
response
,
StoragePosFindCriteria
criteria
,
Pageable
pageable
,
HttpServletRequest
request
)
throws
IOException
{
Query
query
=
getPosFindCriteria
(
criteria
);
public
void
download
(
HttpServletResponse
response
,
StoragePosFindCriteria
criteria
,
Pageable
pageable
,
HttpServletRequest
request
)
throws
IOException
{
Query
query
=
getPosFindCriteria
(
criteria
);
FileUtil
.
downloadExcel
(
query
,
pageable
,
response
,
new
IExcelDownLoad
()
{
@Override
public
List
<
List
<
String
>>
getHeader
()
{
...
...
@@ -682,18 +684,18 @@ public class StoragePosController {
List
<
List
<
Object
>>
dataList
=
new
ArrayList
<>();
DateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
List
<
Map
<
String
,
Object
>>
list
=
new
ArrayList
<>();
List
<
StoragePos
>
storagePos
=
storagePosManager
.
findByQuery
(
query
,
pageable
);
List
<
StoragePos
>
storagePos
=
storagePosManager
.
findByQuery
(
query
,
pageable
);
for
(
StoragePos
pos
:
storagePos
)
{
List
<
Object
>
data
=
new
ArrayList
<>();
Barcode
barcode
=
pos
.
getBarcode
();
if
(
barcode
==
null
){
if
(
barcode
==
null
)
{
continue
;
}
data
.
add
(
barcode
.
getBarcode
());
data
.
add
(
barcode
.
getPartNumber
());
data
.
add
(
barcode
.
getLabelId
());
if
(
barcode
.
getStatus
()
==
BARCODE_STATUS
.
IN_STORE
){
if
(
barcode
.
getStatus
()
==
BARCODE_STATUS
.
IN_STORE
)
{
data
.
add
(
"在库"
);
}
else
{
data
.
add
(
""
);
...
...
@@ -707,13 +709,13 @@ public class StoragePosController {
data
.
add
(
1
);
data
.
add
(
barcode
.
getAmount
());
if
(
barcode
.
getPutInTime
()
!=
-
1
l
){
if
(
barcode
.
getPutInTime
()
!=
-
1
l
)
{
data
.
add
(
dateFormat
.
format
(
barcode
.
getPutInTime
()));
}
else
{
data
.
add
(
""
);
}
if
(
barcode
.
getPutInDate
()
!=
null
){
if
(
barcode
.
getPutInDate
()
!=
null
)
{
data
.
add
(
dateFormat
.
format
(
barcode
.
getPutInDate
()));
}
else
{
data
.
add
(
""
);
...
...
@@ -734,60 +736,63 @@ public class StoragePosController {
}
String
line
=
checkOutDto
.
getLine
();
if
(
StringUtils
.
isEmpty
(
line
)){
if
(
StringUtils
.
isEmpty
(
line
))
{
throw
new
ValidateException
(
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"线体"
});
}
String
model
=
checkOutDto
.
getModel
();
//if (StringUtils.isEmpty(model)) {
if
(
StringUtils
.
isNotEmpty
(
line
))
{
if
(
line
.
startsWith
(
"C02-1FSMT-98"
)){
model
=
"RAINIER"
;
}
else
if
(
line
.
startsWith
(
"C02-3FSMT-03"
)){
model
=
"RAINIER"
;
}
else
if
(
line
.
startsWith
(
"C02-3FSMT-04"
)){
model
=
"RAINIER"
;
}
else
if
(
line
.
startsWith
(
"C02-3FSMT-05"
)){
model
=
"RAINIER"
;
}
else
if
(
line
.
startsWith
(
"C02-3FSMT-06"
)){
model
=
"RAINIER"
;
}
else
if
(
line
.
startsWith
(
"C02-3FSMT-07"
)){
model
=
"RAINIER"
;
}
else
if
(
line
.
startsWith
(
"C02-3FSMT-13"
)){
model
=
"RAINIER"
;
}
else
if
(
line
.
startsWith
(
"C02-3FSMT-14"
)){
model
=
"RAINIER"
;
}
else
if
(
line
.
startsWith
(
"C02-3FSMT-15"
)){
model
=
"RAINIER"
;
}
else
if
(
line
.
startsWith
(
"C02-3FSMT-16"
)){
model
=
"RAINIER"
;
}
else
if
(
line
.
startsWith
(
"C02-3FSMT-17"
)){
model
=
"RAINIER"
;
}
else
if
(
line
.
startsWith
(
"C03-1FSMT-02"
)){
model
=
"RAINIER"
;
}
else
if
(
line
.
startsWith
(
"C03-1FSMT-12"
)){
model
=
"RAINIER"
;
}
else
if
(
line
.
startsWith
(
"C02-3FSMT-08"
)){
model
=
"X11"
;
}
else
if
(
line
.
startsWith
(
"C02-3FSMT-18"
)){
model
=
"X11"
;
}
else
if
(
line
.
startsWith
(
"C03-1FSMT-01"
)){
model
=
"X11"
;
}
else
if
(
line
.
startsWith
(
"C03-1FSMT-11"
)){
model
=
"X11"
;
}
else
if
(
line
.
startsWith
(
"C02-3FSMT-09"
)){
model
=
"X8"
;
}
else
if
(
line
.
startsWith
(
"C02-3FSMT-19"
)){
model
=
"X8"
;
}
else
{
model
=
"ALL"
;
}
List
<
String
>
modelList
=
new
ArrayList
<>();
if
(
StringUtils
.
isNotEmpty
(
line
))
{
if
(
line
.
startsWith
(
"C02-1FSMT-98"
))
{
}
else
if
(
line
.
startsWith
(
"C02-3FSMT-03"
))
{
modelList
.
add
(
"RAINIER"
);
}
else
if
(
line
.
startsWith
(
"C02-3FSMT-04"
))
{
modelList
.
add
(
"RAINIER"
);
}
else
if
(
line
.
startsWith
(
"C02-3FSMT-05"
))
{
modelList
.
add
(
"X11"
);
}
else
if
(
line
.
startsWith
(
"C02-3FSMT-06"
))
{
modelList
.
add
(
"RAINIER"
);
}
else
if
(
line
.
startsWith
(
"C02-3FSMT-07"
))
{
modelList
.
add
(
"RAINIER"
);
}
else
if
(
line
.
startsWith
(
"C02-3FSMT-13"
))
{
modelList
.
add
(
"RAINIER"
);
}
else
if
(
line
.
startsWith
(
"C02-3FSMT-14"
))
{
modelList
.
add
(
"RAINIER"
);
}
else
if
(
line
.
startsWith
(
"C02-3FSMT-15"
))
{
modelList
.
add
(
"X11"
);
}
else
if
(
line
.
startsWith
(
"C02-3FSMT-16"
))
{
modelList
.
add
(
"RAINIER"
);
}
else
if
(
line
.
startsWith
(
"C02-3FSMT-17"
))
{
modelList
.
add
(
"RAINIER"
);
}
else
if
(
line
.
startsWith
(
"C03-1FSMT-02"
))
{
}
else
if
(
line
.
startsWith
(
"C03-1FSMT-12"
))
{
}
else
if
(
line
.
startsWith
(
"C02-3FSMT-08"
))
{
modelList
.
add
(
"X11"
);
}
else
if
(
line
.
startsWith
(
"C02-3FSMT-18"
))
{
modelList
.
add
(
"X11"
);
}
else
if
(
line
.
startsWith
(
"C03-1FSMT-01"
))
{
}
else
if
(
line
.
startsWith
(
"C03-1FSMT-11"
))
{
}
else
if
(
line
.
startsWith
(
"C02-3FSMT-09"
))
{
modelList
.
add
(
"X11"
);
modelList
.
add
(
"X8"
);
}
else
if
(
line
.
startsWith
(
"C02-3FSMT-19"
))
{
modelList
.
add
(
"X11"
);
modelList
.
add
(
"X8"
);
}
else
{
model
=
"ALL"
;
}
//}
}
if
(
modelList
==
null
||
modelList
.
isEmpty
())
{
modelList
.
add
(
"ALL"
);
}
if
(
"C2"
.
equals
(
line
)){
if
(
"C2"
.
equals
(
line
))
{
checkOutDto
.
setForceOut
(
true
);
}
...
...
@@ -805,15 +810,15 @@ public class StoragePosController {
String
[]
pids
=
checkOutDto
.
getPids
();
for
(
String
pid
:
pids
)
{
StoragePos
pos
=
storagePosManager
.
get
(
pid
);
if
(
pos
==
null
){
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"pid"
,
pid
});
if
(
pos
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"pid"
,
pid
});
}
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
if
(
storage
==
null
){
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"storageId"
,
pos
.
getStorageId
()});
if
(
storage
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"storageId"
,
pos
.
getStorageId
()});
}
if
(
excludePosIds
.
contains
(
pos
.
getId
())){
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.pos.inQueue"
,
"位置:[{0}}]已在操作队列中,操作失败"
,
new
String
[]{
pos
.
getPosName
()});
if
(
excludePosIds
.
contains
(
pos
.
getId
()))
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.pos.inQueue"
,
"位置:[{0}}]已在操作队列中,操作失败"
,
new
String
[]{
pos
.
getPosName
()});
}
if
(!
pos
.
isEnabled
())
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
pos
.
getPosName
()
+
"库位被禁用,无法出库"
);
...
...
@@ -822,33 +827,40 @@ public class StoragePosController {
}
//判断是否有可用出库的任务
if
(
needOutPosList
==
null
||
needOutPosList
.
isEmpty
()){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"未找到可以出库的任务"
);
if
(
needOutPosList
==
null
||
needOutPosList
.
isEmpty
())
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"未找到可以出库的任务"
);
}
//需要强制出库
if
(
checkOutDto
.
needForceOut
())
{
if
(
checkOutDto
.
needForceOut
())
{
log
.
info
(
"执行UID强制出库, 不再检查禁用料"
);
}
else
{
}
else
{
//获取禁用料
List
<
Barcode
>
barcodeList
=
needOutPosList
.
stream
().
map
(
StoragePos:
:
getBarcode
).
collect
(
Collectors
.
toList
());
List
<
String
>
checkReelList
=
lizhenApi
.
batchCheckReel
(
barcodeList
,
""
,
model
);
List
<
String
>
checkReelList
=
new
ArrayList
<>();
for
(
String
model
:
modelList
)
{
List
<
String
>
resultList
=
lizhenApi
.
batchCheckReel
(
barcodeList
,
""
,
model
);
if
(
resultList
!=
null
&&
!
resultList
.
isEmpty
()){
checkReelList
.
addAll
(
resultList
);
}
}
List
<
String
>
errorBarcodeList
=
new
ArrayList
<>();
for
(
StoragePos
pos
:
needOutPosList
)
{
Barcode
barcode
=
pos
.
getBarcode
();
String
barcodeStr
=
barcode
.
getBarcode
();
if
(
checkReelList
!=
null
&&
!
checkReelList
.
isEmpty
()){
if
(
checkReelList
.
contains
(
barcodeStr
)){
if
(
checkReelList
!=
null
&&
!
checkReelList
.
isEmpty
())
{
if
(
checkReelList
.
contains
(
barcodeStr
))
{
errorBarcodeList
.
add
(
barcodeStr
);
log
.
info
(
barcodeStr
+
"已经被禁用,库位为:"
+
pos
.
getPosName
());
log
.
info
(
barcodeStr
+
"已经被禁用,库位为:"
+
pos
.
getPosName
());
}
}
}
if
(
errorBarcodeList
!=
null
&&
!
errorBarcodeList
.
isEmpty
()){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
JSON
.
toJSONString
(
errorBarcodeList
)+
"已经被禁用"
);
if
(
errorBarcodeList
!=
null
&&
!
errorBarcodeList
.
isEmpty
())
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
JSON
.
toJSONString
(
errorBarcodeList
)
+
"已经被禁用"
);
}
}
...
...
@@ -856,7 +868,7 @@ public class StoragePosController {
//生成出库任务
List
<
String
>
messageList
=
new
ArrayList
<>();
for
(
StoragePos
pos
:
needOutPosList
){
for
(
StoragePos
pos
:
needOutPosList
)
{
String
message
=
""
;
...
...
@@ -884,20 +896,20 @@ public class StoragePosController {
task
.
setLine
(
line
);
String
resultStr
=
lizhenApi
.
towerCheck
(
task
);
if
(
StringUtils
.
isEmpty
(
resultStr
)){
if
(
StringUtils
.
isEmpty
(
resultStr
))
{
//barcode.setAskPutIn(false);
//barcodeManager.save(barcode);
//pos.setBarcode(barcode);
//storagePosManager.save(pos);
taskService
.
updateQueueTask
(
task
);
}
else
{
messageList
.
add
(
"条码:"
+
barcodeStr
+
"调用tower检验失败:"
+
resultStr
);
messageList
.
add
(
"条码:"
+
barcodeStr
+
"调用tower检验失败:"
+
resultStr
);
continue
;
}
}
if
(
messageList
!=
null
&&
!
messageList
.
isEmpty
()){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
JSON
.
toJSONString
(
messageList
));
if
(
messageList
!=
null
&&
!
messageList
.
isEmpty
())
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
JSON
.
toJSONString
(
messageList
));
}
return
ResultBean
.
newOkResult
(
""
);
...
...
@@ -940,7 +952,7 @@ public class StoragePosController {
dto
.
setBarcode
(
barcode
);
dto
.
setPartNumber
(
codeBean
.
getBarcode
().
getPartNumber
());
String
posName
=
codeBean
.
getBarcode
().
getPosName
();
if
(
StringUtils
.
isNotEmpty
(
posName
)){
if
(
StringUtils
.
isNotEmpty
(
posName
))
{
dto
.
setPosName
(
posName
);
}
else
{
dto
.
setPosName
(
barcode
);
...
...
@@ -970,14 +982,13 @@ public class StoragePosController {
}
@ApiOperation
(
"批量启用或禁用库位"
)
@PutMapping
(
"/batchEnabledOrDisabledPos"
)
@PreAuthorize
(
"@el.check('storagePos:edit')"
)
public
ResultBean
batchEnabledOrDisabledPos
(
@RequestBody
StoragePosEnabledDto
enabledDto
)
{
List
<
String
>
idList
=
enabledDto
.
getIdList
();
if
(
idList
==
null
||
idList
.
isEmpty
())
{
return
ResultBean
.
newErrorResult
(
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
});
return
ResultBean
.
newErrorResult
(
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
});
}
storagePosManager
.
batchUpdatePosEnabled
(
idList
,
enabledDto
.
isEnabled
());
//查询库位具体信息,更新缓存
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论