Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
S
shop-Mall
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
shop-Mall
Commits
78094132
Commit
78094132
authored
Mar 29, 2021
by
licc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增版本更新接口
parent
7b898ff7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
80 additions
and
7 deletions
+80
-7
TradeRecordMapper.java
.../src/main/java/cn/wisenergy/mapper/TradeRecordMapper.java
+2
-0
TradeRecordMapper.xml
...gy-mapper/src/main/resources/mapper/TradeRecordMapper.xml
+12
-4
BankManger.java
...rc/main/java/cn/wisenergy/service/Manager/BankManger.java
+2
-2
AccountService.java
...rc/main/java/cn/wisenergy/service/app/AccountService.java
+9
-0
AccountServiceImpl.java
...ava/cn/wisenergy/service/app/impl/AccountServiceImpl.java
+30
-1
BankServiceImpl.java
...n/java/cn/wisenergy/service/app/impl/BankServiceImpl.java
+12
-0
AccountController.java
...wisenergy/web/admin/controller/app/AccountController.java
+13
-0
No files found.
wisenergy-mapper/src/main/java/cn/wisenergy/mapper/TradeRecordMapper.java
View file @
78094132
...
...
@@ -122,4 +122,6 @@ public interface TradeRecordMapper extends BaseMapper<TradeRecord> {
*/
List
<
TradeRecord
>
getList
(
Map
<
String
,
Object
>
map
);
TradeRecord
getVersion
();
}
wisenergy-mapper/src/main/resources/mapper/TradeRecordMapper.xml
View file @
78094132
...
...
@@ -226,4 +226,12 @@
limit #{startNum},#{endNum}
</select>
<select
id=
"getVersion"
resultType=
"cn.wisenergy.model.app.TradeRecord"
>
select
<include
refid=
"cols_all"
/>
from
<include
refid=
"table"
/>
where trade_type=9
</select>
</mapper>
\ No newline at end of file
wisenergy-service/src/main/java/cn/wisenergy/service/Manager/BankManger.java
View file @
78094132
...
...
@@ -68,9 +68,9 @@ public class BankManger {
}
}
//
新增交易流水记录
//
更改提现状态
if
(
null
!=
record
)
{
int
count
=
recordMapper
.
add
(
record
);
int
count
=
recordMapper
.
edit
(
record
);
return
count
!=
0
;
}
return
true
;
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/AccountService.java
View file @
78094132
...
...
@@ -22,8 +22,17 @@ public interface AccountService {
/**
* 获取账户列表
*
* @param query 查询条件
* @return 账户列表
*/
R
<
PageInfo
<
AccountInfo
>>
getList
(
AccountInfoQuery
query
);
/**
* 版本更新
*
* @param version 版本号
* @return 安装包下载地址
*/
R
<
String
>
updateVersion
(
String
version
);
}
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/AccountServiceImpl.java
View file @
78094132
...
...
@@ -40,6 +40,15 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
@Autowired
private
AccountMapper
accountMapper
;
@Autowired
private
TradeRecordMapper
tradeRecordMapper
;
/**
* 测试安卓包路径:https://www.xitiansen.com/upload/app-debug.apk
* 线上安卓包路径:http://app.xitiansen.com/upload/xitiansen.apk
*/
private
static
final
String
DOWNLOAD_URL
=
"https://www.xitiansen.com/upload/app-debug.apk"
;
@Override
public
R
<
AccountInfo
>
getByUserId
(
String
userId
)
{
AccountInfo
accountInfo
=
accountMapper
.
getByUserId
(
userId
);
...
...
@@ -55,7 +64,7 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
pageHandle
(
query
);
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
int
total
=
accountMapper
.
count
();
map
.
put
(
"startNum"
,
query
.
getStartNum
());
...
...
@@ -69,6 +78,26 @@ public class AccountServiceImpl extends ServiceImpl<AccountMapper, AccountInfo>
return
R
.
ok
(
info
);
}
@Override
public
R
<
String
>
updateVersion
(
String
version
)
{
log
.
info
(
"shop-mall[]AccountServiceImpl[]updateVersion[]input.param.version:"
+
version
);
if
(
StringUtils
.
isBlank
(
version
))
{
return
R
.
error
(
"入参不能为空!"
);
}
//获取版本号信息
TradeRecord
tradeRecord
=
tradeRecordMapper
.
getVersion
();
if
(
null
==
tradeRecord
)
{
return
R
.
error
(
"版本号信息不存在,请联系管理员!"
);
}
//版本号不相等
if
(!
tradeRecord
.
getTradeNo
().
equals
(
version
))
{
return
R
.
ok
(
DOWNLOAD_URL
);
}
return
R
.
ok
(
"当前已是最新版本!"
);
}
/**
* 分页处理方法
*
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/app/impl/BankServiceImpl.java
View file @
78094132
...
...
@@ -204,6 +204,7 @@ public class BankServiceImpl extends ServiceImpl<BankInfoMapper, BankInfo> imple
BigDecimal
earningsTotal
=
accountInfo
.
getEarningsTotal
().
subtract
(
money
);
accountInfo
.
setEarningsTotal
(
earningsTotal
);
//4、添加提现交易流水记录
TradeRecord
tradeRecord
=
new
TradeRecord
();
tradeRecord
.
setUserId
(
accountInfo
.
getUserId
());
...
...
@@ -212,6 +213,13 @@ public class BankServiceImpl extends ServiceImpl<BankInfoMapper, BankInfo> imple
tradeRecord
.
setStatus
(
TradeStatusEnum
.
BANK_TRANSFER_ACCOUNTS
.
getCode
());
tradeRecord
.
setMoney
(
money
);
//获取用户银行卡信息
BankInfo
bankInfo
=
bankInfoMapper
.
getByUserId
(
dto
.
getUserId
());
if
(
null
!=
bankInfo
&&
StringUtils
.
isNotEmpty
(
bankInfo
.
getCardNumber
()))
{
tradeRecord
.
setCardNumber
(
bankInfo
.
getCardNumber
());
}
//更新提现状态,更新账户冻结金额
Boolean
bool
=
bankManger
.
updateAccountAddRecord
(
accountInfo
,
tradeRecord
);
if
(!
bool
)
{
return
R
.
ok
(
1
,
false
);
...
...
@@ -282,6 +290,10 @@ public class BankServiceImpl extends ServiceImpl<BankInfoMapper, BankInfo> imple
return
R
.
error
(
"提现账户信息不存在!"
);
}
tradeRecord
.
setStatus
(
TradeStatusEnum
.
WITHDRAWAL_SUCCESS
.
getCode
());
BigDecimal
frozenMoney
=
accountInfo
.
getFrozenMoney
().
subtract
(
tradeRecord
.
getMoney
());
accountInfo
.
setFrozenMoney
(
frozenMoney
);
//更新提现状态为 提现成功,更新账户冻结金额
boolean
bool
=
bankManger
.
updateAccountAndRecord
(
accountInfo
,
tradeRecord
);
if
(!
bool
)
{
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/AccountController.java
View file @
78094132
...
...
@@ -10,6 +10,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
...
@@ -40,4 +41,16 @@ public class AccountController extends BaseController {
public
R
<
PageInfo
<
AccountInfo
>>
getList
(
AccountInfoQuery
query
)
{
return
accountService
.
getList
(
query
);
}
@ApiOperation
(
value
=
"设置页-版本更新"
,
notes
=
"设置页-版本更新"
,
httpMethod
=
"GET"
)
@ApiImplicitParam
(
name
=
"version"
,
value
=
"版本号"
,
dataType
=
"string"
)
@GetMapping
(
"/version"
)
public
R
<
String
>
version
(
String
version
)
{
if
(
StringUtils
.
isBlank
(
version
)){
return
R
.
error
(
"入参不能为空!"
);
}
return
accountService
.
updateVersion
(
version
);
}
}
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