Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 5f3615fb
由
zshaohui
编写于
2024-08-20 18:04:53 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.UID出库 接口拆分
2.手动入库 bug修改,库位名信息 3.看板 完成/取消 的任务 不展示
1 个父辈
3fa505cd
显示空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
565 行增加
和
11 行删除
src/main/java/com/neotel/smfcore/core/barcode/rest/bean/dto/BarcodeDto.java
src/main/java/com/neotel/smfcore/core/kanban/rest/BoxKanbanController.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/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/core/barcode/rest/bean/dto/BarcodeDto.java
查看文件 @
5f3615f
...
@@ -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/kanban/rest/BoxKanbanController.java
查看文件 @
5f3615f
...
@@ -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
;
...
...
src/main/java/com/neotel/smfcore/core/storage/rest/StoragePosController.java
查看文件 @
5f3615f
...
@@ -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"
)
...
...
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
查看文件 @
5f3615f
...
@@ -256,6 +256,7 @@ public class TaskService {
...
@@ -256,6 +256,7 @@ 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
)
{
if
(!
task
.
isFinished
()
&&
!
task
.
isCancel
())
{
String
barcode
=
taskToExecute
.
getBarcode
();
String
barcode
=
taskToExecute
.
getBarcode
();
String
posName
=
taskToExecute
.
getPosName
();
String
posName
=
taskToExecute
.
getPosName
();
if
(
task
.
getType
()
==
taskToExecute
.
getType
())
{
if
(
task
.
getType
()
==
taskToExecute
.
getType
())
{
...
@@ -268,6 +269,7 @@ public class TaskService {
...
@@ -268,6 +269,7 @@ public class TaskService {
}
}
}
}
}
}
}
updateQueueTask
(
taskToExecute
);
updateQueueTask
(
taskToExecute
);
}
}
...
@@ -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
()
+
"]取消成功"
);
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/manual/ManualGrPutInController.java
查看文件 @
5f3615f
...
@@ -208,7 +208,7 @@ public class ManualGrPutInController {
...
@@ -208,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
)
{
...
@@ -391,7 +391,7 @@ public class ManualGrPutInController {
...
@@ -391,7 +391,7 @@ 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
());
...
...
src/main/java/com/neotel/smfcore/custom/luxsan/factory_c/rawstor/controller/station/StationController.java
0 → 100644
查看文件 @
5f3615f
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
;
}
}
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论