Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
D
data-server
Project
Project
Details
Activity
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
licc
data-server
Commits
2c164440
Commit
2c164440
authored
Mar 04, 2021
by
licc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
钱包接口,累计收益明细实现
parent
196d891d
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
84 additions
and
11 deletions
+84
-11
UsersMapper.java
...mapper/src/main/java/cn/wisenergy/mapper/UsersMapper.java
+1
-1
UsersMapper.xml
wisenergy-mapper/src/main/resources/mapper/UsersMapper.xml
+1
-1
pom.xml
wisenergy-model/pom.xml
+6
-0
WithdrawBankDto.java
...src/main/java/cn/wisenergy/model/dto/WithdrawBankDto.java
+33
-0
pom.xml
wisenergy-service/pom.xml
+6
-0
AccountManager.java
...ain/java/cn/wisenergy/service/Manager/AccountManager.java
+2
-1
BankService.java
...e/src/main/java/cn/wisenergy/service/app/BankService.java
+3
-2
WalletService.java
...src/main/java/cn/wisenergy/service/app/WalletService.java
+1
-1
AccountServiceImpl.java
...ava/cn/wisenergy/service/app/impl/AccountServiceImpl.java
+3
-3
BankServiceImpl.java
...n/java/cn/wisenergy/service/app/impl/BankServiceImpl.java
+26
-1
WalletServiceImpl.java
...java/cn/wisenergy/service/app/impl/WalletServiceImpl.java
+1
-0
application-dev.yml
wisenergy-web-admin/src/main/resources/application-dev.yml
+1
-1
No files found.
wisenergy-mapper/src/main/java/cn/wisenergy/mapper/UsersMapper.java
View file @
2c164440
...
@@ -53,7 +53,7 @@ public interface UsersMapper extends BaseMapper<User> {
...
@@ -53,7 +53,7 @@ public interface UsersMapper extends BaseMapper<User> {
* @param userId 用户id
* @param userId 用户id
* @return 用户信息
* @return 用户信息
*/
*/
Integ
er
getByUserId
(
@Param
(
"userId"
)
String
userId
);
Us
er
getByUserId
(
@Param
(
"userId"
)
String
userId
);
/**
/**
* 获取用户信息
* 获取用户信息
...
...
wisenergy-mapper/src/main/resources/mapper/UsersMapper.xml
View file @
2c164440
...
@@ -162,7 +162,7 @@
...
@@ -162,7 +162,7 @@
user_id=#{userId}
user_id=#{userId}
</where>
</where>
</select>
</select>
<select
id=
"getuserIdById"
resultType=
"
cn.wisenergy.model.app.Us
er"
>
<select
id=
"getuserIdById"
resultType=
"
java.lang.Integ
er"
>
select
select
id
id
from
from
...
...
wisenergy-model/pom.xml
View file @
2c164440
...
@@ -21,6 +21,12 @@
...
@@ -21,6 +21,12 @@
<version>
1.0.0-SNAPSHOT
</version>
<version>
1.0.0-SNAPSHOT
</version>
<scope>
compile
</scope>
<scope>
compile
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<version>
1.18.18
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
</dependencies>
<!-- MAVEN构建 -->
<!-- MAVEN构建 -->
...
...
wisenergy-model/src/main/java/cn/wisenergy/model/dto/WithdrawBankDto.java
0 → 100644
View file @
2c164440
package
cn
.
wisenergy
.
model
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
*@ Description: 钱包余额提现银行卡Dto
*@ Author : 86187
*@ Date : 2021/3/4 9:51
* @author 86187
*/
@Data
@ApiModel
(
"WithdrawBankDto"
)
public
class
WithdrawBankDto
{
/**
* 用户id
*/
@ApiModelProperty
(
value
=
"用户id"
,
name
=
"userId"
)
private
String
userId
;
/**
* 短信验证码
*/
@ApiModelProperty
(
value
=
"短信验证码"
,
name
=
"code"
)
private
String
code
;
/**
* 提现金额
*/
@ApiModelProperty
(
value
=
"提现金额"
,
name
=
"money"
)
private
Double
money
;
}
wisenergy-service/pom.xml
View file @
2c164440
...
@@ -69,6 +69,12 @@
...
@@ -69,6 +69,12 @@
<artifactId>
itext-asian
</artifactId>
<artifactId>
itext-asian
</artifactId>
<version>
5.2.0
</version>
<version>
5.2.0
</version>
</dependency>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<version>
1.18.18
</version>
<scope>
compile
</scope>
</dependency>
</dependencies>
</dependencies>
<!-- MAVEN构建 -->
<!-- MAVEN构建 -->
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/Manager/AccountManager.java
View file @
2c164440
...
@@ -69,12 +69,13 @@ public class AccountManager {
...
@@ -69,12 +69,13 @@ public class AccountManager {
BigDecimal
performanceTotal
=
accountInfo
.
getEarningsMonth
().
add
(
bigDecimal
);
BigDecimal
performanceTotal
=
accountInfo
.
getEarningsMonth
().
add
(
bigDecimal
);
accountInfo
.
setEarningsMonth
(
performanceTotal
);
accountInfo
.
setEarningsMonth
(
performanceTotal
);
//2、修改订单返佣状态:已返佣 1
//2、修改订单返佣状态:已返佣 1
orderInfo
.
setRebateStatus
(
RebateStatusEnum
.
ALREADY_REBATE
.
getCode
());
orderInfo
.
setRebateStatus
(
RebateStatusEnum
.
ALREADY_REBATE
.
getCode
());
orderMapper
.
updateById
(
orderInfo
);
orderMapper
.
updateById
(
orderInfo
);
//3、
增加
账户可用金额
//3、
更新
账户可用金额
accountMapper
.
updateById
(
accountInfo
);
accountMapper
.
updateById
(
accountInfo
);
//4、添加交易流水记录
//4、添加交易流水记录
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/BankService.java
View file @
2c164440
...
@@ -2,6 +2,7 @@ package cn.wisenergy.service.app;
...
@@ -2,6 +2,7 @@ package cn.wisenergy.service.app;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.common.utils.R
;
import
cn.wisenergy.model.app.BankInfo
;
import
cn.wisenergy.model.app.BankInfo
;
import
cn.wisenergy.model.dto.WithdrawBankDto
;
/**
/**
* @author 86187
* @author 86187
...
@@ -42,9 +43,9 @@ public interface BankService {
...
@@ -42,9 +43,9 @@ public interface BankService {
/**
/**
* 用户提现到银行卡
* 用户提现到银行卡
*
*
* @param
userId
用户标识
* @param
dto
用户标识
* @return true 成功 false 失败
* @return true 成功 false 失败
*/
*/
R
<
Boolean
>
userWithdrawBank
(
String
userId
);
R
<
Boolean
>
userWithdrawBank
(
WithdrawBankDto
dto
);
}
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/WalletService.java
View file @
2c164440
...
@@ -29,7 +29,7 @@ public interface WalletService {
...
@@ -29,7 +29,7 @@ public interface WalletService {
R
<
WithdrawalAmountVo
>
getWithdrawalAmount
(
String
userId
);
R
<
WithdrawalAmountVo
>
getWithdrawalAmount
(
String
userId
);
/**
/**
* 展示用户累计收益记录
* 展示用户累计收益记录
-最近六月 不包括本月
*
*
* @param userId 用户id
* @param userId 用户id
* @return 用户累计收益
* @return 用户累计收益
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/AccountServiceImpl.java
View file @
2c164440
...
@@ -120,11 +120,11 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
...
@@ -120,11 +120,11 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
}
}
}
}
//遍历订单 订单状态创建时间,
小于当前时间 订单当月任务处理状态 :未处理
//遍历订单 订单状态创建时间,
当月时间小于当前时间
for
(
OrderInfo
orderInfo
:
list
)
{
for
(
OrderInfo
orderInfo
:
list
)
{
long
createTime
=
orderInfo
.
getCreated
().
getTime
();
long
createTime
=
orderInfo
.
getCreated
().
getTime
();
long
time
=
System
.
currentTimeMillis
();
long
time
=
System
.
currentTimeMillis
();
if
(
MonthlyTaskStatus
.
NO_DEAL_WITH
.
getCode
().
equals
(
orderInfo
.
getMonthlyTaskStatus
())
&&
createTime
<=
time
)
{
if
(
createTime
<=
time
)
{
//获取用户信息
//获取用户信息
User
user
=
usersMapper
.
selectById
(
orderInfo
.
getBuyerId
());
User
user
=
usersMapper
.
selectById
(
orderInfo
.
getBuyerId
());
if
(
null
==
user
)
{
if
(
null
==
user
)
{
...
@@ -144,7 +144,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
...
@@ -144,7 +144,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
teamPerformance
.
setMonthTeamPerformance
(
userCount
);
teamPerformance
.
setMonthTeamPerformance
(
userCount
);
teamPerformances
.
add
(
teamPerformance
);
teamPerformances
.
add
(
teamPerformance
);
//2、获取当前用户的上级用户列表
//2、获取当前用户的上级用户列表
todo 邀请码等于一个固定值,停止 等于两个值 七位XXXXXXX 和 7777777
List
<
User
>
userList
=
getByList
(
user
.
getUserId
());
List
<
User
>
userList
=
getByList
(
user
.
getUserId
());
if
(
CollectionUtils
.
isEmpty
(
userList
))
{
if
(
CollectionUtils
.
isEmpty
(
userList
))
{
continue
;
continue
;
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/BankServiceImpl.java
View file @
2c164440
package
cn
.
wisenergy
.
service
.
app
.
impl
;
package
cn
.
wisenergy
.
service
.
app
.
impl
;
import
cn.wisenergy.common.utils.*
;
import
cn.wisenergy.common.utils.*
;
import
cn.wisenergy.mapper.AccountMapper
;
import
cn.wisenergy.mapper.BankInfoMapper
;
import
cn.wisenergy.mapper.BankInfoMapper
;
import
cn.wisenergy.mapper.UsersMapper
;
import
cn.wisenergy.mapper.UsersMapper
;
import
cn.wisenergy.model.app.AccountInfo
;
import
cn.wisenergy.model.app.BankInfo
;
import
cn.wisenergy.model.app.BankInfo
;
import
cn.wisenergy.model.app.User
;
import
cn.wisenergy.model.app.User
;
import
cn.wisenergy.model.dto.WithdrawBankDto
;
import
cn.wisenergy.service.app.BankService
;
import
cn.wisenergy.service.app.BankService
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
...
@@ -34,6 +37,9 @@ public class BankServiceImpl extends ServiceImpl<BankInfoMapper, BankInfo> imple
...
@@ -34,6 +37,9 @@ public class BankServiceImpl extends ServiceImpl<BankInfoMapper, BankInfo> imple
@Autowired
@Autowired
private
RedisUtils
redisUtils
;
private
RedisUtils
redisUtils
;
@Autowired
private
AccountMapper
accountMapper
;
@Override
@Override
public
R
<
BankInfo
>
add
(
BankInfo
bankInfo
)
{
public
R
<
BankInfo
>
add
(
BankInfo
bankInfo
)
{
...
@@ -116,7 +122,26 @@ public class BankServiceImpl extends ServiceImpl<BankInfoMapper, BankInfo> imple
...
@@ -116,7 +122,26 @@ public class BankServiceImpl extends ServiceImpl<BankInfoMapper, BankInfo> imple
}
}
@Override
@Override
public
R
<
Boolean
>
userWithdrawBank
(
String
userId
)
{
public
R
<
Boolean
>
userWithdrawBank
(
WithdrawBankDto
dto
)
{
log
.
info
(
"shop-mall[]BankServiceImpl[]edit[]input.param.dto:"
+
dto
);
if
(
null
==
dto
||
StringUtils
.
isBlank
(
dto
.
getUserId
())
||
StringUtils
.
isBlank
(
dto
.
getCode
())
||
null
!=
dto
.
getMoney
())
{
return
R
.
error
(
"入参不能为空!"
);
}
//1、判断提现金额不得超过余额
//获取账户信息
AccountInfo
accountInfo
=
accountMapper
.
getByUserId
(
dto
.
getUserId
());
if
(
null
!=
accountInfo
){
if
(
dto
.
getMoney
()
>
accountInfo
.
getExtractMoney
().
doubleValue
()){
return
R
.
error
(
"提现金额不得超过余额"
);
}
}
//2、验证短信验证码
//3、添加提现交易流水记录
return
null
;
return
null
;
}
}
}
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/WalletServiceImpl.java
View file @
2c164440
...
@@ -78,6 +78,7 @@ public class WalletServiceImpl implements WalletService {
...
@@ -78,6 +78,7 @@ public class WalletServiceImpl implements WalletService {
WithdrawalAmountVo
withdrawalAmountVo
=
new
WithdrawalAmountVo
();
WithdrawalAmountVo
withdrawalAmountVo
=
new
WithdrawalAmountVo
();
withdrawalAmountVo
.
setUserId
(
userId
);
withdrawalAmountVo
.
setUserId
(
userId
);
withdrawalAmountVo
.
setWithdrawRule
(
"这是一条规则!"
);
//1、获取用户账户信息
//1、获取用户账户信息
AccountInfo
accountInfo
=
accountMapper
.
getByUserIdAndTime
(
userId
,
yearMonth
);
AccountInfo
accountInfo
=
accountMapper
.
getByUserIdAndTime
(
userId
,
yearMonth
);
...
...
wisenergy-web-admin/src/main/resources/application-dev.yml
View file @
2c164440
...
@@ -62,7 +62,7 @@ uploadFile:
...
@@ -62,7 +62,7 @@ uploadFile:
location
:
/opt/images/upload_flowChart/
#自定义上传文件服务器硬盘保存路径 ,linux服务器保存路径 /home/changfa/app/wxbjgkpt/upload_flowChart/
location
:
/opt/images/upload_flowChart/
#自定义上传文件服务器硬盘保存路径 ,linux服务器保存路径 /home/changfa/app/wxbjgkpt/upload_flowChart/
file
:
file
:
upload
:
upload
:
path
:
D
:/aplus
path
:
C
:/aplus
jwt
:
jwt
:
# 加密秘钥
# 加密秘钥
secret
:
f4e2e52034348f86b67cde581c0f9eb5
secret
:
f4e2e52034348f86b67cde581c0f9eb5
...
...
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