Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
48f02ca8
提交
48f02ca8
authored
10月 16, 2023
作者:
huyufan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
资金管理
上级
2bc243a9
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
104 行增加
和
4 行删除
+104
-4
IdTypeEnum.java
...i/src/main/java/com/clx/performance/enums/IdTypeEnum.java
+4
-1
OwnerCaseOutApproveParam.java
...om/clx/performance/param/pc/OwnerCaseOutApproveParam.java
+5
-0
OwnerAccountRunningWaterRecordVO.java
...x/performance/vo/pc/OwnerAccountRunningWaterRecordVO.java
+3
-0
OwnerAccountController.java
...rformance/controller/pc/owner/OwnerAccountController.java
+9
-0
OwnerCaseOut.java
...src/main/java/com/clx/performance/model/OwnerCaseOut.java
+6
-0
OwnerRunningWaterRecord.java
...va/com/clx/performance/model/OwnerRunningWaterRecord.java
+8
-2
OwnerAccountService.java
...java/com/clx/performance/service/OwnerAccountService.java
+6
-0
OwnerAccountServiceImpl.java
...clx/performance/service/impl/OwnerAccountServiceImpl.java
+63
-1
没有找到文件。
performance-api/src/main/java/com/clx/performance/enums/IdTypeEnum.java
浏览文件 @
48f02ca8
...
...
@@ -13,7 +13,10 @@ public enum IdTypeEnum {
@AllArgsConstructor
public
enum
Type
{
TOP_UP
(
1L
,
"充值"
),
CASE_OUT
(
2L
,
"提现"
)
CASE_OUT
(
2L
,
"提现"
),
CASE_OUT_FROZEN
(
3L
,
"提现冻结"
),
CASE_OUT_SUCCESS
(
4L
,
"提现成功"
),
TOP_UP_SUCCESS
(
5L
,
"充值成功"
),
;
private
final
Long
code
;
private
final
String
msg
;
...
...
performance-api/src/main/java/com/clx/performance/param/pc/OwnerCaseOutApproveParam.java
浏览文件 @
48f02ca8
...
...
@@ -7,6 +7,8 @@ import lombok.NoArgsConstructor;
import
lombok.Setter
;
import
lombok.ToString
;
import
java.math.BigDecimal
;
@ApiModel
(
description
=
"提现审批"
)
@Getter
@Setter
...
...
@@ -26,4 +28,7 @@ public class OwnerCaseOutApproveParam {
@ApiModelProperty
(
value
=
"付款凭证"
,
example
=
"a.png"
)
private
String
paymentProof
;
@ApiModelProperty
(
value
=
"平台付款金额"
,
example
=
"11.21"
)
private
BigDecimal
platformPayBalance
;
}
performance-api/src/main/java/com/clx/performance/vo/pc/OwnerAccountRunningWaterRecordVO.java
浏览文件 @
48f02ca8
...
...
@@ -19,6 +19,9 @@ public class OwnerAccountRunningWaterRecordVO {
*/
@ApiModelProperty
(
"id"
)
private
Integer
id
;
@ApiModelProperty
(
"流水号"
)
private
Long
runningWaterNo
;
/**
* 货主编码
*/
...
...
performance-web/src/main/java/com/clx/performance/controller/pc/owner/OwnerAccountController.java
浏览文件 @
48f02ca8
...
...
@@ -20,6 +20,7 @@ import lombok.extern.slf4j.Slf4j;
import
org.springframework.validation.annotation.Validated
;
import
org.springframework.web.bind.annotation.*
;
import
javax.validation.constraints.NotNull
;
import
java.util.List
;
@Slf4j
...
...
@@ -79,6 +80,14 @@ public class OwnerAccountController {
return
Result
.
ok
(
id
);
}
@ApiOperation
(
value
=
"货主付款确认"
,
notes
=
"<br>By:胡宇帆"
)
@PostMapping
(
"/accountBalanceConfirm"
)
@UnitCovert
(
param
=
false
)
public
void
accountBalanceConfirm
(
@RequestParam
@NotNull
(
message
=
"编号不能为空"
)
Integer
id
)
{
ownerAccountService
.
accountBalanceConfirm
(
id
);
}
@ApiOperation
(
value
=
"货主账户流水列表"
,
notes
=
"<br>By:胡宇帆"
)
@PostMapping
(
"/ownerAccountRunningWaterPageList"
)
@UnitCovert
(
param
=
false
)
...
...
performance-web/src/main/java/com/clx/performance/model/OwnerCaseOut.java
浏览文件 @
48f02ca8
...
...
@@ -86,6 +86,12 @@ public class OwnerCaseOut implements HasKey<Integer> {
*/
@TableField
(
"platform_payment_bank_number"
)
private
String
platformPaymentBankNumber
;
/**
* 平台付款金额
*/
@TableField
(
"platform_pay_balance"
)
private
BigDecimal
platformPayBalance
;
/**
* 付款人
*/
...
...
performance-web/src/main/java/com/clx/performance/model/OwnerRunningWaterRecord.java
浏览文件 @
48f02ca8
...
...
@@ -30,6 +30,12 @@ public class OwnerRunningWaterRecord implements HasKey<Integer> {
*/
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Integer
id
;
/**
* 流水号
*/
@TableField
(
"running_water_no"
)
private
Long
runningWaterNo
;
/**
* 货主编码
*/
...
...
@@ -52,10 +58,10 @@ public class OwnerRunningWaterRecord implements HasKey<Integer> {
private
Integer
accountType
;
/**
* 关联数据
主键ID
* 关联数据
编号
*/
@TableField
(
"relation_id"
)
private
Integer
relationId
;
private
Long
relationId
;
/**
* 流水类型
*/
...
...
performance-web/src/main/java/com/clx/performance/service/OwnerAccountService.java
浏览文件 @
48f02ca8
...
...
@@ -30,4 +30,10 @@ public interface OwnerAccountService {
* @param param
*/
void
accountCaseOutApprove
(
OwnerCaseOutApproveParam
param
);
/**
* 货主付款确认
* @param id
*/
void
accountBalanceConfirm
(
Integer
id
);
}
performance-web/src/main/java/com/clx/performance/service/impl/OwnerAccountServiceImpl.java
浏览文件 @
48f02ca8
...
...
@@ -81,6 +81,7 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
Long
accountCaseOut
(
OwnerCaseOutParam
param
)
{
//提现记录
OwnerCaseOut
entity
=
new
OwnerCaseOut
();
...
...
@@ -93,6 +94,27 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
entity
.
setCaseOutBankNumber
(
param
.
getCaseOutBankNumber
());
ownerCaseOutDao
.
saveEntity
(
entity
);
//插入冻结流水
OwnerRunningWaterRecord
runningWaterRecord
=
new
OwnerRunningWaterRecord
();
BigDecimal
caseOutBalance
=
param
.
getCaseOutBalance
();
runningWaterRecord
.
setOwnerName
(
"测试"
);
runningWaterRecord
.
setMobile
(
"11111111111"
);
runningWaterRecord
.
setCreateBy
(
"操作人测试"
);
runningWaterRecord
.
setRelationId
(
entity
.
getCaseOutNo
());
runningWaterRecord
.
setAccountBalance
(
caseOutBalance
);
runningWaterRecord
.
setOwnerUserNo
(
param
.
getOwnerUserNo
());
runningWaterRecord
.
setAccountType
(
param
.
getAccountType
());
runningWaterRecord
.
setRunningWaterType
(
OwnerAccountEnum
.
RunningWaterStatus
.
FROZEN
.
getCode
());
runningWaterRecord
.
setRunningWaterNo
(
idGenerateSnowFlake
.
nextId
(
IdTypeEnum
.
Type
.
CASE_OUT_FROZEN
.
getCode
()));
ownerRunningWaterRecordDao
.
saveEntity
(
runningWaterRecord
);
//冻结账户可用金额
OwnerAccount
account
=
ownerAccountDao
.
getAccountByOwnerUserNoAndAccountType
(
param
.
getOwnerUserNo
(),
param
.
getAccountType
());
OwnerAccount
update
=
new
OwnerAccount
();
update
.
setUsableBalance
(
account
.
getUsableBalance
().
subtract
(
caseOutBalance
));
update
.
setFrozenBalance
(
account
.
getFrozenBalance
().
add
(
caseOutBalance
));
update
.
setId
(
account
.
getId
());
ownerAccountDao
.
updateEntityByKey
(
update
);
return
entity
.
getCaseOutNo
();
}
...
...
@@ -124,12 +146,13 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
runningWaterRecord
.
setMobile
(
"11111111111"
);
runningWaterRecord
.
setCreateBy
(
"操作人测试"
);
runningWaterRecord
.
setRelationId
(
ownerTopUp
.
get
Id
());
runningWaterRecord
.
setRelationId
(
ownerTopUp
.
get
TopUpNo
());
runningWaterRecord
.
setAccountBalance
(
topUpBalance
);
runningWaterRecord
.
setOwnerUserNo
(
param
.
getOwnerUserNo
());
runningWaterRecord
.
setAccountType
(
param
.
getAccountType
());
runningWaterRecord
.
setRunningWaterType
(
OwnerAccountEnum
.
RunningWaterStatus
.
TOP_UP
.
getCode
());
runningWaterRecord
.
setRunningWaterNo
(
idGenerateSnowFlake
.
nextId
(
IdTypeEnum
.
Type
.
TOP_UP_SUCCESS
.
getCode
()));
ownerRunningWaterRecordDao
.
saveEntity
(
runningWaterRecord
);
//给对应账户增加金额
...
...
@@ -153,6 +176,45 @@ public class OwnerAccountServiceImpl implements OwnerAccountService {
entity
.
setPaymentProof
(
param
.
getPaymentProof
());
entity
.
setPlatformPaymentBank
(
entity
.
getPlatformPaymentBank
());
entity
.
setPlatformPaymentBankNumber
(
param
.
getPlatformPaymentBankNumber
());
entity
.
setPlatformPayBalance
(
param
.
getPlatformPayBalance
());
entity
.
setStatus
(
OwnerAccountEnum
.
CaseOutStatus
.
TO_BE_CONFIRMED
.
getCode
());
ownerCaseOutDao
.
updateEntityByKey
(
entity
);
}
@Override
public
void
accountBalanceConfirm
(
Integer
id
)
{
Optional
<
OwnerCaseOut
>
optional
=
ownerCaseOutDao
.
getEntityByKey
(
id
);
if
(!
optional
.
isPresent
())
{
throw
new
ServiceSystemException
(
PerformanceResultEnum
.
HTTP_ERROR
,
"当前ID未查询到有效记录"
);
}
OwnerCaseOut
ownerCaseOut
=
optional
.
get
();
BigDecimal
caseOutBalance
=
ownerCaseOut
.
getCaseOutBalance
();
BigDecimal
platformPayBalance
=
ownerCaseOut
.
getPlatformPayBalance
();
if
(
platformPayBalance
.
compareTo
(
caseOutBalance
)
!=
0
)
{
throw
new
ServiceSystemException
(
PerformanceResultEnum
.
HTTP_ERROR
,
"货主提现金额和平台支付金额不一致"
);
}
//插入提现成功流水
OwnerRunningWaterRecord
runningWaterRecord
=
new
OwnerRunningWaterRecord
();
runningWaterRecord
.
setOwnerName
(
"测试"
);
runningWaterRecord
.
setMobile
(
"11111111111"
);
runningWaterRecord
.
setCreateBy
(
"操作人"
);
runningWaterRecord
.
setRelationId
(
ownerCaseOut
.
getCaseOutNo
());
runningWaterRecord
.
setAccountBalance
(
caseOutBalance
);
runningWaterRecord
.
setOwnerUserNo
(
ownerCaseOut
.
getOwnerUserNo
());
runningWaterRecord
.
setAccountType
(
ownerCaseOut
.
getAccountType
());
runningWaterRecord
.
setRunningWaterType
(
OwnerAccountEnum
.
RunningWaterStatus
.
CASE_OUT_SUCCESS
.
getCode
());
runningWaterRecord
.
setRunningWaterNo
(
idGenerateSnowFlake
.
nextId
(
IdTypeEnum
.
Type
.
CASE_OUT_SUCCESS
.
getCode
()));
ownerRunningWaterRecordDao
.
saveEntity
(
runningWaterRecord
);
//给对应账户减少金额
OwnerAccount
account
=
ownerAccountDao
.
getAccountByOwnerUserNoAndAccountType
(
ownerCaseOut
.
getOwnerUserNo
(),
ownerCaseOut
.
getAccountType
());
OwnerAccount
update
=
new
OwnerAccount
();
update
.
setAccountBalance
(
account
.
getAccountBalance
().
subtract
(
caseOutBalance
));
update
.
setUsableBalance
(
account
.
getUsableBalance
().
subtract
(
caseOutBalance
));
update
.
setFrozenBalance
(
account
.
getFrozenBalance
().
subtract
(
caseOutBalance
));
update
.
setId
(
account
.
getId
());
ownerAccountDao
.
updateEntityByKey
(
update
);
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论