Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
孙克
/
smf-core
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 4b7908d5
由
LN
编写于
2021-12-16 10:53:37 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
资源全部改为smfcore类型
1 个父辈
73e9a9ae
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
47 个修改的文件
包含
247 行增加
和
239 行删除
src/main/java/com/neotel/smfcore/common/csv/CsvReader.java
src/main/java/com/neotel/smfcore/common/exception/ValidateException.java
src/main/java/com/neotel/smfcore/common/utils/FileUtil.java
src/main/java/com/neotel/smfcore/common/utils/UserCodeUtil.java
src/main/java/com/neotel/smfcore/core/barcode/bean/BarcodeRule.java
src/main/java/com/neotel/smfcore/core/barcode/rest/BarcodeController.java
src/main/java/com/neotel/smfcore/core/barcode/rest/ComponentController.java
src/main/java/com/neotel/smfcore/core/barcode/service/manager/impl/BarcodeManagerImpl.java
src/main/java/com/neotel/smfcore/core/barcode/service/manager/impl/ComponentManagerImpl.java
src/main/java/com/neotel/smfcore/core/barcode/utils/CodeResolve.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/BaseDeviceHandler.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLShelfHandler.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/SensorShelfHandler.java
src/main/java/com/neotel/smfcore/core/device/handler/impl/SpBoxHandler.java
src/main/java/com/neotel/smfcore/core/language/rest/LanguageMsgController.java
src/main/java/com/neotel/smfcore/core/language/rest/LanguageSetController.java
src/main/java/com/neotel/smfcore/core/language/service/nanager/impl/LanguageMsgManagerImpl.java
src/main/java/com/neotel/smfcore/core/language/util/MessageUtils.java
src/main/java/com/neotel/smfcore/core/msd/rest/MSDController.java
src/main/java/com/neotel/smfcore/core/order/LiteOrderCache.java
src/main/java/com/neotel/smfcore/core/order/rest/OrderController.java
src/main/java/com/neotel/smfcore/core/storage/rest/LabelController.java
src/main/java/com/neotel/smfcore/core/storage/rest/MaterialBoxController.java
src/main/java/com/neotel/smfcore/core/storage/rest/MaterialController.java
src/main/java/com/neotel/smfcore/core/storage/rest/StorageController.java
src/main/java/com/neotel/smfcore/core/storage/rest/StoragePosController.java
src/main/java/com/neotel/smfcore/core/storage/service/manager/impl/LabelManagerImpl.java
src/main/java/com/neotel/smfcore/core/storage/service/manager/impl/StoragePosManagerImpl.java
src/main/java/com/neotel/smfcore/core/system/rest/ClientSettingsController.java
src/main/java/com/neotel/smfcore/core/system/rest/SettingsController.java
src/main/java/com/neotel/smfcore/core/system/rest/TaskController.java
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
src/main/java/com/neotel/smfcore/hella/handler/HellaServiceHandler.java
src/main/java/com/neotel/smfcore/security/rest/GroupController.java
src/main/java/com/neotel/smfcore/security/rest/MenuController.java
src/main/java/com/neotel/smfcore/security/rest/RoleController.java
src/main/java/com/neotel/smfcore/security/rest/UserController.java
src/main/java/com/neotel/smfcore/security/service/UserDetailsServiceImpl.java
src/main/java/com/neotel/smfcore/security/service/manager/impl/GroupManagerImpl.java
src/main/java/com/neotel/smfcore/security/service/manager/impl/MenuManagerImpl.java
src/main/java/com/neotel/smfcore/security/service/manager/impl/RoleManagerImpl.java
src/main/java/com/neotel/smfcore/security/service/manager/impl/UserManagerImpl.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/common/csv/CsvReader.java
查看文件 @
4b7908d
...
...
@@ -266,7 +266,7 @@ public class CsvReader {
if
(
index
==
-
1
){
log
.
info
(
"未包含【"
+
titleName
+
"】或【"
+
titleNameEn
+
"】列"
);
// throw new ValidateException("必须包含["+titleNameEn+"]列");
throw
new
ValidateException
(
"smfco
d
e.columnNotExist"
,
"必须包含[{0}列"
,
new
String
[]{
titleNameEn
});
throw
new
ValidateException
(
"smfco
r
e.columnNotExist"
,
"必须包含[{0}列"
,
new
String
[]{
titleNameEn
});
}
return
index
;
}
...
...
src/main/java/com/neotel/smfcore/common/exception/ValidateException.java
查看文件 @
4b7908d
...
...
@@ -3,6 +3,8 @@ package com.neotel.smfcore.common.exception;
import
lombok.Data
;
import
org.springframework.http.HttpStatus
;
import
java.text.MessageFormat
;
import
static
org
.
springframework
.
http
.
HttpStatus
.
BAD_REQUEST
;
/**
...
...
@@ -25,10 +27,10 @@ public class ValidateException extends RuntimeException{
}
public
ValidateException
(
String
msgKey
,
String
defMsg
,
String
[]
msgParam
){
super
(
defMsg
);
super
(
defMsg
=
MessageFormat
.
format
(
defMsg
,
msgParam
)
);
this
.
msgKey
=
msgKey
;
this
.
msgParam
=
msgParam
;
this
.
defaultMsg
=
defMsg
;
this
.
defaultMsg
=
defMsg
;
}
public
ValidateException
(
HttpStatus
status
,
String
msg
){
...
...
src/main/java/com/neotel/smfcore/common/utils/FileUtil.java
查看文件 @
4b7908d
...
...
@@ -255,7 +255,7 @@ public class FileUtil extends cn.hutool.core.io.FileUtil {
// 1M
int
len
=
1024
*
1024
;
if
(
size
>
(
maxSize
*
len
))
{
throw
new
ValidateException
(
"smfco
d
e.fileToLong"
,
"文件超出规定大小"
);
throw
new
ValidateException
(
"smfco
r
e.fileToLong"
,
"文件超出规定大小"
);
}
}
...
...
src/main/java/com/neotel/smfcore/common/utils/UserCodeUtil.java
查看文件 @
4b7908d
...
...
@@ -62,7 +62,7 @@ public class UserCodeUtil {
if
(
index
==
-
1
){
log
.
info
(
"未包含【"
+
titleName
+
"】或【"
+
titleNameEn
+
"】列"
);
// throw new ValidateException("必须包含["+titleNameEn+"]列");
throw
new
ValidateException
(
"smfco
d
e.columnNotExist"
,
"必须包含[{0}列"
,
new
String
[]{
titleNameEn
});
throw
new
ValidateException
(
"smfco
r
e.columnNotExist"
,
"必须包含[{0}列"
,
new
String
[]{
titleNameEn
});
}
return
index
;
}
...
...
src/main/java/com/neotel/smfcore/core/barcode/bean/BarcodeRule.java
查看文件 @
4b7908d
...
...
@@ -497,7 +497,7 @@ public class BarcodeRule {
}
codeBean
.
setCodeStr
(
codeStr
);
if
(!
isValidRule
()){
codeBean
.
setError
(
"smfco
d
e.error.barcode.noRule"
,
"解析规则未定义"
);
codeBean
.
setError
(
"smfco
r
e.error.barcode.noRule"
,
"解析规则未定义"
);
return
codeBean
;
}
String
[]
codeArr
=
new
String
[]{
codeStr
};
...
...
@@ -506,7 +506,7 @@ public class BarcodeRule {
//条码与规则长度对应不上
if
(
codeArr
.
length
!=
length
){
log
.
info
(
"条码["
+
codeStr
+
"]与规则【"
+
ruleStr
+
"】长度不同"
);
codeBean
.
setError
(
"smfco
d
e.error.barcode.wrongLength"
,
new
String
[]{
codeStr
},
"条码[{0}]长度错误"
);
codeBean
.
setError
(
"smfco
r
e.error.barcode.wrongLength"
,
new
String
[]{
codeStr
},
"条码[{0}]长度错误"
);
return
codeBean
;
}
else
{
codeArr
=
codeStr
.
split
(
separator
,
length
);
...
...
@@ -525,7 +525,7 @@ public class BarcodeRule {
if
(
Strings
.
isNullOrEmpty
(
reelId
)){
log
.
info
(
"条码解析失败,未找到RI字段"
);
codeBean
.
setError
(
"smfco
d
e.error.barcode.noField"
,
new
String
[]{
"RI"
},
"条码解析失败,未找到{0}字段"
);
codeBean
.
setError
(
"smfco
r
e.error.barcode.noField"
,
new
String
[]{
"RI"
},
"条码解析失败,未找到{0}字段"
);
return
codeBean
;
}
...
...
@@ -533,7 +533,7 @@ public class BarcodeRule {
if
(
Strings
.
isNullOrEmpty
(
partNumber
)){
log
.
info
(
"条码解析失败,未找到PN字段"
);
codeBean
.
setError
(
"smfco
d
e.error.barcode.noField"
,
new
String
[]{
"PN"
},
"条码解析失败,未找到{0}字段"
);
codeBean
.
setError
(
"smfco
r
e.error.barcode.noField"
,
new
String
[]{
"PN"
},
"条码解析失败,未找到{0}字段"
);
return
codeBean
;
}
if
(
batch_item
.
hasThisField
()){
...
...
@@ -545,7 +545,7 @@ public class BarcodeRule {
quantity
=
quantity_item
.
getIntValue
(
codeArr
);
if
(
quantity
==
-
1
){
log
.
info
(
"条码解析失败,未找到QTY 字段"
);
codeBean
.
setError
(
"smfco
d
e.error.barcode.noField"
,
new
String
[]{
"QTY"
},
"条码解析失败,未找到{0}字段"
);
codeBean
.
setError
(
"smfco
r
e.error.barcode.noField"
,
new
String
[]{
"QTY"
},
"条码解析失败,未找到{0}字段"
);
return
codeBean
;
}
}
...
...
@@ -553,7 +553,7 @@ public class BarcodeRule {
Date
produceDate
=
produceDate_item
.
getDateValue
(
codeArr
);
if
(
produceDate_item
.
hasThisField
()
&&
produceDate
==
null
){
log
.
info
(
"条码解析失败,PRODATE字段不合规则"
);
codeBean
.
setError
(
"smfco
d
e.error.barcode.noField"
,
new
String
[]{
"PRODATE"
},
"条码解析失败,未找到{0}字段"
);
codeBean
.
setError
(
"smfco
r
e.error.barcode.noField"
,
new
String
[]{
"PRODATE"
},
"条码解析失败,未找到{0}字段"
);
return
codeBean
;
}
Date
expireDate
=
expireDate_item
.
getDateValue
(
codeArr
);
...
...
src/main/java/com/neotel/smfcore/core/barcode/rest/BarcodeController.java
查看文件 @
4b7908d
...
...
@@ -84,7 +84,7 @@ public class BarcodeController {
public
ResponseEntity
<
Object
>
update
(
@Validated
@RequestBody
BarcodeDto
resources
)
{
Barcode
barcode
=
barcodeMapper
.
toEntity
(
resources
);
if
(
barcode
.
getId
()
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
});
}
barcodeManager
.
saveBarcode
(
barcode
);
return
new
ResponseEntity
<>(
HttpStatus
.
OK
);
...
...
@@ -97,7 +97,7 @@ public class BarcodeController {
List
<
Barcode
>
barcodes
=
new
ArrayList
<
Barcode
>();
for
(
String
id
:
ids
)
{
if
(
id
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
}
}
barcodeManager
.
deleteBarcodes
(
ids
);
...
...
@@ -117,10 +117,10 @@ public class BarcodeController {
@PreAuthorize
(
"@el.check('barcode')"
)
public
ResponseEntity
<
Object
>
updateRules
(
@Validated
@RequestBody
List
<
String
>
codeRules
)
{
if
(
codeRules
.
isEmpty
()){
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"codeRuleList"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"codeRuleList"
}
);
}
if
(
codeRules
.
size
()>
10
){
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"codeRuleList"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"codeRuleList"
}
);
}
Settings
settings
=
dataCache
.
getSettings
();
settings
.
setCodeRuleList
(
codeRules
);
...
...
@@ -135,7 +135,7 @@ public class BarcodeController {
String
image
=
"csv"
;
String
fileType
=
FileUtil
.
getExtensionName
(
uploadFile
.
getOriginalFilename
());
if
(
fileType
!=
null
&&
!
image
.
contains
(
fileType
)){
throw
new
ValidateException
(
"smfco
d
e.feleFormatError"
,
"文件格式错误!, 仅支持{0}格式"
,
new
String
[]{
image
});
throw
new
ValidateException
(
"smfco
r
e.feleFormatError"
,
"文件格式错误!, 仅支持{0}格式"
,
new
String
[]{
image
});
}
File
folder
=
new
File
(
properties
.
getPath
(),
"pos"
);
File
file
=
FileUtil
.
upload
(
uploadFile
,
folder
.
getAbsolutePath
());
...
...
src/main/java/com/neotel/smfcore/core/barcode/rest/ComponentController.java
查看文件 @
4b7908d
...
...
@@ -76,7 +76,7 @@ public class ComponentController {
public
ResponseEntity
<
Object
>
update
(
@Validated
@RequestBody
ComponentDto
resources
)
{
Component
component
=
componentMapper
.
toEntity
(
resources
);
if
(
component
.
getId
()
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
}
componentManager
.
saveComponent
(
component
);
// //修改元器件时更新storagePos中的数据
...
...
@@ -97,7 +97,7 @@ public class ComponentController {
List
<
Component
>
Components
=
new
ArrayList
<
Component
>();
for
(
String
id
:
ids
)
{
if
(
id
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
}
}
componentManager
.
deleteComponents
(
ids
);
...
...
src/main/java/com/neotel/smfcore/core/barcode/service/manager/impl/BarcodeManagerImpl.java
查看文件 @
4b7908d
...
...
@@ -109,7 +109,7 @@ public class BarcodeManagerImpl implements IBarcodeManager {
//readID不能重复
Barcode
data
=
barcodeDao
.
findOne
(
query
);
if
(
data
!=
null
){
throw
new
ValidateException
(
"smfco
d
e.codeExist"
,
"条码["
+
resources
.
getBarcode
()+
"]已存在"
);
throw
new
ValidateException
(
"smfco
r
e.codeExist"
,
"条码["
+
resources
.
getBarcode
()+
"]已存在"
);
}
if
(
resources
.
getProvider
()==
null
){
...
...
@@ -177,19 +177,19 @@ public class BarcodeManagerImpl implements IBarcodeManager {
protected
void
validateSave
(
Barcode
barcode
)
throws
ValidateException
{
if
(
barcode
.
getBarcode
()==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"barcode"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"barcode"
}
);
// throw new ValidateException("barcode.error.empty");
}
if
(
barcode
.
getPartNumber
()==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"partNumber"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"partNumber"
}
);
// throw new ValidateException("["+barcode.getBarcode()+"]barcode.error.partNumber.empty");
}
if
(
barcode
.
getBatch
()
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"batch"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"batch"
}
);
// throw new ValidateException("批次不能为空");
}
if
(
barcode
.
getAmount
()
<
0
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"amout"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"amout"
}
);
// throw new ValidateException("["+barcode.getBarcode()+"]barcode.error.amount.negative" );
}
if
(!
validateUnique
(
barcode
))
{
...
...
src/main/java/com/neotel/smfcore/core/barcode/service/manager/impl/ComponentManagerImpl.java
查看文件 @
4b7908d
...
...
@@ -126,7 +126,7 @@ public class ComponentManagerImpl implements IComponentManager {
public
Component
saveComponent
(
Component
resources
)
{
if
(
resources
.
getPartNumber
()==
null
){
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"partNumber"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"partNumber"
}
);
// throw new BadRequestException("料号不能为空");
}
if
(
resources
.
getProvider
()==
null
){
...
...
@@ -153,7 +153,7 @@ public class ComponentManagerImpl implements IComponentManager {
}
Component
com
=
componentDao
.
findOne
(
new
Query
(
c
));
if
(
com
!=
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueAlreadyExist"
,
"{0}[{1}]已存在"
,
new
String
[]{
"partNumber"
,
resources
.
getPartNumber
()});
throw
new
ValidateException
(
"smfco
r
e.valueAlreadyExist"
,
"{0}[{1}]已存在"
,
new
String
[]{
"partNumber"
,
resources
.
getPartNumber
()});
// throw new BadRequestException("料号["+resources.getPartNumber()+"]已存在");
}
...
...
src/main/java/com/neotel/smfcore/core/barcode/utils/CodeResolve.java
查看文件 @
4b7908d
...
...
@@ -55,7 +55,7 @@ public class CodeResolve {
if
(
barcodeRuleList
==
null
||
barcodeRuleList
.
isEmpty
()){
CodeBean
codeBean
=
new
CodeBean
();
codeBean
.
setBarcode
(
null
);
codeBean
.
setError
(
"smfco
d
e.error.barcode.noRules"
,
"解析规则未定义"
);
codeBean
.
setError
(
"smfco
r
e.error.barcode.noRules"
,
"解析规则未定义"
);
codeBean
.
setCodeStr
(
barcodeItemStr
);
return
codeBean
;
}
...
...
@@ -195,7 +195,7 @@ public class CodeResolve {
if
(
component
==
null
){
log
.
info
(
"档案["
+
barcodeFromRule
.
getPartNumber
()+
"]不存在"
);
// throw new ValidateException("component.error.notExist",new String[]{barcodeFromRule.getPartNumber()});
throw
new
ValidateException
(
"smfco
d
e.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"component"
,
barcodeFromRule
.
getPartNumber
()});
throw
new
ValidateException
(
"smfco
r
e.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"component"
,
barcodeFromRule
.
getPartNumber
()});
}
codeBeanFromRule
.
setShowImg
(
component
.
getShowImg
());
...
...
@@ -219,21 +219,21 @@ public class CodeResolve {
}
}
catch
(
ValidateException
ve
){
//档案不存在
codeBeanFromRule
.
setError
(
"smfco
d
e.error.barcode.pnNotExist"
,
new
String
[]{
barcodeFromRule
.
getPartNumber
()},
"档案 {0} 不存在"
);
codeBeanFromRule
.
setError
(
"smfco
r
e.error.barcode.pnNotExist"
,
new
String
[]{
barcodeFromRule
.
getPartNumber
()},
"档案 {0} 不存在"
);
log
.
warn
(
"档案"
+
barcodeFromRule
.
getPartNumber
()+
"不存在"
);
}
//解析成功了,直接返回
return
codeBeanFromRule
;
}
else
{
//在数据库中不存在,且未解析成功,用其他规则再解析
codeBeanFromRule
.
setError
(
"smfco
d
e.error.barcode.invalid"
,
new
String
[]{
barcodeItemStr
},
"{0}不是有效的条码"
);
codeBeanFromRule
.
setError
(
"smfco
r
e.error.barcode.invalid"
,
new
String
[]{
barcodeItemStr
},
"{0}不是有效的条码"
);
}
}
if
(
codeBeanFromRule
==
null
){
codeBeanFromRule
=
new
CodeBean
();
codeBeanFromRule
.
setBarcode
(
null
);
codeBeanFromRule
.
setError
(
"smfco
d
e.error.barcode.invalid"
,
new
String
[]{
barcodeItemStr
},
"{0}不是有效的条码"
);
codeBeanFromRule
.
setError
(
"smfco
r
e.error.barcode.invalid"
,
new
String
[]{
barcodeItemStr
},
"{0}不是有效的条码"
);
codeBeanFromRule
.
setCodeStr
(
barcodeItemStr
);
return
codeBeanFromRule
;
}
...
...
@@ -333,7 +333,7 @@ public class CodeResolve {
if
(
barcode
==
null
){
barcode
=
barcodeFromRule
;
}
else
{
throw
new
ValidateException
(
"smfco
d
e.error.barcode.many"
,
"找到多个有效的条码"
,
new
String
[]{
codeStr
});
throw
new
ValidateException
(
"smfco
r
e.error.barcode.many"
,
"找到多个有效的条码"
,
new
String
[]{
codeStr
});
}
}
else
{
errorMsg
=
codeBean
.
getError
();
...
...
@@ -341,7 +341,7 @@ public class CodeResolve {
}
if
(
barcode
==
null
){
throw
new
ValidateException
(
"smfco
d
e.error.barcode.noValidCode"
,
"无效的条码"
,
new
String
[]{
codeBeans
.
size
()+
":"
,
codeStr
});
throw
new
ValidateException
(
"smfco
r
e.error.barcode.noValidCode"
,
"无效的条码"
,
new
String
[]{
codeBeans
.
size
()+
":"
,
codeStr
});
}
return
barcode
;
}
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/BaseDeviceHandler.java
查看文件 @
4b7908d
...
...
@@ -160,7 +160,7 @@ public class BaseDeviceHandler implements IDeviceHandler {
//同条码,但不是同料仓
log
.
error
(
"条码["
+
barcodeSave
.
getBarcode
()
+
"]任务正在执行,但任务料仓为:"
+
task
.
getStorageId
()
+
" 请求料仓为:"
+
task
.
getStorageId
());
//throw new ValidateException("条码["+barcodeSave.getBarcode()+"]任务正在执行");
throw
new
ValidateException
(
"smfco
d
e.error.barcode.executing"
,
"条码[{0}}]任务正在执行"
,
new
String
[]{
barcodeSave
.
getBarcode
()});
throw
new
ValidateException
(
"smfco
r
e.error.barcode.executing"
,
"条码[{0}}]任务正在执行"
,
new
String
[]{
barcodeSave
.
getBarcode
()});
}
}
...
...
@@ -176,19 +176,19 @@ public class BaseDeviceHandler implements IDeviceHandler {
storagePos
=
storagePosManager
.
getByPosName
(
posName
);
if
(
storagePos
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.error.pos.notExist"
,
"库位[{0}]不存在,无法入库"
,
new
String
[]{
posName
});
throw
new
ValidateException
(
"smfco
r
e.error.pos.notExist"
,
"库位[{0}]不存在,无法入库"
,
new
String
[]{
posName
});
}
if
(!
storage
.
getId
().
equals
(
storagePos
.
getStorageId
()))
{
throw
new
ValidateException
(
"smfco
d
e.error.pos.wrong"
,
"库位[{0}]与料仓[{1}}]不匹配,无法入库"
,
new
String
[]{
posName
,
storage
.
getCid
()});
throw
new
ValidateException
(
"smfco
r
e.error.pos.wrong"
,
"库位[{0}]与料仓[{1}}]不匹配,无法入库"
,
new
String
[]{
posName
,
storage
.
getCid
()});
}
if
(
storagePos
.
getBarcode
()
!=
null
)
{
throw
new
ValidateException
(
"smfco
d
e.error.pos.hasReel"
,
"库位[{0}]中已有物料,无法入库"
,
new
String
[]{
posName
});
throw
new
ValidateException
(
"smfco
r
e.error.pos.hasReel"
,
"库位[{0}]中已有物料,无法入库"
,
new
String
[]{
posName
});
}
if
(!
storage
.
canPutInPos
(
barcodeSave
.
getPlateSize
(),
barcodeSave
.
getHeight
(),
storagePos
.
getW
(),
storagePos
.
getH
()))
{
String
reelSize
=
barcodeSave
.
getPlateSize
()
+
"x"
+
barcodeSave
.
getHeight
();
String
posSize
=
storagePos
.
getW
()
+
"x"
+
storagePos
.
getH
();
throw
new
ValidateException
(
"smfco
d
e.error.pos.sizeNotMatch"
,
"料盘尺寸[{0}}]与库位{1}尺寸[{2}]不符,无法入库"
,
new
String
[]{
reelSize
,
posName
,
posSize
});
throw
new
ValidateException
(
"smfco
r
e.error.pos.sizeNotMatch"
,
"料盘尺寸[{0}}]与库位{1}尺寸[{2}]不符,无法入库"
,
new
String
[]{
reelSize
,
posName
,
posSize
});
}
}
else
{
...
...
@@ -265,7 +265,7 @@ public class BaseDeviceHandler implements IDeviceHandler {
//先查找空闲 BOX同尺寸的,如果找不到,再查找可入库 BOX 同尺寸或比盘尺寸大的仓位
StatusBean
statusBean
=
DevicesStatusUtil
.
getStatusBean
(
storageCid
);
if
(
statusBean
==
null
)
{
//当前料仓不可用
throw
new
ValidateException
(
"smfco
d
e.error.storage.offline"
,
"料仓[{0}]离线"
,
new
String
[]{
storageCid
});
throw
new
ValidateException
(
"smfco
r
e.error.storage.offline"
,
"料仓[{0}]离线"
,
new
String
[]{
storageCid
});
}
//还需要排除掉正在队列里的仓位
StoragePos
storagePos
=
null
;
...
...
@@ -312,7 +312,7 @@ public class BaseDeviceHandler implements IDeviceHandler {
public
Barcode
verifyBarcodePutIn
(
List
<
Storage
>
storageList
,
Barcode
barcodeSave
)
throws
ValidateException
{
if
(
barcodeSave
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.error.barcode.invalid"
,
"条码无效"
,
new
String
[]{
""
});
throw
new
ValidateException
(
"smfco
r
e.error.barcode.invalid"
,
"条码无效"
,
new
String
[]{
""
});
}
Date
expireDate
=
barcodeSave
.
getExpireDate
();
...
...
@@ -332,11 +332,11 @@ public class BaseDeviceHandler implements IDeviceHandler {
}
if
(!
canPutIn
){
throw
new
ValidateException
(
"smfco
d
e.error.barcode.wrongSize"
,
"尺寸[{0}]不符"
,
new
String
[]{
w
+
"x"
+
h
});
throw
new
ValidateException
(
"smfco
r
e.error.barcode.wrongSize"
,
"尺寸[{0}]不符"
,
new
String
[]{
w
+
"x"
+
h
});
}
if
(
barcodeSave
.
getAmount
()
<=
0
)
{
throw
new
ValidateException
(
"smfco
d
e.error.barcode.wrongQty"
,
"条码[{0}]对应的数量<=0为: {1}"
,
new
String
[]{
barcodeSave
.
getBarcode
(),
barcodeSave
.
getAmount
()
+
""
});
throw
new
ValidateException
(
"smfco
r
e.error.barcode.wrongQty"
,
"条码[{0}]对应的数量<=0为: {1}"
,
new
String
[]{
barcodeSave
.
getBarcode
(),
barcodeSave
.
getAmount
()
+
""
});
}
// if(barcodeSave.getPlateSize() <=0 || barcodeSave.getHeight() <= 0){
...
...
@@ -359,7 +359,7 @@ public class BaseDeviceHandler implements IDeviceHandler {
return
barcodeSave
;
}
}
throw
new
ValidateException
(
"smfco
d
e.error.barcode.taskNotEnd"
,
"料盘[{0}]的操作未完成,无法执行入库操作"
,
new
String
[]{
barcodeSave
.
getBarcode
()});
throw
new
ValidateException
(
"smfco
r
e.error.barcode.taskNotEnd"
,
"料盘[{0}]的操作未完成,无法执行入库操作"
,
new
String
[]{
barcodeSave
.
getBarcode
()});
}
}
}
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/NLShelfHandler.java
查看文件 @
4b7908d
...
...
@@ -141,11 +141,11 @@ public class NLShelfHandler extends BaseDeviceHandler {
private
void
canBarcodePutInPos
(
StoragePos
pos
,
Barcode
barcode
)
throws
ValidateException
{
if
(
pos
.
getBarcode
()
!=
null
){
throw
new
ValidateException
(
"smfco
d
e.shelf.nextPos.hasReel"
,
"库位[{0}]已有物料,请重新扫描库位码"
,
new
String
[]{
pos
.
getPosName
()});
throw
new
ValidateException
(
"smfco
r
e.shelf.nextPos.hasReel"
,
"库位[{0}]已有物料,请重新扫描库位码"
,
new
String
[]{
pos
.
getPosName
()});
}
Collection
<
String
>
excludePosIds
=
taskService
.
excludePosIds
();
if
(
excludePosIds
.
contains
(
pos
.
getId
())){
throw
new
ValidateException
(
"smfco
d
e.shelf.nextPos.hasTask"
,
"库位[{0}]已有任务,请重新扫描库位码"
,
new
String
[]{
pos
.
getPosName
()});
throw
new
ValidateException
(
"smfco
r
e.shelf.nextPos.hasTask"
,
"库位[{0}]已有任务,请重新扫描库位码"
,
new
String
[]{
pos
.
getPosName
()});
}
// if(barcode != null){
// Storage storage = dataCache.getStorageById(pos.getStorageId());
...
...
@@ -155,7 +155,7 @@ public class NLShelfHandler extends BaseDeviceHandler {
// if(!storage.canPutInPos(barcode.getPlateSize(),barcode.getHeight(), pos.getW(), pos.getH())){
// String reelSize = barcode.getPlateSize() + "x" + barcode.getHeight();
// String posSize = pos.getW() + "x" + pos.getH();
// throw new ValidateException("smfco
d
e.shelf.nextPos.wrongSize","库位["+pos.getPosName()+"]尺寸["+posSize+"]与料盘尺寸["+reelSize+"]不符,请重新扫描库位码",new String[]{pos.getPosName(),posSize, reelSize});
// throw new ValidateException("smfco
r
e.shelf.nextPos.wrongSize","库位["+pos.getPosName()+"]尺寸["+posSize+"]与料盘尺寸["+reelSize+"]不符,请重新扫描库位码",new String[]{pos.getPosName(),posSize, reelSize});
// }
// }
}
...
...
@@ -174,16 +174,16 @@ public class NLShelfHandler extends BaseDeviceHandler {
String
ptoken
=
token
.
substring
(
token
.
length
()-
10
);
String
loginUser
=
SecurityUtils
.
getLoginUsername
();
if
(
ObjectUtils
.
isEmpty
(
code
))
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"code"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"code"
});
}
if
(
groupId
==
null
&&
storageId
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"group"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"group"
});
}
Storage
currentStorage
=
null
;
if
(
groupId
==
null
&&
storageId
!=
null
)
{
currentStorage
=
dataCache
.
getStorageById
(
storageId
);
if
(
currentStorage
==
null
||
!
currentStorage
.
isNLShelf
())
{
return
ResultBean
.
newErrorResult
(
1
,
"smfco
d
e.shelf.notFound"
,
"未找到料架"
);
return
ResultBean
.
newErrorResult
(
1
,
"smfco
r
e.shelf.notFound"
,
"未找到料架"
);
}
if
(
currentStorage
!=
null
)
{
groupId
=
currentStorage
.
getGroupId
();
...
...
@@ -201,21 +201,21 @@ public class NLShelfHandler extends BaseDeviceHandler {
//判断库位是否是对应设备或者租
if
(
currentStorage
!=
null
)
{
if
(
!
pos
.
getStorageId
().
equals
(
storageId
))
{
return
ResultBean
.
newErrorResult
(
1
,
"smfco
d
e.shelf.pos.notInStorage"
,
"料架[{0}]中未找到库位[{1}]"
,
new
String
[]{
currentStorage
.
getName
(),
pos
.
getPosName
()});
return
ResultBean
.
newErrorResult
(
1
,
"smfco
r
e.shelf.pos.notInStorage"
,
"料架[{0}]中未找到库位[{1}]"
,
new
String
[]{
currentStorage
.
getName
(),
pos
.
getPosName
()});
}
}
else
{
currentStorage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
if
(
currentStorage
==
null
||
!
currentStorage
.
isNLShelf
())
{
return
ResultBean
.
newErrorResult
(
1
,
"smfco
d
e.shelf.notFound"
,
"未找到料架"
);
return
ResultBean
.
newErrorResult
(
1
,
"smfco
r
e.shelf.notFound"
,
"未找到料架"
);
}
if
(
currentStorage
.
getGroupId
()
!=
groupId
)
{
return
ResultBean
.
newErrorResult
(
1
,
"smfco
d
e.shelf.pos.notInGroup"
,
"组中未找到库位[{0}]"
,
new
String
[]{
pos
.
getPosName
()});
return
ResultBean
.
newErrorResult
(
1
,
"smfco
r
e.shelf.pos.notInGroup"
,
"组中未找到库位[{0}]"
,
new
String
[]{
pos
.
getPosName
()});
}
}
//扫描的为库位条码,先关掉上一个库位灯, 当前库位中没有物料的话点亮库位灯
closeLastPos
(
token
);
if
(
pos
.
getBarcode
()
!=
null
)
{
return
ResultBean
.
newErrorResult
(
1
,
"smfco
d
e.shelf.msg.hasReel"
,
"库位中[{0}]已有物料"
,
new
String
[]{
pos
.
getPosName
()});
return
ResultBean
.
newErrorResult
(
1
,
"smfco
r
e.shelf.msg.hasReel"
,
"库位中[{0}]已有物料"
,
new
String
[]{
pos
.
getPosName
()});
}
else
{
//设置上一个入库操作库位
openAndCloseLights
(
token
,
pos
,
putInColor
,
delayCloseTime
);
...
...
@@ -225,7 +225,7 @@ public class NLShelfHandler extends BaseDeviceHandler {
operateBean
.
setNextPosId
(
null
);
shelfPutInBeanMap
.
put
(
token
,
operateBean
);
log
.
info
(
ptoken
+
":库位["
+
pos
.
getPosName
()
+
"]操作成功,请扫描要放入的物料"
);
return
ResultBean
.
newOkResult
(
"smfco
d
e.shelf.msg.tipScanReel"
,
"库位["
+
pos
.
getPosName
()
+
"]操作成功,请扫描要放入的物料"
,
new
String
[]{
pos
.
getPosName
()},
""
);
return
ResultBean
.
newOkResult
(
"smfco
r
e.shelf.msg.tipScanReel"
,
"库位["
+
pos
.
getPosName
()
+
"]操作成功,请扫描要放入的物料"
,
new
String
[]{
pos
.
getPosName
()},
""
);
}
}
else
{
//扫的是物料条码
...
...
@@ -246,7 +246,7 @@ public class NLShelfHandler extends BaseDeviceHandler {
//5秒内同一个条码忽略
Date
usedDate
=
barcode
.
getUsedDate
();
if
(
usedDate
!=
null
&&
now
-
usedDate
.
getTime
()
<
5000
)
{
return
ResultBean
.
newErrorResult
(
1
,
"smfco
d
e.shelf.msg.fastop"
,
"条码操作频繁,请稍后再试"
);
return
ResultBean
.
newErrorResult
(
1
,
"smfco
r
e.shelf.msg.fastop"
,
"条码操作频繁,请稍后再试"
);
}
StoragePos
inPos
=
storagePosManager
.
getByBarcodeId
(
barcode
.
getId
());
...
...
@@ -256,15 +256,15 @@ public class NLShelfHandler extends BaseDeviceHandler {
for
(
DataLog
task
:
allTasks
)
{
if
(
task
.
isCheckOutTask
()
&&
task
.
getBarcode
()
!=
null
&&
task
.
getBarcode
().
equals
(
barcode
.
getBarcode
()))
{
// if(!sourceName.equalsIgnoreCase("All") && !sourceName.equals(task.getSourceName())){
// return ResultBean.newErrorResult(1,"smfco
d
e.shelf.error.orderError","任务与指定工单[{0}]不一致",new String[]{sourceName} );
// return ResultBean.newErrorResult(1,"smfco
r
e.shelf.error.orderError","任务与指定工单[{0}]不一致",new String[]{sourceName} );
// }
taskService
.
addTaskToFinished
(
inPos
,
null
,
loginUser
);
opPosLight
(
"close"
,
inPos
,
null
);
log
.
info
(
barcode
.
getBarcode
()
+
" 出库完成, 库位["
+
inPos
.
getPosName
()
+
"]灭灯"
);
return
ResultBean
.
newErrorResult
(
1
,
"smfco
d
e.shelf.msg.outConfirm"
,
"出库完成, 库位[{0}]灭灯"
,
new
String
[]{
inPos
.
getPosName
()}
);
return
ResultBean
.
newErrorResult
(
1
,
"smfco
r
e.shelf.msg.outConfirm"
,
"出库完成, 库位[{0}]灭灯"
,
new
String
[]{
inPos
.
getPosName
()}
);
}
}
return
ResultBean
.
newErrorResult
(
1
,
"smfco
d
e.shelf.msg.noTask"
,
"操作失败,已在库位[{0}]中,未找到对应的出库任务"
,
new
String
[]{
inPos
.
getPosName
()});
return
ResultBean
.
newErrorResult
(
1
,
"smfco
r
e.shelf.msg.noTask"
,
"操作失败,已在库位[{0}]中,未找到对应的出库任务"
,
new
String
[]{
inPos
.
getPosName
()});
}
//入库
...
...
@@ -275,7 +275,7 @@ public class NLShelfHandler extends BaseDeviceHandler {
String
operatePosId
=
operateBean
.
getNextPosId
();
if
(
Strings
.
isNullOrEmpty
(
operatePosId
))
{
log
.
info
(
ptoken
+
":条码["
+
code
+
"],请先扫描库位码"
);
return
ResultBean
.
newErrorResult
(
1
,
"smfco
d
e.shelf.msg.scanPos"
,
"请先扫描库位码"
);
return
ResultBean
.
newErrorResult
(
1
,
"smfco
r
e.shelf.msg.scanPos"
,
"请先扫描库位码"
);
}
else
{
//有下一个库位
StoragePos
currentPos
=
storagePosManager
.
get
(
String
.
valueOf
(
operatePosId
));
...
...
@@ -301,7 +301,7 @@ public class NLShelfHandler extends BaseDeviceHandler {
shelfPutInBeanMap
.
put
(
token
,
operateBean
);
log
.
info
(
ptoken
+
":条码["
+
code
+
"]入库操作成功,请放入库位 ["
+
currentPos
.
getPosName
()
+
"],下一个库位号:"
+
nextPosId
);
return
ResultBean
.
newOkResult
(
"smfco
d
e.shelf.msg.inOk"
,
"操作成功,请放入库位["
+
currentPos
.
getPosName
()
+
"]"
,
new
String
[]{
currentPos
.
getPosName
()},
""
);
return
ResultBean
.
newOkResult
(
"smfco
r
e.shelf.msg.inOk"
,
"操作成功,请放入库位["
+
currentPos
.
getPosName
()
+
"]"
,
new
String
[]{
currentPos
.
getPosName
()},
""
);
}
}
...
...
@@ -327,7 +327,7 @@ public class NLShelfHandler extends BaseDeviceHandler {
}
shelfPutInBeanMap
.
put
(
token
,
operateBean
);
log
.
info
(
ptoken
+
":条码["
+
code
+
"]入库操作成功,请放入库位 ["
+
opPos
.
getPosName
()+
"],下一个库位号:"
+
nextPosId
);
return
ResultBean
.
newOkResult
(
"smfco
d
e.shelf.msg.inOk"
,
"操作成功,请放入库位["
+
opPos
.
getPosName
()+
"]"
,
new
String
[]{
opPos
.
getPosName
()},
""
);
return
ResultBean
.
newOkResult
(
"smfco
r
e.shelf.msg.inOk"
,
"操作成功,请放入库位["
+
opPos
.
getPosName
()+
"]"
,
new
String
[]{
opPos
.
getPosName
()},
""
);
}
}
catch
(
ValidateException
e
)
{
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/SensorShelfHandler.java
查看文件 @
4b7908d
...
...
@@ -71,10 +71,10 @@ public class SensorShelfHandler extends BaseDeviceHandler {
String
groupId
=
mapValues
.
get
(
"group"
);
String
storageId
=
mapValues
.
get
(
"storageId"
);
if
(
ObjectUtils
.
isEmpty
(
code
)){
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"code"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"code"
});
}
if
(
groupId
==
null
&&
storageId
==
null
){
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"group"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"group"
});
}
if
(
groupId
==
null
&&
storageId
!=
null
){
Storage
storage
=
dataCache
.
getStorageById
(
storageId
);
...
...
@@ -127,7 +127,7 @@ public class SensorShelfHandler extends BaseDeviceHandler {
// CodeBean codeBean = codeResolve.resolveSingleCode(codeStr);
if
(
barcode
==
null
||
barcode
.
getBarcode
()
==
null
)
{
return
ResultBean
.
newErrorResult
(
1
,
"smfco
d
e.error.barcode.invalid"
,
"条码无效"
);
return
ResultBean
.
newErrorResult
(
1
,
"smfco
r
e.error.barcode.invalid"
,
"条码无效"
);
}
String
pn
=
barcode
.
getPartNumber
();
...
...
src/main/java/com/neotel/smfcore/core/device/handler/impl/SpBoxHandler.java
查看文件 @
4b7908d
...
...
@@ -133,7 +133,7 @@ public class SpBoxHandler extends BaseDeviceHandler {
//同条码,但不是同料仓
log
.
error
(
"条码["
+
barcodeSave
.
getBarcode
()
+
"]任务正在执行,但任务料仓为:"
+
task
.
getStorageId
()
+
" 请求料仓为:"
+
task
.
getStorageId
());
//throw new ValidateException("条码["+barcodeSave.getBarcode()+"]任务正在执行");
throw
new
ValidateException
(
"smfco
d
e.error.barcode.executing"
,
"条码[{0}}]任务正在执行"
,
new
String
[]{
barcodeSave
.
getBarcode
()});
throw
new
ValidateException
(
"smfco
r
e.error.barcode.executing"
,
"条码[{0}}]任务正在执行"
,
new
String
[]{
barcodeSave
.
getBarcode
()});
}
}
...
...
@@ -150,19 +150,19 @@ public class SpBoxHandler extends BaseDeviceHandler {
storagePos
=
storagePosManager
.
getByPosName
(
posName
);
if
(
storagePos
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.error.pos.notExist"
,
"库位【{0}】不存在,无法入库"
,
new
String
[]{
posName
});
throw
new
ValidateException
(
"smfco
r
e.error.pos.notExist"
,
"库位【{0}】不存在,无法入库"
,
new
String
[]{
posName
});
}
if
(!
storage
.
getId
().
equals
(
storagePos
.
getStorageId
()))
{
throw
new
ValidateException
(
"smfco
d
e.error.pos.wrong"
,
"库位【{0}】与料仓[{1}]不匹配,无法入库"
,
new
String
[]{
posName
,
storage
.
getCid
()});
throw
new
ValidateException
(
"smfco
r
e.error.pos.wrong"
,
"库位【{0}】与料仓[{1}]不匹配,无法入库"
,
new
String
[]{
posName
,
storage
.
getCid
()});
}
if
(
storagePos
.
getBarcode
()
!=
null
)
{
throw
new
ValidateException
(
"smfco
d
e.error.pos.hasReel"
,
"库位【{0}】中已有物料,无法入库"
,
new
String
[]{
posName
});
throw
new
ValidateException
(
"smfco
r
e.error.pos.hasReel"
,
"库位【{0}】中已有物料,无法入库"
,
new
String
[]{
posName
});
}
if
(!
storage
.
canPutInPos
(
barcodeSave
.
getPlateSize
(),
barcodeSave
.
getHeight
(),
storagePos
.
getW
(),
storagePos
.
getH
()))
{
String
reelSize
=
barcodeSave
.
getPlateSize
()
+
"x"
+
barcodeSave
.
getHeight
();
String
posSize
=
storagePos
.
getW
()
+
"x"
+
storagePos
.
getH
();
throw
new
ValidateException
(
"smfco
d
e.error.pos.sizeNotMatch"
,
"料盘尺寸[{0}]与库位{1}尺寸[{2}]不符,无法入库"
,
new
String
[]{
reelSize
,
posName
,
posSize
});
throw
new
ValidateException
(
"smfco
r
e.error.pos.sizeNotMatch"
,
"料盘尺寸[{0}]与库位{1}尺寸[{2}]不符,无法入库"
,
new
String
[]{
reelSize
,
posName
,
posSize
});
}
}
else
{
...
...
src/main/java/com/neotel/smfcore/core/language/rest/LanguageMsgController.java
查看文件 @
4b7908d
...
...
@@ -80,10 +80,10 @@ public class LanguageMsgController {
String
csvType
=
"csv"
;
String
fileType
=
FileUtil
.
getExtensionName
(
uploadFile
.
getOriginalFilename
());
if
(
fileType
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.feleFormatError"
,
"文件格式错误!, 仅支持{0}格式"
,
new
String
[]{
csvType
+
"/"
+
smfclientType
+
"/"
+
smfcoreType
});
throw
new
ValidateException
(
"smfco
r
e.feleFormatError"
,
"文件格式错误!, 仅支持{0}格式"
,
new
String
[]{
csvType
+
"/"
+
smfclientType
+
"/"
+
smfcoreType
});
}
if
((!
smfclientType
.
contains
(
fileType
))
&&
!
smfcoreType
.
contains
(
fileType
)
&&
!
csvType
.
contains
(
fileType
))
{
throw
new
ValidateException
(
"smfco
d
e.feleFormatError"
,
"文件格式错误!, 仅支持{0}格式"
,
new
String
[]{
csvType
+
"/"
+
smfclientType
+
"/"
+
smfcoreType
});
throw
new
ValidateException
(
"smfco
r
e.feleFormatError"
,
"文件格式错误!, 仅支持{0}格式"
,
new
String
[]{
csvType
+
"/"
+
smfclientType
+
"/"
+
smfcoreType
});
}
File
folder
=
new
File
(
properties
.
getPath
(),
"resource"
);
File
file
=
FileUtil
.
upload
(
uploadFile
,
folder
.
getAbsolutePath
());
...
...
@@ -168,7 +168,7 @@ public class LanguageMsgController {
public
ResponseEntity
<
Object
>
update
(
@RequestBody
LanguageMsgDto
resources
)
{
LanguageMsg
msg
=
languageMsgMapper
.
toEntity
(
resources
);
if
(
msg
.
getId
()
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
});
}
languageMsgManager
.
saveMsg
(
msg
);
return
new
ResponseEntity
<>(
HttpStatus
.
OK
);
...
...
@@ -180,7 +180,7 @@ public class LanguageMsgController {
for
(
String
id
:
ids
)
{
if
(
id
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
}
}
languageMsgManager
.
deleteMsgs
(
ids
);
...
...
src/main/java/com/neotel/smfcore/core/language/rest/LanguageSetController.java
查看文件 @
4b7908d
...
...
@@ -58,11 +58,11 @@ public class LanguageSetController {
//判断是否是admin
String
userName
=
SecurityUtils
.
getCurrentUsername
();
if
(!
userName
.
equals
(
Constants
.
SUPER_USERNAME
))
{
throw
new
ValidateException
(
"smfco
d
e.noLanguageSetAccess"
,
"没有编辑语言的权限"
);
throw
new
ValidateException
(
"smfco
r
e.noLanguageSetAccess"
,
"没有编辑语言的权限"
);
}
if
(
newLan
==
null
||
ObjectUtil
.
isEmpty
(
newLan
.
getLanCode
())
||
ObjectUtil
.
isEmpty
(
newLan
.
getLanName
()))
{
throw
new
ValidateException
(
"smfco
d
e.languageCanotNull"
,
"语言类型不能为空"
);
throw
new
ValidateException
(
"smfco
r
e.languageCanotNull"
,
"语言类型不能为空"
);
}
List
<
LanguageInfo
>
languageTypeList
=
getAllLanList
();
...
...
@@ -70,7 +70,7 @@ public class LanguageSetController {
for
(
LanguageInfo
lan
:
languageTypeList
)
{
if
(
lan
.
getLanCode
().
equals
(
newLan
.
getLanCode
()))
{
throw
new
ValidateException
(
"smfco
d
e.languageAlreadyExist "
,
"语言[{0}]已存在"
,
new
String
[]{
newLan
.
getLanCode
()});
throw
new
ValidateException
(
"smfco
r
e.languageAlreadyExist "
,
"语言[{0}]已存在"
,
new
String
[]{
newLan
.
getLanCode
()});
}
}
...
...
@@ -88,12 +88,12 @@ public class LanguageSetController {
//判断是否是admin
String
userName
=
SecurityUtils
.
getCurrentUsername
();
if
(!
userName
.
equals
(
Constants
.
SUPER_USERNAME
))
{
throw
new
ValidateException
(
"smfco
d
e.noLanguageSetAccess"
,
"没有编辑语言的权限"
);
throw
new
ValidateException
(
"smfco
r
e.noLanguageSetAccess"
,
"没有编辑语言的权限"
);
}
List
<
LanguageInfo
>
languageTypeList
=
getAllLanList
();
for
(
String
type
:
lanCodes
)
{
if
(
type
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.languageCanotNull"
,
"语言类型不能为空"
);
throw
new
ValidateException
(
"smfco
r
e.languageCanotNull"
,
"语言类型不能为空"
);
}
}
...
...
@@ -107,7 +107,7 @@ public class LanguageSetController {
lancode
.
equals
(
MessageUtils
.
JA_JP
)
||
lancode
.
equals
(
MessageUtils
.
EN_US
)
)
{
throw
new
ValidateException
(
"smfco
d
e.canotRemove"
,
"不能删除此语言"
);
throw
new
ValidateException
(
"smfco
r
e.canotRemove"
,
"不能删除此语言"
);
}
}
List
<
LanguageInfo
>
newList
=
new
ArrayList
<>();
...
...
@@ -120,7 +120,7 @@ public class LanguageSetController {
}
}
if
(
newList
==
null
||
newList
.
size
()
<=
0
)
{
throw
new
ValidateException
(
"smfco
d
e.languageCanotRemoveAll"
,
"不能删除所有语言"
);
throw
new
ValidateException
(
"smfco
r
e.languageCanotRemoveAll"
,
"不能删除所有语言"
);
}
dataCache
.
updateCache
(
Constants
.
CACHE_languageType
,
newList
);
...
...
src/main/java/com/neotel/smfcore/core/language/service/nanager/impl/LanguageMsgManagerImpl.java
查看文件 @
4b7908d
...
...
@@ -90,13 +90,13 @@ public class LanguageMsgManagerImpl implements ILanguageMsgManager {
@Override
public
LanguageMsg
saveMsg
(
LanguageMsg
resources
)
{
if
(
resources
.
getCode
()
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"code"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"code"
});
}
if
(
resources
.
getMsg
()
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"msg"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"msg"
});
}
if
(
resources
.
getType
()
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"type"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"type"
});
}
if
(
resources
.
getContentList
()
==
null
)
{
resources
.
setContentList
(
new
ArrayList
<>());
...
...
@@ -109,7 +109,7 @@ public class LanguageMsgManagerImpl implements ILanguageMsgManager {
}
//code不能重复
LanguageMsg
result
=
languageMsgDao
.
findOne
(
new
Query
(
c
));
if
(
result
!=
null
)
{
throw
new
ValidateException
(
"smfco
d
e.resourcesExist"
,
"资源["
+
resources
.
getCode
()
+
"]已存在"
);
throw
new
ValidateException
(
"smfco
r
e.resourcesExist"
,
"资源["
+
resources
.
getCode
()
+
"]已存在"
);
}
Query
query
=
new
Query
(
c
);
...
...
src/main/java/com/neotel/smfcore/core/language/util/MessageUtils.java
查看文件 @
4b7908d
...
...
@@ -112,7 +112,7 @@ public class MessageUtils {
msg
.
getContentList
())
{
String
lanT
=
con
.
getLanCode
();
if
(
lanT
.
equals
(
lanType
))
{
if
(
lanT
.
equals
(
lanType
)
&&
ObjectUtil
.
isNotEmpty
(
con
.
getMsg
())
)
{
return
con
.
getMsg
();
}
}
...
...
@@ -151,6 +151,12 @@ public class MessageUtils {
List
<
LanguageMsg
>
msgs
=
languageMsgManager
.
findByQuery
(
new
Query
());
for
(
LanguageMsg
msg
:
msgs
)
{
if
(
msg
.
getCode
().
startsWith
(
"smfcode."
)||
msg
.
getType
().
equals
(
"smfcode"
)){
String
newCode
=
msg
.
getCode
().
replace
(
"smfcode."
,
"smfcore."
);
msg
.
setCode
(
newCode
);
msg
.
setType
(
"smfcore"
);
languageMsgManager
.
save
(
msg
);
}
msgMap
.
put
(
msg
.
getCode
(),
msg
);
}
log
.
info
(
"MessageCache共加载到"
+
msgMap
.
size
()
+
"条Msg"
);
...
...
src/main/java/com/neotel/smfcore/core/msd/rest/MSDController.java
查看文件 @
4b7908d
...
...
@@ -116,11 +116,11 @@ public class MSDController {
MSDSettiings
settiings
=
msdSettingsMapper
.
toEntity
(
msdSettiingsDto
);
if
(
settiings
.
getMaxHumidity
()
<=
settiings
.
getMinHumidity
())
{
throw
new
ValidateException
(
"smfco
d
e.humidityValueError"
,
"温度范围数据错误"
);
throw
new
ValidateException
(
"smfco
r
e.humidityValueError"
,
"温度范围数据错误"
);
}
if
(
settiings
.
getMaxTemperature
()
<=
settiings
.
getMinTemperature
())
{
throw
new
ValidateException
(
"smfco
d
e.temperatureValueError"
,
"湿度范围数据错误"
);
throw
new
ValidateException
(
"smfco
r
e.temperatureValueError"
,
"湿度范围数据错误"
);
}
dataCache
.
updateCache
(
Constants
.
CACHE_msdSetting
,
settiings
);
log
.
info
(
"更改MSD:CACHE_msdSetting="
+
settiings
.
toString
());
...
...
@@ -193,11 +193,11 @@ public class MSDController {
String
posName
=
paramsMap
.
get
(
"posName"
);
StoragePos
pos
=
storagePosManager
.
getByPosName
(
posName
);
if
(
pos
==
null
||
(
pos
.
isUsed
()
==
false
)
||
pos
.
getBarcode
()
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.msd.noPos"
,
"未找到可开封的物料"
);
throw
new
ValidateException
(
"smfco
r
e.msd.noPos"
,
"未找到可开封的物料"
);
}
Barcode
barcode
=
barcodeManager
.
findByBarcode
(
pos
.
getBarcode
().
getBarcode
());
if
(
barcode
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.msd.noPos"
,
"未找到可开封的物料"
);
throw
new
ValidateException
(
"smfco
r
e.msd.noPos"
,
"未找到可开封的物料"
);
}
DateTime
dateTime
=
new
DateTime
();
pos
.
getBarcode
().
setOpenTime
(
dateTime
);
...
...
src/main/java/com/neotel/smfcore/core/order/LiteOrderCache.java
查看文件 @
4b7908d
...
...
@@ -302,22 +302,22 @@ public class LiteOrderCache implements ITaskListener {
}
if
(
cacheOrder
==
null
)
{
return
"smfco
d
e.order.out.notFound"
;
return
"smfco
r
e.order.out.notFound"
;
}
if
(
!
cacheOrder
.
isTaskFinished
()
&&
!
cacheOrder
.
isNew
())
{
log
.
info
(
"工单["
+
orderNo
+
"]正在执行"
);
return
"smfco
d
e.order.out.executing"
;
return
"smfco
r
e.order.out.executing"
;
}
if
(
cacheOrder
.
isClosed
())
{
log
.
info
(
"工单["
+
orderNo
+
"]已关闭,无法出库"
);
return
"smfco
d
e.order.hasClose"
;
return
"smfco
r
e.order.hasClose"
;
}
ORDER_COLOR
nextColor
=
getNextColor
();
if
(
nextColor
==
null
)
{
log
.
info
(
"执行工单["
+
orderNo
+
"] outBom="
+
outBom
+
"时,已达最大可执行工单数"
);
return
"smfco
d
e.order.out.maxOrder"
;
return
"smfco
r
e.order.out.maxOrder"
;
}
log
.
info
(
"开始执行工单["
+
orderNo
+
"] outBom="
+
outBom
);
...
...
@@ -409,7 +409,7 @@ public class LiteOrderCache implements ITaskListener {
liteOrderMap
.
put
(
cacheOrder
.
getOrderNo
(),
cacheOrder
);
if
(
taskReelCount
<=
0
)
{
//return "工单无可执行的任务";
return
"smfco
d
e.order.out.noTask"
;
return
"smfco
r
e.order.out.noTask"
;
}
return
""
;
}
...
...
@@ -445,7 +445,7 @@ public class LiteOrderCache implements ITaskListener {
if
(
liteOrder
==
null
)
{
liteOrder
=
liteOrderManager
.
findByOrderNo
(
orderNo
);
if
(
liteOrder
==
null
){
return
"smfco
d
e.order.out.notFound"
;
return
"smfco
r
e.order.out.notFound"
;
}
}
//有任务的工单不能关闭
...
...
@@ -457,7 +457,7 @@ public class LiteOrderCache implements ITaskListener {
String
taskSourceName
=
task
.
getSourceName
();
if
(!
Strings
.
isNullOrEmpty
(
taskSourceName
)
&&
orderNo
.
equals
(
taskSourceName
))
{
log
.
info
(
"关闭工单["
+
orderNo
+
"]失败,有未完成的出库任务:"
+
task
.
getPosName
());
return
"smfco
d
e.order.close.taskNotEnd"
;
return
"smfco
r
e.order.close.taskNotEnd"
;
}
}
}
...
...
@@ -467,7 +467,7 @@ public class LiteOrderCache implements ITaskListener {
log
.
info
(
"关闭工单["
+
orderNo
+
"]成功"
);
liteOrder
.
setClosed
(
true
);
liteOrderManager
.
save
(
liteOrder
);
return
"smfco
d
e.order.close.success"
;
return
"smfco
r
e.order.close.success"
;
}
/**
...
...
@@ -481,11 +481,11 @@ public class LiteOrderCache implements ITaskListener {
if
(
cacheOrder
==
null
)
{
cacheOrder
=
liteOrderManager
.
findByOrderNo
(
orderNo
);
if
(
cacheOrder
==
null
){
return
"smfco
d
e.order.out.notFound"
;
return
"smfco
r
e.order.out.notFound"
;
}
}
if
(
cacheOrder
.
isClosed
()){
return
"smfco
d
e.order.hasClose"
;
return
"smfco
r
e.order.hasClose"
;
}
for
(
LiteOrderItem
orderItem:
cacheOrder
.
getOrderItems
()
...
...
@@ -508,7 +508,7 @@ public class LiteOrderCache implements ITaskListener {
pos
=
storagePosManager
.
findPartNumberInStorages
(
availableStorageIds
,
partNumber
,
excludePosIds
,
checkoutType
);
}
if
(
pos
==
null
)
{
return
"smfco
d
e.order.supplementOutFail"
;
return
"smfco
r
e.order.supplementOutFail"
;
}
else
{
log
.
info
(
"工单["
+
orderNo
+
"]["
+
partNumber
+
"]补料出库:仓位["
+
pos
.
getPosName
()
+
"]RI=["
+
pos
.
getBarcode
().
getBarcode
()
+
"] PN=["
+
partNumber
+
"] num:"
+
pos
.
getBarcode
().
getAmount
());
DataLog
task
=
newTask
(
pos
)
;
...
...
@@ -527,6 +527,6 @@ public class LiteOrderCache implements ITaskListener {
}
}
}
return
"smfco
d
e.order.supplementOutFail"
;
return
"smfco
r
e.order.supplementOutFail"
;
}
}
src/main/java/com/neotel/smfcore/core/order/rest/OrderController.java
查看文件 @
4b7908d
...
...
@@ -147,7 +147,7 @@ public class OrderController {
liteOrder
.
setOrderNo
(
newOrderNo
);
}
else
{
log
.
info
(
"数据库中已存在工单号为["
+
liteOrder
.
getOrderNo
()
+
"],忽略文件:"
+
localFile
.
getAbsolutePath
());
return
ResultBean
.
newErrorResult
(-
1
,
"smfco
d
e.order.ameExists"
,
"工单名称[{0}]已存在"
,
new
String
[]{
liteOrder
.
getOrderNo
()});
return
ResultBean
.
newErrorResult
(-
1
,
"smfco
r
e.order.ameExists"
,
"工单名称[{0}]已存在"
,
new
String
[]{
liteOrder
.
getOrderNo
()});
}
}
log
.
info
(
"新增加订单:"
+
liteOrder
.
getOrderNo
()
+
",共"
+
liteOrderItems
.
size
()
+
"条工单详情"
);
...
...
@@ -155,7 +155,7 @@ public class OrderController {
liteOrderCache
.
addOrderToMap
(
liteOrder
);
}
return
ResultBean
.
newOkResult
(
"smfco
d
e.order.uploadOK"
,
"工单上传成功"
,
""
);
return
ResultBean
.
newOkResult
(
"smfco
r
e.order.uploadOK"
,
"工单上传成功"
,
""
);
}
@ApiOperation
(
"工单出库"
)
...
...
@@ -164,11 +164,11 @@ public class OrderController {
public
ResultBean
checkOut
(
@RequestBody
Map
<
String
,
String
>
mapValues
)
{
String
orderNo
=
mapValues
.
get
(
"orderNo"
);
if
(
orderNo
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"orderNo"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"orderNo"
});
}
LiteOrder
liteOrder
=
liteOrderManager
.
findByOrderNo
(
orderNo
);
if
(
liteOrder
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueNotFind"
,
"未找到{0}[{1}]"
,
new
String
[]{
"orderNo"
,
orderNo
});
throw
new
ValidateException
(
"smfco
r
e.valueNotFind"
,
"未找到{0}[{1}]"
,
new
String
[]{
"orderNo"
,
orderNo
});
}
String
result
=
liteOrderCache
.
checkOutLiteOrder
(
liteOrder
.
getOrderNo
(),
false
);
if
(
ObjectUtil
.
isEmpty
(
result
)){
...
...
@@ -185,7 +185,7 @@ public class OrderController {
public
ResultBean
outBom
(
@RequestBody
Map
<
String
,
String
>
mapValues
)
{
String
orderNo
=
mapValues
.
get
(
"orderNo"
);
if
(
orderNo
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"orderNo"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"orderNo"
});
}
String
result
=
liteOrderCache
.
checkOutLiteOrder
(
orderNo
,
true
);
if
(
ObjectUtil
.
isEmpty
(
result
)){
...
...
@@ -202,7 +202,7 @@ public class OrderController {
public
ResultBean
outTails
(
@RequestBody
Map
<
String
,
String
>
mapValues
)
{
String
orderNo
=
mapValues
.
get
(
"orderNo"
);
if
(
orderNo
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"orderNo"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"orderNo"
});
}
String
result
=
liteOrderCache
.
checkOutLiteOrder
(
orderNo
,
false
);
...
...
@@ -220,7 +220,7 @@ public class OrderController {
String
orderNo
=
mapValues
.
get
(
"orderNo"
);
String
orderItemId
=
mapValues
.
get
(
"orderItemId"
);
if
(
orderNo
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"orderNo"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"orderNo"
});
}
String
result
=
liteOrderCache
.
orderItemSupplementOut
(
orderNo
,
orderItemId
);
if
(
ObjectUtil
.
isEmpty
(
result
)){
...
...
@@ -369,7 +369,7 @@ public class OrderController {
}
}
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"orderNo"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"orderNo"
});
}
...
...
@@ -381,14 +381,14 @@ public class OrderController {
float
orderTimes
=
param
.
getOrderTimes
();
if
(
orderNo
==
null
)
{
// throw new ValidateException("工单号不能为空");
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"orderNo"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"orderNo"
});
}
LiteOrder
liteOrder
=
liteOrderManager
.
findByOrderNo
(
orderNo
);
if
(
liteOrder
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueNotFind"
,
"未找到{0}[{1}]"
,
new
String
[]{
"orderNo"
,
orderNo
});
throw
new
ValidateException
(
"smfco
r
e.valueNotFind"
,
"未找到{0}[{1}]"
,
new
String
[]{
"orderNo"
,
orderNo
});
}
if
(!
liteOrder
.
isNew
()){
throw
new
ValidateException
(
"smfco
d
e.cannotUpdateOrderNum"
,
"工单已出库,不能修改数量"
);
throw
new
ValidateException
(
"smfco
r
e.cannotUpdateOrderNum"
,
"工单已出库,不能修改数量"
);
}
if
(
orderTimes
<
1
){
orderTimes
=
1
;
...
...
@@ -405,7 +405,7 @@ public class OrderController {
public
ResultBean
closeOrder
(
@RequestBody
Map
<
String
,
String
>
mapValues
)
{
String
orderNo
=
mapValues
.
get
(
"orderNo"
);
if
(
orderNo
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"orderNo"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"orderNo"
});
}
String
result
=
liteOrderCache
.
closeOrder
(
orderNo
);
...
...
@@ -422,19 +422,19 @@ public class OrderController {
@PreAuthorize
(
"@el.check('workOrder')"
)
public
ResultBean
updateLine
(
@RequestBody
OrderDto
param
)
{
if
(
param
.
getId
()
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"orderNo"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"orderNo"
});
}
if
(
param
.
getLine
()
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.order.lineCanotNull"
,
"线别不能为空"
);
throw
new
ValidateException
(
"smfco
r
e.order.lineCanotNull"
,
"线别不能为空"
);
}
LiteOrder
order
=
liteOrderManager
.
get
(
param
.
getId
());
if
(
order
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"orderNo"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"orderNo"
});
}
if
(!
order
.
isNew
())
{
throw
new
ValidateException
(
"smfco
d
e.order.cannotUpdateLine"
,
"工单已出库,不能修改线别"
);
throw
new
ValidateException
(
"smfco
r
e.order.cannotUpdateLine"
,
"工单已出库,不能修改线别"
);
}
order
.
setLine
(
param
.
getLine
());
liteOrderManager
.
save
(
order
);
...
...
src/main/java/com/neotel/smfcore/core/storage/rest/LabelController.java
查看文件 @
4b7908d
...
...
@@ -66,7 +66,7 @@ public class LabelController {
public
ResponseEntity
<
Object
>
update
(
@RequestBody
LabelDto
labelDto
)
{
Label
resources
=
labelMapper
.
toEntity
(
labelDto
);
if
(
resources
.
getId
()
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
}
labelManager
.
saveLabel
(
resources
);
return
new
ResponseEntity
<>(
HttpStatus
.
NO_CONTENT
);
...
...
@@ -79,18 +79,18 @@ public class LabelController {
Set
<
Group
>
menuSet
=
new
HashSet
<>();
for
(
String
id
:
ids
)
{
if
(
id
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
}
Label
label
=
labelManager
.
get
(
id
);
if
(
label
==
null
){
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"group"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"group"
}
);
}
//查找组下是否有设备
Query
query
=
new
Query
(
Criteria
.
where
(
"labelId"
).
is
(
id
));
List
<
StoragePos
>
storagePosList
=
storagePosManager
.
findByQuery
(
query
);
if
(
storagePosList
!=
null
&&
storagePosList
.
size
()
>=
1
)
{
throw
new
ValidateException
(
"smfco
d
e.labelWithStoragePos"
,
"标签[{0}]已和库位关联"
,
new
String
[]{
label
.
getLabelName
()});
throw
new
ValidateException
(
"smfco
r
e.labelWithStoragePos"
,
"标签[{0}]已和库位关联"
,
new
String
[]{
label
.
getLabelName
()});
}
//删除关联
...
...
src/main/java/com/neotel/smfcore/core/storage/rest/MaterialBoxController.java
查看文件 @
4b7908d
...
...
@@ -68,7 +68,7 @@ public class MaterialBoxController {
codeBean
.
setError
(
e
.
getMessage
());
}
if
(
codeBean
==
null
||
codeBean
.
getBarcode
()
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.error.barcode.invalid"
,
"{0}不是有效的条码"
,
new
String
[]{
code
});
throw
new
ValidateException
(
"smfco
r
e.error.barcode.invalid"
,
"{0}不是有效的条码"
,
new
String
[]{
code
});
}
if
(
codeBean
.
getErrorCode
()
!=
null
)
{
throw
new
ValidateException
(
codeBean
.
getErrorCode
(),
codeBean
.
getError
(),
codeBean
.
getParams
());
...
...
@@ -79,7 +79,7 @@ public class MaterialBoxController {
//此处需要判断是否是料盒
Component
component
=
componentManager
.
findOneByPN
(
barcode
.
getPartNumber
()
);
if
(
component
==
null
||(
component
.
getType
()!=
COMPONENT_TYPE
.
FIXTURE
)){
throw
new
ValidateException
(
"smfco
d
e.materialBox.invalid"
,
"未找到料盒信息{0}"
,
new
String
[]{
code
});
throw
new
ValidateException
(
"smfco
r
e.materialBox.invalid"
,
"未找到料盒信息{0}"
,
new
String
[]{
code
});
}
BarcodeDto
barcodeDto
=
barcodeMapper
.
toDto
(
barcode
);
...
...
@@ -98,10 +98,10 @@ public class MaterialBoxController {
Barcode
barcode
=
barcodeManager
.
findByBarcode
(
code
);
if
(
barcode
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.materialBox.invalid"
,
"未找到料盒信息{0}"
,
new
String
[]{
code
});
throw
new
ValidateException
(
"smfco
r
e.materialBox.invalid"
,
"未找到料盒信息{0}"
,
new
String
[]{
code
});
}
if
(
describe
==
null
){
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"describe"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"describe"
}
);
}
barcode
.
setDescribe
(
describe
);
barcodeManager
.
saveBarcode
(
barcode
);
...
...
@@ -121,18 +121,18 @@ public class MaterialBoxController {
Barcode
barcode
=
barcodeManager
.
findByBarcode
(
code
);
if
(
barcode
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.materialBox.invalid"
,
"未找到料盒信息{0}"
,
new
String
[]{
code
});
throw
new
ValidateException
(
"smfco
r
e.materialBox.invalid"
,
"未找到料盒信息{0}"
,
new
String
[]{
code
});
}
Barcode
subBarcode
=
barcode
.
getSubCode
(
subPN
);
if
(
subBarcode
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.materialBox.noReel"
,
"料盒中未找到对应物料"
);
throw
new
ValidateException
(
"smfco
r
e.materialBox.noReel"
,
"料盒中未找到对应物料"
);
}
int
opQty
=
Integer
.
valueOf
(
qtyStr
);
int
oldAmount
=
subBarcode
.
getAmount
();
if
(
oldAmount
<
opQty
)
{
throw
new
ValidateException
(
"smfco
d
e.materialBox.quantityshort"
,
"物料数量不足"
);
throw
new
ValidateException
(
"smfco
r
e.materialBox.quantityshort"
,
"物料数量不足"
);
}
int
newAmount
=
oldAmount
-
opQty
;
subBarcode
.
setAmount
(
newAmount
);
...
...
@@ -152,11 +152,11 @@ public class MaterialBoxController {
Barcode
barcode
=
barcodeManager
.
findByBarcode
(
code
);
if
(
barcode
==
null
){
//料盒不存在
throw
new
ValidateException
(
"smfco
d
e.materialBox.invalid"
,
"未找到料盒信息{0}"
,
new
String
[]{
code
});
throw
new
ValidateException
(
"smfco
r
e.materialBox.invalid"
,
"未找到料盒信息{0}"
,
new
String
[]{
code
});
}
if
(
barcode
.
getSubCodeMap
()==
null
||
barcode
.
getSubCodeMap
().
size
()<=
0
){
//料盒中未找到对应物料
throw
new
ValidateException
(
"smfco
d
e.materialBox.boxNoReel"
,
"料盒中无物料"
);
throw
new
ValidateException
(
"smfco
r
e.materialBox.boxNoReel"
,
"料盒中无物料"
);
}
List
<
Barcode
>
barcodes
=
new
ArrayList
<>(
barcode
.
getSubCodeMap
().
values
())
;
...
...
@@ -183,7 +183,7 @@ public class MaterialBoxController {
Barcode
barcode
=
barcodeManager
.
findByBarcode
(
code
);
if
(
barcode
==
null
){
throw
new
ValidateException
(
"smfco
d
e.materialBox.invalid"
,
"未找到料盒信息{0}"
,
new
String
[]{
code
});
throw
new
ValidateException
(
"smfco
r
e.materialBox.invalid"
,
"未找到料盒信息{0}"
,
new
String
[]{
code
});
}
//用+或-分割,如果最后几位是数量,按手动输入处理
...
...
@@ -243,7 +243,7 @@ public class MaterialBoxController {
int
oldAmount
=
subBarcode
.
getAmount
();
if
(
oldAmount
<
opQty
){
throw
new
ValidateException
(
"smfco
d
e.materialBox.quantityshort"
,
"物料数量不足"
);
throw
new
ValidateException
(
"smfco
r
e.materialBox.quantityshort"
,
"物料数量不足"
);
}
int
newAmount
=
oldAmount
-
opQty
;
...
...
@@ -255,7 +255,7 @@ public class MaterialBoxController {
log
.
info
(
subBarcode
.
getPartNumber
()
+
"从料盒["
+
barcode
.
getPosName
()+
"]出库,物料数量:"
+
oldAmount
+
" - "
+
opQty
+
" = "
+
newAmount
);
}
else
{
//无库存
throw
new
ValidateException
(
"smfco
d
e.materialBox.noReel"
,
"料盒中未找到对应物料"
);
throw
new
ValidateException
(
"smfco
r
e.materialBox.noReel"
,
"料盒中未找到对应物料"
);
}
}
...
...
@@ -267,7 +267,7 @@ public class MaterialBoxController {
Barcode
subBarcode
=
codeBean
.
getBarcode
();
StoragePos
pos
=
storagePosManager
.
getByBarcode
(
subBarcode
.
getBarcode
());
if
(
pos
!=
null
)
{
throw
new
ValidateException
(
"smfco
d
e.materialBox.inPos"
,
"物料已在库位{0}中"
,
new
String
[]{
pos
.
getPosName
()});
throw
new
ValidateException
(
"smfco
r
e.materialBox.inPos"
,
"物料已在库位{0}中"
,
new
String
[]{
pos
.
getPosName
()});
}
if
(
subBarcode
.
getHostBarcodeId
()
==
null
)
{
...
...
@@ -295,7 +295,7 @@ public class MaterialBoxController {
//在别的料盒中
Barcode
hostBarcode
=
barcodeManager
.
get
(
subBarcode
.
getHostBarcodeId
());
if
(
hostBarcode
!=
null
)
{
throw
new
ValidateException
(
"smfco
d
e.materialBox.inOtherBox"
,
"物料已在料盒{0}中"
,
new
String
[]{
hostBarcode
.
getBarcode
()});
throw
new
ValidateException
(
"smfco
r
e.materialBox.inOtherBox"
,
"物料已在料盒{0}中"
,
new
String
[]{
hostBarcode
.
getBarcode
()});
}
}
}
else
{
...
...
src/main/java/com/neotel/smfcore/core/storage/rest/MaterialController.java
查看文件 @
4b7908d
...
...
@@ -85,15 +85,15 @@ public class MaterialController {
public
ResultBean
tacticsOuput
(
@RequestBody
Set
<
TacticsOutDto
>
outDtoSet
)
{
if
(
outDtoSet
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"PN"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"PN"
});
}
for
(
TacticsOutDto
dto
:
outDtoSet
)
{
if
(
dto
.
getPartNumber
()
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"PN"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"PN"
});
}
else
if
(
dto
.
getPlateNumber
()
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"Num"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"Num"
});
}
}
...
...
@@ -173,23 +173,23 @@ public class MaterialController {
String
labelId
=
params
.
getLabelId
();
if
(
Objects
.
isNull
(
labelId
))
{
if
(
posIds
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"PN"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"PN"
});
}
for
(
String
posId
:
posIds
)
{
StoragePos
pos
=
storagePosManager
.
get
(
posId
);
if
(
pos
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"posId"
,
posId
});
throw
new
ValidateException
(
"smfco
r
e.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"posId"
,
posId
});
}
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
if
(
storage
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"storageId"
,
pos
.
getStorageId
()});
throw
new
ValidateException
(
"smfco
r
e.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"storageId"
,
pos
.
getStorageId
()});
}
log
.
info
(
"出库料仓【"
+
storage
.
getName
()
+
"_"
+
storage
.
getCid
()
+
"】位置仓位【"
+
pos
.
getPosName
()
+
"】"
);
String
outResult
=
taskService
.
checkout
(
storage
,
pos
,
true
,
SecurityUtils
.
getCurrentUsername
());
if
(!
Strings
.
isNullOrEmpty
(
outResult
))
{
throw
new
ValidateException
(
"smfco
d
e.error"
,
outResult
);
throw
new
ValidateException
(
"smfco
r
e.error"
,
outResult
);
}
}
}
else
{
...
...
@@ -200,19 +200,19 @@ public class MaterialController {
List
<
StoragePos
>
posList
=
storagePosManager
.
findByQuery
(
query
);
if
(
posList
.
size
()
<=
0
)
{
//未找到出库信息
throw
new
ValidateException
(
"smfco
d
e.label.noReel"
,
"未找到可出库的物料"
);
throw
new
ValidateException
(
"smfco
r
e.label.noReel"
,
"未找到可出库的物料"
);
}
for
(
StoragePos
pos
:
posList
)
{
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
if
(
storage
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"storageId"
,
pos
.
getStorageId
()});
throw
new
ValidateException
(
"smfco
r
e.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"storageId"
,
pos
.
getStorageId
()});
}
log
.
info
(
"出库料仓【"
+
storage
.
getName
()
+
"_"
+
storage
.
getCid
()
+
"】位置仓位【"
+
pos
.
getPosName
()
+
"】"
);
String
outResult
=
taskService
.
checkout
(
storage
,
pos
,
true
,
SecurityUtils
.
getCurrentUsername
());
if
(!
Strings
.
isNullOrEmpty
(
outResult
))
{
throw
new
ValidateException
(
"smfco
d
e.error"
,
outResult
);
throw
new
ValidateException
(
"smfco
r
e.error"
,
outResult
);
}
}
}
...
...
@@ -232,7 +232,7 @@ public class MaterialController {
List
<
String
>
posIds
=
params
.
getPosIds
();
String
labelId
=
params
.
getLabelId
();
if
(
posIds
==
null
||
posIds
.
size
()
<=
0
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
});
}
String
labelName
=
""
;
if
(
ObjectUtil
.
isEmpty
(
labelId
))
{
...
...
@@ -258,7 +258,7 @@ public class MaterialController {
if
(
storagePos
!=
null
)
{
if
(!
ObjectUtil
.
isEmpty
(
storagePos
.
getBarcode
().
getLockId
()))
{
throw
new
ValidateException
(
"smfco
d
e.error.barcode.locked"
,
"库位[{0}]已被锁定"
);
throw
new
ValidateException
(
"smfco
r
e.error.barcode.locked"
,
"库位[{0}]已被锁定"
);
}
try
{
if
(
barcode
!=
null
)
{
...
...
@@ -269,12 +269,12 @@ public class MaterialController {
log
.
info
(
"清理库位["
+
storagePos
.
getPosName
()
+
"],条码["
+
code
+
"],库位条码为空"
);
}
return
ResultBean
.
newOkResult
(
"smfco
d
e.manualOut.ok"
,
"手动出库成功"
,
code
);
return
ResultBean
.
newOkResult
(
"smfco
r
e.manualOut.ok"
,
"手动出库成功"
,
code
);
}
catch
(
Exception
e
)
{
return
ResultBean
.
newErrorResult
(
1
,
"smfcore.error"
,
"出错{0}"
,
new
String
[]{
e
.
getMessage
()},
true
);
}
}
else
{
throw
new
ValidateException
(
"smfco
d
e.manualOut.notFound"
,
"仓库中未找到料盘信息"
);
throw
new
ValidateException
(
"smfco
r
e.manualOut.notFound"
,
"仓库中未找到料盘信息"
);
}
}
...
...
src/main/java/com/neotel/smfcore/core/storage/rest/StorageController.java
查看文件 @
4b7908d
...
...
@@ -143,7 +143,7 @@ public class StorageController {
public
ResponseEntity
<
Object
>
update
(
@Validated
@RequestBody
StorageDto
resources
)
{
Storage
Storage
=
storageMapper
.
toEntity
(
resources
);
if
(
Storage
.
getId
()
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
}
saveStorage
(
Storage
);
return
new
ResponseEntity
<>(
HttpStatus
.
OK
);
...
...
@@ -158,7 +158,7 @@ public class StorageController {
for
(
String
id
:
ids
)
{
if
(
id
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
}
}
deleteStorages
(
ids
);
...
...
@@ -180,7 +180,7 @@ public class StorageController {
if
(
pos
.
getBarcode
()
==
null
||
pos
.
getBarcode
().
equals
(
""
))
{
}
else
{
throw
new
ValidateException
(
"smfco
d
e.posIsused"
,
"料仓[{0}]的库位[{1}}]有料[{2}],删除失败"
,
new
String
[]{
storage
.
getName
()
,
pos
.
getPosName
(),
pos
.
getBarcode
().
getBarcode
()});
throw
new
ValidateException
(
"smfco
r
e.posIsused"
,
"料仓[{0}]的库位[{1}}]有料[{2}],删除失败"
,
new
String
[]{
storage
.
getName
()
,
pos
.
getPosName
(),
pos
.
getBarcode
().
getBarcode
()});
// throw new BadRequestException("料仓[" + storage.getName() + "]的库位[" + pos.getPosName() + "]有料[" + pos.getBarcode() + "],删除失败");
}
}
...
...
@@ -195,16 +195,16 @@ public class StorageController {
}
private
Storage
saveStorage
(
Storage
storage
)
{
if
(
storage
.
getName
()==
null
){
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"name"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"name"
}
);
// throw new BadRequestException("料仓名称不能为空");
}
if
(
storage
.
getCid
()==
null
){
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"cid"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"cid"
}
);
// throw new BadRequestException("料仓编号不能为空");
}
if
(
storage
.
getType
()==
null
){
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"type"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"type"
}
);
// throw new BadRequestException("料仓类型不能为空");
}
if
(
storage
.
getCompatibleType
()==
null
){
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"compatibleType"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"compatibleType"
}
);
// throw new BadRequestException("料仓兼容性不能为空");
}
String
oldCid
=
""
;
...
...
@@ -215,11 +215,11 @@ public class StorageController {
)
{
if
(
isNew
||
(!
storage
.
getId
().
equals
(
s
.
getId
())))
{
if
(
s
.
getName
().
equals
(
storage
.
getName
())){
throw
new
ValidateException
(
"smfco
d
e.valueAlreadyExist"
,
"{0}[{1}]已存在"
,
new
String
[]{
"name"
,
storage
.
getName
()});
throw
new
ValidateException
(
"smfco
r
e.valueAlreadyExist"
,
"{0}[{1}]已存在"
,
new
String
[]{
"name"
,
storage
.
getName
()});
// throw new BadRequestException("料仓名称["+storage.getCid()+"]已存在");
}
if
(
s
.
getCid
().
equals
(
storage
.
getCid
())){
throw
new
ValidateException
(
"smfco
d
e.valueAlreadyExist"
,
"{0}[{1}]已存在"
,
new
String
[]{
"cid"
,
storage
.
getCid
()});
throw
new
ValidateException
(
"smfco
r
e.valueAlreadyExist"
,
"{0}[{1}]已存在"
,
new
String
[]{
"cid"
,
storage
.
getCid
()});
// throw new BadRequestException("料仓cid["+storage.getCid()+"]已存在");
}
}
...
...
@@ -248,7 +248,7 @@ public class StorageController {
String
image
=
"csv"
;
String
fileType
=
FileUtil
.
getExtensionName
(
uploadFile
.
getOriginalFilename
());
if
(
fileType
!=
null
&&
!
image
.
contains
(
fileType
)){
throw
new
ValidateException
(
"smfco
d
e.feleFormatError"
,
"文件格式错误!, 仅支持{0}格式"
,
new
String
[]{
image
});
throw
new
ValidateException
(
"smfco
r
e.feleFormatError"
,
"文件格式错误!, 仅支持{0}格式"
,
new
String
[]{
image
});
}
File
folder
=
new
File
(
properties
.
getPath
(),
"pos"
);
File
file
=
FileUtil
.
upload
(
uploadFile
,
folder
.
getAbsolutePath
());
...
...
@@ -262,7 +262,7 @@ public class StorageController {
log
.
info
(
"开始更新料仓【"
+
storageId
+
"】的位置信息"
);
if
(
Strings
.
isNullOrEmpty
(
storageId
))
{
log
.
error
(
"Storage id is null"
);
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"storageId"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"storageId"
}
);
}
Storage
storage
=
storageManager
.
get
(
storageId
);
if
(
storage
==
null
)
{
...
...
src/main/java/com/neotel/smfcore/core/storage/rest/StoragePosController.java
查看文件 @
4b7908d
...
...
@@ -102,7 +102,7 @@ public class StoragePosController {
}
Storage
storage
=
dataCache
.
getStorage
(
cid
);
if
(
storage
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueNotFind"
,
"未找到{0}[{1}]"
,
new
String
[]{
"cid"
,
cid
});
throw
new
ValidateException
(
"smfco
r
e.valueNotFind"
,
"未找到{0}[{1}]"
,
new
String
[]{
"cid"
,
cid
});
}
List
<
StoragePos
>
allPos
=
storagePosManager
.
findByStorage
(
storage
.
getId
());
for
(
StoragePos
storagePos
:
allPos
...
...
@@ -110,7 +110,7 @@ public class StoragePosController {
if
(
storagePos
!=
null
)
{
Barcode
barcode
=
storagePos
.
getBarcode
();
if
(
barcode
!=
null
)
{
throw
new
ValidateException
(
"smfco
d
e.cannotRemove"
,
"删除库位失败,库位[{0}]中有料"
,
new
String
[]{
storagePos
.
getPosName
()});
throw
new
ValidateException
(
"smfco
r
e.cannotRemove"
,
"删除库位失败,库位[{0}]中有料"
,
new
String
[]{
storagePos
.
getPosName
()});
}
}
}
...
...
@@ -131,7 +131,7 @@ public class StoragePosController {
}
Storage
storage
=
dataCache
.
getStorage
(
cid
);
if
(
storage
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueNotFind"
,
"未找到{0}[{1}]"
,
new
String
[]{
"cid"
,
cid
});
throw
new
ValidateException
(
"smfco
r
e.valueNotFind"
,
"未找到{0}[{1}]"
,
new
String
[]{
"cid"
,
cid
});
}
log
.
info
(
"开始手动清空料仓["
+
storage
.
getName
()
+
"_"
+
storage
.
getCid
()
+
"]的所有库位"
);
...
...
@@ -195,11 +195,11 @@ public class StoragePosController {
@PreAuthorize
(
"@el.check('storagePos:edit')"
)
public
ResultBean
enabledPos
(
@RequestBody
StoragePosEnabledDto
enabledDto
)
{
if
(
enabledDto
.
getId
()
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
});
}
StoragePos
pos
=
storagePosDao
.
findOneById
(
enabledDto
.
getId
());
if
(
pos
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueNotFind"
,
"未找到{0}[{1}]"
,
new
String
[]{
"PosId"
,
enabledDto
.
getId
()});
throw
new
ValidateException
(
"smfco
r
e.valueNotFind"
,
"未找到{0}[{1}]"
,
new
String
[]{
"PosId"
,
enabledDto
.
getId
()});
// throw new ValidateException("未找到库位 ");
}
pos
.
setEnabled
(
enabledDto
.
isEnabled
());
...
...
@@ -215,14 +215,14 @@ public class StoragePosController {
@PreAuthorize
(
"@el.check('storagePos:edit')"
)
public
ResponseEntity
<
Object
>
update
(
@Validated
@RequestBody
StoragePosSaveDto
saveDto
)
{
if
(
saveDto
.
getId
()
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
});
}
if
(
saveDto
.
getPosName
()
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
});
}
StoragePos
pos
=
storagePosDao
.
findOneById
(
saveDto
.
getId
());
if
(
pos
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueNotFind"
,
"未找到{0}[{1}]"
,
new
String
[]{
"PosId"
,
saveDto
.
getId
()});
throw
new
ValidateException
(
"smfco
r
e.valueNotFind"
,
"未找到{0}[{1}]"
,
new
String
[]{
"PosId"
,
saveDto
.
getId
()});
// throw new ValidateException("未找到库位 ");
}
pos
.
setPosName
(
saveDto
.
getPosName
());
...
...
@@ -249,7 +249,7 @@ public class StoragePosController {
for
(
String
id
:
ids
)
{
if
(
id
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
});
}
}
storagePosManager
.
deletePoss
(
ids
);
...
...
@@ -304,7 +304,7 @@ public class StoragePosController {
public
ResultBean
checkout
(
@Validated
@RequestBody
CheckOutDto
checkOutDto
)
{
if
(
checkOutDto
.
getPids
()
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
});
}
if
(
checkOutDto
.
getSingleOut
()
==
null
)
{
checkOutDto
.
setSingleOut
(
true
+
""
);
...
...
@@ -315,19 +315,19 @@ public class StoragePosController {
for
(
String
pid
:
checkOutDto
.
getPids
())
{
StoragePos
pos
=
storagePosManager
.
get
(
pid
);
if
(
pos
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"pid"
,
pid
});
throw
new
ValidateException
(
"smfco
r
e.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"pid"
,
pid
});
// throw new ValidateException("位置[" + pid + "]不存在");
}
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
if
(
storage
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"storageId"
,
pos
.
getStorageId
()});
throw
new
ValidateException
(
"smfco
r
e.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"storageId"
,
pos
.
getStorageId
()});
// throw new ValidateException("料仓[" + pos.getStorageId() + "]不存在");
}
log
.
info
(
"出库料仓【"
+
storage
.
getName
()
+
"_"
+
storage
.
getCid
()
+
"】位置仓位【"
+
pos
.
getPosName
()
+
"】"
);
String
outResult
=
taskService
.
checkout
(
storage
,
pos
,
isSingleOut
,
SecurityUtils
.
getCurrentUsername
());
if
(!
Strings
.
isNullOrEmpty
(
outResult
))
{
throw
new
ValidateException
(
"smfco
d
e.error"
,
outResult
);
throw
new
ValidateException
(
"smfco
r
e.error"
,
outResult
);
}
}
return
ResultBean
.
newOkResult
(
""
);
...
...
@@ -372,14 +372,14 @@ public class StoragePosController {
dto
.
setAmount
(
codeBean
.
getBarcode
().
getAmount
());
if
(!
ObjectUtil
.
isEmpty
(
codeBean
.
getBarcode
().
getLockId
()))
{
codeBean
.
setError
(
"smfco
d
e.error.barcode.locked"
,
"库位[{0}]已被锁定"
);
codeBean
.
setError
(
"smfco
r
e.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("smfco
d
e.error.barcode.inQueue", new String[]{dto.getBarcode()}, "二维码[{0}]已在操作队列中");
// codeBean.setError("smfco
r
e.error.barcode.inQueue", new String[]{dto.getBarcode()}, "二维码[{0}]已在操作队列中");
// }
}
if
(
codeBean
.
getErrorCode
()
!=
null
)
{
...
...
@@ -387,7 +387,7 @@ public class StoragePosController {
dto
.
setError
(
error
);
}
}
else
{
String
error
=
MessageUtils
.
getText
(
"smfco
d
e.error.barcode.invalid"
,
new
String
[]{
code
},
servletRequest
.
getLocale
(),
"{0}不是有效的条码"
);
String
error
=
MessageUtils
.
getText
(
"smfco
r
e.error.barcode.invalid"
,
new
String
[]{
code
},
servletRequest
.
getLocale
(),
"{0}不是有效的条码"
);
dto
.
setError
(
error
);
}
return
dto
;
...
...
src/main/java/com/neotel/smfcore/core/storage/service/manager/impl/LabelManagerImpl.java
查看文件 @
4b7908d
...
...
@@ -34,12 +34,12 @@ public class LabelManagerImpl implements ILabelManager {
logName
=
"修改标签:"
;
}
if
(
resources
.
getLabelName
()
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"labelName"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"labelName"
});
}
Query
que
=
new
Query
(
c
);
List
<
Label
>
groups
=
findByQuery
(
que
);
if
(
groups
!=
null
&&
groups
.
size
()
>
0
)
{
throw
new
ValidateException
(
"smfco
d
e.valueAlreadyExist"
,
"{0}[{1}]已存在"
,
new
String
[]{
"labelName"
,
resources
.
getLabelName
()});
throw
new
ValidateException
(
"smfco
r
e.valueAlreadyExist"
,
"{0}[{1}]已存在"
,
new
String
[]{
"labelName"
,
resources
.
getLabelName
()});
}
Label
label
=
labelDao
.
save
(
resources
);
return
label
;
...
...
src/main/java/com/neotel/smfcore/core/storage/service/manager/impl/StoragePosManagerImpl.java
查看文件 @
4b7908d
...
...
@@ -277,7 +277,7 @@ public class StoragePosManagerImpl implements IStoragePosManager {
if
(
pos
.
getBarcode
()==
null
||
pos
.
getBarcode
().
equals
(
""
))
{
}
else
{
throw
new
ValidateException
(
"smfco
d
e.thePosIsused"
,
" 库位[{0}]有料[{1}],不能删除"
,
new
String
[]{
pos
.
getPosName
(),
pos
.
getBarcode
().
getBarcode
()});
throw
new
ValidateException
(
"smfco
r
e.thePosIsused"
,
" 库位[{0}]有料[{1}],不能删除"
,
new
String
[]{
pos
.
getPosName
(),
pos
.
getBarcode
().
getBarcode
()});
// throw new BadRequestException("库位[" + pos.getPosName() + "]中有料[" + pos.getBarcode() + "],不能删除");
}
delPosName
+=
"["
+
pos
.
getId
()+
"_"
+
pos
.
getPosName
()+
"]"
;
...
...
src/main/java/com/neotel/smfcore/core/system/rest/ClientSettingsController.java
查看文件 @
4b7908d
...
...
@@ -34,7 +34,7 @@ public class ClientSettingsController {
public
ClientSettingDto
getSettings
(
ClientSettingDto
settingDto
)
{
if
(
settingDto
==
null
||
ObjectUtil
.
isEmpty
(
settingDto
.
getKey
())
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"key"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"key"
});
}
//先查找自己的用户名,没找到时再找admin
String
userName
=
SecurityUtils
.
getCurrentUsername
();
...
...
@@ -58,7 +58,7 @@ public class ClientSettingsController {
public
ResultBean
updateSettings
(
@RequestBody
ClientSettingDto
settingDto
)
{
if
(
settingDto
==
null
||
ObjectUtil
.
isEmpty
(
settingDto
.
getKey
())
||
ObjectUtil
.
isEmpty
(
settingDto
.
getValue
()))
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"key"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"key"
});
}
String
userName
=
SecurityUtils
.
getCurrentUsername
();
String
key
=
Constants
.
CACHE_clientSetting
+
"_"
+
userName
+
"_"
+
settingDto
.
getKey
();
...
...
src/main/java/com/neotel/smfcore/core/system/rest/SettingsController.java
查看文件 @
4b7908d
...
...
@@ -54,19 +54,19 @@ public class SettingsController {
//
// if(settingsDto.getMaxHumidity()<=settingsDto.getMinHumidity()){
//
// throw new ValidateException("smfco
d
e.humidityValueError","温度范围数据错误" );
// throw new ValidateException("smfco
r
e.humidityValueError","温度范围数据错误" );
//// throw new BadRequestException("温度范围数据错误");
// }
// if(settingsDto.getMaxHumidityShow()<=settingsDto.getMinHumidityShow()){
// throw new ValidateException("smfco
d
e.humidityShowValueError","温度显示范围数据错误" );
// throw new ValidateException("smfco
r
e.humidityShowValueError","温度显示范围数据错误" );
//// throw new BadRequestException("温度显示范围数据错误");
// }
// if(settingsDto.getMaxTemperature()<=settingsDto.getMinTemperature()){
// throw new ValidateException("smfco
d
e.temperatureValueError","湿度范围数据错误" );
// throw new ValidateException("smfco
r
e.temperatureValueError","湿度范围数据错误" );
//// throw new BadRequestException("湿度范围数据错误");
// }
// if(settingsDto.getMaxTemperatureShow()<=settingsDto.getMinTemperatureShow()){
// throw new ValidateException("smfco
d
e.temperatureShowValueError","湿度显示范围数据错误" );
// throw new ValidateException("smfco
r
e.temperatureShowValueError","湿度显示范围数据错误" );
//// throw new BadRequestException("湿度显示范围数据错误");
// }
//
...
...
src/main/java/com/neotel/smfcore/core/system/rest/TaskController.java
查看文件 @
4b7908d
...
...
@@ -95,7 +95,7 @@ public class TaskController {
}
User
curruser
=
userManager
.
get
(
SecurityUtils
.
getCurrentUserId
());
if
(!
curruser
.
getGroups
().
contains
(
groupId
)){
throw
new
ValidateException
(
"smfco
d
e.nogroupaccess"
,
"没有组[{0}]的操作权限"
,
new
String
[]
{
groupId
});
throw
new
ValidateException
(
"smfco
r
e.nogroupaccess"
,
"没有组[{0}]的操作权限"
,
new
String
[]
{
groupId
});
}
return
getTaskList
(
groupId
,
null
);
}
...
...
src/main/java/com/neotel/smfcore/core/system/util/TaskService.java
查看文件 @
4b7908d
...
...
@@ -160,10 +160,10 @@ public class TaskService {
String
posName
=
taskToExecute
.
getPosName
();
if
(!
Strings
.
isNullOrEmpty
(
barcode
)
&&
task
.
getBarcode
().
equals
(
barcode
))
{
log
.
info
(
"二维码:["
+
barcode
+
"]已在操作队列中,操作失败"
);
throw
new
ValidateException
(
"smfco
d
e.error.barcode.inQueue"
,
"二维码[{0}]已在操作队列中,操作失败"
,
new
String
[]{
barcode
});
throw
new
ValidateException
(
"smfco
r
e.error.barcode.inQueue"
,
"二维码[{0}]已在操作队列中,操作失败"
,
new
String
[]{
barcode
});
}
else
if
(
task
.
getPosName
().
equals
(
posName
)&&
ObjectUtil
.
isNotEmpty
(
posName
))
{
log
.
info
(
"位置:["
+
posName
+
"]已在操作队列中,操作失败"
);
throw
new
ValidateException
(
"smfco
d
e.error.pos.inQueue"
,
"位置:[{0}}]已在操作队列中,操作失败"
,
new
String
[]{
posName
});
throw
new
ValidateException
(
"smfco
r
e.error.pos.inQueue"
,
"位置:[{0}}]已在操作队列中,操作失败"
,
new
String
[]{
posName
});
}
}
updateQueueTask
(
taskToExecute
);
...
...
@@ -608,7 +608,7 @@ public class TaskService {
}
if
(
availbleStorageList
.
isEmpty
())
{
throw
new
ValidateException
(
"smfco
d
e.noValidStorage"
,
"料仓列表中未找到可用的料仓"
);
throw
new
ValidateException
(
"smfco
r
e.noValidStorage"
,
"料仓列表中未找到可用的料仓"
);
}
availbleStorageList
.
sort
(
new
Comparator
<
Storage
>()
{
...
...
@@ -658,7 +658,7 @@ public class TaskService {
private
Barcode
verifyBarcodePutIn
(
List
<
Storage
>
storageList
,
Barcode
barcodeSave
,
String
inRFID
)
throws
ValidateException
{
if
(
barcodeSave
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.error.barcode.invalid"
,
"条码无效"
);
throw
new
ValidateException
(
"smfco
r
e.error.barcode.invalid"
,
"条码无效"
);
}
StoragePos
pos
;
...
...
@@ -670,7 +670,7 @@ public class TaskService {
pos
=
storagePosManager
.
getByBarcodeId
(
barcodeSave
.
getId
());
if
(
barcodeSave
.
getAmount
()
<=
0
)
{
throw
new
ValidateException
(
"smfco
d
e.error.barcode.wrongQty"
,
"条码[{0}]对应的数量<=0为: {1}"
,
new
String
[]{
barcodeSave
.
getBarcode
(),
barcodeSave
.
getAmount
()
+
""
});
throw
new
ValidateException
(
"smfco
r
e.error.barcode.wrongQty"
,
"条码[{0}]对应的数量<=0为: {1}"
,
new
String
[]{
barcodeSave
.
getBarcode
(),
barcodeSave
.
getAmount
()
+
""
});
}
}
...
...
@@ -680,7 +680,7 @@ public class TaskService {
Storage
storage
=
dataCache
.
getStorageById
(
pos
.
getStorageId
());
checkout
(
storage
,
pos
,
true
,
""
);
throw
new
ValidateException
(
"smfco
d
e.error.barcode.exist"
,
"[{0}}]已在{1}}[{2}}]中"
,
new
String
[]{
barcodeSave
.
getBarcode
(),
storage
.
getName
(),
pos
.
getPosName
()});
throw
new
ValidateException
(
"smfco
r
e.error.barcode.exist"
,
"[{0}}]已在{1}}[{2}}]中"
,
new
String
[]{
barcodeSave
.
getBarcode
(),
storage
.
getName
(),
pos
.
getPosName
()});
}
Collection
<
DataLog
>
queueTasks
=
getQueueTasks
();
...
...
@@ -698,7 +698,7 @@ public class TaskService {
return
barcodeSave
;
}
}
throw
new
ValidateException
(
"smfco
d
e.error.barcode.taskNotEnd"
,
"料盘[{0}}]的操作未完成,无法执行入库操作"
,
new
String
[]{
barcodeSave
.
getBarcode
()});
throw
new
ValidateException
(
"smfco
r
e.error.barcode.taskNotEnd"
,
"料盘[{0}}]的操作未完成,无法执行入库操作"
,
new
String
[]{
barcodeSave
.
getBarcode
()});
}
}
}
...
...
src/main/java/com/neotel/smfcore/hella/handler/HellaServiceHandler.java
查看文件 @
4b7908d
...
...
@@ -285,7 +285,7 @@ public class HellaServiceHandler extends IoHandlerAdapter implements ITaskListen
String
codeStr
=
command
.
getData
().
toString
();
CodeBean
codeBean
=
codeResolve
.
resolveSingleCode
(
codeStr
);
if
(
codeBean
==
null
||
codeBean
.
getBarcode
()==
null
){
return
ResultBean
.
newErrorResult
(
1
,
"smfco
d
e.error.barcode.invalid"
,
"条码无效"
);
return
ResultBean
.
newErrorResult
(
1
,
"smfco
r
e.error.barcode.invalid"
,
"条码无效"
);
}
if
(
ObjectUtil
.
isNotEmpty
(
codeBean
.
getErrorCode
())
){
return
ResultBean
.
newErrorResult
(
1
,
codeBean
.
getErrorCode
(),
codeBean
.
getError
(),
codeBean
.
getParams
());
...
...
src/main/java/com/neotel/smfcore/security/rest/GroupController.java
查看文件 @
4b7908d
...
...
@@ -131,11 +131,11 @@ public class GroupController {
public
ResponseEntity
<
Object
>
update
(
@RequestBody
GroupDto
groupDto
)
{
Group
resources
=
groupMapper
.
toEntity
(
groupDto
);
if
(
resources
.
getId
()
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
}
User
curruser
=
userManager
.
get
(
SecurityUtils
.
getCurrentUserId
());
if
(!
curruser
.
hasGroup
(
resources
.
getId
())){
throw
new
ValidateException
(
"smfco
d
e.nogroupaccess"
,
"没有组[{0}]的操作权限"
,
new
String
[]
{
resources
.
getGroupName
()});
throw
new
ValidateException
(
"smfco
r
e.nogroupaccess"
,
"没有组[{0}]的操作权限"
,
new
String
[]
{
resources
.
getGroupName
()});
}
groupManager
.
saveGroup
(
resources
);
return
new
ResponseEntity
<>(
HttpStatus
.
NO_CONTENT
);
...
...
@@ -148,27 +148,27 @@ public class GroupController {
Set
<
Group
>
menuSet
=
new
HashSet
<>();
for
(
String
id
:
ids
)
{
if
(
id
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
}
Group
group
=
groupManager
.
get
(
id
);
if
(
group
==
null
){
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"group"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"group"
}
);
}
User
curruser
=
userManager
.
get
(
SecurityUtils
.
getCurrentUserId
());
if
(!
curruser
.
hasGroup
(
group
.
getId
())){
throw
new
ValidateException
(
"smfco
d
e.nogroupaccess"
,
"没有组[{0}]的操作权限"
,
new
String
[]
{
group
.
getGroupName
()});
throw
new
ValidateException
(
"smfco
r
e.nogroupaccess"
,
"没有组[{0}]的操作权限"
,
new
String
[]
{
group
.
getGroupName
()});
}
// //查找组下是否有设备
// Query query = new Query(Criteria.where("groupId").is(id));
// List<Storage> storages = storageManager.findByQuery(query);
// if (storages != null && storages.size() >= 1) {
// throw new ValidateException("smfco
d
e.groupWithStorage","组[{0}]已和设备关联",new String[]{group.getGroupName()});
// throw new ValidateException("smfco
r
e.groupWithStorage","组[{0}]已和设备关联",new String[]{group.getGroupName()});
// }
//
// Query userQuery = new Query(Criteria.where("groups").all(id));
// List<User> users = userManager.findByQuery(userQuery);
// if (users != null && users.size() >= 1) {
// throw new ValidateException("smfco
d
e.groupWithUser","组[{0}]已和用户关联",new String[]{group.getGroupName()});
// throw new ValidateException("smfco
r
e.groupWithUser","组[{0}]已和用户关联",new String[]{group.getGroupName()});
//// throw new ValidateException("删除失败,组[" + group.getGroupName() + "]已和用户关联");
// }
//删除关联
...
...
src/main/java/com/neotel/smfcore/security/rest/MenuController.java
查看文件 @
4b7908d
...
...
@@ -164,7 +164,7 @@ public class MenuController {
public
ResponseEntity
<
Object
>
update
(
@Validated
@RequestBody
MenuDto
menuDto
)
{
Menu
resources
=
menuMapper
.
toEntity
(
menuDto
);
if
(
resources
.
getId
()
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
}
menuManager
.
saveMenu
(
resources
);
return
new
ResponseEntity
<>(
HttpStatus
.
NO_CONTENT
);
...
...
@@ -176,7 +176,7 @@ public class MenuController {
@PreAuthorize
(
"@el.check('menu:del')"
)
public
ResponseEntity
<
Object
>
delete
(
@RequestBody
Set
<
String
>
ids
)
{
if
(!
SecurityUtils
.
getCurrentUsername
().
equals
(
Constants
.
SUPER_USERNAME
)){
throw
new
ValidateException
(
"smfco
d
e.noAccessUpdate"
,
"没有删除菜单的权限"
);
throw
new
ValidateException
(
"smfco
r
e.noAccessUpdate"
,
"没有删除菜单的权限"
);
}
Set
<
Menu
>
menuSet
=
new
HashSet
<>();
for
(
String
id
:
ids
)
{
...
...
src/main/java/com/neotel/smfcore/security/rest/RoleController.java
查看文件 @
4b7908d
...
...
@@ -109,7 +109,7 @@ public class RoleController {
Role
resources
=
roleMapper
.
toEntity
(
roleDto
);
Role
role
=
roleManager
.
get
(
resources
.
getId
());
if
(
resources
.
getId
()
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
}
resources
.
setMenus
(
role
.
getMenus
());
roleManager
.
saveRole
(
resources
);
...
...
@@ -122,9 +122,9 @@ public class RoleController {
public
ResponseEntity
<
Object
>
updateMenu
(
@RequestBody
RoleDto
roleDto
)
{
Role
resources
=
roleMapper
.
toEntity
(
roleDto
);
if
(
resources
.
getId
()
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
}
// throw new ValidateException("smfco
d
e.valueCanotNull","{0}不能为空",new String[]{"ID"} );
// throw new ValidateException("smfco
r
e.valueCanotNull","{0}不能为空",new String[]{"ID"} );
Role
role
=
roleManager
.
get
(
resources
.
getId
());
//判断ID是否存在
...
...
@@ -133,7 +133,7 @@ public class RoleController {
Query
query
=
new
Query
(
Criteria
.
where
(
"id"
).
in
(
menuIds
));
List
<
Menu
>
menus
=
menuManager
.
findByQuery
(
query
);
if
(
menus
==
null
&&(
menus
.
size
()!=
menuIds
.
size
())){
throw
new
ValidateException
(
"smfco
d
e.menuNotExist"
,
"菜单{0}不存在"
,
new
String
[]{
"ID"
}
);
throw
new
ValidateException
(
"smfco
r
e.menuNotExist"
,
"菜单{0}不存在"
,
new
String
[]{
"ID"
}
);
}
roleManager
.
updateMenu
(
resources
);
return
new
ResponseEntity
<>(
HttpStatus
.
OK
);
...
...
@@ -147,13 +147,13 @@ public class RoleController {
List
<
Role
>
roles
=
new
ArrayList
<
Role
>();
for
(
String
id
:
ids
)
{
if
(
id
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
}
Role
role
=
roleManager
.
get
(
id
);
// 验证是否被用户关联
List
<
User
>
users
=
userManager
.
findByRoleId
(
role
.
getId
());
if
(
users
!=
null
&&
users
.
size
()
>
0
)
{
throw
new
ValidateException
(
"smfco
d
e.roleCannotDel"
,
"角色[{0}]有[{1}]个用户关联改角色,不能删除"
,
new
String
[]{
role
.
getName
(),
users
.
size
()+
""
});
throw
new
ValidateException
(
"smfco
r
e.roleCannotDel"
,
"角色[{0}]有[{1}]个用户关联改角色,不能删除"
,
new
String
[]{
role
.
getName
(),
users
.
size
()+
""
});
}
roles
.
add
(
role
);
}
...
...
src/main/java/com/neotel/smfcore/security/rest/UserController.java
查看文件 @
4b7908d
...
...
@@ -103,15 +103,15 @@ public class UserController {
public
ResponseEntity
<
Object
>
create
(
@Validated
@RequestBody
UserDto
userDto
)
{
User
resources
=
userMapper
.
toEntity
(
userDto
);
if
(
resources
.
getId
()
!=
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueAlreadyExist"
,
"{0}[{1}]已存在"
,
new
String
[]{
"ID"
,
resources
.
getId
()});
throw
new
ValidateException
(
"smfco
r
e.valueAlreadyExist"
,
"{0}[{1}]已存在"
,
new
String
[]{
"ID"
,
resources
.
getId
()});
// throw new ValidateException("新增用户:ID已存在");
}
if
(
resources
.
getUsername
()==
null
){
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"username"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"username"
}
);
// throw new ValidateException("新增用户:用户名不能为空");
}
if
(
resources
.
getRoleId
()==
null
){
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"roleId"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"roleId"
}
);
// throw new ValidateException("新增用户:角色ID不能为空");
}
//判断用户名是否存在
...
...
@@ -139,13 +139,13 @@ public class UserController {
public
ResponseEntity
<
Object
>
update
(
@Validated
@RequestBody
UserDto
userDto
)
{
User
resources
=
userMapper
.
toEntity
(
userDto
);
if
(
resources
.
getId
()
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
}
if
(
resources
.
getUsername
()==
null
){
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"username"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"username"
}
);
}
if
(
resources
.
getRoleId
()==
null
){
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"roleId"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"roleId"
}
);
}
userManager
.
update
(
resources
);
...
...
@@ -158,7 +158,7 @@ public class UserController {
@PreAuthorize
(
"@el.check('user:edit')"
)
public
ResultBean
resetPass
(
@RequestBody
String
id
)
{
if
(
id
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
}
User
resources
=
userManager
.
get
(
id
);
resources
.
setPassword
(
passwordEncoder
.
encode
(
Constants
.
USER_DEFAULTP_PWD
));
...
...
@@ -178,7 +178,7 @@ public class UserController {
public
ResultBean
center
(
@Validated
@RequestBody
UserDto
userDto
)
{
User
resources
=
userMapper
.
toEntity
(
userDto
);
if
(!
resources
.
getId
().
equals
(
SecurityUtils
.
getCurrentUserId
()))
{
throw
new
ValidateException
(
"smfco
d
e.hasNoAccess"
,
"无权限修改此用户信息"
);
throw
new
ValidateException
(
"smfco
r
e.hasNoAccess"
,
"无权限修改此用户信息"
);
// throw new ValidateException("不能修改他人资料");
}
userManager
.
updateCenter
(
resources
);
...
...
@@ -193,10 +193,10 @@ public class UserController {
String
oldPass
=
RsaUtils
.
decryptByPrivateKey
(
RsaProperties
.
privateKey
,
passVo
.
getOldPass
());
String
newPass
=
RsaUtils
.
decryptByPrivateKey
(
RsaProperties
.
privateKey
,
passVo
.
getNewPass
());
if
(!
passwordEncoder
.
matches
(
oldPass
,
user
.
getPassword
()))
{
throw
new
ValidateException
(
"smfco
d
e.oldPwdError"
,
"修改失败,旧密码错误"
);
throw
new
ValidateException
(
"smfco
r
e.oldPwdError"
,
"修改失败,旧密码错误"
);
}
if
(
passwordEncoder
.
matches
(
newPass
,
user
.
getPassword
()))
{
throw
new
ValidateException
(
"smfco
d
e.newPwdError"
,
"新密码不能与旧密码相同"
);
throw
new
ValidateException
(
"smfco
r
e.newPwdError"
,
"新密码不能与旧密码相同"
);
}
userManager
.
updatePass
(
user
.
getUsername
(),
passwordEncoder
.
encode
(
newPass
));
return
ResultBean
.
newOkResult
(
""
);
...
...
@@ -210,13 +210,13 @@ public class UserController {
//不能删除自己
String
currId
=
SecurityUtils
.
getCurrentUserId
();
if
(
currId
==
id
)
{
throw
new
ValidateException
(
"smfco
d
e.canotDelSelf"
,
"删除用户:不能删除自己"
);
throw
new
ValidateException
(
"smfco
r
e.canotDelSelf"
,
"删除用户:不能删除自己"
);
}
User
user
=
userManager
.
get
(
id
);
//admin的用户不让删除
if
(
user
.
getUsername
().
equals
(
Constants
.
SUPER_USERNAME
))
{
throw
new
ValidateException
(
"smfco
d
e.canotDelUser"
,
"删除用户:此用户不能删除"
);
throw
new
ValidateException
(
"smfco
r
e.canotDelUser"
,
"删除用户:此用户不能删除"
);
// throw new ValidateException("删除用户:此用户不能删除");
}
}
...
...
@@ -233,7 +233,7 @@ public class UserController {
// String password = RsaUtils.decryptByPrivateKey(RsaProperties.privateKey, user.getPassword());
// User myUser = userManager.findByUserName(SecurityUtils.getCurrentUsername());
// if (!passwordEncoder.matches(password, myUser.getPassword())) {
// throw new ValidateException("smfco
d
e.pwdError","修改邮箱失败,密码错误");
// throw new ValidateException("smfco
r
e.pwdError","修改邮箱失败,密码错误");
// }
//// verificationCodeService.validated(CodeEnum.EMAIL_RESET_EMAIL_CODE.getKey() + user.getEmail(), code);
// userManager.updateEmail(myUser.getUsername(), myUser.getEmail());
...
...
@@ -245,7 +245,7 @@ public class UserController {
public
ResponseEntity
<
Object
>
updateGroup
(
@RequestBody
UserDto
userDto
)
{
User
resources
=
userMapper
.
toEntity
(
userDto
);
if
(
resources
.
getId
()
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"ID"
}
);
// throw new ValidateException("修改用户组:ID不能为空");
}
User
user
=
userManager
.
get
(
resources
.
getId
());
...
...
@@ -261,7 +261,7 @@ public class UserController {
String
image
=
"csv"
;
String
fileType
=
FileUtil
.
getExtensionName
(
uploadFile
.
getOriginalFilename
());
if
(
fileType
!=
null
&&
!
image
.
contains
(
fileType
)){
throw
new
ValidateException
(
"smfco
d
e.feleFormatError"
,
"文件格式错误!, 仅支持{0}格式"
,
new
String
[]{
image
});
throw
new
ValidateException
(
"smfco
r
e.feleFormatError"
,
"文件格式错误!, 仅支持{0}格式"
,
new
String
[]{
image
});
}
File
folder
=
new
File
(
properties
.
getPath
(),
"user"
);
File
file
=
FileUtil
.
upload
(
uploadFile
,
folder
.
getAbsolutePath
());
...
...
src/main/java/com/neotel/smfcore/security/service/UserDetailsServiceImpl.java
查看文件 @
4b7908d
...
...
@@ -76,16 +76,16 @@ public class UserDetailsServiceImpl implements UserDetailsService {
user
=
userManager
.
findByUserName
(
username
);
}
catch
(
EntityNotFoundException
e
)
{
// SpringSecurity会自动转换UsernameNotFoundException为BadCredentialsException
throw
new
ValidateException
(
"smfco
d
e.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"username"
,
username
});
throw
new
ValidateException
(
"smfco
r
e.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"username"
,
username
});
}
if
(
user
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"username"
,
username
});
throw
new
ValidateException
(
"smfco
r
e.valueNotExist"
,
"{0}[{1}]不存在"
,
new
String
[]{
"username"
,
username
});
}
else
{
if
(
user
.
getEnabled
()==
null
){
throw
new
ValidateException
(
"smfco
d
e.notActivated"
,
"账号未激活"
);
throw
new
ValidateException
(
"smfco
r
e.notActivated"
,
"账号未激活"
);
}
if
(!
user
.
getEnabled
())
{
throw
new
ValidateException
(
"smfco
d
e.notActivated"
,
"账号未激活"
);
throw
new
ValidateException
(
"smfco
r
e.notActivated"
,
"账号未激活"
);
}
if
(
user
.
getUsername
().
equals
(
Constants
.
SUPER_USERNAME
)){
...
...
@@ -93,7 +93,7 @@ public class UserDetailsServiceImpl implements UserDetailsService {
//判断激活码是否正确
String
code
=
Md5Utls
.
getMd5
(
user
.
getId
(),
user
.
getCreateDate
());
if
(!
code
.
equals
(
user
.
getCheckCode
()))
{
throw
new
ValidateException
(
"smfco
d
e.notActivated"
,
"账号未激活"
);
throw
new
ValidateException
(
"smfco
r
e.notActivated"
,
"账号未激活"
);
}
}
List
<
Long
>
dataScopes
=
new
ArrayList
<>();
...
...
src/main/java/com/neotel/smfcore/security/service/manager/impl/GroupManagerImpl.java
查看文件 @
4b7908d
...
...
@@ -54,14 +54,14 @@ public class GroupManagerImpl implements IGroupManager {
logName
=
"修改分组:"
;
}
if
(
resources
.
getGroupName
()
==
null
)
{
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"groupName"
});
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"groupName"
});
// throw new BadRequestException(logName+"组名称不能为空");
}
Query
que
=
new
Query
(
c
);
List
<
Group
>
groups
=
findByQuery
(
que
);
if
(
groups
!=
null
&&
groups
.
size
()
>
0
)
{
// throw new ValidateException(logName+"组名称[" + resources.getGroupName() + "]已存在");
throw
new
ValidateException
(
"smfco
d
e.valueAlreadyExist"
,
"{0}[{1}]已存在"
,
new
String
[]{
"groupname"
,
resources
.
getGroupName
()});
throw
new
ValidateException
(
"smfco
r
e.valueAlreadyExist"
,
"{0}[{1}]已存在"
,
new
String
[]{
"groupname"
,
resources
.
getGroupName
()});
}
Group
group
=
groupDao
.
save
(
resources
);
//同时将组添加到超级管理员用户的权限中
...
...
src/main/java/com/neotel/smfcore/security/service/manager/impl/MenuManagerImpl.java
查看文件 @
4b7908d
...
...
@@ -266,11 +266,11 @@ public class MenuManagerImpl implements IMenuManager {
if
(
menu
.
getType
()==
null
){
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"Type"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"Type"
}
);
// throw new BadRequestException("菜单类型不能为空");
}
if
(
menu
.
getTitle
()==
null
){
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"Title"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"Title"
}
);
// throw new BadRequestException( "菜单标题不能为空");
}
if
(
menu
.
getChildren
()==
null
){
...
...
@@ -307,7 +307,7 @@ public class MenuManagerImpl implements IMenuManager {
//菜单path不能重复
Menu
pathMenu
=
menuDao
.
findOne
(
quer
);
if
(
pathMenu
!=
null
){
throw
new
ValidateException
(
"smfco
d
e.valueAlreadyExist"
,
"{0}[{1}]已存在"
,
new
String
[]{
"path"
,
pathMenu
.
getPath
()});
throw
new
ValidateException
(
"smfco
r
e.valueAlreadyExist"
,
"{0}[{1}]已存在"
,
new
String
[]{
"path"
,
pathMenu
.
getPath
()});
// throw new BadRequestException("路径["+pathMenu+"]已存在");
}
...
...
src/main/java/com/neotel/smfcore/security/service/manager/impl/RoleManagerImpl.java
查看文件 @
4b7908d
...
...
@@ -80,7 +80,7 @@ public class RoleManagerImpl implements IRoleManager {
@Override
public
Role
saveRole
(
Role
role
)
throws
ValidateException
{
if
(
role
.
getName
()==
null
){
throw
new
ValidateException
(
"smfco
d
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"name"
}
);
throw
new
ValidateException
(
"smfco
r
e.valueCanotNull"
,
"{0}不能为空"
,
new
String
[]{
"name"
}
);
// throw new BadRequestException("角色名称不能为空");
}
if
(
role
.
getMenus
()
==
null
)
{
...
...
@@ -102,7 +102,7 @@ public class RoleManagerImpl implements IRoleManager {
log
.
error
(
logName
+
"["
+
role
.
toString
()
+
"]出错:角色名["
+
role
.
getName
()
+
"]已存在"
);
// throw new ValidateException(logName+"角色名[" + role.getName() + "]已存在");
throw
new
ValidateException
(
"smfco
d
e.valueAlreadyExist"
,
"{0}[{1}]已存在"
,
new
String
[]{
"name"
,
role
.
getName
()});
throw
new
ValidateException
(
"smfco
r
e.valueAlreadyExist"
,
"{0}[{1}]已存在"
,
new
String
[]{
"name"
,
role
.
getName
()});
}
return
roleDao
.
save
(
role
);
}
...
...
@@ -111,12 +111,12 @@ public class RoleManagerImpl implements IRoleManager {
Role
role
=
this
.
get
(
resources
.
getId
());
if
(
role
==
null
){
throw
new
ValidateException
(
"smfco
d
e.notSelRole"
,
"请要修改的选择角色"
);
throw
new
ValidateException
(
"smfco
r
e.notSelRole"
,
"请要修改的选择角色"
);
// throw new BadRequestException("请要修改的选择角色");
}
if
(
role
.
getName
().
equals
(
"admin"
)){
if
(!
SecurityUtils
.
getCurrentUsername
().
equals
(
Constants
.
SUPER_USERNAME
)){
throw
new
ValidateException
(
"smfco
d
e.noaccess"
,
"无权限修改此角色的菜单"
);
throw
new
ValidateException
(
"smfco
r
e.noaccess"
,
"无权限修改此角色的菜单"
);
// throw new BadRequestException("只有超级管理员才能修改此角色的菜单");
}
}
...
...
src/main/java/com/neotel/smfcore/security/service/manager/impl/UserManagerImpl.java
查看文件 @
4b7908d
...
...
@@ -61,7 +61,7 @@ public class UserManagerImpl implements IUserManager {
}
List
<
User
>
users
=
userDao
.
findByQuery
(
query
);
if
(
users
!=
null
&&
users
.
size
()>
0
){
throw
new
ValidateException
(
"smfco
d
e.valueAlreadyExist"
,
"{0}[{1}]已存在"
,
new
String
[]{
"userName"
,
username
});
throw
new
ValidateException
(
"smfco
r
e.valueAlreadyExist"
,
"{0}[{1}]已存在"
,
new
String
[]{
"userName"
,
username
});
}
}
@Override
...
...
@@ -84,7 +84,7 @@ public class UserManagerImpl implements IUserManager {
}
if
(
user
.
getUsername
().
equals
(
Constants
.
SUPER_USERNAME
))
{
if
(!
user
.
getId
().
equals
(
SecurityUtils
.
getCurrentUserId
()))
{
throw
new
ValidateException
(
"smfco
d
e.hasNoAccess"
,
"无权限修改此用户信息"
);
throw
new
ValidateException
(
"smfco
r
e.hasNoAccess"
,
"无权限修改此用户信息"
);
// throw new ValidateException("无权限修改此用户信息");
}
}
...
...
src/main/resources/messages.properties
查看文件 @
4b7908d
此文件的差异被折叠,
点击展开。
src/main/resources/messages_en_US.properties
查看文件 @
4b7908d
此文件的差异被折叠,
点击展开。
src/main/resources/messages_ja_JP.properties
查看文件 @
4b7908d
此文件的差异被折叠,
点击展开。
src/main/resources/messages_zh_CN.properties
查看文件 @
4b7908d
此文件的差异被折叠,
点击展开。
src/main/resources/messages_zh_TW.properties
查看文件 @
4b7908d
此文件的差异被折叠,
点击展开。
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论