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
c3118259
Commit
c3118259
authored
Oct 21, 2019
by
libin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
钱包后台
parent
f696bdf1
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
353 additions
and
88 deletions
+353
-88
UserSellingWaterAdminDTO.java
.../wxiaoqi/security/admin/dto/UserSellingWaterAdminDTO.java
+65
-0
UserSellingWaterFindDTO.java
...b/wxiaoqi/security/admin/dto/UserSellingWaterFindDTO.java
+20
-0
WalletCathFindDTO.java
.../github/wxiaoqi/security/admin/dto/WalletCathFindDTO.java
+6
-0
WalletDetailFindDTO.java
...ithub/wxiaoqi/security/admin/dto/WalletDetailFindDTO.java
+4
-0
AppletWalletVo.java
.../com/github/wxiaoqi/security/admin/vo/AppletWalletVo.java
+2
-0
WalletCathAdminVo.java
...m/github/wxiaoqi/security/admin/vo/WalletCathAdminVo.java
+0
-3
WalletPageVo.java
...va/com/github/wxiaoqi/security/admin/vo/WalletPageVo.java
+3
-0
AppUserSellingWaterBiz.java
...ub/wxiaoqi/security/admin/biz/AppUserSellingWaterBiz.java
+13
-5
MyWalletBiz.java
...va/com/github/wxiaoqi/security/admin/biz/MyWalletBiz.java
+36
-24
MyWalletCathBiz.java
...om/github/wxiaoqi/security/admin/biz/MyWalletCathBiz.java
+6
-1
MyWalletDetailBiz.java
.../github/wxiaoqi/security/admin/biz/MyWalletDetailBiz.java
+5
-1
AppUserSellingWaterMapper.java
...aoqi/security/admin/mapper/AppUserSellingWaterMapper.java
+4
-0
MyWalletCathMapper.java
...hub/wxiaoqi/security/admin/mapper/MyWalletCathMapper.java
+4
-1
MyWalletDetailMapper.java
...b/wxiaoqi/security/admin/mapper/MyWalletDetailMapper.java
+5
-1
MyWalletMapper.java
.../github/wxiaoqi/security/admin/mapper/MyWalletMapper.java
+10
-0
MyWalletAdminController.java
...qi/security/admin/rest/admin/MyWalletAdminController.java
+8
-3
UserSellingWaterAdminController.java
...ity/admin/rest/admin/UserSellingWaterAdminController.java
+31
-0
AppUserSellingWaterMapper.xml
...n/src/main/resources/mapper/AppUserSellingWaterMapper.xml
+39
-0
MyWalletCathMapper.xml
...ce-admin/src/main/resources/mapper/MyWalletCathMapper.xml
+32
-11
MyWalletDetailMapper.xml
...-admin/src/main/resources/mapper/MyWalletDetailMapper.xml
+60
-38
No files found.
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/UserSellingWaterAdminDTO.java
0 → 100644
View file @
c3118259
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/10/21 10:23
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
UserSellingWaterAdminDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
Integer
id
;
private
String
userName
;
private
String
sourceName
;
private
String
phone
;
@ApiModelProperty
(
value
=
"订单id"
)
private
Integer
orderId
;
@ApiModelProperty
(
value
=
"订单号"
)
private
String
orderNo
;
@ApiModelProperty
(
value
=
"1-租车;2-旅游;3-会员;4-营地"
)
private
Integer
orderType
;
@ApiModelProperty
(
value
=
"商品数量"
)
private
Integer
goodNumber
;
@ApiModelProperty
(
value
=
"类型 1=>一级上线提成"
)
private
Integer
type
;
@ApiModelProperty
(
value
=
"类别:0-正;1-负"
)
private
Integer
status
;
@ApiModelProperty
(
value
=
"商品标题"
)
private
String
title
;
@ApiModelProperty
(
value
=
"售价"
)
private
BigDecimal
price
;
@ApiModelProperty
(
value
=
"提成百分比"
)
private
Integer
extract
;
@ApiModelProperty
(
value
=
"是否入账:0-未入账;1-已入账"
)
private
Integer
waiting
;
@ApiModelProperty
(
value
=
"创建时间"
,
hidden
=
true
)
private
Long
crtTime
;
private
BigDecimal
commission
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/UserSellingWaterFindDTO.java
0 → 100644
View file @
c3118259
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
dto
;
import
com.github.wxiaoqi.security.common.vo.PageParam
;
import
lombok.Data
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/10/21 10:21
*/
@Data
public
class
UserSellingWaterFindDTO
extends
PageParam
{
private
String
userName
;
private
String
phone
;
private
Integer
waiting
;
private
Integer
status
;
private
Long
startTime
;
private
Long
endTime
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/WalletCathFindDTO.java
View file @
c3118259
...
@@ -20,4 +20,10 @@ public class WalletCathFindDTO extends PageParam {
...
@@ -20,4 +20,10 @@ public class WalletCathFindDTO extends PageParam {
* 转账状态
* 转账状态
*/
*/
private
Integer
state
;
private
Integer
state
;
private
String
orderNo
;
private
Long
startTime
;
private
Long
endTime
;
}
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/WalletDetailFindDTO.java
View file @
c3118259
...
@@ -17,4 +17,8 @@ public class WalletDetailFindDTO extends PageParam {
...
@@ -17,4 +17,8 @@ public class WalletDetailFindDTO extends PageParam {
private
String
phone
;
private
String
phone
;
private
Integer
source
;
private
Integer
source
;
private
Long
startTime
;
private
Long
endTime
;
}
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/AppletWalletVo.java
View file @
c3118259
...
@@ -40,4 +40,6 @@ public class AppletWalletVo {
...
@@ -40,4 +40,6 @@ public class AppletWalletVo {
@ApiModelProperty
(
value
=
"未入账金额"
)
@ApiModelProperty
(
value
=
"未入账金额"
)
private
BigDecimal
unbooked
;
private
BigDecimal
unbooked
;
@ApiModelProperty
(
value
=
"是否冻结"
)
private
Integer
isFrozen
;
}
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/WalletCathAdminVo.java
View file @
c3118259
...
@@ -50,8 +50,5 @@ public class WalletCathAdminVo {
...
@@ -50,8 +50,5 @@ public class WalletCathAdminVo {
@ApiModelProperty
(
value
=
"用户账号"
)
@ApiModelProperty
(
value
=
"用户账号"
)
private
String
accountNumber
;
private
String
accountNumber
;
@ApiModelProperty
(
value
=
"用户账号描述"
)
private
String
accountNumberDesc
;
private
String
accountName
;
private
String
accountName
;
}
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/WalletPageVo.java
View file @
c3118259
...
@@ -52,4 +52,7 @@ public class WalletPageVo {
...
@@ -52,4 +52,7 @@ public class WalletPageVo {
@ApiModelProperty
(
value
=
"是否冻结:0-正常,1-冻结"
)
@ApiModelProperty
(
value
=
"是否冻结:0-正常,1-冻结"
)
private
Integer
isFrozen
;
private
Integer
isFrozen
;
@ApiModelProperty
(
value
=
"佣金比例"
)
private
Integer
commissionRate
;
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserSellingWaterBiz.java
View file @
c3118259
...
@@ -3,9 +3,10 @@ package com.github.wxiaoqi.security.admin.biz;
...
@@ -3,9 +3,10 @@ package com.github.wxiaoqi.security.admin.biz;
import
com.github.wxiaoqi.security.admin.bo.UserIncomeBo
;
import
com.github.wxiaoqi.security.admin.bo.UserIncomeBo
;
import
com.github.wxiaoqi.security.admin.dto.OrderGoodsDTO
;
import
com.github.wxiaoqi.security.admin.dto.OrderGoodsDTO
;
import
com.github.wxiaoqi.security.admin.dto.OrderWaterDTO
;
import
com.github.wxiaoqi.security.admin.dto.OrderWaterDTO
;
import
com.github.wxiaoqi.security.admin.dto.UserSellingWaterAdminDTO
;
import
com.github.wxiaoqi.security.admin.dto.UserSellingWaterFindDTO
;
import
com.github.wxiaoqi.security.admin.entity.*
;
import
com.github.wxiaoqi.security.admin.entity.*
;
import
com.github.wxiaoqi.security.admin.entity.AppUserRelation
;
import
com.github.wxiaoqi.security.admin.entity.AppUserRelation
;
import
com.github.wxiaoqi.security.admin.vo.AppUserVo
;
import
com.github.wxiaoqi.security.admin.vo.SellingWalletVo
;
import
com.github.wxiaoqi.security.admin.vo.SellingWalletVo
;
import
com.github.wxiaoqi.security.admin.vo.SellingWalletPagVo
;
import
com.github.wxiaoqi.security.admin.vo.SellingWalletPagVo
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
...
@@ -380,17 +381,17 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
...
@@ -380,17 +381,17 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
sellingWalletVo
.
setHeadUrl
(
appUserDetail
==
null
?
""
:
appUserDetail
.
getHeadimgurl
());
sellingWalletVo
.
setHeadUrl
(
appUserDetail
==
null
?
""
:
appUserDetail
.
getHeadimgurl
());
}
}
//取消单
//取消单
if
(
sellingWalletVo
.
getSellerStatus
()
==
1
)
{
if
(
sellingWalletVo
.
getSellerStatus
()
==
1
)
{
sellingWalletVo
.
setSellerStatus
(
SellerWallterStatus
.
CANCEL
.
getCode
());
sellingWalletVo
.
setSellerStatus
(
SellerWallterStatus
.
CANCEL
.
getCode
());
sellingWalletVo
.
setStatusText
(
SellerWallterStatus
.
CANCEL
.
getText
());
sellingWalletVo
.
setStatusText
(
SellerWallterStatus
.
CANCEL
.
getText
());
sellingWalletVo
.
setIsShow
(
true
);
sellingWalletVo
.
setIsShow
(
true
);
}
else
{
}
else
{
if
(
sellingWalletVo
.
getWaiting
()
==
SellerWallterStatus
.
POST
.
getCode
())
{
if
(
sellingWalletVo
.
getWaiting
()
==
SellerWallterStatus
.
POST
.
getCode
())
{
sellingWalletVo
.
setSellerStatus
(
SellerWallterStatus
.
POST
.
getCode
());
sellingWalletVo
.
setSellerStatus
(
SellerWallterStatus
.
POST
.
getCode
());
sellingWalletVo
.
setStatusText
(
SellerWallterStatus
.
POST
.
getText
());
sellingWalletVo
.
setStatusText
(
SellerWallterStatus
.
POST
.
getText
());
sellingWalletVo
.
setIsShow
(
false
);
sellingWalletVo
.
setIsShow
(
false
);
}
}
if
(
sellingWalletVo
.
getWaiting
()
==
SellerWallterStatus
.
NO_POST
.
getCode
())
{
if
(
sellingWalletVo
.
getWaiting
()
==
SellerWallterStatus
.
NO_POST
.
getCode
())
{
sellingWalletVo
.
setSellerStatus
(
SellerWallterStatus
.
NO_POST
.
getCode
());
sellingWalletVo
.
setSellerStatus
(
SellerWallterStatus
.
NO_POST
.
getCode
());
sellingWalletVo
.
setStatusText
(
SellerWallterStatus
.
NO_POST
.
getText
());
sellingWalletVo
.
setStatusText
(
SellerWallterStatus
.
NO_POST
.
getText
());
sellingWalletVo
.
setIsShow
(
false
);
sellingWalletVo
.
setIsShow
(
false
);
...
@@ -405,6 +406,13 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
...
@@ -405,6 +406,13 @@ public class AppUserSellingWaterBiz extends BaseBiz<AppUserSellingWaterMapper, A
return
sellingWalletPagVo
;
return
sellingWalletPagVo
;
}
}
public
PageDataVO
<
UserSellingWaterAdminDTO
>
findSellingWaterWithPage
(
UserSellingWaterFindDTO
userSellingWaterFindDTO
)
{
PageDataVO
<
UserSellingWaterAdminDTO
>
pageDataVO
=
PageDataVO
.
pageInfo
(
userSellingWaterFindDTO
.
getPage
(),
userSellingWaterFindDTO
.
getLimit
(),
()
->
mapper
.
selectSellingWaterPage
(
userSellingWaterFindDTO
));
return
pageDataVO
;
}
private
enum
SellerWallterStatus
{
private
enum
SellerWallterStatus
{
CANCEL
(
2
,
"取消订单"
),
CANCEL
(
2
,
"取消订单"
),
POST
(
1
,
"已入账"
),
POST
(
1
,
"已入账"
),
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/MyWalletBiz.java
View file @
c3118259
...
@@ -11,10 +11,7 @@ import com.github.wxiaoqi.security.admin.dto.WalletListDTO;
...
@@ -11,10 +11,7 @@ import com.github.wxiaoqi.security.admin.dto.WalletListDTO;
import
com.github.wxiaoqi.security.admin.entity.*
;
import
com.github.wxiaoqi.security.admin.entity.*
;
import
com.github.wxiaoqi.security.admin.mapper.MyWalletMapper
;
import
com.github.wxiaoqi.security.admin.mapper.MyWalletMapper
;
import
com.github.wxiaoqi.security.admin.rpc.service.AppPermissionService
;
import
com.github.wxiaoqi.security.admin.rpc.service.AppPermissionService
;
import
com.github.wxiaoqi.security.admin.vo.AppletWalletVo
;
import
com.github.wxiaoqi.security.admin.vo.*
;
import
com.github.wxiaoqi.security.admin.vo.ApplyCathVo
;
import
com.github.wxiaoqi.security.admin.vo.PayAccountVo
;
import
com.github.wxiaoqi.security.admin.vo.WalletPageVo
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant
;
import
com.github.wxiaoqi.security.common.config.rabbit.RabbitConstant
;
import
com.github.wxiaoqi.security.common.constant.UserConstant
;
import
com.github.wxiaoqi.security.common.constant.UserConstant
;
...
@@ -50,6 +47,7 @@ import java.time.Instant;
...
@@ -50,6 +47,7 @@ import java.time.Instant;
import
java.time.LocalDate
;
import
java.time.LocalDate
;
import
java.time.format.DateTimeFormatter
;
import
java.time.format.DateTimeFormatter
;
import
java.util.*
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -87,6 +85,9 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
...
@@ -87,6 +85,9 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
@Autowired
@Autowired
private
AppUserAlipayBiz
appUserAlipayBiz
;
private
AppUserAlipayBiz
appUserAlipayBiz
;
@Autowired
private
AppUserPositionBiz
appUserPositionBiz
;
@Autowired
@Autowired
RabbitTemplate
rabbitTemplate
;
RabbitTemplate
rabbitTemplate
;
...
@@ -114,6 +115,7 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
...
@@ -114,6 +115,7 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
appletWalletVo
.
setTodayAmount
(
myWallet
.
getTodayAmount
()
==
null
?
new
BigDecimal
(
0
)
:
myWallet
.
getTodayAmount
());
appletWalletVo
.
setTodayAmount
(
myWallet
.
getTodayAmount
()
==
null
?
new
BigDecimal
(
0
)
:
myWallet
.
getTodayAmount
());
appletWalletVo
.
setTotalAmount
(
myWallet
.
getTotalAmount
()
==
null
?
new
BigDecimal
(
0
)
:
myWallet
.
getTotalAmount
());
appletWalletVo
.
setTotalAmount
(
myWallet
.
getTotalAmount
()
==
null
?
new
BigDecimal
(
0
)
:
myWallet
.
getTotalAmount
());
appletWalletVo
.
setUnbooked
(
myWallet
.
getUnbooked
()
==
null
?
new
BigDecimal
(
0
)
:
myWallet
.
getUnbooked
());
appletWalletVo
.
setUnbooked
(
myWallet
.
getUnbooked
()
==
null
?
new
BigDecimal
(
0
)
:
myWallet
.
getUnbooked
());
appletWalletVo
.
setIsFrozen
(
myWallet
.
getIsFrozen
());
appletWalletVo
.
setUserId
(
myWallet
.
getUserId
());
appletWalletVo
.
setUserId
(
myWallet
.
getUserId
());
return
appletWalletVo
;
return
appletWalletVo
;
}
}
...
@@ -130,7 +132,9 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
...
@@ -130,7 +132,9 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
List
<
Integer
>
userIds
=
wallets
.
stream
().
map
(
WalletListDTO:
:
getUserId
).
collect
(
Collectors
.
toList
());
List
<
Integer
>
userIds
=
wallets
.
stream
().
map
(
WalletListDTO:
:
getUserId
).
collect
(
Collectors
.
toList
());
Map
<
Integer
,
BigDecimal
>
userIdAndTotalConsumptionMap
=
myWalletDetailBiz
.
finduserIdAndPersonalTotalConsumptionMapByUserIds
(
userIds
);
Map
<
Integer
,
BigDecimal
>
userIdAndTotalConsumptionMap
=
myWalletDetailBiz
.
finduserIdAndPersonalTotalConsumptionMapByUserIds
(
userIds
);
Map
<
Integer
,
BigDecimal
>
userIdAndWithdrawalingMap
=
myWalletCathBiz
.
findUserIdAndWithdrawalingMapByUserIds
(
userIds
);
Map
<
Integer
,
BigDecimal
>
userIdAndWithdrawalingMap
=
myWalletCathBiz
.
findUserIdAndWithdrawalingMapByUserIds
(
userIds
);
Map
<
Integer
,
AppUserDetail
>
userdetailMap
=
appUserDetailBiz
.
findUserIdAndUserDetailMapByMemberIds
(
userIds
);
List
<
WalletPostionVo
>
allPostions
=
appUserPositionBiz
.
findAllPostions
();
Map
<
Integer
,
WalletPostionVo
>
postionMap
=
allPostions
.
stream
().
collect
(
Collectors
.
toMap
(
WalletPostionVo:
:
getId
,
Function
.
identity
()));
List
<
WalletPageVo
>
walletPageVos
=
new
ArrayList
<>();
List
<
WalletPageVo
>
walletPageVos
=
new
ArrayList
<>();
WalletPageVo
walletpg
;
WalletPageVo
walletpg
;
for
(
WalletListDTO
wallet
:
wallets
)
{
for
(
WalletListDTO
wallet
:
wallets
)
{
...
@@ -146,10 +150,18 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
...
@@ -146,10 +150,18 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
walletpg
.
setUnbooked
(
walletpg
.
getUnbooked
()
==
null
?
new
BigDecimal
(
0
)
:
walletpg
.
getUnbooked
());
walletpg
.
setUnbooked
(
walletpg
.
getUnbooked
()
==
null
?
new
BigDecimal
(
0
)
:
walletpg
.
getUnbooked
());
walletpg
.
setTotalAmount
(
walletpg
.
getTodayAmount
()
==
null
?
new
BigDecimal
(
0
)
:
walletpg
.
getTotalAmount
());
walletpg
.
setTotalAmount
(
walletpg
.
getTodayAmount
()
==
null
?
new
BigDecimal
(
0
)
:
walletpg
.
getTotalAmount
());
walletpg
.
setTotalConsumption
(
totalConsumpution
);
walletpg
.
setTotalConsumption
(
totalConsumpution
);
AppUserDetail
appUserDetail
=
userdetailMap
.
get
(
wallet
.
getUserId
());
if
(
Objects
.
nonNull
(
appUserDetail
)){
WalletPostionVo
walletPostionVo
=
postionMap
.
get
(
appUserDetail
.
getPositionId
());
if
(
Objects
.
nonNull
(
walletPostionVo
)){
walletpg
.
setCommissionRate
(
walletPostionVo
.
getExtract
());
}
}
walletPageVos
.
add
(
walletpg
);
walletPageVos
.
add
(
walletpg
);
}
}
walletPageVos
.
sort
(
Comparator
.
comparing
(
WalletPageVo:
:
getTotalAmount
).
reversed
());
walletPageVos
.
sort
(
Comparator
.
comparing
(
WalletPageVo:
:
getTotalAmount
).
reversed
());
walletPageVo
.
setPageNum
(
walletFindDTO
.
getPage
());
walletPageVo
.
setPageNum
(
walletFindDTO
.
getPage
());
walletPageVo
.
setPageSize
(
walletFindDTO
.
getLimit
());
walletPageVo
.
setPageSize
(
walletFindDTO
.
getLimit
());
...
@@ -317,29 +329,10 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
...
@@ -317,29 +329,10 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
if
((
realAmount
.
add
(
commission
)).
compareTo
(
balnece
)
>
0
)
{
if
((
realAmount
.
add
(
commission
)).
compareTo
(
balnece
)
>
0
)
{
realAmount
=
balnece
.
subtract
(
commission
);
realAmount
=
balnece
.
subtract
(
commission
);
}
}
//提现单号
//提现单号
String
orderNo
=
snowflake
.
nextIdStr
();
String
orderNo
=
snowflake
.
nextIdStr
();
orderNo
=
String
.
format
(
"%s%s"
,
dateTimeFormatter
.
format
(
LocalDate
.
now
()),
orderNo
);
orderNo
=
String
.
format
(
"%s%s"
,
dateTimeFormatter
.
format
(
LocalDate
.
now
()),
orderNo
);
log
.
info
(
"-----提现申请-----proceduReates==="
+
sumDto
.
getProceduReates
()
+
"----commission===="
+
commission
+
"---realAmount==="
+
realAmount
);
log
.
info
(
"-----提现申请-----proceduReates==="
+
sumDto
.
getProceduReates
()
+
"----commission===="
+
commission
+
"---realAmount==="
+
realAmount
);
//线上自动提现
if
(
WITHDRAW_ONLINE_WAY
.
equals
(
withdrawWay
))
{
HttpServletRequest
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
String
host
=
StringUtils
.
defaultIfBlank
(
request
.
getHeader
(
"userHost"
),
ClientUtil
.
getClientIp
(
request
));
FundPayVo
fundPayVo
=
FundPayVo
.
builder
()
.
amount
(
applyCathVo
.
getCathType
()
==
0
?
String
.
valueOf
(
realAmount
.
multiply
(
new
BigDecimal
(
100
)).
doubleValue
())
:
String
.
format
(
"%.2f"
,
realAmount
.
doubleValue
()))
.
orderNo
(
orderNo
)
.
payeeAccount
(
applyCathVo
.
getAccountNumber
())
.
payerShowName
(
"欣新房车网络科技(广东)股份有限公司"
)
.
remark
(
"提现转账"
)
.
type
(
applyCathVo
.
getCathType
())
.
creatIp
(
host
)
.
build
();
//发送提现申请
sendPayMessage
(
fundPayVo
);
}
walletCath
.
setCrtTime
(
Instant
.
now
().
toEpochMilli
());
walletCath
.
setCrtTime
(
Instant
.
now
().
toEpochMilli
());
walletCath
.
setOrderNo
(
orderNo
);
walletCath
.
setOrderNo
(
orderNo
);
walletCath
.
setStauts
(
WithDrawStatusEnum
.
AUDIT
.
getCode
());
walletCath
.
setStauts
(
WithDrawStatusEnum
.
AUDIT
.
getCode
());
...
@@ -363,6 +356,22 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
...
@@ -363,6 +356,22 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
myWallet
.
setWithdrawals
(
withdrawals
);
myWallet
.
setWithdrawals
(
withdrawals
);
myWallet
.
setVersion
(
sumDto
.
getVersion
());
myWallet
.
setVersion
(
sumDto
.
getVersion
());
mapper
.
updMyWater
(
myWallet
);
mapper
.
updMyWater
(
myWallet
);
//线上自动提现
if
(
WITHDRAW_ONLINE_WAY
.
equals
(
withdrawWay
))
{
HttpServletRequest
request
=
((
ServletRequestAttributes
)
RequestContextHolder
.
getRequestAttributes
()).
getRequest
();
String
host
=
StringUtils
.
defaultIfBlank
(
request
.
getHeader
(
"userHost"
),
ClientUtil
.
getClientIp
(
request
));
FundPayVo
fundPayVo
=
FundPayVo
.
builder
()
.
amount
(
applyCathVo
.
getCathType
()
==
0
?
String
.
valueOf
(
realAmount
.
multiply
(
new
BigDecimal
(
100
)).
doubleValue
())
:
String
.
format
(
"%.2f"
,
realAmount
.
doubleValue
()))
.
orderNo
(
orderNo
)
.
payeeAccount
(
applyCathVo
.
getAccountNumber
())
.
payerShowName
(
"欣新房车网络科技(广东)股份有限公司"
)
.
remark
(
"提现转账"
)
.
type
(
applyCathVo
.
getCathType
())
.
creatIp
(
host
)
.
build
();
//发送提现申请
sendPayMessage
(
fundPayVo
);
}
return
ObjectRestResponse
.
succ
(
walletCath
.
getId
());
return
ObjectRestResponse
.
succ
(
walletCath
.
getId
());
}
}
...
@@ -511,4 +520,7 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
...
@@ -511,4 +520,7 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> implements In
}
}
public
void
forbiddenWalletById
(
Integer
id
,
Integer
state
)
{
mapper
.
forbiddenWalletById
(
id
,
state
);
}
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/MyWalletCathBiz.java
View file @
c3118259
...
@@ -101,7 +101,12 @@ public class MyWalletCathBiz extends BaseBiz<MyWalletCathMapper, MyWalletCath> {
...
@@ -101,7 +101,12 @@ public class MyWalletCathBiz extends BaseBiz<MyWalletCathMapper, MyWalletCath> {
PageDataVO
<
WalletCathListDTO
>
walletCathListDTOPage
=
PageDataVO
.
pageInfo
(
walletCathFindDTO
.
getPage
(),
PageDataVO
<
WalletCathListDTO
>
walletCathListDTOPage
=
PageDataVO
.
pageInfo
(
walletCathFindDTO
.
getPage
(),
walletCathFindDTO
.
getLimit
(),
walletCathFindDTO
.
getLimit
(),
()
->
mapper
.
selectByUserNameOrPhoneOrWithDrawSate
(
walletCathFindDTO
.
getUsername
(),
walletCathFindDTO
.
getPhone
(),
walletCathFindDTO
.
getState
()));
()
->
mapper
.
selectByUserNameOrPhoneOrWithDrawSate
(
walletCathFindDTO
.
getUsername
(),
walletCathFindDTO
.
getPhone
(),
walletCathFindDTO
.
getState
(),
walletCathFindDTO
.
getOrderNo
(),
walletCathFindDTO
.
getStartTime
(),
walletCathFindDTO
.
getEndTime
()));
List
<
WalletCathListDTO
>
walletCathListDTOList
=
walletCathListDTOPage
.
getData
();
List
<
WalletCathListDTO
>
walletCathListDTOList
=
walletCathListDTOPage
.
getData
();
if
(
CollectionUtils
.
isEmpty
(
walletCathListDTOList
))
{
if
(
CollectionUtils
.
isEmpty
(
walletCathListDTOList
))
{
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/MyWalletDetailBiz.java
View file @
c3118259
...
@@ -71,7 +71,11 @@ public class MyWalletDetailBiz extends BaseBiz<MyWalletDetailMapper, MyWalletDet
...
@@ -71,7 +71,11 @@ public class MyWalletDetailBiz extends BaseBiz<MyWalletDetailMapper, MyWalletDet
PageDataVO
<
WalletDetailListDTO
>
walletDetailPage
=
PageDataVO
.
pageInfo
(
walletDetailFindDTO
.
getPage
(),
PageDataVO
<
WalletDetailListDTO
>
walletDetailPage
=
PageDataVO
.
pageInfo
(
walletDetailFindDTO
.
getPage
(),
walletDetailFindDTO
.
getLimit
(),
walletDetailFindDTO
.
getLimit
(),
()->
mapper
.
findWalletDetailsByUserNameOrPhoneOrsourceType
(
walletDetailFindDTO
.
getUsername
(),
walletDetailFindDTO
.
getPhone
(),
walletDetailFindDTO
.
getSource
()));
()->
mapper
.
findWalletDetailsByUserNameOrPhoneOrsourceType
(
walletDetailFindDTO
.
getUsername
(),
walletDetailFindDTO
.
getPhone
(),
walletDetailFindDTO
.
getSource
(),
walletDetailFindDTO
.
getStartTime
(),
walletDetailFindDTO
.
getEndTime
()));
List
<
WalletDetailListDTO
>
detailListDTOS
=
walletDetailPage
.
getData
();
List
<
WalletDetailListDTO
>
detailListDTOS
=
walletDetailPage
.
getData
();
if
(
CollectionUtils
.
isEmpty
(
detailListDTOS
)){
if
(
CollectionUtils
.
isEmpty
(
detailListDTOS
)){
return
pageDataVO
;
return
pageDataVO
;
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/AppUserSellingWaterMapper.java
View file @
c3118259
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
mapper
;
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
mapper
;
import
com.github.wxiaoqi.security.admin.bo.UserIncomeBo
;
import
com.github.wxiaoqi.security.admin.bo.UserIncomeBo
;
import
com.github.wxiaoqi.security.admin.dto.UserSellingWaterAdminDTO
;
import
com.github.wxiaoqi.security.admin.dto.UserSellingWaterFindDTO
;
import
com.github.wxiaoqi.security.admin.entity.AppUserSellingWater
;
import
com.github.wxiaoqi.security.admin.entity.AppUserSellingWater
;
import
com.github.wxiaoqi.security.admin.vo.SellingWalletVo
;
import
com.github.wxiaoqi.security.admin.vo.SellingWalletVo
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
...
@@ -23,4 +25,6 @@ public interface AppUserSellingWaterMapper extends Mapper<AppUserSellingWater> {
...
@@ -23,4 +25,6 @@ public interface AppUserSellingWaterMapper extends Mapper<AppUserSellingWater> {
BigDecimal
selectTotalIncomeByUserId
(
@Param
(
"userId"
)
Integer
userId
);
BigDecimal
selectTotalIncomeByUserId
(
@Param
(
"userId"
)
Integer
userId
);
List
<
SellingWalletVo
>
selectSellerWalterByUserIdAndWating
(
@Param
(
"userId"
)
Integer
userId
,
@Param
(
"wating"
)
Integer
wating
);
List
<
SellingWalletVo
>
selectSellerWalterByUserIdAndWating
(
@Param
(
"userId"
)
Integer
userId
,
@Param
(
"wating"
)
Integer
wating
);
List
<
UserSellingWaterAdminDTO
>
selectSellingWaterPage
(
UserSellingWaterFindDTO
userSellingWaterFindDTO
);
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/MyWalletCathMapper.java
View file @
c3118259
...
@@ -19,7 +19,10 @@ public interface MyWalletCathMapper extends Mapper<MyWalletCath> {
...
@@ -19,7 +19,10 @@ public interface MyWalletCathMapper extends Mapper<MyWalletCath> {
List
<
WalletCathListDTO
>
selectByUserNameOrPhoneOrWithDrawSate
(
@Param
(
"userName"
)
String
userName
,
List
<
WalletCathListDTO
>
selectByUserNameOrPhoneOrWithDrawSate
(
@Param
(
"userName"
)
String
userName
,
@Param
(
"phone"
)
String
phone
,
@Param
(
"phone"
)
String
phone
,
@Param
(
"state"
)
Integer
state
);
@Param
(
"state"
)
Integer
state
,
@Param
(
"orderNo"
)
String
orderNo
,
@Param
(
"startTime"
)
Long
startTime
,
@Param
(
"endTime"
)
Long
endTime
);
List
<
PersonalConsumptionDTO
>
findUserWithDrawingByUserIds
(
@Param
(
"userIds"
)
List
<
Integer
>
userIds
);
List
<
PersonalConsumptionDTO
>
findUserWithDrawingByUserIds
(
@Param
(
"userIds"
)
List
<
Integer
>
userIds
);
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/MyWalletDetailMapper.java
View file @
c3118259
...
@@ -17,7 +17,11 @@ import java.util.List;
...
@@ -17,7 +17,11 @@ import java.util.List;
*/
*/
public
interface
MyWalletDetailMapper
extends
Mapper
<
MyWalletDetail
>
{
public
interface
MyWalletDetailMapper
extends
Mapper
<
MyWalletDetail
>
{
List
<
WalletDetailListDTO
>
findWalletDetailsByUserNameOrPhoneOrsourceType
(
@Param
(
"userName"
)
String
userName
,
@Param
(
"phone"
)
String
phone
,
@Param
(
"sourceType"
)
Integer
sourceType
);
List
<
WalletDetailListDTO
>
findWalletDetailsByUserNameOrPhoneOrsourceType
(
@Param
(
"userName"
)
String
userName
,
@Param
(
"phone"
)
String
phone
,
@Param
(
"sourceType"
)
Integer
sourceType
,
@Param
(
"startTime"
)
Long
starTime
,
@Param
(
"endTime"
)
Long
endTime
);
List
<
PersonalConsumptionDTO
>
findpersonalConsumptionsByUserIds
(
@Param
(
"userIds"
)
List
<
Integer
>
userIds
);
List
<
PersonalConsumptionDTO
>
findpersonalConsumptionsByUserIds
(
@Param
(
"userIds"
)
List
<
Integer
>
userIds
);
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/MyWalletMapper.java
View file @
c3118259
...
@@ -3,6 +3,7 @@ package com.github.wxiaoqi.security.admin.mapper;
...
@@ -3,6 +3,7 @@ package com.github.wxiaoqi.security.admin.mapper;
import
com.github.wxiaoqi.security.admin.dto.WalletListDTO
;
import
com.github.wxiaoqi.security.admin.dto.WalletListDTO
;
import
com.github.wxiaoqi.security.admin.entity.MyWallet
;
import
com.github.wxiaoqi.security.admin.entity.MyWallet
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Update
;
import
tk.mybatis.mapper.common.Mapper
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
import
java.util.List
;
...
@@ -19,4 +20,13 @@ public interface MyWalletMapper extends Mapper<MyWallet> {
...
@@ -19,4 +20,13 @@ public interface MyWalletMapper extends Mapper<MyWallet> {
void
updMyWater
(
MyWallet
myWallet
);
void
updMyWater
(
MyWallet
myWallet
);
List
<
WalletListDTO
>
selectByPhoneOrUserName
(
@Param
(
"phone"
)
String
phone
,
@Param
(
"username"
)
String
username
);
List
<
WalletListDTO
>
selectByPhoneOrUserName
(
@Param
(
"phone"
)
String
phone
,
@Param
(
"username"
)
String
username
);
/**
* 禁用或解除 状态
* @param id
* @param state
*/
@Update
(
"UPDATE `my_wallet` SET `is_frozen`=#{state} WHERE `id`=#{id}"
)
void
forbiddenWalletById
(
@Param
(
"id"
)
Integer
id
,
@Param
(
"state"
)
Integer
state
);
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/admin/MyWalletAdminController.java
View file @
c3118259
...
@@ -7,9 +7,7 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
...
@@ -7,9 +7,7 @@ import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
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.*
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
/**
* @author libin
* @author libin
...
@@ -30,4 +28,11 @@ public class MyWalletAdminController {
...
@@ -30,4 +28,11 @@ public class MyWalletAdminController {
PageDataVO
<
WalletPageVo
>
walletPage
=
myWalletBiz
.
listWalletWithPage
(
walletFindDTO
);
PageDataVO
<
WalletPageVo
>
walletPage
=
myWalletBiz
.
listWalletWithPage
(
walletFindDTO
);
return
ObjectRestResponse
.
succ
(
walletPage
);
return
ObjectRestResponse
.
succ
(
walletPage
);
}
}
@PutMapping
(
"/forbidden"
)
public
ObjectRestResponse
<
Void
>
forbiddenWallet
(
@RequestParam
(
value
=
"id"
)
Integer
id
,
@RequestParam
(
value
=
"state"
)
Integer
state
){
myWalletBiz
.
forbiddenWalletById
(
id
,
state
);
return
ObjectRestResponse
.
succ
();
}
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/admin/UserSellingWaterAdminController.java
0 → 100644
View file @
c3118259
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rest
.
admin
;
import
com.github.wxiaoqi.security.admin.biz.AppUserSellingWaterBiz
;
import
com.github.wxiaoqi.security.admin.dto.UserSellingWaterAdminDTO
;
import
com.github.wxiaoqi.security.admin.dto.UserSellingWaterFindDTO
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/10/21 10:10
*/
@RestController
@RequestMapping
(
"/sellingwater/admin"
)
@RequiredArgsConstructor
(
onConstructor
=
@__
(
@Autowired
))
public
class
UserSellingWaterAdminController
{
private
final
AppUserSellingWaterBiz
appUserSellingWaterBiz
;
@PostMapping
(
"/page"
)
public
ObjectRestResponse
<
PageDataVO
<
UserSellingWaterAdminDTO
>>
findSellingWaterWithPage
(
@RequestBody
UserSellingWaterFindDTO
userSellingWaterFindDTO
){
PageDataVO
<
UserSellingWaterAdminDTO
>
pageDataVO
=
appUserSellingWaterBiz
.
findSellingWaterWithPage
(
userSellingWaterFindDTO
);
return
ObjectRestResponse
.
succ
(
pageDataVO
);
}
}
ace-modules/ace-admin/src/main/resources/mapper/AppUserSellingWaterMapper.xml
View file @
c3118259
...
@@ -84,4 +84,43 @@ FROM
...
@@ -84,4 +84,43 @@ FROM
</if>
</if>
ORDER BY `crt_time`
ORDER BY `crt_time`
</select>
</select>
<select
id=
"selectSellingWaterPage"
resultType=
"com.github.wxiaoqi.security.admin.dto.UserSellingWaterAdminDTO"
>
SELECT
ausw.*,
aul.username AS `phone`,
IFNULL(aud.realname,aud.nickname) AS `sourceName`,
IFNULL(audd.realname,audd.nickname) AS `userName`
FROM
( SELECT * FROM `app_user_selling_water` WHERE 1 = 1
<if
test=
"status !=null"
>
AND `status`=#{status}
</if>
<if
test=
"waiting !=null"
>
AND `waiting`=#{waiting}
</if>
<if
test=
"startTime !=null and endTime !=null"
>
AND `crt_time` BETWEEN #{startTime} AND #{endTime}
</if>
<if
test=
"startTime !=null and endTime ==null"
>
AND
<![CDATA[
`crt_time` >
= #{startTime}
]]>
</if>
<if
test=
"endTime !=null and startTime ==null "
>
AND
<![CDATA[
`crt_time` <= #{endTime}
]]>
</if>
) AS `ausw`
INNER JOIN ( SELECT * FROM `app_user_login`
<if
test=
"phone!=null and phone!=' '"
>
WHERE `username` = #{phone}
</if>
) AS aul ON aul.id = ausw.user_id
INNER JOIN `app_user_detail` AS aud ON aud.userid = ausw.source_id
INNER JOIN ( SELECT * FROM `app_user_detail`
<if
test=
"userName!=null and userName!=' '"
>
WHERE `realname` LIKE CONCAT('%',#{userName},'%') OR `nickname` LIKE CONCAT('%',#{userName},'%')
</if>
) AS audd ON audd.userid = ausw.user_id
</select>
</mapper>
</mapper>
\ No newline at end of file
ace-modules/ace-admin/src/main/resources/mapper/MyWalletCathMapper.xml
View file @
c3118259
...
@@ -3,7 +3,8 @@
...
@@ -3,7 +3,8 @@
<mapper
namespace=
"com.github.wxiaoqi.security.admin.mapper.MyWalletCathMapper"
>
<mapper
namespace=
"com.github.wxiaoqi.security.admin.mapper.MyWalletCathMapper"
>
<select
id=
"selectByUserNameOrPhoneOrWithDrawSate"
resultType=
"com.github.wxiaoqi.security.admin.dto.WalletCathListDTO"
>
<select
id=
"selectByUserNameOrPhoneOrWithDrawSate"
resultType=
"com.github.wxiaoqi.security.admin.dto.WalletCathListDTO"
>
SELECT
SELECT
wc.id,
wc.id,
aud.nickname,
aud.nickname,
...
@@ -19,9 +20,28 @@
...
@@ -19,9 +20,28 @@
wc.account_number AS `accountNumber`,
wc.account_number AS `accountNumber`,
wc.account_name AS `accountName`
wc.account_name AS `accountName`
FROM
FROM
(SELECT * FROM `my_wallet_cath`
<if
test=
"state != null"
>
(SELECT * FROM `my_wallet_cath` WHERE 1 = 1
WHERE `stauts`=#{state}
<if
test=
"state != null"
>
</if>
) AS `wc`
AND `stauts`=#{state}
i
</if>
<if
test=
"orderNo"
>
AND `order_no` = #{orderNo}
</if>
<if
test=
"startTime !=null and endTime !=null"
>
AND `crt_time` BETWEEN #{startTime} AND #{endTime}
</if>
<if
test=
"startTime !=null and endTime ==null"
>
AND
<![CDATA[
`crt_time` >
= #{startTime}
]]>
</if>
<if
test=
"endTime !=null and startTime ==null "
>
AND
<![CDATA[
`crt_time` <= #{endTime}
]]>
</if>
) AS `wc`
INNER JOIN ( SELECT `id`, `username` FROM `app_user_login`
<if
test=
"phone != null and phone != ''"
>
INNER JOIN ( SELECT `id`, `username` FROM `app_user_login`
<if
test=
"phone != null and phone != ''"
>
WHERE `username`=#{phone}
WHERE `username`=#{phone}
</if>
) AS `aul` ON aul.id = wc.user_id
</if>
) AS `aul` ON aul.id = wc.user_id
...
@@ -32,7 +52,8 @@
...
@@ -32,7 +52,8 @@
</select>
</select>
<select
id=
"findUserWithDrawingByUserIds"
resultType=
"com.github.wxiaoqi.security.admin.dto.PersonalConsumptionDTO"
>
<select
id=
"findUserWithDrawingByUserIds"
resultType=
"com.github.wxiaoqi.security.admin.dto.PersonalConsumptionDTO"
>
select `user_id` AS `userId`,SUM(amount) AS `totalConsumption` from `my_wallet_cath` where `stauts`=0 AND `user_id` in
select `user_id` AS `userId`,SUM(amount) AS `totalConsumption` from `my_wallet_cath` where `stauts`=0 AND
`user_id` in
<foreach
collection=
"userIds"
item=
"userId"
open=
"("
close=
")"
separator=
","
>
<foreach
collection=
"userIds"
item=
"userId"
open=
"("
close=
")"
separator=
","
>
#{userId}
#{userId}
</foreach>
</foreach>
...
@@ -46,10 +67,10 @@
...
@@ -46,10 +67,10 @@
<choose>
<choose>
<when
test=
"type ==1 "
>
<when
test=
"type ==1 "
>
AND date_format(from_unixtime(crt_time/1000),'%Y-%m-%d') = date_format(now(),'%Y-%m-%d')
AND date_format(from_unixtime(crt_time/1000),'%Y-%m-%d') = date_format(now(),'%Y-%m-%d')
</when
>
</when>
<when
test=
"type==2 "
>
<when
test=
"type==2 "
>
AND date_format(from_unixtime(crt_time/1000),'%Y-%m') = date_format(now(),'%Y-%m')
AND date_format(from_unixtime(crt_time/1000),'%Y-%m') = date_format(now(),'%Y-%m')
</when
>
</when>
<otherwise>
<otherwise>
</otherwise>
</otherwise>
</choose>
</choose>
...
...
ace-modules/ace-admin/src/main/resources/mapper/MyWalletDetailMapper.xml
View file @
c3118259
...
@@ -2,7 +2,8 @@
...
@@ -2,7 +2,8 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.github.wxiaoqi.security.admin.mapper.MyWalletDetailMapper"
>
<mapper
namespace=
"com.github.wxiaoqi.security.admin.mapper.MyWalletDetailMapper"
>
<select
id=
"findWalletDetailsByUserNameOrPhoneOrsourceType"
resultType=
"com.github.wxiaoqi.security.admin.dto.WalletDetailListDTO"
>
<select
id=
"findWalletDetailsByUserNameOrPhoneOrsourceType"
resultType=
"com.github.wxiaoqi.security.admin.dto.WalletDetailListDTO"
>
SELECT
SELECT
wd.id,
wd.id,
wd.source,
wd.source,
...
@@ -15,31 +16,52 @@
...
@@ -15,31 +16,52 @@
wd.crt_time AS `crtTime`,
wd.crt_time AS `crtTime`,
aul.username AS `phone`,
aul.username AS `phone`,
aud.nickname,
aud.nickname,
aud.realname
,
aud.realname
<!--
,
ausw.price,
ausw.price,
ausw.extract,
ausw.extract,
ausw.waiting,
ausw.waiting,
ausw.title
ausw.title-->
FROM
FROM
(select id,user_id,source,amount,`with_draw_order_no`,cono,itype,activity_id,activity_name,`crt_time` FROM `my_wallet_detail`
<if
test=
"sourceType != null"
>
(select id,user_id,source,amount,`with_draw_order_no`,cono,itype,activity_id,activity_name,`crt_time` FROM
WHERE `source`=#{sourceType}
`my_wallet_detail` WHERE 1=1
</if>
) AS `wd`
<if
test=
"sourceType != null"
>
AND `source`=#{sourceType}
</if>
<if
test=
"startTime !=null and endTime !=null"
>
AND `crt_time` BETWEEN #{startTime} AND #{endTime}
</if>
<if
test=
"startTime !=null and endTime ==null"
>
AND
<![CDATA[
`crt_time` >
= #{startTime}
]]>
</if>
<if
test=
"endTime !=null and startTime ==null "
>
AND
<![CDATA[
`crt_time` <= #{endTime}
]]>
</if>
) AS `wd`
INNER JOIN (SELECT id,username FROM `app_user_login`
<if
test=
"phone != null and phone != ''"
>
INNER JOIN (SELECT id,username FROM `app_user_login`
<if
test=
"phone != null and phone != ''"
>
WHERE `username`=#{phone}
WHERE `username`=#{phone}
</if>
) AS `aul` ON aul.id = wd.user_id
</if>
) AS `aul` ON aul.id = wd.user_id
INNER JOIN (SELECT userid,nickname,realname FROM `app_user_detail`
<if
test=
"userName != null and userName != ''"
>
INNER JOIN (SELECT userid,nickname,realname FROM `app_user_detail`
<if
test=
"userName != null and userName != ''"
>
WHERE `nickname`=#{userName} OR `realname`=#{userName}
WHERE `nickname`=#{userName} OR `realname`=#{userName}
</if>
) AS `aud` ON aud.userid = aul.id
</if>
) AS `aud` ON aud.userid = aul.id
LEFT JOIN (SELECT DISTINCT order_id,id,price,extract,waiting,title FROM `app_user_selling_water`) AS `ausw` ON ausw.order_id = wd.cono
<!-- LEFT JOIN (SELECT DISTINCT order_id,id,price,extract,waiting,title FROM `app_user_selling_water`) AS `ausw` ON
ausw.order_id = wd.cono-->
ORDER BY `crtTime` DESC
ORDER BY `crtTime` DESC
</select>
</select>
<select
id=
"findpersonalConsumptionsByUserIds"
resultType=
"com.github.wxiaoqi.security.admin.dto.PersonalConsumptionDTO"
>
<select
id=
"findpersonalConsumptionsByUserIds"
select `user_id` AS `userId`,SUM(amount) AS `totalConsumption` FROM my_wallet_cath
<if
test=
"userIds != null and userIds.size() != 0"
>
resultType=
"com.github.wxiaoqi.security.admin.dto.PersonalConsumptionDTO"
>
select `user_id` AS `userId`,SUM(amount) AS `totalConsumption` FROM my_wallet_cath
<if
test=
"userIds != null and userIds.size() != 0"
>
WHERE `user_id` IN
WHERE `user_id` IN
<foreach
collection=
"userIds"
item=
"userId"
open=
"("
close=
")"
separator=
","
>
<foreach
collection=
"userIds"
item=
"userId"
open=
"("
close=
")"
separator=
","
>
#{userId}
#{userId}
</foreach>
</foreach>
</if>
GROUP BY user_id;
</if>
GROUP BY user_id;
</select>
</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