Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 6adc0672
由
LN
编写于
2021-10-25 10:49:30 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
手动出库功能
1 个父辈
94b2abde
显示空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
237 行增加
和
100 行删除
src/main/java/com/neotel/smfcore/core/barcode/bean/BarcodeRule.java
src/main/java/com/neotel/smfcore/core/barcode/rest/bean/dto/CodeDto.java
src/main/java/com/neotel/smfcore/core/barcode/utils/CodeResolve.java
src/main/java/com/neotel/smfcore/core/storage/rest/MaterialController.java
src/main/java/com/neotel/smfcore/core/storage/rest/StoragePosController.java
src/main/resources/messages.properties
src/main/resources/messages_en_US.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/bean/BarcodeRule.java
查看文件 @
6adc067
...
@@ -497,7 +497,7 @@ public class BarcodeRule {
...
@@ -497,7 +497,7 @@ public class BarcodeRule {
}
}
codeBean
.
setCodeStr
(
codeStr
);
codeBean
.
setCodeStr
(
codeStr
);
if
(!
isValidRule
()){
if
(!
isValidRule
()){
codeBean
.
setError
(
"error.barcode.noRule"
,
"解析规则未定义"
);
codeBean
.
setError
(
"
smfcode.
error.barcode.noRule"
,
"解析规则未定义"
);
return
codeBean
;
return
codeBean
;
}
}
String
[]
codeArr
=
new
String
[]{
codeStr
};
String
[]
codeArr
=
new
String
[]{
codeStr
};
...
@@ -506,7 +506,7 @@ public class BarcodeRule {
...
@@ -506,7 +506,7 @@ public class BarcodeRule {
//条码与规则长度对应不上
//条码与规则长度对应不上
if
(
codeArr
.
length
!=
length
){
if
(
codeArr
.
length
!=
length
){
log
.
info
(
"条码["
+
codeStr
+
"]与规则【"
+
ruleStr
+
"】长度不同"
);
log
.
info
(
"条码["
+
codeStr
+
"]与规则【"
+
ruleStr
+
"】长度不同"
);
codeBean
.
setError
(
"
error.barcode.wrongLength"
,
new
String
[]{},
"条码["
+
codeStr
+
"
]长度错误"
);
codeBean
.
setError
(
"
smfcode.error.barcode.wrongLength"
,
new
String
[]{
codeStr
},
"条码[{0}
]长度错误"
);
return
codeBean
;
return
codeBean
;
}
else
{
}
else
{
codeArr
=
codeStr
.
split
(
separator
,
length
);
codeArr
=
codeStr
.
split
(
separator
,
length
);
...
@@ -525,7 +525,7 @@ public class BarcodeRule {
...
@@ -525,7 +525,7 @@ public class BarcodeRule {
if
(
Strings
.
isNullOrEmpty
(
reelId
)){
if
(
Strings
.
isNullOrEmpty
(
reelId
)){
log
.
info
(
"条码解析失败,未找到RI字段"
);
log
.
info
(
"条码解析失败,未找到RI字段"
);
codeBean
.
setError
(
"
error.barcode.noField"
,
new
String
[]{
"RI"
},
"条码解析失败,未找到RI
字段"
);
codeBean
.
setError
(
"
smfcode.error.barcode.noField"
,
new
String
[]{
"RI"
},
"条码解析失败,未找到{0}
字段"
);
return
codeBean
;
return
codeBean
;
}
}
...
@@ -533,7 +533,7 @@ public class BarcodeRule {
...
@@ -533,7 +533,7 @@ public class BarcodeRule {
if
(
Strings
.
isNullOrEmpty
(
partNumber
)){
if
(
Strings
.
isNullOrEmpty
(
partNumber
)){
log
.
info
(
"条码解析失败,未找到PN字段"
);
log
.
info
(
"条码解析失败,未找到PN字段"
);
codeBean
.
setError
(
"
error.barcode.noField"
,
new
String
[]{
"PN"
},
"条码解析失败,未找到PN
字段"
);
codeBean
.
setError
(
"
smfcode.error.barcode.noField"
,
new
String
[]{
"PN"
},
"条码解析失败,未找到{0}
字段"
);
return
codeBean
;
return
codeBean
;
}
}
if
(
batch_item
.
hasThisField
()){
if
(
batch_item
.
hasThisField
()){
...
@@ -545,7 +545,7 @@ public class BarcodeRule {
...
@@ -545,7 +545,7 @@ public class BarcodeRule {
quantity
=
quantity_item
.
getIntValue
(
codeArr
);
quantity
=
quantity_item
.
getIntValue
(
codeArr
);
if
(
quantity
==
-
1
){
if
(
quantity
==
-
1
){
log
.
info
(
"条码解析失败,未找到QTY 字段"
);
log
.
info
(
"条码解析失败,未找到QTY 字段"
);
codeBean
.
setError
(
"
error.barcode.noField"
,
new
String
[]{
"QTY"
},
"条码解析失败,未找到QTY
字段"
);
codeBean
.
setError
(
"
smfcode.error.barcode.noField"
,
new
String
[]{
"QTY"
},
"条码解析失败,未找到{0}
字段"
);
return
codeBean
;
return
codeBean
;
}
}
}
}
...
@@ -553,7 +553,7 @@ public class BarcodeRule {
...
@@ -553,7 +553,7 @@ public class BarcodeRule {
Date
produceDate
=
produceDate_item
.
getDateValue
(
codeArr
);
Date
produceDate
=
produceDate_item
.
getDateValue
(
codeArr
);
if
(
produceDate_item
.
hasThisField
()
&&
produceDate
==
null
){
if
(
produceDate_item
.
hasThisField
()
&&
produceDate
==
null
){
log
.
info
(
"条码解析失败,PRODATE字段不合规则"
);
log
.
info
(
"条码解析失败,PRODATE字段不合规则"
);
codeBean
.
setError
(
"
error.barcode.noField"
,
new
String
[]{
"PRODATE"
},
"条码解析失败,未找到PRODATE
字段"
);
codeBean
.
setError
(
"
smfcode.error.barcode.noField"
,
new
String
[]{
"PRODATE"
},
"条码解析失败,未找到{0}
字段"
);
return
codeBean
;
return
codeBean
;
}
}
Date
expireDate
=
expireDate_item
.
getDateValue
(
codeArr
);
Date
expireDate
=
expireDate_item
.
getDateValue
(
codeArr
);
...
...
src/main/java/com/neotel/smfcore/core/barcode/rest/bean/dto/CodeDto.java
查看文件 @
6adc067
...
@@ -4,7 +4,9 @@ import com.google.common.collect.Lists;
...
@@ -4,7 +4,9 @@ import com.google.common.collect.Lists;
import
com.neotel.smfcore.core.barcode.enums.BARCODE_STATUS
;
import
com.neotel.smfcore.core.barcode.enums.BARCODE_STATUS
;
import
com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE
;
import
com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE
;
import
com.neotel.smfcore.core.barcode.enums.SOLDER_STATUS
;
import
com.neotel.smfcore.core.barcode.enums.SOLDER_STATUS
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Getter
;
import
lombok.Getter
;
import
lombok.Setter
;
import
lombok.Setter
;
import
lombok.ToString
;
import
lombok.ToString
;
...
@@ -30,10 +32,16 @@ public class CodeDto implements Serializable {
...
@@ -30,10 +32,16 @@ public class CodeDto implements Serializable {
@ApiModelProperty
(
"高度"
)
@ApiModelProperty
(
"高度"
)
private
int
height
=
0
;
private
int
height
=
0
;
/**
* 原始条码
*/
@ApiModelProperty
(
"原始条码"
)
@ApiModelProperty
(
"原始条码"
)
private
String
fullCode
;
private
String
fullCode
;
@ApiModelProperty
(
"库位信息/仓位"
)
private
String
posName
;
@ApiModelProperty
(
"数量"
)
private
int
amount
;
@ApiModelProperty
(
"错误提示"
)
private
String
error
;
}
}
src/main/java/com/neotel/smfcore/core/barcode/utils/CodeResolve.java
查看文件 @
6adc067
...
@@ -50,7 +50,7 @@ public class CodeResolve {
...
@@ -50,7 +50,7 @@ public class CodeResolve {
if
(
barcodeRuleList
==
null
||
barcodeRuleList
.
isEmpty
()){
if
(
barcodeRuleList
==
null
||
barcodeRuleList
.
isEmpty
()){
CodeBean
codeBean
=
new
CodeBean
();
CodeBean
codeBean
=
new
CodeBean
();
codeBean
.
setBarcode
(
null
);
codeBean
.
setBarcode
(
null
);
codeBean
.
setError
(
"error.barcode.noRules"
,
"解析规则未定义"
);
codeBean
.
setError
(
"
smfcode.
error.barcode.noRules"
,
"解析规则未定义"
);
codeBean
.
setCodeStr
(
barcodeItemStr
);
codeBean
.
setCodeStr
(
barcodeItemStr
);
return
codeBean
;
return
codeBean
;
}
}
...
@@ -199,21 +199,21 @@ public class CodeResolve {
...
@@ -199,21 +199,21 @@ public class CodeResolve {
}
}
}
catch
(
ValidateException
ve
){
}
catch
(
ValidateException
ve
){
//档案不存在
//档案不存在
codeBeanFromRule
.
setError
(
"
error.barcode.pnNotExist"
,
new
String
[]{
barcodeFromRule
.
getPartNumber
()},
"x档案 "
+
barcodeFromRule
.
getPartNumber
()+
"
不存在"
);
codeBeanFromRule
.
setError
(
"
smfcode.error.barcode.pnNotExist"
,
new
String
[]{
barcodeFromRule
.
getPartNumber
()},
"档案 {0}
不存在"
);
log
.
warn
(
"
x
档案"
+
barcodeFromRule
.
getPartNumber
()+
"不存在"
);
log
.
warn
(
"档案"
+
barcodeFromRule
.
getPartNumber
()+
"不存在"
);
}
}
//解析成功了,直接返回
//解析成功了,直接返回
return
codeBeanFromRule
;
return
codeBeanFromRule
;
}
else
{
}
else
{
//在数据库中不存在,且未解析成功,用其他规则再解析
//在数据库中不存在,且未解析成功,用其他规则再解析
codeBeanFromRule
.
setError
(
"
error.barcode.invalid"
,
new
String
[]{
barcodeItemStr
},
barcodeItemStr
+
"
不是有效的条码"
);
codeBeanFromRule
.
setError
(
"
smfcode.error.barcode.invalid"
,
new
String
[]{
barcodeItemStr
},
"{0}
不是有效的条码"
);
}
}
}
}
if
(
codeBeanFromRule
==
null
){
if
(
codeBeanFromRule
==
null
){
codeBeanFromRule
=
new
CodeBean
();
codeBeanFromRule
=
new
CodeBean
();
codeBeanFromRule
.
setBarcode
(
null
);
codeBeanFromRule
.
setBarcode
(
null
);
codeBeanFromRule
.
setError
(
"
error.barcode.invalid"
,
new
String
[]{
barcodeItemStr
},
barcodeItemStr
+
"
不是有效的条码"
);
codeBeanFromRule
.
setError
(
"
smfcode.error.barcode.invalid"
,
new
String
[]{
barcodeItemStr
},
"{0}
不是有效的条码"
);
codeBeanFromRule
.
setCodeStr
(
barcodeItemStr
);
codeBeanFromRule
.
setCodeStr
(
barcodeItemStr
);
return
codeBeanFromRule
;
return
codeBeanFromRule
;
}
}
...
...
src/main/java/com/neotel/smfcore/core/storage/rest/MaterialController.java
查看文件 @
6adc067
...
@@ -7,8 +7,11 @@ import com.neotel.smfcore.common.bean.PageData;
...
@@ -7,8 +7,11 @@ import com.neotel.smfcore.common.bean.PageData;
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.QueryHelp
;
import
com.neotel.smfcore.common.utils.QueryHelp
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.common.utils.StorageConstants
;
import
com.neotel.smfcore.common.utils.StorageConstants
;
import
com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE
;
import
com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE
;
import
com.neotel.smfcore.core.barcode.service.manager.IBarcodeManager
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.storage.bean.InventoryItem
;
import
com.neotel.smfcore.core.storage.bean.InventoryItem
;
import
com.neotel.smfcore.core.storage.rest.dto.*
;
import
com.neotel.smfcore.core.storage.rest.dto.*
;
...
@@ -21,6 +24,7 @@ import com.neotel.smfcore.core.storage.service.manager.IStoragePosManager;
...
@@ -21,6 +24,7 @@ import com.neotel.smfcore.core.storage.service.manager.IStoragePosManager;
import
com.neotel.smfcore.core.storage.service.po.Label
;
import
com.neotel.smfcore.core.storage.service.po.Label
;
import
com.neotel.smfcore.core.storage.service.po.Storage
;
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.po.DataLog
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
com.neotel.smfcore.core.system.util.TaskService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
...
@@ -61,6 +65,9 @@ public class MaterialController {
...
@@ -61,6 +65,9 @@ public class MaterialController {
@Autowired
@Autowired
private
final
ILabelManager
labelManager
;
private
final
ILabelManager
labelManager
;
@Autowired
private
final
IBarcodeManager
barcodeManager
;
@ApiOperation
(
"策略出库获取库存列表"
)
@ApiOperation
(
"策略出库获取库存列表"
)
@GetMapping
(
value
=
"/inventory"
)
@GetMapping
(
value
=
"/inventory"
)
@PreAuthorize
(
"@el.check('tacticsOuput')"
)
@PreAuthorize
(
"@el.check('tacticsOuput')"
)
...
@@ -153,20 +160,20 @@ public class MaterialController {
...
@@ -153,20 +160,20 @@ public class MaterialController {
@PostMapping
(
value
=
"/labelOuput"
)
@PostMapping
(
value
=
"/labelOuput"
)
@PreAuthorize
(
"@el.check('labelOuput')"
)
@PreAuthorize
(
"@el.check('labelOuput')"
)
public
ResultBean
labelOuput
(
@RequestBody
PosLabelDto
params
)
{
public
ResultBean
labelOuput
(
@RequestBody
PosLabelDto
params
)
{
List
<
String
>
posIds
=
params
.
getPosIds
();
List
<
String
>
posIds
=
params
.
getPosIds
();
if
(
posIds
==
null
)
{
if
(
posIds
==
null
)
{
throw
new
ValidateException
(
"smfcode.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"PN"
});
throw
new
ValidateException
(
"smfcode.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"PN"
});
}
}
for
(
String
posId
:
posIds
)
{
for
(
String
posId
:
posIds
)
{
StoragePos
pos
=
storagePosManager
.
get
(
posId
);
StoragePos
pos
=
storagePosManager
.
get
(
posId
);
if
(
pos
==
null
)
{
if
(
pos
==
null
)
{
throw
new
ValidateException
(
"smfcode.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"posId"
,
posId
});
throw
new
ValidateException
(
"smfcode.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"posId"
,
posId
});
}
}
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
if
(
storage
==
null
)
{
if
(
storage
==
null
)
{
throw
new
ValidateException
(
"smfcode.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"storageId"
,
pos
.
getStorageId
()});
throw
new
ValidateException
(
"smfcode.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"storageId"
,
pos
.
getStorageId
()});
}
}
log
.
info
(
"出库料仓【"
+
storage
.
getName
()
+
"_"
+
storage
.
getCid
()
+
"】位置仓位【"
+
pos
.
getPosName
()
+
"】"
);
log
.
info
(
"出库料仓【"
+
storage
.
getName
()
+
"_"
+
storage
.
getCid
()
+
"】位置仓位【"
+
pos
.
getPosName
()
+
"】"
);
...
@@ -187,17 +194,48 @@ public class MaterialController {
...
@@ -187,17 +194,48 @@ public class MaterialController {
// List<String> posIds=(List<String>) params.get("posIds");
// List<String> posIds=(List<String>) params.get("posIds");
// String labelId = params.get("labelId").toString();
// String labelId = params.get("labelId").toString();
List
<
String
>
posIds
=
params
.
getPosIds
();
List
<
String
>
posIds
=
params
.
getPosIds
();
String
labelId
=
params
.
getLabelId
();
String
labelId
=
params
.
getLabelId
();
if
(
posIds
==
null
||
posIds
.
size
()<=
0
)
{
if
(
posIds
==
null
||
posIds
.
size
()
<=
0
)
{
throw
new
ValidateException
(
"smfcode.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
});
throw
new
ValidateException
(
"smfcode.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
});
}
}
if
(
ObjectUtil
.
isEmpty
(
labelId
))
{
if
(
ObjectUtil
.
isEmpty
(
labelId
))
{
labelId
=
""
;
labelId
=
""
;
}
}
String
[]
array
=
posIds
.
toArray
(
new
String
[
posIds
.
size
()])
;
String
[]
array
=
posIds
.
toArray
(
new
String
[
posIds
.
size
()])
;
storagePosManager
.
updatePosLabel
(
array
,
labelId
);
storagePosManager
.
updatePosLabel
(
array
,
labelId
);
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
@ApiOperation
(
"手动出库"
)
@PostMapping
(
value
=
"/manualOut"
)
@PreAuthorize
(
"@el.check('manualOut')"
)
public
ResultBean
manualOut
(
@RequestBody
Map
<
String
,
String
>
paramMap
)
{
String
code
=
paramMap
.
get
(
"barcode"
);
Barcode
barcode
=
barcodeManager
.
findByBarcode
(
code
);
StoragePos
storagePos
=
storagePosManager
.
getByBarcode
(
code
);
if
(
storagePos
!=
null
)
{
if
(!
ObjectUtil
.
isEmpty
(
storagePos
.
getBarcode
().
getLockId
()))
{
throw
new
ValidateException
(
"smfcode.error.barcode.locked"
,
"库位[{0}]已被锁定"
);
}
try
{
if
(
barcode
!=
null
)
{
String
opUser
=
SecurityUtils
.
getCurrentUsername
();
log
.
info
(
opUser
+
"清理库位["
+
storagePos
.
getPosName
()
+
"],条码["
+
code
+
"]中的库存"
+
barcode
.
getBarcode
());
taskService
.
addTaskToFinished
(
storagePos
,
null
,
opUser
+
"-manual"
);
}
else
{
log
.
info
(
"清理库位["
+
storagePos
.
getPosName
()
+
"],条码["
+
code
+
"],库位条码为空"
);
}
return
ResultBean
.
newOkResult
(
"smfcode.manualOut.ok"
,
"手动出库成功"
,
code
);
}
catch
(
Exception
e
)
{
return
ResultBean
.
newOkResult
(
"smfcore.error"
,
"出错{0}"
,
new
String
[]{
e
.
getMessage
()},
code
);
}
}
else
{
throw
new
ValidateException
(
"smfcode.manualOut.notFound"
,
"仓库中未找到料盘信息"
);
}
}
}
}
src/main/java/com/neotel/smfcore/core/storage/rest/StoragePosController.java
查看文件 @
6adc067
package
com
.
neotel
.
smfcore
.
core
.
storage
.
rest
;
package
com
.
neotel
.
smfcore
.
core
.
storage
.
rest
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.google.common.base.Strings
;
import
com.google.common.base.Strings
;
import
com.neotel.smfcore.common.bean.PageData
;
import
com.neotel.smfcore.common.bean.PageData
;
import
com.neotel.smfcore.common.bean.ResultBean
;
import
com.neotel.smfcore.common.bean.ResultBean
;
...
@@ -8,12 +9,14 @@ import com.neotel.smfcore.common.utils.Constants;
...
@@ -8,12 +9,14 @@ import com.neotel.smfcore.common.utils.Constants;
import
com.neotel.smfcore.common.utils.QueryHelp
;
import
com.neotel.smfcore.common.utils.QueryHelp
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.common.utils.SecurityUtils
;
import
com.neotel.smfcore.common.utils.StorageConstants
;
import
com.neotel.smfcore.common.utils.StorageConstants
;
import
com.neotel.smfcore.core.barcode.bean.CodeBean
;
import
com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE
;
import
com.neotel.smfcore.core.barcode.enums.COMPONENT_TYPE
;
import
com.neotel.smfcore.core.barcode.rest.bean.dto.CodeDto
;
import
com.neotel.smfcore.core.barcode.rest.bean.dto.CodeDto
;
import
com.neotel.smfcore.core.barcode.rest.bean.mapstruct.CodeMapper
;
import
com.neotel.smfcore.core.barcode.rest.bean.mapstruct.CodeMapper
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.service.po.Barcode
;
import
com.neotel.smfcore.core.barcode.utils.CodeResolve
;
import
com.neotel.smfcore.core.barcode.utils.CodeResolve
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.device.util.DataCache
;
import
com.neotel.smfcore.core.language.util.MessageUtils
;
import
com.neotel.smfcore.core.storage.rest.dto.CheckOutDto
;
import
com.neotel.smfcore.core.storage.rest.dto.CheckOutDto
;
import
com.neotel.smfcore.core.storage.rest.dto.StoragePosDto
;
import
com.neotel.smfcore.core.storage.rest.dto.StoragePosDto
;
import
com.neotel.smfcore.core.storage.rest.dto.StoragePosEnabledDto
;
import
com.neotel.smfcore.core.storage.rest.dto.StoragePosEnabledDto
;
...
@@ -25,11 +28,13 @@ import com.neotel.smfcore.core.storage.service.dao.IStoragePosDao;
...
@@ -25,11 +28,13 @@ import com.neotel.smfcore.core.storage.service.dao.IStoragePosDao;
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.storage.service.po.StoragePos
;
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.core.system.util.TaskService
;
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.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.Data
;
import
lombok.RequiredArgsConstructor
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
net.bytebuddy.asm.Advice
;
import
net.bytebuddy.asm.Advice
;
...
@@ -72,35 +77,34 @@ public class StoragePosController {
...
@@ -72,35 +77,34 @@ public class StoragePosController {
private
CodeMapper
codeMapper
;
private
CodeMapper
codeMapper
;
@ApiOperation
(
"查询库位"
)
@ApiOperation
(
"查询库位"
)
@GetMapping
@GetMapping
@PreAuthorize
(
"@el.check('storagePos:list')"
)
@PreAuthorize
(
"@el.check('storagePos:list')"
)
public
PageData
<
StoragePosDto
>
query
(
StoragePosQueryCriteria
criteria
,
Pageable
pageable
){
public
PageData
<
StoragePosDto
>
query
(
StoragePosQueryCriteria
criteria
,
Pageable
pageable
)
{
if
(
criteria
.
getStorageIdList
()!=
null
&&
criteria
.
getStorageIdList
().
contains
(
"0"
))
{
if
(
criteria
.
getStorageIdList
()
!=
null
&&
criteria
.
getStorageIdList
().
contains
(
"0"
))
{
criteria
.
setStorageIdList
(
null
);
criteria
.
setStorageIdList
(
null
);
}
}
Query
query
=
QueryHelp
.
getQuery
(
criteria
);
Query
query
=
QueryHelp
.
getQuery
(
criteria
);
PageData
<
StoragePos
>
pages
=
storagePosManager
.
findByPage
(
query
,
pageable
);
PageData
<
StoragePos
>
pages
=
storagePosManager
.
findByPage
(
query
,
pageable
);
List
<
StoragePosDto
>
StoragePosDtos
=
storagePosMapper
.
toDto
(
pages
.
getContent
());
List
<
StoragePosDto
>
StoragePosDtos
=
storagePosMapper
.
toDto
(
pages
.
getContent
());
return
new
PageData
(
StoragePosDtos
,
pages
.
getTotalElements
());
return
new
PageData
(
StoragePosDtos
,
pages
.
getTotalElements
());
}
}
@ApiOperation
(
"删除指定料仓所有库位"
)
@ApiOperation
(
"删除指定料仓所有库位"
)
@PutMapping
(
"/removeAllPos"
)
@PutMapping
(
"/removeAllPos"
)
@PreAuthorize
(
"@el.check('storagePos:edit')"
)
@PreAuthorize
(
"@el.check('storagePos:edit')"
)
public
ResultBean
clearAllPos
(
@RequestBody
Map
<
String
,
String
>
map
)
{
public
ResultBean
clearAllPos
(
@RequestBody
Map
<
String
,
String
>
map
)
{
String
cid
=
""
;
String
cid
=
""
;
if
(
map
.
containsKey
(
"cid"
))
{
if
(
map
.
containsKey
(
"cid"
))
{
cid
=
map
.
get
(
"cid"
);
cid
=
map
.
get
(
"cid"
);
}
}
Storage
storage
=
dataCache
.
getStorage
(
cid
);
Storage
storage
=
dataCache
.
getStorage
(
cid
);
if
(
storage
==
null
)
{
if
(
storage
==
null
)
{
throw
new
ValidateException
(
"smfcode.valueNotFind"
,
"未找到{0}[{1}]"
,
new
String
[]{
"cid"
,
cid
});
throw
new
ValidateException
(
"smfcode.valueNotFind"
,
"未找到{0}[{1}]"
,
new
String
[]{
"cid"
,
cid
});
}
}
List
<
StoragePos
>
allPos
=
storagePosManager
.
findByStorage
(
storage
.
getId
());
List
<
StoragePos
>
allPos
=
storagePosManager
.
findByStorage
(
storage
.
getId
());
for
(
StoragePos
storagePos
:
allPos
for
(
StoragePos
storagePos
:
allPos
)
{
)
{
if
(
storagePos
!=
null
)
{
if
(
storagePos
!=
null
)
{
Barcode
barcode
=
storagePos
.
getBarcode
();
Barcode
barcode
=
storagePos
.
getBarcode
();
...
@@ -110,28 +114,28 @@ public class StoragePosController {
...
@@ -110,28 +114,28 @@ public class StoragePosController {
}
}
}
}
log
.
info
(
"开始删除料仓["
+
cid
+
"] 所有位置"
);
log
.
info
(
"开始删除料仓["
+
cid
+
"] 所有位置"
);
storagePosManager
.
removePosByStorageId
(
storage
.
getId
());
storagePosManager
.
removePosByStorageId
(
storage
.
getId
());
log
.
info
(
"删除料仓["
+
cid
+
"] 所有位置完成"
);
log
.
info
(
"删除料仓["
+
cid
+
"] 所有位置完成"
);
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
@ApiOperation
(
"清空指定料仓所有库位"
)
@ApiOperation
(
"清空指定料仓所有库位"
)
@PutMapping
(
"/clearStoragePos"
)
@PutMapping
(
"/clearStoragePos"
)
@PreAuthorize
(
"@el.check('storagePos:edit')"
)
@PreAuthorize
(
"@el.check('storagePos:edit')"
)
public
ResultBean
clearStoragePos
(
@RequestBody
Map
<
String
,
String
>
map
)
{
public
ResultBean
clearStoragePos
(
@RequestBody
Map
<
String
,
String
>
map
)
{
String
cid
=
""
;
String
cid
=
""
;
if
(
map
.
containsKey
(
"cid"
))
{
if
(
map
.
containsKey
(
"cid"
))
{
cid
=
map
.
get
(
"cid"
);
cid
=
map
.
get
(
"cid"
);
}
}
Storage
storage
=
dataCache
.
getStorage
(
cid
);
Storage
storage
=
dataCache
.
getStorage
(
cid
);
if
(
storage
==
null
)
{
if
(
storage
==
null
)
{
throw
new
ValidateException
(
"smfcode.valueNotFind"
,
"未找到{0}[{1}]"
,
new
String
[]{
"cid"
,
cid
});
throw
new
ValidateException
(
"smfcode.valueNotFind"
,
"未找到{0}[{1}]"
,
new
String
[]{
"cid"
,
cid
});
}
}
log
.
info
(
"开始手动清空料仓["
+
storage
.
getName
()+
"_"
+
storage
.
getCid
()+
"]的所有库位"
);
log
.
info
(
"开始手动清空料仓["
+
storage
.
getName
()
+
"_"
+
storage
.
getCid
()
+
"]的所有库位"
);
List
<
StoragePos
>
allPos
=
storagePosManager
.
findByStorage
(
storage
.
getId
());
List
<
StoragePos
>
allPos
=
storagePosManager
.
findByStorage
(
storage
.
getId
());
for
(
StoragePos
storagePos
:
allPos
for
(
StoragePos
storagePos
:
allPos
)
{
)
{
if
(
storagePos
!=
null
)
{
if
(
storagePos
!=
null
)
{
try
{
try
{
...
@@ -145,7 +149,7 @@ public class StoragePosController {
...
@@ -145,7 +149,7 @@ public class StoragePosController {
taskService
.
addTaskToFinished
(
storagePos
,
null
,
opUser
+
"-clear"
);
taskService
.
addTaskToFinished
(
storagePos
,
null
,
opUser
+
"-clear"
);
}
}
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
throw
new
ValidateException
(
"smfcore.error"
,
"出错{0}"
,
new
String
[]{
"["
+
storagePos
.
getPosName
()+
"]"
+
e
.
toString
()});
throw
new
ValidateException
(
"smfcore.error"
,
"出错{0}"
,
new
String
[]{
"["
+
storagePos
.
getPosName
()
+
"]"
+
e
.
toString
()});
}
}
}
}
}
}
...
@@ -158,7 +162,7 @@ public class StoragePosController {
...
@@ -158,7 +162,7 @@ public class StoragePosController {
@ApiOperation
(
"清空指定库位"
)
@ApiOperation
(
"清空指定库位"
)
@PutMapping
(
"/clearPos"
)
@PutMapping
(
"/clearPos"
)
@PreAuthorize
(
"@el.check('storagePos:edit')"
)
@PreAuthorize
(
"@el.check('storagePos:edit')"
)
public
ResultBean
clearPos
(
@RequestBody
HashMap
<
String
,
String
>
map
)
{
public
ResultBean
clearPos
(
@RequestBody
HashMap
<
String
,
String
>
map
)
{
if
(
map
.
containsKey
(
"posName"
))
{
if
(
map
.
containsKey
(
"posName"
))
{
String
posName
=
map
.
get
(
"posName"
);
String
posName
=
map
.
get
(
"posName"
);
...
@@ -178,7 +182,7 @@ public class StoragePosController {
...
@@ -178,7 +182,7 @@ public class StoragePosController {
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// return e.getMessage();
// return e.getMessage();
throw
new
ValidateException
(
"smfcore.error"
,
"出错{0}"
,
new
String
[]{
e
.
toString
()});
throw
new
ValidateException
(
"smfcore.error"
,
"出错{0}"
,
new
String
[]{
e
.
toString
()});
}
}
}
}
}
}
...
@@ -189,36 +193,35 @@ public class StoragePosController {
...
@@ -189,36 +193,35 @@ public class StoragePosController {
@PutMapping
(
"/enabledPos"
)
@PutMapping
(
"/enabledPos"
)
@PreAuthorize
(
"@el.check('storagePos:edit')"
)
@PreAuthorize
(
"@el.check('storagePos:edit')"
)
public
ResultBean
enabledPos
(
@RequestBody
StoragePosEnabledDto
enabledDto
)
{
public
ResultBean
enabledPos
(
@RequestBody
StoragePosEnabledDto
enabledDto
)
{
if
(
enabledDto
.
getId
()==
null
)
{
if
(
enabledDto
.
getId
()
==
null
)
{
throw
new
ValidateException
(
"smfcode.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
throw
new
ValidateException
(
"smfcode.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
}
}
StoragePos
pos
=
storagePosDao
.
findOneById
(
enabledDto
.
getId
());
StoragePos
pos
=
storagePosDao
.
findOneById
(
enabledDto
.
getId
());
if
(
pos
==
null
)
{
if
(
pos
==
null
)
{
throw
new
ValidateException
(
"smfcode.valueNotFind"
,
"未找到{0}[{1}]"
,
new
String
[]{
"PosId"
,
enabledDto
.
getId
()});
throw
new
ValidateException
(
"smfcode.valueNotFind"
,
"未找到{0}[{1}]"
,
new
String
[]{
"PosId"
,
enabledDto
.
getId
()});
// throw new ValidateException("未找到库位 ");
// throw new ValidateException("未找到库位 ");
}
}
pos
.
setEnabled
(
enabledDto
.
isEnabled
());
pos
.
setEnabled
(
enabledDto
.
isEnabled
());
storagePosDao
.
save
(
pos
);
storagePosDao
.
save
(
pos
);
log
.
info
(
"启用禁用库位:库位号["
+
pos
.
getId
()+
"]["
+
pos
.
getPosName
()+
"]="
+
enabledDto
.
isEnabled
());
log
.
info
(
"启用禁用库位:库位号["
+
pos
.
getId
()
+
"]["
+
pos
.
getPosName
()
+
"]="
+
enabledDto
.
isEnabled
());
return
ResultBean
.
newOkResult
(
""
);
return
ResultBean
.
newOkResult
(
""
);
}
}
@ApiOperation
(
"修改库位"
)
@ApiOperation
(
"修改库位"
)
@PutMapping
@PutMapping
@PreAuthorize
(
"@el.check('storagePos:edit')"
)
@PreAuthorize
(
"@el.check('storagePos:edit')"
)
public
ResponseEntity
<
Object
>
update
(
@Validated
@RequestBody
StoragePosSaveDto
saveDto
)
{
public
ResponseEntity
<
Object
>
update
(
@Validated
@RequestBody
StoragePosSaveDto
saveDto
)
{
if
(
saveDto
.
getId
()==
null
)
{
if
(
saveDto
.
getId
()
==
null
)
{
throw
new
ValidateException
(
"smfcode.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
throw
new
ValidateException
(
"smfcode.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
}
}
if
(
saveDto
.
getPosName
()==
null
)
{
if
(
saveDto
.
getPosName
()
==
null
)
{
throw
new
ValidateException
(
"smfcode.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
throw
new
ValidateException
(
"smfcode.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
}
}
StoragePos
pos
=
storagePosDao
.
findOneById
(
saveDto
.
getId
());
StoragePos
pos
=
storagePosDao
.
findOneById
(
saveDto
.
getId
());
if
(
pos
==
null
)
{
if
(
pos
==
null
)
{
throw
new
ValidateException
(
"smfcode.valueNotFind"
,
"未找到{0}[{1}]"
,
new
String
[]{
"PosId"
,
saveDto
.
getId
()});
throw
new
ValidateException
(
"smfcode.valueNotFind"
,
"未找到{0}[{1}]"
,
new
String
[]{
"PosId"
,
saveDto
.
getId
()});
// throw new ValidateException("未找到库位 ");
// throw new ValidateException("未找到库位 ");
}
}
pos
.
setPosName
(
saveDto
.
getPosName
());
pos
.
setPosName
(
saveDto
.
getPosName
());
...
@@ -226,11 +229,11 @@ public class StoragePosController {
...
@@ -226,11 +229,11 @@ public class StoragePosController {
pos
.
setH
(
saveDto
.
getH
());
pos
.
setH
(
saveDto
.
getH
());
pos
.
setW
(
saveDto
.
getW
());
pos
.
setW
(
saveDto
.
getW
());
storagePosDao
.
save
(
pos
);
storagePosDao
.
save
(
pos
);
log
.
info
(
"修改库位:库位号["
+
pos
.
getId
()+
"]=["
+
saveDto
.
toString
()+
"]"
);
log
.
info
(
"修改库位:库位号["
+
pos
.
getId
()
+
"]=["
+
saveDto
.
toString
()
+
"]"
);
return
new
ResponseEntity
<>(
HttpStatus
.
OK
);
return
new
ResponseEntity
<>(
HttpStatus
.
OK
);
}
}
// @ApiOperation("新增库位")
// @ApiOperation("新增库位")
// @PostMapping
// @PostMapping
// @PreAuthorize("@el.check('storage:add')")
// @PreAuthorize("@el.check('storage:add')")
// public ResponseEntity<Object> create(@Validated @RequestBody StoragePosDto resources) {
// public ResponseEntity<Object> create(@Validated @RequestBody StoragePosDto resources) {
...
@@ -245,7 +248,7 @@ public class StoragePosController {
...
@@ -245,7 +248,7 @@ public class StoragePosController {
for
(
String
id
:
ids
)
{
for
(
String
id
:
ids
)
{
if
(
id
==
null
)
{
if
(
id
==
null
)
{
throw
new
ValidateException
(
"smfcode.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
throw
new
ValidateException
(
"smfcode.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
}
}
}
}
storagePosManager
.
deletePoss
(
ids
);
storagePosManager
.
deletePoss
(
ids
);
...
@@ -255,22 +258,22 @@ public class StoragePosController {
...
@@ -255,22 +258,22 @@ public class StoragePosController {
@ApiOperation
(
"查找出库列表"
)
@ApiOperation
(
"查找出库列表"
)
@GetMapping
(
"/find"
)
@GetMapping
(
"/find"
)
@PreAuthorize
(
"@el.check('checkOut')"
)
@PreAuthorize
(
"@el.check('checkOut')"
)
public
PageData
<
StoragePosDto
>
storagePosFind
(
StoragePosFindCriteria
criteria
,
Pageable
pageable
,
HttpServletRequest
request
)
{
public
PageData
<
StoragePosDto
>
storagePosFind
(
StoragePosFindCriteria
criteria
,
Pageable
pageable
,
HttpServletRequest
request
)
{
if
(
criteria
.
getStorageId
()!=
null
&&
criteria
.
getStorageId
().
equals
(
"0"
))
{
if
(
criteria
.
getStorageId
()
!=
null
&&
criteria
.
getStorageId
().
equals
(
"0"
))
{
criteria
.
setStorageId
(
null
);
criteria
.
setStorageId
(
null
);
}
}
Query
query
=
QueryHelp
.
getQuery
(
criteria
);
Query
query
=
QueryHelp
.
getQuery
(
criteria
);
Criteria
baseCriteria
=
Criteria
.
where
(
"used"
).
is
(
true
);
Criteria
baseCriteria
=
Criteria
.
where
(
"used"
).
is
(
true
);
int
componentType
=
criteria
.
getType
();
int
componentType
=
criteria
.
getType
();
String
name
=
""
;
String
name
=
""
;
if
(
componentType
!=
-
1
)
{
if
(
componentType
!=
-
1
)
{
int
type
=
componentType
;
int
type
=
componentType
;
request
.
setAttribute
(
"type"
,
componentType
);
request
.
setAttribute
(
"type"
,
componentType
);
if
(
componentType
==
41
)
{
//锡膏夹具
if
(
componentType
==
41
)
{
//锡膏夹具
type
=
COMPONENT_TYPE
.
FIXTURE
;
type
=
COMPONENT_TYPE
.
FIXTURE
;
name
=
StorageConstants
.
PACKAGE_TYPE
.
SOLDER_FIXTURE
.
getCode
();
name
=
StorageConstants
.
PACKAGE_TYPE
.
SOLDER_FIXTURE
.
getCode
();
}
else
if
(
componentType
==
42
)
{
//PCB夹具
}
else
if
(
componentType
==
42
)
{
//PCB夹具
type
=
COMPONENT_TYPE
.
FIXTURE
;
type
=
COMPONENT_TYPE
.
FIXTURE
;
name
=
StorageConstants
.
PACKAGE_TYPE
.
PCB_FIXTURE
.
getCode
();
name
=
StorageConstants
.
PACKAGE_TYPE
.
PCB_FIXTURE
.
getCode
();
}
}
...
@@ -279,20 +282,20 @@ public class StoragePosController {
...
@@ -279,20 +282,20 @@ public class StoragePosController {
String
expire
=
criteria
.
getExpire
();
String
expire
=
criteria
.
getExpire
();
if
(!
Strings
.
isNullOrEmpty
(
expire
))
{
if
(!
Strings
.
isNullOrEmpty
(
expire
))
{
if
(
"solder"
.
equalsIgnoreCase
(
expire
))
{
if
(
"solder"
.
equalsIgnoreCase
(
expire
))
{
baseCriteria
.
and
(
"barcode.expTime"
).
lte
(
new
Date
());
baseCriteria
.
and
(
"barcode.expTime"
).
lte
(
new
Date
());
}
else
if
(
"pcb"
.
equalsIgnoreCase
(
expire
))
{
}
else
if
(
"pcb"
.
equalsIgnoreCase
(
expire
))
{
baseCriteria
.
and
(
"barcode.expireDate"
).
lte
(
new
Date
());
baseCriteria
.
and
(
"barcode.expireDate"
).
lte
(
new
Date
());
}
}
request
.
setAttribute
(
"expire"
,
expire
);
request
.
setAttribute
(
"expire"
,
expire
);
}
}
query
.
addCriteria
(
baseCriteria
);
query
.
addCriteria
(
baseCriteria
);
PageData
<
StoragePos
>
pages
=
storagePosManager
.
findByPage
(
query
,
pageable
);
PageData
<
StoragePos
>
pages
=
storagePosManager
.
findByPage
(
query
,
pageable
);
List
<
StoragePosDto
>
StoragePosDtos
=
storagePosMapper
.
toDto
(
pages
.
getContent
());
List
<
StoragePosDto
>
StoragePosDtos
=
storagePosMapper
.
toDto
(
pages
.
getContent
());
return
new
PageData
(
StoragePosDtos
,
pages
.
getTotalElements
());
return
new
PageData
(
StoragePosDtos
,
pages
.
getTotalElements
());
}
}
@ApiOperation
(
"查找出库"
)
@ApiOperation
(
"查找出库"
)
...
@@ -300,10 +303,10 @@ public class StoragePosController {
...
@@ -300,10 +303,10 @@ public class StoragePosController {
public
ResultBean
checkout
(
@Validated
@RequestBody
CheckOutDto
checkOutDto
)
{
public
ResultBean
checkout
(
@Validated
@RequestBody
CheckOutDto
checkOutDto
)
{
if
(
checkOutDto
.
getPids
()
==
null
)
{
if
(
checkOutDto
.
getPids
()
==
null
)
{
throw
new
ValidateException
(
"smfcode.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
throw
new
ValidateException
(
"smfcode.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
}
}
if
(
checkOutDto
.
getSingleOut
()==
null
)
{
if
(
checkOutDto
.
getSingleOut
()
==
null
)
{
checkOutDto
.
setSingleOut
(
true
+
""
);
checkOutDto
.
setSingleOut
(
true
+
""
);
}
}
String
isSingleOutStr
=
checkOutDto
.
getSingleOut
();
String
isSingleOutStr
=
checkOutDto
.
getSingleOut
();
boolean
isSingleOut
=
Boolean
.
valueOf
(
isSingleOutStr
);
boolean
isSingleOut
=
Boolean
.
valueOf
(
isSingleOutStr
);
...
@@ -312,12 +315,12 @@ public class StoragePosController {
...
@@ -312,12 +315,12 @@ public class StoragePosController {
for
(
String
pid
:
checkOutDto
.
getPids
())
{
for
(
String
pid
:
checkOutDto
.
getPids
())
{
StoragePos
pos
=
storagePosManager
.
get
(
pid
);
StoragePos
pos
=
storagePosManager
.
get
(
pid
);
if
(
pos
==
null
)
{
if
(
pos
==
null
)
{
throw
new
ValidateException
(
"smfcode.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"pid"
,
pid
});
throw
new
ValidateException
(
"smfcode.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"pid"
,
pid
});
// throw new ValidateException("位置[" + pid + "]不存在");
// throw new ValidateException("位置[" + pid + "]不存在");
}
}
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
if
(
storage
==
null
)
{
if
(
storage
==
null
)
{
throw
new
ValidateException
(
"smfcode.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"storageId"
,
pos
.
getStorageId
()});
throw
new
ValidateException
(
"smfcode.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"storageId"
,
pos
.
getStorageId
()});
// throw new ValidateException("料仓[" + pos.getStorageId() + "]不存在");
// throw new ValidateException("料仓[" + pos.getStorageId() + "]不存在");
}
}
...
@@ -333,17 +336,61 @@ public class StoragePosController {
...
@@ -333,17 +336,61 @@ public class StoragePosController {
@ApiOperation
(
"解析出库条码"
)
@ApiOperation
(
"解析出库条码"
)
@PutMapping
(
"/resolveCode/{blurry}"
)
@PutMapping
(
"/resolveCode/{blurry}"
)
public
CodeDto
resolveCode
(
@PathVariable
String
blurry
){
public
CodeDto
resolveCode
(
@PathVariable
String
blurry
)
{
String
barcodeStr
=
blurry
;
String
barcodeStr
=
blurry
;
Barcode
barcode
=
codeResolve
.
resolveCode
(
barcodeStr
);
Barcode
barcode
=
codeResolve
.
resolveCode
(
barcodeStr
);
if
(
barcode
==
null
)
{
if
(
barcode
==
null
)
{
return
null
;
return
null
;
}
else
{
}
else
{
CodeDto
dto
=
codeMapper
.
toDto
(
barcode
);
CodeDto
dto
=
codeMapper
.
toDto
(
barcode
);
log
.
info
(
"resolveCode ["
+
barcodeStr
+
"]=["
+
dto
.
toString
()+
"]"
);
log
.
info
(
"resolveCode ["
+
barcodeStr
+
"]=["
+
dto
.
toString
()
+
"]"
);
return
dto
;
return
dto
;
}
}
}
}
@ApiOperation
(
"手动出库解析条码"
)
@PutMapping
(
value
=
"/resolveBarcode"
)
public
CodeDto
resolveBarcode
(
@RequestBody
String
code
,
HttpServletRequest
servletRequest
)
{
// String code = paramMap.get("code");
CodeBean
codeBean
=
new
CodeBean
();
try
{
codeBean
=
codeResolve
.
resolveSingleCode
(
code
);
}
catch
(
ValidateException
e
)
{
codeBean
.
setError
(
e
.
getMessage
());
}
CodeDto
dto
=
new
CodeDto
();
if
(
codeBean
!=
null
)
{
dto
.
setFullCode
(
code
);
dto
.
setHeight
(
codeBean
.
getReelHeight
());
dto
.
setPlateSize
(
codeBean
.
getReelWidth
());
if
(
codeBean
.
getBarcode
()
!=
null
)
{
dto
.
setBarcode
(
codeBean
.
getBarcode
().
getBarcode
());
dto
.
setPartNumber
(
codeBean
.
getBarcode
().
getPartNumber
());
dto
.
setPosName
(
codeBean
.
getBarcode
().
getPosName
());
dto
.
setAmount
(
codeBean
.
getBarcode
().
getAmount
());
if
(!
ObjectUtil
.
isEmpty
(
codeBean
.
getBarcode
().
getLockId
()))
{
codeBean
.
setError
(
"smfcode.error.barcode.locked"
,
"库位[{0}]已被锁定"
);
}
// StoragePos pos = storagePosManager.getByPosName(dto.getPosName());
// Storage storage = dataCache.getStorageById(pos.getStorageId());
// //判断是否已在出库中
// DataLog task = taskService.findExecutingTask(storage.getCid(), pos.getPosName());
// if (task == null) {
// codeBean.setError("smfcode.error.barcode.inQueue", new String[]{dto.getBarcode()}, "二维码[{0}]已在操作队列中");
// }
}
if
(
codeBean
.
getErrorCode
()
!=
null
)
{
String
error
=
MessageUtils
.
getText
(
codeBean
.
getErrorCode
(),
codeBean
.
getParams
(),
servletRequest
.
getLocale
(),
codeBean
.
getError
());
dto
.
setError
(
error
);
}
}
else
{
String
error
=
MessageUtils
.
getText
(
"smfcode.error.barcode.invalid"
,
new
String
[]{
code
},
servletRequest
.
getLocale
(),
"{0}不是有效的条码"
);
dto
.
setError
(
error
);
}
return
dto
;
}
}
}
src/main/resources/messages.properties
查看文件 @
6adc067
...
@@ -100,7 +100,15 @@ smfcode.order.out.noTask=\u5DE5\u5355\u65E0\u53EF\u6267\u884C\u7684\u4EFB\u52A1
...
@@ -100,7 +100,15 @@ smfcode.order.out.noTask=\u5DE5\u5355\u65E0\u53EF\u6267\u884C\u7684\u4EFB\u52A1
smfcode.cannotUpdateOrderNum
=
\u
5DE5
\u5355\u
5DF2
\u
51FA
\u
5E93
\u
FF0C
\u
4E0D
\u
80FD
\u
4FEE
\u6539\u6570\u
91CF
smfcode.cannotUpdateOrderNum
=
\u
5DE5
\u5355\u
5DF2
\u
51FA
\u
5E93
\u
FF0C
\u
4E0D
\u
80FD
\u
4FEE
\u6539\u6570\u
91CF
smfcode.order.close.success
=
\u
5DE5
\u5355\u5173\u
95ED
\u6210\u
529F
smfcode.order.close.success
=
\u
5DE5
\u5355\u5173\u
95ED
\u6210\u
529F
smfcode.order.close.taskNotEnd
=
\u
5DE5
\u5355\u
8FD8
\u6709\u
672A
\u
5B8C
\u6210\u7684\u
4EFB
\u
52A1
smfcode.order.close.taskNotEnd
=
\u
5DE5
\u5355\u
8FD8
\u6709\u
672A
\u
5B8C
\u6210\u7684\u
4EFB
\u
52A1
smfcore.manualOut
=
\u
624B
\u
52A8
\u
51FA
\u
5E93
smfcode.error.barcode.noRules
=
\u
89E3
\u6790\u
89C4
\u5219\u
672A
\u
5B9A
\u
4E49
smfcode.error.barcode.wrongLength
=
\u6761\u7801
[{0}]
\u
957F
\u
5EA6
\u9519\u
8BEF
smfcode.error.barcode.noField
=
\u6761\u7801\u
89E3
\u6790\u5931\u
8D25,
\u
672A
\u
627E
\u5230
{0}
\u
5B57
\u
6BB5
smfcode.error.barcode.pnNotExist
=
x
\u6863\u6848
{0}
\u
4E0D
\u
5B58
\u5728
smfcode.error.barcode.invalid
=
{0}
\u
4E0D
\u
662F
\u6709\u6548\u7684\u6761\u7801
smfcode.error.barcode.locked
=
\u
5E93
\u
4F4D[{0}]
\u
5DF2
\u
88AB
\u9501\u
5B9A
smfcode.manualOut.ok
=
\u
624B
\u
52A8
\u
51FA
\u
5E93
\u6210\u
529F
smfcode.manualOut.notFound
=
\u
4ED3
\u
5E93
\u
4E2D
\u
672A
\u
627E
\u5230\u6599\u
76D8
\u
4FE1
\u
606F
...
...
src/main/resources/messages_en_US.properties
查看文件 @
6adc067
...
@@ -100,3 +100,12 @@ smfcode.order.out.noTask=Work order No executable tasks
...
@@ -100,3 +100,12 @@ smfcode.order.out.noTask=Work order No executable tasks
smfcode.cannotUpdateOrderNum
=
The work order has been issued and the quantity cannot be modified
smfcode.cannotUpdateOrderNum
=
The work order has been issued and the quantity cannot be modified
smfcode.order.close.success
=
Work order closed successfully
smfcode.order.close.success
=
Work order closed successfully
smfcode.order.close.taskNotEnd
=
Work orders with outstanding tasks
smfcode.order.close.taskNotEnd
=
Work orders with outstanding tasks
smfcore.manualOut
=
Manual outbound
smfcode.error.barcode.noRules
=
Parsing rules not defined
smfcode.error.barcode.wrongLength
=
The barcode [{0}] is of wrong length
smfcode.error.barcode.noField
=
Bar code parsing failed, {0} field not found
smfcode.error.barcode.pnNotExist
=
Material file {0} does not exist
smfcode.error.barcode.invalid
=
{0} is not a valid barcode
smfcode.error.barcode.locked
=
Library bit [{0}] is locked
smfcode.manualOut.ok
=
Manual exit successful
smfcode.manualOut.notFound
=
No tray information found
\ No newline at end of file
\ No newline at end of file
src/main/resources/messages_ja_JP.properties
查看文件 @
6adc067
...
@@ -100,3 +100,12 @@ smfcode.order.out.noTask=\u4F5C\u696D\u6307\u793A\u304C\u5B9F\u884C\u3067\u304D\
...
@@ -100,3 +100,12 @@ smfcode.order.out.noTask=\u4F5C\u696D\u6307\u793A\u304C\u5B9F\u884C\u3067\u304D\
smfcode.cannotUpdateOrderNum
=
\u
30EF
\u
30FC
\u
30AF
\u
30AA
\u
30FC
\u
30C0
\u
30FC
\u
304C
\u5728\u
5EAB
\u5207\u
308C
\u3067\u6570\u
91CF
\u
304C
\u5909\u
66F4
\u3067\u
304D
\u
306A
\u3044
smfcode.cannotUpdateOrderNum
=
\u
30EF
\u
30FC
\u
30AF
\u
30AA
\u
30FC
\u
30C0
\u
30FC
\u
304C
\u5728\u
5EAB
\u5207\u
308C
\u3067\u6570\u
91CF
\u
304C
\u5909\u
66F4
\u3067\u
304D
\u
306A
\u3044
smfcode.order.close.success=
\u
30EF
\u
30FC
\u
30AF
\u
30AA
\u
30FC
\u
30C0
\u
30FC
\u
304C
\u
6B63
\u
5E38
\u
306B
\u
7D42
\u
4E86
\u3057\u
307E
\u3057\u
305F
\u3002
smfcode.order.close.success=
\u
30EF
\u
30FC
\u
30AF
\u
30AA
\u
30FC
\u
30C0
\u
30FC
\u
304C
\u
6B63
\u
5E38
\u
306B
\u
7D42
\u
4E86
\u3057\u
307E
\u3057\u
305F
\u3002
smfcode.order.close.taskNotEnd
=
\u
672A
\u
51E6
\u7406\u
306E
\u
30BF
\u
30B9
\u
30AF
\u
304C
\u3042\u
308B
\u
30EF
\u
30FC
\u
30AF
\u
30AA
\u
30FC
\u
30C0
\u
30FC
smfcode.order.close.taskNotEnd
=
\u
672A
\u
51E6
\u7406\u
306E
\u
30BF
\u
30B9
\u
30AF
\u
304C
\u3042\u
308B
\u
30EF
\u
30FC
\u
30AF
\u
30AA
\u
30FC
\u
30C0
\u
30FC
smfcore.manualOut
=
\u
30DE
\u
30CB
\u
30E5
\u
30A2
\u
30EB
\u
30A2
\u
30A6
\u
30C8
\u
30D0
\u
30A6
\u
30F3
\u
30C9
smfcode.error.barcode.noRules
=
\u
69CB
\u6587\u
89E3
\u6790\u
30EB
\u
30FC
\u
30EB
\u
304C
\u
5B9A
\u
7FA9
\u3055\u
308C
\u3066\u3044\u
306A
\u3044
f
smfcode.error.barcode.wrongLength
=
\u
30D0
\u
30FC
\u
30B3
\u
30FC
\u
30C9[{0}]
\u
306E
\u9577\u3055\u
304C
\u
4E0D
\u
6B63
\u3067\u3059
smfcode.error.barcode.noField
=
\u
30D0
\u
30FC
\u
30B3
\u
30FC
\u
30C9
\u
306E
\u
89E3
\u6790\u
306B
\u5931\u6557\u3057\u
307E
\u3057\u
305F
\u3002\u
30D5
\u
30A3
\u
30FC
\u
30EB
\u
30C9{0}
\u
304C
\u
898B
\u3064\u
304B
\u
308A
\u
307E
\u
305B
\u3093
smfcode.error.barcode.pnNotExist
=
\u
30D5
\u
30A1
\u
30A4
\u
30EB{0}
\u
304C
\u
5B58
\u5728\u3057\u
306A
\u3044
smfcode.error.barcode.invalid
=
{0}
\u
306F
\u6709\u
52B9
\u
306A
\u
30D0
\u
30FC
\u
30B3
\u
30FC
\u
30C9
\u3067\u
306F
\u3042\u
308A
\u
307E
\u
305B
\u3093
smfcode.error.barcode.locked
=
\u
30E9
\u
30A4
\u
30D6
\u
30E9
\u
30EA
\u
30DD
\u
30B8
\u
30B7
\u
30E7
\u
30F3 [{0}]
\u
304C
\u
30ED
\u
30C3
\u
30AF
\u3055\u
308C
\u3066\u3044\u
308B
smfcode.manualOut.ok
=
\u
624B
\u
52D5
\u
7D42
\u
4E86
\u6210\u
529F
smfcode.manualOut.notFound
=
\u5009\u
5EAB
\u3067\u
30D1
\u
30EC
\u
30C3
\u
30C8
\u
60C5
\u5831\u
304C
\u
898B
\u3064\u
304B
\u3089\u
306A
\u3044
\ No newline at end of file
\ No newline at end of file
src/main/resources/messages_zh_CN.properties
查看文件 @
6adc067
...
@@ -100,3 +100,12 @@ smfcode.order.out.noTask=\u5DE5\u5355\u65E0\u53EF\u6267\u884C\u7684\u4EFB\u52A1
...
@@ -100,3 +100,12 @@ smfcode.order.out.noTask=\u5DE5\u5355\u65E0\u53EF\u6267\u884C\u7684\u4EFB\u52A1
smfcode.cannotUpdateOrderNum
=
\u
5DE5
\u5355\u
5DF2
\u
51FA
\u
5E93
\u
FF0C
\u
4E0D
\u
80FD
\u
4FEE
\u6539\u6570\u
91CF
smfcode.cannotUpdateOrderNum
=
\u
5DE5
\u5355\u
5DF2
\u
51FA
\u
5E93
\u
FF0C
\u
4E0D
\u
80FD
\u
4FEE
\u6539\u6570\u
91CF
smfcode.order.close.success
=
\u
5DE5
\u5355\u5173\u
95ED
\u6210\u
529F
smfcode.order.close.success
=
\u
5DE5
\u5355\u5173\u
95ED
\u6210\u
529F
smfcode.order.close.taskNotEnd
=
\u
5DE5
\u5355\u
8FD8
\u6709\u
672A
\u
5B8C
\u6210\u7684\u
4EFB
\u
52A1
smfcode.order.close.taskNotEnd
=
\u
5DE5
\u5355\u
8FD8
\u6709\u
672A
\u
5B8C
\u6210\u7684\u
4EFB
\u
52A1
smfcore.manualOut
=
\u
624B
\u
52A8
\u
51FA
\u
5E93
smfcode.error.barcode.noRules
=
\u
89E3
\u6790\u
89C4
\u5219\u
672A
\u
5B9A
\u
4E49
smfcode.error.barcode.wrongLength
=
\u6761\u7801
[{0}]
\u
957F
\u
5EA6
\u9519\u
8BEF
smfcode.error.barcode.noField
=
\u6761\u7801\u
89E3
\u6790\u5931\u
8D25,
\u
672A
\u
627E
\u5230
{0}
\u
5B57
\u
6BB5
smfcode.error.barcode.pnNotExist
=
x
\u6863\u6848
{0}
\u
4E0D
\u
5B58
\u5728
smfcode.error.barcode.invalid
=
{0}
\u
4E0D
\u
662F
\u6709\u6548\u7684\u6761\u7801
smfcode.error.barcode.locked
=
\u
5E93
\u
4F4D[{0}]
\u
5DF2
\u
88AB
\u9501\u
5B9A
smfcode.manualOut.ok
=
\u
624B
\u
52A8
\u
51FA
\u
5E93
\u6210\u
529F
smfcode.manualOut.notFound
=
\u
4ED3
\u
5E93
\u
4E2D
\u
672A
\u
627E
\u5230\u6599\u
76D8
\u
4FE1
\u
606F
\ No newline at end of file
\ No newline at end of file
src/main/resources/messages_zh_TW.properties
查看文件 @
6adc067
...
@@ -100,3 +100,12 @@ smfcode.order.out.noTask=\u5DE5\u55AE\u7121\u53EF\u57F7\u884C\u7684\u4EFB\u52D9
...
@@ -100,3 +100,12 @@ smfcode.order.out.noTask=\u5DE5\u55AE\u7121\u53EF\u57F7\u884C\u7684\u4EFB\u52D9
smfcode.cannotUpdateOrderNum
=
\u
5DE5
\u
55AE
\u
5DF2
\u
51FA
\u
5EAB
\u
FF0C
\u
4E0D
\u
80FD
\u
4FEE
\u6539\u6578\u
91CF
smfcode.cannotUpdateOrderNum
=
\u
5DE5
\u
55AE
\u
5DF2
\u
51FA
\u
5EAB
\u
FF0C
\u
4E0D
\u
80FD
\u
4FEE
\u6539\u6578\u
91CF
smfcode.order.close.success
=
\u
5DE5
\u
55AE
\u
95DC
\u9589\u6210\u
529F
smfcode.order.close.success
=
\u
5DE5
\u
55AE
\u
95DC
\u9589\u6210\u
529F
smfcode.order.close.taskNotEnd
=
\u
5DE5
\u
55AE
\u9084\u6709\u
672A
\u
5B8C
\u6210\u7684\u
4EFB
\u
52D9
smfcode.order.close.taskNotEnd
=
\u
5DE5
\u
55AE
\u9084\u6709\u
672A
\u
5B8C
\u6210\u7684\u
4EFB
\u
52D9
smfcore.manualOut
=
\u
624B
\u
52D5
\u
51FA
\u
5EAB
smfcode.error.barcode.noRules
=
\u
89E3
\u6790\u
898F
\u5247\u
672A
\u
5B9A
\u
7FA9
smfcode.error.barcode.wrongLength
=
\u
689D
\u
78BC[{0}]
\u9577\u
5EA6
\u
932F
\u
8AA4
smfcode.error.barcode.noField
=
\u
689D
\u
78BC
\u
89E3
\u6790\u5931\u6557\u
FF0C
\u
672A
\u
627E
\u5230
{0}
\u
5B57
\u
6BB5
smfcode.error.barcode.pnNotExist
=
\u
6A94
\u6848
{0}
\u
4E0D
\u
5B58
\u5728
smfcode.error.barcode.invalid
=
{0}
\u
4E0D
\u
662F
\u6709\u6548\u7684\u
689D
\u
78BC
smfcode.error.barcode.locked
=
\u
5EAB
\u
4F4D[{0}]
\u
5DF2
\u
88AB
\u9396\u
5B9A
smfcode.manualOut.ok
=
\u
624B
\u
52D5
\u
51FA
\u
5EAB
\u6210\u
529F
smfcode.manualOut.notFound
=
\u5009\u
5EAB
\u
4E2D
\u
672A
\u
627E
\u5230\u6599\u
76E4
\u
4FE1
\u
606F
\ No newline at end of file
\ No newline at end of file
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论