Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
18f2f52a
Commit
18f2f52a
authored
Nov 08, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
钱包保证金明细
parent
7f0036ee
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
35 additions
and
5 deletions
+35
-5
ch-core/src/main/java/com/wwdz/ch/core/entity/UserAccountVo.java
.../src/main/java/com/wwdz/ch/core/entity/UserAccountVo.java
+12
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/UserAccountServiceImpl.java
...main/java/com/wwdz/ch/wx/impl/UserAccountServiceImpl.java
+14
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/openShop/AuctionEarnestServiceImpl.java
...m/wwdz/ch/wx/impl/openShop/AuctionEarnestServiceImpl.java
+9
-5
No files found.
ch-core/src/main/java/com/wwdz/ch/core/entity/UserAccountVo.java
View file @
18f2f52a
package
com.wwdz.ch.core.entity
;
package
com.wwdz.ch.core.entity
;
import
com.wwdz.ch.core.consts.CommConsts
;
import
com.wwdz.ch.core.util.PriceUtil
;
import
com.wwdz.ch.core.util.PriceUtil
;
import
com.wwdz.ch.db.domain.openShop.UserAccount
;
import
com.wwdz.ch.db.domain.openShop.UserAccount
;
import
com.xxdxxs.entity.Entity
;
import
com.xxdxxs.entity.Entity
;
...
@@ -66,6 +67,16 @@ public class UserAccountVo implements Entity{
...
@@ -66,6 +67,16 @@ public class UserAccountVo implements Entity{
*/
*/
private
String
giftEarnestAmount
;
private
String
giftEarnestAmount
;
/**
* 可出价额度
*/
private
String
usableOfferAmount
;
/**
* 占用的出价额度
*/
private
String
occupyEarnestAmount
;
/**
/**
* 创建时间
* 创建时间
*/
*/
...
@@ -89,6 +100,7 @@ public class UserAccountVo implements Entity{
...
@@ -89,6 +100,7 @@ public class UserAccountVo implements Entity{
userAccountVo
.
setEarnestAmount
(
PriceUtil
.
convertPriceFenToYuan
(
userAccount
.
getEarnestAmount
()));
userAccountVo
.
setEarnestAmount
(
PriceUtil
.
convertPriceFenToYuan
(
userAccount
.
getEarnestAmount
()));
userAccountVo
.
setEarnestUsableAmount
(
PriceUtil
.
convertPriceFenToYuan
(
userAccount
.
getEarnestUsableAmount
()));
userAccountVo
.
setEarnestUsableAmount
(
PriceUtil
.
convertPriceFenToYuan
(
userAccount
.
getEarnestUsableAmount
()));
userAccountVo
.
setGiftEarnestAmount
(
PriceUtil
.
convertPriceFenToYuan
(
userAccount
.
getGiftEarnestAmount
()));
userAccountVo
.
setGiftEarnestAmount
(
PriceUtil
.
convertPriceFenToYuan
(
userAccount
.
getGiftEarnestAmount
()));
userAccountVo
.
setUsableOfferAmount
(
PriceUtil
.
convertPriceFenToYuan
(
userAccount
.
getEarnestUsableAmount
()
*
CommConsts
.
EARNEST_TRANSFORM_AUCTION_REBATE
));
return
userAccountVo
;
return
userAccountVo
;
}
}
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/UserAccountServiceImpl.java
View file @
18f2f52a
package
com.wwdz.ch.wx.impl
;
package
com.wwdz.ch.wx.impl
;
import
com.wwdz.ch.core.consts.CommConsts
;
import
com.wwdz.ch.core.consts.CommConsts
;
import
com.wwdz.ch.core.consts.EarnestEnum
;
import
com.wwdz.ch.core.entity.UserAccountVo
;
import
com.wwdz.ch.core.entity.UserAccountVo
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.core.type.Result
;
import
com.wwdz.ch.core.util.PriceUtil
;
import
com.wwdz.ch.db.dao.openShop.EarnestRecordDao
;
import
com.wwdz.ch.db.dao.openShop.UserAccountDao
;
import
com.wwdz.ch.db.dao.openShop.UserAccountDao
;
import
com.wwdz.ch.db.domain.openShop.UserAccount
;
import
com.wwdz.ch.db.domain.openShop.UserAccount
;
import
com.wwdz.ch.db.dto.request.openShop.EarnestRecordRequestDto
;
import
com.wwdz.ch.wx.service.UserAccountService
;
import
com.wwdz.ch.wx.service.UserAccountService
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
...
@@ -21,6 +25,9 @@ public class UserAccountServiceImpl implements UserAccountService {
...
@@ -21,6 +25,9 @@ public class UserAccountServiceImpl implements UserAccountService {
@Autowired
@Autowired
UserAccountDao
userAccountDao
;
UserAccountDao
userAccountDao
;
@Autowired
EarnestRecordDao
earnestRecordDao
;
@Override
@Override
public
Result
initAccount
(
long
userId
)
{
public
Result
initAccount
(
long
userId
)
{
try
{
try
{
...
@@ -54,6 +61,13 @@ public class UserAccountServiceImpl implements UserAccountService {
...
@@ -54,6 +61,13 @@ public class UserAccountServiceImpl implements UserAccountService {
initAccount
(
userId
);
initAccount
(
userId
);
UserAccount
userAccount
=
userAccountDao
.
findByUserId
(
userId
);
UserAccount
userAccount
=
userAccountDao
.
findByUserId
(
userId
);
UserAccountVo
userAccountVo
=
UserAccountVo
.
convert
(
userAccount
);
UserAccountVo
userAccountVo
=
UserAccountVo
.
convert
(
userAccount
);
//查询被占用的保证金额度
EarnestRecordRequestDto
earnestRecordRequestDto
=
new
EarnestRecordRequestDto
();
earnestRecordRequestDto
.
setUserId
(
userId
);
earnestRecordRequestDto
.
setType
(
EarnestEnum
.
TypeEnum
.
OCCUPY
.
getCode
());
earnestRecordRequestDto
.
setState
(
EarnestEnum
.
StateEnum
.
VALID
.
getCode
());
long
occupyAmount
=
earnestRecordDao
.
sumForOccupy
(
earnestRecordRequestDto
);
userAccountVo
.
setOccupyEarnestAmount
(
PriceUtil
.
convertPriceFenToYuan
(
occupyAmount
*
20
));
return
Result
.
success
(
userAccountVo
);
return
Result
.
success
(
userAccountVo
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
info
(
"查询用户账户失败 error: {}"
,
e
);
logger
.
info
(
"查询用户账户失败 error: {}"
,
e
);
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/openShop/AuctionEarnestServiceImpl.java
View file @
18f2f52a
...
@@ -278,17 +278,21 @@ public class AuctionEarnestServiceImpl implements AuctionEarnestService {
...
@@ -278,17 +278,21 @@ public class AuctionEarnestServiceImpl implements AuctionEarnestService {
long
oldEarnestAmount
=
userAccount
.
getEarnestAmount
();
long
oldEarnestAmount
=
userAccount
.
getEarnestAmount
();
long
earnestUsableAmount
=
userAccount
.
getEarnestUsableAmount
();
long
earnestUsableAmount
=
userAccount
.
getEarnestUsableAmount
();
long
giftEarnestAmount
=
userAccount
.
getGiftEarnestAmount
();
long
giftEarnestAmount
=
userAccount
.
getGiftEarnestAmount
();
//可用的保证金金额
newUserAccount
.
setEarnestUsableAmount
(
earnestUsableAmount
-
occupyAmount
);
if
(
occupyAmount
<=
giftEarnestAmount
)
{
if
(
occupyAmount
<=
giftEarnestAmount
)
{
newUserAccount
.
setEarnestUsableAmount
(
earnestUsableAmount
-
occupyAmount
);
//赠送的保证金足够扣除,就只扣除赠送的部分额度
newUserAccount
.
setGiftEarnestAmount
(
giftEarnestAmount
-
occupyAmount
);
newUserAccount
.
setGiftEarnestAmount
(
giftEarnestAmount
-
occupyAmount
);
}
else
if
(
occupyAmount
>
giftEarnestAmount
)
{
}
else
if
(
occupyAmount
>
giftEarnestAmount
)
{
//赠送的保证金不够扣除,就扣除用户自己的缴纳的保证金
newUserAccount
.
setGiftEarnestAmount
(
0L
);
long
differAmount
=
occupyAmount
-
giftEarnestAmount
;
newUserAccount
.
setEarnestAmount
(
oldEarnestAmount
-
differAmount
);
}
}
userAccountDao
.
update
(
newUserAccount
);
userAccountDao
.
update
(
newUserAccount
);
return
Result
.
success
();
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
logger
.
error
(
"
释放
保证金失败 error : {}"
,
e
);
logger
.
error
(
"
扣除
保证金失败 error : {}"
,
e
);
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
TransactionAspectSupport
.
currentTransactionStatus
().
setRollbackOnly
();
}
finally
{
}
finally
{
if
(
lock
!=
null
&&
lock
.
isHeldByCurrentThread
())
{
if
(
lock
!=
null
&&
lock
.
isHeldByCurrentThread
())
{
...
...
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