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
78862201
Commit
78862201
authored
Jul 18, 2019
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/base-modify' into base-modify
parents
992e58c3
d3fbdc7c
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
304 additions
and
42 deletions
+304
-42
AuthController.java
...thub/wxiaoqi/security/auth/controller/AuthController.java
+3
-2
PersonalConsumptionDTO.java
...ub/wxiaoqi/security/admin/dto/PersonalConsumptionDTO.java
+17
-0
WalletCathFindDTO.java
.../github/wxiaoqi/security/admin/dto/WalletCathFindDTO.java
+1
-1
WalletDetailFindDTO.java
...ithub/wxiaoqi/security/admin/dto/WalletDetailFindDTO.java
+20
-0
WalletDetailListDTO.java
...ithub/wxiaoqi/security/admin/dto/WalletDetailListDTO.java
+13
-15
WalletDetailAdminVo.java
...github/wxiaoqi/security/admin/vo/WalletDetailAdminVo.java
+52
-0
WalletPageVo.java
...va/com/github/wxiaoqi/security/admin/vo/WalletPageVo.java
+4
-1
MyWalletBiz.java
...va/com/github/wxiaoqi/security/admin/biz/MyWalletBiz.java
+14
-3
MyWalletCathBiz.java
...om/github/wxiaoqi/security/admin/biz/MyWalletCathBiz.java
+2
-1
MyWalletDetailBiz.java
.../github/wxiaoqi/security/admin/biz/MyWalletDetailBiz.java
+41
-0
MyWalletCathMapper.java
...hub/wxiaoqi/security/admin/mapper/MyWalletCathMapper.java
+1
-0
MyWalletDetailMapper.java
...b/wxiaoqi/security/admin/mapper/MyWalletDetailMapper.java
+9
-1
WalletDetailAdminController.java
...ecurity/admin/rest/admin/WalletDetailAdminController.java
+31
-0
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+1
-1
MyWalletCathMapper.xml
...ce-admin/src/main/resources/mapper/MyWalletCathMapper.xml
+3
-3
MyWalletDetailMapper.xml
...-admin/src/main/resources/mapper/MyWalletDetailMapper.xml
+42
-0
ActivityFeign.java
.../java/com/xxfc/platform/activity/feign/ActivityFeign.java
+2
-2
UserCouponBiz.java
...in/java/com/xxfc/platform/activity/biz/UserCouponBiz.java
+28
-5
UserCouponMapper.java
...a/com/xxfc/platform/activity/mapper/UserCouponMapper.java
+1
-1
UserCouponController.java
...com/xxfc/platform/activity/rest/UserCouponController.java
+16
-6
UserCouponMapper.xml
...ity-server/src/main/resources/mapper/UserCouponMapper.xml
+3
-0
No files found.
ace-auth/ace-auth-server/src/main/java/com/github/wxiaoqi/security/auth/controller/AuthController.java
View file @
78862201
...
@@ -9,6 +9,7 @@ import com.github.wxiaoqi.security.common.util.ClientUtil;
...
@@ -9,6 +9,7 @@ import com.github.wxiaoqi.security.common.util.ClientUtil;
import
com.github.wxiaoqi.security.common.util.EntityUtils
;
import
com.github.wxiaoqi.security.common.util.EntityUtils
;
import
com.github.wxiaoqi.security.common.util.IpUtil
;
import
com.github.wxiaoqi.security.common.util.IpUtil
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.result.JsonResultUtil
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -217,8 +218,8 @@ public class AuthController {
...
@@ -217,8 +218,8 @@ public class AuthController {
}
}
@PostMapping
(
"/imi/login"
)
@PostMapping
(
"/imi/login"
)
public
String
loginImiWithToken
(){
public
JSONObject
loginImiWithToken
(){
return
authService
.
loginImiWithToken
(
);
return
JsonResultUtil
.
createSuccessResultWithObj
(
authService
.
loginImiWithToken
()
);
}
}
}
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/PersonalConsumptionDTO.java
0 → 100644
View file @
78862201
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
dto
;
import
lombok.Data
;
import
java.math.BigDecimal
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/18 15:59
*/
@Data
public
class
PersonalConsumptionDTO
{
private
Integer
userId
;
private
BigDecimal
totalConsumption
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/WalletCathFindDTO.java
View file @
78862201
...
@@ -12,7 +12,7 @@ import lombok.Data;
...
@@ -12,7 +12,7 @@ import lombok.Data;
@Data
@Data
public
class
WalletCathFindDTO
extends
PageParam
{
public
class
WalletCathFindDTO
extends
PageParam
{
private
String
user
N
ame
;
private
String
user
n
ame
;
private
String
phone
;
private
String
phone
;
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/WalletDetailFindDTO.java
0 → 100644
View file @
78862201
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/7/18 11:12
*/
@Data
public
class
WalletDetailFindDTO
extends
PageParam
{
private
String
username
;
private
String
phone
;
private
Integer
source
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/WalletDetailListDTO.java
View file @
78862201
...
@@ -25,25 +25,28 @@ public class WalletDetailListDTO {
...
@@ -25,25 +25,28 @@ public class WalletDetailListDTO {
private
String
phone
;
private
String
phone
;
@ApiModelProperty
(
value
=
"来源:0-活动,1-佣金,2-会员充值,10-提现,11-转账,12-购买"
)
@ApiModelProperty
(
value
=
"来源:0-活动,1-佣金,2-会员充值,10-提现,11-转账,12-购买"
)
private
Integer
source
Type
;
private
Integer
source
;
@ApiModelProperty
(
"
活动名称或
佣金商品名称"
)
@ApiModelProperty
(
"佣金商品名称"
)
private
String
sourc
e
;
private
String
titl
e
;
@ApiModelProperty
(
value
=
"收入/支出:0-收入,1-支出
"
)
@ApiModelProperty
(
"商品价格
"
)
private
Integer
ityp
e
;
private
BigDecimal
pric
e
;
@ApiModelProperty
(
value
=
"收入/支出的金额(分)
"
)
@ApiModelProperty
(
"提成比例
"
)
private
BigDecimal
amoun
t
;
private
Integer
extrac
t
;
@ApiModelProperty
(
"入帐状态"
)
private
Integer
waiting
;
@ApiModelProperty
(
value
=
"活动类型"
)
@ApiModelProperty
(
value
=
"收入/支出的金额(分)"
)
private
Integer
type
;
private
BigDecimal
amount
;
@ApiModelProperty
(
value
=
"活动id"
)
@ApiModelProperty
(
value
=
"活动id"
)
private
Integer
activityId
;
private
Integer
activityId
;
@ApiModelProperty
(
value
=
"0 收入 1 支出"
)
private
Integer
itype
;
@ApiModelProperty
(
"活动名称"
)
@ApiModelProperty
(
"活动名称"
)
private
String
activityName
;
private
String
activityName
;
...
@@ -52,11 +55,6 @@ public class WalletDetailListDTO {
...
@@ -52,11 +55,6 @@ public class WalletDetailListDTO {
@ApiModelProperty
(
value
=
"单号"
)
@ApiModelProperty
(
value
=
"单号"
)
private
Integer
cono
;
private
Integer
cono
;
@ApiModelProperty
(
value
=
"加上当时的收入的余额"
)
private
BigDecimal
balance
;
@ApiModelProperty
(
value
=
"操作时间"
,
hidden
=
true
)
@ApiModelProperty
(
value
=
"操作时间"
,
hidden
=
true
)
private
Long
crtTime
;
private
Long
crtTime
;
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/WalletDetailAdminVo.java
0 → 100644
View file @
78862201
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/18 10:50
*/
@Data
public
class
WalletDetailAdminVo
{
private
Integer
id
;
private
String
username
;
private
String
phone
;
@ApiModelProperty
(
value
=
"来源:0-活动,1-佣金,2-会员充值,10-提现,11-转账,12-购买"
)
private
Integer
source
;
@ApiModelProperty
(
"佣金商品名称"
)
private
String
title
;
@ApiModelProperty
(
"商品价格"
)
private
BigDecimal
price
;
@ApiModelProperty
(
"提成比例"
)
private
Integer
extract
;
@ApiModelProperty
(
"入帐状态"
)
private
Integer
waiting
;
@ApiModelProperty
(
value
=
"收入/支出的金额(分)"
)
private
BigDecimal
amount
;
@ApiModelProperty
(
value
=
"0收入 1支出"
)
private
Integer
itype
;
@ApiModelProperty
(
"活动名称"
)
private
String
activityName
;
@ApiModelProperty
(
value
=
"单号"
)
private
Integer
cono
;
@ApiModelProperty
(
value
=
"操作时间"
,
hidden
=
true
)
private
Long
crtTime
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/WalletPageVo.java
View file @
78862201
...
@@ -30,12 +30,15 @@ public class WalletPageVo {
...
@@ -30,12 +30,15 @@ public class WalletPageVo {
@ApiModelProperty
(
value
=
"已提现金额"
)
@ApiModelProperty
(
value
=
"已提现金额"
)
private
BigDecimal
withdrawals
;
private
BigDecimal
withdrawals
;
@ApiModelProperty
(
value
=
"总消费"
)
private
BigDecimal
totalConsumption
;
@ApiModelProperty
(
value
=
"进账总额(元)"
)
@ApiModelProperty
(
value
=
"进账总额(元)"
)
private
BigDecimal
totalAmount
;
private
BigDecimal
totalAmount
;
@ApiModelProperty
(
value
=
"
进账
总额(元)"
)
@ApiModelProperty
(
value
=
"
日收益
总额(元)"
)
private
BigDecimal
todayAmount
;
private
BigDecimal
todayAmount
;
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/MyWalletBiz.java
View file @
78862201
...
@@ -10,14 +10,15 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
...
@@ -10,14 +10,15 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.entity.Example
;
import
java.
util.ArrayList
;
import
java.
math.BigDecimal
;
import
java.util.
Comparator
;
import
java.util.
*
;
import
java.util.
List
;
import
java.util.
stream.Collectors
;
/**
/**
* @author libin
* @author libin
...
@@ -29,6 +30,8 @@ import java.util.List;
...
@@ -29,6 +30,8 @@ import java.util.List;
@Service
@Service
public
class
MyWalletBiz
extends
BaseBiz
<
MyWalletMapper
,
MyWallet
>
{
public
class
MyWalletBiz
extends
BaseBiz
<
MyWalletMapper
,
MyWallet
>
{
@Autowired
private
MyWalletDetailBiz
myWalletDetailBiz
;
public
AppletWalletVo
findMyWallet
(
Integer
userId
)
{
public
AppletWalletVo
findMyWallet
(
Integer
userId
)
{
...
@@ -62,6 +65,14 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> {
...
@@ -62,6 +65,14 @@ public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> {
walletpg
.
setPhone
(
wallet
.
getUsername
());
walletpg
.
setPhone
(
wallet
.
getUsername
());
walletPageVos
.
add
(
walletpg
);
walletPageVos
.
add
(
walletpg
);
}
}
List
<
Integer
>
userIds
=
wallets
.
stream
().
map
(
WalletListDTO:
:
getUserId
).
collect
(
Collectors
.
toList
());
Map
<
Integer
,
BigDecimal
>
userIdAndTotalConsumptionMap
=
myWalletDetailBiz
.
finduserIdAndPersonalTotalConsumptionMapByUserIds
(
userIds
);
Optional
.
ofNullable
(
userIdAndTotalConsumptionMap
).
ifPresent
(
x
->{
for
(
WalletPageVo
wtpg
:
walletPageVos
)
{
wtpg
.
setTotalConsumption
(
x
.
get
(
wtpg
.
getUserId
()));
}
});
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
());
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/MyWalletCathBiz.java
View file @
78862201
...
@@ -87,7 +87,7 @@ public class MyWalletCathBiz extends BaseBiz<MyWalletCathMapper, MyWalletCath> {
...
@@ -87,7 +87,7 @@ public class MyWalletCathBiz extends BaseBiz<MyWalletCathMapper, MyWalletCath> {
// List<WalletCathListDTO> walletCathListDTOS = mapper.selectByUserNameOrPhoneOrWithDrawSate(walletCathFindDTO.getUserName(), walletCathFindDTO.getPhone(), walletCathFindDTO.getState());
// List<WalletCathListDTO> walletCathListDTOS = mapper.selectByUserNameOrPhoneOrWithDrawSate(walletCathFindDTO.getUserName(), walletCathFindDTO.getPhone(), walletCathFindDTO.getState());
PageDataVO
<
WalletCathListDTO
>
walletCathListDTOPage
=
PageDataVO
.
pageInfo
(
walletCathFindDTO
.
getPage
(),
PageDataVO
<
WalletCathListDTO
>
walletCathListDTOPage
=
PageDataVO
.
pageInfo
(
walletCathFindDTO
.
getPage
(),
walletCathFindDTO
.
getLimit
(),
walletCathFindDTO
.
getLimit
(),
()
->
mapper
.
selectByUserNameOrPhoneOrWithDrawSate
(
walletCathFindDTO
.
getUser
N
ame
(),
walletCathFindDTO
.
getPhone
(),
walletCathFindDTO
.
getState
()));
()
->
mapper
.
selectByUserNameOrPhoneOrWithDrawSate
(
walletCathFindDTO
.
getUser
n
ame
(),
walletCathFindDTO
.
getPhone
(),
walletCathFindDTO
.
getState
()));
List
<
WalletCathListDTO
>
walletCathListDTOList
=
walletCathListDTOPage
.
getData
();
List
<
WalletCathListDTO
>
walletCathListDTOList
=
walletCathListDTOPage
.
getData
();
if
(
CollectionUtils
.
isEmpty
(
walletCathListDTOList
)){
if
(
CollectionUtils
.
isEmpty
(
walletCathListDTOList
)){
...
@@ -111,4 +111,5 @@ public class MyWalletCathBiz extends BaseBiz<MyWalletCathMapper, MyWalletCath> {
...
@@ -111,4 +111,5 @@ public class MyWalletCathBiz extends BaseBiz<MyWalletCathMapper, MyWalletCath> {
return
walletCathAdminVoPage
;
return
walletCathAdminVoPage
;
}
}
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/MyWalletDetailBiz.java
View file @
78862201
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
import
com.github.wxiaoqi.security.admin.dto.PersonalConsumptionDTO
;
import
com.github.wxiaoqi.security.admin.dto.WalletDetailFindDTO
;
import
com.github.wxiaoqi.security.admin.dto.WalletDetailListDTO
;
import
com.github.wxiaoqi.security.admin.entity.MyWalletDetail
;
import
com.github.wxiaoqi.security.admin.entity.MyWalletDetail
;
import
com.github.wxiaoqi.security.admin.mapper.MyWalletDetailMapper
;
import
com.github.wxiaoqi.security.admin.mapper.MyWalletDetailMapper
;
import
com.github.wxiaoqi.security.admin.vo.WalletDetailAdminVo
;
import
com.github.wxiaoqi.security.admin.vo.WalletDetailPageVo
;
import
com.github.wxiaoqi.security.admin.vo.WalletDetailPageVo
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
lombok.Data
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.entity.Example
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
/**
...
@@ -23,6 +31,7 @@ import java.util.List;
...
@@ -23,6 +31,7 @@ import java.util.List;
*/
*/
@Transactional
@Transactional
@Service
@Service
@Data
public
class
MyWalletDetailBiz
extends
BaseBiz
<
MyWalletDetailMapper
,
MyWalletDetail
>
{
public
class
MyWalletDetailBiz
extends
BaseBiz
<
MyWalletDetailMapper
,
MyWalletDetail
>
{
...
@@ -53,4 +62,36 @@ public class MyWalletDetailBiz extends BaseBiz<MyWalletDetailMapper, MyWalletDet
...
@@ -53,4 +62,36 @@ public class MyWalletDetailBiz extends BaseBiz<MyWalletDetailMapper, MyWalletDet
return
walletDetailPageVo
;
return
walletDetailPageVo
;
}
}
public
PageDataVO
<
WalletDetailAdminVo
>
findWalletDetailPage
(
WalletDetailFindDTO
walletDetailFindDTO
){
PageDataVO
<
WalletDetailAdminVo
>
pageDataVO
=
new
PageDataVO
<>();
PageDataVO
<
WalletDetailListDTO
>
walletDetailPage
=
PageDataVO
.
pageInfo
(
walletDetailFindDTO
.
getPage
(),
walletDetailFindDTO
.
getLimit
(),
()->
mapper
.
findWalletDetailsByUserNameOrPhoneOrsourceType
(
walletDetailFindDTO
.
getUsername
(),
walletDetailFindDTO
.
getPhone
(),
walletDetailFindDTO
.
getSource
()));
List
<
WalletDetailListDTO
>
detailListDTOS
=
walletDetailPage
.
getData
();
if
(
CollectionUtils
.
isEmpty
(
detailListDTOS
)){
return
pageDataVO
;
}
List
<
WalletDetailAdminVo
>
walletDetailAdminVos
=
new
ArrayList
<>();
WalletDetailAdminVo
walletDetailAdminVo
;
for
(
WalletDetailListDTO
detailListDTO
:
detailListDTOS
)
{
walletDetailAdminVo
=
new
WalletDetailAdminVo
();
BeanUtils
.
copyProperties
(
detailListDTO
,
walletDetailAdminVo
);
walletDetailAdminVos
.
add
(
walletDetailAdminVo
);
}
pageDataVO
.
setPageNum
(
walletDetailFindDTO
.
getPage
());
pageDataVO
.
setPageSize
(
walletDetailFindDTO
.
getLimit
());
pageDataVO
.
setTotalCount
(
walletDetailPage
.
getTotalCount
());
pageDataVO
.
setTotalPage
(
walletDetailPage
.
getTotalPage
());
pageDataVO
.
setData
(
walletDetailAdminVos
);
return
pageDataVO
;
}
public
Map
<
Integer
,
BigDecimal
>
finduserIdAndPersonalTotalConsumptionMapByUserIds
(
List
<
Integer
>
userIds
)
{
List
<
PersonalConsumptionDTO
>
personalConsumptions
=
mapper
.
findpersonalConsumptionsByUserIds
(
userIds
);
Map
<
Integer
,
BigDecimal
>
userIdAndPersonalConsumptionMap
=
personalConsumptions
.
stream
().
collect
(
Collectors
.
toMap
(
PersonalConsumptionDTO:
:
getUserId
,
PersonalConsumptionDTO:
:
getTotalConsumption
));
return
userIdAndPersonalConsumptionMap
;
}
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/MyWalletCathMapper.java
View file @
78862201
...
@@ -19,4 +19,5 @@ public interface MyWalletCathMapper extends Mapper<MyWalletCath> {
...
@@ -19,4 +19,5 @@ 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
);
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/MyWalletDetailMapper.java
View file @
78862201
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
mapper
;
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
mapper
;
import
com.github.wxiaoqi.security.admin.dto.PersonalConsumptionDTO
;
import
com.github.wxiaoqi.security.admin.dto.WalletDetailListDTO
;
import
com.github.wxiaoqi.security.admin.entity.MyWalletDetail
;
import
com.github.wxiaoqi.security.admin.entity.MyWalletDetail
;
import
org.apache.ibatis.annotations.Param
;
import
tk.mybatis.mapper.common.Mapper
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
/**
/**
* 收入/支持明细表,每笔的进账,出账的详细记录
* 收入/支持明细表,每笔的进账,出账的详细记录
*
*
...
@@ -11,5 +16,8 @@ import tk.mybatis.mapper.common.Mapper;
...
@@ -11,5 +16,8 @@ import tk.mybatis.mapper.common.Mapper;
* @date 2019-07-11 14:14:54
* @date 2019-07-11 14:14:54
*/
*/
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
<
PersonalConsumptionDTO
>
findpersonalConsumptionsByUserIds
(
@Param
(
"userIds"
)
List
<
Integer
>
userIds
);
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/admin/WalletDetailAdminController.java
0 → 100644
View file @
78862201
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rest
.
admin
;
import
com.github.wxiaoqi.security.admin.biz.MyWalletDetailBiz
;
import
com.github.wxiaoqi.security.admin.dto.WalletDetailFindDTO
;
import
com.github.wxiaoqi.security.admin.vo.WalletDetailAdminVo
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
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.RestController
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/18 13:30
*/
@RestController
@RequestMapping
(
"/walletdetail/admin"
)
public
class
WalletDetailAdminController
{
@Autowired
private
MyWalletDetailBiz
myWalletDetailBiz
;
@GetMapping
(
"/page"
)
public
ObjectRestResponse
<
PageDataVO
<
WalletDetailAdminVo
>>
findWalletDetailPage
(
WalletDetailFindDTO
walletDetailFindDTO
){
PageDataVO
<
WalletDetailAdminVo
>
walletDetailPage
=
myWalletDetailBiz
.
findWalletDetailPage
(
walletDetailFindDTO
);
return
ObjectRestResponse
.
succ
(
walletDetailPage
);
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/AppPermissionService.java
View file @
78862201
...
@@ -730,7 +730,7 @@ public class AppPermissionService {
...
@@ -730,7 +730,7 @@ public class AppPermissionService {
public
String
loginImiWithUserId
(
Integer
userId
){
public
String
loginImiWithUserId
(
Integer
userId
){
AppUserLogin
appUserLogin
=
appUserLoginBiz
.
getUserById
(
userId
);
AppUserLogin
appUserLogin
=
appUserLoginBiz
.
getUserById
(
userId
);
String
token
=
loginIm
(
appUserLogin
.
getUsername
(),
appUserLogin
.
getImPassword
(),
userId
);
String
token
=
loginIm
(
appUserLogin
.
getUsername
(),
appUserLogin
.
getImPassword
(),
appUserLogin
.
getImUserid
()
);
return
token
;
return
token
;
}
}
...
...
ace-modules/ace-admin/src/main/resources/mapper/MyWalletCathMapper.xml
View file @
78862201
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
<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.WalletListDTO"
>
<select
id=
"selectByUserNameOrPhoneOrWithDrawSate"
resultType=
"com.github.wxiaoqi.security.admin.dto.Wallet
Cath
ListDTO"
>
SELECT
SELECT
wc.id,
wc.id,
aud.nickname,
aud.nickname,
...
@@ -20,10 +20,10 @@
...
@@ -20,10 +20,10 @@
</if>
) AS `wc`
</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 = w.user_id
</if>
) AS `aul` ON aul.id = w
c
.user_id
INNER JOIN ( SELECT `userid`, `nickname`, `realname` FROM `app_user_detail`
<if
INNER JOIN ( SELECT `userid`, `nickname`, `realname` FROM `app_user_detail`
<if
test=
"userName != null and userName != ''"
>
test=
"userName != null and userName != ''"
>
WHERE nickname =#{user
n
ame} OR realname =#{userName}
WHERE nickname =#{user
N
ame} OR realname =#{userName}
</if>
) AS `aud` ON aud.userid = aul.id
</if>
) AS `aud` ON aud.userid = aul.id
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
ace-modules/ace-admin/src/main/resources/mapper/MyWalletDetailMapper.xml
0 → 100644
View file @
78862201
<?xml version="1.0" encoding="UTF-8" ?>
<!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"
>
<select
id=
"findWalletDetailsByUserNameOrPhoneOrsourceType"
resultType=
"com.github.wxiaoqi.security.admin.dto.WalletDetailListDTO"
>
SELECT
wd.id,
wd.source,
wd.amount,
wd.cono,
wd.itype,
wd.activity_id AS `activityId`,
wd.activity_name AS `activityName`,
aul.username,
aud.nickname,
aud.realname,
ausw.price,
ausw.extract,
ausw.waiting,
ausw.title
FROM
(select id,user_id,source,amount,cono,itype,activity_id,activity_name FROM `my_wallet_detail`
<if
test=
"sourceType != null"
>
WHERE `source`=#{sourceType}
</if>
) AS `wd`
LEFT JOIN (SELECT id,username FROM `app_user_login`
<if
test=
"phone != null and phone != ''"
>
WHERE `username`=#{phone}
</if>
) AS `aul` ON aul.id = wd.user_id
LEFT JOIN (SELECT userid,nickname,realname FROM `app_user_detail`
<if
test=
"userName != null and userName != ''"
>
WHERE `nickname`=#{userName} OR `realname`=#{userName}
</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
</select>
<select
id=
"findpersonalConsumptionsByUserIds"
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
<foreach
collection=
"userIds"
item=
"userId"
open=
"("
close=
")"
separator=
","
>
#{userId}
</foreach>
</if>
GROUP BY user_id;
</select>
</mapper>
\ No newline at end of file
xx-activity/xx-activity-api/src/main/java/com/xxfc/platform/activity/feign/ActivityFeign.java
View file @
78862201
...
@@ -33,10 +33,10 @@ public interface ActivityFeign {
...
@@ -33,10 +33,10 @@ public interface ActivityFeign {
@RequestMapping
(
value
=
"/user/use"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/user/use"
,
method
=
RequestMethod
.
POST
)
public
BigDecimal
use
(
public
BigDecimal
use
(
@RequestParam
(
value
=
"userId"
)
Integer
userId
,
@RequestParam
(
value
=
"userId"
)
Integer
userId
,
@RequestParam
(
value
=
"
TickerNo"
)
String
T
ickerNo
,
@RequestParam
(
value
=
"
tickerNo"
)
String
t
ickerNo
,
@RequestParam
(
value
=
"orderNo"
)
String
orderNo
,
@RequestParam
(
value
=
"orderNo"
)
String
orderNo
,
@RequestParam
(
value
=
"channel"
)
Integer
channel
,
@RequestParam
(
value
=
"channel"
)
Integer
channel
,
@RequestParam
(
value
=
"amou
t"
)
BigDecimal
amou
t
,
@RequestParam
(
value
=
"amou
nt"
)
BigDecimal
amoun
t
,
@RequestParam
(
value
=
"type"
)
Integer
type
);
@RequestParam
(
value
=
"type"
)
Integer
type
);
@ApiOperation
(
"优惠卷取消使用"
)
@ApiOperation
(
"优惠卷取消使用"
)
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/biz/UserCouponBiz.java
View file @
78862201
...
@@ -109,15 +109,33 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
...
@@ -109,15 +109,33 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
}
}
//获取我的优惠卷
//获取我的优惠卷
public
ObjectRestResponse
getCouponList
(
Integer
userId
,
int
type
){
public
ObjectRestResponse
getCouponList
(
Integer
userId
,
int
type
,
Integer
channel
,
BigDecimal
amout
){
if
(
userId
==
null
||
userId
==
0
){
if
(
userId
==
null
||
userId
==
0
){
log
.
error
(
"----参数不能为空"
);
log
.
error
(
"----参数不能为空"
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数不能为空"
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"参数不能为空"
);
}
}
Long
time
=
System
.
currentTimeMillis
();
Long
time
=
System
.
currentTimeMillis
();
return
ObjectRestResponse
.
succ
(
mapper
.
getUserCouponsByType
(
userId
,
type
,
time
));
List
<
UserCouponVo
>
list
=
mapper
.
getUserCouponsByType
(
userId
,
type
,
time
,
channel
);
if
(
amout
.
compareTo
(
new
BigDecimal
(
"0.00"
))>
0
&&
list
.
size
()>
0
){
for
(
UserCouponVo
couponVo:
list
){
Integer
status
=
2
;
if
(
amout
.
compareTo
(
couponVo
.
getUsedAmount
())>=
0
){
if
(
couponVo
.
getChannel
()==
1
){
if
(
amout
.
compareTo
(
couponVo
.
getWithAmount
())>=
0
){
status
=
1
;
}
}
else
if
(
couponVo
.
getChannel
()==
3
){
status
=
1
;
}
}
couponVo
.
setStatus
(
status
);
}
}
return
ObjectRestResponse
.
succ
(
list
);
}
}
//获取单个优惠卷
//获取单个优惠卷
public
UserCouponVo
getUserCoupon
(
String
tickerNo
){
public
UserCouponVo
getUserCoupon
(
String
tickerNo
){
if
(
StringUtils
.
isBlank
(
tickerNo
)){
if
(
StringUtils
.
isBlank
(
tickerNo
)){
...
@@ -135,14 +153,18 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
...
@@ -135,14 +153,18 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
return
couponAmout
;
return
couponAmout
;
}
}
Example
example
=
new
Example
(
UserCoupon
.
class
);
Example
example
=
new
Example
(
UserCoupon
.
class
);
example
.
createCriteria
().
andEqualTo
(
"
T
ickerNo"
,
TickerNo
).
andEqualTo
(
"isDel"
,
0
);
example
.
createCriteria
().
andEqualTo
(
"
t
ickerNo"
,
TickerNo
).
andEqualTo
(
"isDel"
,
0
);
List
<
UserCoupon
>
list
=
selectByExample
(
example
);
List
<
UserCoupon
>
list
=
selectByExample
(
example
);
if
(
list
.
size
()==
0
){
if
(
list
.
size
()==
0
){
log
.
error
(
userId
+
"----
已领优惠卷"
);
log
.
error
(
userId
+
"----
没有可用优惠卷--TickerNo==="
+
TickerNo
);
return
couponAmout
;
return
couponAmout
;
}
}
UserCoupon
userCoupon
=
list
.
get
(
0
);
UserCoupon
userCoupon
=
list
.
get
(
0
);
if
(
userCoupon
!=
null
&&
userCoupon
.
getIsUse
()==
1
){
log
.
error
(
userId
+
"----该优惠卷已使用--TickerNo=="
+
TickerNo
);
return
couponAmout
;
}
if
(
type
==
1
){
if
(
type
==
1
){
userCoupon
.
setIsUse
(
1
);
userCoupon
.
setIsUse
(
1
);
userCoupon
.
setOrderNo
(
orderNo
);
userCoupon
.
setOrderNo
(
orderNo
);
...
@@ -163,7 +185,8 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
...
@@ -163,7 +185,8 @@ public class UserCouponBiz extends BaseBiz<UserCouponMapper, UserCoupon> {
BigDecimal
useAmout
=
coupon
.
getUsedAmount
();
BigDecimal
useAmout
=
coupon
.
getUsedAmount
();
if
(
amout
.
compareTo
(
useAmout
)
>
0
)
{
if
(
amout
.
compareTo
(
useAmout
)
>
0
)
{
if
(
type
==
3
||
(
type
==
1
&&
(
amout
.
compareTo
(
coupon
.
getWithAmount
())
>=
0
)))
{
if
(
type
==
3
||
(
type
==
1
&&
(
amout
.
compareTo
(
coupon
.
getWithAmount
())
>=
0
)))
{
couponAmout
=
amout
.
subtract
(
useAmout
);
//couponAmout = amout.subtract(useAmout);
couponAmout
=
useAmout
;
}
}
}
}
}
}
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/mapper/UserCouponMapper.java
View file @
78862201
...
@@ -17,7 +17,7 @@ import java.util.List;
...
@@ -17,7 +17,7 @@ import java.util.List;
public
interface
UserCouponMapper
extends
Mapper
<
UserCoupon
>
{
public
interface
UserCouponMapper
extends
Mapper
<
UserCoupon
>
{
//我的优惠卷
//我的优惠卷
public
List
<
UserCouponVo
>
getUserCouponsByType
(
@Param
(
"userId"
)
Integer
userId
,
@Param
(
"type"
)
int
type
,
@Param
(
"time"
)
Long
time
);
public
List
<
UserCouponVo
>
getUserCouponsByType
(
@Param
(
"userId"
)
Integer
userId
,
@Param
(
"type"
)
int
type
,
@Param
(
"time"
)
Long
time
,
@Param
(
"channel"
)
Integer
channel
);
//单个优惠卷
//单个优惠卷
public
UserCouponVo
getUserCoupon
(
@Param
(
"tickerNo"
)
String
tickerNo
);
public
UserCouponVo
getUserCoupon
(
@Param
(
"tickerNo"
)
String
tickerNo
);
...
...
xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/rest/UserCouponController.java
View file @
78862201
...
@@ -27,15 +27,23 @@ public class UserCouponController extends ActivityBaseController<UserCouponBiz>
...
@@ -27,15 +27,23 @@ public class UserCouponController extends ActivityBaseController<UserCouponBiz>
return
baseBiz
.
authledCoupon
(
userId
);
return
baseBiz
.
authledCoupon
(
userId
);
}
}
/**
*
* @param type 0-未使用;1-已使用;3-已过期
* @param channel 1-租车;2-旅游;null-全部
* @return
*/
@ApiOperation
(
"我的优惠卷"
)
@ApiOperation
(
"我的优惠卷"
)
@RequestMapping
(
value
=
"/list/{type}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/coupon/list"
,
method
=
RequestMethod
.
GET
)
public
ObjectRestResponse
list
(
@PathVariable
Integer
type
)
{
public
ObjectRestResponse
list
(
@RequestParam
(
value
=
"type"
,
defaultValue
=
"0"
)
Integer
type
,
@RequestParam
(
value
=
"channel"
)
Integer
channel
,
@RequestParam
(
value
=
"amount"
,
defaultValue
=
"0.00"
)
BigDecimal
amount
)
{
AppUserDTO
userInfo
=
getUserInfo
();
AppUserDTO
userInfo
=
getUserInfo
();
Integer
userId
=
userInfo
.
getUserid
();
Integer
userId
=
userInfo
.
getUserid
();
if
(
userId
==
null
){
if
(
userId
==
null
){
return
ObjectRestResponse
.
createDefaultFail
();
return
ObjectRestResponse
.
createDefaultFail
();
}
}
return
baseBiz
.
getCouponList
(
userId
,
type
);
return
baseBiz
.
getCouponList
(
userId
,
type
,
channel
,
amount
);
}
}
@ApiOperation
(
"单个优惠卷信息"
)
@ApiOperation
(
"单个优惠卷信息"
)
...
@@ -49,13 +57,13 @@ public class UserCouponController extends ActivityBaseController<UserCouponBiz>
...
@@ -49,13 +57,13 @@ public class UserCouponController extends ActivityBaseController<UserCouponBiz>
@RequestMapping
(
value
=
"/use"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/use"
,
method
=
RequestMethod
.
POST
)
public
BigDecimal
use
(
public
BigDecimal
use
(
@RequestParam
(
value
=
"userId"
,
defaultValue
=
"0"
)
Integer
userId
,
@RequestParam
(
value
=
"userId"
,
defaultValue
=
"0"
)
Integer
userId
,
@RequestParam
(
value
=
"
TickerNo"
,
defaultValue
=
""
)
String
T
ickerNo
,
@RequestParam
(
value
=
"
tickerNo"
,
defaultValue
=
""
)
String
t
ickerNo
,
@RequestParam
(
value
=
"orderNo"
,
defaultValue
=
""
)
String
orderNo
,
@RequestParam
(
value
=
"orderNo"
,
defaultValue
=
""
)
String
orderNo
,
@RequestParam
(
value
=
"channel"
,
defaultValue
=
"1"
)
Integer
channel
,
@RequestParam
(
value
=
"channel"
,
defaultValue
=
"1"
)
Integer
channel
,
@RequestParam
(
value
=
"amou
t"
,
defaultValue
=
"0.00"
)
BigDecimal
amou
t
,
@RequestParam
(
value
=
"amou
nt"
,
defaultValue
=
"0.00"
)
BigDecimal
amoun
t
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"1"
)
Integer
type
@RequestParam
(
value
=
"type"
,
defaultValue
=
"1"
)
Integer
type
)
{
)
{
return
baseBiz
.
useTickerNo
(
userId
,
TickerNo
,
orderNo
,
channel
,
amou
t
,
type
);
return
baseBiz
.
useTickerNo
(
userId
,
tickerNo
,
orderNo
,
channel
,
amoun
t
,
type
);
}
}
@ApiOperation
(
"优惠卷取消使用"
)
@ApiOperation
(
"优惠卷取消使用"
)
...
@@ -80,4 +88,6 @@ public class UserCouponController extends ActivityBaseController<UserCouponBiz>
...
@@ -80,4 +88,6 @@ public class UserCouponController extends ActivityBaseController<UserCouponBiz>
}
}
\ No newline at end of file
xx-activity/xx-activity-server/src/main/resources/mapper/UserCouponMapper.xml
View file @
78862201
...
@@ -46,6 +46,9 @@
...
@@ -46,6 +46,9 @@
<if
test=
"type==2"
>
<if
test=
"type==2"
>
and u.is_use=0 and u.expire_time
<
#{time}
and u.is_use=0 and u.expire_time
<
#{time}
</if>
</if>
<if
test=
"channel!=null and channel!=''"
>
and (c.channel=#{channel} or c.channel=1 )
</if>
<choose>
<choose>
<when
test=
"type==1"
>
<when
test=
"type==1"
>
ORDER BY u.use_time DESC
ORDER BY u.use_time DESC
...
...
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