Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-csf
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xingmin
yd-csf
Commits
42ec1c40
Commit
42ec1c40
authored
Jan 06, 2026
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
前端对接问题修复65
parent
159d3d14
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
177 additions
and
98 deletions
+177
-98
yd-csf-api/src/main/java/com/yd/csf/api/controller/ApiExpectedFortuneController.java
+1
-1
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiExpectedFortuneServiceImpl.java
+14
-20
yd-csf-feign/src/main/java/com/yd/csf/feign/request/expectedfortune/ExpectedFortuneUpdateRequest.java
+0
-6
yd-csf-feign/src/main/java/com/yd/csf/feign/response/expectedfortune/ApiExpectedFortunePageResponse.java
+26
-8
yd-csf-service/src/main/java/com/yd/csf/service/model/ExpectedFortune.java
+7
-1
yd-csf-service/src/main/java/com/yd/csf/service/service/IExpectedFortuneService.java
+2
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CommissionServiceImpl.java
+1
-3
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/ExpectedFortuneServiceImpl.java
+19
-12
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneServiceImpl.java
+84
-23
yd-csf-service/src/main/java/com/yd/csf/service/vo/ExpectedFortuneExportDTO.java
+23
-24
No files found.
yd-csf-api/src/main/java/com/yd/csf/api/controller/ApiExpectedFortuneController.java
View file @
42ec1c40
...
...
@@ -135,7 +135,7 @@ public class ApiExpectedFortuneController implements ApiExpectedFortuneFeignClie
* @return
*/
@PostMapping
(
"/update"
)
@Operation
(
summary
=
"
更新保单发佣
信息"
)
@Operation
(
summary
=
"
修改出账
信息"
)
public
Result
<
Boolean
>
update
(
@RequestBody
ExpectedFortuneUpdateRequest
request
)
{
if
(
request
==
null
||
request
.
getExpectedFortuneBizId
()
==
null
)
{
return
Result
.
fail
(
ErrorCode
.
PARAMS_ERROR
.
getCode
(),
ErrorCode
.
PARAMS_ERROR
.
getMessage
());
...
...
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiExpectedFortuneServiceImpl.java
View file @
42ec1c40
...
...
@@ -466,7 +466,7 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
true
);
Array
List
<
ExpectedFortune
>
fortuneList
=
new
ArrayList
<>();
List
<
ExpectedFortune
>
fortuneList
=
new
ArrayList
<>();
for
(
ExpectedFortuneAddRequest
expectedFortuneDto
:
fortuneAddRequestList
)
{
ExpectedFortune
expectedFortune
=
new
ExpectedFortune
();
BeanUtil
.
copyProperties
(
expectedFortuneDto
,
expectedFortune
);
...
...
@@ -475,6 +475,11 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
expectedFortune
.
setExpectedFortuneBizId
(
RandomStringGenerator
.
generateBizId16
(
CommonEnum
.
UID_TYPE_EXPECTED_FORTUNE
.
getCode
()));
// 应付款编号
expectedFortune
.
setPayableNo
(
this
.
createPayableNo
(
expectedFortune
.
getFortuneBizType
(),
latest
));
// 已出帐金额、待出帐金额、已出帐比例、待出帐比例
expectedFortune
.
setPaidAmount
(
BigDecimal
.
ZERO
);
expectedFortune
.
setUnpaidAmount
(
expectedFortune
.
getAmount
());
expectedFortune
.
setPaidRatio
(
BigDecimal
.
ZERO
);
expectedFortune
.
setUnpaidRatio
(
BigDecimal
.
valueOf
(
100
));
fortuneList
.
add
(
expectedFortune
);
}
iExpectedFortuneService
.
saveOrUpdateBatch
(
fortuneList
);
...
...
@@ -486,26 +491,11 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
// 查询数据
QueryWrapper
<
ExpectedFortune
>
queryWrapper
=
this
.
getQueryWrapper
(
request
);
List
<
ExpectedFortune
>
fortuneList
=
iExpectedFortuneService
.
list
(
queryWrapper
);
// 关联保单信息
List
<
Policy
>
policyList
=
policyService
.
lambdaQuery
()
.
in
(
Policy:
:
getPolicyNo
,
fortuneList
.
stream
().
map
(
ExpectedFortune:
:
getPolicyNo
).
collect
(
Collectors
.
toList
()))
.
list
();
Map
<
String
,
Policy
>
policyMap
=
policyList
.
stream
()
.
collect
(
Collectors
.
toMap
(
Policy:
:
getPolicyNo
,
Function
.
identity
()));
// 先转换为VO, VO 补充了关联信息(产品计划、产品险种、保险公司、用户)
List
<
ApiExpectedFortunePageResponse
>
expectedFortuneVOList
=
iExpectedFortuneService
.
toVOList
(
fortuneList
);
// 转换为导出DTO
List
<
ExpectedFortuneExportDTO
>
exportDataList
=
fortuneList
.
stream
()
.
map
(
fortune
->
{
ExpectedFortuneExportDTO
dto
=
ExpectedFortuneExportDTO
.
convertToExportDTO
(
fortune
);
// 关联保单信息
Policy
policy
=
policyMap
.
get
(
fortune
.
getPolicyNo
());
if
(!
Objects
.
isNull
(
policy
))
{
dto
.
setInsuranceCompany
(
policy
.
getInsuranceCompany
());
dto
.
setProductName
(
policy
.
getProductName
());
}
return
dto
;
})
List
<
ExpectedFortuneExportDTO
>
exportDataList
=
expectedFortuneVOList
.
stream
()
.
map
(
ExpectedFortuneExportDTO:
:
convertToExportDTO
)
.
collect
(
Collectors
.
toList
());
// 使用EasyExcel导出
...
...
@@ -659,6 +649,10 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
if
(
expectedFortune
==
null
)
{
throw
new
BusinessException
(
ResultCode
.
NULL_ERROR
.
getCode
(),
"预计发佣数据不存在"
);
}
if
(
expectedFortune
.
getPaidAmount
().
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
throw
new
BusinessException
(
ResultCode
.
FAIL
.
getCode
(),
"当前应付款已有出账金额,不能修改"
);
}
ExpectedFortune
updateExpectedFortune
=
new
ExpectedFortune
();
BeanUtils
.
copyProperties
(
request
,
updateExpectedFortune
);
updateExpectedFortune
.
setId
(
expectedFortune
.
getId
());
...
...
yd-csf-feign/src/main/java/com/yd/csf/feign/request/expectedfortune/ExpectedFortuneUpdateRequest.java
View file @
42ec1c40
...
...
@@ -54,12 +54,6 @@ public class ExpectedFortuneUpdateRequest {
private
String
statusDesc
;
/**
* 当前出账金额
*/
@Schema
(
description
=
"当前出账金额"
)
private
BigDecimal
currentPaymentAmount
;
/**
* 出账项目
*/
@Schema
(
description
=
"出账项目"
)
...
...
yd-csf-feign/src/main/java/com/yd/csf/feign/response/expectedfortune/ApiExpectedFortunePageResponse.java
View file @
42ec1c40
...
...
@@ -54,33 +54,39 @@ public class ApiExpectedFortunePageResponse {
private
String
insuranceCompanyBizId
;
/**
* 保险公司
*/
@Schema
(
description
=
"保险公司"
)
private
String
insuranceCompany
;
/**
* 产品计划 ID
*/
@Schema
(
description
=
"产品计划 ID"
)
private
String
productLaunchBizId
;
/**
*
保单信息
*
产品计划
*/
@Schema
(
description
=
"
policy info
"
)
private
PolicyInfo
policy
;
@Schema
(
description
=
"
产品计划
"
)
private
String
productName
;
/**
* 出账期数(1=第一年; 2=第二年; 3=第三年; 4=第四年; 5=第五年)
*/
@Schema
(
description
=
"
fortune period
"
)
@Schema
(
description
=
"
出账期数
"
)
private
Integer
fortunePeriod
;
/**
* 总期数
*/
@Schema
(
description
=
"
fortune total period
"
)
@Schema
(
description
=
"
总期数
"
)
private
Integer
fortuneTotalPeriod
;
/**
* 转介人
名称
* 转介人
*/
@Schema
(
description
=
"转介人
名称
"
)
@Schema
(
description
=
"转介人"
)
private
String
broker
;
/**
...
...
@@ -194,9 +200,21 @@ public class ApiExpectedFortunePageResponse {
private
String
ruleItemBizId
;
/**
* 备注
*/
@Schema
(
description
=
"备注"
)
private
String
remark
;
/**
* 创建时间
*/
@Schema
(
description
=
"
create time
"
)
@Schema
(
description
=
"
创建时间
"
)
private
LocalDateTime
createTime
;
/**
* 更新时间
*/
@Schema
(
description
=
"更新时间"
)
private
LocalDateTime
updateTime
;
}
yd-csf-service/src/main/java/com/yd/csf/service/model/ExpectedFortune.java
View file @
42ec1c40
...
...
@@ -191,12 +191,18 @@ public class ExpectedFortune implements Serializable {
private
BigDecimal
unpaidAmount
;
/**
*
发佣比例 已发佣金额/应发佣
金额
*
已出账比例 已出账金额/应出账
金额
*/
@TableField
(
"paid_ratio"
)
private
BigDecimal
paidRatio
;
/**
* 待出账比例
*/
@TableField
(
"unpaid_ratio"
)
private
BigDecimal
unpaidRatio
;
/**
* 是否含税 0=No, 1=Yes
*/
@TableField
(
"is_tax"
)
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/IExpectedFortuneService.java
View file @
42ec1c40
...
...
@@ -32,4 +32,6 @@ public interface IExpectedFortuneService extends IService<ExpectedFortune> {
ExpectedFortuneStatisticsVO
getStatistics
(
List
<
Long
>
expectedFortuneIds
);
IPage
<
ApiExpectedFortunePageResponse
>
getVOPage
(
IPage
<
ExpectedFortune
>
iPage
);
List
<
ApiExpectedFortunePageResponse
>
toVOList
(
List
<
ExpectedFortune
>
fortuneList
);
}
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CommissionServiceImpl.java
View file @
42ec1c40
...
...
@@ -455,9 +455,6 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
public
Boolean
generateFortune
(
GenerateFortuneRequest
generateFortuneRequest
)
{
List
<
String
>
commissionBizIdList
=
generateFortuneRequest
.
getCommissionBizIdList
();
List
<
Commission
>
commissions
=
this
.
lambdaQuery
().
in
(
Commission:
:
getCommissionBizId
,
commissionBizIdList
).
list
();
// 根据保单号,期数建立映射关系
Map
<
String
,
Commission
>
policyNoPeriodMap
=
commissions
.
stream
()
.
collect
(
Collectors
.
toMap
(
i
->
i
.
getPolicyNo
()
+
"_"
+
i
.
getCommissionPeriod
(),
commission
->
commission
));
// 校验来佣记录是否存在
if
(
CollectionUtils
.
isEmpty
(
commissions
))
{
...
...
@@ -585,6 +582,7 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
fortune
.
setFortuneBizId
(
RandomStringGenerator
.
generateBizId16
(
CommonEnum
.
UID_TYPE_FORTUNE
.
getCode
()));
fortune
.
setFortuneBizType
(
"R"
);
fortune
.
setAmount
(
expectedFortune
.
getAmount
());
fortune
.
setCurrentPaymentAmount
(
expectedFortune
.
getAmount
());
fortune
.
setExpectedFortuneBizId
(
expectedFortune
.
getExpectedFortuneBizId
());
fortune
.
setStatus
(
FortuneStatusEnum
.
CAN_SEND
.
getItemValue
());
fortune
.
setIsPart
(
0
);
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/ExpectedFortuneServiceImpl.java
View file @
42ec1c40
...
...
@@ -77,25 +77,32 @@ public class ExpectedFortuneServiceImpl extends ServiceImpl<ExpectedFortuneMappe
if
(
CollUtil
.
isEmpty
(
expectedFortuneList
))
{
return
expectedFortuneVOPage
;
}
// 查询关联的保单信息
List
<
String
>
policyNoList
=
expectedFortuneList
.
stream
().
map
(
ExpectedFortune:
:
getPolicyNo
).
collect
(
Collectors
.
toList
());
QueryWrapper
<
Policy
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
in
(
"policy_no"
,
policyNoList
);
List
<
Policy
>
policyInfoList
=
policyService
.
list
(
queryWrapper
);
Map
<
String
,
Policy
>
policyMap
=
policyInfoList
.
stream
().
collect
(
Collectors
.
toMap
(
Policy:
:
getPolicyNo
,
Function
.
identity
()));
List
<
ApiExpectedFortunePageResponse
>
expectedFortuneVOList
=
toVOList
(
expectedFortuneList
);
expectedFortuneVOPage
.
setRecords
(
expectedFortuneVOList
);
return
expectedFortuneVOPage
;
}
@Override
public
List
<
ApiExpectedFortunePageResponse
>
toVOList
(
List
<
ExpectedFortune
>
expectedFortuneList
)
{
// 关联保单信息
List
<
Policy
>
policyList
=
policyService
.
lambdaQuery
()
.
in
(
Policy:
:
getPolicyNo
,
expectedFortuneList
.
stream
().
map
(
ExpectedFortune:
:
getPolicyNo
).
collect
(
Collectors
.
toList
()))
.
list
();
Map
<
String
,
Policy
>
policyMap
=
policyList
.
stream
()
.
collect
(
Collectors
.
toMap
(
Policy:
:
getPolicyNo
,
Function
.
identity
()));
List
<
ApiExpectedFortunePageResponse
>
expectedFortuneVOList
=
expectedFortuneList
.
stream
().
map
(
expectedFortune
->
{
ApiExpectedFortunePageResponse
expectedFortuneVO
=
new
ApiExpectedFortunePageResponse
();
BeanUtils
.
copyProperties
(
expectedFortune
,
expectedFortuneVO
);
if
(
policyMap
.
get
(
expectedFortune
.
getPolicyNo
())
!=
null
)
{
PolicyInfo
policyInfo
=
new
PolicyInfo
();
BeanUtils
.
copyProperties
(
policyMap
.
get
(
expectedFortune
.
getPolicyNo
()),
policyInfo
);
expectedFortuneVO
.
setPolicy
(
policyInfo
);
Policy
policy
=
policyMap
.
get
(
expectedFortune
.
getPolicyNo
());
if
(
policy
!=
null
)
{
expectedFortuneVO
.
setInsuranceCompany
(
policy
.
getInsuranceCompany
());
expectedFortuneVO
.
setProductName
(
policy
.
getProductName
());
expectedFortuneVO
.
setPremium
(
policy
.
getPaymentPremium
());
}
return
expectedFortuneVO
;
}).
collect
(
Collectors
.
toList
());
expectedFortuneVOPage
.
setRecords
(
expectedFortuneVOList
);
return
expectedFortuneVOPage
;
return
expectedFortuneVOList
;
}
}
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneServiceImpl.java
View file @
42ec1c40
...
...
@@ -32,6 +32,7 @@ import javax.servlet.http.HttpServletResponse;
import
java.io.IOException
;
import
java.io.UnsupportedEncodingException
;
import
java.math.BigDecimal
;
import
java.math.RoundingMode
;
import
java.net.URLEncoder
;
import
java.time.LocalDate
;
import
java.time.format.DateTimeFormatter
;
...
...
@@ -178,43 +179,103 @@ public class FortuneServiceImpl extends ServiceImpl<FortuneMapper, Fortune>
if
(
expectedFortune
==
null
)
{
throw
new
BusinessException
(
ResultCode
.
NULL_ERROR
.
getCode
(),
"预计出账数据不存在"
);
}
// 如果是部分出账,新增一条待出账的实际出账记录(fortune)
BigDecimal
currentPaymentAmount
=
fortuneUpdateRequest
.
getCurrentPaymentAmount
();
if
(
currentPaymentAmount
!=
null
&&
currentPaymentAmount
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
&&
currentPaymentAmount
.
compareTo
(
expectedFortune
.
getAmount
())
<
0
)
{
Fortune
newFortune
=
new
Fortune
();
BeanUtils
.
copyProperties
(
fortune
,
newFortune
,
"id"
,
"fortuneBizId"
);
newFortune
.
setAmount
(
expectedFortune
.
getAmount
());
newFortune
.
setCurrentPaymentAmount
(
expectedFortune
.
getAmount
().
subtract
(
currentPaymentAmount
));
newFortune
.
setStatus
(
FortuneStatusEnum
.
WAIT
.
getItemValue
());
newFortune
.
setFortuneBizId
(
RandomStringGenerator
.
generateBizId16
(
CommonEnum
.
UID_TYPE_FORTUNE
.
getCode
()));
newFortune
.
setExpectedFortuneBizId
(
expectedFortune
.
getExpectedFortuneBizId
());
newFortune
.
setIsPart
(
1
);
// 设置预计出账日期为次月
newFortune
.
setPayoutDate
(
calculateReconciliationYearMonth
(
fortune
));
this
.
save
(
newFortune
);
if
(
currentPaymentAmount
!=
null
)
{
if
(
currentPaymentAmount
.
compareTo
(
BigDecimal
.
ZERO
)
<
0
)
{
throw
new
BusinessException
(
ResultCode
.
PARAM_CHECK_ERROR
.
getCode
(),
"出账金额不能小于0"
);
}
if
(
currentPaymentAmount
.
compareTo
(
expectedFortune
.
getAmount
())
>
0
)
{
throw
new
BusinessException
(
ResultCode
.
PARAM_CHECK_ERROR
.
getCode
(),
"出账金额不能大于应付款金额"
);
}
}
BeanUtils
.
copyProperties
(
fortuneUpdateRequest
,
fortune
,
"id"
,
"fortuneBizId"
,
"expectedFortuneBizId"
,
"commissionBizId"
);
// 获取当前登录用户
AuthUserDto
currentLoginUser
=
SecurityUtil
.
getCurrentLoginUser
();
String
loginUserId
=
currentLoginUser
.
getId
().
toString
();
// 更新预计出账状态
expectedFortune
.
setStatus
(
fortuneUpdateRequest
.
getStatus
());
expectedFortuneService
.
updateById
(
expectedFortune
);
// 如果传入了金额
if
(
currentPaymentAmount
!=
null
)
{
splitFortune
(
fortune
,
currentPaymentAmount
,
loginUserId
,
fortuneUpdateRequest
);
}
else
{
// 如果未传入金额,仅更新预计出账状态为已出帐
expectedFortuneService
.
lambdaUpdate
()
.
set
(
ExpectedFortune:
:
getStatus
,
fortuneUpdateRequest
.
getStatus
())
.
eq
(
ExpectedFortune:
:
getId
,
expectedFortune
.
getId
())
.
update
();
// 统一更新实际出账数据
BeanUtils
.
copyProperties
(
fortuneUpdateRequest
,
fortune
,
"id"
,
"fortuneBizId"
,
"expectedFortuneBizId"
,
"commissionBizId"
);
// 更新实际出账数据
fortune
.
setUpdaterId
(
loginUserId
);
fortune
.
setUpdateTime
(
new
Date
());
return
this
.
updateById
(
fortune
);
this
.
updateById
(
fortune
);
}
return
true
;
}
private
LocalDate
calculateReconciliationYearMonth
(
Fortune
fortune
)
{
// 设置预计出账日期为次月
return
LocalDate
.
now
().
plusMonths
(
1
);
/**
* 拆分发放(按本次发放金额拆)
*/
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
splitFortune
(
Fortune
main
,
BigDecimal
currentPaymentAmount
,
String
loginUserId
,
FortuneUpdateRequest
fortuneUpdateRequest
)
{
if
(
currentPaymentAmount
==
null
||
currentPaymentAmount
.
compareTo
(
BigDecimal
.
ZERO
)
<=
0
)
throw
new
BusinessException
(
"本次发放金额必须大于0"
);
if
(!
main
.
getStatus
().
equals
(
FortuneStatusEnum
.
CAN_SEND
.
getItemValue
()))
throw
new
BusinessException
(
"只有可出账记录才能修改金额"
);
BigDecimal
fullAmount
=
main
.
getAmount
();
if
(
currentPaymentAmount
.
compareTo
(
main
.
getCurrentPaymentAmount
())
>
0
)
throw
new
BusinessException
(
"本次发放金额不能大于可出账金额"
);
// 1. 更新主行 = 本次发放金额
main
.
setCurrentPaymentAmount
(
currentPaymentAmount
);
main
.
setStatus
(
FortuneStatusEnum
.
CHECKED
.
getItemValue
());
main
.
setUpdaterId
(
loginUserId
);
main
.
setUpdateTime
(
new
Date
());
// 其他字段更新
if
(
StringUtils
.
isNotBlank
(
fortuneUpdateRequest
.
getCurrency
()))
{
main
.
setCurrency
(
fortuneUpdateRequest
.
getCurrency
());
}
this
.
updateById
(
main
);
// 2. 剩余金额生成新行
BigDecimal
leftAmount
=
fullAmount
.
subtract
(
currentPaymentAmount
);
if
(
leftAmount
.
compareTo
(
BigDecimal
.
ZERO
)
>
0
)
{
Fortune
part
=
new
Fortune
();
BeanUtils
.
copyProperties
(
main
,
part
,
"id"
,
"fortuneBizId"
,
"currentPaymentAmount"
,
"status"
,
"isPart"
,
"payoutDate"
);
part
.
setFortuneBizId
(
RandomStringGenerator
.
generateBizId16
(
CommonEnum
.
UID_TYPE_FORTUNE
.
getCode
()));
part
.
setCurrentPaymentAmount
(
leftAmount
);
part
.
setStatus
(
FortuneStatusEnum
.
WAIT
.
getItemValue
());
part
.
setIsPart
(
1
);
part
.
setPayoutDate
(
LocalDate
.
now
().
plusMonths
(
1
));
// 次月
part
.
setCreatorId
(
loginUserId
);
part
.
setCreateTime
(
new
Date
());
this
.
save
(
part
);
}
// 3. 同步 expected_fortune
ExpectedFortune
ef
=
expectedFortuneService
.
lambdaQuery
()
.
eq
(
ExpectedFortune:
:
getExpectedFortuneBizId
,
main
.
getExpectedFortuneBizId
())
.
one
();
if
(
ef
==
null
)
return
;
BigDecimal
newPaid
=
ef
.
getPaidAmount
().
add
(
currentPaymentAmount
);
BigDecimal
newUnpaid
=
ef
.
getAmount
().
subtract
(
newPaid
);
String
newStatus
=
newUnpaid
.
compareTo
(
BigDecimal
.
ZERO
)
==
0
?
"6"
:
"3"
;
expectedFortuneService
.
lambdaUpdate
()
.
set
(
ExpectedFortune:
:
getPaidAmount
,
newPaid
)
.
set
(
ExpectedFortune:
:
getUnpaidAmount
,
newUnpaid
)
.
set
(
ExpectedFortune:
:
getPaidRatio
,
newPaid
.
divide
(
ef
.
getAmount
(),
4
,
RoundingMode
.
HALF_UP
).
multiply
(
BigDecimal
.
valueOf
(
100
)))
.
set
(
ExpectedFortune:
:
getUnpaidRatio
,
newUnpaid
.
divide
(
ef
.
getAmount
(),
4
,
RoundingMode
.
HALF_UP
).
multiply
(
BigDecimal
.
valueOf
(
100
)))
.
set
(
ExpectedFortune:
:
getStatus
,
newStatus
)
.
eq
(
ExpectedFortune:
:
getId
,
ef
.
getId
())
.
update
();
}
@Override
...
...
yd-csf-service/src/main/java/com/yd/csf/service/vo/ExpectedFortuneExportDTO.java
View file @
42ec1c40
...
...
@@ -6,6 +6,7 @@ import com.alibaba.excel.annotation.format.DateTimeFormat;
import
com.alibaba.excel.annotation.write.style.ColumnWidth
;
import
com.alibaba.excel.annotation.write.style.ContentRowHeight
;
import
com.alibaba.excel.annotation.write.style.HeadRowHeight
;
import
com.yd.csf.feign.response.expectedfortune.ApiExpectedFortunePageResponse
;
import
com.yd.csf.service.enums.FortuneStatusEnum
;
import
com.yd.csf.service.model.ExpectedFortune
;
import
lombok.Data
;
...
...
@@ -111,31 +112,29 @@ public class ExpectedFortuneExportDTO {
/**
* 将对象转换为导出DTO
*/
public
static
ExpectedFortuneExportDTO
convertToExportDTO
(
ExpectedFortune
expectedFortune
)
{
public
static
ExpectedFortuneExportDTO
convertToExportDTO
(
ApiExpectedFortunePageResponse
vo
)
{
ExpectedFortuneExportDTO
dto
=
new
ExpectedFortuneExportDTO
();
dto
.
setExpectedFortuneBizId
(
expectedFortune
.
getExpectedFortuneBizId
());
dto
.
setPayableNo
(
expectedFortune
.
getPayableNo
());
dto
.
setFortuneBizType
(
"R"
.
equals
(
expectedFortune
.
getFortuneBizType
())
?
"关联保单应付款"
:
"非关联保单应付款"
);
dto
.
setPolicyNo
(
expectedFortune
.
getPolicyNo
());
dto
.
setPremium
(
expectedFortune
.
getPremium
());
dto
.
setFortunePeriod
(
expectedFortune
.
getFortunePeriod
());
dto
.
setFortuneTotalPeriod
(
expectedFortune
.
getFortuneTotalPeriod
());
dto
.
setBroker
(
expectedFortune
.
getBroker
());
dto
.
setTeam
(
expectedFortune
.
getTeam
());
dto
.
setFortuneName
(
expectedFortune
.
getFortuneName
());
dto
.
setBrokerRatio
(
expectedFortune
.
getBrokerRatio
());
dto
.
setAmount
(
expectedFortune
.
getAmount
());
dto
.
setCurrency
(
expectedFortune
.
getCurrency
());
dto
.
setStatus
(
getStatusText
(
expectedFortune
.
getStatus
()));
dto
.
setStatusDesc
(
expectedFortune
.
getStatusDesc
());
dto
.
setPayoutDate
(
Convert
.
toDate
(
expectedFortune
.
getPayoutDate
()));
dto
.
setActualPayoutDate
(
Convert
.
toDate
(
expectedFortune
.
getActualPayoutDate
()));
dto
.
setPaidAmount
(
expectedFortune
.
getPaidAmount
());
dto
.
setUnpaidAmount
(
expectedFortune
.
getUnpaidAmount
());
dto
.
setPaidRatio
(
expectedFortune
.
getPaidRatio
());
dto
.
setRemark
(
expectedFortune
.
getRemark
());
dto
.
setCreateTime
(
expectedFortune
.
getCreateTime
());
dto
.
setUpdateTime
(
expectedFortune
.
getUpdateTime
());
dto
.
setExpectedFortuneBizId
(
vo
.
getExpectedFortuneBizId
());
dto
.
setPayableNo
(
vo
.
getPayableNo
());
dto
.
setFortuneBizType
(
"R"
.
equals
(
vo
.
getFortuneBizType
())
?
"关联保单应付款"
:
"非关联保单应付款"
);
dto
.
setPolicyNo
(
vo
.
getPolicyNo
());
dto
.
setPremium
(
vo
.
getPremium
());
dto
.
setFortunePeriod
(
vo
.
getFortunePeriod
());
dto
.
setFortuneTotalPeriod
(
vo
.
getFortuneTotalPeriod
());
dto
.
setBroker
(
vo
.
getBroker
());
dto
.
setTeam
(
vo
.
getTeam
());
dto
.
setFortuneName
(
vo
.
getFortuneName
());
dto
.
setBrokerRatio
(
vo
.
getBrokerRatio
());
dto
.
setAmount
(
vo
.
getAmount
());
dto
.
setCurrency
(
vo
.
getCurrency
());
dto
.
setStatus
(
getStatusText
(
vo
.
getStatus
()));
dto
.
setStatusDesc
(
vo
.
getStatusDesc
());
dto
.
setPayoutDate
(
Convert
.
toDate
(
vo
.
getPayoutDate
()));
dto
.
setActualPayoutDate
(
Convert
.
toDate
(
vo
.
getActualPayoutDate
()));
dto
.
setPaidAmount
(
vo
.
getPaidAmount
());
dto
.
setUnpaidAmount
(
vo
.
getUnpaidAmount
());
dto
.
setPaidRatio
(
vo
.
getPaidRatio
());
dto
.
setRemark
(
vo
.
getRemark
());
return
dto
;
}
...
...
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