Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 9441cab4
由
hjh
编写于
2024-08-22 15:45:33 +0800
浏览文件
选项
浏览文件
标签
下载
差异文件
Merge remote-tracking branch 'origin/smf-core-21088' into smf-core-21088
2 个父辈
ae6ff58f
8e34d7a1
隐藏空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
1022 行增加
和
88 行删除
src/main/java/com/neotel/smfcore/core/barcode/rest/bean/dto/BarcodeDto.java
src/main/java/com/neotel/smfcore/core/equipment/bean/EquipStatusBean.java
src/main/java/com/neotel/smfcore/core/kanban/rest/BoxKanbanController.java
src/main/java/com/neotel/smfcore/core/kanban/rest/bean/dto/BoxTaskDto.java
src/main/java/com/neotel/smfcore/core/storage/rest/StoragePosController.java
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/OutLineController.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/GrPutInController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/TicketSortingController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/manual/ManualGrPutInController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/station/StationController.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/kafka/config/KafkaConfig.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/kafka/config/StorageNameConfig.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/kafka/service/KafkaService.java
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/util/BoxHandleUtil.java
src/main/resources/config/application.yml
src/main/java/com/neotel/smfcore/core/barcode/rest/bean/dto/BarcodeDto.java
查看文件 @
9441cab
...
@@ -163,6 +163,9 @@ public class BarcodeDto implements Serializable {
...
@@ -163,6 +163,9 @@ public class BarcodeDto implements Serializable {
@Transient
@Transient
private
List
<
String
>
relationCodes
;
private
List
<
String
>
relationCodes
;
private
boolean
needExpand
=
false
;
/**
/**
* 是否是锡膏
* 是否是锡膏
*/
*/
...
...
src/main/java/com/neotel/smfcore/core/equipment/bean/EquipStatusBean.java
查看文件 @
9441cab
...
@@ -98,9 +98,11 @@ public class EquipStatusBean implements Serializable {
...
@@ -98,9 +98,11 @@ public class EquipStatusBean implements Serializable {
}
}
public
EquipMsg
getMsgByType
(
String
type
){
public
EquipMsg
getMsgByType
(
String
type
){
for
(
EquipMsg
msg
:
getMsgList
()){
if
(
getMsgList
()
!=
null
)
{
if
(
msg
.
getType
().
equals
(
type
)){
for
(
EquipMsg
msg
:
getMsgList
())
{
return
msg
;
if
(
msg
.
getType
().
equals
(
type
))
{
return
msg
;
}
}
}
}
}
return
null
;
return
null
;
...
...
src/main/java/com/neotel/smfcore/core/kanban/rest/BoxKanbanController.java
查看文件 @
9441cab
...
@@ -133,6 +133,11 @@ public class BoxKanbanController {
...
@@ -133,6 +133,11 @@ public class BoxKanbanController {
List
<
BoxTaskDto
>
dtos
=
new
ArrayList
<>();
List
<
BoxTaskDto
>
dtos
=
new
ArrayList
<>();
for
(
DataLog
datalog
:
for
(
DataLog
datalog
:
allTasks
)
{
allTasks
)
{
if
(
datalog
.
isFinished
()
||
datalog
.
isCancel
()){
continue
;
}
//判断类型
//判断类型
if
(
criteria
.
getType
()
!=
null
&&
(!
criteria
.
getType
().
equals
(
datalog
.
getType
())))
{
if
(
criteria
.
getType
()
!=
null
&&
(!
criteria
.
getType
().
equals
(
datalog
.
getType
())))
{
continue
;
continue
;
...
@@ -209,7 +214,16 @@ public class BoxKanbanController {
...
@@ -209,7 +214,16 @@ public class BoxKanbanController {
blurryOk
=
true
;
blurryOk
=
true
;
}
}
if
(
blurryOk
)
{
if
(
blurryOk
)
{
dtos
.
add
(
boxTaskMapper
.
toDto
(
datalog
));
BoxTaskDto
boxTaskDto
=
boxTaskMapper
.
toDto
(
datalog
);
boxTaskDto
.
setSourceName
(
datalog
.
getSourceName
());
if
(
datalog
.
isPutInTask
()){
boxTaskDto
.
setLoc
(
datalog
.
getLoc
());
boxTaskDto
.
setTargetLoc
(
datalog
.
getPosName
());
}
else
{
boxTaskDto
.
setLoc
(
datalog
.
getPosName
());
boxTaskDto
.
setTargetLoc
(
datalog
.
getLoc
());
}
dtos
.
add
(
boxTaskDto
);
}
}
}
}
return
new
PageData
<>(
dtos
,
dtos
.
size
());
return
new
PageData
<>(
dtos
,
dtos
.
size
());
...
...
src/main/java/com/neotel/smfcore/core/kanban/rest/bean/dto/BoxTaskDto.java
查看文件 @
9441cab
...
@@ -99,6 +99,8 @@ public class BoxTaskDto {
...
@@ -99,6 +99,8 @@ public class BoxTaskDto {
@ApiModelProperty
(
"目的地"
)
@ApiModelProperty
(
"目的地"
)
private
String
loc
=
""
;
private
String
loc
=
""
;
private
String
targetLoc
=
""
;
@ApiModelProperty
(
"创建时间"
)
@ApiModelProperty
(
"创建时间"
)
private
Date
createDate
=
new
Date
();
private
Date
createDate
=
new
Date
();
@ApiModelProperty
(
"更新时间"
)
@ApiModelProperty
(
"更新时间"
)
...
...
src/main/java/com/neotel/smfcore/core/storage/rest/StoragePosController.java
查看文件 @
9441cab
...
@@ -503,21 +503,30 @@ public class StoragePosController {
...
@@ -503,21 +503,30 @@ public class StoragePosController {
barcodeDto
.
setFirstPutInDate
(
barcodeDto
.
getCreateDate
());
barcodeDto
.
setFirstPutInDate
(
barcodeDto
.
getCreateDate
());
//storagePosDto.setBarcode(barcode);
//storagePosDto.setBarcode(barcode);
}
}
Barcode
barcode
=
barcodeManager
.
findByBarcode
(
barcodeDto
.
getBarcode
());
barcodeDto
.
setPosName
(
storagePosDto
.
getPosName
());
if
(
ObjectUtil
.
isNotNull
(
barcode
))
{
List
<
BarcodeDto
>
subCodeList
=
barcodeDto
.
getSubCodeList
();
barcodeDto
.
setLabelId
(
barcode
.
getLabelId
());
if
(
subCodeList
!=
null
&&
!
subCodeList
.
isEmpty
()){
barcodeDto
.
setNeedExpand
(
true
);
barcodeDto
.
setSubCodeList
(
new
ArrayList
<>());
}
}
}
}
}
}
// for (StoragePosDto storagePosDto : StoragePosDtos) {
// BarcodeDto barcode = storagePosDto.getBarcode();
// List<BarcodeDto> subCodes = Lists.newArrayList(barcode);
// barcode.setSubCodeList(subCodes);
// storagePosDto.setBarcode(barcode);
// }
return
new
PageData
(
StoragePosDtos
,
pages
.
getTotalElements
());
return
new
PageData
(
StoragePosDtos
,
pages
.
getTotalElements
());
}
}
@ApiOperation
(
"根据料箱号查询barcode信息"
)
@GetMapping
(
"/getBarcodeInfo"
)
public
BarcodeDto
getBarcodeInfo
(
String
boxStr
)
{
StoragePos
pos
=
storagePosManager
.
getByBarcode
(
boxStr
);
if
(
pos
!=
null
)
{
StoragePosDto
dto
=
storagePosMapper
.
toDto
(
pos
);
BarcodeDto
barcode
=
dto
.
getBarcode
();
return
barcode
;
}
return
null
;
}
@ApiOperation
(
"根据条件查找出库"
)
@ApiOperation
(
"根据条件查找出库"
)
@GetMapping
(
"/out"
)
@GetMapping
(
"/out"
)
...
@@ -557,16 +566,35 @@ public class StoragePosController {
...
@@ -557,16 +566,35 @@ public class StoragePosController {
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"未找到可以出库的物料"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"未找到可以出库的物料"
);
}
}
boolean
hasTask
=
false
;
for
(
StoragePos
pos
:
storagePosList
)
{
for
(
StoragePos
pos
:
storagePosList
)
{
Barcode
barcode
=
pos
.
getBarcode
();
//排除正在执行的库位
//排除正在执行的库位
Collection
<
String
>
excludePosIds
=
taskService
.
excludePosIds
();
boolean
boxHasTask
=
false
;
if
(
excludePosIds
!=
null
&&
!
excludePosIds
.
isEmpty
()
&&
excludePosIds
.
contains
(
pos
.
getId
()))
{
List
<
DataLog
>
allTasks
=
taskService
.
getAllTasks
();
log
.
info
(
"库位:"
+
pos
.
getPosName
()
+
"正在执行,跳过"
);
for
(
DataLog
task
:
allTasks
)
{
continue
;
if
(
pos
.
getPosName
().
equals
(
task
.
getPosName
())){
if
(!
task
.
isCancel
()
&&
!
task
.
isFinished
()){
boxHasTask
=
true
;
log
.
info
(
barcode
.
getBarcode
()+
"库位:"
+
pos
.
getPosName
()
+
"正在执行,跳过"
);
break
;
}
}
if
(
task
.
getBarcode
().
equals
(
barcode
.
getBarcode
())){
if
(!
task
.
isCancel
()
&&
!
task
.
isFinished
()){
boxHasTask
=
true
;
log
.
info
(
barcode
.
getBarcode
()+
"库位:"
+
pos
.
getPosName
()
+
"正在执行,跳过"
);
break
;
}
}
}
}
Barcode
barcode
=
pos
.
getBarcode
();
if
(
boxHasTask
){
log
.
info
(
"当前料箱:"
+
barcode
.
getBarcode
()+
",库位:"
+
pos
.
getPosName
()+
"有正在执行的任务,跳过"
);
continue
;
}
//判断有没有输入箱子号
//判断有没有输入箱子号
if
(
StringUtils
.
isNotEmpty
(
box
)
&&
!
box
.
equals
(
barcode
.
getBarcode
()))
{
if
(
StringUtils
.
isNotEmpty
(
box
)
&&
!
box
.
equals
(
barcode
.
getBarcode
()))
{
...
@@ -678,9 +706,14 @@ public class StoragePosController {
...
@@ -678,9 +706,14 @@ public class StoragePosController {
}
}
task
.
setBoxPosName
(
pos
.
getPosName
());
task
.
setBoxPosName
(
pos
.
getPosName
());
task
.
setCartonId
(
barcode
.
getCartonId
());
task
.
setCartonId
(
barcode
.
getCartonId
());
log
.
info
(
"按条件查找出库,箱子号为:"
+
barcode
.
getBarcode
()+
",库位号为:"
+
barcode
.
getPosName
()+
",查询条件为:"
+
getSelectMsg
(
partNumber
,
provider
,
batch
,
dateCode
));
taskService
.
updateQueueTask
(
task
);
taskService
.
updateQueueTask
(
task
);
hasTask
=
true
;
}
}
}
}
if
(!
hasTask
){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"未找到可以出库的任务"
);
}
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
...
...
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
查看文件 @
9441cab
...
@@ -256,15 +256,17 @@ public class TaskService {
...
@@ -256,15 +256,17 @@ public class TaskService {
public
void
addTaskToExecute
(
DataLog
taskToExecute
)
throws
ValidateException
{
public
void
addTaskToExecute
(
DataLog
taskToExecute
)
throws
ValidateException
{
Collection
<
DataLog
>
tasks
=
taskMap
.
values
();
Collection
<
DataLog
>
tasks
=
taskMap
.
values
();
for
(
DataLog
task
:
tasks
)
{
for
(
DataLog
task
:
tasks
)
{
String
barcode
=
taskToExecute
.
getBarcode
();
if
(!
task
.
isFinished
()
&&
!
task
.
isCancel
())
{
String
posName
=
taskToExecute
.
getPosName
();
String
barcode
=
taskToExecute
.
getBarcode
();
if
(
task
.
getType
()
==
taskToExecute
.
getType
())
{
String
posName
=
taskToExecute
.
getPosName
();
if
(!
Strings
.
isNullOrEmpty
(
barcode
)
&&
task
.
getBarcode
().
equals
(
barcode
))
{
if
(
task
.
getType
()
==
taskToExecute
.
getType
())
{
log
.
info
(
"二维码:["
+
barcode
+
"]已在操作队列中,操作失败"
);
if
(!
Strings
.
isNullOrEmpty
(
barcode
)
&&
task
.
getBarcode
().
equals
(
barcode
))
{
throw
new
ValidateException
(
"smfcore.error.barcode.inQueue"
,
"二维码[{0}]已在操作队列中,操作失败"
,
new
String
[]{
barcode
});
log
.
info
(
"二维码:["
+
barcode
+
"]已在操作队列中,操作失败"
);
}
else
if
(
task
.
getPosName
().
equals
(
posName
)
&&
ObjectUtil
.
isNotEmpty
(
posName
))
{
throw
new
ValidateException
(
"smfcore.error.barcode.inQueue"
,
"二维码[{0}]已在操作队列中,操作失败"
,
new
String
[]{
barcode
});
log
.
info
(
"位置:["
+
posName
+
"]已在操作队列中,操作失败"
);
}
else
if
(
task
.
getPosName
().
equals
(
posName
)
&&
ObjectUtil
.
isNotEmpty
(
posName
))
{
throw
new
ValidateException
(
"smfcore.error.pos.inQueue"
,
"位置:[{0}}]已在操作队列中,操作失败"
,
new
String
[]{
posName
});
log
.
info
(
"位置:["
+
posName
+
"]已在操作队列中,操作失败"
);
throw
new
ValidateException
(
"smfcore.error.pos.inQueue"
,
"位置:[{0}}]已在操作队列中,操作失败"
,
new
String
[]{
posName
});
}
}
}
}
}
}
}
...
@@ -325,6 +327,7 @@ public class TaskService {
...
@@ -325,6 +327,7 @@ public class TaskService {
//从正在执行和等待列表中移除
//从正在执行和等待列表中移除
removeQueueTask
(
task
);
removeQueueTask
(
task
);
task
.
setStatus
(
OP_STATUS
.
CANCEL
.
name
());
task
.
setStatus
(
OP_STATUS
.
CANCEL
.
name
());
task
.
setOperator
(
SecurityUtils
.
getLoginUsername
());
task
.
setUpdateDate
(
new
Date
());
task
.
setUpdateDate
(
new
Date
());
updateFinishedTask
(
task
);
updateFinishedTask
(
task
);
log
.
info
(
"任务["
+
task
.
getId
()
+
"] posName["
+
task
.
getPosName
()
+
"] Reel Id["
+
task
.
getBarcode
()
+
"]取消成功"
);
log
.
info
(
"任务["
+
task
.
getId
()
+
"] posName["
+
task
.
getPosName
()
+
"] Reel Id["
+
task
.
getBarcode
()
+
"]取消成功"
);
...
@@ -394,7 +397,9 @@ public class TaskService {
...
@@ -394,7 +397,9 @@ public class TaskService {
if
(
task
.
needRemoveFromCache
())
{
if
(
task
.
needRemoveFromCache
())
{
theFinishedTaskMap
.
remove
(
task
.
getId
());
theFinishedTaskMap
.
remove
(
task
.
getId
());
}
else
{
}
else
{
resultTasks
.
add
(
task
);
if
(!
task
.
isFinished
()
&&
!
task
.
isCancel
())
{
resultTasks
.
add
(
task
);
}
}
}
}
}
return
resultTasks
;
return
resultTasks
;
...
@@ -710,9 +715,11 @@ public class TaskService {
...
@@ -710,9 +715,11 @@ public class TaskService {
Collection
<
DataLog
>
allTasks
=
taskMap
.
values
();
Collection
<
DataLog
>
allTasks
=
taskMap
.
values
();
Collection
<
String
>
operatingPosIds
=
ReelLockPosUtil
.
getAllLockPosIds
();
Collection
<
String
>
operatingPosIds
=
ReelLockPosUtil
.
getAllLockPosIds
();
for
(
DataLog
task
:
allTasks
)
{
for
(
DataLog
task
:
allTasks
)
{
String
posId
=
task
.
getPosId
();
if
(!
task
.
isCancel
()
&&
!
task
.
isFinished
())
{
if
(!
Strings
.
isNullOrEmpty
(
posId
))
{
String
posId
=
task
.
getPosId
();
operatingPosIds
.
add
(
task
.
getPosId
());
if
(!
Strings
.
isNullOrEmpty
(
posId
))
{
operatingPosIds
.
add
(
task
.
getPosId
());
}
}
}
}
}
return
operatingPosIds
;
return
operatingPosIds
;
...
...
src/main/java/com/neotel/smfcore/custom/lizhen/agvBox/rest/OutLineController.java
查看文件 @
9441cab
...
@@ -673,7 +673,7 @@ public class OutLineController {
...
@@ -673,7 +673,7 @@ public class OutLineController {
if
(
barcode
.
getBarcode
().
equals
(
task
.
getBarcode
())){
if
(
barcode
.
getBarcode
().
equals
(
task
.
getBarcode
())){
if
(!
task
.
isFinished
()
&&
!
task
.
isCancel
()){
if
(!
task
.
isFinished
()
&&
!
task
.
isCancel
()){
if
(
task
.
isPutInTask
())
{
if
(
task
.
isPutInTask
())
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
code
+
"有正在执行中的任务,请确认"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
code
+
"有正在执行中的
入库
任务,请确认"
);
}
else
{
}
else
{
dataLog
=
task
;
dataLog
=
task
;
break
;
break
;
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/CDeviceController.java
查看文件 @
9441cab
...
@@ -788,7 +788,8 @@ public class CDeviceController {
...
@@ -788,7 +788,8 @@ public class CDeviceController {
callAgvTask
(
stackerId
,
stackerBarcode
);
callAgvTask
(
stackerId
,
stackerBarcode
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
info
(
"入料机构获取可用料格:"
+
stackerId
+
"结果异常:"
+
e
.
getMessage
());
//e.printStackTrace();
isProcess
.
set
(
false
);
isProcess
.
set
(
false
);
}
}
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/GrPutInController.java
查看文件 @
9441cab
...
@@ -48,7 +48,7 @@ public class GrPutInController {
...
@@ -48,7 +48,7 @@ public class GrPutInController {
@ApiOperation
(
"判断料串是否已经绑定Gr信息"
)
@ApiOperation
(
"判断料串是否已经绑定Gr信息"
)
@RequestMapping
(
"/alreadyBindGr"
)
@RequestMapping
(
"/alreadyBindGr"
)
@AnonymousAccess
//
@AnonymousAccess
public
ResultBean
alreadyBindGr
(
String
materialStr
)
{
public
ResultBean
alreadyBindGr
(
String
materialStr
)
{
//判断GR有没有绑定成功
//判断GR有没有绑定成功
Map
<
String
,
BindGrInfo
>
cacheMap
=
dataCache
.
getCache
(
CacheNameUtil
.
CACHE_BIND_GR
);
Map
<
String
,
BindGrInfo
>
cacheMap
=
dataCache
.
getCache
(
CacheNameUtil
.
CACHE_BIND_GR
);
...
@@ -64,7 +64,7 @@ public class GrPutInController {
...
@@ -64,7 +64,7 @@ public class GrPutInController {
@ApiOperation
(
"获取Gr列表"
)
@ApiOperation
(
"获取Gr列表"
)
@RequestMapping
(
"/grList"
)
@RequestMapping
(
"/grList"
)
@AnonymousAccess
//
@AnonymousAccess
public
ResultBean
grList
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
public
ResultBean
grList
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
//料串
//料串
...
@@ -105,7 +105,7 @@ public class GrPutInController {
...
@@ -105,7 +105,7 @@ public class GrPutInController {
@ApiOperation
(
"获取GR已过账的列表"
)
@ApiOperation
(
"获取GR已过账的列表"
)
@RequestMapping
(
"/grStatus"
)
@RequestMapping
(
"/grStatus"
)
@AnonymousAccess
//
@AnonymousAccess
public
ResultBean
grStatus
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
public
ResultBean
grStatus
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
//料串
//料串
...
@@ -148,7 +148,7 @@ public class GrPutInController {
...
@@ -148,7 +148,7 @@ public class GrPutInController {
@ApiOperation
(
"绑定GR信息"
)
@ApiOperation
(
"绑定GR信息"
)
@RequestMapping
(
"/bindGr"
)
@RequestMapping
(
"/bindGr"
)
@AnonymousAccess
//
@AnonymousAccess
public
synchronized
ResultBean
bindGr
(
@RequestBody
BindGrInfo
info
)
{
public
synchronized
ResultBean
bindGr
(
@RequestBody
BindGrInfo
info
)
{
String
materialStr
=
info
.
getMaterialStr
();
String
materialStr
=
info
.
getMaterialStr
();
...
@@ -216,8 +216,8 @@ public class GrPutInController {
...
@@ -216,8 +216,8 @@ public class GrPutInController {
@ApiOperation
(
"GR与料串绑定信息"
)
@ApiOperation
(
"GR与料串绑定信息"
)
@RequestMapping
(
"/bindGrInfo"
)
@RequestMapping
(
"/bindGrInfo"
)
@AnonymousAccess
//
@AnonymousAccess
public
synchronized
ResultBean
bindGrInfo
()
{
public
ResultBean
bindGrInfo
()
{
Map
<
String
,
BindGrInfo
>
cacheMap
=
dataCache
.
getCache
(
CacheNameUtil
.
CACHE_BIND_GR
);
Map
<
String
,
BindGrInfo
>
cacheMap
=
dataCache
.
getCache
(
CacheNameUtil
.
CACHE_BIND_GR
);
if
(
cacheMap
!=
null
){
if
(
cacheMap
!=
null
){
return
ResultBean
.
newOkResult
(
cacheMap
.
values
());
return
ResultBean
.
newOkResult
(
cacheMap
.
values
());
...
@@ -226,4 +226,22 @@ public class GrPutInController {
...
@@ -226,4 +226,22 @@ public class GrPutInController {
}
}
@ApiOperation
(
"移除绑定GR信息"
)
@RequestMapping
(
"/removeBindGr"
)
@AnonymousAccess
public
synchronized
ResultBean
bindGrInfo
(
String
materialStr
)
{
if
(
StringUtils
.
isEmpty
(
materialStr
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"料串信息不能为空"
);
}
log
.
info
(
"人工手动移除料串信息"
);
Map
<
String
,
BindGrInfo
>
cacheMap
=
dataCache
.
getCache
(
CacheNameUtil
.
CACHE_BIND_GR
);
if
(
cacheMap
==
null
)
{
cacheMap
=
new
HashMap
<>();
}
cacheMap
.
remove
(
materialStr
);
dataCache
.
updateCache
(
CacheNameUtil
.
CACHE_BIND_GR
,
cacheMap
);
return
ResultBean
.
newOkResult
(
""
);
}
}
}
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/TicketSortingController.java
查看文件 @
9441cab
...
@@ -9,23 +9,31 @@ import com.neotel.smfcore.core.barcode.service.po.Barcode;
...
@@ -9,23 +9,31 @@ 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.device.enums.OP
;
import
com.neotel.smfcore.core.device.enums.OP
;
import
com.neotel.smfcore.core.device.enums.OP_STATUS
;
import
com.neotel.smfcore.core.device.enums.OP_STATUS
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.order.enums.LITEORDER_SOURCE
;
import
com.neotel.smfcore.core.order.service.manager.ILiteOrderItemManager
;
import
com.neotel.smfcore.core.order.service.manager.ILiteOrderItemManager
;
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.order.service.po.LiteOrderItem
;
import
com.neotel.smfcore.core.order.service.po.LiteOrderItem
;
import
com.neotel.smfcore.core.storage.service.manager.IStoragePosManager
;
import
com.neotel.smfcore.core.storage.service.manager.IStoragePosManager
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
import
com.neotel.smfcore.core.system.service.manager.IDataLogManager
;
import
com.neotel.smfcore.core.system.service.manager.IDataLogManager
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.custom.luxsan.api.LuxsanApi
;
import
com.neotel.smfcore.custom.luxsan.api.LuxsanApi
;
import
com.neotel.smfcore.custom.luxsan.api.bean.request.PickingIssueRequest
;
import
com.neotel.smfcore.custom.luxsan.api.bean.request.PickingIssueRequest
;
import
com.neotel.smfcore.custom.luxsan.api.bean.request.TicketPickLabelList
;
import
com.neotel.smfcore.custom.luxsan.api.bean.request.TicketPickRequest
;
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.rawstor.enums.LiteorderCheckType
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.enums.TaskCurrentLoc
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.BoxHandleUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.BoxHandleUtil
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
javafx.concurrent.Task
;
import
javafx.concurrent.Task
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -34,6 +42,7 @@ import org.springframework.web.bind.annotation.RestController;
...
@@ -34,6 +42,7 @@ import org.springframework.web.bind.annotation.RestController;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
@Slf4j
@Api
(
tags
=
"单据sorting"
)
@Api
(
tags
=
"单据sorting"
)
@RestController
@RestController
@RequestMapping
(
"/ticketSortIng"
)
@RequestMapping
(
"/ticketSortIng"
)
...
@@ -57,6 +66,12 @@ public class TicketSortingController {
...
@@ -57,6 +66,12 @@ public class TicketSortingController {
@Autowired
@Autowired
private
IDataLogManager
dataLogManager
;
private
IDataLogManager
dataLogManager
;
@Autowired
private
ILiteOrderManager
liteOrderManager
;
@Autowired
private
DataCache
dataCache
;
@ApiOperation
(
"获取料箱信息"
)
@ApiOperation
(
"获取料箱信息"
)
@RequestMapping
(
"/boxInfo"
)
@RequestMapping
(
"/boxInfo"
)
...
@@ -172,7 +187,7 @@ public class TicketSortingController {
...
@@ -172,7 +187,7 @@ public class TicketSortingController {
@RequestMapping
(
"/scanPar"
)
@RequestMapping
(
"/scanPar"
)
@AnonymousAccess
@AnonymousAccess
public
ResultBean
scanPar
(
String
boxStr
,
String
parStr
)
{
public
ResultBean
scanPar
(
String
boxStr
,
String
parStr
)
{
log
.
info
(
"Sorting页面,人员扫描隔扣码,料箱号为:"
+
boxStr
+
",隔口号为:"
+
parStr
);
if
(
StringUtils
.
isEmpty
(
parStr
))
{
if
(
StringUtils
.
isEmpty
(
parStr
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"料格条码不能为空"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"料格条码不能为空"
);
}
}
...
@@ -208,6 +223,7 @@ public class TicketSortingController {
...
@@ -208,6 +223,7 @@ public class TicketSortingController {
if
(
parStr
.
equals
(
subCode
.
getPosName
()))
{
if
(
parStr
.
equals
(
subCode
.
getPosName
()))
{
needOutBarcodeList
.
add
(
subCode
);
needOutBarcodeList
.
add
(
subCode
);
if
(
subCode
.
isOut
())
{
if
(
subCode
.
isOut
())
{
log
.
info
(
subCode
.
getBarcode
()+
"是Sorting物料,隔口号为:"
+
parStr
);
outBarcodeCount
=
outBarcodeCount
+
1
;
outBarcodeCount
=
outBarcodeCount
+
1
;
}
}
}
}
...
@@ -223,6 +239,7 @@ public class TicketSortingController {
...
@@ -223,6 +239,7 @@ public class TicketSortingController {
}
}
for
(
Barcode
needOutBarcode
:
needOutBarcodeList
)
{
for
(
Barcode
needOutBarcode
:
needOutBarcodeList
)
{
log
.
info
(
needOutBarcode
.
getBarcode
()+
"状态需要改成1,代表人工手动把物料拿出来"
);
needOutBarcode
.
updateExtraData
(
"status"
,
"1"
);
needOutBarcode
.
updateExtraData
(
"status"
,
"1"
);
barcodeManager
.
save
(
needOutBarcode
);
barcodeManager
.
save
(
needOutBarcode
);
barcode
.
updateSubCodes
(
needOutBarcode
);
barcode
.
updateSubCodes
(
needOutBarcode
);
...
@@ -251,6 +268,8 @@ public class TicketSortingController {
...
@@ -251,6 +268,8 @@ public class TicketSortingController {
String
parStr
=
paramMap
.
get
(
"parStr"
);
String
parStr
=
paramMap
.
get
(
"parStr"
);
String
boxStr
=
paramMap
.
get
(
"boxStr"
);
String
boxStr
=
paramMap
.
get
(
"boxStr"
);
log
.
info
(
"Sorting扫描料盘条码,料盘为:"
+
codeStr
+
",隔口号为:"
+
parStr
+
",料箱号为:"
+
boxStr
);
if
(
StringUtils
.
isEmpty
(
codeStr
))
{
if
(
StringUtils
.
isEmpty
(
codeStr
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"料盘条码不能为空"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"料盘条码不能为空"
);
}
}
...
@@ -261,37 +280,82 @@ public class TicketSortingController {
...
@@ -261,37 +280,82 @@ public class TicketSortingController {
}
}
StoragePos
pos
=
BoxHandleUtil
.
locOnePos
(
boxBarcode
);
StoragePos
pos
=
BoxHandleUtil
.
locOnePos
(
boxBarcode
);
if
(
pos
!=
null
){
if
(
pos
!=
null
)
{
if
(
pos
.
getBarcode
()
!=
null
){
if
(
pos
.
getBarcode
()
!=
null
)
{
boxBarcode
=
pos
.
getBarcode
();
boxBarcode
=
pos
.
getBarcode
();
}
}
}
}
Barcode
barcode
=
codeResolve
.
resolveOneValideBarcode
(
codeStr
);
Barcode
barcode
=
codeResolve
.
resolveOneValideBarcode
(
codeStr
);
if
(
barcode
==
null
)
{
if
(
barcode
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
codeStr
+
"
料箱
条码不正确"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
codeStr
+
"
物料
条码不正确"
);
}
}
if
(!
barcode
.
getPosName
().
equals
(
parStr
))
{
if
(!
barcode
.
getPosName
().
equals
(
parStr
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
barcode
.
getBarcode
()
+
"不在料格:"
+
parStr
+
"中"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
barcode
.
getBarcode
()
+
"不在料格:"
+
parStr
+
"中"
);
}
}
Map
<
String
,
Integer
>
resultMap
=
new
HashMap
<>();
boolean
hasNeedPutInBarcode
=
false
;
resultMap
.
put
(
"ng"
,
0
);
List
<
Barcode
>
subCodeList
=
boxBarcode
.
getSubCodeList
();
if
(
subCodeList
!=
null
&&
!
subCodeList
.
isEmpty
())
{
for
(
Barcode
subCode
:
subCodeList
)
{
if
(
parStr
.
equals
(
subCode
.
getPosName
())){
String
status
=
subCode
.
getExtraData
(
"status"
);
if
(
StringUtils
.
isNotEmpty
(
status
))
{
hasNeedPutInBarcode
=
true
;
break
;
}
}
}
}
if
(!
hasNeedPutInBarcode
){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"请先扫描料格条码:"
+
parStr
+
",回车后,再扫描料盘条码"
);
}
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
resultMap
.
put
(
"ng"
,
0
);
//判断是不是要出库的物料
//判断是不是要出库的物料
if
(
barcode
.
isOut
())
{
if
(
barcode
.
isOut
())
{
LuxsanApi
.
pickingIssue
(
new
PickingIssueRequest
(
CommonUtil
.
plantCode
,
"SMFW"
+
System
.
currentTimeMillis
(),
"0"
,
barcode
.
getPartNumber
()
String
orderId
=
""
;
,
barcode
.
getWarehouseCode
(),
""
,
""
,
""
,
Arrays
.
asList
(
barcode
.
getBarcode
())));
String
orderNo
=
""
;
String
orderItemId
=
barcode
.
getOrderItemId
();
if
(
StringUtils
.
isNotEmpty
(
orderItemId
))
{
LiteOrderItem
item
=
liteOrderItemManager
.
get
(
orderItemId
);
orderId
=
item
.
getOrderId
();
orderNo
=
item
.
getOrderNo
();
LiteOrder
liteOrder
=
liteOrderManager
.
get
(
orderId
);
log
.
info
(
barcode
.
getBarcode
()+
"属于Sorting物料,隔口号为:"
+
parStr
+
",单据号为:"
+
orderNo
+
",类型为:"
+
LiteorderCheckType
.
TICKET_CHECKOUT
+
",item为:"
+
item
.
getId
());
if
(
LiteorderCheckType
.
TICKET_CHECKOUT
==
liteOrder
.
getCheckType
())
{
TicketPickRequest
request
=
new
TicketPickRequest
();
request
.
setPLANT_CODE
(
CommonUtil
.
plantCode
);
request
.
setTICKET_CODE
(
item
.
getTicketCode
());
request
.
setTICKET_ITEM
(
item
.
getTicketItem
());
request
.
setQTY
(
barcode
.
getAmount
());
request
.
setBIN_CODE
(
parStr
);
List
<
TicketPickLabelList
>
labelList
=
new
ArrayList
<>();
TicketPickLabelList
tickPick
=
new
TicketPickLabelList
();
tickPick
.
setREEL_LIST
(
Arrays
.
asList
(
barcode
.
getBarcode
()));
tickPick
.
setLABEL_ID
(
barcode
.
getLabelId
());
labelList
.
add
(
tickPick
);
request
.
setLABEL_LIST
(
labelList
);
LuxsanApi
.
ticketPick
(
request
);
}
}
else
{
LuxsanApi
.
pickingIssue
(
new
PickingIssueRequest
(
CommonUtil
.
plantCode
,
"SMFW"
+
System
.
currentTimeMillis
(),
"0"
,
barcode
.
getPartNumber
()
,
barcode
.
getWarehouseCode
(),
""
,
""
,
""
,
Arrays
.
asList
(
barcode
.
getBarcode
())));
}
barcode
.
updateExtraData
(
"status"
,
null
);
barcode
.
setOut
(
false
);
barcode
.
setOut
(
false
);
barcode
.
setOrderItemId
(
""
);
barcode
.
setOrderItemId
(
""
);
barcode
.
setPosName
(
""
);
barcode
.
setPosName
(
""
);
barcode
=
barcodeManager
.
save
(
barcode
);
barcode
=
barcodeManager
.
save
(
barcode
);
boxBarcode
.
removeFromSubCodes
(
barcode
);
boxBarcode
.
removeFromSubCodes
(
barcode
);
boxBarcode
=
barcodeManager
.
save
(
boxBarcode
);
boxBarcode
=
barcodeManager
.
save
(
boxBarcode
);
if
(
pos
!=
null
){
if
(
pos
!=
null
)
{
pos
.
setBarcode
(
boxBarcode
);
pos
.
setBarcode
(
boxBarcode
);
storagePosManager
.
save
(
pos
);
storagePosManager
.
save
(
pos
);
}
}
...
@@ -302,36 +366,140 @@ public class TicketSortingController {
...
@@ -302,36 +366,140 @@ public class TicketSortingController {
task
.
setNum
(
barcode
.
getAmount
());
task
.
setNum
(
barcode
.
getAmount
());
task
.
setType
(
OP
.
CHECKOUT
);
task
.
setType
(
OP
.
CHECKOUT
);
task
.
setStatus
(
OP_STATUS
.
FINISHED
.
name
());
task
.
setStatus
(
OP_STATUS
.
FINISHED
.
name
());
task
.
setOperator
(
SecurityUtils
.
getLoginUsername
()+
"Sorting出库"
);
task
.
setOperator
(
SecurityUtils
.
getLoginUsername
()
+
"Sorting出库"
);
task
.
setPosName
(
boxBarcode
.
getBarcode
());
//生成出库任务
//生成出库任务
String
itemId
=
barcode
.
getOrderItemId
();
String
itemId
=
barcode
.
getOrderItemId
();
if
(
StringUtils
.
isNotEmpty
(
itemId
)){
task
.
setSourceId
(
orderId
);
LiteOrderItem
item
=
liteOrderItemManager
.
get
(
itemId
);
task
.
setSourceName
(
orderNo
);
if
(
item
!=
null
){
task
.
setSubSourceId
(
itemId
);
task
.
setSourceId
(
item
.
getOrderId
());
taskService
.
updateFinishedTask
(
task
);
task
.
setSourceName
(
item
.
getOrderNo
());
resultMap
.
put
(
"ng"
,
1
);
task
.
setSubSourceId
(
item
.
getId
());
resultMap
.
put
(
"reason"
,
barcode
.
getBarcode
()
+
"为禁用料,不要放到箱格中"
);
}
}
dataLogManager
.
save
(
task
);
taskService
.
moveTaskToFinished
(
task
);
resultMap
.
put
(
"ng"
,
1
);
}
else
{
}
else
{
barcode
.
setSeq
(
getSeq
(
boxBarcode
,
barcode
.
getPosName
()));
barcode
.
setSeq
(
getSeq
(
boxBarcode
,
barcode
.
getPosName
()));
barcode
.
updateExtraData
(
"status"
,
null
);
barcode
.
updateExtraData
(
"status"
,
null
);
barcodeManager
.
save
(
barcode
);
barcodeManager
.
save
(
barcode
);
boxBarcode
.
updateSubCodes
(
barcode
);
boxBarcode
.
updateSubCodes
(
barcode
);
boxBarcode
=
barcodeManager
.
save
(
boxBarcode
);
boxBarcode
=
barcodeManager
.
save
(
boxBarcode
);
if
(
pos
!=
null
){
if
(
pos
!=
null
)
{
pos
.
setBarcode
(
boxBarcode
);
pos
.
setBarcode
(
boxBarcode
);
storagePosManager
.
save
(
pos
);
storagePosManager
.
save
(
pos
);
}
}
resultMap
.
put
(
"ng"
,
0
);
resultMap
.
put
(
"reason"
,
barcode
.
getBarcode
()
+
"请放入原箱格"
);
}
}
return
ResultBean
.
newOkResult
(
resultMap
);
return
ResultBean
.
newOkResult
(
resultMap
);
}
}
@ApiOperation
(
"sorting完成装箱并入库"
)
@RequestMapping
(
"/sortingBoxToPos"
)
//@AnonymousAccess
public
synchronized
ResultBean
boxToPosNew
(
String
boxStr
,
String
posName
,
String
type
)
{
if
(
StringUtils
.
isEmpty
(
boxStr
))
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"料箱信息"
});
}
Barcode
boxBarcode
=
codeResolve
.
resolveOneValideBarcode
(
boxStr
);
if
(
boxBarcode
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.invalid"
,
"条码无效"
);
}
List
<
Barcode
>
subCodeList
=
boxBarcode
.
getSubCodeList
();
//1.判断有没有正在sorting未入库的
for
(
Barcode
subCode
:
subCodeList
)
{
String
status
=
subCode
.
getExtraData
(
"status"
);
if
(
StringUtils
.
isNotEmpty
(
status
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"请扫描完全部料盘,再进行入库操作"
);
}
}
//判断库位有没有正在执行的任务
for
(
DataLog
task
:
taskService
.
getAllTasks
())
{
if
(
posName
.
equals
(
task
.
getPosName
()))
{
if
(!
task
.
isCancel
()
&&
!
task
.
isFinished
())
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
posName
+
"当前库位有正在执行的任务,请确认"
);
}
}
}
if
(
"1"
.
equals
(
type
))
{
if
(
StringUtils
.
isEmpty
(
posName
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"库位不能为空"
);
}
StoragePos
pos
=
storagePosManager
.
getByPosName
(
posName
);
if
(
pos
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
boxStr
+
"对应的库位"
+
posName
+
"不存在"
);
}
Barcode
barcode
=
pos
.
getBarcode
();
if
(
barcode
!=
null
)
{
if
(!
barcode
.
getBarcode
().
equals
(
boxBarcode
.
getBarcode
()))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
posName
+
"已经存在料箱:"
+
barcode
.
getBarcode
());
}
}
//判断当前箱子是否在其他库位中
StoragePos
oldPos
=
storagePosManager
.
getByBarcode
(
boxBarcode
.
getBarcode
());
if
(
oldPos
!=
null
)
{
log
.
info
(
boxStr
+
"清空原来的储位:"
+
oldPos
.
getPosName
());
oldPos
.
setBarcode
(
null
);
oldPos
.
setUsed
(
false
);
storagePosManager
.
save
(
oldPos
);
}
boxBarcode
=
clearOutFlag
(
boxStr
,
boxBarcode
,
subCodeList
);
pos
.
setBarcode
(
null
);
taskService
.
addTaskToFinished
(
pos
,
boxBarcode
,
"手动入库"
);
return
ResultBean
.
newOkResult
(
""
);
}
else
{
StoragePos
pos
=
BoxHandleUtil
.
locOnePos
(
boxBarcode
);
if
(
pos
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
boxStr
+
"未找到可用库位"
);
}
//如果是虚拟仓的库位,提示出来
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
if
(
storage
.
isVirtual
())
{
return
ResultBean
.
newErrorResult
(
2
,
""
,
""
);
}
pos
.
setBarcode
(
boxBarcode
);
storagePosManager
.
save
(
pos
);
log
.
info
(
boxStr
+
"入库到智能仓,分配的储位为:"
+
pos
.
getPosName
());
boxBarcode
=
clearOutFlag
(
boxStr
,
boxBarcode
,
subCodeList
);
DataLog
dataLog
=
taskService
.
addPutInTaskToExecute
(
storage
,
boxBarcode
,
pos
,
TaskCurrentLoc
.
Manual_DischargeHole
);
return
ResultBean
.
newOkResult
(
""
);
}
}
private
Barcode
clearOutFlag
(
String
boxStr
,
Barcode
boxBarcode
,
List
<
Barcode
>
subCodeList
)
{
//2.判断有没有未完成的任务,进行出库操作
List
<
Barcode
>
newSubCodeList
=
new
ArrayList
<>();
for
(
Barcode
barcode
:
subCodeList
)
{
if
(
barcode
.
isOut
())
{
log
.
info
(
boxStr
+
"有需要出库的料盘:"
+
barcode
.
getBarcode
()
+
"需要改成不出库"
);
String
orderItemId
=
barcode
.
getOrderItemId
();
barcode
.
setOdn
(
""
);
barcode
.
setOrderId
(
""
);
barcode
.
setOrderItemId
(
""
);
barcode
.
setOut
(
false
);
barcode
=
barcodeManager
.
save
(
barcode
);
BoxHandleUtil
.
manualGenerateTask
(
barcode
,
OP_STATUS
.
CANCEL
.
name
(),
barcode
.
getAmount
(),
OP
.
CHECKOUT
,
orderItemId
);
}
newSubCodeList
.
add
(
barcode
);
}
boxBarcode
.
setSubCodeList
(
newSubCodeList
);
boxBarcode
=
barcodeManager
.
save
(
boxBarcode
);
return
boxBarcode
;
}
public
int
getSeq
(
Barcode
boxBarcode
,
String
posName
)
{
public
int
getSeq
(
Barcode
boxBarcode
,
String
posName
)
{
int
seq
=
0
;
int
seq
=
0
;
List
<
Barcode
>
subCodeList
=
boxBarcode
.
getSubCodeList
();
List
<
Barcode
>
subCodeList
=
boxBarcode
.
getSubCodeList
();
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/manual/ManualGrPutInController.java
查看文件 @
9441cab
...
@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
...
@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.DateUtil
;
import
com.neotel.smfcore.common.utils.DateUtil
;
import
com.neotel.smfcore.common.utils.ReelLockPosUtil
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.api.SmfApi
;
import
com.neotel.smfcore.core.api.SmfApi
;
...
@@ -207,7 +208,7 @@ public class ManualGrPutInController {
...
@@ -207,7 +208,7 @@ public class ManualGrPutInController {
int
w
=
7
;
int
w
=
7
;
int
h
=
8
;
int
h
=
8
;
Component
component
=
componentManager
.
findByPartNumberAndProvider
(
noDbBarcode
.
getPartNumber
(),
noDbBarcode
.
getProvider
())
;
Component
component
=
null
;
if
(
component
==
null
)
{
if
(
component
==
null
)
{
BrandQtyResult
result
=
LuxsanApi
.
brandQtyUrl
(
new
BrandQtyRequest
(
noDbBarcode
.
getPartNumber
(),
noDbBarcode
.
getProvider
()));
BrandQtyResult
result
=
LuxsanApi
.
brandQtyUrl
(
new
BrandQtyRequest
(
noDbBarcode
.
getPartNumber
(),
noDbBarcode
.
getProvider
()));
if
(
result
==
null
)
{
if
(
result
==
null
)
{
...
@@ -226,6 +227,22 @@ public class ManualGrPutInController {
...
@@ -226,6 +227,22 @@ public class ManualGrPutInController {
h
=
component
.
getHeight
();
h
=
component
.
getHeight
();
}
}
if
(
13
==
w
){
if
(!
binCode
.
startsWith
(
"C13"
)
&&
!
binCode
.
endsWith
(
"-01"
)){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"13寸的物料,请放入C13的01号料格中"
);
}
}
else
if
(
15
==
w
){
if
(!
binCode
.
startsWith
(
"C15"
)
&&
!
binCode
.
endsWith
(
"-01"
)){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"15寸的物料,请放入C15的01号料格中"
);
}
}
else
if
(
7
==
w
){
if
(
binCode
.
startsWith
(
"C15"
)
||
binCode
.
startsWith
(
"C13"
)){
if
(
binCode
.
endsWith
(
"01"
)){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"7寸的物料,不可以放入C15或者C13的料格中,请选择其他料格"
);
}
}
}
//判断条码是否正常
//判断条码是否正常
Barcode
barcode
=
null
;
Barcode
barcode
=
null
;
...
@@ -364,7 +381,7 @@ public class ManualGrPutInController {
...
@@ -364,7 +381,7 @@ public class ManualGrPutInController {
//如果是type为0时,入智能仓
//如果是type为0时,入智能仓
if
(
"0"
.
equals
(
type
)){
if
(
"0"
.
equals
(
type
)){
StoragePos
pos
=
BoxHandleUtil
.
locOnePos
(
boxBarcode
);
/*
StoragePos pos = BoxHandleUtil.locOnePos(boxBarcode);
if (pos == null) {
if (pos == null) {
return ResultBean.newErrorResult(-1, "", boxStr + "未找到可用库位");
return ResultBean.newErrorResult(-1, "", boxStr + "未找到可用库位");
}
}
...
@@ -374,12 +391,12 @@ public class ManualGrPutInController {
...
@@ -374,12 +391,12 @@ public class ManualGrPutInController {
if (storage.isVirtual()){
if (storage.isVirtual()){
return ResultBean.newErrorResult(-1,"","料箱:"+boxStr+"所属的库位为:"+pos.getPosName()+",属于虚拟仓,请在虚拟仓页面进行操作");
return ResultBean.newErrorResult(-1,"","料箱:"+boxStr+"所属的库位为:"+pos.getPosName()+",属于虚拟仓,请在虚拟仓页面进行操作");
}
}
boxBarcode.setPosName(pos.getPosName());
pos.setBarcode(boxBarcode);
pos.setBarcode(boxBarcode);
storagePosManager.save(pos);
storagePosManager.save(pos);
log.info(boxStr+"入库到智能仓,分配的储位为:"+pos.getPosName());
log.info(boxStr+"入库到智能仓,分配的储位为:"+pos.getPosName());
DataLog
dataLog
=
taskService
.
addPutInTaskToExecute
(
storage
,
boxBarcode
,
pos
,
TaskCurrentLoc
.
Manual_DischargeHole
);
DataLog dataLog = taskService.addPutInTaskToExecute(storage, boxBarcode, pos, TaskCurrentLoc.Manual_DischargeHole);
*/
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
else
if
(
"1"
.
equals
(
type
)){
else
if
(
"1"
.
equals
(
type
)){
...
@@ -396,6 +413,19 @@ public class ManualGrPutInController {
...
@@ -396,6 +413,19 @@ public class ManualGrPutInController {
}
}
}
}
//判断当前箱子是否在其他库位中
StoragePos
oldPos
=
storagePosManager
.
getByBarcode
(
boxBarcode
.
getBarcode
());
if
(
oldPos
!=
null
){
log
.
info
(
boxStr
+
"原来的储位为:"
+
oldPos
.
getPosName
()+
",当前输入的储位为:"
+
posName
);
if
(!
posName
.
equals
(
oldPos
.
getPosName
())){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
boxStr
+
"请放入原来的库位:"
+
oldPos
.
getPosName
()+
",不可以放到库位:"
+
posName
);
}
//oldPos.setBarcode(null);
//oldPos.setUsed(false);
//storagePosManager.save(oldPos);
}
StoragePos
pos
=
storagePosManager
.
getByPosName
(
posName
);
StoragePos
pos
=
storagePosManager
.
getByPosName
(
posName
);
if
(
pos
==
null
){
if
(
pos
==
null
){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
boxStr
+
"对应的库位"
+
posName
+
"不存在"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
boxStr
+
"对应的库位"
+
posName
+
"不存在"
);
...
@@ -406,17 +436,10 @@ public class ManualGrPutInController {
...
@@ -406,17 +436,10 @@ public class ManualGrPutInController {
return
ResultBean
.
newErrorResult
(-
1
,
""
,
posName
+
"已经存在料箱:"
+
barcode
.
getBarcode
());
return
ResultBean
.
newErrorResult
(-
1
,
""
,
posName
+
"已经存在料箱:"
+
barcode
.
getBarcode
());
}
}
}
}
//判断当前箱子是否在其他库位中
StoragePos
oldPos
=
storagePosManager
.
getByBarcode
(
boxBarcode
.
getBarcode
());
if
(
oldPos
!=
null
){
log
.
info
(
boxStr
+
"清空原来的储位:"
+
oldPos
.
getPosName
());
oldPos
.
setBarcode
(
null
);
oldPos
.
setUsed
(
false
);
storagePosManager
.
save
(
oldPos
);
}
pos
.
setBarcode
(
null
);
pos
.
setBarcode
(
null
);
taskService
.
addTaskToFinished
(
pos
,
boxBarcode
,
"手动入库"
);
taskService
.
addTaskToFinished
(
pos
,
boxBarcode
,
"手动入库"
);
ReelLockPosUtil
.
removeReelLockPosInfo
(
barcode
.
getBarcode
());
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"请选择手动入库"
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"请选择手动入库"
);
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/station/StationController.java
0 → 100644
查看文件 @
9441cab
package
com
.
neotel
.
smfcore
.
custom
.
luxsan
.
factory_c
.
rawstor
.
controller
.
station
;
import
com.google.common.collect.Maps
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.exception.ValidateException
;
import
com.neotel.smfcore.common.utils.DateUtil
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.common.utils.StringUtils
;
import
com.neotel.smfcore.core.api.SmfApi
;
import
com.neotel.smfcore.core.barcode.bean.CodeBean
;
import
com.neotel.smfcore.core.barcode.enums.BARCODE_STATUS
;
import
com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.service.po.Component
;
import
com.neotel.smfcore.core.barcode.utils.CodeResolve
;
import
com.neotel.smfcore.core.device.enums.OP
;
import
com.neotel.smfcore.core.device.enums.OP_STATUS
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.order.service.manager.ILiteOrderItemManager
;
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.LiteOrderItem
;
import
com.neotel.smfcore.core.storage.service.manager.IStoragePosManager
;
import
com.neotel.smfcore.core.storage.service.po.StoragePos
;
import
com.neotel.smfcore.core.system.service.po.DataLog
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.custom.lizhen.agvBox.util.BoxUtil
;
import
com.neotel.smfcore.custom.lizhen.innerBox.enums.ExtendType
;
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.request.NewLabelToCellRequest
;
import
com.neotel.smfcore.custom.luxsan.api.bean.request.PickingIssueRequest
;
import
com.neotel.smfcore.custom.luxsan.api.bean.result.BrandQtyResult
;
import
com.neotel.smfcore.custom.luxsan.api.bean.result.NewLabelToCellResult
;
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.rawstor.enums.LiteorderCheckType
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.BinCacheUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.BoxHandleUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.util.GrUtil
;
import
com.neotel.smfcore.security.annotation.AnonymousAccess
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
javafx.concurrent.Task
;
import
lombok.extern.slf4j.Slf4j
;
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.*
;
@Slf4j
@RestController
@RequestMapping
(
"/station"
)
public
class
StationController
{
@Autowired
private
CodeResolve
codeResolve
;
@Autowired
private
IStoragePosManager
storagePosManager
;
@Autowired
private
SmfApi
smfApi
;
@Autowired
private
IBarcodeManager
barcodeManager
;
@Autowired
private
TaskService
taskService
;
@Autowired
private
ILiteOrderManager
liteOrderManager
;
@Autowired
private
ILiteOrderItemManager
liteOrderItemManager
;
@Autowired
private
DataCache
dataCache
;
@ApiOperation
(
"获取工位信息"
)
@RequestMapping
(
"/boxInfo"
)
@AnonymousAccess
public
ResultBean
boxInfo
(
String
station
)
{
Map
<
String
,
String
>
cacheMap
=
dataCache
.
getCache
(
CacheNameUtil
.
CHCHE_MANUAL_LINE_STATIONSTATUS
);
if
(
cacheMap
==
null
)
{
cacheMap
=
Maps
.
newConcurrentMap
();
}
String
boxStr
=
cacheMap
.
get
(
station
);
boxStr
=
boxStr
.
toUpperCase
(
Locale
.
ROOT
);
//如果不是C07,C13,C15开头的 报错
if
(!
boxStr
.
startsWith
(
"C07"
)
&&
!
boxStr
.
startsWith
(
"C13"
)
&&
!
boxStr
.
startsWith
(
"C15"
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
boxStr
+
"不是有效的料箱条码"
);
}
//如果不是以A/B结尾的,则提示
if
(!
boxStr
.
endsWith
(
"A"
)
&&
!
boxStr
.
endsWith
(
"B"
)){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
boxStr
+
"请输入完整的料箱条码"
);
}
Barcode
barcode
=
codeResolve
.
resolveCode
(
boxStr
);
if
(
barcode
!=
null
){
if
(
barcode
.
getStatus
()
==
BARCODE_STATUS
.
IN_STORE
)
{
StoragePos
pos
=
storagePosManager
.
getByBarcode
(
barcode
.
getBarcode
());
if
(
pos
!=
null
)
{
barcode
=
pos
.
getBarcode
();
barcode
.
setStatus
(
BARCODE_STATUS
.
OUT_NORMAL
);
//设置成 不在库
barcodeManager
.
save
(
barcode
);
pos
.
setBarcode
(
barcode
);
storagePosManager
.
save
(
pos
);
}
}
}
return
ResultBean
.
newOkResult
(
BoxHandleUtil
.
getBoxInfo
(
boxStr
));
}
@ApiOperation
(
"S1工位入库"
)
@RequestMapping
(
"/grPutIn/rawS01"
)
@AnonymousAccess
public
synchronized
ResultBean
grPutInRawS01
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
return
reelToBox
(
paramMap
);
}
@ApiOperation
(
"S2工位入库"
)
@RequestMapping
(
"/grPutIn/rawS02"
)
@AnonymousAccess
public
synchronized
ResultBean
grPutInRawS02
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
return
reelToBox
(
paramMap
);
}
@ApiOperation
(
"S3工位入库"
)
@RequestMapping
(
"/grPutIn/rawS03"
)
@AnonymousAccess
public
synchronized
ResultBean
grPutInRawS03
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
return
reelToBox
(
paramMap
);
}
@ApiOperation
(
"S1工位出库"
)
@RequestMapping
(
"/checkOut/rawS01"
)
@AnonymousAccess
public
synchronized
ResultBean
checkOutRawS01
(
@RequestBody
Map
<
String
,
String
>
paramMap
){
return
reelOutBox
(
paramMap
);
}
@ApiOperation
(
"S2工位出库"
)
@RequestMapping
(
"/checkOut/rawS02"
)
@AnonymousAccess
public
synchronized
ResultBean
checkOutRawS02
(
@RequestBody
Map
<
String
,
String
>
paramMap
){
return
reelOutBox
(
paramMap
);
}
@ApiOperation
(
"S3工位出库"
)
@RequestMapping
(
"/checkOut/rawS03"
)
@AnonymousAccess
public
synchronized
ResultBean
checkOutRawS03
(
@RequestBody
Map
<
String
,
String
>
paramMap
){
return
reelOutBox
(
paramMap
);
}
private
ResultBean
reelOutBox
(
Map
<
String
,
String
>
paramMap
)
{
String
codeStr
=
paramMap
.
get
(
"code"
);
codeStr
=
codeStr
.
toUpperCase
();
//判断是否整箱出库
if
(
isBoxPartition
(
codeStr
)
&&
(
codeStr
.
endsWith
(
"A"
)
||
codeStr
.
endsWith
(
"B"
)))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"请扫描料盘进行出库"
);
}
//判断是否隔口出库
else
if
(
isBoxPartition
(
codeStr
)
&&
codeStr
.
indexOf
(
"-"
)
!=
-
1
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"请扫描料盘进行出库"
);
}
//获取料箱信息
CodeBean
code
=
codeResolve
.
resolveSingleCode
(
codeStr
);
if
(!
code
.
isValid
())
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.noValidCode"
,
"条码无效"
);
}
Barcode
barcode
=
code
.
getBarcode
();
String
posName
=
barcode
.
getPosName
();
if
(
StringUtils
.
isBlank
(
posName
))
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
barcode
.
getBarcode
()
+
"不存在此料箱中"
);
}
//判断该料箱中 有没有可以出库的物料
String
boxStr
=
BoxHandleUtil
.
getBoxStr
(
posName
,
false
);
Barcode
pidBarcode
=
barcodeManager
.
findByBarcode
(
boxStr
);
List
<
Barcode
>
subCodes
=
pidBarcode
.
getSubCodeList
();
if
(
subCodes
==
null
||
subCodes
.
isEmpty
())
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"料箱:"
+
boxStr
+
",没有可出库的物料"
);
}
//判断当前料箱是否包含此物料
boolean
hasBarcode
=
false
;
String
barcodeStr
=
barcode
.
getBarcode
();
for
(
Barcode
subCode
:
subCodes
)
{
if
(
barcodeStr
.
equals
(
subCode
.
getBarcode
()))
{
hasBarcode
=
true
;
barcode
=
subCode
;
break
;
}
}
if
(!
hasBarcode
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
barcodeStr
+
"不在料箱:"
+
boxStr
+
"请核实是否已经出库"
);
}
//判断当前隔口是否有要出的任务
boolean
isOut
=
false
;
if
(
barcode
.
isOut
()){
manualCheckOut
(
barcode
);
isOut
=
true
;
String
orderItemId
=
barcode
.
getOrderItemId
();
pidBarcode
.
removeFromSubCodes
(
barcode
);
pidBarcode
.
setAmount
(
pidBarcode
.
getAmount
()
-
barcode
.
getAmount
());
barcodeManager
.
save
(
pidBarcode
);
generateCheckOutTask
(
barcode
,
OP_STATUS
.
FINISHED
.
name
(),
barcode
.
getAmount
(),
OP
.
CHECKOUT
,
barcode
.
getOrderItemId
());
barcode
.
setSelectMsg
(
null
);
barcode
.
setOut
(
false
);
barcode
.
setOrderItemId
(
null
);
barcode
.
setPosName
(
null
);
barcode
.
setHostBarcodeId
(
null
);
barcode
.
setStorageId
(
null
);
barcodeManager
.
save
(
barcode
);
}
else
{
if
(
subCodes
!=
null
&&
!
subCodes
.
isEmpty
())
{
//获取到需要出库的物料,进行更改
Barcode
barcodeByOut
=
null
;
for
(
Barcode
subCode
:
subCodes
)
{
//判断料箱隔口是否一致
if
(
subCode
.
getPosName
().
equals
(
barcode
.
getPosName
()))
{
if
(
subCode
.
isOut
()
&&
StringUtils
.
isNotBlank
(
subCode
.
getOrderItemId
()))
{
barcodeByOut
=
subCode
;
break
;
}
}
}
if
(
barcodeByOut
!=
null
)
{
String
orderItemId
=
barcodeByOut
.
getOrderItemId
();
barcodeByOut
.
setOut
(
false
);
barcodeByOut
.
setOrderItemId
(
null
);
barcodeByOut
.
setSelectMsg
(
null
);
pidBarcode
.
UpdateSubCode
(
barcodeByOut
);
log
.
info
(
barcode
.
getBarcode
()
+
"不是出库任务,"
+
barcodeByOut
.
getBarcode
()
+
"需更改out为false"
);
barcode
.
setOrderItemId
(
orderItemId
);
pidBarcode
.
setAmount
(
pidBarcode
.
getAmount
()
-
barcode
.
getAmount
());
pidBarcode
.
removeFromSubCodes
(
barcode
);
//通知WMS
manualCheckOut
(
barcode
);
barcodeByOut
=
barcodeManager
.
save
(
barcodeByOut
);
generateCheckOutTask
(
barcode
,
OP_STATUS
.
FINISHED
.
name
(),
barcode
.
getAmount
(),
OP
.
CHECKOUT
,
barcode
.
getOrderItemId
());
log
.
info
(
"物料出库,生成出库任务,barcode:"
+
barcode
.
getBarcode
()
+
",隔口号为:"
+
barcode
.
getPosName
());
barcode
.
setSelectMsg
(
null
);
barcode
.
setOut
(
false
);
barcode
.
setOrderItemId
(
null
);
barcode
.
setPosName
(
null
);
barcode
.
setHostBarcodeId
(
null
);
barcode
.
setStorageId
(
null
);
barcodeManager
.
save
(
barcode
);
isOut
=
true
;
}
}
}
pidBarcode
=
barcodeManager
.
save
(
pidBarcode
);
StoragePos
pos
=
BoxHandleUtil
.
locOnePos
(
pidBarcode
);
if
(
pos
!=
null
)
{
pos
.
setBarcode
(
pidBarcode
);
storagePosManager
.
save
(
pos
);
}
if
(!
isOut
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
barcode
.
getBarcode
()
+
"不需要出库"
);
}
return
ResultBean
.
newOkResult
(
BoxHandleUtil
.
getBoxInfo
(
boxStr
));
}
private
ResultBean
reelToBox
(
Map
<
String
,
String
>
paramMap
){
String
binCode
=
paramMap
.
get
(
"binCode"
);
//料格信息
String
udCode
=
paramMap
.
get
(
"udCode"
);
//过账编码
String
codeStr
=
paramMap
.
get
(
"codeStr"
);
//条码信息
String
warhouseCode
=
paramMap
.
get
(
"warhouseCode"
);
//库别
String
grCode
=
paramMap
.
get
(
"grCode"
);
//GrItem
String
grItem
=
paramMap
.
get
(
"grItem"
);
//GrCode
String
boxStr
=
paramMap
.
get
(
"boxStr"
);
//料箱信息
log
.
info
(
"人工GR入库,料格信息为:"
+
binCode
+
",过账编码为:"
+
udCode
+
"条码信息为:"
+
codeStr
);
if
(
StringUtils
.
isEmpty
(
binCode
))
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"料格信息"
});
}
if
(
StringUtils
.
isEmpty
(
udCode
))
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"过账编码"
});
}
if
(
StringUtils
.
isEmpty
(
codeStr
))
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"条码信息"
});
}
if
(
StringUtils
.
isEmpty
(
warhouseCode
))
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"库别"
});
}
if
(
StringUtils
.
isEmpty
(
grCode
))
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"Gr信息"
});
}
if
(
StringUtils
.
isEmpty
(
boxStr
))
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"料箱信息"
});
}
codeStr
=
codeStr
.
toUpperCase
(
Locale
.
ROOT
);
binCode
=
binCode
.
toUpperCase
(
Locale
.
ROOT
);
boxStr
=
boxStr
.
toUpperCase
(
Locale
.
ROOT
);
Barcode
noDbBarcode
=
codeResolve
.
resolveCode
(
codeStr
);
if
(
noDbBarcode
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
"smfcore.error.barcode.noValidCode"
,
"条码无效"
);
}
int
w
=
7
;
int
h
=
8
;
Component
component
=
null
;
if
(
component
==
null
)
{
BrandQtyResult
result
=
LuxsanApi
.
brandQtyUrl
(
new
BrandQtyRequest
(
noDbBarcode
.
getPartNumber
(),
noDbBarcode
.
getProvider
()));
if
(
result
==
null
)
{
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"料号:"
+
noDbBarcode
.
getPartNumber
()+
"供应商:"
+
noDbBarcode
.
getProvider
()+
"未找到对应的尺寸信息"
);
}
w
=
result
.
getReel_size
();
if
(
w
==
7
)
{
h
=
8
;
}
else
if
(
w
==
13
)
{
h
=
24
;
}
else
if
(
w
==
15
)
{
h
=
32
;
}
}
else
{
w
=
component
.
getPlateSize
();
h
=
component
.
getHeight
();
}
if
(
13
==
w
){
if
(!
binCode
.
startsWith
(
"C13"
)
&&
!
binCode
.
endsWith
(
"-01"
)){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"13寸的物料,请放入C13的01号料格中"
);
}
}
else
if
(
15
==
w
){
if
(!
binCode
.
startsWith
(
"C15"
)
&&
!
binCode
.
endsWith
(
"-01"
)){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"15寸的物料,请放入C15的01号料格中"
);
}
}
else
if
(
7
==
w
){
if
(
binCode
.
startsWith
(
"C15"
)
||
binCode
.
startsWith
(
"C13"
)){
if
(
binCode
.
endsWith
(
"01"
)){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"7寸的物料,不可以放入C15或者C13的料格中,请选择其他料格"
);
}
}
}
//判断条码是否正常
Barcode
barcode
=
null
;
try
{
barcode
=
codeResolve
.
resolveOneValideBarcode
(
"="
+
w
+
"x"
+
h
+
"="
+
codeStr
);
}
catch
(
ValidateException
ve
)
{
return
ResultBean
.
newErrorResult
(-
1
,
ve
.
getMsgKey
(),
ve
.
getDefaultMsg
());
}
//判断是否存在料箱中
if
(
StringUtils
.
isNotEmpty
(
barcode
.
getPosName
()))
{
log
.
info
(
barcode
.
getBarcode
()
+
"已经存在料格"
+
barcode
.
getPosName
());
return
ResultBean
.
newErrorResult
(-
1
,
""
,
barcode
.
getBarcode
()
+
"已经存在料格"
+
barcode
.
getPosName
());
}
//找到box信息
Barcode
boxBarcode
=
null
;
StoragePos
inPos
=
null
;
try
{
boxBarcode
=
codeResolve
.
resolveOneValideBarcode
(
boxStr
);
inPos
=
storagePosManager
.
getByBarcode
(
boxBarcode
.
getBarcode
());
if
(
inPos
!=
null
){
boxBarcode
=
inPos
.
getBarcode
();
}
}
catch
(
ValidateException
ve
){
return
ResultBean
.
newErrorResult
(-
1
,
ve
.
getMsgKey
(),
"料箱条码不正确:"
+
boxStr
);
}
//判断料格条码和料箱是否匹配
if
(!
binCode
.
startsWith
(
boxBarcode
.
getBarcode
())){
return
ResultBean
.
newErrorResult
(-
1
,
""
,
"当前扫描的隔口"
+
binCode
+
"与料箱信息:"
+
boxStr
+
"不匹配"
);
}
//判断是否为禁用料
barcode
=
smfApi
.
canPutInAfterResolve
(
barcode
);
barcode
.
setWarehouseCode
(
warhouseCode
);
//判断隔口能否放入
if
(
boxBarcode
!=
null
){
String
canPutIn
=
BinCacheUtil
.
canMaterialPutInBin
(
barcode
,
boxBarcode
,
binCode
);
if
(
StringUtils
.
isEmpty
(
canPutIn
))
{
NewLabelToCellResult
cell
=
LuxsanApi
.
newLabelToCell
(
new
NewLabelToCellRequest
(
CommonUtil
.
plantCode
,
Arrays
.
asList
(
udCode
),
barcode
.
getAmount
(),
binCode
,
Arrays
.
asList
(
barcode
.
getFullCode
())));
//将GR日期设置为生产日期
Date
grDate
=
DateUtil
.
getNoTimeDate
(
cell
.
getGR_DATE
());
barcode
.
setProduceDate
(
grDate
);
barcode
.
setLabelId
(
cell
.
getLABEL_ID
());
barcode
.
setPosName
(
binCode
);
barcode
.
setBarSource
(
grCode
);
barcode
.
setWarehouseCode
(
warhouseCode
);
barcode
.
setSeq
(
BoxHandleUtil
.
getSeq
(
boxBarcode
,
binCode
)+
1
);
barcode
.
setPutInTime
(
System
.
currentTimeMillis
());
// 刷新缓存中gr已过帐数量, 如果超出数量则报错
int
amount
=
barcode
.
getAmount
();
GrUtil
.
addQty
(
grCode
,
grItem
,
amount
);
barcode
=
barcodeManager
.
save
(
barcode
);
generatePutInTask
(
barcode
,
boxBarcode
,
OP_STATUS
.
FINISHED
.
name
());
boxBarcode
.
updateSubCodes
(
barcode
);
boxBarcode
.
setAmount
(
boxBarcode
.
getAmount
()+
barcode
.
getAmount
());
barcodeManager
.
save
(
boxBarcode
);
if
(
inPos
!=
null
){
//流程异常时,为保证数据一致性, pos中的box barcode也需要更新
inPos
.
setBarcode
(
boxBarcode
);
storagePosManager
.
save
(
inPos
);
}
return
ResultBean
.
newOkResult
(
BoxHandleUtil
.
getBoxInfo
(
boxStr
));
}
else
{
log
.
info
(
barcode
.
getBarcode
()
+
"不可以放到料格:"
+
binCode
+
",原因为:"
+
canPutIn
);
return
ResultBean
.
newErrorResult
(-
1
,
""
,
barcode
.
getBarcode
()
+
"不可以放到料格:"
+
binCode
+
",原因为:"
+
canPutIn
);
}
}
return
ResultBean
.
newErrorResult
(-
1
,
""
,
barcode
.
getBarcode
()
+
"不可以放到料格:"
+
binCode
);
}
private
boolean
isBoxPartition
(
String
code
)
{
boolean
flag
=
false
;
if
(
code
.
startsWith
(
"C07"
)
||
code
.
startsWith
(
"C13"
)
||
code
.
startsWith
(
"C15"
))
{
flag
=
true
;
}
return
flag
;
}
private
void
generatePutInTask
(
Barcode
barcode
,
Barcode
boxBarcode
,
String
status
)
{
DataLog
dataLog
=
new
DataLog
();
dataLog
.
setPosId
(
boxBarcode
.
getId
());
dataLog
.
setPosName
(
barcode
.
getPosName
());
dataLog
.
setBarcode
(
barcode
.
getBarcode
());
dataLog
.
setW
(
barcode
.
getPlateSize
());
dataLog
.
setH
(
barcode
.
getHeight
());
dataLog
.
setPartNumber
(
barcode
.
getPartNumber
());
dataLog
.
setNum
(
barcode
.
getAmount
());
dataLog
.
setType
(
OP
.
PUT_IN
);
dataLog
.
setStatus
(
status
);
dataLog
.
setBatchInfo
(
barcode
.
getBatch
());
dataLog
.
setSourceName
(
barcode
.
getBarSource
());
dataLog
.
setWarehouseCode
(
barcode
.
getWarehouseCode
());
taskService
.
updateFinishedTask
(
dataLog
);
}
public
void
manualCheckOut
(
Barcode
barcode
)
{
String
itemId
=
barcode
.
getOrderItemId
();
if
(
StringUtils
.
isNotEmpty
(
itemId
))
{
LiteOrderItem
orderItem
=
liteOrderItemManager
.
get
(
itemId
);
LiteOrder
liteOrder
=
liteOrderManager
.
get
(
orderItem
.
getOrderId
());
if
(
liteOrder
==
null
)
{
throw
new
ValidateException
(
""
,
barcode
.
getBarcode
()
+
"未找到对应的工单出库信息"
);
}
if
(
liteOrder
.
getCheckType
()
==
LiteorderCheckType
.
PICKING_CHECKOUT
)
{
String
batchCode
=
""
;
if
(!
"N/A"
.
equals
(
orderItem
.
getBatchCode
()))
{
batchCode
=
orderItem
.
getBatchCode
();
}
LuxsanApi
.
pickingIssue
(
new
PickingIssueRequest
(
CommonUtil
.
plantCode
,
liteOrder
.
getOrderNo
(),
orderItem
.
getItemId
(),
barcode
.
getPartNumber
()
,
barcode
.
getWarehouseCode
(),
orderItem
.
getBrand
(),
orderItem
.
getFace
(),
batchCode
,
Arrays
.
asList
(
barcode
.
getBarcode
())));
}
}
else
{
//人工出库,
LuxsanApi
.
pickingIssue
(
new
PickingIssueRequest
(
CommonUtil
.
plantCode
,
"SMFW"
+
System
.
currentTimeMillis
(),
"0"
,
barcode
.
getPartNumber
()
,
barcode
.
getWarehouseCode
(),
""
,
""
,
""
,
Arrays
.
asList
(
barcode
.
getBarcode
())));
}
}
private
DataLog
generateCheckOutTask
(
Barcode
barcode
,
String
opStatus
,
int
opQty
,
int
opType
,
String
orderItemId
)
{
//生成任务
DataLog
task
=
new
DataLog
();
task
.
setStatus
(
opStatus
);
task
.
setPartNumber
(
barcode
.
getPartNumber
());
task
.
setBarcode
(
barcode
.
getBarcode
());
task
.
setNum
(
opQty
);
task
.
setType
(
opType
);
task
.
setPosName
(
barcode
.
getPosName
());
task
.
setOperator
(
SecurityUtils
.
getCurrentUsername
());
task
.
setDateCode
(
barcode
.
getDateCode
());
task
.
setBatchInfo
(
barcode
.
getBatch
());
task
.
setProvider
(
barcode
.
getProvider
());
task
.
setProviderNumber
(
barcode
.
getProviderNumber
());
task
.
setKeeperCode
(
barcode
.
getKeeperCode
());
//task.setReelPosName(barcode.getPosName());
task
.
setSubSourceId
(
orderItemId
);
task
.
setWarehouseCode
(
barcode
.
getWarehouseCode
());
if
(
StringUtils
.
isNotBlank
(
orderItemId
))
{
LiteOrderItem
orderItem
=
liteOrderItemManager
.
get
(
orderItemId
);
if
(
orderItem
!=
null
)
{
task
.
setSourceName
(
orderItem
.
getOrderNo
());
task
.
setLine
(
orderItem
.
getLine
());
task
.
setMo
(
orderItem
.
getMo
());
task
.
setSide
(
orderItem
.
getSide
());
task
.
setPlantCode
(
orderItem
.
getPlantCode
());
task
.
setOrderNo
(
orderItem
.
getOrderNo
());
task
.
setManualUpload
(
orderItem
.
isManualUpload
());
}
}
if
(
barcode
.
getPutInTime
()
!=
-
1
){
task
.
setFristPutInDate
(
new
Date
(
barcode
.
getPutInTime
()));
}
else
{
task
.
setFristPutInDate
(
barcode
.
getPutInDate
());
}
task
.
setDescribe
(
barcode
.
getDescribe
());
taskService
.
updateFinishedTask
(
task
);
return
task
;
}
}
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/kafka/config/KafkaConfig.java
查看文件 @
9441cab
...
@@ -16,8 +16,4 @@ public class KafkaConfig {
...
@@ -16,8 +16,4 @@ public class KafkaConfig {
* MachineParameter
* MachineParameter
*/
*/
public
static
final
String
MACHINEPARAMETER_TOPIC
=
"MachineParameter"
;
public
static
final
String
MACHINEPARAMETER_TOPIC
=
"MachineParameter"
;
public
static
final
String
LINE_CID
=
"line"
;
}
}
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/kafka/config/StorageNameConfig.java
查看文件 @
9441cab
package
com
.
neotel
.
smfcore
.
custom
.
luxsan
.
factory_c
.
rawstor
.
kafka
.
config
;
package
com
.
neotel
.
smfcore
.
custom
.
luxsan
.
factory_c
.
rawstor
.
kafka
.
config
;
import
org.springframework.stereotype.Component
;
import
javax.annotation.PostConstruct
;
import
java.util.ArrayList
;
import
java.util.List
;
@Component
public
class
StorageNameConfig
{
public
class
StorageNameConfig
{
public
static
List
<
String
>
rawMaterialList
=
new
ArrayList
<>();
@PostConstruct
public
void
initList
(){
rawMaterialList
.
add
(
rawMaterialIn01
);
rawMaterialList
.
add
(
rawMaterialIn02
);
rawMaterialList
.
add
(
rawMaterialIn03
);
rawMaterialList
.
add
(
rawMaterialIn04
);
rawMaterialList
.
add
(
rawMaterialIn05
);
rawMaterialList
.
add
(
rawMaterialIn06
);
rawMaterialList
.
add
(
rawMaterialOut01
);
rawMaterialList
.
add
(
rawMaterialOut02
);
rawMaterialList
.
add
(
rawMaterialOut03
);
rawMaterialList
.
add
(
rawMaterialOut04
);
rawMaterialList
.
add
(
rawMaterialOut05
);
rawMaterialList
.
add
(
rawMaterialOut06
);
}
public
static
List
<
String
>
getRawMaterialList
(){
return
rawMaterialList
;
}
//原材料仓货架
//原材料仓货架
public
static
final
String
rawMaterialTower
=
"raw-material-tower"
;
public
static
final
String
rawMaterialTower
=
"raw-material-tower"
;
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/kafka/service/KafkaService.java
查看文件 @
9441cab
...
@@ -6,11 +6,17 @@ import com.neotel.smfcore.core.barcode.enums.BARCODE_STATUS;
...
@@ -6,11 +6,17 @@ import com.neotel.smfcore.core.barcode.enums.BARCODE_STATUS;
import
com.neotel.smfcore.core.device.enums.OP
;
import
com.neotel.smfcore.core.device.enums.OP
;
import
com.neotel.smfcore.core.device.enums.OP_STATUS
;
import
com.neotel.smfcore.core.device.enums.OP_STATUS
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.device.util.EquipmentCache
;
import
com.neotel.smfcore.core.equipment.bean.EquipMsg
;
import
com.neotel.smfcore.core.equipment.bean.EquipStatusBean
;
import
com.neotel.smfcore.core.storage.service.manager.IStoragePosManager
;
import
com.neotel.smfcore.core.storage.service.manager.IStoragePosManager
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
import
com.neotel.smfcore.core.system.service.manager.IDataLogManager
;
import
com.neotel.smfcore.core.system.service.manager.IDataLogManager
;
import
com.neotel.smfcore.core.system.util.EquipStatusUtil
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.kafka.bean.Heartbeat
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.kafka.bean.MachineParameter
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.kafka.bean.MachineParameter
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.kafka.bean.MachineParameterData
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.kafka.bean.MachineParameterData
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.kafka.bean.MachineStatus
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.kafka.config.KafkaConfig
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.kafka.config.KafkaConfig
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.kafka.config.StorageNameConfig
;
import
com.neotel.smfcore.custom.luxsan.factory_c.rawstor.kafka.config.StorageNameConfig
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -44,6 +50,107 @@ public class KafkaService {
...
@@ -44,6 +50,107 @@ public class KafkaService {
private
IStoragePosManager
storagePosManager
;
private
IStoragePosManager
storagePosManager
;
/**
* 抛送入料机构,分拣机构的设备状态信息,每1分钟抛送一次
*/
//@Scheduled(fixedRate = 1000 * 60 * 1)
public
void
setRawMaterialInOutMachineStatus
()
{
//获取所有的设备
List
<
String
>
rawMaterialList
=
StorageNameConfig
.
getRawMaterialList
();
for
(
String
machineId
:
rawMaterialList
)
{
String
currentStatus
=
"1"
;
//正常
List
<
EquipMsg
>
equipMsgList
=
new
ArrayList
<>();
EquipStatusBean
statusBean
=
EquipStatusUtil
.
getStatusBean
(
machineId
);
if
(
statusBean
==
null
){
currentStatus
=
"5"
;
}
else
{
int
status
=
statusBean
.
getStatus
();
//状态
if
(
2
==
status
||
3
==
status
)
{
currentStatus
=
"3"
;
//故障
}
if
(
0
==
status
)
{
currentStatus
=
"5"
;
}
equipMsgList
=
statusBean
.
getMsgList
();
}
if
(
equipMsgList
!=
null
&&
!
equipMsgList
.
isEmpty
()){
for
(
EquipMsg
equipMsg
:
equipMsgList
)
{
MachineStatus
machineStatus
=
new
MachineStatus
();
String
dateStr
=
DateUtil
.
format
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss.SSS"
);
machineStatus
.
setOccurrenceTime
(
dateStr
);
machineStatus
.
setMachineID
(
machineId
);
machineStatus
.
setTopicType
(
KafkaConfig
.
MACHINESTATUS_TOPIC
);
machineStatus
.
setCurrentStatus
(
currentStatus
);
machineStatus
.
setErrorCode
(
equipMsg
.
getErrorCode
());
machineStatus
.
setErrorMsg
(
equipMsg
.
getMsg
());
machineStatus
.
setClientIP
(
""
);
String
statusStr
=
JSON
.
toJSONString
(
machineStatus
);
log
.
info
(
machineId
+
"抛送设备状态主题为:"
+
KafkaConfig
.
MACHINESTATUS_TOPIC
+
"内容为:"
+
statusStr
);
ListenableFuture
future
=
kafkaTemplate
.
send
(
KafkaConfig
.
MACHINESTATUS_TOPIC
,
statusStr
);
log
.
info
(
machineId
+
"抛送设备状态返回结果为:"
+
JSON
.
toJSONString
(
future
));
}
}
else
{
MachineStatus
machineStatus
=
new
MachineStatus
();
String
dateStr
=
DateUtil
.
format
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss.SSS"
);
machineStatus
.
setOccurrenceTime
(
dateStr
);
machineStatus
.
setMachineID
(
machineId
);
machineStatus
.
setTopicType
(
KafkaConfig
.
MACHINESTATUS_TOPIC
);
machineStatus
.
setCurrentStatus
(
currentStatus
);
machineStatus
.
setErrorCode
(
""
);
machineStatus
.
setErrorMsg
(
""
);
machineStatus
.
setClientIP
(
""
);
String
statusStr
=
JSON
.
toJSONString
(
machineStatus
);
log
.
info
(
machineId
+
"抛送设备状态主题为:"
+
KafkaConfig
.
MACHINESTATUS_TOPIC
+
"内容为:"
+
statusStr
);
ListenableFuture
future
=
kafkaTemplate
.
send
(
KafkaConfig
.
MACHINESTATUS_TOPIC
,
statusStr
);
log
.
info
(
machineId
+
"抛送设备状态返回结果为:"
+
JSON
.
toJSONString
(
future
));
}
}
}
/**
* 抛送入料机构,分拣机构的心跳,每10s抛送一次
*/
//@Scheduled(fixedRate = 1000 * 10)
public
void
setRawMaterialInOutHeartbeat
()
{
//获取所有的设备
List
<
String
>
rawMaterialList
=
StorageNameConfig
.
getRawMaterialList
();
for
(
String
machineId
:
rawMaterialList
)
{
EquipStatusBean
equipStatus
=
EquipStatusUtil
.
getStatusBean
(
machineId
);
if
(
equipStatus
!=
null
)
{
if
(!
equipStatus
.
timeOut
())
{
int
status
=
equipStatus
.
getStatus
();
//状态
String
currentStatus
=
"1"
;
//正常
if
(
2
==
status
||
3
==
status
)
{
currentStatus
=
"3"
;
//故障
}
if
(
0
==
status
)
{
currentStatus
=
"5"
;
//离线
}
if
(
"1"
.
equals
(
currentStatus
))
{
Heartbeat
heartbeat
=
new
Heartbeat
();
String
dateStr
=
DateUtil
.
format
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss.SSS"
);
heartbeat
.
setOccurrenceTime
(
dateStr
);
heartbeat
.
setMachineID
(
machineId
);
heartbeat
.
setTopicType
(
KafkaConfig
.
HEARTBEAT_TOPIC
);
String
statusStr
=
JSON
.
toJSONString
(
heartbeat
);
log
.
info
(
"出料口主题为:"
+
KafkaConfig
.
HEARTBEAT_TOPIC
+
"内容为:"
+
statusStr
);
ListenableFuture
future
=
kafkaTemplate
.
send
(
KafkaConfig
.
HEARTBEAT_TOPIC
,
statusStr
);
log
.
info
(
"出料口返回结果为:"
+
JSON
.
toJSONString
(
future
));
}
}
}
}
}
/**
* 推送原材料仓的储位,出入库信息,每5分钟抛送一次
*/
@Scheduled
(
fixedRate
=
1000
*
60
*
5
)
@Scheduled
(
fixedRate
=
1000
*
60
*
5
)
public
void
setTowerDataMachineParamter
()
{
public
void
setTowerDataMachineParamter
()
{
log
.
info
(
"开始推送原材料仓tower数据"
);
log
.
info
(
"开始推送原材料仓tower数据"
);
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/util/BoxHandleUtil.java
查看文件 @
9441cab
...
@@ -375,14 +375,7 @@ public class BoxHandleUtil {
...
@@ -375,14 +375,7 @@ public class BoxHandleUtil {
//判断信息是否在已经在库位中(出入库只改变料箱位置状态,不从StoragePos表中清除)
//判断信息是否在已经在库位中(出入库只改变料箱位置状态,不从StoragePos表中清除)
StoragePos
pos
=
storagePosManager
.
getByBarcode
(
boxBarcode
.
getBarcode
());
StoragePos
pos
=
storagePosManager
.
getByBarcode
(
boxBarcode
.
getBarcode
());
if
(
pos
!=
null
)
{
if
(
pos
!=
null
)
{
if
(
warehouseCode
.
equals
(
pos
.
getWareHouseCode
())){
return
pos
;
return
pos
;
}
else
{
log
.
info
(
barcode
+
"对应的库别为:"
+
warehouseCode
+
",与当前库位:"
+
pos
.
getPosName
()+
"的库别:"
+
pos
.
getWareHouseCode
()+
"不一致,清空原来库位"
);
pos
.
setBarcode
(
null
);
pos
.
setUsed
(
false
);
storagePosManager
.
save
(
pos
);
}
}
}
List
<
String
>
cidList
=
new
ArrayList
<>();
List
<
String
>
cidList
=
new
ArrayList
<>();
...
@@ -405,6 +398,7 @@ public class BoxHandleUtil {
...
@@ -405,6 +398,7 @@ public class BoxHandleUtil {
return
null
;
return
null
;
}
else
{
}
else
{
log
.
info
(
"料箱["
+
boxBarcode
.
getBarcode
()
+
"]信息加入库位["
+
pos
.
getPosName
()
+
"]中"
);
log
.
info
(
"料箱["
+
boxBarcode
.
getBarcode
()
+
"]信息加入库位["
+
pos
.
getPosName
()
+
"]中"
);
boxBarcode
.
setWarehouseCode
(
warehouseCode
);
pos
.
setBarcode
(
boxBarcode
);
pos
.
setBarcode
(
boxBarcode
);
pos
.
setUsed
(
true
);
pos
.
setUsed
(
true
);
storagePosManager
.
save
(
pos
);
storagePosManager
.
save
(
pos
);
...
...
src/main/resources/config/application.yml
查看文件 @
9441cab
...
@@ -33,7 +33,7 @@ lizhen:
...
@@ -33,7 +33,7 @@ lizhen:
url
:
#http://172.30.88.19:8001/smf-core/api/Mes/machineCallMaterial
url
:
#http://172.30.88.19:8001/smf-core/api/Mes/machineCallMaterial
F3
:
F3
:
name
:
3F
name
:
3F
line
:
C0
2-3FSMT-01,C02-3FSMT-03,C02-3FSMT-04,C02-3FSMT-08,C02-3FSMT-13,C02-3FSMT-14,C02-3FSMT-18,C03-1FSMT-01,C03-1FSMT-02,C03-1FSMT-11,C03-1FSMT-12
line
:
C0
3-1FSMT-01,C03-3FSMT-13,C02-3FSMT-12,C02-3FSMT-18,C02-3FSMT-19,C03-1FSMT-12,C02-3FSMT-02,C02-3FSMT-09,C02-3FSMT-11,C03-3FSMT-03,C03-1FSMT-11,C02-3FSMT-01,C03-1FSMT-02,C02-3FSMT-08,C02-3FSMT-06,C02-3FSMT-07,C02-3FSMT-17,C02-3FSMT-04,C02-3FSMT-14,C03-1FSMT-12,C02-3FSMT-05,C02-3FSMT-13,C02-3FSMT-03,C02-3FSMT-16,C03-1FSMT-02,C02-3FSMT-15
url
:
http://10.68.27.85/smf-core/wcs/machineCallMaterial
url
:
http://10.68.27.85/smf-core/wcs/machineCallMaterial
F5
:
F5
:
name
:
#5F
name
:
#5F
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论