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
92797cf8
Commit
92797cf8
authored
Jul 26, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
123
parent
27388812
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
586 additions
and
14 deletions
+586
-14
WalletCathSumDto.java
...m/github/wxiaoqi/security/admin/dto/WalletCathSumDto.java
+35
-0
MyWalletCath.java
...om/github/wxiaoqi/security/admin/entity/MyWalletCath.java
+31
-7
ApplyCathVo.java
...ava/com/github/wxiaoqi/security/admin/vo/ApplyCathVo.java
+46
-0
pom.xml
ace-modules/ace-admin/pom.xml
+5
-0
AppUserAlipayBiz.java
...m/github/wxiaoqi/security/admin/biz/AppUserAlipayBiz.java
+47
-0
MyWalletBiz.java
...va/com/github/wxiaoqi/security/admin/biz/MyWalletBiz.java
+257
-2
MyWalletCathBiz.java
...om/github/wxiaoqi/security/admin/biz/MyWalletCathBiz.java
+5
-0
AppUserAlipayMapper.java
...ub/wxiaoqi/security/admin/mapper/AppUserAlipayMapper.java
+16
-0
MyWalletCathMapper.java
...hub/wxiaoqi/security/admin/mapper/MyWalletCathMapper.java
+9
-1
MyWalletController.java
...ithub/wxiaoqi/security/admin/rest/MyWalletController.java
+101
-4
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+17
-0
MyWalletCathMapper.xml
...ce-admin/src/main/resources/mapper/MyWalletCathMapper.xml
+17
-0
No files found.
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/WalletCathSumDto.java
0 → 100644
View file @
92797cf8
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
dto
;
import
lombok.Data
;
import
java.math.BigDecimal
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/17 20:22
*/
@Data
public
class
WalletCathSumDto
{
//总金额
private
BigDecimal
sumAmount
;
//总次数
private
Integer
number
;
//用户余额
private
BigDecimal
balance
;
//费率
private
BigDecimal
proceduReates
;
//钱包id
private
Integer
walletId
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/MyWalletCath.java
View file @
92797cf8
...
...
@@ -33,7 +33,7 @@ public class MyWalletCath implements Serializable {
*/
@Column
(
name
=
"user_id"
)
@ApiModelProperty
(
value
=
"用户iD"
)
private
String
userId
;
private
Integer
userId
;
/**
* 提现类别,第三方提现类别(0-微信,1-支付宝,2-银行卡)
...
...
@@ -45,9 +45,9 @@ public class MyWalletCath implements Serializable {
/**
* 商户订单号
*/
@Column
(
name
=
"
orderno
"
)
@ApiModelProperty
(
value
=
"
商户订单
号"
)
private
String
orderno
;
@Column
(
name
=
"
account_number
"
)
@ApiModelProperty
(
value
=
"
用户账
号"
)
private
String
accountNumber
;
/**
* 第三方订单号:如微信,支付宝,银行卡等
...
...
@@ -55,13 +55,37 @@ public class MyWalletCath implements Serializable {
@Column
(
name
=
"cono"
)
@ApiModelProperty
(
value
=
"第三方订单号:如微信,支付宝,银行卡等"
)
private
String
cono
;
/**
* 提现金额
*/
@Column
(
name
=
"balance"
)
@ApiModelProperty
(
value
=
"当前钱包余额"
)
private
BigDecimal
balance
;
/**
/**
* 提现金额
*/
@Column
(
name
=
"amount"
)
@ApiModelProperty
(
value
=
"提现金额"
)
private
BigDecimal
amount
;
/**
* 到账金额
*/
@Column
(
name
=
"real_amount"
)
@ApiModelProperty
(
value
=
"到账金额"
)
private
BigDecimal
realAmount
;
/**
* 手续费
*/
@Column
(
name
=
"commission"
)
@ApiModelProperty
(
value
=
"手续费"
)
private
BigDecimal
commission
;
/**
* 订单状态:0-未提现,待审核,1-已审核
...
...
@@ -87,9 +111,9 @@ public class MyWalletCath implements Serializable {
/**
* 操作者ID
*/
@Column
(
name
=
"
oper
_user"
)
@Column
(
name
=
"
upd
_user"
)
@ApiModelProperty
(
value
=
"操作者ID"
)
private
String
oper
User
;
private
String
upd
User
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/ApplyCathVo.java
0 → 100644
View file @
92797cf8
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 9:20
*/
@Data
public
class
ApplyCathVo
{
/**
* 用户ID
*/
@ApiModelProperty
(
"用户ID"
)
private
Integer
userId
;
/**
* 提现金额
*/
@ApiModelProperty
(
value
=
"提现金额"
)
private
BigDecimal
amount
;
/**
* 支付密码
*/
@ApiModelProperty
(
value
=
"支付密码"
)
private
String
password
;
/**
* 支付账号
*/
@ApiModelProperty
(
value
=
"支付账号"
)
private
String
accountNumber
;
/**
* 支付类型
*/
@ApiModelProperty
(
value
=
"支付类型"
)
private
Integer
cathType
;
}
ace-modules/ace-admin/pom.xml
View file @
92797cf8
...
...
@@ -46,6 +46,11 @@
<artifactId>
xx-im-api
</artifactId>
<version>
2.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.xxfc.platform
</groupId>
<artifactId>
xx-app-api
</artifactId>
<version>
2.0-SNAPSHOT
</version>
</dependency>
<dependency>
<groupId>
com.xxfc.platform
</groupId>
<artifactId>
xx-activity-api
</artifactId>
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserAlipayBiz.java
0 → 100644
View file @
92797cf8
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
import
com.github.wxiaoqi.security.admin.entity.AppUserAlipay
;
import
com.github.wxiaoqi.security.admin.entity.AppUserRelationTemp
;
import
com.github.wxiaoqi.security.admin.mapper.AppUserAlipayMapper
;
import
com.github.wxiaoqi.security.admin.mapper.AppUserRelationTempMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
org.springframework.stereotype.Service
;
import
tk.mybatis.mapper.entity.Example
;
import
java.util.List
;
/**
* 支付宝账号表
*
* @author libin
* @email 18178966185@163.com
* @date 2019-07-03 16:36:44
*/
@Service
public
class
AppUserAlipayBiz
extends
BaseBiz
<
AppUserAlipayMapper
,
AppUserAlipay
>
{
//添加支付宝账号
public
void
addAlipay
(
Integer
userId
,
String
txAlipay
){
AppUserAlipay
appUserAlipay
=
new
AppUserAlipay
();
appUserAlipay
.
setTxAlipay
(
txAlipay
);
appUserAlipay
.
setUserId
(
userId
);
appUserAlipay
.
setIsDel
(
0
);
AppUserAlipay
appUserAlipay1
=
selectOne
(
appUserAlipay
);
if
(
appUserAlipay1
==
null
){
appUserAlipay
.
setIsDefault
(
1
);
insertSelective
(
appUserAlipay
);
}
else
{
appUserAlipay1
.
setIsDefault
(
1
);
updateSelectiveById
(
appUserAlipay1
);
}
}
//获取支付宝列表
public
List
<
AppUserAlipay
>
getListByUserId
(
Integer
userId
){
Example
example
=
new
Example
(
AppUserAlipay
.
class
);
example
.
createCriteria
().
andEqualTo
(
"userId"
,
userId
).
andEqualTo
(
"isDel"
,
0
);
example
.
setOrderByClause
(
"is_default desc"
);
return
selectByExample
(
example
);
}
}
\ No newline at end of file
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/MyWalletBiz.java
View file @
92797cf8
This diff is collapsed.
Click to expand it.
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/MyWalletCathBiz.java
View file @
92797cf8
...
...
@@ -3,6 +3,7 @@ package com.github.wxiaoqi.security.admin.biz;
import
com.github.wxiaoqi.security.admin.dto.PersonalConsumptionDTO
;
import
com.github.wxiaoqi.security.admin.dto.WalletCathFindDTO
;
import
com.github.wxiaoqi.security.admin.dto.WalletCathListDTO
;
import
com.github.wxiaoqi.security.admin.dto.WalletCathSumDto
;
import
com.github.wxiaoqi.security.admin.entity.MyWalletCath
;
import
com.github.wxiaoqi.security.admin.mapper.MyWalletCathMapper
;
import
com.github.wxiaoqi.security.admin.vo.WalletCathAdminVo
;
...
...
@@ -120,4 +121,8 @@ public class MyWalletCathBiz extends BaseBiz<MyWalletCathMapper, MyWalletCath> {
Map
<
Integer
,
BigDecimal
>
userIdAndPersonalConsumptionMap
=
personalConsumptions
.
stream
().
collect
(
Collectors
.
toMap
(
PersonalConsumptionDTO:
:
getUserId
,
PersonalConsumptionDTO:
:
getTotalConsumption
));
return
userIdAndPersonalConsumptionMap
;
}
public
WalletCathSumDto
sumCathAmount
(
Integer
type
){
return
mapper
.
sumCathAmount
(
type
);
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/AppUserAlipayMapper.java
0 → 100644
View file @
92797cf8
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
mapper
;
import
com.github.wxiaoqi.security.admin.entity.AppUserAlipay
;
import
tk.mybatis.mapper.common.Mapper
;
/**
* 钱包提现表
*
* @author zjw
* @email 18178966185@163.com
* @date 2019-07-11 14:14:54
*/
public
interface
AppUserAlipayMapper
extends
Mapper
<
AppUserAlipay
>
{
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/MyWalletCathMapper.java
View file @
92797cf8
...
...
@@ -2,10 +2,10 @@ package com.github.wxiaoqi.security.admin.mapper;
import
com.github.wxiaoqi.security.admin.dto.PersonalConsumptionDTO
;
import
com.github.wxiaoqi.security.admin.dto.WalletCathListDTO
;
import
com.github.wxiaoqi.security.admin.dto.WalletCathSumDto
;
import
com.github.wxiaoqi.security.admin.entity.MyWalletCath
;
import
org.apache.ibatis.annotations.Param
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
/**
...
...
@@ -22,4 +22,12 @@ public interface MyWalletCathMapper extends Mapper<MyWalletCath> {
@Param
(
"state"
)
Integer
state
);
List
<
PersonalConsumptionDTO
>
findUserWithDrawingByUserIds
(
@Param
(
"userIds"
)
List
<
Integer
>
userIds
);
/**
* 计算提现的金额
* @param type 1-日;2-月
* @return
*/
WalletCathSumDto
sumCathAmount
(
@Param
(
"type"
)
int
type
);
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/MyWalletController.java
View file @
92797cf8
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rest
;
import
com.github.wxiaoqi.security.admin.biz.AppUserAlipayBiz
;
import
com.github.wxiaoqi.security.admin.biz.MyWalletBiz
;
import
com.github.wxiaoqi.security.admin.vo.AppletWalletVo
;
import
com.github.wxiaoqi.security.admin.vo.ApplyCathVo
;
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
io.swagger.annotations.ApiOperation
;
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
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
java.math.BigDecimal
;
/**
* @author libin
...
...
@@ -34,6 +35,10 @@ public class MyWalletController {
@Autowired
private
MyWalletBiz
myWalletBiz
;
@Autowired
private
AppUserAlipayBiz
alipayBiz
;
@GetMapping
public
ObjectRestResponse
<
AppletWalletVo
>
findMyWallet
(
HttpServletRequest
request
){
try
{
...
...
@@ -46,4 +51,96 @@ public class MyWalletController {
}
@GetMapping
@ApiOperation
(
"检查验证码"
)
public
ObjectRestResponse
checkCode
(
@RequestParam
(
value
=
"phone"
,
defaultValue
=
""
)
String
phone
,
@RequestParam
(
value
=
"mobilecode"
,
defaultValue
=
""
)
String
mobilecod
){
return
myWalletBiz
.
checkCode
(
phone
,
mobilecod
);
}
@PostMapping
(
"/setPwd"
)
@ApiOperation
(
"设置密码"
)
public
ObjectRestResponse
setPwd
(
@RequestParam
(
value
=
"phone"
,
defaultValue
=
""
)
String
phone
,
@RequestParam
(
value
=
"mobilecode"
,
defaultValue
=
""
)
String
mobilecod
,
@RequestParam
(
value
=
"password"
,
defaultValue
=
""
)
String
password
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"1"
)
Integer
type
,
HttpServletRequest
request
){
try
{
Integer
userId
=
Integer
.
parseInt
(
userAuthUtil
.
getInfoFromToken
(
userAuthConfig
.
getToken
(
request
)).
getId
());
return
myWalletBiz
.
setPwd
(
userId
,
phone
,
mobilecod
,
password
,
type
);
}
catch
(
Exception
e
)
{
throw
new
BaseException
(
e
);
}
}
@GetMapping
(
"/checkSetPwd"
)
@ApiOperation
(
"检查用户是否设置过支付密码"
)
public
ObjectRestResponse
checkSetPwd
(
HttpServletRequest
request
){
try
{
Integer
userId
=
Integer
.
parseInt
(
userAuthUtil
.
getInfoFromToken
(
userAuthConfig
.
getToken
(
request
)).
getId
());
return
myWalletBiz
.
checkSetPwd
(
userId
);
}
catch
(
Exception
e
)
{
throw
new
BaseException
(
e
);
}
}
@GetMapping
(
"/checkAmount"
)
@ApiOperation
(
"检查提成下一步操作"
)
public
ObjectRestResponse
checkAmount
(
@RequestParam
(
value
=
"amount"
,
defaultValue
=
"0.00"
)
BigDecimal
amount
,
HttpServletRequest
request
){
try
{
Integer
userId
=
Integer
.
parseInt
(
userAuthUtil
.
getInfoFromToken
(
userAuthConfig
.
getToken
(
request
)).
getId
());
return
myWalletBiz
.
checkAmount
(
userId
,
amount
,
null
);
}
catch
(
Exception
e
)
{
throw
new
BaseException
(
e
);
}
}
@PostMapping
(
"/applyCath"
)
@ApiOperation
(
"提现申请"
)
public
ObjectRestResponse
applyCath
(
@RequestBody
ApplyCathVo
applyCathVo
,
HttpServletRequest
request
){
try
{
Integer
userId
=
Integer
.
parseInt
(
userAuthUtil
.
getInfoFromToken
(
userAuthConfig
.
getToken
(
request
)).
getId
());
return
myWalletBiz
.
applyCath
(
applyCathVo
);
}
catch
(
Exception
e
)
{
throw
new
BaseException
(
e
);
}
}
@PostMapping
(
"/verifyCath"
)
@ApiOperation
(
"提现审核"
)
public
ObjectRestResponse
verifyCath
(
@RequestParam
(
value
=
"cathId"
,
defaultValue
=
"0"
)
Integer
cathId
,
@RequestParam
(
value
=
"cono"
,
defaultValue
=
""
)
String
cono
){
try
{
return
myWalletBiz
.
verifyCath
(
cathId
,
cono
);
}
catch
(
Exception
e
)
{
throw
new
BaseException
(
e
);
}
}
@GetMapping
(
"/txAlipayList"
)
@ApiOperation
(
"获取支付账号列表"
)
public
ObjectRestResponse
txAlipayList
(
HttpServletRequest
request
){
try
{
Integer
userId
=
Integer
.
parseInt
(
userAuthUtil
.
getInfoFromToken
(
userAuthConfig
.
getToken
(
request
)).
getId
());
return
ObjectRestResponse
.
succ
(
alipayBiz
.
getListByUserId
(
userId
))
;
}
catch
(
Exception
e
)
{
throw
new
BaseException
(
e
);
}
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/AppPermissionService.java
View file @
92797cf8
...
...
@@ -205,6 +205,23 @@ public class AppPermissionService {
return
JsonResultUtil
.
createSuccessResultWithObj
(
result
);
}
//检查验证码是否正确
public
String
checkCodeByUsername
(
String
username
,
String
mobilecode
){
// 判断参数和验证码
if
(
StringUtils
.
isBlank
(
username
)
||
StringUtils
.
isBlank
(
mobilecode
))
{
log
.
info
(
"---参数为空------"
);
return
null
;
}
String
redisLockKey
=
RedisKey
.
CONSTANT_CODE_PREFIX
+
username
+
mobilecode
;
String
mobilecodeRedis
=
userRedisTemplate
.
opsForValue
().
get
(
redisLockKey
)
==
null
?
""
:
userRedisTemplate
.
opsForValue
().
get
(
redisLockKey
).
toString
();
log
.
error
(
"checkCodeByUsername接口,获取redis中的验证码:"
+
mobilecodeRedis
);
if
(
StringUtils
.
isBlank
(
mobilecodeRedis
))
{
log
.
info
(
"---验证码错误------username==="
+
username
);
return
null
;
}
return
redisLockKey
;
}
/**
* 注册用户
*
...
...
ace-modules/ace-admin/src/main/resources/mapper/MyWalletCathMapper.xml
View file @
92797cf8
...
...
@@ -34,4 +34,21 @@
</foreach>
GROUP BY `user_id`
</select>
<select
id=
"sumCathAmount"
resultType=
"com.github.wxiaoqi.security.admin.dto.WalletCathSumDto"
>
select IFNULL(SUM(amount),0) as sumAmount,COUNT(*) as `number` from my_wallet_cath
<where>
<choose>
<when
test=
"type ==1 "
>
AND date_format(from_unixtime(crt_time/1000),'%Y-%m-%d') = date_format(now(),'%Y-%m-%d')
</when >
<when
test=
"type==2 "
>
AND date_format(from_unixtime(crt_time/1000),'%Y-%m') = date_format(now(),'%Y-%m')
</when >
<otherwise>
</otherwise>
</choose>
</where>
</select>
</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