Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
eb40ea9c
Commit
eb40ea9c
authored
Apr 09, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
关注列表
parent
cbf44d22
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
34 deletions
+24
-34
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/FollowFansRecordServiceImpl.java
...java/com/wwdz/ch/wx/impl/FollowFansRecordServiceImpl.java
+0
-11
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/CollectionItemsRelationServiceImpl.java
...impl/distribution/CollectionItemsRelationServiceImpl.java
+13
-9
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
...wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
+11
-14
No files found.
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/FollowFansRecordServiceImpl.java
View file @
eb40ea9c
...
...
@@ -58,7 +58,6 @@ public class FollowFansRecordServiceImpl implements FollowFansRecordService {
CommunityAttributeReadService
communityAttributeReadService
;
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Result
follow
(
FollowFansRecordRequestDto
dto
)
{
try
{
if
(
dto
.
getFollowerId
()
==
null
||
dto
.
getFansId
()
==
null
)
{
...
...
@@ -100,7 +99,6 @@ public class FollowFansRecordServiceImpl implements FollowFansRecordService {
return
Result
.
success
(
map
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"{} 关注 {} error {}"
,
dto
.
getFansId
(),
dto
.
getFollowerId
(),
e
);
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
}
return
Result
.
failed
();
}
...
...
@@ -182,15 +180,6 @@ public class FollowFansRecordServiceImpl implements FollowFansRecordService {
followFansRecordVo
.
setFollowerName
(
cacheUtil
.
getAppletUserNameById
(
f
.
getFollowerId
()));
followFansRecordVo
.
setFollowerIcon
(
cacheUtil
.
getAppletUserById
(
f
.
getFollowerId
()).
getAvatar
());
followFansRecordVo
.
setIntroducerName
(
cacheUtil
.
getAppletUserById
(
f
.
getIntroducerId
()).
getNickname
());
/* try {
CloudServerResponse<CommunityUserAttributeDO> response = communityAttributeReadService.getCommunityUserAttributeByUserId(f.getFollowerId());
if (response.isSuccess()) {
followFansRecordVo.setFollowerProfile(response.getResult() == null ? null : response.getResult().getSignature());
}
} catch (Exception e) {
logger.error(">>>>>>>>> 调用社区用户查询接口获取用户签名出错:{}", e);
}
*/
if
(
fansIdList
.
contains
(
f
.
getFollowerId
().
longValue
()))
{
followFansRecordVo
.
setRelation
(
"互相关注"
);
followFansRecordVo
.
setRelationCode
(
FollowFansEnum
.
RelationEnum
.
BOTH_FOLLOWED
.
getCode
());
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/CollectionItemsRelationServiceImpl.java
View file @
eb40ea9c
...
...
@@ -12,11 +12,13 @@ import com.wwdz.ch.db.dao.distribution.CollectionShareRecordDao;
import
com.wwdz.ch.db.dao.distribution.ItemCollectedRecordDao
;
import
com.wwdz.ch.db.dao.distribution.SupplierItemDao
;
import
com.wwdz.ch.db.domain.distribution.*
;
import
com.wwdz.ch.db.dto.request.FollowFansRecordRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.CollectionBookRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.CollectionItemsRelationRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.ItemCollectedRecordRequestDto
;
import
com.wwdz.ch.db.dto.request.distribution.SupplierItemRequestDto
;
import
com.wwdz.ch.wx.entity.vo.distribution.CollectionBookVo
;
import
com.wwdz.ch.wx.service.FollowFansRecordService
;
import
com.wwdz.ch.wx.service.distribution.CollectionBookService
;
import
com.wwdz.ch.wx.service.distribution.CollectionItemsRelationService
;
import
com.xxdxxs.utils.EntityMapper
;
...
...
@@ -51,6 +53,9 @@ public class CollectionItemsRelationServiceImpl implements CollectionItemsRelati
@Autowired
ItemCollectedRecordDao
itemCollectedRecordDao
;
@Autowired
FollowFansRecordService
followFansRecordService
;
@Override
public
Result
create
(
CollectionItemsRelationRequestDto
dto
)
{
try
{
...
...
@@ -91,17 +96,16 @@ public class CollectionItemsRelationServiceImpl implements CollectionItemsRelati
if
(
collectionShareRecord
.
getItemUserId
().
longValue
()
!=
dto
.
getUserId
().
longValue
())
{
collectionBookVo
.
setIsMine
(
false
);
searchUserId
=
collectionShareRecord
.
getItemUserId
();
//客态进入别人的藏馆,自动关注
FollowFansRecordRequestDto
followFansRecordRequestDto
=
new
FollowFansRecordRequestDto
();
followFansRecordRequestDto
.
setFollowerId
(
collectionShareRecord
.
getItemUserId
());
followFansRecordRequestDto
.
setFansId
(
dto
.
getUserId
());
followFansRecordRequestDto
.
setIntroducerId
(
collectionShareRecord
.
getSharerId
());
followFansRecordService
.
follow
(
followFansRecordRequestDto
);
logger
.
info
(
"用户id:{} 关注了 用户id为 {}, 介绍人为"
,
dto
.
getUserId
(),
collectionShareRecord
.
getItemUserId
(),
collectionShareRecord
.
getSharerId
());
}
}
//查询所有的标签
/* CollectionBookRequestDto collectionBookRequestDto = new CollectionBookRequestDto();
collectionBookRequestDto.setUserId(searchUserId);
collectionBookRequestDto。s
Result bookResult = collectionBookService.findList(collectionBookRequestDto);
if (bookResult.getSuccess()) {
collectionBookVo.setBookList((List<Map<String, Object>>) bookResult.getData());
}*/
//查询所有的上传藏品
SupplierItemRequestDto
supplierItemRequestDto
=
new
SupplierItemRequestDto
();
supplierItemRequestDto
.
setType
(
DistributionEnum
.
DistributionTypeEnum
.
COLLECT
.
getCode
());
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SupplierItemServiceImpl.java
View file @
eb40ea9c
...
...
@@ -23,6 +23,7 @@ import com.wwdz.ch.db.dto.request.distribution.*;
import
com.wwdz.ch.core.entity.SupplierItemVo
;
import
com.wwdz.ch.wx.entity.vo.distribution.AuctionDetailVo
;
import
com.wwdz.ch.wx.entity.vo.distribution.AuctionRecordRowVo
;
import
com.wwdz.ch.wx.service.FollowFansRecordService
;
import
com.wwdz.ch.wx.service.distribution.CollectionItemsRelationService
;
import
com.wwdz.ch.wx.service.distribution.DistributionOrderService
;
import
com.wwdz.ch.wx.service.distribution.SupplierItemService
;
...
...
@@ -109,6 +110,9 @@ public class SupplierItemServiceImpl implements SupplierItemService {
@Autowired
FollowFansRecordDao
followFansRecordDao
;
@Autowired
FollowFansRecordService
followFansRecordService
;
@Override
...
...
@@ -659,22 +663,15 @@ public class SupplierItemServiceImpl implements SupplierItemService {
}
return
Result
.
failed
(
"该藏品已删除"
);
}
//如果是客态,
需要记录浏览记录
//如果是客态,
则自动关注该用户
if
(
StringUtils
.
hasLength
(
dto
.
getShareRecordId
()))
{
if
(
collectionShareRecord
.
getItemUserId
().
longValue
()
!=
dto
.
getUserId
().
longValue
())
{
boolean
isExisted
=
userRecentBrowseDao
.
isExistedBySharedUserId
(
userId
,
collectionShareRecord
.
getItemUserId
());
if
(!
isExisted
)
{
UserRecentBrowse
userRecentBrowse
=
new
UserRecentBrowse
();
userRecentBrowse
.
setUserId
(
userId
);
userRecentBrowse
.
setSharerId
(
collectionShareRecord
.
getSharerId
());
userRecentBrowse
.
setCreateTime
(
new
Date
());
userRecentBrowse
.
setUpdateTime
(
new
Date
());
userRecentBrowse
.
setShareRecordId
(
dto
.
getShareRecordId
());
userRecentBrowse
.
setType
(
DistributionEnum
.
UserBrowseTypeEnum
.
USER_ITEM
.
getCode
());
userRecentBrowse
.
setSharedUserId
(
collectionShareRecord
.
getItemUserId
());
userRecentBrowseDao
.
insert
(
userRecentBrowse
);
logger
.
info
(
"用户id:{} 浏览了 用户id为 {} 的藏品"
,
dto
.
getUserId
(),
collectionShareRecord
.
getItemUserId
());
}
FollowFansRecordRequestDto
followFansRecordRequestDto
=
new
FollowFansRecordRequestDto
();
followFansRecordRequestDto
.
setFollowerId
(
collectionShareRecord
.
getItemUserId
());
followFansRecordRequestDto
.
setFansId
(
dto
.
getUserId
());
followFansRecordRequestDto
.
setIntroducerId
(
collectionShareRecord
.
getSharerId
());
followFansRecordService
.
follow
(
followFansRecordRequestDto
);
logger
.
info
(
"用户id:{} 关注了 用户id为 {}, 介绍人为"
,
dto
.
getUserId
(),
collectionShareRecord
.
getItemUserId
(),
collectionShareRecord
.
getSharerId
());
}
}
}
else
{
...
...
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