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
1faadba1
Commit
1faadba1
authored
Apr 10, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
藏家主页
parent
171686e4
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
18 deletions
+34
-18
ch-core/src/main/java/com/wwdz/ch/core/util/CacheUtil.java
ch-core/src/main/java/com/wwdz/ch/core/util/CacheUtil.java
+1
-1
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/vo/distribution/SelfPageInfoVo.java
...com/wwdz/ch/wx/entity/vo/distribution/SelfPageInfoVo.java
+16
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SelfPageServiceImpl.java
...com/wwdz/ch/wx/impl/distribution/SelfPageServiceImpl.java
+17
-17
No files found.
ch-core/src/main/java/com/wwdz/ch/core/util/CacheUtil.java
View file @
1faadba1
...
...
@@ -121,7 +121,7 @@ public class CacheUtil {
*/
public
AsyncLoadingCache
<
Long
,
User
>
appletUserInfoCache
=
Caffeine
.
newBuilder
()
.
maximumSize
(
5000
)
.
expireAfterAccess
(
30
,
TimeUnit
.
SECONDS
)
.
expireAfterAccess
(
8
,
TimeUnit
.
SECONDS
)
.
buildAsync
(
k
->
getAppletUsers
(
k
));
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/vo/distribution/SelfPageInfoVo.java
View file @
1faadba1
...
...
@@ -40,6 +40,16 @@ public class SelfPageInfoVo implements Entity {
*/
private
String
avatarUrl
;
/**
* 简介
*/
private
String
profile
;
/**
* 背景图片
*/
private
String
background
;
/**
* 各状态订单数量
*/
...
...
@@ -51,4 +61,10 @@ public class SelfPageInfoVo implements Entity {
private
List
<
DistributionOrderNum
>
orderNumForDistributor
;
/**
* 藏家卖出去的商品订单
*/
private
List
<
DistributionOrderNum
>
orderNumForCollector
;
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/distribution/SelfPageServiceImpl.java
View file @
1faadba1
...
...
@@ -9,6 +9,7 @@ import com.wwdz.ch.core.util.RedisUtils;
import
com.wwdz.ch.db.bean.DistributionOrderNum
;
import
com.wwdz.ch.db.dao.FollowFansRecordDao
;
import
com.wwdz.ch.db.dao.SwitchDao
;
import
com.wwdz.ch.db.dao.UserDao
;
import
com.wwdz.ch.db.dao.distribution.*
;
import
com.wwdz.ch.db.domain.User
;
import
com.wwdz.ch.db.domain.distribution.AuctionConfig
;
...
...
@@ -72,6 +73,9 @@ public class SelfPageServiceImpl implements SelfPageService {
@Autowired
FollowFansRecordDao
followFansRecordDao
;
@Autowired
UserDao
userDao
;
@Override
...
...
@@ -82,8 +86,8 @@ public class SelfPageServiceImpl implements SelfPageService {
long
totalProfit
=
distributorProfitDao
.
countProfit
(
dto
.
getUserId
());
SelfPageInfoVo
selfPageInfoVo
=
new
SelfPageInfoVo
();
selfPageInfoVo
.
setUserId
(
dto
.
getUserId
());
selfPageInfoVo
.
setUserName
(
cacheUtil
.
getAppletUserNameById
(
dto
.
getUserId
()
));
selfPageInfoVo
.
setAvatarUrl
(
cacheUtil
.
getAppletUsers
(
dto
.
getUserId
()
).
getAvatar
());
selfPageInfoVo
.
setUserName
(
cacheUtil
.
appletUserInfoCache
.
get
(
dto
.
getUserId
()).
get
().
getNickname
(
));
selfPageInfoVo
.
setAvatarUrl
(
cacheUtil
.
appletUserInfoCache
.
get
(
dto
.
getUserId
()).
get
(
).
getAvatar
());
selfPageInfoVo
.
setTotalSellItemNum
((
int
)
sellItemNum
);
selfPageInfoVo
.
setTotalSellAmount
(
PriceUtil
.
convertPriceFenToYuan
(
sellAmount
));
selfPageInfoVo
.
setTotalProfit
(
PriceUtil
.
convertPriceFenToYuan
(
totalProfit
));
...
...
@@ -111,8 +115,8 @@ public class SelfPageServiceImpl implements SelfPageService {
try
{
SelfPageInfoVo
selfPageInfoVo
=
new
SelfPageInfoVo
();
selfPageInfoVo
.
setUserId
(
dto
.
getUserId
());
selfPageInfoVo
.
setUserName
(
cacheUtil
.
getAppletUserNameById
(
dto
.
getUserId
()
));
selfPageInfoVo
.
setAvatarUrl
(
cacheUtil
.
getAppletUsers
(
dto
.
getUserId
()
).
getAvatar
());
selfPageInfoVo
.
setUserName
(
cacheUtil
.
appletUserInfoCache
.
get
(
dto
.
getUserId
()).
get
().
getNickname
(
));
selfPageInfoVo
.
setAvatarUrl
(
cacheUtil
.
appletUserInfoCache
.
get
(
dto
.
getUserId
()).
get
(
).
getAvatar
());
List
<
DistributionOrderNum
>
distributionOrderNumList
=
distributionOrderDao
.
countGroupByStateForUser
(
dto
.
getUserId
());
distributionOrderNumList
.
forEach
(
distributionOrderNum
->
{
distributionOrderNum
.
setStateName
(
DistributionEnum
.
DistributionOrderStateEnum
.
getNameByCode
(
distributionOrderNum
.
getState
()));
...
...
@@ -146,31 +150,27 @@ public class SelfPageServiceImpl implements SelfPageService {
@Override
public
Result
getCollectorPageInfo
(
SelfPageRequestDto
dto
)
{
try
{
long
sellItemNum
=
distributorProfitDao
.
countSellItemNum
(
dto
.
getUserId
());
long
sellAmount
=
distributorProfitDao
.
countSellAmount
(
dto
.
getUserId
());
long
totalProfit
=
distributorProfitDao
.
countProfit
(
dto
.
getUserId
());
SelfPageInfoVo
selfPageInfoVo
=
new
SelfPageInfoVo
();
selfPageInfoVo
.
setUserId
(
dto
.
getUserId
());
selfPageInfoVo
.
setUserName
(
cacheUtil
.
getAppletUserNameById
(
dto
.
getUserId
()));
selfPageInfoVo
.
setAvatarUrl
(
cacheUtil
.
getAppletUsers
(
dto
.
getUserId
()).
getAvatar
());
selfPageInfoVo
.
setTotalSellItemNum
((
int
)
sellItemNum
);
selfPageInfoVo
.
setTotalSellAmount
(
PriceUtil
.
convertPriceFenToYuan
(
sellAmount
));
selfPageInfoVo
.
setTotalProfit
(
PriceUtil
.
convertPriceFenToYuan
(
totalProfit
));
selfPageInfoVo
.
setUserName
(
cacheUtil
.
appletUserInfoCache
.
get
(
dto
.
getUserId
()).
get
().
getNickname
());
selfPageInfoVo
.
setAvatarUrl
(
cacheUtil
.
appletUserInfoCache
.
get
(
dto
.
getUserId
()).
get
().
getAvatar
());
selfPageInfoVo
.
setProfile
(
cacheUtil
.
appletUserInfoCache
.
get
(
dto
.
getUserId
()).
get
().
getProfile
());
selfPageInfoVo
.
setBackground
(
cacheUtil
.
appletUserInfoCache
.
get
(
dto
.
getUserId
()).
get
().
getBackground
());
List
<
DistributionOrderNum
>
distributionOrderNumList
=
distributionOrderDao
.
countGroupByStateForDistributor
(
dto
.
getUserId
());
distributionOrderNumList
.
forEach
(
distributionOrderNum
->
{
distributionOrderNum
.
setStateName
(
DistributionEnum
.
DistributionOrderStateEnum
.
getNameByCode
(
distributionOrderNum
.
getState
()));
});
//
分销商
卖出去的商品订单
selfPageInfoVo
.
setOrderNumFor
Distribu
tor
(
distributionOrderNumList
);
/* //分销商
自己购买的订单
//
藏家
卖出去的商品订单
selfPageInfoVo
.
setOrderNumFor
Collec
tor
(
distributionOrderNumList
);
//藏家
自己购买的订单
List
<
DistributionOrderNum
>
selfBuyNumList
=
distributionOrderDao
.
countGroupByStateForUser
(
dto
.
getUserId
());
selfBuyNumList
.
forEach
(
s
->
{
s
.
setStateName
(
DistributionEnum
.
DistributionOrderStateEnum
.
getNameByCode
(
s
.
getState
()));
});
selfPageInfoVo.setOrderNum(selfBuyNumList);
*/
selfPageInfoVo
.
setOrderNum
(
selfBuyNumList
);
return
Result
.
success
(
selfPageInfoVo
);
}
catch
(
Exception
e
)
{
logger
.
error
(
"查询
分销商
个人主页失败 error : {}"
,
e
);
logger
.
error
(
"查询
藏家
个人主页失败 error : {}"
,
e
);
}
return
Result
.
failed
();
}
...
...
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