Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
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
haoban3.0
haoban-manage3.0
Commits
c64baecc
Commit
c64baecc
authored
Mar 31, 2020
by
huangZW
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
111
parent
143e7816
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
41 additions
and
3 deletions
+41
-3
DictApiService.java
...ava/com/gic/haoban/manage/api/service/DictApiService.java
+1
-1
DictController.java
.../com/gic/haoban/manage/web/controller/DictController.java
+7
-1
HaoBanErrCode.java
...java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
+2
-0
DictMapper.java
.../com/gic/haoban/manage/service/dao/mapper/DictMapper.java
+5
-0
DictApiServiceImpl.java
...n/manage/service/service/out/impl/DictApiServiceImpl.java
+10
-1
DictMapper.xml
...-manage3-service/src/main/resources/mapper/DictMapper.xml
+16
-0
No files found.
haoban-manage3-api/src/main/java/com/gic/haoban/manage/api/service/DictApiService.java
View file @
c64baecc
...
...
@@ -10,7 +10,7 @@ import java.util.List;
* Created by tgs on 2020/2/9.
*/
public
interface
DictApiService
{
void
saveDict
(
DictDTO
dto
);
int
saveDict
(
DictDTO
dto
);
DictDTO
findOneDict
(
String
dictId
);
...
...
haoban-manage3-operation-web/src/main/java/com/gic/haoban/manage/web/controller/DictController.java
View file @
c64baecc
...
...
@@ -29,7 +29,13 @@ public class DictController extends WebBaseController{
//保存字典
@RequestMapping
(
"save-dict"
)
public
HaobanResponse
saveDict
(
DictDTO
dto
)
{
dictApiService
.
saveDict
(
dto
);
int
i
=
dictApiService
.
saveDict
(
dto
);
if
(
i
==
8
){
return
resultResponse
(
HaoBanErrCode
.
ERR_10006
);
}
if
(
i
==
9
){
return
resultResponse
(
HaoBanErrCode
.
ERR_10007
);
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
//查看字典详情
...
...
haoban-manage3-operation-web/src/main/java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
View file @
c64baecc
...
...
@@ -67,6 +67,8 @@ public enum HaoBanErrCode {
ERR_10004
(
10004
,
"成员名称不能为空"
),
ERR_10005
(
10005
,
"成员已存在"
),
ERR_10006
(
10006
,
"字典key已存在"
),
ERR_10007
(
10007
,
"字典名称已存在"
),
ERR_DEFINE
(-
888
,
"自定义错误"
),
...
...
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/dao/mapper/DictMapper.java
View file @
c64baecc
...
...
@@ -23,4 +23,8 @@ public interface DictMapper {
List
<
TabHaobanDict
>
queryList
(
@Param
(
"keys"
)
List
<
String
>
keys
);
TabHaobanDict
selectByDictKey
(
String
dictKey
);
TabHaobanDict
selectByDictName
(
String
dictKey
);
}
\ No newline at end of file
haoban-manage3-service/src/main/java/com/gic/haoban/manage/service/service/out/impl/DictApiServiceImpl.java
View file @
c64baecc
...
...
@@ -26,16 +26,25 @@ public class DictApiServiceImpl implements DictApiService{
@Autowired
private
DictMapper
dictMapper
;
@Override
public
void
saveDict
(
DictDTO
dto
)
{
public
int
saveDict
(
DictDTO
dto
)
{
if
(
StringUtils
.
isBlank
(
dto
.
getDictId
())){
//空,则新增
dto
.
setDictId
(
UuidUtil
.
randomUUID
());
TabHaobanDict
tab
=
EntityUtil
.
changeEntity
(
TabHaobanDict
.
class
,
dto
);
TabHaobanDict
tab1
=
dictMapper
.
selectByDictKey
(
dto
.
getDictKey
());
if
(
tab1
!=
null
){
return
8
;
}
TabHaobanDict
tab2
=
dictMapper
.
selectByDictName
(
dto
.
getDictName
());
if
(
tab2
!=
null
){
return
9
;
}
dictMapper
.
insert
(
tab
);
}
else
{
TabHaobanDict
tab
=
EntityUtil
.
changeEntity
(
TabHaobanDict
.
class
,
dto
);
dictMapper
.
updateByPrimaryKeySelective
(
tab
);
}
return
1
;
}
@Override
...
...
haoban-manage3-service/src/main/resources/mapper/DictMapper.xml
View file @
c64baecc
...
...
@@ -133,4 +133,19 @@
#{item}
</foreach>
</select>
<select
id=
"selectByDictKey"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_dict
where dict_key = #{dictKey,jdbcType=VARCHAR}
and status_flag = 1
</select>
<select
id=
"selectByDictName"
resultMap=
"BaseResultMap"
parameterType=
"java.lang.String"
>
select
<include
refid=
"Base_Column_List"
/>
from tab_haoban_dict
where dict_name = #{dictName,jdbcType=VARCHAR}
and status_flag = 1
</select>
</mapper>
\ No newline at end of file
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