Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit b5fa96fd
由
zshaohui
编写于
2025-06-06 17:15:33 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
1.工单出库,同步挑料箱中的信息
1 个父辈
9721d0c5
显示空白字符变更
内嵌
并排
正在显示
13 个修改的文件
包含
186 行增加
和
16 行删除
src/main/java/com/neotel/smfcore/core/barcode/rest/bean/dto/BarcodeDto.java
src/main/java/com/neotel/smfcore/core/barcode/service/po/Barcode.java
src/main/java/com/neotel/smfcore/core/device/util/DataCache.java
src/main/java/com/neotel/smfcore/core/order/LiteOrderCache.java
src/main/java/com/neotel/smfcore/core/storage/service/manager/impl/StoragePosManagerImpl.java
src/main/java/com/neotel/smfcore/core/virtual/controller/VirtualOperateController.java
src/main/resources/messages.properties
src/main/resources/messages_de_DE.properties
src/main/resources/messages_en_US.properties
src/main/resources/messages_fr_FR.properties
src/main/resources/messages_ja_JP.properties
src/main/resources/messages_zh_CN.properties
src/main/resources/messages_zh_TW.properties
src/main/java/com/neotel/smfcore/core/barcode/rest/bean/dto/BarcodeDto.java
查看文件 @
b5fa96f
...
@@ -253,4 +253,7 @@ public class BarcodeDto implements Serializable {
...
@@ -253,4 +253,7 @@ public class BarcodeDto implements Serializable {
@ApiModelProperty
(
"制造商物料编号"
)
@ApiModelProperty
(
"制造商物料编号"
)
private
String
mpn
;
private
String
mpn
;
@ApiModelProperty
(
"附加信息"
)
private
Map
<
String
,
Object
>
appendData
=
new
HashMap
<>();
}
}
src/main/java/com/neotel/smfcore/core/barcode/service/po/Barcode.java
查看文件 @
b5fa96f
...
@@ -480,6 +480,19 @@ public class Barcode extends BasePo implements Serializable {
...
@@ -480,6 +480,19 @@ public class Barcode extends BasePo implements Serializable {
return
null
;
return
null
;
}
}
public
Barcode
getSubCodeByBarcode
(
String
barcodeStr
)
{
if
(
subCodeList
==
null
)
{
return
null
;
}
for
(
Barcode
barcode
:
subCodeList
)
{
if
(
barcode
.
getBarcode
().
equals
(
barcodeStr
))
{
return
barcode
;
}
}
return
null
;
}
public
void
UpdateSubCode
(
Barcode
barcode
)
{
public
void
UpdateSubCode
(
Barcode
barcode
)
{
if
(
subCodeList
==
null
)
{
if
(
subCodeList
==
null
)
{
...
...
src/main/java/com/neotel/smfcore/core/device/util/DataCache.java
查看文件 @
b5fa96f
...
@@ -815,28 +815,36 @@ public class DataCache {
...
@@ -815,28 +815,36 @@ public class DataCache {
public
List
<
String
>
getAvailableStorageIds
()
{
public
List
<
String
>
getAvailableStorageIds
()
{
List
<
String
>
availableStorageIds
=
new
ArrayList
<>();
List
<
String
>
availableStorageIds
=
new
ArrayList
<>();
for
(
Storage
storage
:
getAllStorage
().
values
())
{
for
(
Storage
storage
:
getAllStorage
().
values
())
{
if
(!
storage
.
isVirtual
())
{
StatusBean
bean
=
DevicesStatusUtil
.
getStatusBean
(
storage
.
getCid
());
StatusBean
bean
=
DevicesStatusUtil
.
getStatusBean
(
storage
.
getCid
());
if
(
bean
==
null
||
bean
.
timeOut
()
||
!
bean
.
isAvailable
())
{
if
(
bean
==
null
||
bean
.
timeOut
()
||
!
bean
.
isAvailable
())
{
continue
;
continue
;
}
}
availableStorageIds
.
add
(
storage
.
getId
());
availableStorageIds
.
add
(
storage
.
getId
());
}
else
{
availableStorageIds
.
add
(
storage
.
getId
());
}
}
}
return
availableStorageIds
;
return
availableStorageIds
;
}
}
public
List
<
String
>
getAvailableStorageIds
(
List
<
String
>
cidList
)
{
public
List
<
String
>
getAvailableStorageIds
(
List
<
String
>
cidList
)
{
if
(
cidList
==
null
||
cidList
.
size
()<=
0
)
{
if
(
cidList
==
null
||
cidList
.
size
()
<=
0
)
{
return
getAvailableStorageIds
();
return
getAvailableStorageIds
();
}
}
List
<
String
>
availableStorageIds
=
new
ArrayList
<>();
List
<
String
>
availableStorageIds
=
new
ArrayList
<>();
for
(
Storage
storage
:
getAllStorage
().
values
())
{
for
(
Storage
storage
:
getAllStorage
().
values
())
{
if
(!
cidList
.
contains
(
storage
.
getCid
()))
{
if
(!
cidList
.
contains
(
storage
.
getCid
()))
{
continue
;
continue
;
}
}
if
(!
storage
.
isVirtual
())
{
StatusBean
bean
=
DevicesStatusUtil
.
getStatusBean
(
storage
.
getCid
());
StatusBean
bean
=
DevicesStatusUtil
.
getStatusBean
(
storage
.
getCid
());
if
(
bean
==
null
||
bean
.
timeOut
()
||
!
bean
.
isAvailable
())
{
if
(
bean
==
null
||
bean
.
timeOut
()
||
!
bean
.
isAvailable
())
{
continue
;
continue
;
}
}
availableStorageIds
.
add
(
storage
.
getId
());
availableStorageIds
.
add
(
storage
.
getId
());
}
else
{
availableStorageIds
.
add
(
storage
.
getId
());
}
}
}
return
availableStorageIds
;
return
availableStorageIds
;
}
}
...
...
src/main/java/com/neotel/smfcore/core/order/LiteOrderCache.java
查看文件 @
b5fa96f
...
@@ -9,6 +9,7 @@ import com.neotel.smfcore.common.utils.Constants;
...
@@ -9,6 +9,7 @@ import com.neotel.smfcore.common.utils.Constants;
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
;
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.Barcode
;
import
com.neotel.smfcore.core.device.bean.StatusBean
;
import
com.neotel.smfcore.core.device.bean.StatusBean
;
import
com.neotel.smfcore.core.device.enums.OP
;
import
com.neotel.smfcore.core.device.enums.OP
;
...
@@ -57,9 +58,13 @@ public class LiteOrderCache {
...
@@ -57,9 +58,13 @@ public class LiteOrderCache {
@Autowired
@Autowired
private
IStoragePosManager
storagePosManager
;
private
IStoragePosManager
storagePosManager
;
@Autowired
@Autowired
private
SmfApi
smfApi
;
private
SmfApi
smfApi
;
@Autowired
private
IBarcodeManager
barcodeManager
;
// //最大工单数
// //最大工单数
// public int MaxOrderCount=1;
// public int MaxOrderCount=1;
// public boolean SingleOrderMode(){
// public boolean SingleOrderMode(){
...
@@ -496,6 +501,9 @@ public class LiteOrderCache {
...
@@ -496,6 +501,9 @@ public class LiteOrderCache {
}
}
List
<
String
>
availableStorageIds
=
dataCache
.
getAvailableStorageIds
(
cidList
);
List
<
String
>
availableStorageIds
=
dataCache
.
getAvailableStorageIds
(
cidList
);
//需要出库的料箱信息
List
<
String
>
needOutPosId
=
new
ArrayList
<>();
boolean
shortage
=
false
;
boolean
shortage
=
false
;
//其他出库模式一次性全部生成任务
//其他出库模式一次性全部生成任务
for
(
LiteOrderItem
orderItem
:
cacheOrder
.
getOrderItems
())
{
for
(
LiteOrderItem
orderItem
:
cacheOrder
.
getOrderItems
())
{
...
@@ -548,11 +556,15 @@ public class LiteOrderCache {
...
@@ -548,11 +556,15 @@ public class LiteOrderCache {
shortage
=
true
;
shortage
=
true
;
break
;
break
;
}
else
{
}
else
{
//判断是属于料箱还是料盘
Barcode
posBarcode
=
pos
.
getBarcode
();
List
<
Barcode
>
subCodeList
=
posBarcode
.
getSubCodeList
();
if
(
subCodeList
==
null
||
subCodeList
.
isEmpty
())
{
assignNum
=
assignNum
+
pos
.
getBarcode
().
getAmount
();
assignNum
=
assignNum
+
pos
.
getBarcode
().
getAmount
();
assignReelCount
=
assignReelCount
+
1
;
assignReelCount
=
assignReelCount
+
1
;
taskReelCount
=
taskReelCount
+
1
;
taskReelCount
=
taskReelCount
+
1
;
log
.
info
(
"工单["
+
orderNo
+
"],任务数["
+
taskReelCount
+
"]出库位置仓位【"
+
pos
.
getPosName
()
+
"】RI=["
+
pos
.
getBarcode
().
getBarcode
()
+
"] PN=["
+
partNumber
+
"] num:"
+
pos
.
getBarcode
().
getAmount
());
log
.
info
(
"工单["
+
orderNo
+
"],任务数["
+
taskReelCount
+
"]出库位置仓位【"
+
pos
.
getPosName
()
+
"】RI=["
+
pos
.
getBarcode
().
getBarcode
()
+
"] PN=["
+
partNumber
+
"] num:"
+
pos
.
getBarcode
().
getAmount
());
DataLog
task
=
newTask
(
pos
)
;
DataLog
task
=
newTask
(
pos
)
;
task
.
setSourceId
(
cacheOrder
.
getId
());
task
.
setSourceId
(
cacheOrder
.
getId
());
task
.
setSourceName
(
cacheOrder
.
getOrderNo
());
task
.
setSourceName
(
cacheOrder
.
getOrderNo
());
...
@@ -565,6 +577,37 @@ public class LiteOrderCache {
...
@@ -565,6 +577,37 @@ public class LiteOrderCache {
task
.
setLine
(
cacheOrder
.
getLine
());
task
.
setLine
(
cacheOrder
.
getLine
());
// task = dataLogDao.save(task);
// task = dataLogDao.save(task);
taskService
.
addTaskToExecute
(
task
);
taskService
.
addTaskToExecute
(
task
);
}
else
{
Barcode
subCode
=
null
;
if
(!
Strings
.
isNullOrEmpty
(
reelId
))
{
subCode
=
posBarcode
.
getSubCodeByBarcode
(
reelId
);
}
else
if
(
Strings
.
isNullOrEmpty
(
reelId
)
&&
!
Strings
.
isNullOrEmpty
(
partNumber
))
{
subCode
=
posBarcode
.
getSubCode
(
partNumber
);
}
if
(
subCode
!=
null
)
{
//设置出库数量
int
amount
=
subCode
.
getAmount
();
int
awaitingNum
=
remainNum
-
assignNum
;
if
(
awaitingNum
-
amount
>=
0
)
{
assignNum
=
assignNum
+
amount
;
subCode
.
updateAppendData
(
"awaiting"
,
amount
);
}
else
{
subCode
.
updateAppendData
(
"awaiting"
,
amount
-
awaitingNum
);
assignNum
=
assignNum
+
amount
-
awaitingNum
;
}
assignReelCount
=
assignReelCount
+
1
;
taskReelCount
=
taskReelCount
+
1
;
subCode
.
updateAppendData
(
"orderItemId"
,
orderItem
.
getId
());
subCode
.
updateAppendData
(
"orderNo"
,
cacheOrder
.
getOrderNo
());
subCode
.
updateAppendData
(
"orderId"
,
cacheOrder
.
getId
());
posBarcode
.
UpdateSubCode
(
subCode
);
barcodeManager
.
save
(
subCode
);
barcodeManager
.
save
(
posBarcode
);
pos
.
setBarcode
(
posBarcode
);
storagePosManager
.
save
(
pos
);
needOutPosId
.
add
(
pos
.
getId
());
}
}
}
}
//如果是RI出库,只有一盘,出完就结束
//如果是RI出库,只有一盘,出完就结束
if
(!
Strings
.
isNullOrEmpty
(
reelId
)){
if
(!
Strings
.
isNullOrEmpty
(
reelId
)){
...
@@ -575,6 +618,24 @@ public class LiteOrderCache {
...
@@ -575,6 +618,24 @@ public class LiteOrderCache {
}
}
if
(
needOutPosId
!=
null
&&
!
needOutPosId
.
isEmpty
())
{
needOutPosId
=
needOutPosId
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
for
(
String
posId
:
needOutPosId
)
{
StoragePos
pos
=
storagePosManager
.
get
(
posId
);
DataLog
task
=
newTask
(
pos
);
task
.
setSourceName
(
cacheOrder
.
getOrderNo
());
task
.
setSourceId
(
cacheOrder
.
getId
());
task
.
setType
(
OP
.
CHECKOUT
);
task
.
setLightColor
(
nextColor
.
getRgb
());
task
.
setStatus
(
OP_STATUS
.
WAIT
.
name
());
task
.
setSingleOut
(
singleOut
);
task
.
setLine
(
cacheOrder
.
getLine
());
taskService
.
addTaskToExecute
(
task
);
taskReelCount
=
taskReelCount
+
1
;
}
}
if
(
shortage
){
if
(
shortage
){
cacheOrder
.
addAppendDate
(
"shortage"
,
"true"
);
cacheOrder
.
addAppendDate
(
"shortage"
,
"true"
);
}
else
{
}
else
{
...
...
src/main/java/com/neotel/smfcore/core/storage/service/manager/impl/StoragePosManagerImpl.java
查看文件 @
b5fa96f
...
@@ -230,8 +230,12 @@ public class StoragePosManagerImpl implements IStoragePosManager {
...
@@ -230,8 +230,12 @@ public class StoragePosManagerImpl implements IStoragePosManager {
}
}
@Override
@Override
public
StoragePos
getByBarcode
(
String
barcode
){
public
StoragePos
getByBarcode
(
String
barcode
)
{
return
storagePosDao
.
findOneByCondition
(
new
String
[]{
"barcode.barcode"
},
new
String
[]{
barcode
});
List
<
Criteria
>
orCriterialList
=
Lists
.
newArrayList
();
orCriterialList
.
add
(
Criteria
.
where
(
"barcode.barcode"
).
is
(
barcode
));
orCriterialList
.
add
(
Criteria
.
where
(
"barcode.subCodeList.barcode"
).
is
(
barcode
));
Criteria
c
=
new
Criteria
().
orOperator
(
orCriterialList
);
return
storagePosDao
.
findOne
(
new
Query
(
c
));
}
}
@Override
@Override
...
@@ -286,8 +290,7 @@ public class StoragePosManagerImpl implements IStoragePosManager {
...
@@ -286,8 +290,7 @@ public class StoragePosManagerImpl implements IStoragePosManager {
String
regex
=
"^"
+
escapeExprSpecialWord
(
pn
.
toString
())+
".*"
;
String
regex
=
"^"
+
escapeExprSpecialWord
(
pn
.
toString
())+
".*"
;
Pattern
pattern
=
Pattern
.
compile
(
regex
);
Pattern
pattern
=
Pattern
.
compile
(
regex
);
Criteria
c
=
Criteria
.
where
(
"barcode.partNumber"
).
regex
(
pattern
)
Criteria
c
=
Criteria
.
where
(
"id"
).
nin
(
excludePosIds
)
.
and
(
"id"
).
nin
(
excludePosIds
)
.
and
(
"enabled"
).
is
(
true
)
//可用
.
and
(
"enabled"
).
is
(
true
)
//可用
.
and
(
"barcode.lockId"
).
is
(
null
);
//没有被锁定的仓位;
.
and
(
"barcode.lockId"
).
is
(
null
);
//没有被锁定的仓位;
if
(
storageIdList
!=
null
)
{
if
(
storageIdList
!=
null
)
{
...
@@ -297,6 +300,13 @@ public class StoragePosManagerImpl implements IStoragePosManager {
...
@@ -297,6 +300,13 @@ public class StoragePosManagerImpl implements IStoragePosManager {
c
.
and
(
"labelId"
).
is
(
labelId
);
c
.
and
(
"labelId"
).
is
(
labelId
);
}
}
c
=
addAppendData
(
c
,
appendDate
);
c
=
addAppendData
(
c
,
appendDate
);
//从料箱/料盘中查
List
<
Criteria
>
orCriterialList
=
Lists
.
newArrayList
();
orCriterialList
.
add
(
Criteria
.
where
(
"barcode.partNumber"
).
regex
(
pattern
));
orCriterialList
.
add
(
Criteria
.
where
(
"barcode.subCodeList.partNumber"
).
regex
(
pattern
));
c
.
orOperator
(
orCriterialList
);
Query
q
=
new
Query
(
c
);
Query
q
=
new
Query
(
c
);
Sort
sort
=
getSortByCheckOutType
(
checkOutType
);
Sort
sort
=
getSortByCheckOutType
(
checkOutType
);
q
.
with
(
sort
);
q
.
with
(
sort
);
...
...
src/main/java/com/neotel/smfcore/core/virtual/controller/VirtualOperateController.java
查看文件 @
b5fa96f
...
@@ -156,7 +156,7 @@ public class VirtualOperateController {
...
@@ -156,7 +156,7 @@ public class VirtualOperateController {
}
}
subBarcode
.
setPutInTime
(
System
.
currentTimeMillis
());
subBarcode
.
setPutInTime
(
System
.
currentTimeMillis
());
subBarcode
=
barcodeManager
.
save
(
subBarcode
);
subBarcode
=
barcodeManager
.
save
(
subBarcode
);
barcode
=
finishTask
(
barcode
,
opType
,
subBarcode
,
opQty
);
barcode
=
finishTask
(
barcode
,
opType
,
subBarcode
,
opQty
,
OP_STATUS
.
FINISHED
.
name
()
);
log
.
info
(
"条码"
+
subBarcode
.
getBarcode
()
+
"["
+
subBarcode
.
getPartNumber
()
+
"]入库到料盒["
+
barcode
.
getBarcode
()
+
"]数量:"
+
barcode
.
getAmount
());
log
.
info
(
"条码"
+
subBarcode
.
getBarcode
()
+
"["
+
subBarcode
.
getPartNumber
()
+
"]入库到料盒["
+
barcode
.
getBarcode
()
+
"]数量:"
+
barcode
.
getAmount
());
}
else
if
(
"ri"
.
equals
(
putInType
))
{
}
else
if
(
"ri"
.
equals
(
putInType
))
{
//解析条码
//解析条码
...
@@ -164,17 +164,28 @@ public class VirtualOperateController {
...
@@ -164,17 +164,28 @@ public class VirtualOperateController {
if
(
subCode
==
null
)
{
if
(
subCode
==
null
)
{
throw
new
ValidateException
(
"smfcore.error.barcode.invalid"
,
"{0}不是有效的条码"
,
new
String
[]{
operageStr
});
throw
new
ValidateException
(
"smfcore.error.barcode.invalid"
,
"{0}不是有效的条码"
,
new
String
[]{
operageStr
});
}
}
String
hostBarcodeId
=
subCode
.
getHostBarcodeId
();
String
hostBarcodeId
=
subCode
.
getHostBarcodeId
();
if
(
StringUtils
.
isNotEmpty
(
hostBarcodeId
))
{
if
(
StringUtils
.
isNotEmpty
(
hostBarcodeId
))
{
if
(!
hostBarcodeId
.
equals
(
barcode
.
getId
()))
{
if
(!
hostBarcodeId
.
equals
(
barcode
.
getId
()))
{
throw
new
ValidateException
(
"smfcore.materialBox.inOtherBox"
,
"物料已在料盒{0}中"
,
new
String
[]{
barcode
.
getBarcode
()});
Barcode
hostBarcode
=
barcodeManager
.
get
(
hostBarcodeId
);
if
(
hostBarcode
!=
null
)
{
throw
new
ValidateException
(
"smfcore.materialBox.inOtherBox"
,
"物料已在料盒{0}中"
,
new
String
[]{
hostBarcode
.
getBarcode
()});
}
}
}
}
//判断物料是否存在料箱中
String
posName
=
subCode
.
getPosName
();
if
(
StringUtils
.
isNotEmpty
(
posName
))
{
throw
new
ValidateException
(
"smfcore.materialBox.inPos"
,
"物料已在库位{0}中"
,
new
String
[]{
posName
});
}
}
subCode
.
setHostBarcodeId
(
barcode
.
getId
());
subCode
.
setHostBarcodeId
(
barcode
.
getId
());
subCode
.
setAmount
(
opQty
);
subCode
.
setAmount
(
opQty
);
subCode
.
setPutInTime
(
System
.
currentTimeMillis
());
subCode
.
setPutInTime
(
System
.
currentTimeMillis
());
barcodeManager
.
saveBarcode
(
subCode
);
barcodeManager
.
saveBarcode
(
subCode
);
barcode
=
finishTask
(
barcode
,
opType
,
subCode
,
opQty
);
barcode
=
finishTask
(
barcode
,
opType
,
subCode
,
opQty
,
OP_STATUS
.
FINISHED
.
name
()
);
log
.
info
(
"条码"
+
subCode
.
getBarcode
()
+
"["
+
subCode
.
getPartNumber
()
+
"]入库到料盒["
+
barcode
.
getBarcode
()
+
"]数量:"
+
barcode
.
getAmount
());
log
.
info
(
"条码"
+
subCode
.
getBarcode
()
+
"["
+
subCode
.
getPartNumber
()
+
"]入库到料盒["
+
barcode
.
getBarcode
()
+
"]数量:"
+
barcode
.
getAmount
());
}
}
return
ResultBean
.
newOkResult
(
barcodeMapper
.
toDto
(
barcode
));
return
ResultBean
.
newOkResult
(
barcodeMapper
.
toDto
(
barcode
));
...
@@ -192,6 +203,11 @@ public class VirtualOperateController {
...
@@ -192,6 +203,11 @@ public class VirtualOperateController {
if
(
barcode
==
null
)
{
if
(
barcode
==
null
)
{
throw
new
ValidateException
(
"smfcore.error.barcode.invalid"
,
"{0}不是有效的条码"
,
new
String
[]{
code
});
throw
new
ValidateException
(
"smfcore.error.barcode.invalid"
,
"{0}不是有效的条码"
,
new
String
[]{
code
});
}
}
//判断是否还在库位中
String
posName
=
barcode
.
getPosName
();
if
(
StringUtils
.
isNotEmpty
(
posName
))
{
throw
new
ValidateException
(
"smfcore.virtual.boxInPos"
,
"[{0}]已在库位[{1}]中,请先取出"
,
new
String
[]{
barcode
.
getBarcode
(),
posName
});
}
int
opQty
=
Integer
.
valueOf
(
amountStr
);
int
opQty
=
Integer
.
valueOf
(
amountStr
);
int
opType
=
OP
.
NON_OP
;
int
opType
=
OP
.
NON_OP
;
if
(
opQty
>
0
)
{
if
(
opQty
>
0
)
{
...
@@ -200,6 +216,7 @@ public class VirtualOperateController {
...
@@ -200,6 +216,7 @@ public class VirtualOperateController {
//请输入正确的数量
//请输入正确的数量
throw
new
ValidateException
(
"smfcore.materialBox.qtyError"
,
"请输入正确的数量"
);
throw
new
ValidateException
(
"smfcore.materialBox.qtyError"
,
"请输入正确的数量"
);
}
}
//判断是pn还是ri出
//判断是pn还是ri出
if
(
"pn"
.
equals
(
checkOutType
))
{
if
(
"pn"
.
equals
(
checkOutType
))
{
//查看该库位中是否有相同的物料,有的话,数量累加
//查看该库位中是否有相同的物料,有的话,数量累加
...
@@ -211,11 +228,17 @@ public class VirtualOperateController {
...
@@ -211,11 +228,17 @@ public class VirtualOperateController {
if
(
oldAmount
<
opQty
)
{
if
(
oldAmount
<
opQty
)
{
throw
new
ValidateException
(
"smfcore.materialBox.quantityshort"
,
"物料数量不足"
);
throw
new
ValidateException
(
"smfcore.materialBox.quantityshort"
,
"物料数量不足"
);
}
}
Integer
awaitingNum
=
subBarcode
.
getAppendData
(
"awaiting"
);
if
(
awaitingNum
!=
null
)
{
if
(
opQty
<
awaitingNum
)
{
throw
new
ValidateException
(
"smfcore.virtual.quantityError"
,
"取出数量应为[{0}]"
,
new
String
[]{
awaitingNum
+
""
});
}
}
int
newAmount
=
oldAmount
-
opQty
;
int
newAmount
=
oldAmount
-
opQty
;
subBarcode
.
setHostBarcodeId
(
barcode
.
getId
());
subBarcode
.
setHostBarcodeId
(
barcode
.
getId
());
subBarcode
.
setAmount
(
newAmount
);
subBarcode
.
setAmount
(
newAmount
);
subBarcode
=
barcodeManager
.
save
(
subBarcode
);
subBarcode
=
barcodeManager
.
save
(
subBarcode
);
barcode
=
finishTask
(
barcode
,
opType
,
subBarcode
,
opQty
);
barcode
=
finishTask
(
barcode
,
opType
,
subBarcode
,
opQty
,
OP_STATUS
.
FINISHED
.
name
()
);
log
.
info
(
subBarcode
.
getPartNumber
()
+
"从料盒["
+
barcode
.
getPosName
()
+
"]出库,物料数量:"
+
oldAmount
+
" - "
+
opQty
+
" = "
+
newAmount
);
log
.
info
(
subBarcode
.
getPartNumber
()
+
"从料盒["
+
barcode
.
getPosName
()
+
"]出库,物料数量:"
+
oldAmount
+
" - "
+
opQty
+
" = "
+
newAmount
);
}
else
if
(
"ri"
.
equals
(
checkOutType
))
{
}
else
if
(
"ri"
.
equals
(
checkOutType
))
{
CodeBean
codeBean
=
codeResolve
.
resolveSingleCode
(
"=1x1="
+
operageStr
);
CodeBean
codeBean
=
codeResolve
.
resolveSingleCode
(
"=1x1="
+
operageStr
);
...
@@ -238,9 +261,16 @@ public class VirtualOperateController {
...
@@ -238,9 +261,16 @@ public class VirtualOperateController {
if
(
qty
<
0
)
{
if
(
qty
<
0
)
{
qty
=
0
;
qty
=
0
;
}
}
Integer
awaitingNum
=
subBarcode
.
getAppendData
(
"awaiting"
);
if
(
awaitingNum
!=
null
)
{
if
(
opQty
<
awaitingNum
)
{
throw
new
ValidateException
(
"smfcore.virtual.quantityError"
,
"取出数量应为[{0}]"
,
new
String
[]{
awaitingNum
+
""
});
}
}
//出库
//出库
subBarcode
.
setAmount
(
qty
);
subBarcode
.
setAmount
(
qty
);
finishTask
(
barcode
,
OP
.
CHECKOUT
,
subBarcode
,
qty
);
subBarcode
=
barcodeManager
.
save
(
subBarcode
);
finishTask
(
barcode
,
OP
.
CHECKOUT
,
subBarcode
,
opQty
,
OP_STATUS
.
FINISHED
.
name
());
log
.
info
(
"条码"
+
subBarcode
.
getBarcode
()
+
"["
+
subBarcode
.
getPartNumber
()
+
"]从料盒["
+
barcode
.
getBarcode
()
+
"]出库,数量:"
+
qty
);
log
.
info
(
"条码"
+
subBarcode
.
getBarcode
()
+
"["
+
subBarcode
.
getPartNumber
()
+
"]从料盒["
+
barcode
.
getBarcode
()
+
"]出库,数量:"
+
qty
);
}
}
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
...
@@ -278,6 +308,17 @@ public class VirtualOperateController {
...
@@ -278,6 +308,17 @@ public class VirtualOperateController {
throw
new
ValidateException
(
"smfcore.pos.noVirtual"
,
"[{0}]不是虚拟仓的库位"
,
new
String
[]{
posNameStr
});
throw
new
ValidateException
(
"smfcore.pos.noVirtual"
,
"[{0}]不是虚拟仓的库位"
,
new
String
[]{
posNameStr
});
}
}
barcode
.
setDescribe
(
describe
);
barcode
.
setDescribe
(
describe
);
List
<
Barcode
>
subCodeList
=
barcode
.
getSubCodeList
();
if
(
subCodeList
!=
null
&&
!
subCodeList
.
isEmpty
())
{
for
(
Barcode
subCode
:
subCodeList
)
{
Integer
awaiting
=
subCode
.
getAppendData
(
"awaiting"
);
if
(
awaiting
!=
null
)
{
barcode
=
finishTask
(
barcode
,
OP
.
CHECKOUT
,
subCode
,
awaiting
,
OP_STATUS
.
CANCEL
.
name
());
}
}
}
//开始入库
//开始入库
taskService
.
addTaskToFinished
(
pos
,
barcode
,
SecurityUtils
.
getLoginUsername
());
taskService
.
addTaskToFinished
(
pos
,
barcode
,
SecurityUtils
.
getLoginUsername
());
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
...
@@ -331,11 +372,12 @@ public class VirtualOperateController {
...
@@ -331,11 +372,12 @@ public class VirtualOperateController {
if
(
oldAmount
<
opQty
)
{
if
(
oldAmount
<
opQty
)
{
throw
new
ValidateException
(
"smfcore.materialBox.quantityshort"
,
"物料数量不足"
);
throw
new
ValidateException
(
"smfcore.materialBox.quantityshort"
,
"物料数量不足"
);
}
}
int
newAmount
=
oldAmount
-
opQty
;
int
newAmount
=
oldAmount
-
opQty
;
subBarcode
.
setAmount
(
newAmount
);
subBarcode
.
setAmount
(
newAmount
);
subBarcode
=
barcodeManager
.
save
(
subBarcode
);
subBarcode
=
barcodeManager
.
save
(
subBarcode
);
finishTask
(
barcode
,
OP
.
CHECKOUT
,
subBarcode
,
opQty
);
finishTask
(
barcode
,
OP
.
CHECKOUT
,
subBarcode
,
opQty
,
OP_STATUS
.
FINISHED
.
name
()
);
log
.
info
(
subBarcode
.
getPartNumber
()
+
"从料盒["
+
barcode
.
getPosName
()
+
"]出库,物料数量:"
+
oldAmount
+
" - "
+
opQty
+
" = "
+
newAmount
);
log
.
info
(
subBarcode
.
getPartNumber
()
+
"从料盒["
+
barcode
.
getPosName
()
+
"]出库,物料数量:"
+
oldAmount
+
" - "
+
opQty
+
" = "
+
newAmount
);
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
...
@@ -446,7 +488,17 @@ public class VirtualOperateController {
...
@@ -446,7 +488,17 @@ public class VirtualOperateController {
* @throws ValidateException*/
* @throws ValidateException*/
private
Barcode
finishTask
(
Barcode
pidBarcode
,
int
opType
,
Barcode
subBarcode
,
int
opQty
)
throws
ValidateException
{
private
Barcode
finishTask
(
Barcode
pidBarcode
,
int
opType
,
Barcode
subBarcode
,
int
opQty
,
String
status
)
throws
ValidateException
{
String
orderItemId
=
subBarcode
.
getAppendData
(
"orderItemId"
);
String
orderNo
=
subBarcode
.
getAppendData
(
"orderNo"
);
String
orderId
=
subBarcode
.
getAppendData
(
"orderId"
);
subBarcode
.
updateAppendData
(
"orderItemId"
,
null
);
subBarcode
.
updateAppendData
(
"orderNo"
,
null
);
subBarcode
.
updateAppendData
(
"orderId"
,
null
);
subBarcode
.
updateAppendData
(
"awaiting"
,
null
);
barcodeManager
.
save
(
subBarcode
);
//更新barcode缓存
//更新barcode缓存
pidBarcode
.
UpdateSubCode
(
subBarcode
);
pidBarcode
.
UpdateSubCode
(
subBarcode
);
if
(
opType
==
OP
.
CHECKOUT
&&
subBarcode
.
getAmount
()
<=
0
)
{
if
(
opType
==
OP
.
CHECKOUT
&&
subBarcode
.
getAmount
()
<=
0
)
{
...
@@ -455,7 +507,7 @@ public class VirtualOperateController {
...
@@ -455,7 +507,7 @@ public class VirtualOperateController {
}
}
barcodeManager
.
saveBarcode
(
pidBarcode
);
barcodeManager
.
saveBarcode
(
pidBarcode
);
DataLog
task
=
new
DataLog
();
DataLog
task
=
new
DataLog
();
task
.
setStatus
(
OP_STATUS
.
FINISHED
.
name
()
);
task
.
setStatus
(
status
);
task
.
setPartNumber
(
subBarcode
.
getPartNumber
());
task
.
setPartNumber
(
subBarcode
.
getPartNumber
());
task
.
setBarcode
(
subBarcode
.
getBarcode
());
task
.
setBarcode
(
subBarcode
.
getBarcode
());
task
.
setNum
(
opQty
);
task
.
setNum
(
opQty
);
...
@@ -468,8 +520,17 @@ public class VirtualOperateController {
...
@@ -468,8 +520,17 @@ public class VirtualOperateController {
task
.
setPosName
(
pidBarcode
.
getBarcode
());
task
.
setPosName
(
pidBarcode
.
getBarcode
());
task
.
setOperator
(
SecurityUtils
.
getLoginUsername
());
task
.
setOperator
(
SecurityUtils
.
getLoginUsername
());
task
.
setSourceType
(
BARCODE_SOURCE
.
VIRTUAL
);
task
.
setSourceType
(
BARCODE_SOURCE
.
VIRTUAL
);
if
(
StringUtils
.
isNotEmpty
(
orderItemId
)){
task
.
setSubSourceId
(
orderItemId
);
}
if
(
StringUtils
.
isNotEmpty
(
orderNo
)){
task
.
setSourceName
(
orderNo
);
}
if
(
StringUtils
.
isNotEmpty
(
orderId
)){
task
.
setSourceId
(
orderId
);
}
task
=
dataLogManager
.
save
(
task
);
task
=
dataLogManager
.
save
(
task
);
taskService
.
moveTaskToFinished
(
task
);
taskService
.
updateFinishedTask
(
task
);
return
pidBarcode
;
return
pidBarcode
;
}
}
...
...
src/main/resources/messages.properties
查看文件 @
b5fa96f
...
@@ -432,3 +432,5 @@ smfcore.virtualManager=\u865A\u62DF\u4ED3\u7BA1\u7406
...
@@ -432,3 +432,5 @@ smfcore.virtualManager=\u865A\u62DF\u4ED3\u7BA1\u7406
smfcore.virtualLocationManager
=
\u
865A
\u
62DF
\u
5E93
\u
4F4D
\u
7BA1
\u7406
smfcore.virtualLocationManager
=
\u
865A
\u
62DF
\u
5E93
\u
4F4D
\u
7BA1
\u7406
smfcore.virtualOperations
=
\u
865A
\u
62DF
\u
4ED3
\u
64CD
\u
4F5C
smfcore.virtualOperations
=
\u
865A
\u
62DF
\u
4ED3
\u
64CD
\u
4F5C
smfcore.equipment.view.ncgroup
=
Neo Counter
smfcore.equipment.view.ncgroup
=
Neo Counter
smfcore.virtual.boxInPos
=
[{0}]
\u
5DF2
\u5728\u
5E93
\u
4F4D[{1}]
\u
4E2D,
\u
8BF7
\u5148\u
53D6
\u
51FA
smfcore.virtual.quantityError
=
\u
53D6
\u
51FA
\u6570\u
91CF
\u
5E94
\u
4E3A[{0}]
\ No newline at end of file
\ No newline at end of file
src/main/resources/messages_de_DE.properties
查看文件 @
b5fa96f
...
@@ -422,3 +422,5 @@ smfcore.virtualManager=Verwaltung des virtuellen Lagers
...
@@ -422,3 +422,5 @@ smfcore.virtualManager=Verwaltung des virtuellen Lagers
smfcore.virtualLocationManager
=
Verwaltung virtueller Lagerpl
\u
00E4tze
smfcore.virtualLocationManager
=
Verwaltung virtueller Lagerpl
\u
00E4tze
smfcore.virtualOperations
=
Vorg
\u
00E4nge im virtuellen Lager
smfcore.virtualOperations
=
Vorg
\u
00E4nge im virtuellen Lager
smfcore.equipment.view.ncgroup
=
Neo Counter
smfcore.equipment.view.ncgroup
=
Neo Counter
smfcore.virtual.boxInPos
=
[{0}] befindet sich bereits im Lagerplatz [{1}]. Bitte entnehmen Sie es zuerst
smfcore.virtual.quantityError
=
Die zu entnehmende Menge sollte [{0}] betragen
\ No newline at end of file
\ No newline at end of file
src/main/resources/messages_en_US.properties
查看文件 @
b5fa96f
...
@@ -423,3 +423,5 @@ smfcore.virtualManager=Virtual Storage Mgmt
...
@@ -423,3 +423,5 @@ smfcore.virtualManager=Virtual Storage Mgmt
smfcore.virtualLocationManager
=
Virtual Location Mgmt
smfcore.virtualLocationManager
=
Virtual Location Mgmt
smfcore.virtualOperations
=
Virtual Storage Op
smfcore.virtualOperations
=
Virtual Storage Op
smfcore.equipment.view.ncgroup
=
Neo Counter
smfcore.equipment.view.ncgroup
=
Neo Counter
smfcore.virtual.boxInPos
=
[{0}] is already in location [{1}]. Please remove it first
smfcore.virtual.quantityError
=
The quantity to be removed should be [{0}]
\ No newline at end of file
\ No newline at end of file
src/main/resources/messages_fr_FR.properties
查看文件 @
b5fa96f
...
@@ -422,3 +422,5 @@ smfcore.virtualManager=Gestion de l'entrep\u00F4t virtuel
...
@@ -422,3 +422,5 @@ smfcore.virtualManager=Gestion de l'entrep\u00F4t virtuel
smfcore.virtualLocationManager
=
Gestion des emplacements virtuels
smfcore.virtualLocationManager
=
Gestion des emplacements virtuels
smfcore.virtualOperations
=
Op
\u
00E9rations de l'entrep
\u
00F4t virtuel
smfcore.virtualOperations
=
Op
\u
00E9rations de l'entrep
\u
00F4t virtuel
smfcore.equipment.view.ncgroup
=
Neo Counter
smfcore.equipment.view.ncgroup
=
Neo Counter
smfcore.virtual.boxInPos
=
[{0}] est d
\u
00E9j
\u
00E0 dans l'emplacement [{1}]. Veuillez d'abord le retirer
smfcore.virtual.quantityError
=
La quantit
\u
00E9
\u
00E0 retirer doit
\u
00EAtre [{0}]
\ No newline at end of file
\ No newline at end of file
src/main/resources/messages_ja_JP.properties
查看文件 @
b5fa96f
...
@@ -419,3 +419,5 @@ smfcore.virtualManager=\u4EEE\u60F3\u5009\u5EAB\u7BA1\u7406
...
@@ -419,3 +419,5 @@ smfcore.virtualManager=\u4EEE\u60F3\u5009\u5EAB\u7BA1\u7406
smfcore.virtualLocationManager
=
\u
4EEE
\u
60F3
\u
30ED
\u
30B1
\u
30FC
\u
30B7
\u
30E7
\u
30F3
\u
7BA1
\u7406
smfcore.virtualLocationManager
=
\u
4EEE
\u
60F3
\u
30ED
\u
30B1
\u
30FC
\u
30B7
\u
30E7
\u
30F3
\u
7BA1
\u7406
smfcore.virtualOperations
=
\u
4EEE
\u
60F3
\u5009\u
5EAB
\u
64CD
\u
4F5C
smfcore.virtualOperations
=
\u
4EEE
\u
60F3
\u5009\u
5EAB
\u
64CD
\u
4F5C
smfcore.equipment.view.ncgroup
=
Neo Counter
smfcore.equipment.view.ncgroup
=
Neo Counter
smfcore.virtual.boxInPos
=
[{0}]
\u
306F
\u
65E2
\u
306B
\u
30ED
\u
30B1
\u
30FC
\u
30B7
\u
30E7
\u
30F3 [{1}]
\u
306B
\u3042\u
308A
\u
307E
\u3059\u3002\u5148\u
306B
\u
53D6
\u
308A
\u
51FA
\u3057\u3066\u
304F
\u3060\u3055\u3044
smfcore.virtual.quantityError
=
\u
53D6
\u
308A
\u
51FA
\u3057\u6570\u
91CF
\u
306F[{0}]
\u3067\u3042\u
308B
\u
5FC5
\u8981\u
304C
\u3042\u
308A
\u
307E
\u3059
\ No newline at end of file
\ No newline at end of file
src/main/resources/messages_zh_CN.properties
查看文件 @
b5fa96f
...
@@ -419,3 +419,5 @@ smfcore.virtualManager=\u865A\u62DF\u4ED3\u7BA1\u7406
...
@@ -419,3 +419,5 @@ smfcore.virtualManager=\u865A\u62DF\u4ED3\u7BA1\u7406
smfcore.virtualLocationManager
=
\u
865A
\u
62DF
\u
5E93
\u
4F4D
\u
7BA1
\u7406
smfcore.virtualLocationManager
=
\u
865A
\u
62DF
\u
5E93
\u
4F4D
\u
7BA1
\u7406
smfcore.virtualOperations
=
\u
865A
\u
62DF
\u
4ED3
\u
64CD
\u
4F5C
smfcore.virtualOperations
=
\u
865A
\u
62DF
\u
4ED3
\u
64CD
\u
4F5C
smfcore.equipment.view.ncgroup
=
Neo Counter
smfcore.equipment.view.ncgroup
=
Neo Counter
smfcore.virtual.boxInPos
=
[{0}]
\u
5DF2
\u5728\u
5E93
\u
4F4D[{1}]
\u
4E2D,
\u
8BF7
\u5148\u
53D6
\u
51FA
smfcore.virtual.quantityError
=
\u
53D6
\u
51FA
\u6570\u
91CF
\u
5E94
\u
4E3A[{0}]
\ No newline at end of file
\ No newline at end of file
src/main/resources/messages_zh_TW.properties
查看文件 @
b5fa96f
...
@@ -419,3 +419,5 @@ smfcore.virtualManager=\u865B\u64EC\u5009\u7BA1\u7406
...
@@ -419,3 +419,5 @@ smfcore.virtualManager=\u865B\u64EC\u5009\u7BA1\u7406
smfcore.virtualLocationManager
=
\u
865B
\u
64EC
\u
5EAB
\u
4F4D
\u
7BA1
\u7406
smfcore.virtualLocationManager
=
\u
865B
\u
64EC
\u
5EAB
\u
4F4D
\u
7BA1
\u7406
smfcore.virtualOperations
=
\u
865B
\u
64EC
\u5009\u
64CD
\u
4F5C
smfcore.virtualOperations
=
\u
865B
\u
64EC
\u5009\u
64CD
\u
4F5C
smfcore.equipment.view.ncgroup
=
Neo Counter
smfcore.equipment.view.ncgroup
=
Neo Counter
smfcore.virtual.boxInPos
=
[{0}]
\u
5DF2
\u5728\u
5EAB
\u
4F4D[{1}]
\u
4E2D,
\u
8ACB
\u5148\u
53D6
\u
51FA
smfcore.virtual.quantityError
=
\u
53D6
\u
51FA
\u6578\u
91CF
\u
61C9
\u
70BA[{0}]
\ No newline at end of file
\ No newline at end of file
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论