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
6c7a0966
Commit
6c7a0966
authored
Jul 01, 2021
by
wenyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
标签--使用场景(新增、修改、列表查询、使用场景查询)
parent
51ab3335
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
906 additions
and
9 deletions
+906
-9
yd-api/src/main/java/com/yd/api/agms/AgmsController.java
+16
-0
yd-api/src/main/java/com/yd/api/agms/service/AgmsTagService.java
+10
-0
yd-api/src/main/java/com/yd/api/agms/service/impl/AgmsTagServiceImpl.java
+94
-0
yd-api/src/main/java/com/yd/api/agms/vo/tag/TagViewUpdateRequestVO.java
+191
-0
yd-api/src/main/java/com/yd/api/agms/vo/tag/TagViewUpdateResponseVO.java
+58
-0
yd-api/src/main/java/com/yd/api/metadata/MetadataController.java
+21
-3
yd-api/src/main/java/com/yd/api/metadata/service/MetadataService.java
+10
-0
yd-api/src/main/java/com/yd/api/metadata/service/impl/MetadataServiceImpl.java
+84
-0
yd-api/src/main/java/com/yd/api/metadata/vo/TagViewQueryInfo.java
+257
-0
yd-api/src/main/java/com/yd/api/metadata/vo/TagViewQueryRequestVO.java
+49
-0
yd-api/src/main/java/com/yd/api/metadata/vo/TagViewQueryResponseVO.java
+40
-0
yd-api/src/main/java/com/yd/dal/mapper/meta/MdTagViewMapper.java
+6
-1
yd-api/src/main/java/com/yd/dal/service/meta/MdTagNewDALService.java
+2
-0
yd-api/src/main/java/com/yd/dal/service/meta/MdTagViewDALService.java
+12
-0
yd-api/src/main/java/com/yd/dal/service/meta/impl/MdTagNewDALServiceImpl.java
+6
-0
yd-api/src/main/java/com/yd/dal/service/meta/impl/MdTagViewDALServiceImpl.java
+27
-3
yd-api/src/main/resources/i18n/messages_zh_CN.properties
+9
-2
yd-api/src/main/resources/mapper/meta/MdTagViewMapper.xml
+14
-0
No files found.
yd-api/src/main/java/com/yd/api/agms/AgmsController.java
View file @
6c7a0966
...
@@ -30,6 +30,8 @@ import com.yd.api.agms.vo.statistics.LeadsStatisticsRequestVO;
...
@@ -30,6 +30,8 @@ import com.yd.api.agms.vo.statistics.LeadsStatisticsRequestVO;
import
com.yd.api.agms.vo.statistics.LeadsStatisticsResponseVO
;
import
com.yd.api.agms.vo.statistics.LeadsStatisticsResponseVO
;
import
com.yd.api.agms.vo.tag.TagUpdateRequestVO
;
import
com.yd.api.agms.vo.tag.TagUpdateRequestVO
;
import
com.yd.api.agms.vo.tag.TagUpdateResponseVO
;
import
com.yd.api.agms.vo.tag.TagUpdateResponseVO
;
import
com.yd.api.agms.vo.tag.TagViewUpdateRequestVO
;
import
com.yd.api.agms.vo.tag.TagViewUpdateResponseVO
;
import
com.yd.api.result.JsonResult
;
import
com.yd.api.result.JsonResult
;
import
com.yd.util.CommonUtil
;
import
com.yd.util.CommonUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -379,4 +381,18 @@ public class AgmsController {
...
@@ -379,4 +381,18 @@ public class AgmsController {
result
.
addResult
(
responseVO
);
result
.
addResult
(
responseVO
);
return
result
;
return
result
;
}
}
/**
* AGMS -- 前端显示标签 保存与修改
* @param requestVO 请求数据
* @return 响应数据
*/
@RequestMapping
(
value
=
"/tagViewUpdate"
)
public
Object
tagViewUpdate
(
@RequestBody
TagViewUpdateRequestVO
requestVO
)
{
JsonResult
result
=
new
JsonResult
();
TagViewUpdateResponseVO
responseVO
=
agmsTagService
.
tagViewUpdate
(
requestVO
);
result
.
setData
(
responseVO
);
result
.
addResult
(
responseVO
);
return
result
;
}
}
}
yd-api/src/main/java/com/yd/api/agms/service/AgmsTagService.java
View file @
6c7a0966
...
@@ -2,6 +2,8 @@ package com.yd.api.agms.service;
...
@@ -2,6 +2,8 @@ package com.yd.api.agms.service;
import
com.yd.api.agms.vo.tag.TagUpdateRequestVO
;
import
com.yd.api.agms.vo.tag.TagUpdateRequestVO
;
import
com.yd.api.agms.vo.tag.TagUpdateResponseVO
;
import
com.yd.api.agms.vo.tag.TagUpdateResponseVO
;
import
com.yd.api.agms.vo.tag.TagViewUpdateRequestVO
;
import
com.yd.api.agms.vo.tag.TagViewUpdateResponseVO
;
/**
/**
* @author xxy
* @author xxy
...
@@ -13,4 +15,12 @@ public interface AgmsTagService {
...
@@ -13,4 +15,12 @@ public interface AgmsTagService {
* @return 响应数据
* @return 响应数据
*/
*/
TagUpdateResponseVO
tagUpdate
(
TagUpdateRequestVO
requestVO
);
TagUpdateResponseVO
tagUpdate
(
TagUpdateRequestVO
requestVO
);
/**
* AGMS -- 前端显示标签 保存与修改
* @param requestVO 请求数据
* @return 响应数据
*/
TagViewUpdateResponseVO
tagViewUpdate
(
TagViewUpdateRequestVO
requestVO
);
}
}
yd-api/src/main/java/com/yd/api/agms/service/impl/AgmsTagServiceImpl.java
View file @
6c7a0966
...
@@ -3,9 +3,13 @@ package com.yd.api.agms.service.impl;
...
@@ -3,9 +3,13 @@ package com.yd.api.agms.service.impl;
import
com.yd.api.agms.service.AgmsTagService
;
import
com.yd.api.agms.service.AgmsTagService
;
import
com.yd.api.agms.vo.tag.TagUpdateRequestVO
;
import
com.yd.api.agms.vo.tag.TagUpdateRequestVO
;
import
com.yd.api.agms.vo.tag.TagUpdateResponseVO
;
import
com.yd.api.agms.vo.tag.TagUpdateResponseVO
;
import
com.yd.api.agms.vo.tag.TagViewUpdateRequestVO
;
import
com.yd.api.agms.vo.tag.TagViewUpdateResponseVO
;
import
com.yd.api.result.CommonResult
;
import
com.yd.api.result.CommonResult
;
import
com.yd.dal.entity.meta.MdTagNew
;
import
com.yd.dal.entity.meta.MdTagNew
;
import
com.yd.dal.entity.meta.MdTagView
;
import
com.yd.dal.service.meta.MdTagNewDALService
;
import
com.yd.dal.service.meta.MdTagNewDALService
;
import
com.yd.dal.service.meta.MdTagViewDALService
;
import
com.yd.util.CommonUtil
;
import
com.yd.util.CommonUtil
;
import
com.yd.util.config.ZHBErrorConfig
;
import
com.yd.util.config.ZHBErrorConfig
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
...
@@ -24,6 +28,9 @@ public class AgmsTagServiceImpl implements AgmsTagService {
...
@@ -24,6 +28,9 @@ public class AgmsTagServiceImpl implements AgmsTagService {
@Autowired
@Autowired
public
MdTagNewDALService
mdTagNewDALService
;
public
MdTagNewDALService
mdTagNewDALService
;
@Autowired
public
MdTagViewDALService
mdTagViewDALService
;
@Override
@Override
public
TagUpdateResponseVO
tagUpdate
(
TagUpdateRequestVO
requestVO
)
{
public
TagUpdateResponseVO
tagUpdate
(
TagUpdateRequestVO
requestVO
)
{
TagUpdateResponseVO
responseVO
=
new
TagUpdateResponseVO
();
TagUpdateResponseVO
responseVO
=
new
TagUpdateResponseVO
();
...
@@ -68,4 +75,91 @@ public class AgmsTagServiceImpl implements AgmsTagService {
...
@@ -68,4 +75,91 @@ public class AgmsTagServiceImpl implements AgmsTagService {
commonResult
.
setSuccess
(
true
);
commonResult
.
setSuccess
(
true
);
commonResult
.
setMessage
(
ZHBErrorConfig
.
getErrorInfo
(
"800000"
));
commonResult
.
setMessage
(
ZHBErrorConfig
.
getErrorInfo
(
"800000"
));
}
}
/**
* AGMS -- 前端显示标签 保存与修改
* @author xxy
* @date 2021年06月30日 23:39
*/
@Override
public
TagViewUpdateResponseVO
tagViewUpdate
(
TagViewUpdateRequestVO
requestVO
)
{
TagViewUpdateResponseVO
responseVO
=
new
TagViewUpdateResponseVO
();
CommonResult
commonResult
=
new
CommonResult
();
tagViewUpdateEntryCheck
(
requestVO
,
commonResult
);
if
(!
commonResult
.
isSuccess
()){
responseVO
.
setCommonResult
(
commonResult
);
return
responseVO
;
}
MdTagView
mdTagView
=
new
MdTagView
();
BeanUtils
.
copyProperties
(
requestVO
,
mdTagView
);
if
(
CommonUtil
.
isNullOrZero
(
requestVO
.
getId
())){
mdTagView
.
setCreatedAt
(
new
Date
());
mdTagView
.
setUpdatedAt
(
new
Date
());
mdTagView
.
setCreatedBy
(
requestVO
.
getLoginId
());
mdTagView
.
setUpdatedBy
(
requestVO
.
getLoginId
());
mdTagViewDALService
.
insert
(
mdTagView
);
}
else
{
mdTagView
.
setUpdatedAt
(
new
Date
());
mdTagView
.
setUpdatedBy
(
requestVO
.
getLoginId
());
mdTagViewDALService
.
updateByPrimaryKeySelective
(
mdTagView
);
}
commonResult
.
setSuccess
(
true
);
commonResult
.
setMessage
(
ZHBErrorConfig
.
getErrorInfo
(
"800000"
));
responseVO
.
setId
(
mdTagView
.
getId
());
responseVO
.
setCommonResult
(
commonResult
);
return
responseVO
;
}
private
void
tagViewUpdateEntryCheck
(
TagViewUpdateRequestVO
requestVO
,
CommonResult
commonResult
)
{
if
(
CommonUtil
.
isNullOrBlank
(
requestVO
.
getTagViewType
())){
commonResult
.
setSuccess
(
false
);
commonResult
.
setMessage
(
ZHBErrorConfig
.
getErrorInfo
(
"830029"
));
return
;
}
if
(
CommonUtil
.
isNullOrZero
(
requestVO
.
getTagId
())){
commonResult
.
setSuccess
(
false
);
commonResult
.
setMessage
(
ZHBErrorConfig
.
getErrorInfo
(
"830030"
));
return
;
}
else
{
MdTagNew
mdTagNew
=
mdTagNewDALService
.
selectByPrimaryKey
(
requestVO
.
getTagId
());
if
(!(
mdTagNew
!=
null
&&
!
CommonUtil
.
isNullOrZero
(
mdTagNew
.
getIsActive
())
&&
mdTagNew
.
getIsActive
()
==
1
)){
commonResult
.
setSuccess
(
false
);
commonResult
.
setMessage
(
ZHBErrorConfig
.
getErrorInfo
(
"830035"
));
return
;
}
}
if
(
CommonUtil
.
isNullOrBlank
(
requestVO
.
getTagLevel
())){
commonResult
.
setSuccess
(
false
);
commonResult
.
setMessage
(
ZHBErrorConfig
.
getErrorInfo
(
"830027"
));
return
;
}
if
(
CommonUtil
.
isNullOrZero
(
requestVO
.
getUpperTagViewId
())
&&
!
"1"
.
equals
(
requestVO
.
getTagLevel
())){
commonResult
.
setSuccess
(
false
);
commonResult
.
setMessage
(
ZHBErrorConfig
.
getErrorInfo
(
"830028"
));
return
;
}
else
{
MdTagView
mdTagView
=
mdTagViewDALService
.
selectByPrimaryKey
(
requestVO
.
getUpperTagViewId
());
if
(
mdTagView
!=
null
){
if
(!
requestVO
.
getTagViewType
().
equals
(
mdTagView
.
getTagViewType
())){
commonResult
.
setSuccess
(
false
);
commonResult
.
setMessage
(
ZHBErrorConfig
.
getErrorInfo
(
"830033"
));
return
;
}
if
(
CommonUtil
.
stringParseInt
(
requestVO
.
getTagLevel
())
!=
CommonUtil
.
stringParseInt
(
mdTagView
.
getTagLevel
())
+
1
){
commonResult
.
setSuccess
(
false
);
commonResult
.
setMessage
(
ZHBErrorConfig
.
getErrorInfo
(
"830034"
));
return
;
}
}
else
{
commonResult
.
setSuccess
(
false
);
commonResult
.
setMessage
(
ZHBErrorConfig
.
getErrorInfo
(
"830032"
));
return
;
}
}
commonResult
.
setSuccess
(
true
);
commonResult
.
setMessage
(
ZHBErrorConfig
.
getErrorInfo
(
"800000"
));
}
}
}
yd-api/src/main/java/com/yd/api/agms/vo/tag/TagViewUpdateRequestVO.java
0 → 100644
View file @
6c7a0966
package
com
.
yd
.
api
.
agms
.
vo
.
tag
;
/**
* @author wenYang
* @date 2021年06月30日 23:41
*/
public
class
TagViewUpdateRequestVO
{
private
Long
id
;
private
String
tagViewType
;
//标签显示类别(1=12宫格; 2=左侧热榜列表; 3=右上角筛选)
private
Long
tagId
;
//标签ID
private
String
tagName
;
//标签名称
private
String
tagLevel
;
// 标签级别(1=一级标签;2=二级标签;3=三级标签,以此类推)
private
Long
upperTagViewId
;
//上级前端显示标签ID
private
String
displayImage
;
// UI上显示图片
private
Integer
displayOrder
;
//UI上layout优先级
private
Integer
isActive
;
// 1=active 2=inactive
private
String
remark
;
//备注
private
Long
loginId
;
/**
* @return the id
*/
public
Long
getId
()
{
return
id
;
}
/**
* @param id the id to set
*/
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
/**
* @return the tagViewType
*/
public
String
getTagViewType
()
{
return
tagViewType
;
}
/**
* @param tagViewType the tagViewType to set
*/
public
void
setTagViewType
(
String
tagViewType
)
{
this
.
tagViewType
=
tagViewType
;
}
/**
* @return the tagId
*/
public
Long
getTagId
()
{
return
tagId
;
}
/**
* @param tagId the tagId to set
*/
public
void
setTagId
(
Long
tagId
)
{
this
.
tagId
=
tagId
;
}
/**
* @return the tagName
*/
public
String
getTagName
()
{
return
tagName
;
}
/**
* @param tagName the tagName to set
*/
public
void
setTagName
(
String
tagName
)
{
this
.
tagName
=
tagName
;
}
/**
* @return the tagLevel
*/
public
String
getTagLevel
()
{
return
tagLevel
;
}
/**
* @param tagLevel the tagLevel to set
*/
public
void
setTagLevel
(
String
tagLevel
)
{
this
.
tagLevel
=
tagLevel
;
}
/**
* @return the upperTagViewId
*/
public
Long
getUpperTagViewId
()
{
return
upperTagViewId
;
}
/**
* @param upperTagViewId the upperTagViewId to set
*/
public
void
setUpperTagViewId
(
Long
upperTagViewId
)
{
this
.
upperTagViewId
=
upperTagViewId
;
}
/**
* @return the displayImage
*/
public
String
getDisplayImage
()
{
return
displayImage
;
}
/**
* @param displayImage the displayImage to set
*/
public
void
setDisplayImage
(
String
displayImage
)
{
this
.
displayImage
=
displayImage
;
}
/**
* @return the displayOrder
*/
public
Integer
getDisplayOrder
()
{
return
displayOrder
;
}
/**
* @param displayOrder the displayOrder to set
*/
public
void
setDisplayOrder
(
Integer
displayOrder
)
{
this
.
displayOrder
=
displayOrder
;
}
/**
* @return the isActive
*/
public
Integer
getIsActive
()
{
return
isActive
;
}
/**
* @param isActive the isActive to set
*/
public
void
setIsActive
(
Integer
isActive
)
{
this
.
isActive
=
isActive
;
}
/**
* @return the remark
*/
public
String
getRemark
()
{
return
remark
;
}
/**
* @param remark the remark to set
*/
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
/**
* @return the loginId
*/
public
Long
getLoginId
()
{
return
loginId
;
}
/**
* @param loginId the loginId to set
*/
public
void
setLoginId
(
Long
loginId
)
{
this
.
loginId
=
loginId
;
}
@Override
public
String
toString
()
{
return
"MdTagView{"
+
"id="
+
id
+
", tagViewType='"
+
tagViewType
+
'\''
+
", tagId="
+
tagId
+
", tagName='"
+
tagName
+
'\''
+
", tagLevel='"
+
tagLevel
+
'\''
+
", upperTagViewId="
+
upperTagViewId
+
", displayImage='"
+
displayImage
+
'\''
+
", displayOrder="
+
displayOrder
+
", isActive="
+
isActive
+
", remark='"
+
remark
+
", loginId='"
+
loginId
+
'}'
;
}
}
yd-api/src/main/java/com/yd/api/agms/vo/tag/TagViewUpdateResponseVO.java
0 → 100644
View file @
6c7a0966
package
com
.
yd
.
api
.
agms
.
vo
.
tag
;
import
com.yd.api.result.CommonResult
;
/**
* @author xxy
* @date 2021年06月21日 23:41
*/
public
class
TagViewUpdateResponseVO
{
private
Long
id
;
private
CommonResult
commonResult
;
/**
* Gets the value of commonResult. *
*
* @return the value of commonResult
*/
public
CommonResult
getCommonResult
()
{
return
commonResult
;
}
/**
* Sets the commonResult. *
* <p>You can use getCommonResult() to get the value of commonResult</p>
* * @param commonResult commonResult
*/
public
void
setCommonResult
(
CommonResult
commonResult
)
{
this
.
commonResult
=
commonResult
;
}
/**
* Gets the value of id. *
*
* @return the value of id
*/
public
Long
getId
()
{
return
id
;
}
/**
* Sets the id. *
* <p>You can use getId() to get the value of id</p>
* * @param id id
*/
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
@Override
public
String
toString
()
{
return
"TagUpdateResponseVO{"
+
"id="
+
id
+
", commonResult="
+
commonResult
+
'}'
;
}
}
yd-api/src/main/java/com/yd/api/metadata/MetadataController.java
View file @
6c7a0966
package
com
.
yd
.
api
.
metadata
;
package
com
.
yd
.
api
.
metadata
;
import
com.yd.api.metadata.service.MetadataService
;
import
com.yd.api.metadata.vo.TagQueryResponseVO
;
import
com.yd.api.result.JsonResult
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.yd.api.metadata.service.MetadataService
;
import
com.yd.api.metadata.vo.TagQueryResponseVO
;
import
com.yd.api.metadata.vo.TagViewQueryRequestVO
;
import
com.yd.api.metadata.vo.TagViewQueryResponseVO
;
import
com.yd.api.result.JsonResult
;
/**
/**
* @author xxy
* @author xxy
* @date 2021年06月21日 17:14
* @date 2021年06月21日 17:14
...
@@ -33,4 +37,18 @@ public class MetadataController {
...
@@ -33,4 +37,18 @@ public class MetadataController {
return
result
;
return
result
;
}
}
/**
* 前端显示标签合集查询
* @return TagViewQueryResponseVO
* @date 2021年06月21日 17:14
*/
@RequestMapping
(
"/tagViewQuery"
)
public
Object
tagViewQuery
(
@RequestBody
TagViewQueryRequestVO
requestVO
){
JsonResult
result
=
new
JsonResult
();
TagViewQueryResponseVO
responseVO
=
metadataService
.
tagViewQuery
(
requestVO
);
result
.
setData
(
responseVO
);
result
.
addResult
(
responseVO
);
return
result
;
}
}
}
yd-api/src/main/java/com/yd/api/metadata/service/MetadataService.java
View file @
6c7a0966
package
com
.
yd
.
api
.
metadata
.
service
;
package
com
.
yd
.
api
.
metadata
.
service
;
import
com.yd.api.metadata.vo.TagQueryResponseVO
;
import
com.yd.api.metadata.vo.TagQueryResponseVO
;
import
com.yd.api.metadata.vo.TagViewQueryRequestVO
;
import
com.yd.api.metadata.vo.TagViewQueryResponseVO
;
public
interface
MetadataService
{
public
interface
MetadataService
{
/**
/**
...
@@ -9,4 +11,12 @@ public interface MetadataService {
...
@@ -9,4 +11,12 @@ public interface MetadataService {
* @return
* @return
*/
*/
TagQueryResponseVO
tagQuery
(
Long
isActive
);
TagQueryResponseVO
tagQuery
(
Long
isActive
);
/**
* 前端显示标签合集查询
* @param TagViewQueryRequestVO requestVO
* @return TagViewQueryResponseVO
* @date 2021年06月21日 17:14
*/
TagViewQueryResponseVO
tagViewQuery
(
TagViewQueryRequestVO
requestVO
);
}
}
yd-api/src/main/java/com/yd/api/metadata/service/impl/MetadataServiceImpl.java
View file @
6c7a0966
package
com
.
yd
.
api
.
metadata
.
service
.
impl
;
package
com
.
yd
.
api
.
metadata
.
service
.
impl
;
import
com.yd.api.agms.vo.tag.TagViewUpdateRequestVO
;
import
com.yd.api.metadata.service.MetadataService
;
import
com.yd.api.metadata.service.MetadataService
;
import
com.yd.api.metadata.vo.TagQueryInfo
;
import
com.yd.api.metadata.vo.TagQueryInfo
;
import
com.yd.api.metadata.vo.TagQueryResponseVO
;
import
com.yd.api.metadata.vo.TagQueryResponseVO
;
import
com.yd.api.metadata.vo.TagViewQueryInfo
;
import
com.yd.api.metadata.vo.TagViewQueryRequestVO
;
import
com.yd.api.metadata.vo.TagViewQueryResponseVO
;
import
com.yd.api.result.CommonResult
;
import
com.yd.api.result.CommonResult
;
import
com.yd.dal.entity.meta.MdTagNew
;
import
com.yd.dal.entity.meta.MdTagNew
;
import
com.yd.dal.entity.meta.MdTagView
;
import
com.yd.dal.service.meta.MdTagNewDALService
;
import
com.yd.dal.service.meta.MdTagNewDALService
;
import
com.yd.dal.service.meta.MdTagViewDALService
;
import
com.yd.dal.service.metadata.MetadataDALService
;
import
com.yd.dal.service.metadata.MetadataDALService
;
import
com.yd.util.CommonUtil
;
import
com.yd.util.CommonUtil
;
import
com.yd.util.config.ZHBErrorConfig
;
import
com.yd.util.config.ZHBErrorConfig
;
...
@@ -31,6 +37,10 @@ public class MetadataServiceImpl implements MetadataService {
...
@@ -31,6 +37,10 @@ public class MetadataServiceImpl implements MetadataService {
@Autowired
@Autowired
public
MdTagNewDALService
mdTagNewDalService
;
public
MdTagNewDALService
mdTagNewDalService
;
@Autowired
public
MdTagViewDALService
mdTagViewDALService
;
@Override
@Override
@SuppressWarnings
(
"unchecked"
)
@SuppressWarnings
(
"unchecked"
)
...
@@ -101,4 +111,78 @@ public class MetadataServiceImpl implements MetadataService {
...
@@ -101,4 +111,78 @@ public class MetadataServiceImpl implements MetadataService {
tagQueryInfo
.
setTagQueryInfos
(
tagQueryInfoList
);
tagQueryInfo
.
setTagQueryInfos
(
tagQueryInfoList
);
tagQueryInfos
.
add
(
tagQueryInfo
);
tagQueryInfos
.
add
(
tagQueryInfo
);
}
}
/**
* 前端显示标签合集查询
* @param TagViewQueryRequestVO requestVO
* @return TagViewQueryResponseVO
* @date 2021年06月21日 17:14
*/
@Override
@SuppressWarnings
(
"unchecked"
)
public
TagViewQueryResponseVO
tagViewQuery
(
TagViewQueryRequestVO
requestVO
)
{
TagViewQueryResponseVO
responseVO
=
new
TagViewQueryResponseVO
();
CommonResult
commonResult
=
new
CommonResult
();
tagViewQueryCheck
(
requestVO
,
commonResult
);
if
(!
commonResult
.
isSuccess
()){
responseVO
.
setCommonResult
(
commonResult
);
return
responseVO
;
}
List
<
MdTagView
>
mdTagViewList
=
mdTagViewDALService
.
selectByIsActive
(
requestVO
.
getIsActive
().
longValue
());
if
(!
CommonUtil
.
isNullOrBlank
(
requestVO
.
getTagViewType
())){
BeanPropertyValueEqualsPredicate
predicateClause
=
new
BeanPropertyValueEqualsPredicate
(
"tagViewType"
,
requestVO
.
getTagViewType
());
mdTagViewList
=
(
List
<
MdTagView
>)
CollectionUtils
.
select
(
mdTagViewList
,
predicateClause
);
}
List
<
TagViewQueryInfo
>
tagViewQueryInfos
=
new
ArrayList
<>(
16
);
List
<
MdTagView
>
mdTagViewAddList
=
new
ArrayList
<>(
16
);
BeanPropertyValueEqualsPredicate
predicateClause
=
new
BeanPropertyValueEqualsPredicate
(
"tagLevel"
,
"1"
);
List
<
MdTagView
>
objectListSelect
=
(
List
<
MdTagView
>)
CollectionUtils
.
select
(
mdTagViewList
,
predicateClause
);
mdTagViewAddList
.
addAll
(
objectListSelect
);
classificationBuildUpMdTagView
(
mdTagViewList
,
mdTagViewAddList
,
objectListSelect
,
tagViewQueryInfos
);
mdTagViewList
.
removeAll
(
mdTagViewAddList
);
responseVO
.
setTagViewQueryInfos
(
tagViewQueryInfos
);
responseVO
.
setCommonResult
(
new
CommonResult
(
true
,
ZHBErrorConfig
.
getErrorInfo
(
"800000"
)));
return
responseVO
;
}
@SuppressWarnings
(
"unchecked"
)
private
void
classificationBuildUpMdTagView
(
List
<
MdTagView
>
mdTagViewList
,
List
<
MdTagView
>
mdTagViewAddList
,
List
<
MdTagView
>
objectListSelect
,
List
<
TagViewQueryInfo
>
tagViewQueryInfos
)
{
for
(
MdTagView
mdTagView
:
objectListSelect
)
{
Long
id
=
mdTagView
.
getId
();
TagViewQueryInfo
tagViewQueryInfo
=
new
TagViewQueryInfo
();
BeanUtils
.
copyProperties
(
mdTagView
,
tagViewQueryInfo
);
tagViewQueryInfo
.
setCreatedAt
(
CommonUtil
.
dateParseString
(
mdTagView
.
getCreatedAt
(),
"yyyy-MM-dd HH:mm:ss"
));
tagViewQueryInfo
.
setUpdatedAt
(
CommonUtil
.
dateParseString
(
mdTagView
.
getUpdatedAt
(),
"yyyy-MM-dd HH:mm:ss"
));
BeanPropertyValueEqualsPredicate
predicateClause
=
new
BeanPropertyValueEqualsPredicate
(
"upperTagViewId"
,
id
);
List
<
MdTagView
>
mdTagNewListSelect
=
(
List
<
MdTagView
>)
CollectionUtils
.
select
(
mdTagViewList
,
predicateClause
);
if
(
mdTagNewListSelect
.
isEmpty
()){
tagViewQueryInfos
.
add
(
tagViewQueryInfo
);
continue
;
}
mdTagViewAddList
.
addAll
(
mdTagNewListSelect
);
List
<
TagViewQueryInfo
>
tagViewQueryInfoList
=
new
ArrayList
<>(
16
);
classificationBuildUpMdTagView
(
mdTagViewList
,
mdTagViewAddList
,
mdTagNewListSelect
,
tagViewQueryInfoList
);
tagViewQueryInfoList
.
sort
((
o1
,
o2
)
->
o2
.
getId
().
compareTo
(
o1
.
getId
()));
tagViewQueryInfo
.
setTagViewQueryInfos
(
tagViewQueryInfoList
);
tagViewQueryInfos
.
add
(
tagViewQueryInfo
);
}
}
private
void
tagViewQueryCheck
(
TagViewQueryRequestVO
requestVO
,
CommonResult
commonResult
)
{
if
(
CommonUtil
.
isNullOrZero
(
requestVO
.
getIsActive
())){
commonResult
.
setSuccess
(
false
);
commonResult
.
setMessage
(
ZHBErrorConfig
.
getErrorInfo
(
"830031"
));
return
;
}
commonResult
.
setSuccess
(
true
);
commonResult
.
setMessage
(
ZHBErrorConfig
.
getErrorInfo
(
"800000"
));
}
}
}
yd-api/src/main/java/com/yd/api/metadata/vo/TagViewQueryInfo.java
0 → 100644
View file @
6c7a0966
package
com
.
yd
.
api
.
metadata
.
vo
;
import
java.util.List
;
/**
* @author xxy
* @date 2021年06月21日 17:56
*/
public
class
TagViewQueryInfo
{
private
Long
id
;
private
String
tagViewType
;
//标签显示类别(1=12宫格; 2=左侧热榜列表; 3=右上角筛选)
private
Long
tagId
;
//标签ID
private
String
tagName
;
//标签名称
private
String
tagLevel
;
// 标签级别(1=一级标签;2=二级标签;3=三级标签,以此类推)
private
Long
upperTagViewId
;
//上级前端显示标签ID
private
String
displayImage
;
// UI上显示图片
private
Integer
displayOrder
;
//UI上layout优先级
private
Integer
isActive
;
// 1=active 2=inactive
private
String
remark
;
//备注
private
String
createdAt
;
private
Long
createdBy
;
private
String
updatedAt
;
private
Long
updatedBy
;
public
List
<
TagViewQueryInfo
>
tagViewQueryInfos
;
/**
* @return the id
*/
public
Long
getId
()
{
return
id
;
}
/**
* @param id the id to set
*/
public
void
setId
(
Long
id
)
{
this
.
id
=
id
;
}
/**
* @return the tagViewType
*/
public
String
getTagViewType
()
{
return
tagViewType
;
}
/**
* @param tagViewType the tagViewType to set
*/
public
void
setTagViewType
(
String
tagViewType
)
{
this
.
tagViewType
=
tagViewType
;
}
/**
* @return the tagId
*/
public
Long
getTagId
()
{
return
tagId
;
}
/**
* @param tagId the tagId to set
*/
public
void
setTagId
(
Long
tagId
)
{
this
.
tagId
=
tagId
;
}
/**
* @return the tagName
*/
public
String
getTagName
()
{
return
tagName
;
}
/**
* @param tagName the tagName to set
*/
public
void
setTagName
(
String
tagName
)
{
this
.
tagName
=
tagName
;
}
/**
* @return the tagLevel
*/
public
String
getTagLevel
()
{
return
tagLevel
;
}
/**
* @param tagLevel the tagLevel to set
*/
public
void
setTagLevel
(
String
tagLevel
)
{
this
.
tagLevel
=
tagLevel
;
}
/**
* @return the upperTagViewId
*/
public
Long
getUpperTagViewId
()
{
return
upperTagViewId
;
}
/**
* @param upperTagViewId the upperTagViewId to set
*/
public
void
setUpperTagViewId
(
Long
upperTagViewId
)
{
this
.
upperTagViewId
=
upperTagViewId
;
}
/**
* @return the displayImage
*/
public
String
getDisplayImage
()
{
return
displayImage
;
}
/**
* @param displayImage the displayImage to set
*/
public
void
setDisplayImage
(
String
displayImage
)
{
this
.
displayImage
=
displayImage
;
}
/**
* @return the displayOrder
*/
public
Integer
getDisplayOrder
()
{
return
displayOrder
;
}
/**
* @param displayOrder the displayOrder to set
*/
public
void
setDisplayOrder
(
Integer
displayOrder
)
{
this
.
displayOrder
=
displayOrder
;
}
/**
* @return the isActive
*/
public
Integer
getIsActive
()
{
return
isActive
;
}
/**
* @param isActive the isActive to set
*/
public
void
setIsActive
(
Integer
isActive
)
{
this
.
isActive
=
isActive
;
}
/**
* @return the remark
*/
public
String
getRemark
()
{
return
remark
;
}
/**
* @param remark the remark to set
*/
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
}
/**
* @return the createdAt
*/
public
String
getCreatedAt
()
{
return
createdAt
;
}
/**
* @param createdAt the createdAt to set
*/
public
void
setCreatedAt
(
String
createdAt
)
{
this
.
createdAt
=
createdAt
;
}
/**
* @return the createdBy
*/
public
Long
getCreatedBy
()
{
return
createdBy
;
}
/**
* @param createdBy the createdBy to set
*/
public
void
setCreatedBy
(
Long
createdBy
)
{
this
.
createdBy
=
createdBy
;
}
/**
* @return the updatedAt
*/
public
String
getUpdatedAt
()
{
return
updatedAt
;
}
/**
* @param updatedAt the updatedAt to set
*/
public
void
setUpdatedAt
(
String
updatedAt
)
{
this
.
updatedAt
=
updatedAt
;
}
/**
* @return the updatedBy
*/
public
Long
getUpdatedBy
()
{
return
updatedBy
;
}
/**
* @param updatedBy the updatedBy to set
*/
public
void
setUpdatedBy
(
Long
updatedBy
)
{
this
.
updatedBy
=
updatedBy
;
}
/**
* @return the tagViewQueryInfos
*/
public
List
<
TagViewQueryInfo
>
getTagViewQueryInfos
()
{
return
tagViewQueryInfos
;
}
/**
* @param tagViewQueryInfos the tagViewQueryInfos to set
*/
public
void
setTagViewQueryInfos
(
List
<
TagViewQueryInfo
>
tagViewQueryInfos
)
{
this
.
tagViewQueryInfos
=
tagViewQueryInfos
;
}
@Override
public
String
toString
()
{
return
"TagViewQueryInfo{"
+
"id="
+
id
+
", tagViewType="
+
tagViewType
+
", tagId="
+
tagId
+
", tagName='"
+
tagName
+
'\''
+
", tagLevel='"
+
tagLevel
+
'\''
+
", upperTagViewId='"
+
upperTagViewId
+
'\''
+
", displayImage='"
+
displayImage
+
'\''
+
", displayOrder='"
+
displayOrder
+
'\''
+
", isActive="
+
isActive
+
", remark='"
+
remark
+
'\''
+
", createdAt='"
+
createdAt
+
'\''
+
", createdBy="
+
createdBy
+
", updatedAt="
+
updatedAt
+
", updatedBy="
+
updatedBy
+
", tagViewQueryInfos="
+
tagViewQueryInfos
+
'}'
;
}
}
yd-api/src/main/java/com/yd/api/metadata/vo/TagViewQueryRequestVO.java
0 → 100644
View file @
6c7a0966
package
com
.
yd
.
api
.
metadata
.
vo
;
/**
* @author wenYang
* @date 2021年06月30日 23:41
*/
public
class
TagViewQueryRequestVO
{
private
String
tagViewType
;
//标签显示类别(1=12宫格; 2=左侧热榜列表; 3=右上角筛选)
private
Integer
isActive
;
// 1=active 2=inactive
/**
* @return the tagViewType
*/
public
String
getTagViewType
()
{
return
tagViewType
;
}
/**
* @param tagViewType the tagViewType to set
*/
public
void
setTagViewType
(
String
tagViewType
)
{
this
.
tagViewType
=
tagViewType
;
}
/**
* @return the isActive
*/
public
Integer
getIsActive
()
{
return
isActive
;
}
/**
* @param isActive the isActive to set
*/
public
void
setIsActive
(
Integer
isActive
)
{
this
.
isActive
=
isActive
;
}
@Override
public
String
toString
()
{
return
"MdTagView{"
+
", tagViewType='"
+
tagViewType
+
'\''
+
", isActive="
+
isActive
+
'}'
;
}
}
yd-api/src/main/java/com/yd/api/metadata/vo/TagViewQueryResponseVO.java
0 → 100644
View file @
6c7a0966
package
com
.
yd
.
api
.
metadata
.
vo
;
import
java.util.List
;
import
com.yd.api.result.CommonResult
;
/**
* @author xxy
* @date 2021年06月21日 17:39
*/
public
class
TagViewQueryResponseVO
{
private
List
<
TagViewQueryInfo
>
tagViewQueryInfos
;
public
List
<
TagViewQueryInfo
>
getTagViewQueryInfos
()
{
return
tagViewQueryInfos
;
}
public
void
setTagViewQueryInfos
(
List
<
TagViewQueryInfo
>
tagViewQueryInfos
)
{
this
.
tagViewQueryInfos
=
tagViewQueryInfos
;
}
private
CommonResult
commonResult
;
public
CommonResult
getCommonResult
()
{
return
commonResult
;
}
public
void
setCommonResult
(
CommonResult
commonResult
)
{
this
.
commonResult
=
commonResult
;
}
@Override
public
String
toString
()
{
return
"TagViewQueryResponseVO{"
+
"tagViewQueryInfos="
+
tagViewQueryInfos
+
", commonResult="
+
commonResult
+
'}'
;
}
}
yd-api/src/main/java/com/yd/dal/mapper/meta/MdTagViewMapper.java
View file @
6c7a0966
package
com
.
yd
.
dal
.
mapper
.
meta
;
package
com
.
yd
.
dal
.
mapper
.
meta
;
import
com.yd.dal.entity.meta.MdTagView
;
import
java.util.List
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
com.yd.dal.entity.meta.MdTagView
;
/**
/**
* @author xxy
* @author xxy
*/
*/
...
@@ -25,4 +27,6 @@ public interface MdTagViewMapper {
...
@@ -25,4 +27,6 @@ public interface MdTagViewMapper {
int
updateBatchSelective
(
List
<
MdTagView
>
list
);
int
updateBatchSelective
(
List
<
MdTagView
>
list
);
int
batchInsert
(
@Param
(
"list"
)
List
<
MdTagView
>
list
);
int
batchInsert
(
@Param
(
"list"
)
List
<
MdTagView
>
list
);
List
<
MdTagView
>
selectByIsActive
(
@Param
(
"isActive"
)
Long
isActive
);
}
}
\ No newline at end of file
yd-api/src/main/java/com/yd/dal/service/meta/MdTagNewDALService.java
View file @
6c7a0966
...
@@ -13,4 +13,6 @@ public interface MdTagNewDALService {
...
@@ -13,4 +13,6 @@ public interface MdTagNewDALService {
void
insert
(
MdTagNew
mdTagNew
);
void
insert
(
MdTagNew
mdTagNew
);
void
updateByPrimaryKeySelective
(
MdTagNew
mdTagNew
);
void
updateByPrimaryKeySelective
(
MdTagNew
mdTagNew
);
MdTagNew
selectByPrimaryKey
(
Long
id
);
}
}
yd-api/src/main/java/com/yd/dal/service/meta/MdTagViewDALService.java
View file @
6c7a0966
package
com
.
yd
.
dal
.
service
.
meta
;
package
com
.
yd
.
dal
.
service
.
meta
;
import
java.util.List
;
import
com.yd.dal.entity.meta.MdTagView
;
/**
/**
* @author xxy
* @author xxy
*/
*/
public
interface
MdTagViewDALService
{
public
interface
MdTagViewDALService
{
List
<
MdTagView
>
selectByIsActive
(
Long
isActive
);
void
insert
(
MdTagView
mdTagView
);
void
updateByPrimaryKeySelective
(
MdTagView
mdTagView
);
MdTagView
selectByPrimaryKey
(
Long
id
);
}
}
yd-api/src/main/java/com/yd/dal/service/meta/impl/MdTagNewDALServiceImpl.java
View file @
6c7a0966
...
@@ -31,4 +31,10 @@ public class MdTagNewDALServiceImpl implements MdTagNewDALService {
...
@@ -31,4 +31,10 @@ public class MdTagNewDALServiceImpl implements MdTagNewDALService {
public
void
updateByPrimaryKeySelective
(
MdTagNew
mdTagNew
)
{
public
void
updateByPrimaryKeySelective
(
MdTagNew
mdTagNew
)
{
mapper
.
updateByPrimaryKeySelective
(
mdTagNew
);
mapper
.
updateByPrimaryKeySelective
(
mdTagNew
);
}
}
@Override
public
MdTagNew
selectByPrimaryKey
(
Long
id
)
{
return
mapper
.
selectByPrimaryKey
(
id
);
}
}
}
yd-api/src/main/java/com/yd/dal/service/meta/impl/MdTagViewDALServiceImpl.java
View file @
6c7a0966
package
com
.
yd
.
dal
.
service
.
meta
.
impl
;
package
com
.
yd
.
dal
.
service
.
meta
.
impl
;
import
com.yd.dal.mapper.meta.MdTagViewMapper
;
import
java.util.List
;
import
com.yd.dal.service.meta.MdTagViewDALService
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
org.springframework.stereotype.Service
;
import
com.yd.dal.entity.meta.MdTagView
;
import
com.yd.dal.mapper.meta.MdTagViewMapper
;
import
com.yd.dal.service.meta.MdTagViewDALService
;
/**
/**
* @author xxy
* @author xxy
* @date 2021年06月21日 17:25
* @date 2021年06月21日 17:25
...
@@ -14,4 +18,24 @@ import javax.annotation.Resource;
...
@@ -14,4 +18,24 @@ import javax.annotation.Resource;
public
class
MdTagViewDALServiceImpl
implements
MdTagViewDALService
{
public
class
MdTagViewDALServiceImpl
implements
MdTagViewDALService
{
@Resource
@Resource
public
MdTagViewMapper
mapper
;
public
MdTagViewMapper
mapper
;
@Override
public
List
<
MdTagView
>
selectByIsActive
(
Long
isActive
)
{
return
mapper
.
selectByIsActive
(
isActive
);
}
@Override
public
void
insert
(
MdTagView
mdTagView
)
{
mapper
.
insert
(
mdTagView
);
}
@Override
public
void
updateByPrimaryKeySelective
(
MdTagView
mdTagView
)
{
mapper
.
updateByPrimaryKeySelective
(
mdTagView
);
}
@Override
public
MdTagView
selectByPrimaryKey
(
Long
id
)
{
return
mapper
.
selectByPrimaryKey
(
id
);
}
}
}
yd-api/src/main/resources/i18n/messages_zh_CN.properties
View file @
6c7a0966
...
@@ -42,4 +42,11 @@
...
@@ -42,4 +42,11 @@
830026
=
经纪人审批步骤出现问题,请联系it!
830026
=
经纪人审批步骤出现问题,请联系it!
830027
=
标签级别不能为空!
830027
=
标签级别不能为空!
830028
=
此标签不是一级标签,上级标签id不能为空!
830028
=
此标签不是一级标签,上级标签id不能为空!
900003
=
保险公司响应报文为空!
900003
=
保险公司响应报文为空!
\ No newline at end of file
830029
=
标签显示类别不能为空!
830030
=
标签ID不能为空!
830031
=
标签是否有效不能为空!
830032
=
上级显示标签不存在!
830033
=
上级显示标签的标签显示类别与保存标签的显示类别不一致!
830034
=
保存标签的标签级别与上级显示标签的标签级别不能相隔多级!
830035
=
根据基础标签ID查找不到有效的基础标签!
\ No newline at end of file
yd-api/src/main/resources/mapper/meta/MdTagViewMapper.xml
View file @
6c7a0966
...
@@ -389,4 +389,17 @@
...
@@ -389,4 +389,17 @@
#{item.updatedBy,jdbcType=BIGINT})
#{item.updatedBy,jdbcType=BIGINT})
</foreach>
</foreach>
</insert>
</insert>
<select
id=
"selectByIsActive"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from ag_md_tag_view
<where>
<if
test=
"isActive != null"
>
is_active = #{isActive,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