Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
clx-performance
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
姜武杰
clx-performance
Commits
99bafec2
提交
99bafec2
authored
2月 27, 2024
作者:
liuhaiquan
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/v10.7_borrowing_and_repayment_20240118'…
Merge remote-tracking branch 'origin/v10.7_borrowing_and_repayment_20240118' into v10.7_borrowing_and_repayment_20240118
上级
dc19677b
314030b0
隐藏空白字符变更
内嵌
并排
正在显示
20 个修改的文件
包含
221 行增加
和
44 行删除
+221
-44
OwnerLoanRecordEnum.java
...a/com/clx/performance/enums/loan/OwnerLoanRecordEnum.java
+1
-1
CarrierPageSettlementDriverDetailVO.java
...c/carrier/settle/CarrierPageSettlementDriverDetailVO.java
+1
-1
CarrierPageSettlementDriverVO.java
...e/vo/pc/carrier/settle/CarrierPageSettlementDriverVO.java
+1
-1
CarrierPageSettlementOwnerVO.java
...ce/vo/pc/carrier/settle/CarrierPageSettlementOwnerVO.java
+1
-0
OrderChildLoanComponent.java
...om/clx/performance/component/OrderChildLoanComponent.java
+1
-1
OwnerLoanAccountRunningWaterRecordDaoImpl.java
.../impl/loan/OwnerLoanAccountRunningWaterRecordDaoImpl.java
+8
-0
OwnerLoanRecordDaoImpl.java
...clx/performance/dao/impl/loan/OwnerLoanRecordDaoImpl.java
+2
-2
SettlementDriverDaoImpl.java
.../performance/dao/impl/settle/SettlementDriverDaoImpl.java
+9
-0
SettlementDriverDetailDaoImpl.java
...rmance/dao/impl/settle/SettlementDriverDetailDaoImpl.java
+10
-0
OwnerLoanAccountRunningWaterRecordDao.java
...mance/dao/loan/OwnerLoanAccountRunningWaterRecordDao.java
+2
-0
SettlementDriverDao.java
...a/com/clx/performance/dao/settle/SettlementDriverDao.java
+4
-0
SettlementDriverDetailDao.java
...clx/performance/dao/settle/SettlementDriverDetailDao.java
+2
-0
SettlementOwnerDetailDao.java
.../clx/performance/dao/settle/SettlementOwnerDetailDao.java
+1
-0
EventListenerComponent.java
...ava/com/clx/performance/event/EventListenerComponent.java
+37
-0
OwnerLoanFlagEvent.java
...in/java/com/clx/performance/event/OwnerLoanFlagEvent.java
+30
-0
OwnerLoanAccountMapper.java
...m/clx/performance/mapper/loan/OwnerLoanAccountMapper.java
+2
-2
OwnerLoanRecordServiceImpl.java
...ormance/service/impl/loan/OwnerLoanRecordServiceImpl.java
+65
-24
OwnerRepaymentServiceImpl.java
...formance/service/impl/loan/OwnerRepaymentServiceImpl.java
+40
-9
SettlementDriverDetailStruct.java
...rformance/struct/settle/SettlementDriverDetailStruct.java
+3
-1
SettlementDriverStruct.java
...clx/performance/struct/settle/SettlementDriverStruct.java
+1
-2
没有找到文件。
performance-api/src/main/java/com/clx/performance/enums/loan/OwnerLoanRecordEnum.java
浏览文件 @
99bafec2
...
@@ -70,7 +70,7 @@ public enum OwnerLoanRecordEnum {
...
@@ -70,7 +70,7 @@ public enum OwnerLoanRecordEnum {
}
}
public
static
String
getMsgByCode
(
Integer
code
)
{
public
static
String
getMsgByCode
(
Integer
code
)
{
return
getByCode
(
code
).
map
(
LoanFlag:
:
getMsg
).
orElse
(
null
);
return
getByCode
(
code
).
map
(
LoanFlag:
:
getMsg
).
orElse
(
"无需借款"
);
}
}
}
}
...
...
performance-api/src/main/java/com/clx/performance/vo/pc/carrier/settle/CarrierPageSettlementDriverDetailVO.java
浏览文件 @
99bafec2
...
@@ -65,7 +65,7 @@ public class CarrierPageSettlementDriverDetailVO {
...
@@ -65,7 +65,7 @@ public class CarrierPageSettlementDriverDetailVO {
private
Integer
loanFlag
;
private
Integer
loanFlag
;
@ApiModelProperty
(
value
=
"借款标示 0:未借款 1:已借款 2:已还款"
)
@ApiModelProperty
(
value
=
"借款标示 0:未借款 1:已借款 2:已还款"
)
private
Integer
loanFlagMsg
;
private
String
loanFlagMsg
;
@MoneyOutConvert
@MoneyOutConvert
@ApiModelProperty
(
value
=
"结算金额"
)
@ApiModelProperty
(
value
=
"结算金额"
)
...
...
performance-api/src/main/java/com/clx/performance/vo/pc/carrier/settle/CarrierPageSettlementDriverVO.java
浏览文件 @
99bafec2
...
@@ -64,7 +64,7 @@ public class CarrierPageSettlementDriverVO {
...
@@ -64,7 +64,7 @@ public class CarrierPageSettlementDriverVO {
private
Integer
loanFlag
;
private
Integer
loanFlag
;
@ApiModelProperty
(
value
=
"借款标示 0:未借款 1:已借款 2:已还款"
)
@ApiModelProperty
(
value
=
"借款标示 0:未借款 1:已借款 2:已还款"
)
private
Integer
loanFlagMsg
;
private
String
loanFlagMsg
;
@MoneyOutConvert
@MoneyOutConvert
@ApiModelProperty
(
value
=
"结算金额"
)
@ApiModelProperty
(
value
=
"结算金额"
)
...
...
performance-api/src/main/java/com/clx/performance/vo/pc/carrier/settle/CarrierPageSettlementOwnerVO.java
浏览文件 @
99bafec2
...
@@ -45,6 +45,7 @@ public class CarrierPageSettlementOwnerVO {
...
@@ -45,6 +45,7 @@ public class CarrierPageSettlementOwnerVO {
@MoneyOutConvert
@MoneyOutConvert
@ApiModelProperty
(
value
=
"结算金额"
)
@ApiModelProperty
(
value
=
"结算金额"
)
private
BigDecimal
settlementFreight
;
private
BigDecimal
settlementFreight
;
@MoneyOutConvert
@ApiModelProperty
(
value
=
"借款金额"
)
@ApiModelProperty
(
value
=
"借款金额"
)
private
BigDecimal
loanFreight
;
private
BigDecimal
loanFreight
;
@MoneyOutConvert
@MoneyOutConvert
...
...
performance-web/src/main/java/com/clx/performance/component/OrderChildLoanComponent.java
浏览文件 @
99bafec2
...
@@ -192,7 +192,7 @@ public class OrderChildLoanComponent {
...
@@ -192,7 +192,7 @@ public class OrderChildLoanComponent {
OwnerQuotationDetailVO
quotationDetailVO
=
orderFeign
.
getQuotationByOrderNo
(
settlementDriverDetail
.
getOrderNo
()).
getData
();
OwnerQuotationDetailVO
quotationDetailVO
=
orderFeign
.
getQuotationByOrderNo
(
settlementDriverDetail
.
getOrderNo
()).
getData
();
BigDecimal
freightFreezeRate
=
quotationDetailVO
.
getFreightFreezeRate
();
BigDecimal
freightFreezeRate
=
quotationDetailVO
.
getFreightFreezeRate
();
if
(
freightFreezeRate
.
compareTo
(
BigDecimal
.
ONE
)
==
0
)
{
if
(
freightFreezeRate
.
compareTo
(
new
BigDecimal
(
100
)
)
==
0
)
{
//百分百预付不需要考虑借款账户
//百分百预付不需要考虑借款账户
log
.
info
(
"1.1百分百预付不需要考虑借款账户"
);
log
.
info
(
"1.1百分百预付不需要考虑借款账户"
);
return
;
return
;
...
...
performance-web/src/main/java/com/clx/performance/dao/impl/loan/OwnerLoanAccountRunningWaterRecordDaoImpl.java
浏览文件 @
99bafec2
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.clx.performance.dao.loan.OwnerLoanAccountRunningWaterRecordDao
;
import
com.clx.performance.dao.loan.OwnerLoanAccountRunningWaterRecordDao
;
import
com.clx.performance.enums.loan.OwnerLoanAccountRunningWaterRecordEnum
;
import
com.clx.performance.mapper.loan.OwnerLoanAccountRunningWaterRecordMapper
;
import
com.clx.performance.mapper.loan.OwnerLoanAccountRunningWaterRecordMapper
;
import
com.clx.performance.model.loan.OwnerLoanAccountRunningWaterRecord
;
import
com.clx.performance.model.loan.OwnerLoanAccountRunningWaterRecord
;
import
com.clx.performance.param.pc.loan.carrier.PageOwnerLoanAccountWaterRecordOfOwnerParam
;
import
com.clx.performance.param.pc.loan.carrier.PageOwnerLoanAccountWaterRecordOfOwnerParam
;
...
@@ -92,4 +93,11 @@ public class OwnerLoanAccountRunningWaterRecordDaoImpl extends BaseDaoImpl<Owner
...
@@ -92,4 +93,11 @@ public class OwnerLoanAccountRunningWaterRecordDaoImpl extends BaseDaoImpl<Owner
.
orderByAsc
(
OwnerLoanAccountRunningWaterRecord:
:
getId
)
.
orderByAsc
(
OwnerLoanAccountRunningWaterRecord:
:
getId
)
);
);
}
}
@Override
public
List
<
OwnerLoanAccountRunningWaterRecord
>
selectLoanRunningWatterRecord
(
Long
loanNo
)
{
return
baseMapper
.
selectList
(
lQrWrapper
().
eq
(
OwnerLoanAccountRunningWaterRecord:
:
getLoanNo
,
loanNo
)
.
eq
(
OwnerLoanAccountRunningWaterRecord:
:
getRunningWaterType
,
OwnerLoanAccountRunningWaterRecordEnum
.
RunWaterType
.
APPROVE_FROZEN
.
getCode
())
);
}
}
}
performance-web/src/main/java/com/clx/performance/dao/impl/loan/OwnerLoanRecordDaoImpl.java
浏览文件 @
99bafec2
...
@@ -57,14 +57,14 @@ public class OwnerLoanRecordDaoImpl extends BaseDaoImpl<OwnerLoanRecordMapper, O
...
@@ -57,14 +57,14 @@ public class OwnerLoanRecordDaoImpl extends BaseDaoImpl<OwnerLoanRecordMapper, O
}
}
/**
/**
* 查询审批通过
并且未用完的借款
* 查询审批通过
和付款成功并且未用完的借款(资金+虚拟货币)
* @param userNo
* @param userNo
* @return
* @return
*/
*/
@Override
@Override
public
List
<
OwnerLoanRecord
>
selectLoanBalance
(
Long
userNo
)
{
public
List
<
OwnerLoanRecord
>
selectLoanBalance
(
Long
userNo
)
{
return
baseMapper
.
selectList
(
return
baseMapper
.
selectList
(
lQrWrapper
().
eq
(
OwnerLoanRecord:
:
getStatus
,
OwnerLoanRecordEnum
.
Status
.
APPROVE_PA
SS
.
getCode
())
lQrWrapper
().
in
(
OwnerLoanRecord:
:
getStatus
,
OwnerLoanRecordEnum
.
Status
.
APPROVE_PASS
.
getCode
(),
OwnerLoanRecordEnum
.
Status
.
PAY_SUCCE
SS
.
getCode
())
.
eq
(
OwnerLoanRecord:
:
getOwnerUserNo
,
userNo
)
.
eq
(
OwnerLoanRecord:
:
getOwnerUserNo
,
userNo
)
.
gt
(
OwnerLoanRecord:
:
getLoanResidueBalance
,
0
)
.
gt
(
OwnerLoanRecord:
:
getLoanResidueBalance
,
0
)
.
orderByAsc
(
OwnerLoanRecord:
:
getId
)
.
orderByAsc
(
OwnerLoanRecord:
:
getId
)
...
...
performance-web/src/main/java/com/clx/performance/dao/impl/settle/SettlementDriverDaoImpl.java
浏览文件 @
99bafec2
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.clx.performance.dao.settle.SettlementDriverDao
;
import
com.clx.performance.dao.settle.SettlementDriverDao
;
import
com.clx.performance.enums.loan.OwnerLoanRecordEnum
;
import
com.clx.performance.mapper.settle.SettlementDriverMapper
;
import
com.clx.performance.mapper.settle.SettlementDriverMapper
;
import
com.clx.performance.model.settle.SettlementDriver
;
import
com.clx.performance.model.settle.SettlementDriver
;
import
com.clx.performance.param.pc.driver.PageCarrierSettlementDriverParam
;
import
com.clx.performance.param.pc.driver.PageCarrierSettlementDriverParam
;
...
@@ -13,6 +14,7 @@ import org.apache.commons.lang3.StringUtils;
...
@@ -13,6 +14,7 @@ import org.apache.commons.lang3.StringUtils;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
java.util.Objects
;
import
java.util.Objects
;
import
java.util.Set
;
/**
/**
* @Author: aiqinguo
* @Author: aiqinguo
...
@@ -57,4 +59,11 @@ public class SettlementDriverDaoImpl extends BaseDaoImpl<SettlementDriverMapper,
...
@@ -57,4 +59,11 @@ public class SettlementDriverDaoImpl extends BaseDaoImpl<SettlementDriverMapper,
)
)
.
map
(
super
::
getOne
);
.
map
(
super
::
getOne
);
}
}
@Override
public
void
updateLoanFlagByChildNoList
(
Set
<
String
>
childNoList
)
{
update
(
lUdWrapper
().
in
(
SettlementDriver:
:
getChildNo
,
childNoList
)
.
set
(
SettlementDriver:
:
getLoanFlag
,
OwnerLoanRecordEnum
.
LoanFlag
.
RE_PAY
.
getCode
())
);
}
}
}
performance-web/src/main/java/com/clx/performance/dao/impl/settle/SettlementDriverDetailDaoImpl.java
浏览文件 @
99bafec2
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.clx.performance.dao.settle.SettlementDriverDetailDao
;
import
com.clx.performance.dao.settle.SettlementDriverDetailDao
;
import
com.clx.performance.enums.loan.OwnerLoanRecordEnum
;
import
com.clx.performance.mapper.settle.SettlementDriverDetailMapper
;
import
com.clx.performance.mapper.settle.SettlementDriverDetailMapper
;
import
com.clx.performance.model.settle.SettlementDriverDetail
;
import
com.clx.performance.model.settle.SettlementDriverDetail
;
import
com.clx.performance.param.pc.driver.PageCarrierSettlementDriverDetailParam
;
import
com.clx.performance.param.pc.driver.PageCarrierSettlementDriverDetailParam
;
...
@@ -15,6 +16,7 @@ import org.springframework.stereotype.Repository;
...
@@ -15,6 +16,7 @@ import org.springframework.stereotype.Repository;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Objects
;
import
java.util.Objects
;
import
java.util.Set
;
/**
/**
* @Author: aiqinguo
* @Author: aiqinguo
...
@@ -81,4 +83,12 @@ public class SettlementDriverDetailDaoImpl extends BaseDaoImpl<SettlementDriverD
...
@@ -81,4 +83,12 @@ public class SettlementDriverDetailDaoImpl extends BaseDaoImpl<SettlementDriverD
return
baseMapper
.
findByDriverSettlementIds
(
ids
);
return
baseMapper
.
findByDriverSettlementIds
(
ids
);
}
}
@Override
public
void
updateLoanFlagByChildNoList
(
Set
<
String
>
childNoList
)
{
update
(
lUdWrapper
()
.
in
(
SettlementDriverDetail:
:
getChildNo
,
childNoList
)
.
set
(
SettlementDriverDetail:
:
getLoanFlag
,
OwnerLoanRecordEnum
.
LoanFlag
.
RE_PAY
.
getCode
())
);
}
}
}
performance-web/src/main/java/com/clx/performance/dao/loan/OwnerLoanAccountRunningWaterRecordDao.java
浏览文件 @
99bafec2
...
@@ -26,4 +26,6 @@ public interface OwnerLoanAccountRunningWaterRecordDao extends BaseDao<OwnerLoan
...
@@ -26,4 +26,6 @@ public interface OwnerLoanAccountRunningWaterRecordDao extends BaseDao<OwnerLoan
OwnerLoanAccountRunningWaterRecord
getOneByChildNoAndStatus
(
String
childNo
,
Integer
type
);
OwnerLoanAccountRunningWaterRecord
getOneByChildNoAndStatus
(
String
childNo
,
Integer
type
);
List
<
OwnerLoanAccountRunningWaterRecord
>
getListByOrderNoAndRunningWaterType
(
String
childNo
,
Integer
runningWaterType
);
List
<
OwnerLoanAccountRunningWaterRecord
>
getListByOrderNoAndRunningWaterType
(
String
childNo
,
Integer
runningWaterType
);
List
<
OwnerLoanAccountRunningWaterRecord
>
selectLoanRunningWatterRecord
(
Long
loanNo
);
}
}
performance-web/src/main/java/com/clx/performance/dao/settle/SettlementDriverDao.java
浏览文件 @
99bafec2
...
@@ -7,6 +7,8 @@ import com.clx.performance.param.pc.driver.PageCarrierSettlementDriverParam;
...
@@ -7,6 +7,8 @@ import com.clx.performance.param.pc.driver.PageCarrierSettlementDriverParam;
import
com.msl.common.base.Optional
;
import
com.msl.common.base.Optional
;
import
com.msl.common.dao.BaseDao
;
import
com.msl.common.dao.BaseDao
;
import
java.util.Set
;
/**
/**
* @Author: aiqinguo
* @Author: aiqinguo
* @Description: 车主结算单
* @Description: 车主结算单
...
@@ -18,4 +20,6 @@ public interface SettlementDriverDao extends BaseDao<SettlementDriverMapper, Set
...
@@ -18,4 +20,6 @@ public interface SettlementDriverDao extends BaseDao<SettlementDriverMapper, Set
Optional
<
SettlementDriver
>
getByChildNo
(
String
childNo
);
Optional
<
SettlementDriver
>
getByChildNo
(
String
childNo
);
void
updateLoanFlagByChildNoList
(
Set
<
String
>
childNoList
);
}
}
performance-web/src/main/java/com/clx/performance/dao/settle/SettlementDriverDetailDao.java
浏览文件 @
99bafec2
...
@@ -9,6 +9,7 @@ import com.msl.common.dao.BaseDao;
...
@@ -9,6 +9,7 @@ import com.msl.common.dao.BaseDao;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Set
;
/**
/**
* @Author: aiqinguo
* @Author: aiqinguo
...
@@ -31,4 +32,5 @@ public interface SettlementDriverDetailDao extends BaseDao<SettlementDriverDetai
...
@@ -31,4 +32,5 @@ public interface SettlementDriverDetailDao extends BaseDao<SettlementDriverDetai
List
<
SettlementDriverDetail
>
findByDriverSettlementIds
(
List
<
Integer
>
ids
);
List
<
SettlementDriverDetail
>
findByDriverSettlementIds
(
List
<
Integer
>
ids
);
void
updateLoanFlagByChildNoList
(
Set
<
String
>
childNoList
);
}
}
performance-web/src/main/java/com/clx/performance/dao/settle/SettlementOwnerDetailDao.java
浏览文件 @
99bafec2
...
@@ -10,6 +10,7 @@ import com.msl.common.dao.BaseDao;
...
@@ -10,6 +10,7 @@ import com.msl.common.dao.BaseDao;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Set
;
/**
/**
...
...
performance-web/src/main/java/com/clx/performance/event/EventListenerComponent.java
浏览文件 @
99bafec2
package
com
.
clx
.
performance
.
event
;
package
com
.
clx
.
performance
.
event
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.core.exceptions.ExceptionUtil
;
import
cn.hutool.core.exceptions.ExceptionUtil
;
import
cn.hutool.json.JSONUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.clx.performance.component.OrderChildLoanComponent
;
import
com.clx.performance.component.OrderChildLoanComponent
;
import
com.clx.performance.dao.loan.OrderChildLoanRetryRecordDao
;
import
com.clx.performance.dao.loan.OrderChildLoanRetryRecordDao
;
import
com.clx.performance.dao.loan.OwnerLoanAccountRunningWaterRecordDao
;
import
com.clx.performance.dao.loan.OwnerRepaymentDao
;
import
com.clx.performance.dao.loan.OwnerRepaymentDao
;
import
com.clx.performance.dao.settle.SettlementDriverDao
;
import
com.clx.performance.dao.settle.SettlementDriverDetailDao
;
import
com.clx.performance.dao.settle.SettlementDriverDetailDao
;
import
com.clx.performance.dao.settle.SettlementOwnerDetailDao
;
import
com.clx.performance.dao.settle.SettlementOwnerDetailDao
;
import
com.clx.performance.dto.OwnerLoanMqDTO
;
import
com.clx.performance.dto.OwnerLoanMqDTO
;
...
@@ -12,6 +15,7 @@ import com.clx.performance.enums.loan.OwnerLoanRecordEnum;
...
@@ -12,6 +15,7 @@ import com.clx.performance.enums.loan.OwnerLoanRecordEnum;
import
com.clx.performance.enums.loan.OwnerRePaymentEnum
;
import
com.clx.performance.enums.loan.OwnerRePaymentEnum
;
import
com.clx.performance.model.OrderChild
;
import
com.clx.performance.model.OrderChild
;
import
com.clx.performance.model.loan.OrderChildLoanRetryRecord
;
import
com.clx.performance.model.loan.OrderChildLoanRetryRecord
;
import
com.clx.performance.model.loan.OwnerLoanAccountRunningWaterRecord
;
import
com.clx.performance.model.loan.OwnerRepayment
;
import
com.clx.performance.model.loan.OwnerRepayment
;
import
com.clx.performance.model.settle.SettlementDriverDetail
;
import
com.clx.performance.model.settle.SettlementDriverDetail
;
import
com.clx.performance.model.settle.SettlementOwnerDetail
;
import
com.clx.performance.model.settle.SettlementOwnerDetail
;
...
@@ -23,6 +27,11 @@ import org.springframework.context.event.EventListener;
...
@@ -23,6 +27,11 @@ import org.springframework.context.event.EventListener;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Component
;
import
org.springframework.transaction.PlatformTransactionManager
;
import
org.springframework.transaction.PlatformTransactionManager
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Set
;
import
java.util.stream.Collectors
;
@Component
@Component
@Slf4j
@Slf4j
@AllArgsConstructor
@AllArgsConstructor
...
@@ -42,6 +51,10 @@ public class EventListenerComponent {
...
@@ -42,6 +51,10 @@ public class EventListenerComponent {
private
final
ApplicationEventPublisher
applicationEventPublisher
;
private
final
ApplicationEventPublisher
applicationEventPublisher
;
private
final
SettlementDriverDao
settlementDriverDao
;
private
final
OwnerLoanAccountRunningWaterRecordDao
ownerLoanAccountRunningWaterRecordDao
;
@EventListener
(
classes
=
{
SettlementUpdateEvent
.
class
})
@EventListener
(
classes
=
{
SettlementUpdateEvent
.
class
})
public
void
listen
(
SettlementUpdateEvent
event
)
{
public
void
listen
(
SettlementUpdateEvent
event
)
{
...
@@ -94,4 +107,28 @@ public class EventListenerComponent {
...
@@ -94,4 +107,28 @@ public class EventListenerComponent {
// 发送mq 通过开票标识
// 发送mq 通过开票标识
settlementMqService
.
invoiceTypeSync
(
settlementDriverDetail
.
getChildNo
(),
settlementDriverDetail
.
getInvoiceType
());
settlementMqService
.
invoiceTypeSync
(
settlementDriverDetail
.
getChildNo
(),
settlementDriverDetail
.
getInvoiceType
());
}
}
@EventListener
(
classes
=
{
OwnerLoanFlagEvent
.
class
})
public
void
listen
(
OwnerLoanFlagEvent
event
)
{
log
.
info
(
"OwnerLoanFlagEvent事件执行"
);
Long
loanNo
=
event
.
getLoanNo
();
List
<
OwnerLoanAccountRunningWaterRecord
>
records
=
ownerLoanAccountRunningWaterRecordDao
.
selectLoanRunningWatterRecord
(
loanNo
);
if
(
CollectionUtil
.
isEmpty
(
records
))
{
return
;
}
Map
<
String
,
List
<
OwnerLoanAccountRunningWaterRecord
>>
listMap
=
records
.
stream
().
collect
(
Collectors
.
groupingBy
(
OwnerLoanAccountRunningWaterRecord:
:
getChildNo
));
for
(
Map
.
Entry
<
String
,
List
<
OwnerLoanAccountRunningWaterRecord
>>
entry
:
listMap
.
entrySet
())
{
if
(
entry
.
getValue
().
size
()
>
1
)
{
log
.
info
(
"当前运单{}存在多条流水,不更新还款标志"
,
entry
.
getKey
());
listMap
.
remove
(
entry
.
getKey
());
}
}
log
.
info
(
"当前需要更新的运单数量:{}"
,
listMap
.
size
());
settlementDriverDetailDao
.
updateLoanFlagByChildNoList
(
listMap
.
keySet
());
settlementDriverDao
.
updateLoanFlagByChildNoList
(
listMap
.
keySet
());
}
}
}
performance-web/src/main/java/com/clx/performance/event/OwnerLoanFlagEvent.java
0 → 100644
浏览文件 @
99bafec2
package
com
.
clx
.
performance
.
event
;
import
lombok.Getter
;
import
lombok.Setter
;
import
org.springframework.context.ApplicationEvent
;
@Getter
@Setter
public
class
OwnerLoanFlagEvent
extends
ApplicationEvent
{
private
Long
loanNo
;
/**
* Create a new {@code ApplicationEvent}.
*
* @param source the object on which the event initially occurred or with
* which the event is associated (never {@code null})
*/
public
OwnerLoanFlagEvent
(
Object
source
)
{
super
(
source
);
}
public
OwnerLoanFlagEvent
(
Object
source
,
Long
loanNo
)
{
super
(
source
);
this
.
loanNo
=
loanNo
;
}
}
performance-web/src/main/java/com/clx/performance/mapper/loan/OwnerLoanAccountMapper.java
浏览文件 @
99bafec2
...
@@ -21,7 +21,7 @@ public interface OwnerLoanAccountMapper extends BaseMapper<OwnerLoanAccount> {
...
@@ -21,7 +21,7 @@ public interface OwnerLoanAccountMapper extends BaseMapper<OwnerLoanAccount> {
@Update
(
"update owner_loan_account set funding_account_balance = funding_account_balance + #{account.fundingAccountBalance}"
+
@Update
(
"update owner_loan_account set funding_account_balance = funding_account_balance + #{account.fundingAccountBalance}"
+
",funding_usable_balance = funding_usable_balance + #{account.fundingUsableBalance},funding_frozen_balance = funding_frozen_balance + #{account.fundingFrozenBalance}"
+
",funding_usable_balance = funding_usable_balance + #{account.fundingUsableBalance},funding_frozen_balance = funding_frozen_balance + #{account.fundingFrozenBalance}"
+
",virtually_account_balance = virtually_account_balance + #{account.virtuallyAccountBalance},virtually_usable_balance = virtually_usable_balance + #{account.virtuallyUsableBalance}"
+
",virtually_account_balance = virtually_account_balance + #{account.virtuallyAccountBalance},virtually_usable_balance = virtually_usable_balance + #{account.virtuallyUsableBalance}"
+
",virtually_frozen_balance = virtually_frozen_balance + #{account.virtuallyFrozenBalance}"
+
",virtually_frozen_balance = virtually_frozen_balance + #{account.virtuallyFrozenBalance}
,funding_arrears = funding_arrears + #{account.fundingArrears},virtually_arrears = virtually_arrears + #{account.virtuallyArrears}
"
+
",modified_time=#{now}"
",modified_time=#{now}"
+
"where id = #{account.id} and modified_time = #{account.modifiedTime}"
+
"where id = #{account.id} and modified_time = #{account.modifiedTime}"
)
)
...
@@ -30,7 +30,7 @@ public interface OwnerLoanAccountMapper extends BaseMapper<OwnerLoanAccount> {
...
@@ -30,7 +30,7 @@ public interface OwnerLoanAccountMapper extends BaseMapper<OwnerLoanAccount> {
@Update
(
"update owner_loan_account set funding_account_balance = funding_account_balance - #{account.fundingAccountBalance}"
+
@Update
(
"update owner_loan_account set funding_account_balance = funding_account_balance - #{account.fundingAccountBalance}"
+
",funding_usable_balance = funding_usable_balance - #{account.fundingUsableBalance},funding_frozen_balance = funding_frozen_balance + #{account.fundingFrozenBalance}"
+
",funding_usable_balance = funding_usable_balance - #{account.fundingUsableBalance},funding_frozen_balance = funding_frozen_balance + #{account.fundingFrozenBalance}"
+
",virtually_account_balance = virtually_account_balance - #{account.virtuallyAccountBalance},virtually_usable_balance = virtually_usable_balance - #{account.virtuallyUsableBalance}"
+
",virtually_account_balance = virtually_account_balance - #{account.virtuallyAccountBalance},virtually_usable_balance = virtually_usable_balance - #{account.virtuallyUsableBalance}"
+
",virtually_frozen_balance = virtually_frozen_balance + #{account.virtuallyFrozenBalance}"
+
",virtually_frozen_balance = virtually_frozen_balance + #{account.virtuallyFrozenBalance}
,funding_arrears = funding_arrears - #{account.fundingArrears},virtually_arrears = virtually_arrears - #{account.virtuallyArrears}
"
+
",modified_time=#{now}"
",modified_time=#{now}"
+
"where id = #{account.id} and modified_time = #{account.modifiedTime}"
+
"where id = #{account.id} and modified_time = #{account.modifiedTime}"
)
)
...
...
performance-web/src/main/java/com/clx/performance/service/impl/loan/OwnerLoanRecordServiceImpl.java
浏览文件 @
99bafec2
package
com
.
clx
.
performance
.
service
.
impl
.
loan
;
package
com
.
clx
.
performance
.
service
.
impl
.
loan
;
import
cn.hutool.core.collection.CollectionUtil
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONObject
;
import
cn.hutool.json.JSONUtil
;
import
cn.hutool.json.JSONUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
...
@@ -184,7 +185,6 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
...
@@ -184,7 +185,6 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
.
orElseThrow
(
PerformanceResultEnum
.
DATA_NOT_FIND
);
.
orElseThrow
(
PerformanceResultEnum
.
DATA_NOT_FIND
);
//同意
//同意
ownerLoanRecord
.
setPayChannel
(
param
.
getPayChannel
());
ownerLoanRecord
.
setLoanType
(
param
.
getLoanType
());
ownerLoanRecord
.
setLoanType
(
param
.
getLoanType
());
//设置借款记录中借款方和借出方的银行账户信息
//设置借款记录中借款方和借出方的银行账户信息
...
@@ -223,6 +223,9 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
...
@@ -223,6 +223,9 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
entity
.
setVirtuallyFrozenBalance
(
BigDecimal
.
ZERO
);
entity
.
setVirtuallyFrozenBalance
(
BigDecimal
.
ZERO
);
entity
.
setVirtuallyUsableBalance
(
ownerLoanRecord
.
getLoanBalance
());
entity
.
setVirtuallyUsableBalance
(
ownerLoanRecord
.
getLoanBalance
());
entity
.
setModifiedTime
(
ownerLoanAccount
.
getModifiedTime
());
entity
.
setModifiedTime
(
ownerLoanAccount
.
getModifiedTime
());
entity
.
setFundingArrears
(
BigDecimal
.
ZERO
);
entity
.
setVirtuallyArrears
(
ownerLoanRecord
.
getLoanBalance
());
Integer
flag
=
ownerLoanAccountDao
.
updateAccountCAS
(
entity
,
LocalDateTime
.
now
(),
true
);
Integer
flag
=
ownerLoanAccountDao
.
updateAccountCAS
(
entity
,
LocalDateTime
.
now
(),
true
);
if
(
flag
==
1
)
{
if
(
flag
==
1
)
{
//生成借款流水
//生成借款流水
...
@@ -303,7 +306,7 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
...
@@ -303,7 +306,7 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
* @param ownerLoanRecord
* @param ownerLoanRecord
*/
*/
private
void
initOwnerLoanRunningWaterRecord
(
OwnerLoanRecord
ownerLoanRecord
)
{
private
void
initOwnerLoanRunningWaterRecord
(
OwnerLoanRecord
ownerLoanRecord
)
{
OwnerLoanAccount
ownerLoanAccount
=
ownerLoanAccountDao
.
getOneByField
(
OwnerLoanAccount:
:
getOwnerUserNo
,
ownerLoanRecord
.
getOwnerUserNo
()).
get
();
OwnerLoanAccount
ownerLoanAccount
=
ownerLoanAccountDao
.
getOneByField
(
OwnerLoanAccount:
:
getOwnerUserNo
,
ownerLoanRecord
.
getOwnerUserNo
()).
get
();
ownerLoanRecordDao
.
updateEntityByKey
(
ownerLoanRecord
);
ownerLoanRecordDao
.
updateEntityByKey
(
ownerLoanRecord
);
OwnerLoanAccountRunningWaterRecord
record
=
new
OwnerLoanAccountRunningWaterRecord
()
OwnerLoanAccountRunningWaterRecord
record
=
new
OwnerLoanAccountRunningWaterRecord
()
.
setOwnerUserNo
(
ownerLoanRecord
.
getOwnerUserNo
())
.
setOwnerUserNo
(
ownerLoanRecord
.
getOwnerUserNo
())
...
@@ -466,24 +469,52 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
...
@@ -466,24 +469,52 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
List
<
OwnerLoanRecord
>
ownerLoanRecords
=
ownerLoanRecordDao
.
selectLoanBalance
(
userNo
);
List
<
OwnerLoanRecord
>
ownerLoanRecords
=
ownerLoanRecordDao
.
selectLoanBalance
(
userNo
);
BigDecimal
orderChildPriceTemp
=
orderChildPrice
;
BigDecimal
orderChildPriceTemp
=
orderChildPrice
;
log
.
info
(
"查询ownerLoanRecords:{}"
,
JSONUtil
.
parse
(
ownerLoanRecords
));
log
.
info
(
"查询ownerLoanRecords:{}"
,
JSONUtil
.
parse
(
ownerLoanRecords
));
for
(
OwnerLoanRecord
ownerLoanRecord
:
ownerLoanRecords
)
{
Map
<
Integer
,
List
<
OwnerLoanRecord
>>
listMap
=
ownerLoanRecords
.
stream
().
collect
(
Collectors
.
groupingBy
(
OwnerLoanRecord:
:
getLoanType
));
BigDecimal
loanResidueBalance
=
ownerLoanRecord
.
getLoanResidueBalance
();
log
.
info
(
"当前借款金额:{},借款单号{},借款剩余金额{}"
,
orderChildPriceTemp
,
ownerLoanRecord
.
getLoanNo
(),
loanResidueBalance
);
List
<
OwnerLoanRecord
>
verList
=
listMap
.
get
(
OwnerLoanRecordEnum
.
LoanType
.
VIRTUAL_CURRENCY
.
getCode
());
if
(
loanResidueBalance
.
compareTo
(
orderChildPriceTemp
)
>=
0
)
{
if
(
CollectionUtil
.
isNotEmpty
(
verList
))
{
log
.
info
(
"当前借款单的剩余金额足够借款金额"
);
for
(
OwnerLoanRecord
ownerLoanRecord
:
verList
)
{
generateFrozenOwnerLoanRunningWater
(
ownerLoanRecord
,
childNo
,
orderChildPriceTemp
);
BigDecimal
loanResidueBalance
=
ownerLoanRecord
.
getLoanResidueBalance
();
updateList
.
add
(
ownerLoanRecord
.
setLoanResidueBalance
(
loanResidueBalance
.
subtract
(
orderChildPriceTemp
)));
log
.
info
(
"当前借款金额:{},虚拟币借款单号{},借款剩余金额{}"
,
orderChildPriceTemp
,
ownerLoanRecord
.
getLoanNo
(),
loanResidueBalance
);
orderChildPriceTemp
=
BigDecimal
.
ZERO
;
if
(
loanResidueBalance
.
compareTo
(
orderChildPriceTemp
)
>=
0
)
{
break
;
log
.
info
(
"当前借款单的剩余金额足够借款金额"
);
}
else
{
generateFrozenOwnerLoanRunningWater
(
ownerLoanRecord
,
childNo
,
orderChildPriceTemp
);
log
.
info
(
"当前借款单的剩余金额不够抵扣借款金额,先进行扣除当前借款所有剩余"
);
updateList
.
add
(
ownerLoanRecord
.
setLoanResidueBalance
(
loanResidueBalance
.
subtract
(
orderChildPriceTemp
)));
generateFrozenOwnerLoanRunningWater
(
ownerLoanRecord
,
childNo
,
loanResidueBalance
);
orderChildPriceTemp
=
BigDecimal
.
ZERO
;
updateList
.
add
(
ownerLoanRecord
.
setLoanResidueBalance
(
BigDecimal
.
ZERO
));
break
;
orderChildPriceTemp
=
orderChildPriceTemp
.
subtract
(
loanResidueBalance
);
}
else
{
log
.
info
(
"当前借款单的剩余金额不够抵扣借款金额,先进行扣除当前借款所有剩余"
);
generateFrozenOwnerLoanRunningWater
(
ownerLoanRecord
,
childNo
,
loanResidueBalance
);
updateList
.
add
(
ownerLoanRecord
.
setLoanResidueBalance
(
BigDecimal
.
ZERO
));
orderChildPriceTemp
=
orderChildPriceTemp
.
subtract
(
loanResidueBalance
);
}
log
.
info
(
"当前虚拟币orderChildPriceTemp:{}"
,
orderChildPriceTemp
);
}
}
List
<
OwnerLoanRecord
>
fundList
=
listMap
.
get
(
OwnerLoanRecordEnum
.
LoanType
.
FUND
.
getCode
());
if
(
orderChildPriceTemp
.
compareTo
(
BigDecimal
.
ZERO
)
!=
0
&&
CollectionUtil
.
isNotEmpty
(
fundList
))
{
for
(
OwnerLoanRecord
ownerLoanRecord
:
fundList
)
{
BigDecimal
loanResidueBalance
=
ownerLoanRecord
.
getLoanResidueBalance
();
log
.
info
(
"当前借款金额:{},资金借款单号{},借款剩余金额{}"
,
orderChildPriceTemp
,
ownerLoanRecord
.
getLoanNo
(),
loanResidueBalance
);
if
(
loanResidueBalance
.
compareTo
(
orderChildPriceTemp
)
>=
0
)
{
log
.
info
(
"当前借款单的剩余金额足够借款金额"
);
generateFrozenOwnerLoanRunningWater
(
ownerLoanRecord
,
childNo
,
orderChildPriceTemp
);
updateList
.
add
(
ownerLoanRecord
.
setLoanResidueBalance
(
loanResidueBalance
.
subtract
(
orderChildPriceTemp
)));
orderChildPriceTemp
=
BigDecimal
.
ZERO
;
break
;
}
else
{
log
.
info
(
"当前借款单的剩余金额不够抵扣借款金额,先进行扣除当前借款所有剩余"
);
generateFrozenOwnerLoanRunningWater
(
ownerLoanRecord
,
childNo
,
loanResidueBalance
);
updateList
.
add
(
ownerLoanRecord
.
setLoanResidueBalance
(
BigDecimal
.
ZERO
));
orderChildPriceTemp
=
orderChildPriceTemp
.
subtract
(
loanResidueBalance
);
}
log
.
info
(
"当前资金orderChildPriceTemp:{}"
,
orderChildPriceTemp
);
}
}
log
.
info
(
"当前orderChildPriceTemp:{}"
,
orderChildPriceTemp
);
}
}
if
(
orderChildPriceTemp
.
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
if
(
orderChildPriceTemp
.
compareTo
(
BigDecimal
.
ZERO
)
!=
0
)
{
//当前钱不够,需要记录,流程卡死,不往下走
//当前钱不够,需要记录,流程卡死,不往下走
...
@@ -575,7 +606,7 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
...
@@ -575,7 +606,7 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
BankTrade
bankTrade
=
bankTradeDao
.
selectByMerchantRunningWaterNo
(
merSeqNo
).
get
();
BankTrade
bankTrade
=
bankTradeDao
.
selectByMerchantRunningWaterNo
(
merSeqNo
).
get
();
OwnerLoanRecord
ownerLoanRecord
=
ownerLoanRecordDao
.
getOneByField
(
OwnerLoanRecord:
:
getLoanNo
,
bankTrade
.
getRelationNo
())
OwnerLoanRecord
ownerLoanRecord
=
ownerLoanRecordDao
.
getOneByField
(
OwnerLoanRecord:
:
getLoanNo
,
bankTrade
.
getRelationNo
())
.
orElseThrow
(
PerformanceResultEnum
.
DATA_NOT_FIND
);
.
orElseThrow
(
PerformanceResultEnum
.
DATA_NOT_FIND
);
if
(
Objects
.
equals
(
ownerLoanRecord
.
getStatus
(),
OwnerLoanRecordEnum
.
Status
.
PAYING
.
getCode
()))
{
if
(
!
Objects
.
equals
(
ownerLoanRecord
.
getStatus
(),
OwnerLoanRecordEnum
.
Status
.
PAYING
.
getCode
()))
{
log
.
info
(
"借款单非支付中状态, loanNo:{}"
,
bankTrade
.
getRelationNo
());
log
.
info
(
"借款单非支付中状态, loanNo:{}"
,
bankTrade
.
getRelationNo
());
return
;
return
;
}
}
...
@@ -594,7 +625,7 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
...
@@ -594,7 +625,7 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
OwnerLoanRecord
ownerLoanRecord
=
ownerLoanRecordDao
.
getOneByField
(
OwnerLoanRecord:
:
getLoanNo
,
bankTrade
.
getRelationNo
())
OwnerLoanRecord
ownerLoanRecord
=
ownerLoanRecordDao
.
getOneByField
(
OwnerLoanRecord:
:
getLoanNo
,
bankTrade
.
getRelationNo
())
.
orElseThrow
(
PerformanceResultEnum
.
DATA_NOT_FIND
);
.
orElseThrow
(
PerformanceResultEnum
.
DATA_NOT_FIND
);
if
(
Objects
.
equals
(
ownerLoanRecord
.
getStatus
(),
OwnerLoanRecordEnum
.
Status
.
PAYING
.
getCode
()))
{
if
(
!
Objects
.
equals
(
ownerLoanRecord
.
getStatus
(),
OwnerLoanRecordEnum
.
Status
.
PAYING
.
getCode
()))
{
log
.
info
(
"借款单非支付中状态, loanNo:{}"
,
ownerLoanRecord
.
getLoanNo
());
log
.
info
(
"借款单非支付中状态, loanNo:{}"
,
ownerLoanRecord
.
getLoanNo
());
return
;
return
;
}
}
...
@@ -605,13 +636,17 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
...
@@ -605,13 +636,17 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
ownerLoanRecord
.
getOwnerUserNo
()).
get
();
ownerLoanRecord
.
getOwnerUserNo
()).
get
();
OwnerLoanAccount
entity
=
new
OwnerLoanAccount
();
OwnerLoanAccount
entity
=
new
OwnerLoanAccount
();
entity
.
setId
(
ownerLoanAccount
.
getId
());
entity
.
setId
(
ownerLoanAccount
.
getId
());
entity
.
setFundingAccountBalance
(
BigDecimal
.
ZERO
);
entity
.
setVirtuallyAccountBalance
(
BigDecimal
.
ZERO
);
entity
.
setFundingFrozenBalance
(
BigDecimal
.
ZERO
);
entity
.
setFundingUsableBalance
(
BigDecimal
.
ZERO
);
entity
.
setVirtuallyAccountBalance
(
ownerLoanRecord
.
getLoanBalance
());
entity
.
setVirtuallyFrozenBalance
(
BigDecimal
.
ZERO
);
entity
.
setVirtuallyFrozenBalance
(
BigDecimal
.
ZERO
);
entity
.
setVirtuallyUsableBalance
(
ownerLoanRecord
.
getLoanBalance
());
entity
.
setVirtuallyUsableBalance
(
BigDecimal
.
ZERO
);
entity
.
setFundingAccountBalance
(
ownerLoanRecord
.
getLoanBalance
());
entity
.
setFundingFrozenBalance
(
BigDecimal
.
ZERO
);
entity
.
setFundingUsableBalance
(
ownerLoanRecord
.
getLoanBalance
());
entity
.
setFundingArrears
(
ownerLoanRecord
.
getLoanBalance
());
entity
.
setVirtuallyArrears
(
BigDecimal
.
ZERO
);
entity
.
setModifiedTime
(
ownerLoanAccount
.
getModifiedTime
());
entity
.
setModifiedTime
(
ownerLoanAccount
.
getModifiedTime
());
Integer
flag
=
ownerLoanAccountDao
.
updateAccountCAS
(
entity
,
LocalDateTime
.
now
(),
true
);
Integer
flag
=
ownerLoanAccountDao
.
updateAccountCAS
(
entity
,
LocalDateTime
.
now
(),
true
);
if
(
flag
==
1
)
{
if
(
flag
==
1
)
{
//生成借款流水
//生成借款流水
...
@@ -702,7 +737,9 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
...
@@ -702,7 +737,9 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
log
.
info
(
"13.生成借款冻结流水"
);
log
.
info
(
"13.生成借款冻结流水"
);
OwnerLoanAccount
update
=
new
OwnerLoanAccount
();
OwnerLoanAccount
update
=
new
OwnerLoanAccount
();
while
(
true
)
{
while
(
true
)
{
//赋值
ownerLoanAccountUpdate
(
ownerLoanRecord
,
orderChildPrice
,
update
);
ownerLoanAccountUpdate
(
ownerLoanRecord
,
orderChildPrice
,
update
);
log
.
info
(
"13.1 当前cas更新对象信息:{}"
,
JSONUtil
.
parse
(
update
));
Integer
i
=
ownerLoanAccountDao
.
updateAccountCAS
(
update
,
LocalDateTime
.
now
(),
false
);
Integer
i
=
ownerLoanAccountDao
.
updateAccountCAS
(
update
,
LocalDateTime
.
now
(),
false
);
log
.
info
(
"CAS更新结果:{}"
,
i
);
log
.
info
(
"CAS更新结果:{}"
,
i
);
if
(
i
==
1
)
{
if
(
i
==
1
)
{
...
@@ -747,6 +784,8 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
...
@@ -747,6 +784,8 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
update
.
setFundingAccountBalance
(
BigDecimal
.
ZERO
);
update
.
setFundingAccountBalance
(
BigDecimal
.
ZERO
);
update
.
setFundingFrozenBalance
(
BigDecimal
.
ZERO
);
update
.
setFundingFrozenBalance
(
BigDecimal
.
ZERO
);
update
.
setFundingUsableBalance
(
BigDecimal
.
ZERO
);
update
.
setFundingUsableBalance
(
BigDecimal
.
ZERO
);
update
.
setFundingArrears
(
BigDecimal
.
ZERO
);
update
.
setVirtuallyArrears
(
BigDecimal
.
ZERO
);
}
else
{
}
else
{
log
.
info
(
"进行资金信息赋值"
);
log
.
info
(
"进行资金信息赋值"
);
update
.
setId
(
account
.
getId
());
update
.
setId
(
account
.
getId
());
...
@@ -758,6 +797,8 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
...
@@ -758,6 +797,8 @@ public class OwnerLoanRecordServiceImpl implements OwnerLoanRecordService {
update
.
setVirtuallyFrozenBalance
(
BigDecimal
.
ZERO
);
update
.
setVirtuallyFrozenBalance
(
BigDecimal
.
ZERO
);
update
.
setVirtuallyUsableBalance
(
BigDecimal
.
ZERO
);
update
.
setVirtuallyUsableBalance
(
BigDecimal
.
ZERO
);
update
.
setVirtuallyAccountBalance
(
BigDecimal
.
ZERO
);
update
.
setVirtuallyAccountBalance
(
BigDecimal
.
ZERO
);
update
.
setFundingArrears
(
BigDecimal
.
ZERO
);
update
.
setVirtuallyArrears
(
BigDecimal
.
ZERO
);
}
}
}
}
...
...
performance-web/src/main/java/com/clx/performance/service/impl/loan/OwnerRepaymentServiceImpl.java
浏览文件 @
99bafec2
...
@@ -15,20 +15,16 @@ import com.clx.performance.config.ClxMessageConfig;
...
@@ -15,20 +15,16 @@ import com.clx.performance.config.ClxMessageConfig;
import
com.clx.performance.config.loan.ClxPayeeConfig
;
import
com.clx.performance.config.loan.ClxPayeeConfig
;
import
com.clx.performance.config.loan.PaymentFromConfig
;
import
com.clx.performance.config.loan.PaymentFromConfig
;
import
com.clx.performance.config.nbbank.NbBankConfig
;
import
com.clx.performance.config.nbbank.NbBankConfig
;
import
com.clx.performance.dao.loan.BankTradeDao
;
import
com.clx.performance.dao.loan.*
;
import
com.clx.performance.dao.loan.OwnerLoanRecordDao
;
import
com.clx.performance.dao.loan.OwnerPaymentDao
;
import
com.clx.performance.dao.loan.OwnerRepaymentDao
;
import
com.clx.performance.enums.PerformanceResultEnum
;
import
com.clx.performance.enums.PerformanceResultEnum
;
import
com.clx.performance.enums.loan.OwnerLoanRecordEnum
;
import
com.clx.performance.enums.loan.OwnerLoanRecordEnum
;
import
com.clx.performance.enums.loan.OwnerPaymentEnum
;
import
com.clx.performance.enums.loan.OwnerPaymentEnum
;
import
com.clx.performance.enums.loan.OwnerRePaymentEnum
;
import
com.clx.performance.enums.loan.OwnerRePaymentEnum
;
import
com.clx.performance.enums.nbbank.NbBankStatusEnum
;
import
com.clx.performance.enums.nbbank.NbBankStatusEnum
;
import
com.clx.performance.event.OwnerLoanFlagEvent
;
import
com.clx.performance.event.OwnerRepaymentUpdateEvent
;
import
com.clx.performance.extranal.user.impl.OwnerInfoServiceImpl
;
import
com.clx.performance.extranal.user.impl.OwnerInfoServiceImpl
;
import
com.clx.performance.model.loan.BankTrade
;
import
com.clx.performance.model.loan.*
;
import
com.clx.performance.model.loan.OwnerLoanRecord
;
import
com.clx.performance.model.loan.OwnerPayment
;
import
com.clx.performance.model.loan.OwnerRepayment
;
import
com.clx.performance.param.pc.loan.carrier.PageCarrierOwnerRepaymentParam
;
import
com.clx.performance.param.pc.loan.carrier.PageCarrierOwnerRepaymentParam
;
import
com.clx.performance.param.pc.loan.carrier.PageOwnerRepaymentOfOwner
;
import
com.clx.performance.param.pc.loan.carrier.PageOwnerRepaymentOfOwner
;
import
com.clx.performance.param.pc.loan.owner.ExportPaymentApplicationFormParam
;
import
com.clx.performance.param.pc.loan.owner.ExportPaymentApplicationFormParam
;
...
@@ -54,9 +50,11 @@ import com.msl.user.data.UserSessionData;
...
@@ -54,9 +50,11 @@ import com.msl.user.data.UserSessionData;
import
com.msl.user.utils.TokenUtil
;
import
com.msl.user.utils.TokenUtil
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.context.ApplicationEventPublisher
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.math.BigDecimal
;
import
java.time.LocalDateTime
;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
java.util.*
;
...
@@ -84,6 +82,8 @@ public class OwnerRepaymentServiceImpl implements OwnerRepaymentService {
...
@@ -84,6 +82,8 @@ public class OwnerRepaymentServiceImpl implements OwnerRepaymentService {
private
final
IdGenerateSnowFlake
idGenerateSnowFlake
;
private
final
IdGenerateSnowFlake
idGenerateSnowFlake
;
private
final
OwnerPaymentDao
ownerPaymentDao
;
private
final
OwnerPaymentDao
ownerPaymentDao
;
private
final
OwnerLoanRecordDao
ownerLoanRecordDao
;
private
final
OwnerLoanRecordDao
ownerLoanRecordDao
;
private
final
ApplicationEventPublisher
applicationEventPublisher
;
private
final
OwnerLoanAccountDao
ownerLoanAccountDao
;
@Override
@Override
public
IPage
<
OwnerRepaymentVO
>
pageOwnerRepayment
(
PageCarrierOwnerRepaymentParam
param
)
{
public
IPage
<
OwnerRepaymentVO
>
pageOwnerRepayment
(
PageCarrierOwnerRepaymentParam
param
)
{
...
@@ -271,12 +271,40 @@ public class OwnerRepaymentServiceImpl implements OwnerRepaymentService {
...
@@ -271,12 +271,40 @@ public class OwnerRepaymentServiceImpl implements OwnerRepaymentService {
// 查询还款信息
// 查询还款信息
OwnerRepayment
ownerRepayment
=
ownerRepaymentDao
.
getOneByField
(
OwnerRepayment:
:
getRepaymentNo
,
bankTrade
.
getRelationNo
()).
get
();
OwnerRepayment
ownerRepayment
=
ownerRepaymentDao
.
getOneByField
(
OwnerRepayment:
:
getRepaymentNo
,
bankTrade
.
getRelationNo
()).
get
();
ownerRepayment
.
setStatus
(
OwnerRePaymentEnum
.
Status
.
PAY_SUCCESS
.
getCode
());
ownerRepayment
.
setStatus
(
OwnerRePaymentEnum
.
Status
.
PAY_SUCCESS
.
getCode
());
// 更新
借
款信息
// 更新
还
款信息
ownerRepaymentDao
.
updateStatusById
(
ownerRepayment
);
ownerRepaymentDao
.
updateStatusById
(
ownerRepayment
);
OwnerLoanRecord
ownerLoanRecord
=
ownerLoanRecordDao
.
getOneByField
(
OwnerLoanRecord:
:
getLoanNo
,
OwnerLoanRecord
ownerLoanRecord
=
ownerLoanRecordDao
.
getOneByField
(
OwnerLoanRecord:
:
getLoanNo
,
ownerRepayment
.
getLoanNo
()).
orElseThrow
(
PerformanceResultEnum
.
DATA_NOT_FIND
);
ownerRepayment
.
getLoanNo
()).
orElseThrow
(
PerformanceResultEnum
.
DATA_NOT_FIND
);
while
(
true
)
{
OwnerLoanAccount
ownerLoanAccount
=
ownerLoanAccountDao
.
getOneByField
(
OwnerLoanAccount:
:
getOwnerUserNo
,
ownerLoanRecord
.
getOwnerUserNo
()).
get
();
OwnerLoanAccount
entity
=
new
OwnerLoanAccount
();
if
(
OwnerLoanRecordEnum
.
LoanType
.
FUND
.
getCode
().
equals
(
ownerLoanRecord
.
getLoanType
()))
{
entity
.
setFundingArrears
(
ownerLoanRecord
.
getLoanBalance
());
entity
.
setVirtuallyArrears
(
BigDecimal
.
ZERO
);
}
else
{
entity
.
setFundingArrears
(
BigDecimal
.
ZERO
);
entity
.
setVirtuallyArrears
(
ownerLoanRecord
.
getLoanBalance
());
}
entity
.
setFundingFrozenBalance
(
BigDecimal
.
ZERO
);
entity
.
setFundingUsableBalance
(
BigDecimal
.
ZERO
);
entity
.
setFundingAccountBalance
(
BigDecimal
.
ZERO
);
entity
.
setVirtuallyFrozenBalance
(
BigDecimal
.
ZERO
);
entity
.
setVirtuallyUsableBalance
(
BigDecimal
.
ZERO
);
entity
.
setVirtuallyAccountBalance
(
BigDecimal
.
ZERO
);
entity
.
setId
(
ownerLoanAccount
.
getId
());
entity
.
setModifiedTime
(
ownerLoanAccount
.
getModifiedTime
());
Integer
flag
=
ownerLoanAccountDao
.
updateAccountCAS
(
entity
,
LocalDateTime
.
now
(),
false
);
if
(
flag
>
0
)
{
break
;
}
}
//生成付款记录
//生成付款记录
OwnerPayment
ownerPayment
=
new
OwnerPayment
();
OwnerPayment
ownerPayment
=
new
OwnerPayment
();
ownerPayment
.
setOwnerUserNo
(
ownerRepayment
.
getOwnerUserNo
());
ownerPayment
.
setOwnerUserNo
(
ownerRepayment
.
getOwnerUserNo
());
...
@@ -297,6 +325,9 @@ public class OwnerRepaymentServiceImpl implements OwnerRepaymentService {
...
@@ -297,6 +325,9 @@ public class OwnerRepaymentServiceImpl implements OwnerRepaymentService {
ownerPayment
.
setPayChannel
(
OwnerLoanRecordEnum
.
PayChannel
.
ASSET
.
getCode
());
ownerPayment
.
setPayChannel
(
OwnerLoanRecordEnum
.
PayChannel
.
ASSET
.
getCode
());
ownerPayment
.
setCreateBy
(
"系统"
);
ownerPayment
.
setCreateBy
(
"系统"
);
ownerPaymentDao
.
saveEntity
(
ownerPayment
);
ownerPaymentDao
.
saveEntity
(
ownerPayment
);
applicationEventPublisher
.
publishEvent
(
new
OwnerLoanFlagEvent
(
this
,
ownerRepayment
.
getLoanNo
()));
}
}
@Override
@Override
...
...
performance-web/src/main/java/com/clx/performance/struct/settle/SettlementDriverDetailStruct.java
浏览文件 @
99bafec2
...
@@ -13,8 +13,10 @@ import java.util.List;
...
@@ -13,8 +13,10 @@ import java.util.List;
@Mapper
(
componentModel
=
"spring"
,
uses
=
DateStructUtil
.
class
,
imports
=
{
DateUtils
.
class
})
@Mapper
(
componentModel
=
"spring"
,
uses
=
DateStructUtil
.
class
,
imports
=
{
DateUtils
.
class
})
public
interface
SettlementDriverDetailStruct
{
public
interface
SettlementDriverDetailStruct
{
@Mapping
(
target
=
"loanFlagMsg"
,
expression
=
"java(com.clx.performance.service.impl.settle.SettlementDriverDetailServiceImpl.formatLoanMsg(detail.getLoanFlag()))"
)
List
<
CarrierPageSettlementDriverDetailVO
>
covertList
(
List
<
SettlementDriverDetail
>
records
);
List
<
CarrierPageSettlementDriverDetailVO
>
covertList
(
List
<
SettlementDriverDetail
>
records
);
@Mapping
(
target
=
"loanFlagMsg"
,
expression
=
"java(com.clx.performance.enums.loan.OwnerLoanRecordEnum.LoanFlag.getMsgByCode(detail.getLoanFlag()))"
)
CarrierPageSettlementDriverDetailVO
convert
(
SettlementDriverDetail
detail
);
OrderChildSyncTransportRecord
convertRecord
(
SettlementDriverDetail
detail
);
OrderChildSyncTransportRecord
convertRecord
(
SettlementDriverDetail
detail
);
}
}
performance-web/src/main/java/com/clx/performance/struct/settle/SettlementDriverStruct.java
浏览文件 @
99bafec2
...
@@ -8,7 +8,6 @@ import org.mapstruct.IterableMapping;
...
@@ -8,7 +8,6 @@ import org.mapstruct.IterableMapping;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mapper
;
import
org.mapstruct.Mapping
;
import
org.mapstruct.Mapping
;
import
org.mapstruct.Named
;
import
org.mapstruct.Named
;
import
java.util.List
;
import
java.util.List
;
@Mapper
(
componentModel
=
"spring"
,
uses
=
DateStructUtil
.
class
,
imports
=
{
DateUtils
.
class
})
@Mapper
(
componentModel
=
"spring"
,
uses
=
DateStructUtil
.
class
,
imports
=
{
DateUtils
.
class
})
...
@@ -17,9 +16,9 @@ public interface SettlementDriverStruct {
...
@@ -17,9 +16,9 @@ public interface SettlementDriverStruct {
@Named
(
"toBaseVo"
)
@Named
(
"toBaseVo"
)
@Mapping
(
target
=
"payErrorMsg"
,
expression
=
"java(com.clx.performance.service.impl.settle.SettlementDriverServiceImpl.formatPayMsg(detail.getStatus(),detail.getPayErrorMsg()))"
)
@Mapping
(
target
=
"payErrorMsg"
,
expression
=
"java(com.clx.performance.service.impl.settle.SettlementDriverServiceImpl.formatPayMsg(detail.getStatus(),detail.getPayErrorMsg()))"
)
@Mapping
(
target
=
"loanFlagMsg"
,
expression
=
"java(com.clx.performance.enums.loan.OwnerLoanRecordEnum.LoanFlag.getMsgByCode(detail.getLoanFlag()))"
)
CarrierPageSettlementDriverVO
convert
(
SettlementDriver
detail
);
CarrierPageSettlementDriverVO
convert
(
SettlementDriver
detail
);
@Mapping
(
target
=
"loanFlagMsg"
,
expression
=
"java(com.clx.performance.service.impl.settle.SettlementDriverServiceImpl.formatLoanMsg(detail.getLoanFlag()))"
)
@IterableMapping
(
qualifiedByName
=
"toBaseVo"
)
@IterableMapping
(
qualifiedByName
=
"toBaseVo"
)
List
<
CarrierPageSettlementDriverVO
>
covertList
(
List
<
SettlementDriver
>
records
);
List
<
CarrierPageSettlementDriverVO
>
covertList
(
List
<
SettlementDriver
>
records
);
}
}
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论