Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
105da5dd
提交
105da5dd
authored
11月 08, 2023
作者:
huyufan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
预付运费和保证金账户如果是0,不进行冻结可扣款流水
上级
4da8f242
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
21 行增加
和
0 行删除
+21
-0
OwnerAccountServiceImpl.java
...clx/performance/service/impl/OwnerAccountServiceImpl.java
+21
-0
没有找到文件。
performance-web/src/main/java/com/clx/performance/service/impl/OwnerAccountServiceImpl.java
浏览文件 @
105da5dd
...
@@ -655,6 +655,8 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
...
@@ -655,6 +655,8 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
String
ownerName
=
""
;
String
ownerName
=
""
;
BigDecimal
frozenBalance
=
param
.
getFrozenBalance
();
BigDecimal
frozenBalance
=
param
.
getFrozenBalance
();
BigDecimal
ensureBalance
=
param
.
getEnsureBalance
();
BigDecimal
ensureBalance
=
param
.
getEnsureBalance
();
boolean
ensureBalanceZeroFlag
=
false
;
boolean
frozenBalanceZeroFlag
=
false
;
Integer
orderId
=
param
.
getOrderId
();
Integer
orderId
=
param
.
getOrderId
();
String
orderNo
=
param
.
getOrderNo
();
String
orderNo
=
param
.
getOrderNo
();
LocalDateTime
now
=
LocalDateTime
.
now
();
LocalDateTime
now
=
LocalDateTime
.
now
();
...
@@ -677,6 +679,10 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
...
@@ -677,6 +679,10 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
if
(
ownerAccount
.
getUsableBalance
().
compareTo
(
ensureBalance
)
<
0
)
{
if
(
ownerAccount
.
getUsableBalance
().
compareTo
(
ensureBalance
)
<
0
)
{
throw
new
ServiceSystemException
(
PerformanceResultEnum
.
HTTP_ERROR
,
"当前货主保证金账户可用余额不够冻结"
);
throw
new
ServiceSystemException
(
PerformanceResultEnum
.
HTTP_ERROR
,
"当前货主保证金账户可用余额不够冻结"
);
}
}
if
(
ensureBalance
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
)
{
flag
+=
1
;
ensureBalanceZeroFlag
=
true
;
}
else
{
//冻结金额
//冻结金额
entity
.
setFrozenBalance
(
ensureBalance
);
entity
.
setFrozenBalance
(
ensureBalance
);
//可用余额
//可用余额
...
@@ -686,10 +692,16 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
...
@@ -686,10 +692,16 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
//updateList.add(entity);
//updateList.add(entity);
flag
+=
ownerAccountDao
.
updateAccountCAS
(
entity
,
now
,
false
);
flag
+=
ownerAccountDao
.
updateAccountCAS
(
entity
,
now
,
false
);
}
}
else
{
}
else
{
if
(
ownerAccount
.
getUsableBalance
().
compareTo
(
frozenBalance
)
<
0
)
{
if
(
ownerAccount
.
getUsableBalance
().
compareTo
(
frozenBalance
)
<
0
)
{
throw
new
ServiceSystemException
(
PerformanceResultEnum
.
HTTP_ERROR
,
"当前货主预付运费账户可用余额不够冻结"
);
throw
new
ServiceSystemException
(
PerformanceResultEnum
.
HTTP_ERROR
,
"当前货主预付运费账户可用余额不够冻结"
);
}
}
if
(
frozenBalance
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
)
{
flag
+=
1
;
frozenBalanceZeroFlag
=
true
;
}
else
{
//冻结金额
//冻结金额
entity
.
setFrozenBalance
(
frozenBalance
);
entity
.
setFrozenBalance
(
frozenBalance
);
//可用余额
//可用余额
...
@@ -700,6 +712,7 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
...
@@ -700,6 +712,7 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
flag
+=
ownerAccountDao
.
updateAccountCAS
(
entity
,
now
,
false
);
flag
+=
ownerAccountDao
.
updateAccountCAS
(
entity
,
now
,
false
);
}
}
}
}
}
if
(
flag
==
2
)
{
if
(
flag
==
2
)
{
log
.
info
(
"冻结账户完毕"
);
log
.
info
(
"冻结账户完毕"
);
log
.
info
(
"插入保证金冻结流水"
);
log
.
info
(
"插入保证金冻结流水"
);
...
@@ -707,6 +720,10 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
...
@@ -707,6 +720,10 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
for
(
OwnerAccount
ownerAccount
:
accountList
)
{
for
(
OwnerAccount
ownerAccount
:
accountList
)
{
if
(
ownerAccount
.
getAccountType
().
equals
(
OwnerAccountEnum
.
AccountTypeStatus
.
MARGIN_ACCOUNT
.
getCode
()))
{
if
(
ownerAccount
.
getAccountType
().
equals
(
OwnerAccountEnum
.
AccountTypeStatus
.
MARGIN_ACCOUNT
.
getCode
()))
{
log
.
info
(
"插入保证金冻结流水"
);
log
.
info
(
"插入保证金冻结流水"
);
if
(
ensureBalanceZeroFlag
)
{
log
.
info
(
"保证金账户需冻结金额为0,不产生流水"
);
continue
;
}
OwnerRunningWaterRecord
marginAccount
=
new
OwnerRunningWaterRecord
();
OwnerRunningWaterRecord
marginAccount
=
new
OwnerRunningWaterRecord
();
marginAccount
.
setOwnerUserName
(
ownerName
);
marginAccount
.
setOwnerUserName
(
ownerName
);
marginAccount
.
setMobile
(
mobile
);
marginAccount
.
setMobile
(
mobile
);
...
@@ -728,6 +745,10 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
...
@@ -728,6 +745,10 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
ownerRunningWaterRecordDao
.
saveEntity
(
marginAccount
);
ownerRunningWaterRecordDao
.
saveEntity
(
marginAccount
);
}
else
{
}
else
{
log
.
info
(
"插入预付运费冻结流水"
);
log
.
info
(
"插入预付运费冻结流水"
);
if
(
frozenBalanceZeroFlag
)
{
log
.
info
(
"保证金账户需冻结金额为0,不产生流水"
);
continue
;
}
OwnerRunningWaterRecord
prepaidFreight
=
new
OwnerRunningWaterRecord
();
OwnerRunningWaterRecord
prepaidFreight
=
new
OwnerRunningWaterRecord
();
prepaidFreight
.
setOwnerUserName
(
ownerName
);
prepaidFreight
.
setOwnerUserName
(
ownerName
);
prepaidFreight
.
setMobile
(
mobile
);
prepaidFreight
.
setMobile
(
mobile
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论