Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
dcc8a50d
提交
dcc8a50d
authored
10月 24, 2023
作者:
huyufan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
资金相关
上级
04b9dc0f
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
31 行增加
和
23 行删除
+31
-23
PerformanceResultEnum.java
...java/com/clx/performance/enums/PerformanceResultEnum.java
+1
-1
PageOwnerAccountListParam.java
...m/clx/performance/param/pc/PageOwnerAccountListParam.java
+1
-1
FrozenAccountParam.java
...om/clx/performance/param/pc/owner/FrozenAccountParam.java
+2
-2
OwnerAccountMapper.java
...n/java/com/clx/performance/mapper/OwnerAccountMapper.java
+5
-1
OwnerAccountServiceImpl.java
...clx/performance/service/impl/OwnerAccountServiceImpl.java
+8
-8
OwnerAccountSqlProvider.java
.../clx/performance/sqlProvider/OwnerAccountSqlProvider.java
+0
-9
JobTest.java
...rmance-web/src/test/java/com/clx/performance/JobTest.java
+14
-1
没有找到文件。
performance-api/src/main/java/com/clx/performance/enums/PerformanceResultEnum.java
浏览文件 @
dcc8a50d
...
...
@@ -69,7 +69,7 @@ public enum PerformanceResultEnum implements ResultEnum {
SETTLEMENT_ORDER_STATUS_CHANGED
(
1401
,
"结算单状态已变更,请重新刷新页面"
),
SETTLEMENT_NO_FOUND
(
1401
,
"结算单不存在"
),
MONEY_NO_SAME
(
1501
,
"货主提现金额和平台支付金额不一致"
),
;
private
final
int
code
;
...
...
performance-api/src/main/java/com/clx/performance/param/pc/PageOwnerAccountListParam.java
浏览文件 @
dcc8a50d
...
...
@@ -17,7 +17,7 @@ public class PageOwnerAccountListParam extends PageParam {
private
String
ownerUserNo
;
@ApiModelProperty
(
value
=
"联系电话"
)
private
Integer
mobile
;
private
String
mobile
;
@ApiModelProperty
(
value
=
"账户类型 1:保证金 2:预付运费"
)
private
Integer
accountType
;
...
...
performance-api/src/main/java/com/clx/performance/param/pc/owner/FrozenAccountParam.java
浏览文件 @
dcc8a50d
...
...
@@ -15,9 +15,9 @@ public class FrozenAccountParam {
private
Long
userNo
;
//保证金
private
BigDecimal
frozenBalance
;
//预付运费
private
BigDecimal
frozenBalance
;
//保证金
private
BigDecimal
ensureBalance
;
private
Integer
orderId
;
private
String
orderNo
;
...
...
performance-web/src/main/java/com/clx/performance/mapper/OwnerAccountMapper.java
浏览文件 @
dcc8a50d
...
...
@@ -40,6 +40,9 @@ public interface OwnerAccountMapper extends BaseMapper<OwnerAccount> {
)
Integer
subAccount
(
@Param
(
"account"
)
OwnerAccount
account
,
@Param
(
"now"
)
String
now
);
@SelectProvider
(
type
=
OwnerAccountSqlProvider
.
class
,
method
=
"updateOwnerAccountForConfirm"
)
@Update
(
"update owner_account set frozen_balance = frozen_balance - #{account.frozenBalance},"
+
"modified_time=#{now}"
+
"where id = #{account.id} and modified_time = #{account.modifiedTime}"
)
Integer
updateOwnerAccountForConfirm
(
OwnerAccount
account
);
}
\ No newline at end of file
performance-web/src/main/java/com/clx/performance/service/impl/OwnerAccountServiceImpl.java
浏览文件 @
dcc8a50d
...
...
@@ -328,7 +328,7 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
BigDecimal
caseOutBalance
=
ownerCaseOut
.
getCaseOutBalance
();
BigDecimal
platformPayBalance
=
ownerCaseOut
.
getPlatformPayBalance
();
if
(
platformPayBalance
.
compareTo
(
caseOutBalance
)
!=
0
)
{
throw
new
ServiceSystemException
(
PerformanceResultEnum
.
HTTP_ERROR
,
"货主提现金额和平台支付金额不一致"
);
throw
new
ServiceSystemException
(
PerformanceResultEnum
.
MONEY_NO_SAME
);
}
//给对应账户减少金额
...
...
@@ -627,26 +627,26 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
entity
.
setId
(
ownerAccount
.
getId
());
entity
.
setModifiedTime
(
ownerAccount
.
getModifiedTime
());
if
(
ownerAccount
.
getAccountType
().
equals
(
OwnerAccountEnum
.
AccountTypeStatus
.
MARGIN_ACCOUNT
.
getCode
()))
{
if
(
ownerAccount
.
getUsableBalance
().
compareTo
(
frozen
Balance
)
<
0
)
{
if
(
ownerAccount
.
getUsableBalance
().
compareTo
(
ensure
Balance
)
<
0
)
{
throw
new
ServiceSystemException
(
PerformanceResultEnum
.
HTTP_ERROR
,
"当前货主保证金账户可用余额不够冻结"
);
}
//冻结金额
entity
.
setFrozenBalance
(
frozen
Balance
);
entity
.
setFrozenBalance
(
ensure
Balance
);
//可用余额
entity
.
setUsableBalance
(
frozen
Balance
);
entity
.
setUsableBalance
(
ensure
Balance
);
//账户余额
entity
.
setAccountBalance
(
frozen
Balance
);
entity
.
setAccountBalance
(
ensure
Balance
);
//updateList.add(entity);
flag
+=
ownerAccountDao
.
updateAccountCAS
(
entity
,
now
,
false
);
}
else
{
if
(
ownerAccount
.
getUsableBalance
().
compareTo
(
ensure
Balance
)
<
0
)
{
if
(
ownerAccount
.
getUsableBalance
().
compareTo
(
frozen
Balance
)
<
0
)
{
throw
new
ServiceSystemException
(
PerformanceResultEnum
.
HTTP_ERROR
,
"当前货主预付运费账户可用余额不够冻结"
);
}
//冻结金额
entity
.
setFrozenBalance
(
ensure
Balance
);
entity
.
setFrozenBalance
(
frozen
Balance
);
//可用余额
entity
.
setUsableBalance
(
ensure
Balance
);
entity
.
setUsableBalance
(
frozen
Balance
);
//账户余额
entity
.
setAccountBalance
(
frozenBalance
);
//updateList.add(entity);
...
...
performance-web/src/main/java/com/clx/performance/sqlProvider/OwnerAccountSqlProvider.java
浏览文件 @
dcc8a50d
...
...
@@ -64,13 +64,4 @@ public class OwnerAccountSqlProvider {
return
sqlList
.
toString
();
}
public
String
updateOwnerAccountForConfirm
(
OwnerAccount
account
)
{
StringBuffer
sqlList
=
new
StringBuffer
();
sqlList
.
append
(
"update owner_account set frozen_balance = frozen_balance -"
+
account
.
getFrozenBalance
()
+
"where id = "
+
account
.
getId
()
+
"and modified_time = '"
+
DateUtils
.
formatDateTime
(
account
.
getModifiedTime
(),
"yyyy-MM-dd HH:mm:ss"
).
get
()+
"'"
);
return
sqlList
.
toString
();
}
}
performance-web/src/test/java/com/clx/performance/JobTest.java
浏览文件 @
dcc8a50d
...
...
@@ -11,16 +11,20 @@ import com.clx.performance.constant.RabbitKeyConstants;
import
com.clx.performance.constant.RedisConstants
;
import
com.clx.performance.dao.OrderGoodsDao
;
import
com.clx.performance.dao.OwnerAccountDao
;
import
com.clx.performance.dao.OwnerCaseOutDao
;
import
com.clx.performance.enums.OrderGoodsStatusEnum
;
import
com.clx.performance.enums.OrderGoodsTruckBindEnum
;
import
com.clx.performance.enums.PerformanceResultEnum
;
import
com.clx.performance.feign.PerformanceFeign
;
import
com.clx.performance.mapper.OrderGoodsMapper
;
import
com.clx.performance.model.OrderGoods
;
import
com.clx.performance.model.OwnerAccount
;
import
com.clx.performance.model.OwnerCaseOut
;
import
com.clx.performance.param.pc.OwnerCaseOutParam
;
import
com.clx.performance.param.pc.owner.FrozenAccountParam
;
import
com.clx.performance.service.OwnerAccountService
;
import
com.msl.common.base.Optional
;
import
com.msl.common.exception.ServiceSystemException
;
import
com.msl.common.result.Result
;
import
org.junit.Test
;
import
org.junit.runner.RunWith
;
...
...
@@ -69,8 +73,17 @@ public class JobTest {
@Autowired
private
PerformanceFeign
performanceFeign
;
@Autowired
private
OwnerCaseOutDao
ownerCaseOutDao
;
@Test
public
void
test1
()
{
Optional
<
OwnerCaseOut
>
optional
=
ownerCaseOutDao
.
getEntityByKey
(
19
);
OwnerCaseOut
ownerCaseOut
=
optional
.
get
();
BigDecimal
caseOutBalance
=
ownerCaseOut
.
getCaseOutBalance
();
BigDecimal
platformPayBalance
=
ownerCaseOut
.
getPlatformPayBalance
();
if
(
platformPayBalance
.
compareTo
(
caseOutBalance
)
!=
0
)
{
throw
new
ServiceSystemException
(
PerformanceResultEnum
.
MONEY_NO_SAME
);
}
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论