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
5d91d3b3
Commit
5d91d3b3
authored
Jul 12, 2019
by
libin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
佣金明细
parent
c132733e
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
357 additions
and
8 deletions
+357
-8
SellingWaterPagVo.java
...m/github/wxiaoqi/security/admin/vo/SellingWaterPagVo.java
+27
-0
SellingWaterVo.java
.../com/github/wxiaoqi/security/admin/vo/SellingWaterVo.java
+54
-0
UserTeamMemberVo.java
...om/github/wxiaoqi/security/admin/vo/UserTeamMemberVo.java
+1
-1
WalletCathPageVo.java
...om/github/wxiaoqi/security/admin/vo/WalletCathPageVo.java
+28
-0
WalletCathVo.java
...va/com/github/wxiaoqi/security/admin/vo/WalletCathVo.java
+65
-0
AppUserSellingWaterBiz.java
...ub/wxiaoqi/security/admin/biz/AppUserSellingWaterBiz.java
+66
-3
MyWalletCathBiz.java
...om/github/wxiaoqi/security/admin/biz/MyWalletCathBiz.java
+61
-0
UserBusinessBiz.java
...om/github/wxiaoqi/security/admin/biz/UserBusinessBiz.java
+4
-4
UserSellingWaterController.java
...iaoqi/security/admin/rest/UserSellingWaterController.java
+51
-0
No files found.
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/SellingWaterPagVo.java
0 → 100644
View file @
5d91d3b3
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
vo
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/12 11:02
*/
@Data
public
class
SellingWaterPagVo
{
private
BigDecimal
totalIncome
;
private
List
<
SellingWaterVo
>
sellingWaters
;
private
Integer
pageNum
;
private
Integer
pageSize
;
private
Integer
totalCount
;
private
Integer
totalPage
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/SellingWaterVo.java
0 → 100644
View file @
5d91d3b3
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/12 11:02
*/
@Data
public
class
SellingWaterVo
{
/**
* 用户名
*/
private
String
username
;
/**
* 昵称
*/
private
String
nickName
;
/**
* 用户头像
*/
private
String
headUrl
;
@ApiModelProperty
(
value
=
"商品数量"
)
private
Integer
goodNumber
;
@ApiModelProperty
(
value
=
"商品标题"
)
private
String
title
;
@ApiModelProperty
(
value
=
"图片"
)
private
String
img
;
@ApiModelProperty
(
value
=
"售价"
)
private
BigDecimal
price
;
@ApiModelProperty
(
value
=
"创建时间"
,
hidden
=
true
)
private
Integer
crtTime
;
@ApiModelProperty
(
value
=
"更新时间"
,
hidden
=
true
)
private
Integer
updTime
;
/**
* 所获佣金
*/
private
BigDecimal
commission
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/UserTeamMemberVo.java
View file @
5d91d3b3
...
...
@@ -25,7 +25,7 @@ public class UserTeamMemberVo {
private
List
<
UserTeamMemberBo
>
userTeamMemberBos
;
private
Integer
pageN
o
;
private
Integer
pageN
um
;
private
Integer
pageSize
;
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/WalletCathPageVo.java
0 → 100644
View file @
5d91d3b3
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
vo
;
import
lombok.Data
;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/12 10:31
*/
@Data
public
class
WalletCathPageVo
{
private
BigDecimal
totalWithdraw
;
private
List
<
WalletCathVo
>
walletCaths
;
private
Integer
pageNum
;
private
Integer
pageSize
;
private
Integer
totalCount
;
private
Integer
totalPage
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/WalletCathVo.java
0 → 100644
View file @
5d91d3b3
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.math.BigDecimal
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/12 10:45
*/
@Data
public
class
WalletCathVo
{
/**
* 用户iD
*/
@ApiModelProperty
(
value
=
"用户iD"
)
private
String
userId
;
/**
* 提现类别,第三方提现类别(0-微信,1-支付宝,2-银行卡)
*/
@ApiModelProperty
(
value
=
"提现类别,第三方提现类别(0-微信,1-支付宝,2-银行卡)"
)
private
Integer
cathType
;
/**
* 商户订单号
*/
@ApiModelProperty
(
value
=
"商户订单号"
)
private
String
orderno
;
/**
* 第三方订单号:如微信,支付宝,银行卡等
*/
@ApiModelProperty
(
value
=
"第三方订单号:如微信,支付宝,银行卡等"
)
private
String
cono
;
/**
* 提现金额
*/
@ApiModelProperty
(
value
=
"提现金额"
)
private
BigDecimal
amount
;
/**
* 订单状态:0-未提现,待审核,1-已审核
*/
@ApiModelProperty
(
value
=
"订单状态:0-未提现,待审核,1-已审核"
)
private
Integer
stauts
;
/**
* 提现日期
*/
@ApiModelProperty
(
value
=
"提现日期"
,
hidden
=
true
)
private
Long
crtTime
;
/**
* 审核日期
*/
@ApiModelProperty
(
value
=
"审核日期"
)
private
Long
finishTime
;
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserSellingWaterBiz.java
View file @
5d91d3b3
...
...
@@ -3,24 +3,29 @@ package com.github.wxiaoqi.security.admin.biz;
import
com.github.wxiaoqi.security.admin.bo.UserIncomeBo
;
import
com.github.wxiaoqi.security.admin.dto.OrderGoodsDTO
;
import
com.github.wxiaoqi.security.admin.dto.OrderWaterDTO
;
import
com.github.wxiaoqi.security.admin.entity.AppUserRelation
;
import
com.github.wxiaoqi.security.admin.entity.MyWalletDetail
;
import
com.github.wxiaoqi.security.admin.entity.*
;
import
com.github.wxiaoqi.security.admin.vo.AppUserVo
;
import
com.github.wxiaoqi.security.admin.vo.SellingWaterPagVo
;
import
com.github.wxiaoqi.security.admin.vo.SellingWaterVo
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.github.wxiaoqi.security.admin.entity.AppUserSellingWater
;
import
com.github.wxiaoqi.security.admin.mapper.AppUserSellingWaterMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
tk.mybatis.mapper.entity.Example
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.function.Supplier
;
import
java.util.stream.Collectors
;
import
java.util.stream.Stream
;
/**
* 拥金明细表
...
...
@@ -46,6 +51,12 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper,Ap
@Autowired
AppUserDetailBiz
detailBiz
;
@Autowired
private
AppUserLoginBiz
appUserLoginBiz
;
@Autowired
private
AppUserDetailBiz
appUserDetailBiz
;
//购买计算用户拥金
public
void
payOrderWater
(
OrderWaterDTO
orderWaterDTO
){
...
...
@@ -178,4 +189,56 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper,Ap
return
memberIdAndIncomeMap
;
}
public
SellingWaterPagVo
findSellingWaterPageByWaiting
(
Integer
waiting
,
Integer
userId
,
Integer
pageNo
,
Integer
pageSize
){
SellingWaterPagVo
sellingWaterPagVo
=
new
SellingWaterPagVo
();
Example
example
=
new
Example
(
AppUserSellingWater
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
if
(
waiting
!=
null
){
criteria
.
andEqualTo
(
"waiting"
,
waiting
);
}
criteria
.
andEqualTo
(
"userId"
,
userId
);
PageDataVO
<
AppUserSellingWater
>
appUserSellingWaterPageDataVO
=
PageDataVO
.
pageInfo
(
pageNo
,
pageSize
,()->
mapper
.
selectByExample
(
example
));
List
<
AppUserSellingWater
>
appUserSellingWaters
=
appUserSellingWaterPageDataVO
.
getData
();
if
(
CollectionUtils
.
isEmpty
(
appUserSellingWaters
)){
return
sellingWaterPagVo
;
}
List
<
Integer
>
memberIds
=
appUserSellingWaters
.
stream
().
map
(
AppUserSellingWater:
:
getSourceId
).
collect
(
Collectors
.
toList
());
Map
<
Integer
,
AppUserLogin
>
userIdAndAppUserLoginMap
=
appUserLoginBiz
.
findUserIdAndUserLoginMapByMemberIds
(
memberIds
);
Map
<
Integer
,
AppUserDetail
>
userIdAndAppUserDetailMap
=
appUserDetailBiz
.
findUserIdAndUserDetailMapByMemberIds
(
memberIds
);
List
<
SellingWaterVo
>
sellingWaterVos
=
new
ArrayList
<>();
SellingWaterVo
sellingWaterVo
;
BigDecimal
totalIncome
=
new
BigDecimal
(
0
);
for
(
AppUserSellingWater
appUserSellingWater
:
appUserSellingWaters
)
{
sellingWaterVo
=
new
SellingWaterVo
();
BeanUtils
.
copyProperties
(
appUserSellingWater
,
sellingWaterVo
);
sellingWaterVo
.
setUsername
(
userIdAndAppUserLoginMap
.
get
(
appUserSellingWater
.
getSourceId
()).
getUsername
());
if
(
userIdAndAppUserDetailMap
!=
null
){
AppUserDetail
appUserDetail
=
userIdAndAppUserDetailMap
.
get
(
appUserSellingWater
.
getSourceId
());
sellingWaterVo
.
setNickName
(
appUserDetail
==
null
?
""
:
appUserDetail
.
getNickname
());
sellingWaterVo
.
setHeadUrl
(
appUserDetail
==
null
?
""
:
appUserDetail
.
getHeadimgurl
());
}
totalIncome
=
totalIncome
.
add
(
sellingWaterVo
.
getCommission
());
sellingWaterVos
.
add
(
sellingWaterVo
);
}
if
(
waiting
==
null
){
Supplier
<
Stream
<
AppUserSellingWater
>>
commissionStream
=
()->
appUserSellingWaters
.
stream
();
BigDecimal
total
=
commissionStream
.
get
().
filter
(
x
->
x
.
getStatus
()
==
0
).
map
(
AppUserSellingWater:
:
getCommission
).
reduce
(
new
BigDecimal
(
0
),(
x
,
y
)->
x
.
add
(
y
));
BigDecimal
refund
=
commissionStream
.
get
().
filter
(
x
->
x
.
getStatus
()
==
1
).
map
(
AppUserSellingWater:
:
getCommission
).
reduce
(
new
BigDecimal
(
0
),(
x
,
y
)->
x
.
add
(
y
));
totalIncome
=
total
.
subtract
(
refund
);
}
sellingWaterPagVo
.
setPageNum
(
appUserSellingWaterPageDataVO
.
getPageNum
());
sellingWaterPagVo
.
setPageSize
(
appUserSellingWaterPageDataVO
.
getPageSize
());
sellingWaterPagVo
.
setTotalCount
(
appUserSellingWaterPageDataVO
.
getTotalCount
().
intValue
());
sellingWaterPagVo
.
setTotalPage
(
appUserSellingWaterPageDataVO
.
getTotalPage
());
sellingWaterPagVo
.
setTotalIncome
(
totalIncome
);
sellingWaterPagVo
.
setSellingWaters
(
sellingWaterVos
);
return
sellingWaterPagVo
;
}
}
\ No newline at end of file
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/MyWalletCathBiz.java
0 → 100644
View file @
5d91d3b3
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
import
com.github.wxiaoqi.security.admin.entity.MyWalletCath
;
import
com.github.wxiaoqi.security.admin.mapper.MyWalletCathMapper
;
import
com.github.wxiaoqi.security.admin.vo.WalletCathPageVo
;
import
com.github.wxiaoqi.security.admin.vo.WalletCathVo
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
tk.mybatis.mapper.entity.Example
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/12 10:21
*/
@Transactional
@Service
public
class
MyWalletCathBiz
extends
BaseBiz
<
MyWalletCathMapper
,
MyWalletCath
>
{
public
WalletCathPageVo
findWatchCatchByWithdrawalState
(
Integer
state
,
Integer
pageNo
,
Integer
pageSize
){
WalletCathPageVo
walletCathPageVo
=
new
WalletCathPageVo
();
Example
example
=
new
Example
(
MyWalletCath
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"stauts"
,
state
);
PageDataVO
<
MyWalletCath
>
walletCathPage
=
PageDataVO
.
pageInfo
(
pageNo
,
pageSize
,
()
->
mapper
.
selectByExample
(
example
));
List
<
MyWalletCath
>
walletCaths
=
walletCathPage
.
getData
();
if
(
CollectionUtils
.
isEmpty
(
walletCaths
)){
return
walletCathPageVo
;
}
WalletCathVo
walletCathVo
=
null
;
BigDecimal
totalWithdraw
=
new
BigDecimal
(
0
);
List
<
WalletCathVo
>
walletCatchPageVos
=
new
ArrayList
<>();
for
(
MyWalletCath
walletCath
:
walletCaths
)
{
walletCathVo
=
new
WalletCathVo
();
BeanUtils
.
copyProperties
(
walletCath
,
walletCathVo
);
totalWithdraw
=
totalWithdraw
.
add
(
walletCathVo
.
getAmount
());
walletCatchPageVos
.
add
(
walletCathVo
);
}
walletCathPageVo
.
setPageNum
(
walletCathPage
.
getPageNum
());
walletCathPageVo
.
setPageSize
(
walletCathPage
.
getPageSize
());
walletCathPageVo
.
setTotalCount
(
walletCathPage
.
getTotalCount
().
intValue
());
walletCathPageVo
.
setTotalPage
(
walletCathPage
.
getTotalPage
());
walletCathPageVo
.
setTotalWithdraw
(
totalWithdraw
);
walletCathPageVo
.
setWalletCaths
(
walletCatchPageVos
);
return
walletCathPageVo
;
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/UserBusinessBiz.java
View file @
5d91d3b3
...
...
@@ -57,7 +57,7 @@ public class UserBusinessBiz {
}
Map
<
Integer
,
AppUserLogin
>
userIdAndAppUserLoginMap
=
appUserLoginBiz
.
findUserIdAndUserLoginMapByMemberIds
(
memberIds
);
Map
<
Integer
,
AppUserDetail
>
U
serIdAndAppUserDetailMap
=
appUserDetailBiz
.
findUserIdAndUserDetailMapByMemberIds
(
memberIds
);
Map
<
Integer
,
AppUserDetail
>
u
serIdAndAppUserDetailMap
=
appUserDetailBiz
.
findUserIdAndUserDetailMapByMemberIds
(
memberIds
);
List
<
UserTeamMemberBo
>
userTeamMemberBos
=
new
ArrayList
<>();
UserTeamMemberBo
userTeamMemberBo
;
...
...
@@ -72,8 +72,8 @@ public class UserBusinessBiz {
AppUserLogin
appUserLogin
=
userIdAndAppUserLoginMap
.
get
(
appUserRelation
.
getUserId
());
userTeamMemberBo
.
setUserName
(
appUserLogin
.
getUsername
());
}
if
(
U
serIdAndAppUserDetailMap
!=
null
){
AppUserDetail
appUserDetail
=
U
serIdAndAppUserDetailMap
.
get
(
appUserRelation
.
getUserId
());
if
(
u
serIdAndAppUserDetailMap
!=
null
){
AppUserDetail
appUserDetail
=
u
serIdAndAppUserDetailMap
.
get
(
appUserRelation
.
getUserId
());
userTeamMemberBo
.
setHeadUrl
(
appUserDetail
==
null
?
""
:
appUserDetail
.
getHeadimgurl
());
userTeamMemberBo
.
setNickName
(
appUserDetail
==
null
?
""
:
appUserDetail
.
getNickname
());
}
...
...
@@ -81,7 +81,7 @@ public class UserBusinessBiz {
totalIncome
=
totalIncome
.
add
(
userTeamMemberBo
.
getIncome
());
userTeamMemberBos
.
add
(
userTeamMemberBo
);
}
userTeamMemberVo
.
setPageN
o
(
memberPage
.
getPageNum
());
userTeamMemberVo
.
setPageN
um
(
memberPage
.
getPageNum
());
userTeamMemberVo
.
setPageSize
(
memberPage
.
getPageSize
());
userTeamMemberVo
.
setTotalCount
(
memberPage
.
getTotalCount
().
intValue
());
userTeamMemberVo
.
setTotalPage
(
memberPage
.
getTotalPage
());
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/UserSellingWaterController.java
0 → 100644
View file @
5d91d3b3
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rest
;
import
com.github.wxiaoqi.security.admin.biz.AppUserSellingWaterBiz
;
import
com.github.wxiaoqi.security.admin.vo.SellingWaterPagVo
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.auth.client.jwt.UserAuthUtil
;
import
com.github.wxiaoqi.security.auth.common.util.jwt.IJWTInfo
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletRequest
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/12 11:35
*/
@RestController
@RequestMapping
(
"/sellingwater"
)
public
class
UserSellingWaterController
{
@Autowired
private
AppUserSellingWaterBiz
appUserSellingWaterBiz
;
@Autowired
private
UserAuthUtil
userAuthUtil
;
@Autowired
private
UserAuthConfig
userAuthConfig
;
@GetMapping
(
"/page"
)
public
ObjectRestResponse
<
SellingWaterPagVo
>
findSellingWaterPage
(
@RequestParam
(
"type"
)
Integer
wating
,
@RequestParam
(
"pageNo"
)
Integer
pageNo
,
@RequestParam
(
"pageSize"
)
Integer
pageSize
,
HttpServletRequest
request
)
{
try
{
IJWTInfo
infoFromToken
=
userAuthUtil
.
getInfoFromToken
(
userAuthConfig
.
getToken
(
request
));
SellingWaterPagVo
sellingWaterPagVo
=
appUserSellingWaterBiz
.
findSellingWaterPageByWaiting
(
wating
,
Integer
.
valueOf
(
infoFromToken
.
getId
()),
pageNo
,
pageSize
);
return
ObjectRestResponse
.
succ
(
sellingWaterPagVo
);
}
catch
(
Exception
e
)
{
throw
new
BaseException
(
e
);
}
}
}
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