Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangxinjiang
yifu-mvp
Commits
599a7482
Commit
599a7482
authored
Jun 16, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
字典项优化
parent
47ce3629
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
0 deletions
+21
-0
ErrorCodes.java
....cloud.plus.v1/yifu/common/core/exception/ErrorCodes.java
+5
-0
messages_zh_CN.properties
...on-core/src/main/resources/i18n/messages_zh_CN.properties
+1
-0
DictController.java
...u.cloud.plus.v1/yifu/admin/controller/DictController.java
+15
-0
No files found.
yifu-common/yifu-common-core/src/main/java/com/yifu.cloud.plus.v1/yifu/common/core/exception/ErrorCodes.java
View file @
599a7482
...
...
@@ -146,4 +146,9 @@ public interface ErrorCodes {
* 已存在对应编码的字典
*/
String
SYS_DICT_ADD_TYPE_EXISTS
=
"sys.dict.add.type.exist"
;
/**
* 已存在对应值的字典项
*/
String
SYS_DICT_ITEM_ADD_VALUE_EXIST
=
"sys.dict.item.add.value.exist"
;
}
yifu-common/yifu-common-core/src/main/resources/i18n/messages_zh_CN.properties
View file @
599a7482
...
...
@@ -29,6 +29,7 @@ sys.dict.delete.system=\u7CFB\u7EDF\u5185\u7F6E\u5B57\u5178\u9879\u76EE\u4E0D\u8
sys.dict.update.system
=
\u
7CFB
\u
7EDF
\u5185\u
7F6E
\u
5B57
\u5178\u9879\u
76EE
\u
4E0D
\u
80FD
\u
4FEE
\u6539
sys.dict.delete.existing
=
\u
5B57
\u5178\u
5B58
\u5728\u
4E0B
\u
7EA7
\u8282\u
70B9
\u
4E0D
\u
80FD
\u5220\u9664
sys.dict.add.type.exist
=
\u
5DF2
\u
5B58
\u5728\u
5BF9
\u
5E94
\u
7F16
\u7801\u7684\u
5B57
\u5178
sys.dict.item.add.value.exist
=
\u
5DF2
\u
5B58
\u5728\u
5BF9
\u
5E94
\u
503C
\u7684\u
5B57
\u5178\u9879
sys.role.delete.system
=
\u
7CFB
\u
7EDF
\u5185\u
7F6E
\u
89D2
\u8272\u
4E0D
\u
80FD
\u5220\u9664
sys.role.update.system
=
\u
7CFB
\u
7EDF
\u5185\u
7F6E
\u
89D2
\u8272\u
4E0D
\u
80FD
\u
4FEE
\u6539
...
...
yifu-upms/yifu-upms-biz/src/main/java/com/yifu.cloud.plus.v1/yifu/admin/controller/DictController.java
View file @
599a7482
...
...
@@ -180,6 +180,13 @@ public class DictController {
@PostMapping
(
"/item"
)
@CacheEvict
(
value
=
CacheConstants
.
DICT_DETAILS
,
allEntries
=
true
)
public
R
<
Boolean
>
save
(
@RequestBody
SysDictItem
sysDictItem
)
{
SysDictItem
item
=
sysDictItemService
.
getOne
(
Wrappers
.<
SysDictItem
>
query
().
lambda
()
.
eq
(
SysDictItem:
:
getType
,
sysDictItem
.
getType
())
.
eq
(
SysDictItem:
:
getValue
,
sysDictItem
.
getValue
())
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isNotNull
(
item
)){
return
R
.
failed
(
MsgUtils
.
getMessage
(
ErrorCodes
.
SYS_DICT_ITEM_ADD_VALUE_EXIST
));
}
return
R
.
ok
(
sysDictItemService
.
save
(
sysDictItem
));
}
...
...
@@ -191,6 +198,14 @@ public class DictController {
@SysLog
(
"修改字典项"
)
@PutMapping
(
"/item"
)
public
R
updateById
(
@RequestBody
SysDictItem
sysDictItem
)
{
SysDictItem
item
=
sysDictItemService
.
getOne
(
Wrappers
.<
SysDictItem
>
query
().
lambda
()
.
eq
(
SysDictItem:
:
getType
,
sysDictItem
.
getType
())
.
ne
(
SysDictItem:
:
getId
,
sysDictItem
.
getDictId
())
.
eq
(
SysDictItem:
:
getValue
,
sysDictItem
.
getValue
())
.
last
(
CommonConstants
.
LAST_ONE_SQL
));
if
(
Common
.
isNotNull
(
item
)){
return
R
.
failed
(
MsgUtils
.
getMessage
(
ErrorCodes
.
SYS_DICT_ITEM_ADD_VALUE_EXIST
));
}
return
R
.
ok
(
sysDictItemService
.
updateDictItem
(
sysDictItem
));
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment