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
8295b567
Commit
8295b567
authored
Jan 29, 2026
by
zhangxingmin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/test' into test
parents
b7891caa
d75b431a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
70 additions
and
14 deletions
+70
-14
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiAppointmentServiceImpl.java
+1
-1
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiExpectedFortuneServiceImpl.java
+61
-2
yd-csf-service/src/main/java/com/yd/csf/service/model/Fortune.java
+1
-1
yd-csf-service/src/main/java/com/yd/csf/service/model/PolicyFollow.java
+1
-1
yd-csf-service/src/main/java/com/yd/csf/service/service/CommissionService.java
+2
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CommissionExpectedServiceImpl.java
+1
-7
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CommissionServiceImpl.java
+2
-1
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneAccountServiceImpl.java
+1
-1
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneServiceImpl.java
+0
-0
No files found.
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiAppointmentServiceImpl.java
View file @
8295b567
...
...
@@ -717,7 +717,7 @@ public class ApiAppointmentServiceImpl implements ApiAppointmentService {
follow
.
setPolicyCurrency
(
apiProductPlanMainInfoDto
.
getPolicyCurrency
());
// 供款年期
if
(
StringUtils
.
isNotBlank
(
apiProductPlanMainInfoDto
.
getIssueNumber
()))
{
follow
.
setIssueNumber
(
Integer
.
parseInt
(
apiProductPlanMainInfoDto
.
getIssueNumber
()
));
follow
.
setIssueNumber
(
apiProductPlanMainInfoDto
.
getIssueNumber
(
));
}
// 保障期限
if
(
StringUtils
.
isNotBlank
(
apiProductPlanMainInfoDto
.
getGuaranteePeriod
()))
{
...
...
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiExpectedFortuneServiceImpl.java
View file @
8295b567
package
com
.
yd
.
csf
.
api
.
service
.
impl
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollUtil
;
import
com.alibaba.excel.EasyExcel
;
import
com.alibaba.excel.ExcelWriter
;
import
com.alibaba.excel.write.metadata.WriteSheet
;
...
...
@@ -20,6 +21,7 @@ import com.yd.csf.api.dto.*;
import
com.yd.csf.api.service.ApiBasicLawCalculateService
;
import
com.yd.csf.api.service.ApiExpectedFortuneLogService
;
import
com.yd.csf.api.service.ApiExpectedFortuneService
;
import
com.yd.csf.feign.dto.appointmentfile.ItineraryDto
;
import
com.yd.csf.feign.request.expectedfortune.*
;
import
com.yd.csf.feign.response.expectedfortune.ApiExpectedFortunePageResponse
;
import
com.yd.csf.feign.response.expectedfortune.ApiGenerateExpectedFortuneResponse
;
...
...
@@ -29,6 +31,7 @@ import com.yd.csf.service.dto.QueryPolicyBrokerDto;
import
com.yd.csf.service.enums.FortuneStatusEnum
;
import
com.yd.csf.service.model.CommissionRuleBinding
;
import
com.yd.csf.service.model.ExpectedFortune
;
import
com.yd.csf.service.model.Policy
;
import
com.yd.csf.service.model.PolicyBroker
;
import
com.yd.csf.service.service.ICommissionRuleBindingService
;
import
com.yd.csf.service.service.IExpectedFortuneService
;
...
...
@@ -59,6 +62,7 @@ import java.math.RoundingMode;
import
java.time.LocalDate
;
import
java.time.LocalDateTime
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
@Slf4j
...
...
@@ -302,7 +306,7 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
}
}
}
//批量设置应付款编号
//批量设置应付款编号
、发佣类型
updatePayableNoBatch
(
policyNo
);
//执行成功完毕,也要销毁redis缓存
...
...
@@ -409,6 +413,9 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
//查询当前保单号的所有预计发佣记录
List
<
ExpectedFortune
>
expectedFortuneList
=
iExpectedFortuneService
.
queryList
(
policyNo
);
//查询redis缓存的字典列表信息
List
<
GetDictItemListByDictTypeResponse
>
dictTypeResponses
=
redisUtil
.
getCacheObject
(
RedisConstants
.
DICT_LIST
);
//获取当前序号作为起点
int
currentSeq
=
0
;
if
(!
Objects
.
isNull
(
latest
))
{
...
...
@@ -416,8 +423,12 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
}
//批量更新应付款编号,每个item递增
ExpectedFortune
expectedFortune
;
for
(
int
i
=
0
;
i
<
expectedFortuneList
.
size
();
i
++)
{
expectedFortuneList
.
get
(
i
).
setPayableNo
(
this
.
createPayableNo
(
"R"
,
currentSeq
+
i
+
1
));
expectedFortune
=
expectedFortuneList
.
get
(
i
);
expectedFortune
.
setPayableNo
(
this
.
createPayableNo
(
"R"
,
currentSeq
+
i
+
1
));
expectedFortune
.
setFortuneType
(
GetDictItemListByDictTypeResponse
.
getItemValue
(
dictTypeResponses
,
"csf_fortune_type"
,
expectedFortune
.
getFortuneName
()));
}
iExpectedFortuneService
.
updateBatchById
(
expectedFortuneList
);
}
...
...
@@ -670,6 +681,18 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
}
validateAdd
(
fortuneAddRequestList
);
// 查询保单信息
Set
<
String
>
policyNoSet
=
fortuneAddRequestList
.
stream
()
.
map
(
ExpectedFortuneAddRequest:
:
getPolicyNo
)
.
filter
(
StringUtils:
:
isNotBlank
).
collect
(
Collectors
.
toSet
());
Map
<
String
,
Policy
>
policyMap
=
new
HashMap
<>();
if
(
CollUtil
.
isNotEmpty
(
policyNoSet
))
{
List
<
Policy
>
policyList
=
policyService
.
lambdaQuery
().
in
(
Policy:
:
getPolicyNo
,
policyNoSet
).
list
();
// 保单映射
policyMap
=
policyList
.
stream
().
collect
(
Collectors
.
toMap
(
Policy:
:
getPolicyNo
,
Function
.
identity
()));
}
// 查询最新一条有 payableNo 记录
ExpectedFortune
latest
=
iExpectedFortuneService
.
getOne
(
new
QueryWrapper
<
ExpectedFortune
>().
isNotNull
(
"payable_no"
).
orderByDesc
(
"id"
).
last
(
"LIMIT 1"
),
...
...
@@ -686,8 +709,23 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
ExpectedFortune
expectedFortune
=
new
ExpectedFortune
();
BeanUtil
.
copyProperties
(
expectedFortuneDto
,
expectedFortune
);
if
(
"R"
.
equals
(
expectedFortuneDto
.
getFortuneBizType
()))
{
Policy
policy
=
policyMap
.
get
(
expectedFortuneDto
.
getPolicyNo
());
if
(
ObjectUtils
.
isEmpty
(
policy
))
{
throw
new
BusinessException
(
ResultCode
.
PARAMS_ERROR
.
getCode
(),
"保单号为"
+
expectedFortuneDto
.
getPolicyNo
()
+
"的保单不存在"
);
}
// 设置关联字段
expectedFortune
.
setInsuranceCompanyBizId
(
policy
.
getInsuranceCompanyBizId
());
expectedFortune
.
setProductLaunchBizId
(
policy
.
getProductLaunchBizId
());
expectedFortune
.
setPremium
(
policy
.
getPaymentPremium
());
expectedFortune
.
setPolicyCurrency
(
policy
.
getCurrency
());
}
// 预计发佣业务id
expectedFortune
.
setExpectedFortuneBizId
(
RandomStringGenerator
.
generateBizId16
(
CommonEnum
.
UID_TYPE_EXPECTED_FORTUNE
.
getCode
()));
// 预计发佣类型名称
expectedFortune
.
setFortuneName
(
queryByDict
(
expectedFortuneDto
.
getFortuneType
()));
// 应付款编号(序号递增)
expectedFortune
.
setPayableNo
(
this
.
createPayableNo
(
expectedFortune
.
getFortuneBizType
(),
++
currentSeq
));
// 默认结算汇率
...
...
@@ -696,6 +734,8 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
expectedFortune
.
setHkdAmount
(
expectedFortune
.
getAmount
().
multiply
(
expectedFortune
.
getDefaultExchangeRate
()));
// 已出帐金额、待出帐金额、已出帐比例、待出帐比例
expectedFortune
.
setPaidAmount
(
BigDecimal
.
ZERO
);
// 转介人比例默认100%
expectedFortune
.
setBrokerRatio
(
"100"
);
expectedFortune
.
setUnpaidAmount
(
expectedFortune
.
getAmount
());
expectedFortune
.
setPaidRatio
(
BigDecimal
.
ZERO
);
expectedFortune
.
setUnpaidRatio
(
BigDecimal
.
valueOf
(
100
));
...
...
@@ -705,6 +745,25 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
return
true
;
}
private
String
queryByDict
(
String
fortuneType
)
{
//查询redis缓存的字典列表信息
List
<
GetDictItemListByDictTypeResponse
>
dictTypeResponses
=
redisUtil
.
getCacheObject
(
RedisConstants
.
DICT_LIST
);
String
fortuneName
=
GetDictItemListByDictTypeResponse
.
getItemLabel
(
dictTypeResponses
,
"csf_fortune_type"
,
fortuneType
);
if
(
ObjectUtils
.
isNotEmpty
(
fortuneName
))
{
return
fortuneName
;
}
Result
<
List
<
GetDictItemListByDictTypeResponse
>>
result
=
apiSysDictFeignClient
.
getDictItemListByDictType
(
"csf_fortune_type"
);
if
(
ObjectUtils
.
isNotEmpty
(
result
.
getData
()))
{
for
(
GetDictItemListByDictTypeResponse
dictItem
:
result
.
getData
())
{
if
(
StringUtils
.
equalsIgnoreCase
(
dictItem
.
getItemValue
(),
fortuneType
))
{
return
dictItem
.
getItemLabel
();
}
}
}
return
null
;
}
private
BigDecimal
queryDefaultExchangeRate
(
String
currency
)
{
if
(
"HKD"
.
equalsIgnoreCase
(
currency
))
{
return
BigDecimal
.
valueOf
(
1
);
...
...
yd-csf-service/src/main/java/com/yd/csf/service/model/Fortune.java
View file @
8295b567
...
...
@@ -171,7 +171,7 @@ public class Fortune implements Serializable {
/**
* 实际出账日期
*/
private
Local
Date
actualPayoutDate
;
private
Date
actualPayoutDate
;
/**
* 检核人
...
...
yd-csf-service/src/main/java/com/yd/csf/service/model/PolicyFollow.java
View file @
8295b567
...
...
@@ -138,7 +138,7 @@ public class PolicyFollow implements Serializable {
/**
* 供款年期
*/
private
Integer
issueNumber
;
private
Object
issueNumber
;
/**
* 保障期限
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/CommissionService.java
View file @
8295b567
...
...
@@ -32,6 +32,8 @@ public interface CommissionService extends IService<Commission> {
Boolean
generateFortune
(
GenerateFortuneRequest
generateFortuneRequest
);
String
buildPolicyPeriodKey
(
String
policyNo
,
Object
period
);
Commission
getByCommissionBizId
(
String
commissionBizId
);
List
<
Commission
>
queryList
(
CommissionDto
dto
);
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CommissionExpectedServiceImpl.java
View file @
8295b567
...
...
@@ -255,22 +255,16 @@ public class CommissionExpectedServiceImpl extends ServiceImpl<CommissionExpecte
}
validateAddCommissionExpected
(
addDtoList
);
// 查询保单信息
、保单产品信息
// 查询保单信息
Set
<
String
>
policyNoSet
=
addDtoList
.
stream
()
.
map
(
CommissionExpectedAddDto:
:
getPolicyNo
)
.
filter
(
StringUtils:
:
isNotBlank
).
collect
(
Collectors
.
toSet
());
Map
<
String
,
Policy
>
policyMap
=
new
HashMap
<>();
Map
<
String
,
PolicyProductInfo
>
policyProductInfoMap
=
new
HashMap
<>();
if
(
CollUtil
.
isNotEmpty
(
policyNoSet
))
{
List
<
Policy
>
policyList
=
policyService
.
lambdaQuery
().
in
(
Policy:
:
getPolicyNo
,
policyNoSet
).
list
();
// 保单映射
policyMap
=
policyList
.
stream
().
collect
(
Collectors
.
toMap
(
Policy:
:
getPolicyNo
,
Function
.
identity
()));
// 关联查询保单产品信息
Set
<
String
>
productLaunchBizIdSet
=
policyList
.
stream
()
.
map
(
Policy:
:
getProductLaunchBizId
)
.
collect
(
Collectors
.
toSet
());
// policyProductInfoMap = policyService.getPolicyProductInfoMap(productLaunchBizIdSet);
}
List
<
CommissionExpected
>
addList
=
new
ArrayList
<>();
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/CommissionServiceImpl.java
View file @
8295b567
...
...
@@ -726,7 +726,8 @@ public class CommissionServiceImpl extends ServiceImpl<CommissionMapper, Commiss
/**
* 构建保单号+期次的唯一键
*/
private
String
buildPolicyPeriodKey
(
String
policyNo
,
Object
period
)
{
@Override
public
String
buildPolicyPeriodKey
(
String
policyNo
,
Object
period
)
{
return
(
policyNo
==
null
?
""
:
policyNo
)
+
"|"
+
(
period
==
null
?
""
:
period
.
toString
());
}
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneAccountServiceImpl.java
View file @
8295b567
...
...
@@ -284,7 +284,7 @@ public class FortuneAccountServiceImpl extends ServiceImpl<FortuneAccountMapper,
if
(
CollectionUtils
.
isNotEmpty
(
fortunes
))
{
fortunes
.
forEach
(
f
->
{
f
.
setStatus
(
FortuneStatusEnum
.
SENT
.
getItemValue
());
f
.
setActualPayoutDate
(
LocalDate
.
now
());
f
.
setActualPayoutDate
(
new
Date
());
f
.
setUpdaterId
(
loginUserId
.
toString
());
f
.
setUpdateTime
(
new
Date
());
});
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/FortuneServiceImpl.java
View file @
8295b567
This diff is collapsed.
Click to expand it.
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