Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-backend
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
AutogeneralShanghai
yd-backend
Commits
3974d2b1
Commit
3974d2b1
authored
Jul 26, 2021
by
wenyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
基础标签不能新增相同的标签类别的标签名称
parent
2d8e96f8
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
53 additions
and
0 deletions
+53
-0
yd-api/src/main/java/com/yd/api/agms/service/impl/AgmsTagServiceImpl.java
+17
-0
yd-api/src/main/java/com/yd/dal/mapper/meta/MdTagNewMapper.java
+4
-0
yd-api/src/main/java/com/yd/dal/service/meta/MdTagNewDALService.java
+2
-0
yd-api/src/main/java/com/yd/dal/service/meta/impl/MdTagNewDALServiceImpl.java
+5
-0
yd-api/src/main/resources/i18n/messages_zh_CN.properties
+2
-0
yd-api/src/main/resources/mapper/meta/MdTagNewMapper.xml
+23
-0
No files found.
yd-api/src/main/java/com/yd/api/agms/service/impl/AgmsTagServiceImpl.java
View file @
3974d2b1
...
@@ -68,6 +68,23 @@ public class AgmsTagServiceImpl implements AgmsTagService {
...
@@ -68,6 +68,23 @@ public class AgmsTagServiceImpl implements AgmsTagService {
}
}
}
}
List
<
MdTagNew
>
tagNameCheck
=
mdTagNewDALService
.
selectByIdOrTagName
(
1L
,
requestVO
.
getTagName
(),
requestVO
.
getTagType
(),
null
);
if
(
tagNameCheck
!=
null
&&
tagNameCheck
.
size
()
>
0
){
if
(!
CommonUtil
.
isNullOrZero
(
requestVO
.
getId
())){
if
(!
tagNameCheck
.
get
(
0
).
getId
().
toString
().
equals
(
requestVO
.
getId
().
toString
())){
commonResult
.
setSuccess
(
false
);
commonResult
.
setMessage
(
ZHBErrorConfig
.
getErrorInfo
(
"830038"
));
responseVO
.
setCommonResult
(
commonResult
);
return
responseVO
;
}
}
else
{
commonResult
.
setSuccess
(
false
);
commonResult
.
setMessage
(
ZHBErrorConfig
.
getErrorInfo
(
"830038"
));
responseVO
.
setCommonResult
(
commonResult
);
return
responseVO
;
}
}
MdTagNew
mdTagNew
=
new
MdTagNew
();
MdTagNew
mdTagNew
=
new
MdTagNew
();
BeanUtils
.
copyProperties
(
requestVO
,
mdTagNew
);
BeanUtils
.
copyProperties
(
requestVO
,
mdTagNew
);
if
(
CommonUtil
.
isNullOrZero
(
requestVO
.
getId
())){
if
(
CommonUtil
.
isNullOrZero
(
requestVO
.
getId
())){
...
...
yd-api/src/main/java/com/yd/dal/mapper/meta/MdTagNewMapper.java
View file @
3974d2b1
...
@@ -26,4 +26,7 @@ public interface MdTagNewMapper {
...
@@ -26,4 +26,7 @@ public interface MdTagNewMapper {
List
<
MdTagNew
>
selectByIsActive
(
@Param
(
"isActive"
)
Long
isActive
,
@Param
(
"configLevel"
)
Long
configLevel
,
@Param
(
"upperTagId"
)
Long
upperTagId
,
@Param
(
"tagName"
)
String
tagName
,
@Param
(
"tagType"
)
Long
tagType
);
List
<
MdTagNew
>
selectByIsActive
(
@Param
(
"isActive"
)
Long
isActive
,
@Param
(
"configLevel"
)
Long
configLevel
,
@Param
(
"upperTagId"
)
Long
upperTagId
,
@Param
(
"tagName"
)
String
tagName
,
@Param
(
"tagType"
)
Long
tagType
);
List
<
MdTagNew
>
selectByConfigLevelAndtagType
(
@Param
(
"configLevel"
)
Long
configLevel
,
@Param
(
"tagType"
)
Long
tagType
);
List
<
MdTagNew
>
selectByConfigLevelAndtagType
(
@Param
(
"configLevel"
)
Long
configLevel
,
@Param
(
"tagType"
)
Long
tagType
);
List
<
MdTagNew
>
selectByIdOrTagName
(
@Param
(
"isActive"
)
Long
isActive
,
@Param
(
"tagName"
)
String
tagName
,
@Param
(
"tagType"
)
Long
tagType
,
@Param
(
"id"
)
Long
id
);
}
}
\ No newline at end of file
yd-api/src/main/java/com/yd/dal/service/meta/MdTagNewDALService.java
View file @
3974d2b1
...
@@ -17,4 +17,6 @@ public interface MdTagNewDALService {
...
@@ -17,4 +17,6 @@ public interface MdTagNewDALService {
MdTagNew
selectByPrimaryKey
(
Long
id
);
MdTagNew
selectByPrimaryKey
(
Long
id
);
List
<
MdTagNew
>
selectByConfigLevelAndtagType
(
Long
configLevel
,
Long
tagType
);
List
<
MdTagNew
>
selectByConfigLevelAndtagType
(
Long
configLevel
,
Long
tagType
);
List
<
MdTagNew
>
selectByIdOrTagName
(
Long
isActive
,
String
tagName
,
Long
tagType
,
Long
id
);
}
}
yd-api/src/main/java/com/yd/dal/service/meta/impl/MdTagNewDALServiceImpl.java
View file @
3974d2b1
...
@@ -4,6 +4,7 @@ import java.util.List;
...
@@ -4,6 +4,7 @@ import java.util.List;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
org.apache.ibatis.annotations.Param
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.yd.dal.entity.meta.MdTagNew
;
import
com.yd.dal.entity.meta.MdTagNew
;
...
@@ -44,5 +45,9 @@ public class MdTagNewDALServiceImpl implements MdTagNewDALService {
...
@@ -44,5 +45,9 @@ public class MdTagNewDALServiceImpl implements MdTagNewDALService {
return
mapper
.
selectByConfigLevelAndtagType
(
configLevel
,
tagType
);
return
mapper
.
selectByConfigLevelAndtagType
(
configLevel
,
tagType
);
}
}
@Override
public
List
<
MdTagNew
>
selectByIdOrTagName
(
Long
isActive
,
String
tagName
,
Long
tagType
,
Long
id
)
{
return
mapper
.
selectByIdOrTagName
(
isActive
,
tagName
,
tagType
,
id
);
}
}
}
yd-api/src/main/resources/i18n/messages_zh_CN.properties
View file @
3974d2b1
...
@@ -52,3 +52,4 @@
...
@@ -52,3 +52,4 @@
830035
=
根据基础标签ID查找不到有效的基础标签!
830035
=
根据基础标签ID查找不到有效的基础标签!
830036
=
标签名称有值时标签级别不能为空!
830036
=
标签名称有值时标签级别不能为空!
830037
=
该标签类别已经有一级标签!
830037
=
该标签类别已经有一级标签!
830038
=
该标签类别已存在相同的标签名称!
\ No newline at end of file
yd-api/src/main/resources/mapper/meta/MdTagNewMapper.xml
View file @
3974d2b1
...
@@ -341,4 +341,26 @@
...
@@ -341,4 +341,26 @@
from ag_md_tag_new where is_active = 1 and config_level = #{configLevel,jdbcType=BIGINT} and tag_type = #{tagType,jdbcType=BIGINT}
from ag_md_tag_new where is_active = 1 and config_level = #{configLevel,jdbcType=BIGINT} and tag_type = #{tagType,jdbcType=BIGINT}
</select>
</select>
<select
id=
"selectByIdOrTagName"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from ag_md_tag_new t
<where>
1 = 1
<if
test=
"isActive != null"
>
and t.is_active = #{isActive,jdbcType=BIGINT}
</if>
<if
test=
"tagName != null"
>
and t.tag_name = #{tagName,jdbcType=VARCHAR}
</if>
<if
test=
"tagType != null"
>
and t.tag_type = #{tagType,jdbcType=BIGINT}
</if>
<if
test=
"id != null"
>
and t.id =#{id,jdbcType=BIGINT}
</if>
</where>
</select>
</mapper>
</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