Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
71d34d89
Commit
71d34d89
authored
Nov 05, 2020
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
123
parent
ac026b0c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
59 additions
and
17 deletions
+59
-17
UserCommentFindDTO.java
...github/wxiaoqi/security/admin/dto/UserCommentFindDTO.java
+3
-1
UserCommentBiz.java
...com/github/wxiaoqi/security/admin/biz/UserCommentBiz.java
+23
-14
AppUserCommentController.java
...wxiaoqi/security/admin/rest/AppUserCommentController.java
+21
-0
UserCommentMapper.xml
...ace-admin/src/main/resources/mapper/UserCommentMapper.xml
+12
-2
No files found.
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/UserCommentFindDTO.java
View file @
71d34d89
...
@@ -16,7 +16,7 @@ public class UserCommentFindDTO extends PageParam{
...
@@ -16,7 +16,7 @@ public class UserCommentFindDTO extends PageParam{
private
Integer
parentId
;
private
Integer
parentId
;
private
Integer
soureId
;
private
String
soureId
;
private
Integer
rootParentId
;
private
Integer
rootParentId
;
...
@@ -37,5 +37,7 @@ public class UserCommentFindDTO extends PageParam{
...
@@ -37,5 +37,7 @@ public class UserCommentFindDTO extends PageParam{
private
Integer
commentId
;
private
Integer
commentId
;
private
Integer
companyId
;
private
Integer
isDesc
;
private
Integer
isDesc
;
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/UserCommentBiz.java
View file @
71d34d89
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
import
cn.hutool.json.JSONUtil
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.pagehelper.PageInfo
;
import
com.github.wxiaoqi.security.admin.dto.CompanyInfoFindDTO
;
import
com.github.wxiaoqi.security.admin.dto.UserCommentFindDTO
;
import
com.github.wxiaoqi.security.admin.dto.UserCommentFindDTO
;
import
com.github.wxiaoqi.security.admin.entity.*
;
import
com.github.wxiaoqi.security.admin.entity.*
;
import
com.github.wxiaoqi.security.admin.mapper.CompanyInfoMapper
;
import
com.github.wxiaoqi.security.admin.mapper.UserCommentMapper
;
import
com.github.wxiaoqi.security.admin.mapper.UserCommentMapper
;
import
com.github.wxiaoqi.security.admin.vo.UserCommentVo
;
import
com.github.wxiaoqi.security.admin.vo.UserCommentVo
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.app.entity.Cofig
;
import
com.xxfc.platform.app.feign.ConfigFeign
;
import
com.xxfc.platform.universal.dto.SendMsgDTO
;
import
com.xxfc.platform.universal.feign.MQSenderFeign
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
tk.mybatis.mapper.entity.Example
;
import
java.util.Comparator
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
config
.
rabbit
.
RabbitConstant
.
ADMIN_TOPIC
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
config
.
rabbit
.
RabbitConstant
.
KEY_CORPORATION_UPD
;
@Service
@Service
@Slf4j
@Slf4j
...
@@ -116,6 +104,18 @@ public class UserCommentBiz extends BaseBiz<UserCommentMapper, UserComment>{
...
@@ -116,6 +104,18 @@ public class UserCommentBiz extends BaseBiz<UserCommentMapper, UserComment>{
}
}
public
void
setParamByVehicle
(
UserCommentFindDTO
userCommentFindDTO
){
UserComment
comment
=
selectById
(
userCommentFindDTO
.
getCommentId
());
if
(
comment
!=
null
){
userCommentFindDTO
.
setSoureId
(
comment
.
getSoureId
());
userCommentFindDTO
.
setIsShow
(
1
);
userCommentFindDTO
.
setIsDesc
(
1
);
userCommentFindDTO
.
setUserId
(
comment
.
getUserId
());
}
}
public
List
<
UserCommentVo
>
getListByToUserId
(
UserCommentFindDTO
commentFindDTO
){
public
List
<
UserCommentVo
>
getListByToUserId
(
UserCommentFindDTO
commentFindDTO
){
return
mapper
.
selectListByToUserId
(
commentFindDTO
);
return
mapper
.
selectListByToUserId
(
commentFindDTO
);
...
@@ -124,8 +124,17 @@ public class UserCommentBiz extends BaseBiz<UserCommentMapper, UserComment>{
...
@@ -124,8 +124,17 @@ public class UserCommentBiz extends BaseBiz<UserCommentMapper, UserComment>{
public
PageDataVO
<
UserCommentVo
>
selectListV2
(
UserCommentFindDTO
userCommentFindDTO
){
public
PageDataVO
<
UserCommentVo
>
selectListV2
(
UserCommentFindDTO
userCommentFindDTO
){
PageHelper
.
startPage
(
userCommentFindDTO
.
getPage
(),
userCommentFindDTO
.
getLimit
());
PageHelper
.
startPage
(
userCommentFindDTO
.
getPage
(),
userCommentFindDTO
.
getLimit
());
Integer
commentId
=
userCommentFindDTO
.
getCommentId
()
==
null
?
0
:
userCommentFindDTO
.
getCommentId
();
if
(
commentId
>
0
){
setParamByVehicle
(
userCommentFindDTO
);
}
PageInfo
<
UserCommentVo
>
pageInfo
=
new
PageInfo
<>(
getList
(
userCommentFindDTO
));
PageInfo
<
UserCommentVo
>
pageInfo
=
new
PageInfo
<>(
getList
(
userCommentFindDTO
));
PageDataVO
<
UserCommentVo
>
dataVO
=
PageDataVO
.
pageInfo
(
pageInfo
);
PageDataVO
<
UserCommentVo
>
dataVO
=
PageDataVO
.
pageInfo
(
pageInfo
);
List
<
UserCommentVo
>
list
=
dataVO
.
getData
();
if
(
CollectionUtils
.
isNotEmpty
(
list
)){
list
.
sort
(
Comparator
.
comparing
(
UserCommentVo:
:
getId
));
dataVO
.
setData
(
list
);
}
return
dataVO
;
return
dataVO
;
}
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/AppUserCommentController.java
View file @
71d34d89
...
@@ -60,6 +60,13 @@ public class AppUserCommentController extends BaseController<UserCommentBiz> {
...
@@ -60,6 +60,13 @@ public class AppUserCommentController extends BaseController<UserCommentBiz> {
@ApiModelProperty
(
"列表"
)
@ApiModelProperty
(
"列表"
)
public
ObjectRestResponse
selectListByToUserId
(
UserCommentFindDTO
commentFindDTO
)
{
public
ObjectRestResponse
selectListByToUserId
(
UserCommentFindDTO
commentFindDTO
)
{
commentFindDTO
.
setUserId
(
getCurrentUserIdInt
());
commentFindDTO
.
setUserId
(
getCurrentUserIdInt
());
Integer
isGoods
=
commentFindDTO
.
getIsGoods
()
==
null
?
0
:
commentFindDTO
.
getIsGoods
();
if
(
isGoods
==
2
&&
(
commentFindDTO
.
getCompanyId
()
==
null
||
commentFindDTO
.
getCompanyId
()
==
0
)){
List
<
Integer
>
companyIds
=
getBusinessUserCompanyIds
();
if
(
companyIds
!=
null
&&
companyIds
.
size
()
>
0
){
commentFindDTO
.
setCompanyId
(
companyIds
.
get
(
0
));
}
}
return
ObjectRestResponse
.
succ
(
baseBiz
.
selectListByToUserId
(
commentFindDTO
));
return
ObjectRestResponse
.
succ
(
baseBiz
.
selectListByToUserId
(
commentFindDTO
));
}
}
...
@@ -74,5 +81,19 @@ public class AppUserCommentController extends BaseController<UserCommentBiz> {
...
@@ -74,5 +81,19 @@ public class AppUserCommentController extends BaseController<UserCommentBiz> {
}
}
@GetMapping
(
"selectListByCommentId"
)
@ApiModelProperty
(
"列表"
)
public
ObjectRestResponse
selectListByCommentId
(
UserCommentFindDTO
commentFindDTO
)
{
if
(
commentFindDTO
.
getCompanyId
()
==
null
||
commentFindDTO
.
getCompanyId
()
==
0
){
List
<
Integer
>
companyIds
=
getBusinessUserCompanyIds
();
if
(
companyIds
!=
null
&&
companyIds
.
size
()
>
0
){
commentFindDTO
.
setCompanyId
(
companyIds
.
get
(
0
));
}
}
commentFindDTO
.
setIsGoods
(
2
);
return
ObjectRestResponse
.
succ
(
baseBiz
.
selectListV2
(
commentFindDTO
));
}
}
}
ace-modules/ace-admin/src/main/resources/mapper/UserCommentMapper.xml
View file @
71d34d89
...
@@ -10,12 +10,17 @@
...
@@ -10,12 +10,17 @@
d1.headimgurl as headimgurl,
d1.headimgurl as headimgurl,
IFNULL(d2.realname,d2.nickname) as toUserName,
IFNULL(d2.realname,d2.nickname) as toUserName,
d2.headimgurl as toHeadimgurl,
d2.headimgurl as toHeadimgurl,
b.`name`as companyName
b.`name`as companyName,
b.`company_pic`as companyPic
FROM user_comment c
FROM user_comment c
LEFT JOIN app_user_detail d1 ON c.user_id=d1.userid
LEFT JOIN app_user_detail d1 ON c.user_id=d1.userid
LEFT JOIN app_user_detail d2 ON c.to_user_id=d2.userid
LEFT JOIN app_user_detail d2 ON c.to_user_id=d2.userid
LEFT JOIN branch_company b ON c.company_id=b.id
LEFT JOIN branch_company b ON c.company_id=b.id
<where>
<where>
c.is_del = 0
<if
test=
"isGoods != null and isGoods == 2 "
>
AND ( c.user_id = #{userId} or (c.to_user_id = #{userId} and c.company_id = #{companyId} ))
</if>
<if
test=
"soureId != null "
>
<if
test=
"soureId != null "
>
AND c.soure_id=#{soureId}
AND c.soure_id=#{soureId}
</if>
</if>
...
@@ -66,12 +71,17 @@
...
@@ -66,12 +71,17 @@
<choose>
<choose>
<when
test=
"isGoods != null and isGoods == 1"
>
<when
test=
"isGoods != null and isGoods == 1"
>
and to_user_id=#{userId}
and to_user_id=#{userId}
GROUP BY soure_id,to_user_id )
</when>
<when
test=
"isGoods != null and isGoods == 2"
>
and company_id = 0 and soure_user_id=#{companyId}
GROUP BY soure_id,user_id )
</when>
</when>
<otherwise>
<otherwise>
and ((soure_type =1 and soure_user_id=#{userId} and parent_id = 0) or to_user_id=#{userId})
and ((soure_type =1 and soure_user_id=#{userId} and parent_id = 0) or to_user_id=#{userId})
GROUP BY soure_id,to_user_id )
</otherwise>
</otherwise>
</choose>
</choose>
GROUP BY soure_id,to_user_id )
) c
) c
LEFT JOIN branch_company b ON c.company_id=b.id
LEFT JOIN branch_company b ON c.company_id=b.id
LEFT JOIN app_user_detail d ON c.user_id=d.userid
LEFT JOIN app_user_detail d ON c.user_id=d.userid
...
...
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